diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index 9f7cb40aae7f..7273d0c6e905 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -1353,6 +1353,13 @@ pom import + + com.google.cloud + google-cloud-sql-bom + 0.1.0-SNAPSHOT + pom + import + com.google.cloud google-cloud-storage-bom diff --git a/java-sql/.repo-metadata.json b/java-sql/.repo-metadata.json new file mode 100644 index 000000000000..9e2f67bb5f72 --- /dev/null +++ b/java-sql/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "api_shortname": "sqladmin", + "name_pretty": "Cloud SQL Admin", + "product_documentation": "", + "api_description": "Cloud SQL Admin API", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-sql/latest/overview", + "release_level": "preview", + "transport": "grpc+rest", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-sql", + "distribution_name": "com.google.cloud:google-cloud-sql", + "api_id": "sqladmin.googleapis.com", + "library_type": "GAPIC_AUTO" +} \ No newline at end of file diff --git a/java-sql/README.md b/java-sql/README.md new file mode 100644 index 000000000000..a54bdb855c50 --- /dev/null +++ b/java-sql/README.md @@ -0,0 +1,210 @@ +# Google Cloud SQL Admin Client for Java + +Java idiomatic client for [Cloud SQL Admin][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.83.0 + pom + import + + + + + + + com.google.cloud + google-cloud-sql + + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + +```xml + + com.google.cloud + google-cloud-sql + 0.0.0 + +``` + +If you are using Gradle 5.x or later, add this to your dependencies: + +```Groovy +implementation platform('com.google.cloud:libraries-bom:26.83.0') + +implementation 'com.google.cloud:google-cloud-sql' +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-sql:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-sql" % "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 Cloud SQL Admin APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Cloud SQL Admin API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Cloud SQL Admin [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Cloud SQL Admin. +[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-sql` library. See the [Quickstart](#quickstart) section +to add `google-cloud-sql` as a dependency in your code. + +## About Cloud SQL Admin + + +[Cloud SQL Admin][product-docs] Cloud SQL Admin API + +See the [Cloud SQL Admin client library docs][javadocs] to learn how to +use this Cloud SQL Admin Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Cloud SQL Admin uses both gRPC and 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/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-sql/latest/overview +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-sql.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-sql/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=sqladmin.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-sql/google-cloud-sql-bom/pom.xml b/java-sql/google-cloud-sql-bom/pom.xml new file mode 100644 index 000000000000..a82fd7287540 --- /dev/null +++ b/java-sql/google-cloud-sql-bom/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + com.google.cloud + google-cloud-sql-bom + 0.1.0-SNAPSHOT + pom + + com.google.cloud + google-cloud-pom-parent + 1.89.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Cloud SQL Admin BOM + + BOM for Cloud SQL Admin + + + + true + + + + + + + com.google.cloud + google-cloud-sql + 0.1.0-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-sql-v1 + 0.1.0-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-sql-v1beta4 + 0.1.0-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-sql-v1 + 0.1.0-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-sql-v1beta4 + 0.1.0-SNAPSHOT + + + + + \ No newline at end of file diff --git a/java-sql/google-cloud-sql/pom.xml b/java-sql/google-cloud-sql/pom.xml new file mode 100644 index 000000000000..f45b26e0b7a1 --- /dev/null +++ b/java-sql/google-cloud-sql/pom.xml @@ -0,0 +1,126 @@ + + + 4.0.0 + com.google.cloud + google-cloud-sql + 0.1.0-SNAPSHOT + jar + Google Cloud SQL Admin + Cloud SQL Admin Cloud SQL Admin API + + com.google.cloud + google-cloud-sql-parent + 0.1.0-SNAPSHOT + + + google-cloud-sql + + + + 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-sql-v1 + + + com.google.api.grpc + proto-google-cloud-sql-v1beta4 + + + + 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.grpc + grpc-google-cloud-sql-v1 + test + + + com.google.api.grpc + grpc-google-cloud-sql-v1beta4 + test + + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + \ No newline at end of file diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsServiceClient.java new file mode 100644 index 000000000000..6d15a37b20ae --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsServiceClient.java @@ -0,0 +1,508 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.stub.SqlBackupRunsServiceStub; +import com.google.cloud.sql.v1.stub.SqlBackupRunsServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for managing database backups. + * + *

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 (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+ *     SqlBackupRunsServiceClient.create()) {
+ *   SqlBackupRunsDeleteRequest request =
+ *       SqlBackupRunsDeleteRequest.newBuilder()
+ *           .setId(3355)
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlBackupRunsServiceClient.delete(request);
+ * }
+ * }
+ * + *

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

Delete

Deletes the backup taken by a backup run.

+ *

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

+ *
    + *
  • delete(SqlBackupRunsDeleteRequest request) + *

+ *

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

+ *
    + *
  • deleteCallable() + *

+ *

Get

Retrieves a resource containing information about a backup run.

+ *

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

+ *
    + *
  • get(SqlBackupRunsGetRequest request) + *

+ *

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

+ *
    + *
  • getCallable() + *

+ *

Insert

Creates a new backup run on demand.

+ *

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

+ *
    + *
  • insert(SqlBackupRunsInsertRequest request) + *

+ *

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

+ *
    + *
  • insertCallable() + *

+ *

List

Lists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.

+ *

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

+ *
    + *
  • list(SqlBackupRunsListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *
+ * + *

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 SqlBackupRunsServiceSettings + * 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
+ * SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings =
+ *     SqlBackupRunsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+ *     SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings);
+ * }
+ * + *

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
+ * SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings =
+ *     SqlBackupRunsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+ *     SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings =
+ *     SqlBackupRunsServiceSettings.newHttpJsonBuilder().build();
+ * SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+ *     SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlBackupRunsServiceClient implements BackgroundResource { + private final @Nullable SqlBackupRunsServiceSettings settings; + private final SqlBackupRunsServiceStub stub; + + /** Constructs an instance of SqlBackupRunsServiceClient with default settings. */ + public static final SqlBackupRunsServiceClient create() throws IOException { + return create(SqlBackupRunsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlBackupRunsServiceClient, 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 SqlBackupRunsServiceClient create(SqlBackupRunsServiceSettings settings) + throws IOException { + return new SqlBackupRunsServiceClient(settings); + } + + /** + * Constructs an instance of SqlBackupRunsServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(SqlBackupRunsServiceSettings). + */ + public static final SqlBackupRunsServiceClient create(SqlBackupRunsServiceStub stub) { + return new SqlBackupRunsServiceClient(stub); + } + + /** + * Constructs an instance of SqlBackupRunsServiceClient, 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 SqlBackupRunsServiceClient(SqlBackupRunsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlBackupRunsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlBackupRunsServiceClient(SqlBackupRunsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlBackupRunsServiceSettings getSettings() { + return settings; + } + + public SqlBackupRunsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the backup taken by a backup run. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsDeleteRequest request =
+   *       SqlBackupRunsDeleteRequest.newBuilder()
+   *           .setId(3355)
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlBackupRunsServiceClient.delete(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 Operation delete(SqlBackupRunsDeleteRequest request) { + return deleteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the backup taken by a backup run. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsDeleteRequest request =
+   *       SqlBackupRunsDeleteRequest.newBuilder()
+   *           .setId(3355)
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlBackupRunsServiceClient.deleteCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCallable() { + return stub.deleteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a backup run. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsGetRequest request =
+   *       SqlBackupRunsGetRequest.newBuilder()
+   *           .setId(3355)
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   BackupRun response = sqlBackupRunsServiceClient.get(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 BackupRun get(SqlBackupRunsGetRequest request) { + return getCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a backup run. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsGetRequest request =
+   *       SqlBackupRunsGetRequest.newBuilder()
+   *           .setId(3355)
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlBackupRunsServiceClient.getCallable().futureCall(request);
+   *   // Do something.
+   *   BackupRun response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCallable() { + return stub.getCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new backup run on demand. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsInsertRequest request =
+   *       SqlBackupRunsInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(BackupRun.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlBackupRunsServiceClient.insert(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 Operation insert(SqlBackupRunsInsertRequest request) { + return insertCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new backup run on demand. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsInsertRequest request =
+   *       SqlBackupRunsInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(BackupRun.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlBackupRunsServiceClient.insertCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable insertCallable() { + return stub.insertCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backup runs associated with the project or a given instance and configuration in the + * reverse chronological order of the backup initiation time. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsListRequest request =
+   *       SqlBackupRunsListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setMaxResults(1128457243)
+   *           .setPageToken("pageToken873572522")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   BackupRunsListResponse response = sqlBackupRunsServiceClient.list(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 BackupRunsListResponse list(SqlBackupRunsListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backup runs associated with the project or a given instance and configuration in the + * reverse chronological order of the backup initiation time. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsListRequest request =
+   *       SqlBackupRunsListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setMaxResults(1128457243)
+   *           .setPageToken("pageToken873572522")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlBackupRunsServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   BackupRunsListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsServiceSettings.java new file mode 100644 index 000000000000..d5528442d4e4 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsServiceSettings.java @@ -0,0 +1,251 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1.stub.SqlBackupRunsServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlBackupRunsServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlBackupRunsServiceSettings.Builder sqlBackupRunsServiceSettingsBuilder =
+ *     SqlBackupRunsServiceSettings.newBuilder();
+ * sqlBackupRunsServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlBackupRunsServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings =
+ *     sqlBackupRunsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlBackupRunsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return ((SqlBackupRunsServiceStubSettings) getStubSettings()).deleteSettings(); + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return ((SqlBackupRunsServiceStubSettings) getStubSettings()).getSettings(); + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return ((SqlBackupRunsServiceStubSettings) getStubSettings()).insertSettings(); + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlBackupRunsServiceStubSettings) getStubSettings()).listSettings(); + } + + public static final SqlBackupRunsServiceSettings create(SqlBackupRunsServiceStubSettings stub) + throws IOException { + return new SqlBackupRunsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlBackupRunsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlBackupRunsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlBackupRunsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlBackupRunsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlBackupRunsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlBackupRunsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlBackupRunsServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlBackupRunsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlBackupRunsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlBackupRunsServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlBackupRunsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlBackupRunsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlBackupRunsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlBackupRunsServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlBackupRunsServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlBackupRunsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlBackupRunsServiceStubSettings.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 delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return getStubSettingsBuilder().deleteSettings(); + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getStubSettingsBuilder().getSettings(); + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return getStubSettingsBuilder().insertSettings(); + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + @Override + public SqlBackupRunsServiceSettings build() throws IOException { + return new SqlBackupRunsServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlBackupsServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlBackupsServiceClient.java new file mode 100644 index 000000000000..8abe39d2e935 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlBackupsServiceClient.java @@ -0,0 +1,979 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.stub.SqlBackupsServiceStub; +import com.google.cloud.sql.v1.stub.SqlBackupsServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   Backup backup = Backup.newBuilder().build();
+ *   Operation response = sqlBackupsServiceClient.createBackup(parent, backup);
+ * }
+ * }
+ * + *

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

CreateBackup

Creates a backup for a Cloud SQL instance. This API can be used only to create on-demand backups.

+ *

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

+ *
    + *
  • createBackup(CreateBackupRequest request) + *

+ *

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

+ *
    + *
  • createBackup(ProjectName parent, Backup backup) + *

  • createBackup(String parent, Backup backup) + *

+ *

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

+ *
    + *
  • createBackupCallable() + *

+ *

GetBackup

Retrieves a resource containing information about a backup.

+ *

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

+ *
    + *
  • getBackup(GetBackupRequest request) + *

+ *

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

+ *
    + *
  • getBackup(BackupName name) + *

  • getBackup(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.

+ *
    + *
  • getBackupCallable() + *

+ *

ListBackups

Lists all backups associated with the project.

+ *

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

+ *
    + *
  • listBackups(ListBackupsRequest request) + *

+ *

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

+ *
    + *
  • listBackups(ProjectName parent) + *

  • listBackups(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.

+ *
    + *
  • listBackupsPagedCallable() + *

  • listBackupsCallable() + *

+ *

UpdateBackup

Updates the retention period and description of the backup. You can use this API to update final backups only.

+ *

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

+ *
    + *
  • updateBackup(UpdateBackupRequest request) + *

+ *

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

+ *
    + *
  • updateBackup(Backup backup, 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.

+ *
    + *
  • updateBackupCallable() + *

+ *

DeleteBackup

Deletes the backup.

+ *

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

+ *
    + *
  • deleteBackup(DeleteBackupRequest request) + *

+ *

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

+ *
    + *
  • deleteBackup(BackupName name) + *

  • deleteBackup(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.

+ *
    + *
  • deleteBackupCallable() + *

+ *
+ * + *

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 SqlBackupsServiceSettings 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
+ * SqlBackupsServiceSettings sqlBackupsServiceSettings =
+ *     SqlBackupsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlBackupsServiceClient sqlBackupsServiceClient =
+ *     SqlBackupsServiceClient.create(sqlBackupsServiceSettings);
+ * }
+ * + *

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
+ * SqlBackupsServiceSettings sqlBackupsServiceSettings =
+ *     SqlBackupsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlBackupsServiceClient sqlBackupsServiceClient =
+ *     SqlBackupsServiceClient.create(sqlBackupsServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlBackupsServiceSettings sqlBackupsServiceSettings =
+ *     SqlBackupsServiceSettings.newHttpJsonBuilder().build();
+ * SqlBackupsServiceClient sqlBackupsServiceClient =
+ *     SqlBackupsServiceClient.create(sqlBackupsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlBackupsServiceClient implements BackgroundResource { + private final @Nullable SqlBackupsServiceSettings settings; + private final SqlBackupsServiceStub stub; + + /** Constructs an instance of SqlBackupsServiceClient with default settings. */ + public static final SqlBackupsServiceClient create() throws IOException { + return create(SqlBackupsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlBackupsServiceClient, 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 SqlBackupsServiceClient create(SqlBackupsServiceSettings settings) + throws IOException { + return new SqlBackupsServiceClient(settings); + } + + /** + * Constructs an instance of SqlBackupsServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(SqlBackupsServiceSettings). + */ + public static final SqlBackupsServiceClient create(SqlBackupsServiceStub stub) { + return new SqlBackupsServiceClient(stub); + } + + /** + * Constructs an instance of SqlBackupsServiceClient, 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 SqlBackupsServiceClient(SqlBackupsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlBackupsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlBackupsServiceClient(SqlBackupsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlBackupsServiceSettings getSettings() { + return settings; + } + + public SqlBackupsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup for a Cloud SQL instance. This API can be used only to create on-demand + * backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Backup backup = Backup.newBuilder().build();
+   *   Operation response = sqlBackupsServiceClient.createBackup(parent, backup);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this backup is created. Format: + * projects/{project} + * @param backup Required. The Backup to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation createBackup(@Nullable ProjectName parent, Backup backup) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBackup(backup) + .build(); + return createBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup for a Cloud SQL instance. This API can be used only to create on-demand + * backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   Backup backup = Backup.newBuilder().build();
+   *   Operation response = sqlBackupsServiceClient.createBackup(parent, backup);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this backup is created. Format: + * projects/{project} + * @param backup Required. The Backup to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation createBackup(String parent, Backup backup) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder().setParent(parent).setBackup(backup).build(); + return createBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup for a Cloud SQL instance. This API can be used only to create on-demand + * backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlBackupsServiceClient.createBackup(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 Operation createBackup(CreateBackupRequest request) { + return createBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup for a Cloud SQL instance. This API can be used only to create on-demand + * backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlBackupsServiceClient.createBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createBackupCallable() { + return stub.createBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[BACKUP]");
+   *   Backup response = sqlBackupsServiceClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. The name of the backup to retrieve. Format: + * projects/{project}/backups/{backup} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(@Nullable BackupName name) { + GetBackupRequest request = + GetBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[BACKUP]").toString();
+   *   Backup response = sqlBackupsServiceClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. The name of the backup to retrieve. Format: + * projects/{project}/backups/{backup} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(String name) { + GetBackupRequest request = GetBackupRequest.newBuilder().setName(name).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString())
+   *           .build();
+   *   Backup response = sqlBackupsServiceClient.getBackup(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(GetBackupRequest request) { + return getBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString())
+   *           .build();
+   *   ApiFuture future = sqlBackupsServiceClient.getBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getBackupCallable() { + return stub.getBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups associated with the project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (Backup element : sqlBackupsServiceClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent that owns this collection of backups. Format: + * projects/{project} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(@Nullable ProjectName parent) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups associated with the project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   for (Backup element : sqlBackupsServiceClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent that owns this collection of backups. Format: + * projects/{project} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(String parent) { + ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups associated with the project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (Backup element : sqlBackupsServiceClient.listBackups(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) { + return listBackupsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups associated with the project. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListBackupsResponse response = sqlBackupsServiceClient.listBackupsCallable().call(request);
+   *     for (Backup element : response.getBackupsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listBackupsCallable() { + return stub.listBackupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the retention period and description of the backup. You can use this API to update + * final backups only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   Backup backup = Backup.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Operation response = sqlBackupsServiceClient.updateBackup(backup, updateMask);
+   * }
+   * }
+ * + * @param backup Required. The backup to update. The backup’s `name` field is used to identify the + * backup to update. Format: projects/{project}/backups/{backup} + * @param updateMask The list of fields that you can update. You can update only the description + * and retention period of the final backup. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation updateBackup(Backup backup, FieldMask updateMask) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder().setBackup(backup).setUpdateMask(updateMask).build(); + return updateBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the retention period and description of the backup. You can use this API to update + * final backups only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlBackupsServiceClient.updateBackup(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 Operation updateBackup(UpdateBackupRequest request) { + return updateBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the retention period and description of the backup. You can use this API to update + * final backups only. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[BACKUP]");
+   *   Operation response = sqlBackupsServiceClient.deleteBackup(name);
+   * }
+   * }
+ * + * @param name Required. The name of the backup to delete. Format: + * projects/{project}/backups/{backup} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation deleteBackup(@Nullable BackupName name) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[BACKUP]").toString();
+   *   Operation response = sqlBackupsServiceClient.deleteBackup(name);
+   * }
+   * }
+ * + * @param name Required. The name of the backup to delete. Format: + * projects/{project}/backups/{backup} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation deleteBackup(String name) { + DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build(); + return deleteBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString())
+   *           .build();
+   *   Operation response = sqlBackupsServiceClient.deleteBackup(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 Operation deleteBackup(DeleteBackupRequest request) { + return deleteBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlBackupsServiceClient.deleteBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteBackupCallable() { + return stub.deleteBackupCallable(); + } + + @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 ListBackupsPagedResponse + extends AbstractPagedListResponse< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBackupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListBackupsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListBackupsPagedResponse(ListBackupsPage page) { + super(page, ListBackupsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBackupsPage + extends AbstractPage { + + private ListBackupsPage( + @Nullable PageContext context, + @Nullable ListBackupsResponse response) { + super(context, response); + } + + private static ListBackupsPage createEmptyPage() { + return new ListBackupsPage(null, null); + } + + @Override + protected ListBackupsPage createPage( + @Nullable PageContext context, + @Nullable ListBackupsResponse response) { + return new ListBackupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + @Nullable PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBackupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + private ListBackupsFixedSizeCollection( + @Nullable List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBackupsFixedSizeCollection createEmptyCollection() { + return new ListBackupsFixedSizeCollection(null, 0); + } + + @Override + protected ListBackupsFixedSizeCollection createCollection( + @Nullable List pages, int collectionSize) { + return new ListBackupsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlBackupsServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlBackupsServiceSettings.java new file mode 100644 index 000000000000..2135a2be542b --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlBackupsServiceSettings.java @@ -0,0 +1,264 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import static com.google.cloud.sql.v1.SqlBackupsServiceClient.ListBackupsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1.stub.SqlBackupsServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlBackupsServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 createBackup: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlBackupsServiceSettings.Builder sqlBackupsServiceSettingsBuilder =
+ *     SqlBackupsServiceSettings.newBuilder();
+ * sqlBackupsServiceSettingsBuilder
+ *     .createBackupSettings()
+ *     .setRetrySettings(
+ *         sqlBackupsServiceSettingsBuilder
+ *             .createBackupSettings()
+ *             .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());
+ * SqlBackupsServiceSettings sqlBackupsServiceSettings = sqlBackupsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlBackupsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return ((SqlBackupsServiceStubSettings) getStubSettings()).createBackupSettings(); + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return ((SqlBackupsServiceStubSettings) getStubSettings()).getBackupSettings(); + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return ((SqlBackupsServiceStubSettings) getStubSettings()).listBackupsSettings(); + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return ((SqlBackupsServiceStubSettings) getStubSettings()).updateBackupSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return ((SqlBackupsServiceStubSettings) getStubSettings()).deleteBackupSettings(); + } + + public static final SqlBackupsServiceSettings create(SqlBackupsServiceStubSettings stub) + throws IOException { + return new SqlBackupsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlBackupsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlBackupsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlBackupsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlBackupsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlBackupsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlBackupsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlBackupsServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlBackupsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlBackupsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlBackupsServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlBackupsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlBackupsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlBackupsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlBackupsServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlBackupsServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlBackupsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlBackupsServiceStubSettings.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 createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return getStubSettingsBuilder().createBackupSettings(); + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getStubSettingsBuilder().getBackupSettings(); + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return getStubSettingsBuilder().listBackupsSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return getStubSettingsBuilder().updateBackupSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return getStubSettingsBuilder().deleteBackupSettings(); + } + + @Override + public SqlBackupsServiceSettings build() throws IOException { + return new SqlBackupsServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlConnectServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlConnectServiceClient.java new file mode 100644 index 000000000000..dfcd0186fbea --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlConnectServiceClient.java @@ -0,0 +1,437 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.stub.SqlConnectServiceStub; +import com.google.cloud.sql.v1.stub.SqlConnectServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Cloud SQL connect service. + * + *

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 (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+ *   GetConnectSettingsRequest request =
+ *       GetConnectSettingsRequest.newBuilder()
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .setReadTime(Timestamp.newBuilder().build())
+ *           .build();
+ *   ConnectSettings response = sqlConnectServiceClient.getConnectSettings(request);
+ * }
+ * }
+ * + *

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

GetConnectSettings

Retrieves connect settings about a Cloud SQL instance.

+ *

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

+ *
    + *
  • getConnectSettings(GetConnectSettingsRequest request) + *

+ *

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

+ *
    + *
  • getConnectSettingsCallable() + *

+ *

ResolveConnectSettings

Retrieves connect settings about a Cloud SQL instance using the instance DNS name.

+ *

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

+ *
    + *
  • resolveConnectSettings(ResolveConnectSettingsRequest request) + *

+ *

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

+ *
    + *
  • resolveConnectSettingsCallable() + *

+ *

GenerateEphemeralCert

Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.

+ *

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

+ *
    + *
  • generateEphemeralCert(GenerateEphemeralCertRequest request) + *

+ *

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

+ *
    + *
  • generateEphemeralCertCallable() + *

+ *
+ * + *

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 SqlConnectServiceSettings 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
+ * SqlConnectServiceSettings sqlConnectServiceSettings =
+ *     SqlConnectServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlConnectServiceClient sqlConnectServiceClient =
+ *     SqlConnectServiceClient.create(sqlConnectServiceSettings);
+ * }
+ * + *

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
+ * SqlConnectServiceSettings sqlConnectServiceSettings =
+ *     SqlConnectServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlConnectServiceClient sqlConnectServiceClient =
+ *     SqlConnectServiceClient.create(sqlConnectServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlConnectServiceSettings sqlConnectServiceSettings =
+ *     SqlConnectServiceSettings.newHttpJsonBuilder().build();
+ * SqlConnectServiceClient sqlConnectServiceClient =
+ *     SqlConnectServiceClient.create(sqlConnectServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlConnectServiceClient implements BackgroundResource { + private final @Nullable SqlConnectServiceSettings settings; + private final SqlConnectServiceStub stub; + + /** Constructs an instance of SqlConnectServiceClient with default settings. */ + public static final SqlConnectServiceClient create() throws IOException { + return create(SqlConnectServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlConnectServiceClient, 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 SqlConnectServiceClient create(SqlConnectServiceSettings settings) + throws IOException { + return new SqlConnectServiceClient(settings); + } + + /** + * Constructs an instance of SqlConnectServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(SqlConnectServiceSettings). + */ + public static final SqlConnectServiceClient create(SqlConnectServiceStub stub) { + return new SqlConnectServiceClient(stub); + } + + /** + * Constructs an instance of SqlConnectServiceClient, 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 SqlConnectServiceClient(SqlConnectServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlConnectServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlConnectServiceClient(SqlConnectServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlConnectServiceSettings getSettings() { + return settings; + } + + public SqlConnectServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves connect settings about a Cloud SQL 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 (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+   *   GetConnectSettingsRequest request =
+   *       GetConnectSettingsRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setReadTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ConnectSettings response = sqlConnectServiceClient.getConnectSettings(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 ConnectSettings getConnectSettings(GetConnectSettingsRequest request) { + return getConnectSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves connect settings about a Cloud SQL 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 (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+   *   GetConnectSettingsRequest request =
+   *       GetConnectSettingsRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setReadTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlConnectServiceClient.getConnectSettingsCallable().futureCall(request);
+   *   // Do something.
+   *   ConnectSettings response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getConnectSettingsCallable() { + return stub.getConnectSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves connect settings about a Cloud SQL instance using the instance DNS name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+   *   ResolveConnectSettingsRequest request =
+   *       ResolveConnectSettingsRequest.newBuilder()
+   *           .setDnsName("dnsName1813886804")
+   *           .setLocation("location1901043637")
+   *           .build();
+   *   ConnectSettings response = sqlConnectServiceClient.resolveConnectSettings(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 ConnectSettings resolveConnectSettings(ResolveConnectSettingsRequest request) { + return resolveConnectSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves connect settings about a Cloud SQL instance using the instance DNS name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+   *   ResolveConnectSettingsRequest request =
+   *       ResolveConnectSettingsRequest.newBuilder()
+   *           .setDnsName("dnsName1813886804")
+   *           .setLocation("location1901043637")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlConnectServiceClient.resolveConnectSettingsCallable().futureCall(request);
+   *   // Do something.
+   *   ConnectSettings response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + resolveConnectSettingsCallable() { + return stub.resolveConnectSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generates a short-lived X509 certificate containing the provided public key and signed by a + * private key specific to the target instance. Users may use the certificate to authenticate as + * themselves when connecting to the database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+   *   GenerateEphemeralCertRequest request =
+   *       GenerateEphemeralCertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setPublicKey("publicKey1446899510")
+   *           .setAccessToken("accessToken-1042689291")
+   *           .setReadTime(Timestamp.newBuilder().build())
+   *           .setValidDuration(Duration.newBuilder().build())
+   *           .build();
+   *   GenerateEphemeralCertResponse response =
+   *       sqlConnectServiceClient.generateEphemeralCert(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 GenerateEphemeralCertResponse generateEphemeralCert( + GenerateEphemeralCertRequest request) { + return generateEphemeralCertCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generates a short-lived X509 certificate containing the provided public key and signed by a + * private key specific to the target instance. Users may use the certificate to authenticate as + * themselves when connecting to the database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+   *   GenerateEphemeralCertRequest request =
+   *       GenerateEphemeralCertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setPublicKey("publicKey1446899510")
+   *           .setAccessToken("accessToken-1042689291")
+   *           .setReadTime(Timestamp.newBuilder().build())
+   *           .setValidDuration(Duration.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlConnectServiceClient.generateEphemeralCertCallable().futureCall(request);
+   *   // Do something.
+   *   GenerateEphemeralCertResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + generateEphemeralCertCallable() { + return stub.generateEphemeralCertCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlConnectServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlConnectServiceSettings.java new file mode 100644 index 000000000000..092cec702915 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlConnectServiceSettings.java @@ -0,0 +1,244 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1.stub.SqlConnectServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlConnectServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 getConnectSettings: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlConnectServiceSettings.Builder sqlConnectServiceSettingsBuilder =
+ *     SqlConnectServiceSettings.newBuilder();
+ * sqlConnectServiceSettingsBuilder
+ *     .getConnectSettingsSettings()
+ *     .setRetrySettings(
+ *         sqlConnectServiceSettingsBuilder
+ *             .getConnectSettingsSettings()
+ *             .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());
+ * SqlConnectServiceSettings sqlConnectServiceSettings = sqlConnectServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlConnectServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getConnectSettings. */ + public UnaryCallSettings + getConnectSettingsSettings() { + return ((SqlConnectServiceStubSettings) getStubSettings()).getConnectSettingsSettings(); + } + + /** Returns the object with the settings used for calls to resolveConnectSettings. */ + public UnaryCallSettings + resolveConnectSettingsSettings() { + return ((SqlConnectServiceStubSettings) getStubSettings()).resolveConnectSettingsSettings(); + } + + /** Returns the object with the settings used for calls to generateEphemeralCert. */ + public UnaryCallSettings + generateEphemeralCertSettings() { + return ((SqlConnectServiceStubSettings) getStubSettings()).generateEphemeralCertSettings(); + } + + public static final SqlConnectServiceSettings create(SqlConnectServiceStubSettings stub) + throws IOException { + return new SqlConnectServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlConnectServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlConnectServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlConnectServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlConnectServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlConnectServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlConnectServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlConnectServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlConnectServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlConnectServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlConnectServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlConnectServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlConnectServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlConnectServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlConnectServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlConnectServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlConnectServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlConnectServiceStubSettings.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 getConnectSettings. */ + public UnaryCallSettings.Builder + getConnectSettingsSettings() { + return getStubSettingsBuilder().getConnectSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to resolveConnectSettings. */ + public UnaryCallSettings.Builder + resolveConnectSettingsSettings() { + return getStubSettingsBuilder().resolveConnectSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to generateEphemeralCert. */ + public UnaryCallSettings.Builder + generateEphemeralCertSettings() { + return getStubSettingsBuilder().generateEphemeralCertSettings(); + } + + @Override + public SqlConnectServiceSettings build() throws IOException { + return new SqlConnectServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlDatabasesServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlDatabasesServiceClient.java new file mode 100644 index 000000000000..40fcd38b15b3 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlDatabasesServiceClient.java @@ -0,0 +1,650 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.stub.SqlDatabasesServiceStub; +import com.google.cloud.sql.v1.stub.SqlDatabasesServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service to manage databases. + * + *

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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+ *   SqlDatabasesDeleteRequest request =
+ *       SqlDatabasesDeleteRequest.newBuilder()
+ *           .setDatabase("database1789464955")
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlDatabasesServiceClient.delete(request);
+ * }
+ * }
+ * + *

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

Delete

Deletes a database from a Cloud SQL instance.

+ *

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

+ *
    + *
  • delete(SqlDatabasesDeleteRequest request) + *

+ *

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

+ *
    + *
  • deleteCallable() + *

+ *

Get

Retrieves a resource containing information about a database inside a Cloud SQL instance.

+ *

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

+ *
    + *
  • get(SqlDatabasesGetRequest request) + *

+ *

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

+ *
    + *
  • getCallable() + *

+ *

Insert

Inserts a resource containing information about a database inside a Cloud SQL instance. + *

**Note:** You can't modify the default character set and collation.

+ *

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

+ *
    + *
  • insert(SqlDatabasesInsertRequest request) + *

+ *

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

+ *
    + *
  • insertCallable() + *

+ *

List

Lists databases in the specified Cloud SQL instance.

+ *

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

+ *
    + *
  • list(SqlDatabasesListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *

Patch

Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.

+ *

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

+ *
    + *
  • patch(SqlDatabasesUpdateRequest request) + *

+ *

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

+ *
    + *
  • patchCallable() + *

+ *

Update

Updates a resource containing information about a database inside a Cloud SQL instance.

+ *

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

+ *
    + *
  • update(SqlDatabasesUpdateRequest request) + *

+ *

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

+ *
    + *
  • updateCallable() + *

+ *
+ * + *

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 SqlDatabasesServiceSettings 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
+ * SqlDatabasesServiceSettings sqlDatabasesServiceSettings =
+ *     SqlDatabasesServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlDatabasesServiceClient sqlDatabasesServiceClient =
+ *     SqlDatabasesServiceClient.create(sqlDatabasesServiceSettings);
+ * }
+ * + *

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
+ * SqlDatabasesServiceSettings sqlDatabasesServiceSettings =
+ *     SqlDatabasesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlDatabasesServiceClient sqlDatabasesServiceClient =
+ *     SqlDatabasesServiceClient.create(sqlDatabasesServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlDatabasesServiceSettings sqlDatabasesServiceSettings =
+ *     SqlDatabasesServiceSettings.newHttpJsonBuilder().build();
+ * SqlDatabasesServiceClient sqlDatabasesServiceClient =
+ *     SqlDatabasesServiceClient.create(sqlDatabasesServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlDatabasesServiceClient implements BackgroundResource { + private final @Nullable SqlDatabasesServiceSettings settings; + private final SqlDatabasesServiceStub stub; + + /** Constructs an instance of SqlDatabasesServiceClient with default settings. */ + public static final SqlDatabasesServiceClient create() throws IOException { + return create(SqlDatabasesServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlDatabasesServiceClient, 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 SqlDatabasesServiceClient create(SqlDatabasesServiceSettings settings) + throws IOException { + return new SqlDatabasesServiceClient(settings); + } + + /** + * Constructs an instance of SqlDatabasesServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(SqlDatabasesServiceSettings). + */ + public static final SqlDatabasesServiceClient create(SqlDatabasesServiceStub stub) { + return new SqlDatabasesServiceClient(stub); + } + + /** + * Constructs an instance of SqlDatabasesServiceClient, 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 SqlDatabasesServiceClient(SqlDatabasesServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlDatabasesServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlDatabasesServiceClient(SqlDatabasesServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlDatabasesServiceSettings getSettings() { + return settings; + } + + public SqlDatabasesServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a database from a Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesDeleteRequest request =
+   *       SqlDatabasesDeleteRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlDatabasesServiceClient.delete(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 Operation delete(SqlDatabasesDeleteRequest request) { + return deleteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a database from a Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesDeleteRequest request =
+   *       SqlDatabasesDeleteRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlDatabasesServiceClient.deleteCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCallable() { + return stub.deleteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a database inside a Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesGetRequest request =
+   *       SqlDatabasesGetRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Database response = sqlDatabasesServiceClient.get(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 Database get(SqlDatabasesGetRequest request) { + return getCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a database inside a Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesGetRequest request =
+   *       SqlDatabasesGetRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlDatabasesServiceClient.getCallable().futureCall(request);
+   *   // Do something.
+   *   Database response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCallable() { + return stub.getCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Inserts a resource containing information about a database inside a Cloud SQL instance. + * + *

**Note:** You can't modify the default character set and collation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesInsertRequest request =
+   *       SqlDatabasesInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(Database.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlDatabasesServiceClient.insert(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 Operation insert(SqlDatabasesInsertRequest request) { + return insertCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Inserts a resource containing information about a database inside a Cloud SQL instance. + * + *

**Note:** You can't modify the default character set and collation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesInsertRequest request =
+   *       SqlDatabasesInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(Database.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlDatabasesServiceClient.insertCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable insertCallable() { + return stub.insertCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists databases in the specified Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesListRequest request =
+   *       SqlDatabasesListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   DatabasesListResponse response = sqlDatabasesServiceClient.list(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 DatabasesListResponse list(SqlDatabasesListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists databases in the specified Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesListRequest request =
+   *       SqlDatabasesListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlDatabasesServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   DatabasesListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates a resource containing information about a database inside a Cloud SQL + * instance. This method supports patch semantics. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesUpdateRequest request =
+   *       SqlDatabasesUpdateRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(Database.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlDatabasesServiceClient.patch(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 Operation patch(SqlDatabasesUpdateRequest request) { + return patchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates a resource containing information about a database inside a Cloud SQL + * instance. This method supports patch semantics. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesUpdateRequest request =
+   *       SqlDatabasesUpdateRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(Database.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlDatabasesServiceClient.patchCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable patchCallable() { + return stub.patchCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a resource containing information about a database inside a Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesUpdateRequest request =
+   *       SqlDatabasesUpdateRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(Database.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlDatabasesServiceClient.update(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 Operation update(SqlDatabasesUpdateRequest request) { + return updateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a resource containing information about a database inside a Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesUpdateRequest request =
+   *       SqlDatabasesUpdateRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(Database.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlDatabasesServiceClient.updateCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateCallable() { + return stub.updateCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlDatabasesServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlDatabasesServiceSettings.java new file mode 100644 index 000000000000..640a2e7a8edd --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlDatabasesServiceSettings.java @@ -0,0 +1,270 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1.stub.SqlDatabasesServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlDatabasesServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlDatabasesServiceSettings.Builder sqlDatabasesServiceSettingsBuilder =
+ *     SqlDatabasesServiceSettings.newBuilder();
+ * sqlDatabasesServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlDatabasesServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlDatabasesServiceSettings sqlDatabasesServiceSettings =
+ *     sqlDatabasesServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlDatabasesServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return ((SqlDatabasesServiceStubSettings) getStubSettings()).deleteSettings(); + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return ((SqlDatabasesServiceStubSettings) getStubSettings()).getSettings(); + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return ((SqlDatabasesServiceStubSettings) getStubSettings()).insertSettings(); + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlDatabasesServiceStubSettings) getStubSettings()).listSettings(); + } + + /** Returns the object with the settings used for calls to patch. */ + public UnaryCallSettings patchSettings() { + return ((SqlDatabasesServiceStubSettings) getStubSettings()).patchSettings(); + } + + /** Returns the object with the settings used for calls to update. */ + public UnaryCallSettings updateSettings() { + return ((SqlDatabasesServiceStubSettings) getStubSettings()).updateSettings(); + } + + public static final SqlDatabasesServiceSettings create(SqlDatabasesServiceStubSettings stub) + throws IOException { + return new SqlDatabasesServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlDatabasesServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlDatabasesServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlDatabasesServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlDatabasesServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlDatabasesServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlDatabasesServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlDatabasesServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlDatabasesServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlDatabasesServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlDatabasesServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlDatabasesServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlDatabasesServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlDatabasesServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlDatabasesServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlDatabasesServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlDatabasesServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlDatabasesServiceStubSettings.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 delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return getStubSettingsBuilder().deleteSettings(); + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getStubSettingsBuilder().getSettings(); + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return getStubSettingsBuilder().insertSettings(); + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + /** Returns the builder for the settings used for calls to patch. */ + public UnaryCallSettings.Builder patchSettings() { + return getStubSettingsBuilder().patchSettings(); + } + + /** Returns the builder for the settings used for calls to update. */ + public UnaryCallSettings.Builder updateSettings() { + return getStubSettingsBuilder().updateSettings(); + } + + @Override + public SqlDatabasesServiceSettings build() throws IOException { + return new SqlDatabasesServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlFlagsServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlFlagsServiceClient.java new file mode 100644 index 000000000000..004289484f97 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlFlagsServiceClient.java @@ -0,0 +1,273 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.stub.SqlFlagsServiceStub; +import com.google.cloud.sql.v1.stub.SqlFlagsServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service to manage database flags for Cloud SQL instances. + * + *

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 (SqlFlagsServiceClient sqlFlagsServiceClient = SqlFlagsServiceClient.create()) {
+ *   SqlFlagsListRequest request =
+ *       SqlFlagsListRequest.newBuilder()
+ *           .setDatabaseVersion("databaseVersion1250955997")
+ *           .setFlagScope(SqlFlagScope.forNumber(0))
+ *           .build();
+ *   FlagsListResponse response = sqlFlagsServiceClient.list(request);
+ * }
+ * }
+ * + *

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

List

Lists all available database flags for Cloud SQL instances.

+ *

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

+ *
    + *
  • list(SqlFlagsListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *
+ * + *

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 SqlFlagsServiceSettings 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
+ * SqlFlagsServiceSettings sqlFlagsServiceSettings =
+ *     SqlFlagsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlFlagsServiceClient sqlFlagsServiceClient =
+ *     SqlFlagsServiceClient.create(sqlFlagsServiceSettings);
+ * }
+ * + *

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
+ * SqlFlagsServiceSettings sqlFlagsServiceSettings =
+ *     SqlFlagsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlFlagsServiceClient sqlFlagsServiceClient =
+ *     SqlFlagsServiceClient.create(sqlFlagsServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlFlagsServiceSettings sqlFlagsServiceSettings =
+ *     SqlFlagsServiceSettings.newHttpJsonBuilder().build();
+ * SqlFlagsServiceClient sqlFlagsServiceClient =
+ *     SqlFlagsServiceClient.create(sqlFlagsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlFlagsServiceClient implements BackgroundResource { + private final @Nullable SqlFlagsServiceSettings settings; + private final SqlFlagsServiceStub stub; + + /** Constructs an instance of SqlFlagsServiceClient with default settings. */ + public static final SqlFlagsServiceClient create() throws IOException { + return create(SqlFlagsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlFlagsServiceClient, 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 SqlFlagsServiceClient create(SqlFlagsServiceSettings settings) + throws IOException { + return new SqlFlagsServiceClient(settings); + } + + /** + * Constructs an instance of SqlFlagsServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SqlFlagsServiceSettings). + */ + public static final SqlFlagsServiceClient create(SqlFlagsServiceStub stub) { + return new SqlFlagsServiceClient(stub); + } + + /** + * Constructs an instance of SqlFlagsServiceClient, 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 SqlFlagsServiceClient(SqlFlagsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlFlagsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlFlagsServiceClient(SqlFlagsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlFlagsServiceSettings getSettings() { + return settings; + } + + public SqlFlagsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all available database flags for Cloud SQL instances. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlFlagsServiceClient sqlFlagsServiceClient = SqlFlagsServiceClient.create()) {
+   *   SqlFlagsListRequest request =
+   *       SqlFlagsListRequest.newBuilder()
+   *           .setDatabaseVersion("databaseVersion1250955997")
+   *           .setFlagScope(SqlFlagScope.forNumber(0))
+   *           .build();
+   *   FlagsListResponse response = sqlFlagsServiceClient.list(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 FlagsListResponse list(SqlFlagsListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all available database flags for Cloud SQL instances. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlFlagsServiceClient sqlFlagsServiceClient = SqlFlagsServiceClient.create()) {
+   *   SqlFlagsListRequest request =
+   *       SqlFlagsListRequest.newBuilder()
+   *           .setDatabaseVersion("databaseVersion1250955997")
+   *           .setFlagScope(SqlFlagScope.forNumber(0))
+   *           .build();
+   *   ApiFuture future =
+   *       sqlFlagsServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   FlagsListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlFlagsServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlFlagsServiceSettings.java new file mode 100644 index 000000000000..5f011bec84d3 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlFlagsServiceSettings.java @@ -0,0 +1,218 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1.stub.SqlFlagsServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlFlagsServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 list: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlFlagsServiceSettings.Builder sqlFlagsServiceSettingsBuilder =
+ *     SqlFlagsServiceSettings.newBuilder();
+ * sqlFlagsServiceSettingsBuilder
+ *     .listSettings()
+ *     .setRetrySettings(
+ *         sqlFlagsServiceSettingsBuilder
+ *             .listSettings()
+ *             .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());
+ * SqlFlagsServiceSettings sqlFlagsServiceSettings = sqlFlagsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlFlagsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlFlagsServiceStubSettings) getStubSettings()).listSettings(); + } + + public static final SqlFlagsServiceSettings create(SqlFlagsServiceStubSettings stub) + throws IOException { + return new SqlFlagsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlFlagsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlFlagsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlFlagsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlFlagsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlFlagsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlFlagsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlFlagsServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlFlagsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlFlagsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlFlagsServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlFlagsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlFlagsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlFlagsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlFlagsServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlFlagsServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlFlagsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlFlagsServiceStubSettings.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 list. */ + public UnaryCallSettings.Builder listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + @Override + public SqlFlagsServiceSettings build() throws IOException { + return new SqlFlagsServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlInstancesServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlInstancesServiceClient.java new file mode 100644 index 000000000000..a1fa1bebd6c9 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlInstancesServiceClient.java @@ -0,0 +1,3485 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.stub.SqlInstancesServiceStub; +import com.google.cloud.sql.v1.stub.SqlInstancesServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+ *   SqlInstancesAddServerCaRequest request =
+ *       SqlInstancesAddServerCaRequest.newBuilder()
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlInstancesServiceClient.addServerCa(request);
+ * }
+ * }
+ * + *

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

AddServerCa

Adds a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in. For instances that have enabled Certificate Authority Service (CAS) based server CA, use AddServerCertificate to add a new server certificate.

+ *

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

+ *
    + *
  • addServerCa(SqlInstancesAddServerCaRequest request) + *

+ *

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

+ *
    + *
  • addServerCaCallable() + *

+ *

AddServerCertificate

Add a new trusted server certificate version for the specified instance using Certificate Authority Service (CAS) server CA. Required to prepare for a certificate rotation. If a server certificate version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one certificate version waiting to be rotated in. For instances not using CAS server CA, use AddServerCa instead.

+ *

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

+ *
    + *
  • addServerCertificate(SqlInstancesAddServerCertificateRequest request) + *

+ *

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

+ *
    + *
  • addServerCertificateCallable() + *

+ *

AddEntraIdCertificate

Adds a new Entra ID certificate for the specified instance. If an Entra ID certificate was previously added but never used in a certificate rotation, this operation replaces that version.

+ *

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

+ *
    + *
  • addEntraIdCertificate(SqlInstancesAddEntraIdCertificateRequest request) + *

+ *

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

+ *
    + *
  • addEntraIdCertificateCallable() + *

+ *

Clone

Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.

+ *

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

+ *
    + *
  • clone(SqlInstancesCloneRequest request) + *

+ *

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

+ *
    + *
  • cloneCallable() + *

+ *

Delete

Deletes a Cloud SQL instance.

+ *

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

+ *
    + *
  • delete(SqlInstancesDeleteRequest request) + *

+ *

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

+ *
    + *
  • deleteCallable() + *

+ *

DemoteMaster

Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.

+ *

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

+ *
    + *
  • demoteMaster(SqlInstancesDemoteMasterRequest request) + *

+ *

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

+ *
    + *
  • demoteMasterCallable() + *

+ *

Demote

Demotes an existing standalone instance to be a Cloud SQL read replica for an external database server.

+ *

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

+ *
    + *
  • demote(SqlInstancesDemoteRequest request) + *

+ *

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

+ *
    + *
  • demoteCallable() + *

+ *

Export

Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.

+ *

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

+ *
    + *
  • export(SqlInstancesExportRequest request) + *

+ *

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

+ *
    + *
  • exportCallable() + *

+ *

Failover

Initiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to the new primary. For more information, see the [Overview of high availability](https://cloud.google.com/sql/docs/mysql/high-availability) page in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its failover replica instance.

+ *

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

+ *
    + *
  • failover(SqlInstancesFailoverRequest request) + *

+ *

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

+ *
    + *
  • failoverCallable() + *

+ *

Reencrypt

Reencrypt CMEK instance with latest key version.

+ *

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

+ *
    + *
  • reencrypt(SqlInstancesReencryptRequest request) + *

+ *

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

+ *
    + *
  • reencryptCallable() + *

+ *

Get

Retrieves a resource containing information about a Cloud SQL instance.

+ *

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

+ *
    + *
  • get(SqlInstancesGetRequest request) + *

+ *

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

+ *
    + *
  • getCallable() + *

+ *

Import

Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.

+ *

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

+ *
    + *
  • import_(SqlInstancesImportRequest request) + *

+ *

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

+ *
    + *
  • import_Callable() + *

+ *

Insert

Creates a new Cloud SQL instance.

+ *

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

+ *
    + *
  • insert(SqlInstancesInsertRequest request) + *

+ *

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

+ *
    + *
  • insertCallable() + *

+ *

List

Lists instances under a given project.

+ *

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

+ *
    + *
  • list(SqlInstancesListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *

ListServerCas

Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out.

+ *

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

+ *
    + *
  • listServerCas(SqlInstancesListServerCasRequest request) + *

+ *

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

+ *
    + *
  • listServerCasCallable() + *

+ *

ListServerCertificates

Lists all versions of server certificates and certificate authorities (CAs) for the specified instance. There can be up to three sets of certs listed: the certificate that is currently in use, a future that has been added but not yet used to sign a certificate, and a certificate that has been rotated out. For instances not using Certificate Authority Service (CAS) server CA, use ListServerCas instead.

+ *

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

+ *
    + *
  • listServerCertificates(SqlInstancesListServerCertificatesRequest request) + *

+ *

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

+ *
    + *
  • listServerCertificatesCallable() + *

+ *

ListEntraIdCertificates

Lists all versions of EntraID certificates for the specified instance. There can be up to three sets of certificates listed: the certificate that is currently in use, a future that has been added but not yet used to sign a certificate, and a certificate that has been rotated out.

+ *

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

+ *
    + *
  • listEntraIdCertificates(SqlInstancesListEntraIdCertificatesRequest request) + *

+ *

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

+ *
    + *
  • listEntraIdCertificatesCallable() + *

+ *

Patch

Partially updates settings of a Cloud SQL instance by merging the request with the current configuration. This method supports patch semantics.

+ *

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

+ *
    + *
  • patch(SqlInstancesPatchRequest request) + *

+ *

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

+ *
    + *
  • patchCallable() + *

+ *

PromoteReplica

Promotes the read replica instance to be an independent Cloud SQL primary instance. Using this operation might cause your instance to restart.

+ *

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

+ *
    + *
  • promoteReplica(SqlInstancesPromoteReplicaRequest request) + *

+ *

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

+ *
    + *
  • promoteReplicaCallable() + *

+ *

Switchover

Switches over from the primary instance to the DR replica instance.

+ *

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

+ *
    + *
  • switchover(SqlInstancesSwitchoverRequest request) + *

+ *

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

+ *
    + *
  • switchoverCallable() + *

+ *

ResetSslConfig

Deletes all client certificates and generates a new server SSL certificate for the instance.

+ *

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

+ *
    + *
  • resetSslConfig(SqlInstancesResetSslConfigRequest request) + *

+ *

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

+ *
    + *
  • resetSslConfigCallable() + *

+ *

Restart

Restarts a Cloud SQL instance.

+ *

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

+ *
    + *
  • restart(SqlInstancesRestartRequest request) + *

+ *

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

+ *
    + *
  • restartCallable() + *

+ *

RestoreBackup

Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.

+ *

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

+ *
    + *
  • restoreBackup(SqlInstancesRestoreBackupRequest request) + *

+ *

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

+ *
    + *
  • restoreBackupCallable() + *

+ *

RotateServerCa

Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. For instances that have enabled Certificate Authority Service (CAS) based server CA, use RotateServerCertificate to rotate the server certificate.

+ *

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

+ *
    + *
  • rotateServerCa(SqlInstancesRotateServerCaRequest request) + *

+ *

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

+ *
    + *
  • rotateServerCaCallable() + *

+ *

RotateServerCertificate

Rotates the server certificate version to one previously added with the addServerCertificate method. For instances not using Certificate Authority Service (CAS) server CA, use RotateServerCa instead.

+ *

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

+ *
    + *
  • rotateServerCertificate(SqlInstancesRotateServerCertificateRequest request) + *

+ *

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

+ *
    + *
  • rotateServerCertificateCallable() + *

+ *

RotateEntraIdCertificate

Rotates the server certificate version to one previously added with the addEntraIdCertificate method.

+ *

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

+ *
    + *
  • rotateEntraIdCertificate(SqlInstancesRotateEntraIdCertificateRequest request) + *

+ *

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

+ *
    + *
  • rotateEntraIdCertificateCallable() + *

+ *

StartReplica

Starts the replication in the read replica instance.

+ *

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

+ *
    + *
  • startReplica(SqlInstancesStartReplicaRequest request) + *

+ *

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

+ *
    + *
  • startReplicaCallable() + *

+ *

StopReplica

Stops the replication in the read replica instance.

+ *

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

+ *
    + *
  • stopReplica(SqlInstancesStopReplicaRequest request) + *

+ *

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

+ *
    + *
  • stopReplicaCallable() + *

+ *

TruncateLog

Truncate MySQL general and slow query log tables MySQL only.

+ *

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

+ *
    + *
  • truncateLog(SqlInstancesTruncateLogRequest request) + *

+ *

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

+ *
    + *
  • truncateLogCallable() + *

+ *

Update

Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.

+ *

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

+ *
    + *
  • update(SqlInstancesUpdateRequest request) + *

+ *

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

+ *
    + *
  • updateCallable() + *

+ *

CreateEphemeral

Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.

+ *

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

+ *
    + *
  • createEphemeral(SqlInstancesCreateEphemeralCertRequest request) + *

+ *

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

+ *
    + *
  • createEphemeralCallable() + *

+ *

RescheduleMaintenance

Reschedules the maintenance on the given instance.

+ *

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

+ *
    + *
  • rescheduleMaintenance(SqlInstancesRescheduleMaintenanceRequest request) + *

+ *

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

+ *
    + *
  • rescheduleMaintenanceCallable() + *

+ *

VerifyExternalSyncSettings

Verify External primary instance external sync settings.

+ *

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

+ *
    + *
  • verifyExternalSyncSettings(SqlInstancesVerifyExternalSyncSettingsRequest request) + *

+ *

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

+ *
    + *
  • verifyExternalSyncSettingsCallable() + *

+ *

StartExternalSync

Start External primary instance migration.

+ *

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

+ *
    + *
  • startExternalSync(SqlInstancesStartExternalSyncRequest request) + *

+ *

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

+ *
    + *
  • startExternalSyncCallable() + *

+ *

PerformDiskShrink

Perform Disk Shrink on primary instance.

+ *

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

+ *
    + *
  • performDiskShrink(SqlInstancesPerformDiskShrinkRequest request) + *

+ *

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

+ *
    + *
  • performDiskShrinkCallable() + *

+ *

GetDiskShrinkConfig

Get Disk Shrink Config for a given instance.

+ *

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

+ *
    + *
  • getDiskShrinkConfig(SqlInstancesGetDiskShrinkConfigRequest request) + *

+ *

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

+ *
    + *
  • getDiskShrinkConfigCallable() + *

+ *

ResetReplicaSize

Reset Replica Size to primary instance disk size.

+ *

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

+ *
    + *
  • resetReplicaSize(SqlInstancesResetReplicaSizeRequest request) + *

+ *

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

+ *
    + *
  • resetReplicaSizeCallable() + *

+ *

GetLatestRecoveryTime

Get Latest Recovery Time for a given instance.

+ *

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

+ *
    + *
  • getLatestRecoveryTime(SqlInstancesGetLatestRecoveryTimeRequest request) + *

+ *

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

+ *
    + *
  • getLatestRecoveryTimeCallable() + *

+ *

ExecuteSql

Execute SQL statements.

+ *

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

+ *
    + *
  • executeSql(SqlInstancesExecuteSqlRequest request) + *

+ *

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

+ *
    + *
  • executeSqlCallable() + *

+ *

AcquireSsrsLease

Acquire a lease for the setup of SQL Server Reporting Services (SSRS).

+ *

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

+ *
    + *
  • acquireSsrsLease(SqlInstancesAcquireSsrsLeaseRequest request) + *

+ *

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

+ *
    + *
  • acquireSsrsLeaseCallable() + *

+ *

ReleaseSsrsLease

Release a lease for the setup of SQL Server Reporting Services (SSRS).

+ *

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

+ *
    + *
  • releaseSsrsLease(SqlInstancesReleaseSsrsLeaseRequest request) + *

+ *

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

+ *
    + *
  • releaseSsrsLeaseCallable() + *

+ *

PreCheckMajorVersionUpgrade

Execute MVU Pre-checks

+ *

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

+ *
    + *
  • preCheckMajorVersionUpgrade(SqlInstancesPreCheckMajorVersionUpgradeRequest request) + *

+ *

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

+ *
    + *
  • preCheckMajorVersionUpgradeCallable() + *

+ *

PointInTimeRestore

Point in time restore for an instance managed by Google Cloud Backup and Disaster Recovery.

+ *

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

+ *
    + *
  • pointInTimeRestore(SqlInstancesPointInTimeRestoreRequest request) + *

+ *

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

+ *
    + *
  • pointInTimeRestoreCallable() + *

+ *
+ * + *

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 SqlInstancesServiceSettings 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
+ * SqlInstancesServiceSettings sqlInstancesServiceSettings =
+ *     SqlInstancesServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlInstancesServiceClient sqlInstancesServiceClient =
+ *     SqlInstancesServiceClient.create(sqlInstancesServiceSettings);
+ * }
+ * + *

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
+ * SqlInstancesServiceSettings sqlInstancesServiceSettings =
+ *     SqlInstancesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlInstancesServiceClient sqlInstancesServiceClient =
+ *     SqlInstancesServiceClient.create(sqlInstancesServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlInstancesServiceSettings sqlInstancesServiceSettings =
+ *     SqlInstancesServiceSettings.newHttpJsonBuilder().build();
+ * SqlInstancesServiceClient sqlInstancesServiceClient =
+ *     SqlInstancesServiceClient.create(sqlInstancesServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlInstancesServiceClient implements BackgroundResource { + private final @Nullable SqlInstancesServiceSettings settings; + private final SqlInstancesServiceStub stub; + + /** Constructs an instance of SqlInstancesServiceClient with default settings. */ + public static final SqlInstancesServiceClient create() throws IOException { + return create(SqlInstancesServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlInstancesServiceClient, 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 SqlInstancesServiceClient create(SqlInstancesServiceSettings settings) + throws IOException { + return new SqlInstancesServiceClient(settings); + } + + /** + * Constructs an instance of SqlInstancesServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(SqlInstancesServiceSettings). + */ + public static final SqlInstancesServiceClient create(SqlInstancesServiceStub stub) { + return new SqlInstancesServiceClient(stub); + } + + /** + * Constructs an instance of SqlInstancesServiceClient, 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 SqlInstancesServiceClient(SqlInstancesServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlInstancesServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlInstancesServiceClient(SqlInstancesServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlInstancesServiceSettings getSettings() { + return settings; + } + + public SqlInstancesServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds a new trusted Certificate Authority (CA) version for the specified instance. Required to + * prepare for a certificate rotation. If a CA version was previously added but never used in a + * certificate rotation, this operation replaces that version. There cannot be more than one CA + * version waiting to be rotated in. For instances that have enabled Certificate Authority Service + * (CAS) based server CA, use AddServerCertificate to add a new server certificate. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAddServerCaRequest request =
+   *       SqlInstancesAddServerCaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.addServerCa(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 Operation addServerCa(SqlInstancesAddServerCaRequest request) { + return addServerCaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds a new trusted Certificate Authority (CA) version for the specified instance. Required to + * prepare for a certificate rotation. If a CA version was previously added but never used in a + * certificate rotation, this operation replaces that version. There cannot be more than one CA + * version waiting to be rotated in. For instances that have enabled Certificate Authority Service + * (CAS) based server CA, use AddServerCertificate to add a new server certificate. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAddServerCaRequest request =
+   *       SqlInstancesAddServerCaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.addServerCaCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable addServerCaCallable() { + return stub.addServerCaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Add a new trusted server certificate version for the specified instance using Certificate + * Authority Service (CAS) server CA. Required to prepare for a certificate rotation. If a server + * certificate version was previously added but never used in a certificate rotation, this + * operation replaces that version. There cannot be more than one certificate version waiting to + * be rotated in. For instances not using CAS server CA, use AddServerCa instead. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAddServerCertificateRequest request =
+   *       SqlInstancesAddServerCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.addServerCertificate(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 Operation addServerCertificate(SqlInstancesAddServerCertificateRequest request) { + return addServerCertificateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Add a new trusted server certificate version for the specified instance using Certificate + * Authority Service (CAS) server CA. Required to prepare for a certificate rotation. If a server + * certificate version was previously added but never used in a certificate rotation, this + * operation replaces that version. There cannot be more than one certificate version waiting to + * be rotated in. For instances not using CAS server CA, use AddServerCa instead. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAddServerCertificateRequest request =
+   *       SqlInstancesAddServerCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.addServerCertificateCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + addServerCertificateCallable() { + return stub.addServerCertificateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds a new Entra ID certificate for the specified instance. If an Entra ID certificate was + * previously added but never used in a certificate rotation, this operation replaces that + * version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAddEntraIdCertificateRequest request =
+   *       SqlInstancesAddEntraIdCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.addEntraIdCertificate(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 Operation addEntraIdCertificate(SqlInstancesAddEntraIdCertificateRequest request) { + return addEntraIdCertificateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds a new Entra ID certificate for the specified instance. If an Entra ID certificate was + * previously added but never used in a certificate rotation, this operation replaces that + * version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAddEntraIdCertificateRequest request =
+   *       SqlInstancesAddEntraIdCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.addEntraIdCertificateCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + addEntraIdCertificateCallable() { + return stub.addEntraIdCertificateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Cloud SQL instance as a clone of the source instance. Using this operation might + * cause your instance to restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesCloneRequest request =
+   *       SqlInstancesCloneRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesCloneRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.clone(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 Operation clone(SqlInstancesCloneRequest request) { + return cloneCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Cloud SQL instance as a clone of the source instance. Using this operation might + * cause your instance to restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesCloneRequest request =
+   *       SqlInstancesCloneRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesCloneRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.cloneCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable cloneCallable() { + return stub.cloneCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesDeleteRequest request =
+   *       SqlInstancesDeleteRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setEnableFinalBackup(true)
+   *           .setFinalBackupDescription("finalBackupDescription-293551612")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.delete(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 Operation delete(SqlInstancesDeleteRequest request) { + return deleteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesDeleteRequest request =
+   *       SqlInstancesDeleteRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setEnableFinalBackup(true)
+   *           .setFinalBackupDescription("finalBackupDescription-293551612")
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.deleteCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCallable() { + return stub.deleteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Demotes the stand-alone instance to be a Cloud SQL read replica for an external database + * server. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesDemoteMasterRequest request =
+   *       SqlInstancesDemoteMasterRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesDemoteMasterRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.demoteMaster(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 Operation demoteMaster(SqlInstancesDemoteMasterRequest request) { + return demoteMasterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Demotes the stand-alone instance to be a Cloud SQL read replica for an external database + * server. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesDemoteMasterRequest request =
+   *       SqlInstancesDemoteMasterRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesDemoteMasterRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.demoteMasterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable demoteMasterCallable() { + return stub.demoteMasterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Demotes an existing standalone instance to be a Cloud SQL read replica for an external database + * server. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesDemoteRequest request =
+   *       SqlInstancesDemoteRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesDemoteRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.demote(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 Operation demote(SqlInstancesDemoteRequest request) { + return demoteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Demotes an existing standalone instance to be a Cloud SQL read replica for an external database + * server. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesDemoteRequest request =
+   *       SqlInstancesDemoteRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesDemoteRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.demoteCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable demoteCallable() { + return stub.demoteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesExportRequest request =
+   *       SqlInstancesExportRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesExportRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.export(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 Operation export(SqlInstancesExportRequest request) { + return exportCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesExportRequest request =
+   *       SqlInstancesExportRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesExportRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.exportCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable exportCallable() { + return stub.exportCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Initiates a manual failover of a high availability (HA) primary instance to a standby instance, + * which becomes the primary instance. Users are then rerouted to the new primary. For more + * information, see the [Overview of high + * availability](https://cloud.google.com/sql/docs/mysql/high-availability) page in the Cloud SQL + * documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its + * failover replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesFailoverRequest request =
+   *       SqlInstancesFailoverRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesFailoverRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.failover(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 Operation failover(SqlInstancesFailoverRequest request) { + return failoverCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Initiates a manual failover of a high availability (HA) primary instance to a standby instance, + * which becomes the primary instance. Users are then rerouted to the new primary. For more + * information, see the [Overview of high + * availability](https://cloud.google.com/sql/docs/mysql/high-availability) page in the Cloud SQL + * documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its + * failover replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesFailoverRequest request =
+   *       SqlInstancesFailoverRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesFailoverRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.failoverCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable failoverCallable() { + return stub.failoverCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reencrypt CMEK instance with latest key version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesReencryptRequest request =
+   *       SqlInstancesReencryptRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesReencryptRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.reencrypt(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 Operation reencrypt(SqlInstancesReencryptRequest request) { + return reencryptCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reencrypt CMEK instance with latest key version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesReencryptRequest request =
+   *       SqlInstancesReencryptRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesReencryptRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.reencryptCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable reencryptCallable() { + return stub.reencryptCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesGetRequest request =
+   *       SqlInstancesGetRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   DatabaseInstance response = sqlInstancesServiceClient.get(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 DatabaseInstance get(SqlInstancesGetRequest request) { + return getCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesGetRequest request =
+   *       SqlInstancesGetRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.getCallable().futureCall(request);
+   *   // Do something.
+   *   DatabaseInstance response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCallable() { + return stub.getCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesImportRequest request =
+   *       SqlInstancesImportRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesImportRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.import_(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 Operation import_(SqlInstancesImportRequest request) { + return import_Callable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesImportRequest request =
+   *       SqlInstancesImportRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesImportRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.importCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable import_Callable() { + return stub.import_Callable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesInsertRequest request =
+   *       SqlInstancesInsertRequest.newBuilder()
+   *           .setProject("project-309310695")
+   *           .setBody(DatabaseInstance.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.insert(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 Operation insert(SqlInstancesInsertRequest request) { + return insertCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesInsertRequest request =
+   *       SqlInstancesInsertRequest.newBuilder()
+   *           .setProject("project-309310695")
+   *           .setBody(DatabaseInstance.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.insertCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable insertCallable() { + return stub.insertCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists instances under a given project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListRequest request =
+   *       SqlInstancesListRequest.newBuilder()
+   *           .setFilter("filter-1274492040")
+   *           .setMaxResults(1128457243)
+   *           .setPageToken("pageToken873572522")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   InstancesListResponse response = sqlInstancesServiceClient.list(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 InstancesListResponse list(SqlInstancesListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists instances under a given project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListRequest request =
+   *       SqlInstancesListRequest.newBuilder()
+   *           .setFilter("filter-1274492040")
+   *           .setMaxResults(1128457243)
+   *           .setPageToken("pageToken873572522")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   InstancesListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be + * up to three CAs listed: the CA that was used to sign the certificate that is currently in use, + * a CA that has been added but not yet used to sign a certificate, and a CA used to sign a + * certificate that has previously rotated out. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListServerCasRequest request =
+   *       SqlInstancesListServerCasRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   InstancesListServerCasResponse response = sqlInstancesServiceClient.listServerCas(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 InstancesListServerCasResponse listServerCas( + SqlInstancesListServerCasRequest request) { + return listServerCasCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be + * up to three CAs listed: the CA that was used to sign the certificate that is currently in use, + * a CA that has been added but not yet used to sign a certificate, and a CA used to sign a + * certificate that has previously rotated out. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListServerCasRequest request =
+   *       SqlInstancesListServerCasRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.listServerCasCallable().futureCall(request);
+   *   // Do something.
+   *   InstancesListServerCasResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + listServerCasCallable() { + return stub.listServerCasCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of server certificates and certificate authorities (CAs) for the specified + * instance. There can be up to three sets of certs listed: the certificate that is currently in + * use, a future that has been added but not yet used to sign a certificate, and a certificate + * that has been rotated out. For instances not using Certificate Authority Service (CAS) server + * CA, use ListServerCas instead. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListServerCertificatesRequest request =
+   *       SqlInstancesListServerCertificatesRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   InstancesListServerCertificatesResponse response =
+   *       sqlInstancesServiceClient.listServerCertificates(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 InstancesListServerCertificatesResponse listServerCertificates( + SqlInstancesListServerCertificatesRequest request) { + return listServerCertificatesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of server certificates and certificate authorities (CAs) for the specified + * instance. There can be up to three sets of certs listed: the certificate that is currently in + * use, a future that has been added but not yet used to sign a certificate, and a certificate + * that has been rotated out. For instances not using Certificate Authority Service (CAS) server + * CA, use ListServerCas instead. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListServerCertificatesRequest request =
+   *       SqlInstancesListServerCertificatesRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.listServerCertificatesCallable().futureCall(request);
+   *   // Do something.
+   *   InstancesListServerCertificatesResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesCallable() { + return stub.listServerCertificatesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of EntraID certificates for the specified instance. There can be up to three + * sets of certificates listed: the certificate that is currently in use, a future that has been + * added but not yet used to sign a certificate, and a certificate that has been rotated out. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListEntraIdCertificatesRequest request =
+   *       SqlInstancesListEntraIdCertificatesRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   InstancesListEntraIdCertificatesResponse response =
+   *       sqlInstancesServiceClient.listEntraIdCertificates(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 InstancesListEntraIdCertificatesResponse listEntraIdCertificates( + SqlInstancesListEntraIdCertificatesRequest request) { + return listEntraIdCertificatesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of EntraID certificates for the specified instance. There can be up to three + * sets of certificates listed: the certificate that is currently in use, a future that has been + * added but not yet used to sign a certificate, and a certificate that has been rotated out. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListEntraIdCertificatesRequest request =
+   *       SqlInstancesListEntraIdCertificatesRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.listEntraIdCertificatesCallable().futureCall(request);
+   *   // Do something.
+   *   InstancesListEntraIdCertificatesResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesCallable() { + return stub.listEntraIdCertificatesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates settings of a Cloud SQL instance by merging the request with the current + * configuration. This method supports patch semantics. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPatchRequest request =
+   *       SqlInstancesPatchRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setReconcilePscNetworking(true)
+   *           .setReconcilePscNetworkingForce(true)
+   *           .setBody(DatabaseInstance.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.patch(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 Operation patch(SqlInstancesPatchRequest request) { + return patchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates settings of a Cloud SQL instance by merging the request with the current + * configuration. This method supports patch semantics. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPatchRequest request =
+   *       SqlInstancesPatchRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setReconcilePscNetworking(true)
+   *           .setReconcilePscNetworkingForce(true)
+   *           .setBody(DatabaseInstance.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.patchCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable patchCallable() { + return stub.patchCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Promotes the read replica instance to be an independent Cloud SQL primary instance. Using this + * operation might cause your instance to restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPromoteReplicaRequest request =
+   *       SqlInstancesPromoteReplicaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setFailover(true)
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.promoteReplica(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 Operation promoteReplica(SqlInstancesPromoteReplicaRequest request) { + return promoteReplicaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Promotes the read replica instance to be an independent Cloud SQL primary instance. Using this + * operation might cause your instance to restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPromoteReplicaRequest request =
+   *       SqlInstancesPromoteReplicaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setFailover(true)
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.promoteReplicaCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + promoteReplicaCallable() { + return stub.promoteReplicaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Switches over from the primary instance to the DR replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesSwitchoverRequest request =
+   *       SqlInstancesSwitchoverRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setDbTimeout(Duration.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.switchover(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 Operation switchover(SqlInstancesSwitchoverRequest request) { + return switchoverCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Switches over from the primary instance to the DR replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesSwitchoverRequest request =
+   *       SqlInstancesSwitchoverRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setDbTimeout(Duration.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.switchoverCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable switchoverCallable() { + return stub.switchoverCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes all client certificates and generates a new server SSL certificate for the 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesResetSslConfigRequest request =
+   *       SqlInstancesResetSslConfigRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.resetSslConfig(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 Operation resetSslConfig(SqlInstancesResetSslConfigRequest request) { + return resetSslConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes all client certificates and generates a new server SSL certificate for the 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesResetSslConfigRequest request =
+   *       SqlInstancesResetSslConfigRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.resetSslConfigCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + resetSslConfigCallable() { + return stub.resetSslConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restarts a Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRestartRequest request =
+   *       SqlInstancesRestartRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.restart(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 Operation restart(SqlInstancesRestartRequest request) { + return restartCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restarts a Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRestartRequest request =
+   *       SqlInstancesRestartRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.restartCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restartCallable() { + return stub.restartCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to + * restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRestoreBackupRequest request =
+   *       SqlInstancesRestoreBackupRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRestoreBackupRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.restoreBackup(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 Operation restoreBackup(SqlInstancesRestoreBackupRequest request) { + return restoreBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to + * restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRestoreBackupRequest request =
+   *       SqlInstancesRestoreBackupRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRestoreBackupRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.restoreBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restoreBackupCallable() { + return stub.restoreBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Rotates the server certificate to one signed by the Certificate Authority (CA) version + * previously added with the addServerCA method. For instances that have enabled Certificate + * Authority Service (CAS) based server CA, use RotateServerCertificate to rotate the server + * certificate. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRotateServerCaRequest request =
+   *       SqlInstancesRotateServerCaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRotateServerCaRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.rotateServerCa(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 Operation rotateServerCa(SqlInstancesRotateServerCaRequest request) { + return rotateServerCaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Rotates the server certificate to one signed by the Certificate Authority (CA) version + * previously added with the addServerCA method. For instances that have enabled Certificate + * Authority Service (CAS) based server CA, use RotateServerCertificate to rotate the server + * certificate. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRotateServerCaRequest request =
+   *       SqlInstancesRotateServerCaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRotateServerCaRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.rotateServerCaCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + rotateServerCaCallable() { + return stub.rotateServerCaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Rotates the server certificate version to one previously added with the addServerCertificate + * method. For instances not using Certificate Authority Service (CAS) server CA, use + * RotateServerCa instead. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRotateServerCertificateRequest request =
+   *       SqlInstancesRotateServerCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRotateServerCertificateRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.rotateServerCertificate(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 Operation rotateServerCertificate( + SqlInstancesRotateServerCertificateRequest request) { + return rotateServerCertificateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Rotates the server certificate version to one previously added with the addServerCertificate + * method. For instances not using Certificate Authority Service (CAS) server CA, use + * RotateServerCa instead. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRotateServerCertificateRequest request =
+   *       SqlInstancesRotateServerCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRotateServerCertificateRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.rotateServerCertificateCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + rotateServerCertificateCallable() { + return stub.rotateServerCertificateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Rotates the server certificate version to one previously added with the addEntraIdCertificate + * method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRotateEntraIdCertificateRequest request =
+   *       SqlInstancesRotateEntraIdCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.rotateEntraIdCertificate(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 Operation rotateEntraIdCertificate( + SqlInstancesRotateEntraIdCertificateRequest request) { + return rotateEntraIdCertificateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Rotates the server certificate version to one previously added with the addEntraIdCertificate + * method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRotateEntraIdCertificateRequest request =
+   *       SqlInstancesRotateEntraIdCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.rotateEntraIdCertificateCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + rotateEntraIdCertificateCallable() { + return stub.rotateEntraIdCertificateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts the replication in the read replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesStartReplicaRequest request =
+   *       SqlInstancesStartReplicaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.startReplica(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 Operation startReplica(SqlInstancesStartReplicaRequest request) { + return startReplicaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts the replication in the read replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesStartReplicaRequest request =
+   *       SqlInstancesStartReplicaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.startReplicaCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable startReplicaCallable() { + return stub.startReplicaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops the replication in the read replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesStopReplicaRequest request =
+   *       SqlInstancesStopReplicaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.stopReplica(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 Operation stopReplica(SqlInstancesStopReplicaRequest request) { + return stopReplicaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops the replication in the read replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesStopReplicaRequest request =
+   *       SqlInstancesStopReplicaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.stopReplicaCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable stopReplicaCallable() { + return stub.stopReplicaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Truncate MySQL general and slow query log tables MySQL only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesTruncateLogRequest request =
+   *       SqlInstancesTruncateLogRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesTruncateLogRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.truncateLog(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 Operation truncateLog(SqlInstancesTruncateLogRequest request) { + return truncateLogCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Truncate MySQL general and slow query log tables MySQL only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesTruncateLogRequest request =
+   *       SqlInstancesTruncateLogRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesTruncateLogRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.truncateLogCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable truncateLogCallable() { + return stub.truncateLogCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates settings of a Cloud SQL instance. Using this operation might cause your instance to + * restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesUpdateRequest request =
+   *       SqlInstancesUpdateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(DatabaseInstance.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.update(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 Operation update(SqlInstancesUpdateRequest request) { + return updateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates settings of a Cloud SQL instance. Using this operation might cause your instance to + * restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesUpdateRequest request =
+   *       SqlInstancesUpdateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(DatabaseInstance.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.updateCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateCallable() { + return stub.updateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generates a short-lived X509 certificate containing the provided public key and signed by a + * private key specific to the target instance. Users may use the certificate to authenticate as + * themselves when connecting to the database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesCreateEphemeralCertRequest request =
+   *       SqlInstancesCreateEphemeralCertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(SslCertsCreateEphemeralRequest.newBuilder().build())
+   *           .build();
+   *   SslCert response = sqlInstancesServiceClient.createEphemeral(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 SslCert createEphemeral(SqlInstancesCreateEphemeralCertRequest request) { + return createEphemeralCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generates a short-lived X509 certificate containing the provided public key and signed by a + * private key specific to the target instance. Users may use the certificate to authenticate as + * themselves when connecting to the database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesCreateEphemeralCertRequest request =
+   *       SqlInstancesCreateEphemeralCertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(SslCertsCreateEphemeralRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.createEphemeralCallable().futureCall(request);
+   *   // Do something.
+   *   SslCert response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createEphemeralCallable() { + return stub.createEphemeralCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reschedules the maintenance on the given 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRescheduleMaintenanceRequest request =
+   *       SqlInstancesRescheduleMaintenanceRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.rescheduleMaintenance(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 Operation rescheduleMaintenance(SqlInstancesRescheduleMaintenanceRequest request) { + return rescheduleMaintenanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reschedules the maintenance on the given 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRescheduleMaintenanceRequest request =
+   *       SqlInstancesRescheduleMaintenanceRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.rescheduleMaintenanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + rescheduleMaintenanceCallable() { + return stub.rescheduleMaintenanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Verify External primary instance external sync settings. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesVerifyExternalSyncSettingsRequest request =
+   *       SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setVerifyConnectionOnly(true)
+   *           .setVerifyReplicationOnly(true)
+   *           .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0))
+   *           .addAllSelectedObjects(new ArrayList())
+   *           .build();
+   *   SqlInstancesVerifyExternalSyncSettingsResponse response =
+   *       sqlInstancesServiceClient.verifyExternalSyncSettings(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 SqlInstancesVerifyExternalSyncSettingsResponse verifyExternalSyncSettings( + SqlInstancesVerifyExternalSyncSettingsRequest request) { + return verifyExternalSyncSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Verify External primary instance external sync settings. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesVerifyExternalSyncSettingsRequest request =
+   *       SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setVerifyConnectionOnly(true)
+   *           .setVerifyReplicationOnly(true)
+   *           .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0))
+   *           .addAllSelectedObjects(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.verifyExternalSyncSettingsCallable().futureCall(request);
+   *   // Do something.
+   *   SqlInstancesVerifyExternalSyncSettingsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsCallable() { + return stub.verifyExternalSyncSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Start External primary instance migration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesStartExternalSyncRequest request =
+   *       SqlInstancesStartExternalSyncRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSkipVerification(true)
+   *           .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0))
+   *           .setReplicaOverwriteEnabled(true)
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.startExternalSync(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 Operation startExternalSync(SqlInstancesStartExternalSyncRequest request) { + return startExternalSyncCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Start External primary instance migration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesStartExternalSyncRequest request =
+   *       SqlInstancesStartExternalSyncRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSkipVerification(true)
+   *           .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0))
+   *           .setReplicaOverwriteEnabled(true)
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.startExternalSyncCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + startExternalSyncCallable() { + return stub.startExternalSyncCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform Disk Shrink on primary 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPerformDiskShrinkRequest request =
+   *       SqlInstancesPerformDiskShrinkRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(PerformDiskShrinkContext.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.performDiskShrink(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 Operation performDiskShrink(SqlInstancesPerformDiskShrinkRequest request) { + return performDiskShrinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform Disk Shrink on primary 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPerformDiskShrinkRequest request =
+   *       SqlInstancesPerformDiskShrinkRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(PerformDiskShrinkContext.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.performDiskShrinkCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + performDiskShrinkCallable() { + return stub.performDiskShrinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get Disk Shrink Config for a given 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesGetDiskShrinkConfigRequest request =
+   *       SqlInstancesGetDiskShrinkConfigRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   SqlInstancesGetDiskShrinkConfigResponse response =
+   *       sqlInstancesServiceClient.getDiskShrinkConfig(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 SqlInstancesGetDiskShrinkConfigResponse getDiskShrinkConfig( + SqlInstancesGetDiskShrinkConfigRequest request) { + return getDiskShrinkConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get Disk Shrink Config for a given 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesGetDiskShrinkConfigRequest request =
+   *       SqlInstancesGetDiskShrinkConfigRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.getDiskShrinkConfigCallable().futureCall(request);
+   *   // Do something.
+   *   SqlInstancesGetDiskShrinkConfigResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigCallable() { + return stub.getDiskShrinkConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reset Replica Size to primary instance disk size. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesResetReplicaSizeRequest request =
+   *       SqlInstancesResetReplicaSizeRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.resetReplicaSize(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 Operation resetReplicaSize(SqlInstancesResetReplicaSizeRequest request) { + return resetReplicaSizeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reset Replica Size to primary instance disk size. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesResetReplicaSizeRequest request =
+   *       SqlInstancesResetReplicaSizeRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.resetReplicaSizeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + resetReplicaSizeCallable() { + return stub.resetReplicaSizeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get Latest Recovery Time for a given 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesGetLatestRecoveryTimeRequest request =
+   *       SqlInstancesGetLatestRecoveryTimeRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSourceInstanceDeletionTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   SqlInstancesGetLatestRecoveryTimeResponse response =
+   *       sqlInstancesServiceClient.getLatestRecoveryTime(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 SqlInstancesGetLatestRecoveryTimeResponse getLatestRecoveryTime( + SqlInstancesGetLatestRecoveryTimeRequest request) { + return getLatestRecoveryTimeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get Latest Recovery Time for a given 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesGetLatestRecoveryTimeRequest request =
+   *       SqlInstancesGetLatestRecoveryTimeRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSourceInstanceDeletionTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.getLatestRecoveryTimeCallable().futureCall(request);
+   *   // Do something.
+   *   SqlInstancesGetLatestRecoveryTimeResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeCallable() { + return stub.getLatestRecoveryTimeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Execute SQL statements. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesExecuteSqlRequest request =
+   *       SqlInstancesExecuteSqlRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(ExecuteSqlPayload.newBuilder().build())
+   *           .build();
+   *   SqlInstancesExecuteSqlResponse response = sqlInstancesServiceClient.executeSql(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 SqlInstancesExecuteSqlResponse executeSql(SqlInstancesExecuteSqlRequest request) { + return executeSqlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Execute SQL statements. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesExecuteSqlRequest request =
+   *       SqlInstancesExecuteSqlRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(ExecuteSqlPayload.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.executeSqlCallable().futureCall(request);
+   *   // Do something.
+   *   SqlInstancesExecuteSqlResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + executeSqlCallable() { + return stub.executeSqlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Acquire a lease for the setup of SQL Server Reporting Services (SSRS). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAcquireSsrsLeaseRequest request =
+   *       SqlInstancesAcquireSsrsLeaseRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build())
+   *           .build();
+   *   SqlInstancesAcquireSsrsLeaseResponse response =
+   *       sqlInstancesServiceClient.acquireSsrsLease(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 SqlInstancesAcquireSsrsLeaseResponse acquireSsrsLease( + SqlInstancesAcquireSsrsLeaseRequest request) { + return acquireSsrsLeaseCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Acquire a lease for the setup of SQL Server Reporting Services (SSRS). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAcquireSsrsLeaseRequest request =
+   *       SqlInstancesAcquireSsrsLeaseRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.acquireSsrsLeaseCallable().futureCall(request);
+   *   // Do something.
+   *   SqlInstancesAcquireSsrsLeaseResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseCallable() { + return stub.acquireSsrsLeaseCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Release a lease for the setup of SQL Server Reporting Services (SSRS). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesReleaseSsrsLeaseRequest request =
+   *       SqlInstancesReleaseSsrsLeaseRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   SqlInstancesReleaseSsrsLeaseResponse response =
+   *       sqlInstancesServiceClient.releaseSsrsLease(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 SqlInstancesReleaseSsrsLeaseResponse releaseSsrsLease( + SqlInstancesReleaseSsrsLeaseRequest request) { + return releaseSsrsLeaseCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Release a lease for the setup of SQL Server Reporting Services (SSRS). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesReleaseSsrsLeaseRequest request =
+   *       SqlInstancesReleaseSsrsLeaseRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.releaseSsrsLeaseCallable().futureCall(request);
+   *   // Do something.
+   *   SqlInstancesReleaseSsrsLeaseResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseCallable() { + return stub.releaseSsrsLeaseCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Execute MVU Pre-checks + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPreCheckMajorVersionUpgradeRequest request =
+   *       SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.preCheckMajorVersionUpgrade(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 Operation preCheckMajorVersionUpgrade( + SqlInstancesPreCheckMajorVersionUpgradeRequest request) { + return preCheckMajorVersionUpgradeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Execute MVU Pre-checks + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPreCheckMajorVersionUpgradeRequest request =
+   *       SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.preCheckMajorVersionUpgradeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + preCheckMajorVersionUpgradeCallable() { + return stub.preCheckMajorVersionUpgradeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Point in time restore for an instance managed by Google Cloud Backup and Disaster Recovery. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPointInTimeRestoreRequest request =
+   *       SqlInstancesPointInTimeRestoreRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setContext(PointInTimeRestoreContext.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.pointInTimeRestore(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 Operation pointInTimeRestore(SqlInstancesPointInTimeRestoreRequest request) { + return pointInTimeRestoreCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Point in time restore for an instance managed by Google Cloud Backup and Disaster Recovery. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPointInTimeRestoreRequest request =
+   *       SqlInstancesPointInTimeRestoreRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setContext(PointInTimeRestoreContext.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.pointInTimeRestoreCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + pointInTimeRestoreCallable() { + return stub.pointInTimeRestoreCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlInstancesServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlInstancesServiceSettings.java new file mode 100644 index 000000000000..98a52ee26ed7 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlInstancesServiceSettings.java @@ -0,0 +1,709 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1.stub.SqlInstancesServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlInstancesServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 addServerCa: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlInstancesServiceSettings.Builder sqlInstancesServiceSettingsBuilder =
+ *     SqlInstancesServiceSettings.newBuilder();
+ * sqlInstancesServiceSettingsBuilder
+ *     .addServerCaSettings()
+ *     .setRetrySettings(
+ *         sqlInstancesServiceSettingsBuilder
+ *             .addServerCaSettings()
+ *             .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());
+ * SqlInstancesServiceSettings sqlInstancesServiceSettings =
+ *     sqlInstancesServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlInstancesServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to addServerCa. */ + public UnaryCallSettings addServerCaSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).addServerCaSettings(); + } + + /** Returns the object with the settings used for calls to addServerCertificate. */ + public UnaryCallSettings + addServerCertificateSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).addServerCertificateSettings(); + } + + /** Returns the object with the settings used for calls to addEntraIdCertificate. */ + public UnaryCallSettings + addEntraIdCertificateSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).addEntraIdCertificateSettings(); + } + + /** Returns the object with the settings used for calls to clone. */ + public UnaryCallSettings cloneSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).cloneSettings(); + } + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).deleteSettings(); + } + + /** Returns the object with the settings used for calls to demoteMaster. */ + public UnaryCallSettings demoteMasterSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).demoteMasterSettings(); + } + + /** Returns the object with the settings used for calls to demote. */ + public UnaryCallSettings demoteSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).demoteSettings(); + } + + /** Returns the object with the settings used for calls to export. */ + public UnaryCallSettings exportSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).exportSettings(); + } + + /** Returns the object with the settings used for calls to failover. */ + public UnaryCallSettings failoverSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).failoverSettings(); + } + + /** Returns the object with the settings used for calls to reencrypt. */ + public UnaryCallSettings reencryptSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).reencryptSettings(); + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).getSettings(); + } + + /** Returns the object with the settings used for calls to import_. */ + public UnaryCallSettings import_Settings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).import_Settings(); + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).insertSettings(); + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).listSettings(); + } + + /** Returns the object with the settings used for calls to listServerCas. */ + public UnaryCallSettings + listServerCasSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).listServerCasSettings(); + } + + /** Returns the object with the settings used for calls to listServerCertificates. */ + public UnaryCallSettings< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).listServerCertificatesSettings(); + } + + /** Returns the object with the settings used for calls to listEntraIdCertificates. */ + public UnaryCallSettings< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).listEntraIdCertificatesSettings(); + } + + /** Returns the object with the settings used for calls to patch. */ + public UnaryCallSettings patchSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).patchSettings(); + } + + /** Returns the object with the settings used for calls to promoteReplica. */ + public UnaryCallSettings promoteReplicaSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).promoteReplicaSettings(); + } + + /** Returns the object with the settings used for calls to switchover. */ + public UnaryCallSettings switchoverSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).switchoverSettings(); + } + + /** Returns the object with the settings used for calls to resetSslConfig. */ + public UnaryCallSettings resetSslConfigSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).resetSslConfigSettings(); + } + + /** Returns the object with the settings used for calls to restart. */ + public UnaryCallSettings restartSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).restartSettings(); + } + + /** Returns the object with the settings used for calls to restoreBackup. */ + public UnaryCallSettings restoreBackupSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).restoreBackupSettings(); + } + + /** Returns the object with the settings used for calls to rotateServerCa. */ + public UnaryCallSettings rotateServerCaSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).rotateServerCaSettings(); + } + + /** Returns the object with the settings used for calls to rotateServerCertificate. */ + public UnaryCallSettings + rotateServerCertificateSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).rotateServerCertificateSettings(); + } + + /** Returns the object with the settings used for calls to rotateEntraIdCertificate. */ + public UnaryCallSettings + rotateEntraIdCertificateSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).rotateEntraIdCertificateSettings(); + } + + /** Returns the object with the settings used for calls to startReplica. */ + public UnaryCallSettings startReplicaSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).startReplicaSettings(); + } + + /** Returns the object with the settings used for calls to stopReplica. */ + public UnaryCallSettings stopReplicaSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).stopReplicaSettings(); + } + + /** Returns the object with the settings used for calls to truncateLog. */ + public UnaryCallSettings truncateLogSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).truncateLogSettings(); + } + + /** Returns the object with the settings used for calls to update. */ + public UnaryCallSettings updateSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).updateSettings(); + } + + /** Returns the object with the settings used for calls to createEphemeral. */ + public UnaryCallSettings + createEphemeralSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).createEphemeralSettings(); + } + + /** Returns the object with the settings used for calls to rescheduleMaintenance. */ + public UnaryCallSettings + rescheduleMaintenanceSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).rescheduleMaintenanceSettings(); + } + + /** Returns the object with the settings used for calls to verifyExternalSyncSettings. */ + public UnaryCallSettings< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()) + .verifyExternalSyncSettingsSettings(); + } + + /** Returns the object with the settings used for calls to startExternalSync. */ + public UnaryCallSettings + startExternalSyncSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).startExternalSyncSettings(); + } + + /** Returns the object with the settings used for calls to performDiskShrink. */ + public UnaryCallSettings + performDiskShrinkSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).performDiskShrinkSettings(); + } + + /** Returns the object with the settings used for calls to getDiskShrinkConfig. */ + public UnaryCallSettings< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).getDiskShrinkConfigSettings(); + } + + /** Returns the object with the settings used for calls to resetReplicaSize. */ + public UnaryCallSettings + resetReplicaSizeSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).resetReplicaSizeSettings(); + } + + /** Returns the object with the settings used for calls to getLatestRecoveryTime. */ + public UnaryCallSettings< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).getLatestRecoveryTimeSettings(); + } + + /** Returns the object with the settings used for calls to executeSql. */ + public UnaryCallSettings + executeSqlSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).executeSqlSettings(); + } + + /** Returns the object with the settings used for calls to acquireSsrsLease. */ + public UnaryCallSettings< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).acquireSsrsLeaseSettings(); + } + + /** Returns the object with the settings used for calls to releaseSsrsLease. */ + public UnaryCallSettings< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).releaseSsrsLeaseSettings(); + } + + /** Returns the object with the settings used for calls to preCheckMajorVersionUpgrade. */ + public UnaryCallSettings + preCheckMajorVersionUpgradeSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()) + .preCheckMajorVersionUpgradeSettings(); + } + + /** Returns the object with the settings used for calls to pointInTimeRestore. */ + public UnaryCallSettings + pointInTimeRestoreSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).pointInTimeRestoreSettings(); + } + + public static final SqlInstancesServiceSettings create(SqlInstancesServiceStubSettings stub) + throws IOException { + return new SqlInstancesServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlInstancesServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlInstancesServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlInstancesServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlInstancesServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlInstancesServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlInstancesServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlInstancesServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlInstancesServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlInstancesServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlInstancesServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlInstancesServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlInstancesServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlInstancesServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlInstancesServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlInstancesServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlInstancesServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlInstancesServiceStubSettings.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 addServerCa. */ + public UnaryCallSettings.Builder + addServerCaSettings() { + return getStubSettingsBuilder().addServerCaSettings(); + } + + /** Returns the builder for the settings used for calls to addServerCertificate. */ + public UnaryCallSettings.Builder + addServerCertificateSettings() { + return getStubSettingsBuilder().addServerCertificateSettings(); + } + + /** Returns the builder for the settings used for calls to addEntraIdCertificate. */ + public UnaryCallSettings.Builder + addEntraIdCertificateSettings() { + return getStubSettingsBuilder().addEntraIdCertificateSettings(); + } + + /** Returns the builder for the settings used for calls to clone. */ + public UnaryCallSettings.Builder cloneSettings() { + return getStubSettingsBuilder().cloneSettings(); + } + + /** Returns the builder for the settings used for calls to delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return getStubSettingsBuilder().deleteSettings(); + } + + /** Returns the builder for the settings used for calls to demoteMaster. */ + public UnaryCallSettings.Builder + demoteMasterSettings() { + return getStubSettingsBuilder().demoteMasterSettings(); + } + + /** Returns the builder for the settings used for calls to demote. */ + public UnaryCallSettings.Builder demoteSettings() { + return getStubSettingsBuilder().demoteSettings(); + } + + /** Returns the builder for the settings used for calls to export. */ + public UnaryCallSettings.Builder exportSettings() { + return getStubSettingsBuilder().exportSettings(); + } + + /** Returns the builder for the settings used for calls to failover. */ + public UnaryCallSettings.Builder failoverSettings() { + return getStubSettingsBuilder().failoverSettings(); + } + + /** Returns the builder for the settings used for calls to reencrypt. */ + public UnaryCallSettings.Builder reencryptSettings() { + return getStubSettingsBuilder().reencryptSettings(); + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getStubSettingsBuilder().getSettings(); + } + + /** Returns the builder for the settings used for calls to import_. */ + public UnaryCallSettings.Builder import_Settings() { + return getStubSettingsBuilder().import_Settings(); + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return getStubSettingsBuilder().insertSettings(); + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + /** Returns the builder for the settings used for calls to listServerCas. */ + public UnaryCallSettings.Builder< + SqlInstancesListServerCasRequest, InstancesListServerCasResponse> + listServerCasSettings() { + return getStubSettingsBuilder().listServerCasSettings(); + } + + /** Returns the builder for the settings used for calls to listServerCertificates. */ + public UnaryCallSettings.Builder< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesSettings() { + return getStubSettingsBuilder().listServerCertificatesSettings(); + } + + /** Returns the builder for the settings used for calls to listEntraIdCertificates. */ + public UnaryCallSettings.Builder< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesSettings() { + return getStubSettingsBuilder().listEntraIdCertificatesSettings(); + } + + /** Returns the builder for the settings used for calls to patch. */ + public UnaryCallSettings.Builder patchSettings() { + return getStubSettingsBuilder().patchSettings(); + } + + /** Returns the builder for the settings used for calls to promoteReplica. */ + public UnaryCallSettings.Builder + promoteReplicaSettings() { + return getStubSettingsBuilder().promoteReplicaSettings(); + } + + /** Returns the builder for the settings used for calls to switchover. */ + public UnaryCallSettings.Builder + switchoverSettings() { + return getStubSettingsBuilder().switchoverSettings(); + } + + /** Returns the builder for the settings used for calls to resetSslConfig. */ + public UnaryCallSettings.Builder + resetSslConfigSettings() { + return getStubSettingsBuilder().resetSslConfigSettings(); + } + + /** Returns the builder for the settings used for calls to restart. */ + public UnaryCallSettings.Builder restartSettings() { + return getStubSettingsBuilder().restartSettings(); + } + + /** Returns the builder for the settings used for calls to restoreBackup. */ + public UnaryCallSettings.Builder + restoreBackupSettings() { + return getStubSettingsBuilder().restoreBackupSettings(); + } + + /** Returns the builder for the settings used for calls to rotateServerCa. */ + public UnaryCallSettings.Builder + rotateServerCaSettings() { + return getStubSettingsBuilder().rotateServerCaSettings(); + } + + /** Returns the builder for the settings used for calls to rotateServerCertificate. */ + public UnaryCallSettings.Builder + rotateServerCertificateSettings() { + return getStubSettingsBuilder().rotateServerCertificateSettings(); + } + + /** Returns the builder for the settings used for calls to rotateEntraIdCertificate. */ + public UnaryCallSettings.Builder + rotateEntraIdCertificateSettings() { + return getStubSettingsBuilder().rotateEntraIdCertificateSettings(); + } + + /** Returns the builder for the settings used for calls to startReplica. */ + public UnaryCallSettings.Builder + startReplicaSettings() { + return getStubSettingsBuilder().startReplicaSettings(); + } + + /** Returns the builder for the settings used for calls to stopReplica. */ + public UnaryCallSettings.Builder + stopReplicaSettings() { + return getStubSettingsBuilder().stopReplicaSettings(); + } + + /** Returns the builder for the settings used for calls to truncateLog. */ + public UnaryCallSettings.Builder + truncateLogSettings() { + return getStubSettingsBuilder().truncateLogSettings(); + } + + /** Returns the builder for the settings used for calls to update. */ + public UnaryCallSettings.Builder updateSettings() { + return getStubSettingsBuilder().updateSettings(); + } + + /** Returns the builder for the settings used for calls to createEphemeral. */ + public UnaryCallSettings.Builder + createEphemeralSettings() { + return getStubSettingsBuilder().createEphemeralSettings(); + } + + /** Returns the builder for the settings used for calls to rescheduleMaintenance. */ + public UnaryCallSettings.Builder + rescheduleMaintenanceSettings() { + return getStubSettingsBuilder().rescheduleMaintenanceSettings(); + } + + /** Returns the builder for the settings used for calls to verifyExternalSyncSettings. */ + public UnaryCallSettings.Builder< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsSettings() { + return getStubSettingsBuilder().verifyExternalSyncSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to startExternalSync. */ + public UnaryCallSettings.Builder + startExternalSyncSettings() { + return getStubSettingsBuilder().startExternalSyncSettings(); + } + + /** Returns the builder for the settings used for calls to performDiskShrink. */ + public UnaryCallSettings.Builder + performDiskShrinkSettings() { + return getStubSettingsBuilder().performDiskShrinkSettings(); + } + + /** Returns the builder for the settings used for calls to getDiskShrinkConfig. */ + public UnaryCallSettings.Builder< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigSettings() { + return getStubSettingsBuilder().getDiskShrinkConfigSettings(); + } + + /** Returns the builder for the settings used for calls to resetReplicaSize. */ + public UnaryCallSettings.Builder + resetReplicaSizeSettings() { + return getStubSettingsBuilder().resetReplicaSizeSettings(); + } + + /** Returns the builder for the settings used for calls to getLatestRecoveryTime. */ + public UnaryCallSettings.Builder< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeSettings() { + return getStubSettingsBuilder().getLatestRecoveryTimeSettings(); + } + + /** Returns the builder for the settings used for calls to executeSql. */ + public UnaryCallSettings.Builder + executeSqlSettings() { + return getStubSettingsBuilder().executeSqlSettings(); + } + + /** Returns the builder for the settings used for calls to acquireSsrsLease. */ + public UnaryCallSettings.Builder< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseSettings() { + return getStubSettingsBuilder().acquireSsrsLeaseSettings(); + } + + /** Returns the builder for the settings used for calls to releaseSsrsLease. */ + public UnaryCallSettings.Builder< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseSettings() { + return getStubSettingsBuilder().releaseSsrsLeaseSettings(); + } + + /** Returns the builder for the settings used for calls to preCheckMajorVersionUpgrade. */ + public UnaryCallSettings.Builder + preCheckMajorVersionUpgradeSettings() { + return getStubSettingsBuilder().preCheckMajorVersionUpgradeSettings(); + } + + /** Returns the builder for the settings used for calls to pointInTimeRestore. */ + public UnaryCallSettings.Builder + pointInTimeRestoreSettings() { + return getStubSettingsBuilder().pointInTimeRestoreSettings(); + } + + @Override + public SqlInstancesServiceSettings build() throws IOException { + return new SqlInstancesServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlOperationsServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlOperationsServiceClient.java new file mode 100644 index 000000000000..4c5f1f9d5b69 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlOperationsServiceClient.java @@ -0,0 +1,429 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.stub.SqlOperationsServiceStub; +import com.google.cloud.sql.v1.stub.SqlOperationsServiceStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service to fetch operations for database instances. + * + *

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 (SqlOperationsServiceClient sqlOperationsServiceClient =
+ *     SqlOperationsServiceClient.create()) {
+ *   SqlOperationsGetRequest request =
+ *       SqlOperationsGetRequest.newBuilder()
+ *           .setOperation("operation1662702951")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlOperationsServiceClient.get(request);
+ * }
+ * }
+ * + *

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

Get

Retrieves an instance operation that has been performed on an instance.

+ *

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

+ *
    + *
  • get(SqlOperationsGetRequest request) + *

+ *

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

+ *
    + *
  • getCallable() + *

+ *

List

Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.

+ *

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

+ *
    + *
  • list(SqlOperationsListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *

Cancel

Cancels an instance operation that has been performed on an instance.

+ *

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

+ *
    + *
  • cancel(SqlOperationsCancelRequest request) + *

+ *

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

+ *
    + *
  • cancelCallable() + *

+ *
+ * + *

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 SqlOperationsServiceSettings + * 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
+ * SqlOperationsServiceSettings sqlOperationsServiceSettings =
+ *     SqlOperationsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlOperationsServiceClient sqlOperationsServiceClient =
+ *     SqlOperationsServiceClient.create(sqlOperationsServiceSettings);
+ * }
+ * + *

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
+ * SqlOperationsServiceSettings sqlOperationsServiceSettings =
+ *     SqlOperationsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlOperationsServiceClient sqlOperationsServiceClient =
+ *     SqlOperationsServiceClient.create(sqlOperationsServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlOperationsServiceSettings sqlOperationsServiceSettings =
+ *     SqlOperationsServiceSettings.newHttpJsonBuilder().build();
+ * SqlOperationsServiceClient sqlOperationsServiceClient =
+ *     SqlOperationsServiceClient.create(sqlOperationsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlOperationsServiceClient implements BackgroundResource { + private final @Nullable SqlOperationsServiceSettings settings; + private final SqlOperationsServiceStub stub; + + /** Constructs an instance of SqlOperationsServiceClient with default settings. */ + public static final SqlOperationsServiceClient create() throws IOException { + return create(SqlOperationsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlOperationsServiceClient, 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 SqlOperationsServiceClient create(SqlOperationsServiceSettings settings) + throws IOException { + return new SqlOperationsServiceClient(settings); + } + + /** + * Constructs an instance of SqlOperationsServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(SqlOperationsServiceSettings). + */ + public static final SqlOperationsServiceClient create(SqlOperationsServiceStub stub) { + return new SqlOperationsServiceClient(stub); + } + + /** + * Constructs an instance of SqlOperationsServiceClient, 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 SqlOperationsServiceClient(SqlOperationsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlOperationsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlOperationsServiceClient(SqlOperationsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlOperationsServiceSettings getSettings() { + return settings; + } + + public SqlOperationsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves an instance operation that has been performed on 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 (SqlOperationsServiceClient sqlOperationsServiceClient =
+   *     SqlOperationsServiceClient.create()) {
+   *   SqlOperationsGetRequest request =
+   *       SqlOperationsGetRequest.newBuilder()
+   *           .setOperation("operation1662702951")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlOperationsServiceClient.get(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 Operation get(SqlOperationsGetRequest request) { + return getCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves an instance operation that has been performed on 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 (SqlOperationsServiceClient sqlOperationsServiceClient =
+   *     SqlOperationsServiceClient.create()) {
+   *   SqlOperationsGetRequest request =
+   *       SqlOperationsGetRequest.newBuilder()
+   *           .setOperation("operation1662702951")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlOperationsServiceClient.getCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCallable() { + return stub.getCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all instance operations that have been performed on the given Cloud SQL instance in the + * reverse chronological order of the start time. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlOperationsServiceClient sqlOperationsServiceClient =
+   *     SqlOperationsServiceClient.create()) {
+   *   SqlOperationsListRequest request =
+   *       SqlOperationsListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setMaxResults(1128457243)
+   *           .setPageToken("pageToken873572522")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   OperationsListResponse response = sqlOperationsServiceClient.list(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 OperationsListResponse list(SqlOperationsListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all instance operations that have been performed on the given Cloud SQL instance in the + * reverse chronological order of the start time. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlOperationsServiceClient sqlOperationsServiceClient =
+   *     SqlOperationsServiceClient.create()) {
+   *   SqlOperationsListRequest request =
+   *       SqlOperationsListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setMaxResults(1128457243)
+   *           .setPageToken("pageToken873572522")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlOperationsServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   OperationsListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels an instance operation that has been performed on 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 (SqlOperationsServiceClient sqlOperationsServiceClient =
+   *     SqlOperationsServiceClient.create()) {
+   *   SqlOperationsCancelRequest request =
+   *       SqlOperationsCancelRequest.newBuilder()
+   *           .setOperation("operation1662702951")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   sqlOperationsServiceClient.cancel(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void cancel(SqlOperationsCancelRequest request) { + cancelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels an instance operation that has been performed on 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 (SqlOperationsServiceClient sqlOperationsServiceClient =
+   *     SqlOperationsServiceClient.create()) {
+   *   SqlOperationsCancelRequest request =
+   *       SqlOperationsCancelRequest.newBuilder()
+   *           .setOperation("operation1662702951")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlOperationsServiceClient.cancelCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable cancelCallable() { + return stub.cancelCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlOperationsServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlOperationsServiceSettings.java new file mode 100644 index 000000000000..b6a7a7378119 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlOperationsServiceSettings.java @@ -0,0 +1,242 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1.stub.SqlOperationsServiceStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlOperationsServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 get: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlOperationsServiceSettings.Builder sqlOperationsServiceSettingsBuilder =
+ *     SqlOperationsServiceSettings.newBuilder();
+ * sqlOperationsServiceSettingsBuilder
+ *     .getSettings()
+ *     .setRetrySettings(
+ *         sqlOperationsServiceSettingsBuilder
+ *             .getSettings()
+ *             .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());
+ * SqlOperationsServiceSettings sqlOperationsServiceSettings =
+ *     sqlOperationsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlOperationsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return ((SqlOperationsServiceStubSettings) getStubSettings()).getSettings(); + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlOperationsServiceStubSettings) getStubSettings()).listSettings(); + } + + /** Returns the object with the settings used for calls to cancel. */ + public UnaryCallSettings cancelSettings() { + return ((SqlOperationsServiceStubSettings) getStubSettings()).cancelSettings(); + } + + public static final SqlOperationsServiceSettings create(SqlOperationsServiceStubSettings stub) + throws IOException { + return new SqlOperationsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlOperationsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlOperationsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlOperationsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlOperationsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlOperationsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlOperationsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlOperationsServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlOperationsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlOperationsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlOperationsServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlOperationsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlOperationsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlOperationsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlOperationsServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlOperationsServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlOperationsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlOperationsServiceStubSettings.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 get. */ + public UnaryCallSettings.Builder getSettings() { + return getStubSettingsBuilder().getSettings(); + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + /** Returns the builder for the settings used for calls to cancel. */ + public UnaryCallSettings.Builder cancelSettings() { + return getStubSettingsBuilder().cancelSettings(); + } + + @Override + public SqlOperationsServiceSettings build() throws IOException { + return new SqlOperationsServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlSslCertsServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlSslCertsServiceClient.java new file mode 100644 index 000000000000..d79d3718bf30 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlSslCertsServiceClient.java @@ -0,0 +1,500 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.stub.SqlSslCertsServiceStub; +import com.google.cloud.sql.v1.stub.SqlSslCertsServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service to manage SSL certs for Cloud SQL instances. + * + *

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 (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+ *   SqlSslCertsDeleteRequest request =
+ *       SqlSslCertsDeleteRequest.newBuilder()
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .setSha1Fingerprint("sha1Fingerprint163009183")
+ *           .build();
+ *   Operation response = sqlSslCertsServiceClient.delete(request);
+ * }
+ * }
+ * + *

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

Delete

Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.

+ *

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

+ *
    + *
  • delete(SqlSslCertsDeleteRequest request) + *

+ *

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

+ *
    + *
  • deleteCallable() + *

+ *

Get

Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation.

+ *

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

+ *
    + *
  • get(SqlSslCertsGetRequest request) + *

+ *

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

+ *
    + *
  • getCallable() + *

+ *

Insert

Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted.

+ *

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

+ *
    + *
  • insert(SqlSslCertsInsertRequest request) + *

+ *

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

+ *
    + *
  • insertCallable() + *

+ *

List

Lists all of the current SSL certificates for the instance.

+ *

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

+ *
    + *
  • list(SqlSslCertsListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *
+ * + *

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 SqlSslCertsServiceSettings 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
+ * SqlSslCertsServiceSettings sqlSslCertsServiceSettings =
+ *     SqlSslCertsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlSslCertsServiceClient sqlSslCertsServiceClient =
+ *     SqlSslCertsServiceClient.create(sqlSslCertsServiceSettings);
+ * }
+ * + *

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
+ * SqlSslCertsServiceSettings sqlSslCertsServiceSettings =
+ *     SqlSslCertsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlSslCertsServiceClient sqlSslCertsServiceClient =
+ *     SqlSslCertsServiceClient.create(sqlSslCertsServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlSslCertsServiceSettings sqlSslCertsServiceSettings =
+ *     SqlSslCertsServiceSettings.newHttpJsonBuilder().build();
+ * SqlSslCertsServiceClient sqlSslCertsServiceClient =
+ *     SqlSslCertsServiceClient.create(sqlSslCertsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlSslCertsServiceClient implements BackgroundResource { + private final @Nullable SqlSslCertsServiceSettings settings; + private final SqlSslCertsServiceStub stub; + + /** Constructs an instance of SqlSslCertsServiceClient with default settings. */ + public static final SqlSslCertsServiceClient create() throws IOException { + return create(SqlSslCertsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlSslCertsServiceClient, 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 SqlSslCertsServiceClient create(SqlSslCertsServiceSettings settings) + throws IOException { + return new SqlSslCertsServiceClient(settings); + } + + /** + * Constructs an instance of SqlSslCertsServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(SqlSslCertsServiceSettings). + */ + public static final SqlSslCertsServiceClient create(SqlSslCertsServiceStub stub) { + return new SqlSslCertsServiceClient(stub); + } + + /** + * Constructs an instance of SqlSslCertsServiceClient, 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 SqlSslCertsServiceClient(SqlSslCertsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlSslCertsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlSslCertsServiceClient(SqlSslCertsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlSslCertsServiceSettings getSettings() { + return settings; + } + + public SqlSslCertsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the SSL certificate. For First Generation instances, the certificate remains valid + * until the instance is restarted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsDeleteRequest request =
+   *       SqlSslCertsDeleteRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSha1Fingerprint("sha1Fingerprint163009183")
+   *           .build();
+   *   Operation response = sqlSslCertsServiceClient.delete(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 Operation delete(SqlSslCertsDeleteRequest request) { + return deleteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the SSL certificate. For First Generation instances, the certificate remains valid + * until the instance is restarted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsDeleteRequest request =
+   *       SqlSslCertsDeleteRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSha1Fingerprint("sha1Fingerprint163009183")
+   *           .build();
+   *   ApiFuture future = sqlSslCertsServiceClient.deleteCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCallable() { + return stub.deleteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a particular SSL certificate. Does not include the private key (required for usage). + * The private key must be saved from the response to initial creation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsGetRequest request =
+   *       SqlSslCertsGetRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSha1Fingerprint("sha1Fingerprint163009183")
+   *           .build();
+   *   SslCert response = sqlSslCertsServiceClient.get(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 SslCert get(SqlSslCertsGetRequest request) { + return getCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a particular SSL certificate. Does not include the private key (required for usage). + * The private key must be saved from the response to initial creation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsGetRequest request =
+   *       SqlSslCertsGetRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSha1Fingerprint("sha1Fingerprint163009183")
+   *           .build();
+   *   ApiFuture future = sqlSslCertsServiceClient.getCallable().futureCall(request);
+   *   // Do something.
+   *   SslCert response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCallable() { + return stub.getCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an SSL certificate and returns it along with the private key and server certificate + * authority. The new certificate will not be usable until the instance is restarted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsInsertRequest request =
+   *       SqlSslCertsInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(SslCertsInsertRequest.newBuilder().build())
+   *           .build();
+   *   SslCertsInsertResponse response = sqlSslCertsServiceClient.insert(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 SslCertsInsertResponse insert(SqlSslCertsInsertRequest request) { + return insertCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an SSL certificate and returns it along with the private key and server certificate + * authority. The new certificate will not be usable until the instance is restarted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsInsertRequest request =
+   *       SqlSslCertsInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(SslCertsInsertRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlSslCertsServiceClient.insertCallable().futureCall(request);
+   *   // Do something.
+   *   SslCertsInsertResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable insertCallable() { + return stub.insertCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all of the current SSL certificates for the 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 (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsListRequest request =
+   *       SqlSslCertsListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   SslCertsListResponse response = sqlSslCertsServiceClient.list(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 SslCertsListResponse list(SqlSslCertsListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all of the current SSL certificates for the 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 (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsListRequest request =
+   *       SqlSslCertsListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlSslCertsServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   SslCertsListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlSslCertsServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlSslCertsServiceSettings.java new file mode 100644 index 000000000000..6c5664bc22d0 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlSslCertsServiceSettings.java @@ -0,0 +1,250 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1.stub.SqlSslCertsServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlSslCertsServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlSslCertsServiceSettings.Builder sqlSslCertsServiceSettingsBuilder =
+ *     SqlSslCertsServiceSettings.newBuilder();
+ * sqlSslCertsServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlSslCertsServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlSslCertsServiceSettings sqlSslCertsServiceSettings =
+ *     sqlSslCertsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlSslCertsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return ((SqlSslCertsServiceStubSettings) getStubSettings()).deleteSettings(); + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return ((SqlSslCertsServiceStubSettings) getStubSettings()).getSettings(); + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return ((SqlSslCertsServiceStubSettings) getStubSettings()).insertSettings(); + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlSslCertsServiceStubSettings) getStubSettings()).listSettings(); + } + + public static final SqlSslCertsServiceSettings create(SqlSslCertsServiceStubSettings stub) + throws IOException { + return new SqlSslCertsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlSslCertsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlSslCertsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlSslCertsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlSslCertsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlSslCertsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlSslCertsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlSslCertsServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlSslCertsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlSslCertsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlSslCertsServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlSslCertsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlSslCertsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlSslCertsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlSslCertsServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlSslCertsServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlSslCertsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlSslCertsServiceStubSettings.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 delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return getStubSettingsBuilder().deleteSettings(); + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getStubSettingsBuilder().getSettings(); + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder + insertSettings() { + return getStubSettingsBuilder().insertSettings(); + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + @Override + public SqlSslCertsServiceSettings build() throws IOException { + return new SqlSslCertsServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlTiersServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlTiersServiceClient.java new file mode 100644 index 000000000000..bfbcac66d0ec --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlTiersServiceClient.java @@ -0,0 +1,266 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.stub.SqlTiersServiceStub; +import com.google.cloud.sql.v1.stub.SqlTiersServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for providing machine types (tiers) for Cloud SQL instances. + * + *

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 (SqlTiersServiceClient sqlTiersServiceClient = SqlTiersServiceClient.create()) {
+ *   SqlTiersListRequest request =
+ *       SqlTiersListRequest.newBuilder().setProject("project-309310695").build();
+ *   TiersListResponse response = sqlTiersServiceClient.list(request);
+ * }
+ * }
+ * + *

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

List

Lists all available machine types (tiers) for Cloud SQL, for example, `db-custom-1-3840`. For more information, see https://cloud.google.com/sql/pricing.

+ *

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

+ *
    + *
  • list(SqlTiersListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *
+ * + *

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 SqlTiersServiceSettings 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
+ * SqlTiersServiceSettings sqlTiersServiceSettings =
+ *     SqlTiersServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlTiersServiceClient sqlTiersServiceClient =
+ *     SqlTiersServiceClient.create(sqlTiersServiceSettings);
+ * }
+ * + *

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
+ * SqlTiersServiceSettings sqlTiersServiceSettings =
+ *     SqlTiersServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlTiersServiceClient sqlTiersServiceClient =
+ *     SqlTiersServiceClient.create(sqlTiersServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlTiersServiceSettings sqlTiersServiceSettings =
+ *     SqlTiersServiceSettings.newHttpJsonBuilder().build();
+ * SqlTiersServiceClient sqlTiersServiceClient =
+ *     SqlTiersServiceClient.create(sqlTiersServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlTiersServiceClient implements BackgroundResource { + private final @Nullable SqlTiersServiceSettings settings; + private final SqlTiersServiceStub stub; + + /** Constructs an instance of SqlTiersServiceClient with default settings. */ + public static final SqlTiersServiceClient create() throws IOException { + return create(SqlTiersServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlTiersServiceClient, 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 SqlTiersServiceClient create(SqlTiersServiceSettings settings) + throws IOException { + return new SqlTiersServiceClient(settings); + } + + /** + * Constructs an instance of SqlTiersServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SqlTiersServiceSettings). + */ + public static final SqlTiersServiceClient create(SqlTiersServiceStub stub) { + return new SqlTiersServiceClient(stub); + } + + /** + * Constructs an instance of SqlTiersServiceClient, 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 SqlTiersServiceClient(SqlTiersServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlTiersServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlTiersServiceClient(SqlTiersServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlTiersServiceSettings getSettings() { + return settings; + } + + public SqlTiersServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all available machine types (tiers) for Cloud SQL, for example, `db-custom-1-3840`. For + * more information, see https://cloud.google.com/sql/pricing. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlTiersServiceClient sqlTiersServiceClient = SqlTiersServiceClient.create()) {
+   *   SqlTiersListRequest request =
+   *       SqlTiersListRequest.newBuilder().setProject("project-309310695").build();
+   *   TiersListResponse response = sqlTiersServiceClient.list(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 TiersListResponse list(SqlTiersListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all available machine types (tiers) for Cloud SQL, for example, `db-custom-1-3840`. For + * more information, see https://cloud.google.com/sql/pricing. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlTiersServiceClient sqlTiersServiceClient = SqlTiersServiceClient.create()) {
+   *   SqlTiersListRequest request =
+   *       SqlTiersListRequest.newBuilder().setProject("project-309310695").build();
+   *   ApiFuture future =
+   *       sqlTiersServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   TiersListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlTiersServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlTiersServiceSettings.java new file mode 100644 index 000000000000..93cfab9b28f5 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlTiersServiceSettings.java @@ -0,0 +1,218 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1.stub.SqlTiersServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlTiersServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 list: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlTiersServiceSettings.Builder sqlTiersServiceSettingsBuilder =
+ *     SqlTiersServiceSettings.newBuilder();
+ * sqlTiersServiceSettingsBuilder
+ *     .listSettings()
+ *     .setRetrySettings(
+ *         sqlTiersServiceSettingsBuilder
+ *             .listSettings()
+ *             .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());
+ * SqlTiersServiceSettings sqlTiersServiceSettings = sqlTiersServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlTiersServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlTiersServiceStubSettings) getStubSettings()).listSettings(); + } + + public static final SqlTiersServiceSettings create(SqlTiersServiceStubSettings stub) + throws IOException { + return new SqlTiersServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlTiersServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlTiersServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlTiersServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlTiersServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlTiersServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlTiersServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlTiersServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlTiersServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlTiersServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlTiersServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlTiersServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlTiersServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlTiersServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlTiersServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlTiersServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlTiersServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlTiersServiceStubSettings.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 list. */ + public UnaryCallSettings.Builder listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + @Override + public SqlTiersServiceSettings build() throws IOException { + return new SqlTiersServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlUsersServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlUsersServiceClient.java new file mode 100644 index 000000000000..666a12be1c08 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlUsersServiceClient.java @@ -0,0 +1,579 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.stub.SqlUsersServiceStub; +import com.google.cloud.sql.v1.stub.SqlUsersServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Cloud SQL users service. + * + *

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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+ *   SqlUsersDeleteRequest request =
+ *       SqlUsersDeleteRequest.newBuilder()
+ *           .setHost("host3208616")
+ *           .setInstance("instance555127957")
+ *           .setName("name3373707")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlUsersServiceClient.delete(request);
+ * }
+ * }
+ * + *

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

Delete

Deletes a user from a Cloud SQL instance.

+ *

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

+ *
    + *
  • delete(SqlUsersDeleteRequest request) + *

+ *

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

+ *
    + *
  • deleteCallable() + *

+ *

Get

Retrieves a resource containing information about a user.

+ *

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

+ *
    + *
  • get(SqlUsersGetRequest request) + *

+ *

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

+ *
    + *
  • getCallable() + *

+ *

Insert

Creates a new user in a Cloud SQL instance.

+ *

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

+ *
    + *
  • insert(SqlUsersInsertRequest request) + *

+ *

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

+ *
    + *
  • insertCallable() + *

+ *

List

Lists users in the specified Cloud SQL instance.

+ *

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

+ *
    + *
  • list(SqlUsersListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *

Update

Updates an existing user in a Cloud SQL instance.

+ *

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

+ *
    + *
  • update(SqlUsersUpdateRequest request) + *

+ *

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

+ *
    + *
  • updateCallable() + *

+ *
+ * + *

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 SqlUsersServiceSettings 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
+ * SqlUsersServiceSettings sqlUsersServiceSettings =
+ *     SqlUsersServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlUsersServiceClient sqlUsersServiceClient =
+ *     SqlUsersServiceClient.create(sqlUsersServiceSettings);
+ * }
+ * + *

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
+ * SqlUsersServiceSettings sqlUsersServiceSettings =
+ *     SqlUsersServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlUsersServiceClient sqlUsersServiceClient =
+ *     SqlUsersServiceClient.create(sqlUsersServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlUsersServiceSettings sqlUsersServiceSettings =
+ *     SqlUsersServiceSettings.newHttpJsonBuilder().build();
+ * SqlUsersServiceClient sqlUsersServiceClient =
+ *     SqlUsersServiceClient.create(sqlUsersServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlUsersServiceClient implements BackgroundResource { + private final @Nullable SqlUsersServiceSettings settings; + private final SqlUsersServiceStub stub; + + /** Constructs an instance of SqlUsersServiceClient with default settings. */ + public static final SqlUsersServiceClient create() throws IOException { + return create(SqlUsersServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlUsersServiceClient, 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 SqlUsersServiceClient create(SqlUsersServiceSettings settings) + throws IOException { + return new SqlUsersServiceClient(settings); + } + + /** + * Constructs an instance of SqlUsersServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SqlUsersServiceSettings). + */ + public static final SqlUsersServiceClient create(SqlUsersServiceStub stub) { + return new SqlUsersServiceClient(stub); + } + + /** + * Constructs an instance of SqlUsersServiceClient, 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 SqlUsersServiceClient(SqlUsersServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlUsersServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlUsersServiceClient(SqlUsersServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlUsersServiceSettings getSettings() { + return settings; + } + + public SqlUsersServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user from a Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersDeleteRequest request =
+   *       SqlUsersDeleteRequest.newBuilder()
+   *           .setHost("host3208616")
+   *           .setInstance("instance555127957")
+   *           .setName("name3373707")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlUsersServiceClient.delete(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 Operation delete(SqlUsersDeleteRequest request) { + return deleteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user from a Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersDeleteRequest request =
+   *       SqlUsersDeleteRequest.newBuilder()
+   *           .setHost("host3208616")
+   *           .setInstance("instance555127957")
+   *           .setName("name3373707")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlUsersServiceClient.deleteCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCallable() { + return stub.deleteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a user. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersGetRequest request =
+   *       SqlUsersGetRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setName("name3373707")
+   *           .setProject("project-309310695")
+   *           .setHost("host3208616")
+   *           .build();
+   *   User response = sqlUsersServiceClient.get(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 User get(SqlUsersGetRequest request) { + return getCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a user. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersGetRequest request =
+   *       SqlUsersGetRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setName("name3373707")
+   *           .setProject("project-309310695")
+   *           .setHost("host3208616")
+   *           .build();
+   *   ApiFuture future = sqlUsersServiceClient.getCallable().futureCall(request);
+   *   // Do something.
+   *   User response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCallable() { + return stub.getCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new user in a Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersInsertRequest request =
+   *       SqlUsersInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(User.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlUsersServiceClient.insert(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 Operation insert(SqlUsersInsertRequest request) { + return insertCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new user in a Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersInsertRequest request =
+   *       SqlUsersInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(User.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlUsersServiceClient.insertCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable insertCallable() { + return stub.insertCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists users in the specified Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersListRequest request =
+   *       SqlUsersListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   UsersListResponse response = sqlUsersServiceClient.list(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 UsersListResponse list(SqlUsersListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists users in the specified Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersListRequest request =
+   *       SqlUsersListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlUsersServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   UsersListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing user in a Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersUpdateRequest request =
+   *       SqlUsersUpdateRequest.newBuilder()
+   *           .setHost("host3208616")
+   *           .setInstance("instance555127957")
+   *           .setName("name3373707")
+   *           .setProject("project-309310695")
+   *           .addAllDatabaseRoles(new ArrayList())
+   *           .setRevokeExistingRoles(true)
+   *           .setBody(User.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlUsersServiceClient.update(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 Operation update(SqlUsersUpdateRequest request) { + return updateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing user in a Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersUpdateRequest request =
+   *       SqlUsersUpdateRequest.newBuilder()
+   *           .setHost("host3208616")
+   *           .setInstance("instance555127957")
+   *           .setName("name3373707")
+   *           .setProject("project-309310695")
+   *           .addAllDatabaseRoles(new ArrayList())
+   *           .setRevokeExistingRoles(true)
+   *           .setBody(User.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlUsersServiceClient.updateCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateCallable() { + return stub.updateCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlUsersServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlUsersServiceSettings.java new file mode 100644 index 000000000000..b759ffab9b7b --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/SqlUsersServiceSettings.java @@ -0,0 +1,258 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1.stub.SqlUsersServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlUsersServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlUsersServiceSettings.Builder sqlUsersServiceSettingsBuilder =
+ *     SqlUsersServiceSettings.newBuilder();
+ * sqlUsersServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlUsersServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlUsersServiceSettings sqlUsersServiceSettings = sqlUsersServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class SqlUsersServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return ((SqlUsersServiceStubSettings) getStubSettings()).deleteSettings(); + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return ((SqlUsersServiceStubSettings) getStubSettings()).getSettings(); + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return ((SqlUsersServiceStubSettings) getStubSettings()).insertSettings(); + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlUsersServiceStubSettings) getStubSettings()).listSettings(); + } + + /** Returns the object with the settings used for calls to update. */ + public UnaryCallSettings updateSettings() { + return ((SqlUsersServiceStubSettings) getStubSettings()).updateSettings(); + } + + public static final SqlUsersServiceSettings create(SqlUsersServiceStubSettings stub) + throws IOException { + return new SqlUsersServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlUsersServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlUsersServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlUsersServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlUsersServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlUsersServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlUsersServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlUsersServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlUsersServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlUsersServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlUsersServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlUsersServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlUsersServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlUsersServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlUsersServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlUsersServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlUsersServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlUsersServiceStubSettings.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 delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return getStubSettingsBuilder().deleteSettings(); + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getStubSettingsBuilder().getSettings(); + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return getStubSettingsBuilder().insertSettings(); + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + /** Returns the builder for the settings used for calls to update. */ + public UnaryCallSettings.Builder updateSettings() { + return getStubSettingsBuilder().updateSettings(); + } + + @Override + public SqlUsersServiceSettings build() throws IOException { + return new SqlUsersServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/gapic_metadata.json b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/gapic_metadata.json new file mode 100644 index 000000000000..694a58a15fad --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/gapic_metadata.json @@ -0,0 +1,324 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.sql.v1", + "libraryPackage": "com.google.cloud.sql.v1", + "services": { + "SqlBackupRunsService": { + "clients": { + "grpc": { + "libraryClient": "SqlBackupRunsServiceClient", + "rpcs": { + "Delete": { + "methods": ["delete", "deleteCallable"] + }, + "Get": { + "methods": ["get", "getCallable"] + }, + "Insert": { + "methods": ["insert", "insertCallable"] + }, + "List": { + "methods": ["list", "listCallable"] + } + } + } + } + }, + "SqlBackupsService": { + "clients": { + "grpc": { + "libraryClient": "SqlBackupsServiceClient", + "rpcs": { + "CreateBackup": { + "methods": ["createBackup", "createBackup", "createBackup", "createBackupCallable"] + }, + "DeleteBackup": { + "methods": ["deleteBackup", "deleteBackup", "deleteBackup", "deleteBackupCallable"] + }, + "GetBackup": { + "methods": ["getBackup", "getBackup", "getBackup", "getBackupCallable"] + }, + "ListBackups": { + "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] + }, + "UpdateBackup": { + "methods": ["updateBackup", "updateBackup", "updateBackupCallable"] + } + } + } + } + }, + "SqlConnectService": { + "clients": { + "grpc": { + "libraryClient": "SqlConnectServiceClient", + "rpcs": { + "GenerateEphemeralCert": { + "methods": ["generateEphemeralCert", "generateEphemeralCertCallable"] + }, + "GetConnectSettings": { + "methods": ["getConnectSettings", "getConnectSettingsCallable"] + }, + "ResolveConnectSettings": { + "methods": ["resolveConnectSettings", "resolveConnectSettingsCallable"] + } + } + } + } + }, + "SqlDatabasesService": { + "clients": { + "grpc": { + "libraryClient": "SqlDatabasesServiceClient", + "rpcs": { + "Delete": { + "methods": ["delete", "deleteCallable"] + }, + "Get": { + "methods": ["get", "getCallable"] + }, + "Insert": { + "methods": ["insert", "insertCallable"] + }, + "List": { + "methods": ["list", "listCallable"] + }, + "Patch": { + "methods": ["patch", "patchCallable"] + }, + "Update": { + "methods": ["update", "updateCallable"] + } + } + } + } + }, + "SqlFlagsService": { + "clients": { + "grpc": { + "libraryClient": "SqlFlagsServiceClient", + "rpcs": { + "List": { + "methods": ["list", "listCallable"] + } + } + } + } + }, + "SqlInstancesService": { + "clients": { + "grpc": { + "libraryClient": "SqlInstancesServiceClient", + "rpcs": { + "AcquireSsrsLease": { + "methods": ["acquireSsrsLease", "acquireSsrsLeaseCallable"] + }, + "AddEntraIdCertificate": { + "methods": ["addEntraIdCertificate", "addEntraIdCertificateCallable"] + }, + "AddServerCa": { + "methods": ["addServerCa", "addServerCaCallable"] + }, + "AddServerCertificate": { + "methods": ["addServerCertificate", "addServerCertificateCallable"] + }, + "Clone": { + "methods": ["clone", "cloneCallable"] + }, + "CreateEphemeral": { + "methods": ["createEphemeral", "createEphemeralCallable"] + }, + "Delete": { + "methods": ["delete", "deleteCallable"] + }, + "Demote": { + "methods": ["demote", "demoteCallable"] + }, + "DemoteMaster": { + "methods": ["demoteMaster", "demoteMasterCallable"] + }, + "ExecuteSql": { + "methods": ["executeSql", "executeSqlCallable"] + }, + "Export": { + "methods": ["export", "exportCallable"] + }, + "Failover": { + "methods": ["failover", "failoverCallable"] + }, + "Get": { + "methods": ["get", "getCallable"] + }, + "GetDiskShrinkConfig": { + "methods": ["getDiskShrinkConfig", "getDiskShrinkConfigCallable"] + }, + "GetLatestRecoveryTime": { + "methods": ["getLatestRecoveryTime", "getLatestRecoveryTimeCallable"] + }, + "Import": { + "methods": ["import_", "import_Callable"] + }, + "Insert": { + "methods": ["insert", "insertCallable"] + }, + "List": { + "methods": ["list", "listCallable"] + }, + "ListEntraIdCertificates": { + "methods": ["listEntraIdCertificates", "listEntraIdCertificatesCallable"] + }, + "ListServerCas": { + "methods": ["listServerCas", "listServerCasCallable"] + }, + "ListServerCertificates": { + "methods": ["listServerCertificates", "listServerCertificatesCallable"] + }, + "Patch": { + "methods": ["patch", "patchCallable"] + }, + "PerformDiskShrink": { + "methods": ["performDiskShrink", "performDiskShrinkCallable"] + }, + "PointInTimeRestore": { + "methods": ["pointInTimeRestore", "pointInTimeRestoreCallable"] + }, + "PreCheckMajorVersionUpgrade": { + "methods": ["preCheckMajorVersionUpgrade", "preCheckMajorVersionUpgradeCallable"] + }, + "PromoteReplica": { + "methods": ["promoteReplica", "promoteReplicaCallable"] + }, + "Reencrypt": { + "methods": ["reencrypt", "reencryptCallable"] + }, + "ReleaseSsrsLease": { + "methods": ["releaseSsrsLease", "releaseSsrsLeaseCallable"] + }, + "RescheduleMaintenance": { + "methods": ["rescheduleMaintenance", "rescheduleMaintenanceCallable"] + }, + "ResetReplicaSize": { + "methods": ["resetReplicaSize", "resetReplicaSizeCallable"] + }, + "ResetSslConfig": { + "methods": ["resetSslConfig", "resetSslConfigCallable"] + }, + "Restart": { + "methods": ["restart", "restartCallable"] + }, + "RestoreBackup": { + "methods": ["restoreBackup", "restoreBackupCallable"] + }, + "RotateEntraIdCertificate": { + "methods": ["rotateEntraIdCertificate", "rotateEntraIdCertificateCallable"] + }, + "RotateServerCa": { + "methods": ["rotateServerCa", "rotateServerCaCallable"] + }, + "RotateServerCertificate": { + "methods": ["rotateServerCertificate", "rotateServerCertificateCallable"] + }, + "StartExternalSync": { + "methods": ["startExternalSync", "startExternalSyncCallable"] + }, + "StartReplica": { + "methods": ["startReplica", "startReplicaCallable"] + }, + "StopReplica": { + "methods": ["stopReplica", "stopReplicaCallable"] + }, + "Switchover": { + "methods": ["switchover", "switchoverCallable"] + }, + "TruncateLog": { + "methods": ["truncateLog", "truncateLogCallable"] + }, + "Update": { + "methods": ["update", "updateCallable"] + }, + "VerifyExternalSyncSettings": { + "methods": ["verifyExternalSyncSettings", "verifyExternalSyncSettingsCallable"] + } + } + } + } + }, + "SqlOperationsService": { + "clients": { + "grpc": { + "libraryClient": "SqlOperationsServiceClient", + "rpcs": { + "Cancel": { + "methods": ["cancel", "cancelCallable"] + }, + "Get": { + "methods": ["get", "getCallable"] + }, + "List": { + "methods": ["list", "listCallable"] + } + } + } + } + }, + "SqlSslCertsService": { + "clients": { + "grpc": { + "libraryClient": "SqlSslCertsServiceClient", + "rpcs": { + "Delete": { + "methods": ["delete", "deleteCallable"] + }, + "Get": { + "methods": ["get", "getCallable"] + }, + "Insert": { + "methods": ["insert", "insertCallable"] + }, + "List": { + "methods": ["list", "listCallable"] + } + } + } + } + }, + "SqlTiersService": { + "clients": { + "grpc": { + "libraryClient": "SqlTiersServiceClient", + "rpcs": { + "List": { + "methods": ["list", "listCallable"] + } + } + } + } + }, + "SqlUsersService": { + "clients": { + "grpc": { + "libraryClient": "SqlUsersServiceClient", + "rpcs": { + "Delete": { + "methods": ["delete", "deleteCallable"] + }, + "Get": { + "methods": ["get", "getCallable"] + }, + "Insert": { + "methods": ["insert", "insertCallable"] + }, + "List": { + "methods": ["list", "listCallable"] + }, + "Update": { + "methods": ["update", "updateCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/package-info.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/package-info.java new file mode 100644 index 000000000000..e7caf63fa7ce --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/package-info.java @@ -0,0 +1,243 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 Cloud SQL Admin API + * + *

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

======================= SqlBackupRunsServiceClient ======================= + * + *

Service Description: Service for managing database backups. + * + *

Sample for SqlBackupRunsServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+ *     SqlBackupRunsServiceClient.create()) {
+ *   SqlBackupRunsDeleteRequest request =
+ *       SqlBackupRunsDeleteRequest.newBuilder()
+ *           .setId(3355)
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlBackupRunsServiceClient.delete(request);
+ * }
+ * }
+ * + *

======================= SqlBackupsServiceClient ======================= + * + *

Sample for SqlBackupsServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   Backup backup = Backup.newBuilder().build();
+ *   Operation response = sqlBackupsServiceClient.createBackup(parent, backup);
+ * }
+ * }
+ * + *

======================= SqlConnectServiceClient ======================= + * + *

Service Description: Cloud SQL connect service. + * + *

Sample for SqlConnectServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+ *   GetConnectSettingsRequest request =
+ *       GetConnectSettingsRequest.newBuilder()
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .setReadTime(Timestamp.newBuilder().build())
+ *           .build();
+ *   ConnectSettings response = sqlConnectServiceClient.getConnectSettings(request);
+ * }
+ * }
+ * + *

======================= SqlDatabasesServiceClient ======================= + * + *

Service Description: Service to manage databases. + * + *

Sample for SqlDatabasesServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+ *   SqlDatabasesDeleteRequest request =
+ *       SqlDatabasesDeleteRequest.newBuilder()
+ *           .setDatabase("database1789464955")
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlDatabasesServiceClient.delete(request);
+ * }
+ * }
+ * + *

======================= SqlFlagsServiceClient ======================= + * + *

Service Description: Service to manage database flags for Cloud SQL instances. + * + *

Sample for SqlFlagsServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlFlagsServiceClient sqlFlagsServiceClient = SqlFlagsServiceClient.create()) {
+ *   SqlFlagsListRequest request =
+ *       SqlFlagsListRequest.newBuilder()
+ *           .setDatabaseVersion("databaseVersion1250955997")
+ *           .setFlagScope(SqlFlagScope.forNumber(0))
+ *           .build();
+ *   FlagsListResponse response = sqlFlagsServiceClient.list(request);
+ * }
+ * }
+ * + *

======================= SqlInstancesServiceClient ======================= + * + *

Sample for SqlInstancesServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+ *   SqlInstancesAddServerCaRequest request =
+ *       SqlInstancesAddServerCaRequest.newBuilder()
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlInstancesServiceClient.addServerCa(request);
+ * }
+ * }
+ * + *

======================= SqlOperationsServiceClient ======================= + * + *

Service Description: Service to fetch operations for database instances. + * + *

Sample for SqlOperationsServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlOperationsServiceClient sqlOperationsServiceClient =
+ *     SqlOperationsServiceClient.create()) {
+ *   SqlOperationsGetRequest request =
+ *       SqlOperationsGetRequest.newBuilder()
+ *           .setOperation("operation1662702951")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlOperationsServiceClient.get(request);
+ * }
+ * }
+ * + *

======================= SqlSslCertsServiceClient ======================= + * + *

Service Description: Service to manage SSL certs for Cloud SQL instances. + * + *

Sample for SqlSslCertsServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+ *   SqlSslCertsDeleteRequest request =
+ *       SqlSslCertsDeleteRequest.newBuilder()
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .setSha1Fingerprint("sha1Fingerprint163009183")
+ *           .build();
+ *   Operation response = sqlSslCertsServiceClient.delete(request);
+ * }
+ * }
+ * + *

======================= SqlTiersServiceClient ======================= + * + *

Service Description: Service for providing machine types (tiers) for Cloud SQL instances. + * + *

Sample for SqlTiersServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlTiersServiceClient sqlTiersServiceClient = SqlTiersServiceClient.create()) {
+ *   SqlTiersListRequest request =
+ *       SqlTiersListRequest.newBuilder().setProject("project-309310695").build();
+ *   TiersListResponse response = sqlTiersServiceClient.list(request);
+ * }
+ * }
+ * + *

======================= SqlUsersServiceClient ======================= + * + *

Service Description: Cloud SQL users service. + * + *

Sample for SqlUsersServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+ *   SqlUsersDeleteRequest request =
+ *       SqlUsersDeleteRequest.newBuilder()
+ *           .setHost("host3208616")
+ *           .setInstance("instance555127957")
+ *           .setName("name3373707")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlUsersServiceClient.delete(request);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.sql.v1; + +import javax.annotation.Generated; diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlBackupRunsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlBackupRunsServiceCallableFactory.java new file mode 100644 index 000000000000..1a299dace27f --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlBackupRunsServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlBackupRunsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlBackupRunsServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlBackupRunsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlBackupRunsServiceStub.java new file mode 100644 index 000000000000..1786a20a6430 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlBackupRunsServiceStub.java @@ -0,0 +1,307 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1.BackupRun; +import com.google.cloud.sql.v1.BackupRunsListResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest; +import com.google.cloud.sql.v1.SqlBackupRunsGetRequest; +import com.google.cloud.sql.v1.SqlBackupRunsInsertRequest; +import com.google.cloud.sql.v1.SqlBackupRunsListRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlBackupRunsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlBackupRunsServiceStub extends SqlBackupRunsServiceStub { + private static final MethodDescriptor + deleteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlBackupRunsService/Delete") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlBackupRunsDeleteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlBackupRunsService/Get") + .setRequestMarshaller(ProtoUtils.marshaller(SqlBackupRunsGetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BackupRun.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + insertMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlBackupRunsService/Insert") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlBackupRunsInsertRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlBackupRunsService/List") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlBackupRunsListRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BackupRunsListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/backupRuns/{id}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/backupRuns/{id}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + + public static final GrpcSqlBackupRunsServiceStub create(SqlBackupRunsServiceStubSettings settings) + throws IOException { + return new GrpcSqlBackupRunsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlBackupRunsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlBackupRunsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlBackupRunsServiceStub, 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 GrpcSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlBackupRunsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlBackupRunsServiceStub, 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 GrpcSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings deleteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("id", String.valueOf(request.getId())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("id", String.valueOf(request.getId())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings getTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("id", String.valueOf(request.getId())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("id", String.valueOf(request.getId())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings insertTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlBackupsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlBackupsServiceCallableFactory.java new file mode 100644 index 000000000000..1fe25b56d377 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlBackupsServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlBackupsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlBackupsServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlBackupsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlBackupsServiceStub.java new file mode 100644 index 000000000000..9df16213ec8e --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlBackupsServiceStub.java @@ -0,0 +1,302 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import static com.google.cloud.sql.v1.SqlBackupsServiceClient.ListBackupsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.CreateBackupRequest; +import com.google.cloud.sql.v1.DeleteBackupRequest; +import com.google.cloud.sql.v1.GetBackupRequest; +import com.google.cloud.sql.v1.ListBackupsRequest; +import com.google.cloud.sql.v1.ListBackupsResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.UpdateBackupRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlBackupsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlBackupsServiceStub extends SqlBackupsServiceStub { + private static final MethodDescriptor + createBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlBackupsService/CreateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlBackupsService/GetBackup") + .setRequestMarshaller(ProtoUtils.marshaller(GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Backup.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listBackupsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlBackupsService/ListBackups") + .setRequestMarshaller(ProtoUtils.marshaller(ListBackupsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBackupsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlBackupsService/UpdateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlBackupsService/DeleteBackup") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createBackupCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable + listBackupsPagedCallable; + private final UnaryCallable updateBackupCallable; + private final UnaryCallable deleteBackupCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSqlBackupsServiceStub create(SqlBackupsServiceStubSettings settings) + throws IOException { + return new GrpcSqlBackupsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlBackupsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlBackupsServiceStub( + SqlBackupsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlBackupsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlBackupsServiceStub( + SqlBackupsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlBackupsServiceStub, 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 GrpcSqlBackupsServiceStub( + SqlBackupsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlBackupsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlBackupsServiceStub, 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 GrpcSqlBackupsServiceStub( + SqlBackupsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings getBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings listBackupsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings updateBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("backup.name", String.valueOf(request.getBackup().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + + this.createBackupCallable = + callableFactory.createUnaryCallable( + createBackupTransportSettings, settings.createBackupSettings(), clientContext); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.listBackupsPagedCallable = + callableFactory.createPagedCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.updateBackupCallable = + callableFactory.createUnaryCallable( + updateBackupTransportSettings, settings.updateBackupSettings(), clientContext); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createBackupCallable() { + return createBackupCallable; + } + + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable listBackupsPagedCallable() { + return listBackupsPagedCallable; + } + + @Override + public UnaryCallable updateBackupCallable() { + return updateBackupCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlConnectServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlConnectServiceCallableFactory.java new file mode 100644 index 000000000000..eaeed2b960ce --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlConnectServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlConnectService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlConnectServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlConnectServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlConnectServiceStub.java new file mode 100644 index 000000000000..53d49417bb1d --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlConnectServiceStub.java @@ -0,0 +1,247 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.ConnectSettings; +import com.google.cloud.sql.v1.GenerateEphemeralCertRequest; +import com.google.cloud.sql.v1.GenerateEphemeralCertResponse; +import com.google.cloud.sql.v1.GetConnectSettingsRequest; +import com.google.cloud.sql.v1.ResolveConnectSettingsRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlConnectService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlConnectServiceStub extends SqlConnectServiceStub { + private static final MethodDescriptor + getConnectSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlConnectService/GetConnectSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(GetConnectSettingsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ConnectSettings.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + resolveConnectSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlConnectService/ResolveConnectSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(ResolveConnectSettingsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ConnectSettings.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + generateEphemeralCertMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlConnectService/GenerateEphemeralCert") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateEphemeralCertRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateEphemeralCertResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable + getConnectSettingsCallable; + private final UnaryCallable + resolveConnectSettingsCallable; + private final UnaryCallable + generateEphemeralCertCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSqlConnectServiceStub create(SqlConnectServiceStubSettings settings) + throws IOException { + return new GrpcSqlConnectServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlConnectServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlConnectServiceStub( + SqlConnectServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlConnectServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlConnectServiceStub( + SqlConnectServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlConnectServiceStub, 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 GrpcSqlConnectServiceStub( + SqlConnectServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlConnectServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlConnectServiceStub, 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 GrpcSqlConnectServiceStub( + SqlConnectServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + getConnectSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getConnectSettingsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .build(); + GrpcCallSettings + resolveConnectSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(resolveConnectSettingsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("dns_name", String.valueOf(request.getDnsName())); + builder.add("location", String.valueOf(request.getLocation())); + return builder.build(); + }) + .build(); + GrpcCallSettings + generateEphemeralCertTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(generateEphemeralCertMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .build(); + + this.getConnectSettingsCallable = + callableFactory.createUnaryCallable( + getConnectSettingsTransportSettings, + settings.getConnectSettingsSettings(), + clientContext); + this.resolveConnectSettingsCallable = + callableFactory.createUnaryCallable( + resolveConnectSettingsTransportSettings, + settings.resolveConnectSettingsSettings(), + clientContext); + this.generateEphemeralCertCallable = + callableFactory.createUnaryCallable( + generateEphemeralCertTransportSettings, + settings.generateEphemeralCertSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getConnectSettingsCallable() { + return getConnectSettingsCallable; + } + + @Override + public UnaryCallable + resolveConnectSettingsCallable() { + return resolveConnectSettingsCallable; + } + + @Override + public UnaryCallable + generateEphemeralCertCallable() { + return generateEphemeralCertCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlDatabasesServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlDatabasesServiceCallableFactory.java new file mode 100644 index 000000000000..2bf87ba8e3f2 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlDatabasesServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlDatabasesService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlDatabasesServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlDatabasesServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlDatabasesServiceStub.java new file mode 100644 index 000000000000..557402edc639 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlDatabasesServiceStub.java @@ -0,0 +1,392 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1.Database; +import com.google.cloud.sql.v1.DatabasesListResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlDatabasesDeleteRequest; +import com.google.cloud.sql.v1.SqlDatabasesGetRequest; +import com.google.cloud.sql.v1.SqlDatabasesInsertRequest; +import com.google.cloud.sql.v1.SqlDatabasesListRequest; +import com.google.cloud.sql.v1.SqlDatabasesUpdateRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlDatabasesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlDatabasesServiceStub extends SqlDatabasesServiceStub { + private static final MethodDescriptor + deleteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlDatabasesService/Delete") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlDatabasesDeleteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlDatabasesService/Get") + .setRequestMarshaller(ProtoUtils.marshaller(SqlDatabasesGetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Database.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + insertMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlDatabasesService/Insert") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlDatabasesInsertRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlDatabasesService/List") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlDatabasesListRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(DatabasesListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + patchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlDatabasesService/Patch") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlDatabasesUpdateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlDatabasesService/Update") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlDatabasesUpdateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + private final UnaryCallable patchCallable; + private final UnaryCallable updateCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PATCH_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + private static final PathTemplate UPDATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + + public static final GrpcSqlDatabasesServiceStub create(SqlDatabasesServiceStubSettings settings) + throws IOException { + return new GrpcSqlDatabasesServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlDatabasesServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlDatabasesServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlDatabasesServiceStub, 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 GrpcSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlDatabasesServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlDatabasesServiceStub, 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 GrpcSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings deleteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings getTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings insertTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings patchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(patchMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PATCH_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings updateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return UPDATE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.patchCallable = + callableFactory.createUnaryCallable( + patchTransportSettings, settings.patchSettings(), clientContext); + this.updateCallable = + callableFactory.createUnaryCallable( + updateTransportSettings, settings.updateSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable patchCallable() { + return patchCallable; + } + + @Override + public UnaryCallable updateCallable() { + return updateCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlFlagsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlFlagsServiceCallableFactory.java new file mode 100644 index 000000000000..028691f82e58 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlFlagsServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlFlagsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlFlagsServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlFlagsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlFlagsServiceStub.java new file mode 100644 index 000000000000..a0ad245b46e7 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlFlagsServiceStub.java @@ -0,0 +1,157 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.FlagsListResponse; +import com.google.cloud.sql.v1.SqlFlagsListRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlFlagsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlFlagsServiceStub extends SqlFlagsServiceStub { + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlFlagsService/List") + .setRequestMarshaller(ProtoUtils.marshaller(SqlFlagsListRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(FlagsListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSqlFlagsServiceStub create(SqlFlagsServiceStubSettings settings) + throws IOException { + return new GrpcSqlFlagsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlFlagsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlFlagsServiceStub( + SqlFlagsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlFlagsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlFlagsServiceStub( + SqlFlagsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlFlagsServiceStub, 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 GrpcSqlFlagsServiceStub( + SqlFlagsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlFlagsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlFlagsServiceStub, 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 GrpcSqlFlagsServiceStub( + SqlFlagsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .build(); + + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlInstancesServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlInstancesServiceCallableFactory.java new file mode 100644 index 000000000000..0e4efcbfcfcb --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlInstancesServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlInstancesService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlInstancesServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlInstancesServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlInstancesServiceStub.java new file mode 100644 index 000000000000..629940cf28e3 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlInstancesServiceStub.java @@ -0,0 +1,2107 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1.DatabaseInstance; +import com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse; +import com.google.cloud.sql.v1.InstancesListResponse; +import com.google.cloud.sql.v1.InstancesListServerCasResponse; +import com.google.cloud.sql.v1.InstancesListServerCertificatesResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse; +import com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest; +import com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesCloneRequest; +import com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest; +import com.google.cloud.sql.v1.SqlInstancesDeleteRequest; +import com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest; +import com.google.cloud.sql.v1.SqlInstancesDemoteRequest; +import com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest; +import com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse; +import com.google.cloud.sql.v1.SqlInstancesExportRequest; +import com.google.cloud.sql.v1.SqlInstancesFailoverRequest; +import com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest; +import com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse; +import com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest; +import com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse; +import com.google.cloud.sql.v1.SqlInstancesGetRequest; +import com.google.cloud.sql.v1.SqlInstancesImportRequest; +import com.google.cloud.sql.v1.SqlInstancesInsertRequest; +import com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest; +import com.google.cloud.sql.v1.SqlInstancesListRequest; +import com.google.cloud.sql.v1.SqlInstancesListServerCasRequest; +import com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest; +import com.google.cloud.sql.v1.SqlInstancesPatchRequest; +import com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest; +import com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest; +import com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest; +import com.google.cloud.sql.v1.SqlInstancesReencryptRequest; +import com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest; +import com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse; +import com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest; +import com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest; +import com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest; +import com.google.cloud.sql.v1.SqlInstancesRestartRequest; +import com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest; +import com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest; +import com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest; +import com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest; +import com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest; +import com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest; +import com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest; +import com.google.cloud.sql.v1.SqlInstancesUpdateRequest; +import com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest; +import com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse; +import com.google.cloud.sql.v1.SslCert; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlInstancesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlInstancesServiceStub extends SqlInstancesServiceStub { + private static final MethodDescriptor + addServerCaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/AddServerCa") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesAddServerCaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + addServerCertificateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/AddServerCertificate") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesAddServerCertificateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + addEntraIdCertificateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/AddEntraIdCertificate") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesAddEntraIdCertificateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor cloneMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Clone") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesCloneRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Delete") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesDeleteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + demoteMasterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/DemoteMaster") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesDemoteMasterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + demoteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Demote") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesDemoteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + exportMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Export") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesExportRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + failoverMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Failover") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesFailoverRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + reencryptMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Reencrypt") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesReencryptRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Get") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesGetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(DatabaseInstance.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + import_MethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Import") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesImportRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + insertMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Insert") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesInsertRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/List") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesListRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(InstancesListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesListServerCasRequest, InstancesListServerCasResponse> + listServerCasMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/ListServerCas") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesListServerCasRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(InstancesListServerCasResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/ListServerCertificates") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesListServerCertificatesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + InstancesListServerCertificatesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/ListEntraIdCertificates") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesListEntraIdCertificatesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + InstancesListEntraIdCertificatesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor patchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Patch") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesPatchRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + promoteReplicaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/PromoteReplica") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesPromoteReplicaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + switchoverMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Switchover") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesSwitchoverRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + resetSslConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/ResetSslConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesResetSslConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + restartMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Restart") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesRestartRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + restoreBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/RestoreBackup") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesRestoreBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + rotateServerCaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/RotateServerCa") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesRotateServerCaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + rotateServerCertificateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/RotateServerCertificate") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesRotateServerCertificateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + rotateEntraIdCertificateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/RotateEntraIdCertificate") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesRotateEntraIdCertificateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + startReplicaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/StartReplica") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesStartReplicaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + stopReplicaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/StopReplica") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesStopReplicaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + truncateLogMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/TruncateLog") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesTruncateLogRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Update") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesUpdateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createEphemeralMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/CreateEphemeral") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesCreateEphemeralCertRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SslCert.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + rescheduleMaintenanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/RescheduleMaintenance") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesRescheduleMaintenanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.sql.v1.SqlInstancesService/VerifyExternalSyncSettings") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesVerifyExternalSyncSettingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + SqlInstancesVerifyExternalSyncSettingsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + startExternalSyncMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/StartExternalSync") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesStartExternalSyncRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + performDiskShrinkMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/PerformDiskShrink") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesPerformDiskShrinkRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/GetDiskShrinkConfig") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesGetDiskShrinkConfigRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + SqlInstancesGetDiskShrinkConfigResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + resetReplicaSizeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/ResetReplicaSize") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesResetReplicaSizeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/GetLatestRecoveryTime") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesGetLatestRecoveryTimeRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + SqlInstancesGetLatestRecoveryTimeResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesExecuteSqlRequest, SqlInstancesExecuteSqlResponse> + executeSqlMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/ExecuteSql") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesExecuteSqlRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SqlInstancesExecuteSqlResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/AcquireSsrsLease") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesAcquireSsrsLeaseRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SqlInstancesAcquireSsrsLeaseResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/ReleaseSsrsLease") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesReleaseSsrsLeaseRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SqlInstancesReleaseSsrsLeaseResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + preCheckMajorVersionUpgradeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.sql.v1.SqlInstancesService/PreCheckMajorVersionUpgrade") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesPreCheckMajorVersionUpgradeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + pointInTimeRestoreMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/PointInTimeRestore") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesPointInTimeRestoreRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable addServerCaCallable; + private final UnaryCallable + addServerCertificateCallable; + private final UnaryCallable + addEntraIdCertificateCallable; + private final UnaryCallable cloneCallable; + private final UnaryCallable deleteCallable; + private final UnaryCallable demoteMasterCallable; + private final UnaryCallable demoteCallable; + private final UnaryCallable exportCallable; + private final UnaryCallable failoverCallable; + private final UnaryCallable reencryptCallable; + private final UnaryCallable getCallable; + private final UnaryCallable import_Callable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + private final UnaryCallable + listServerCasCallable; + private final UnaryCallable< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesCallable; + private final UnaryCallable< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesCallable; + private final UnaryCallable patchCallable; + private final UnaryCallable promoteReplicaCallable; + private final UnaryCallable switchoverCallable; + private final UnaryCallable resetSslConfigCallable; + private final UnaryCallable restartCallable; + private final UnaryCallable restoreBackupCallable; + private final UnaryCallable rotateServerCaCallable; + private final UnaryCallable + rotateServerCertificateCallable; + private final UnaryCallable + rotateEntraIdCertificateCallable; + private final UnaryCallable startReplicaCallable; + private final UnaryCallable stopReplicaCallable; + private final UnaryCallable truncateLogCallable; + private final UnaryCallable updateCallable; + private final UnaryCallable + createEphemeralCallable; + private final UnaryCallable + rescheduleMaintenanceCallable; + private final UnaryCallable< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsCallable; + private final UnaryCallable + startExternalSyncCallable; + private final UnaryCallable + performDiskShrinkCallable; + private final UnaryCallable< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigCallable; + private final UnaryCallable + resetReplicaSizeCallable; + private final UnaryCallable< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeCallable; + private final UnaryCallable + executeSqlCallable; + private final UnaryCallable< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseCallable; + private final UnaryCallable< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseCallable; + private final UnaryCallable + preCheckMajorVersionUpgradeCallable; + private final UnaryCallable + pointInTimeRestoreCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate ADD_SERVER_CA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ADD_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ADD_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate CLONE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate DEMOTE_MASTER_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate DEMOTE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate EXPORT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate FAILOVER_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate REENCRYPT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate IMPORT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + private static final PathTemplate LIST_SERVER_CAS_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_SERVER_CERTIFICATES_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_ENTRA_ID_CERTIFICATES_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PATCH_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PROMOTE_REPLICA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate SWITCHOVER_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESET_SSL_CONFIG_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESTART_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESTORE_BACKUP_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ROTATE_SERVER_CA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ROTATE_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ROTATE_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate START_REPLICA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate STOP_REPLICA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate TRUNCATE_LOG_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate UPDATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate CREATE_EPHEMERAL_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESCHEDULE_MAINTENANCE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate VERIFY_EXTERNAL_SYNC_SETTINGS_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate START_EXTERNAL_SYNC_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PERFORM_DISK_SHRINK_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_DISK_SHRINK_CONFIG_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESET_REPLICA_SIZE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_LATEST_RECOVERY_TIME_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate EXECUTE_SQL_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ACQUIRE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RELEASE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PRE_CHECK_MAJOR_VERSION_UPGRADE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate POINT_IN_TIME_RESTORE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("{parent=projects/*}"); + + public static final GrpcSqlInstancesServiceStub create(SqlInstancesServiceStubSettings settings) + throws IOException { + return new GrpcSqlInstancesServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlInstancesServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlInstancesServiceStub( + SqlInstancesServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlInstancesServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlInstancesServiceStub( + SqlInstancesServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlInstancesServiceStub, 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 GrpcSqlInstancesServiceStub( + SqlInstancesServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlInstancesServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlInstancesServiceStub, 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 GrpcSqlInstancesServiceStub( + SqlInstancesServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings addServerCaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addServerCaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ADD_SERVER_CA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings + addServerCertificateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addServerCertificateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ADD_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + addEntraIdCertificateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addEntraIdCertificateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ADD_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings cloneTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(cloneMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return CLONE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings deleteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings demoteMasterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(demoteMasterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DEMOTE_MASTER_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings demoteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(demoteMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DEMOTE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings exportTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(exportMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return EXPORT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings failoverTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(failoverMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return FAILOVER_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings reencryptTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(reencryptMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return REENCRYPT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings getTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings import_TransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(import_MethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return IMPORT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings insertTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings + listServerCasTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listServerCasMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_SERVER_CAS_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(listServerCertificatesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_SERVER_CERTIFICATES_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(listEntraIdCertificatesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_ENTRA_ID_CERTIFICATES_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings patchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(patchMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PATCH_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings promoteReplicaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(promoteReplicaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PROMOTE_REPLICA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings switchoverTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(switchoverMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return SWITCHOVER_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings resetSslConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(resetSslConfigMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESET_SSL_CONFIG_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings restartTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restartMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESTART_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings restoreBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restoreBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESTORE_BACKUP_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings rotateServerCaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(rotateServerCaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ROTATE_SERVER_CA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings + rotateServerCertificateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(rotateServerCertificateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ROTATE_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + rotateEntraIdCertificateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(rotateEntraIdCertificateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ROTATE_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings startReplicaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(startReplicaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return START_REPLICA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings stopReplicaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(stopReplicaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return STOP_REPLICA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings truncateLogTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(truncateLogMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return TRUNCATE_LOG_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings updateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return UPDATE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings + createEphemeralTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createEphemeralMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return CREATE_EPHEMERAL_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + rescheduleMaintenanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(rescheduleMaintenanceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESCHEDULE_MAINTENANCE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(verifyExternalSyncSettingsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return VERIFY_EXTERNAL_SYNC_SETTINGS_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + startExternalSyncTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(startExternalSyncMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return START_EXTERNAL_SYNC_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + performDiskShrinkTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(performDiskShrinkMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PERFORM_DISK_SHRINK_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(getDiskShrinkConfigMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_DISK_SHRINK_CONFIG_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + resetReplicaSizeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(resetReplicaSizeMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESET_REPLICA_SIZE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(getLatestRecoveryTimeMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_LATEST_RECOVERY_TIME_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + executeSqlTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(executeSqlMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return EXECUTE_SQL_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings + acquireSsrsLeaseTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(acquireSsrsLeaseMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ACQUIRE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + releaseSsrsLeaseTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(releaseSsrsLeaseMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RELEASE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + preCheckMajorVersionUpgradeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(preCheckMajorVersionUpgradeMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PRE_CHECK_MAJOR_VERSION_UPGRADE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + pointInTimeRestoreTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pointInTimeRestoreMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("parent", String.valueOf(request.getParent())); + return POINT_IN_TIME_RESTORE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + + this.addServerCaCallable = + callableFactory.createUnaryCallable( + addServerCaTransportSettings, settings.addServerCaSettings(), clientContext); + this.addServerCertificateCallable = + callableFactory.createUnaryCallable( + addServerCertificateTransportSettings, + settings.addServerCertificateSettings(), + clientContext); + this.addEntraIdCertificateCallable = + callableFactory.createUnaryCallable( + addEntraIdCertificateTransportSettings, + settings.addEntraIdCertificateSettings(), + clientContext); + this.cloneCallable = + callableFactory.createUnaryCallable( + cloneTransportSettings, settings.cloneSettings(), clientContext); + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.demoteMasterCallable = + callableFactory.createUnaryCallable( + demoteMasterTransportSettings, settings.demoteMasterSettings(), clientContext); + this.demoteCallable = + callableFactory.createUnaryCallable( + demoteTransportSettings, settings.demoteSettings(), clientContext); + this.exportCallable = + callableFactory.createUnaryCallable( + exportTransportSettings, settings.exportSettings(), clientContext); + this.failoverCallable = + callableFactory.createUnaryCallable( + failoverTransportSettings, settings.failoverSettings(), clientContext); + this.reencryptCallable = + callableFactory.createUnaryCallable( + reencryptTransportSettings, settings.reencryptSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.import_Callable = + callableFactory.createUnaryCallable( + import_TransportSettings, settings.import_Settings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.listServerCasCallable = + callableFactory.createUnaryCallable( + listServerCasTransportSettings, settings.listServerCasSettings(), clientContext); + this.listServerCertificatesCallable = + callableFactory.createUnaryCallable( + listServerCertificatesTransportSettings, + settings.listServerCertificatesSettings(), + clientContext); + this.listEntraIdCertificatesCallable = + callableFactory.createUnaryCallable( + listEntraIdCertificatesTransportSettings, + settings.listEntraIdCertificatesSettings(), + clientContext); + this.patchCallable = + callableFactory.createUnaryCallable( + patchTransportSettings, settings.patchSettings(), clientContext); + this.promoteReplicaCallable = + callableFactory.createUnaryCallable( + promoteReplicaTransportSettings, settings.promoteReplicaSettings(), clientContext); + this.switchoverCallable = + callableFactory.createUnaryCallable( + switchoverTransportSettings, settings.switchoverSettings(), clientContext); + this.resetSslConfigCallable = + callableFactory.createUnaryCallable( + resetSslConfigTransportSettings, settings.resetSslConfigSettings(), clientContext); + this.restartCallable = + callableFactory.createUnaryCallable( + restartTransportSettings, settings.restartSettings(), clientContext); + this.restoreBackupCallable = + callableFactory.createUnaryCallable( + restoreBackupTransportSettings, settings.restoreBackupSettings(), clientContext); + this.rotateServerCaCallable = + callableFactory.createUnaryCallable( + rotateServerCaTransportSettings, settings.rotateServerCaSettings(), clientContext); + this.rotateServerCertificateCallable = + callableFactory.createUnaryCallable( + rotateServerCertificateTransportSettings, + settings.rotateServerCertificateSettings(), + clientContext); + this.rotateEntraIdCertificateCallable = + callableFactory.createUnaryCallable( + rotateEntraIdCertificateTransportSettings, + settings.rotateEntraIdCertificateSettings(), + clientContext); + this.startReplicaCallable = + callableFactory.createUnaryCallable( + startReplicaTransportSettings, settings.startReplicaSettings(), clientContext); + this.stopReplicaCallable = + callableFactory.createUnaryCallable( + stopReplicaTransportSettings, settings.stopReplicaSettings(), clientContext); + this.truncateLogCallable = + callableFactory.createUnaryCallable( + truncateLogTransportSettings, settings.truncateLogSettings(), clientContext); + this.updateCallable = + callableFactory.createUnaryCallable( + updateTransportSettings, settings.updateSettings(), clientContext); + this.createEphemeralCallable = + callableFactory.createUnaryCallable( + createEphemeralTransportSettings, settings.createEphemeralSettings(), clientContext); + this.rescheduleMaintenanceCallable = + callableFactory.createUnaryCallable( + rescheduleMaintenanceTransportSettings, + settings.rescheduleMaintenanceSettings(), + clientContext); + this.verifyExternalSyncSettingsCallable = + callableFactory.createUnaryCallable( + verifyExternalSyncSettingsTransportSettings, + settings.verifyExternalSyncSettingsSettings(), + clientContext); + this.startExternalSyncCallable = + callableFactory.createUnaryCallable( + startExternalSyncTransportSettings, + settings.startExternalSyncSettings(), + clientContext); + this.performDiskShrinkCallable = + callableFactory.createUnaryCallable( + performDiskShrinkTransportSettings, + settings.performDiskShrinkSettings(), + clientContext); + this.getDiskShrinkConfigCallable = + callableFactory.createUnaryCallable( + getDiskShrinkConfigTransportSettings, + settings.getDiskShrinkConfigSettings(), + clientContext); + this.resetReplicaSizeCallable = + callableFactory.createUnaryCallable( + resetReplicaSizeTransportSettings, settings.resetReplicaSizeSettings(), clientContext); + this.getLatestRecoveryTimeCallable = + callableFactory.createUnaryCallable( + getLatestRecoveryTimeTransportSettings, + settings.getLatestRecoveryTimeSettings(), + clientContext); + this.executeSqlCallable = + callableFactory.createUnaryCallable( + executeSqlTransportSettings, settings.executeSqlSettings(), clientContext); + this.acquireSsrsLeaseCallable = + callableFactory.createUnaryCallable( + acquireSsrsLeaseTransportSettings, settings.acquireSsrsLeaseSettings(), clientContext); + this.releaseSsrsLeaseCallable = + callableFactory.createUnaryCallable( + releaseSsrsLeaseTransportSettings, settings.releaseSsrsLeaseSettings(), clientContext); + this.preCheckMajorVersionUpgradeCallable = + callableFactory.createUnaryCallable( + preCheckMajorVersionUpgradeTransportSettings, + settings.preCheckMajorVersionUpgradeSettings(), + clientContext); + this.pointInTimeRestoreCallable = + callableFactory.createUnaryCallable( + pointInTimeRestoreTransportSettings, + settings.pointInTimeRestoreSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable addServerCaCallable() { + return addServerCaCallable; + } + + @Override + public UnaryCallable + addServerCertificateCallable() { + return addServerCertificateCallable; + } + + @Override + public UnaryCallable + addEntraIdCertificateCallable() { + return addEntraIdCertificateCallable; + } + + @Override + public UnaryCallable cloneCallable() { + return cloneCallable; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable demoteMasterCallable() { + return demoteMasterCallable; + } + + @Override + public UnaryCallable demoteCallable() { + return demoteCallable; + } + + @Override + public UnaryCallable exportCallable() { + return exportCallable; + } + + @Override + public UnaryCallable failoverCallable() { + return failoverCallable; + } + + @Override + public UnaryCallable reencryptCallable() { + return reencryptCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable import_Callable() { + return import_Callable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable + listServerCasCallable() { + return listServerCasCallable; + } + + @Override + public UnaryCallable< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesCallable() { + return listServerCertificatesCallable; + } + + @Override + public UnaryCallable< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesCallable() { + return listEntraIdCertificatesCallable; + } + + @Override + public UnaryCallable patchCallable() { + return patchCallable; + } + + @Override + public UnaryCallable promoteReplicaCallable() { + return promoteReplicaCallable; + } + + @Override + public UnaryCallable switchoverCallable() { + return switchoverCallable; + } + + @Override + public UnaryCallable resetSslConfigCallable() { + return resetSslConfigCallable; + } + + @Override + public UnaryCallable restartCallable() { + return restartCallable; + } + + @Override + public UnaryCallable restoreBackupCallable() { + return restoreBackupCallable; + } + + @Override + public UnaryCallable rotateServerCaCallable() { + return rotateServerCaCallable; + } + + @Override + public UnaryCallable + rotateServerCertificateCallable() { + return rotateServerCertificateCallable; + } + + @Override + public UnaryCallable + rotateEntraIdCertificateCallable() { + return rotateEntraIdCertificateCallable; + } + + @Override + public UnaryCallable startReplicaCallable() { + return startReplicaCallable; + } + + @Override + public UnaryCallable stopReplicaCallable() { + return stopReplicaCallable; + } + + @Override + public UnaryCallable truncateLogCallable() { + return truncateLogCallable; + } + + @Override + public UnaryCallable updateCallable() { + return updateCallable; + } + + @Override + public UnaryCallable createEphemeralCallable() { + return createEphemeralCallable; + } + + @Override + public UnaryCallable + rescheduleMaintenanceCallable() { + return rescheduleMaintenanceCallable; + } + + @Override + public UnaryCallable< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsCallable() { + return verifyExternalSyncSettingsCallable; + } + + @Override + public UnaryCallable + startExternalSyncCallable() { + return startExternalSyncCallable; + } + + @Override + public UnaryCallable + performDiskShrinkCallable() { + return performDiskShrinkCallable; + } + + @Override + public UnaryCallable< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigCallable() { + return getDiskShrinkConfigCallable; + } + + @Override + public UnaryCallable resetReplicaSizeCallable() { + return resetReplicaSizeCallable; + } + + @Override + public UnaryCallable< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeCallable() { + return getLatestRecoveryTimeCallable; + } + + @Override + public UnaryCallable + executeSqlCallable() { + return executeSqlCallable; + } + + @Override + public UnaryCallable + acquireSsrsLeaseCallable() { + return acquireSsrsLeaseCallable; + } + + @Override + public UnaryCallable + releaseSsrsLeaseCallable() { + return releaseSsrsLeaseCallable; + } + + @Override + public UnaryCallable + preCheckMajorVersionUpgradeCallable() { + return preCheckMajorVersionUpgradeCallable; + } + + @Override + public UnaryCallable + pointInTimeRestoreCallable() { + return pointInTimeRestoreCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlOperationsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlOperationsServiceCallableFactory.java new file mode 100644 index 000000000000..e081629104f5 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlOperationsServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlOperationsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlOperationsServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlOperationsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlOperationsServiceStub.java new file mode 100644 index 000000000000..1dfab0bb43ce --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlOperationsServiceStub.java @@ -0,0 +1,259 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.OperationsListResponse; +import com.google.cloud.sql.v1.SqlOperationsCancelRequest; +import com.google.cloud.sql.v1.SqlOperationsGetRequest; +import com.google.cloud.sql.v1.SqlOperationsListRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlOperationsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlOperationsServiceStub extends SqlOperationsServiceStub { + private static final MethodDescriptor getMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlOperationsService/Get") + .setRequestMarshaller(ProtoUtils.marshaller(SqlOperationsGetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlOperationsService/List") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlOperationsListRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(OperationsListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor cancelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlOperationsService/Cancel") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlOperationsCancelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable getCallable; + private final UnaryCallable listCallable; + private final UnaryCallable cancelCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/operations/{operation}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + private static final PathTemplate CANCEL_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/operations/{operation}"); + + public static final GrpcSqlOperationsServiceStub create(SqlOperationsServiceStubSettings settings) + throws IOException { + return new GrpcSqlOperationsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlOperationsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlOperationsServiceStub( + SqlOperationsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlOperationsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlOperationsServiceStub( + SqlOperationsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlOperationsServiceStub, 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 GrpcSqlOperationsServiceStub( + SqlOperationsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlOperationsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlOperationsServiceStub, 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 GrpcSqlOperationsServiceStub( + SqlOperationsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("operation", String.valueOf(request.getOperation())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("operation", String.valueOf(request.getOperation())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings cancelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(cancelMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("operation", String.valueOf(request.getOperation())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("operation", String.valueOf(request.getOperation())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return CANCEL_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.cancelCallable = + callableFactory.createUnaryCallable( + cancelTransportSettings, settings.cancelSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable cancelCallable() { + return cancelCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlSslCertsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlSslCertsServiceCallableFactory.java new file mode 100644 index 000000000000..cfcb9ff504d1 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlSslCertsServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlSslCertsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlSslCertsServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlSslCertsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlSslCertsServiceStub.java new file mode 100644 index 000000000000..f6e26aff6276 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlSslCertsServiceStub.java @@ -0,0 +1,311 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlSslCertsDeleteRequest; +import com.google.cloud.sql.v1.SqlSslCertsGetRequest; +import com.google.cloud.sql.v1.SqlSslCertsInsertRequest; +import com.google.cloud.sql.v1.SqlSslCertsListRequest; +import com.google.cloud.sql.v1.SslCert; +import com.google.cloud.sql.v1.SslCertsInsertResponse; +import com.google.cloud.sql.v1.SslCertsListResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlSslCertsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlSslCertsServiceStub extends SqlSslCertsServiceStub { + private static final MethodDescriptor + deleteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlSslCertsService/Delete") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlSslCertsDeleteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlSslCertsService/Get") + .setRequestMarshaller(ProtoUtils.marshaller(SqlSslCertsGetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SslCert.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + insertMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlSslCertsService/Insert") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlSslCertsInsertRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SslCertsInsertResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlSslCertsService/List") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlSslCertsListRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SslCertsListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + + public static final GrpcSqlSslCertsServiceStub create(SqlSslCertsServiceStubSettings settings) + throws IOException { + return new GrpcSqlSslCertsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlSslCertsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlSslCertsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlSslCertsServiceStub, 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 GrpcSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlSslCertsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlSslCertsServiceStub, 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 GrpcSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings deleteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + builder.add("sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + resourceNameSegments.put( + "sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings getTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + builder.add("sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + resourceNameSegments.put( + "sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings insertTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlTiersServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlTiersServiceCallableFactory.java new file mode 100644 index 000000000000..3caa5dc8224d --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlTiersServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlTiersService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlTiersServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlTiersServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlTiersServiceStub.java new file mode 100644 index 000000000000..f6da22d95577 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlTiersServiceStub.java @@ -0,0 +1,176 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1.SqlTiersListRequest; +import com.google.cloud.sql.v1.TiersListResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlTiersService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlTiersServiceStub extends SqlTiersServiceStub { + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlTiersService/List") + .setRequestMarshaller(ProtoUtils.marshaller(SqlTiersListRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(TiersListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + + public static final GrpcSqlTiersServiceStub create(SqlTiersServiceStubSettings settings) + throws IOException { + return new GrpcSqlTiersServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlTiersServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlTiersServiceStub( + SqlTiersServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlTiersServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlTiersServiceStub( + SqlTiersServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlTiersServiceStub, 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 GrpcSqlTiersServiceStub( + SqlTiersServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlTiersServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlTiersServiceStub, 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 GrpcSqlTiersServiceStub( + SqlTiersServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlUsersServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlUsersServiceCallableFactory.java new file mode 100644 index 000000000000..fd747509cb63 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlUsersServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlUsersService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlUsersServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlUsersServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlUsersServiceStub.java new file mode 100644 index 000000000000..eb5afb350825 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/GrpcSqlUsersServiceStub.java @@ -0,0 +1,338 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlUsersDeleteRequest; +import com.google.cloud.sql.v1.SqlUsersGetRequest; +import com.google.cloud.sql.v1.SqlUsersInsertRequest; +import com.google.cloud.sql.v1.SqlUsersListRequest; +import com.google.cloud.sql.v1.SqlUsersUpdateRequest; +import com.google.cloud.sql.v1.User; +import com.google.cloud.sql.v1.UsersListResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlUsersService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class GrpcSqlUsersServiceStub extends SqlUsersServiceStub { + private static final MethodDescriptor deleteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlUsersService/Delete") + .setRequestMarshaller(ProtoUtils.marshaller(SqlUsersDeleteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlUsersService/Get") + .setRequestMarshaller(ProtoUtils.marshaller(SqlUsersGetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor insertMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlUsersService/Insert") + .setRequestMarshaller(ProtoUtils.marshaller(SqlUsersInsertRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlUsersService/List") + .setRequestMarshaller(ProtoUtils.marshaller(SqlUsersListRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(UsersListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1.SqlUsersService/Update") + .setRequestMarshaller(ProtoUtils.marshaller(SqlUsersUpdateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + private final UnaryCallable updateCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/users/{name}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate UPDATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + + public static final GrpcSqlUsersServiceStub create(SqlUsersServiceStubSettings settings) + throws IOException { + return new GrpcSqlUsersServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlUsersServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlUsersServiceStub( + SqlUsersServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlUsersServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlUsersServiceStub( + SqlUsersServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlUsersServiceStub, 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 GrpcSqlUsersServiceStub( + SqlUsersServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlUsersServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlUsersServiceStub, 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 GrpcSqlUsersServiceStub( + SqlUsersServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings deleteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings getTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("name", String.valueOf(request.getName())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("name", String.valueOf(request.getName())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings insertTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings updateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return UPDATE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.updateCallable = + callableFactory.createUnaryCallable( + updateTransportSettings, settings.updateSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable updateCallable() { + return updateCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlBackupRunsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlBackupRunsServiceCallableFactory.java new file mode 100644 index 000000000000..369db4689f23 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlBackupRunsServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlBackupRunsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlBackupRunsServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlBackupRunsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlBackupRunsServiceStub.java new file mode 100644 index 000000000000..15b37ef99ea4 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlBackupRunsServiceStub.java @@ -0,0 +1,426 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1.BackupRun; +import com.google.cloud.sql.v1.BackupRunsListResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest; +import com.google.cloud.sql.v1.SqlBackupRunsGetRequest; +import com.google.cloud.sql.v1.SqlBackupRunsInsertRequest; +import com.google.cloud.sql.v1.SqlBackupRunsListRequest; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlBackupRunsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlBackupRunsServiceStub extends SqlBackupRunsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + deleteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlBackupRunsService/Delete") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/backupRuns/{id}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "id", request.getId()); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlBackupRunsService/Get") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/backupRuns/{id}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "id", request.getId()); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(BackupRun.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + insertMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlBackupRunsService/Insert") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/backupRuns", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlBackupRunsService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/backupRuns", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "maxResults", request.getMaxResults()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BackupRunsListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/backupRuns/{id}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/backupRuns/{id}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + + public static final HttpJsonSqlBackupRunsServiceStub create( + SqlBackupRunsServiceStubSettings settings) throws IOException { + return new HttpJsonSqlBackupRunsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlBackupRunsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlBackupRunsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlBackupRunsServiceStub, 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 HttpJsonSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlBackupRunsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlBackupRunsServiceStub, 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 HttpJsonSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("id", String.valueOf(request.getId())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("id", String.valueOf(request.getId())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings getTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("id", String.valueOf(request.getId())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("id", String.valueOf(request.getId())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings insertTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(deleteMethodDescriptor); + methodDescriptors.add(getMethodDescriptor); + methodDescriptors.add(insertMethodDescriptor); + methodDescriptors.add(listMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlBackupsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlBackupsServiceCallableFactory.java new file mode 100644 index 000000000000..9444857e7e92 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlBackupsServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlBackupsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlBackupsServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlBackupsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlBackupsServiceStub.java new file mode 100644 index 000000000000..4194bf291b77 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlBackupsServiceStub.java @@ -0,0 +1,451 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import static com.google.cloud.sql.v1.SqlBackupsServiceClient.ListBackupsPagedResponse; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.CreateBackupRequest; +import com.google.cloud.sql.v1.DeleteBackupRequest; +import com.google.cloud.sql.v1.GetBackupRequest; +import com.google.cloud.sql.v1.ListBackupsRequest; +import com.google.cloud.sql.v1.ListBackupsResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.UpdateBackupRequest; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlBackupsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlBackupsServiceStub extends SqlBackupsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlBackupsService/CreateBackup") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*}/backups", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("backup", request.getBackup(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlBackupsService/GetBackup") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/backups/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Backup.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listBackupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlBackupsService/ListBackups") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*}/backups", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListBackupsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlBackupsService/UpdateBackup") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{backup.name=projects/*/backups/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "backup.name", request.getBackup().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("backup", request.getBackup(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlBackupsService/DeleteBackup") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/backups/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createBackupCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable + listBackupsPagedCallable; + private final UnaryCallable updateBackupCallable; + private final UnaryCallable deleteBackupCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSqlBackupsServiceStub create(SqlBackupsServiceStubSettings settings) + throws IOException { + return new HttpJsonSqlBackupsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlBackupsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlBackupsServiceStub( + SqlBackupsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlBackupsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlBackupsServiceStub( + SqlBackupsServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlBackupsServiceStub, 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 HttpJsonSqlBackupsServiceStub( + SqlBackupsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlBackupsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlBackupsServiceStub, 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 HttpJsonSqlBackupsServiceStub( + SqlBackupsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings getBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings listBackupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings updateBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("backup.name", String.valueOf(request.getBackup().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + + this.createBackupCallable = + callableFactory.createUnaryCallable( + createBackupTransportSettings, settings.createBackupSettings(), clientContext); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.listBackupsPagedCallable = + callableFactory.createPagedCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.updateBackupCallable = + callableFactory.createUnaryCallable( + updateBackupTransportSettings, settings.updateBackupSettings(), clientContext); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createBackupMethodDescriptor); + methodDescriptors.add(getBackupMethodDescriptor); + methodDescriptors.add(listBackupsMethodDescriptor); + methodDescriptors.add(updateBackupMethodDescriptor); + methodDescriptors.add(deleteBackupMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createBackupCallable() { + return createBackupCallable; + } + + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable listBackupsPagedCallable() { + return listBackupsPagedCallable; + } + + @Override + public UnaryCallable updateBackupCallable() { + return updateBackupCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlConnectServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlConnectServiceCallableFactory.java new file mode 100644 index 000000000000..95ce71a95f52 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlConnectServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlConnectService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlConnectServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlConnectServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlConnectServiceStub.java new file mode 100644 index 000000000000..31be168cc7c7 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlConnectServiceStub.java @@ -0,0 +1,342 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.ConnectSettings; +import com.google.cloud.sql.v1.GenerateEphemeralCertRequest; +import com.google.cloud.sql.v1.GenerateEphemeralCertResponse; +import com.google.cloud.sql.v1.GetConnectSettingsRequest; +import com.google.cloud.sql.v1.ResolveConnectSettingsRequest; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlConnectService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlConnectServiceStub extends SqlConnectServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + getConnectSettingsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlConnectService/GetConnectSettings") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/connectSettings", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "readTime", request.getReadTime()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ConnectSettings.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + resolveConnectSettingsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlConnectService/ResolveConnectSettings") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/locations/{location}/dns/{dnsName}:resolveConnectSettings", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "dnsName", request.getDnsName()); + serializer.putPathParam(fields, "location", request.getLocation()); + 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(ConnectSettings.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + GenerateEphemeralCertRequest, GenerateEphemeralCertResponse> + generateEphemeralCertMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlConnectService/GenerateEphemeralCert") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}:generateEphemeralCert", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearInstance().clearProject().build(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateEphemeralCertResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + getConnectSettingsCallable; + private final UnaryCallable + resolveConnectSettingsCallable; + private final UnaryCallable + generateEphemeralCertCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSqlConnectServiceStub create(SqlConnectServiceStubSettings settings) + throws IOException { + return new HttpJsonSqlConnectServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlConnectServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlConnectServiceStub( + SqlConnectServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlConnectServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlConnectServiceStub( + SqlConnectServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlConnectServiceStub, 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 HttpJsonSqlConnectServiceStub( + SqlConnectServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlConnectServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlConnectServiceStub, 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 HttpJsonSqlConnectServiceStub( + SqlConnectServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + getConnectSettingsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getConnectSettingsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + resolveConnectSettingsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(resolveConnectSettingsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("dns_name", String.valueOf(request.getDnsName())); + builder.add("location", String.valueOf(request.getLocation())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + generateEphemeralCertTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(generateEphemeralCertMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .build(); + + this.getConnectSettingsCallable = + callableFactory.createUnaryCallable( + getConnectSettingsTransportSettings, + settings.getConnectSettingsSettings(), + clientContext); + this.resolveConnectSettingsCallable = + callableFactory.createUnaryCallable( + resolveConnectSettingsTransportSettings, + settings.resolveConnectSettingsSettings(), + clientContext); + this.generateEphemeralCertCallable = + callableFactory.createUnaryCallable( + generateEphemeralCertTransportSettings, + settings.generateEphemeralCertSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getConnectSettingsMethodDescriptor); + methodDescriptors.add(resolveConnectSettingsMethodDescriptor); + methodDescriptors.add(generateEphemeralCertMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable getConnectSettingsCallable() { + return getConnectSettingsCallable; + } + + @Override + public UnaryCallable + resolveConnectSettingsCallable() { + return resolveConnectSettingsCallable; + } + + @Override + public UnaryCallable + generateEphemeralCertCallable() { + return generateEphemeralCertCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlDatabasesServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlDatabasesServiceCallableFactory.java new file mode 100644 index 000000000000..d2ff91b03f4f --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlDatabasesServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlDatabasesService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlDatabasesServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlDatabasesServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlDatabasesServiceStub.java new file mode 100644 index 000000000000..13f42326ad5e --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlDatabasesServiceStub.java @@ -0,0 +1,567 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1.Database; +import com.google.cloud.sql.v1.DatabasesListResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlDatabasesDeleteRequest; +import com.google.cloud.sql.v1.SqlDatabasesGetRequest; +import com.google.cloud.sql.v1.SqlDatabasesInsertRequest; +import com.google.cloud.sql.v1.SqlDatabasesListRequest; +import com.google.cloud.sql.v1.SqlDatabasesUpdateRequest; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlDatabasesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlDatabasesServiceStub extends SqlDatabasesServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + deleteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlDatabasesService/Delete") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/databases/{database}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "database", request.getDatabase()); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlDatabasesService/Get") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/databases/{database}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "database", request.getDatabase()); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Database.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + insertMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlDatabasesService/Insert") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/databases", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlDatabasesService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/databases", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(DatabasesListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + patchMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlDatabasesService/Patch") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/databases/{database}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "database", request.getDatabase()); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlDatabasesService/Update") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/databases/{database}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "database", request.getDatabase()); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + private final UnaryCallable patchCallable; + private final UnaryCallable updateCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PATCH_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + private static final PathTemplate UPDATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + + public static final HttpJsonSqlDatabasesServiceStub create( + SqlDatabasesServiceStubSettings settings) throws IOException { + return new HttpJsonSqlDatabasesServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlDatabasesServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlDatabasesServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlDatabasesServiceStub, 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 HttpJsonSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlDatabasesServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlDatabasesServiceStub, 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 HttpJsonSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings getTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings insertTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings patchTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PATCH_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings updateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return UPDATE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.patchCallable = + callableFactory.createUnaryCallable( + patchTransportSettings, settings.patchSettings(), clientContext); + this.updateCallable = + callableFactory.createUnaryCallable( + updateTransportSettings, settings.updateSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(deleteMethodDescriptor); + methodDescriptors.add(getMethodDescriptor); + methodDescriptors.add(insertMethodDescriptor); + methodDescriptors.add(listMethodDescriptor); + methodDescriptors.add(patchMethodDescriptor); + methodDescriptors.add(updateMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable patchCallable() { + return patchCallable; + } + + @Override + public UnaryCallable updateCallable() { + return updateCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlFlagsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlFlagsServiceCallableFactory.java new file mode 100644 index 000000000000..13c21f3d0655 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlFlagsServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlFlagsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlFlagsServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlFlagsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlFlagsServiceStub.java new file mode 100644 index 000000000000..a84c3eeee9d5 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlFlagsServiceStub.java @@ -0,0 +1,197 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.FlagsListResponse; +import com.google.cloud.sql.v1.SqlFlagsListRequest; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlFlagsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlFlagsServiceStub extends SqlFlagsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlFlagsService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/flags", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "databaseVersion", request.getDatabaseVersion()); + if (request.hasFlagScope()) { + serializer.putQueryParam( + fields, "flagScope", request.getFlagScopeValue()); + } + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(FlagsListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSqlFlagsServiceStub create(SqlFlagsServiceStubSettings settings) + throws IOException { + return new HttpJsonSqlFlagsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlFlagsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlFlagsServiceStub( + SqlFlagsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlFlagsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlFlagsServiceStub( + SqlFlagsServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlFlagsServiceStub, 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 HttpJsonSqlFlagsServiceStub( + SqlFlagsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlFlagsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlFlagsServiceStub, 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 HttpJsonSqlFlagsServiceStub( + SqlFlagsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlInstancesServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlInstancesServiceCallableFactory.java new file mode 100644 index 000000000000..ea514b76285f --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlInstancesServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlInstancesService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlInstancesServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlInstancesServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlInstancesServiceStub.java new file mode 100644 index 000000000000..fe4f98ac2d99 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlInstancesServiceStub.java @@ -0,0 +1,3334 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1.DatabaseInstance; +import com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse; +import com.google.cloud.sql.v1.InstancesListResponse; +import com.google.cloud.sql.v1.InstancesListServerCasResponse; +import com.google.cloud.sql.v1.InstancesListServerCertificatesResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse; +import com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest; +import com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesCloneRequest; +import com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest; +import com.google.cloud.sql.v1.SqlInstancesDeleteRequest; +import com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest; +import com.google.cloud.sql.v1.SqlInstancesDemoteRequest; +import com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest; +import com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse; +import com.google.cloud.sql.v1.SqlInstancesExportRequest; +import com.google.cloud.sql.v1.SqlInstancesFailoverRequest; +import com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest; +import com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse; +import com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest; +import com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse; +import com.google.cloud.sql.v1.SqlInstancesGetRequest; +import com.google.cloud.sql.v1.SqlInstancesImportRequest; +import com.google.cloud.sql.v1.SqlInstancesInsertRequest; +import com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest; +import com.google.cloud.sql.v1.SqlInstancesListRequest; +import com.google.cloud.sql.v1.SqlInstancesListServerCasRequest; +import com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest; +import com.google.cloud.sql.v1.SqlInstancesPatchRequest; +import com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest; +import com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest; +import com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest; +import com.google.cloud.sql.v1.SqlInstancesReencryptRequest; +import com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest; +import com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse; +import com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest; +import com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest; +import com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest; +import com.google.cloud.sql.v1.SqlInstancesRestartRequest; +import com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest; +import com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest; +import com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest; +import com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest; +import com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest; +import com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest; +import com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest; +import com.google.cloud.sql.v1.SqlInstancesUpdateRequest; +import com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest; +import com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse; +import com.google.cloud.sql.v1.SslCert; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlInstancesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlInstancesServiceStub extends SqlInstancesServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + addServerCaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/AddServerCa") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/addServerCa", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + addServerCertificateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/AddServerCertificate") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/addServerCertificate", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + addEntraIdCertificateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/AddEntraIdCertificate") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/addEntraIdCertificate", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + cloneMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Clone") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/clone", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Delete") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + if (request.hasEnableFinalBackup()) { + serializer.putQueryParam( + fields, "enableFinalBackup", request.getEnableFinalBackup()); + } + serializer.putQueryParam( + fields, + "finalBackupDescription", + request.getFinalBackupDescription()); + serializer.putQueryParam( + fields, + "finalBackupExpiryTime", + request.getFinalBackupExpiryTime()); + serializer.putQueryParam( + fields, "finalBackupTtlDays", request.getFinalBackupTtlDays()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + demoteMasterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/DemoteMaster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/demoteMaster", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + demoteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Demote") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/demote", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + exportMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Export") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/export", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + failoverMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Failover") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/failover", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + reencryptMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Reencrypt") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/reencrypt", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Get") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(DatabaseInstance.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + import_MethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Import") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/import", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + insertMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Insert") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "maxResults", request.getMaxResults()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(InstancesListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesListServerCasRequest, InstancesListServerCasResponse> + listServerCasMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/ListServerCas") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/listServerCas", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(InstancesListServerCasResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/ListServerCertificates") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/listServerCertificates", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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( + InstancesListServerCertificatesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/ListEntraIdCertificates") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/listEntraIdCertificates", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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( + InstancesListEntraIdCertificatesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + patchMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Patch") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + if (request.hasReconcilePscNetworking()) { + serializer.putQueryParam( + fields, + "reconcilePscNetworking", + request.getReconcilePscNetworking()); + } + if (request.hasReconcilePscNetworkingForce()) { + serializer.putQueryParam( + fields, + "reconcilePscNetworkingForce", + request.getReconcilePscNetworkingForce()); + } + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + promoteReplicaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/PromoteReplica") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/promoteReplica", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "failover", request.getFailover()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + switchoverMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Switchover") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/switchover", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "dbTimeout", request.getDbTimeout()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + resetSslConfigMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/ResetSslConfig") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/resetSslConfig", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "mode", request.getModeValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + restartMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Restart") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/restart", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + restoreBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/RestoreBackup") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/restoreBackup", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + rotateServerCaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/RotateServerCa") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/rotateServerCa", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + rotateServerCertificateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/RotateServerCertificate") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/rotateServerCertificate", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + rotateEntraIdCertificateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/RotateEntraIdCertificate") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/rotateEntraIdCertificate", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + startReplicaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/StartReplica") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/startReplica", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + stopReplicaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/StopReplica") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/stopReplica", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + truncateLogMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/TruncateLog") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/truncateLog", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/Update") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createEphemeralMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/CreateEphemeral") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/createEphemeral", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SslCert.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + rescheduleMaintenanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/RescheduleMaintenance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/rescheduleMaintenance", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName( + "google.cloud.sql.v1.SqlInstancesService/VerifyExternalSyncSettings") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/verifyExternalSyncSettings", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearInstance().clearProject().build(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser + .newBuilder() + .setDefaultInstance( + SqlInstancesVerifyExternalSyncSettingsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + startExternalSyncMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/StartExternalSync") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/startExternalSync", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearInstance().clearProject().build(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + performDiskShrinkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/PerformDiskShrink") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/performDiskShrink", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/GetDiskShrinkConfig") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/getDiskShrinkConfig", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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( + SqlInstancesGetDiskShrinkConfigResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + resetReplicaSizeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/ResetReplicaSize") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/resetReplicaSize", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearInstance().clearProject().build(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/GetLatestRecoveryTime") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/getLatestRecoveryTime", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + if (request.hasSourceInstanceDeletionTime()) { + serializer.putQueryParam( + fields, + "sourceInstanceDeletionTime", + request.getSourceInstanceDeletionTime()); + } + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance( + SqlInstancesGetLatestRecoveryTimeResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesExecuteSqlRequest, SqlInstancesExecuteSqlResponse> + executeSqlMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/ExecuteSql") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/executeSql", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SqlInstancesExecuteSqlResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/AcquireSsrsLease") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/acquireSsrsLease", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SqlInstancesAcquireSsrsLeaseResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/ReleaseSsrsLease") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/releaseSsrsLease", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(SqlInstancesReleaseSsrsLeaseResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesPreCheckMajorVersionUpgradeRequest, Operation> + preCheckMajorVersionUpgradeMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.sql.v1.SqlInstancesService/PreCheckMajorVersionUpgrade") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/preCheckMajorVersionUpgrade", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pointInTimeRestoreMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlInstancesService/PointInTimeRestore") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*}:pointInTimeRestore", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("context", request.getContext(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable addServerCaCallable; + private final UnaryCallable + addServerCertificateCallable; + private final UnaryCallable + addEntraIdCertificateCallable; + private final UnaryCallable cloneCallable; + private final UnaryCallable deleteCallable; + private final UnaryCallable demoteMasterCallable; + private final UnaryCallable demoteCallable; + private final UnaryCallable exportCallable; + private final UnaryCallable failoverCallable; + private final UnaryCallable reencryptCallable; + private final UnaryCallable getCallable; + private final UnaryCallable import_Callable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + private final UnaryCallable + listServerCasCallable; + private final UnaryCallable< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesCallable; + private final UnaryCallable< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesCallable; + private final UnaryCallable patchCallable; + private final UnaryCallable promoteReplicaCallable; + private final UnaryCallable switchoverCallable; + private final UnaryCallable resetSslConfigCallable; + private final UnaryCallable restartCallable; + private final UnaryCallable restoreBackupCallable; + private final UnaryCallable rotateServerCaCallable; + private final UnaryCallable + rotateServerCertificateCallable; + private final UnaryCallable + rotateEntraIdCertificateCallable; + private final UnaryCallable startReplicaCallable; + private final UnaryCallable stopReplicaCallable; + private final UnaryCallable truncateLogCallable; + private final UnaryCallable updateCallable; + private final UnaryCallable + createEphemeralCallable; + private final UnaryCallable + rescheduleMaintenanceCallable; + private final UnaryCallable< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsCallable; + private final UnaryCallable + startExternalSyncCallable; + private final UnaryCallable + performDiskShrinkCallable; + private final UnaryCallable< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigCallable; + private final UnaryCallable + resetReplicaSizeCallable; + private final UnaryCallable< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeCallable; + private final UnaryCallable + executeSqlCallable; + private final UnaryCallable< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseCallable; + private final UnaryCallable< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseCallable; + private final UnaryCallable + preCheckMajorVersionUpgradeCallable; + private final UnaryCallable + pointInTimeRestoreCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate ADD_SERVER_CA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ADD_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ADD_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate CLONE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate DEMOTE_MASTER_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate DEMOTE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate EXPORT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate FAILOVER_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate REENCRYPT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate IMPORT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + private static final PathTemplate LIST_SERVER_CAS_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_SERVER_CERTIFICATES_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_ENTRA_ID_CERTIFICATES_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PATCH_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PROMOTE_REPLICA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate SWITCHOVER_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESET_SSL_CONFIG_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESTART_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESTORE_BACKUP_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ROTATE_SERVER_CA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ROTATE_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ROTATE_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate START_REPLICA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate STOP_REPLICA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate TRUNCATE_LOG_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate UPDATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate CREATE_EPHEMERAL_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESCHEDULE_MAINTENANCE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate VERIFY_EXTERNAL_SYNC_SETTINGS_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate START_EXTERNAL_SYNC_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PERFORM_DISK_SHRINK_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_DISK_SHRINK_CONFIG_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESET_REPLICA_SIZE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_LATEST_RECOVERY_TIME_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate EXECUTE_SQL_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ACQUIRE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RELEASE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PRE_CHECK_MAJOR_VERSION_UPGRADE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate POINT_IN_TIME_RESTORE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("{parent=projects/*}"); + + public static final HttpJsonSqlInstancesServiceStub create( + SqlInstancesServiceStubSettings settings) throws IOException { + return new HttpJsonSqlInstancesServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlInstancesServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlInstancesServiceStub( + SqlInstancesServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlInstancesServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlInstancesServiceStub( + SqlInstancesServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlInstancesServiceStub, 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 HttpJsonSqlInstancesServiceStub( + SqlInstancesServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlInstancesServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlInstancesServiceStub, 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 HttpJsonSqlInstancesServiceStub( + SqlInstancesServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings addServerCaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addServerCaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ADD_SERVER_CA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + addServerCertificateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addServerCertificateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ADD_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + addEntraIdCertificateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addEntraIdCertificateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ADD_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings cloneTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(cloneMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return CLONE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings deleteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings demoteMasterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(demoteMasterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DEMOTE_MASTER_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings demoteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(demoteMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DEMOTE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings exportTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(exportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return EXPORT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings failoverTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(failoverMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return FAILOVER_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings reencryptTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(reencryptMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return REENCRYPT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings getTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings import_TransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(import_MethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return IMPORT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings insertTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + listServerCasTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listServerCasMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_SERVER_CAS_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(listServerCertificatesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_SERVER_CERTIFICATES_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(listEntraIdCertificatesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_ENTRA_ID_CERTIFICATES_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings patchTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PATCH_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + promoteReplicaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(promoteReplicaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PROMOTE_REPLICA_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings switchoverTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(switchoverMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return SWITCHOVER_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + resetSslConfigTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(resetSslConfigMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESET_SSL_CONFIG_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings restartTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(restartMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESTART_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + restoreBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(restoreBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESTORE_BACKUP_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + rotateServerCaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(rotateServerCaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ROTATE_SERVER_CA_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + rotateServerCertificateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(rotateServerCertificateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ROTATE_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + rotateEntraIdCertificateTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(rotateEntraIdCertificateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ROTATE_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings startReplicaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(startReplicaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return START_REPLICA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings stopReplicaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(stopReplicaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return STOP_REPLICA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings truncateLogTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(truncateLogMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return TRUNCATE_LOG_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings updateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return UPDATE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + createEphemeralTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createEphemeralMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return CREATE_EPHEMERAL_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + rescheduleMaintenanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(rescheduleMaintenanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESCHEDULE_MAINTENANCE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(verifyExternalSyncSettingsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return VERIFY_EXTERNAL_SYNC_SETTINGS_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + startExternalSyncTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(startExternalSyncMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return START_EXTERNAL_SYNC_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + performDiskShrinkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(performDiskShrinkMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PERFORM_DISK_SHRINK_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(getDiskShrinkConfigMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_DISK_SHRINK_CONFIG_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + resetReplicaSizeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(resetReplicaSizeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESET_REPLICA_SIZE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(getLatestRecoveryTimeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_LATEST_RECOVERY_TIME_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + executeSqlTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(executeSqlMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return EXECUTE_SQL_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + acquireSsrsLeaseTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(acquireSsrsLeaseMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ACQUIRE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + releaseSsrsLeaseTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(releaseSsrsLeaseMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RELEASE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + preCheckMajorVersionUpgradeTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(preCheckMajorVersionUpgradeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PRE_CHECK_MAJOR_VERSION_UPGRADE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + pointInTimeRestoreTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pointInTimeRestoreMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("parent", String.valueOf(request.getParent())); + return POINT_IN_TIME_RESTORE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + + this.addServerCaCallable = + callableFactory.createUnaryCallable( + addServerCaTransportSettings, settings.addServerCaSettings(), clientContext); + this.addServerCertificateCallable = + callableFactory.createUnaryCallable( + addServerCertificateTransportSettings, + settings.addServerCertificateSettings(), + clientContext); + this.addEntraIdCertificateCallable = + callableFactory.createUnaryCallable( + addEntraIdCertificateTransportSettings, + settings.addEntraIdCertificateSettings(), + clientContext); + this.cloneCallable = + callableFactory.createUnaryCallable( + cloneTransportSettings, settings.cloneSettings(), clientContext); + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.demoteMasterCallable = + callableFactory.createUnaryCallable( + demoteMasterTransportSettings, settings.demoteMasterSettings(), clientContext); + this.demoteCallable = + callableFactory.createUnaryCallable( + demoteTransportSettings, settings.demoteSettings(), clientContext); + this.exportCallable = + callableFactory.createUnaryCallable( + exportTransportSettings, settings.exportSettings(), clientContext); + this.failoverCallable = + callableFactory.createUnaryCallable( + failoverTransportSettings, settings.failoverSettings(), clientContext); + this.reencryptCallable = + callableFactory.createUnaryCallable( + reencryptTransportSettings, settings.reencryptSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.import_Callable = + callableFactory.createUnaryCallable( + import_TransportSettings, settings.import_Settings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.listServerCasCallable = + callableFactory.createUnaryCallable( + listServerCasTransportSettings, settings.listServerCasSettings(), clientContext); + this.listServerCertificatesCallable = + callableFactory.createUnaryCallable( + listServerCertificatesTransportSettings, + settings.listServerCertificatesSettings(), + clientContext); + this.listEntraIdCertificatesCallable = + callableFactory.createUnaryCallable( + listEntraIdCertificatesTransportSettings, + settings.listEntraIdCertificatesSettings(), + clientContext); + this.patchCallable = + callableFactory.createUnaryCallable( + patchTransportSettings, settings.patchSettings(), clientContext); + this.promoteReplicaCallable = + callableFactory.createUnaryCallable( + promoteReplicaTransportSettings, settings.promoteReplicaSettings(), clientContext); + this.switchoverCallable = + callableFactory.createUnaryCallable( + switchoverTransportSettings, settings.switchoverSettings(), clientContext); + this.resetSslConfigCallable = + callableFactory.createUnaryCallable( + resetSslConfigTransportSettings, settings.resetSslConfigSettings(), clientContext); + this.restartCallable = + callableFactory.createUnaryCallable( + restartTransportSettings, settings.restartSettings(), clientContext); + this.restoreBackupCallable = + callableFactory.createUnaryCallable( + restoreBackupTransportSettings, settings.restoreBackupSettings(), clientContext); + this.rotateServerCaCallable = + callableFactory.createUnaryCallable( + rotateServerCaTransportSettings, settings.rotateServerCaSettings(), clientContext); + this.rotateServerCertificateCallable = + callableFactory.createUnaryCallable( + rotateServerCertificateTransportSettings, + settings.rotateServerCertificateSettings(), + clientContext); + this.rotateEntraIdCertificateCallable = + callableFactory.createUnaryCallable( + rotateEntraIdCertificateTransportSettings, + settings.rotateEntraIdCertificateSettings(), + clientContext); + this.startReplicaCallable = + callableFactory.createUnaryCallable( + startReplicaTransportSettings, settings.startReplicaSettings(), clientContext); + this.stopReplicaCallable = + callableFactory.createUnaryCallable( + stopReplicaTransportSettings, settings.stopReplicaSettings(), clientContext); + this.truncateLogCallable = + callableFactory.createUnaryCallable( + truncateLogTransportSettings, settings.truncateLogSettings(), clientContext); + this.updateCallable = + callableFactory.createUnaryCallable( + updateTransportSettings, settings.updateSettings(), clientContext); + this.createEphemeralCallable = + callableFactory.createUnaryCallable( + createEphemeralTransportSettings, settings.createEphemeralSettings(), clientContext); + this.rescheduleMaintenanceCallable = + callableFactory.createUnaryCallable( + rescheduleMaintenanceTransportSettings, + settings.rescheduleMaintenanceSettings(), + clientContext); + this.verifyExternalSyncSettingsCallable = + callableFactory.createUnaryCallable( + verifyExternalSyncSettingsTransportSettings, + settings.verifyExternalSyncSettingsSettings(), + clientContext); + this.startExternalSyncCallable = + callableFactory.createUnaryCallable( + startExternalSyncTransportSettings, + settings.startExternalSyncSettings(), + clientContext); + this.performDiskShrinkCallable = + callableFactory.createUnaryCallable( + performDiskShrinkTransportSettings, + settings.performDiskShrinkSettings(), + clientContext); + this.getDiskShrinkConfigCallable = + callableFactory.createUnaryCallable( + getDiskShrinkConfigTransportSettings, + settings.getDiskShrinkConfigSettings(), + clientContext); + this.resetReplicaSizeCallable = + callableFactory.createUnaryCallable( + resetReplicaSizeTransportSettings, settings.resetReplicaSizeSettings(), clientContext); + this.getLatestRecoveryTimeCallable = + callableFactory.createUnaryCallable( + getLatestRecoveryTimeTransportSettings, + settings.getLatestRecoveryTimeSettings(), + clientContext); + this.executeSqlCallable = + callableFactory.createUnaryCallable( + executeSqlTransportSettings, settings.executeSqlSettings(), clientContext); + this.acquireSsrsLeaseCallable = + callableFactory.createUnaryCallable( + acquireSsrsLeaseTransportSettings, settings.acquireSsrsLeaseSettings(), clientContext); + this.releaseSsrsLeaseCallable = + callableFactory.createUnaryCallable( + releaseSsrsLeaseTransportSettings, settings.releaseSsrsLeaseSettings(), clientContext); + this.preCheckMajorVersionUpgradeCallable = + callableFactory.createUnaryCallable( + preCheckMajorVersionUpgradeTransportSettings, + settings.preCheckMajorVersionUpgradeSettings(), + clientContext); + this.pointInTimeRestoreCallable = + callableFactory.createUnaryCallable( + pointInTimeRestoreTransportSettings, + settings.pointInTimeRestoreSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(addServerCaMethodDescriptor); + methodDescriptors.add(addServerCertificateMethodDescriptor); + methodDescriptors.add(addEntraIdCertificateMethodDescriptor); + methodDescriptors.add(cloneMethodDescriptor); + methodDescriptors.add(deleteMethodDescriptor); + methodDescriptors.add(demoteMasterMethodDescriptor); + methodDescriptors.add(demoteMethodDescriptor); + methodDescriptors.add(exportMethodDescriptor); + methodDescriptors.add(failoverMethodDescriptor); + methodDescriptors.add(reencryptMethodDescriptor); + methodDescriptors.add(getMethodDescriptor); + methodDescriptors.add(import_MethodDescriptor); + methodDescriptors.add(insertMethodDescriptor); + methodDescriptors.add(listMethodDescriptor); + methodDescriptors.add(listServerCasMethodDescriptor); + methodDescriptors.add(listServerCertificatesMethodDescriptor); + methodDescriptors.add(listEntraIdCertificatesMethodDescriptor); + methodDescriptors.add(patchMethodDescriptor); + methodDescriptors.add(promoteReplicaMethodDescriptor); + methodDescriptors.add(switchoverMethodDescriptor); + methodDescriptors.add(resetSslConfigMethodDescriptor); + methodDescriptors.add(restartMethodDescriptor); + methodDescriptors.add(restoreBackupMethodDescriptor); + methodDescriptors.add(rotateServerCaMethodDescriptor); + methodDescriptors.add(rotateServerCertificateMethodDescriptor); + methodDescriptors.add(rotateEntraIdCertificateMethodDescriptor); + methodDescriptors.add(startReplicaMethodDescriptor); + methodDescriptors.add(stopReplicaMethodDescriptor); + methodDescriptors.add(truncateLogMethodDescriptor); + methodDescriptors.add(updateMethodDescriptor); + methodDescriptors.add(createEphemeralMethodDescriptor); + methodDescriptors.add(rescheduleMaintenanceMethodDescriptor); + methodDescriptors.add(verifyExternalSyncSettingsMethodDescriptor); + methodDescriptors.add(startExternalSyncMethodDescriptor); + methodDescriptors.add(performDiskShrinkMethodDescriptor); + methodDescriptors.add(getDiskShrinkConfigMethodDescriptor); + methodDescriptors.add(resetReplicaSizeMethodDescriptor); + methodDescriptors.add(getLatestRecoveryTimeMethodDescriptor); + methodDescriptors.add(executeSqlMethodDescriptor); + methodDescriptors.add(acquireSsrsLeaseMethodDescriptor); + methodDescriptors.add(releaseSsrsLeaseMethodDescriptor); + methodDescriptors.add(preCheckMajorVersionUpgradeMethodDescriptor); + methodDescriptors.add(pointInTimeRestoreMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable addServerCaCallable() { + return addServerCaCallable; + } + + @Override + public UnaryCallable + addServerCertificateCallable() { + return addServerCertificateCallable; + } + + @Override + public UnaryCallable + addEntraIdCertificateCallable() { + return addEntraIdCertificateCallable; + } + + @Override + public UnaryCallable cloneCallable() { + return cloneCallable; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable demoteMasterCallable() { + return demoteMasterCallable; + } + + @Override + public UnaryCallable demoteCallable() { + return demoteCallable; + } + + @Override + public UnaryCallable exportCallable() { + return exportCallable; + } + + @Override + public UnaryCallable failoverCallable() { + return failoverCallable; + } + + @Override + public UnaryCallable reencryptCallable() { + return reencryptCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable import_Callable() { + return import_Callable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable + listServerCasCallable() { + return listServerCasCallable; + } + + @Override + public UnaryCallable< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesCallable() { + return listServerCertificatesCallable; + } + + @Override + public UnaryCallable< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesCallable() { + return listEntraIdCertificatesCallable; + } + + @Override + public UnaryCallable patchCallable() { + return patchCallable; + } + + @Override + public UnaryCallable promoteReplicaCallable() { + return promoteReplicaCallable; + } + + @Override + public UnaryCallable switchoverCallable() { + return switchoverCallable; + } + + @Override + public UnaryCallable resetSslConfigCallable() { + return resetSslConfigCallable; + } + + @Override + public UnaryCallable restartCallable() { + return restartCallable; + } + + @Override + public UnaryCallable restoreBackupCallable() { + return restoreBackupCallable; + } + + @Override + public UnaryCallable rotateServerCaCallable() { + return rotateServerCaCallable; + } + + @Override + public UnaryCallable + rotateServerCertificateCallable() { + return rotateServerCertificateCallable; + } + + @Override + public UnaryCallable + rotateEntraIdCertificateCallable() { + return rotateEntraIdCertificateCallable; + } + + @Override + public UnaryCallable startReplicaCallable() { + return startReplicaCallable; + } + + @Override + public UnaryCallable stopReplicaCallable() { + return stopReplicaCallable; + } + + @Override + public UnaryCallable truncateLogCallable() { + return truncateLogCallable; + } + + @Override + public UnaryCallable updateCallable() { + return updateCallable; + } + + @Override + public UnaryCallable createEphemeralCallable() { + return createEphemeralCallable; + } + + @Override + public UnaryCallable + rescheduleMaintenanceCallable() { + return rescheduleMaintenanceCallable; + } + + @Override + public UnaryCallable< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsCallable() { + return verifyExternalSyncSettingsCallable; + } + + @Override + public UnaryCallable + startExternalSyncCallable() { + return startExternalSyncCallable; + } + + @Override + public UnaryCallable + performDiskShrinkCallable() { + return performDiskShrinkCallable; + } + + @Override + public UnaryCallable< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigCallable() { + return getDiskShrinkConfigCallable; + } + + @Override + public UnaryCallable resetReplicaSizeCallable() { + return resetReplicaSizeCallable; + } + + @Override + public UnaryCallable< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeCallable() { + return getLatestRecoveryTimeCallable; + } + + @Override + public UnaryCallable + executeSqlCallable() { + return executeSqlCallable; + } + + @Override + public UnaryCallable + acquireSsrsLeaseCallable() { + return acquireSsrsLeaseCallable; + } + + @Override + public UnaryCallable + releaseSsrsLeaseCallable() { + return releaseSsrsLeaseCallable; + } + + @Override + public UnaryCallable + preCheckMajorVersionUpgradeCallable() { + return preCheckMajorVersionUpgradeCallable; + } + + @Override + public UnaryCallable + pointInTimeRestoreCallable() { + return pointInTimeRestoreCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlOperationsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlOperationsServiceCallableFactory.java new file mode 100644 index 000000000000..b4244eb5d11d --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlOperationsServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlOperationsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlOperationsServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlOperationsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlOperationsServiceStub.java new file mode 100644 index 000000000000..7a6e6170e43d --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlOperationsServiceStub.java @@ -0,0 +1,349 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.OperationsListResponse; +import com.google.cloud.sql.v1.SqlOperationsCancelRequest; +import com.google.cloud.sql.v1.SqlOperationsGetRequest; +import com.google.cloud.sql.v1.SqlOperationsListRequest; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlOperationsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlOperationsServiceStub extends SqlOperationsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor getMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlOperationsService/Get") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/operations/{operation}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "operation", request.getOperation()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlOperationsService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/operations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "instance", request.getInstance()); + serializer.putQueryParam(fields, "maxResults", request.getMaxResults()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(OperationsListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + cancelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlOperationsService/Cancel") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/operations/{operation}/cancel", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "operation", request.getOperation()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getCallable; + private final UnaryCallable listCallable; + private final UnaryCallable cancelCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/operations/{operation}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + private static final PathTemplate CANCEL_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/operations/{operation}"); + + public static final HttpJsonSqlOperationsServiceStub create( + SqlOperationsServiceStubSettings settings) throws IOException { + return new HttpJsonSqlOperationsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlOperationsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlOperationsServiceStub( + SqlOperationsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlOperationsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlOperationsServiceStub( + SqlOperationsServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlOperationsServiceStub, 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 HttpJsonSqlOperationsServiceStub( + SqlOperationsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlOperationsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlOperationsServiceStub, 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 HttpJsonSqlOperationsServiceStub( + SqlOperationsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("operation", String.valueOf(request.getOperation())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("operation", String.valueOf(request.getOperation())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings cancelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(cancelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("operation", String.valueOf(request.getOperation())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("operation", String.valueOf(request.getOperation())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return CANCEL_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.cancelCallable = + callableFactory.createUnaryCallable( + cancelTransportSettings, settings.cancelSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getMethodDescriptor); + methodDescriptors.add(listMethodDescriptor); + methodDescriptors.add(cancelMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable cancelCallable() { + return cancelCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlSslCertsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlSslCertsServiceCallableFactory.java new file mode 100644 index 000000000000..115020d1a62d --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlSslCertsServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlSslCertsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlSslCertsServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlSslCertsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlSslCertsServiceStub.java new file mode 100644 index 000000000000..5f4324e7a11c --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlSslCertsServiceStub.java @@ -0,0 +1,429 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlSslCertsDeleteRequest; +import com.google.cloud.sql.v1.SqlSslCertsGetRequest; +import com.google.cloud.sql.v1.SqlSslCertsInsertRequest; +import com.google.cloud.sql.v1.SqlSslCertsListRequest; +import com.google.cloud.sql.v1.SslCert; +import com.google.cloud.sql.v1.SslCertsInsertResponse; +import com.google.cloud.sql.v1.SslCertsListResponse; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlSslCertsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlSslCertsServiceStub extends SqlSslCertsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + deleteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlSslCertsService/Delete") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + serializer.putPathParam( + fields, "sha1Fingerprint", request.getSha1Fingerprint()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlSslCertsService/Get") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + serializer.putPathParam( + fields, "sha1Fingerprint", request.getSha1Fingerprint()); + 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(SslCert.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + insertMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlSslCertsService/Insert") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/sslCerts", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SslCertsInsertResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlSslCertsService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/sslCerts", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(SslCertsListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + + public static final HttpJsonSqlSslCertsServiceStub create(SqlSslCertsServiceStubSettings settings) + throws IOException { + return new HttpJsonSqlSslCertsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlSslCertsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlSslCertsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlSslCertsServiceStub, 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 HttpJsonSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlSslCertsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlSslCertsServiceStub, 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 HttpJsonSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + builder.add("sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + resourceNameSegments.put( + "sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings getTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + builder.add("sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + resourceNameSegments.put( + "sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings insertTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(deleteMethodDescriptor); + methodDescriptors.add(getMethodDescriptor); + methodDescriptors.add(insertMethodDescriptor); + methodDescriptors.add(listMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlTiersServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlTiersServiceCallableFactory.java new file mode 100644 index 000000000000..20736abe7b57 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlTiersServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlTiersService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlTiersServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlTiersServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlTiersServiceStub.java new file mode 100644 index 000000000000..fb30fec43fba --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlTiersServiceStub.java @@ -0,0 +1,209 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1.SqlTiersListRequest; +import com.google.cloud.sql.v1.TiersListResponse; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlTiersService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlTiersServiceStub extends SqlTiersServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlTiersService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/tiers", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "project", request.getProject()); + 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(TiersListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + + public static final HttpJsonSqlTiersServiceStub create(SqlTiersServiceStubSettings settings) + throws IOException { + return new HttpJsonSqlTiersServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlTiersServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlTiersServiceStub( + SqlTiersServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlTiersServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlTiersServiceStub( + SqlTiersServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlTiersServiceStub, 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 HttpJsonSqlTiersServiceStub( + SqlTiersServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlTiersServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlTiersServiceStub, 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 HttpJsonSqlTiersServiceStub( + SqlTiersServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlUsersServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlUsersServiceCallableFactory.java new file mode 100644 index 000000000000..da8933d59fa1 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlUsersServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlUsersService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlUsersServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlUsersServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlUsersServiceStub.java new file mode 100644 index 000000000000..f20a5174af31 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/HttpJsonSqlUsersServiceStub.java @@ -0,0 +1,499 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlUsersDeleteRequest; +import com.google.cloud.sql.v1.SqlUsersGetRequest; +import com.google.cloud.sql.v1.SqlUsersInsertRequest; +import com.google.cloud.sql.v1.SqlUsersListRequest; +import com.google.cloud.sql.v1.SqlUsersUpdateRequest; +import com.google.cloud.sql.v1.User; +import com.google.cloud.sql.v1.UsersListResponse; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlUsersService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class HttpJsonSqlUsersServiceStub extends SqlUsersServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + deleteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlUsersService/Delete") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "host", request.getHost()); + serializer.putQueryParam(fields, "name", request.getName()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlUsersService/Get") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/users/{name}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "name", request.getName()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "host", request.getHost()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + insertMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlUsersService/Insert") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlUsersService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(UsersListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1.SqlUsersService/Update") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{project}/instances/{instance}/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "databaseRoles", request.getDatabaseRolesList()); + serializer.putQueryParam(fields, "host", request.getHost()); + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasRevokeExistingRoles()) { + serializer.putQueryParam( + fields, "revokeExistingRoles", request.getRevokeExistingRoles()); + } + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + private final UnaryCallable updateCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/users/{name}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate UPDATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + + public static final HttpJsonSqlUsersServiceStub create(SqlUsersServiceStubSettings settings) + throws IOException { + return new HttpJsonSqlUsersServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlUsersServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlUsersServiceStub( + SqlUsersServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlUsersServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlUsersServiceStub( + SqlUsersServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlUsersServiceStub, 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 HttpJsonSqlUsersServiceStub( + SqlUsersServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlUsersServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlUsersServiceStub, 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 HttpJsonSqlUsersServiceStub( + SqlUsersServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings getTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("name", String.valueOf(request.getName())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("name", String.valueOf(request.getName())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings insertTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings updateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return UPDATE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.updateCallable = + callableFactory.createUnaryCallable( + updateTransportSettings, settings.updateSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(deleteMethodDescriptor); + methodDescriptors.add(getMethodDescriptor); + methodDescriptors.add(insertMethodDescriptor); + methodDescriptors.add(listMethodDescriptor); + methodDescriptors.add(updateMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable updateCallable() { + return updateCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlBackupRunsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlBackupRunsServiceStub.java new file mode 100644 index 000000000000..d1404b5bd256 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlBackupRunsServiceStub.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.BackupRun; +import com.google.cloud.sql.v1.BackupRunsListResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest; +import com.google.cloud.sql.v1.SqlBackupRunsGetRequest; +import com.google.cloud.sql.v1.SqlBackupRunsInsertRequest; +import com.google.cloud.sql.v1.SqlBackupRunsListRequest; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlBackupRunsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public abstract class SqlBackupRunsServiceStub implements BackgroundResource { + + public UnaryCallable deleteCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCallable()"); + } + + public UnaryCallable getCallable() { + throw new UnsupportedOperationException("Not implemented: getCallable()"); + } + + public UnaryCallable insertCallable() { + throw new UnsupportedOperationException("Not implemented: insertCallable()"); + } + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlBackupRunsServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlBackupRunsServiceStubSettings.java new file mode 100644 index 000000000000..7b58ebfc4bdf --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlBackupRunsServiceStubSettings.java @@ -0,0 +1,427 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1.BackupRun; +import com.google.cloud.sql.v1.BackupRunsListResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest; +import com.google.cloud.sql.v1.SqlBackupRunsGetRequest; +import com.google.cloud.sql.v1.SqlBackupRunsInsertRequest; +import com.google.cloud.sql.v1.SqlBackupRunsListRequest; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlBackupRunsServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlBackupRunsServiceStubSettings.Builder sqlBackupRunsServiceSettingsBuilder =
+ *     SqlBackupRunsServiceStubSettings.newBuilder();
+ * sqlBackupRunsServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlBackupRunsServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlBackupRunsServiceStubSettings sqlBackupRunsServiceSettings =
+ *     sqlBackupRunsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlBackupRunsServiceStubSettings + 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings deleteSettings; + private final UnaryCallSettings getSettings; + private final UnaryCallSettings insertSettings; + private final UnaryCallSettings listSettings; + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return deleteSettings; + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return getSettings; + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return insertSettings; + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + public SqlBackupRunsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlBackupRunsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlBackupRunsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlBackupRunsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlBackupRunsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlBackupRunsServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlBackupRunsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteSettings = settingsBuilder.deleteSettings().build(); + getSettings = settingsBuilder.getSettings().build(); + insertSettings = settingsBuilder.insertSettings().build(); + listSettings = settingsBuilder.listSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlBackupRunsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder deleteSettings; + private final UnaryCallSettings.Builder getSettings; + private final UnaryCallSettings.Builder insertSettings; + private final UnaryCallSettings.Builder + listSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + deleteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, getSettings, insertSettings, listSettings); + initDefaults(this); + } + + protected Builder(SqlBackupRunsServiceStubSettings settings) { + super(settings); + + deleteSettings = settings.deleteSettings.toBuilder(); + getSettings = settings.getSettings.toBuilder(); + insertSettings = settings.insertSettings.toBuilder(); + listSettings = settings.listSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, getSettings, insertSettings, listSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .deleteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .insertSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return deleteSettings; + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getSettings; + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return insertSettings; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return listSettings; + } + + @Override + public SqlBackupRunsServiceStubSettings build() throws IOException { + return new SqlBackupRunsServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlBackupsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlBackupsServiceStub.java new file mode 100644 index 000000000000..6fa8f5a2079a --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlBackupsServiceStub.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import static com.google.cloud.sql.v1.SqlBackupsServiceClient.ListBackupsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.CreateBackupRequest; +import com.google.cloud.sql.v1.DeleteBackupRequest; +import com.google.cloud.sql.v1.GetBackupRequest; +import com.google.cloud.sql.v1.ListBackupsRequest; +import com.google.cloud.sql.v1.ListBackupsResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.UpdateBackupRequest; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlBackupsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public abstract class SqlBackupsServiceStub implements BackgroundResource { + + public UnaryCallable createBackupCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupCallable()"); + } + + public UnaryCallable getBackupCallable() { + throw new UnsupportedOperationException("Not implemented: getBackupCallable()"); + } + + public UnaryCallable listBackupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsPagedCallable()"); + } + + public UnaryCallable listBackupsCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsCallable()"); + } + + public UnaryCallable updateBackupCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupCallable()"); + } + + public UnaryCallable deleteBackupCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlBackupsServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlBackupsServiceStubSettings.java new file mode 100644 index 000000000000..10f5f7581a3b --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlBackupsServiceStubSettings.java @@ -0,0 +1,518 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import static com.google.cloud.sql.v1.SqlBackupsServiceClient.ListBackupsPagedResponse; + +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.sql.v1.Backup; +import com.google.cloud.sql.v1.CreateBackupRequest; +import com.google.cloud.sql.v1.DeleteBackupRequest; +import com.google.cloud.sql.v1.GetBackupRequest; +import com.google.cloud.sql.v1.ListBackupsRequest; +import com.google.cloud.sql.v1.ListBackupsResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.UpdateBackupRequest; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlBackupsServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 createBackup: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlBackupsServiceStubSettings.Builder sqlBackupsServiceSettingsBuilder =
+ *     SqlBackupsServiceStubSettings.newBuilder();
+ * sqlBackupsServiceSettingsBuilder
+ *     .createBackupSettings()
+ *     .setRetrySettings(
+ *         sqlBackupsServiceSettingsBuilder
+ *             .createBackupSettings()
+ *             .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());
+ * SqlBackupsServiceStubSettings sqlBackupsServiceSettings =
+ *     sqlBackupsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlBackupsServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings createBackupSettings; + private final UnaryCallSettings getBackupSettings; + private final PagedCallSettings + listBackupsSettings; + private final UnaryCallSettings updateBackupSettings; + private final UnaryCallSettings deleteBackupSettings; + + private static final PagedListDescriptor + LIST_BACKUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBackupsRequest injectToken(ListBackupsRequest payload, String token) { + return ListBackupsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBackupsRequest injectPageSize(ListBackupsRequest payload, int pageSize) { + return ListBackupsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBackupsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBackupsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBackupsResponse payload) { + return payload.getBackupsList(); + } + }; + + private static final PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + LIST_BACKUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBackupsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BACKUPS_PAGE_STR_DESC, request, context); + return ListBackupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return createBackupSettings; + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return getBackupSettings; + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return deleteBackupSettings; + } + + public SqlBackupsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlBackupsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlBackupsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlBackupsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlBackupsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlBackupsServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlBackupsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createBackupSettings = settingsBuilder.createBackupSettings().build(); + getBackupSettings = settingsBuilder.getBackupSettings().build(); + listBackupsSettings = settingsBuilder.listBackupsSettings().build(); + updateBackupSettings = settingsBuilder.updateBackupSettings().build(); + deleteBackupSettings = settingsBuilder.deleteBackupSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlBackupsServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createBackupSettings; + private final UnaryCallSettings.Builder getBackupSettings; + private final PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings; + private final UnaryCallSettings.Builder updateBackupSettings; + private final UnaryCallSettings.Builder deleteBackupSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + createBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT); + updateBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createBackupSettings, + getBackupSettings, + listBackupsSettings, + updateBackupSettings, + deleteBackupSettings); + initDefaults(this); + } + + protected Builder(SqlBackupsServiceStubSettings settings) { + super(settings); + + createBackupSettings = settings.createBackupSettings.toBuilder(); + getBackupSettings = settings.getBackupSettings.toBuilder(); + listBackupsSettings = settings.listBackupsSettings.toBuilder(); + updateBackupSettings = settings.updateBackupSettings.toBuilder(); + deleteBackupSettings = settings.deleteBackupSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createBackupSettings, + getBackupSettings, + listBackupsSettings, + updateBackupSettings, + deleteBackupSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listBackupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return createBackupSettings; + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getBackupSettings; + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return deleteBackupSettings; + } + + @Override + public SqlBackupsServiceStubSettings build() throws IOException { + return new SqlBackupsServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlConnectServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlConnectServiceStub.java new file mode 100644 index 000000000000..f5c24c899063 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlConnectServiceStub.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.ConnectSettings; +import com.google.cloud.sql.v1.GenerateEphemeralCertRequest; +import com.google.cloud.sql.v1.GenerateEphemeralCertResponse; +import com.google.cloud.sql.v1.GetConnectSettingsRequest; +import com.google.cloud.sql.v1.ResolveConnectSettingsRequest; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlConnectService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public abstract class SqlConnectServiceStub implements BackgroundResource { + + public UnaryCallable getConnectSettingsCallable() { + throw new UnsupportedOperationException("Not implemented: getConnectSettingsCallable()"); + } + + public UnaryCallable + resolveConnectSettingsCallable() { + throw new UnsupportedOperationException("Not implemented: resolveConnectSettingsCallable()"); + } + + public UnaryCallable + generateEphemeralCertCallable() { + throw new UnsupportedOperationException("Not implemented: generateEphemeralCertCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlConnectServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlConnectServiceStubSettings.java new file mode 100644 index 000000000000..c81a701f1b0a --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlConnectServiceStubSettings.java @@ -0,0 +1,410 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1.ConnectSettings; +import com.google.cloud.sql.v1.GenerateEphemeralCertRequest; +import com.google.cloud.sql.v1.GenerateEphemeralCertResponse; +import com.google.cloud.sql.v1.GetConnectSettingsRequest; +import com.google.cloud.sql.v1.ResolveConnectSettingsRequest; +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 java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlConnectServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 getConnectSettings: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlConnectServiceStubSettings.Builder sqlConnectServiceSettingsBuilder =
+ *     SqlConnectServiceStubSettings.newBuilder();
+ * sqlConnectServiceSettingsBuilder
+ *     .getConnectSettingsSettings()
+ *     .setRetrySettings(
+ *         sqlConnectServiceSettingsBuilder
+ *             .getConnectSettingsSettings()
+ *             .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());
+ * SqlConnectServiceStubSettings sqlConnectServiceSettings =
+ *     sqlConnectServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlConnectServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings + getConnectSettingsSettings; + private final UnaryCallSettings + resolveConnectSettingsSettings; + private final UnaryCallSettings + generateEphemeralCertSettings; + + /** Returns the object with the settings used for calls to getConnectSettings. */ + public UnaryCallSettings + getConnectSettingsSettings() { + return getConnectSettingsSettings; + } + + /** Returns the object with the settings used for calls to resolveConnectSettings. */ + public UnaryCallSettings + resolveConnectSettingsSettings() { + return resolveConnectSettingsSettings; + } + + /** Returns the object with the settings used for calls to generateEphemeralCert. */ + public UnaryCallSettings + generateEphemeralCertSettings() { + return generateEphemeralCertSettings; + } + + public SqlConnectServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlConnectServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlConnectServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlConnectServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlConnectServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlConnectServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlConnectServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getConnectSettingsSettings = settingsBuilder.getConnectSettingsSettings().build(); + resolveConnectSettingsSettings = settingsBuilder.resolveConnectSettingsSettings().build(); + generateEphemeralCertSettings = settingsBuilder.generateEphemeralCertSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlConnectServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + getConnectSettingsSettings; + private final UnaryCallSettings.Builder + resolveConnectSettingsSettings; + private final UnaryCallSettings.Builder< + GenerateEphemeralCertRequest, GenerateEphemeralCertResponse> + generateEphemeralCertSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + 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().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + getConnectSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + resolveConnectSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + generateEphemeralCertSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getConnectSettingsSettings, + resolveConnectSettingsSettings, + generateEphemeralCertSettings); + initDefaults(this); + } + + protected Builder(SqlConnectServiceStubSettings settings) { + super(settings); + + getConnectSettingsSettings = settings.getConnectSettingsSettings.toBuilder(); + resolveConnectSettingsSettings = settings.resolveConnectSettingsSettings.toBuilder(); + generateEphemeralCertSettings = settings.generateEphemeralCertSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getConnectSettingsSettings, + resolveConnectSettingsSettings, + generateEphemeralCertSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getConnectSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .resolveConnectSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .generateEphemeralCertSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getConnectSettings. */ + public UnaryCallSettings.Builder + getConnectSettingsSettings() { + return getConnectSettingsSettings; + } + + /** Returns the builder for the settings used for calls to resolveConnectSettings. */ + public UnaryCallSettings.Builder + resolveConnectSettingsSettings() { + return resolveConnectSettingsSettings; + } + + /** Returns the builder for the settings used for calls to generateEphemeralCert. */ + public UnaryCallSettings.Builder + generateEphemeralCertSettings() { + return generateEphemeralCertSettings; + } + + @Override + public SqlConnectServiceStubSettings build() throws IOException { + return new SqlConnectServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlDatabasesServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlDatabasesServiceStub.java new file mode 100644 index 000000000000..662a0933a8b1 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlDatabasesServiceStub.java @@ -0,0 +1,68 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.Database; +import com.google.cloud.sql.v1.DatabasesListResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlDatabasesDeleteRequest; +import com.google.cloud.sql.v1.SqlDatabasesGetRequest; +import com.google.cloud.sql.v1.SqlDatabasesInsertRequest; +import com.google.cloud.sql.v1.SqlDatabasesListRequest; +import com.google.cloud.sql.v1.SqlDatabasesUpdateRequest; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlDatabasesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public abstract class SqlDatabasesServiceStub implements BackgroundResource { + + public UnaryCallable deleteCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCallable()"); + } + + public UnaryCallable getCallable() { + throw new UnsupportedOperationException("Not implemented: getCallable()"); + } + + public UnaryCallable insertCallable() { + throw new UnsupportedOperationException("Not implemented: insertCallable()"); + } + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + public UnaryCallable patchCallable() { + throw new UnsupportedOperationException("Not implemented: patchCallable()"); + } + + public UnaryCallable updateCallable() { + throw new UnsupportedOperationException("Not implemented: updateCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlDatabasesServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlDatabasesServiceStubSettings.java new file mode 100644 index 000000000000..97e85209d4ac --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlDatabasesServiceStubSettings.java @@ -0,0 +1,477 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1.Database; +import com.google.cloud.sql.v1.DatabasesListResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlDatabasesDeleteRequest; +import com.google.cloud.sql.v1.SqlDatabasesGetRequest; +import com.google.cloud.sql.v1.SqlDatabasesInsertRequest; +import com.google.cloud.sql.v1.SqlDatabasesListRequest; +import com.google.cloud.sql.v1.SqlDatabasesUpdateRequest; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlDatabasesServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlDatabasesServiceStubSettings.Builder sqlDatabasesServiceSettingsBuilder =
+ *     SqlDatabasesServiceStubSettings.newBuilder();
+ * sqlDatabasesServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlDatabasesServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlDatabasesServiceStubSettings sqlDatabasesServiceSettings =
+ *     sqlDatabasesServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlDatabasesServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings deleteSettings; + private final UnaryCallSettings getSettings; + private final UnaryCallSettings insertSettings; + private final UnaryCallSettings listSettings; + private final UnaryCallSettings patchSettings; + private final UnaryCallSettings updateSettings; + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return deleteSettings; + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return getSettings; + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return insertSettings; + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + /** Returns the object with the settings used for calls to patch. */ + public UnaryCallSettings patchSettings() { + return patchSettings; + } + + /** Returns the object with the settings used for calls to update. */ + public UnaryCallSettings updateSettings() { + return updateSettings; + } + + public SqlDatabasesServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlDatabasesServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlDatabasesServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlDatabasesServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlDatabasesServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlDatabasesServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlDatabasesServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteSettings = settingsBuilder.deleteSettings().build(); + getSettings = settingsBuilder.getSettings().build(); + insertSettings = settingsBuilder.insertSettings().build(); + listSettings = settingsBuilder.listSettings().build(); + patchSettings = settingsBuilder.patchSettings().build(); + updateSettings = settingsBuilder.updateSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlDatabasesServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder deleteSettings; + private final UnaryCallSettings.Builder getSettings; + private final UnaryCallSettings.Builder insertSettings; + private final UnaryCallSettings.Builder + listSettings; + private final UnaryCallSettings.Builder patchSettings; + private final UnaryCallSettings.Builder updateSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + deleteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + patchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, + getSettings, + insertSettings, + listSettings, + patchSettings, + updateSettings); + initDefaults(this); + } + + protected Builder(SqlDatabasesServiceStubSettings settings) { + super(settings); + + deleteSettings = settings.deleteSettings.toBuilder(); + getSettings = settings.getSettings.toBuilder(); + insertSettings = settings.insertSettings.toBuilder(); + listSettings = settings.listSettings.toBuilder(); + patchSettings = settings.patchSettings.toBuilder(); + updateSettings = settings.updateSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, + getSettings, + insertSettings, + listSettings, + patchSettings, + updateSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .deleteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .insertSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .patchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return deleteSettings; + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getSettings; + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return insertSettings; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return listSettings; + } + + /** Returns the builder for the settings used for calls to patch. */ + public UnaryCallSettings.Builder patchSettings() { + return patchSettings; + } + + /** Returns the builder for the settings used for calls to update. */ + public UnaryCallSettings.Builder updateSettings() { + return updateSettings; + } + + @Override + public SqlDatabasesServiceStubSettings build() throws IOException { + return new SqlDatabasesServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlFlagsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlFlagsServiceStub.java new file mode 100644 index 000000000000..d4d341feed5d --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlFlagsServiceStub.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.FlagsListResponse; +import com.google.cloud.sql.v1.SqlFlagsListRequest; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlFlagsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public abstract class SqlFlagsServiceStub implements BackgroundResource { + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlFlagsServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlFlagsServiceStubSettings.java new file mode 100644 index 000000000000..874c9e404f99 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlFlagsServiceStubSettings.java @@ -0,0 +1,353 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1.FlagsListResponse; +import com.google.cloud.sql.v1.SqlFlagsListRequest; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlFlagsServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 list: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlFlagsServiceStubSettings.Builder sqlFlagsServiceSettingsBuilder =
+ *     SqlFlagsServiceStubSettings.newBuilder();
+ * sqlFlagsServiceSettingsBuilder
+ *     .listSettings()
+ *     .setRetrySettings(
+ *         sqlFlagsServiceSettingsBuilder
+ *             .listSettings()
+ *             .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());
+ * SqlFlagsServiceStubSettings sqlFlagsServiceSettings = sqlFlagsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlFlagsServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings listSettings; + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + public SqlFlagsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlFlagsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlFlagsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlFlagsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlFlagsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlFlagsServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlFlagsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listSettings = settingsBuilder.listSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlFlagsServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder listSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of(listSettings); + initDefaults(this); + } + + protected Builder(SqlFlagsServiceStubSettings settings) { + super(settings); + + listSettings = settings.listSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of(listSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder listSettings() { + return listSettings; + } + + @Override + public SqlFlagsServiceStubSettings build() throws IOException { + return new SqlFlagsServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlInstancesServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlInstancesServiceStub.java new file mode 100644 index 000000000000..45e918497dd6 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlInstancesServiceStub.java @@ -0,0 +1,290 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.DatabaseInstance; +import com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse; +import com.google.cloud.sql.v1.InstancesListResponse; +import com.google.cloud.sql.v1.InstancesListServerCasResponse; +import com.google.cloud.sql.v1.InstancesListServerCertificatesResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse; +import com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest; +import com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesCloneRequest; +import com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest; +import com.google.cloud.sql.v1.SqlInstancesDeleteRequest; +import com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest; +import com.google.cloud.sql.v1.SqlInstancesDemoteRequest; +import com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest; +import com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse; +import com.google.cloud.sql.v1.SqlInstancesExportRequest; +import com.google.cloud.sql.v1.SqlInstancesFailoverRequest; +import com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest; +import com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse; +import com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest; +import com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse; +import com.google.cloud.sql.v1.SqlInstancesGetRequest; +import com.google.cloud.sql.v1.SqlInstancesImportRequest; +import com.google.cloud.sql.v1.SqlInstancesInsertRequest; +import com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest; +import com.google.cloud.sql.v1.SqlInstancesListRequest; +import com.google.cloud.sql.v1.SqlInstancesListServerCasRequest; +import com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest; +import com.google.cloud.sql.v1.SqlInstancesPatchRequest; +import com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest; +import com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest; +import com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest; +import com.google.cloud.sql.v1.SqlInstancesReencryptRequest; +import com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest; +import com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse; +import com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest; +import com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest; +import com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest; +import com.google.cloud.sql.v1.SqlInstancesRestartRequest; +import com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest; +import com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest; +import com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest; +import com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest; +import com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest; +import com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest; +import com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest; +import com.google.cloud.sql.v1.SqlInstancesUpdateRequest; +import com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest; +import com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse; +import com.google.cloud.sql.v1.SslCert; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlInstancesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public abstract class SqlInstancesServiceStub implements BackgroundResource { + + public UnaryCallable addServerCaCallable() { + throw new UnsupportedOperationException("Not implemented: addServerCaCallable()"); + } + + public UnaryCallable + addServerCertificateCallable() { + throw new UnsupportedOperationException("Not implemented: addServerCertificateCallable()"); + } + + public UnaryCallable + addEntraIdCertificateCallable() { + throw new UnsupportedOperationException("Not implemented: addEntraIdCertificateCallable()"); + } + + public UnaryCallable cloneCallable() { + throw new UnsupportedOperationException("Not implemented: cloneCallable()"); + } + + public UnaryCallable deleteCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCallable()"); + } + + public UnaryCallable demoteMasterCallable() { + throw new UnsupportedOperationException("Not implemented: demoteMasterCallable()"); + } + + public UnaryCallable demoteCallable() { + throw new UnsupportedOperationException("Not implemented: demoteCallable()"); + } + + public UnaryCallable exportCallable() { + throw new UnsupportedOperationException("Not implemented: exportCallable()"); + } + + public UnaryCallable failoverCallable() { + throw new UnsupportedOperationException("Not implemented: failoverCallable()"); + } + + public UnaryCallable reencryptCallable() { + throw new UnsupportedOperationException("Not implemented: reencryptCallable()"); + } + + public UnaryCallable getCallable() { + throw new UnsupportedOperationException("Not implemented: getCallable()"); + } + + public UnaryCallable import_Callable() { + throw new UnsupportedOperationException("Not implemented: import_Callable()"); + } + + public UnaryCallable insertCallable() { + throw new UnsupportedOperationException("Not implemented: insertCallable()"); + } + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + public UnaryCallable + listServerCasCallable() { + throw new UnsupportedOperationException("Not implemented: listServerCasCallable()"); + } + + public UnaryCallable< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesCallable() { + throw new UnsupportedOperationException("Not implemented: listServerCertificatesCallable()"); + } + + public UnaryCallable< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesCallable() { + throw new UnsupportedOperationException("Not implemented: listEntraIdCertificatesCallable()"); + } + + public UnaryCallable patchCallable() { + throw new UnsupportedOperationException("Not implemented: patchCallable()"); + } + + public UnaryCallable promoteReplicaCallable() { + throw new UnsupportedOperationException("Not implemented: promoteReplicaCallable()"); + } + + public UnaryCallable switchoverCallable() { + throw new UnsupportedOperationException("Not implemented: switchoverCallable()"); + } + + public UnaryCallable resetSslConfigCallable() { + throw new UnsupportedOperationException("Not implemented: resetSslConfigCallable()"); + } + + public UnaryCallable restartCallable() { + throw new UnsupportedOperationException("Not implemented: restartCallable()"); + } + + public UnaryCallable restoreBackupCallable() { + throw new UnsupportedOperationException("Not implemented: restoreBackupCallable()"); + } + + public UnaryCallable rotateServerCaCallable() { + throw new UnsupportedOperationException("Not implemented: rotateServerCaCallable()"); + } + + public UnaryCallable + rotateServerCertificateCallable() { + throw new UnsupportedOperationException("Not implemented: rotateServerCertificateCallable()"); + } + + public UnaryCallable + rotateEntraIdCertificateCallable() { + throw new UnsupportedOperationException("Not implemented: rotateEntraIdCertificateCallable()"); + } + + public UnaryCallable startReplicaCallable() { + throw new UnsupportedOperationException("Not implemented: startReplicaCallable()"); + } + + public UnaryCallable stopReplicaCallable() { + throw new UnsupportedOperationException("Not implemented: stopReplicaCallable()"); + } + + public UnaryCallable truncateLogCallable() { + throw new UnsupportedOperationException("Not implemented: truncateLogCallable()"); + } + + public UnaryCallable updateCallable() { + throw new UnsupportedOperationException("Not implemented: updateCallable()"); + } + + public UnaryCallable createEphemeralCallable() { + throw new UnsupportedOperationException("Not implemented: createEphemeralCallable()"); + } + + public UnaryCallable + rescheduleMaintenanceCallable() { + throw new UnsupportedOperationException("Not implemented: rescheduleMaintenanceCallable()"); + } + + public UnaryCallable< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsCallable() { + throw new UnsupportedOperationException( + "Not implemented: verifyExternalSyncSettingsCallable()"); + } + + public UnaryCallable + startExternalSyncCallable() { + throw new UnsupportedOperationException("Not implemented: startExternalSyncCallable()"); + } + + public UnaryCallable + performDiskShrinkCallable() { + throw new UnsupportedOperationException("Not implemented: performDiskShrinkCallable()"); + } + + public UnaryCallable< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getDiskShrinkConfigCallable()"); + } + + public UnaryCallable resetReplicaSizeCallable() { + throw new UnsupportedOperationException("Not implemented: resetReplicaSizeCallable()"); + } + + public UnaryCallable< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeCallable() { + throw new UnsupportedOperationException("Not implemented: getLatestRecoveryTimeCallable()"); + } + + public UnaryCallable + executeSqlCallable() { + throw new UnsupportedOperationException("Not implemented: executeSqlCallable()"); + } + + public UnaryCallable + acquireSsrsLeaseCallable() { + throw new UnsupportedOperationException("Not implemented: acquireSsrsLeaseCallable()"); + } + + public UnaryCallable + releaseSsrsLeaseCallable() { + throw new UnsupportedOperationException("Not implemented: releaseSsrsLeaseCallable()"); + } + + public UnaryCallable + preCheckMajorVersionUpgradeCallable() { + throw new UnsupportedOperationException( + "Not implemented: preCheckMajorVersionUpgradeCallable()"); + } + + public UnaryCallable + pointInTimeRestoreCallable() { + throw new UnsupportedOperationException("Not implemented: pointInTimeRestoreCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlInstancesServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlInstancesServiceStubSettings.java new file mode 100644 index 000000000000..c948540703bc --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlInstancesServiceStubSettings.java @@ -0,0 +1,1484 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1.DatabaseInstance; +import com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse; +import com.google.cloud.sql.v1.InstancesListResponse; +import com.google.cloud.sql.v1.InstancesListServerCasResponse; +import com.google.cloud.sql.v1.InstancesListServerCertificatesResponse; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse; +import com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest; +import com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesCloneRequest; +import com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest; +import com.google.cloud.sql.v1.SqlInstancesDeleteRequest; +import com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest; +import com.google.cloud.sql.v1.SqlInstancesDemoteRequest; +import com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest; +import com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse; +import com.google.cloud.sql.v1.SqlInstancesExportRequest; +import com.google.cloud.sql.v1.SqlInstancesFailoverRequest; +import com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest; +import com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse; +import com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest; +import com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse; +import com.google.cloud.sql.v1.SqlInstancesGetRequest; +import com.google.cloud.sql.v1.SqlInstancesImportRequest; +import com.google.cloud.sql.v1.SqlInstancesInsertRequest; +import com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest; +import com.google.cloud.sql.v1.SqlInstancesListRequest; +import com.google.cloud.sql.v1.SqlInstancesListServerCasRequest; +import com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest; +import com.google.cloud.sql.v1.SqlInstancesPatchRequest; +import com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest; +import com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest; +import com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest; +import com.google.cloud.sql.v1.SqlInstancesReencryptRequest; +import com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest; +import com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse; +import com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest; +import com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest; +import com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest; +import com.google.cloud.sql.v1.SqlInstancesRestartRequest; +import com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest; +import com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest; +import com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest; +import com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest; +import com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest; +import com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest; +import com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest; +import com.google.cloud.sql.v1.SqlInstancesUpdateRequest; +import com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest; +import com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse; +import com.google.cloud.sql.v1.SslCert; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlInstancesServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 addServerCa: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlInstancesServiceStubSettings.Builder sqlInstancesServiceSettingsBuilder =
+ *     SqlInstancesServiceStubSettings.newBuilder();
+ * sqlInstancesServiceSettingsBuilder
+ *     .addServerCaSettings()
+ *     .setRetrySettings(
+ *         sqlInstancesServiceSettingsBuilder
+ *             .addServerCaSettings()
+ *             .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());
+ * SqlInstancesServiceStubSettings sqlInstancesServiceSettings =
+ *     sqlInstancesServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlInstancesServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings addServerCaSettings; + private final UnaryCallSettings + addServerCertificateSettings; + private final UnaryCallSettings + addEntraIdCertificateSettings; + private final UnaryCallSettings cloneSettings; + private final UnaryCallSettings deleteSettings; + private final UnaryCallSettings demoteMasterSettings; + private final UnaryCallSettings demoteSettings; + private final UnaryCallSettings exportSettings; + private final UnaryCallSettings failoverSettings; + private final UnaryCallSettings reencryptSettings; + private final UnaryCallSettings getSettings; + private final UnaryCallSettings import_Settings; + private final UnaryCallSettings insertSettings; + private final UnaryCallSettings listSettings; + private final UnaryCallSettings + listServerCasSettings; + private final UnaryCallSettings< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesSettings; + private final UnaryCallSettings< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesSettings; + private final UnaryCallSettings patchSettings; + private final UnaryCallSettings + promoteReplicaSettings; + private final UnaryCallSettings switchoverSettings; + private final UnaryCallSettings + resetSslConfigSettings; + private final UnaryCallSettings restartSettings; + private final UnaryCallSettings + restoreBackupSettings; + private final UnaryCallSettings + rotateServerCaSettings; + private final UnaryCallSettings + rotateServerCertificateSettings; + private final UnaryCallSettings + rotateEntraIdCertificateSettings; + private final UnaryCallSettings startReplicaSettings; + private final UnaryCallSettings stopReplicaSettings; + private final UnaryCallSettings truncateLogSettings; + private final UnaryCallSettings updateSettings; + private final UnaryCallSettings + createEphemeralSettings; + private final UnaryCallSettings + rescheduleMaintenanceSettings; + private final UnaryCallSettings< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsSettings; + private final UnaryCallSettings + startExternalSyncSettings; + private final UnaryCallSettings + performDiskShrinkSettings; + private final UnaryCallSettings< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigSettings; + private final UnaryCallSettings + resetReplicaSizeSettings; + private final UnaryCallSettings< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeSettings; + private final UnaryCallSettings + executeSqlSettings; + private final UnaryCallSettings< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseSettings; + private final UnaryCallSettings< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseSettings; + private final UnaryCallSettings + preCheckMajorVersionUpgradeSettings; + private final UnaryCallSettings + pointInTimeRestoreSettings; + + /** Returns the object with the settings used for calls to addServerCa. */ + public UnaryCallSettings addServerCaSettings() { + return addServerCaSettings; + } + + /** Returns the object with the settings used for calls to addServerCertificate. */ + public UnaryCallSettings + addServerCertificateSettings() { + return addServerCertificateSettings; + } + + /** Returns the object with the settings used for calls to addEntraIdCertificate. */ + public UnaryCallSettings + addEntraIdCertificateSettings() { + return addEntraIdCertificateSettings; + } + + /** Returns the object with the settings used for calls to clone. */ + public UnaryCallSettings cloneSettings() { + return cloneSettings; + } + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return deleteSettings; + } + + /** Returns the object with the settings used for calls to demoteMaster. */ + public UnaryCallSettings demoteMasterSettings() { + return demoteMasterSettings; + } + + /** Returns the object with the settings used for calls to demote. */ + public UnaryCallSettings demoteSettings() { + return demoteSettings; + } + + /** Returns the object with the settings used for calls to export. */ + public UnaryCallSettings exportSettings() { + return exportSettings; + } + + /** Returns the object with the settings used for calls to failover. */ + public UnaryCallSettings failoverSettings() { + return failoverSettings; + } + + /** Returns the object with the settings used for calls to reencrypt. */ + public UnaryCallSettings reencryptSettings() { + return reencryptSettings; + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return getSettings; + } + + /** Returns the object with the settings used for calls to import_. */ + public UnaryCallSettings import_Settings() { + return import_Settings; + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return insertSettings; + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + /** Returns the object with the settings used for calls to listServerCas. */ + public UnaryCallSettings + listServerCasSettings() { + return listServerCasSettings; + } + + /** Returns the object with the settings used for calls to listServerCertificates. */ + public UnaryCallSettings< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesSettings() { + return listServerCertificatesSettings; + } + + /** Returns the object with the settings used for calls to listEntraIdCertificates. */ + public UnaryCallSettings< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesSettings() { + return listEntraIdCertificatesSettings; + } + + /** Returns the object with the settings used for calls to patch. */ + public UnaryCallSettings patchSettings() { + return patchSettings; + } + + /** Returns the object with the settings used for calls to promoteReplica. */ + public UnaryCallSettings promoteReplicaSettings() { + return promoteReplicaSettings; + } + + /** Returns the object with the settings used for calls to switchover. */ + public UnaryCallSettings switchoverSettings() { + return switchoverSettings; + } + + /** Returns the object with the settings used for calls to resetSslConfig. */ + public UnaryCallSettings resetSslConfigSettings() { + return resetSslConfigSettings; + } + + /** Returns the object with the settings used for calls to restart. */ + public UnaryCallSettings restartSettings() { + return restartSettings; + } + + /** Returns the object with the settings used for calls to restoreBackup. */ + public UnaryCallSettings restoreBackupSettings() { + return restoreBackupSettings; + } + + /** Returns the object with the settings used for calls to rotateServerCa. */ + public UnaryCallSettings rotateServerCaSettings() { + return rotateServerCaSettings; + } + + /** Returns the object with the settings used for calls to rotateServerCertificate. */ + public UnaryCallSettings + rotateServerCertificateSettings() { + return rotateServerCertificateSettings; + } + + /** Returns the object with the settings used for calls to rotateEntraIdCertificate. */ + public UnaryCallSettings + rotateEntraIdCertificateSettings() { + return rotateEntraIdCertificateSettings; + } + + /** Returns the object with the settings used for calls to startReplica. */ + public UnaryCallSettings startReplicaSettings() { + return startReplicaSettings; + } + + /** Returns the object with the settings used for calls to stopReplica. */ + public UnaryCallSettings stopReplicaSettings() { + return stopReplicaSettings; + } + + /** Returns the object with the settings used for calls to truncateLog. */ + public UnaryCallSettings truncateLogSettings() { + return truncateLogSettings; + } + + /** Returns the object with the settings used for calls to update. */ + public UnaryCallSettings updateSettings() { + return updateSettings; + } + + /** Returns the object with the settings used for calls to createEphemeral. */ + public UnaryCallSettings + createEphemeralSettings() { + return createEphemeralSettings; + } + + /** Returns the object with the settings used for calls to rescheduleMaintenance. */ + public UnaryCallSettings + rescheduleMaintenanceSettings() { + return rescheduleMaintenanceSettings; + } + + /** Returns the object with the settings used for calls to verifyExternalSyncSettings. */ + public UnaryCallSettings< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsSettings() { + return verifyExternalSyncSettingsSettings; + } + + /** Returns the object with the settings used for calls to startExternalSync. */ + public UnaryCallSettings + startExternalSyncSettings() { + return startExternalSyncSettings; + } + + /** Returns the object with the settings used for calls to performDiskShrink. */ + public UnaryCallSettings + performDiskShrinkSettings() { + return performDiskShrinkSettings; + } + + /** Returns the object with the settings used for calls to getDiskShrinkConfig. */ + public UnaryCallSettings< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigSettings() { + return getDiskShrinkConfigSettings; + } + + /** Returns the object with the settings used for calls to resetReplicaSize. */ + public UnaryCallSettings + resetReplicaSizeSettings() { + return resetReplicaSizeSettings; + } + + /** Returns the object with the settings used for calls to getLatestRecoveryTime. */ + public UnaryCallSettings< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeSettings() { + return getLatestRecoveryTimeSettings; + } + + /** Returns the object with the settings used for calls to executeSql. */ + public UnaryCallSettings + executeSqlSettings() { + return executeSqlSettings; + } + + /** Returns the object with the settings used for calls to acquireSsrsLease. */ + public UnaryCallSettings< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseSettings() { + return acquireSsrsLeaseSettings; + } + + /** Returns the object with the settings used for calls to releaseSsrsLease. */ + public UnaryCallSettings< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseSettings() { + return releaseSsrsLeaseSettings; + } + + /** Returns the object with the settings used for calls to preCheckMajorVersionUpgrade. */ + public UnaryCallSettings + preCheckMajorVersionUpgradeSettings() { + return preCheckMajorVersionUpgradeSettings; + } + + /** Returns the object with the settings used for calls to pointInTimeRestore. */ + public UnaryCallSettings + pointInTimeRestoreSettings() { + return pointInTimeRestoreSettings; + } + + public SqlInstancesServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlInstancesServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlInstancesServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlInstancesServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlInstancesServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlInstancesServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlInstancesServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + addServerCaSettings = settingsBuilder.addServerCaSettings().build(); + addServerCertificateSettings = settingsBuilder.addServerCertificateSettings().build(); + addEntraIdCertificateSettings = settingsBuilder.addEntraIdCertificateSettings().build(); + cloneSettings = settingsBuilder.cloneSettings().build(); + deleteSettings = settingsBuilder.deleteSettings().build(); + demoteMasterSettings = settingsBuilder.demoteMasterSettings().build(); + demoteSettings = settingsBuilder.demoteSettings().build(); + exportSettings = settingsBuilder.exportSettings().build(); + failoverSettings = settingsBuilder.failoverSettings().build(); + reencryptSettings = settingsBuilder.reencryptSettings().build(); + getSettings = settingsBuilder.getSettings().build(); + import_Settings = settingsBuilder.import_Settings().build(); + insertSettings = settingsBuilder.insertSettings().build(); + listSettings = settingsBuilder.listSettings().build(); + listServerCasSettings = settingsBuilder.listServerCasSettings().build(); + listServerCertificatesSettings = settingsBuilder.listServerCertificatesSettings().build(); + listEntraIdCertificatesSettings = settingsBuilder.listEntraIdCertificatesSettings().build(); + patchSettings = settingsBuilder.patchSettings().build(); + promoteReplicaSettings = settingsBuilder.promoteReplicaSettings().build(); + switchoverSettings = settingsBuilder.switchoverSettings().build(); + resetSslConfigSettings = settingsBuilder.resetSslConfigSettings().build(); + restartSettings = settingsBuilder.restartSettings().build(); + restoreBackupSettings = settingsBuilder.restoreBackupSettings().build(); + rotateServerCaSettings = settingsBuilder.rotateServerCaSettings().build(); + rotateServerCertificateSettings = settingsBuilder.rotateServerCertificateSettings().build(); + rotateEntraIdCertificateSettings = settingsBuilder.rotateEntraIdCertificateSettings().build(); + startReplicaSettings = settingsBuilder.startReplicaSettings().build(); + stopReplicaSettings = settingsBuilder.stopReplicaSettings().build(); + truncateLogSettings = settingsBuilder.truncateLogSettings().build(); + updateSettings = settingsBuilder.updateSettings().build(); + createEphemeralSettings = settingsBuilder.createEphemeralSettings().build(); + rescheduleMaintenanceSettings = settingsBuilder.rescheduleMaintenanceSettings().build(); + verifyExternalSyncSettingsSettings = + settingsBuilder.verifyExternalSyncSettingsSettings().build(); + startExternalSyncSettings = settingsBuilder.startExternalSyncSettings().build(); + performDiskShrinkSettings = settingsBuilder.performDiskShrinkSettings().build(); + getDiskShrinkConfigSettings = settingsBuilder.getDiskShrinkConfigSettings().build(); + resetReplicaSizeSettings = settingsBuilder.resetReplicaSizeSettings().build(); + getLatestRecoveryTimeSettings = settingsBuilder.getLatestRecoveryTimeSettings().build(); + executeSqlSettings = settingsBuilder.executeSqlSettings().build(); + acquireSsrsLeaseSettings = settingsBuilder.acquireSsrsLeaseSettings().build(); + releaseSsrsLeaseSettings = settingsBuilder.releaseSsrsLeaseSettings().build(); + preCheckMajorVersionUpgradeSettings = + settingsBuilder.preCheckMajorVersionUpgradeSettings().build(); + pointInTimeRestoreSettings = settingsBuilder.pointInTimeRestoreSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlInstancesServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + addServerCaSettings; + private final UnaryCallSettings.Builder + addServerCertificateSettings; + private final UnaryCallSettings.Builder + addEntraIdCertificateSettings; + private final UnaryCallSettings.Builder cloneSettings; + private final UnaryCallSettings.Builder deleteSettings; + private final UnaryCallSettings.Builder + demoteMasterSettings; + private final UnaryCallSettings.Builder demoteSettings; + private final UnaryCallSettings.Builder exportSettings; + private final UnaryCallSettings.Builder + failoverSettings; + private final UnaryCallSettings.Builder + reencryptSettings; + private final UnaryCallSettings.Builder getSettings; + private final UnaryCallSettings.Builder import_Settings; + private final UnaryCallSettings.Builder insertSettings; + private final UnaryCallSettings.Builder + listSettings; + private final UnaryCallSettings.Builder< + SqlInstancesListServerCasRequest, InstancesListServerCasResponse> + listServerCasSettings; + private final UnaryCallSettings.Builder< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesSettings; + private final UnaryCallSettings.Builder< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesSettings; + private final UnaryCallSettings.Builder patchSettings; + private final UnaryCallSettings.Builder + promoteReplicaSettings; + private final UnaryCallSettings.Builder + switchoverSettings; + private final UnaryCallSettings.Builder + resetSslConfigSettings; + private final UnaryCallSettings.Builder restartSettings; + private final UnaryCallSettings.Builder + restoreBackupSettings; + private final UnaryCallSettings.Builder + rotateServerCaSettings; + private final UnaryCallSettings.Builder + rotateServerCertificateSettings; + private final UnaryCallSettings.Builder + rotateEntraIdCertificateSettings; + private final UnaryCallSettings.Builder + startReplicaSettings; + private final UnaryCallSettings.Builder + stopReplicaSettings; + private final UnaryCallSettings.Builder + truncateLogSettings; + private final UnaryCallSettings.Builder updateSettings; + private final UnaryCallSettings.Builder + createEphemeralSettings; + private final UnaryCallSettings.Builder + rescheduleMaintenanceSettings; + private final UnaryCallSettings.Builder< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsSettings; + private final UnaryCallSettings.Builder + startExternalSyncSettings; + private final UnaryCallSettings.Builder + performDiskShrinkSettings; + private final UnaryCallSettings.Builder< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigSettings; + private final UnaryCallSettings.Builder + resetReplicaSizeSettings; + private final UnaryCallSettings.Builder< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeSettings; + private final UnaryCallSettings.Builder< + SqlInstancesExecuteSqlRequest, SqlInstancesExecuteSqlResponse> + executeSqlSettings; + private final UnaryCallSettings.Builder< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseSettings; + private final UnaryCallSettings.Builder< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseSettings; + private final UnaryCallSettings.Builder< + SqlInstancesPreCheckMajorVersionUpgradeRequest, Operation> + preCheckMajorVersionUpgradeSettings; + private final UnaryCallSettings.Builder + pointInTimeRestoreSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + addServerCaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + addServerCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + addEntraIdCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + cloneSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + demoteMasterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + demoteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + exportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + failoverSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + reencryptSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + import_Settings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listServerCasSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listServerCertificatesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listEntraIdCertificatesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + patchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + promoteReplicaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + switchoverSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + resetSslConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restartSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restoreBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + rotateServerCaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + rotateServerCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + rotateEntraIdCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + startReplicaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + stopReplicaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + truncateLogSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createEphemeralSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + rescheduleMaintenanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + verifyExternalSyncSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + startExternalSyncSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + performDiskShrinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getDiskShrinkConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + resetReplicaSizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getLatestRecoveryTimeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + executeSqlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + acquireSsrsLeaseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + releaseSsrsLeaseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + preCheckMajorVersionUpgradeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + pointInTimeRestoreSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + addServerCaSettings, + addServerCertificateSettings, + addEntraIdCertificateSettings, + cloneSettings, + deleteSettings, + demoteMasterSettings, + demoteSettings, + exportSettings, + failoverSettings, + reencryptSettings, + getSettings, + import_Settings, + insertSettings, + listSettings, + listServerCasSettings, + listServerCertificatesSettings, + listEntraIdCertificatesSettings, + patchSettings, + promoteReplicaSettings, + switchoverSettings, + resetSslConfigSettings, + restartSettings, + restoreBackupSettings, + rotateServerCaSettings, + rotateServerCertificateSettings, + rotateEntraIdCertificateSettings, + startReplicaSettings, + stopReplicaSettings, + truncateLogSettings, + updateSettings, + createEphemeralSettings, + rescheduleMaintenanceSettings, + verifyExternalSyncSettingsSettings, + startExternalSyncSettings, + performDiskShrinkSettings, + getDiskShrinkConfigSettings, + resetReplicaSizeSettings, + getLatestRecoveryTimeSettings, + executeSqlSettings, + acquireSsrsLeaseSettings, + releaseSsrsLeaseSettings, + preCheckMajorVersionUpgradeSettings, + pointInTimeRestoreSettings); + initDefaults(this); + } + + protected Builder(SqlInstancesServiceStubSettings settings) { + super(settings); + + addServerCaSettings = settings.addServerCaSettings.toBuilder(); + addServerCertificateSettings = settings.addServerCertificateSettings.toBuilder(); + addEntraIdCertificateSettings = settings.addEntraIdCertificateSettings.toBuilder(); + cloneSettings = settings.cloneSettings.toBuilder(); + deleteSettings = settings.deleteSettings.toBuilder(); + demoteMasterSettings = settings.demoteMasterSettings.toBuilder(); + demoteSettings = settings.demoteSettings.toBuilder(); + exportSettings = settings.exportSettings.toBuilder(); + failoverSettings = settings.failoverSettings.toBuilder(); + reencryptSettings = settings.reencryptSettings.toBuilder(); + getSettings = settings.getSettings.toBuilder(); + import_Settings = settings.import_Settings.toBuilder(); + insertSettings = settings.insertSettings.toBuilder(); + listSettings = settings.listSettings.toBuilder(); + listServerCasSettings = settings.listServerCasSettings.toBuilder(); + listServerCertificatesSettings = settings.listServerCertificatesSettings.toBuilder(); + listEntraIdCertificatesSettings = settings.listEntraIdCertificatesSettings.toBuilder(); + patchSettings = settings.patchSettings.toBuilder(); + promoteReplicaSettings = settings.promoteReplicaSettings.toBuilder(); + switchoverSettings = settings.switchoverSettings.toBuilder(); + resetSslConfigSettings = settings.resetSslConfigSettings.toBuilder(); + restartSettings = settings.restartSettings.toBuilder(); + restoreBackupSettings = settings.restoreBackupSettings.toBuilder(); + rotateServerCaSettings = settings.rotateServerCaSettings.toBuilder(); + rotateServerCertificateSettings = settings.rotateServerCertificateSettings.toBuilder(); + rotateEntraIdCertificateSettings = settings.rotateEntraIdCertificateSettings.toBuilder(); + startReplicaSettings = settings.startReplicaSettings.toBuilder(); + stopReplicaSettings = settings.stopReplicaSettings.toBuilder(); + truncateLogSettings = settings.truncateLogSettings.toBuilder(); + updateSettings = settings.updateSettings.toBuilder(); + createEphemeralSettings = settings.createEphemeralSettings.toBuilder(); + rescheduleMaintenanceSettings = settings.rescheduleMaintenanceSettings.toBuilder(); + verifyExternalSyncSettingsSettings = settings.verifyExternalSyncSettingsSettings.toBuilder(); + startExternalSyncSettings = settings.startExternalSyncSettings.toBuilder(); + performDiskShrinkSettings = settings.performDiskShrinkSettings.toBuilder(); + getDiskShrinkConfigSettings = settings.getDiskShrinkConfigSettings.toBuilder(); + resetReplicaSizeSettings = settings.resetReplicaSizeSettings.toBuilder(); + getLatestRecoveryTimeSettings = settings.getLatestRecoveryTimeSettings.toBuilder(); + executeSqlSettings = settings.executeSqlSettings.toBuilder(); + acquireSsrsLeaseSettings = settings.acquireSsrsLeaseSettings.toBuilder(); + releaseSsrsLeaseSettings = settings.releaseSsrsLeaseSettings.toBuilder(); + preCheckMajorVersionUpgradeSettings = + settings.preCheckMajorVersionUpgradeSettings.toBuilder(); + pointInTimeRestoreSettings = settings.pointInTimeRestoreSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + addServerCaSettings, + addServerCertificateSettings, + addEntraIdCertificateSettings, + cloneSettings, + deleteSettings, + demoteMasterSettings, + demoteSettings, + exportSettings, + failoverSettings, + reencryptSettings, + getSettings, + import_Settings, + insertSettings, + listSettings, + listServerCasSettings, + listServerCertificatesSettings, + listEntraIdCertificatesSettings, + patchSettings, + promoteReplicaSettings, + switchoverSettings, + resetSslConfigSettings, + restartSettings, + restoreBackupSettings, + rotateServerCaSettings, + rotateServerCertificateSettings, + rotateEntraIdCertificateSettings, + startReplicaSettings, + stopReplicaSettings, + truncateLogSettings, + updateSettings, + createEphemeralSettings, + rescheduleMaintenanceSettings, + verifyExternalSyncSettingsSettings, + startExternalSyncSettings, + performDiskShrinkSettings, + getDiskShrinkConfigSettings, + resetReplicaSizeSettings, + getLatestRecoveryTimeSettings, + executeSqlSettings, + acquireSsrsLeaseSettings, + releaseSsrsLeaseSettings, + preCheckMajorVersionUpgradeSettings, + pointInTimeRestoreSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .addServerCaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .addServerCertificateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .addEntraIdCertificateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .cloneSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .demoteMasterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .demoteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .exportSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .failoverSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .reencryptSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .import_Settings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .insertSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listServerCasSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listServerCertificatesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listEntraIdCertificatesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .patchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .promoteReplicaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .switchoverSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .resetSslConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .restartSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .restoreBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .rotateServerCaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .rotateServerCertificateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .rotateEntraIdCertificateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .startReplicaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .stopReplicaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .truncateLogSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createEphemeralSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .rescheduleMaintenanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .verifyExternalSyncSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .startExternalSyncSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .performDiskShrinkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getDiskShrinkConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .resetReplicaSizeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLatestRecoveryTimeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .executeSqlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .acquireSsrsLeaseSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .releaseSsrsLeaseSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .preCheckMajorVersionUpgradeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .pointInTimeRestoreSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to addServerCa. */ + public UnaryCallSettings.Builder + addServerCaSettings() { + return addServerCaSettings; + } + + /** Returns the builder for the settings used for calls to addServerCertificate. */ + public UnaryCallSettings.Builder + addServerCertificateSettings() { + return addServerCertificateSettings; + } + + /** Returns the builder for the settings used for calls to addEntraIdCertificate. */ + public UnaryCallSettings.Builder + addEntraIdCertificateSettings() { + return addEntraIdCertificateSettings; + } + + /** Returns the builder for the settings used for calls to clone. */ + public UnaryCallSettings.Builder cloneSettings() { + return cloneSettings; + } + + /** Returns the builder for the settings used for calls to delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return deleteSettings; + } + + /** Returns the builder for the settings used for calls to demoteMaster. */ + public UnaryCallSettings.Builder + demoteMasterSettings() { + return demoteMasterSettings; + } + + /** Returns the builder for the settings used for calls to demote. */ + public UnaryCallSettings.Builder demoteSettings() { + return demoteSettings; + } + + /** Returns the builder for the settings used for calls to export. */ + public UnaryCallSettings.Builder exportSettings() { + return exportSettings; + } + + /** Returns the builder for the settings used for calls to failover. */ + public UnaryCallSettings.Builder failoverSettings() { + return failoverSettings; + } + + /** Returns the builder for the settings used for calls to reencrypt. */ + public UnaryCallSettings.Builder reencryptSettings() { + return reencryptSettings; + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getSettings; + } + + /** Returns the builder for the settings used for calls to import_. */ + public UnaryCallSettings.Builder import_Settings() { + return import_Settings; + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return insertSettings; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return listSettings; + } + + /** Returns the builder for the settings used for calls to listServerCas. */ + public UnaryCallSettings.Builder< + SqlInstancesListServerCasRequest, InstancesListServerCasResponse> + listServerCasSettings() { + return listServerCasSettings; + } + + /** Returns the builder for the settings used for calls to listServerCertificates. */ + public UnaryCallSettings.Builder< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesSettings() { + return listServerCertificatesSettings; + } + + /** Returns the builder for the settings used for calls to listEntraIdCertificates. */ + public UnaryCallSettings.Builder< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesSettings() { + return listEntraIdCertificatesSettings; + } + + /** Returns the builder for the settings used for calls to patch. */ + public UnaryCallSettings.Builder patchSettings() { + return patchSettings; + } + + /** Returns the builder for the settings used for calls to promoteReplica. */ + public UnaryCallSettings.Builder + promoteReplicaSettings() { + return promoteReplicaSettings; + } + + /** Returns the builder for the settings used for calls to switchover. */ + public UnaryCallSettings.Builder + switchoverSettings() { + return switchoverSettings; + } + + /** Returns the builder for the settings used for calls to resetSslConfig. */ + public UnaryCallSettings.Builder + resetSslConfigSettings() { + return resetSslConfigSettings; + } + + /** Returns the builder for the settings used for calls to restart. */ + public UnaryCallSettings.Builder restartSettings() { + return restartSettings; + } + + /** Returns the builder for the settings used for calls to restoreBackup. */ + public UnaryCallSettings.Builder + restoreBackupSettings() { + return restoreBackupSettings; + } + + /** Returns the builder for the settings used for calls to rotateServerCa. */ + public UnaryCallSettings.Builder + rotateServerCaSettings() { + return rotateServerCaSettings; + } + + /** Returns the builder for the settings used for calls to rotateServerCertificate. */ + public UnaryCallSettings.Builder + rotateServerCertificateSettings() { + return rotateServerCertificateSettings; + } + + /** Returns the builder for the settings used for calls to rotateEntraIdCertificate. */ + public UnaryCallSettings.Builder + rotateEntraIdCertificateSettings() { + return rotateEntraIdCertificateSettings; + } + + /** Returns the builder for the settings used for calls to startReplica. */ + public UnaryCallSettings.Builder + startReplicaSettings() { + return startReplicaSettings; + } + + /** Returns the builder for the settings used for calls to stopReplica. */ + public UnaryCallSettings.Builder + stopReplicaSettings() { + return stopReplicaSettings; + } + + /** Returns the builder for the settings used for calls to truncateLog. */ + public UnaryCallSettings.Builder + truncateLogSettings() { + return truncateLogSettings; + } + + /** Returns the builder for the settings used for calls to update. */ + public UnaryCallSettings.Builder updateSettings() { + return updateSettings; + } + + /** Returns the builder for the settings used for calls to createEphemeral. */ + public UnaryCallSettings.Builder + createEphemeralSettings() { + return createEphemeralSettings; + } + + /** Returns the builder for the settings used for calls to rescheduleMaintenance. */ + public UnaryCallSettings.Builder + rescheduleMaintenanceSettings() { + return rescheduleMaintenanceSettings; + } + + /** Returns the builder for the settings used for calls to verifyExternalSyncSettings. */ + public UnaryCallSettings.Builder< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsSettings() { + return verifyExternalSyncSettingsSettings; + } + + /** Returns the builder for the settings used for calls to startExternalSync. */ + public UnaryCallSettings.Builder + startExternalSyncSettings() { + return startExternalSyncSettings; + } + + /** Returns the builder for the settings used for calls to performDiskShrink. */ + public UnaryCallSettings.Builder + performDiskShrinkSettings() { + return performDiskShrinkSettings; + } + + /** Returns the builder for the settings used for calls to getDiskShrinkConfig. */ + public UnaryCallSettings.Builder< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigSettings() { + return getDiskShrinkConfigSettings; + } + + /** Returns the builder for the settings used for calls to resetReplicaSize. */ + public UnaryCallSettings.Builder + resetReplicaSizeSettings() { + return resetReplicaSizeSettings; + } + + /** Returns the builder for the settings used for calls to getLatestRecoveryTime. */ + public UnaryCallSettings.Builder< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeSettings() { + return getLatestRecoveryTimeSettings; + } + + /** Returns the builder for the settings used for calls to executeSql. */ + public UnaryCallSettings.Builder + executeSqlSettings() { + return executeSqlSettings; + } + + /** Returns the builder for the settings used for calls to acquireSsrsLease. */ + public UnaryCallSettings.Builder< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseSettings() { + return acquireSsrsLeaseSettings; + } + + /** Returns the builder for the settings used for calls to releaseSsrsLease. */ + public UnaryCallSettings.Builder< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseSettings() { + return releaseSsrsLeaseSettings; + } + + /** Returns the builder for the settings used for calls to preCheckMajorVersionUpgrade. */ + public UnaryCallSettings.Builder + preCheckMajorVersionUpgradeSettings() { + return preCheckMajorVersionUpgradeSettings; + } + + /** Returns the builder for the settings used for calls to pointInTimeRestore. */ + public UnaryCallSettings.Builder + pointInTimeRestoreSettings() { + return pointInTimeRestoreSettings; + } + + @Override + public SqlInstancesServiceStubSettings build() throws IOException { + return new SqlInstancesServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlOperationsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlOperationsServiceStub.java new file mode 100644 index 000000000000..82fc22802b27 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlOperationsServiceStub.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.OperationsListResponse; +import com.google.cloud.sql.v1.SqlOperationsCancelRequest; +import com.google.cloud.sql.v1.SqlOperationsGetRequest; +import com.google.cloud.sql.v1.SqlOperationsListRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlOperationsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public abstract class SqlOperationsServiceStub implements BackgroundResource { + + public UnaryCallable getCallable() { + throw new UnsupportedOperationException("Not implemented: getCallable()"); + } + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + public UnaryCallable cancelCallable() { + throw new UnsupportedOperationException("Not implemented: cancelCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlOperationsServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlOperationsServiceStubSettings.java new file mode 100644 index 000000000000..e105aa686e0f --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlOperationsServiceStubSettings.java @@ -0,0 +1,406 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.OperationsListResponse; +import com.google.cloud.sql.v1.SqlOperationsCancelRequest; +import com.google.cloud.sql.v1.SqlOperationsGetRequest; +import com.google.cloud.sql.v1.SqlOperationsListRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlOperationsServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 get: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlOperationsServiceStubSettings.Builder sqlOperationsServiceSettingsBuilder =
+ *     SqlOperationsServiceStubSettings.newBuilder();
+ * sqlOperationsServiceSettingsBuilder
+ *     .getSettings()
+ *     .setRetrySettings(
+ *         sqlOperationsServiceSettingsBuilder
+ *             .getSettings()
+ *             .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());
+ * SqlOperationsServiceStubSettings sqlOperationsServiceSettings =
+ *     sqlOperationsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlOperationsServiceStubSettings + 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings getSettings; + private final UnaryCallSettings listSettings; + private final UnaryCallSettings cancelSettings; + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return getSettings; + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + /** Returns the object with the settings used for calls to cancel. */ + public UnaryCallSettings cancelSettings() { + return cancelSettings; + } + + public SqlOperationsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlOperationsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlOperationsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlOperationsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlOperationsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlOperationsServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlOperationsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getSettings = settingsBuilder.getSettings().build(); + listSettings = settingsBuilder.listSettings().build(); + cancelSettings = settingsBuilder.cancelSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlOperationsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getSettings; + private final UnaryCallSettings.Builder + listSettings; + private final UnaryCallSettings.Builder cancelSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + getSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + cancelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getSettings, listSettings, cancelSettings); + initDefaults(this); + } + + protected Builder(SqlOperationsServiceStubSettings settings) { + super(settings); + + getSettings = settings.getSettings.toBuilder(); + listSettings = settings.listSettings.toBuilder(); + cancelSettings = settings.cancelSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getSettings, listSettings, cancelSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .cancelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getSettings; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return listSettings; + } + + /** Returns the builder for the settings used for calls to cancel. */ + public UnaryCallSettings.Builder cancelSettings() { + return cancelSettings; + } + + @Override + public SqlOperationsServiceStubSettings build() throws IOException { + return new SqlOperationsServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlSslCertsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlSslCertsServiceStub.java new file mode 100644 index 000000000000..3e955b3a92fe --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlSslCertsServiceStub.java @@ -0,0 +1,60 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlSslCertsDeleteRequest; +import com.google.cloud.sql.v1.SqlSslCertsGetRequest; +import com.google.cloud.sql.v1.SqlSslCertsInsertRequest; +import com.google.cloud.sql.v1.SqlSslCertsListRequest; +import com.google.cloud.sql.v1.SslCert; +import com.google.cloud.sql.v1.SslCertsInsertResponse; +import com.google.cloud.sql.v1.SslCertsListResponse; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlSslCertsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public abstract class SqlSslCertsServiceStub implements BackgroundResource { + + public UnaryCallable deleteCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCallable()"); + } + + public UnaryCallable getCallable() { + throw new UnsupportedOperationException("Not implemented: getCallable()"); + } + + public UnaryCallable insertCallable() { + throw new UnsupportedOperationException("Not implemented: insertCallable()"); + } + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlSslCertsServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlSslCertsServiceStubSettings.java new file mode 100644 index 000000000000..6c510d9c086a --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlSslCertsServiceStubSettings.java @@ -0,0 +1,428 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlSslCertsDeleteRequest; +import com.google.cloud.sql.v1.SqlSslCertsGetRequest; +import com.google.cloud.sql.v1.SqlSslCertsInsertRequest; +import com.google.cloud.sql.v1.SqlSslCertsListRequest; +import com.google.cloud.sql.v1.SslCert; +import com.google.cloud.sql.v1.SslCertsInsertResponse; +import com.google.cloud.sql.v1.SslCertsListResponse; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlSslCertsServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlSslCertsServiceStubSettings.Builder sqlSslCertsServiceSettingsBuilder =
+ *     SqlSslCertsServiceStubSettings.newBuilder();
+ * sqlSslCertsServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlSslCertsServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlSslCertsServiceStubSettings sqlSslCertsServiceSettings =
+ *     sqlSslCertsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlSslCertsServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings deleteSettings; + private final UnaryCallSettings getSettings; + private final UnaryCallSettings insertSettings; + private final UnaryCallSettings listSettings; + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return deleteSettings; + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return getSettings; + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return insertSettings; + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + public SqlSslCertsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlSslCertsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlSslCertsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlSslCertsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlSslCertsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlSslCertsServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlSslCertsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteSettings = settingsBuilder.deleteSettings().build(); + getSettings = settingsBuilder.getSettings().build(); + insertSettings = settingsBuilder.insertSettings().build(); + listSettings = settingsBuilder.listSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlSslCertsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder deleteSettings; + private final UnaryCallSettings.Builder getSettings; + private final UnaryCallSettings.Builder + insertSettings; + private final UnaryCallSettings.Builder + listSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + deleteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, getSettings, insertSettings, listSettings); + initDefaults(this); + } + + protected Builder(SqlSslCertsServiceStubSettings settings) { + super(settings); + + deleteSettings = settings.deleteSettings.toBuilder(); + getSettings = settings.getSettings.toBuilder(); + insertSettings = settings.insertSettings.toBuilder(); + listSettings = settings.listSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, getSettings, insertSettings, listSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .deleteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .insertSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return deleteSettings; + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getSettings; + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder + insertSettings() { + return insertSettings; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder listSettings() { + return listSettings; + } + + @Override + public SqlSslCertsServiceStubSettings build() throws IOException { + return new SqlSslCertsServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlTiersServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlTiersServiceStub.java new file mode 100644 index 000000000000..b2dd865f23cb --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlTiersServiceStub.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.SqlTiersListRequest; +import com.google.cloud.sql.v1.TiersListResponse; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlTiersService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public abstract class SqlTiersServiceStub implements BackgroundResource { + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlTiersServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlTiersServiceStubSettings.java new file mode 100644 index 000000000000..1fee76d93bd6 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlTiersServiceStubSettings.java @@ -0,0 +1,353 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1.SqlTiersListRequest; +import com.google.cloud.sql.v1.TiersListResponse; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlTiersServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 list: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlTiersServiceStubSettings.Builder sqlTiersServiceSettingsBuilder =
+ *     SqlTiersServiceStubSettings.newBuilder();
+ * sqlTiersServiceSettingsBuilder
+ *     .listSettings()
+ *     .setRetrySettings(
+ *         sqlTiersServiceSettingsBuilder
+ *             .listSettings()
+ *             .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());
+ * SqlTiersServiceStubSettings sqlTiersServiceSettings = sqlTiersServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlTiersServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings listSettings; + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + public SqlTiersServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlTiersServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlTiersServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlTiersServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlTiersServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlTiersServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlTiersServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listSettings = settingsBuilder.listSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlTiersServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder listSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of(listSettings); + initDefaults(this); + } + + protected Builder(SqlTiersServiceStubSettings settings) { + super(settings); + + listSettings = settings.listSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of(listSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder listSettings() { + return listSettings; + } + + @Override + public SqlTiersServiceStubSettings build() throws IOException { + return new SqlTiersServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlUsersServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlUsersServiceStub.java new file mode 100644 index 000000000000..c34eb2ba7d5e --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlUsersServiceStub.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlUsersDeleteRequest; +import com.google.cloud.sql.v1.SqlUsersGetRequest; +import com.google.cloud.sql.v1.SqlUsersInsertRequest; +import com.google.cloud.sql.v1.SqlUsersListRequest; +import com.google.cloud.sql.v1.SqlUsersUpdateRequest; +import com.google.cloud.sql.v1.User; +import com.google.cloud.sql.v1.UsersListResponse; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlUsersService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@Generated("by gapic-generator-java") +public abstract class SqlUsersServiceStub implements BackgroundResource { + + public UnaryCallable deleteCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCallable()"); + } + + public UnaryCallable getCallable() { + throw new UnsupportedOperationException("Not implemented: getCallable()"); + } + + public UnaryCallable insertCallable() { + throw new UnsupportedOperationException("Not implemented: insertCallable()"); + } + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + public UnaryCallable updateCallable() { + throw new UnsupportedOperationException("Not implemented: updateCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlUsersServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlUsersServiceStubSettings.java new file mode 100644 index 000000000000..54781b14878d --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/SqlUsersServiceStubSettings.java @@ -0,0 +1,443 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlUsersDeleteRequest; +import com.google.cloud.sql.v1.SqlUsersGetRequest; +import com.google.cloud.sql.v1.SqlUsersInsertRequest; +import com.google.cloud.sql.v1.SqlUsersListRequest; +import com.google.cloud.sql.v1.SqlUsersUpdateRequest; +import com.google.cloud.sql.v1.User; +import com.google.cloud.sql.v1.UsersListResponse; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlUsersServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlUsersServiceStubSettings.Builder sqlUsersServiceSettingsBuilder =
+ *     SqlUsersServiceStubSettings.newBuilder();
+ * sqlUsersServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlUsersServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlUsersServiceStubSettings sqlUsersServiceSettings = sqlUsersServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlUsersServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings deleteSettings; + private final UnaryCallSettings getSettings; + private final UnaryCallSettings insertSettings; + private final UnaryCallSettings listSettings; + private final UnaryCallSettings updateSettings; + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return deleteSettings; + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return getSettings; + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return insertSettings; + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + /** Returns the object with the settings used for calls to update. */ + public UnaryCallSettings updateSettings() { + return updateSettings; + } + + public SqlUsersServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlUsersServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlUsersServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlUsersServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlUsersServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlUsersServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlUsersServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteSettings = settingsBuilder.deleteSettings().build(); + getSettings = settingsBuilder.getSettings().build(); + insertSettings = settingsBuilder.insertSettings().build(); + listSettings = settingsBuilder.listSettings().build(); + updateSettings = settingsBuilder.updateSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlUsersServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder deleteSettings; + private final UnaryCallSettings.Builder getSettings; + private final UnaryCallSettings.Builder insertSettings; + private final UnaryCallSettings.Builder listSettings; + private final UnaryCallSettings.Builder updateSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + deleteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, getSettings, insertSettings, listSettings, updateSettings); + initDefaults(this); + } + + protected Builder(SqlUsersServiceStubSettings settings) { + super(settings); + + deleteSettings = settings.deleteSettings.toBuilder(); + getSettings = settings.getSettings.toBuilder(); + insertSettings = settings.insertSettings.toBuilder(); + listSettings = settings.listSettings.toBuilder(); + updateSettings = settings.updateSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, getSettings, insertSettings, listSettings, updateSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .deleteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .insertSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return deleteSettings; + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getSettings; + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return insertSettings; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder listSettings() { + return listSettings; + } + + /** Returns the builder for the settings used for calls to update. */ + public UnaryCallSettings.Builder updateSettings() { + return updateSettings; + } + + @Override + public SqlUsersServiceStubSettings build() throws IOException { + return new SqlUsersServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/Version.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/Version.java new file mode 100644 index 000000000000..6a5775e29a31 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1/stub/Version.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub; + +import com.google.api.core.InternalApi; + +@InternalApi("For internal use only") +final class Version { + // {x-version-update-start:google-cloud-sql:current} + static final String VERSION = "0.0.0-SNAPSHOT"; + // {x-version-update-end} + +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceClient.java new file mode 100644 index 000000000000..88b4f39e8470 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceClient.java @@ -0,0 +1,508 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.stub.SqlBackupRunsServiceStub; +import com.google.cloud.sql.v1beta4.stub.SqlBackupRunsServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+ *     SqlBackupRunsServiceClient.create()) {
+ *   SqlBackupRunsDeleteRequest request =
+ *       SqlBackupRunsDeleteRequest.newBuilder()
+ *           .setId(3355)
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlBackupRunsServiceClient.delete(request);
+ * }
+ * }
+ * + *

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

Delete

Deletes the backup taken by a backup run.

+ *

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

+ *
    + *
  • delete(SqlBackupRunsDeleteRequest request) + *

+ *

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

+ *
    + *
  • deleteCallable() + *

+ *

Get

Retrieves a resource containing information about a backup run.

+ *

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

+ *
    + *
  • get(SqlBackupRunsGetRequest request) + *

+ *

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

+ *
    + *
  • getCallable() + *

+ *

Insert

Creates a new backup run on demand.

+ *

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

+ *
    + *
  • insert(SqlBackupRunsInsertRequest request) + *

+ *

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

+ *
    + *
  • insertCallable() + *

+ *

List

Lists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.

+ *

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

+ *
    + *
  • list(SqlBackupRunsListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *
+ * + *

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 SqlBackupRunsServiceSettings + * 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
+ * SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings =
+ *     SqlBackupRunsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+ *     SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings);
+ * }
+ * + *

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
+ * SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings =
+ *     SqlBackupRunsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+ *     SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings =
+ *     SqlBackupRunsServiceSettings.newHttpJsonBuilder().build();
+ * SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+ *     SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlBackupRunsServiceClient implements BackgroundResource { + private final @Nullable SqlBackupRunsServiceSettings settings; + private final SqlBackupRunsServiceStub stub; + + /** Constructs an instance of SqlBackupRunsServiceClient with default settings. */ + public static final SqlBackupRunsServiceClient create() throws IOException { + return create(SqlBackupRunsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlBackupRunsServiceClient, 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 SqlBackupRunsServiceClient create(SqlBackupRunsServiceSettings settings) + throws IOException { + return new SqlBackupRunsServiceClient(settings); + } + + /** + * Constructs an instance of SqlBackupRunsServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(SqlBackupRunsServiceSettings). + */ + public static final SqlBackupRunsServiceClient create(SqlBackupRunsServiceStub stub) { + return new SqlBackupRunsServiceClient(stub); + } + + /** + * Constructs an instance of SqlBackupRunsServiceClient, 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 SqlBackupRunsServiceClient(SqlBackupRunsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlBackupRunsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlBackupRunsServiceClient(SqlBackupRunsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlBackupRunsServiceSettings getSettings() { + return settings; + } + + public SqlBackupRunsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the backup taken by a backup run. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsDeleteRequest request =
+   *       SqlBackupRunsDeleteRequest.newBuilder()
+   *           .setId(3355)
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlBackupRunsServiceClient.delete(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 Operation delete(SqlBackupRunsDeleteRequest request) { + return deleteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the backup taken by a backup run. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsDeleteRequest request =
+   *       SqlBackupRunsDeleteRequest.newBuilder()
+   *           .setId(3355)
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlBackupRunsServiceClient.deleteCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCallable() { + return stub.deleteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a backup run. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsGetRequest request =
+   *       SqlBackupRunsGetRequest.newBuilder()
+   *           .setId(3355)
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   BackupRun response = sqlBackupRunsServiceClient.get(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 BackupRun get(SqlBackupRunsGetRequest request) { + return getCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a backup run. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsGetRequest request =
+   *       SqlBackupRunsGetRequest.newBuilder()
+   *           .setId(3355)
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlBackupRunsServiceClient.getCallable().futureCall(request);
+   *   // Do something.
+   *   BackupRun response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCallable() { + return stub.getCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new backup run on demand. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsInsertRequest request =
+   *       SqlBackupRunsInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(BackupRun.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlBackupRunsServiceClient.insert(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 Operation insert(SqlBackupRunsInsertRequest request) { + return insertCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new backup run on demand. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsInsertRequest request =
+   *       SqlBackupRunsInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(BackupRun.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlBackupRunsServiceClient.insertCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable insertCallable() { + return stub.insertCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backup runs associated with the project or a given instance and configuration in the + * reverse chronological order of the backup initiation time. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsListRequest request =
+   *       SqlBackupRunsListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setMaxResults(1128457243)
+   *           .setPageToken("pageToken873572522")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   BackupRunsListResponse response = sqlBackupRunsServiceClient.list(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 BackupRunsListResponse list(SqlBackupRunsListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backup runs associated with the project or a given instance and configuration in the + * reverse chronological order of the backup initiation time. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+   *     SqlBackupRunsServiceClient.create()) {
+   *   SqlBackupRunsListRequest request =
+   *       SqlBackupRunsListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setMaxResults(1128457243)
+   *           .setPageToken("pageToken873572522")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlBackupRunsServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   BackupRunsListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceSettings.java new file mode 100644 index 000000000000..bf1b3b2fb30f --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceSettings.java @@ -0,0 +1,252 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1beta4.stub.SqlBackupRunsServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlBackupRunsServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlBackupRunsServiceSettings.Builder sqlBackupRunsServiceSettingsBuilder =
+ *     SqlBackupRunsServiceSettings.newBuilder();
+ * sqlBackupRunsServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlBackupRunsServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings =
+ *     sqlBackupRunsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlBackupRunsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return ((SqlBackupRunsServiceStubSettings) getStubSettings()).deleteSettings(); + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return ((SqlBackupRunsServiceStubSettings) getStubSettings()).getSettings(); + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return ((SqlBackupRunsServiceStubSettings) getStubSettings()).insertSettings(); + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlBackupRunsServiceStubSettings) getStubSettings()).listSettings(); + } + + public static final SqlBackupRunsServiceSettings create(SqlBackupRunsServiceStubSettings stub) + throws IOException { + return new SqlBackupRunsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlBackupRunsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlBackupRunsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlBackupRunsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlBackupRunsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlBackupRunsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlBackupRunsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlBackupRunsServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlBackupRunsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlBackupRunsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlBackupRunsServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlBackupRunsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlBackupRunsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlBackupRunsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlBackupRunsServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlBackupRunsServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlBackupRunsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlBackupRunsServiceStubSettings.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 delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return getStubSettingsBuilder().deleteSettings(); + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getStubSettingsBuilder().getSettings(); + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return getStubSettingsBuilder().insertSettings(); + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + @Override + public SqlBackupRunsServiceSettings build() throws IOException { + return new SqlBackupRunsServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceClient.java new file mode 100644 index 000000000000..dc4a03631b33 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceClient.java @@ -0,0 +1,981 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +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.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.stub.SqlBackupsServiceStub; +import com.google.cloud.sql.v1beta4.stub.SqlBackupsServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   Backup backup = Backup.newBuilder().build();
+ *   Operation response = sqlBackupsServiceClient.createBackup(parent, backup);
+ * }
+ * }
+ * + *

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

CreateBackup

Creates a backup for a Cloud SQL instance. This API can be used only to create on-demand backups.

+ *

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

+ *
    + *
  • createBackup(CreateBackupRequest request) + *

+ *

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

+ *
    + *
  • createBackup(ProjectName parent, Backup backup) + *

  • createBackup(String parent, Backup backup) + *

+ *

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

+ *
    + *
  • createBackupCallable() + *

+ *

GetBackup

Retrieves a resource containing information about a backup.

+ *

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

+ *
    + *
  • getBackup(GetBackupRequest request) + *

+ *

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

+ *
    + *
  • getBackup(BackupName name) + *

  • getBackup(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.

+ *
    + *
  • getBackupCallable() + *

+ *

ListBackups

Lists all backups associated with the project.

+ *

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

+ *
    + *
  • listBackups(ListBackupsRequest request) + *

+ *

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

+ *
    + *
  • listBackups(ProjectName parent) + *

  • listBackups(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.

+ *
    + *
  • listBackupsPagedCallable() + *

  • listBackupsCallable() + *

+ *

UpdateBackup

Updates the retention period and the description of the backup. You can use this API to update final backups only.

+ *

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

+ *
    + *
  • updateBackup(UpdateBackupRequest request) + *

+ *

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

+ *
    + *
  • updateBackup(Backup backup, 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.

+ *
    + *
  • updateBackupCallable() + *

+ *

DeleteBackup

Deletes the backup.

+ *

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

+ *
    + *
  • deleteBackup(DeleteBackupRequest request) + *

+ *

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

+ *
    + *
  • deleteBackup(BackupName name) + *

  • deleteBackup(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.

+ *
    + *
  • deleteBackupCallable() + *

+ *
+ * + *

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 SqlBackupsServiceSettings 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
+ * SqlBackupsServiceSettings sqlBackupsServiceSettings =
+ *     SqlBackupsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlBackupsServiceClient sqlBackupsServiceClient =
+ *     SqlBackupsServiceClient.create(sqlBackupsServiceSettings);
+ * }
+ * + *

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
+ * SqlBackupsServiceSettings sqlBackupsServiceSettings =
+ *     SqlBackupsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlBackupsServiceClient sqlBackupsServiceClient =
+ *     SqlBackupsServiceClient.create(sqlBackupsServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlBackupsServiceSettings sqlBackupsServiceSettings =
+ *     SqlBackupsServiceSettings.newHttpJsonBuilder().build();
+ * SqlBackupsServiceClient sqlBackupsServiceClient =
+ *     SqlBackupsServiceClient.create(sqlBackupsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlBackupsServiceClient implements BackgroundResource { + private final @Nullable SqlBackupsServiceSettings settings; + private final SqlBackupsServiceStub stub; + + /** Constructs an instance of SqlBackupsServiceClient with default settings. */ + public static final SqlBackupsServiceClient create() throws IOException { + return create(SqlBackupsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlBackupsServiceClient, 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 SqlBackupsServiceClient create(SqlBackupsServiceSettings settings) + throws IOException { + return new SqlBackupsServiceClient(settings); + } + + /** + * Constructs an instance of SqlBackupsServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(SqlBackupsServiceSettings). + */ + public static final SqlBackupsServiceClient create(SqlBackupsServiceStub stub) { + return new SqlBackupsServiceClient(stub); + } + + /** + * Constructs an instance of SqlBackupsServiceClient, 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 SqlBackupsServiceClient(SqlBackupsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlBackupsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlBackupsServiceClient(SqlBackupsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlBackupsServiceSettings getSettings() { + return settings; + } + + public SqlBackupsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup for a Cloud SQL instance. This API can be used only to create on-demand + * backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Backup backup = Backup.newBuilder().build();
+   *   Operation response = sqlBackupsServiceClient.createBackup(parent, backup);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this backup is created. Format: + * projects/{project} + * @param backup Required. The Backup to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation createBackup(@Nullable ProjectName parent, Backup backup) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBackup(backup) + .build(); + return createBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup for a Cloud SQL instance. This API can be used only to create on-demand + * backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   Backup backup = Backup.newBuilder().build();
+   *   Operation response = sqlBackupsServiceClient.createBackup(parent, backup);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this backup is created. Format: + * projects/{project} + * @param backup Required. The Backup to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation createBackup(String parent, Backup backup) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder().setParent(parent).setBackup(backup).build(); + return createBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup for a Cloud SQL instance. This API can be used only to create on-demand + * backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlBackupsServiceClient.createBackup(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 Operation createBackup(CreateBackupRequest request) { + return createBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup for a Cloud SQL instance. This API can be used only to create on-demand + * backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlBackupsServiceClient.createBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createBackupCallable() { + return stub.createBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[BACKUP]");
+   *   Backup response = sqlBackupsServiceClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. The name of the backup to retrieve. Format: + * projects/{project}/backups/{backup} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(@Nullable BackupName name) { + GetBackupRequest request = + GetBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[BACKUP]").toString();
+   *   Backup response = sqlBackupsServiceClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. The name of the backup to retrieve. Format: + * projects/{project}/backups/{backup} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(String name) { + GetBackupRequest request = GetBackupRequest.newBuilder().setName(name).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString())
+   *           .build();
+   *   Backup response = sqlBackupsServiceClient.getBackup(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(GetBackupRequest request) { + return getBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString())
+   *           .build();
+   *   ApiFuture future = sqlBackupsServiceClient.getBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getBackupCallable() { + return stub.getBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups associated with the project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (Backup element : sqlBackupsServiceClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent that owns this collection of backups. Format: + * projects/{project} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(@Nullable ProjectName parent) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups associated with the project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   for (Backup element : sqlBackupsServiceClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent that owns this collection of backups. Format: + * projects/{project} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(String parent) { + ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups associated with the project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (Backup element : sqlBackupsServiceClient.listBackups(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) { + return listBackupsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups associated with the project. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListBackupsResponse response = sqlBackupsServiceClient.listBackupsCallable().call(request);
+   *     for (Backup element : response.getBackupsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listBackupsCallable() { + return stub.listBackupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the retention period and the description of the backup. You can use this API to update + * final backups only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   Backup backup = Backup.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Operation response = sqlBackupsServiceClient.updateBackup(backup, updateMask);
+   * }
+   * }
+ * + * @param backup Required. The backup to update. The backup’s `name` field is used to identify the + * backup to update. Format: projects/{project}/backups/{backup} + * @param updateMask The list of fields that you can update. You can update only the description + * and retention period of the final backup. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation updateBackup(Backup backup, FieldMask updateMask) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder().setBackup(backup).setUpdateMask(updateMask).build(); + return updateBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the retention period and the description of the backup. You can use this API to update + * final backups only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlBackupsServiceClient.updateBackup(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 Operation updateBackup(UpdateBackupRequest request) { + return updateBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the retention period and the description of the backup. You can use this API to update + * final backups only. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[BACKUP]");
+   *   Operation response = sqlBackupsServiceClient.deleteBackup(name);
+   * }
+   * }
+ * + * @param name Required. The name of the backup to delete. Format: + * projects/{project}/backups/{backup} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation deleteBackup(@Nullable BackupName name) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[BACKUP]").toString();
+   *   Operation response = sqlBackupsServiceClient.deleteBackup(name);
+   * }
+   * }
+ * + * @param name Required. The name of the backup to delete. Format: + * projects/{project}/backups/{backup} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation deleteBackup(String name) { + DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build(); + return deleteBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString())
+   *           .build();
+   *   Operation response = sqlBackupsServiceClient.deleteBackup(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 Operation deleteBackup(DeleteBackupRequest request) { + return deleteBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlBackupsServiceClient.deleteBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteBackupCallable() { + return stub.deleteBackupCallable(); + } + + @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 ListBackupsPagedResponse + extends AbstractPagedListResponse< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBackupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListBackupsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListBackupsPagedResponse(ListBackupsPage page) { + super(page, ListBackupsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBackupsPage + extends AbstractPage { + + private ListBackupsPage( + @Nullable PageContext context, + @Nullable ListBackupsResponse response) { + super(context, response); + } + + private static ListBackupsPage createEmptyPage() { + return new ListBackupsPage(null, null); + } + + @Override + protected ListBackupsPage createPage( + @Nullable PageContext context, + @Nullable ListBackupsResponse response) { + return new ListBackupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + @Nullable PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBackupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + private ListBackupsFixedSizeCollection( + @Nullable List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBackupsFixedSizeCollection createEmptyCollection() { + return new ListBackupsFixedSizeCollection(null, 0); + } + + @Override + protected ListBackupsFixedSizeCollection createCollection( + @Nullable List pages, int collectionSize) { + return new ListBackupsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceSettings.java new file mode 100644 index 000000000000..f6fa1ea980ab --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceSettings.java @@ -0,0 +1,265 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import static com.google.cloud.sql.v1beta4.SqlBackupsServiceClient.ListBackupsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1beta4.stub.SqlBackupsServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlBackupsServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 createBackup: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlBackupsServiceSettings.Builder sqlBackupsServiceSettingsBuilder =
+ *     SqlBackupsServiceSettings.newBuilder();
+ * sqlBackupsServiceSettingsBuilder
+ *     .createBackupSettings()
+ *     .setRetrySettings(
+ *         sqlBackupsServiceSettingsBuilder
+ *             .createBackupSettings()
+ *             .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());
+ * SqlBackupsServiceSettings sqlBackupsServiceSettings = sqlBackupsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlBackupsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return ((SqlBackupsServiceStubSettings) getStubSettings()).createBackupSettings(); + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return ((SqlBackupsServiceStubSettings) getStubSettings()).getBackupSettings(); + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return ((SqlBackupsServiceStubSettings) getStubSettings()).listBackupsSettings(); + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return ((SqlBackupsServiceStubSettings) getStubSettings()).updateBackupSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return ((SqlBackupsServiceStubSettings) getStubSettings()).deleteBackupSettings(); + } + + public static final SqlBackupsServiceSettings create(SqlBackupsServiceStubSettings stub) + throws IOException { + return new SqlBackupsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlBackupsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlBackupsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlBackupsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlBackupsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlBackupsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlBackupsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlBackupsServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlBackupsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlBackupsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlBackupsServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlBackupsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlBackupsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlBackupsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlBackupsServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlBackupsServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlBackupsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlBackupsServiceStubSettings.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 createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return getStubSettingsBuilder().createBackupSettings(); + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getStubSettingsBuilder().getBackupSettings(); + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return getStubSettingsBuilder().listBackupsSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return getStubSettingsBuilder().updateBackupSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return getStubSettingsBuilder().deleteBackupSettings(); + } + + @Override + public SqlBackupsServiceSettings build() throws IOException { + return new SqlBackupsServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlConnectServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlConnectServiceClient.java new file mode 100644 index 000000000000..49849aa2de80 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlConnectServiceClient.java @@ -0,0 +1,439 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.stub.SqlConnectServiceStub; +import com.google.cloud.sql.v1beta4.stub.SqlConnectServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Cloud SQL connect service. + * + *

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 (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+ *   GetConnectSettingsRequest request =
+ *       GetConnectSettingsRequest.newBuilder()
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .setReadTime(Timestamp.newBuilder().build())
+ *           .build();
+ *   ConnectSettings response = sqlConnectServiceClient.getConnectSettings(request);
+ * }
+ * }
+ * + *

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

GetConnectSettings

Retrieves connect settings about a Cloud SQL instance.

+ *

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

+ *
    + *
  • getConnectSettings(GetConnectSettingsRequest request) + *

+ *

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

+ *
    + *
  • getConnectSettingsCallable() + *

+ *

ResolveConnectSettings

Retrieves connect settings about a Cloud SQL instance using the instance DNS name.

+ *

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

+ *
    + *
  • resolveConnectSettings(ResolveConnectSettingsRequest request) + *

+ *

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

+ *
    + *
  • resolveConnectSettingsCallable() + *

+ *

GenerateEphemeralCert

Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.

+ *

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

+ *
    + *
  • generateEphemeralCert(GenerateEphemeralCertRequest request) + *

+ *

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

+ *
    + *
  • generateEphemeralCertCallable() + *

+ *
+ * + *

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 SqlConnectServiceSettings 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
+ * SqlConnectServiceSettings sqlConnectServiceSettings =
+ *     SqlConnectServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlConnectServiceClient sqlConnectServiceClient =
+ *     SqlConnectServiceClient.create(sqlConnectServiceSettings);
+ * }
+ * + *

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
+ * SqlConnectServiceSettings sqlConnectServiceSettings =
+ *     SqlConnectServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlConnectServiceClient sqlConnectServiceClient =
+ *     SqlConnectServiceClient.create(sqlConnectServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlConnectServiceSettings sqlConnectServiceSettings =
+ *     SqlConnectServiceSettings.newHttpJsonBuilder().build();
+ * SqlConnectServiceClient sqlConnectServiceClient =
+ *     SqlConnectServiceClient.create(sqlConnectServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlConnectServiceClient implements BackgroundResource { + private final @Nullable SqlConnectServiceSettings settings; + private final SqlConnectServiceStub stub; + + /** Constructs an instance of SqlConnectServiceClient with default settings. */ + public static final SqlConnectServiceClient create() throws IOException { + return create(SqlConnectServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlConnectServiceClient, 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 SqlConnectServiceClient create(SqlConnectServiceSettings settings) + throws IOException { + return new SqlConnectServiceClient(settings); + } + + /** + * Constructs an instance of SqlConnectServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(SqlConnectServiceSettings). + */ + public static final SqlConnectServiceClient create(SqlConnectServiceStub stub) { + return new SqlConnectServiceClient(stub); + } + + /** + * Constructs an instance of SqlConnectServiceClient, 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 SqlConnectServiceClient(SqlConnectServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlConnectServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlConnectServiceClient(SqlConnectServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlConnectServiceSettings getSettings() { + return settings; + } + + public SqlConnectServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves connect settings about a Cloud SQL 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 (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+   *   GetConnectSettingsRequest request =
+   *       GetConnectSettingsRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setReadTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ConnectSettings response = sqlConnectServiceClient.getConnectSettings(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 ConnectSettings getConnectSettings(GetConnectSettingsRequest request) { + return getConnectSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves connect settings about a Cloud SQL 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 (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+   *   GetConnectSettingsRequest request =
+   *       GetConnectSettingsRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setReadTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlConnectServiceClient.getConnectSettingsCallable().futureCall(request);
+   *   // Do something.
+   *   ConnectSettings response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getConnectSettingsCallable() { + return stub.getConnectSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves connect settings about a Cloud SQL instance using the instance DNS name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+   *   ResolveConnectSettingsRequest request =
+   *       ResolveConnectSettingsRequest.newBuilder()
+   *           .setDnsName("dnsName1813886804")
+   *           .setLocation("location1901043637")
+   *           .build();
+   *   ConnectSettings response = sqlConnectServiceClient.resolveConnectSettings(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 ConnectSettings resolveConnectSettings(ResolveConnectSettingsRequest request) { + return resolveConnectSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves connect settings about a Cloud SQL instance using the instance DNS name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+   *   ResolveConnectSettingsRequest request =
+   *       ResolveConnectSettingsRequest.newBuilder()
+   *           .setDnsName("dnsName1813886804")
+   *           .setLocation("location1901043637")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlConnectServiceClient.resolveConnectSettingsCallable().futureCall(request);
+   *   // Do something.
+   *   ConnectSettings response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + resolveConnectSettingsCallable() { + return stub.resolveConnectSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generates a short-lived X509 certificate containing the provided public key and signed by a + * private key specific to the target instance. Users may use the certificate to authenticate as + * themselves when connecting to the database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+   *   GenerateEphemeralCertRequest request =
+   *       GenerateEphemeralCertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setPublicKey("publicKey1446899510")
+   *           .setAccessToken("accessToken-1042689291")
+   *           .setReadTime(Timestamp.newBuilder().build())
+   *           .setValidDuration(Duration.newBuilder().build())
+   *           .build();
+   *   GenerateEphemeralCertResponse response =
+   *       sqlConnectServiceClient.generateEphemeralCert(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 GenerateEphemeralCertResponse generateEphemeralCert( + GenerateEphemeralCertRequest request) { + return generateEphemeralCertCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generates a short-lived X509 certificate containing the provided public key and signed by a + * private key specific to the target instance. Users may use the certificate to authenticate as + * themselves when connecting to the database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+   *   GenerateEphemeralCertRequest request =
+   *       GenerateEphemeralCertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setPublicKey("publicKey1446899510")
+   *           .setAccessToken("accessToken-1042689291")
+   *           .setReadTime(Timestamp.newBuilder().build())
+   *           .setValidDuration(Duration.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlConnectServiceClient.generateEphemeralCertCallable().futureCall(request);
+   *   // Do something.
+   *   GenerateEphemeralCertResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + generateEphemeralCertCallable() { + return stub.generateEphemeralCertCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlConnectServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlConnectServiceSettings.java new file mode 100644 index 000000000000..22772e8ebcb2 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlConnectServiceSettings.java @@ -0,0 +1,245 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1beta4.stub.SqlConnectServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlConnectServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 getConnectSettings: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlConnectServiceSettings.Builder sqlConnectServiceSettingsBuilder =
+ *     SqlConnectServiceSettings.newBuilder();
+ * sqlConnectServiceSettingsBuilder
+ *     .getConnectSettingsSettings()
+ *     .setRetrySettings(
+ *         sqlConnectServiceSettingsBuilder
+ *             .getConnectSettingsSettings()
+ *             .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());
+ * SqlConnectServiceSettings sqlConnectServiceSettings = sqlConnectServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlConnectServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getConnectSettings. */ + public UnaryCallSettings + getConnectSettingsSettings() { + return ((SqlConnectServiceStubSettings) getStubSettings()).getConnectSettingsSettings(); + } + + /** Returns the object with the settings used for calls to resolveConnectSettings. */ + public UnaryCallSettings + resolveConnectSettingsSettings() { + return ((SqlConnectServiceStubSettings) getStubSettings()).resolveConnectSettingsSettings(); + } + + /** Returns the object with the settings used for calls to generateEphemeralCert. */ + public UnaryCallSettings + generateEphemeralCertSettings() { + return ((SqlConnectServiceStubSettings) getStubSettings()).generateEphemeralCertSettings(); + } + + public static final SqlConnectServiceSettings create(SqlConnectServiceStubSettings stub) + throws IOException { + return new SqlConnectServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlConnectServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlConnectServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlConnectServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlConnectServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlConnectServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlConnectServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlConnectServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlConnectServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlConnectServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlConnectServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlConnectServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlConnectServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlConnectServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlConnectServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlConnectServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlConnectServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlConnectServiceStubSettings.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 getConnectSettings. */ + public UnaryCallSettings.Builder + getConnectSettingsSettings() { + return getStubSettingsBuilder().getConnectSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to resolveConnectSettings. */ + public UnaryCallSettings.Builder + resolveConnectSettingsSettings() { + return getStubSettingsBuilder().resolveConnectSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to generateEphemeralCert. */ + public UnaryCallSettings.Builder + generateEphemeralCertSettings() { + return getStubSettingsBuilder().generateEphemeralCertSettings(); + } + + @Override + public SqlConnectServiceSettings build() throws IOException { + return new SqlConnectServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlDataServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlDataServiceClient.java new file mode 100644 index 000000000000..8662a65a49c3 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlDataServiceClient.java @@ -0,0 +1,272 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.cloud.sql.v1beta4.stub.SqlDataServiceStub; +import com.google.cloud.sql.v1beta4.stub.SqlDataServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for streaming data to and from Cloud SQL instances. + * + *

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 (SqlDataServiceClient sqlDataServiceClient = SqlDataServiceClient.create()) {
+ *   BidiStream bidiStream =
+ *       sqlDataServiceClient.streamSqlDataCallable().call();
+ *   StreamSqlDataRequest request =
+ *       StreamSqlDataRequest.newBuilder()
+ *           .setAck(Ack.newBuilder().build())
+ *           .setInstanceId(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ *           .build();
+ *   bidiStream.send(request);
+ *   for (StreamSqlDataResponse response : bidiStream) {
+ *     // Do something when a response is received.
+ *   }
+ * }
+ * }
+ * + *

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

StreamSqlData

`StreamSqlData` establishes a bidirectional stream to a Cloud SQL instance, and then streams data to and from the instance. + *

The first message from the client MUST be a `StreamSqlDataRequest` request with configuration settings, including required values for the `connection_settings` field. Subsequent messages from the client may contain the `payload` field. + *

Messages from the server may contain the `payload` field. + *

The `payload` fields of the request and response streams contain the raw data of the database's native wire protocol (e.g., PostgreSQL wire protocol). The database client is responsible for generating and parsing this data. + *

Any errors on initial connection (e.g., connection failure, authorization issues, network problems) will result in the stream being terminated with an appropriate RPC status exception. + *

After a successful connection is made, if an error occurs, then the server terminates connection and returns the appropriate RPC status exception. + *

Add the request params headers to the request to ensure that the streaming request is routed to the correct service for your database. + *

Use this format for the request params header: + *

`x-goog-request-params`: location_id={location_path}&instance_id={instance_path}` + *

`location_path` is `locations/{location_name}` `instance_path` is `projects/{project_name}/instances/{instance_name}` + *

for example: `x-goog-request-params`: `location_id=locations/us-central1&instance_id=projects/myproject/instances/instancename`

+ *

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

+ *
    + *
  • streamSqlDataCallable() + *

+ *
+ * + *

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 SqlDataServiceSettings 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
+ * SqlDataServiceSettings sqlDataServiceSettings =
+ *     SqlDataServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlDataServiceClient sqlDataServiceClient = SqlDataServiceClient.create(sqlDataServiceSettings);
+ * }
+ * + *

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
+ * SqlDataServiceSettings sqlDataServiceSettings =
+ *     SqlDataServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlDataServiceClient sqlDataServiceClient = SqlDataServiceClient.create(sqlDataServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlDataServiceClient implements BackgroundResource { + private final @Nullable SqlDataServiceSettings settings; + private final SqlDataServiceStub stub; + + /** Constructs an instance of SqlDataServiceClient with default settings. */ + public static final SqlDataServiceClient create() throws IOException { + return create(SqlDataServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlDataServiceClient, 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 SqlDataServiceClient create(SqlDataServiceSettings settings) + throws IOException { + return new SqlDataServiceClient(settings); + } + + /** + * Constructs an instance of SqlDataServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SqlDataServiceSettings). + */ + public static final SqlDataServiceClient create(SqlDataServiceStub stub) { + return new SqlDataServiceClient(stub); + } + + /** + * Constructs an instance of SqlDataServiceClient, 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 SqlDataServiceClient(SqlDataServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlDataServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlDataServiceClient(SqlDataServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlDataServiceSettings getSettings() { + return settings; + } + + public SqlDataServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * `StreamSqlData` establishes a bidirectional stream to a Cloud SQL instance, and then streams + * data to and from the instance. + * + *

The first message from the client MUST be a `StreamSqlDataRequest` request with + * configuration settings, including required values for the `connection_settings` field. + * Subsequent messages from the client may contain the `payload` field. + * + *

Messages from the server may contain the `payload` field. + * + *

The `payload` fields of the request and response streams contain the raw data of the + * database's native wire protocol (e.g., PostgreSQL wire protocol). The database client is + * responsible for generating and parsing this data. + * + *

Any errors on initial connection (e.g., connection failure, authorization issues, network + * problems) will result in the stream being terminated with an appropriate RPC status exception. + * + *

After a successful connection is made, if an error occurs, then the server terminates + * connection and returns the appropriate RPC status exception. + * + *

Add the request params headers to the request to ensure that the streaming request is routed + * to the correct service for your database. + * + *

Use this format for the request params header: + * + *

`x-goog-request-params`: location_id={location_path}&instance_id={instance_path}` + * + *

`location_path` is `locations/{location_name}` `instance_path` is + * `projects/{project_name}/instances/{instance_name}` + * + *

for example: `x-goog-request-params`: + * `location_id=locations/us-central1&instance_id=projects/myproject/instances/instancename` + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlDataServiceClient sqlDataServiceClient = SqlDataServiceClient.create()) {
+   *   BidiStream bidiStream =
+   *       sqlDataServiceClient.streamSqlDataCallable().call();
+   *   StreamSqlDataRequest request =
+   *       StreamSqlDataRequest.newBuilder()
+   *           .setAck(Ack.newBuilder().build())
+   *           .setInstanceId(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .build();
+   *   bidiStream.send(request);
+   *   for (StreamSqlDataResponse response : bidiStream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final BidiStreamingCallable + streamSqlDataCallable() { + return stub.streamSqlDataCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlDataServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlDataServiceSettings.java new file mode 100644 index 000000000000..951a89ac6238 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlDataServiceSettings.java @@ -0,0 +1,205 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1beta4.stub.SqlDataServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlDataServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 streamSqlData: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlDataServiceSettings.Builder sqlDataServiceSettingsBuilder =
+ *     SqlDataServiceSettings.newBuilder();
+ * sqlDataServiceSettingsBuilder
+ *     .streamSqlDataSettings()
+ *     .setRetrySettings(
+ *         sqlDataServiceSettingsBuilder
+ *             .streamSqlDataSettings()
+ *             .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());
+ * SqlDataServiceSettings sqlDataServiceSettings = sqlDataServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlDataServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to streamSqlData. */ + public StreamingCallSettings + streamSqlDataSettings() { + return ((SqlDataServiceStubSettings) getStubSettings()).streamSqlDataSettings(); + } + + public static final SqlDataServiceSettings create(SqlDataServiceStubSettings stub) + throws IOException { + return new SqlDataServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlDataServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlDataServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlDataServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlDataServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlDataServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlDataServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlDataServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlDataServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlDataServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlDataServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlDataServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlDataServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlDataServiceStubSettings.newBuilder()); + } + + public SqlDataServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlDataServiceStubSettings.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 streamSqlData. */ + public StreamingCallSettings.Builder + streamSqlDataSettings() { + return getStubSettingsBuilder().streamSqlDataSettings(); + } + + @Override + public SqlDataServiceSettings build() throws IOException { + return new SqlDataServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceClient.java new file mode 100644 index 000000000000..dda8f9d54b7d --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceClient.java @@ -0,0 +1,650 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.stub.SqlDatabasesServiceStub; +import com.google.cloud.sql.v1beta4.stub.SqlDatabasesServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+ *   SqlDatabasesDeleteRequest request =
+ *       SqlDatabasesDeleteRequest.newBuilder()
+ *           .setDatabase("database1789464955")
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlDatabasesServiceClient.delete(request);
+ * }
+ * }
+ * + *

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

Delete

Deletes a database from a Cloud SQL instance.

+ *

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

+ *
    + *
  • delete(SqlDatabasesDeleteRequest request) + *

+ *

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

+ *
    + *
  • deleteCallable() + *

+ *

Get

Retrieves a resource containing information about a database inside a Cloud SQL instance.

+ *

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

+ *
    + *
  • get(SqlDatabasesGetRequest request) + *

+ *

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

+ *
    + *
  • getCallable() + *

+ *

Insert

Inserts a resource containing information about a database inside a Cloud SQL instance. + *

**Note:** You can't modify the default character set and collation.

+ *

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

+ *
    + *
  • insert(SqlDatabasesInsertRequest request) + *

+ *

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

+ *
    + *
  • insertCallable() + *

+ *

List

Lists databases in the specified Cloud SQL instance.

+ *

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

+ *
    + *
  • list(SqlDatabasesListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *

Patch

Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.

+ *

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

+ *
    + *
  • patch(SqlDatabasesUpdateRequest request) + *

+ *

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

+ *
    + *
  • patchCallable() + *

+ *

Update

Updates a resource containing information about a database inside a Cloud SQL instance.

+ *

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

+ *
    + *
  • update(SqlDatabasesUpdateRequest request) + *

+ *

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

+ *
    + *
  • updateCallable() + *

+ *
+ * + *

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 SqlDatabasesServiceSettings 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
+ * SqlDatabasesServiceSettings sqlDatabasesServiceSettings =
+ *     SqlDatabasesServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlDatabasesServiceClient sqlDatabasesServiceClient =
+ *     SqlDatabasesServiceClient.create(sqlDatabasesServiceSettings);
+ * }
+ * + *

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
+ * SqlDatabasesServiceSettings sqlDatabasesServiceSettings =
+ *     SqlDatabasesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlDatabasesServiceClient sqlDatabasesServiceClient =
+ *     SqlDatabasesServiceClient.create(sqlDatabasesServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlDatabasesServiceSettings sqlDatabasesServiceSettings =
+ *     SqlDatabasesServiceSettings.newHttpJsonBuilder().build();
+ * SqlDatabasesServiceClient sqlDatabasesServiceClient =
+ *     SqlDatabasesServiceClient.create(sqlDatabasesServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlDatabasesServiceClient implements BackgroundResource { + private final @Nullable SqlDatabasesServiceSettings settings; + private final SqlDatabasesServiceStub stub; + + /** Constructs an instance of SqlDatabasesServiceClient with default settings. */ + public static final SqlDatabasesServiceClient create() throws IOException { + return create(SqlDatabasesServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlDatabasesServiceClient, 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 SqlDatabasesServiceClient create(SqlDatabasesServiceSettings settings) + throws IOException { + return new SqlDatabasesServiceClient(settings); + } + + /** + * Constructs an instance of SqlDatabasesServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(SqlDatabasesServiceSettings). + */ + public static final SqlDatabasesServiceClient create(SqlDatabasesServiceStub stub) { + return new SqlDatabasesServiceClient(stub); + } + + /** + * Constructs an instance of SqlDatabasesServiceClient, 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 SqlDatabasesServiceClient(SqlDatabasesServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlDatabasesServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlDatabasesServiceClient(SqlDatabasesServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlDatabasesServiceSettings getSettings() { + return settings; + } + + public SqlDatabasesServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a database from a Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesDeleteRequest request =
+   *       SqlDatabasesDeleteRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlDatabasesServiceClient.delete(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 Operation delete(SqlDatabasesDeleteRequest request) { + return deleteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a database from a Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesDeleteRequest request =
+   *       SqlDatabasesDeleteRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlDatabasesServiceClient.deleteCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCallable() { + return stub.deleteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a database inside a Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesGetRequest request =
+   *       SqlDatabasesGetRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Database response = sqlDatabasesServiceClient.get(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 Database get(SqlDatabasesGetRequest request) { + return getCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a database inside a Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesGetRequest request =
+   *       SqlDatabasesGetRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlDatabasesServiceClient.getCallable().futureCall(request);
+   *   // Do something.
+   *   Database response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCallable() { + return stub.getCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Inserts a resource containing information about a database inside a Cloud SQL instance. + * + *

**Note:** You can't modify the default character set and collation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesInsertRequest request =
+   *       SqlDatabasesInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(Database.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlDatabasesServiceClient.insert(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 Operation insert(SqlDatabasesInsertRequest request) { + return insertCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Inserts a resource containing information about a database inside a Cloud SQL instance. + * + *

**Note:** You can't modify the default character set and collation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesInsertRequest request =
+   *       SqlDatabasesInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(Database.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlDatabasesServiceClient.insertCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable insertCallable() { + return stub.insertCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists databases in the specified Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesListRequest request =
+   *       SqlDatabasesListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   DatabasesListResponse response = sqlDatabasesServiceClient.list(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 DatabasesListResponse list(SqlDatabasesListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists databases in the specified Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesListRequest request =
+   *       SqlDatabasesListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlDatabasesServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   DatabasesListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates a resource containing information about a database inside a Cloud SQL + * instance. This method supports patch semantics. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesUpdateRequest request =
+   *       SqlDatabasesUpdateRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(Database.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlDatabasesServiceClient.patch(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 Operation patch(SqlDatabasesUpdateRequest request) { + return patchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates a resource containing information about a database inside a Cloud SQL + * instance. This method supports patch semantics. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesUpdateRequest request =
+   *       SqlDatabasesUpdateRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(Database.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlDatabasesServiceClient.patchCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable patchCallable() { + return stub.patchCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a resource containing information about a database inside a Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesUpdateRequest request =
+   *       SqlDatabasesUpdateRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(Database.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlDatabasesServiceClient.update(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 Operation update(SqlDatabasesUpdateRequest request) { + return updateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a resource containing information about a database inside a Cloud SQL 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 (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+   *   SqlDatabasesUpdateRequest request =
+   *       SqlDatabasesUpdateRequest.newBuilder()
+   *           .setDatabase("database1789464955")
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(Database.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlDatabasesServiceClient.updateCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateCallable() { + return stub.updateCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceSettings.java new file mode 100644 index 000000000000..42beb2cfa3ba --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceSettings.java @@ -0,0 +1,271 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1beta4.stub.SqlDatabasesServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlDatabasesServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlDatabasesServiceSettings.Builder sqlDatabasesServiceSettingsBuilder =
+ *     SqlDatabasesServiceSettings.newBuilder();
+ * sqlDatabasesServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlDatabasesServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlDatabasesServiceSettings sqlDatabasesServiceSettings =
+ *     sqlDatabasesServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlDatabasesServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return ((SqlDatabasesServiceStubSettings) getStubSettings()).deleteSettings(); + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return ((SqlDatabasesServiceStubSettings) getStubSettings()).getSettings(); + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return ((SqlDatabasesServiceStubSettings) getStubSettings()).insertSettings(); + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlDatabasesServiceStubSettings) getStubSettings()).listSettings(); + } + + /** Returns the object with the settings used for calls to patch. */ + public UnaryCallSettings patchSettings() { + return ((SqlDatabasesServiceStubSettings) getStubSettings()).patchSettings(); + } + + /** Returns the object with the settings used for calls to update. */ + public UnaryCallSettings updateSettings() { + return ((SqlDatabasesServiceStubSettings) getStubSettings()).updateSettings(); + } + + public static final SqlDatabasesServiceSettings create(SqlDatabasesServiceStubSettings stub) + throws IOException { + return new SqlDatabasesServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlDatabasesServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlDatabasesServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlDatabasesServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlDatabasesServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlDatabasesServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlDatabasesServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlDatabasesServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlDatabasesServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlDatabasesServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlDatabasesServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlDatabasesServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlDatabasesServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlDatabasesServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlDatabasesServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlDatabasesServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlDatabasesServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlDatabasesServiceStubSettings.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 delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return getStubSettingsBuilder().deleteSettings(); + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getStubSettingsBuilder().getSettings(); + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return getStubSettingsBuilder().insertSettings(); + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + /** Returns the builder for the settings used for calls to patch. */ + public UnaryCallSettings.Builder patchSettings() { + return getStubSettingsBuilder().patchSettings(); + } + + /** Returns the builder for the settings used for calls to update. */ + public UnaryCallSettings.Builder updateSettings() { + return getStubSettingsBuilder().updateSettings(); + } + + @Override + public SqlDatabasesServiceSettings build() throws IOException { + return new SqlDatabasesServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceClient.java new file mode 100644 index 000000000000..223151211365 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceClient.java @@ -0,0 +1,273 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.stub.SqlFlagsServiceStub; +import com.google.cloud.sql.v1beta4.stub.SqlFlagsServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (SqlFlagsServiceClient sqlFlagsServiceClient = SqlFlagsServiceClient.create()) {
+ *   SqlFlagsListRequest request =
+ *       SqlFlagsListRequest.newBuilder()
+ *           .setDatabaseVersion("databaseVersion1250955997")
+ *           .setFlagScope(SqlFlagScope.forNumber(0))
+ *           .build();
+ *   FlagsListResponse response = sqlFlagsServiceClient.list(request);
+ * }
+ * }
+ * + *

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

List

Lists all available database flags for Cloud SQL instances.

+ *

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

+ *
    + *
  • list(SqlFlagsListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *
+ * + *

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 SqlFlagsServiceSettings 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
+ * SqlFlagsServiceSettings sqlFlagsServiceSettings =
+ *     SqlFlagsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlFlagsServiceClient sqlFlagsServiceClient =
+ *     SqlFlagsServiceClient.create(sqlFlagsServiceSettings);
+ * }
+ * + *

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
+ * SqlFlagsServiceSettings sqlFlagsServiceSettings =
+ *     SqlFlagsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlFlagsServiceClient sqlFlagsServiceClient =
+ *     SqlFlagsServiceClient.create(sqlFlagsServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlFlagsServiceSettings sqlFlagsServiceSettings =
+ *     SqlFlagsServiceSettings.newHttpJsonBuilder().build();
+ * SqlFlagsServiceClient sqlFlagsServiceClient =
+ *     SqlFlagsServiceClient.create(sqlFlagsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlFlagsServiceClient implements BackgroundResource { + private final @Nullable SqlFlagsServiceSettings settings; + private final SqlFlagsServiceStub stub; + + /** Constructs an instance of SqlFlagsServiceClient with default settings. */ + public static final SqlFlagsServiceClient create() throws IOException { + return create(SqlFlagsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlFlagsServiceClient, 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 SqlFlagsServiceClient create(SqlFlagsServiceSettings settings) + throws IOException { + return new SqlFlagsServiceClient(settings); + } + + /** + * Constructs an instance of SqlFlagsServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SqlFlagsServiceSettings). + */ + public static final SqlFlagsServiceClient create(SqlFlagsServiceStub stub) { + return new SqlFlagsServiceClient(stub); + } + + /** + * Constructs an instance of SqlFlagsServiceClient, 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 SqlFlagsServiceClient(SqlFlagsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlFlagsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlFlagsServiceClient(SqlFlagsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlFlagsServiceSettings getSettings() { + return settings; + } + + public SqlFlagsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all available database flags for Cloud SQL instances. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlFlagsServiceClient sqlFlagsServiceClient = SqlFlagsServiceClient.create()) {
+   *   SqlFlagsListRequest request =
+   *       SqlFlagsListRequest.newBuilder()
+   *           .setDatabaseVersion("databaseVersion1250955997")
+   *           .setFlagScope(SqlFlagScope.forNumber(0))
+   *           .build();
+   *   FlagsListResponse response = sqlFlagsServiceClient.list(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 FlagsListResponse list(SqlFlagsListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all available database flags for Cloud SQL instances. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlFlagsServiceClient sqlFlagsServiceClient = SqlFlagsServiceClient.create()) {
+   *   SqlFlagsListRequest request =
+   *       SqlFlagsListRequest.newBuilder()
+   *           .setDatabaseVersion("databaseVersion1250955997")
+   *           .setFlagScope(SqlFlagScope.forNumber(0))
+   *           .build();
+   *   ApiFuture future =
+   *       sqlFlagsServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   FlagsListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceSettings.java new file mode 100644 index 000000000000..5cfca48e2c48 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceSettings.java @@ -0,0 +1,219 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1beta4.stub.SqlFlagsServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlFlagsServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 list: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlFlagsServiceSettings.Builder sqlFlagsServiceSettingsBuilder =
+ *     SqlFlagsServiceSettings.newBuilder();
+ * sqlFlagsServiceSettingsBuilder
+ *     .listSettings()
+ *     .setRetrySettings(
+ *         sqlFlagsServiceSettingsBuilder
+ *             .listSettings()
+ *             .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());
+ * SqlFlagsServiceSettings sqlFlagsServiceSettings = sqlFlagsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlFlagsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlFlagsServiceStubSettings) getStubSettings()).listSettings(); + } + + public static final SqlFlagsServiceSettings create(SqlFlagsServiceStubSettings stub) + throws IOException { + return new SqlFlagsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlFlagsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlFlagsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlFlagsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlFlagsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlFlagsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlFlagsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlFlagsServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlFlagsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlFlagsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlFlagsServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlFlagsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlFlagsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlFlagsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlFlagsServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlFlagsServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlFlagsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlFlagsServiceStubSettings.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 list. */ + public UnaryCallSettings.Builder listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + @Override + public SqlFlagsServiceSettings build() throws IOException { + return new SqlFlagsServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceClient.java new file mode 100644 index 000000000000..a40b05f2be3d --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceClient.java @@ -0,0 +1,3487 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.stub.SqlInstancesServiceStub; +import com.google.cloud.sql.v1beta4.stub.SqlInstancesServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+ *   SqlInstancesAddServerCaRequest request =
+ *       SqlInstancesAddServerCaRequest.newBuilder()
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlInstancesServiceClient.addServerCa(request);
+ * }
+ * }
+ * + *

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

AddServerCa

Add a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in. For instances that have enabled Certificate Authority Service (CAS) based server CA, use AddServerCertificate to add a new server certificate.

+ *

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

+ *
    + *
  • addServerCa(SqlInstancesAddServerCaRequest request) + *

+ *

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

+ *
    + *
  • addServerCaCallable() + *

+ *

AddServerCertificate

Add a new trusted server certificate version for the specified instance using Certificate Authority Service (CAS) server CA. Required to prepare for a certificate rotation. If a server certificate version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one certificate version waiting to be rotated in. For instances not using CAS server CA, use AddServerCa instead.

+ *

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

+ *
    + *
  • addServerCertificate(SqlInstancesAddServerCertificateRequest request) + *

+ *

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

+ *
    + *
  • addServerCertificateCallable() + *

+ *

AddEntraIdCertificate

Adds a new Entra ID certificate for the specified instance. If an Entra ID certificate was previously added but never used in a certificate rotation, this operation replaces that version.

+ *

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

+ *
    + *
  • addEntraIdCertificate(SqlInstancesAddEntraIdCertificateRequest request) + *

+ *

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

+ *
    + *
  • addEntraIdCertificateCallable() + *

+ *

Clone

Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.

+ *

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

+ *
    + *
  • clone(SqlInstancesCloneRequest request) + *

+ *

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

+ *
    + *
  • cloneCallable() + *

+ *

Delete

Deletes a Cloud SQL instance.

+ *

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

+ *
    + *
  • delete(SqlInstancesDeleteRequest request) + *

+ *

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

+ *
    + *
  • deleteCallable() + *

+ *

DemoteMaster

Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.

+ *

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

+ *
    + *
  • demoteMaster(SqlInstancesDemoteMasterRequest request) + *

+ *

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

+ *
    + *
  • demoteMasterCallable() + *

+ *

Demote

Demotes an existing standalone instance to be a Cloud SQL read replica for an external database server.

+ *

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

+ *
    + *
  • demote(SqlInstancesDemoteRequest request) + *

+ *

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

+ *
    + *
  • demoteCallable() + *

+ *

Export

Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.

+ *

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

+ *
    + *
  • export(SqlInstancesExportRequest request) + *

+ *

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

+ *
    + *
  • exportCallable() + *

+ *

Failover

Initiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to the new primary. For more information, see the [Overview of high availability](https://cloud.google.com/sql/docs/mysql/high-availability) page in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its failover replica instance.

+ *

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

+ *
    + *
  • failover(SqlInstancesFailoverRequest request) + *

+ *

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

+ *
    + *
  • failoverCallable() + *

+ *

Reencrypt

Reencrypt CMEK instance with latest key version.

+ *

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

+ *
    + *
  • reencrypt(SqlInstancesReencryptRequest request) + *

+ *

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

+ *
    + *
  • reencryptCallable() + *

+ *

Get

Retrieves a resource containing information about a Cloud SQL instance.

+ *

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

+ *
    + *
  • get(SqlInstancesGetRequest request) + *

+ *

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

+ *
    + *
  • getCallable() + *

+ *

Import

Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.

+ *

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

+ *
    + *
  • import_(SqlInstancesImportRequest request) + *

+ *

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

+ *
    + *
  • import_Callable() + *

+ *

Insert

Creates a new Cloud SQL instance.

+ *

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

+ *
    + *
  • insert(SqlInstancesInsertRequest request) + *

+ *

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

+ *
    + *
  • insertCallable() + *

+ *

List

Lists instances under a given project.

+ *

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

+ *
    + *
  • list(SqlInstancesListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *

ListServerCas

Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out.

+ *

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

+ *
    + *
  • listServerCas(SqlInstancesListServerCasRequest request) + *

+ *

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

+ *
    + *
  • listServerCasCallable() + *

+ *

ListServerCertificates

Lists all versions of server certificates and certificate authorities (CAs) for the specified instance. There can be up to three sets of certs listed: the certificate that is currently in use, a future that has been added but not yet used to sign a certificate, and a certificate that has been rotated out. For instances not using Certificate Authority Service (CAS) server CA, use ListServerCas instead.

+ *

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

+ *
    + *
  • listServerCertificates(SqlInstancesListServerCertificatesRequest request) + *

+ *

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

+ *
    + *
  • listServerCertificatesCallable() + *

+ *

ListEntraIdCertificates

Lists all versions of EntraID certificates for the specified instance. There can be up to three sets of certificates listed: the certificate that is currently in use, a future that has been added but not yet used to sign a certificate, and a certificate that has been rotated out.

+ *

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

+ *
    + *
  • listEntraIdCertificates(SqlInstancesListEntraIdCertificatesRequest request) + *

+ *

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

+ *
    + *
  • listEntraIdCertificatesCallable() + *

+ *

Patch

Partially updates settings of a Cloud SQL instance by merging the request with the current configuration. This method supports patch semantics.

+ *

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

+ *
    + *
  • patch(SqlInstancesPatchRequest request) + *

+ *

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

+ *
    + *
  • patchCallable() + *

+ *

PromoteReplica

Promotes the read replica instance to be an independent Cloud SQL primary instance. Using this operation might cause your instance to restart.

+ *

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

+ *
    + *
  • promoteReplica(SqlInstancesPromoteReplicaRequest request) + *

+ *

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

+ *
    + *
  • promoteReplicaCallable() + *

+ *

Switchover

Switches over from the primary instance to the DR replica instance.

+ *

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

+ *
    + *
  • switchover(SqlInstancesSwitchoverRequest request) + *

+ *

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

+ *
    + *
  • switchoverCallable() + *

+ *

ResetSslConfig

Deletes all client certificates and generates a new server SSL certificate for the instance.

+ *

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

+ *
    + *
  • resetSslConfig(SqlInstancesResetSslConfigRequest request) + *

+ *

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

+ *
    + *
  • resetSslConfigCallable() + *

+ *

Restart

Restarts a Cloud SQL instance.

+ *

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

+ *
    + *
  • restart(SqlInstancesRestartRequest request) + *

+ *

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

+ *
    + *
  • restartCallable() + *

+ *

RestoreBackup

Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.

+ *

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

+ *
    + *
  • restoreBackup(SqlInstancesRestoreBackupRequest request) + *

+ *

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

+ *
    + *
  • restoreBackupCallable() + *

+ *

RotateServerCa

Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. For instances that have enabled Certificate Authority Service (CAS) based server CA, use RotateServerCertificate to rotate the server certificate.

+ *

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

+ *
    + *
  • rotateServerCa(SqlInstancesRotateServerCaRequest request) + *

+ *

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

+ *
    + *
  • rotateServerCaCallable() + *

+ *

RotateServerCertificate

Rotates the server certificate version to one previously added with the addServerCertificate method. For instances not using Certificate Authority Service (CAS) server CA, use RotateServerCa instead.

+ *

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

+ *
    + *
  • rotateServerCertificate(SqlInstancesRotateServerCertificateRequest request) + *

+ *

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

+ *
    + *
  • rotateServerCertificateCallable() + *

+ *

RotateEntraIdCertificate

Rotates the Entra Id certificate version to one previously added with the addEntraIdCertificate method.

+ *

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

+ *
    + *
  • rotateEntraIdCertificate(SqlInstancesRotateEntraIdCertificateRequest request) + *

+ *

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

+ *
    + *
  • rotateEntraIdCertificateCallable() + *

+ *

StartReplica

Starts the replication in the read replica instance.

+ *

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

+ *
    + *
  • startReplica(SqlInstancesStartReplicaRequest request) + *

+ *

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

+ *
    + *
  • startReplicaCallable() + *

+ *

StopReplica

Stops the replication in the read replica instance.

+ *

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

+ *
    + *
  • stopReplica(SqlInstancesStopReplicaRequest request) + *

+ *

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

+ *
    + *
  • stopReplicaCallable() + *

+ *

TruncateLog

Truncate MySQL general and slow query log tables MySQL only.

+ *

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

+ *
    + *
  • truncateLog(SqlInstancesTruncateLogRequest request) + *

+ *

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

+ *
    + *
  • truncateLogCallable() + *

+ *

Update

Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.

+ *

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

+ *
    + *
  • update(SqlInstancesUpdateRequest request) + *

+ *

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

+ *
    + *
  • updateCallable() + *

+ *

CreateEphemeral

Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.

+ *

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

+ *
    + *
  • createEphemeral(SqlInstancesCreateEphemeralCertRequest request) + *

+ *

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

+ *
    + *
  • createEphemeralCallable() + *

+ *

RescheduleMaintenance

Reschedules the maintenance on the given instance.

+ *

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

+ *
    + *
  • rescheduleMaintenance(SqlInstancesRescheduleMaintenanceRequest request) + *

+ *

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

+ *
    + *
  • rescheduleMaintenanceCallable() + *

+ *

VerifyExternalSyncSettings

Verify External primary instance external sync settings.

+ *

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

+ *
    + *
  • verifyExternalSyncSettings(SqlInstancesVerifyExternalSyncSettingsRequest request) + *

+ *

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

+ *
    + *
  • verifyExternalSyncSettingsCallable() + *

+ *

StartExternalSync

Start External primary instance migration.

+ *

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

+ *
    + *
  • startExternalSync(SqlInstancesStartExternalSyncRequest request) + *

+ *

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

+ *
    + *
  • startExternalSyncCallable() + *

+ *

PerformDiskShrink

Perform Disk Shrink on primary instance.

+ *

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

+ *
    + *
  • performDiskShrink(SqlInstancesPerformDiskShrinkRequest request) + *

+ *

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

+ *
    + *
  • performDiskShrinkCallable() + *

+ *

GetDiskShrinkConfig

Get Disk Shrink Config for a given instance.

+ *

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

+ *
    + *
  • getDiskShrinkConfig(SqlInstancesGetDiskShrinkConfigRequest request) + *

+ *

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

+ *
    + *
  • getDiskShrinkConfigCallable() + *

+ *

ResetReplicaSize

Reset Replica Size to primary instance disk size.

+ *

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

+ *
    + *
  • resetReplicaSize(SqlInstancesResetReplicaSizeRequest request) + *

+ *

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

+ *
    + *
  • resetReplicaSizeCallable() + *

+ *

GetLatestRecoveryTime

Get Latest Recovery Time for a given instance.

+ *

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

+ *
    + *
  • getLatestRecoveryTime(SqlInstancesGetLatestRecoveryTimeRequest request) + *

+ *

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

+ *
    + *
  • getLatestRecoveryTimeCallable() + *

+ *

ExecuteSql

Execute SQL statements.

+ *

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

+ *
    + *
  • executeSql(SqlInstancesExecuteSqlRequest request) + *

+ *

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

+ *
    + *
  • executeSqlCallable() + *

+ *

AcquireSsrsLease

Acquire a lease for the setup of SQL Server Reporting Services (SSRS).

+ *

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

+ *
    + *
  • acquireSsrsLease(SqlInstancesAcquireSsrsLeaseRequest request) + *

+ *

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

+ *
    + *
  • acquireSsrsLeaseCallable() + *

+ *

ReleaseSsrsLease

Release a lease for the setup of SQL Server Reporting Services (SSRS).

+ *

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

+ *
    + *
  • releaseSsrsLease(SqlInstancesReleaseSsrsLeaseRequest request) + *

+ *

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

+ *
    + *
  • releaseSsrsLeaseCallable() + *

+ *

PreCheckMajorVersionUpgrade

Execute MVU Pre-checks

+ *

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

+ *
    + *
  • preCheckMajorVersionUpgrade(SqlInstancesPreCheckMajorVersionUpgradeRequest request) + *

+ *

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

+ *
    + *
  • preCheckMajorVersionUpgradeCallable() + *

+ *

PointInTimeRestore

Point in time restore for an instance managed by Google Cloud Backup and Disaster Recovery.

+ *

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

+ *
    + *
  • pointInTimeRestore(SqlInstancesPointInTimeRestoreRequest request) + *

+ *

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

+ *
    + *
  • pointInTimeRestoreCallable() + *

+ *
+ * + *

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 SqlInstancesServiceSettings 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
+ * SqlInstancesServiceSettings sqlInstancesServiceSettings =
+ *     SqlInstancesServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlInstancesServiceClient sqlInstancesServiceClient =
+ *     SqlInstancesServiceClient.create(sqlInstancesServiceSettings);
+ * }
+ * + *

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
+ * SqlInstancesServiceSettings sqlInstancesServiceSettings =
+ *     SqlInstancesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlInstancesServiceClient sqlInstancesServiceClient =
+ *     SqlInstancesServiceClient.create(sqlInstancesServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlInstancesServiceSettings sqlInstancesServiceSettings =
+ *     SqlInstancesServiceSettings.newHttpJsonBuilder().build();
+ * SqlInstancesServiceClient sqlInstancesServiceClient =
+ *     SqlInstancesServiceClient.create(sqlInstancesServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlInstancesServiceClient implements BackgroundResource { + private final @Nullable SqlInstancesServiceSettings settings; + private final SqlInstancesServiceStub stub; + + /** Constructs an instance of SqlInstancesServiceClient with default settings. */ + public static final SqlInstancesServiceClient create() throws IOException { + return create(SqlInstancesServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlInstancesServiceClient, 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 SqlInstancesServiceClient create(SqlInstancesServiceSettings settings) + throws IOException { + return new SqlInstancesServiceClient(settings); + } + + /** + * Constructs an instance of SqlInstancesServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(SqlInstancesServiceSettings). + */ + public static final SqlInstancesServiceClient create(SqlInstancesServiceStub stub) { + return new SqlInstancesServiceClient(stub); + } + + /** + * Constructs an instance of SqlInstancesServiceClient, 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 SqlInstancesServiceClient(SqlInstancesServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlInstancesServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlInstancesServiceClient(SqlInstancesServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlInstancesServiceSettings getSettings() { + return settings; + } + + public SqlInstancesServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Add a new trusted Certificate Authority (CA) version for the specified instance. Required to + * prepare for a certificate rotation. If a CA version was previously added but never used in a + * certificate rotation, this operation replaces that version. There cannot be more than one CA + * version waiting to be rotated in. For instances that have enabled Certificate Authority Service + * (CAS) based server CA, use AddServerCertificate to add a new server certificate. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAddServerCaRequest request =
+   *       SqlInstancesAddServerCaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.addServerCa(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 Operation addServerCa(SqlInstancesAddServerCaRequest request) { + return addServerCaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Add a new trusted Certificate Authority (CA) version for the specified instance. Required to + * prepare for a certificate rotation. If a CA version was previously added but never used in a + * certificate rotation, this operation replaces that version. There cannot be more than one CA + * version waiting to be rotated in. For instances that have enabled Certificate Authority Service + * (CAS) based server CA, use AddServerCertificate to add a new server certificate. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAddServerCaRequest request =
+   *       SqlInstancesAddServerCaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.addServerCaCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable addServerCaCallable() { + return stub.addServerCaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Add a new trusted server certificate version for the specified instance using Certificate + * Authority Service (CAS) server CA. Required to prepare for a certificate rotation. If a server + * certificate version was previously added but never used in a certificate rotation, this + * operation replaces that version. There cannot be more than one certificate version waiting to + * be rotated in. For instances not using CAS server CA, use AddServerCa instead. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAddServerCertificateRequest request =
+   *       SqlInstancesAddServerCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.addServerCertificate(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 Operation addServerCertificate(SqlInstancesAddServerCertificateRequest request) { + return addServerCertificateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Add a new trusted server certificate version for the specified instance using Certificate + * Authority Service (CAS) server CA. Required to prepare for a certificate rotation. If a server + * certificate version was previously added but never used in a certificate rotation, this + * operation replaces that version. There cannot be more than one certificate version waiting to + * be rotated in. For instances not using CAS server CA, use AddServerCa instead. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAddServerCertificateRequest request =
+   *       SqlInstancesAddServerCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.addServerCertificateCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + addServerCertificateCallable() { + return stub.addServerCertificateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds a new Entra ID certificate for the specified instance. If an Entra ID certificate was + * previously added but never used in a certificate rotation, this operation replaces that + * version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAddEntraIdCertificateRequest request =
+   *       SqlInstancesAddEntraIdCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.addEntraIdCertificate(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 Operation addEntraIdCertificate(SqlInstancesAddEntraIdCertificateRequest request) { + return addEntraIdCertificateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds a new Entra ID certificate for the specified instance. If an Entra ID certificate was + * previously added but never used in a certificate rotation, this operation replaces that + * version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAddEntraIdCertificateRequest request =
+   *       SqlInstancesAddEntraIdCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.addEntraIdCertificateCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + addEntraIdCertificateCallable() { + return stub.addEntraIdCertificateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Cloud SQL instance as a clone of the source instance. Using this operation might + * cause your instance to restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesCloneRequest request =
+   *       SqlInstancesCloneRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesCloneRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.clone(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 Operation clone(SqlInstancesCloneRequest request) { + return cloneCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Cloud SQL instance as a clone of the source instance. Using this operation might + * cause your instance to restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesCloneRequest request =
+   *       SqlInstancesCloneRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesCloneRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.cloneCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable cloneCallable() { + return stub.cloneCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesDeleteRequest request =
+   *       SqlInstancesDeleteRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setEnableFinalBackup(true)
+   *           .setFinalBackupDescription("finalBackupDescription-293551612")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.delete(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 Operation delete(SqlInstancesDeleteRequest request) { + return deleteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesDeleteRequest request =
+   *       SqlInstancesDeleteRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setEnableFinalBackup(true)
+   *           .setFinalBackupDescription("finalBackupDescription-293551612")
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.deleteCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCallable() { + return stub.deleteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Demotes the stand-alone instance to be a Cloud SQL read replica for an external database + * server. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesDemoteMasterRequest request =
+   *       SqlInstancesDemoteMasterRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesDemoteMasterRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.demoteMaster(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 Operation demoteMaster(SqlInstancesDemoteMasterRequest request) { + return demoteMasterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Demotes the stand-alone instance to be a Cloud SQL read replica for an external database + * server. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesDemoteMasterRequest request =
+   *       SqlInstancesDemoteMasterRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesDemoteMasterRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.demoteMasterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable demoteMasterCallable() { + return stub.demoteMasterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Demotes an existing standalone instance to be a Cloud SQL read replica for an external database + * server. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesDemoteRequest request =
+   *       SqlInstancesDemoteRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesDemoteRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.demote(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 Operation demote(SqlInstancesDemoteRequest request) { + return demoteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Demotes an existing standalone instance to be a Cloud SQL read replica for an external database + * server. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesDemoteRequest request =
+   *       SqlInstancesDemoteRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesDemoteRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.demoteCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable demoteCallable() { + return stub.demoteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesExportRequest request =
+   *       SqlInstancesExportRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesExportRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.export(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 Operation export(SqlInstancesExportRequest request) { + return exportCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesExportRequest request =
+   *       SqlInstancesExportRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesExportRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.exportCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable exportCallable() { + return stub.exportCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Initiates a manual failover of a high availability (HA) primary instance to a standby instance, + * which becomes the primary instance. Users are then rerouted to the new primary. For more + * information, see the [Overview of high + * availability](https://cloud.google.com/sql/docs/mysql/high-availability) page in the Cloud SQL + * documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its + * failover replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesFailoverRequest request =
+   *       SqlInstancesFailoverRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesFailoverRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.failover(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 Operation failover(SqlInstancesFailoverRequest request) { + return failoverCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Initiates a manual failover of a high availability (HA) primary instance to a standby instance, + * which becomes the primary instance. Users are then rerouted to the new primary. For more + * information, see the [Overview of high + * availability](https://cloud.google.com/sql/docs/mysql/high-availability) page in the Cloud SQL + * documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its + * failover replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesFailoverRequest request =
+   *       SqlInstancesFailoverRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesFailoverRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.failoverCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable failoverCallable() { + return stub.failoverCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reencrypt CMEK instance with latest key version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesReencryptRequest request =
+   *       SqlInstancesReencryptRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesReencryptRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.reencrypt(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 Operation reencrypt(SqlInstancesReencryptRequest request) { + return reencryptCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reencrypt CMEK instance with latest key version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesReencryptRequest request =
+   *       SqlInstancesReencryptRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesReencryptRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.reencryptCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable reencryptCallable() { + return stub.reencryptCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesGetRequest request =
+   *       SqlInstancesGetRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   DatabaseInstance response = sqlInstancesServiceClient.get(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 DatabaseInstance get(SqlInstancesGetRequest request) { + return getCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesGetRequest request =
+   *       SqlInstancesGetRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.getCallable().futureCall(request);
+   *   // Do something.
+   *   DatabaseInstance response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCallable() { + return stub.getCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesImportRequest request =
+   *       SqlInstancesImportRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesImportRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.import_(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 Operation import_(SqlInstancesImportRequest request) { + return import_Callable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesImportRequest request =
+   *       SqlInstancesImportRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesImportRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.importCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable import_Callable() { + return stub.import_Callable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesInsertRequest request =
+   *       SqlInstancesInsertRequest.newBuilder()
+   *           .setProject("project-309310695")
+   *           .setBody(DatabaseInstance.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.insert(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 Operation insert(SqlInstancesInsertRequest request) { + return insertCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesInsertRequest request =
+   *       SqlInstancesInsertRequest.newBuilder()
+   *           .setProject("project-309310695")
+   *           .setBody(DatabaseInstance.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.insertCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable insertCallable() { + return stub.insertCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists instances under a given project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListRequest request =
+   *       SqlInstancesListRequest.newBuilder()
+   *           .setFilter("filter-1274492040")
+   *           .setMaxResults(1128457243)
+   *           .setPageToken("pageToken873572522")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   InstancesListResponse response = sqlInstancesServiceClient.list(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 InstancesListResponse list(SqlInstancesListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists instances under a given project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListRequest request =
+   *       SqlInstancesListRequest.newBuilder()
+   *           .setFilter("filter-1274492040")
+   *           .setMaxResults(1128457243)
+   *           .setPageToken("pageToken873572522")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   InstancesListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be + * up to three CAs listed: the CA that was used to sign the certificate that is currently in use, + * a CA that has been added but not yet used to sign a certificate, and a CA used to sign a + * certificate that has previously rotated out. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListServerCasRequest request =
+   *       SqlInstancesListServerCasRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   InstancesListServerCasResponse response = sqlInstancesServiceClient.listServerCas(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 InstancesListServerCasResponse listServerCas( + SqlInstancesListServerCasRequest request) { + return listServerCasCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be + * up to three CAs listed: the CA that was used to sign the certificate that is currently in use, + * a CA that has been added but not yet used to sign a certificate, and a CA used to sign a + * certificate that has previously rotated out. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListServerCasRequest request =
+   *       SqlInstancesListServerCasRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.listServerCasCallable().futureCall(request);
+   *   // Do something.
+   *   InstancesListServerCasResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + listServerCasCallable() { + return stub.listServerCasCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of server certificates and certificate authorities (CAs) for the specified + * instance. There can be up to three sets of certs listed: the certificate that is currently in + * use, a future that has been added but not yet used to sign a certificate, and a certificate + * that has been rotated out. For instances not using Certificate Authority Service (CAS) server + * CA, use ListServerCas instead. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListServerCertificatesRequest request =
+   *       SqlInstancesListServerCertificatesRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   InstancesListServerCertificatesResponse response =
+   *       sqlInstancesServiceClient.listServerCertificates(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 InstancesListServerCertificatesResponse listServerCertificates( + SqlInstancesListServerCertificatesRequest request) { + return listServerCertificatesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of server certificates and certificate authorities (CAs) for the specified + * instance. There can be up to three sets of certs listed: the certificate that is currently in + * use, a future that has been added but not yet used to sign a certificate, and a certificate + * that has been rotated out. For instances not using Certificate Authority Service (CAS) server + * CA, use ListServerCas instead. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListServerCertificatesRequest request =
+   *       SqlInstancesListServerCertificatesRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.listServerCertificatesCallable().futureCall(request);
+   *   // Do something.
+   *   InstancesListServerCertificatesResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesCallable() { + return stub.listServerCertificatesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of EntraID certificates for the specified instance. There can be up to three + * sets of certificates listed: the certificate that is currently in use, a future that has been + * added but not yet used to sign a certificate, and a certificate that has been rotated out. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListEntraIdCertificatesRequest request =
+   *       SqlInstancesListEntraIdCertificatesRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   InstancesListEntraIdCertificatesResponse response =
+   *       sqlInstancesServiceClient.listEntraIdCertificates(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 InstancesListEntraIdCertificatesResponse listEntraIdCertificates( + SqlInstancesListEntraIdCertificatesRequest request) { + return listEntraIdCertificatesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all versions of EntraID certificates for the specified instance. There can be up to three + * sets of certificates listed: the certificate that is currently in use, a future that has been + * added but not yet used to sign a certificate, and a certificate that has been rotated out. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesListEntraIdCertificatesRequest request =
+   *       SqlInstancesListEntraIdCertificatesRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.listEntraIdCertificatesCallable().futureCall(request);
+   *   // Do something.
+   *   InstancesListEntraIdCertificatesResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesCallable() { + return stub.listEntraIdCertificatesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates settings of a Cloud SQL instance by merging the request with the current + * configuration. This method supports patch semantics. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPatchRequest request =
+   *       SqlInstancesPatchRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setReconcilePscNetworking(true)
+   *           .setReconcilePscNetworkingForce(true)
+   *           .setBody(DatabaseInstance.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.patch(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 Operation patch(SqlInstancesPatchRequest request) { + return patchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates settings of a Cloud SQL instance by merging the request with the current + * configuration. This method supports patch semantics. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPatchRequest request =
+   *       SqlInstancesPatchRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setReconcilePscNetworking(true)
+   *           .setReconcilePscNetworkingForce(true)
+   *           .setBody(DatabaseInstance.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.patchCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable patchCallable() { + return stub.patchCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Promotes the read replica instance to be an independent Cloud SQL primary instance. Using this + * operation might cause your instance to restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPromoteReplicaRequest request =
+   *       SqlInstancesPromoteReplicaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setFailover(true)
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.promoteReplica(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 Operation promoteReplica(SqlInstancesPromoteReplicaRequest request) { + return promoteReplicaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Promotes the read replica instance to be an independent Cloud SQL primary instance. Using this + * operation might cause your instance to restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPromoteReplicaRequest request =
+   *       SqlInstancesPromoteReplicaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setFailover(true)
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.promoteReplicaCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + promoteReplicaCallable() { + return stub.promoteReplicaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Switches over from the primary instance to the DR replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesSwitchoverRequest request =
+   *       SqlInstancesSwitchoverRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setDbTimeout(Duration.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.switchover(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 Operation switchover(SqlInstancesSwitchoverRequest request) { + return switchoverCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Switches over from the primary instance to the DR replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesSwitchoverRequest request =
+   *       SqlInstancesSwitchoverRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setDbTimeout(Duration.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.switchoverCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable switchoverCallable() { + return stub.switchoverCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes all client certificates and generates a new server SSL certificate for the 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesResetSslConfigRequest request =
+   *       SqlInstancesResetSslConfigRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.resetSslConfig(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 Operation resetSslConfig(SqlInstancesResetSslConfigRequest request) { + return resetSslConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes all client certificates and generates a new server SSL certificate for the 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesResetSslConfigRequest request =
+   *       SqlInstancesResetSslConfigRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.resetSslConfigCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + resetSslConfigCallable() { + return stub.resetSslConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restarts a Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRestartRequest request =
+   *       SqlInstancesRestartRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.restart(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 Operation restart(SqlInstancesRestartRequest request) { + return restartCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restarts a Cloud SQL 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRestartRequest request =
+   *       SqlInstancesRestartRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.restartCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restartCallable() { + return stub.restartCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to + * restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRestoreBackupRequest request =
+   *       SqlInstancesRestoreBackupRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRestoreBackupRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.restoreBackup(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 Operation restoreBackup(SqlInstancesRestoreBackupRequest request) { + return restoreBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to + * restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRestoreBackupRequest request =
+   *       SqlInstancesRestoreBackupRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRestoreBackupRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.restoreBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restoreBackupCallable() { + return stub.restoreBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Rotates the server certificate to one signed by the Certificate Authority (CA) version + * previously added with the addServerCA method. For instances that have enabled Certificate + * Authority Service (CAS) based server CA, use RotateServerCertificate to rotate the server + * certificate. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRotateServerCaRequest request =
+   *       SqlInstancesRotateServerCaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRotateServerCaRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.rotateServerCa(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 Operation rotateServerCa(SqlInstancesRotateServerCaRequest request) { + return rotateServerCaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Rotates the server certificate to one signed by the Certificate Authority (CA) version + * previously added with the addServerCA method. For instances that have enabled Certificate + * Authority Service (CAS) based server CA, use RotateServerCertificate to rotate the server + * certificate. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRotateServerCaRequest request =
+   *       SqlInstancesRotateServerCaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRotateServerCaRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.rotateServerCaCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + rotateServerCaCallable() { + return stub.rotateServerCaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Rotates the server certificate version to one previously added with the addServerCertificate + * method. For instances not using Certificate Authority Service (CAS) server CA, use + * RotateServerCa instead. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRotateServerCertificateRequest request =
+   *       SqlInstancesRotateServerCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRotateServerCertificateRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.rotateServerCertificate(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 Operation rotateServerCertificate( + SqlInstancesRotateServerCertificateRequest request) { + return rotateServerCertificateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Rotates the server certificate version to one previously added with the addServerCertificate + * method. For instances not using Certificate Authority Service (CAS) server CA, use + * RotateServerCa instead. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRotateServerCertificateRequest request =
+   *       SqlInstancesRotateServerCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRotateServerCertificateRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.rotateServerCertificateCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + rotateServerCertificateCallable() { + return stub.rotateServerCertificateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Rotates the Entra Id certificate version to one previously added with the addEntraIdCertificate + * method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRotateEntraIdCertificateRequest request =
+   *       SqlInstancesRotateEntraIdCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.rotateEntraIdCertificate(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 Operation rotateEntraIdCertificate( + SqlInstancesRotateEntraIdCertificateRequest request) { + return rotateEntraIdCertificateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Rotates the Entra Id certificate version to one previously added with the addEntraIdCertificate + * method. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRotateEntraIdCertificateRequest request =
+   *       SqlInstancesRotateEntraIdCertificateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.rotateEntraIdCertificateCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + rotateEntraIdCertificateCallable() { + return stub.rotateEntraIdCertificateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts the replication in the read replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesStartReplicaRequest request =
+   *       SqlInstancesStartReplicaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.startReplica(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 Operation startReplica(SqlInstancesStartReplicaRequest request) { + return startReplicaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts the replication in the read replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesStartReplicaRequest request =
+   *       SqlInstancesStartReplicaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.startReplicaCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable startReplicaCallable() { + return stub.startReplicaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops the replication in the read replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesStopReplicaRequest request =
+   *       SqlInstancesStopReplicaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.stopReplica(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 Operation stopReplica(SqlInstancesStopReplicaRequest request) { + return stopReplicaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops the replication in the read replica 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesStopReplicaRequest request =
+   *       SqlInstancesStopReplicaRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.stopReplicaCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable stopReplicaCallable() { + return stub.stopReplicaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Truncate MySQL general and slow query log tables MySQL only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesTruncateLogRequest request =
+   *       SqlInstancesTruncateLogRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesTruncateLogRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.truncateLog(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 Operation truncateLog(SqlInstancesTruncateLogRequest request) { + return truncateLogCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Truncate MySQL general and slow query log tables MySQL only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesTruncateLogRequest request =
+   *       SqlInstancesTruncateLogRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesTruncateLogRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.truncateLogCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable truncateLogCallable() { + return stub.truncateLogCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates settings of a Cloud SQL instance. Using this operation might cause your instance to + * restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesUpdateRequest request =
+   *       SqlInstancesUpdateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(DatabaseInstance.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.update(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 Operation update(SqlInstancesUpdateRequest request) { + return updateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates settings of a Cloud SQL instance. Using this operation might cause your instance to + * restart. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesUpdateRequest request =
+   *       SqlInstancesUpdateRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(DatabaseInstance.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlInstancesServiceClient.updateCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateCallable() { + return stub.updateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generates a short-lived X509 certificate containing the provided public key and signed by a + * private key specific to the target instance. Users may use the certificate to authenticate as + * themselves when connecting to the database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesCreateEphemeralCertRequest request =
+   *       SqlInstancesCreateEphemeralCertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(SslCertsCreateEphemeralRequest.newBuilder().build())
+   *           .build();
+   *   SslCert response = sqlInstancesServiceClient.createEphemeral(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 SslCert createEphemeral(SqlInstancesCreateEphemeralCertRequest request) { + return createEphemeralCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generates a short-lived X509 certificate containing the provided public key and signed by a + * private key specific to the target instance. Users may use the certificate to authenticate as + * themselves when connecting to the database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesCreateEphemeralCertRequest request =
+   *       SqlInstancesCreateEphemeralCertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(SslCertsCreateEphemeralRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.createEphemeralCallable().futureCall(request);
+   *   // Do something.
+   *   SslCert response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createEphemeralCallable() { + return stub.createEphemeralCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reschedules the maintenance on the given 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRescheduleMaintenanceRequest request =
+   *       SqlInstancesRescheduleMaintenanceRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.rescheduleMaintenance(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 Operation rescheduleMaintenance(SqlInstancesRescheduleMaintenanceRequest request) { + return rescheduleMaintenanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reschedules the maintenance on the given 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesRescheduleMaintenanceRequest request =
+   *       SqlInstancesRescheduleMaintenanceRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.rescheduleMaintenanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + rescheduleMaintenanceCallable() { + return stub.rescheduleMaintenanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Verify External primary instance external sync settings. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesVerifyExternalSyncSettingsRequest request =
+   *       SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setVerifyConnectionOnly(true)
+   *           .setVerifyReplicationOnly(true)
+   *           .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0))
+   *           .addAllSelectedObjects(new ArrayList())
+   *           .build();
+   *   SqlInstancesVerifyExternalSyncSettingsResponse response =
+   *       sqlInstancesServiceClient.verifyExternalSyncSettings(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 SqlInstancesVerifyExternalSyncSettingsResponse verifyExternalSyncSettings( + SqlInstancesVerifyExternalSyncSettingsRequest request) { + return verifyExternalSyncSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Verify External primary instance external sync settings. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesVerifyExternalSyncSettingsRequest request =
+   *       SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setVerifyConnectionOnly(true)
+   *           .setVerifyReplicationOnly(true)
+   *           .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0))
+   *           .addAllSelectedObjects(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.verifyExternalSyncSettingsCallable().futureCall(request);
+   *   // Do something.
+   *   SqlInstancesVerifyExternalSyncSettingsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsCallable() { + return stub.verifyExternalSyncSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Start External primary instance migration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesStartExternalSyncRequest request =
+   *       SqlInstancesStartExternalSyncRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSkipVerification(true)
+   *           .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0))
+   *           .setReplicaOverwriteEnabled(true)
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.startExternalSync(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 Operation startExternalSync(SqlInstancesStartExternalSyncRequest request) { + return startExternalSyncCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Start External primary instance migration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesStartExternalSyncRequest request =
+   *       SqlInstancesStartExternalSyncRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSkipVerification(true)
+   *           .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0))
+   *           .setReplicaOverwriteEnabled(true)
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.startExternalSyncCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + startExternalSyncCallable() { + return stub.startExternalSyncCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform Disk Shrink on primary 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPerformDiskShrinkRequest request =
+   *       SqlInstancesPerformDiskShrinkRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(PerformDiskShrinkContext.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.performDiskShrink(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 Operation performDiskShrink(SqlInstancesPerformDiskShrinkRequest request) { + return performDiskShrinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform Disk Shrink on primary 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPerformDiskShrinkRequest request =
+   *       SqlInstancesPerformDiskShrinkRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(PerformDiskShrinkContext.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.performDiskShrinkCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + performDiskShrinkCallable() { + return stub.performDiskShrinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get Disk Shrink Config for a given 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesGetDiskShrinkConfigRequest request =
+   *       SqlInstancesGetDiskShrinkConfigRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   SqlInstancesGetDiskShrinkConfigResponse response =
+   *       sqlInstancesServiceClient.getDiskShrinkConfig(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 SqlInstancesGetDiskShrinkConfigResponse getDiskShrinkConfig( + SqlInstancesGetDiskShrinkConfigRequest request) { + return getDiskShrinkConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get Disk Shrink Config for a given 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesGetDiskShrinkConfigRequest request =
+   *       SqlInstancesGetDiskShrinkConfigRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.getDiskShrinkConfigCallable().futureCall(request);
+   *   // Do something.
+   *   SqlInstancesGetDiskShrinkConfigResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigCallable() { + return stub.getDiskShrinkConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reset Replica Size to primary instance disk size. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesResetReplicaSizeRequest request =
+   *       SqlInstancesResetReplicaSizeRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.resetReplicaSize(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 Operation resetReplicaSize(SqlInstancesResetReplicaSizeRequest request) { + return resetReplicaSizeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reset Replica Size to primary instance disk size. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesResetReplicaSizeRequest request =
+   *       SqlInstancesResetReplicaSizeRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.resetReplicaSizeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + resetReplicaSizeCallable() { + return stub.resetReplicaSizeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get Latest Recovery Time for a given 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesGetLatestRecoveryTimeRequest request =
+   *       SqlInstancesGetLatestRecoveryTimeRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSourceInstanceDeletionTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   SqlInstancesGetLatestRecoveryTimeResponse response =
+   *       sqlInstancesServiceClient.getLatestRecoveryTime(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 SqlInstancesGetLatestRecoveryTimeResponse getLatestRecoveryTime( + SqlInstancesGetLatestRecoveryTimeRequest request) { + return getLatestRecoveryTimeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get Latest Recovery Time for a given 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 (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesGetLatestRecoveryTimeRequest request =
+   *       SqlInstancesGetLatestRecoveryTimeRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSourceInstanceDeletionTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.getLatestRecoveryTimeCallable().futureCall(request);
+   *   // Do something.
+   *   SqlInstancesGetLatestRecoveryTimeResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeCallable() { + return stub.getLatestRecoveryTimeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Execute SQL statements. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesExecuteSqlRequest request =
+   *       SqlInstancesExecuteSqlRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(ExecuteSqlPayload.newBuilder().build())
+   *           .build();
+   *   SqlInstancesExecuteSqlResponse response = sqlInstancesServiceClient.executeSql(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 SqlInstancesExecuteSqlResponse executeSql(SqlInstancesExecuteSqlRequest request) { + return executeSqlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Execute SQL statements. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesExecuteSqlRequest request =
+   *       SqlInstancesExecuteSqlRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(ExecuteSqlPayload.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.executeSqlCallable().futureCall(request);
+   *   // Do something.
+   *   SqlInstancesExecuteSqlResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + executeSqlCallable() { + return stub.executeSqlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Acquire a lease for the setup of SQL Server Reporting Services (SSRS). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAcquireSsrsLeaseRequest request =
+   *       SqlInstancesAcquireSsrsLeaseRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build())
+   *           .build();
+   *   SqlInstancesAcquireSsrsLeaseResponse response =
+   *       sqlInstancesServiceClient.acquireSsrsLease(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 SqlInstancesAcquireSsrsLeaseResponse acquireSsrsLease( + SqlInstancesAcquireSsrsLeaseRequest request) { + return acquireSsrsLeaseCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Acquire a lease for the setup of SQL Server Reporting Services (SSRS). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesAcquireSsrsLeaseRequest request =
+   *       SqlInstancesAcquireSsrsLeaseRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.acquireSsrsLeaseCallable().futureCall(request);
+   *   // Do something.
+   *   SqlInstancesAcquireSsrsLeaseResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseCallable() { + return stub.acquireSsrsLeaseCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Release a lease for the setup of SQL Server Reporting Services (SSRS). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesReleaseSsrsLeaseRequest request =
+   *       SqlInstancesReleaseSsrsLeaseRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   SqlInstancesReleaseSsrsLeaseResponse response =
+   *       sqlInstancesServiceClient.releaseSsrsLease(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 SqlInstancesReleaseSsrsLeaseResponse releaseSsrsLease( + SqlInstancesReleaseSsrsLeaseRequest request) { + return releaseSsrsLeaseCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Release a lease for the setup of SQL Server Reporting Services (SSRS). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesReleaseSsrsLeaseRequest request =
+   *       SqlInstancesReleaseSsrsLeaseRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.releaseSsrsLeaseCallable().futureCall(request);
+   *   // Do something.
+   *   SqlInstancesReleaseSsrsLeaseResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseCallable() { + return stub.releaseSsrsLeaseCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Execute MVU Pre-checks + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPreCheckMajorVersionUpgradeRequest request =
+   *       SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.preCheckMajorVersionUpgrade(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 Operation preCheckMajorVersionUpgrade( + SqlInstancesPreCheckMajorVersionUpgradeRequest request) { + return preCheckMajorVersionUpgradeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Execute MVU Pre-checks + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPreCheckMajorVersionUpgradeRequest request =
+   *       SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.preCheckMajorVersionUpgradeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + preCheckMajorVersionUpgradeCallable() { + return stub.preCheckMajorVersionUpgradeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Point in time restore for an instance managed by Google Cloud Backup and Disaster Recovery. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPointInTimeRestoreRequest request =
+   *       SqlInstancesPointInTimeRestoreRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setContext(PointInTimeRestoreContext.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlInstancesServiceClient.pointInTimeRestore(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 Operation pointInTimeRestore(SqlInstancesPointInTimeRestoreRequest request) { + return pointInTimeRestoreCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Point in time restore for an instance managed by Google Cloud Backup and Disaster Recovery. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+   *   SqlInstancesPointInTimeRestoreRequest request =
+   *       SqlInstancesPointInTimeRestoreRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setContext(PointInTimeRestoreContext.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlInstancesServiceClient.pointInTimeRestoreCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + pointInTimeRestoreCallable() { + return stub.pointInTimeRestoreCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceSettings.java new file mode 100644 index 000000000000..33e0f4b1c034 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceSettings.java @@ -0,0 +1,710 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1beta4.stub.SqlInstancesServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlInstancesServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 addServerCa: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlInstancesServiceSettings.Builder sqlInstancesServiceSettingsBuilder =
+ *     SqlInstancesServiceSettings.newBuilder();
+ * sqlInstancesServiceSettingsBuilder
+ *     .addServerCaSettings()
+ *     .setRetrySettings(
+ *         sqlInstancesServiceSettingsBuilder
+ *             .addServerCaSettings()
+ *             .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());
+ * SqlInstancesServiceSettings sqlInstancesServiceSettings =
+ *     sqlInstancesServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlInstancesServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to addServerCa. */ + public UnaryCallSettings addServerCaSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).addServerCaSettings(); + } + + /** Returns the object with the settings used for calls to addServerCertificate. */ + public UnaryCallSettings + addServerCertificateSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).addServerCertificateSettings(); + } + + /** Returns the object with the settings used for calls to addEntraIdCertificate. */ + public UnaryCallSettings + addEntraIdCertificateSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).addEntraIdCertificateSettings(); + } + + /** Returns the object with the settings used for calls to clone. */ + public UnaryCallSettings cloneSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).cloneSettings(); + } + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).deleteSettings(); + } + + /** Returns the object with the settings used for calls to demoteMaster. */ + public UnaryCallSettings demoteMasterSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).demoteMasterSettings(); + } + + /** Returns the object with the settings used for calls to demote. */ + public UnaryCallSettings demoteSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).demoteSettings(); + } + + /** Returns the object with the settings used for calls to export. */ + public UnaryCallSettings exportSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).exportSettings(); + } + + /** Returns the object with the settings used for calls to failover. */ + public UnaryCallSettings failoverSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).failoverSettings(); + } + + /** Returns the object with the settings used for calls to reencrypt. */ + public UnaryCallSettings reencryptSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).reencryptSettings(); + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).getSettings(); + } + + /** Returns the object with the settings used for calls to import_. */ + public UnaryCallSettings import_Settings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).import_Settings(); + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).insertSettings(); + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).listSettings(); + } + + /** Returns the object with the settings used for calls to listServerCas. */ + public UnaryCallSettings + listServerCasSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).listServerCasSettings(); + } + + /** Returns the object with the settings used for calls to listServerCertificates. */ + public UnaryCallSettings< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).listServerCertificatesSettings(); + } + + /** Returns the object with the settings used for calls to listEntraIdCertificates. */ + public UnaryCallSettings< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).listEntraIdCertificatesSettings(); + } + + /** Returns the object with the settings used for calls to patch. */ + public UnaryCallSettings patchSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).patchSettings(); + } + + /** Returns the object with the settings used for calls to promoteReplica. */ + public UnaryCallSettings promoteReplicaSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).promoteReplicaSettings(); + } + + /** Returns the object with the settings used for calls to switchover. */ + public UnaryCallSettings switchoverSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).switchoverSettings(); + } + + /** Returns the object with the settings used for calls to resetSslConfig. */ + public UnaryCallSettings resetSslConfigSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).resetSslConfigSettings(); + } + + /** Returns the object with the settings used for calls to restart. */ + public UnaryCallSettings restartSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).restartSettings(); + } + + /** Returns the object with the settings used for calls to restoreBackup. */ + public UnaryCallSettings restoreBackupSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).restoreBackupSettings(); + } + + /** Returns the object with the settings used for calls to rotateServerCa. */ + public UnaryCallSettings rotateServerCaSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).rotateServerCaSettings(); + } + + /** Returns the object with the settings used for calls to rotateServerCertificate. */ + public UnaryCallSettings + rotateServerCertificateSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).rotateServerCertificateSettings(); + } + + /** Returns the object with the settings used for calls to rotateEntraIdCertificate. */ + public UnaryCallSettings + rotateEntraIdCertificateSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).rotateEntraIdCertificateSettings(); + } + + /** Returns the object with the settings used for calls to startReplica. */ + public UnaryCallSettings startReplicaSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).startReplicaSettings(); + } + + /** Returns the object with the settings used for calls to stopReplica. */ + public UnaryCallSettings stopReplicaSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).stopReplicaSettings(); + } + + /** Returns the object with the settings used for calls to truncateLog. */ + public UnaryCallSettings truncateLogSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).truncateLogSettings(); + } + + /** Returns the object with the settings used for calls to update. */ + public UnaryCallSettings updateSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).updateSettings(); + } + + /** Returns the object with the settings used for calls to createEphemeral. */ + public UnaryCallSettings + createEphemeralSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).createEphemeralSettings(); + } + + /** Returns the object with the settings used for calls to rescheduleMaintenance. */ + public UnaryCallSettings + rescheduleMaintenanceSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).rescheduleMaintenanceSettings(); + } + + /** Returns the object with the settings used for calls to verifyExternalSyncSettings. */ + public UnaryCallSettings< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()) + .verifyExternalSyncSettingsSettings(); + } + + /** Returns the object with the settings used for calls to startExternalSync. */ + public UnaryCallSettings + startExternalSyncSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).startExternalSyncSettings(); + } + + /** Returns the object with the settings used for calls to performDiskShrink. */ + public UnaryCallSettings + performDiskShrinkSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).performDiskShrinkSettings(); + } + + /** Returns the object with the settings used for calls to getDiskShrinkConfig. */ + public UnaryCallSettings< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).getDiskShrinkConfigSettings(); + } + + /** Returns the object with the settings used for calls to resetReplicaSize. */ + public UnaryCallSettings + resetReplicaSizeSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).resetReplicaSizeSettings(); + } + + /** Returns the object with the settings used for calls to getLatestRecoveryTime. */ + public UnaryCallSettings< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).getLatestRecoveryTimeSettings(); + } + + /** Returns the object with the settings used for calls to executeSql. */ + public UnaryCallSettings + executeSqlSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).executeSqlSettings(); + } + + /** Returns the object with the settings used for calls to acquireSsrsLease. */ + public UnaryCallSettings< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).acquireSsrsLeaseSettings(); + } + + /** Returns the object with the settings used for calls to releaseSsrsLease. */ + public UnaryCallSettings< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).releaseSsrsLeaseSettings(); + } + + /** Returns the object with the settings used for calls to preCheckMajorVersionUpgrade. */ + public UnaryCallSettings + preCheckMajorVersionUpgradeSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()) + .preCheckMajorVersionUpgradeSettings(); + } + + /** Returns the object with the settings used for calls to pointInTimeRestore. */ + public UnaryCallSettings + pointInTimeRestoreSettings() { + return ((SqlInstancesServiceStubSettings) getStubSettings()).pointInTimeRestoreSettings(); + } + + public static final SqlInstancesServiceSettings create(SqlInstancesServiceStubSettings stub) + throws IOException { + return new SqlInstancesServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlInstancesServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlInstancesServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlInstancesServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlInstancesServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlInstancesServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlInstancesServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlInstancesServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlInstancesServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlInstancesServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlInstancesServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlInstancesServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlInstancesServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlInstancesServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlInstancesServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlInstancesServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlInstancesServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlInstancesServiceStubSettings.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 addServerCa. */ + public UnaryCallSettings.Builder + addServerCaSettings() { + return getStubSettingsBuilder().addServerCaSettings(); + } + + /** Returns the builder for the settings used for calls to addServerCertificate. */ + public UnaryCallSettings.Builder + addServerCertificateSettings() { + return getStubSettingsBuilder().addServerCertificateSettings(); + } + + /** Returns the builder for the settings used for calls to addEntraIdCertificate. */ + public UnaryCallSettings.Builder + addEntraIdCertificateSettings() { + return getStubSettingsBuilder().addEntraIdCertificateSettings(); + } + + /** Returns the builder for the settings used for calls to clone. */ + public UnaryCallSettings.Builder cloneSettings() { + return getStubSettingsBuilder().cloneSettings(); + } + + /** Returns the builder for the settings used for calls to delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return getStubSettingsBuilder().deleteSettings(); + } + + /** Returns the builder for the settings used for calls to demoteMaster. */ + public UnaryCallSettings.Builder + demoteMasterSettings() { + return getStubSettingsBuilder().demoteMasterSettings(); + } + + /** Returns the builder for the settings used for calls to demote. */ + public UnaryCallSettings.Builder demoteSettings() { + return getStubSettingsBuilder().demoteSettings(); + } + + /** Returns the builder for the settings used for calls to export. */ + public UnaryCallSettings.Builder exportSettings() { + return getStubSettingsBuilder().exportSettings(); + } + + /** Returns the builder for the settings used for calls to failover. */ + public UnaryCallSettings.Builder failoverSettings() { + return getStubSettingsBuilder().failoverSettings(); + } + + /** Returns the builder for the settings used for calls to reencrypt. */ + public UnaryCallSettings.Builder reencryptSettings() { + return getStubSettingsBuilder().reencryptSettings(); + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getStubSettingsBuilder().getSettings(); + } + + /** Returns the builder for the settings used for calls to import_. */ + public UnaryCallSettings.Builder import_Settings() { + return getStubSettingsBuilder().import_Settings(); + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return getStubSettingsBuilder().insertSettings(); + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + /** Returns the builder for the settings used for calls to listServerCas. */ + public UnaryCallSettings.Builder< + SqlInstancesListServerCasRequest, InstancesListServerCasResponse> + listServerCasSettings() { + return getStubSettingsBuilder().listServerCasSettings(); + } + + /** Returns the builder for the settings used for calls to listServerCertificates. */ + public UnaryCallSettings.Builder< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesSettings() { + return getStubSettingsBuilder().listServerCertificatesSettings(); + } + + /** Returns the builder for the settings used for calls to listEntraIdCertificates. */ + public UnaryCallSettings.Builder< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesSettings() { + return getStubSettingsBuilder().listEntraIdCertificatesSettings(); + } + + /** Returns the builder for the settings used for calls to patch. */ + public UnaryCallSettings.Builder patchSettings() { + return getStubSettingsBuilder().patchSettings(); + } + + /** Returns the builder for the settings used for calls to promoteReplica. */ + public UnaryCallSettings.Builder + promoteReplicaSettings() { + return getStubSettingsBuilder().promoteReplicaSettings(); + } + + /** Returns the builder for the settings used for calls to switchover. */ + public UnaryCallSettings.Builder + switchoverSettings() { + return getStubSettingsBuilder().switchoverSettings(); + } + + /** Returns the builder for the settings used for calls to resetSslConfig. */ + public UnaryCallSettings.Builder + resetSslConfigSettings() { + return getStubSettingsBuilder().resetSslConfigSettings(); + } + + /** Returns the builder for the settings used for calls to restart. */ + public UnaryCallSettings.Builder restartSettings() { + return getStubSettingsBuilder().restartSettings(); + } + + /** Returns the builder for the settings used for calls to restoreBackup. */ + public UnaryCallSettings.Builder + restoreBackupSettings() { + return getStubSettingsBuilder().restoreBackupSettings(); + } + + /** Returns the builder for the settings used for calls to rotateServerCa. */ + public UnaryCallSettings.Builder + rotateServerCaSettings() { + return getStubSettingsBuilder().rotateServerCaSettings(); + } + + /** Returns the builder for the settings used for calls to rotateServerCertificate. */ + public UnaryCallSettings.Builder + rotateServerCertificateSettings() { + return getStubSettingsBuilder().rotateServerCertificateSettings(); + } + + /** Returns the builder for the settings used for calls to rotateEntraIdCertificate. */ + public UnaryCallSettings.Builder + rotateEntraIdCertificateSettings() { + return getStubSettingsBuilder().rotateEntraIdCertificateSettings(); + } + + /** Returns the builder for the settings used for calls to startReplica. */ + public UnaryCallSettings.Builder + startReplicaSettings() { + return getStubSettingsBuilder().startReplicaSettings(); + } + + /** Returns the builder for the settings used for calls to stopReplica. */ + public UnaryCallSettings.Builder + stopReplicaSettings() { + return getStubSettingsBuilder().stopReplicaSettings(); + } + + /** Returns the builder for the settings used for calls to truncateLog. */ + public UnaryCallSettings.Builder + truncateLogSettings() { + return getStubSettingsBuilder().truncateLogSettings(); + } + + /** Returns the builder for the settings used for calls to update. */ + public UnaryCallSettings.Builder updateSettings() { + return getStubSettingsBuilder().updateSettings(); + } + + /** Returns the builder for the settings used for calls to createEphemeral. */ + public UnaryCallSettings.Builder + createEphemeralSettings() { + return getStubSettingsBuilder().createEphemeralSettings(); + } + + /** Returns the builder for the settings used for calls to rescheduleMaintenance. */ + public UnaryCallSettings.Builder + rescheduleMaintenanceSettings() { + return getStubSettingsBuilder().rescheduleMaintenanceSettings(); + } + + /** Returns the builder for the settings used for calls to verifyExternalSyncSettings. */ + public UnaryCallSettings.Builder< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsSettings() { + return getStubSettingsBuilder().verifyExternalSyncSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to startExternalSync. */ + public UnaryCallSettings.Builder + startExternalSyncSettings() { + return getStubSettingsBuilder().startExternalSyncSettings(); + } + + /** Returns the builder for the settings used for calls to performDiskShrink. */ + public UnaryCallSettings.Builder + performDiskShrinkSettings() { + return getStubSettingsBuilder().performDiskShrinkSettings(); + } + + /** Returns the builder for the settings used for calls to getDiskShrinkConfig. */ + public UnaryCallSettings.Builder< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigSettings() { + return getStubSettingsBuilder().getDiskShrinkConfigSettings(); + } + + /** Returns the builder for the settings used for calls to resetReplicaSize. */ + public UnaryCallSettings.Builder + resetReplicaSizeSettings() { + return getStubSettingsBuilder().resetReplicaSizeSettings(); + } + + /** Returns the builder for the settings used for calls to getLatestRecoveryTime. */ + public UnaryCallSettings.Builder< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeSettings() { + return getStubSettingsBuilder().getLatestRecoveryTimeSettings(); + } + + /** Returns the builder for the settings used for calls to executeSql. */ + public UnaryCallSettings.Builder + executeSqlSettings() { + return getStubSettingsBuilder().executeSqlSettings(); + } + + /** Returns the builder for the settings used for calls to acquireSsrsLease. */ + public UnaryCallSettings.Builder< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseSettings() { + return getStubSettingsBuilder().acquireSsrsLeaseSettings(); + } + + /** Returns the builder for the settings used for calls to releaseSsrsLease. */ + public UnaryCallSettings.Builder< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseSettings() { + return getStubSettingsBuilder().releaseSsrsLeaseSettings(); + } + + /** Returns the builder for the settings used for calls to preCheckMajorVersionUpgrade. */ + public UnaryCallSettings.Builder + preCheckMajorVersionUpgradeSettings() { + return getStubSettingsBuilder().preCheckMajorVersionUpgradeSettings(); + } + + /** Returns the builder for the settings used for calls to pointInTimeRestore. */ + public UnaryCallSettings.Builder + pointInTimeRestoreSettings() { + return getStubSettingsBuilder().pointInTimeRestoreSettings(); + } + + @Override + public SqlInstancesServiceSettings build() throws IOException { + return new SqlInstancesServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceClient.java new file mode 100644 index 000000000000..2d222c038d20 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceClient.java @@ -0,0 +1,431 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.stub.SqlOperationsServiceStub; +import com.google.cloud.sql.v1beta4.stub.SqlOperationsServiceStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (SqlOperationsServiceClient sqlOperationsServiceClient =
+ *     SqlOperationsServiceClient.create()) {
+ *   SqlOperationsGetRequest request =
+ *       SqlOperationsGetRequest.newBuilder()
+ *           .setOperation("operation1662702951")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlOperationsServiceClient.get(request);
+ * }
+ * }
+ * + *

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

Get

Retrieves an instance operation that has been performed on an instance.

+ *

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

+ *
    + *
  • get(SqlOperationsGetRequest request) + *

+ *

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

+ *
    + *
  • getCallable() + *

+ *

List

Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.

+ *

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

+ *
    + *
  • list(SqlOperationsListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *

Cancel

Cancels an instance operation that has been performed on an instance. Ordinarily, this method name should be `CancelSqlOperation`.

+ *

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

+ *
    + *
  • cancel(SqlOperationsCancelRequest request) + *

+ *

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

+ *
    + *
  • cancelCallable() + *

+ *
+ * + *

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 SqlOperationsServiceSettings + * 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
+ * SqlOperationsServiceSettings sqlOperationsServiceSettings =
+ *     SqlOperationsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlOperationsServiceClient sqlOperationsServiceClient =
+ *     SqlOperationsServiceClient.create(sqlOperationsServiceSettings);
+ * }
+ * + *

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
+ * SqlOperationsServiceSettings sqlOperationsServiceSettings =
+ *     SqlOperationsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlOperationsServiceClient sqlOperationsServiceClient =
+ *     SqlOperationsServiceClient.create(sqlOperationsServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlOperationsServiceSettings sqlOperationsServiceSettings =
+ *     SqlOperationsServiceSettings.newHttpJsonBuilder().build();
+ * SqlOperationsServiceClient sqlOperationsServiceClient =
+ *     SqlOperationsServiceClient.create(sqlOperationsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlOperationsServiceClient implements BackgroundResource { + private final @Nullable SqlOperationsServiceSettings settings; + private final SqlOperationsServiceStub stub; + + /** Constructs an instance of SqlOperationsServiceClient with default settings. */ + public static final SqlOperationsServiceClient create() throws IOException { + return create(SqlOperationsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlOperationsServiceClient, 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 SqlOperationsServiceClient create(SqlOperationsServiceSettings settings) + throws IOException { + return new SqlOperationsServiceClient(settings); + } + + /** + * Constructs an instance of SqlOperationsServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(SqlOperationsServiceSettings). + */ + public static final SqlOperationsServiceClient create(SqlOperationsServiceStub stub) { + return new SqlOperationsServiceClient(stub); + } + + /** + * Constructs an instance of SqlOperationsServiceClient, 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 SqlOperationsServiceClient(SqlOperationsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlOperationsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlOperationsServiceClient(SqlOperationsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlOperationsServiceSettings getSettings() { + return settings; + } + + public SqlOperationsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves an instance operation that has been performed on 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 (SqlOperationsServiceClient sqlOperationsServiceClient =
+   *     SqlOperationsServiceClient.create()) {
+   *   SqlOperationsGetRequest request =
+   *       SqlOperationsGetRequest.newBuilder()
+   *           .setOperation("operation1662702951")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlOperationsServiceClient.get(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 Operation get(SqlOperationsGetRequest request) { + return getCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves an instance operation that has been performed on 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 (SqlOperationsServiceClient sqlOperationsServiceClient =
+   *     SqlOperationsServiceClient.create()) {
+   *   SqlOperationsGetRequest request =
+   *       SqlOperationsGetRequest.newBuilder()
+   *           .setOperation("operation1662702951")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlOperationsServiceClient.getCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCallable() { + return stub.getCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all instance operations that have been performed on the given Cloud SQL instance in the + * reverse chronological order of the start time. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlOperationsServiceClient sqlOperationsServiceClient =
+   *     SqlOperationsServiceClient.create()) {
+   *   SqlOperationsListRequest request =
+   *       SqlOperationsListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setMaxResults(1128457243)
+   *           .setPageToken("pageToken873572522")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   OperationsListResponse response = sqlOperationsServiceClient.list(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 OperationsListResponse list(SqlOperationsListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all instance operations that have been performed on the given Cloud SQL instance in the + * reverse chronological order of the start time. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlOperationsServiceClient sqlOperationsServiceClient =
+   *     SqlOperationsServiceClient.create()) {
+   *   SqlOperationsListRequest request =
+   *       SqlOperationsListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setMaxResults(1128457243)
+   *           .setPageToken("pageToken873572522")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlOperationsServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   OperationsListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels an instance operation that has been performed on an instance. Ordinarily, this method + * name should be `CancelSqlOperation`. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlOperationsServiceClient sqlOperationsServiceClient =
+   *     SqlOperationsServiceClient.create()) {
+   *   SqlOperationsCancelRequest request =
+   *       SqlOperationsCancelRequest.newBuilder()
+   *           .setOperation("operation1662702951")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   sqlOperationsServiceClient.cancel(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void cancel(SqlOperationsCancelRequest request) { + cancelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels an instance operation that has been performed on an instance. Ordinarily, this method + * name should be `CancelSqlOperation`. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlOperationsServiceClient sqlOperationsServiceClient =
+   *     SqlOperationsServiceClient.create()) {
+   *   SqlOperationsCancelRequest request =
+   *       SqlOperationsCancelRequest.newBuilder()
+   *           .setOperation("operation1662702951")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlOperationsServiceClient.cancelCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable cancelCallable() { + return stub.cancelCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceSettings.java new file mode 100644 index 000000000000..6a1bc2de29a8 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceSettings.java @@ -0,0 +1,243 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1beta4.stub.SqlOperationsServiceStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlOperationsServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 get: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlOperationsServiceSettings.Builder sqlOperationsServiceSettingsBuilder =
+ *     SqlOperationsServiceSettings.newBuilder();
+ * sqlOperationsServiceSettingsBuilder
+ *     .getSettings()
+ *     .setRetrySettings(
+ *         sqlOperationsServiceSettingsBuilder
+ *             .getSettings()
+ *             .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());
+ * SqlOperationsServiceSettings sqlOperationsServiceSettings =
+ *     sqlOperationsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlOperationsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return ((SqlOperationsServiceStubSettings) getStubSettings()).getSettings(); + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlOperationsServiceStubSettings) getStubSettings()).listSettings(); + } + + /** Returns the object with the settings used for calls to cancel. */ + public UnaryCallSettings cancelSettings() { + return ((SqlOperationsServiceStubSettings) getStubSettings()).cancelSettings(); + } + + public static final SqlOperationsServiceSettings create(SqlOperationsServiceStubSettings stub) + throws IOException { + return new SqlOperationsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlOperationsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlOperationsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlOperationsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlOperationsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlOperationsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlOperationsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlOperationsServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlOperationsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlOperationsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlOperationsServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlOperationsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlOperationsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlOperationsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlOperationsServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlOperationsServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlOperationsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlOperationsServiceStubSettings.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 get. */ + public UnaryCallSettings.Builder getSettings() { + return getStubSettingsBuilder().getSettings(); + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + /** Returns the builder for the settings used for calls to cancel. */ + public UnaryCallSettings.Builder cancelSettings() { + return getStubSettingsBuilder().cancelSettings(); + } + + @Override + public SqlOperationsServiceSettings build() throws IOException { + return new SqlOperationsServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceClient.java new file mode 100644 index 000000000000..626a05600490 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceClient.java @@ -0,0 +1,500 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.stub.SqlSslCertsServiceStub; +import com.google.cloud.sql.v1beta4.stub.SqlSslCertsServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+ *   SqlSslCertsDeleteRequest request =
+ *       SqlSslCertsDeleteRequest.newBuilder()
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .setSha1Fingerprint("sha1Fingerprint163009183")
+ *           .build();
+ *   Operation response = sqlSslCertsServiceClient.delete(request);
+ * }
+ * }
+ * + *

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

Delete

Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.

+ *

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

+ *
    + *
  • delete(SqlSslCertsDeleteRequest request) + *

+ *

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

+ *
    + *
  • deleteCallable() + *

+ *

Get

Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation.

+ *

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

+ *
    + *
  • get(SqlSslCertsGetRequest request) + *

+ *

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

+ *
    + *
  • getCallable() + *

+ *

Insert

Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted.

+ *

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

+ *
    + *
  • insert(SqlSslCertsInsertRequest request) + *

+ *

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

+ *
    + *
  • insertCallable() + *

+ *

List

Lists all of the current SSL certificates for the instance.

+ *

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

+ *
    + *
  • list(SqlSslCertsListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *
+ * + *

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 SqlSslCertsServiceSettings 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
+ * SqlSslCertsServiceSettings sqlSslCertsServiceSettings =
+ *     SqlSslCertsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlSslCertsServiceClient sqlSslCertsServiceClient =
+ *     SqlSslCertsServiceClient.create(sqlSslCertsServiceSettings);
+ * }
+ * + *

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
+ * SqlSslCertsServiceSettings sqlSslCertsServiceSettings =
+ *     SqlSslCertsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlSslCertsServiceClient sqlSslCertsServiceClient =
+ *     SqlSslCertsServiceClient.create(sqlSslCertsServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlSslCertsServiceSettings sqlSslCertsServiceSettings =
+ *     SqlSslCertsServiceSettings.newHttpJsonBuilder().build();
+ * SqlSslCertsServiceClient sqlSslCertsServiceClient =
+ *     SqlSslCertsServiceClient.create(sqlSslCertsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlSslCertsServiceClient implements BackgroundResource { + private final @Nullable SqlSslCertsServiceSettings settings; + private final SqlSslCertsServiceStub stub; + + /** Constructs an instance of SqlSslCertsServiceClient with default settings. */ + public static final SqlSslCertsServiceClient create() throws IOException { + return create(SqlSslCertsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlSslCertsServiceClient, 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 SqlSslCertsServiceClient create(SqlSslCertsServiceSettings settings) + throws IOException { + return new SqlSslCertsServiceClient(settings); + } + + /** + * Constructs an instance of SqlSslCertsServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(SqlSslCertsServiceSettings). + */ + public static final SqlSslCertsServiceClient create(SqlSslCertsServiceStub stub) { + return new SqlSslCertsServiceClient(stub); + } + + /** + * Constructs an instance of SqlSslCertsServiceClient, 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 SqlSslCertsServiceClient(SqlSslCertsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlSslCertsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlSslCertsServiceClient(SqlSslCertsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlSslCertsServiceSettings getSettings() { + return settings; + } + + public SqlSslCertsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the SSL certificate. For First Generation instances, the certificate remains valid + * until the instance is restarted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsDeleteRequest request =
+   *       SqlSslCertsDeleteRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSha1Fingerprint("sha1Fingerprint163009183")
+   *           .build();
+   *   Operation response = sqlSslCertsServiceClient.delete(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 Operation delete(SqlSslCertsDeleteRequest request) { + return deleteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the SSL certificate. For First Generation instances, the certificate remains valid + * until the instance is restarted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsDeleteRequest request =
+   *       SqlSslCertsDeleteRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSha1Fingerprint("sha1Fingerprint163009183")
+   *           .build();
+   *   ApiFuture future = sqlSslCertsServiceClient.deleteCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCallable() { + return stub.deleteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a particular SSL certificate. Does not include the private key (required for usage). + * The private key must be saved from the response to initial creation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsGetRequest request =
+   *       SqlSslCertsGetRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSha1Fingerprint("sha1Fingerprint163009183")
+   *           .build();
+   *   SslCert response = sqlSslCertsServiceClient.get(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 SslCert get(SqlSslCertsGetRequest request) { + return getCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a particular SSL certificate. Does not include the private key (required for usage). + * The private key must be saved from the response to initial creation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsGetRequest request =
+   *       SqlSslCertsGetRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setSha1Fingerprint("sha1Fingerprint163009183")
+   *           .build();
+   *   ApiFuture future = sqlSslCertsServiceClient.getCallable().futureCall(request);
+   *   // Do something.
+   *   SslCert response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCallable() { + return stub.getCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an SSL certificate and returns it along with the private key and server certificate + * authority. The new certificate will not be usable until the instance is restarted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsInsertRequest request =
+   *       SqlSslCertsInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(SslCertsInsertRequest.newBuilder().build())
+   *           .build();
+   *   SslCertsInsertResponse response = sqlSslCertsServiceClient.insert(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 SslCertsInsertResponse insert(SqlSslCertsInsertRequest request) { + return insertCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an SSL certificate and returns it along with the private key and server certificate + * authority. The new certificate will not be usable until the instance is restarted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsInsertRequest request =
+   *       SqlSslCertsInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(SslCertsInsertRequest.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sqlSslCertsServiceClient.insertCallable().futureCall(request);
+   *   // Do something.
+   *   SslCertsInsertResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable insertCallable() { + return stub.insertCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all of the current SSL certificates for the 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 (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsListRequest request =
+   *       SqlSslCertsListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   SslCertsListResponse response = sqlSslCertsServiceClient.list(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 SslCertsListResponse list(SqlSslCertsListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all of the current SSL certificates for the 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 (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+   *   SqlSslCertsListRequest request =
+   *       SqlSslCertsListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlSslCertsServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   SslCertsListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceSettings.java new file mode 100644 index 000000000000..3310fc7efd92 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceSettings.java @@ -0,0 +1,251 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1beta4.stub.SqlSslCertsServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlSslCertsServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlSslCertsServiceSettings.Builder sqlSslCertsServiceSettingsBuilder =
+ *     SqlSslCertsServiceSettings.newBuilder();
+ * sqlSslCertsServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlSslCertsServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlSslCertsServiceSettings sqlSslCertsServiceSettings =
+ *     sqlSslCertsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlSslCertsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return ((SqlSslCertsServiceStubSettings) getStubSettings()).deleteSettings(); + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return ((SqlSslCertsServiceStubSettings) getStubSettings()).getSettings(); + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return ((SqlSslCertsServiceStubSettings) getStubSettings()).insertSettings(); + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlSslCertsServiceStubSettings) getStubSettings()).listSettings(); + } + + public static final SqlSslCertsServiceSettings create(SqlSslCertsServiceStubSettings stub) + throws IOException { + return new SqlSslCertsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlSslCertsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlSslCertsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlSslCertsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlSslCertsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlSslCertsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlSslCertsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlSslCertsServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlSslCertsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlSslCertsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlSslCertsServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlSslCertsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlSslCertsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlSslCertsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlSslCertsServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlSslCertsServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlSslCertsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlSslCertsServiceStubSettings.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 delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return getStubSettingsBuilder().deleteSettings(); + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getStubSettingsBuilder().getSettings(); + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder + insertSettings() { + return getStubSettingsBuilder().insertSettings(); + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + @Override + public SqlSslCertsServiceSettings build() throws IOException { + return new SqlSslCertsServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersServiceClient.java new file mode 100644 index 000000000000..a5fac376919e --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersServiceClient.java @@ -0,0 +1,268 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.stub.SqlTiersServiceStub; +import com.google.cloud.sql.v1beta4.stub.SqlTiersServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for providing machine types (tiers) for Cloud SQL. + * + *

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 (SqlTiersServiceClient sqlTiersServiceClient = SqlTiersServiceClient.create()) {
+ *   SqlTiersListRequest request =
+ *       SqlTiersListRequest.newBuilder().setProject("project-309310695").build();
+ *   TiersListResponse response = sqlTiersServiceClient.list(request);
+ * }
+ * }
+ * + *

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

List

Lists all available machine types (tiers) for Cloud SQL, for example, `db-custom-1-3840`. For related information, see [Pricing](/sql/pricing).

+ *

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

+ *
    + *
  • list(SqlTiersListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *
+ * + *

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 SqlTiersServiceSettings 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
+ * SqlTiersServiceSettings sqlTiersServiceSettings =
+ *     SqlTiersServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlTiersServiceClient sqlTiersServiceClient =
+ *     SqlTiersServiceClient.create(sqlTiersServiceSettings);
+ * }
+ * + *

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
+ * SqlTiersServiceSettings sqlTiersServiceSettings =
+ *     SqlTiersServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlTiersServiceClient sqlTiersServiceClient =
+ *     SqlTiersServiceClient.create(sqlTiersServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlTiersServiceSettings sqlTiersServiceSettings =
+ *     SqlTiersServiceSettings.newHttpJsonBuilder().build();
+ * SqlTiersServiceClient sqlTiersServiceClient =
+ *     SqlTiersServiceClient.create(sqlTiersServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlTiersServiceClient implements BackgroundResource { + private final @Nullable SqlTiersServiceSettings settings; + private final SqlTiersServiceStub stub; + + /** Constructs an instance of SqlTiersServiceClient with default settings. */ + public static final SqlTiersServiceClient create() throws IOException { + return create(SqlTiersServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlTiersServiceClient, 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 SqlTiersServiceClient create(SqlTiersServiceSettings settings) + throws IOException { + return new SqlTiersServiceClient(settings); + } + + /** + * Constructs an instance of SqlTiersServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SqlTiersServiceSettings). + */ + public static final SqlTiersServiceClient create(SqlTiersServiceStub stub) { + return new SqlTiersServiceClient(stub); + } + + /** + * Constructs an instance of SqlTiersServiceClient, 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 SqlTiersServiceClient(SqlTiersServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlTiersServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlTiersServiceClient(SqlTiersServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlTiersServiceSettings getSettings() { + return settings; + } + + public SqlTiersServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all available machine types (tiers) for Cloud SQL, for example, `db-custom-1-3840`. For + * related information, see [Pricing](/sql/pricing). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlTiersServiceClient sqlTiersServiceClient = SqlTiersServiceClient.create()) {
+   *   SqlTiersListRequest request =
+   *       SqlTiersListRequest.newBuilder().setProject("project-309310695").build();
+   *   TiersListResponse response = sqlTiersServiceClient.list(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 TiersListResponse list(SqlTiersListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all available machine types (tiers) for Cloud SQL, for example, `db-custom-1-3840`. For + * related information, see [Pricing](/sql/pricing). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlTiersServiceClient sqlTiersServiceClient = SqlTiersServiceClient.create()) {
+   *   SqlTiersListRequest request =
+   *       SqlTiersListRequest.newBuilder().setProject("project-309310695").build();
+   *   ApiFuture future =
+   *       sqlTiersServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   TiersListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersServiceSettings.java new file mode 100644 index 000000000000..be13923d914c --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersServiceSettings.java @@ -0,0 +1,219 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1beta4.stub.SqlTiersServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlTiersServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 list: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlTiersServiceSettings.Builder sqlTiersServiceSettingsBuilder =
+ *     SqlTiersServiceSettings.newBuilder();
+ * sqlTiersServiceSettingsBuilder
+ *     .listSettings()
+ *     .setRetrySettings(
+ *         sqlTiersServiceSettingsBuilder
+ *             .listSettings()
+ *             .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());
+ * SqlTiersServiceSettings sqlTiersServiceSettings = sqlTiersServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlTiersServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlTiersServiceStubSettings) getStubSettings()).listSettings(); + } + + public static final SqlTiersServiceSettings create(SqlTiersServiceStubSettings stub) + throws IOException { + return new SqlTiersServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlTiersServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlTiersServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlTiersServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlTiersServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlTiersServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlTiersServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlTiersServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlTiersServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlTiersServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlTiersServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlTiersServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlTiersServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlTiersServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlTiersServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlTiersServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlTiersServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlTiersServiceStubSettings.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 list. */ + public UnaryCallSettings.Builder listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + @Override + public SqlTiersServiceSettings build() throws IOException { + return new SqlTiersServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersServiceClient.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersServiceClient.java new file mode 100644 index 000000000000..0acf6c37325a --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersServiceClient.java @@ -0,0 +1,579 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.stub.SqlUsersServiceStub; +import com.google.cloud.sql.v1beta4.stub.SqlUsersServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+ *   SqlUsersDeleteRequest request =
+ *       SqlUsersDeleteRequest.newBuilder()
+ *           .setHost("host3208616")
+ *           .setInstance("instance555127957")
+ *           .setName("name3373707")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlUsersServiceClient.delete(request);
+ * }
+ * }
+ * + *

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

Delete

Deletes a user from a Cloud SQL instance.

+ *

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

+ *
    + *
  • delete(SqlUsersDeleteRequest request) + *

+ *

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

+ *
    + *
  • deleteCallable() + *

+ *

Get

Retrieves a resource containing information about a user.

+ *

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

+ *
    + *
  • get(SqlUsersGetRequest request) + *

+ *

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

+ *
    + *
  • getCallable() + *

+ *

Insert

Creates a new user in a Cloud SQL instance.

+ *

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

+ *
    + *
  • insert(SqlUsersInsertRequest request) + *

+ *

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

+ *
    + *
  • insertCallable() + *

+ *

List

Lists users in the specified Cloud SQL instance.

+ *

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

+ *
    + *
  • list(SqlUsersListRequest request) + *

+ *

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

+ *
    + *
  • listCallable() + *

+ *

Update

Updates an existing user in a Cloud SQL instance.

+ *

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

+ *
    + *
  • update(SqlUsersUpdateRequest request) + *

+ *

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

+ *
    + *
  • updateCallable() + *

+ *
+ * + *

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 SqlUsersServiceSettings 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
+ * SqlUsersServiceSettings sqlUsersServiceSettings =
+ *     SqlUsersServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SqlUsersServiceClient sqlUsersServiceClient =
+ *     SqlUsersServiceClient.create(sqlUsersServiceSettings);
+ * }
+ * + *

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
+ * SqlUsersServiceSettings sqlUsersServiceSettings =
+ *     SqlUsersServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SqlUsersServiceClient sqlUsersServiceClient =
+ *     SqlUsersServiceClient.create(sqlUsersServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlUsersServiceSettings sqlUsersServiceSettings =
+ *     SqlUsersServiceSettings.newHttpJsonBuilder().build();
+ * SqlUsersServiceClient sqlUsersServiceClient =
+ *     SqlUsersServiceClient.create(sqlUsersServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlUsersServiceClient implements BackgroundResource { + private final @Nullable SqlUsersServiceSettings settings; + private final SqlUsersServiceStub stub; + + /** Constructs an instance of SqlUsersServiceClient with default settings. */ + public static final SqlUsersServiceClient create() throws IOException { + return create(SqlUsersServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SqlUsersServiceClient, 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 SqlUsersServiceClient create(SqlUsersServiceSettings settings) + throws IOException { + return new SqlUsersServiceClient(settings); + } + + /** + * Constructs an instance of SqlUsersServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SqlUsersServiceSettings). + */ + public static final SqlUsersServiceClient create(SqlUsersServiceStub stub) { + return new SqlUsersServiceClient(stub); + } + + /** + * Constructs an instance of SqlUsersServiceClient, 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 SqlUsersServiceClient(SqlUsersServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SqlUsersServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SqlUsersServiceClient(SqlUsersServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final @Nullable SqlUsersServiceSettings getSettings() { + return settings; + } + + public SqlUsersServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user from a Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersDeleteRequest request =
+   *       SqlUsersDeleteRequest.newBuilder()
+   *           .setHost("host3208616")
+   *           .setInstance("instance555127957")
+   *           .setName("name3373707")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   Operation response = sqlUsersServiceClient.delete(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 Operation delete(SqlUsersDeleteRequest request) { + return deleteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user from a Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersDeleteRequest request =
+   *       SqlUsersDeleteRequest.newBuilder()
+   *           .setHost("host3208616")
+   *           .setInstance("instance555127957")
+   *           .setName("name3373707")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future = sqlUsersServiceClient.deleteCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCallable() { + return stub.deleteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a user. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersGetRequest request =
+   *       SqlUsersGetRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setName("name3373707")
+   *           .setProject("project-309310695")
+   *           .setHost("host3208616")
+   *           .build();
+   *   User response = sqlUsersServiceClient.get(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 User get(SqlUsersGetRequest request) { + return getCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about a user. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersGetRequest request =
+   *       SqlUsersGetRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setName("name3373707")
+   *           .setProject("project-309310695")
+   *           .setHost("host3208616")
+   *           .build();
+   *   ApiFuture future = sqlUsersServiceClient.getCallable().futureCall(request);
+   *   // Do something.
+   *   User response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCallable() { + return stub.getCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new user in a Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersInsertRequest request =
+   *       SqlUsersInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(User.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlUsersServiceClient.insert(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 Operation insert(SqlUsersInsertRequest request) { + return insertCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new user in a Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersInsertRequest request =
+   *       SqlUsersInsertRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .setBody(User.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlUsersServiceClient.insertCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable insertCallable() { + return stub.insertCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists users in the specified Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersListRequest request =
+   *       SqlUsersListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   UsersListResponse response = sqlUsersServiceClient.list(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 UsersListResponse list(SqlUsersListRequest request) { + return listCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists users in the specified Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersListRequest request =
+   *       SqlUsersListRequest.newBuilder()
+   *           .setInstance("instance555127957")
+   *           .setProject("project-309310695")
+   *           .build();
+   *   ApiFuture future =
+   *       sqlUsersServiceClient.listCallable().futureCall(request);
+   *   // Do something.
+   *   UsersListResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listCallable() { + return stub.listCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing user in a Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersUpdateRequest request =
+   *       SqlUsersUpdateRequest.newBuilder()
+   *           .setHost("host3208616")
+   *           .setInstance("instance555127957")
+   *           .setName("name3373707")
+   *           .setProject("project-309310695")
+   *           .addAllDatabaseRoles(new ArrayList())
+   *           .setRevokeExistingRoles(true)
+   *           .setBody(User.newBuilder().build())
+   *           .build();
+   *   Operation response = sqlUsersServiceClient.update(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 Operation update(SqlUsersUpdateRequest request) { + return updateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing user in a Cloud SQL 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 (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+   *   SqlUsersUpdateRequest request =
+   *       SqlUsersUpdateRequest.newBuilder()
+   *           .setHost("host3208616")
+   *           .setInstance("instance555127957")
+   *           .setName("name3373707")
+   *           .setProject("project-309310695")
+   *           .addAllDatabaseRoles(new ArrayList())
+   *           .setRevokeExistingRoles(true)
+   *           .setBody(User.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sqlUsersServiceClient.updateCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateCallable() { + return stub.updateCallable(); + } + + @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); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersServiceSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersServiceSettings.java new file mode 100644 index 000000000000..52f48953d767 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersServiceSettings.java @@ -0,0 +1,259 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1beta4.stub.SqlUsersServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlUsersServiceClient}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlUsersServiceSettings.Builder sqlUsersServiceSettingsBuilder =
+ *     SqlUsersServiceSettings.newBuilder();
+ * sqlUsersServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlUsersServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlUsersServiceSettings sqlUsersServiceSettings = sqlUsersServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class SqlUsersServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return ((SqlUsersServiceStubSettings) getStubSettings()).deleteSettings(); + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return ((SqlUsersServiceStubSettings) getStubSettings()).getSettings(); + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return ((SqlUsersServiceStubSettings) getStubSettings()).insertSettings(); + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return ((SqlUsersServiceStubSettings) getStubSettings()).listSettings(); + } + + /** Returns the object with the settings used for calls to update. */ + public UnaryCallSettings updateSettings() { + return ((SqlUsersServiceStubSettings) getStubSettings()).updateSettings(); + } + + public static final SqlUsersServiceSettings create(SqlUsersServiceStubSettings stub) + throws IOException { + return new SqlUsersServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SqlUsersServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SqlUsersServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SqlUsersServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SqlUsersServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SqlUsersServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SqlUsersServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SqlUsersServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlUsersServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlUsersServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SqlUsersServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(SqlUsersServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SqlUsersServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SqlUsersServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SqlUsersServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SqlUsersServiceStubSettings.newHttpJsonBuilder()); + } + + public SqlUsersServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SqlUsersServiceStubSettings.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 delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return getStubSettingsBuilder().deleteSettings(); + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getStubSettingsBuilder().getSettings(); + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return getStubSettingsBuilder().insertSettings(); + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder listSettings() { + return getStubSettingsBuilder().listSettings(); + } + + /** Returns the builder for the settings used for calls to update. */ + public UnaryCallSettings.Builder updateSettings() { + return getStubSettingsBuilder().updateSettings(); + } + + @Override + public SqlUsersServiceSettings build() throws IOException { + return new SqlUsersServiceSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/gapic_metadata.json b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/gapic_metadata.json new file mode 100644 index 000000000000..e7dd468213ca --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/gapic_metadata.json @@ -0,0 +1,336 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.sql.v1beta4", + "libraryPackage": "com.google.cloud.sql.v1beta4", + "services": { + "SqlBackupRunsService": { + "clients": { + "grpc": { + "libraryClient": "SqlBackupRunsServiceClient", + "rpcs": { + "Delete": { + "methods": ["delete", "deleteCallable"] + }, + "Get": { + "methods": ["get", "getCallable"] + }, + "Insert": { + "methods": ["insert", "insertCallable"] + }, + "List": { + "methods": ["list", "listCallable"] + } + } + } + } + }, + "SqlDatabasesService": { + "clients": { + "grpc": { + "libraryClient": "SqlDatabasesServiceClient", + "rpcs": { + "Delete": { + "methods": ["delete", "deleteCallable"] + }, + "Get": { + "methods": ["get", "getCallable"] + }, + "Insert": { + "methods": ["insert", "insertCallable"] + }, + "List": { + "methods": ["list", "listCallable"] + }, + "Patch": { + "methods": ["patch", "patchCallable"] + }, + "Update": { + "methods": ["update", "updateCallable"] + } + } + } + } + }, + "SqlFlagsService": { + "clients": { + "grpc": { + "libraryClient": "SqlFlagsServiceClient", + "rpcs": { + "List": { + "methods": ["list", "listCallable"] + } + } + } + } + }, + "SqlInstancesService": { + "clients": { + "grpc": { + "libraryClient": "SqlInstancesServiceClient", + "rpcs": { + "AcquireSsrsLease": { + "methods": ["acquireSsrsLease", "acquireSsrsLeaseCallable"] + }, + "AddEntraIdCertificate": { + "methods": ["addEntraIdCertificate", "addEntraIdCertificateCallable"] + }, + "AddServerCa": { + "methods": ["addServerCa", "addServerCaCallable"] + }, + "AddServerCertificate": { + "methods": ["addServerCertificate", "addServerCertificateCallable"] + }, + "Clone": { + "methods": ["clone", "cloneCallable"] + }, + "CreateEphemeral": { + "methods": ["createEphemeral", "createEphemeralCallable"] + }, + "Delete": { + "methods": ["delete", "deleteCallable"] + }, + "Demote": { + "methods": ["demote", "demoteCallable"] + }, + "DemoteMaster": { + "methods": ["demoteMaster", "demoteMasterCallable"] + }, + "ExecuteSql": { + "methods": ["executeSql", "executeSqlCallable"] + }, + "Export": { + "methods": ["export", "exportCallable"] + }, + "Failover": { + "methods": ["failover", "failoverCallable"] + }, + "Get": { + "methods": ["get", "getCallable"] + }, + "GetDiskShrinkConfig": { + "methods": ["getDiskShrinkConfig", "getDiskShrinkConfigCallable"] + }, + "GetLatestRecoveryTime": { + "methods": ["getLatestRecoveryTime", "getLatestRecoveryTimeCallable"] + }, + "Import": { + "methods": ["import_", "import_Callable"] + }, + "Insert": { + "methods": ["insert", "insertCallable"] + }, + "List": { + "methods": ["list", "listCallable"] + }, + "ListEntraIdCertificates": { + "methods": ["listEntraIdCertificates", "listEntraIdCertificatesCallable"] + }, + "ListServerCas": { + "methods": ["listServerCas", "listServerCasCallable"] + }, + "ListServerCertificates": { + "methods": ["listServerCertificates", "listServerCertificatesCallable"] + }, + "Patch": { + "methods": ["patch", "patchCallable"] + }, + "PerformDiskShrink": { + "methods": ["performDiskShrink", "performDiskShrinkCallable"] + }, + "PointInTimeRestore": { + "methods": ["pointInTimeRestore", "pointInTimeRestoreCallable"] + }, + "PreCheckMajorVersionUpgrade": { + "methods": ["preCheckMajorVersionUpgrade", "preCheckMajorVersionUpgradeCallable"] + }, + "PromoteReplica": { + "methods": ["promoteReplica", "promoteReplicaCallable"] + }, + "Reencrypt": { + "methods": ["reencrypt", "reencryptCallable"] + }, + "ReleaseSsrsLease": { + "methods": ["releaseSsrsLease", "releaseSsrsLeaseCallable"] + }, + "RescheduleMaintenance": { + "methods": ["rescheduleMaintenance", "rescheduleMaintenanceCallable"] + }, + "ResetReplicaSize": { + "methods": ["resetReplicaSize", "resetReplicaSizeCallable"] + }, + "ResetSslConfig": { + "methods": ["resetSslConfig", "resetSslConfigCallable"] + }, + "Restart": { + "methods": ["restart", "restartCallable"] + }, + "RestoreBackup": { + "methods": ["restoreBackup", "restoreBackupCallable"] + }, + "RotateEntraIdCertificate": { + "methods": ["rotateEntraIdCertificate", "rotateEntraIdCertificateCallable"] + }, + "RotateServerCa": { + "methods": ["rotateServerCa", "rotateServerCaCallable"] + }, + "RotateServerCertificate": { + "methods": ["rotateServerCertificate", "rotateServerCertificateCallable"] + }, + "StartExternalSync": { + "methods": ["startExternalSync", "startExternalSyncCallable"] + }, + "StartReplica": { + "methods": ["startReplica", "startReplicaCallable"] + }, + "StopReplica": { + "methods": ["stopReplica", "stopReplicaCallable"] + }, + "Switchover": { + "methods": ["switchover", "switchoverCallable"] + }, + "TruncateLog": { + "methods": ["truncateLog", "truncateLogCallable"] + }, + "Update": { + "methods": ["update", "updateCallable"] + }, + "VerifyExternalSyncSettings": { + "methods": ["verifyExternalSyncSettings", "verifyExternalSyncSettingsCallable"] + } + } + } + } + }, + "SqlOperationsService": { + "clients": { + "grpc": { + "libraryClient": "SqlOperationsServiceClient", + "rpcs": { + "Cancel": { + "methods": ["cancel", "cancelCallable"] + }, + "Get": { + "methods": ["get", "getCallable"] + }, + "List": { + "methods": ["list", "listCallable"] + } + } + } + } + }, + "SqlSslCertsService": { + "clients": { + "grpc": { + "libraryClient": "SqlSslCertsServiceClient", + "rpcs": { + "Delete": { + "methods": ["delete", "deleteCallable"] + }, + "Get": { + "methods": ["get", "getCallable"] + }, + "Insert": { + "methods": ["insert", "insertCallable"] + }, + "List": { + "methods": ["list", "listCallable"] + } + } + } + } + }, + "SqlBackupsService": { + "clients": { + "grpc": { + "libraryClient": "SqlBackupsServiceClient", + "rpcs": { + "CreateBackup": { + "methods": ["createBackup", "createBackup", "createBackup", "createBackupCallable"] + }, + "DeleteBackup": { + "methods": ["deleteBackup", "deleteBackup", "deleteBackup", "deleteBackupCallable"] + }, + "GetBackup": { + "methods": ["getBackup", "getBackup", "getBackup", "getBackupCallable"] + }, + "ListBackups": { + "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] + }, + "UpdateBackup": { + "methods": ["updateBackup", "updateBackup", "updateBackupCallable"] + } + } + } + } + }, + "SqlConnectService": { + "clients": { + "grpc": { + "libraryClient": "SqlConnectServiceClient", + "rpcs": { + "GenerateEphemeralCert": { + "methods": ["generateEphemeralCert", "generateEphemeralCertCallable"] + }, + "GetConnectSettings": { + "methods": ["getConnectSettings", "getConnectSettingsCallable"] + }, + "ResolveConnectSettings": { + "methods": ["resolveConnectSettings", "resolveConnectSettingsCallable"] + } + } + } + } + }, + "SqlDataService": { + "clients": { + "grpc": { + "libraryClient": "SqlDataServiceClient", + "rpcs": { + "StreamSqlData": { + "methods": ["streamSqlDataCallable"] + } + } + } + } + }, + "SqlTiersService": { + "clients": { + "grpc": { + "libraryClient": "SqlTiersServiceClient", + "rpcs": { + "List": { + "methods": ["list", "listCallable"] + } + } + } + } + }, + "SqlUsersService": { + "clients": { + "grpc": { + "libraryClient": "SqlUsersServiceClient", + "rpcs": { + "Delete": { + "methods": ["delete", "deleteCallable"] + }, + "Get": { + "methods": ["get", "getCallable"] + }, + "Insert": { + "methods": ["insert", "insertCallable"] + }, + "List": { + "methods": ["list", "listCallable"] + }, + "Update": { + "methods": ["update", "updateCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/package-info.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/package-info.java new file mode 100644 index 000000000000..4c9e7795ecbd --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/package-info.java @@ -0,0 +1,258 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 Cloud SQL Admin API + * + *

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

======================= SqlBackupRunsServiceClient ======================= + * + *

Sample for SqlBackupRunsServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
+ *     SqlBackupRunsServiceClient.create()) {
+ *   SqlBackupRunsDeleteRequest request =
+ *       SqlBackupRunsDeleteRequest.newBuilder()
+ *           .setId(3355)
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlBackupRunsServiceClient.delete(request);
+ * }
+ * }
+ * + *

======================= SqlDatabasesServiceClient ======================= + * + *

Sample for SqlDatabasesServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) {
+ *   SqlDatabasesDeleteRequest request =
+ *       SqlDatabasesDeleteRequest.newBuilder()
+ *           .setDatabase("database1789464955")
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlDatabasesServiceClient.delete(request);
+ * }
+ * }
+ * + *

======================= SqlFlagsServiceClient ======================= + * + *

Sample for SqlFlagsServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlFlagsServiceClient sqlFlagsServiceClient = SqlFlagsServiceClient.create()) {
+ *   SqlFlagsListRequest request =
+ *       SqlFlagsListRequest.newBuilder()
+ *           .setDatabaseVersion("databaseVersion1250955997")
+ *           .setFlagScope(SqlFlagScope.forNumber(0))
+ *           .build();
+ *   FlagsListResponse response = sqlFlagsServiceClient.list(request);
+ * }
+ * }
+ * + *

======================= SqlInstancesServiceClient ======================= + * + *

Sample for SqlInstancesServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) {
+ *   SqlInstancesAddServerCaRequest request =
+ *       SqlInstancesAddServerCaRequest.newBuilder()
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlInstancesServiceClient.addServerCa(request);
+ * }
+ * }
+ * + *

======================= SqlOperationsServiceClient ======================= + * + *

Sample for SqlOperationsServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlOperationsServiceClient sqlOperationsServiceClient =
+ *     SqlOperationsServiceClient.create()) {
+ *   SqlOperationsGetRequest request =
+ *       SqlOperationsGetRequest.newBuilder()
+ *           .setOperation("operation1662702951")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlOperationsServiceClient.get(request);
+ * }
+ * }
+ * + *

======================= SqlSslCertsServiceClient ======================= + * + *

Sample for SqlSslCertsServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) {
+ *   SqlSslCertsDeleteRequest request =
+ *       SqlSslCertsDeleteRequest.newBuilder()
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .setSha1Fingerprint("sha1Fingerprint163009183")
+ *           .build();
+ *   Operation response = sqlSslCertsServiceClient.delete(request);
+ * }
+ * }
+ * + *

======================= SqlBackupsServiceClient ======================= + * + *

Sample for SqlBackupsServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   Backup backup = Backup.newBuilder().build();
+ *   Operation response = sqlBackupsServiceClient.createBackup(parent, backup);
+ * }
+ * }
+ * + *

======================= SqlConnectServiceClient ======================= + * + *

Service Description: Cloud SQL connect service. + * + *

Sample for SqlConnectServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) {
+ *   GetConnectSettingsRequest request =
+ *       GetConnectSettingsRequest.newBuilder()
+ *           .setInstance("instance555127957")
+ *           .setProject("project-309310695")
+ *           .setReadTime(Timestamp.newBuilder().build())
+ *           .build();
+ *   ConnectSettings response = sqlConnectServiceClient.getConnectSettings(request);
+ * }
+ * }
+ * + *

======================= SqlDataServiceClient ======================= + * + *

Service Description: Service for streaming data to and from Cloud SQL instances. + * + *

Sample for SqlDataServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlDataServiceClient sqlDataServiceClient = SqlDataServiceClient.create()) {
+ *   BidiStream bidiStream =
+ *       sqlDataServiceClient.streamSqlDataCallable().call();
+ *   StreamSqlDataRequest request =
+ *       StreamSqlDataRequest.newBuilder()
+ *           .setAck(Ack.newBuilder().build())
+ *           .setInstanceId(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ *           .build();
+ *   bidiStream.send(request);
+ *   for (StreamSqlDataResponse response : bidiStream) {
+ *     // Do something when a response is received.
+ *   }
+ * }
+ * }
+ * + *

======================= SqlTiersServiceClient ======================= + * + *

Service Description: Service for providing machine types (tiers) for Cloud SQL. + * + *

Sample for SqlTiersServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlTiersServiceClient sqlTiersServiceClient = SqlTiersServiceClient.create()) {
+ *   SqlTiersListRequest request =
+ *       SqlTiersListRequest.newBuilder().setProject("project-309310695").build();
+ *   TiersListResponse response = sqlTiersServiceClient.list(request);
+ * }
+ * }
+ * + *

======================= SqlUsersServiceClient ======================= + * + *

Sample for SqlUsersServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) {
+ *   SqlUsersDeleteRequest request =
+ *       SqlUsersDeleteRequest.newBuilder()
+ *           .setHost("host3208616")
+ *           .setInstance("instance555127957")
+ *           .setName("name3373707")
+ *           .setProject("project-309310695")
+ *           .build();
+ *   Operation response = sqlUsersServiceClient.delete(request);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.sql.v1beta4; + +import javax.annotation.Generated; diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlBackupRunsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlBackupRunsServiceCallableFactory.java new file mode 100644 index 000000000000..3a2cc8b4a55d --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlBackupRunsServiceCallableFactory.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlBackupRunsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlBackupRunsServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlBackupRunsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlBackupRunsServiceStub.java new file mode 100644 index 000000000000..57cd0049cdf9 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlBackupRunsServiceStub.java @@ -0,0 +1,309 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1beta4.BackupRun; +import com.google.cloud.sql.v1beta4.BackupRunsListResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlBackupRunsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlBackupRunsServiceStub extends SqlBackupRunsServiceStub { + private static final MethodDescriptor + deleteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupRunsService/Delete") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlBackupRunsDeleteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupRunsService/Get") + .setRequestMarshaller(ProtoUtils.marshaller(SqlBackupRunsGetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BackupRun.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + insertMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupRunsService/Insert") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlBackupRunsInsertRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupRunsService/List") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlBackupRunsListRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BackupRunsListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/backupRuns/{id}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/backupRuns/{id}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + + public static final GrpcSqlBackupRunsServiceStub create(SqlBackupRunsServiceStubSettings settings) + throws IOException { + return new GrpcSqlBackupRunsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlBackupRunsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlBackupRunsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlBackupRunsServiceStub, 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 GrpcSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlBackupRunsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlBackupRunsServiceStub, 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 GrpcSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings deleteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("id", String.valueOf(request.getId())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("id", String.valueOf(request.getId())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings getTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("id", String.valueOf(request.getId())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("id", String.valueOf(request.getId())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings insertTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlBackupsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlBackupsServiceCallableFactory.java new file mode 100644 index 000000000000..379b8e507a54 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlBackupsServiceCallableFactory.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlBackupsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlBackupsServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlBackupsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlBackupsServiceStub.java new file mode 100644 index 000000000000..3fbfd9375dc6 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlBackupsServiceStub.java @@ -0,0 +1,304 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import static com.google.cloud.sql.v1beta4.SqlBackupsServiceClient.ListBackupsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.CreateBackupRequest; +import com.google.cloud.sql.v1beta4.DeleteBackupRequest; +import com.google.cloud.sql.v1beta4.GetBackupRequest; +import com.google.cloud.sql.v1beta4.ListBackupsRequest; +import com.google.cloud.sql.v1beta4.ListBackupsResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.UpdateBackupRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlBackupsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlBackupsServiceStub extends SqlBackupsServiceStub { + private static final MethodDescriptor + createBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupsService/CreateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupsService/GetBackup") + .setRequestMarshaller(ProtoUtils.marshaller(GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Backup.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listBackupsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupsService/ListBackups") + .setRequestMarshaller(ProtoUtils.marshaller(ListBackupsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBackupsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupsService/UpdateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupsService/DeleteBackup") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createBackupCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable + listBackupsPagedCallable; + private final UnaryCallable updateBackupCallable; + private final UnaryCallable deleteBackupCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSqlBackupsServiceStub create(SqlBackupsServiceStubSettings settings) + throws IOException { + return new GrpcSqlBackupsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlBackupsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlBackupsServiceStub( + SqlBackupsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlBackupsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlBackupsServiceStub( + SqlBackupsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlBackupsServiceStub, 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 GrpcSqlBackupsServiceStub( + SqlBackupsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlBackupsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlBackupsServiceStub, 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 GrpcSqlBackupsServiceStub( + SqlBackupsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings getBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings listBackupsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings updateBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("backup.name", String.valueOf(request.getBackup().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + + this.createBackupCallable = + callableFactory.createUnaryCallable( + createBackupTransportSettings, settings.createBackupSettings(), clientContext); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.listBackupsPagedCallable = + callableFactory.createPagedCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.updateBackupCallable = + callableFactory.createUnaryCallable( + updateBackupTransportSettings, settings.updateBackupSettings(), clientContext); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createBackupCallable() { + return createBackupCallable; + } + + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable listBackupsPagedCallable() { + return listBackupsPagedCallable; + } + + @Override + public UnaryCallable updateBackupCallable() { + return updateBackupCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlConnectServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlConnectServiceCallableFactory.java new file mode 100644 index 000000000000..5228d3926229 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlConnectServiceCallableFactory.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlConnectService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlConnectServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlConnectServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlConnectServiceStub.java new file mode 100644 index 000000000000..346ce3229267 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlConnectServiceStub.java @@ -0,0 +1,250 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.ConnectSettings; +import com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest; +import com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse; +import com.google.cloud.sql.v1beta4.GetConnectSettingsRequest; +import com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlConnectService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlConnectServiceStub extends SqlConnectServiceStub { + private static final MethodDescriptor + getConnectSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlConnectService/GetConnectSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(GetConnectSettingsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ConnectSettings.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + resolveConnectSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlConnectService/ResolveConnectSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(ResolveConnectSettingsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ConnectSettings.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + generateEphemeralCertMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlConnectService/GenerateEphemeralCert") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateEphemeralCertRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateEphemeralCertResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable + getConnectSettingsCallable; + private final UnaryCallable + resolveConnectSettingsCallable; + private final UnaryCallable + generateEphemeralCertCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSqlConnectServiceStub create(SqlConnectServiceStubSettings settings) + throws IOException { + return new GrpcSqlConnectServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlConnectServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlConnectServiceStub( + SqlConnectServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlConnectServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlConnectServiceStub( + SqlConnectServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlConnectServiceStub, 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 GrpcSqlConnectServiceStub( + SqlConnectServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlConnectServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlConnectServiceStub, 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 GrpcSqlConnectServiceStub( + SqlConnectServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + getConnectSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getConnectSettingsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .build(); + GrpcCallSettings + resolveConnectSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(resolveConnectSettingsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("dns_name", String.valueOf(request.getDnsName())); + builder.add("location", String.valueOf(request.getLocation())); + return builder.build(); + }) + .build(); + GrpcCallSettings + generateEphemeralCertTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(generateEphemeralCertMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .build(); + + this.getConnectSettingsCallable = + callableFactory.createUnaryCallable( + getConnectSettingsTransportSettings, + settings.getConnectSettingsSettings(), + clientContext); + this.resolveConnectSettingsCallable = + callableFactory.createUnaryCallable( + resolveConnectSettingsTransportSettings, + settings.resolveConnectSettingsSettings(), + clientContext); + this.generateEphemeralCertCallable = + callableFactory.createUnaryCallable( + generateEphemeralCertTransportSettings, + settings.generateEphemeralCertSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getConnectSettingsCallable() { + return getConnectSettingsCallable; + } + + @Override + public UnaryCallable + resolveConnectSettingsCallable() { + return resolveConnectSettingsCallable; + } + + @Override + public UnaryCallable + generateEphemeralCertCallable() { + return generateEphemeralCertCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlDataServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlDataServiceCallableFactory.java new file mode 100644 index 000000000000..57472681ff91 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlDataServiceCallableFactory.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlDataService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlDataServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlDataServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlDataServiceStub.java new file mode 100644 index 000000000000..69a5e1dac0d0 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlDataServiceStub.java @@ -0,0 +1,164 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.cloud.sql.v1beta4.StreamSqlDataRequest; +import com.google.cloud.sql.v1beta4.StreamSqlDataResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlDataService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlDataServiceStub extends SqlDataServiceStub { + private static final MethodDescriptor + streamSqlDataMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.cloud.sql.v1beta4.SqlDataService/StreamSqlData") + .setRequestMarshaller( + ProtoUtils.marshaller(StreamSqlDataRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamSqlDataResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final BidiStreamingCallable + streamSqlDataCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSqlDataServiceStub create(SqlDataServiceStubSettings settings) + throws IOException { + return new GrpcSqlDataServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlDataServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlDataServiceStub( + SqlDataServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlDataServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlDataServiceStub( + SqlDataServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlDataServiceStub, 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 GrpcSqlDataServiceStub(SqlDataServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcSqlDataServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlDataServiceStub, 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 GrpcSqlDataServiceStub( + SqlDataServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings streamSqlDataTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamSqlDataMethodDescriptor) + .setResourceNameExtractor(request -> request.getInstanceId()) + .build(); + + this.streamSqlDataCallable = + callableFactory.createBidiStreamingCallable( + streamSqlDataTransportSettings, settings.streamSqlDataSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public BidiStreamingCallable + streamSqlDataCallable() { + return streamSqlDataCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlDatabasesServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlDatabasesServiceCallableFactory.java new file mode 100644 index 000000000000..bbd8f64f8ee4 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlDatabasesServiceCallableFactory.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlDatabasesService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlDatabasesServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlDatabasesServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlDatabasesServiceStub.java new file mode 100644 index 000000000000..74248a76b9a8 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlDatabasesServiceStub.java @@ -0,0 +1,394 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1beta4.Database; +import com.google.cloud.sql.v1beta4.DatabasesListResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesListRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlDatabasesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlDatabasesServiceStub extends SqlDatabasesServiceStub { + private static final MethodDescriptor + deleteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlDatabasesService/Delete") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlDatabasesDeleteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlDatabasesService/Get") + .setRequestMarshaller(ProtoUtils.marshaller(SqlDatabasesGetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Database.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + insertMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlDatabasesService/Insert") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlDatabasesInsertRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlDatabasesService/List") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlDatabasesListRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(DatabasesListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + patchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlDatabasesService/Patch") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlDatabasesUpdateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlDatabasesService/Update") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlDatabasesUpdateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + private final UnaryCallable patchCallable; + private final UnaryCallable updateCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PATCH_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + private static final PathTemplate UPDATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + + public static final GrpcSqlDatabasesServiceStub create(SqlDatabasesServiceStubSettings settings) + throws IOException { + return new GrpcSqlDatabasesServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlDatabasesServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlDatabasesServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlDatabasesServiceStub, 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 GrpcSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlDatabasesServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlDatabasesServiceStub, 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 GrpcSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings deleteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings getTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings insertTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings patchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(patchMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PATCH_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings updateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return UPDATE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.patchCallable = + callableFactory.createUnaryCallable( + patchTransportSettings, settings.patchSettings(), clientContext); + this.updateCallable = + callableFactory.createUnaryCallable( + updateTransportSettings, settings.updateSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable patchCallable() { + return patchCallable; + } + + @Override + public UnaryCallable updateCallable() { + return updateCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlFlagsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlFlagsServiceCallableFactory.java new file mode 100644 index 000000000000..5e9af5bb2861 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlFlagsServiceCallableFactory.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlFlagsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlFlagsServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlFlagsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlFlagsServiceStub.java new file mode 100644 index 000000000000..be05cb5fa848 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlFlagsServiceStub.java @@ -0,0 +1,159 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.FlagsListResponse; +import com.google.cloud.sql.v1beta4.SqlFlagsListRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlFlagsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlFlagsServiceStub extends SqlFlagsServiceStub { + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlFlagsService/List") + .setRequestMarshaller(ProtoUtils.marshaller(SqlFlagsListRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(FlagsListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSqlFlagsServiceStub create(SqlFlagsServiceStubSettings settings) + throws IOException { + return new GrpcSqlFlagsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlFlagsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlFlagsServiceStub( + SqlFlagsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlFlagsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlFlagsServiceStub( + SqlFlagsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlFlagsServiceStub, 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 GrpcSqlFlagsServiceStub( + SqlFlagsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlFlagsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlFlagsServiceStub, 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 GrpcSqlFlagsServiceStub( + SqlFlagsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .build(); + + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlInstancesServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlInstancesServiceCallableFactory.java new file mode 100644 index 000000000000..53075116b98a --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlInstancesServiceCallableFactory.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlInstancesService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlInstancesServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlInstancesServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlInstancesServiceStub.java new file mode 100644 index 000000000000..d69af6ccd52c --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlInstancesServiceStub.java @@ -0,0 +1,2117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1beta4.DatabaseInstance; +import com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse; +import com.google.cloud.sql.v1beta4.InstancesListResponse; +import com.google.cloud.sql.v1beta4.InstancesListServerCasResponse; +import com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesExportRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesGetRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesImportRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse; +import com.google.cloud.sql.v1beta4.SslCert; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlInstancesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlInstancesServiceStub extends SqlInstancesServiceStub { + private static final MethodDescriptor + addServerCaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/AddServerCa") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesAddServerCaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + addServerCertificateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/AddServerCertificate") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesAddServerCertificateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + addEntraIdCertificateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/AddEntraIdCertificate") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesAddEntraIdCertificateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor cloneMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Clone") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesCloneRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Delete") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesDeleteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + demoteMasterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/DemoteMaster") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesDemoteMasterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + demoteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Demote") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesDemoteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + exportMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Export") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesExportRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + failoverMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Failover") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesFailoverRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + reencryptMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Reencrypt") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesReencryptRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Get") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesGetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(DatabaseInstance.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + import_MethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Import") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesImportRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + insertMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Insert") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesInsertRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/List") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesListRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(InstancesListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesListServerCasRequest, InstancesListServerCasResponse> + listServerCasMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/ListServerCas") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesListServerCasRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(InstancesListServerCasResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/ListServerCertificates") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesListServerCertificatesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + InstancesListServerCertificatesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/ListEntraIdCertificates") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesListEntraIdCertificatesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + InstancesListEntraIdCertificatesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor patchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Patch") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesPatchRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + promoteReplicaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/PromoteReplica") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesPromoteReplicaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + switchoverMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Switchover") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesSwitchoverRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + resetSslConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/ResetSslConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesResetSslConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + restartMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Restart") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesRestartRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + restoreBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/RestoreBackup") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesRestoreBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + rotateServerCaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/RotateServerCa") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesRotateServerCaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + rotateServerCertificateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/RotateServerCertificate") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesRotateServerCertificateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + rotateEntraIdCertificateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/RotateEntraIdCertificate") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesRotateEntraIdCertificateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + startReplicaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/StartReplica") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesStartReplicaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + stopReplicaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/StopReplica") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesStopReplicaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + truncateLogMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/TruncateLog") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesTruncateLogRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Update") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesUpdateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createEphemeralMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/CreateEphemeral") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesCreateEphemeralCertRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SslCert.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + rescheduleMaintenanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/RescheduleMaintenance") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesRescheduleMaintenanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/VerifyExternalSyncSettings") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesVerifyExternalSyncSettingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + SqlInstancesVerifyExternalSyncSettingsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + startExternalSyncMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/StartExternalSync") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesStartExternalSyncRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + performDiskShrinkMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/PerformDiskShrink") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesPerformDiskShrinkRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/GetDiskShrinkConfig") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesGetDiskShrinkConfigRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + SqlInstancesGetDiskShrinkConfigResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + resetReplicaSizeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/ResetReplicaSize") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesResetReplicaSizeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/GetLatestRecoveryTime") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesGetLatestRecoveryTimeRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + SqlInstancesGetLatestRecoveryTimeResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesExecuteSqlRequest, SqlInstancesExecuteSqlResponse> + executeSqlMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/ExecuteSql") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesExecuteSqlRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SqlInstancesExecuteSqlResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/AcquireSsrsLease") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesAcquireSsrsLeaseRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SqlInstancesAcquireSsrsLeaseResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/ReleaseSsrsLease") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesReleaseSsrsLeaseRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SqlInstancesReleaseSsrsLeaseResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + preCheckMajorVersionUpgradeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/PreCheckMajorVersionUpgrade") + .setRequestMarshaller( + ProtoUtils.marshaller( + SqlInstancesPreCheckMajorVersionUpgradeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + pointInTimeRestoreMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/PointInTimeRestore") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlInstancesPointInTimeRestoreRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable addServerCaCallable; + private final UnaryCallable + addServerCertificateCallable; + private final UnaryCallable + addEntraIdCertificateCallable; + private final UnaryCallable cloneCallable; + private final UnaryCallable deleteCallable; + private final UnaryCallable demoteMasterCallable; + private final UnaryCallable demoteCallable; + private final UnaryCallable exportCallable; + private final UnaryCallable failoverCallable; + private final UnaryCallable reencryptCallable; + private final UnaryCallable getCallable; + private final UnaryCallable import_Callable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + private final UnaryCallable + listServerCasCallable; + private final UnaryCallable< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesCallable; + private final UnaryCallable< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesCallable; + private final UnaryCallable patchCallable; + private final UnaryCallable promoteReplicaCallable; + private final UnaryCallable switchoverCallable; + private final UnaryCallable resetSslConfigCallable; + private final UnaryCallable restartCallable; + private final UnaryCallable restoreBackupCallable; + private final UnaryCallable rotateServerCaCallable; + private final UnaryCallable + rotateServerCertificateCallable; + private final UnaryCallable + rotateEntraIdCertificateCallable; + private final UnaryCallable startReplicaCallable; + private final UnaryCallable stopReplicaCallable; + private final UnaryCallable truncateLogCallable; + private final UnaryCallable updateCallable; + private final UnaryCallable + createEphemeralCallable; + private final UnaryCallable + rescheduleMaintenanceCallable; + private final UnaryCallable< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsCallable; + private final UnaryCallable + startExternalSyncCallable; + private final UnaryCallable + performDiskShrinkCallable; + private final UnaryCallable< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigCallable; + private final UnaryCallable + resetReplicaSizeCallable; + private final UnaryCallable< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeCallable; + private final UnaryCallable + executeSqlCallable; + private final UnaryCallable< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseCallable; + private final UnaryCallable< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseCallable; + private final UnaryCallable + preCheckMajorVersionUpgradeCallable; + private final UnaryCallable + pointInTimeRestoreCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate ADD_SERVER_CA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ADD_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ADD_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate CLONE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate DEMOTE_MASTER_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate DEMOTE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate EXPORT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate FAILOVER_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate REENCRYPT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate IMPORT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + private static final PathTemplate LIST_SERVER_CAS_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_SERVER_CERTIFICATES_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_ENTRA_ID_CERTIFICATES_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PATCH_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PROMOTE_REPLICA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate SWITCHOVER_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESET_SSL_CONFIG_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESTART_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESTORE_BACKUP_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ROTATE_SERVER_CA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ROTATE_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ROTATE_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate START_REPLICA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate STOP_REPLICA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate TRUNCATE_LOG_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate UPDATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate CREATE_EPHEMERAL_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESCHEDULE_MAINTENANCE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate VERIFY_EXTERNAL_SYNC_SETTINGS_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate START_EXTERNAL_SYNC_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PERFORM_DISK_SHRINK_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_DISK_SHRINK_CONFIG_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESET_REPLICA_SIZE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_LATEST_RECOVERY_TIME_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate EXECUTE_SQL_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ACQUIRE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RELEASE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PRE_CHECK_MAJOR_VERSION_UPGRADE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate POINT_IN_TIME_RESTORE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("{parent=projects/*}"); + + public static final GrpcSqlInstancesServiceStub create(SqlInstancesServiceStubSettings settings) + throws IOException { + return new GrpcSqlInstancesServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlInstancesServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlInstancesServiceStub( + SqlInstancesServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlInstancesServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlInstancesServiceStub( + SqlInstancesServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlInstancesServiceStub, 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 GrpcSqlInstancesServiceStub( + SqlInstancesServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlInstancesServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlInstancesServiceStub, 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 GrpcSqlInstancesServiceStub( + SqlInstancesServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings addServerCaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addServerCaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ADD_SERVER_CA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings + addServerCertificateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addServerCertificateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ADD_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + addEntraIdCertificateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addEntraIdCertificateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ADD_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings cloneTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(cloneMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return CLONE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings deleteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings demoteMasterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(demoteMasterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DEMOTE_MASTER_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings demoteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(demoteMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DEMOTE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings exportTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(exportMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return EXPORT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings failoverTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(failoverMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return FAILOVER_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings reencryptTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(reencryptMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return REENCRYPT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings getTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings import_TransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(import_MethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return IMPORT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings insertTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings + listServerCasTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listServerCasMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_SERVER_CAS_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(listServerCertificatesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_SERVER_CERTIFICATES_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(listEntraIdCertificatesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_ENTRA_ID_CERTIFICATES_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings patchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(patchMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PATCH_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings promoteReplicaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(promoteReplicaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PROMOTE_REPLICA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings switchoverTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(switchoverMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return SWITCHOVER_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings resetSslConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(resetSslConfigMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESET_SSL_CONFIG_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings restartTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restartMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESTART_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings restoreBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restoreBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESTORE_BACKUP_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings rotateServerCaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(rotateServerCaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ROTATE_SERVER_CA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings + rotateServerCertificateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(rotateServerCertificateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ROTATE_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + rotateEntraIdCertificateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(rotateEntraIdCertificateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ROTATE_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings startReplicaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(startReplicaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return START_REPLICA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings stopReplicaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(stopReplicaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return STOP_REPLICA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings truncateLogTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(truncateLogMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return TRUNCATE_LOG_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings updateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return UPDATE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings + createEphemeralTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createEphemeralMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return CREATE_EPHEMERAL_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + rescheduleMaintenanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(rescheduleMaintenanceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESCHEDULE_MAINTENANCE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(verifyExternalSyncSettingsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return VERIFY_EXTERNAL_SYNC_SETTINGS_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + startExternalSyncTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(startExternalSyncMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return START_EXTERNAL_SYNC_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + performDiskShrinkTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(performDiskShrinkMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PERFORM_DISK_SHRINK_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(getDiskShrinkConfigMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_DISK_SHRINK_CONFIG_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + resetReplicaSizeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(resetReplicaSizeMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESET_REPLICA_SIZE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(getLatestRecoveryTimeMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_LATEST_RECOVERY_TIME_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + executeSqlTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(executeSqlMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return EXECUTE_SQL_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings + acquireSsrsLeaseTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(acquireSsrsLeaseMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ACQUIRE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + releaseSsrsLeaseTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(releaseSsrsLeaseMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RELEASE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + preCheckMajorVersionUpgradeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(preCheckMajorVersionUpgradeMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PRE_CHECK_MAJOR_VERSION_UPGRADE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + GrpcCallSettings + pointInTimeRestoreTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pointInTimeRestoreMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("parent", String.valueOf(request.getParent())); + return POINT_IN_TIME_RESTORE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + + this.addServerCaCallable = + callableFactory.createUnaryCallable( + addServerCaTransportSettings, settings.addServerCaSettings(), clientContext); + this.addServerCertificateCallable = + callableFactory.createUnaryCallable( + addServerCertificateTransportSettings, + settings.addServerCertificateSettings(), + clientContext); + this.addEntraIdCertificateCallable = + callableFactory.createUnaryCallable( + addEntraIdCertificateTransportSettings, + settings.addEntraIdCertificateSettings(), + clientContext); + this.cloneCallable = + callableFactory.createUnaryCallable( + cloneTransportSettings, settings.cloneSettings(), clientContext); + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.demoteMasterCallable = + callableFactory.createUnaryCallable( + demoteMasterTransportSettings, settings.demoteMasterSettings(), clientContext); + this.demoteCallable = + callableFactory.createUnaryCallable( + demoteTransportSettings, settings.demoteSettings(), clientContext); + this.exportCallable = + callableFactory.createUnaryCallable( + exportTransportSettings, settings.exportSettings(), clientContext); + this.failoverCallable = + callableFactory.createUnaryCallable( + failoverTransportSettings, settings.failoverSettings(), clientContext); + this.reencryptCallable = + callableFactory.createUnaryCallable( + reencryptTransportSettings, settings.reencryptSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.import_Callable = + callableFactory.createUnaryCallable( + import_TransportSettings, settings.import_Settings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.listServerCasCallable = + callableFactory.createUnaryCallable( + listServerCasTransportSettings, settings.listServerCasSettings(), clientContext); + this.listServerCertificatesCallable = + callableFactory.createUnaryCallable( + listServerCertificatesTransportSettings, + settings.listServerCertificatesSettings(), + clientContext); + this.listEntraIdCertificatesCallable = + callableFactory.createUnaryCallable( + listEntraIdCertificatesTransportSettings, + settings.listEntraIdCertificatesSettings(), + clientContext); + this.patchCallable = + callableFactory.createUnaryCallable( + patchTransportSettings, settings.patchSettings(), clientContext); + this.promoteReplicaCallable = + callableFactory.createUnaryCallable( + promoteReplicaTransportSettings, settings.promoteReplicaSettings(), clientContext); + this.switchoverCallable = + callableFactory.createUnaryCallable( + switchoverTransportSettings, settings.switchoverSettings(), clientContext); + this.resetSslConfigCallable = + callableFactory.createUnaryCallable( + resetSslConfigTransportSettings, settings.resetSslConfigSettings(), clientContext); + this.restartCallable = + callableFactory.createUnaryCallable( + restartTransportSettings, settings.restartSettings(), clientContext); + this.restoreBackupCallable = + callableFactory.createUnaryCallable( + restoreBackupTransportSettings, settings.restoreBackupSettings(), clientContext); + this.rotateServerCaCallable = + callableFactory.createUnaryCallable( + rotateServerCaTransportSettings, settings.rotateServerCaSettings(), clientContext); + this.rotateServerCertificateCallable = + callableFactory.createUnaryCallable( + rotateServerCertificateTransportSettings, + settings.rotateServerCertificateSettings(), + clientContext); + this.rotateEntraIdCertificateCallable = + callableFactory.createUnaryCallable( + rotateEntraIdCertificateTransportSettings, + settings.rotateEntraIdCertificateSettings(), + clientContext); + this.startReplicaCallable = + callableFactory.createUnaryCallable( + startReplicaTransportSettings, settings.startReplicaSettings(), clientContext); + this.stopReplicaCallable = + callableFactory.createUnaryCallable( + stopReplicaTransportSettings, settings.stopReplicaSettings(), clientContext); + this.truncateLogCallable = + callableFactory.createUnaryCallable( + truncateLogTransportSettings, settings.truncateLogSettings(), clientContext); + this.updateCallable = + callableFactory.createUnaryCallable( + updateTransportSettings, settings.updateSettings(), clientContext); + this.createEphemeralCallable = + callableFactory.createUnaryCallable( + createEphemeralTransportSettings, settings.createEphemeralSettings(), clientContext); + this.rescheduleMaintenanceCallable = + callableFactory.createUnaryCallable( + rescheduleMaintenanceTransportSettings, + settings.rescheduleMaintenanceSettings(), + clientContext); + this.verifyExternalSyncSettingsCallable = + callableFactory.createUnaryCallable( + verifyExternalSyncSettingsTransportSettings, + settings.verifyExternalSyncSettingsSettings(), + clientContext); + this.startExternalSyncCallable = + callableFactory.createUnaryCallable( + startExternalSyncTransportSettings, + settings.startExternalSyncSettings(), + clientContext); + this.performDiskShrinkCallable = + callableFactory.createUnaryCallable( + performDiskShrinkTransportSettings, + settings.performDiskShrinkSettings(), + clientContext); + this.getDiskShrinkConfigCallable = + callableFactory.createUnaryCallable( + getDiskShrinkConfigTransportSettings, + settings.getDiskShrinkConfigSettings(), + clientContext); + this.resetReplicaSizeCallable = + callableFactory.createUnaryCallable( + resetReplicaSizeTransportSettings, settings.resetReplicaSizeSettings(), clientContext); + this.getLatestRecoveryTimeCallable = + callableFactory.createUnaryCallable( + getLatestRecoveryTimeTransportSettings, + settings.getLatestRecoveryTimeSettings(), + clientContext); + this.executeSqlCallable = + callableFactory.createUnaryCallable( + executeSqlTransportSettings, settings.executeSqlSettings(), clientContext); + this.acquireSsrsLeaseCallable = + callableFactory.createUnaryCallable( + acquireSsrsLeaseTransportSettings, settings.acquireSsrsLeaseSettings(), clientContext); + this.releaseSsrsLeaseCallable = + callableFactory.createUnaryCallable( + releaseSsrsLeaseTransportSettings, settings.releaseSsrsLeaseSettings(), clientContext); + this.preCheckMajorVersionUpgradeCallable = + callableFactory.createUnaryCallable( + preCheckMajorVersionUpgradeTransportSettings, + settings.preCheckMajorVersionUpgradeSettings(), + clientContext); + this.pointInTimeRestoreCallable = + callableFactory.createUnaryCallable( + pointInTimeRestoreTransportSettings, + settings.pointInTimeRestoreSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable addServerCaCallable() { + return addServerCaCallable; + } + + @Override + public UnaryCallable + addServerCertificateCallable() { + return addServerCertificateCallable; + } + + @Override + public UnaryCallable + addEntraIdCertificateCallable() { + return addEntraIdCertificateCallable; + } + + @Override + public UnaryCallable cloneCallable() { + return cloneCallable; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable demoteMasterCallable() { + return demoteMasterCallable; + } + + @Override + public UnaryCallable demoteCallable() { + return demoteCallable; + } + + @Override + public UnaryCallable exportCallable() { + return exportCallable; + } + + @Override + public UnaryCallable failoverCallable() { + return failoverCallable; + } + + @Override + public UnaryCallable reencryptCallable() { + return reencryptCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable import_Callable() { + return import_Callable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable + listServerCasCallable() { + return listServerCasCallable; + } + + @Override + public UnaryCallable< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesCallable() { + return listServerCertificatesCallable; + } + + @Override + public UnaryCallable< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesCallable() { + return listEntraIdCertificatesCallable; + } + + @Override + public UnaryCallable patchCallable() { + return patchCallable; + } + + @Override + public UnaryCallable promoteReplicaCallable() { + return promoteReplicaCallable; + } + + @Override + public UnaryCallable switchoverCallable() { + return switchoverCallable; + } + + @Override + public UnaryCallable resetSslConfigCallable() { + return resetSslConfigCallable; + } + + @Override + public UnaryCallable restartCallable() { + return restartCallable; + } + + @Override + public UnaryCallable restoreBackupCallable() { + return restoreBackupCallable; + } + + @Override + public UnaryCallable rotateServerCaCallable() { + return rotateServerCaCallable; + } + + @Override + public UnaryCallable + rotateServerCertificateCallable() { + return rotateServerCertificateCallable; + } + + @Override + public UnaryCallable + rotateEntraIdCertificateCallable() { + return rotateEntraIdCertificateCallable; + } + + @Override + public UnaryCallable startReplicaCallable() { + return startReplicaCallable; + } + + @Override + public UnaryCallable stopReplicaCallable() { + return stopReplicaCallable; + } + + @Override + public UnaryCallable truncateLogCallable() { + return truncateLogCallable; + } + + @Override + public UnaryCallable updateCallable() { + return updateCallable; + } + + @Override + public UnaryCallable createEphemeralCallable() { + return createEphemeralCallable; + } + + @Override + public UnaryCallable + rescheduleMaintenanceCallable() { + return rescheduleMaintenanceCallable; + } + + @Override + public UnaryCallable< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsCallable() { + return verifyExternalSyncSettingsCallable; + } + + @Override + public UnaryCallable + startExternalSyncCallable() { + return startExternalSyncCallable; + } + + @Override + public UnaryCallable + performDiskShrinkCallable() { + return performDiskShrinkCallable; + } + + @Override + public UnaryCallable< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigCallable() { + return getDiskShrinkConfigCallable; + } + + @Override + public UnaryCallable resetReplicaSizeCallable() { + return resetReplicaSizeCallable; + } + + @Override + public UnaryCallable< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeCallable() { + return getLatestRecoveryTimeCallable; + } + + @Override + public UnaryCallable + executeSqlCallable() { + return executeSqlCallable; + } + + @Override + public UnaryCallable + acquireSsrsLeaseCallable() { + return acquireSsrsLeaseCallable; + } + + @Override + public UnaryCallable + releaseSsrsLeaseCallable() { + return releaseSsrsLeaseCallable; + } + + @Override + public UnaryCallable + preCheckMajorVersionUpgradeCallable() { + return preCheckMajorVersionUpgradeCallable; + } + + @Override + public UnaryCallable + pointInTimeRestoreCallable() { + return pointInTimeRestoreCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlOperationsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlOperationsServiceCallableFactory.java new file mode 100644 index 000000000000..67cc53b00cf1 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlOperationsServiceCallableFactory.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlOperationsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlOperationsServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlOperationsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlOperationsServiceStub.java new file mode 100644 index 000000000000..207b2e22dd3d --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlOperationsServiceStub.java @@ -0,0 +1,261 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.OperationsListResponse; +import com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest; +import com.google.cloud.sql.v1beta4.SqlOperationsGetRequest; +import com.google.cloud.sql.v1beta4.SqlOperationsListRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlOperationsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlOperationsServiceStub extends SqlOperationsServiceStub { + private static final MethodDescriptor getMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlOperationsService/Get") + .setRequestMarshaller(ProtoUtils.marshaller(SqlOperationsGetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlOperationsService/List") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlOperationsListRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(OperationsListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor cancelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlOperationsService/Cancel") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlOperationsCancelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable getCallable; + private final UnaryCallable listCallable; + private final UnaryCallable cancelCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/operations/{operation}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + private static final PathTemplate CANCEL_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/operations/{operation}"); + + public static final GrpcSqlOperationsServiceStub create(SqlOperationsServiceStubSettings settings) + throws IOException { + return new GrpcSqlOperationsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlOperationsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlOperationsServiceStub( + SqlOperationsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlOperationsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlOperationsServiceStub( + SqlOperationsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlOperationsServiceStub, 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 GrpcSqlOperationsServiceStub( + SqlOperationsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlOperationsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlOperationsServiceStub, 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 GrpcSqlOperationsServiceStub( + SqlOperationsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("operation", String.valueOf(request.getOperation())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("operation", String.valueOf(request.getOperation())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings cancelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(cancelMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("operation", String.valueOf(request.getOperation())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("operation", String.valueOf(request.getOperation())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return CANCEL_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.cancelCallable = + callableFactory.createUnaryCallable( + cancelTransportSettings, settings.cancelSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable cancelCallable() { + return cancelCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlSslCertsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlSslCertsServiceCallableFactory.java new file mode 100644 index 000000000000..446b894f6de7 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlSslCertsServiceCallableFactory.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlSslCertsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlSslCertsServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlSslCertsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlSslCertsServiceStub.java new file mode 100644 index 000000000000..172712d4fec8 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlSslCertsServiceStub.java @@ -0,0 +1,313 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsListRequest; +import com.google.cloud.sql.v1beta4.SslCert; +import com.google.cloud.sql.v1beta4.SslCertsInsertResponse; +import com.google.cloud.sql.v1beta4.SslCertsListResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlSslCertsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlSslCertsServiceStub extends SqlSslCertsServiceStub { + private static final MethodDescriptor + deleteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlSslCertsService/Delete") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlSslCertsDeleteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlSslCertsService/Get") + .setRequestMarshaller(ProtoUtils.marshaller(SqlSslCertsGetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SslCert.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + insertMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlSslCertsService/Insert") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlSslCertsInsertRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SslCertsInsertResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlSslCertsService/List") + .setRequestMarshaller( + ProtoUtils.marshaller(SqlSslCertsListRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SslCertsListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + + public static final GrpcSqlSslCertsServiceStub create(SqlSslCertsServiceStubSettings settings) + throws IOException { + return new GrpcSqlSslCertsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlSslCertsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlSslCertsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlSslCertsServiceStub, 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 GrpcSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlSslCertsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlSslCertsServiceStub, 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 GrpcSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings deleteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + builder.add("sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + resourceNameSegments.put( + "sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings getTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + builder.add("sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + resourceNameSegments.put( + "sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings insertTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlTiersServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlTiersServiceCallableFactory.java new file mode 100644 index 000000000000..0880a6644a33 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlTiersServiceCallableFactory.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlTiersService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlTiersServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlTiersServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlTiersServiceStub.java new file mode 100644 index 000000000000..2fab62d8cf0f --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlTiersServiceStub.java @@ -0,0 +1,178 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1beta4.SqlTiersListRequest; +import com.google.cloud.sql.v1beta4.TiersListResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlTiersService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlTiersServiceStub extends SqlTiersServiceStub { + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlTiersService/List") + .setRequestMarshaller(ProtoUtils.marshaller(SqlTiersListRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(TiersListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + + public static final GrpcSqlTiersServiceStub create(SqlTiersServiceStubSettings settings) + throws IOException { + return new GrpcSqlTiersServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlTiersServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlTiersServiceStub( + SqlTiersServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlTiersServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlTiersServiceStub( + SqlTiersServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlTiersServiceStub, 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 GrpcSqlTiersServiceStub( + SqlTiersServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlTiersServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlTiersServiceStub, 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 GrpcSqlTiersServiceStub( + SqlTiersServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlUsersServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlUsersServiceCallableFactory.java new file mode 100644 index 000000000000..e749b9cf1b7b --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlUsersServiceCallableFactory.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SqlUsersService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlUsersServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlUsersServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlUsersServiceStub.java new file mode 100644 index 000000000000..cd60a6dce479 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/GrpcSqlUsersServiceStub.java @@ -0,0 +1,340 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlUsersGetRequest; +import com.google.cloud.sql.v1beta4.SqlUsersInsertRequest; +import com.google.cloud.sql.v1beta4.SqlUsersListRequest; +import com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest; +import com.google.cloud.sql.v1beta4.User; +import com.google.cloud.sql.v1beta4.UsersListResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SqlUsersService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSqlUsersServiceStub extends SqlUsersServiceStub { + private static final MethodDescriptor deleteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlUsersService/Delete") + .setRequestMarshaller(ProtoUtils.marshaller(SqlUsersDeleteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlUsersService/Get") + .setRequestMarshaller(ProtoUtils.marshaller(SqlUsersGetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor insertMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlUsersService/Insert") + .setRequestMarshaller(ProtoUtils.marshaller(SqlUsersInsertRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlUsersService/List") + .setRequestMarshaller(ProtoUtils.marshaller(SqlUsersListRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(UsersListResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.sql.v1beta4.SqlUsersService/Update") + .setRequestMarshaller(ProtoUtils.marshaller(SqlUsersUpdateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + private final UnaryCallable updateCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/users/{name}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate UPDATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + + public static final GrpcSqlUsersServiceStub create(SqlUsersServiceStubSettings settings) + throws IOException { + return new GrpcSqlUsersServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSqlUsersServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSqlUsersServiceStub( + SqlUsersServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSqlUsersServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSqlUsersServiceStub( + SqlUsersServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSqlUsersServiceStub, 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 GrpcSqlUsersServiceStub( + SqlUsersServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSqlUsersServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSqlUsersServiceStub, 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 GrpcSqlUsersServiceStub( + SqlUsersServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings deleteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings getTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("name", String.valueOf(request.getName())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("name", String.valueOf(request.getName())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings insertTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings listTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + GrpcCallSettings updateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return UPDATE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.updateCallable = + callableFactory.createUnaryCallable( + updateTransportSettings, settings.updateSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable updateCallable() { + return updateCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlBackupRunsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlBackupRunsServiceCallableFactory.java new file mode 100644 index 000000000000..5f03817daa5c --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlBackupRunsServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlBackupRunsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlBackupRunsServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlBackupRunsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlBackupRunsServiceStub.java new file mode 100644 index 000000000000..3ed346d888b2 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlBackupRunsServiceStub.java @@ -0,0 +1,428 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1beta4.BackupRun; +import com.google.cloud.sql.v1beta4.BackupRunsListResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlBackupRunsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlBackupRunsServiceStub extends SqlBackupRunsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + deleteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupRunsService/Delete") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "id", request.getId()); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupRunsService/Get") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "id", request.getId()); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(BackupRun.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + insertMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupRunsService/Insert") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupRunsService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "maxResults", request.getMaxResults()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BackupRunsListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/backupRuns/{id}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/backupRuns/{id}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + + public static final HttpJsonSqlBackupRunsServiceStub create( + SqlBackupRunsServiceStubSettings settings) throws IOException { + return new HttpJsonSqlBackupRunsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlBackupRunsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlBackupRunsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlBackupRunsServiceStub, 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 HttpJsonSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlBackupRunsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlBackupRunsServiceStub, 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 HttpJsonSqlBackupRunsServiceStub( + SqlBackupRunsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("id", String.valueOf(request.getId())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("id", String.valueOf(request.getId())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings getTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("id", String.valueOf(request.getId())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("id", String.valueOf(request.getId())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings insertTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(deleteMethodDescriptor); + methodDescriptors.add(getMethodDescriptor); + methodDescriptors.add(insertMethodDescriptor); + methodDescriptors.add(listMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlBackupsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlBackupsServiceCallableFactory.java new file mode 100644 index 000000000000..05e2655ceee3 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlBackupsServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlBackupsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlBackupsServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlBackupsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlBackupsServiceStub.java new file mode 100644 index 000000000000..d0110c829167 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlBackupsServiceStub.java @@ -0,0 +1,453 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import static com.google.cloud.sql.v1beta4.SqlBackupsServiceClient.ListBackupsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.CreateBackupRequest; +import com.google.cloud.sql.v1beta4.DeleteBackupRequest; +import com.google.cloud.sql.v1beta4.GetBackupRequest; +import com.google.cloud.sql.v1beta4.ListBackupsRequest; +import com.google.cloud.sql.v1beta4.ListBackupsResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.UpdateBackupRequest; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlBackupsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlBackupsServiceStub extends SqlBackupsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupsService/CreateBackup") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/{parent=projects/*}/backups", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("backup", request.getBackup(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupsService/GetBackup") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/{name=projects/*/backups/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Backup.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listBackupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupsService/ListBackups") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/{parent=projects/*}/backups", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListBackupsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupsService/UpdateBackup") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/{backup.name=projects/*/backups/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "backup.name", request.getBackup().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("backup", request.getBackup(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlBackupsService/DeleteBackup") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/{name=projects/*/backups/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createBackupCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable + listBackupsPagedCallable; + private final UnaryCallable updateBackupCallable; + private final UnaryCallable deleteBackupCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSqlBackupsServiceStub create(SqlBackupsServiceStubSettings settings) + throws IOException { + return new HttpJsonSqlBackupsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlBackupsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlBackupsServiceStub( + SqlBackupsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlBackupsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlBackupsServiceStub( + SqlBackupsServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlBackupsServiceStub, 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 HttpJsonSqlBackupsServiceStub( + SqlBackupsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlBackupsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlBackupsServiceStub, 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 HttpJsonSqlBackupsServiceStub( + SqlBackupsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings getBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings listBackupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings updateBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("backup.name", String.valueOf(request.getBackup().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + + this.createBackupCallable = + callableFactory.createUnaryCallable( + createBackupTransportSettings, settings.createBackupSettings(), clientContext); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.listBackupsPagedCallable = + callableFactory.createPagedCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.updateBackupCallable = + callableFactory.createUnaryCallable( + updateBackupTransportSettings, settings.updateBackupSettings(), clientContext); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createBackupMethodDescriptor); + methodDescriptors.add(getBackupMethodDescriptor); + methodDescriptors.add(listBackupsMethodDescriptor); + methodDescriptors.add(updateBackupMethodDescriptor); + methodDescriptors.add(deleteBackupMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createBackupCallable() { + return createBackupCallable; + } + + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable listBackupsPagedCallable() { + return listBackupsPagedCallable; + } + + @Override + public UnaryCallable updateBackupCallable() { + return updateBackupCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlConnectServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlConnectServiceCallableFactory.java new file mode 100644 index 000000000000..8887b73a09b4 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlConnectServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlConnectService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlConnectServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlConnectServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlConnectServiceStub.java new file mode 100644 index 000000000000..15303eb32b66 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlConnectServiceStub.java @@ -0,0 +1,345 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.ConnectSettings; +import com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest; +import com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse; +import com.google.cloud.sql.v1beta4.GetConnectSettingsRequest; +import com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlConnectService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlConnectServiceStub extends SqlConnectServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + getConnectSettingsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlConnectService/GetConnectSettings") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/connectSettings", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "readTime", request.getReadTime()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ConnectSettings.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + resolveConnectSettingsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlConnectService/ResolveConnectSettings") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/locations/{location}/dns/{dnsName}:resolveConnectSettings", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "dnsName", request.getDnsName()); + serializer.putPathParam(fields, "location", request.getLocation()); + 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(ConnectSettings.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + GenerateEphemeralCertRequest, GenerateEphemeralCertResponse> + generateEphemeralCertMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlConnectService/GenerateEphemeralCert") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}:generateEphemeralCert", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearInstance().clearProject().build(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateEphemeralCertResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + getConnectSettingsCallable; + private final UnaryCallable + resolveConnectSettingsCallable; + private final UnaryCallable + generateEphemeralCertCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSqlConnectServiceStub create(SqlConnectServiceStubSettings settings) + throws IOException { + return new HttpJsonSqlConnectServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlConnectServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlConnectServiceStub( + SqlConnectServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlConnectServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlConnectServiceStub( + SqlConnectServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlConnectServiceStub, 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 HttpJsonSqlConnectServiceStub( + SqlConnectServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlConnectServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlConnectServiceStub, 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 HttpJsonSqlConnectServiceStub( + SqlConnectServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + getConnectSettingsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getConnectSettingsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + resolveConnectSettingsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(resolveConnectSettingsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("dns_name", String.valueOf(request.getDnsName())); + builder.add("location", String.valueOf(request.getLocation())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + generateEphemeralCertTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(generateEphemeralCertMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .build(); + + this.getConnectSettingsCallable = + callableFactory.createUnaryCallable( + getConnectSettingsTransportSettings, + settings.getConnectSettingsSettings(), + clientContext); + this.resolveConnectSettingsCallable = + callableFactory.createUnaryCallable( + resolveConnectSettingsTransportSettings, + settings.resolveConnectSettingsSettings(), + clientContext); + this.generateEphemeralCertCallable = + callableFactory.createUnaryCallable( + generateEphemeralCertTransportSettings, + settings.generateEphemeralCertSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getConnectSettingsMethodDescriptor); + methodDescriptors.add(resolveConnectSettingsMethodDescriptor); + methodDescriptors.add(generateEphemeralCertMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable getConnectSettingsCallable() { + return getConnectSettingsCallable; + } + + @Override + public UnaryCallable + resolveConnectSettingsCallable() { + return resolveConnectSettingsCallable; + } + + @Override + public UnaryCallable + generateEphemeralCertCallable() { + return generateEphemeralCertCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlDatabasesServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlDatabasesServiceCallableFactory.java new file mode 100644 index 000000000000..f1c5aff28750 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlDatabasesServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlDatabasesService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlDatabasesServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlDatabasesServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlDatabasesServiceStub.java new file mode 100644 index 000000000000..071efc4037db --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlDatabasesServiceStub.java @@ -0,0 +1,569 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1beta4.Database; +import com.google.cloud.sql.v1beta4.DatabasesListResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesListRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlDatabasesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlDatabasesServiceStub extends SqlDatabasesServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + deleteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlDatabasesService/Delete") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "database", request.getDatabase()); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlDatabasesService/Get") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "database", request.getDatabase()); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Database.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + insertMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlDatabasesService/Insert") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/databases", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlDatabasesService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/databases", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(DatabasesListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + patchMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlDatabasesService/Patch") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "database", request.getDatabase()); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlDatabasesService/Update") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "database", request.getDatabase()); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + private final UnaryCallable patchCallable; + private final UnaryCallable updateCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PATCH_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + private static final PathTemplate UPDATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/databases/{database}"); + + public static final HttpJsonSqlDatabasesServiceStub create( + SqlDatabasesServiceStubSettings settings) throws IOException { + return new HttpJsonSqlDatabasesServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlDatabasesServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlDatabasesServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlDatabasesServiceStub, 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 HttpJsonSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlDatabasesServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlDatabasesServiceStub, 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 HttpJsonSqlDatabasesServiceStub( + SqlDatabasesServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings getTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings insertTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings patchTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PATCH_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings updateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("database", String.valueOf(request.getDatabase())); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("database", String.valueOf(request.getDatabase())); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return UPDATE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.patchCallable = + callableFactory.createUnaryCallable( + patchTransportSettings, settings.patchSettings(), clientContext); + this.updateCallable = + callableFactory.createUnaryCallable( + updateTransportSettings, settings.updateSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(deleteMethodDescriptor); + methodDescriptors.add(getMethodDescriptor); + methodDescriptors.add(insertMethodDescriptor); + methodDescriptors.add(listMethodDescriptor); + methodDescriptors.add(patchMethodDescriptor); + methodDescriptors.add(updateMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable patchCallable() { + return patchCallable; + } + + @Override + public UnaryCallable updateCallable() { + return updateCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlFlagsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlFlagsServiceCallableFactory.java new file mode 100644 index 000000000000..104144855ee8 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlFlagsServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlFlagsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlFlagsServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlFlagsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlFlagsServiceStub.java new file mode 100644 index 000000000000..0d54ac409b3d --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlFlagsServiceStub.java @@ -0,0 +1,199 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.FlagsListResponse; +import com.google.cloud.sql.v1beta4.SqlFlagsListRequest; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlFlagsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlFlagsServiceStub extends SqlFlagsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlFlagsService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/flags", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "databaseVersion", request.getDatabaseVersion()); + if (request.hasFlagScope()) { + serializer.putQueryParam( + fields, "flagScope", request.getFlagScopeValue()); + } + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(FlagsListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSqlFlagsServiceStub create(SqlFlagsServiceStubSettings settings) + throws IOException { + return new HttpJsonSqlFlagsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlFlagsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlFlagsServiceStub( + SqlFlagsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlFlagsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlFlagsServiceStub( + SqlFlagsServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlFlagsServiceStub, 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 HttpJsonSqlFlagsServiceStub( + SqlFlagsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlFlagsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlFlagsServiceStub, 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 HttpJsonSqlFlagsServiceStub( + SqlFlagsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlInstancesServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlInstancesServiceCallableFactory.java new file mode 100644 index 000000000000..9b057c1d54bd --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlInstancesServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlInstancesService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlInstancesServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlInstancesServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlInstancesServiceStub.java new file mode 100644 index 000000000000..87879f4cdf57 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlInstancesServiceStub.java @@ -0,0 +1,3344 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1beta4.DatabaseInstance; +import com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse; +import com.google.cloud.sql.v1beta4.InstancesListResponse; +import com.google.cloud.sql.v1beta4.InstancesListServerCasResponse; +import com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesExportRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesGetRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesImportRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse; +import com.google.cloud.sql.v1beta4.SslCert; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlInstancesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlInstancesServiceStub extends SqlInstancesServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + addServerCaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/AddServerCa") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/addServerCa", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + addServerCertificateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/AddServerCertificate") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/addServerCertificate", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + addEntraIdCertificateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/AddEntraIdCertificate") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/addEntraIdCertificate", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + cloneMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Clone") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/clone", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Delete") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + if (request.hasEnableFinalBackup()) { + serializer.putQueryParam( + fields, "enableFinalBackup", request.getEnableFinalBackup()); + } + serializer.putQueryParam( + fields, + "finalBackupDescription", + request.getFinalBackupDescription()); + serializer.putQueryParam( + fields, + "finalBackupExpiryTime", + request.getFinalBackupExpiryTime()); + serializer.putQueryParam( + fields, "finalBackupTtlDays", request.getFinalBackupTtlDays()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + demoteMasterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/DemoteMaster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + demoteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Demote") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/demote", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + exportMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Export") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/export", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + failoverMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Failover") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/failover", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + reencryptMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Reencrypt") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/reencrypt", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Get") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(DatabaseInstance.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + import_MethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Import") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/import", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + insertMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Insert") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "maxResults", request.getMaxResults()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(InstancesListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesListServerCasRequest, InstancesListServerCasResponse> + listServerCasMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/ListServerCas") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/listServerCas", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(InstancesListServerCasResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/ListServerCertificates") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/listServerCertificates", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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( + InstancesListServerCertificatesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/ListEntraIdCertificates") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/listEntraIdCertificates", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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( + InstancesListEntraIdCertificatesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + patchMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Patch") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + if (request.hasReconcilePscNetworking()) { + serializer.putQueryParam( + fields, + "reconcilePscNetworking", + request.getReconcilePscNetworking()); + } + if (request.hasReconcilePscNetworkingForce()) { + serializer.putQueryParam( + fields, + "reconcilePscNetworkingForce", + request.getReconcilePscNetworkingForce()); + } + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + promoteReplicaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/PromoteReplica") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "failover", request.getFailover()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + switchoverMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Switchover") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/switchover", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "dbTimeout", request.getDbTimeout()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + resetSslConfigMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/ResetSslConfig") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "mode", request.getModeValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + restartMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Restart") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/restart", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + restoreBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/RestoreBackup") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + rotateServerCaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/RotateServerCa") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + rotateServerCertificateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/RotateServerCertificate") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCertificate", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + rotateEntraIdCertificateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/RotateEntraIdCertificate") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/rotateEntraIdCertificate", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + startReplicaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/StartReplica") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/startReplica", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + stopReplicaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/StopReplica") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/stopReplica", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + truncateLogMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/TruncateLog") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/truncateLog", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/Update") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createEphemeralMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/CreateEphemeral") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SslCert.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + rescheduleMaintenanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/RescheduleMaintenance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/VerifyExternalSyncSettings") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearInstance().clearProject().build(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser + .newBuilder() + .setDefaultInstance( + SqlInstancesVerifyExternalSyncSettingsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + startExternalSyncMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/StartExternalSync") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearInstance().clearProject().build(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + performDiskShrinkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/PerformDiskShrink") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/performDiskShrink", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/GetDiskShrinkConfig") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/getDiskShrinkConfig", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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( + SqlInstancesGetDiskShrinkConfigResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + resetReplicaSizeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/ResetReplicaSize") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/resetReplicaSize", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearInstance().clearProject().build(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/GetLatestRecoveryTime") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/getLatestRecoveryTime", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + if (request.hasSourceInstanceDeletionTime()) { + serializer.putQueryParam( + fields, + "sourceInstanceDeletionTime", + request.getSourceInstanceDeletionTime()); + } + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance( + SqlInstancesGetLatestRecoveryTimeResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesExecuteSqlRequest, SqlInstancesExecuteSqlResponse> + executeSqlMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/ExecuteSql") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/executeSql", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SqlInstancesExecuteSqlResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/AcquireSsrsLease") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/acquireSsrsLease", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SqlInstancesAcquireSsrsLeaseResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/ReleaseSsrsLease") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/releaseSsrsLease", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(SqlInstancesReleaseSsrsLeaseResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SqlInstancesPreCheckMajorVersionUpgradeRequest, Operation> + preCheckMajorVersionUpgradeMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.sql.v1beta4.SqlInstancesService/PreCheckMajorVersionUpgrade") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/preCheckMajorVersionUpgrade", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pointInTimeRestoreMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlInstancesService/PointInTimeRestore") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/{parent=projects/*}:pointInTimeRestore", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("context", request.getContext(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable addServerCaCallable; + private final UnaryCallable + addServerCertificateCallable; + private final UnaryCallable + addEntraIdCertificateCallable; + private final UnaryCallable cloneCallable; + private final UnaryCallable deleteCallable; + private final UnaryCallable demoteMasterCallable; + private final UnaryCallable demoteCallable; + private final UnaryCallable exportCallable; + private final UnaryCallable failoverCallable; + private final UnaryCallable reencryptCallable; + private final UnaryCallable getCallable; + private final UnaryCallable import_Callable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + private final UnaryCallable + listServerCasCallable; + private final UnaryCallable< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesCallable; + private final UnaryCallable< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesCallable; + private final UnaryCallable patchCallable; + private final UnaryCallable promoteReplicaCallable; + private final UnaryCallable switchoverCallable; + private final UnaryCallable resetSslConfigCallable; + private final UnaryCallable restartCallable; + private final UnaryCallable restoreBackupCallable; + private final UnaryCallable rotateServerCaCallable; + private final UnaryCallable + rotateServerCertificateCallable; + private final UnaryCallable + rotateEntraIdCertificateCallable; + private final UnaryCallable startReplicaCallable; + private final UnaryCallable stopReplicaCallable; + private final UnaryCallable truncateLogCallable; + private final UnaryCallable updateCallable; + private final UnaryCallable + createEphemeralCallable; + private final UnaryCallable + rescheduleMaintenanceCallable; + private final UnaryCallable< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsCallable; + private final UnaryCallable + startExternalSyncCallable; + private final UnaryCallable + performDiskShrinkCallable; + private final UnaryCallable< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigCallable; + private final UnaryCallable + resetReplicaSizeCallable; + private final UnaryCallable< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeCallable; + private final UnaryCallable + executeSqlCallable; + private final UnaryCallable< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseCallable; + private final UnaryCallable< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseCallable; + private final UnaryCallable + preCheckMajorVersionUpgradeCallable; + private final UnaryCallable + pointInTimeRestoreCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate ADD_SERVER_CA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ADD_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ADD_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate CLONE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate DEMOTE_MASTER_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate DEMOTE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate EXPORT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate FAILOVER_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate REENCRYPT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate IMPORT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + private static final PathTemplate LIST_SERVER_CAS_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_SERVER_CERTIFICATES_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_ENTRA_ID_CERTIFICATES_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PATCH_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PROMOTE_REPLICA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate SWITCHOVER_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESET_SSL_CONFIG_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESTART_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESTORE_BACKUP_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ROTATE_SERVER_CA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ROTATE_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ROTATE_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate START_REPLICA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate STOP_REPLICA_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate TRUNCATE_LOG_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate UPDATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate CREATE_EPHEMERAL_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESCHEDULE_MAINTENANCE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate VERIFY_EXTERNAL_SYNC_SETTINGS_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate START_EXTERNAL_SYNC_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PERFORM_DISK_SHRINK_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_DISK_SHRINK_CONFIG_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RESET_REPLICA_SIZE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_LATEST_RECOVERY_TIME_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate EXECUTE_SQL_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate ACQUIRE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate RELEASE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate PRE_CHECK_MAJOR_VERSION_UPGRADE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate POINT_IN_TIME_RESTORE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("{parent=projects/*}"); + + public static final HttpJsonSqlInstancesServiceStub create( + SqlInstancesServiceStubSettings settings) throws IOException { + return new HttpJsonSqlInstancesServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlInstancesServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlInstancesServiceStub( + SqlInstancesServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlInstancesServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlInstancesServiceStub( + SqlInstancesServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlInstancesServiceStub, 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 HttpJsonSqlInstancesServiceStub( + SqlInstancesServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlInstancesServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlInstancesServiceStub, 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 HttpJsonSqlInstancesServiceStub( + SqlInstancesServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings addServerCaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addServerCaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ADD_SERVER_CA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + addServerCertificateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addServerCertificateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ADD_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + addEntraIdCertificateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addEntraIdCertificateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ADD_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings cloneTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(cloneMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return CLONE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings deleteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings demoteMasterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(demoteMasterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DEMOTE_MASTER_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings demoteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(demoteMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DEMOTE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings exportTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(exportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return EXPORT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings failoverTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(failoverMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return FAILOVER_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings reencryptTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(reencryptMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return REENCRYPT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings getTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings import_TransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(import_MethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return IMPORT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings insertTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + listServerCasTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listServerCasMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_SERVER_CAS_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(listServerCertificatesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_SERVER_CERTIFICATES_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(listEntraIdCertificatesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_ENTRA_ID_CERTIFICATES_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings patchTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PATCH_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + promoteReplicaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(promoteReplicaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PROMOTE_REPLICA_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings switchoverTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(switchoverMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return SWITCHOVER_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + resetSslConfigTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(resetSslConfigMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESET_SSL_CONFIG_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings restartTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(restartMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESTART_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + restoreBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(restoreBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESTORE_BACKUP_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + rotateServerCaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(rotateServerCaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ROTATE_SERVER_CA_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + rotateServerCertificateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(rotateServerCertificateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ROTATE_SERVER_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + rotateEntraIdCertificateTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(rotateEntraIdCertificateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ROTATE_ENTRA_ID_CERTIFICATE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings startReplicaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(startReplicaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return START_REPLICA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings stopReplicaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(stopReplicaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return STOP_REPLICA_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings truncateLogTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(truncateLogMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return TRUNCATE_LOG_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings updateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return UPDATE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + createEphemeralTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createEphemeralMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return CREATE_EPHEMERAL_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + rescheduleMaintenanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(rescheduleMaintenanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESCHEDULE_MAINTENANCE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(verifyExternalSyncSettingsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return VERIFY_EXTERNAL_SYNC_SETTINGS_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + startExternalSyncTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(startExternalSyncMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return START_EXTERNAL_SYNC_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + performDiskShrinkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(performDiskShrinkMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PERFORM_DISK_SHRINK_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(getDiskShrinkConfigMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_DISK_SHRINK_CONFIG_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + resetReplicaSizeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(resetReplicaSizeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RESET_REPLICA_SIZE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(getLatestRecoveryTimeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_LATEST_RECOVERY_TIME_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + executeSqlTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(executeSqlMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return EXECUTE_SQL_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + acquireSsrsLeaseTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(acquireSsrsLeaseMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return ACQUIRE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + releaseSsrsLeaseTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(releaseSsrsLeaseMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return RELEASE_SSRS_LEASE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + preCheckMajorVersionUpgradeTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(preCheckMajorVersionUpgradeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return PRE_CHECK_MAJOR_VERSION_UPGRADE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + HttpJsonCallSettings + pointInTimeRestoreTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pointInTimeRestoreMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("parent", String.valueOf(request.getParent())); + return POINT_IN_TIME_RESTORE_RESOURCE_NAME_TEMPLATE.instantiate( + resourceNameSegments); + }) + .build(); + + this.addServerCaCallable = + callableFactory.createUnaryCallable( + addServerCaTransportSettings, settings.addServerCaSettings(), clientContext); + this.addServerCertificateCallable = + callableFactory.createUnaryCallable( + addServerCertificateTransportSettings, + settings.addServerCertificateSettings(), + clientContext); + this.addEntraIdCertificateCallable = + callableFactory.createUnaryCallable( + addEntraIdCertificateTransportSettings, + settings.addEntraIdCertificateSettings(), + clientContext); + this.cloneCallable = + callableFactory.createUnaryCallable( + cloneTransportSettings, settings.cloneSettings(), clientContext); + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.demoteMasterCallable = + callableFactory.createUnaryCallable( + demoteMasterTransportSettings, settings.demoteMasterSettings(), clientContext); + this.demoteCallable = + callableFactory.createUnaryCallable( + demoteTransportSettings, settings.demoteSettings(), clientContext); + this.exportCallable = + callableFactory.createUnaryCallable( + exportTransportSettings, settings.exportSettings(), clientContext); + this.failoverCallable = + callableFactory.createUnaryCallable( + failoverTransportSettings, settings.failoverSettings(), clientContext); + this.reencryptCallable = + callableFactory.createUnaryCallable( + reencryptTransportSettings, settings.reencryptSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.import_Callable = + callableFactory.createUnaryCallable( + import_TransportSettings, settings.import_Settings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.listServerCasCallable = + callableFactory.createUnaryCallable( + listServerCasTransportSettings, settings.listServerCasSettings(), clientContext); + this.listServerCertificatesCallable = + callableFactory.createUnaryCallable( + listServerCertificatesTransportSettings, + settings.listServerCertificatesSettings(), + clientContext); + this.listEntraIdCertificatesCallable = + callableFactory.createUnaryCallable( + listEntraIdCertificatesTransportSettings, + settings.listEntraIdCertificatesSettings(), + clientContext); + this.patchCallable = + callableFactory.createUnaryCallable( + patchTransportSettings, settings.patchSettings(), clientContext); + this.promoteReplicaCallable = + callableFactory.createUnaryCallable( + promoteReplicaTransportSettings, settings.promoteReplicaSettings(), clientContext); + this.switchoverCallable = + callableFactory.createUnaryCallable( + switchoverTransportSettings, settings.switchoverSettings(), clientContext); + this.resetSslConfigCallable = + callableFactory.createUnaryCallable( + resetSslConfigTransportSettings, settings.resetSslConfigSettings(), clientContext); + this.restartCallable = + callableFactory.createUnaryCallable( + restartTransportSettings, settings.restartSettings(), clientContext); + this.restoreBackupCallable = + callableFactory.createUnaryCallable( + restoreBackupTransportSettings, settings.restoreBackupSettings(), clientContext); + this.rotateServerCaCallable = + callableFactory.createUnaryCallable( + rotateServerCaTransportSettings, settings.rotateServerCaSettings(), clientContext); + this.rotateServerCertificateCallable = + callableFactory.createUnaryCallable( + rotateServerCertificateTransportSettings, + settings.rotateServerCertificateSettings(), + clientContext); + this.rotateEntraIdCertificateCallable = + callableFactory.createUnaryCallable( + rotateEntraIdCertificateTransportSettings, + settings.rotateEntraIdCertificateSettings(), + clientContext); + this.startReplicaCallable = + callableFactory.createUnaryCallable( + startReplicaTransportSettings, settings.startReplicaSettings(), clientContext); + this.stopReplicaCallable = + callableFactory.createUnaryCallable( + stopReplicaTransportSettings, settings.stopReplicaSettings(), clientContext); + this.truncateLogCallable = + callableFactory.createUnaryCallable( + truncateLogTransportSettings, settings.truncateLogSettings(), clientContext); + this.updateCallable = + callableFactory.createUnaryCallable( + updateTransportSettings, settings.updateSettings(), clientContext); + this.createEphemeralCallable = + callableFactory.createUnaryCallable( + createEphemeralTransportSettings, settings.createEphemeralSettings(), clientContext); + this.rescheduleMaintenanceCallable = + callableFactory.createUnaryCallable( + rescheduleMaintenanceTransportSettings, + settings.rescheduleMaintenanceSettings(), + clientContext); + this.verifyExternalSyncSettingsCallable = + callableFactory.createUnaryCallable( + verifyExternalSyncSettingsTransportSettings, + settings.verifyExternalSyncSettingsSettings(), + clientContext); + this.startExternalSyncCallable = + callableFactory.createUnaryCallable( + startExternalSyncTransportSettings, + settings.startExternalSyncSettings(), + clientContext); + this.performDiskShrinkCallable = + callableFactory.createUnaryCallable( + performDiskShrinkTransportSettings, + settings.performDiskShrinkSettings(), + clientContext); + this.getDiskShrinkConfigCallable = + callableFactory.createUnaryCallable( + getDiskShrinkConfigTransportSettings, + settings.getDiskShrinkConfigSettings(), + clientContext); + this.resetReplicaSizeCallable = + callableFactory.createUnaryCallable( + resetReplicaSizeTransportSettings, settings.resetReplicaSizeSettings(), clientContext); + this.getLatestRecoveryTimeCallable = + callableFactory.createUnaryCallable( + getLatestRecoveryTimeTransportSettings, + settings.getLatestRecoveryTimeSettings(), + clientContext); + this.executeSqlCallable = + callableFactory.createUnaryCallable( + executeSqlTransportSettings, settings.executeSqlSettings(), clientContext); + this.acquireSsrsLeaseCallable = + callableFactory.createUnaryCallable( + acquireSsrsLeaseTransportSettings, settings.acquireSsrsLeaseSettings(), clientContext); + this.releaseSsrsLeaseCallable = + callableFactory.createUnaryCallable( + releaseSsrsLeaseTransportSettings, settings.releaseSsrsLeaseSettings(), clientContext); + this.preCheckMajorVersionUpgradeCallable = + callableFactory.createUnaryCallable( + preCheckMajorVersionUpgradeTransportSettings, + settings.preCheckMajorVersionUpgradeSettings(), + clientContext); + this.pointInTimeRestoreCallable = + callableFactory.createUnaryCallable( + pointInTimeRestoreTransportSettings, + settings.pointInTimeRestoreSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(addServerCaMethodDescriptor); + methodDescriptors.add(addServerCertificateMethodDescriptor); + methodDescriptors.add(addEntraIdCertificateMethodDescriptor); + methodDescriptors.add(cloneMethodDescriptor); + methodDescriptors.add(deleteMethodDescriptor); + methodDescriptors.add(demoteMasterMethodDescriptor); + methodDescriptors.add(demoteMethodDescriptor); + methodDescriptors.add(exportMethodDescriptor); + methodDescriptors.add(failoverMethodDescriptor); + methodDescriptors.add(reencryptMethodDescriptor); + methodDescriptors.add(getMethodDescriptor); + methodDescriptors.add(import_MethodDescriptor); + methodDescriptors.add(insertMethodDescriptor); + methodDescriptors.add(listMethodDescriptor); + methodDescriptors.add(listServerCasMethodDescriptor); + methodDescriptors.add(listServerCertificatesMethodDescriptor); + methodDescriptors.add(listEntraIdCertificatesMethodDescriptor); + methodDescriptors.add(patchMethodDescriptor); + methodDescriptors.add(promoteReplicaMethodDescriptor); + methodDescriptors.add(switchoverMethodDescriptor); + methodDescriptors.add(resetSslConfigMethodDescriptor); + methodDescriptors.add(restartMethodDescriptor); + methodDescriptors.add(restoreBackupMethodDescriptor); + methodDescriptors.add(rotateServerCaMethodDescriptor); + methodDescriptors.add(rotateServerCertificateMethodDescriptor); + methodDescriptors.add(rotateEntraIdCertificateMethodDescriptor); + methodDescriptors.add(startReplicaMethodDescriptor); + methodDescriptors.add(stopReplicaMethodDescriptor); + methodDescriptors.add(truncateLogMethodDescriptor); + methodDescriptors.add(updateMethodDescriptor); + methodDescriptors.add(createEphemeralMethodDescriptor); + methodDescriptors.add(rescheduleMaintenanceMethodDescriptor); + methodDescriptors.add(verifyExternalSyncSettingsMethodDescriptor); + methodDescriptors.add(startExternalSyncMethodDescriptor); + methodDescriptors.add(performDiskShrinkMethodDescriptor); + methodDescriptors.add(getDiskShrinkConfigMethodDescriptor); + methodDescriptors.add(resetReplicaSizeMethodDescriptor); + methodDescriptors.add(getLatestRecoveryTimeMethodDescriptor); + methodDescriptors.add(executeSqlMethodDescriptor); + methodDescriptors.add(acquireSsrsLeaseMethodDescriptor); + methodDescriptors.add(releaseSsrsLeaseMethodDescriptor); + methodDescriptors.add(preCheckMajorVersionUpgradeMethodDescriptor); + methodDescriptors.add(pointInTimeRestoreMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable addServerCaCallable() { + return addServerCaCallable; + } + + @Override + public UnaryCallable + addServerCertificateCallable() { + return addServerCertificateCallable; + } + + @Override + public UnaryCallable + addEntraIdCertificateCallable() { + return addEntraIdCertificateCallable; + } + + @Override + public UnaryCallable cloneCallable() { + return cloneCallable; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable demoteMasterCallable() { + return demoteMasterCallable; + } + + @Override + public UnaryCallable demoteCallable() { + return demoteCallable; + } + + @Override + public UnaryCallable exportCallable() { + return exportCallable; + } + + @Override + public UnaryCallable failoverCallable() { + return failoverCallable; + } + + @Override + public UnaryCallable reencryptCallable() { + return reencryptCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable import_Callable() { + return import_Callable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable + listServerCasCallable() { + return listServerCasCallable; + } + + @Override + public UnaryCallable< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesCallable() { + return listServerCertificatesCallable; + } + + @Override + public UnaryCallable< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesCallable() { + return listEntraIdCertificatesCallable; + } + + @Override + public UnaryCallable patchCallable() { + return patchCallable; + } + + @Override + public UnaryCallable promoteReplicaCallable() { + return promoteReplicaCallable; + } + + @Override + public UnaryCallable switchoverCallable() { + return switchoverCallable; + } + + @Override + public UnaryCallable resetSslConfigCallable() { + return resetSslConfigCallable; + } + + @Override + public UnaryCallable restartCallable() { + return restartCallable; + } + + @Override + public UnaryCallable restoreBackupCallable() { + return restoreBackupCallable; + } + + @Override + public UnaryCallable rotateServerCaCallable() { + return rotateServerCaCallable; + } + + @Override + public UnaryCallable + rotateServerCertificateCallable() { + return rotateServerCertificateCallable; + } + + @Override + public UnaryCallable + rotateEntraIdCertificateCallable() { + return rotateEntraIdCertificateCallable; + } + + @Override + public UnaryCallable startReplicaCallable() { + return startReplicaCallable; + } + + @Override + public UnaryCallable stopReplicaCallable() { + return stopReplicaCallable; + } + + @Override + public UnaryCallable truncateLogCallable() { + return truncateLogCallable; + } + + @Override + public UnaryCallable updateCallable() { + return updateCallable; + } + + @Override + public UnaryCallable createEphemeralCallable() { + return createEphemeralCallable; + } + + @Override + public UnaryCallable + rescheduleMaintenanceCallable() { + return rescheduleMaintenanceCallable; + } + + @Override + public UnaryCallable< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsCallable() { + return verifyExternalSyncSettingsCallable; + } + + @Override + public UnaryCallable + startExternalSyncCallable() { + return startExternalSyncCallable; + } + + @Override + public UnaryCallable + performDiskShrinkCallable() { + return performDiskShrinkCallable; + } + + @Override + public UnaryCallable< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigCallable() { + return getDiskShrinkConfigCallable; + } + + @Override + public UnaryCallable resetReplicaSizeCallable() { + return resetReplicaSizeCallable; + } + + @Override + public UnaryCallable< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeCallable() { + return getLatestRecoveryTimeCallable; + } + + @Override + public UnaryCallable + executeSqlCallable() { + return executeSqlCallable; + } + + @Override + public UnaryCallable + acquireSsrsLeaseCallable() { + return acquireSsrsLeaseCallable; + } + + @Override + public UnaryCallable + releaseSsrsLeaseCallable() { + return releaseSsrsLeaseCallable; + } + + @Override + public UnaryCallable + preCheckMajorVersionUpgradeCallable() { + return preCheckMajorVersionUpgradeCallable; + } + + @Override + public UnaryCallable + pointInTimeRestoreCallable() { + return pointInTimeRestoreCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlOperationsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlOperationsServiceCallableFactory.java new file mode 100644 index 000000000000..39cf9a831a79 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlOperationsServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlOperationsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlOperationsServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlOperationsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlOperationsServiceStub.java new file mode 100644 index 000000000000..225e3c9414bb --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlOperationsServiceStub.java @@ -0,0 +1,351 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.OperationsListResponse; +import com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest; +import com.google.cloud.sql.v1beta4.SqlOperationsGetRequest; +import com.google.cloud.sql.v1beta4.SqlOperationsListRequest; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlOperationsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlOperationsServiceStub extends SqlOperationsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor getMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlOperationsService/Get") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/operations/{operation}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "operation", request.getOperation()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlOperationsService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/operations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "instance", request.getInstance()); + serializer.putQueryParam(fields, "maxResults", request.getMaxResults()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(OperationsListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + cancelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlOperationsService/Cancel") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/operations/{operation}/cancel", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "operation", request.getOperation()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getCallable; + private final UnaryCallable listCallable; + private final UnaryCallable cancelCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/operations/{operation}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + private static final PathTemplate CANCEL_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/operations/{operation}"); + + public static final HttpJsonSqlOperationsServiceStub create( + SqlOperationsServiceStubSettings settings) throws IOException { + return new HttpJsonSqlOperationsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlOperationsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlOperationsServiceStub( + SqlOperationsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlOperationsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlOperationsServiceStub( + SqlOperationsServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlOperationsServiceStub, 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 HttpJsonSqlOperationsServiceStub( + SqlOperationsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlOperationsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlOperationsServiceStub, 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 HttpJsonSqlOperationsServiceStub( + SqlOperationsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("operation", String.valueOf(request.getOperation())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("operation", String.valueOf(request.getOperation())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings cancelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(cancelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("operation", String.valueOf(request.getOperation())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("operation", String.valueOf(request.getOperation())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return CANCEL_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.cancelCallable = + callableFactory.createUnaryCallable( + cancelTransportSettings, settings.cancelSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getMethodDescriptor); + methodDescriptors.add(listMethodDescriptor); + methodDescriptors.add(cancelMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable cancelCallable() { + return cancelCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlSslCertsServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlSslCertsServiceCallableFactory.java new file mode 100644 index 000000000000..e82161b89266 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlSslCertsServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlSslCertsService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlSslCertsServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlSslCertsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlSslCertsServiceStub.java new file mode 100644 index 000000000000..6b64b8b4ad42 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlSslCertsServiceStub.java @@ -0,0 +1,431 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsListRequest; +import com.google.cloud.sql.v1beta4.SslCert; +import com.google.cloud.sql.v1beta4.SslCertsInsertResponse; +import com.google.cloud.sql.v1beta4.SslCertsListResponse; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlSslCertsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlSslCertsServiceStub extends SqlSslCertsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + deleteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlSslCertsService/Delete") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + serializer.putPathParam( + fields, "sha1Fingerprint", request.getSha1Fingerprint()); + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlSslCertsService/Get") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + serializer.putPathParam( + fields, "sha1Fingerprint", request.getSha1Fingerprint()); + 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(SslCert.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + insertMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlSslCertsService/Insert") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SslCertsInsertResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlSslCertsService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(SslCertsListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + + public static final HttpJsonSqlSslCertsServiceStub create(SqlSslCertsServiceStubSettings settings) + throws IOException { + return new HttpJsonSqlSslCertsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlSslCertsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlSslCertsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlSslCertsServiceStub, 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 HttpJsonSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlSslCertsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlSslCertsServiceStub, 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 HttpJsonSqlSslCertsServiceStub( + SqlSslCertsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + builder.add("sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + resourceNameSegments.put( + "sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings getTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + builder.add("sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + resourceNameSegments.put( + "sha1_fingerprint", String.valueOf(request.getSha1Fingerprint())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings insertTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(deleteMethodDescriptor); + methodDescriptors.add(getMethodDescriptor); + methodDescriptors.add(insertMethodDescriptor); + methodDescriptors.add(listMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlTiersServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlTiersServiceCallableFactory.java new file mode 100644 index 000000000000..6f263e4e5f72 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlTiersServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlTiersService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlTiersServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlTiersServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlTiersServiceStub.java new file mode 100644 index 000000000000..cbf08d605f95 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlTiersServiceStub.java @@ -0,0 +1,211 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1beta4.SqlTiersListRequest; +import com.google.cloud.sql.v1beta4.TiersListResponse; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlTiersService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlTiersServiceStub extends SqlTiersServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlTiersService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/tiers", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "project", request.getProject()); + 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(TiersListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}"); + + public static final HttpJsonSqlTiersServiceStub create(SqlTiersServiceStubSettings settings) + throws IOException { + return new HttpJsonSqlTiersServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlTiersServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlTiersServiceStub( + SqlTiersServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlTiersServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlTiersServiceStub( + SqlTiersServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlTiersServiceStub, 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 HttpJsonSqlTiersServiceStub( + SqlTiersServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlTiersServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlTiersServiceStub, 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 HttpJsonSqlTiersServiceStub( + SqlTiersServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlUsersServiceCallableFactory.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlUsersServiceCallableFactory.java new file mode 100644 index 000000000000..aed05e15cc9f --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlUsersServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SqlUsersService service API. + * + *

This class is for advanced usage. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlUsersServiceCallableFactory + 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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlUsersServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlUsersServiceStub.java new file mode 100644 index 000000000000..186c24954232 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/HttpJsonSqlUsersServiceStub.java @@ -0,0 +1,501 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlUsersGetRequest; +import com.google.cloud.sql.v1beta4.SqlUsersInsertRequest; +import com.google.cloud.sql.v1beta4.SqlUsersListRequest; +import com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest; +import com.google.cloud.sql.v1beta4.User; +import com.google.cloud.sql.v1beta4.UsersListResponse; +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; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SqlUsersService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSqlUsersServiceStub extends SqlUsersServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + deleteMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlUsersService/Delete") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "host", request.getHost()); + serializer.putQueryParam(fields, "name", request.getName()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlUsersService/Get") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/users/{name}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "name", request.getName()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "host", request.getHost()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + insertMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlUsersService/Insert") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlUsersService/List") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + 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(UsersListResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.sql.v1beta4.SqlUsersService/Update") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/sql/v1beta4/projects/{project}/instances/{instance}/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "instance", request.getInstance()); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "databaseRoles", request.getDatabaseRolesList()); + serializer.putQueryParam(fields, "host", request.getHost()); + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasRevokeExistingRoles()) { + serializer.putQueryParam( + fields, "revokeExistingRoles", request.getRevokeExistingRoles()); + } + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("body", request.getBody(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable deleteCallable; + private final UnaryCallable getCallable; + private final UnaryCallable insertCallable; + private final UnaryCallable listCallable; + private final UnaryCallable updateCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate DELETE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate GET_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}/users/{name}"); + private static final PathTemplate INSERT_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate LIST_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + private static final PathTemplate UPDATE_RESOURCE_NAME_TEMPLATE = + PathTemplate.create("projects/{project}/instances/{instance}"); + + public static final HttpJsonSqlUsersServiceStub create(SqlUsersServiceStubSettings settings) + throws IOException { + return new HttpJsonSqlUsersServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSqlUsersServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSqlUsersServiceStub( + SqlUsersServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSqlUsersServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSqlUsersServiceStub( + SqlUsersServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSqlUsersServiceStub, 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 HttpJsonSqlUsersServiceStub( + SqlUsersServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSqlUsersServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSqlUsersServiceStub, 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 HttpJsonSqlUsersServiceStub( + SqlUsersServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings deleteTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return DELETE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings getTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("name", String.valueOf(request.getName())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("name", String.valueOf(request.getName())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return GET_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings insertTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return INSERT_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings listTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return LIST_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + HttpJsonCallSettings updateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance", String.valueOf(request.getInstance())); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) + .setResourceNameExtractor( + request -> { + Map resourceNameSegments = new HashMap(); + resourceNameSegments.put("instance", String.valueOf(request.getInstance())); + resourceNameSegments.put("project", String.valueOf(request.getProject())); + return UPDATE_RESOURCE_NAME_TEMPLATE.instantiate(resourceNameSegments); + }) + .build(); + + this.deleteCallable = + callableFactory.createUnaryCallable( + deleteTransportSettings, settings.deleteSettings(), clientContext); + this.getCallable = + callableFactory.createUnaryCallable( + getTransportSettings, settings.getSettings(), clientContext); + this.insertCallable = + callableFactory.createUnaryCallable( + insertTransportSettings, settings.insertSettings(), clientContext); + this.listCallable = + callableFactory.createUnaryCallable( + listTransportSettings, settings.listSettings(), clientContext); + this.updateCallable = + callableFactory.createUnaryCallable( + updateTransportSettings, settings.updateSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(deleteMethodDescriptor); + methodDescriptors.add(getMethodDescriptor); + methodDescriptors.add(insertMethodDescriptor); + methodDescriptors.add(listMethodDescriptor); + methodDescriptors.add(updateMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable deleteCallable() { + return deleteCallable; + } + + @Override + public UnaryCallable getCallable() { + return getCallable; + } + + @Override + public UnaryCallable insertCallable() { + return insertCallable; + } + + @Override + public UnaryCallable listCallable() { + return listCallable; + } + + @Override + public UnaryCallable updateCallable() { + return updateCallable; + } + + @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-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlBackupRunsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlBackupRunsServiceStub.java new file mode 100644 index 000000000000..c647e5c5877e --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlBackupRunsServiceStub.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.BackupRun; +import com.google.cloud.sql.v1beta4.BackupRunsListResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlBackupRunsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SqlBackupRunsServiceStub implements BackgroundResource { + + public UnaryCallable deleteCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCallable()"); + } + + public UnaryCallable getCallable() { + throw new UnsupportedOperationException("Not implemented: getCallable()"); + } + + public UnaryCallable insertCallable() { + throw new UnsupportedOperationException("Not implemented: insertCallable()"); + } + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlBackupRunsServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlBackupRunsServiceStubSettings.java new file mode 100644 index 000000000000..25cfe512496f --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlBackupRunsServiceStubSettings.java @@ -0,0 +1,428 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1beta4.BackupRun; +import com.google.cloud.sql.v1beta4.BackupRunsListResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlBackupRunsServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlBackupRunsServiceStubSettings.Builder sqlBackupRunsServiceSettingsBuilder =
+ *     SqlBackupRunsServiceStubSettings.newBuilder();
+ * sqlBackupRunsServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlBackupRunsServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlBackupRunsServiceStubSettings sqlBackupRunsServiceSettings =
+ *     sqlBackupRunsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlBackupRunsServiceStubSettings + 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings deleteSettings; + private final UnaryCallSettings getSettings; + private final UnaryCallSettings insertSettings; + private final UnaryCallSettings listSettings; + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return deleteSettings; + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return getSettings; + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return insertSettings; + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + public SqlBackupRunsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlBackupRunsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlBackupRunsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlBackupRunsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlBackupRunsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlBackupRunsServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlBackupRunsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteSettings = settingsBuilder.deleteSettings().build(); + getSettings = settingsBuilder.getSettings().build(); + insertSettings = settingsBuilder.insertSettings().build(); + listSettings = settingsBuilder.listSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlBackupRunsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder deleteSettings; + private final UnaryCallSettings.Builder getSettings; + private final UnaryCallSettings.Builder insertSettings; + private final UnaryCallSettings.Builder + listSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + deleteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, getSettings, insertSettings, listSettings); + initDefaults(this); + } + + protected Builder(SqlBackupRunsServiceStubSettings settings) { + super(settings); + + deleteSettings = settings.deleteSettings.toBuilder(); + getSettings = settings.getSettings.toBuilder(); + insertSettings = settings.insertSettings.toBuilder(); + listSettings = settings.listSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, getSettings, insertSettings, listSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .deleteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .insertSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return deleteSettings; + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getSettings; + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return insertSettings; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return listSettings; + } + + @Override + public SqlBackupRunsServiceStubSettings build() throws IOException { + return new SqlBackupRunsServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlBackupsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlBackupsServiceStub.java new file mode 100644 index 000000000000..f9ebf665d6f8 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlBackupsServiceStub.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import static com.google.cloud.sql.v1beta4.SqlBackupsServiceClient.ListBackupsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.CreateBackupRequest; +import com.google.cloud.sql.v1beta4.DeleteBackupRequest; +import com.google.cloud.sql.v1beta4.GetBackupRequest; +import com.google.cloud.sql.v1beta4.ListBackupsRequest; +import com.google.cloud.sql.v1beta4.ListBackupsResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.UpdateBackupRequest; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlBackupsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SqlBackupsServiceStub implements BackgroundResource { + + public UnaryCallable createBackupCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupCallable()"); + } + + public UnaryCallable getBackupCallable() { + throw new UnsupportedOperationException("Not implemented: getBackupCallable()"); + } + + public UnaryCallable listBackupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsPagedCallable()"); + } + + public UnaryCallable listBackupsCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsCallable()"); + } + + public UnaryCallable updateBackupCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupCallable()"); + } + + public UnaryCallable deleteBackupCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlBackupsServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlBackupsServiceStubSettings.java new file mode 100644 index 000000000000..442479bbfd23 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlBackupsServiceStubSettings.java @@ -0,0 +1,519 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import static com.google.cloud.sql.v1beta4.SqlBackupsServiceClient.ListBackupsPagedResponse; + +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.CreateBackupRequest; +import com.google.cloud.sql.v1beta4.DeleteBackupRequest; +import com.google.cloud.sql.v1beta4.GetBackupRequest; +import com.google.cloud.sql.v1beta4.ListBackupsRequest; +import com.google.cloud.sql.v1beta4.ListBackupsResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.UpdateBackupRequest; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlBackupsServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 createBackup: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlBackupsServiceStubSettings.Builder sqlBackupsServiceSettingsBuilder =
+ *     SqlBackupsServiceStubSettings.newBuilder();
+ * sqlBackupsServiceSettingsBuilder
+ *     .createBackupSettings()
+ *     .setRetrySettings(
+ *         sqlBackupsServiceSettingsBuilder
+ *             .createBackupSettings()
+ *             .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());
+ * SqlBackupsServiceStubSettings sqlBackupsServiceSettings =
+ *     sqlBackupsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlBackupsServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings createBackupSettings; + private final UnaryCallSettings getBackupSettings; + private final PagedCallSettings + listBackupsSettings; + private final UnaryCallSettings updateBackupSettings; + private final UnaryCallSettings deleteBackupSettings; + + private static final PagedListDescriptor + LIST_BACKUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBackupsRequest injectToken(ListBackupsRequest payload, String token) { + return ListBackupsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBackupsRequest injectPageSize(ListBackupsRequest payload, int pageSize) { + return ListBackupsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBackupsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBackupsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBackupsResponse payload) { + return payload.getBackupsList(); + } + }; + + private static final PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + LIST_BACKUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBackupsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BACKUPS_PAGE_STR_DESC, request, context); + return ListBackupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return createBackupSettings; + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return getBackupSettings; + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return deleteBackupSettings; + } + + public SqlBackupsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlBackupsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlBackupsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlBackupsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlBackupsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlBackupsServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlBackupsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createBackupSettings = settingsBuilder.createBackupSettings().build(); + getBackupSettings = settingsBuilder.getBackupSettings().build(); + listBackupsSettings = settingsBuilder.listBackupsSettings().build(); + updateBackupSettings = settingsBuilder.updateBackupSettings().build(); + deleteBackupSettings = settingsBuilder.deleteBackupSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlBackupsServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createBackupSettings; + private final UnaryCallSettings.Builder getBackupSettings; + private final PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings; + private final UnaryCallSettings.Builder updateBackupSettings; + private final UnaryCallSettings.Builder deleteBackupSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + createBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT); + updateBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createBackupSettings, + getBackupSettings, + listBackupsSettings, + updateBackupSettings, + deleteBackupSettings); + initDefaults(this); + } + + protected Builder(SqlBackupsServiceStubSettings settings) { + super(settings); + + createBackupSettings = settings.createBackupSettings.toBuilder(); + getBackupSettings = settings.getBackupSettings.toBuilder(); + listBackupsSettings = settings.listBackupsSettings.toBuilder(); + updateBackupSettings = settings.updateBackupSettings.toBuilder(); + deleteBackupSettings = settings.deleteBackupSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createBackupSettings, + getBackupSettings, + listBackupsSettings, + updateBackupSettings, + deleteBackupSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listBackupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return createBackupSettings; + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getBackupSettings; + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return deleteBackupSettings; + } + + @Override + public SqlBackupsServiceStubSettings build() throws IOException { + return new SqlBackupsServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlConnectServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlConnectServiceStub.java new file mode 100644 index 000000000000..cec3e491c4ac --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlConnectServiceStub.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.ConnectSettings; +import com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest; +import com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse; +import com.google.cloud.sql.v1beta4.GetConnectSettingsRequest; +import com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlConnectService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SqlConnectServiceStub implements BackgroundResource { + + public UnaryCallable getConnectSettingsCallable() { + throw new UnsupportedOperationException("Not implemented: getConnectSettingsCallable()"); + } + + public UnaryCallable + resolveConnectSettingsCallable() { + throw new UnsupportedOperationException("Not implemented: resolveConnectSettingsCallable()"); + } + + public UnaryCallable + generateEphemeralCertCallable() { + throw new UnsupportedOperationException("Not implemented: generateEphemeralCertCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlConnectServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlConnectServiceStubSettings.java new file mode 100644 index 000000000000..a24be5df135d --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlConnectServiceStubSettings.java @@ -0,0 +1,411 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1beta4.ConnectSettings; +import com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest; +import com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse; +import com.google.cloud.sql.v1beta4.GetConnectSettingsRequest; +import com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest; +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 java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlConnectServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 getConnectSettings: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlConnectServiceStubSettings.Builder sqlConnectServiceSettingsBuilder =
+ *     SqlConnectServiceStubSettings.newBuilder();
+ * sqlConnectServiceSettingsBuilder
+ *     .getConnectSettingsSettings()
+ *     .setRetrySettings(
+ *         sqlConnectServiceSettingsBuilder
+ *             .getConnectSettingsSettings()
+ *             .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());
+ * SqlConnectServiceStubSettings sqlConnectServiceSettings =
+ *     sqlConnectServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlConnectServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings + getConnectSettingsSettings; + private final UnaryCallSettings + resolveConnectSettingsSettings; + private final UnaryCallSettings + generateEphemeralCertSettings; + + /** Returns the object with the settings used for calls to getConnectSettings. */ + public UnaryCallSettings + getConnectSettingsSettings() { + return getConnectSettingsSettings; + } + + /** Returns the object with the settings used for calls to resolveConnectSettings. */ + public UnaryCallSettings + resolveConnectSettingsSettings() { + return resolveConnectSettingsSettings; + } + + /** Returns the object with the settings used for calls to generateEphemeralCert. */ + public UnaryCallSettings + generateEphemeralCertSettings() { + return generateEphemeralCertSettings; + } + + public SqlConnectServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlConnectServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlConnectServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlConnectServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlConnectServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlConnectServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlConnectServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getConnectSettingsSettings = settingsBuilder.getConnectSettingsSettings().build(); + resolveConnectSettingsSettings = settingsBuilder.resolveConnectSettingsSettings().build(); + generateEphemeralCertSettings = settingsBuilder.generateEphemeralCertSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlConnectServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + getConnectSettingsSettings; + private final UnaryCallSettings.Builder + resolveConnectSettingsSettings; + private final UnaryCallSettings.Builder< + GenerateEphemeralCertRequest, GenerateEphemeralCertResponse> + generateEphemeralCertSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + 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().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + getConnectSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + resolveConnectSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + generateEphemeralCertSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getConnectSettingsSettings, + resolveConnectSettingsSettings, + generateEphemeralCertSettings); + initDefaults(this); + } + + protected Builder(SqlConnectServiceStubSettings settings) { + super(settings); + + getConnectSettingsSettings = settings.getConnectSettingsSettings.toBuilder(); + resolveConnectSettingsSettings = settings.resolveConnectSettingsSettings.toBuilder(); + generateEphemeralCertSettings = settings.generateEphemeralCertSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getConnectSettingsSettings, + resolveConnectSettingsSettings, + generateEphemeralCertSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getConnectSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .resolveConnectSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .generateEphemeralCertSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getConnectSettings. */ + public UnaryCallSettings.Builder + getConnectSettingsSettings() { + return getConnectSettingsSettings; + } + + /** Returns the builder for the settings used for calls to resolveConnectSettings. */ + public UnaryCallSettings.Builder + resolveConnectSettingsSettings() { + return resolveConnectSettingsSettings; + } + + /** Returns the builder for the settings used for calls to generateEphemeralCert. */ + public UnaryCallSettings.Builder + generateEphemeralCertSettings() { + return generateEphemeralCertSettings; + } + + @Override + public SqlConnectServiceStubSettings build() throws IOException { + return new SqlConnectServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlDataServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlDataServiceStub.java new file mode 100644 index 000000000000..511090c2bcba --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlDataServiceStub.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.cloud.sql.v1beta4.StreamSqlDataRequest; +import com.google.cloud.sql.v1beta4.StreamSqlDataResponse; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlDataService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SqlDataServiceStub implements BackgroundResource { + + public BidiStreamingCallable + streamSqlDataCallable() { + throw new UnsupportedOperationException("Not implemented: streamSqlDataCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlDataServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlDataServiceStubSettings.java new file mode 100644 index 000000000000..99762bf03fce --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlDataServiceStubSettings.java @@ -0,0 +1,305 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.sql.v1beta4.StreamSqlDataRequest; +import com.google.cloud.sql.v1beta4.StreamSqlDataResponse; +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 java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlDataServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 streamSqlData: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlDataServiceStubSettings.Builder sqlDataServiceSettingsBuilder =
+ *     SqlDataServiceStubSettings.newBuilder();
+ * sqlDataServiceSettingsBuilder
+ *     .streamSqlDataSettings()
+ *     .setRetrySettings(
+ *         sqlDataServiceSettingsBuilder
+ *             .streamSqlDataSettings()
+ *             .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());
+ * SqlDataServiceStubSettings sqlDataServiceSettings = sqlDataServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlDataServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final StreamingCallSettings + streamSqlDataSettings; + + /** Returns the object with the settings used for calls to streamSqlData. */ + public StreamingCallSettings + streamSqlDataSettings() { + return streamSqlDataSettings; + } + + public SqlDataServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlDataServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlDataServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlDataServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlDataServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + streamSqlDataSettings = settingsBuilder.streamSqlDataSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlDataServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final StreamingCallSettings.Builder + streamSqlDataSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + 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().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + streamSqlDataSettings = StreamingCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of(); + initDefaults(this); + } + + protected Builder(SqlDataServiceStubSettings settings) { + super(settings); + + streamSqlDataSettings = settings.streamSqlDataSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of(); + } + + 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) { + 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 streamSqlData. */ + public StreamingCallSettings.Builder + streamSqlDataSettings() { + return streamSqlDataSettings; + } + + @Override + public SqlDataServiceStubSettings build() throws IOException { + return new SqlDataServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlDatabasesServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlDatabasesServiceStub.java new file mode 100644 index 000000000000..9f96cedc0865 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlDatabasesServiceStub.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.Database; +import com.google.cloud.sql.v1beta4.DatabasesListResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesListRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlDatabasesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SqlDatabasesServiceStub implements BackgroundResource { + + public UnaryCallable deleteCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCallable()"); + } + + public UnaryCallable getCallable() { + throw new UnsupportedOperationException("Not implemented: getCallable()"); + } + + public UnaryCallable insertCallable() { + throw new UnsupportedOperationException("Not implemented: insertCallable()"); + } + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + public UnaryCallable patchCallable() { + throw new UnsupportedOperationException("Not implemented: patchCallable()"); + } + + public UnaryCallable updateCallable() { + throw new UnsupportedOperationException("Not implemented: updateCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlDatabasesServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlDatabasesServiceStubSettings.java new file mode 100644 index 000000000000..008bf28d5b08 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlDatabasesServiceStubSettings.java @@ -0,0 +1,478 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1beta4.Database; +import com.google.cloud.sql.v1beta4.DatabasesListResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesListRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlDatabasesServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlDatabasesServiceStubSettings.Builder sqlDatabasesServiceSettingsBuilder =
+ *     SqlDatabasesServiceStubSettings.newBuilder();
+ * sqlDatabasesServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlDatabasesServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlDatabasesServiceStubSettings sqlDatabasesServiceSettings =
+ *     sqlDatabasesServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlDatabasesServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings deleteSettings; + private final UnaryCallSettings getSettings; + private final UnaryCallSettings insertSettings; + private final UnaryCallSettings listSettings; + private final UnaryCallSettings patchSettings; + private final UnaryCallSettings updateSettings; + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return deleteSettings; + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return getSettings; + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return insertSettings; + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + /** Returns the object with the settings used for calls to patch. */ + public UnaryCallSettings patchSettings() { + return patchSettings; + } + + /** Returns the object with the settings used for calls to update. */ + public UnaryCallSettings updateSettings() { + return updateSettings; + } + + public SqlDatabasesServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlDatabasesServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlDatabasesServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlDatabasesServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlDatabasesServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlDatabasesServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlDatabasesServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteSettings = settingsBuilder.deleteSettings().build(); + getSettings = settingsBuilder.getSettings().build(); + insertSettings = settingsBuilder.insertSettings().build(); + listSettings = settingsBuilder.listSettings().build(); + patchSettings = settingsBuilder.patchSettings().build(); + updateSettings = settingsBuilder.updateSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlDatabasesServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder deleteSettings; + private final UnaryCallSettings.Builder getSettings; + private final UnaryCallSettings.Builder insertSettings; + private final UnaryCallSettings.Builder + listSettings; + private final UnaryCallSettings.Builder patchSettings; + private final UnaryCallSettings.Builder updateSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + deleteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + patchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, + getSettings, + insertSettings, + listSettings, + patchSettings, + updateSettings); + initDefaults(this); + } + + protected Builder(SqlDatabasesServiceStubSettings settings) { + super(settings); + + deleteSettings = settings.deleteSettings.toBuilder(); + getSettings = settings.getSettings.toBuilder(); + insertSettings = settings.insertSettings.toBuilder(); + listSettings = settings.listSettings.toBuilder(); + patchSettings = settings.patchSettings.toBuilder(); + updateSettings = settings.updateSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, + getSettings, + insertSettings, + listSettings, + patchSettings, + updateSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .deleteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .insertSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .patchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return deleteSettings; + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getSettings; + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return insertSettings; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return listSettings; + } + + /** Returns the builder for the settings used for calls to patch. */ + public UnaryCallSettings.Builder patchSettings() { + return patchSettings; + } + + /** Returns the builder for the settings used for calls to update. */ + public UnaryCallSettings.Builder updateSettings() { + return updateSettings; + } + + @Override + public SqlDatabasesServiceStubSettings build() throws IOException { + return new SqlDatabasesServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlFlagsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlFlagsServiceStub.java new file mode 100644 index 000000000000..9b4d2852f7de --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlFlagsServiceStub.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.FlagsListResponse; +import com.google.cloud.sql.v1beta4.SqlFlagsListRequest; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlFlagsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SqlFlagsServiceStub implements BackgroundResource { + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlFlagsServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlFlagsServiceStubSettings.java new file mode 100644 index 000000000000..367b1265bbc7 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlFlagsServiceStubSettings.java @@ -0,0 +1,354 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1beta4.FlagsListResponse; +import com.google.cloud.sql.v1beta4.SqlFlagsListRequest; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlFlagsServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 list: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlFlagsServiceStubSettings.Builder sqlFlagsServiceSettingsBuilder =
+ *     SqlFlagsServiceStubSettings.newBuilder();
+ * sqlFlagsServiceSettingsBuilder
+ *     .listSettings()
+ *     .setRetrySettings(
+ *         sqlFlagsServiceSettingsBuilder
+ *             .listSettings()
+ *             .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());
+ * SqlFlagsServiceStubSettings sqlFlagsServiceSettings = sqlFlagsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlFlagsServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings listSettings; + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + public SqlFlagsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlFlagsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlFlagsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlFlagsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlFlagsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlFlagsServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlFlagsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listSettings = settingsBuilder.listSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlFlagsServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder listSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of(listSettings); + initDefaults(this); + } + + protected Builder(SqlFlagsServiceStubSettings settings) { + super(settings); + + listSettings = settings.listSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of(listSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder listSettings() { + return listSettings; + } + + @Override + public SqlFlagsServiceStubSettings build() throws IOException { + return new SqlFlagsServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlInstancesServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlInstancesServiceStub.java new file mode 100644 index 000000000000..f924aea7dcc1 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlInstancesServiceStub.java @@ -0,0 +1,292 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.DatabaseInstance; +import com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse; +import com.google.cloud.sql.v1beta4.InstancesListResponse; +import com.google.cloud.sql.v1beta4.InstancesListServerCasResponse; +import com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesExportRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesGetRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesImportRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse; +import com.google.cloud.sql.v1beta4.SslCert; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlInstancesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SqlInstancesServiceStub implements BackgroundResource { + + public UnaryCallable addServerCaCallable() { + throw new UnsupportedOperationException("Not implemented: addServerCaCallable()"); + } + + public UnaryCallable + addServerCertificateCallable() { + throw new UnsupportedOperationException("Not implemented: addServerCertificateCallable()"); + } + + public UnaryCallable + addEntraIdCertificateCallable() { + throw new UnsupportedOperationException("Not implemented: addEntraIdCertificateCallable()"); + } + + public UnaryCallable cloneCallable() { + throw new UnsupportedOperationException("Not implemented: cloneCallable()"); + } + + public UnaryCallable deleteCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCallable()"); + } + + public UnaryCallable demoteMasterCallable() { + throw new UnsupportedOperationException("Not implemented: demoteMasterCallable()"); + } + + public UnaryCallable demoteCallable() { + throw new UnsupportedOperationException("Not implemented: demoteCallable()"); + } + + public UnaryCallable exportCallable() { + throw new UnsupportedOperationException("Not implemented: exportCallable()"); + } + + public UnaryCallable failoverCallable() { + throw new UnsupportedOperationException("Not implemented: failoverCallable()"); + } + + public UnaryCallable reencryptCallable() { + throw new UnsupportedOperationException("Not implemented: reencryptCallable()"); + } + + public UnaryCallable getCallable() { + throw new UnsupportedOperationException("Not implemented: getCallable()"); + } + + public UnaryCallable import_Callable() { + throw new UnsupportedOperationException("Not implemented: import_Callable()"); + } + + public UnaryCallable insertCallable() { + throw new UnsupportedOperationException("Not implemented: insertCallable()"); + } + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + public UnaryCallable + listServerCasCallable() { + throw new UnsupportedOperationException("Not implemented: listServerCasCallable()"); + } + + public UnaryCallable< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesCallable() { + throw new UnsupportedOperationException("Not implemented: listServerCertificatesCallable()"); + } + + public UnaryCallable< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesCallable() { + throw new UnsupportedOperationException("Not implemented: listEntraIdCertificatesCallable()"); + } + + public UnaryCallable patchCallable() { + throw new UnsupportedOperationException("Not implemented: patchCallable()"); + } + + public UnaryCallable promoteReplicaCallable() { + throw new UnsupportedOperationException("Not implemented: promoteReplicaCallable()"); + } + + public UnaryCallable switchoverCallable() { + throw new UnsupportedOperationException("Not implemented: switchoverCallable()"); + } + + public UnaryCallable resetSslConfigCallable() { + throw new UnsupportedOperationException("Not implemented: resetSslConfigCallable()"); + } + + public UnaryCallable restartCallable() { + throw new UnsupportedOperationException("Not implemented: restartCallable()"); + } + + public UnaryCallable restoreBackupCallable() { + throw new UnsupportedOperationException("Not implemented: restoreBackupCallable()"); + } + + public UnaryCallable rotateServerCaCallable() { + throw new UnsupportedOperationException("Not implemented: rotateServerCaCallable()"); + } + + public UnaryCallable + rotateServerCertificateCallable() { + throw new UnsupportedOperationException("Not implemented: rotateServerCertificateCallable()"); + } + + public UnaryCallable + rotateEntraIdCertificateCallable() { + throw new UnsupportedOperationException("Not implemented: rotateEntraIdCertificateCallable()"); + } + + public UnaryCallable startReplicaCallable() { + throw new UnsupportedOperationException("Not implemented: startReplicaCallable()"); + } + + public UnaryCallable stopReplicaCallable() { + throw new UnsupportedOperationException("Not implemented: stopReplicaCallable()"); + } + + public UnaryCallable truncateLogCallable() { + throw new UnsupportedOperationException("Not implemented: truncateLogCallable()"); + } + + public UnaryCallable updateCallable() { + throw new UnsupportedOperationException("Not implemented: updateCallable()"); + } + + public UnaryCallable createEphemeralCallable() { + throw new UnsupportedOperationException("Not implemented: createEphemeralCallable()"); + } + + public UnaryCallable + rescheduleMaintenanceCallable() { + throw new UnsupportedOperationException("Not implemented: rescheduleMaintenanceCallable()"); + } + + public UnaryCallable< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsCallable() { + throw new UnsupportedOperationException( + "Not implemented: verifyExternalSyncSettingsCallable()"); + } + + public UnaryCallable + startExternalSyncCallable() { + throw new UnsupportedOperationException("Not implemented: startExternalSyncCallable()"); + } + + public UnaryCallable + performDiskShrinkCallable() { + throw new UnsupportedOperationException("Not implemented: performDiskShrinkCallable()"); + } + + public UnaryCallable< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getDiskShrinkConfigCallable()"); + } + + public UnaryCallable resetReplicaSizeCallable() { + throw new UnsupportedOperationException("Not implemented: resetReplicaSizeCallable()"); + } + + public UnaryCallable< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeCallable() { + throw new UnsupportedOperationException("Not implemented: getLatestRecoveryTimeCallable()"); + } + + public UnaryCallable + executeSqlCallable() { + throw new UnsupportedOperationException("Not implemented: executeSqlCallable()"); + } + + public UnaryCallable + acquireSsrsLeaseCallable() { + throw new UnsupportedOperationException("Not implemented: acquireSsrsLeaseCallable()"); + } + + public UnaryCallable + releaseSsrsLeaseCallable() { + throw new UnsupportedOperationException("Not implemented: releaseSsrsLeaseCallable()"); + } + + public UnaryCallable + preCheckMajorVersionUpgradeCallable() { + throw new UnsupportedOperationException( + "Not implemented: preCheckMajorVersionUpgradeCallable()"); + } + + public UnaryCallable + pointInTimeRestoreCallable() { + throw new UnsupportedOperationException("Not implemented: pointInTimeRestoreCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlInstancesServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlInstancesServiceStubSettings.java new file mode 100644 index 000000000000..83d5b5fd6866 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlInstancesServiceStubSettings.java @@ -0,0 +1,1485 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1beta4.DatabaseInstance; +import com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse; +import com.google.cloud.sql.v1beta4.InstancesListResponse; +import com.google.cloud.sql.v1beta4.InstancesListServerCasResponse; +import com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesExportRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesGetRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesImportRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse; +import com.google.cloud.sql.v1beta4.SslCert; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlInstancesServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 addServerCa: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlInstancesServiceStubSettings.Builder sqlInstancesServiceSettingsBuilder =
+ *     SqlInstancesServiceStubSettings.newBuilder();
+ * sqlInstancesServiceSettingsBuilder
+ *     .addServerCaSettings()
+ *     .setRetrySettings(
+ *         sqlInstancesServiceSettingsBuilder
+ *             .addServerCaSettings()
+ *             .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());
+ * SqlInstancesServiceStubSettings sqlInstancesServiceSettings =
+ *     sqlInstancesServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlInstancesServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings addServerCaSettings; + private final UnaryCallSettings + addServerCertificateSettings; + private final UnaryCallSettings + addEntraIdCertificateSettings; + private final UnaryCallSettings cloneSettings; + private final UnaryCallSettings deleteSettings; + private final UnaryCallSettings demoteMasterSettings; + private final UnaryCallSettings demoteSettings; + private final UnaryCallSettings exportSettings; + private final UnaryCallSettings failoverSettings; + private final UnaryCallSettings reencryptSettings; + private final UnaryCallSettings getSettings; + private final UnaryCallSettings import_Settings; + private final UnaryCallSettings insertSettings; + private final UnaryCallSettings listSettings; + private final UnaryCallSettings + listServerCasSettings; + private final UnaryCallSettings< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesSettings; + private final UnaryCallSettings< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesSettings; + private final UnaryCallSettings patchSettings; + private final UnaryCallSettings + promoteReplicaSettings; + private final UnaryCallSettings switchoverSettings; + private final UnaryCallSettings + resetSslConfigSettings; + private final UnaryCallSettings restartSettings; + private final UnaryCallSettings + restoreBackupSettings; + private final UnaryCallSettings + rotateServerCaSettings; + private final UnaryCallSettings + rotateServerCertificateSettings; + private final UnaryCallSettings + rotateEntraIdCertificateSettings; + private final UnaryCallSettings startReplicaSettings; + private final UnaryCallSettings stopReplicaSettings; + private final UnaryCallSettings truncateLogSettings; + private final UnaryCallSettings updateSettings; + private final UnaryCallSettings + createEphemeralSettings; + private final UnaryCallSettings + rescheduleMaintenanceSettings; + private final UnaryCallSettings< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsSettings; + private final UnaryCallSettings + startExternalSyncSettings; + private final UnaryCallSettings + performDiskShrinkSettings; + private final UnaryCallSettings< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigSettings; + private final UnaryCallSettings + resetReplicaSizeSettings; + private final UnaryCallSettings< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeSettings; + private final UnaryCallSettings + executeSqlSettings; + private final UnaryCallSettings< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseSettings; + private final UnaryCallSettings< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseSettings; + private final UnaryCallSettings + preCheckMajorVersionUpgradeSettings; + private final UnaryCallSettings + pointInTimeRestoreSettings; + + /** Returns the object with the settings used for calls to addServerCa. */ + public UnaryCallSettings addServerCaSettings() { + return addServerCaSettings; + } + + /** Returns the object with the settings used for calls to addServerCertificate. */ + public UnaryCallSettings + addServerCertificateSettings() { + return addServerCertificateSettings; + } + + /** Returns the object with the settings used for calls to addEntraIdCertificate. */ + public UnaryCallSettings + addEntraIdCertificateSettings() { + return addEntraIdCertificateSettings; + } + + /** Returns the object with the settings used for calls to clone. */ + public UnaryCallSettings cloneSettings() { + return cloneSettings; + } + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return deleteSettings; + } + + /** Returns the object with the settings used for calls to demoteMaster. */ + public UnaryCallSettings demoteMasterSettings() { + return demoteMasterSettings; + } + + /** Returns the object with the settings used for calls to demote. */ + public UnaryCallSettings demoteSettings() { + return demoteSettings; + } + + /** Returns the object with the settings used for calls to export. */ + public UnaryCallSettings exportSettings() { + return exportSettings; + } + + /** Returns the object with the settings used for calls to failover. */ + public UnaryCallSettings failoverSettings() { + return failoverSettings; + } + + /** Returns the object with the settings used for calls to reencrypt. */ + public UnaryCallSettings reencryptSettings() { + return reencryptSettings; + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return getSettings; + } + + /** Returns the object with the settings used for calls to import_. */ + public UnaryCallSettings import_Settings() { + return import_Settings; + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return insertSettings; + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + /** Returns the object with the settings used for calls to listServerCas. */ + public UnaryCallSettings + listServerCasSettings() { + return listServerCasSettings; + } + + /** Returns the object with the settings used for calls to listServerCertificates. */ + public UnaryCallSettings< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesSettings() { + return listServerCertificatesSettings; + } + + /** Returns the object with the settings used for calls to listEntraIdCertificates. */ + public UnaryCallSettings< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesSettings() { + return listEntraIdCertificatesSettings; + } + + /** Returns the object with the settings used for calls to patch. */ + public UnaryCallSettings patchSettings() { + return patchSettings; + } + + /** Returns the object with the settings used for calls to promoteReplica. */ + public UnaryCallSettings promoteReplicaSettings() { + return promoteReplicaSettings; + } + + /** Returns the object with the settings used for calls to switchover. */ + public UnaryCallSettings switchoverSettings() { + return switchoverSettings; + } + + /** Returns the object with the settings used for calls to resetSslConfig. */ + public UnaryCallSettings resetSslConfigSettings() { + return resetSslConfigSettings; + } + + /** Returns the object with the settings used for calls to restart. */ + public UnaryCallSettings restartSettings() { + return restartSettings; + } + + /** Returns the object with the settings used for calls to restoreBackup. */ + public UnaryCallSettings restoreBackupSettings() { + return restoreBackupSettings; + } + + /** Returns the object with the settings used for calls to rotateServerCa. */ + public UnaryCallSettings rotateServerCaSettings() { + return rotateServerCaSettings; + } + + /** Returns the object with the settings used for calls to rotateServerCertificate. */ + public UnaryCallSettings + rotateServerCertificateSettings() { + return rotateServerCertificateSettings; + } + + /** Returns the object with the settings used for calls to rotateEntraIdCertificate. */ + public UnaryCallSettings + rotateEntraIdCertificateSettings() { + return rotateEntraIdCertificateSettings; + } + + /** Returns the object with the settings used for calls to startReplica. */ + public UnaryCallSettings startReplicaSettings() { + return startReplicaSettings; + } + + /** Returns the object with the settings used for calls to stopReplica. */ + public UnaryCallSettings stopReplicaSettings() { + return stopReplicaSettings; + } + + /** Returns the object with the settings used for calls to truncateLog. */ + public UnaryCallSettings truncateLogSettings() { + return truncateLogSettings; + } + + /** Returns the object with the settings used for calls to update. */ + public UnaryCallSettings updateSettings() { + return updateSettings; + } + + /** Returns the object with the settings used for calls to createEphemeral. */ + public UnaryCallSettings + createEphemeralSettings() { + return createEphemeralSettings; + } + + /** Returns the object with the settings used for calls to rescheduleMaintenance. */ + public UnaryCallSettings + rescheduleMaintenanceSettings() { + return rescheduleMaintenanceSettings; + } + + /** Returns the object with the settings used for calls to verifyExternalSyncSettings. */ + public UnaryCallSettings< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsSettings() { + return verifyExternalSyncSettingsSettings; + } + + /** Returns the object with the settings used for calls to startExternalSync. */ + public UnaryCallSettings + startExternalSyncSettings() { + return startExternalSyncSettings; + } + + /** Returns the object with the settings used for calls to performDiskShrink. */ + public UnaryCallSettings + performDiskShrinkSettings() { + return performDiskShrinkSettings; + } + + /** Returns the object with the settings used for calls to getDiskShrinkConfig. */ + public UnaryCallSettings< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigSettings() { + return getDiskShrinkConfigSettings; + } + + /** Returns the object with the settings used for calls to resetReplicaSize. */ + public UnaryCallSettings + resetReplicaSizeSettings() { + return resetReplicaSizeSettings; + } + + /** Returns the object with the settings used for calls to getLatestRecoveryTime. */ + public UnaryCallSettings< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeSettings() { + return getLatestRecoveryTimeSettings; + } + + /** Returns the object with the settings used for calls to executeSql. */ + public UnaryCallSettings + executeSqlSettings() { + return executeSqlSettings; + } + + /** Returns the object with the settings used for calls to acquireSsrsLease. */ + public UnaryCallSettings< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseSettings() { + return acquireSsrsLeaseSettings; + } + + /** Returns the object with the settings used for calls to releaseSsrsLease. */ + public UnaryCallSettings< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseSettings() { + return releaseSsrsLeaseSettings; + } + + /** Returns the object with the settings used for calls to preCheckMajorVersionUpgrade. */ + public UnaryCallSettings + preCheckMajorVersionUpgradeSettings() { + return preCheckMajorVersionUpgradeSettings; + } + + /** Returns the object with the settings used for calls to pointInTimeRestore. */ + public UnaryCallSettings + pointInTimeRestoreSettings() { + return pointInTimeRestoreSettings; + } + + public SqlInstancesServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlInstancesServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlInstancesServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlInstancesServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlInstancesServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlInstancesServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlInstancesServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + addServerCaSettings = settingsBuilder.addServerCaSettings().build(); + addServerCertificateSettings = settingsBuilder.addServerCertificateSettings().build(); + addEntraIdCertificateSettings = settingsBuilder.addEntraIdCertificateSettings().build(); + cloneSettings = settingsBuilder.cloneSettings().build(); + deleteSettings = settingsBuilder.deleteSettings().build(); + demoteMasterSettings = settingsBuilder.demoteMasterSettings().build(); + demoteSettings = settingsBuilder.demoteSettings().build(); + exportSettings = settingsBuilder.exportSettings().build(); + failoverSettings = settingsBuilder.failoverSettings().build(); + reencryptSettings = settingsBuilder.reencryptSettings().build(); + getSettings = settingsBuilder.getSettings().build(); + import_Settings = settingsBuilder.import_Settings().build(); + insertSettings = settingsBuilder.insertSettings().build(); + listSettings = settingsBuilder.listSettings().build(); + listServerCasSettings = settingsBuilder.listServerCasSettings().build(); + listServerCertificatesSettings = settingsBuilder.listServerCertificatesSettings().build(); + listEntraIdCertificatesSettings = settingsBuilder.listEntraIdCertificatesSettings().build(); + patchSettings = settingsBuilder.patchSettings().build(); + promoteReplicaSettings = settingsBuilder.promoteReplicaSettings().build(); + switchoverSettings = settingsBuilder.switchoverSettings().build(); + resetSslConfigSettings = settingsBuilder.resetSslConfigSettings().build(); + restartSettings = settingsBuilder.restartSettings().build(); + restoreBackupSettings = settingsBuilder.restoreBackupSettings().build(); + rotateServerCaSettings = settingsBuilder.rotateServerCaSettings().build(); + rotateServerCertificateSettings = settingsBuilder.rotateServerCertificateSettings().build(); + rotateEntraIdCertificateSettings = settingsBuilder.rotateEntraIdCertificateSettings().build(); + startReplicaSettings = settingsBuilder.startReplicaSettings().build(); + stopReplicaSettings = settingsBuilder.stopReplicaSettings().build(); + truncateLogSettings = settingsBuilder.truncateLogSettings().build(); + updateSettings = settingsBuilder.updateSettings().build(); + createEphemeralSettings = settingsBuilder.createEphemeralSettings().build(); + rescheduleMaintenanceSettings = settingsBuilder.rescheduleMaintenanceSettings().build(); + verifyExternalSyncSettingsSettings = + settingsBuilder.verifyExternalSyncSettingsSettings().build(); + startExternalSyncSettings = settingsBuilder.startExternalSyncSettings().build(); + performDiskShrinkSettings = settingsBuilder.performDiskShrinkSettings().build(); + getDiskShrinkConfigSettings = settingsBuilder.getDiskShrinkConfigSettings().build(); + resetReplicaSizeSettings = settingsBuilder.resetReplicaSizeSettings().build(); + getLatestRecoveryTimeSettings = settingsBuilder.getLatestRecoveryTimeSettings().build(); + executeSqlSettings = settingsBuilder.executeSqlSettings().build(); + acquireSsrsLeaseSettings = settingsBuilder.acquireSsrsLeaseSettings().build(); + releaseSsrsLeaseSettings = settingsBuilder.releaseSsrsLeaseSettings().build(); + preCheckMajorVersionUpgradeSettings = + settingsBuilder.preCheckMajorVersionUpgradeSettings().build(); + pointInTimeRestoreSettings = settingsBuilder.pointInTimeRestoreSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlInstancesServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + addServerCaSettings; + private final UnaryCallSettings.Builder + addServerCertificateSettings; + private final UnaryCallSettings.Builder + addEntraIdCertificateSettings; + private final UnaryCallSettings.Builder cloneSettings; + private final UnaryCallSettings.Builder deleteSettings; + private final UnaryCallSettings.Builder + demoteMasterSettings; + private final UnaryCallSettings.Builder demoteSettings; + private final UnaryCallSettings.Builder exportSettings; + private final UnaryCallSettings.Builder + failoverSettings; + private final UnaryCallSettings.Builder + reencryptSettings; + private final UnaryCallSettings.Builder getSettings; + private final UnaryCallSettings.Builder import_Settings; + private final UnaryCallSettings.Builder insertSettings; + private final UnaryCallSettings.Builder + listSettings; + private final UnaryCallSettings.Builder< + SqlInstancesListServerCasRequest, InstancesListServerCasResponse> + listServerCasSettings; + private final UnaryCallSettings.Builder< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesSettings; + private final UnaryCallSettings.Builder< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesSettings; + private final UnaryCallSettings.Builder patchSettings; + private final UnaryCallSettings.Builder + promoteReplicaSettings; + private final UnaryCallSettings.Builder + switchoverSettings; + private final UnaryCallSettings.Builder + resetSslConfigSettings; + private final UnaryCallSettings.Builder restartSettings; + private final UnaryCallSettings.Builder + restoreBackupSettings; + private final UnaryCallSettings.Builder + rotateServerCaSettings; + private final UnaryCallSettings.Builder + rotateServerCertificateSettings; + private final UnaryCallSettings.Builder + rotateEntraIdCertificateSettings; + private final UnaryCallSettings.Builder + startReplicaSettings; + private final UnaryCallSettings.Builder + stopReplicaSettings; + private final UnaryCallSettings.Builder + truncateLogSettings; + private final UnaryCallSettings.Builder updateSettings; + private final UnaryCallSettings.Builder + createEphemeralSettings; + private final UnaryCallSettings.Builder + rescheduleMaintenanceSettings; + private final UnaryCallSettings.Builder< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsSettings; + private final UnaryCallSettings.Builder + startExternalSyncSettings; + private final UnaryCallSettings.Builder + performDiskShrinkSettings; + private final UnaryCallSettings.Builder< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigSettings; + private final UnaryCallSettings.Builder + resetReplicaSizeSettings; + private final UnaryCallSettings.Builder< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeSettings; + private final UnaryCallSettings.Builder< + SqlInstancesExecuteSqlRequest, SqlInstancesExecuteSqlResponse> + executeSqlSettings; + private final UnaryCallSettings.Builder< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseSettings; + private final UnaryCallSettings.Builder< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseSettings; + private final UnaryCallSettings.Builder< + SqlInstancesPreCheckMajorVersionUpgradeRequest, Operation> + preCheckMajorVersionUpgradeSettings; + private final UnaryCallSettings.Builder + pointInTimeRestoreSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + addServerCaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + addServerCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + addEntraIdCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + cloneSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + demoteMasterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + demoteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + exportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + failoverSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + reencryptSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + import_Settings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listServerCasSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listServerCertificatesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listEntraIdCertificatesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + patchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + promoteReplicaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + switchoverSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + resetSslConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restartSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restoreBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + rotateServerCaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + rotateServerCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + rotateEntraIdCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + startReplicaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + stopReplicaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + truncateLogSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createEphemeralSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + rescheduleMaintenanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + verifyExternalSyncSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + startExternalSyncSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + performDiskShrinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getDiskShrinkConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + resetReplicaSizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getLatestRecoveryTimeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + executeSqlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + acquireSsrsLeaseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + releaseSsrsLeaseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + preCheckMajorVersionUpgradeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + pointInTimeRestoreSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + addServerCaSettings, + addServerCertificateSettings, + addEntraIdCertificateSettings, + cloneSettings, + deleteSettings, + demoteMasterSettings, + demoteSettings, + exportSettings, + failoverSettings, + reencryptSettings, + getSettings, + import_Settings, + insertSettings, + listSettings, + listServerCasSettings, + listServerCertificatesSettings, + listEntraIdCertificatesSettings, + patchSettings, + promoteReplicaSettings, + switchoverSettings, + resetSslConfigSettings, + restartSettings, + restoreBackupSettings, + rotateServerCaSettings, + rotateServerCertificateSettings, + rotateEntraIdCertificateSettings, + startReplicaSettings, + stopReplicaSettings, + truncateLogSettings, + updateSettings, + createEphemeralSettings, + rescheduleMaintenanceSettings, + verifyExternalSyncSettingsSettings, + startExternalSyncSettings, + performDiskShrinkSettings, + getDiskShrinkConfigSettings, + resetReplicaSizeSettings, + getLatestRecoveryTimeSettings, + executeSqlSettings, + acquireSsrsLeaseSettings, + releaseSsrsLeaseSettings, + preCheckMajorVersionUpgradeSettings, + pointInTimeRestoreSettings); + initDefaults(this); + } + + protected Builder(SqlInstancesServiceStubSettings settings) { + super(settings); + + addServerCaSettings = settings.addServerCaSettings.toBuilder(); + addServerCertificateSettings = settings.addServerCertificateSettings.toBuilder(); + addEntraIdCertificateSettings = settings.addEntraIdCertificateSettings.toBuilder(); + cloneSettings = settings.cloneSettings.toBuilder(); + deleteSettings = settings.deleteSettings.toBuilder(); + demoteMasterSettings = settings.demoteMasterSettings.toBuilder(); + demoteSettings = settings.demoteSettings.toBuilder(); + exportSettings = settings.exportSettings.toBuilder(); + failoverSettings = settings.failoverSettings.toBuilder(); + reencryptSettings = settings.reencryptSettings.toBuilder(); + getSettings = settings.getSettings.toBuilder(); + import_Settings = settings.import_Settings.toBuilder(); + insertSettings = settings.insertSettings.toBuilder(); + listSettings = settings.listSettings.toBuilder(); + listServerCasSettings = settings.listServerCasSettings.toBuilder(); + listServerCertificatesSettings = settings.listServerCertificatesSettings.toBuilder(); + listEntraIdCertificatesSettings = settings.listEntraIdCertificatesSettings.toBuilder(); + patchSettings = settings.patchSettings.toBuilder(); + promoteReplicaSettings = settings.promoteReplicaSettings.toBuilder(); + switchoverSettings = settings.switchoverSettings.toBuilder(); + resetSslConfigSettings = settings.resetSslConfigSettings.toBuilder(); + restartSettings = settings.restartSettings.toBuilder(); + restoreBackupSettings = settings.restoreBackupSettings.toBuilder(); + rotateServerCaSettings = settings.rotateServerCaSettings.toBuilder(); + rotateServerCertificateSettings = settings.rotateServerCertificateSettings.toBuilder(); + rotateEntraIdCertificateSettings = settings.rotateEntraIdCertificateSettings.toBuilder(); + startReplicaSettings = settings.startReplicaSettings.toBuilder(); + stopReplicaSettings = settings.stopReplicaSettings.toBuilder(); + truncateLogSettings = settings.truncateLogSettings.toBuilder(); + updateSettings = settings.updateSettings.toBuilder(); + createEphemeralSettings = settings.createEphemeralSettings.toBuilder(); + rescheduleMaintenanceSettings = settings.rescheduleMaintenanceSettings.toBuilder(); + verifyExternalSyncSettingsSettings = settings.verifyExternalSyncSettingsSettings.toBuilder(); + startExternalSyncSettings = settings.startExternalSyncSettings.toBuilder(); + performDiskShrinkSettings = settings.performDiskShrinkSettings.toBuilder(); + getDiskShrinkConfigSettings = settings.getDiskShrinkConfigSettings.toBuilder(); + resetReplicaSizeSettings = settings.resetReplicaSizeSettings.toBuilder(); + getLatestRecoveryTimeSettings = settings.getLatestRecoveryTimeSettings.toBuilder(); + executeSqlSettings = settings.executeSqlSettings.toBuilder(); + acquireSsrsLeaseSettings = settings.acquireSsrsLeaseSettings.toBuilder(); + releaseSsrsLeaseSettings = settings.releaseSsrsLeaseSettings.toBuilder(); + preCheckMajorVersionUpgradeSettings = + settings.preCheckMajorVersionUpgradeSettings.toBuilder(); + pointInTimeRestoreSettings = settings.pointInTimeRestoreSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + addServerCaSettings, + addServerCertificateSettings, + addEntraIdCertificateSettings, + cloneSettings, + deleteSettings, + demoteMasterSettings, + demoteSettings, + exportSettings, + failoverSettings, + reencryptSettings, + getSettings, + import_Settings, + insertSettings, + listSettings, + listServerCasSettings, + listServerCertificatesSettings, + listEntraIdCertificatesSettings, + patchSettings, + promoteReplicaSettings, + switchoverSettings, + resetSslConfigSettings, + restartSettings, + restoreBackupSettings, + rotateServerCaSettings, + rotateServerCertificateSettings, + rotateEntraIdCertificateSettings, + startReplicaSettings, + stopReplicaSettings, + truncateLogSettings, + updateSettings, + createEphemeralSettings, + rescheduleMaintenanceSettings, + verifyExternalSyncSettingsSettings, + startExternalSyncSettings, + performDiskShrinkSettings, + getDiskShrinkConfigSettings, + resetReplicaSizeSettings, + getLatestRecoveryTimeSettings, + executeSqlSettings, + acquireSsrsLeaseSettings, + releaseSsrsLeaseSettings, + preCheckMajorVersionUpgradeSettings, + pointInTimeRestoreSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .addServerCaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .addServerCertificateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .addEntraIdCertificateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .cloneSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .demoteMasterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .demoteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .exportSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .failoverSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .reencryptSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .import_Settings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .insertSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listServerCasSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listServerCertificatesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listEntraIdCertificatesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .patchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .promoteReplicaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .switchoverSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .resetSslConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .restartSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .restoreBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .rotateServerCaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .rotateServerCertificateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .rotateEntraIdCertificateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .startReplicaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .stopReplicaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .truncateLogSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createEphemeralSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .rescheduleMaintenanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .verifyExternalSyncSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .startExternalSyncSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .performDiskShrinkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getDiskShrinkConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .resetReplicaSizeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLatestRecoveryTimeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .executeSqlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .acquireSsrsLeaseSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .releaseSsrsLeaseSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .preCheckMajorVersionUpgradeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .pointInTimeRestoreSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to addServerCa. */ + public UnaryCallSettings.Builder + addServerCaSettings() { + return addServerCaSettings; + } + + /** Returns the builder for the settings used for calls to addServerCertificate. */ + public UnaryCallSettings.Builder + addServerCertificateSettings() { + return addServerCertificateSettings; + } + + /** Returns the builder for the settings used for calls to addEntraIdCertificate. */ + public UnaryCallSettings.Builder + addEntraIdCertificateSettings() { + return addEntraIdCertificateSettings; + } + + /** Returns the builder for the settings used for calls to clone. */ + public UnaryCallSettings.Builder cloneSettings() { + return cloneSettings; + } + + /** Returns the builder for the settings used for calls to delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return deleteSettings; + } + + /** Returns the builder for the settings used for calls to demoteMaster. */ + public UnaryCallSettings.Builder + demoteMasterSettings() { + return demoteMasterSettings; + } + + /** Returns the builder for the settings used for calls to demote. */ + public UnaryCallSettings.Builder demoteSettings() { + return demoteSettings; + } + + /** Returns the builder for the settings used for calls to export. */ + public UnaryCallSettings.Builder exportSettings() { + return exportSettings; + } + + /** Returns the builder for the settings used for calls to failover. */ + public UnaryCallSettings.Builder failoverSettings() { + return failoverSettings; + } + + /** Returns the builder for the settings used for calls to reencrypt. */ + public UnaryCallSettings.Builder reencryptSettings() { + return reencryptSettings; + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getSettings; + } + + /** Returns the builder for the settings used for calls to import_. */ + public UnaryCallSettings.Builder import_Settings() { + return import_Settings; + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return insertSettings; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return listSettings; + } + + /** Returns the builder for the settings used for calls to listServerCas. */ + public UnaryCallSettings.Builder< + SqlInstancesListServerCasRequest, InstancesListServerCasResponse> + listServerCasSettings() { + return listServerCasSettings; + } + + /** Returns the builder for the settings used for calls to listServerCertificates. */ + public UnaryCallSettings.Builder< + SqlInstancesListServerCertificatesRequest, InstancesListServerCertificatesResponse> + listServerCertificatesSettings() { + return listServerCertificatesSettings; + } + + /** Returns the builder for the settings used for calls to listEntraIdCertificates. */ + public UnaryCallSettings.Builder< + SqlInstancesListEntraIdCertificatesRequest, InstancesListEntraIdCertificatesResponse> + listEntraIdCertificatesSettings() { + return listEntraIdCertificatesSettings; + } + + /** Returns the builder for the settings used for calls to patch. */ + public UnaryCallSettings.Builder patchSettings() { + return patchSettings; + } + + /** Returns the builder for the settings used for calls to promoteReplica. */ + public UnaryCallSettings.Builder + promoteReplicaSettings() { + return promoteReplicaSettings; + } + + /** Returns the builder for the settings used for calls to switchover. */ + public UnaryCallSettings.Builder + switchoverSettings() { + return switchoverSettings; + } + + /** Returns the builder for the settings used for calls to resetSslConfig. */ + public UnaryCallSettings.Builder + resetSslConfigSettings() { + return resetSslConfigSettings; + } + + /** Returns the builder for the settings used for calls to restart. */ + public UnaryCallSettings.Builder restartSettings() { + return restartSettings; + } + + /** Returns the builder for the settings used for calls to restoreBackup. */ + public UnaryCallSettings.Builder + restoreBackupSettings() { + return restoreBackupSettings; + } + + /** Returns the builder for the settings used for calls to rotateServerCa. */ + public UnaryCallSettings.Builder + rotateServerCaSettings() { + return rotateServerCaSettings; + } + + /** Returns the builder for the settings used for calls to rotateServerCertificate. */ + public UnaryCallSettings.Builder + rotateServerCertificateSettings() { + return rotateServerCertificateSettings; + } + + /** Returns the builder for the settings used for calls to rotateEntraIdCertificate. */ + public UnaryCallSettings.Builder + rotateEntraIdCertificateSettings() { + return rotateEntraIdCertificateSettings; + } + + /** Returns the builder for the settings used for calls to startReplica. */ + public UnaryCallSettings.Builder + startReplicaSettings() { + return startReplicaSettings; + } + + /** Returns the builder for the settings used for calls to stopReplica. */ + public UnaryCallSettings.Builder + stopReplicaSettings() { + return stopReplicaSettings; + } + + /** Returns the builder for the settings used for calls to truncateLog. */ + public UnaryCallSettings.Builder + truncateLogSettings() { + return truncateLogSettings; + } + + /** Returns the builder for the settings used for calls to update. */ + public UnaryCallSettings.Builder updateSettings() { + return updateSettings; + } + + /** Returns the builder for the settings used for calls to createEphemeral. */ + public UnaryCallSettings.Builder + createEphemeralSettings() { + return createEphemeralSettings; + } + + /** Returns the builder for the settings used for calls to rescheduleMaintenance. */ + public UnaryCallSettings.Builder + rescheduleMaintenanceSettings() { + return rescheduleMaintenanceSettings; + } + + /** Returns the builder for the settings used for calls to verifyExternalSyncSettings. */ + public UnaryCallSettings.Builder< + SqlInstancesVerifyExternalSyncSettingsRequest, + SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettingsSettings() { + return verifyExternalSyncSettingsSettings; + } + + /** Returns the builder for the settings used for calls to startExternalSync. */ + public UnaryCallSettings.Builder + startExternalSyncSettings() { + return startExternalSyncSettings; + } + + /** Returns the builder for the settings used for calls to performDiskShrink. */ + public UnaryCallSettings.Builder + performDiskShrinkSettings() { + return performDiskShrinkSettings; + } + + /** Returns the builder for the settings used for calls to getDiskShrinkConfig. */ + public UnaryCallSettings.Builder< + SqlInstancesGetDiskShrinkConfigRequest, SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfigSettings() { + return getDiskShrinkConfigSettings; + } + + /** Returns the builder for the settings used for calls to resetReplicaSize. */ + public UnaryCallSettings.Builder + resetReplicaSizeSettings() { + return resetReplicaSizeSettings; + } + + /** Returns the builder for the settings used for calls to getLatestRecoveryTime. */ + public UnaryCallSettings.Builder< + SqlInstancesGetLatestRecoveryTimeRequest, SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTimeSettings() { + return getLatestRecoveryTimeSettings; + } + + /** Returns the builder for the settings used for calls to executeSql. */ + public UnaryCallSettings.Builder + executeSqlSettings() { + return executeSqlSettings; + } + + /** Returns the builder for the settings used for calls to acquireSsrsLease. */ + public UnaryCallSettings.Builder< + SqlInstancesAcquireSsrsLeaseRequest, SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLeaseSettings() { + return acquireSsrsLeaseSettings; + } + + /** Returns the builder for the settings used for calls to releaseSsrsLease. */ + public UnaryCallSettings.Builder< + SqlInstancesReleaseSsrsLeaseRequest, SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLeaseSettings() { + return releaseSsrsLeaseSettings; + } + + /** Returns the builder for the settings used for calls to preCheckMajorVersionUpgrade. */ + public UnaryCallSettings.Builder + preCheckMajorVersionUpgradeSettings() { + return preCheckMajorVersionUpgradeSettings; + } + + /** Returns the builder for the settings used for calls to pointInTimeRestore. */ + public UnaryCallSettings.Builder + pointInTimeRestoreSettings() { + return pointInTimeRestoreSettings; + } + + @Override + public SqlInstancesServiceStubSettings build() throws IOException { + return new SqlInstancesServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlOperationsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlOperationsServiceStub.java new file mode 100644 index 000000000000..a0f1aa900236 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlOperationsServiceStub.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.OperationsListResponse; +import com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest; +import com.google.cloud.sql.v1beta4.SqlOperationsGetRequest; +import com.google.cloud.sql.v1beta4.SqlOperationsListRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlOperationsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SqlOperationsServiceStub implements BackgroundResource { + + public UnaryCallable getCallable() { + throw new UnsupportedOperationException("Not implemented: getCallable()"); + } + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + public UnaryCallable cancelCallable() { + throw new UnsupportedOperationException("Not implemented: cancelCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlOperationsServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlOperationsServiceStubSettings.java new file mode 100644 index 000000000000..52b4514a6865 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlOperationsServiceStubSettings.java @@ -0,0 +1,407 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.OperationsListResponse; +import com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest; +import com.google.cloud.sql.v1beta4.SqlOperationsGetRequest; +import com.google.cloud.sql.v1beta4.SqlOperationsListRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlOperationsServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 get: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlOperationsServiceStubSettings.Builder sqlOperationsServiceSettingsBuilder =
+ *     SqlOperationsServiceStubSettings.newBuilder();
+ * sqlOperationsServiceSettingsBuilder
+ *     .getSettings()
+ *     .setRetrySettings(
+ *         sqlOperationsServiceSettingsBuilder
+ *             .getSettings()
+ *             .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());
+ * SqlOperationsServiceStubSettings sqlOperationsServiceSettings =
+ *     sqlOperationsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlOperationsServiceStubSettings + 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings getSettings; + private final UnaryCallSettings listSettings; + private final UnaryCallSettings cancelSettings; + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return getSettings; + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + /** Returns the object with the settings used for calls to cancel. */ + public UnaryCallSettings cancelSettings() { + return cancelSettings; + } + + public SqlOperationsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlOperationsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlOperationsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlOperationsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlOperationsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlOperationsServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlOperationsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getSettings = settingsBuilder.getSettings().build(); + listSettings = settingsBuilder.listSettings().build(); + cancelSettings = settingsBuilder.cancelSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlOperationsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getSettings; + private final UnaryCallSettings.Builder + listSettings; + private final UnaryCallSettings.Builder cancelSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + getSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + cancelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getSettings, listSettings, cancelSettings); + initDefaults(this); + } + + protected Builder(SqlOperationsServiceStubSettings settings) { + super(settings); + + getSettings = settings.getSettings.toBuilder(); + listSettings = settings.listSettings.toBuilder(); + cancelSettings = settings.cancelSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getSettings, listSettings, cancelSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .cancelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getSettings; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder + listSettings() { + return listSettings; + } + + /** Returns the builder for the settings used for calls to cancel. */ + public UnaryCallSettings.Builder cancelSettings() { + return cancelSettings; + } + + @Override + public SqlOperationsServiceStubSettings build() throws IOException { + return new SqlOperationsServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlSslCertsServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlSslCertsServiceStub.java new file mode 100644 index 000000000000..c2acab569ace --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlSslCertsServiceStub.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsListRequest; +import com.google.cloud.sql.v1beta4.SslCert; +import com.google.cloud.sql.v1beta4.SslCertsInsertResponse; +import com.google.cloud.sql.v1beta4.SslCertsListResponse; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlSslCertsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SqlSslCertsServiceStub implements BackgroundResource { + + public UnaryCallable deleteCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCallable()"); + } + + public UnaryCallable getCallable() { + throw new UnsupportedOperationException("Not implemented: getCallable()"); + } + + public UnaryCallable insertCallable() { + throw new UnsupportedOperationException("Not implemented: insertCallable()"); + } + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlSslCertsServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlSslCertsServiceStubSettings.java new file mode 100644 index 000000000000..7d0e9986241d --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlSslCertsServiceStubSettings.java @@ -0,0 +1,429 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsListRequest; +import com.google.cloud.sql.v1beta4.SslCert; +import com.google.cloud.sql.v1beta4.SslCertsInsertResponse; +import com.google.cloud.sql.v1beta4.SslCertsListResponse; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlSslCertsServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlSslCertsServiceStubSettings.Builder sqlSslCertsServiceSettingsBuilder =
+ *     SqlSslCertsServiceStubSettings.newBuilder();
+ * sqlSslCertsServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlSslCertsServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlSslCertsServiceStubSettings sqlSslCertsServiceSettings =
+ *     sqlSslCertsServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlSslCertsServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings deleteSettings; + private final UnaryCallSettings getSettings; + private final UnaryCallSettings insertSettings; + private final UnaryCallSettings listSettings; + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return deleteSettings; + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return getSettings; + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return insertSettings; + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + public SqlSslCertsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlSslCertsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlSslCertsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlSslCertsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlSslCertsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlSslCertsServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlSslCertsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteSettings = settingsBuilder.deleteSettings().build(); + getSettings = settingsBuilder.getSettings().build(); + insertSettings = settingsBuilder.insertSettings().build(); + listSettings = settingsBuilder.listSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlSslCertsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder deleteSettings; + private final UnaryCallSettings.Builder getSettings; + private final UnaryCallSettings.Builder + insertSettings; + private final UnaryCallSettings.Builder + listSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + deleteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, getSettings, insertSettings, listSettings); + initDefaults(this); + } + + protected Builder(SqlSslCertsServiceStubSettings settings) { + super(settings); + + deleteSettings = settings.deleteSettings.toBuilder(); + getSettings = settings.getSettings.toBuilder(); + insertSettings = settings.insertSettings.toBuilder(); + listSettings = settings.listSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, getSettings, insertSettings, listSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .deleteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .insertSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return deleteSettings; + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getSettings; + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder + insertSettings() { + return insertSettings; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder listSettings() { + return listSettings; + } + + @Override + public SqlSslCertsServiceStubSettings build() throws IOException { + return new SqlSslCertsServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlTiersServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlTiersServiceStub.java new file mode 100644 index 000000000000..3f06a03d4741 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlTiersServiceStub.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.SqlTiersListRequest; +import com.google.cloud.sql.v1beta4.TiersListResponse; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlTiersService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SqlTiersServiceStub implements BackgroundResource { + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlTiersServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlTiersServiceStubSettings.java new file mode 100644 index 000000000000..f1077449f011 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlTiersServiceStubSettings.java @@ -0,0 +1,354 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1beta4.SqlTiersListRequest; +import com.google.cloud.sql.v1beta4.TiersListResponse; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlTiersServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 list: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlTiersServiceStubSettings.Builder sqlTiersServiceSettingsBuilder =
+ *     SqlTiersServiceStubSettings.newBuilder();
+ * sqlTiersServiceSettingsBuilder
+ *     .listSettings()
+ *     .setRetrySettings(
+ *         sqlTiersServiceSettingsBuilder
+ *             .listSettings()
+ *             .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());
+ * SqlTiersServiceStubSettings sqlTiersServiceSettings = sqlTiersServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlTiersServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings listSettings; + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + public SqlTiersServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlTiersServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlTiersServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlTiersServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlTiersServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlTiersServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlTiersServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listSettings = settingsBuilder.listSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlTiersServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder listSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of(listSettings); + initDefaults(this); + } + + protected Builder(SqlTiersServiceStubSettings settings) { + super(settings); + + listSettings = settings.listSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of(listSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder listSettings() { + return listSettings; + } + + @Override + public SqlTiersServiceStubSettings build() throws IOException { + return new SqlTiersServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlUsersServiceStub.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlUsersServiceStub.java new file mode 100644 index 000000000000..d52cee919e2f --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlUsersServiceStub.java @@ -0,0 +1,66 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlUsersGetRequest; +import com.google.cloud.sql.v1beta4.SqlUsersInsertRequest; +import com.google.cloud.sql.v1beta4.SqlUsersListRequest; +import com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest; +import com.google.cloud.sql.v1beta4.User; +import com.google.cloud.sql.v1beta4.UsersListResponse; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SqlUsersService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SqlUsersServiceStub implements BackgroundResource { + + public UnaryCallable deleteCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCallable()"); + } + + public UnaryCallable getCallable() { + throw new UnsupportedOperationException("Not implemented: getCallable()"); + } + + public UnaryCallable insertCallable() { + throw new UnsupportedOperationException("Not implemented: insertCallable()"); + } + + public UnaryCallable listCallable() { + throw new UnsupportedOperationException("Not implemented: listCallable()"); + } + + public UnaryCallable updateCallable() { + throw new UnsupportedOperationException("Not implemented: updateCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlUsersServiceStubSettings.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlUsersServiceStubSettings.java new file mode 100644 index 000000000000..3d05e531dcba --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/SqlUsersServiceStubSettings.java @@ -0,0 +1,444 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.ApiFunction; +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.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlUsersGetRequest; +import com.google.cloud.sql.v1beta4.SqlUsersInsertRequest; +import com.google.cloud.sql.v1beta4.SqlUsersListRequest; +import com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest; +import com.google.cloud.sql.v1beta4.User; +import com.google.cloud.sql.v1beta4.UsersListResponse; +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 java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SqlUsersServiceStub}. + * + *

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

    + *
  • The default service address (sqladmin.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 delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SqlUsersServiceStubSettings.Builder sqlUsersServiceSettingsBuilder =
+ *     SqlUsersServiceStubSettings.newBuilder();
+ * sqlUsersServiceSettingsBuilder
+ *     .deleteSettings()
+ *     .setRetrySettings(
+ *         sqlUsersServiceSettingsBuilder
+ *             .deleteSettings()
+ *             .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());
+ * SqlUsersServiceStubSettings sqlUsersServiceSettings = sqlUsersServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SqlUsersServiceStubSettings 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") + .add("https://www.googleapis.com/auth/sqlservice.admin") + .build(); + + private final UnaryCallSettings deleteSettings; + private final UnaryCallSettings getSettings; + private final UnaryCallSettings insertSettings; + private final UnaryCallSettings listSettings; + private final UnaryCallSettings updateSettings; + + /** Returns the object with the settings used for calls to delete. */ + public UnaryCallSettings deleteSettings() { + return deleteSettings; + } + + /** Returns the object with the settings used for calls to get. */ + public UnaryCallSettings getSettings() { + return getSettings; + } + + /** Returns the object with the settings used for calls to insert. */ + public UnaryCallSettings insertSettings() { + return insertSettings; + } + + /** Returns the object with the settings used for calls to list. */ + public UnaryCallSettings listSettings() { + return listSettings; + } + + /** Returns the object with the settings used for calls to update. */ + public UnaryCallSettings updateSettings() { + return updateSettings; + } + + public SqlUsersServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSqlUsersServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSqlUsersServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "sqladmin"; + } + + /** 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 "sqladmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "sqladmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlUsersServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SqlUsersServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SqlUsersServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(@Nullable 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 SqlUsersServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteSettings = settingsBuilder.deleteSettings().build(); + getSettings = settingsBuilder.getSettings().build(); + insertSettings = settingsBuilder.insertSettings().build(); + listSettings = settingsBuilder.listSettings().build(); + updateSettings = settingsBuilder.updateSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-sql") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SqlUsersServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder deleteSettings; + private final UnaryCallSettings.Builder getSettings; + private final UnaryCallSettings.Builder insertSettings; + private final UnaryCallSettings.Builder listSettings; + private final UnaryCallSettings.Builder updateSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(@Nullable ClientContext clientContext) { + super(clientContext); + + deleteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, getSettings, insertSettings, listSettings, updateSettings); + initDefaults(this); + } + + protected Builder(SqlUsersServiceStubSettings settings) { + super(settings); + + deleteSettings = settings.deleteSettings.toBuilder(); + getSettings = settings.getSettings.toBuilder(); + insertSettings = settings.insertSettings.toBuilder(); + listSettings = settings.listSettings.toBuilder(); + updateSettings = settings.updateSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteSettings, getSettings, insertSettings, listSettings, updateSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .deleteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .insertSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to delete. */ + public UnaryCallSettings.Builder deleteSettings() { + return deleteSettings; + } + + /** Returns the builder for the settings used for calls to get. */ + public UnaryCallSettings.Builder getSettings() { + return getSettings; + } + + /** Returns the builder for the settings used for calls to insert. */ + public UnaryCallSettings.Builder insertSettings() { + return insertSettings; + } + + /** Returns the builder for the settings used for calls to list. */ + public UnaryCallSettings.Builder listSettings() { + return listSettings; + } + + /** Returns the builder for the settings used for calls to update. */ + public UnaryCallSettings.Builder updateSettings() { + return updateSettings; + } + + @Override + public SqlUsersServiceStubSettings build() throws IOException { + return new SqlUsersServiceStubSettings(this); + } + } +} diff --git a/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/Version.java b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/Version.java new file mode 100644 index 000000000000..e6be3cd5224a --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/stub/Version.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub; + +import com.google.api.core.InternalApi; + +@InternalApi("For internal use only") +final class Version { + // {x-version-update-start:google-cloud-sql:current} + static final String VERSION = "0.0.0-SNAPSHOT"; + // {x-version-update-end} + +} diff --git a/java-sql/google-cloud-sql/src/main/resources/META-INF/native-image/com.google.cloud.sql.v1/reflect-config.json b/java-sql/google-cloud-sql/src/main/resources/META-INF/native-image/com.google.cloud.sql.v1/reflect-config.json new file mode 100644 index 000000000000..91a0097add34 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/resources/META-INF/native-image/com.google.cloud.sql.v1/reflect-config.json @@ -0,0 +1,6086 @@ +[ + { + "name": "com.google.api.BatchingConfigProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingConfigProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingSettingsProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingSettingsProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "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.FlowControlLimitExceededBehaviorProto", + "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.sql.v1.AclEntry", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.AclEntry$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.AcquireSsrsLeaseContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.AcquireSsrsLeaseContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.AdvancedMachineFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.AdvancedMachineFeatures$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ApiWarning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ApiWarning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ApiWarning$SqlApiWarningCode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.AutoDnsStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.AvailableDatabaseVersion", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.AvailableDatabaseVersion$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Backup", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Backup$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Backup$SqlBackupState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Backup$SqlBackupType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupConfiguration$BackupTier", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupConfiguration$TransactionalLogStorageState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupReencryptionConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupReencryptionConfig$BackupType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupReencryptionConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupRetentionSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupRetentionSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupRetentionSettings$RetentionUnit", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupRun", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupRun$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupRunsListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BackupRunsListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BakType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BinLogCoordinates", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.BinLogCoordinates$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.CloneContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.CloneContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Column", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Column$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ConnectSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ConnectSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ConnectSettings$CaMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ConnectSettings$ConnectPoolNodeConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ConnectSettings$ConnectPoolNodeConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ConnectSettings$MdxProtocolSupport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ConnectionPoolConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ConnectionPoolConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ConnectionPoolFlags", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ConnectionPoolFlags$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.CreateBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.CreateBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DataCacheConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DataCacheConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Database", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Database$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseFlags", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseFlags$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseInstance", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseInstance$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseInstance$PoolNodeConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseInstance$PoolNodeConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseInstance$SqlFailoverReplica", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseInstance$SqlFailoverReplica$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseInstance$SqlInstanceState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseInstance$SqlNetworkArchitecture", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseInstance$SqlOutOfDiskReport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseInstance$SqlOutOfDiskReport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseInstance$SqlOutOfDiskReport$SqlOutOfDiskState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseInstance$SqlScheduledMaintenance", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabaseInstance$SqlScheduledMaintenance$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabasesListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DatabasesListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DeleteBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DeleteBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DemoteContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DemoteContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DemoteMasterConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DemoteMasterConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DemoteMasterContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DemoteMasterContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DenyMaintenancePeriod", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DenyMaintenancePeriod$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DiskEncryptionConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DiskEncryptionConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DiskEncryptionStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DiskEncryptionStatus$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DnsNameMapping", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DnsNameMapping$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DnsNameMapping$ConnectionType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DnsNameMapping$DnsScope", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.DnsNameMapping$RecordManager", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExecuteSqlPayload", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExecuteSqlPayload$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExecuteSqlPayload$PartialResultMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExportContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExportContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExportContext$SqlBakExportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExportContext$SqlBakExportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExportContext$SqlCsvExportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExportContext$SqlCsvExportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExportContext$SqlExportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExportContext$SqlExportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExportContext$SqlExportOptions$MysqlExportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExportContext$SqlExportOptions$MysqlExportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExportContext$SqlExportOptions$PostgresExportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExportContext$SqlExportOptions$PostgresExportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExportContext$SqlTdeExportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExportContext$SqlTdeExportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExternalSyncParallelLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExternalSyncSelectedObject", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ExternalSyncSelectedObject$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.FailoverContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.FailoverContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.FinalBackupConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.FinalBackupConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Flag", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Flag$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.FlagsListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.FlagsListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.GeminiInstanceConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.GeminiInstanceConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.GenerateEphemeralCertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.GenerateEphemeralCertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.GenerateEphemeralCertResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.GenerateEphemeralCertResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.GetBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.GetBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.GetConnectSettingsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.GetConnectSettingsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ImportContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ImportContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ImportContext$SqlBakImportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ImportContext$SqlBakImportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ImportContext$SqlBakImportOptions$EncryptionOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ImportContext$SqlBakImportOptions$EncryptionOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ImportContext$SqlCsvImportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ImportContext$SqlCsvImportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ImportContext$SqlImportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ImportContext$SqlImportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ImportContext$SqlImportOptions$PostgresImportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ImportContext$SqlImportOptions$PostgresImportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ImportContext$SqlTdeImportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ImportContext$SqlTdeImportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InsightsConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InsightsConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstanceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstanceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesCloneRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesCloneRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesDemoteMasterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesDemoteMasterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesDemoteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesDemoteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesExportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesExportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesFailoverRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesFailoverRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesImportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesImportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesListServerCasResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesListServerCasResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesListServerCertificatesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesListServerCertificatesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesReencryptRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesReencryptRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesRestoreBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesRestoreBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesRotateServerCaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesRotateServerCaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesTruncateLogRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.InstancesTruncateLogRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.IpConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.IpConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.IpConfiguration$CaMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.IpConfiguration$ServerCertificateRotationMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.IpConfiguration$SslMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.IpMapping", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.IpMapping$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ListBackupsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ListBackupsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ListBackupsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ListBackupsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.LocationPreference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.LocationPreference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.MaintenanceWindow", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.MaintenanceWindow$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Metadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Metadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.MySqlReplicaConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.MySqlReplicaConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.MySqlSyncConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.MySqlSyncConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.OnPremisesConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.OnPremisesConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.OnPremisesConfiguration$SslOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Operation$SqlOperationStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Operation$SqlOperationType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.OperationError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.OperationError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.OperationErrors", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.OperationErrors$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.OperationsListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.OperationsListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PasswordStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PasswordStatus$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PasswordValidationPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PasswordValidationPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PasswordValidationPolicy$Complexity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PerformDiskShrinkContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PerformDiskShrinkContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PerformanceCaptureConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PerformanceCaptureConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PerformanceCaptureConfig$TransactionKillType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PointInTimeRestoreContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PointInTimeRestoreContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PreCheckResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PreCheckResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PreCheckResponse$MessageType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PscAutoConnectionConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PscAutoConnectionConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PscConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.PscConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.QueryResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.QueryResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ReadPoolAutoScaleConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ReadPoolAutoScaleConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ReadPoolAutoScaleConfig$TargetMetric", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ReadPoolAutoScaleConfig$TargetMetric$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ReplicaConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ReplicaConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ReplicationCluster", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ReplicationCluster$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ResolveConnectSettingsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.ResolveConnectSettingsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.RestoreBackupContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.RestoreBackupContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.RotateEntraIdCertificateContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.RotateEntraIdCertificateContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.RotateServerCaContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.RotateServerCaContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.RotateServerCertificateContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.RotateServerCertificateContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Row", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Row$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SelectedObjects", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SelectedObjects$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Settings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Settings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Settings$ConnectorEnforcement", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Settings$DataApiAccess", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Settings$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Settings$SqlActivationPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlActiveDirectoryConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlActiveDirectoryConfig$ActiveDirectoryMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlActiveDirectoryConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlAvailabilityType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlBackendType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlBackupKind", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlBackupRunStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlBackupRunType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlBackupRunsGetRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlBackupRunsGetRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlBackupRunsInsertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlBackupRunsInsertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlBackupRunsListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlBackupRunsListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlDataDiskType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlDatabaseVersion", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlDatabasesDeleteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlDatabasesDeleteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlDatabasesGetRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlDatabasesGetRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlDatabasesInsertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlDatabasesInsertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlDatabasesListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlDatabasesListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlDatabasesUpdateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlDatabasesUpdateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlExternalSyncSettingError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlExternalSyncSettingError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlExternalSyncSettingError$SqlExternalSyncSettingErrorType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlFileType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlFlagScope", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlFlagType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlFlagsListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlFlagsListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstanceType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesCloneRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesCloneRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesDeleteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesDeleteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesDemoteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesDemoteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse$Message", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse$Message$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesExportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesExportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesFailoverRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesFailoverRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesGetRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesGetRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesImportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesImportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesInsertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesInsertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesListServerCasRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesListServerCasRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesPatchRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesPatchRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesReencryptRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesReencryptRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody$Reschedule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody$Reschedule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody$RescheduleType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest$ResetSslMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRestartRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRestartRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesUpdateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesUpdateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest$ExternalSyncMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest$MigrationType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlIpAddressType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlMaintenanceType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlOperationsCancelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlOperationsCancelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlOperationsGetRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlOperationsGetRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlOperationsListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlOperationsListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlPricingPlan", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlReplicationType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlServerAuditConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlServerAuditConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlServerDatabaseDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlServerDatabaseDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlServerEntraIdConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlServerEntraIdConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlServerUserDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlServerUserDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlSslCertsDeleteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlSslCertsDeleteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlSslCertsGetRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlSslCertsGetRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlSslCertsInsertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlSslCertsInsertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlSslCertsListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlSslCertsListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlSubOperationType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlSubOperationType$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlSuspensionReason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlTiersListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlTiersListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlUpdateTrack", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlUsersDeleteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlUsersDeleteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlUsersGetRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlUsersGetRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlUsersInsertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlUsersInsertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlUsersListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlUsersListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlUsersUpdateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SqlUsersUpdateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SslCert", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SslCert$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SslCertDetail", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SslCertDetail$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SslCertsInsertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SslCertsInsertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SslCertsInsertResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SslCertsInsertResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SslCertsListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SslCertsListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SyncFlags", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.SyncFlags$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Tier", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Tier$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.TiersListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.TiersListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.TruncateLogContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.TruncateLogContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.UpdateBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.UpdateBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.User", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.User$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.User$DualPasswordType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.User$IamStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.User$SqlUserType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.UserPasswordValidationPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.UserPasswordValidationPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.UsersListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.UsersListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1.Value$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.BoolValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BoolValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue$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$EnforceNamingStyle", + "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$FeatureSet$VisibilityFeature", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$DefaultSymbolVisibility", + "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$FeatureSupport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport$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$SymbolVisibility", + "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.DoubleValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DoubleValue$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.FloatValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FloatValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int32Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int32Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int64Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int64Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.StringValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.StringValue$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.protobuf.UInt32Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt32Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt64Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt64Value$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 + }, + { + "name": "com.google.type.Interval", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Interval$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-sql/google-cloud-sql/src/main/resources/META-INF/native-image/com.google.cloud.sql.v1beta4/reflect-config.json b/java-sql/google-cloud-sql/src/main/resources/META-INF/native-image/com.google.cloud.sql.v1beta4/reflect-config.json new file mode 100644 index 000000000000..c65e81191198 --- /dev/null +++ b/java-sql/google-cloud-sql/src/main/resources/META-INF/native-image/com.google.cloud.sql.v1beta4/reflect-config.json @@ -0,0 +1,6239 @@ +[ + { + "name": "com.google.api.BatchingConfigProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingConfigProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingSettingsProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingSettingsProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "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.FlowControlLimitExceededBehaviorProto", + "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.sql.v1beta4.Ack", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Ack$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.AclEntry", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.AclEntry$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.AdvancedMachineFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.AdvancedMachineFeatures$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ApiWarning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ApiWarning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ApiWarning$SqlApiWarningCode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.AutoDnsStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.AvailableDatabaseVersion", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.AvailableDatabaseVersion$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Backup", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Backup$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Backup$SqlBackupState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Backup$SqlBackupType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupConfiguration$BackupTier", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupConfiguration$TransactionalLogStorageState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupReencryptionConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupReencryptionConfig$BackupType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupReencryptionConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupRetentionSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupRetentionSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupRetentionSettings$RetentionUnit", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupRun", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupRun$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupRunsListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BackupRunsListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BakType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BinLogCoordinates", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.BinLogCoordinates$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.CloneContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.CloneContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Column", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Column$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ConnectSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ConnectSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ConnectSettings$CaMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ConnectSettings$ConnectPoolNodeConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ConnectSettings$ConnectPoolNodeConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ConnectSettings$MdxProtocolSupport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ConnectionPoolConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ConnectionPoolConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ConnectionPoolFlags", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ConnectionPoolFlags$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ContinueSession", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ContinueSession$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.CreateBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.CreateBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DataCacheConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DataCacheConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DataPacket", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DataPacket$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Database", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Database$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseFlags", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseFlags$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseInstance", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseInstance$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseInstance$PoolNodeConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseInstance$PoolNodeConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseInstance$SqlFailoverReplica", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseInstance$SqlFailoverReplica$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseInstance$SqlInstanceState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseInstance$SqlNetworkArchitecture", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseInstance$SqlOutOfDiskReport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseInstance$SqlOutOfDiskReport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseInstance$SqlOutOfDiskReport$SqlOutOfDiskState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseInstance$SqlScheduledMaintenance", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabaseInstance$SqlScheduledMaintenance$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabasesListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DatabasesListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DeleteBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DeleteBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DemoteContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DemoteContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DemoteMasterConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DemoteMasterConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DemoteMasterContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DemoteMasterContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DenyMaintenancePeriod", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DenyMaintenancePeriod$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DiskEncryptionStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DiskEncryptionStatus$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DnsNameMapping", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DnsNameMapping$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DnsNameMapping$ConnectionType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DnsNameMapping$DnsScope", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.DnsNameMapping$RecordManager", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExecuteSqlPayload", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExecuteSqlPayload$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExecuteSqlPayload$PartialResultMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExportContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExportContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExportContext$SqlBakExportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExportContext$SqlBakExportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExportContext$SqlCsvExportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExportContext$SqlCsvExportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExportContext$SqlExportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExportContext$SqlExportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExportContext$SqlExportOptions$MysqlExportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExportContext$SqlExportOptions$MysqlExportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExportContext$SqlExportOptions$PostgresExportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExportContext$SqlExportOptions$PostgresExportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExportContext$SqlTdeExportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExportContext$SqlTdeExportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.FailoverContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.FailoverContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.FinalBackupConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.FinalBackupConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Flag", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Flag$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.FlagsListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.FlagsListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.GeminiInstanceConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.GeminiInstanceConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.GetBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.GetBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.GetConnectSettingsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.GetConnectSettingsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ImportContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ImportContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ImportContext$SqlBakImportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ImportContext$SqlBakImportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ImportContext$SqlBakImportOptions$EncryptionOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ImportContext$SqlBakImportOptions$EncryptionOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ImportContext$SqlCsvImportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ImportContext$SqlCsvImportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ImportContext$SqlImportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ImportContext$SqlImportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ImportContext$SqlImportOptions$PostgresImportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ImportContext$SqlImportOptions$PostgresImportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ImportContext$SqlTdeImportOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ImportContext$SqlTdeImportOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InsightsConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InsightsConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstanceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstanceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesCloneRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesCloneRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesDemoteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesDemoteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesExportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesExportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesFailoverRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesFailoverRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesImportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesImportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesListServerCasResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesListServerCasResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesReencryptRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesReencryptRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.IpConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.IpConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.IpConfiguration$CaMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.IpConfiguration$ServerCertificateRotationMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.IpConfiguration$SslMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.IpMapping", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.IpMapping$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ListBackupsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ListBackupsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ListBackupsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ListBackupsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.LocationPreference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.LocationPreference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.MaintenanceWindow", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.MaintenanceWindow$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Metadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Metadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.MySqlSyncConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.MySqlSyncConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.OnPremisesConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.OnPremisesConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.OnPremisesConfiguration$SslOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Operation$SqlOperationStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Operation$SqlOperationType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.OperationError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.OperationError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.OperationErrors", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.OperationErrors$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.OperationsListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.OperationsListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PasswordStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PasswordStatus$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PasswordValidationPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PasswordValidationPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PasswordValidationPolicy$Complexity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PerformDiskShrinkContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PerformDiskShrinkContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PerformanceCaptureConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PerformanceCaptureConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PerformanceCaptureConfig$TransactionKillType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PointInTimeRestoreContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PointInTimeRestoreContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PreCheckResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PreCheckResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PreCheckResponse$MessageType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PscAutoConnectionConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PscAutoConnectionConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PscConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.PscConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.QueryResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.QueryResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig$TargetMetric", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig$TargetMetric$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ReplicaConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ReplicaConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ReplicationCluster", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ReplicationCluster$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.RestoreBackupContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.RestoreBackupContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.RotateServerCaContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.RotateServerCaContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.RotateServerCertificateContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.RotateServerCertificateContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Row", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Row$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SelectedObjects", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SelectedObjects$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SessionMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SessionMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Settings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Settings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Settings$ConnectorEnforcement", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Settings$DataApiAccess", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Settings$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Settings$SqlActivationPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig$ActiveDirectoryMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlAvailabilityType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlBackendType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlBackupKind", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlBackupRunStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlBackupRunType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlDataDiskType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlDataFeature", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlDatabaseVersion", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlDatabasesListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlDatabasesListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError$SqlExternalSyncSettingErrorType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlFileType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlFlagScope", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlFlagType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlFlagsListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlFlagsListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstanceType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse$Message", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse$Message$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesExportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesExportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesGetRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesGetRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesImportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesImportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody$Reschedule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody$Reschedule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody$RescheduleType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest$ResetSslMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest$ExternalSyncMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest$MigrationType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlIpAddressType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlMaintenanceType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlOperationsGetRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlOperationsGetRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlOperationsListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlOperationsListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlPricingPlan", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlReplicationType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlServerAuditConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlServerAuditConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlServerUserDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlServerUserDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlSslCertsListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlSslCertsListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlSubOperationType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlSubOperationType$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlSuspensionReason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlTiersListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlTiersListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlUpdateTrack", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlUsersGetRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlUsersGetRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlUsersInsertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlUsersInsertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlUsersListRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlUsersListRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SslCert", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SslCert$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SslCertDetail", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SslCertDetail$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SslCertsInsertRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SslCertsInsertRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SslCertsInsertResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SslCertsInsertResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SslCertsListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SslCertsListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.StartSession", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.StartSession$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.StreamSqlDataRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.StreamSqlDataRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.StreamSqlDataResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.StreamSqlDataResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SyncFlags", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.SyncFlags$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.TerminateSession", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.TerminateSession$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Tier", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Tier$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.TiersListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.TiersListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.TruncateLogContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.TruncateLogContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.UpdateBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.UpdateBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.User", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.User$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.User$DualPasswordType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.User$IamStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.User$SqlUserType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.UsersListResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.UsersListResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.sql.v1beta4.Value$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.BoolValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BoolValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue$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$EnforceNamingStyle", + "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$FeatureSet$VisibilityFeature", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$DefaultSymbolVisibility", + "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$FeatureSupport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport$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$SymbolVisibility", + "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.DoubleValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DoubleValue$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.FloatValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FloatValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int32Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int32Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int64Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int64Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.StringValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.StringValue$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.protobuf.UInt32Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt32Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt64Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt64Value$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 + }, + { + "name": "com.google.type.Interval", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Interval$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockLocations.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockLocations.java new file mode 100644 index 000000000000..1f1a6f8f5654 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockLocationsImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..e43f36156980 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockLocationsImpl.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlBackupRunsService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlBackupRunsService.java new file mode 100644 index 000000000000..e1f571023167 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlBackupRunsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlBackupRunsService implements MockGrpcService { + private final MockSqlBackupRunsServiceImpl serviceImpl; + + public MockSqlBackupRunsService() { + serviceImpl = new MockSqlBackupRunsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlBackupRunsServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlBackupRunsServiceImpl.java new file mode 100644 index 000000000000..1e16ab21f349 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlBackupRunsServiceImpl.java @@ -0,0 +1,143 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1.SqlBackupRunsServiceGrpc.SqlBackupRunsServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlBackupRunsServiceImpl extends SqlBackupRunsServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlBackupRunsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void delete( + SqlBackupRunsDeleteRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Delete, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void get(SqlBackupRunsGetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BackupRun) { + requests.add(request); + responseObserver.onNext(((BackupRun) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Get, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BackupRun.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void insert( + SqlBackupRunsInsertRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Insert, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void list( + SqlBackupRunsListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BackupRunsListResponse) { + requests.add(request); + responseObserver.onNext(((BackupRunsListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BackupRunsListResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlBackupsService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlBackupsService.java new file mode 100644 index 000000000000..ef487ccc916d --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlBackupsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlBackupsService implements MockGrpcService { + private final MockSqlBackupsServiceImpl serviceImpl; + + public MockSqlBackupsService() { + serviceImpl = new MockSqlBackupsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlBackupsServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlBackupsServiceImpl.java new file mode 100644 index 000000000000..50f115a8ef8e --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlBackupsServiceImpl.java @@ -0,0 +1,164 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1.SqlBackupsServiceGrpc.SqlBackupsServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlBackupsServiceImpl extends SqlBackupsServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlBackupsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createBackup( + CreateBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBackup(GetBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Backup) { + requests.add(request); + responseObserver.onNext(((Backup) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Backup.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBackups( + ListBackupsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBackupsResponse) { + requests.add(request); + responseObserver.onNext(((ListBackupsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListBackups, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBackupsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBackup( + UpdateBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBackup( + DeleteBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlConnectService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlConnectService.java new file mode 100644 index 000000000000..9292c894449b --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlConnectService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlConnectService implements MockGrpcService { + private final MockSqlConnectServiceImpl serviceImpl; + + public MockSqlConnectService() { + serviceImpl = new MockSqlConnectServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlConnectServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlConnectServiceImpl.java new file mode 100644 index 000000000000..ceaa43f8ecb7 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlConnectServiceImpl.java @@ -0,0 +1,126 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1.SqlConnectServiceGrpc.SqlConnectServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlConnectServiceImpl extends SqlConnectServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlConnectServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void getConnectSettings( + GetConnectSettingsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ConnectSettings) { + requests.add(request); + responseObserver.onNext(((ConnectSettings) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetConnectSettings, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ConnectSettings.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void resolveConnectSettings( + ResolveConnectSettingsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ConnectSettings) { + requests.add(request); + responseObserver.onNext(((ConnectSettings) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ResolveConnectSettings, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + ConnectSettings.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void generateEphemeralCert( + GenerateEphemeralCertRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GenerateEphemeralCertResponse) { + requests.add(request); + responseObserver.onNext(((GenerateEphemeralCertResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GenerateEphemeralCert, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + GenerateEphemeralCertResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlDatabasesService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlDatabasesService.java new file mode 100644 index 000000000000..f71696f0911c --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlDatabasesService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlDatabasesService implements MockGrpcService { + private final MockSqlDatabasesServiceImpl serviceImpl; + + public MockSqlDatabasesService() { + serviceImpl = new MockSqlDatabasesServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlDatabasesServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlDatabasesServiceImpl.java new file mode 100644 index 000000000000..147ffff7085a --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlDatabasesServiceImpl.java @@ -0,0 +1,184 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1.SqlDatabasesServiceGrpc.SqlDatabasesServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlDatabasesServiceImpl extends SqlDatabasesServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlDatabasesServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void delete( + SqlDatabasesDeleteRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Delete, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void get(SqlDatabasesGetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Database) { + requests.add(request); + responseObserver.onNext(((Database) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Get, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Database.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void insert( + SqlDatabasesInsertRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Insert, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void list( + SqlDatabasesListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DatabasesListResponse) { + requests.add(request); + responseObserver.onNext(((DatabasesListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DatabasesListResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void patch(SqlDatabasesUpdateRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Patch, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void update( + SqlDatabasesUpdateRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Update, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlFlagsService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlFlagsService.java new file mode 100644 index 000000000000..a9e28aa39242 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlFlagsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlFlagsService implements MockGrpcService { + private final MockSqlFlagsServiceImpl serviceImpl; + + public MockSqlFlagsService() { + serviceImpl = new MockSqlFlagsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlFlagsServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlFlagsServiceImpl.java new file mode 100644 index 000000000000..8cf0578da072 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlFlagsServiceImpl.java @@ -0,0 +1,81 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1.SqlFlagsServiceGrpc.SqlFlagsServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlFlagsServiceImpl extends SqlFlagsServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlFlagsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void list( + SqlFlagsListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof FlagsListResponse) { + requests.add(request); + responseObserver.onNext(((FlagsListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + FlagsListResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlInstancesService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlInstancesService.java new file mode 100644 index 000000000000..b5093abf3930 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlInstancesService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlInstancesService implements MockGrpcService { + private final MockSqlInstancesServiceImpl serviceImpl; + + public MockSqlInstancesService() { + serviceImpl = new MockSqlInstancesServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlInstancesServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlInstancesServiceImpl.java new file mode 100644 index 000000000000..93ce19d3e14a --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlInstancesServiceImpl.java @@ -0,0 +1,985 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1.SqlInstancesServiceGrpc.SqlInstancesServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlInstancesServiceImpl extends SqlInstancesServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlInstancesServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void addServerCa( + SqlInstancesAddServerCaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AddServerCa, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void addServerCertificate( + SqlInstancesAddServerCertificateRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AddServerCertificate, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void addEntraIdCertificate( + SqlInstancesAddEntraIdCertificateRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AddEntraIdCertificate, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void clone(SqlInstancesCloneRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Clone, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void delete( + SqlInstancesDeleteRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Delete, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void demoteMaster( + SqlInstancesDemoteMasterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DemoteMaster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void demote( + SqlInstancesDemoteRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Demote, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void export( + SqlInstancesExportRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Export, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void failover( + SqlInstancesFailoverRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Failover, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void reencrypt( + SqlInstancesReencryptRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Reencrypt, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void get( + SqlInstancesGetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DatabaseInstance) { + requests.add(request); + responseObserver.onNext(((DatabaseInstance) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Get, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DatabaseInstance.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void import_( + SqlInstancesImportRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Import, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void insert( + SqlInstancesInsertRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Insert, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void list( + SqlInstancesListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof InstancesListResponse) { + requests.add(request); + responseObserver.onNext(((InstancesListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + InstancesListResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listServerCas( + SqlInstancesListServerCasRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof InstancesListServerCasResponse) { + requests.add(request); + responseObserver.onNext(((InstancesListServerCasResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListServerCas, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + InstancesListServerCasResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listServerCertificates( + SqlInstancesListServerCertificatesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof InstancesListServerCertificatesResponse) { + requests.add(request); + responseObserver.onNext(((InstancesListServerCertificatesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListServerCertificates, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + InstancesListServerCertificatesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listEntraIdCertificates( + SqlInstancesListEntraIdCertificatesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof InstancesListEntraIdCertificatesResponse) { + requests.add(request); + responseObserver.onNext(((InstancesListEntraIdCertificatesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListEntraIdCertificates, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + InstancesListEntraIdCertificatesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void patch(SqlInstancesPatchRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Patch, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void promoteReplica( + SqlInstancesPromoteReplicaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PromoteReplica, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void switchover( + SqlInstancesSwitchoverRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Switchover, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void resetSslConfig( + SqlInstancesResetSslConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ResetSslConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void restart( + SqlInstancesRestartRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Restart, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void restoreBackup( + SqlInstancesRestoreBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RestoreBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void rotateServerCa( + SqlInstancesRotateServerCaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RotateServerCa, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void rotateServerCertificate( + SqlInstancesRotateServerCertificateRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RotateServerCertificate, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void rotateEntraIdCertificate( + SqlInstancesRotateEntraIdCertificateRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RotateEntraIdCertificate, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void startReplica( + SqlInstancesStartReplicaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StartReplica, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void stopReplica( + SqlInstancesStopReplicaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StopReplica, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void truncateLog( + SqlInstancesTruncateLogRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TruncateLog, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void update( + SqlInstancesUpdateRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Update, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createEphemeral( + SqlInstancesCreateEphemeralCertRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SslCert) { + requests.add(request); + responseObserver.onNext(((SslCert) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateEphemeral, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SslCert.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void rescheduleMaintenance( + SqlInstancesRescheduleMaintenanceRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RescheduleMaintenance, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void verifyExternalSyncSettings( + SqlInstancesVerifyExternalSyncSettingsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SqlInstancesVerifyExternalSyncSettingsResponse) { + requests.add(request); + responseObserver.onNext(((SqlInstancesVerifyExternalSyncSettingsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method VerifyExternalSyncSettings, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), + SqlInstancesVerifyExternalSyncSettingsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void startExternalSync( + SqlInstancesStartExternalSyncRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StartExternalSync, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void performDiskShrink( + SqlInstancesPerformDiskShrinkRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PerformDiskShrink, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getDiskShrinkConfig( + SqlInstancesGetDiskShrinkConfigRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SqlInstancesGetDiskShrinkConfigResponse) { + requests.add(request); + responseObserver.onNext(((SqlInstancesGetDiskShrinkConfigResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetDiskShrinkConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SqlInstancesGetDiskShrinkConfigResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void resetReplicaSize( + SqlInstancesResetReplicaSizeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ResetReplicaSize, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLatestRecoveryTime( + SqlInstancesGetLatestRecoveryTimeRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SqlInstancesGetLatestRecoveryTimeResponse) { + requests.add(request); + responseObserver.onNext(((SqlInstancesGetLatestRecoveryTimeResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLatestRecoveryTime, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + SqlInstancesGetLatestRecoveryTimeResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void executeSql( + SqlInstancesExecuteSqlRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SqlInstancesExecuteSqlResponse) { + requests.add(request); + responseObserver.onNext(((SqlInstancesExecuteSqlResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ExecuteSql, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SqlInstancesExecuteSqlResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void acquireSsrsLease( + SqlInstancesAcquireSsrsLeaseRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SqlInstancesAcquireSsrsLeaseResponse) { + requests.add(request); + responseObserver.onNext(((SqlInstancesAcquireSsrsLeaseResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AcquireSsrsLease, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SqlInstancesAcquireSsrsLeaseResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void releaseSsrsLease( + SqlInstancesReleaseSsrsLeaseRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SqlInstancesReleaseSsrsLeaseResponse) { + requests.add(request); + responseObserver.onNext(((SqlInstancesReleaseSsrsLeaseResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ReleaseSsrsLease, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SqlInstancesReleaseSsrsLeaseResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void preCheckMajorVersionUpgrade( + SqlInstancesPreCheckMajorVersionUpgradeRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PreCheckMajorVersionUpgrade, expected" + + " %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void pointInTimeRestore( + SqlInstancesPointInTimeRestoreRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PointInTimeRestore, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlOperationsService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlOperationsService.java new file mode 100644 index 000000000000..32c1ef4c1bd1 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlOperationsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlOperationsService implements MockGrpcService { + private final MockSqlOperationsServiceImpl serviceImpl; + + public MockSqlOperationsService() { + serviceImpl = new MockSqlOperationsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlOperationsServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlOperationsServiceImpl.java new file mode 100644 index 000000000000..01c8469844b3 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlOperationsServiceImpl.java @@ -0,0 +1,122 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1.SqlOperationsServiceGrpc.SqlOperationsServiceImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlOperationsServiceImpl extends SqlOperationsServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlOperationsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void get(SqlOperationsGetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Get, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void list( + SqlOperationsListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof OperationsListResponse) { + requests.add(request); + responseObserver.onNext(((OperationsListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + OperationsListResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void cancel(SqlOperationsCancelRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Cancel, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlSslCertsService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlSslCertsService.java new file mode 100644 index 000000000000..7fb5d5af476c --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlSslCertsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlSslCertsService implements MockGrpcService { + private final MockSqlSslCertsServiceImpl serviceImpl; + + public MockSqlSslCertsService() { + serviceImpl = new MockSqlSslCertsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlSslCertsServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlSslCertsServiceImpl.java new file mode 100644 index 000000000000..1bc900f24bf5 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlSslCertsServiceImpl.java @@ -0,0 +1,142 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1.SqlSslCertsServiceGrpc.SqlSslCertsServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlSslCertsServiceImpl extends SqlSslCertsServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlSslCertsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void delete(SqlSslCertsDeleteRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Delete, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void get(SqlSslCertsGetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SslCert) { + requests.add(request); + responseObserver.onNext(((SslCert) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Get, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SslCert.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void insert( + SqlSslCertsInsertRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SslCertsInsertResponse) { + requests.add(request); + responseObserver.onNext(((SslCertsInsertResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Insert, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SslCertsInsertResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void list( + SqlSslCertsListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SslCertsListResponse) { + requests.add(request); + responseObserver.onNext(((SslCertsListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SslCertsListResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlTiersService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlTiersService.java new file mode 100644 index 000000000000..d28b1e3653f9 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlTiersService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlTiersService implements MockGrpcService { + private final MockSqlTiersServiceImpl serviceImpl; + + public MockSqlTiersService() { + serviceImpl = new MockSqlTiersServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlTiersServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlTiersServiceImpl.java new file mode 100644 index 000000000000..a30e27171957 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlTiersServiceImpl.java @@ -0,0 +1,81 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1.SqlTiersServiceGrpc.SqlTiersServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlTiersServiceImpl extends SqlTiersServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlTiersServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void list( + SqlTiersListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TiersListResponse) { + requests.add(request); + responseObserver.onNext(((TiersListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TiersListResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlUsersService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlUsersService.java new file mode 100644 index 000000000000..f3067a81a9cb --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlUsersService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlUsersService implements MockGrpcService { + private final MockSqlUsersServiceImpl serviceImpl; + + public MockSqlUsersService() { + serviceImpl = new MockSqlUsersServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlUsersServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlUsersServiceImpl.java new file mode 100644 index 000000000000..5af107a2cabc --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/MockSqlUsersServiceImpl.java @@ -0,0 +1,161 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1.SqlUsersServiceGrpc.SqlUsersServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlUsersServiceImpl extends SqlUsersServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlUsersServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void delete(SqlUsersDeleteRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Delete, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void get(SqlUsersGetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Get, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void insert(SqlUsersInsertRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Insert, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void list( + SqlUsersListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof UsersListResponse) { + requests.add(request); + responseObserver.onNext(((UsersListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + UsersListResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void update(SqlUsersUpdateRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Update, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlBackupRunsServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlBackupRunsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..17181d17f46d --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlBackupRunsServiceClientHttpJsonTest.java @@ -0,0 +1,349 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +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.sql.v1.stub.HttpJsonSqlBackupRunsServiceStub; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlBackupRunsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlBackupRunsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlBackupRunsServiceStub.getMethodDescriptors(), + SqlBackupRunsServiceSettings.getDefaultEndpoint()); + SqlBackupRunsServiceSettings settings = + SqlBackupRunsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlBackupRunsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlBackupRunsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlBackupRunsDeleteRequest request = + SqlBackupRunsDeleteRequest.newBuilder() + .setId(3355) + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.delete(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 deleteExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlBackupRunsDeleteRequest request = + SqlBackupRunsDeleteRequest.newBuilder() + .setId(3355) + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + BackupRun expectedResponse = + BackupRun.newBuilder() + .setKind("kind3292052") + .setStatus(SqlBackupRunStatus.forNumber(0)) + .setEnqueuedTime(Timestamp.newBuilder().build()) + .setId(3355) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setType(SqlBackupRunType.forNumber(0)) + .setDescription("description-1724546052") + .setWindowStartTime(Timestamp.newBuilder().build()) + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .setLocation("location1901043637") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setDiskEncryptionConfiguration(DiskEncryptionConfiguration.newBuilder().build()) + .setDiskEncryptionStatus(DiskEncryptionStatus.newBuilder().build()) + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setMaxChargeableBytes(-1424371595) + .build(); + mockService.addResponse(expectedResponse); + + SqlBackupRunsGetRequest request = + SqlBackupRunsGetRequest.newBuilder() + .setId(3355) + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + BackupRun actualResponse = client.get(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 getExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlBackupRunsGetRequest request = + SqlBackupRunsGetRequest.newBuilder() + .setId(3355) + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlBackupRunsInsertRequest request = + SqlBackupRunsInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(BackupRun.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(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 insertExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlBackupRunsInsertRequest request = + SqlBackupRunsInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(BackupRun.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + BackupRunsListResponse expectedResponse = + BackupRunsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockService.addResponse(expectedResponse); + + SqlBackupRunsListRequest request = + SqlBackupRunsListRequest.newBuilder() + .setInstance("instance-7525") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-6911") + .build(); + + BackupRunsListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlBackupRunsListRequest request = + SqlBackupRunsListRequest.newBuilder() + .setInstance("instance-7525") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-6911") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlBackupRunsServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlBackupRunsServiceClientTest.java new file mode 100644 index 000000000000..beb8f8c1b34f --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlBackupRunsServiceClientTest.java @@ -0,0 +1,341 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlBackupRunsServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlBackupRunsService mockSqlBackupRunsService; + private LocalChannelProvider channelProvider; + private SqlBackupRunsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlBackupRunsService = new MockSqlBackupRunsService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlBackupRunsService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlBackupRunsServiceSettings settings = + SqlBackupRunsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlBackupRunsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlBackupRunsService.addResponse(expectedResponse); + + SqlBackupRunsDeleteRequest request = + SqlBackupRunsDeleteRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.delete(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupRunsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlBackupRunsDeleteRequest actualRequest = ((SqlBackupRunsDeleteRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getId(), actualRequest.getId()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupRunsService.addException(exception); + + try { + SqlBackupRunsDeleteRequest request = + SqlBackupRunsDeleteRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + BackupRun expectedResponse = + BackupRun.newBuilder() + .setKind("kind3292052") + .setStatus(SqlBackupRunStatus.forNumber(0)) + .setEnqueuedTime(Timestamp.newBuilder().build()) + .setId(3355) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setType(SqlBackupRunType.forNumber(0)) + .setDescription("description-1724546052") + .setWindowStartTime(Timestamp.newBuilder().build()) + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .setLocation("location1901043637") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setDiskEncryptionConfiguration(DiskEncryptionConfiguration.newBuilder().build()) + .setDiskEncryptionStatus(DiskEncryptionStatus.newBuilder().build()) + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setMaxChargeableBytes(-1424371595) + .build(); + mockSqlBackupRunsService.addResponse(expectedResponse); + + SqlBackupRunsGetRequest request = + SqlBackupRunsGetRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + BackupRun actualResponse = client.get(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupRunsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlBackupRunsGetRequest actualRequest = ((SqlBackupRunsGetRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getId(), actualRequest.getId()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupRunsService.addException(exception); + + try { + SqlBackupRunsGetRequest request = + SqlBackupRunsGetRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlBackupRunsService.addResponse(expectedResponse); + + SqlBackupRunsInsertRequest request = + SqlBackupRunsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(BackupRun.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupRunsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlBackupRunsInsertRequest actualRequest = ((SqlBackupRunsInsertRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void insertExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupRunsService.addException(exception); + + try { + SqlBackupRunsInsertRequest request = + SqlBackupRunsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(BackupRun.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + BackupRunsListResponse expectedResponse = + BackupRunsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockSqlBackupRunsService.addResponse(expectedResponse); + + SqlBackupRunsListRequest request = + SqlBackupRunsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + + BackupRunsListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupRunsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlBackupRunsListRequest actualRequest = ((SqlBackupRunsListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getMaxResults(), actualRequest.getMaxResults()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupRunsService.addException(exception); + + try { + SqlBackupRunsListRequest request = + SqlBackupRunsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlBackupsServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlBackupsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..de132fbd78b3 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlBackupsServiceClientHttpJsonTest.java @@ -0,0 +1,663 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import static com.google.cloud.sql.v1.SqlBackupsServiceClient.ListBackupsPagedResponse; + +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.sql.v1.stub.HttpJsonSqlBackupsServiceStub; +import com.google.common.collect.Lists; +import com.google.protobuf.BoolValue; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.type.Interval; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlBackupsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlBackupsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlBackupsServiceStub.getMethodDescriptors(), + SqlBackupsServiceSettings.getDefaultEndpoint()); + SqlBackupsServiceSettings settings = + SqlBackupsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlBackupsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlBackupsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + Backup backup = Backup.newBuilder().build(); + + Operation actualResponse = client.createBackup(parent, backup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + Backup backup = Backup.newBuilder().build(); + client.createBackup(parent, backup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupTest2() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-2353"; + Backup backup = Backup.newBuilder().build(); + + Operation actualResponse = client.createBackup(parent, backup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-2353"; + Backup backup = Backup.newBuilder().build(); + client.createBackup(parent, backup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .setKind("kind3292052") + .setSelfLink("selfLink1191800166") + .setDescription("description-1724546052") + .setInstance("instance555127957") + .setLocation("location1901043637") + .setBackupInterval(Interval.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setKmsKey("kmsKey-1127483058") + .setKmsKeyVersion("kmsKeyVersion2084784042") + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setMaxChargeableBytes(-1424371595) + .setInstanceDeletionTime(Timestamp.newBuilder().build()) + .setInstanceSettings(DatabaseInstance.newBuilder().build()) + .setBackupRun("backupRun1355341161") + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .setKind("kind3292052") + .setSelfLink("selfLink1191800166") + .setDescription("description-1724546052") + .setInstance("instance555127957") + .setLocation("location1901043637") + .setBackupInterval(Interval.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setKmsKey("kmsKey-1127483058") + .setKmsKeyVersion("kmsKeyVersion2084784042") + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setMaxChargeableBytes(-1424371595) + .setInstanceDeletionTime(Timestamp.newBuilder().build()) + .setInstanceSettings(DatabaseInstance.newBuilder().build()) + .setBackupRun("backupRun1355341161") + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-5917/backups/backup-5917"; + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5917/backups/backup-5917"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBackupsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-2353"; + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBackupsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-2353"; + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + Backup backup = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .setKind("kind3292052") + .setSelfLink("selfLink1191800166") + .setDescription("description-1724546052") + .setInstance("instance555127957") + .setLocation("location1901043637") + .setBackupInterval(Interval.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setKmsKey("kmsKey-1127483058") + .setKmsKeyVersion("kmsKeyVersion2084784042") + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setMaxChargeableBytes(-1424371595) + .setInstanceDeletionTime(Timestamp.newBuilder().build()) + .setInstanceSettings(DatabaseInstance.newBuilder().build()) + .setBackupRun("backupRun1355341161") + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Operation actualResponse = client.updateBackup(backup, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Backup backup = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .setKind("kind3292052") + .setSelfLink("selfLink1191800166") + .setDescription("description-1724546052") + .setInstance("instance555127957") + .setLocation("location1901043637") + .setBackupInterval(Interval.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setKmsKey("kmsKey-1127483058") + .setKmsKeyVersion("kmsKeyVersion2084784042") + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setMaxChargeableBytes(-1424371595) + .setInstanceDeletionTime(Timestamp.newBuilder().build()) + .setInstanceSettings(DatabaseInstance.newBuilder().build()) + .setBackupRun("backupRun1355341161") + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackup(backup, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + + Operation actualResponse = client.deleteBackup(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 deleteBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-5917/backups/backup-5917"; + + Operation actualResponse = client.deleteBackup(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 deleteBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5917/backups/backup-5917"; + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlBackupsServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlBackupsServiceClientTest.java new file mode 100644 index 000000000000..e0b7698a598d --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlBackupsServiceClientTest.java @@ -0,0 +1,576 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import static com.google.cloud.sql.v1.SqlBackupsServiceClient.ListBackupsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.BoolValue; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.type.Interval; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlBackupsServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlBackupsService mockSqlBackupsService; + private LocalChannelProvider channelProvider; + private SqlBackupsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlBackupsService = new MockSqlBackupsService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlBackupsService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlBackupsServiceSettings settings = + SqlBackupsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlBackupsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + Backup backup = Backup.newBuilder().build(); + + Operation actualResponse = client.createBackup(parent, backup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + Backup backup = Backup.newBuilder().build(); + client.createBackup(parent, backup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupTest2() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Backup backup = Backup.newBuilder().build(); + + Operation actualResponse = client.createBackup(parent, backup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + String parent = "parent-995424086"; + Backup backup = Backup.newBuilder().build(); + client.createBackup(parent, backup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .setKind("kind3292052") + .setSelfLink("selfLink1191800166") + .setDescription("description-1724546052") + .setInstance("instance555127957") + .setLocation("location1901043637") + .setBackupInterval(Interval.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setKmsKey("kmsKey-1127483058") + .setKmsKeyVersion("kmsKeyVersion2084784042") + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setMaxChargeableBytes(-1424371595) + .setInstanceDeletionTime(Timestamp.newBuilder().build()) + .setInstanceSettings(DatabaseInstance.newBuilder().build()) + .setBackupRun("backupRun1355341161") + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .setKind("kind3292052") + .setSelfLink("selfLink1191800166") + .setDescription("description-1724546052") + .setInstance("instance555127957") + .setLocation("location1901043637") + .setBackupInterval(Interval.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setKmsKey("kmsKey-1127483058") + .setKmsKeyVersion("kmsKeyVersion2084784042") + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setMaxChargeableBytes(-1424371595) + .setInstanceDeletionTime(Timestamp.newBuilder().build()) + .setInstanceSettings(DatabaseInstance.newBuilder().build()) + .setBackupRun("backupRun1355341161") + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + String name = "name3373707"; + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + String name = "name3373707"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Operation actualResponse = client.updateBackup(backup, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBackupRequest actualRequest = ((UpdateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackup(backup, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + + Operation actualResponse = client.deleteBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + String name = "name3373707"; + + Operation actualResponse = client.deleteBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + String name = "name3373707"; + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlConnectServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlConnectServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..96cde7bf3fbb --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlConnectServiceClientHttpJsonTest.java @@ -0,0 +1,268 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +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.sql.v1.stub.HttpJsonSqlConnectServiceStub; +import com.google.protobuf.Duration; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlConnectServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlConnectServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlConnectServiceStub.getMethodDescriptors(), + SqlConnectServiceSettings.getDefaultEndpoint()); + SqlConnectServiceSettings settings = + SqlConnectServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlConnectServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlConnectServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getConnectSettingsTest() throws Exception { + ConnectSettings expectedResponse = + ConnectSettings.newBuilder() + .setKind("kind3292052") + .setServerCaCert(SslCert.newBuilder().build()) + .addAllIpAddresses(new ArrayList()) + .setRegion("region-934795532") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setBackendType(SqlBackendType.forNumber(0)) + .setPscEnabled(true) + .setDnsName("dnsName1813886804") + .addAllCustomSubjectAlternativeNames(new ArrayList()) + .addAllDnsNames(new ArrayList()) + .setNodeCount(1539922066) + .addAllNodes(new ArrayList()) + .addAllMdxProtocolSupport(new ArrayList()) + .setConnectionName("connectionName1270009481") + .build(); + mockService.addResponse(expectedResponse); + + GetConnectSettingsRequest request = + GetConnectSettingsRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setReadTime(Timestamp.newBuilder().build()) + .build(); + + ConnectSettings actualResponse = client.getConnectSettings(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 getConnectSettingsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetConnectSettingsRequest request = + GetConnectSettingsRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setReadTime(Timestamp.newBuilder().build()) + .build(); + client.getConnectSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resolveConnectSettingsTest() throws Exception { + ConnectSettings expectedResponse = + ConnectSettings.newBuilder() + .setKind("kind3292052") + .setServerCaCert(SslCert.newBuilder().build()) + .addAllIpAddresses(new ArrayList()) + .setRegion("region-934795532") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setBackendType(SqlBackendType.forNumber(0)) + .setPscEnabled(true) + .setDnsName("dnsName1813886804") + .addAllCustomSubjectAlternativeNames(new ArrayList()) + .addAllDnsNames(new ArrayList()) + .setNodeCount(1539922066) + .addAllNodes(new ArrayList()) + .addAllMdxProtocolSupport(new ArrayList()) + .setConnectionName("connectionName1270009481") + .build(); + mockService.addResponse(expectedResponse); + + ResolveConnectSettingsRequest request = + ResolveConnectSettingsRequest.newBuilder() + .setDnsName("dnsName-6118") + .setLocation("location-9355") + .build(); + + ConnectSettings actualResponse = client.resolveConnectSettings(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 resolveConnectSettingsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ResolveConnectSettingsRequest request = + ResolveConnectSettingsRequest.newBuilder() + .setDnsName("dnsName-6118") + .setLocation("location-9355") + .build(); + client.resolveConnectSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateEphemeralCertTest() throws Exception { + GenerateEphemeralCertResponse expectedResponse = + GenerateEphemeralCertResponse.newBuilder() + .setEphemeralCert(SslCert.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GenerateEphemeralCertRequest request = + GenerateEphemeralCertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setPublicKey("publicKey1446899510") + .setAccessToken("accessToken-1042689291") + .setReadTime(Timestamp.newBuilder().build()) + .setValidDuration(Duration.newBuilder().build()) + .build(); + + GenerateEphemeralCertResponse actualResponse = client.generateEphemeralCert(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 generateEphemeralCertExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GenerateEphemeralCertRequest request = + GenerateEphemeralCertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setPublicKey("publicKey1446899510") + .setAccessToken("accessToken-1042689291") + .setReadTime(Timestamp.newBuilder().build()) + .setValidDuration(Duration.newBuilder().build()) + .build(); + client.generateEphemeralCert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlConnectServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlConnectServiceClientTest.java new file mode 100644 index 000000000000..760b87ba2514 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlConnectServiceClientTest.java @@ -0,0 +1,267 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Duration; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlConnectServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlConnectService mockSqlConnectService; + private LocalChannelProvider channelProvider; + private SqlConnectServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlConnectService = new MockSqlConnectService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlConnectService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlConnectServiceSettings settings = + SqlConnectServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlConnectServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getConnectSettingsTest() throws Exception { + ConnectSettings expectedResponse = + ConnectSettings.newBuilder() + .setKind("kind3292052") + .setServerCaCert(SslCert.newBuilder().build()) + .addAllIpAddresses(new ArrayList()) + .setRegion("region-934795532") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setBackendType(SqlBackendType.forNumber(0)) + .setPscEnabled(true) + .setDnsName("dnsName1813886804") + .addAllCustomSubjectAlternativeNames(new ArrayList()) + .addAllDnsNames(new ArrayList()) + .setNodeCount(1539922066) + .addAllNodes(new ArrayList()) + .addAllMdxProtocolSupport(new ArrayList()) + .setConnectionName("connectionName1270009481") + .build(); + mockSqlConnectService.addResponse(expectedResponse); + + GetConnectSettingsRequest request = + GetConnectSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReadTime(Timestamp.newBuilder().build()) + .build(); + + ConnectSettings actualResponse = client.getConnectSettings(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlConnectService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConnectSettingsRequest actualRequest = ((GetConnectSettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getReadTime(), actualRequest.getReadTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getConnectSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlConnectService.addException(exception); + + try { + GetConnectSettingsRequest request = + GetConnectSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReadTime(Timestamp.newBuilder().build()) + .build(); + client.getConnectSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resolveConnectSettingsTest() throws Exception { + ConnectSettings expectedResponse = + ConnectSettings.newBuilder() + .setKind("kind3292052") + .setServerCaCert(SslCert.newBuilder().build()) + .addAllIpAddresses(new ArrayList()) + .setRegion("region-934795532") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setBackendType(SqlBackendType.forNumber(0)) + .setPscEnabled(true) + .setDnsName("dnsName1813886804") + .addAllCustomSubjectAlternativeNames(new ArrayList()) + .addAllDnsNames(new ArrayList()) + .setNodeCount(1539922066) + .addAllNodes(new ArrayList()) + .addAllMdxProtocolSupport(new ArrayList()) + .setConnectionName("connectionName1270009481") + .build(); + mockSqlConnectService.addResponse(expectedResponse); + + ResolveConnectSettingsRequest request = + ResolveConnectSettingsRequest.newBuilder() + .setDnsName("dnsName1813886804") + .setLocation("location1901043637") + .build(); + + ConnectSettings actualResponse = client.resolveConnectSettings(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlConnectService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ResolveConnectSettingsRequest actualRequest = + ((ResolveConnectSettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getDnsName(), actualRequest.getDnsName()); + Assert.assertEquals(request.getLocation(), actualRequest.getLocation()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void resolveConnectSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlConnectService.addException(exception); + + try { + ResolveConnectSettingsRequest request = + ResolveConnectSettingsRequest.newBuilder() + .setDnsName("dnsName1813886804") + .setLocation("location1901043637") + .build(); + client.resolveConnectSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateEphemeralCertTest() throws Exception { + GenerateEphemeralCertResponse expectedResponse = + GenerateEphemeralCertResponse.newBuilder() + .setEphemeralCert(SslCert.newBuilder().build()) + .build(); + mockSqlConnectService.addResponse(expectedResponse); + + GenerateEphemeralCertRequest request = + GenerateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setPublicKey("publicKey1446899510") + .setAccessToken("accessToken-1042689291") + .setReadTime(Timestamp.newBuilder().build()) + .setValidDuration(Duration.newBuilder().build()) + .build(); + + GenerateEphemeralCertResponse actualResponse = client.generateEphemeralCert(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlConnectService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateEphemeralCertRequest actualRequest = + ((GenerateEphemeralCertRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getPublicKey(), actualRequest.getPublicKey()); + Assert.assertEquals(request.getAccessToken(), actualRequest.getAccessToken()); + Assert.assertEquals(request.getReadTime(), actualRequest.getReadTime()); + Assert.assertEquals(request.getValidDuration(), actualRequest.getValidDuration()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateEphemeralCertExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlConnectService.addException(exception); + + try { + GenerateEphemeralCertRequest request = + GenerateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setPublicKey("publicKey1446899510") + .setAccessToken("accessToken-1042689291") + .setReadTime(Timestamp.newBuilder().build()) + .setValidDuration(Duration.newBuilder().build()) + .build(); + client.generateEphemeralCert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlDatabasesServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlDatabasesServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..3fdeb54a9b66 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlDatabasesServiceClientHttpJsonTest.java @@ -0,0 +1,481 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +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.sql.v1.stub.HttpJsonSqlDatabasesServiceStub; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlDatabasesServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlDatabasesServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlDatabasesServiceStub.getMethodDescriptors(), + SqlDatabasesServiceSettings.getDefaultEndpoint()); + SqlDatabasesServiceSettings settings = + SqlDatabasesServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlDatabasesServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlDatabasesServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlDatabasesDeleteRequest request = + SqlDatabasesDeleteRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.delete(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 deleteExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlDatabasesDeleteRequest request = + SqlDatabasesDeleteRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + Database expectedResponse = + Database.newBuilder() + .setKind("kind3292052") + .setCharset("charset739074380") + .setCollation("collation1880293257") + .setEtag("etag3123477") + .setName("name3373707") + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .setProject("project-309310695") + .build(); + mockService.addResponse(expectedResponse); + + SqlDatabasesGetRequest request = + SqlDatabasesGetRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Database actualResponse = client.get(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 getExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlDatabasesGetRequest request = + SqlDatabasesGetRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlDatabasesInsertRequest request = + SqlDatabasesInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(Database.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(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 insertExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlDatabasesInsertRequest request = + SqlDatabasesInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(Database.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + DatabasesListResponse expectedResponse = + DatabasesListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SqlDatabasesListRequest request = + SqlDatabasesListRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + DatabasesListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlDatabasesListRequest request = + SqlDatabasesListRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void patchTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(Database.newBuilder().build()) + .build(); + + Operation actualResponse = client.patch(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 patchExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(Database.newBuilder().build()) + .build(); + client.patch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(Database.newBuilder().build()) + .build(); + + Operation actualResponse = client.update(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 updateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(Database.newBuilder().build()) + .build(); + client.update(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlDatabasesServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlDatabasesServiceClientTest.java new file mode 100644 index 000000000000..c43c428eb158 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlDatabasesServiceClientTest.java @@ -0,0 +1,465 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlDatabasesServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlDatabasesService mockSqlDatabasesService; + private LocalChannelProvider channelProvider; + private SqlDatabasesServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlDatabasesService = new MockSqlDatabasesService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlDatabasesService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlDatabasesServiceSettings settings = + SqlDatabasesServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlDatabasesServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlDatabasesService.addResponse(expectedResponse); + + SqlDatabasesDeleteRequest request = + SqlDatabasesDeleteRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.delete(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlDatabasesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlDatabasesDeleteRequest actualRequest = ((SqlDatabasesDeleteRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getDatabase(), actualRequest.getDatabase()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlDatabasesService.addException(exception); + + try { + SqlDatabasesDeleteRequest request = + SqlDatabasesDeleteRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + Database expectedResponse = + Database.newBuilder() + .setKind("kind3292052") + .setCharset("charset739074380") + .setCollation("collation1880293257") + .setEtag("etag3123477") + .setName("name3373707") + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .setProject("project-309310695") + .build(); + mockSqlDatabasesService.addResponse(expectedResponse); + + SqlDatabasesGetRequest request = + SqlDatabasesGetRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Database actualResponse = client.get(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlDatabasesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlDatabasesGetRequest actualRequest = ((SqlDatabasesGetRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getDatabase(), actualRequest.getDatabase()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlDatabasesService.addException(exception); + + try { + SqlDatabasesGetRequest request = + SqlDatabasesGetRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlDatabasesService.addResponse(expectedResponse); + + SqlDatabasesInsertRequest request = + SqlDatabasesInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlDatabasesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlDatabasesInsertRequest actualRequest = ((SqlDatabasesInsertRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void insertExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlDatabasesService.addException(exception); + + try { + SqlDatabasesInsertRequest request = + SqlDatabasesInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + DatabasesListResponse expectedResponse = + DatabasesListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockSqlDatabasesService.addResponse(expectedResponse); + + SqlDatabasesListRequest request = + SqlDatabasesListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + DatabasesListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlDatabasesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlDatabasesListRequest actualRequest = ((SqlDatabasesListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlDatabasesService.addException(exception); + + try { + SqlDatabasesListRequest request = + SqlDatabasesListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void patchTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlDatabasesService.addResponse(expectedResponse); + + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + + Operation actualResponse = client.patch(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlDatabasesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlDatabasesUpdateRequest actualRequest = ((SqlDatabasesUpdateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getDatabase(), actualRequest.getDatabase()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void patchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlDatabasesService.addException(exception); + + try { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + client.patch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlDatabasesService.addResponse(expectedResponse); + + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + + Operation actualResponse = client.update(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlDatabasesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlDatabasesUpdateRequest actualRequest = ((SqlDatabasesUpdateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getDatabase(), actualRequest.getDatabase()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlDatabasesService.addException(exception); + + try { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + client.update(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlFlagsServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlFlagsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..fe77d8e1561d --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlFlagsServiceClientHttpJsonTest.java @@ -0,0 +1,127 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +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.sql.v1.stub.HttpJsonSqlFlagsServiceStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlFlagsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlFlagsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlFlagsServiceStub.getMethodDescriptors(), + SqlFlagsServiceSettings.getDefaultEndpoint()); + SqlFlagsServiceSettings settings = + SqlFlagsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlFlagsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlFlagsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listTest() throws Exception { + FlagsListResponse expectedResponse = + FlagsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SqlFlagsListRequest request = + SqlFlagsListRequest.newBuilder() + .setDatabaseVersion("databaseVersion1250955997") + .setFlagScope(SqlFlagScope.forNumber(0)) + .build(); + + FlagsListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlFlagsListRequest request = + SqlFlagsListRequest.newBuilder() + .setDatabaseVersion("databaseVersion1250955997") + .setFlagScope(SqlFlagScope.forNumber(0)) + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlFlagsServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlFlagsServiceClientTest.java new file mode 100644 index 000000000000..11d754ca2834 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlFlagsServiceClientTest.java @@ -0,0 +1,129 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlFlagsServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlFlagsService mockSqlFlagsService; + private LocalChannelProvider channelProvider; + private SqlFlagsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlFlagsService = new MockSqlFlagsService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlFlagsService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlFlagsServiceSettings settings = + SqlFlagsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlFlagsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listTest() throws Exception { + FlagsListResponse expectedResponse = + FlagsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockSqlFlagsService.addResponse(expectedResponse); + + SqlFlagsListRequest request = + SqlFlagsListRequest.newBuilder() + .setDatabaseVersion("databaseVersion1250955997") + .setFlagScope(SqlFlagScope.forNumber(0)) + .build(); + + FlagsListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlFlagsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlFlagsListRequest actualRequest = ((SqlFlagsListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getDatabaseVersion(), actualRequest.getDatabaseVersion()); + Assert.assertEquals(request.getFlagScope(), actualRequest.getFlagScope()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlFlagsService.addException(exception); + + try { + SqlFlagsListRequest request = + SqlFlagsListRequest.newBuilder() + .setDatabaseVersion("databaseVersion1250955997") + .setFlagScope(SqlFlagScope.forNumber(0)) + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlInstancesServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlInstancesServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..59cefcd006d5 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlInstancesServiceClientHttpJsonTest.java @@ -0,0 +1,3024 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +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.sql.v1.stub.HttpJsonSqlInstancesServiceStub; +import com.google.protobuf.BoolValue; +import com.google.protobuf.Duration; +import com.google.protobuf.Int64Value; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlInstancesServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlInstancesServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlInstancesServiceStub.getMethodDescriptors(), + SqlInstancesServiceSettings.getDefaultEndpoint()); + SqlInstancesServiceSettings settings = + SqlInstancesServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlInstancesServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlInstancesServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void addServerCaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesAddServerCaRequest request = + SqlInstancesAddServerCaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.addServerCa(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 addServerCaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesAddServerCaRequest request = + SqlInstancesAddServerCaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.addServerCa(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addServerCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesAddServerCertificateRequest request = + SqlInstancesAddServerCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.addServerCertificate(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 addServerCertificateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesAddServerCertificateRequest request = + SqlInstancesAddServerCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.addServerCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addEntraIdCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesAddEntraIdCertificateRequest request = + SqlInstancesAddEntraIdCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.addEntraIdCertificate(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 addEntraIdCertificateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesAddEntraIdCertificateRequest request = + SqlInstancesAddEntraIdCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.addEntraIdCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void cloneTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesCloneRequest request = + SqlInstancesCloneRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesCloneRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.clone(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 cloneExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesCloneRequest request = + SqlInstancesCloneRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesCloneRequest.newBuilder().build()) + .build(); + client.clone(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesDeleteRequest request = + SqlInstancesDeleteRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setEnableFinalBackup(true) + .setFinalBackupDescription("finalBackupDescription-293551612") + .build(); + + Operation actualResponse = client.delete(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 deleteExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesDeleteRequest request = + SqlInstancesDeleteRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setEnableFinalBackup(true) + .setFinalBackupDescription("finalBackupDescription-293551612") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void demoteMasterTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesDemoteMasterRequest request = + SqlInstancesDemoteMasterRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesDemoteMasterRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.demoteMaster(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 demoteMasterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesDemoteMasterRequest request = + SqlInstancesDemoteMasterRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesDemoteMasterRequest.newBuilder().build()) + .build(); + client.demoteMaster(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void demoteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesDemoteRequest request = + SqlInstancesDemoteRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesDemoteRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.demote(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 demoteExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesDemoteRequest request = + SqlInstancesDemoteRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesDemoteRequest.newBuilder().build()) + .build(); + client.demote(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void exportTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesExportRequest request = + SqlInstancesExportRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesExportRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.export(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 exportExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesExportRequest request = + SqlInstancesExportRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesExportRequest.newBuilder().build()) + .build(); + client.export(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void failoverTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesFailoverRequest request = + SqlInstancesFailoverRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesFailoverRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.failover(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 failoverExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesFailoverRequest request = + SqlInstancesFailoverRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesFailoverRequest.newBuilder().build()) + .build(); + client.failover(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void reencryptTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesReencryptRequest request = + SqlInstancesReencryptRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesReencryptRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.reencrypt(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 reencryptExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesReencryptRequest request = + SqlInstancesReencryptRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesReencryptRequest.newBuilder().build()) + .build(); + client.reencrypt(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + DatabaseInstance expectedResponse = + DatabaseInstance.newBuilder() + .setKind("kind3292052") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setSettings(Settings.newBuilder().build()) + .setEtag("etag3123477") + .setFailoverReplica(DatabaseInstance.SqlFailoverReplica.newBuilder().build()) + .setMasterInstanceName("masterInstanceName2132225090") + .addAllReplicaNames(new ArrayList()) + .setMaxDiskSize(Int64Value.newBuilder().build()) + .setCurrentDiskSize(Int64Value.newBuilder().build()) + .addAllIpAddresses(new ArrayList()) + .setServerCaCert(SslCert.newBuilder().build()) + .setInstanceType(SqlInstanceType.forNumber(0)) + .setProject("project-309310695") + .setIpv6Address("ipv6Address1372169229") + .setServiceAccountEmailAddress("serviceAccountEmailAddress245216912") + .setOnPremisesConfiguration(OnPremisesConfiguration.newBuilder().build()) + .setReplicaConfiguration(ReplicaConfiguration.newBuilder().build()) + .setBackendType(SqlBackendType.forNumber(0)) + .setSelfLink("selfLink1191800166") + .addAllSuspensionReason(new ArrayList()) + .setConnectionName("connectionName1270009481") + .setName("name3373707") + .setRegion("region-934795532") + .setGceZone("gceZone-146048427") + .setSecondaryGceZone("secondaryGceZone227989057") + .setDiskEncryptionConfiguration(DiskEncryptionConfiguration.newBuilder().build()) + .setDiskEncryptionStatus(DiskEncryptionStatus.newBuilder().build()) + .setRootPassword("rootPassword1669569949") + .setScheduledMaintenance(DatabaseInstance.SqlScheduledMaintenance.newBuilder().build()) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setDatabaseInstalledVersion("databaseInstalledVersion-808517735") + .setOutOfDiskReport(DatabaseInstance.SqlOutOfDiskReport.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .addAllAvailableMaintenanceVersions(new ArrayList()) + .setMaintenanceVersion("maintenanceVersion1355658821") + .addAllUpgradableDatabaseVersions(new ArrayList()) + .setPscServiceAttachmentLink("pscServiceAttachmentLink-321045774") + .setDnsName("dnsName1813886804") + .setPrimaryDnsName("primaryDnsName330291954") + .setWriteEndpoint("writeEndpoint-105280876") + .setReplicationCluster(ReplicationCluster.newBuilder().build()) + .setGeminiConfig(GeminiInstanceConfig.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .setSwitchTransactionLogsToCloudStorageEnabled(BoolValue.newBuilder().build()) + .setIncludeReplicasForMajorVersionUpgrade(BoolValue.newBuilder().build()) + .putAllTags(new HashMap()) + .setNodeCount(1539922066) + .addAllNodes(new ArrayList()) + .addAllDnsNames(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesGetRequest request = + SqlInstancesGetRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + DatabaseInstance actualResponse = client.get(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 getExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesGetRequest request = + SqlInstancesGetRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void import_Test() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesImportRequest request = + SqlInstancesImportRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesImportRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.import_(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 import_ExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesImportRequest request = + SqlInstancesImportRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesImportRequest.newBuilder().build()) + .build(); + client.import_(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesInsertRequest request = + SqlInstancesInsertRequest.newBuilder() + .setProject("project-6911") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(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 insertExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesInsertRequest request = + SqlInstancesInsertRequest.newBuilder() + .setProject("project-6911") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + InstancesListResponse expectedResponse = + InstancesListResponse.newBuilder() + .setKind("kind3292052") + .addAllWarnings(new ArrayList()) + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesListRequest request = + SqlInstancesListRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-6911") + .build(); + + InstancesListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesListRequest request = + SqlInstancesListRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-6911") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listServerCasTest() throws Exception { + InstancesListServerCasResponse expectedResponse = + InstancesListServerCasResponse.newBuilder() + .addAllCerts(new ArrayList()) + .setActiveVersion("activeVersion-827825422") + .setKind("kind3292052") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesListServerCasRequest request = + SqlInstancesListServerCasRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + InstancesListServerCasResponse actualResponse = client.listServerCas(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 listServerCasExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesListServerCasRequest request = + SqlInstancesListServerCasRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.listServerCas(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listServerCertificatesTest() throws Exception { + InstancesListServerCertificatesResponse expectedResponse = + InstancesListServerCertificatesResponse.newBuilder() + .addAllCaCerts(new ArrayList()) + .addAllServerCerts(new ArrayList()) + .setActiveVersion("activeVersion-827825422") + .setKind("kind3292052") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesListServerCertificatesRequest request = + SqlInstancesListServerCertificatesRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + InstancesListServerCertificatesResponse actualResponse = client.listServerCertificates(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 listServerCertificatesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesListServerCertificatesRequest request = + SqlInstancesListServerCertificatesRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.listServerCertificates(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEntraIdCertificatesTest() throws Exception { + InstancesListEntraIdCertificatesResponse expectedResponse = + InstancesListEntraIdCertificatesResponse.newBuilder() + .addAllCerts(new ArrayList()) + .setActiveVersion("activeVersion-827825422") + .setKind("kind3292052") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesListEntraIdCertificatesRequest request = + SqlInstancesListEntraIdCertificatesRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + InstancesListEntraIdCertificatesResponse actualResponse = + client.listEntraIdCertificates(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 listEntraIdCertificatesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesListEntraIdCertificatesRequest request = + SqlInstancesListEntraIdCertificatesRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.listEntraIdCertificates(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void patchTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesPatchRequest request = + SqlInstancesPatchRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setReconcilePscNetworking(true) + .setReconcilePscNetworkingForce(true) + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + + Operation actualResponse = client.patch(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 patchExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesPatchRequest request = + SqlInstancesPatchRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setReconcilePscNetworking(true) + .setReconcilePscNetworkingForce(true) + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + client.patch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void promoteReplicaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesPromoteReplicaRequest request = + SqlInstancesPromoteReplicaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setFailover(true) + .build(); + + Operation actualResponse = client.promoteReplica(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 promoteReplicaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesPromoteReplicaRequest request = + SqlInstancesPromoteReplicaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setFailover(true) + .build(); + client.promoteReplica(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void switchoverTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesSwitchoverRequest request = + SqlInstancesSwitchoverRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setDbTimeout(Duration.newBuilder().build()) + .build(); + + Operation actualResponse = client.switchover(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 switchoverExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesSwitchoverRequest request = + SqlInstancesSwitchoverRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setDbTimeout(Duration.newBuilder().build()) + .build(); + client.switchover(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resetSslConfigTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesResetSslConfigRequest request = + SqlInstancesResetSslConfigRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.resetSslConfig(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 resetSslConfigExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesResetSslConfigRequest request = + SqlInstancesResetSslConfigRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.resetSslConfig(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void restartTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesRestartRequest request = + SqlInstancesRestartRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.restart(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 restartExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesRestartRequest request = + SqlInstancesRestartRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.restart(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void restoreBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesRestoreBackupRequest request = + SqlInstancesRestoreBackupRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRestoreBackupRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.restoreBackup(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 restoreBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesRestoreBackupRequest request = + SqlInstancesRestoreBackupRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRestoreBackupRequest.newBuilder().build()) + .build(); + client.restoreBackup(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rotateServerCaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesRotateServerCaRequest request = + SqlInstancesRotateServerCaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRotateServerCaRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.rotateServerCa(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 rotateServerCaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesRotateServerCaRequest request = + SqlInstancesRotateServerCaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRotateServerCaRequest.newBuilder().build()) + .build(); + client.rotateServerCa(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rotateServerCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesRotateServerCertificateRequest request = + SqlInstancesRotateServerCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRotateServerCertificateRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.rotateServerCertificate(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 rotateServerCertificateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesRotateServerCertificateRequest request = + SqlInstancesRotateServerCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRotateServerCertificateRequest.newBuilder().build()) + .build(); + client.rotateServerCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rotateEntraIdCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesRotateEntraIdCertificateRequest request = + SqlInstancesRotateEntraIdCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.rotateEntraIdCertificate(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 rotateEntraIdCertificateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesRotateEntraIdCertificateRequest request = + SqlInstancesRotateEntraIdCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build()) + .build(); + client.rotateEntraIdCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void startReplicaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesStartReplicaRequest request = + SqlInstancesStartReplicaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.startReplica(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 startReplicaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesStartReplicaRequest request = + SqlInstancesStartReplicaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.startReplica(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void stopReplicaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesStopReplicaRequest request = + SqlInstancesStopReplicaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.stopReplica(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 stopReplicaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesStopReplicaRequest request = + SqlInstancesStopReplicaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.stopReplica(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void truncateLogTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesTruncateLogRequest request = + SqlInstancesTruncateLogRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesTruncateLogRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.truncateLog(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 truncateLogExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesTruncateLogRequest request = + SqlInstancesTruncateLogRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesTruncateLogRequest.newBuilder().build()) + .build(); + client.truncateLog(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesUpdateRequest request = + SqlInstancesUpdateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + + Operation actualResponse = client.update(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 updateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesUpdateRequest request = + SqlInstancesUpdateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + client.update(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createEphemeralTest() throws Exception { + SslCert expectedResponse = + SslCert.newBuilder() + .setKind("kind3292052") + .setCertSerialNumber("certSerialNumber1709590177") + .setCert("cert3050020") + .setCreateTime(Timestamp.newBuilder().build()) + .setCommonName("commonName1184312086") + .setExpirationTime(Timestamp.newBuilder().build()) + .setSha1Fingerprint("sha1Fingerprint163009183") + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesCreateEphemeralCertRequest request = + SqlInstancesCreateEphemeralCertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(SslCertsCreateEphemeralRequest.newBuilder().build()) + .build(); + + SslCert actualResponse = client.createEphemeral(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 createEphemeralExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesCreateEphemeralCertRequest request = + SqlInstancesCreateEphemeralCertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(SslCertsCreateEphemeralRequest.newBuilder().build()) + .build(); + client.createEphemeral(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rescheduleMaintenanceTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesRescheduleMaintenanceRequest request = + SqlInstancesRescheduleMaintenanceRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build()) + .build(); + + Operation actualResponse = client.rescheduleMaintenance(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 rescheduleMaintenanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesRescheduleMaintenanceRequest request = + SqlInstancesRescheduleMaintenanceRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build()) + .build(); + client.rescheduleMaintenance(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyExternalSyncSettingsTest() throws Exception { + SqlInstancesVerifyExternalSyncSettingsResponse expectedResponse = + SqlInstancesVerifyExternalSyncSettingsResponse.newBuilder() + .setKind("kind3292052") + .addAllErrors(new ArrayList()) + .addAllWarnings(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesVerifyExternalSyncSettingsRequest request = + SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setVerifyConnectionOnly(true) + .setVerifyReplicationOnly(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .addAllSelectedObjects(new ArrayList()) + .build(); + + SqlInstancesVerifyExternalSyncSettingsResponse actualResponse = + client.verifyExternalSyncSettings(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 verifyExternalSyncSettingsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesVerifyExternalSyncSettingsRequest request = + SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setVerifyConnectionOnly(true) + .setVerifyReplicationOnly(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .addAllSelectedObjects(new ArrayList()) + .build(); + client.verifyExternalSyncSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void startExternalSyncTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesStartExternalSyncRequest request = + SqlInstancesStartExternalSyncRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSkipVerification(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .setReplicaOverwriteEnabled(true) + .build(); + + Operation actualResponse = client.startExternalSync(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 startExternalSyncExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesStartExternalSyncRequest request = + SqlInstancesStartExternalSyncRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSkipVerification(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .setReplicaOverwriteEnabled(true) + .build(); + client.startExternalSync(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void performDiskShrinkTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesPerformDiskShrinkRequest request = + SqlInstancesPerformDiskShrinkRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(PerformDiskShrinkContext.newBuilder().build()) + .build(); + + Operation actualResponse = client.performDiskShrink(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 performDiskShrinkExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesPerformDiskShrinkRequest request = + SqlInstancesPerformDiskShrinkRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(PerformDiskShrinkContext.newBuilder().build()) + .build(); + client.performDiskShrink(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDiskShrinkConfigTest() throws Exception { + SqlInstancesGetDiskShrinkConfigResponse expectedResponse = + SqlInstancesGetDiskShrinkConfigResponse.newBuilder() + .setKind("kind3292052") + .setMinimalTargetSizeGb(-1076246647) + .setMessage("message954925063") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesGetDiskShrinkConfigRequest request = + SqlInstancesGetDiskShrinkConfigRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + SqlInstancesGetDiskShrinkConfigResponse actualResponse = client.getDiskShrinkConfig(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 getDiskShrinkConfigExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesGetDiskShrinkConfigRequest request = + SqlInstancesGetDiskShrinkConfigRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.getDiskShrinkConfig(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resetReplicaSizeTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesResetReplicaSizeRequest request = + SqlInstancesResetReplicaSizeRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.resetReplicaSize(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 resetReplicaSizeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesResetReplicaSizeRequest request = + SqlInstancesResetReplicaSizeRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.resetReplicaSize(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLatestRecoveryTimeTest() throws Exception { + SqlInstancesGetLatestRecoveryTimeResponse expectedResponse = + SqlInstancesGetLatestRecoveryTimeResponse.newBuilder() + .setKind("kind3292052") + .setLatestRecoveryTime(Timestamp.newBuilder().build()) + .setEarliestRecoveryTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesGetLatestRecoveryTimeRequest request = + SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSourceInstanceDeletionTime(Timestamp.newBuilder().build()) + .build(); + + SqlInstancesGetLatestRecoveryTimeResponse actualResponse = + client.getLatestRecoveryTime(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 getLatestRecoveryTimeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesGetLatestRecoveryTimeRequest request = + SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSourceInstanceDeletionTime(Timestamp.newBuilder().build()) + .build(); + client.getLatestRecoveryTime(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void executeSqlTest() throws Exception { + SqlInstancesExecuteSqlResponse expectedResponse = + SqlInstancesExecuteSqlResponse.newBuilder() + .addAllMessages(new ArrayList()) + .setMetadata(Metadata.newBuilder().build()) + .addAllResults(new ArrayList()) + .setStatus(Status.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesExecuteSqlRequest request = + SqlInstancesExecuteSqlRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(ExecuteSqlPayload.newBuilder().build()) + .build(); + + SqlInstancesExecuteSqlResponse actualResponse = client.executeSql(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 executeSqlExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesExecuteSqlRequest request = + SqlInstancesExecuteSqlRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(ExecuteSqlPayload.newBuilder().build()) + .build(); + client.executeSql(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void acquireSsrsLeaseTest() throws Exception { + SqlInstancesAcquireSsrsLeaseResponse expectedResponse = + SqlInstancesAcquireSsrsLeaseResponse.newBuilder() + .setOperationId("operationId129704162") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesAcquireSsrsLeaseRequest request = + SqlInstancesAcquireSsrsLeaseRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build()) + .build(); + + SqlInstancesAcquireSsrsLeaseResponse actualResponse = client.acquireSsrsLease(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 acquireSsrsLeaseExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesAcquireSsrsLeaseRequest request = + SqlInstancesAcquireSsrsLeaseRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build()) + .build(); + client.acquireSsrsLease(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void releaseSsrsLeaseTest() throws Exception { + SqlInstancesReleaseSsrsLeaseResponse expectedResponse = + SqlInstancesReleaseSsrsLeaseResponse.newBuilder() + .setOperationId("operationId129704162") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesReleaseSsrsLeaseRequest request = + SqlInstancesReleaseSsrsLeaseRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + SqlInstancesReleaseSsrsLeaseResponse actualResponse = client.releaseSsrsLease(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 releaseSsrsLeaseExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesReleaseSsrsLeaseRequest request = + SqlInstancesReleaseSsrsLeaseRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.releaseSsrsLease(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void preCheckMajorVersionUpgradeTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesPreCheckMajorVersionUpgradeRequest request = + SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.preCheckMajorVersionUpgrade(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 preCheckMajorVersionUpgradeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesPreCheckMajorVersionUpgradeRequest request = + SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build()) + .build(); + client.preCheckMajorVersionUpgrade(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pointInTimeRestoreTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesPointInTimeRestoreRequest request = + SqlInstancesPointInTimeRestoreRequest.newBuilder() + .setParent("projects/project-2353") + .setContext(PointInTimeRestoreContext.newBuilder().build()) + .build(); + + Operation actualResponse = client.pointInTimeRestore(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 pointInTimeRestoreExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesPointInTimeRestoreRequest request = + SqlInstancesPointInTimeRestoreRequest.newBuilder() + .setParent("projects/project-2353") + .setContext(PointInTimeRestoreContext.newBuilder().build()) + .build(); + client.pointInTimeRestore(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlInstancesServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlInstancesServiceClientTest.java new file mode 100644 index 000000000000..058c770f2836 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlInstancesServiceClientTest.java @@ -0,0 +1,2900 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.BoolValue; +import com.google.protobuf.Duration; +import com.google.protobuf.Int64Value; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import 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 SqlInstancesServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlInstancesService mockSqlInstancesService; + private LocalChannelProvider channelProvider; + private SqlInstancesServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlInstancesService = new MockSqlInstancesService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlInstancesService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlInstancesServiceSettings settings = + SqlInstancesServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlInstancesServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void addServerCaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesAddServerCaRequest request = + SqlInstancesAddServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.addServerCa(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesAddServerCaRequest actualRequest = + ((SqlInstancesAddServerCaRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addServerCaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesAddServerCaRequest request = + SqlInstancesAddServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.addServerCa(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addServerCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesAddServerCertificateRequest request = + SqlInstancesAddServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.addServerCertificate(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesAddServerCertificateRequest actualRequest = + ((SqlInstancesAddServerCertificateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addServerCertificateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesAddServerCertificateRequest request = + SqlInstancesAddServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.addServerCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addEntraIdCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesAddEntraIdCertificateRequest request = + SqlInstancesAddEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.addEntraIdCertificate(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesAddEntraIdCertificateRequest actualRequest = + ((SqlInstancesAddEntraIdCertificateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addEntraIdCertificateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesAddEntraIdCertificateRequest request = + SqlInstancesAddEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.addEntraIdCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void cloneTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesCloneRequest request = + SqlInstancesCloneRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesCloneRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.clone(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesCloneRequest actualRequest = ((SqlInstancesCloneRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void cloneExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesCloneRequest request = + SqlInstancesCloneRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesCloneRequest.newBuilder().build()) + .build(); + client.clone(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesDeleteRequest request = + SqlInstancesDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setEnableFinalBackup(true) + .setFinalBackupDescription("finalBackupDescription-293551612") + .build(); + + Operation actualResponse = client.delete(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesDeleteRequest actualRequest = ((SqlInstancesDeleteRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getEnableFinalBackup(), actualRequest.getEnableFinalBackup()); + Assert.assertEquals(request.getFinalBackupTtlDays(), actualRequest.getFinalBackupTtlDays()); + Assert.assertEquals( + request.getFinalBackupExpiryTime(), actualRequest.getFinalBackupExpiryTime()); + Assert.assertEquals( + request.getFinalBackupDescription(), actualRequest.getFinalBackupDescription()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesDeleteRequest request = + SqlInstancesDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setEnableFinalBackup(true) + .setFinalBackupDescription("finalBackupDescription-293551612") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void demoteMasterTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesDemoteMasterRequest request = + SqlInstancesDemoteMasterRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteMasterRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.demoteMaster(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesDemoteMasterRequest actualRequest = + ((SqlInstancesDemoteMasterRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void demoteMasterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesDemoteMasterRequest request = + SqlInstancesDemoteMasterRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteMasterRequest.newBuilder().build()) + .build(); + client.demoteMaster(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void demoteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesDemoteRequest request = + SqlInstancesDemoteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.demote(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesDemoteRequest actualRequest = ((SqlInstancesDemoteRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void demoteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesDemoteRequest request = + SqlInstancesDemoteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteRequest.newBuilder().build()) + .build(); + client.demote(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void exportTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesExportRequest request = + SqlInstancesExportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesExportRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.export(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesExportRequest actualRequest = ((SqlInstancesExportRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void exportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesExportRequest request = + SqlInstancesExportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesExportRequest.newBuilder().build()) + .build(); + client.export(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void failoverTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesFailoverRequest request = + SqlInstancesFailoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesFailoverRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.failover(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesFailoverRequest actualRequest = + ((SqlInstancesFailoverRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void failoverExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesFailoverRequest request = + SqlInstancesFailoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesFailoverRequest.newBuilder().build()) + .build(); + client.failover(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void reencryptTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesReencryptRequest request = + SqlInstancesReencryptRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesReencryptRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.reencrypt(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesReencryptRequest actualRequest = + ((SqlInstancesReencryptRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void reencryptExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesReencryptRequest request = + SqlInstancesReencryptRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesReencryptRequest.newBuilder().build()) + .build(); + client.reencrypt(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + DatabaseInstance expectedResponse = + DatabaseInstance.newBuilder() + .setKind("kind3292052") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setSettings(Settings.newBuilder().build()) + .setEtag("etag3123477") + .setFailoverReplica(DatabaseInstance.SqlFailoverReplica.newBuilder().build()) + .setMasterInstanceName("masterInstanceName2132225090") + .addAllReplicaNames(new ArrayList()) + .setMaxDiskSize(Int64Value.newBuilder().build()) + .setCurrentDiskSize(Int64Value.newBuilder().build()) + .addAllIpAddresses(new ArrayList()) + .setServerCaCert(SslCert.newBuilder().build()) + .setInstanceType(SqlInstanceType.forNumber(0)) + .setProject("project-309310695") + .setIpv6Address("ipv6Address1372169229") + .setServiceAccountEmailAddress("serviceAccountEmailAddress245216912") + .setOnPremisesConfiguration(OnPremisesConfiguration.newBuilder().build()) + .setReplicaConfiguration(ReplicaConfiguration.newBuilder().build()) + .setBackendType(SqlBackendType.forNumber(0)) + .setSelfLink("selfLink1191800166") + .addAllSuspensionReason(new ArrayList()) + .setConnectionName("connectionName1270009481") + .setName("name3373707") + .setRegion("region-934795532") + .setGceZone("gceZone-146048427") + .setSecondaryGceZone("secondaryGceZone227989057") + .setDiskEncryptionConfiguration(DiskEncryptionConfiguration.newBuilder().build()) + .setDiskEncryptionStatus(DiskEncryptionStatus.newBuilder().build()) + .setRootPassword("rootPassword1669569949") + .setScheduledMaintenance(DatabaseInstance.SqlScheduledMaintenance.newBuilder().build()) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setDatabaseInstalledVersion("databaseInstalledVersion-808517735") + .setOutOfDiskReport(DatabaseInstance.SqlOutOfDiskReport.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .addAllAvailableMaintenanceVersions(new ArrayList()) + .setMaintenanceVersion("maintenanceVersion1355658821") + .addAllUpgradableDatabaseVersions(new ArrayList()) + .setPscServiceAttachmentLink("pscServiceAttachmentLink-321045774") + .setDnsName("dnsName1813886804") + .setPrimaryDnsName("primaryDnsName330291954") + .setWriteEndpoint("writeEndpoint-105280876") + .setReplicationCluster(ReplicationCluster.newBuilder().build()) + .setGeminiConfig(GeminiInstanceConfig.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .setSwitchTransactionLogsToCloudStorageEnabled(BoolValue.newBuilder().build()) + .setIncludeReplicasForMajorVersionUpgrade(BoolValue.newBuilder().build()) + .putAllTags(new HashMap()) + .setNodeCount(1539922066) + .addAllNodes(new ArrayList()) + .addAllDnsNames(new ArrayList()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesGetRequest request = + SqlInstancesGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + DatabaseInstance actualResponse = client.get(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesGetRequest actualRequest = ((SqlInstancesGetRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesGetRequest request = + SqlInstancesGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void import_Test() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesImportRequest request = + SqlInstancesImportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesImportRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.import_(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesImportRequest actualRequest = ((SqlInstancesImportRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void import_ExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesImportRequest request = + SqlInstancesImportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesImportRequest.newBuilder().build()) + .build(); + client.import_(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesInsertRequest request = + SqlInstancesInsertRequest.newBuilder() + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesInsertRequest actualRequest = ((SqlInstancesInsertRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void insertExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesInsertRequest request = + SqlInstancesInsertRequest.newBuilder() + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + InstancesListResponse expectedResponse = + InstancesListResponse.newBuilder() + .setKind("kind3292052") + .addAllWarnings(new ArrayList()) + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesListRequest request = + SqlInstancesListRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + + InstancesListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesListRequest actualRequest = ((SqlInstancesListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getMaxResults(), actualRequest.getMaxResults()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesListRequest request = + SqlInstancesListRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listServerCasTest() throws Exception { + InstancesListServerCasResponse expectedResponse = + InstancesListServerCasResponse.newBuilder() + .addAllCerts(new ArrayList()) + .setActiveVersion("activeVersion-827825422") + .setKind("kind3292052") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesListServerCasRequest request = + SqlInstancesListServerCasRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + InstancesListServerCasResponse actualResponse = client.listServerCas(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesListServerCasRequest actualRequest = + ((SqlInstancesListServerCasRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listServerCasExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesListServerCasRequest request = + SqlInstancesListServerCasRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.listServerCas(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listServerCertificatesTest() throws Exception { + InstancesListServerCertificatesResponse expectedResponse = + InstancesListServerCertificatesResponse.newBuilder() + .addAllCaCerts(new ArrayList()) + .addAllServerCerts(new ArrayList()) + .setActiveVersion("activeVersion-827825422") + .setKind("kind3292052") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesListServerCertificatesRequest request = + SqlInstancesListServerCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + InstancesListServerCertificatesResponse actualResponse = client.listServerCertificates(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesListServerCertificatesRequest actualRequest = + ((SqlInstancesListServerCertificatesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listServerCertificatesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesListServerCertificatesRequest request = + SqlInstancesListServerCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.listServerCertificates(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEntraIdCertificatesTest() throws Exception { + InstancesListEntraIdCertificatesResponse expectedResponse = + InstancesListEntraIdCertificatesResponse.newBuilder() + .addAllCerts(new ArrayList()) + .setActiveVersion("activeVersion-827825422") + .setKind("kind3292052") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesListEntraIdCertificatesRequest request = + SqlInstancesListEntraIdCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + InstancesListEntraIdCertificatesResponse actualResponse = + client.listEntraIdCertificates(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesListEntraIdCertificatesRequest actualRequest = + ((SqlInstancesListEntraIdCertificatesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listEntraIdCertificatesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesListEntraIdCertificatesRequest request = + SqlInstancesListEntraIdCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.listEntraIdCertificates(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void patchTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesPatchRequest request = + SqlInstancesPatchRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReconcilePscNetworking(true) + .setReconcilePscNetworkingForce(true) + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + + Operation actualResponse = client.patch(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesPatchRequest actualRequest = ((SqlInstancesPatchRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals( + request.getReconcilePscNetworking(), actualRequest.getReconcilePscNetworking()); + Assert.assertEquals( + request.getReconcilePscNetworkingForce(), actualRequest.getReconcilePscNetworkingForce()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void patchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesPatchRequest request = + SqlInstancesPatchRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReconcilePscNetworking(true) + .setReconcilePscNetworkingForce(true) + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + client.patch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void promoteReplicaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesPromoteReplicaRequest request = + SqlInstancesPromoteReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setFailover(true) + .build(); + + Operation actualResponse = client.promoteReplica(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesPromoteReplicaRequest actualRequest = + ((SqlInstancesPromoteReplicaRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getFailover(), actualRequest.getFailover()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void promoteReplicaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesPromoteReplicaRequest request = + SqlInstancesPromoteReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setFailover(true) + .build(); + client.promoteReplica(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void switchoverTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesSwitchoverRequest request = + SqlInstancesSwitchoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setDbTimeout(Duration.newBuilder().build()) + .build(); + + Operation actualResponse = client.switchover(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesSwitchoverRequest actualRequest = + ((SqlInstancesSwitchoverRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getDbTimeout(), actualRequest.getDbTimeout()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void switchoverExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesSwitchoverRequest request = + SqlInstancesSwitchoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setDbTimeout(Duration.newBuilder().build()) + .build(); + client.switchover(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resetSslConfigTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesResetSslConfigRequest request = + SqlInstancesResetSslConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.resetSslConfig(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesResetSslConfigRequest actualRequest = + ((SqlInstancesResetSslConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getMode(), actualRequest.getMode()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void resetSslConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesResetSslConfigRequest request = + SqlInstancesResetSslConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.resetSslConfig(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void restartTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesRestartRequest request = + SqlInstancesRestartRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.restart(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesRestartRequest actualRequest = ((SqlInstancesRestartRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restartExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesRestartRequest request = + SqlInstancesRestartRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.restart(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void restoreBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesRestoreBackupRequest request = + SqlInstancesRestoreBackupRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRestoreBackupRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.restoreBackup(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesRestoreBackupRequest actualRequest = + ((SqlInstancesRestoreBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restoreBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesRestoreBackupRequest request = + SqlInstancesRestoreBackupRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRestoreBackupRequest.newBuilder().build()) + .build(); + client.restoreBackup(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rotateServerCaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesRotateServerCaRequest request = + SqlInstancesRotateServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCaRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.rotateServerCa(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesRotateServerCaRequest actualRequest = + ((SqlInstancesRotateServerCaRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void rotateServerCaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesRotateServerCaRequest request = + SqlInstancesRotateServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCaRequest.newBuilder().build()) + .build(); + client.rotateServerCa(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rotateServerCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesRotateServerCertificateRequest request = + SqlInstancesRotateServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCertificateRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.rotateServerCertificate(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesRotateServerCertificateRequest actualRequest = + ((SqlInstancesRotateServerCertificateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void rotateServerCertificateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesRotateServerCertificateRequest request = + SqlInstancesRotateServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCertificateRequest.newBuilder().build()) + .build(); + client.rotateServerCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rotateEntraIdCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesRotateEntraIdCertificateRequest request = + SqlInstancesRotateEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.rotateEntraIdCertificate(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesRotateEntraIdCertificateRequest actualRequest = + ((SqlInstancesRotateEntraIdCertificateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void rotateEntraIdCertificateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesRotateEntraIdCertificateRequest request = + SqlInstancesRotateEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build()) + .build(); + client.rotateEntraIdCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void startReplicaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesStartReplicaRequest request = + SqlInstancesStartReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.startReplica(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesStartReplicaRequest actualRequest = + ((SqlInstancesStartReplicaRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void startReplicaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesStartReplicaRequest request = + SqlInstancesStartReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.startReplica(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void stopReplicaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesStopReplicaRequest request = + SqlInstancesStopReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.stopReplica(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesStopReplicaRequest actualRequest = + ((SqlInstancesStopReplicaRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void stopReplicaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesStopReplicaRequest request = + SqlInstancesStopReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.stopReplica(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void truncateLogTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesTruncateLogRequest request = + SqlInstancesTruncateLogRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesTruncateLogRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.truncateLog(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesTruncateLogRequest actualRequest = + ((SqlInstancesTruncateLogRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void truncateLogExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesTruncateLogRequest request = + SqlInstancesTruncateLogRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesTruncateLogRequest.newBuilder().build()) + .build(); + client.truncateLog(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesUpdateRequest request = + SqlInstancesUpdateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + + Operation actualResponse = client.update(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesUpdateRequest actualRequest = ((SqlInstancesUpdateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesUpdateRequest request = + SqlInstancesUpdateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + client.update(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createEphemeralTest() throws Exception { + SslCert expectedResponse = + SslCert.newBuilder() + .setKind("kind3292052") + .setCertSerialNumber("certSerialNumber1709590177") + .setCert("cert3050020") + .setCreateTime(Timestamp.newBuilder().build()) + .setCommonName("commonName1184312086") + .setExpirationTime(Timestamp.newBuilder().build()) + .setSha1Fingerprint("sha1Fingerprint163009183") + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesCreateEphemeralCertRequest request = + SqlInstancesCreateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsCreateEphemeralRequest.newBuilder().build()) + .build(); + + SslCert actualResponse = client.createEphemeral(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesCreateEphemeralCertRequest actualRequest = + ((SqlInstancesCreateEphemeralCertRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createEphemeralExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesCreateEphemeralCertRequest request = + SqlInstancesCreateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsCreateEphemeralRequest.newBuilder().build()) + .build(); + client.createEphemeral(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rescheduleMaintenanceTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesRescheduleMaintenanceRequest request = + SqlInstancesRescheduleMaintenanceRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build()) + .build(); + + Operation actualResponse = client.rescheduleMaintenance(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesRescheduleMaintenanceRequest actualRequest = + ((SqlInstancesRescheduleMaintenanceRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void rescheduleMaintenanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesRescheduleMaintenanceRequest request = + SqlInstancesRescheduleMaintenanceRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build()) + .build(); + client.rescheduleMaintenance(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyExternalSyncSettingsTest() throws Exception { + SqlInstancesVerifyExternalSyncSettingsResponse expectedResponse = + SqlInstancesVerifyExternalSyncSettingsResponse.newBuilder() + .setKind("kind3292052") + .addAllErrors(new ArrayList()) + .addAllWarnings(new ArrayList()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesVerifyExternalSyncSettingsRequest request = + SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setVerifyConnectionOnly(true) + .setVerifyReplicationOnly(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .addAllSelectedObjects(new ArrayList()) + .build(); + + SqlInstancesVerifyExternalSyncSettingsResponse actualResponse = + client.verifyExternalSyncSettings(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesVerifyExternalSyncSettingsRequest actualRequest = + ((SqlInstancesVerifyExternalSyncSettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getVerifyConnectionOnly(), actualRequest.getVerifyConnectionOnly()); + Assert.assertEquals(request.getSyncMode(), actualRequest.getSyncMode()); + Assert.assertEquals( + request.getVerifyReplicationOnly(), actualRequest.getVerifyReplicationOnly()); + Assert.assertEquals(request.getMysqlSyncConfig(), actualRequest.getMysqlSyncConfig()); + Assert.assertEquals(request.getMigrationType(), actualRequest.getMigrationType()); + Assert.assertEquals(request.getSyncParallelLevel(), actualRequest.getSyncParallelLevel()); + Assert.assertEquals(request.getSelectedObjectsList(), actualRequest.getSelectedObjectsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void verifyExternalSyncSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesVerifyExternalSyncSettingsRequest request = + SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setVerifyConnectionOnly(true) + .setVerifyReplicationOnly(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .addAllSelectedObjects(new ArrayList()) + .build(); + client.verifyExternalSyncSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void startExternalSyncTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesStartExternalSyncRequest request = + SqlInstancesStartExternalSyncRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSkipVerification(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .setReplicaOverwriteEnabled(true) + .build(); + + Operation actualResponse = client.startExternalSync(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesStartExternalSyncRequest actualRequest = + ((SqlInstancesStartExternalSyncRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getSyncMode(), actualRequest.getSyncMode()); + Assert.assertEquals(request.getSkipVerification(), actualRequest.getSkipVerification()); + Assert.assertEquals(request.getMysqlSyncConfig(), actualRequest.getMysqlSyncConfig()); + Assert.assertEquals(request.getSyncParallelLevel(), actualRequest.getSyncParallelLevel()); + Assert.assertEquals(request.getMigrationType(), actualRequest.getMigrationType()); + Assert.assertEquals( + request.getReplicaOverwriteEnabled(), actualRequest.getReplicaOverwriteEnabled()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void startExternalSyncExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesStartExternalSyncRequest request = + SqlInstancesStartExternalSyncRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSkipVerification(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .setReplicaOverwriteEnabled(true) + .build(); + client.startExternalSync(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void performDiskShrinkTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesPerformDiskShrinkRequest request = + SqlInstancesPerformDiskShrinkRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(PerformDiskShrinkContext.newBuilder().build()) + .build(); + + Operation actualResponse = client.performDiskShrink(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesPerformDiskShrinkRequest actualRequest = + ((SqlInstancesPerformDiskShrinkRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void performDiskShrinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesPerformDiskShrinkRequest request = + SqlInstancesPerformDiskShrinkRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(PerformDiskShrinkContext.newBuilder().build()) + .build(); + client.performDiskShrink(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDiskShrinkConfigTest() throws Exception { + SqlInstancesGetDiskShrinkConfigResponse expectedResponse = + SqlInstancesGetDiskShrinkConfigResponse.newBuilder() + .setKind("kind3292052") + .setMinimalTargetSizeGb(-1076246647) + .setMessage("message954925063") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesGetDiskShrinkConfigRequest request = + SqlInstancesGetDiskShrinkConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + SqlInstancesGetDiskShrinkConfigResponse actualResponse = client.getDiskShrinkConfig(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesGetDiskShrinkConfigRequest actualRequest = + ((SqlInstancesGetDiskShrinkConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDiskShrinkConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesGetDiskShrinkConfigRequest request = + SqlInstancesGetDiskShrinkConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.getDiskShrinkConfig(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resetReplicaSizeTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesResetReplicaSizeRequest request = + SqlInstancesResetReplicaSizeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.resetReplicaSize(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesResetReplicaSizeRequest actualRequest = + ((SqlInstancesResetReplicaSizeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void resetReplicaSizeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesResetReplicaSizeRequest request = + SqlInstancesResetReplicaSizeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.resetReplicaSize(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLatestRecoveryTimeTest() throws Exception { + SqlInstancesGetLatestRecoveryTimeResponse expectedResponse = + SqlInstancesGetLatestRecoveryTimeResponse.newBuilder() + .setKind("kind3292052") + .setLatestRecoveryTime(Timestamp.newBuilder().build()) + .setEarliestRecoveryTime(Timestamp.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesGetLatestRecoveryTimeRequest request = + SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSourceInstanceDeletionTime(Timestamp.newBuilder().build()) + .build(); + + SqlInstancesGetLatestRecoveryTimeResponse actualResponse = + client.getLatestRecoveryTime(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesGetLatestRecoveryTimeRequest actualRequest = + ((SqlInstancesGetLatestRecoveryTimeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals( + request.getSourceInstanceDeletionTime(), actualRequest.getSourceInstanceDeletionTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLatestRecoveryTimeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesGetLatestRecoveryTimeRequest request = + SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSourceInstanceDeletionTime(Timestamp.newBuilder().build()) + .build(); + client.getLatestRecoveryTime(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void executeSqlTest() throws Exception { + SqlInstancesExecuteSqlResponse expectedResponse = + SqlInstancesExecuteSqlResponse.newBuilder() + .addAllMessages(new ArrayList()) + .setMetadata(Metadata.newBuilder().build()) + .addAllResults(new ArrayList()) + .setStatus(Status.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesExecuteSqlRequest request = + SqlInstancesExecuteSqlRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(ExecuteSqlPayload.newBuilder().build()) + .build(); + + SqlInstancesExecuteSqlResponse actualResponse = client.executeSql(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesExecuteSqlRequest actualRequest = + ((SqlInstancesExecuteSqlRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void executeSqlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesExecuteSqlRequest request = + SqlInstancesExecuteSqlRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(ExecuteSqlPayload.newBuilder().build()) + .build(); + client.executeSql(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void acquireSsrsLeaseTest() throws Exception { + SqlInstancesAcquireSsrsLeaseResponse expectedResponse = + SqlInstancesAcquireSsrsLeaseResponse.newBuilder() + .setOperationId("operationId129704162") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesAcquireSsrsLeaseRequest request = + SqlInstancesAcquireSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build()) + .build(); + + SqlInstancesAcquireSsrsLeaseResponse actualResponse = client.acquireSsrsLease(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesAcquireSsrsLeaseRequest actualRequest = + ((SqlInstancesAcquireSsrsLeaseRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void acquireSsrsLeaseExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesAcquireSsrsLeaseRequest request = + SqlInstancesAcquireSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build()) + .build(); + client.acquireSsrsLease(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void releaseSsrsLeaseTest() throws Exception { + SqlInstancesReleaseSsrsLeaseResponse expectedResponse = + SqlInstancesReleaseSsrsLeaseResponse.newBuilder() + .setOperationId("operationId129704162") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesReleaseSsrsLeaseRequest request = + SqlInstancesReleaseSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + SqlInstancesReleaseSsrsLeaseResponse actualResponse = client.releaseSsrsLease(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesReleaseSsrsLeaseRequest actualRequest = + ((SqlInstancesReleaseSsrsLeaseRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void releaseSsrsLeaseExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesReleaseSsrsLeaseRequest request = + SqlInstancesReleaseSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.releaseSsrsLease(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void preCheckMajorVersionUpgradeTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesPreCheckMajorVersionUpgradeRequest request = + SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.preCheckMajorVersionUpgrade(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesPreCheckMajorVersionUpgradeRequest actualRequest = + ((SqlInstancesPreCheckMajorVersionUpgradeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void preCheckMajorVersionUpgradeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesPreCheckMajorVersionUpgradeRequest request = + SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build()) + .build(); + client.preCheckMajorVersionUpgrade(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pointInTimeRestoreTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesPointInTimeRestoreRequest request = + SqlInstancesPointInTimeRestoreRequest.newBuilder() + .setParent("parent-995424086") + .setContext(PointInTimeRestoreContext.newBuilder().build()) + .build(); + + Operation actualResponse = client.pointInTimeRestore(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesPointInTimeRestoreRequest actualRequest = + ((SqlInstancesPointInTimeRestoreRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getContext(), actualRequest.getContext()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pointInTimeRestoreExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesPointInTimeRestoreRequest request = + SqlInstancesPointInTimeRestoreRequest.newBuilder() + .setParent("parent-995424086") + .setContext(PointInTimeRestoreContext.newBuilder().build()) + .build(); + client.pointInTimeRestore(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlOperationsServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlOperationsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..1b5da3462e9c --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlOperationsServiceClientHttpJsonTest.java @@ -0,0 +1,252 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +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.sql.v1.stub.HttpJsonSqlOperationsServiceStub; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlOperationsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlOperationsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlOperationsServiceStub.getMethodDescriptors(), + SqlOperationsServiceSettings.getDefaultEndpoint()); + SqlOperationsServiceSettings settings = + SqlOperationsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlOperationsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlOperationsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlOperationsGetRequest request = + SqlOperationsGetRequest.newBuilder() + .setOperation("operation-3971") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.get(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 getExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlOperationsGetRequest request = + SqlOperationsGetRequest.newBuilder() + .setOperation("operation-3971") + .setProject("project-6911") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + OperationsListResponse expectedResponse = + OperationsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockService.addResponse(expectedResponse); + + SqlOperationsListRequest request = + SqlOperationsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-6911") + .build(); + + OperationsListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlOperationsListRequest request = + SqlOperationsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-6911") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void cancelTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + SqlOperationsCancelRequest request = + SqlOperationsCancelRequest.newBuilder() + .setOperation("operation-3971") + .setProject("project-6911") + .build(); + + client.cancel(request); + + 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 cancelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlOperationsCancelRequest request = + SqlOperationsCancelRequest.newBuilder() + .setOperation("operation-3971") + .setProject("project-6911") + .build(); + client.cancel(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlOperationsServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlOperationsServiceClientTest.java new file mode 100644 index 000000000000..5d1e0f3e64d3 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlOperationsServiceClientTest.java @@ -0,0 +1,246 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlOperationsServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlOperationsService mockSqlOperationsService; + private LocalChannelProvider channelProvider; + private SqlOperationsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlOperationsService = new MockSqlOperationsService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlOperationsService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlOperationsServiceSettings settings = + SqlOperationsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlOperationsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlOperationsService.addResponse(expectedResponse); + + SqlOperationsGetRequest request = + SqlOperationsGetRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.get(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlOperationsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlOperationsGetRequest actualRequest = ((SqlOperationsGetRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getOperation(), actualRequest.getOperation()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlOperationsService.addException(exception); + + try { + SqlOperationsGetRequest request = + SqlOperationsGetRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + OperationsListResponse expectedResponse = + OperationsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockSqlOperationsService.addResponse(expectedResponse); + + SqlOperationsListRequest request = + SqlOperationsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + + OperationsListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlOperationsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlOperationsListRequest actualRequest = ((SqlOperationsListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getMaxResults(), actualRequest.getMaxResults()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlOperationsService.addException(exception); + + try { + SqlOperationsListRequest request = + SqlOperationsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void cancelTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSqlOperationsService.addResponse(expectedResponse); + + SqlOperationsCancelRequest request = + SqlOperationsCancelRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + + client.cancel(request); + + List actualRequests = mockSqlOperationsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlOperationsCancelRequest actualRequest = ((SqlOperationsCancelRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getOperation(), actualRequest.getOperation()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void cancelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlOperationsService.addException(exception); + + try { + SqlOperationsCancelRequest request = + SqlOperationsCancelRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + client.cancel(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlSslCertsServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlSslCertsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..280dafbac1ba --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlSslCertsServiceClientHttpJsonTest.java @@ -0,0 +1,319 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +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.sql.v1.stub.HttpJsonSqlSslCertsServiceStub; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlSslCertsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlSslCertsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlSslCertsServiceStub.getMethodDescriptors(), + SqlSslCertsServiceSettings.getDefaultEndpoint()); + SqlSslCertsServiceSettings settings = + SqlSslCertsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlSslCertsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlSslCertsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlSslCertsDeleteRequest request = + SqlSslCertsDeleteRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSha1Fingerprint("sha1Fingerprint-7419") + .build(); + + Operation actualResponse = client.delete(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 deleteExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlSslCertsDeleteRequest request = + SqlSslCertsDeleteRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSha1Fingerprint("sha1Fingerprint-7419") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + SslCert expectedResponse = + SslCert.newBuilder() + .setKind("kind3292052") + .setCertSerialNumber("certSerialNumber1709590177") + .setCert("cert3050020") + .setCreateTime(Timestamp.newBuilder().build()) + .setCommonName("commonName1184312086") + .setExpirationTime(Timestamp.newBuilder().build()) + .setSha1Fingerprint("sha1Fingerprint163009183") + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .build(); + mockService.addResponse(expectedResponse); + + SqlSslCertsGetRequest request = + SqlSslCertsGetRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSha1Fingerprint("sha1Fingerprint-7419") + .build(); + + SslCert actualResponse = client.get(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 getExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlSslCertsGetRequest request = + SqlSslCertsGetRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSha1Fingerprint("sha1Fingerprint-7419") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + SslCertsInsertResponse expectedResponse = + SslCertsInsertResponse.newBuilder() + .setKind("kind3292052") + .setOperation(Operation.newBuilder().build()) + .setServerCaCert(SslCert.newBuilder().build()) + .setClientCert(SslCertDetail.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlSslCertsInsertRequest request = + SqlSslCertsInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(SslCertsInsertRequest.newBuilder().build()) + .build(); + + SslCertsInsertResponse actualResponse = client.insert(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 insertExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlSslCertsInsertRequest request = + SqlSslCertsInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(SslCertsInsertRequest.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + SslCertsListResponse expectedResponse = + SslCertsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SqlSslCertsListRequest request = + SqlSslCertsListRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + SslCertsListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlSslCertsListRequest request = + SqlSslCertsListRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlSslCertsServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlSslCertsServiceClientTest.java new file mode 100644 index 000000000000..f1560a1d766f --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlSslCertsServiceClientTest.java @@ -0,0 +1,309 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlSslCertsServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlSslCertsService mockSqlSslCertsService; + private LocalChannelProvider channelProvider; + private SqlSslCertsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlSslCertsService = new MockSqlSslCertsService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlSslCertsService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlSslCertsServiceSettings settings = + SqlSslCertsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlSslCertsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlSslCertsService.addResponse(expectedResponse); + + SqlSslCertsDeleteRequest request = + SqlSslCertsDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + + Operation actualResponse = client.delete(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlSslCertsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlSslCertsDeleteRequest actualRequest = ((SqlSslCertsDeleteRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getSha1Fingerprint(), actualRequest.getSha1Fingerprint()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlSslCertsService.addException(exception); + + try { + SqlSslCertsDeleteRequest request = + SqlSslCertsDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + SslCert expectedResponse = + SslCert.newBuilder() + .setKind("kind3292052") + .setCertSerialNumber("certSerialNumber1709590177") + .setCert("cert3050020") + .setCreateTime(Timestamp.newBuilder().build()) + .setCommonName("commonName1184312086") + .setExpirationTime(Timestamp.newBuilder().build()) + .setSha1Fingerprint("sha1Fingerprint163009183") + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .build(); + mockSqlSslCertsService.addResponse(expectedResponse); + + SqlSslCertsGetRequest request = + SqlSslCertsGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + + SslCert actualResponse = client.get(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlSslCertsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlSslCertsGetRequest actualRequest = ((SqlSslCertsGetRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getSha1Fingerprint(), actualRequest.getSha1Fingerprint()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlSslCertsService.addException(exception); + + try { + SqlSslCertsGetRequest request = + SqlSslCertsGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + SslCertsInsertResponse expectedResponse = + SslCertsInsertResponse.newBuilder() + .setKind("kind3292052") + .setOperation(Operation.newBuilder().build()) + .setServerCaCert(SslCert.newBuilder().build()) + .setClientCert(SslCertDetail.newBuilder().build()) + .build(); + mockSqlSslCertsService.addResponse(expectedResponse); + + SqlSslCertsInsertRequest request = + SqlSslCertsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsInsertRequest.newBuilder().build()) + .build(); + + SslCertsInsertResponse actualResponse = client.insert(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlSslCertsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlSslCertsInsertRequest actualRequest = ((SqlSslCertsInsertRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void insertExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlSslCertsService.addException(exception); + + try { + SqlSslCertsInsertRequest request = + SqlSslCertsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsInsertRequest.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + SslCertsListResponse expectedResponse = + SslCertsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockSqlSslCertsService.addResponse(expectedResponse); + + SqlSslCertsListRequest request = + SqlSslCertsListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + SslCertsListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlSslCertsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlSslCertsListRequest actualRequest = ((SqlSslCertsListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlSslCertsService.addException(exception); + + try { + SqlSslCertsListRequest request = + SqlSslCertsListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlTiersServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlTiersServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..0f84170e01c6 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlTiersServiceClientHttpJsonTest.java @@ -0,0 +1,121 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +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.sql.v1.stub.HttpJsonSqlTiersServiceStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlTiersServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlTiersServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlTiersServiceStub.getMethodDescriptors(), + SqlTiersServiceSettings.getDefaultEndpoint()); + SqlTiersServiceSettings settings = + SqlTiersServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlTiersServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlTiersServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listTest() throws Exception { + TiersListResponse expectedResponse = + TiersListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SqlTiersListRequest request = + SqlTiersListRequest.newBuilder().setProject("project-6911").build(); + + TiersListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlTiersListRequest request = + SqlTiersListRequest.newBuilder().setProject("project-6911").build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlTiersServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlTiersServiceClientTest.java new file mode 100644 index 000000000000..07af74f1eebd --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlTiersServiceClientTest.java @@ -0,0 +1,122 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlTiersServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlTiersService mockSqlTiersService; + private LocalChannelProvider channelProvider; + private SqlTiersServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlTiersService = new MockSqlTiersService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlTiersService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlTiersServiceSettings settings = + SqlTiersServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlTiersServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listTest() throws Exception { + TiersListResponse expectedResponse = + TiersListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockSqlTiersService.addResponse(expectedResponse); + + SqlTiersListRequest request = + SqlTiersListRequest.newBuilder().setProject("project-309310695").build(); + + TiersListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlTiersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlTiersListRequest actualRequest = ((SqlTiersListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlTiersService.addException(exception); + + try { + SqlTiersListRequest request = + SqlTiersListRequest.newBuilder().setProject("project-309310695").build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlUsersServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlUsersServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..05c169326694 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlUsersServiceClientHttpJsonTest.java @@ -0,0 +1,420 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +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.sql.v1.stub.HttpJsonSqlUsersServiceStub; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlUsersServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlUsersServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlUsersServiceStub.getMethodDescriptors(), + SqlUsersServiceSettings.getDefaultEndpoint()); + SqlUsersServiceSettings settings = + SqlUsersServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlUsersServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlUsersServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlUsersDeleteRequest request = + SqlUsersDeleteRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance-7525") + .setName("name3373707") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.delete(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 deleteExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlUsersDeleteRequest request = + SqlUsersDeleteRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance-7525") + .setName("name3373707") + .setProject("project-6911") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setKind("kind3292052") + .setPassword("password1216985755") + .setEtag("etag3123477") + .setName("name3373707") + .setHost("host3208616") + .setInstance("instance555127957") + .setProject("project-309310695") + .setIamEmail("iamEmail1687646791") + .setPasswordPolicy(UserPasswordValidationPolicy.newBuilder().build()) + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SqlUsersGetRequest request = + SqlUsersGetRequest.newBuilder() + .setInstance("instance-7525") + .setName("name-4959") + .setProject("project-6911") + .setHost("host3208616") + .build(); + + User actualResponse = client.get(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 getExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlUsersGetRequest request = + SqlUsersGetRequest.newBuilder() + .setInstance("instance-7525") + .setName("name-4959") + .setProject("project-6911") + .setHost("host3208616") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlUsersInsertRequest request = + SqlUsersInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(User.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(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 insertExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlUsersInsertRequest request = + SqlUsersInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(User.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + UsersListResponse expectedResponse = + UsersListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockService.addResponse(expectedResponse); + + SqlUsersListRequest request = + SqlUsersListRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + UsersListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlUsersListRequest request = + SqlUsersListRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlUsersUpdateRequest request = + SqlUsersUpdateRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance-7525") + .setName("name3373707") + .setProject("project-6911") + .addAllDatabaseRoles(new ArrayList()) + .setRevokeExistingRoles(true) + .setBody(User.newBuilder().build()) + .build(); + + Operation actualResponse = client.update(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 updateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlUsersUpdateRequest request = + SqlUsersUpdateRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance-7525") + .setName("name3373707") + .setProject("project-6911") + .addAllDatabaseRoles(new ArrayList()) + .setRevokeExistingRoles(true) + .setBody(User.newBuilder().build()) + .build(); + client.update(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlUsersServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlUsersServiceClientTest.java new file mode 100644 index 000000000000..1476f1929fd3 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1/SqlUsersServiceClientTest.java @@ -0,0 +1,412 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlUsersServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlUsersService mockSqlUsersService; + private LocalChannelProvider channelProvider; + private SqlUsersServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlUsersService = new MockSqlUsersService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlUsersService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlUsersServiceSettings settings = + SqlUsersServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlUsersServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlUsersService.addResponse(expectedResponse); + + SqlUsersDeleteRequest request = + SqlUsersDeleteRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.delete(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlUsersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlUsersDeleteRequest actualRequest = ((SqlUsersDeleteRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getHost(), actualRequest.getHost()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlUsersService.addException(exception); + + try { + SqlUsersDeleteRequest request = + SqlUsersDeleteRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setKind("kind3292052") + .setPassword("password1216985755") + .setEtag("etag3123477") + .setName("name3373707") + .setHost("host3208616") + .setInstance("instance555127957") + .setProject("project-309310695") + .setIamEmail("iamEmail1687646791") + .setPasswordPolicy(UserPasswordValidationPolicy.newBuilder().build()) + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockSqlUsersService.addResponse(expectedResponse); + + SqlUsersGetRequest request = + SqlUsersGetRequest.newBuilder() + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .setHost("host3208616") + .build(); + + User actualResponse = client.get(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlUsersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlUsersGetRequest actualRequest = ((SqlUsersGetRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getHost(), actualRequest.getHost()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlUsersService.addException(exception); + + try { + SqlUsersGetRequest request = + SqlUsersGetRequest.newBuilder() + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .setHost("host3208616") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlUsersService.addResponse(expectedResponse); + + SqlUsersInsertRequest request = + SqlUsersInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(User.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlUsersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlUsersInsertRequest actualRequest = ((SqlUsersInsertRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void insertExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlUsersService.addException(exception); + + try { + SqlUsersInsertRequest request = + SqlUsersInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(User.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + UsersListResponse expectedResponse = + UsersListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockSqlUsersService.addResponse(expectedResponse); + + SqlUsersListRequest request = + SqlUsersListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + UsersListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlUsersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlUsersListRequest actualRequest = ((SqlUsersListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlUsersService.addException(exception); + + try { + SqlUsersListRequest request = + SqlUsersListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlUsersService.addResponse(expectedResponse); + + SqlUsersUpdateRequest request = + SqlUsersUpdateRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .addAllDatabaseRoles(new ArrayList()) + .setRevokeExistingRoles(true) + .setBody(User.newBuilder().build()) + .build(); + + Operation actualResponse = client.update(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlUsersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlUsersUpdateRequest actualRequest = ((SqlUsersUpdateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getHost(), actualRequest.getHost()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getDatabaseRolesList(), actualRequest.getDatabaseRolesList()); + Assert.assertEquals(request.getRevokeExistingRoles(), actualRequest.getRevokeExistingRoles()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlUsersService.addException(exception); + + try { + SqlUsersUpdateRequest request = + SqlUsersUpdateRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .addAllDatabaseRoles(new ArrayList()) + .setRevokeExistingRoles(true) + .setBody(User.newBuilder().build()) + .build(); + client.update(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockLocations.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockLocations.java new file mode 100644 index 000000000000..adbfcd4f4078 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockLocationsImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockLocationsImpl.java new file mode 100644 index 000000000000..1b1484e9e96e --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockLocationsImpl.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlBackupRunsService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlBackupRunsService.java new file mode 100644 index 000000000000..8a2636d00db7 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlBackupRunsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlBackupRunsService implements MockGrpcService { + private final MockSqlBackupRunsServiceImpl serviceImpl; + + public MockSqlBackupRunsService() { + serviceImpl = new MockSqlBackupRunsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlBackupRunsServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlBackupRunsServiceImpl.java new file mode 100644 index 000000000000..227457ad26ee --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlBackupRunsServiceImpl.java @@ -0,0 +1,143 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceGrpc.SqlBackupRunsServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlBackupRunsServiceImpl extends SqlBackupRunsServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlBackupRunsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void delete( + SqlBackupRunsDeleteRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Delete, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void get(SqlBackupRunsGetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BackupRun) { + requests.add(request); + responseObserver.onNext(((BackupRun) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Get, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BackupRun.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void insert( + SqlBackupRunsInsertRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Insert, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void list( + SqlBackupRunsListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BackupRunsListResponse) { + requests.add(request); + responseObserver.onNext(((BackupRunsListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BackupRunsListResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlBackupsService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlBackupsService.java new file mode 100644 index 000000000000..d5389fb4e910 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlBackupsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlBackupsService implements MockGrpcService { + private final MockSqlBackupsServiceImpl serviceImpl; + + public MockSqlBackupsService() { + serviceImpl = new MockSqlBackupsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlBackupsServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlBackupsServiceImpl.java new file mode 100644 index 000000000000..bd19a74779b6 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlBackupsServiceImpl.java @@ -0,0 +1,164 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceGrpc.SqlBackupsServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlBackupsServiceImpl extends SqlBackupsServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlBackupsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createBackup( + CreateBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBackup(GetBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Backup) { + requests.add(request); + responseObserver.onNext(((Backup) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Backup.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBackups( + ListBackupsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBackupsResponse) { + requests.add(request); + responseObserver.onNext(((ListBackupsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListBackups, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBackupsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBackup( + UpdateBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBackup( + DeleteBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlConnectService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlConnectService.java new file mode 100644 index 000000000000..54f1fac987e3 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlConnectService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlConnectService implements MockGrpcService { + private final MockSqlConnectServiceImpl serviceImpl; + + public MockSqlConnectService() { + serviceImpl = new MockSqlConnectServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlConnectServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlConnectServiceImpl.java new file mode 100644 index 000000000000..43a8153d1ee5 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlConnectServiceImpl.java @@ -0,0 +1,126 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1beta4.SqlConnectServiceGrpc.SqlConnectServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlConnectServiceImpl extends SqlConnectServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlConnectServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void getConnectSettings( + GetConnectSettingsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ConnectSettings) { + requests.add(request); + responseObserver.onNext(((ConnectSettings) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetConnectSettings, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ConnectSettings.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void resolveConnectSettings( + ResolveConnectSettingsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ConnectSettings) { + requests.add(request); + responseObserver.onNext(((ConnectSettings) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ResolveConnectSettings, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + ConnectSettings.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void generateEphemeralCert( + GenerateEphemeralCertRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GenerateEphemeralCertResponse) { + requests.add(request); + responseObserver.onNext(((GenerateEphemeralCertResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GenerateEphemeralCert, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + GenerateEphemeralCertResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlDataService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlDataService.java new file mode 100644 index 000000000000..37d1d9918845 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlDataService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlDataService implements MockGrpcService { + private final MockSqlDataServiceImpl serviceImpl; + + public MockSqlDataService() { + serviceImpl = new MockSqlDataServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlDataServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlDataServiceImpl.java new file mode 100644 index 000000000000..febc88be6eae --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlDataServiceImpl.java @@ -0,0 +1,98 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1beta4.SqlDataServiceGrpc.SqlDataServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlDataServiceImpl extends SqlDataServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlDataServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public StreamObserver streamSqlData( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(StreamSqlDataRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof StreamSqlDataResponse) { + responseObserver.onNext(((StreamSqlDataResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StreamSqlData, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + StreamSqlDataResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlDatabasesService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlDatabasesService.java new file mode 100644 index 000000000000..b00bc9158d93 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlDatabasesService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlDatabasesService implements MockGrpcService { + private final MockSqlDatabasesServiceImpl serviceImpl; + + public MockSqlDatabasesService() { + serviceImpl = new MockSqlDatabasesServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlDatabasesServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlDatabasesServiceImpl.java new file mode 100644 index 000000000000..0ee9c6b4c804 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlDatabasesServiceImpl.java @@ -0,0 +1,184 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceGrpc.SqlDatabasesServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlDatabasesServiceImpl extends SqlDatabasesServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlDatabasesServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void delete( + SqlDatabasesDeleteRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Delete, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void get(SqlDatabasesGetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Database) { + requests.add(request); + responseObserver.onNext(((Database) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Get, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Database.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void insert( + SqlDatabasesInsertRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Insert, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void list( + SqlDatabasesListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DatabasesListResponse) { + requests.add(request); + responseObserver.onNext(((DatabasesListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DatabasesListResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void patch(SqlDatabasesUpdateRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Patch, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void update( + SqlDatabasesUpdateRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Update, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlFlagsService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlFlagsService.java new file mode 100644 index 000000000000..3e038d486b28 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlFlagsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlFlagsService implements MockGrpcService { + private final MockSqlFlagsServiceImpl serviceImpl; + + public MockSqlFlagsService() { + serviceImpl = new MockSqlFlagsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlFlagsServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlFlagsServiceImpl.java new file mode 100644 index 000000000000..80c59b986b61 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlFlagsServiceImpl.java @@ -0,0 +1,81 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1beta4.SqlFlagsServiceGrpc.SqlFlagsServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlFlagsServiceImpl extends SqlFlagsServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlFlagsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void list( + SqlFlagsListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof FlagsListResponse) { + requests.add(request); + responseObserver.onNext(((FlagsListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + FlagsListResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlInstancesService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlInstancesService.java new file mode 100644 index 000000000000..d13c2226cf6e --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlInstancesService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlInstancesService implements MockGrpcService { + private final MockSqlInstancesServiceImpl serviceImpl; + + public MockSqlInstancesService() { + serviceImpl = new MockSqlInstancesServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlInstancesServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlInstancesServiceImpl.java new file mode 100644 index 000000000000..d0c3922e76d5 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlInstancesServiceImpl.java @@ -0,0 +1,985 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceGrpc.SqlInstancesServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlInstancesServiceImpl extends SqlInstancesServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlInstancesServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void addServerCa( + SqlInstancesAddServerCaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AddServerCa, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void addServerCertificate( + SqlInstancesAddServerCertificateRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AddServerCertificate, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void addEntraIdCertificate( + SqlInstancesAddEntraIdCertificateRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AddEntraIdCertificate, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void clone(SqlInstancesCloneRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Clone, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void delete( + SqlInstancesDeleteRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Delete, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void demoteMaster( + SqlInstancesDemoteMasterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DemoteMaster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void demote( + SqlInstancesDemoteRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Demote, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void export( + SqlInstancesExportRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Export, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void failover( + SqlInstancesFailoverRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Failover, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void reencrypt( + SqlInstancesReencryptRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Reencrypt, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void get( + SqlInstancesGetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DatabaseInstance) { + requests.add(request); + responseObserver.onNext(((DatabaseInstance) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Get, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DatabaseInstance.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void import_( + SqlInstancesImportRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Import, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void insert( + SqlInstancesInsertRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Insert, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void list( + SqlInstancesListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof InstancesListResponse) { + requests.add(request); + responseObserver.onNext(((InstancesListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + InstancesListResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listServerCas( + SqlInstancesListServerCasRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof InstancesListServerCasResponse) { + requests.add(request); + responseObserver.onNext(((InstancesListServerCasResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListServerCas, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + InstancesListServerCasResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listServerCertificates( + SqlInstancesListServerCertificatesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof InstancesListServerCertificatesResponse) { + requests.add(request); + responseObserver.onNext(((InstancesListServerCertificatesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListServerCertificates, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + InstancesListServerCertificatesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listEntraIdCertificates( + SqlInstancesListEntraIdCertificatesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof InstancesListEntraIdCertificatesResponse) { + requests.add(request); + responseObserver.onNext(((InstancesListEntraIdCertificatesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListEntraIdCertificates, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + InstancesListEntraIdCertificatesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void patch(SqlInstancesPatchRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Patch, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void promoteReplica( + SqlInstancesPromoteReplicaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PromoteReplica, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void switchover( + SqlInstancesSwitchoverRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Switchover, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void resetSslConfig( + SqlInstancesResetSslConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ResetSslConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void restart( + SqlInstancesRestartRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Restart, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void restoreBackup( + SqlInstancesRestoreBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RestoreBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void rotateServerCa( + SqlInstancesRotateServerCaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RotateServerCa, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void rotateServerCertificate( + SqlInstancesRotateServerCertificateRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RotateServerCertificate, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void rotateEntraIdCertificate( + SqlInstancesRotateEntraIdCertificateRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RotateEntraIdCertificate, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void startReplica( + SqlInstancesStartReplicaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StartReplica, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void stopReplica( + SqlInstancesStopReplicaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StopReplica, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void truncateLog( + SqlInstancesTruncateLogRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TruncateLog, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void update( + SqlInstancesUpdateRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Update, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createEphemeral( + SqlInstancesCreateEphemeralCertRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SslCert) { + requests.add(request); + responseObserver.onNext(((SslCert) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateEphemeral, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SslCert.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void rescheduleMaintenance( + SqlInstancesRescheduleMaintenanceRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RescheduleMaintenance, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void verifyExternalSyncSettings( + SqlInstancesVerifyExternalSyncSettingsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SqlInstancesVerifyExternalSyncSettingsResponse) { + requests.add(request); + responseObserver.onNext(((SqlInstancesVerifyExternalSyncSettingsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method VerifyExternalSyncSettings, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), + SqlInstancesVerifyExternalSyncSettingsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void startExternalSync( + SqlInstancesStartExternalSyncRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StartExternalSync, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void performDiskShrink( + SqlInstancesPerformDiskShrinkRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PerformDiskShrink, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getDiskShrinkConfig( + SqlInstancesGetDiskShrinkConfigRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SqlInstancesGetDiskShrinkConfigResponse) { + requests.add(request); + responseObserver.onNext(((SqlInstancesGetDiskShrinkConfigResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetDiskShrinkConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SqlInstancesGetDiskShrinkConfigResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void resetReplicaSize( + SqlInstancesResetReplicaSizeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ResetReplicaSize, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLatestRecoveryTime( + SqlInstancesGetLatestRecoveryTimeRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SqlInstancesGetLatestRecoveryTimeResponse) { + requests.add(request); + responseObserver.onNext(((SqlInstancesGetLatestRecoveryTimeResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLatestRecoveryTime, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + SqlInstancesGetLatestRecoveryTimeResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void executeSql( + SqlInstancesExecuteSqlRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SqlInstancesExecuteSqlResponse) { + requests.add(request); + responseObserver.onNext(((SqlInstancesExecuteSqlResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ExecuteSql, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SqlInstancesExecuteSqlResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void acquireSsrsLease( + SqlInstancesAcquireSsrsLeaseRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SqlInstancesAcquireSsrsLeaseResponse) { + requests.add(request); + responseObserver.onNext(((SqlInstancesAcquireSsrsLeaseResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AcquireSsrsLease, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SqlInstancesAcquireSsrsLeaseResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void releaseSsrsLease( + SqlInstancesReleaseSsrsLeaseRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SqlInstancesReleaseSsrsLeaseResponse) { + requests.add(request); + responseObserver.onNext(((SqlInstancesReleaseSsrsLeaseResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ReleaseSsrsLease, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SqlInstancesReleaseSsrsLeaseResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void preCheckMajorVersionUpgrade( + SqlInstancesPreCheckMajorVersionUpgradeRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PreCheckMajorVersionUpgrade, expected" + + " %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void pointInTimeRestore( + SqlInstancesPointInTimeRestoreRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PointInTimeRestore, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlOperationsService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlOperationsService.java new file mode 100644 index 000000000000..bc1733e3fb74 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlOperationsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlOperationsService implements MockGrpcService { + private final MockSqlOperationsServiceImpl serviceImpl; + + public MockSqlOperationsService() { + serviceImpl = new MockSqlOperationsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlOperationsServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlOperationsServiceImpl.java new file mode 100644 index 000000000000..d5479cc1fef5 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlOperationsServiceImpl.java @@ -0,0 +1,122 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1beta4.SqlOperationsServiceGrpc.SqlOperationsServiceImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlOperationsServiceImpl extends SqlOperationsServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlOperationsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void get(SqlOperationsGetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Get, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void list( + SqlOperationsListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof OperationsListResponse) { + requests.add(request); + responseObserver.onNext(((OperationsListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + OperationsListResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void cancel(SqlOperationsCancelRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Cancel, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlSslCertsService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlSslCertsService.java new file mode 100644 index 000000000000..2302fb7f3b9a --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlSslCertsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlSslCertsService implements MockGrpcService { + private final MockSqlSslCertsServiceImpl serviceImpl; + + public MockSqlSslCertsService() { + serviceImpl = new MockSqlSslCertsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlSslCertsServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlSslCertsServiceImpl.java new file mode 100644 index 000000000000..83840078ede8 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlSslCertsServiceImpl.java @@ -0,0 +1,142 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceGrpc.SqlSslCertsServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlSslCertsServiceImpl extends SqlSslCertsServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlSslCertsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void delete(SqlSslCertsDeleteRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Delete, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void get(SqlSslCertsGetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SslCert) { + requests.add(request); + responseObserver.onNext(((SslCert) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Get, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SslCert.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void insert( + SqlSslCertsInsertRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SslCertsInsertResponse) { + requests.add(request); + responseObserver.onNext(((SslCertsInsertResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Insert, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SslCertsInsertResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void list( + SqlSslCertsListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SslCertsListResponse) { + requests.add(request); + responseObserver.onNext(((SslCertsListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SslCertsListResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlTiersService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlTiersService.java new file mode 100644 index 000000000000..d11c49b5b7de --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlTiersService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlTiersService implements MockGrpcService { + private final MockSqlTiersServiceImpl serviceImpl; + + public MockSqlTiersService() { + serviceImpl = new MockSqlTiersServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlTiersServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlTiersServiceImpl.java new file mode 100644 index 000000000000..158077b173de --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlTiersServiceImpl.java @@ -0,0 +1,81 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1beta4.SqlTiersServiceGrpc.SqlTiersServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlTiersServiceImpl extends SqlTiersServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlTiersServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void list( + SqlTiersListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TiersListResponse) { + requests.add(request); + responseObserver.onNext(((TiersListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TiersListResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlUsersService.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlUsersService.java new file mode 100644 index 000000000000..d8f7e76b8b17 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlUsersService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlUsersService implements MockGrpcService { + private final MockSqlUsersServiceImpl serviceImpl; + + public MockSqlUsersService() { + serviceImpl = new MockSqlUsersServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlUsersServiceImpl.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlUsersServiceImpl.java new file mode 100644 index 000000000000..0f74801f2b95 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/MockSqlUsersServiceImpl.java @@ -0,0 +1,161 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.core.BetaApi; +import com.google.cloud.sql.v1beta4.SqlUsersServiceGrpc.SqlUsersServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSqlUsersServiceImpl extends SqlUsersServiceImplBase { + private List requests; + private Queue responses; + + public MockSqlUsersServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void delete(SqlUsersDeleteRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Delete, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void get(SqlUsersGetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Get, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void insert(SqlUsersInsertRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Insert, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void list( + SqlUsersListRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof UsersListResponse) { + requests.add(request); + responseObserver.onNext(((UsersListResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method List, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + UsersListResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void update(SqlUsersUpdateRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Update, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..3ee637b58cdd --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceClientHttpJsonTest.java @@ -0,0 +1,349 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +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.sql.v1beta4.stub.HttpJsonSqlBackupRunsServiceStub; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlBackupRunsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlBackupRunsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlBackupRunsServiceStub.getMethodDescriptors(), + SqlBackupRunsServiceSettings.getDefaultEndpoint()); + SqlBackupRunsServiceSettings settings = + SqlBackupRunsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlBackupRunsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlBackupRunsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlBackupRunsDeleteRequest request = + SqlBackupRunsDeleteRequest.newBuilder() + .setId(3355) + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.delete(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 deleteExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlBackupRunsDeleteRequest request = + SqlBackupRunsDeleteRequest.newBuilder() + .setId(3355) + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + BackupRun expectedResponse = + BackupRun.newBuilder() + .setKind("kind3292052") + .setStatus(SqlBackupRunStatus.forNumber(0)) + .setEnqueuedTime(Timestamp.newBuilder().build()) + .setId(3355) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setType(SqlBackupRunType.forNumber(0)) + .setDescription("description-1724546052") + .setWindowStartTime(Timestamp.newBuilder().build()) + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .setLocation("location1901043637") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setDiskEncryptionConfiguration(DiskEncryptionConfiguration.newBuilder().build()) + .setDiskEncryptionStatus(DiskEncryptionStatus.newBuilder().build()) + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setMaxChargeableBytes(-1424371595) + .build(); + mockService.addResponse(expectedResponse); + + SqlBackupRunsGetRequest request = + SqlBackupRunsGetRequest.newBuilder() + .setId(3355) + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + BackupRun actualResponse = client.get(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 getExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlBackupRunsGetRequest request = + SqlBackupRunsGetRequest.newBuilder() + .setId(3355) + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlBackupRunsInsertRequest request = + SqlBackupRunsInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(BackupRun.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(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 insertExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlBackupRunsInsertRequest request = + SqlBackupRunsInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(BackupRun.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + BackupRunsListResponse expectedResponse = + BackupRunsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockService.addResponse(expectedResponse); + + SqlBackupRunsListRequest request = + SqlBackupRunsListRequest.newBuilder() + .setInstance("instance-7525") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-6911") + .build(); + + BackupRunsListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlBackupRunsListRequest request = + SqlBackupRunsListRequest.newBuilder() + .setInstance("instance-7525") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-6911") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceClientTest.java new file mode 100644 index 000000000000..81dc10160063 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceClientTest.java @@ -0,0 +1,341 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlBackupRunsServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlBackupRunsService mockSqlBackupRunsService; + private LocalChannelProvider channelProvider; + private SqlBackupRunsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlBackupRunsService = new MockSqlBackupRunsService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlBackupRunsService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlBackupRunsServiceSettings settings = + SqlBackupRunsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlBackupRunsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlBackupRunsService.addResponse(expectedResponse); + + SqlBackupRunsDeleteRequest request = + SqlBackupRunsDeleteRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.delete(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupRunsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlBackupRunsDeleteRequest actualRequest = ((SqlBackupRunsDeleteRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getId(), actualRequest.getId()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupRunsService.addException(exception); + + try { + SqlBackupRunsDeleteRequest request = + SqlBackupRunsDeleteRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + BackupRun expectedResponse = + BackupRun.newBuilder() + .setKind("kind3292052") + .setStatus(SqlBackupRunStatus.forNumber(0)) + .setEnqueuedTime(Timestamp.newBuilder().build()) + .setId(3355) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setType(SqlBackupRunType.forNumber(0)) + .setDescription("description-1724546052") + .setWindowStartTime(Timestamp.newBuilder().build()) + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .setLocation("location1901043637") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setDiskEncryptionConfiguration(DiskEncryptionConfiguration.newBuilder().build()) + .setDiskEncryptionStatus(DiskEncryptionStatus.newBuilder().build()) + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setMaxChargeableBytes(-1424371595) + .build(); + mockSqlBackupRunsService.addResponse(expectedResponse); + + SqlBackupRunsGetRequest request = + SqlBackupRunsGetRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + BackupRun actualResponse = client.get(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupRunsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlBackupRunsGetRequest actualRequest = ((SqlBackupRunsGetRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getId(), actualRequest.getId()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupRunsService.addException(exception); + + try { + SqlBackupRunsGetRequest request = + SqlBackupRunsGetRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlBackupRunsService.addResponse(expectedResponse); + + SqlBackupRunsInsertRequest request = + SqlBackupRunsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(BackupRun.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupRunsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlBackupRunsInsertRequest actualRequest = ((SqlBackupRunsInsertRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void insertExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupRunsService.addException(exception); + + try { + SqlBackupRunsInsertRequest request = + SqlBackupRunsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(BackupRun.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + BackupRunsListResponse expectedResponse = + BackupRunsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockSqlBackupRunsService.addResponse(expectedResponse); + + SqlBackupRunsListRequest request = + SqlBackupRunsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + + BackupRunsListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupRunsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlBackupRunsListRequest actualRequest = ((SqlBackupRunsListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getMaxResults(), actualRequest.getMaxResults()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupRunsService.addException(exception); + + try { + SqlBackupRunsListRequest request = + SqlBackupRunsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..8169b5a0a2d4 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceClientHttpJsonTest.java @@ -0,0 +1,663 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import static com.google.cloud.sql.v1beta4.SqlBackupsServiceClient.ListBackupsPagedResponse; + +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.sql.v1beta4.stub.HttpJsonSqlBackupsServiceStub; +import com.google.common.collect.Lists; +import com.google.protobuf.BoolValue; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.type.Interval; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlBackupsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlBackupsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlBackupsServiceStub.getMethodDescriptors(), + SqlBackupsServiceSettings.getDefaultEndpoint()); + SqlBackupsServiceSettings settings = + SqlBackupsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlBackupsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlBackupsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + Backup backup = Backup.newBuilder().build(); + + Operation actualResponse = client.createBackup(parent, backup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + Backup backup = Backup.newBuilder().build(); + client.createBackup(parent, backup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupTest2() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-2353"; + Backup backup = Backup.newBuilder().build(); + + Operation actualResponse = client.createBackup(parent, backup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-2353"; + Backup backup = Backup.newBuilder().build(); + client.createBackup(parent, backup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .setKind("kind3292052") + .setSelfLink("selfLink1191800166") + .setDescription("description-1724546052") + .setInstance("instance555127957") + .setLocation("location1901043637") + .setBackupInterval(Interval.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setKmsKey("kmsKey-1127483058") + .setKmsKeyVersion("kmsKeyVersion2084784042") + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setMaxChargeableBytes(-1424371595) + .setInstanceDeletionTime(Timestamp.newBuilder().build()) + .setInstanceSettings(DatabaseInstance.newBuilder().build()) + .setBackupRun("backupRun1355341161") + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .setKind("kind3292052") + .setSelfLink("selfLink1191800166") + .setDescription("description-1724546052") + .setInstance("instance555127957") + .setLocation("location1901043637") + .setBackupInterval(Interval.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setKmsKey("kmsKey-1127483058") + .setKmsKeyVersion("kmsKeyVersion2084784042") + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setMaxChargeableBytes(-1424371595) + .setInstanceDeletionTime(Timestamp.newBuilder().build()) + .setInstanceSettings(DatabaseInstance.newBuilder().build()) + .setBackupRun("backupRun1355341161") + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-5917/backups/backup-5917"; + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5917/backups/backup-5917"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBackupsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-2353"; + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBackupsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-2353"; + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + Backup backup = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .setKind("kind3292052") + .setSelfLink("selfLink1191800166") + .setDescription("description-1724546052") + .setInstance("instance555127957") + .setLocation("location1901043637") + .setBackupInterval(Interval.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setKmsKey("kmsKey-1127483058") + .setKmsKeyVersion("kmsKeyVersion2084784042") + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setMaxChargeableBytes(-1424371595) + .setInstanceDeletionTime(Timestamp.newBuilder().build()) + .setInstanceSettings(DatabaseInstance.newBuilder().build()) + .setBackupRun("backupRun1355341161") + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Operation actualResponse = client.updateBackup(backup, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Backup backup = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .setKind("kind3292052") + .setSelfLink("selfLink1191800166") + .setDescription("description-1724546052") + .setInstance("instance555127957") + .setLocation("location1901043637") + .setBackupInterval(Interval.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setKmsKey("kmsKey-1127483058") + .setKmsKeyVersion("kmsKeyVersion2084784042") + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setMaxChargeableBytes(-1424371595) + .setInstanceDeletionTime(Timestamp.newBuilder().build()) + .setInstanceSettings(DatabaseInstance.newBuilder().build()) + .setBackupRun("backupRun1355341161") + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackup(backup, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + + Operation actualResponse = client.deleteBackup(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 deleteBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-5917/backups/backup-5917"; + + Operation actualResponse = client.deleteBackup(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 deleteBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5917/backups/backup-5917"; + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceClientTest.java new file mode 100644 index 000000000000..852e1a80dc9c --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceClientTest.java @@ -0,0 +1,576 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import static com.google.cloud.sql.v1beta4.SqlBackupsServiceClient.ListBackupsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.BoolValue; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.type.Interval; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlBackupsServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlBackupsService mockSqlBackupsService; + private LocalChannelProvider channelProvider; + private SqlBackupsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlBackupsService = new MockSqlBackupsService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlBackupsService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlBackupsServiceSettings settings = + SqlBackupsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlBackupsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + Backup backup = Backup.newBuilder().build(); + + Operation actualResponse = client.createBackup(parent, backup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + Backup backup = Backup.newBuilder().build(); + client.createBackup(parent, backup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupTest2() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Backup backup = Backup.newBuilder().build(); + + Operation actualResponse = client.createBackup(parent, backup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + String parent = "parent-995424086"; + Backup backup = Backup.newBuilder().build(); + client.createBackup(parent, backup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .setKind("kind3292052") + .setSelfLink("selfLink1191800166") + .setDescription("description-1724546052") + .setInstance("instance555127957") + .setLocation("location1901043637") + .setBackupInterval(Interval.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setKmsKey("kmsKey-1127483058") + .setKmsKeyVersion("kmsKeyVersion2084784042") + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setMaxChargeableBytes(-1424371595) + .setInstanceDeletionTime(Timestamp.newBuilder().build()) + .setInstanceSettings(DatabaseInstance.newBuilder().build()) + .setBackupRun("backupRun1355341161") + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .setKind("kind3292052") + .setSelfLink("selfLink1191800166") + .setDescription("description-1724546052") + .setInstance("instance555127957") + .setLocation("location1901043637") + .setBackupInterval(Interval.newBuilder().build()) + .setError(OperationError.newBuilder().build()) + .setKmsKey("kmsKey-1127483058") + .setKmsKeyVersion("kmsKeyVersion2084784042") + .setBackupKind(SqlBackupKind.forNumber(0)) + .setTimeZone("timeZone-2077180903") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setMaxChargeableBytes(-1424371595) + .setInstanceDeletionTime(Timestamp.newBuilder().build()) + .setInstanceSettings(DatabaseInstance.newBuilder().build()) + .setBackupRun("backupRun1355341161") + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + String name = "name3373707"; + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + String name = "name3373707"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Operation actualResponse = client.updateBackup(backup, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBackupRequest actualRequest = ((UpdateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackup(backup, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + + Operation actualResponse = client.deleteBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlBackupsService.addResponse(expectedResponse); + + String name = "name3373707"; + + Operation actualResponse = client.deleteBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlBackupsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlBackupsService.addException(exception); + + try { + String name = "name3373707"; + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlConnectServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlConnectServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..59d7292e355d --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlConnectServiceClientHttpJsonTest.java @@ -0,0 +1,268 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +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.sql.v1beta4.stub.HttpJsonSqlConnectServiceStub; +import com.google.protobuf.Duration; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlConnectServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlConnectServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlConnectServiceStub.getMethodDescriptors(), + SqlConnectServiceSettings.getDefaultEndpoint()); + SqlConnectServiceSettings settings = + SqlConnectServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlConnectServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlConnectServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getConnectSettingsTest() throws Exception { + ConnectSettings expectedResponse = + ConnectSettings.newBuilder() + .setKind("kind3292052") + .setServerCaCert(SslCert.newBuilder().build()) + .addAllIpAddresses(new ArrayList()) + .setRegion("region-934795532") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setBackendType(SqlBackendType.forNumber(0)) + .setPscEnabled(true) + .setDnsName("dnsName1813886804") + .addAllCustomSubjectAlternativeNames(new ArrayList()) + .addAllDnsNames(new ArrayList()) + .setNodeCount(1539922066) + .addAllNodes(new ArrayList()) + .addAllMdxProtocolSupport(new ArrayList()) + .setConnectionName("connectionName1270009481") + .build(); + mockService.addResponse(expectedResponse); + + GetConnectSettingsRequest request = + GetConnectSettingsRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setReadTime(Timestamp.newBuilder().build()) + .build(); + + ConnectSettings actualResponse = client.getConnectSettings(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 getConnectSettingsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetConnectSettingsRequest request = + GetConnectSettingsRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setReadTime(Timestamp.newBuilder().build()) + .build(); + client.getConnectSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resolveConnectSettingsTest() throws Exception { + ConnectSettings expectedResponse = + ConnectSettings.newBuilder() + .setKind("kind3292052") + .setServerCaCert(SslCert.newBuilder().build()) + .addAllIpAddresses(new ArrayList()) + .setRegion("region-934795532") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setBackendType(SqlBackendType.forNumber(0)) + .setPscEnabled(true) + .setDnsName("dnsName1813886804") + .addAllCustomSubjectAlternativeNames(new ArrayList()) + .addAllDnsNames(new ArrayList()) + .setNodeCount(1539922066) + .addAllNodes(new ArrayList()) + .addAllMdxProtocolSupport(new ArrayList()) + .setConnectionName("connectionName1270009481") + .build(); + mockService.addResponse(expectedResponse); + + ResolveConnectSettingsRequest request = + ResolveConnectSettingsRequest.newBuilder() + .setDnsName("dnsName-6118") + .setLocation("location-9355") + .build(); + + ConnectSettings actualResponse = client.resolveConnectSettings(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 resolveConnectSettingsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ResolveConnectSettingsRequest request = + ResolveConnectSettingsRequest.newBuilder() + .setDnsName("dnsName-6118") + .setLocation("location-9355") + .build(); + client.resolveConnectSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateEphemeralCertTest() throws Exception { + GenerateEphemeralCertResponse expectedResponse = + GenerateEphemeralCertResponse.newBuilder() + .setEphemeralCert(SslCert.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GenerateEphemeralCertRequest request = + GenerateEphemeralCertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setPublicKey("publicKey1446899510") + .setAccessToken("accessToken-1042689291") + .setReadTime(Timestamp.newBuilder().build()) + .setValidDuration(Duration.newBuilder().build()) + .build(); + + GenerateEphemeralCertResponse actualResponse = client.generateEphemeralCert(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 generateEphemeralCertExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GenerateEphemeralCertRequest request = + GenerateEphemeralCertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setPublicKey("publicKey1446899510") + .setAccessToken("accessToken-1042689291") + .setReadTime(Timestamp.newBuilder().build()) + .setValidDuration(Duration.newBuilder().build()) + .build(); + client.generateEphemeralCert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlConnectServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlConnectServiceClientTest.java new file mode 100644 index 000000000000..6e36f1dcd670 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlConnectServiceClientTest.java @@ -0,0 +1,267 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Duration; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlConnectServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlConnectService mockSqlConnectService; + private LocalChannelProvider channelProvider; + private SqlConnectServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlConnectService = new MockSqlConnectService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlConnectService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlConnectServiceSettings settings = + SqlConnectServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlConnectServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getConnectSettingsTest() throws Exception { + ConnectSettings expectedResponse = + ConnectSettings.newBuilder() + .setKind("kind3292052") + .setServerCaCert(SslCert.newBuilder().build()) + .addAllIpAddresses(new ArrayList()) + .setRegion("region-934795532") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setBackendType(SqlBackendType.forNumber(0)) + .setPscEnabled(true) + .setDnsName("dnsName1813886804") + .addAllCustomSubjectAlternativeNames(new ArrayList()) + .addAllDnsNames(new ArrayList()) + .setNodeCount(1539922066) + .addAllNodes(new ArrayList()) + .addAllMdxProtocolSupport(new ArrayList()) + .setConnectionName("connectionName1270009481") + .build(); + mockSqlConnectService.addResponse(expectedResponse); + + GetConnectSettingsRequest request = + GetConnectSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReadTime(Timestamp.newBuilder().build()) + .build(); + + ConnectSettings actualResponse = client.getConnectSettings(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlConnectService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConnectSettingsRequest actualRequest = ((GetConnectSettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getReadTime(), actualRequest.getReadTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getConnectSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlConnectService.addException(exception); + + try { + GetConnectSettingsRequest request = + GetConnectSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReadTime(Timestamp.newBuilder().build()) + .build(); + client.getConnectSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resolveConnectSettingsTest() throws Exception { + ConnectSettings expectedResponse = + ConnectSettings.newBuilder() + .setKind("kind3292052") + .setServerCaCert(SslCert.newBuilder().build()) + .addAllIpAddresses(new ArrayList()) + .setRegion("region-934795532") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setBackendType(SqlBackendType.forNumber(0)) + .setPscEnabled(true) + .setDnsName("dnsName1813886804") + .addAllCustomSubjectAlternativeNames(new ArrayList()) + .addAllDnsNames(new ArrayList()) + .setNodeCount(1539922066) + .addAllNodes(new ArrayList()) + .addAllMdxProtocolSupport(new ArrayList()) + .setConnectionName("connectionName1270009481") + .build(); + mockSqlConnectService.addResponse(expectedResponse); + + ResolveConnectSettingsRequest request = + ResolveConnectSettingsRequest.newBuilder() + .setDnsName("dnsName1813886804") + .setLocation("location1901043637") + .build(); + + ConnectSettings actualResponse = client.resolveConnectSettings(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlConnectService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ResolveConnectSettingsRequest actualRequest = + ((ResolveConnectSettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getDnsName(), actualRequest.getDnsName()); + Assert.assertEquals(request.getLocation(), actualRequest.getLocation()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void resolveConnectSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlConnectService.addException(exception); + + try { + ResolveConnectSettingsRequest request = + ResolveConnectSettingsRequest.newBuilder() + .setDnsName("dnsName1813886804") + .setLocation("location1901043637") + .build(); + client.resolveConnectSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateEphemeralCertTest() throws Exception { + GenerateEphemeralCertResponse expectedResponse = + GenerateEphemeralCertResponse.newBuilder() + .setEphemeralCert(SslCert.newBuilder().build()) + .build(); + mockSqlConnectService.addResponse(expectedResponse); + + GenerateEphemeralCertRequest request = + GenerateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setPublicKey("publicKey1446899510") + .setAccessToken("accessToken-1042689291") + .setReadTime(Timestamp.newBuilder().build()) + .setValidDuration(Duration.newBuilder().build()) + .build(); + + GenerateEphemeralCertResponse actualResponse = client.generateEphemeralCert(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlConnectService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateEphemeralCertRequest actualRequest = + ((GenerateEphemeralCertRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getPublicKey(), actualRequest.getPublicKey()); + Assert.assertEquals(request.getAccessToken(), actualRequest.getAccessToken()); + Assert.assertEquals(request.getReadTime(), actualRequest.getReadTime()); + Assert.assertEquals(request.getValidDuration(), actualRequest.getValidDuration()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateEphemeralCertExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlConnectService.addException(exception); + + try { + GenerateEphemeralCertRequest request = + GenerateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setPublicKey("publicKey1446899510") + .setAccessToken("accessToken-1042689291") + .setReadTime(Timestamp.newBuilder().build()) + .setValidDuration(Duration.newBuilder().build()) + .build(); + client.generateEphemeralCert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlDataServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlDataServiceClientTest.java new file mode 100644 index 000000000000..74922b977111 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlDataServiceClientTest.java @@ -0,0 +1,137 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlDataServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlDataService mockSqlDataService; + private LocalChannelProvider channelProvider; + private SqlDataServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlDataService = new MockSqlDataService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlDataService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlDataServiceSettings settings = + SqlDataServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlDataServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void streamSqlDataTest() throws Exception { + StreamSqlDataResponse expectedResponse = + StreamSqlDataResponse.newBuilder().setAck(Ack.newBuilder().build()).build(); + mockSqlDataService.addResponse(expectedResponse); + StreamSqlDataRequest request = + StreamSqlDataRequest.newBuilder() + .setAck(Ack.newBuilder().build()) + .setInstanceId(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.streamSqlDataCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void streamSqlDataExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlDataService.addException(exception); + StreamSqlDataRequest request = + StreamSqlDataRequest.newBuilder() + .setAck(Ack.newBuilder().build()) + .setInstanceId(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.streamSqlDataCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..c84adcc97547 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceClientHttpJsonTest.java @@ -0,0 +1,481 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +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.sql.v1beta4.stub.HttpJsonSqlDatabasesServiceStub; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlDatabasesServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlDatabasesServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlDatabasesServiceStub.getMethodDescriptors(), + SqlDatabasesServiceSettings.getDefaultEndpoint()); + SqlDatabasesServiceSettings settings = + SqlDatabasesServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlDatabasesServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlDatabasesServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlDatabasesDeleteRequest request = + SqlDatabasesDeleteRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.delete(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 deleteExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlDatabasesDeleteRequest request = + SqlDatabasesDeleteRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + Database expectedResponse = + Database.newBuilder() + .setKind("kind3292052") + .setCharset("charset739074380") + .setCollation("collation1880293257") + .setEtag("etag3123477") + .setName("name3373707") + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .setProject("project-309310695") + .build(); + mockService.addResponse(expectedResponse); + + SqlDatabasesGetRequest request = + SqlDatabasesGetRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Database actualResponse = client.get(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 getExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlDatabasesGetRequest request = + SqlDatabasesGetRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlDatabasesInsertRequest request = + SqlDatabasesInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(Database.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(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 insertExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlDatabasesInsertRequest request = + SqlDatabasesInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(Database.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + DatabasesListResponse expectedResponse = + DatabasesListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SqlDatabasesListRequest request = + SqlDatabasesListRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + DatabasesListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlDatabasesListRequest request = + SqlDatabasesListRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void patchTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(Database.newBuilder().build()) + .build(); + + Operation actualResponse = client.patch(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 patchExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(Database.newBuilder().build()) + .build(); + client.patch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(Database.newBuilder().build()) + .build(); + + Operation actualResponse = client.update(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 updateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database-1201") + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(Database.newBuilder().build()) + .build(); + client.update(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceClientTest.java new file mode 100644 index 000000000000..4c3a479dcbe8 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceClientTest.java @@ -0,0 +1,465 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlDatabasesServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlDatabasesService mockSqlDatabasesService; + private LocalChannelProvider channelProvider; + private SqlDatabasesServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlDatabasesService = new MockSqlDatabasesService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlDatabasesService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlDatabasesServiceSettings settings = + SqlDatabasesServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlDatabasesServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlDatabasesService.addResponse(expectedResponse); + + SqlDatabasesDeleteRequest request = + SqlDatabasesDeleteRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.delete(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlDatabasesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlDatabasesDeleteRequest actualRequest = ((SqlDatabasesDeleteRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getDatabase(), actualRequest.getDatabase()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlDatabasesService.addException(exception); + + try { + SqlDatabasesDeleteRequest request = + SqlDatabasesDeleteRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + Database expectedResponse = + Database.newBuilder() + .setKind("kind3292052") + .setCharset("charset739074380") + .setCollation("collation1880293257") + .setEtag("etag3123477") + .setName("name3373707") + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .setProject("project-309310695") + .build(); + mockSqlDatabasesService.addResponse(expectedResponse); + + SqlDatabasesGetRequest request = + SqlDatabasesGetRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Database actualResponse = client.get(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlDatabasesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlDatabasesGetRequest actualRequest = ((SqlDatabasesGetRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getDatabase(), actualRequest.getDatabase()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlDatabasesService.addException(exception); + + try { + SqlDatabasesGetRequest request = + SqlDatabasesGetRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlDatabasesService.addResponse(expectedResponse); + + SqlDatabasesInsertRequest request = + SqlDatabasesInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlDatabasesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlDatabasesInsertRequest actualRequest = ((SqlDatabasesInsertRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void insertExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlDatabasesService.addException(exception); + + try { + SqlDatabasesInsertRequest request = + SqlDatabasesInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + DatabasesListResponse expectedResponse = + DatabasesListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockSqlDatabasesService.addResponse(expectedResponse); + + SqlDatabasesListRequest request = + SqlDatabasesListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + DatabasesListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlDatabasesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlDatabasesListRequest actualRequest = ((SqlDatabasesListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlDatabasesService.addException(exception); + + try { + SqlDatabasesListRequest request = + SqlDatabasesListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void patchTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlDatabasesService.addResponse(expectedResponse); + + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + + Operation actualResponse = client.patch(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlDatabasesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlDatabasesUpdateRequest actualRequest = ((SqlDatabasesUpdateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getDatabase(), actualRequest.getDatabase()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void patchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlDatabasesService.addException(exception); + + try { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + client.patch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlDatabasesService.addResponse(expectedResponse); + + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + + Operation actualResponse = client.update(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlDatabasesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlDatabasesUpdateRequest actualRequest = ((SqlDatabasesUpdateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getDatabase(), actualRequest.getDatabase()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlDatabasesService.addException(exception); + + try { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + client.update(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..e1bcbaafea4d --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceClientHttpJsonTest.java @@ -0,0 +1,127 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +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.sql.v1beta4.stub.HttpJsonSqlFlagsServiceStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlFlagsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlFlagsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlFlagsServiceStub.getMethodDescriptors(), + SqlFlagsServiceSettings.getDefaultEndpoint()); + SqlFlagsServiceSettings settings = + SqlFlagsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlFlagsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlFlagsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listTest() throws Exception { + FlagsListResponse expectedResponse = + FlagsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SqlFlagsListRequest request = + SqlFlagsListRequest.newBuilder() + .setDatabaseVersion("databaseVersion1250955997") + .setFlagScope(SqlFlagScope.forNumber(0)) + .build(); + + FlagsListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlFlagsListRequest request = + SqlFlagsListRequest.newBuilder() + .setDatabaseVersion("databaseVersion1250955997") + .setFlagScope(SqlFlagScope.forNumber(0)) + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceClientTest.java new file mode 100644 index 000000000000..54243ee3ca66 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceClientTest.java @@ -0,0 +1,129 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlFlagsServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlFlagsService mockSqlFlagsService; + private LocalChannelProvider channelProvider; + private SqlFlagsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlFlagsService = new MockSqlFlagsService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlFlagsService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlFlagsServiceSettings settings = + SqlFlagsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlFlagsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listTest() throws Exception { + FlagsListResponse expectedResponse = + FlagsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockSqlFlagsService.addResponse(expectedResponse); + + SqlFlagsListRequest request = + SqlFlagsListRequest.newBuilder() + .setDatabaseVersion("databaseVersion1250955997") + .setFlagScope(SqlFlagScope.forNumber(0)) + .build(); + + FlagsListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlFlagsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlFlagsListRequest actualRequest = ((SqlFlagsListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getDatabaseVersion(), actualRequest.getDatabaseVersion()); + Assert.assertEquals(request.getFlagScope(), actualRequest.getFlagScope()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlFlagsService.addException(exception); + + try { + SqlFlagsListRequest request = + SqlFlagsListRequest.newBuilder() + .setDatabaseVersion("databaseVersion1250955997") + .setFlagScope(SqlFlagScope.forNumber(0)) + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..c6f7ef7c2e64 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceClientHttpJsonTest.java @@ -0,0 +1,3024 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +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.sql.v1beta4.stub.HttpJsonSqlInstancesServiceStub; +import com.google.protobuf.BoolValue; +import com.google.protobuf.Duration; +import com.google.protobuf.Int64Value; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlInstancesServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlInstancesServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlInstancesServiceStub.getMethodDescriptors(), + SqlInstancesServiceSettings.getDefaultEndpoint()); + SqlInstancesServiceSettings settings = + SqlInstancesServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlInstancesServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlInstancesServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void addServerCaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesAddServerCaRequest request = + SqlInstancesAddServerCaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.addServerCa(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 addServerCaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesAddServerCaRequest request = + SqlInstancesAddServerCaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.addServerCa(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addServerCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesAddServerCertificateRequest request = + SqlInstancesAddServerCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.addServerCertificate(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 addServerCertificateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesAddServerCertificateRequest request = + SqlInstancesAddServerCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.addServerCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addEntraIdCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesAddEntraIdCertificateRequest request = + SqlInstancesAddEntraIdCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.addEntraIdCertificate(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 addEntraIdCertificateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesAddEntraIdCertificateRequest request = + SqlInstancesAddEntraIdCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.addEntraIdCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void cloneTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesCloneRequest request = + SqlInstancesCloneRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesCloneRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.clone(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 cloneExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesCloneRequest request = + SqlInstancesCloneRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesCloneRequest.newBuilder().build()) + .build(); + client.clone(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesDeleteRequest request = + SqlInstancesDeleteRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setEnableFinalBackup(true) + .setFinalBackupDescription("finalBackupDescription-293551612") + .build(); + + Operation actualResponse = client.delete(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 deleteExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesDeleteRequest request = + SqlInstancesDeleteRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setEnableFinalBackup(true) + .setFinalBackupDescription("finalBackupDescription-293551612") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void demoteMasterTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesDemoteMasterRequest request = + SqlInstancesDemoteMasterRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesDemoteMasterRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.demoteMaster(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 demoteMasterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesDemoteMasterRequest request = + SqlInstancesDemoteMasterRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesDemoteMasterRequest.newBuilder().build()) + .build(); + client.demoteMaster(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void demoteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesDemoteRequest request = + SqlInstancesDemoteRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesDemoteRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.demote(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 demoteExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesDemoteRequest request = + SqlInstancesDemoteRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesDemoteRequest.newBuilder().build()) + .build(); + client.demote(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void exportTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesExportRequest request = + SqlInstancesExportRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesExportRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.export(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 exportExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesExportRequest request = + SqlInstancesExportRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesExportRequest.newBuilder().build()) + .build(); + client.export(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void failoverTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesFailoverRequest request = + SqlInstancesFailoverRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesFailoverRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.failover(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 failoverExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesFailoverRequest request = + SqlInstancesFailoverRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesFailoverRequest.newBuilder().build()) + .build(); + client.failover(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void reencryptTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesReencryptRequest request = + SqlInstancesReencryptRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesReencryptRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.reencrypt(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 reencryptExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesReencryptRequest request = + SqlInstancesReencryptRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesReencryptRequest.newBuilder().build()) + .build(); + client.reencrypt(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + DatabaseInstance expectedResponse = + DatabaseInstance.newBuilder() + .setKind("kind3292052") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setSettings(Settings.newBuilder().build()) + .setEtag("etag3123477") + .setFailoverReplica(DatabaseInstance.SqlFailoverReplica.newBuilder().build()) + .setMasterInstanceName("masterInstanceName2132225090") + .addAllReplicaNames(new ArrayList()) + .setMaxDiskSize(Int64Value.newBuilder().build()) + .setCurrentDiskSize(Int64Value.newBuilder().build()) + .addAllIpAddresses(new ArrayList()) + .setServerCaCert(SslCert.newBuilder().build()) + .setInstanceType(SqlInstanceType.forNumber(0)) + .setProject("project-309310695") + .setIpv6Address("ipv6Address1372169229") + .setServiceAccountEmailAddress("serviceAccountEmailAddress245216912") + .setOnPremisesConfiguration(OnPremisesConfiguration.newBuilder().build()) + .setReplicaConfiguration(ReplicaConfiguration.newBuilder().build()) + .setBackendType(SqlBackendType.forNumber(0)) + .setSelfLink("selfLink1191800166") + .addAllSuspensionReason(new ArrayList()) + .setConnectionName("connectionName1270009481") + .setName("name3373707") + .setRegion("region-934795532") + .setGceZone("gceZone-146048427") + .setSecondaryGceZone("secondaryGceZone227989057") + .setDiskEncryptionConfiguration(DiskEncryptionConfiguration.newBuilder().build()) + .setDiskEncryptionStatus(DiskEncryptionStatus.newBuilder().build()) + .setRootPassword("rootPassword1669569949") + .setScheduledMaintenance(DatabaseInstance.SqlScheduledMaintenance.newBuilder().build()) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setDatabaseInstalledVersion("databaseInstalledVersion-808517735") + .setOutOfDiskReport(DatabaseInstance.SqlOutOfDiskReport.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .addAllAvailableMaintenanceVersions(new ArrayList()) + .setMaintenanceVersion("maintenanceVersion1355658821") + .addAllUpgradableDatabaseVersions(new ArrayList()) + .setPscServiceAttachmentLink("pscServiceAttachmentLink-321045774") + .setDnsName("dnsName1813886804") + .setPrimaryDnsName("primaryDnsName330291954") + .setWriteEndpoint("writeEndpoint-105280876") + .setReplicationCluster(ReplicationCluster.newBuilder().build()) + .setGeminiConfig(GeminiInstanceConfig.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .setSwitchTransactionLogsToCloudStorageEnabled(BoolValue.newBuilder().build()) + .setIncludeReplicasForMajorVersionUpgrade(BoolValue.newBuilder().build()) + .putAllTags(new HashMap()) + .setNodeCount(1539922066) + .addAllNodes(new ArrayList()) + .addAllDnsNames(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesGetRequest request = + SqlInstancesGetRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + DatabaseInstance actualResponse = client.get(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 getExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesGetRequest request = + SqlInstancesGetRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void import_Test() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesImportRequest request = + SqlInstancesImportRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesImportRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.import_(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 import_ExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesImportRequest request = + SqlInstancesImportRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesImportRequest.newBuilder().build()) + .build(); + client.import_(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesInsertRequest request = + SqlInstancesInsertRequest.newBuilder() + .setProject("project-6911") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(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 insertExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesInsertRequest request = + SqlInstancesInsertRequest.newBuilder() + .setProject("project-6911") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + InstancesListResponse expectedResponse = + InstancesListResponse.newBuilder() + .setKind("kind3292052") + .addAllWarnings(new ArrayList()) + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesListRequest request = + SqlInstancesListRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-6911") + .build(); + + InstancesListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesListRequest request = + SqlInstancesListRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-6911") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listServerCasTest() throws Exception { + InstancesListServerCasResponse expectedResponse = + InstancesListServerCasResponse.newBuilder() + .addAllCerts(new ArrayList()) + .setActiveVersion("activeVersion-827825422") + .setKind("kind3292052") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesListServerCasRequest request = + SqlInstancesListServerCasRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + InstancesListServerCasResponse actualResponse = client.listServerCas(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 listServerCasExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesListServerCasRequest request = + SqlInstancesListServerCasRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.listServerCas(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listServerCertificatesTest() throws Exception { + InstancesListServerCertificatesResponse expectedResponse = + InstancesListServerCertificatesResponse.newBuilder() + .addAllCaCerts(new ArrayList()) + .addAllServerCerts(new ArrayList()) + .setActiveVersion("activeVersion-827825422") + .setKind("kind3292052") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesListServerCertificatesRequest request = + SqlInstancesListServerCertificatesRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + InstancesListServerCertificatesResponse actualResponse = client.listServerCertificates(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 listServerCertificatesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesListServerCertificatesRequest request = + SqlInstancesListServerCertificatesRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.listServerCertificates(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEntraIdCertificatesTest() throws Exception { + InstancesListEntraIdCertificatesResponse expectedResponse = + InstancesListEntraIdCertificatesResponse.newBuilder() + .addAllCerts(new ArrayList()) + .setActiveVersion("activeVersion-827825422") + .setKind("kind3292052") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesListEntraIdCertificatesRequest request = + SqlInstancesListEntraIdCertificatesRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + InstancesListEntraIdCertificatesResponse actualResponse = + client.listEntraIdCertificates(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 listEntraIdCertificatesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesListEntraIdCertificatesRequest request = + SqlInstancesListEntraIdCertificatesRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.listEntraIdCertificates(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void patchTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesPatchRequest request = + SqlInstancesPatchRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setReconcilePscNetworking(true) + .setReconcilePscNetworkingForce(true) + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + + Operation actualResponse = client.patch(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 patchExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesPatchRequest request = + SqlInstancesPatchRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setReconcilePscNetworking(true) + .setReconcilePscNetworkingForce(true) + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + client.patch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void promoteReplicaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesPromoteReplicaRequest request = + SqlInstancesPromoteReplicaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setFailover(true) + .build(); + + Operation actualResponse = client.promoteReplica(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 promoteReplicaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesPromoteReplicaRequest request = + SqlInstancesPromoteReplicaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setFailover(true) + .build(); + client.promoteReplica(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void switchoverTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesSwitchoverRequest request = + SqlInstancesSwitchoverRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setDbTimeout(Duration.newBuilder().build()) + .build(); + + Operation actualResponse = client.switchover(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 switchoverExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesSwitchoverRequest request = + SqlInstancesSwitchoverRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setDbTimeout(Duration.newBuilder().build()) + .build(); + client.switchover(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resetSslConfigTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesResetSslConfigRequest request = + SqlInstancesResetSslConfigRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.resetSslConfig(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 resetSslConfigExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesResetSslConfigRequest request = + SqlInstancesResetSslConfigRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.resetSslConfig(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void restartTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesRestartRequest request = + SqlInstancesRestartRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.restart(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 restartExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesRestartRequest request = + SqlInstancesRestartRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.restart(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void restoreBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesRestoreBackupRequest request = + SqlInstancesRestoreBackupRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRestoreBackupRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.restoreBackup(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 restoreBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesRestoreBackupRequest request = + SqlInstancesRestoreBackupRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRestoreBackupRequest.newBuilder().build()) + .build(); + client.restoreBackup(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rotateServerCaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesRotateServerCaRequest request = + SqlInstancesRotateServerCaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRotateServerCaRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.rotateServerCa(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 rotateServerCaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesRotateServerCaRequest request = + SqlInstancesRotateServerCaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRotateServerCaRequest.newBuilder().build()) + .build(); + client.rotateServerCa(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rotateServerCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesRotateServerCertificateRequest request = + SqlInstancesRotateServerCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRotateServerCertificateRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.rotateServerCertificate(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 rotateServerCertificateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesRotateServerCertificateRequest request = + SqlInstancesRotateServerCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRotateServerCertificateRequest.newBuilder().build()) + .build(); + client.rotateServerCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rotateEntraIdCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesRotateEntraIdCertificateRequest request = + SqlInstancesRotateEntraIdCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.rotateEntraIdCertificate(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 rotateEntraIdCertificateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesRotateEntraIdCertificateRequest request = + SqlInstancesRotateEntraIdCertificateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build()) + .build(); + client.rotateEntraIdCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void startReplicaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesStartReplicaRequest request = + SqlInstancesStartReplicaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.startReplica(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 startReplicaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesStartReplicaRequest request = + SqlInstancesStartReplicaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.startReplica(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void stopReplicaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesStopReplicaRequest request = + SqlInstancesStopReplicaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.stopReplica(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 stopReplicaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesStopReplicaRequest request = + SqlInstancesStopReplicaRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.stopReplica(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void truncateLogTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesTruncateLogRequest request = + SqlInstancesTruncateLogRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesTruncateLogRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.truncateLog(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 truncateLogExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesTruncateLogRequest request = + SqlInstancesTruncateLogRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesTruncateLogRequest.newBuilder().build()) + .build(); + client.truncateLog(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesUpdateRequest request = + SqlInstancesUpdateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + + Operation actualResponse = client.update(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 updateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesUpdateRequest request = + SqlInstancesUpdateRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + client.update(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createEphemeralTest() throws Exception { + SslCert expectedResponse = + SslCert.newBuilder() + .setKind("kind3292052") + .setCertSerialNumber("certSerialNumber1709590177") + .setCert("cert3050020") + .setCreateTime(Timestamp.newBuilder().build()) + .setCommonName("commonName1184312086") + .setExpirationTime(Timestamp.newBuilder().build()) + .setSha1Fingerprint("sha1Fingerprint163009183") + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesCreateEphemeralCertRequest request = + SqlInstancesCreateEphemeralCertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(SslCertsCreateEphemeralRequest.newBuilder().build()) + .build(); + + SslCert actualResponse = client.createEphemeral(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 createEphemeralExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesCreateEphemeralCertRequest request = + SqlInstancesCreateEphemeralCertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(SslCertsCreateEphemeralRequest.newBuilder().build()) + .build(); + client.createEphemeral(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rescheduleMaintenanceTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesRescheduleMaintenanceRequest request = + SqlInstancesRescheduleMaintenanceRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build()) + .build(); + + Operation actualResponse = client.rescheduleMaintenance(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 rescheduleMaintenanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesRescheduleMaintenanceRequest request = + SqlInstancesRescheduleMaintenanceRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build()) + .build(); + client.rescheduleMaintenance(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyExternalSyncSettingsTest() throws Exception { + SqlInstancesVerifyExternalSyncSettingsResponse expectedResponse = + SqlInstancesVerifyExternalSyncSettingsResponse.newBuilder() + .setKind("kind3292052") + .addAllErrors(new ArrayList()) + .addAllWarnings(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesVerifyExternalSyncSettingsRequest request = + SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setVerifyConnectionOnly(true) + .setVerifyReplicationOnly(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .addAllSelectedObjects(new ArrayList()) + .build(); + + SqlInstancesVerifyExternalSyncSettingsResponse actualResponse = + client.verifyExternalSyncSettings(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 verifyExternalSyncSettingsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesVerifyExternalSyncSettingsRequest request = + SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setVerifyConnectionOnly(true) + .setVerifyReplicationOnly(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .addAllSelectedObjects(new ArrayList()) + .build(); + client.verifyExternalSyncSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void startExternalSyncTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesStartExternalSyncRequest request = + SqlInstancesStartExternalSyncRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSkipVerification(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .setReplicaOverwriteEnabled(true) + .build(); + + Operation actualResponse = client.startExternalSync(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 startExternalSyncExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesStartExternalSyncRequest request = + SqlInstancesStartExternalSyncRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSkipVerification(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .setReplicaOverwriteEnabled(true) + .build(); + client.startExternalSync(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void performDiskShrinkTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesPerformDiskShrinkRequest request = + SqlInstancesPerformDiskShrinkRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(PerformDiskShrinkContext.newBuilder().build()) + .build(); + + Operation actualResponse = client.performDiskShrink(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 performDiskShrinkExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesPerformDiskShrinkRequest request = + SqlInstancesPerformDiskShrinkRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(PerformDiskShrinkContext.newBuilder().build()) + .build(); + client.performDiskShrink(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDiskShrinkConfigTest() throws Exception { + SqlInstancesGetDiskShrinkConfigResponse expectedResponse = + SqlInstancesGetDiskShrinkConfigResponse.newBuilder() + .setKind("kind3292052") + .setMinimalTargetSizeGb(-1076246647) + .setMessage("message954925063") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesGetDiskShrinkConfigRequest request = + SqlInstancesGetDiskShrinkConfigRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + SqlInstancesGetDiskShrinkConfigResponse actualResponse = client.getDiskShrinkConfig(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 getDiskShrinkConfigExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesGetDiskShrinkConfigRequest request = + SqlInstancesGetDiskShrinkConfigRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.getDiskShrinkConfig(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resetReplicaSizeTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesResetReplicaSizeRequest request = + SqlInstancesResetReplicaSizeRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.resetReplicaSize(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 resetReplicaSizeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesResetReplicaSizeRequest request = + SqlInstancesResetReplicaSizeRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.resetReplicaSize(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLatestRecoveryTimeTest() throws Exception { + SqlInstancesGetLatestRecoveryTimeResponse expectedResponse = + SqlInstancesGetLatestRecoveryTimeResponse.newBuilder() + .setKind("kind3292052") + .setLatestRecoveryTime(Timestamp.newBuilder().build()) + .setEarliestRecoveryTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesGetLatestRecoveryTimeRequest request = + SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSourceInstanceDeletionTime(Timestamp.newBuilder().build()) + .build(); + + SqlInstancesGetLatestRecoveryTimeResponse actualResponse = + client.getLatestRecoveryTime(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 getLatestRecoveryTimeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesGetLatestRecoveryTimeRequest request = + SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSourceInstanceDeletionTime(Timestamp.newBuilder().build()) + .build(); + client.getLatestRecoveryTime(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void executeSqlTest() throws Exception { + SqlInstancesExecuteSqlResponse expectedResponse = + SqlInstancesExecuteSqlResponse.newBuilder() + .addAllMessages(new ArrayList()) + .setMetadata(Metadata.newBuilder().build()) + .addAllResults(new ArrayList()) + .setStatus(Status.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesExecuteSqlRequest request = + SqlInstancesExecuteSqlRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(ExecuteSqlPayload.newBuilder().build()) + .build(); + + SqlInstancesExecuteSqlResponse actualResponse = client.executeSql(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 executeSqlExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesExecuteSqlRequest request = + SqlInstancesExecuteSqlRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(ExecuteSqlPayload.newBuilder().build()) + .build(); + client.executeSql(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void acquireSsrsLeaseTest() throws Exception { + SqlInstancesAcquireSsrsLeaseResponse expectedResponse = + SqlInstancesAcquireSsrsLeaseResponse.newBuilder() + .setOperationId("operationId129704162") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesAcquireSsrsLeaseRequest request = + SqlInstancesAcquireSsrsLeaseRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build()) + .build(); + + SqlInstancesAcquireSsrsLeaseResponse actualResponse = client.acquireSsrsLease(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 acquireSsrsLeaseExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesAcquireSsrsLeaseRequest request = + SqlInstancesAcquireSsrsLeaseRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build()) + .build(); + client.acquireSsrsLease(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void releaseSsrsLeaseTest() throws Exception { + SqlInstancesReleaseSsrsLeaseResponse expectedResponse = + SqlInstancesReleaseSsrsLeaseResponse.newBuilder() + .setOperationId("operationId129704162") + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesReleaseSsrsLeaseRequest request = + SqlInstancesReleaseSsrsLeaseRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + SqlInstancesReleaseSsrsLeaseResponse actualResponse = client.releaseSsrsLease(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 releaseSsrsLeaseExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesReleaseSsrsLeaseRequest request = + SqlInstancesReleaseSsrsLeaseRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.releaseSsrsLease(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void preCheckMajorVersionUpgradeTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesPreCheckMajorVersionUpgradeRequest request = + SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.preCheckMajorVersionUpgrade(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 preCheckMajorVersionUpgradeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesPreCheckMajorVersionUpgradeRequest request = + SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build()) + .build(); + client.preCheckMajorVersionUpgrade(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pointInTimeRestoreTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlInstancesPointInTimeRestoreRequest request = + SqlInstancesPointInTimeRestoreRequest.newBuilder() + .setParent("projects/project-2353") + .setContext(PointInTimeRestoreContext.newBuilder().build()) + .build(); + + Operation actualResponse = client.pointInTimeRestore(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 pointInTimeRestoreExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlInstancesPointInTimeRestoreRequest request = + SqlInstancesPointInTimeRestoreRequest.newBuilder() + .setParent("projects/project-2353") + .setContext(PointInTimeRestoreContext.newBuilder().build()) + .build(); + client.pointInTimeRestore(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceClientTest.java new file mode 100644 index 000000000000..908198796c94 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceClientTest.java @@ -0,0 +1,2900 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.BoolValue; +import com.google.protobuf.Duration; +import com.google.protobuf.Int64Value; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import 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 SqlInstancesServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlInstancesService mockSqlInstancesService; + private LocalChannelProvider channelProvider; + private SqlInstancesServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlInstancesService = new MockSqlInstancesService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlInstancesService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlInstancesServiceSettings settings = + SqlInstancesServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlInstancesServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void addServerCaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesAddServerCaRequest request = + SqlInstancesAddServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.addServerCa(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesAddServerCaRequest actualRequest = + ((SqlInstancesAddServerCaRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addServerCaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesAddServerCaRequest request = + SqlInstancesAddServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.addServerCa(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addServerCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesAddServerCertificateRequest request = + SqlInstancesAddServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.addServerCertificate(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesAddServerCertificateRequest actualRequest = + ((SqlInstancesAddServerCertificateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addServerCertificateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesAddServerCertificateRequest request = + SqlInstancesAddServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.addServerCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addEntraIdCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesAddEntraIdCertificateRequest request = + SqlInstancesAddEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.addEntraIdCertificate(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesAddEntraIdCertificateRequest actualRequest = + ((SqlInstancesAddEntraIdCertificateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addEntraIdCertificateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesAddEntraIdCertificateRequest request = + SqlInstancesAddEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.addEntraIdCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void cloneTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesCloneRequest request = + SqlInstancesCloneRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesCloneRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.clone(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesCloneRequest actualRequest = ((SqlInstancesCloneRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void cloneExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesCloneRequest request = + SqlInstancesCloneRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesCloneRequest.newBuilder().build()) + .build(); + client.clone(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesDeleteRequest request = + SqlInstancesDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setEnableFinalBackup(true) + .setFinalBackupDescription("finalBackupDescription-293551612") + .build(); + + Operation actualResponse = client.delete(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesDeleteRequest actualRequest = ((SqlInstancesDeleteRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getEnableFinalBackup(), actualRequest.getEnableFinalBackup()); + Assert.assertEquals(request.getFinalBackupTtlDays(), actualRequest.getFinalBackupTtlDays()); + Assert.assertEquals( + request.getFinalBackupExpiryTime(), actualRequest.getFinalBackupExpiryTime()); + Assert.assertEquals( + request.getFinalBackupDescription(), actualRequest.getFinalBackupDescription()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesDeleteRequest request = + SqlInstancesDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setEnableFinalBackup(true) + .setFinalBackupDescription("finalBackupDescription-293551612") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void demoteMasterTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesDemoteMasterRequest request = + SqlInstancesDemoteMasterRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteMasterRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.demoteMaster(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesDemoteMasterRequest actualRequest = + ((SqlInstancesDemoteMasterRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void demoteMasterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesDemoteMasterRequest request = + SqlInstancesDemoteMasterRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteMasterRequest.newBuilder().build()) + .build(); + client.demoteMaster(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void demoteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesDemoteRequest request = + SqlInstancesDemoteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.demote(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesDemoteRequest actualRequest = ((SqlInstancesDemoteRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void demoteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesDemoteRequest request = + SqlInstancesDemoteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteRequest.newBuilder().build()) + .build(); + client.demote(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void exportTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesExportRequest request = + SqlInstancesExportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesExportRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.export(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesExportRequest actualRequest = ((SqlInstancesExportRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void exportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesExportRequest request = + SqlInstancesExportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesExportRequest.newBuilder().build()) + .build(); + client.export(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void failoverTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesFailoverRequest request = + SqlInstancesFailoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesFailoverRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.failover(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesFailoverRequest actualRequest = + ((SqlInstancesFailoverRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void failoverExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesFailoverRequest request = + SqlInstancesFailoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesFailoverRequest.newBuilder().build()) + .build(); + client.failover(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void reencryptTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesReencryptRequest request = + SqlInstancesReencryptRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesReencryptRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.reencrypt(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesReencryptRequest actualRequest = + ((SqlInstancesReencryptRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void reencryptExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesReencryptRequest request = + SqlInstancesReencryptRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesReencryptRequest.newBuilder().build()) + .build(); + client.reencrypt(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + DatabaseInstance expectedResponse = + DatabaseInstance.newBuilder() + .setKind("kind3292052") + .setDatabaseVersion(SqlDatabaseVersion.forNumber(0)) + .setSettings(Settings.newBuilder().build()) + .setEtag("etag3123477") + .setFailoverReplica(DatabaseInstance.SqlFailoverReplica.newBuilder().build()) + .setMasterInstanceName("masterInstanceName2132225090") + .addAllReplicaNames(new ArrayList()) + .setMaxDiskSize(Int64Value.newBuilder().build()) + .setCurrentDiskSize(Int64Value.newBuilder().build()) + .addAllIpAddresses(new ArrayList()) + .setServerCaCert(SslCert.newBuilder().build()) + .setInstanceType(SqlInstanceType.forNumber(0)) + .setProject("project-309310695") + .setIpv6Address("ipv6Address1372169229") + .setServiceAccountEmailAddress("serviceAccountEmailAddress245216912") + .setOnPremisesConfiguration(OnPremisesConfiguration.newBuilder().build()) + .setReplicaConfiguration(ReplicaConfiguration.newBuilder().build()) + .setBackendType(SqlBackendType.forNumber(0)) + .setSelfLink("selfLink1191800166") + .addAllSuspensionReason(new ArrayList()) + .setConnectionName("connectionName1270009481") + .setName("name3373707") + .setRegion("region-934795532") + .setGceZone("gceZone-146048427") + .setSecondaryGceZone("secondaryGceZone227989057") + .setDiskEncryptionConfiguration(DiskEncryptionConfiguration.newBuilder().build()) + .setDiskEncryptionStatus(DiskEncryptionStatus.newBuilder().build()) + .setRootPassword("rootPassword1669569949") + .setScheduledMaintenance(DatabaseInstance.SqlScheduledMaintenance.newBuilder().build()) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setDatabaseInstalledVersion("databaseInstalledVersion-808517735") + .setOutOfDiskReport(DatabaseInstance.SqlOutOfDiskReport.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .addAllAvailableMaintenanceVersions(new ArrayList()) + .setMaintenanceVersion("maintenanceVersion1355658821") + .addAllUpgradableDatabaseVersions(new ArrayList()) + .setPscServiceAttachmentLink("pscServiceAttachmentLink-321045774") + .setDnsName("dnsName1813886804") + .setPrimaryDnsName("primaryDnsName330291954") + .setWriteEndpoint("writeEndpoint-105280876") + .setReplicationCluster(ReplicationCluster.newBuilder().build()) + .setGeminiConfig(GeminiInstanceConfig.newBuilder().build()) + .setSatisfiesPzi(BoolValue.newBuilder().build()) + .setSwitchTransactionLogsToCloudStorageEnabled(BoolValue.newBuilder().build()) + .setIncludeReplicasForMajorVersionUpgrade(BoolValue.newBuilder().build()) + .putAllTags(new HashMap()) + .setNodeCount(1539922066) + .addAllNodes(new ArrayList()) + .addAllDnsNames(new ArrayList()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesGetRequest request = + SqlInstancesGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + DatabaseInstance actualResponse = client.get(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesGetRequest actualRequest = ((SqlInstancesGetRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesGetRequest request = + SqlInstancesGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void import_Test() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesImportRequest request = + SqlInstancesImportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesImportRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.import_(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesImportRequest actualRequest = ((SqlInstancesImportRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void import_ExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesImportRequest request = + SqlInstancesImportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesImportRequest.newBuilder().build()) + .build(); + client.import_(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesInsertRequest request = + SqlInstancesInsertRequest.newBuilder() + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesInsertRequest actualRequest = ((SqlInstancesInsertRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void insertExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesInsertRequest request = + SqlInstancesInsertRequest.newBuilder() + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + InstancesListResponse expectedResponse = + InstancesListResponse.newBuilder() + .setKind("kind3292052") + .addAllWarnings(new ArrayList()) + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesListRequest request = + SqlInstancesListRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + + InstancesListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesListRequest actualRequest = ((SqlInstancesListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getMaxResults(), actualRequest.getMaxResults()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesListRequest request = + SqlInstancesListRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listServerCasTest() throws Exception { + InstancesListServerCasResponse expectedResponse = + InstancesListServerCasResponse.newBuilder() + .addAllCerts(new ArrayList()) + .setActiveVersion("activeVersion-827825422") + .setKind("kind3292052") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesListServerCasRequest request = + SqlInstancesListServerCasRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + InstancesListServerCasResponse actualResponse = client.listServerCas(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesListServerCasRequest actualRequest = + ((SqlInstancesListServerCasRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listServerCasExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesListServerCasRequest request = + SqlInstancesListServerCasRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.listServerCas(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listServerCertificatesTest() throws Exception { + InstancesListServerCertificatesResponse expectedResponse = + InstancesListServerCertificatesResponse.newBuilder() + .addAllCaCerts(new ArrayList()) + .addAllServerCerts(new ArrayList()) + .setActiveVersion("activeVersion-827825422") + .setKind("kind3292052") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesListServerCertificatesRequest request = + SqlInstancesListServerCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + InstancesListServerCertificatesResponse actualResponse = client.listServerCertificates(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesListServerCertificatesRequest actualRequest = + ((SqlInstancesListServerCertificatesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listServerCertificatesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesListServerCertificatesRequest request = + SqlInstancesListServerCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.listServerCertificates(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEntraIdCertificatesTest() throws Exception { + InstancesListEntraIdCertificatesResponse expectedResponse = + InstancesListEntraIdCertificatesResponse.newBuilder() + .addAllCerts(new ArrayList()) + .setActiveVersion("activeVersion-827825422") + .setKind("kind3292052") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesListEntraIdCertificatesRequest request = + SqlInstancesListEntraIdCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + InstancesListEntraIdCertificatesResponse actualResponse = + client.listEntraIdCertificates(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesListEntraIdCertificatesRequest actualRequest = + ((SqlInstancesListEntraIdCertificatesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listEntraIdCertificatesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesListEntraIdCertificatesRequest request = + SqlInstancesListEntraIdCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.listEntraIdCertificates(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void patchTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesPatchRequest request = + SqlInstancesPatchRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReconcilePscNetworking(true) + .setReconcilePscNetworkingForce(true) + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + + Operation actualResponse = client.patch(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesPatchRequest actualRequest = ((SqlInstancesPatchRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals( + request.getReconcilePscNetworking(), actualRequest.getReconcilePscNetworking()); + Assert.assertEquals( + request.getReconcilePscNetworkingForce(), actualRequest.getReconcilePscNetworkingForce()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void patchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesPatchRequest request = + SqlInstancesPatchRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReconcilePscNetworking(true) + .setReconcilePscNetworkingForce(true) + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + client.patch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void promoteReplicaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesPromoteReplicaRequest request = + SqlInstancesPromoteReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setFailover(true) + .build(); + + Operation actualResponse = client.promoteReplica(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesPromoteReplicaRequest actualRequest = + ((SqlInstancesPromoteReplicaRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getFailover(), actualRequest.getFailover()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void promoteReplicaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesPromoteReplicaRequest request = + SqlInstancesPromoteReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setFailover(true) + .build(); + client.promoteReplica(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void switchoverTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesSwitchoverRequest request = + SqlInstancesSwitchoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setDbTimeout(Duration.newBuilder().build()) + .build(); + + Operation actualResponse = client.switchover(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesSwitchoverRequest actualRequest = + ((SqlInstancesSwitchoverRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getDbTimeout(), actualRequest.getDbTimeout()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void switchoverExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesSwitchoverRequest request = + SqlInstancesSwitchoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setDbTimeout(Duration.newBuilder().build()) + .build(); + client.switchover(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resetSslConfigTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesResetSslConfigRequest request = + SqlInstancesResetSslConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.resetSslConfig(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesResetSslConfigRequest actualRequest = + ((SqlInstancesResetSslConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getMode(), actualRequest.getMode()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void resetSslConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesResetSslConfigRequest request = + SqlInstancesResetSslConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.resetSslConfig(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void restartTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesRestartRequest request = + SqlInstancesRestartRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.restart(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesRestartRequest actualRequest = ((SqlInstancesRestartRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restartExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesRestartRequest request = + SqlInstancesRestartRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.restart(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void restoreBackupTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesRestoreBackupRequest request = + SqlInstancesRestoreBackupRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRestoreBackupRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.restoreBackup(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesRestoreBackupRequest actualRequest = + ((SqlInstancesRestoreBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restoreBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesRestoreBackupRequest request = + SqlInstancesRestoreBackupRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRestoreBackupRequest.newBuilder().build()) + .build(); + client.restoreBackup(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rotateServerCaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesRotateServerCaRequest request = + SqlInstancesRotateServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCaRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.rotateServerCa(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesRotateServerCaRequest actualRequest = + ((SqlInstancesRotateServerCaRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void rotateServerCaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesRotateServerCaRequest request = + SqlInstancesRotateServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCaRequest.newBuilder().build()) + .build(); + client.rotateServerCa(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rotateServerCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesRotateServerCertificateRequest request = + SqlInstancesRotateServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCertificateRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.rotateServerCertificate(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesRotateServerCertificateRequest actualRequest = + ((SqlInstancesRotateServerCertificateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void rotateServerCertificateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesRotateServerCertificateRequest request = + SqlInstancesRotateServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCertificateRequest.newBuilder().build()) + .build(); + client.rotateServerCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rotateEntraIdCertificateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesRotateEntraIdCertificateRequest request = + SqlInstancesRotateEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.rotateEntraIdCertificate(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesRotateEntraIdCertificateRequest actualRequest = + ((SqlInstancesRotateEntraIdCertificateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void rotateEntraIdCertificateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesRotateEntraIdCertificateRequest request = + SqlInstancesRotateEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build()) + .build(); + client.rotateEntraIdCertificate(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void startReplicaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesStartReplicaRequest request = + SqlInstancesStartReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.startReplica(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesStartReplicaRequest actualRequest = + ((SqlInstancesStartReplicaRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void startReplicaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesStartReplicaRequest request = + SqlInstancesStartReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.startReplica(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void stopReplicaTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesStopReplicaRequest request = + SqlInstancesStopReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.stopReplica(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesStopReplicaRequest actualRequest = + ((SqlInstancesStopReplicaRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void stopReplicaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesStopReplicaRequest request = + SqlInstancesStopReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.stopReplica(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void truncateLogTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesTruncateLogRequest request = + SqlInstancesTruncateLogRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesTruncateLogRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.truncateLog(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesTruncateLogRequest actualRequest = + ((SqlInstancesTruncateLogRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void truncateLogExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesTruncateLogRequest request = + SqlInstancesTruncateLogRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesTruncateLogRequest.newBuilder().build()) + .build(); + client.truncateLog(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesUpdateRequest request = + SqlInstancesUpdateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + + Operation actualResponse = client.update(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesUpdateRequest actualRequest = ((SqlInstancesUpdateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesUpdateRequest request = + SqlInstancesUpdateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + client.update(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createEphemeralTest() throws Exception { + SslCert expectedResponse = + SslCert.newBuilder() + .setKind("kind3292052") + .setCertSerialNumber("certSerialNumber1709590177") + .setCert("cert3050020") + .setCreateTime(Timestamp.newBuilder().build()) + .setCommonName("commonName1184312086") + .setExpirationTime(Timestamp.newBuilder().build()) + .setSha1Fingerprint("sha1Fingerprint163009183") + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesCreateEphemeralCertRequest request = + SqlInstancesCreateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsCreateEphemeralRequest.newBuilder().build()) + .build(); + + SslCert actualResponse = client.createEphemeral(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesCreateEphemeralCertRequest actualRequest = + ((SqlInstancesCreateEphemeralCertRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createEphemeralExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesCreateEphemeralCertRequest request = + SqlInstancesCreateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsCreateEphemeralRequest.newBuilder().build()) + .build(); + client.createEphemeral(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rescheduleMaintenanceTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesRescheduleMaintenanceRequest request = + SqlInstancesRescheduleMaintenanceRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build()) + .build(); + + Operation actualResponse = client.rescheduleMaintenance(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesRescheduleMaintenanceRequest actualRequest = + ((SqlInstancesRescheduleMaintenanceRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void rescheduleMaintenanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesRescheduleMaintenanceRequest request = + SqlInstancesRescheduleMaintenanceRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build()) + .build(); + client.rescheduleMaintenance(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyExternalSyncSettingsTest() throws Exception { + SqlInstancesVerifyExternalSyncSettingsResponse expectedResponse = + SqlInstancesVerifyExternalSyncSettingsResponse.newBuilder() + .setKind("kind3292052") + .addAllErrors(new ArrayList()) + .addAllWarnings(new ArrayList()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesVerifyExternalSyncSettingsRequest request = + SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setVerifyConnectionOnly(true) + .setVerifyReplicationOnly(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .addAllSelectedObjects(new ArrayList()) + .build(); + + SqlInstancesVerifyExternalSyncSettingsResponse actualResponse = + client.verifyExternalSyncSettings(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesVerifyExternalSyncSettingsRequest actualRequest = + ((SqlInstancesVerifyExternalSyncSettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getVerifyConnectionOnly(), actualRequest.getVerifyConnectionOnly()); + Assert.assertEquals(request.getSyncMode(), actualRequest.getSyncMode()); + Assert.assertEquals( + request.getVerifyReplicationOnly(), actualRequest.getVerifyReplicationOnly()); + Assert.assertEquals(request.getMysqlSyncConfig(), actualRequest.getMysqlSyncConfig()); + Assert.assertEquals(request.getMigrationType(), actualRequest.getMigrationType()); + Assert.assertEquals(request.getSyncParallelLevel(), actualRequest.getSyncParallelLevel()); + Assert.assertEquals(request.getSelectedObjectsList(), actualRequest.getSelectedObjectsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void verifyExternalSyncSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesVerifyExternalSyncSettingsRequest request = + SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setVerifyConnectionOnly(true) + .setVerifyReplicationOnly(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .addAllSelectedObjects(new ArrayList()) + .build(); + client.verifyExternalSyncSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void startExternalSyncTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesStartExternalSyncRequest request = + SqlInstancesStartExternalSyncRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSkipVerification(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .setReplicaOverwriteEnabled(true) + .build(); + + Operation actualResponse = client.startExternalSync(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesStartExternalSyncRequest actualRequest = + ((SqlInstancesStartExternalSyncRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getSyncMode(), actualRequest.getSyncMode()); + Assert.assertEquals(request.getSkipVerification(), actualRequest.getSkipVerification()); + Assert.assertEquals(request.getMysqlSyncConfig(), actualRequest.getMysqlSyncConfig()); + Assert.assertEquals(request.getSyncParallelLevel(), actualRequest.getSyncParallelLevel()); + Assert.assertEquals(request.getMigrationType(), actualRequest.getMigrationType()); + Assert.assertEquals( + request.getReplicaOverwriteEnabled(), actualRequest.getReplicaOverwriteEnabled()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void startExternalSyncExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesStartExternalSyncRequest request = + SqlInstancesStartExternalSyncRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSkipVerification(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .setReplicaOverwriteEnabled(true) + .build(); + client.startExternalSync(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void performDiskShrinkTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesPerformDiskShrinkRequest request = + SqlInstancesPerformDiskShrinkRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(PerformDiskShrinkContext.newBuilder().build()) + .build(); + + Operation actualResponse = client.performDiskShrink(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesPerformDiskShrinkRequest actualRequest = + ((SqlInstancesPerformDiskShrinkRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void performDiskShrinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesPerformDiskShrinkRequest request = + SqlInstancesPerformDiskShrinkRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(PerformDiskShrinkContext.newBuilder().build()) + .build(); + client.performDiskShrink(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDiskShrinkConfigTest() throws Exception { + SqlInstancesGetDiskShrinkConfigResponse expectedResponse = + SqlInstancesGetDiskShrinkConfigResponse.newBuilder() + .setKind("kind3292052") + .setMinimalTargetSizeGb(-1076246647) + .setMessage("message954925063") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesGetDiskShrinkConfigRequest request = + SqlInstancesGetDiskShrinkConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + SqlInstancesGetDiskShrinkConfigResponse actualResponse = client.getDiskShrinkConfig(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesGetDiskShrinkConfigRequest actualRequest = + ((SqlInstancesGetDiskShrinkConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDiskShrinkConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesGetDiskShrinkConfigRequest request = + SqlInstancesGetDiskShrinkConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.getDiskShrinkConfig(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resetReplicaSizeTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesResetReplicaSizeRequest request = + SqlInstancesResetReplicaSizeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.resetReplicaSize(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesResetReplicaSizeRequest actualRequest = + ((SqlInstancesResetReplicaSizeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void resetReplicaSizeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesResetReplicaSizeRequest request = + SqlInstancesResetReplicaSizeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.resetReplicaSize(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLatestRecoveryTimeTest() throws Exception { + SqlInstancesGetLatestRecoveryTimeResponse expectedResponse = + SqlInstancesGetLatestRecoveryTimeResponse.newBuilder() + .setKind("kind3292052") + .setLatestRecoveryTime(Timestamp.newBuilder().build()) + .setEarliestRecoveryTime(Timestamp.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesGetLatestRecoveryTimeRequest request = + SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSourceInstanceDeletionTime(Timestamp.newBuilder().build()) + .build(); + + SqlInstancesGetLatestRecoveryTimeResponse actualResponse = + client.getLatestRecoveryTime(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesGetLatestRecoveryTimeRequest actualRequest = + ((SqlInstancesGetLatestRecoveryTimeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals( + request.getSourceInstanceDeletionTime(), actualRequest.getSourceInstanceDeletionTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLatestRecoveryTimeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesGetLatestRecoveryTimeRequest request = + SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSourceInstanceDeletionTime(Timestamp.newBuilder().build()) + .build(); + client.getLatestRecoveryTime(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void executeSqlTest() throws Exception { + SqlInstancesExecuteSqlResponse expectedResponse = + SqlInstancesExecuteSqlResponse.newBuilder() + .addAllMessages(new ArrayList()) + .setMetadata(Metadata.newBuilder().build()) + .addAllResults(new ArrayList()) + .setStatus(Status.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesExecuteSqlRequest request = + SqlInstancesExecuteSqlRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(ExecuteSqlPayload.newBuilder().build()) + .build(); + + SqlInstancesExecuteSqlResponse actualResponse = client.executeSql(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesExecuteSqlRequest actualRequest = + ((SqlInstancesExecuteSqlRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void executeSqlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesExecuteSqlRequest request = + SqlInstancesExecuteSqlRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(ExecuteSqlPayload.newBuilder().build()) + .build(); + client.executeSql(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void acquireSsrsLeaseTest() throws Exception { + SqlInstancesAcquireSsrsLeaseResponse expectedResponse = + SqlInstancesAcquireSsrsLeaseResponse.newBuilder() + .setOperationId("operationId129704162") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesAcquireSsrsLeaseRequest request = + SqlInstancesAcquireSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build()) + .build(); + + SqlInstancesAcquireSsrsLeaseResponse actualResponse = client.acquireSsrsLease(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesAcquireSsrsLeaseRequest actualRequest = + ((SqlInstancesAcquireSsrsLeaseRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void acquireSsrsLeaseExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesAcquireSsrsLeaseRequest request = + SqlInstancesAcquireSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build()) + .build(); + client.acquireSsrsLease(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void releaseSsrsLeaseTest() throws Exception { + SqlInstancesReleaseSsrsLeaseResponse expectedResponse = + SqlInstancesReleaseSsrsLeaseResponse.newBuilder() + .setOperationId("operationId129704162") + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesReleaseSsrsLeaseRequest request = + SqlInstancesReleaseSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + SqlInstancesReleaseSsrsLeaseResponse actualResponse = client.releaseSsrsLease(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesReleaseSsrsLeaseRequest actualRequest = + ((SqlInstancesReleaseSsrsLeaseRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void releaseSsrsLeaseExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesReleaseSsrsLeaseRequest request = + SqlInstancesReleaseSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.releaseSsrsLease(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void preCheckMajorVersionUpgradeTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesPreCheckMajorVersionUpgradeRequest request = + SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build()) + .build(); + + Operation actualResponse = client.preCheckMajorVersionUpgrade(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesPreCheckMajorVersionUpgradeRequest actualRequest = + ((SqlInstancesPreCheckMajorVersionUpgradeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void preCheckMajorVersionUpgradeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesPreCheckMajorVersionUpgradeRequest request = + SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build()) + .build(); + client.preCheckMajorVersionUpgrade(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pointInTimeRestoreTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlInstancesService.addResponse(expectedResponse); + + SqlInstancesPointInTimeRestoreRequest request = + SqlInstancesPointInTimeRestoreRequest.newBuilder() + .setParent("parent-995424086") + .setContext(PointInTimeRestoreContext.newBuilder().build()) + .build(); + + Operation actualResponse = client.pointInTimeRestore(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlInstancesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlInstancesPointInTimeRestoreRequest actualRequest = + ((SqlInstancesPointInTimeRestoreRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getContext(), actualRequest.getContext()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pointInTimeRestoreExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlInstancesService.addException(exception); + + try { + SqlInstancesPointInTimeRestoreRequest request = + SqlInstancesPointInTimeRestoreRequest.newBuilder() + .setParent("parent-995424086") + .setContext(PointInTimeRestoreContext.newBuilder().build()) + .build(); + client.pointInTimeRestore(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..7ab26d48402f --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceClientHttpJsonTest.java @@ -0,0 +1,252 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +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.sql.v1beta4.stub.HttpJsonSqlOperationsServiceStub; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlOperationsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlOperationsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlOperationsServiceStub.getMethodDescriptors(), + SqlOperationsServiceSettings.getDefaultEndpoint()); + SqlOperationsServiceSettings settings = + SqlOperationsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlOperationsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlOperationsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlOperationsGetRequest request = + SqlOperationsGetRequest.newBuilder() + .setOperation("operation-3971") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.get(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 getExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlOperationsGetRequest request = + SqlOperationsGetRequest.newBuilder() + .setOperation("operation-3971") + .setProject("project-6911") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + OperationsListResponse expectedResponse = + OperationsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockService.addResponse(expectedResponse); + + SqlOperationsListRequest request = + SqlOperationsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-6911") + .build(); + + OperationsListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlOperationsListRequest request = + SqlOperationsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-6911") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void cancelTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + SqlOperationsCancelRequest request = + SqlOperationsCancelRequest.newBuilder() + .setOperation("operation-3971") + .setProject("project-6911") + .build(); + + client.cancel(request); + + 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 cancelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlOperationsCancelRequest request = + SqlOperationsCancelRequest.newBuilder() + .setOperation("operation-3971") + .setProject("project-6911") + .build(); + client.cancel(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceClientTest.java new file mode 100644 index 000000000000..bdd849e1cefe --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceClientTest.java @@ -0,0 +1,246 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlOperationsServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlOperationsService mockSqlOperationsService; + private LocalChannelProvider channelProvider; + private SqlOperationsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlOperationsService = new MockSqlOperationsService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlOperationsService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlOperationsServiceSettings settings = + SqlOperationsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlOperationsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlOperationsService.addResponse(expectedResponse); + + SqlOperationsGetRequest request = + SqlOperationsGetRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.get(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlOperationsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlOperationsGetRequest actualRequest = ((SqlOperationsGetRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getOperation(), actualRequest.getOperation()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlOperationsService.addException(exception); + + try { + SqlOperationsGetRequest request = + SqlOperationsGetRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + OperationsListResponse expectedResponse = + OperationsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockSqlOperationsService.addResponse(expectedResponse); + + SqlOperationsListRequest request = + SqlOperationsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + + OperationsListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlOperationsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlOperationsListRequest actualRequest = ((SqlOperationsListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getMaxResults(), actualRequest.getMaxResults()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlOperationsService.addException(exception); + + try { + SqlOperationsListRequest request = + SqlOperationsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void cancelTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSqlOperationsService.addResponse(expectedResponse); + + SqlOperationsCancelRequest request = + SqlOperationsCancelRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + + client.cancel(request); + + List actualRequests = mockSqlOperationsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlOperationsCancelRequest actualRequest = ((SqlOperationsCancelRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getOperation(), actualRequest.getOperation()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void cancelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlOperationsService.addException(exception); + + try { + SqlOperationsCancelRequest request = + SqlOperationsCancelRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + client.cancel(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..7e2b036a073c --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceClientHttpJsonTest.java @@ -0,0 +1,319 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +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.sql.v1beta4.stub.HttpJsonSqlSslCertsServiceStub; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlSslCertsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlSslCertsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlSslCertsServiceStub.getMethodDescriptors(), + SqlSslCertsServiceSettings.getDefaultEndpoint()); + SqlSslCertsServiceSettings settings = + SqlSslCertsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlSslCertsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlSslCertsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlSslCertsDeleteRequest request = + SqlSslCertsDeleteRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSha1Fingerprint("sha1Fingerprint-7419") + .build(); + + Operation actualResponse = client.delete(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 deleteExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlSslCertsDeleteRequest request = + SqlSslCertsDeleteRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSha1Fingerprint("sha1Fingerprint-7419") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + SslCert expectedResponse = + SslCert.newBuilder() + .setKind("kind3292052") + .setCertSerialNumber("certSerialNumber1709590177") + .setCert("cert3050020") + .setCreateTime(Timestamp.newBuilder().build()) + .setCommonName("commonName1184312086") + .setExpirationTime(Timestamp.newBuilder().build()) + .setSha1Fingerprint("sha1Fingerprint163009183") + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .build(); + mockService.addResponse(expectedResponse); + + SqlSslCertsGetRequest request = + SqlSslCertsGetRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSha1Fingerprint("sha1Fingerprint-7419") + .build(); + + SslCert actualResponse = client.get(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 getExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlSslCertsGetRequest request = + SqlSslCertsGetRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setSha1Fingerprint("sha1Fingerprint-7419") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + SslCertsInsertResponse expectedResponse = + SslCertsInsertResponse.newBuilder() + .setKind("kind3292052") + .setOperation(Operation.newBuilder().build()) + .setServerCaCert(SslCert.newBuilder().build()) + .setClientCert(SslCertDetail.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlSslCertsInsertRequest request = + SqlSslCertsInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(SslCertsInsertRequest.newBuilder().build()) + .build(); + + SslCertsInsertResponse actualResponse = client.insert(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 insertExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlSslCertsInsertRequest request = + SqlSslCertsInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(SslCertsInsertRequest.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + SslCertsListResponse expectedResponse = + SslCertsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SqlSslCertsListRequest request = + SqlSslCertsListRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + SslCertsListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlSslCertsListRequest request = + SqlSslCertsListRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceClientTest.java new file mode 100644 index 000000000000..cb9fb91bbbb3 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceClientTest.java @@ -0,0 +1,309 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlSslCertsServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlSslCertsService mockSqlSslCertsService; + private LocalChannelProvider channelProvider; + private SqlSslCertsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlSslCertsService = new MockSqlSslCertsService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlSslCertsService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlSslCertsServiceSettings settings = + SqlSslCertsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlSslCertsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlSslCertsService.addResponse(expectedResponse); + + SqlSslCertsDeleteRequest request = + SqlSslCertsDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + + Operation actualResponse = client.delete(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlSslCertsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlSslCertsDeleteRequest actualRequest = ((SqlSslCertsDeleteRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getSha1Fingerprint(), actualRequest.getSha1Fingerprint()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlSslCertsService.addException(exception); + + try { + SqlSslCertsDeleteRequest request = + SqlSslCertsDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + SslCert expectedResponse = + SslCert.newBuilder() + .setKind("kind3292052") + .setCertSerialNumber("certSerialNumber1709590177") + .setCert("cert3050020") + .setCreateTime(Timestamp.newBuilder().build()) + .setCommonName("commonName1184312086") + .setExpirationTime(Timestamp.newBuilder().build()) + .setSha1Fingerprint("sha1Fingerprint163009183") + .setInstance("instance555127957") + .setSelfLink("selfLink1191800166") + .build(); + mockSqlSslCertsService.addResponse(expectedResponse); + + SqlSslCertsGetRequest request = + SqlSslCertsGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + + SslCert actualResponse = client.get(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlSslCertsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlSslCertsGetRequest actualRequest = ((SqlSslCertsGetRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getSha1Fingerprint(), actualRequest.getSha1Fingerprint()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlSslCertsService.addException(exception); + + try { + SqlSslCertsGetRequest request = + SqlSslCertsGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + SslCertsInsertResponse expectedResponse = + SslCertsInsertResponse.newBuilder() + .setKind("kind3292052") + .setOperation(Operation.newBuilder().build()) + .setServerCaCert(SslCert.newBuilder().build()) + .setClientCert(SslCertDetail.newBuilder().build()) + .build(); + mockSqlSslCertsService.addResponse(expectedResponse); + + SqlSslCertsInsertRequest request = + SqlSslCertsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsInsertRequest.newBuilder().build()) + .build(); + + SslCertsInsertResponse actualResponse = client.insert(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlSslCertsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlSslCertsInsertRequest actualRequest = ((SqlSslCertsInsertRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void insertExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlSslCertsService.addException(exception); + + try { + SqlSslCertsInsertRequest request = + SqlSslCertsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsInsertRequest.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + SslCertsListResponse expectedResponse = + SslCertsListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockSqlSslCertsService.addResponse(expectedResponse); + + SqlSslCertsListRequest request = + SqlSslCertsListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + SslCertsListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlSslCertsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlSslCertsListRequest actualRequest = ((SqlSslCertsListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlSslCertsService.addException(exception); + + try { + SqlSslCertsListRequest request = + SqlSslCertsListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlTiersServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlTiersServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..14e754815792 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlTiersServiceClientHttpJsonTest.java @@ -0,0 +1,121 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +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.sql.v1beta4.stub.HttpJsonSqlTiersServiceStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlTiersServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlTiersServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlTiersServiceStub.getMethodDescriptors(), + SqlTiersServiceSettings.getDefaultEndpoint()); + SqlTiersServiceSettings settings = + SqlTiersServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlTiersServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlTiersServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listTest() throws Exception { + TiersListResponse expectedResponse = + TiersListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SqlTiersListRequest request = + SqlTiersListRequest.newBuilder().setProject("project-6911").build(); + + TiersListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlTiersListRequest request = + SqlTiersListRequest.newBuilder().setProject("project-6911").build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlTiersServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlTiersServiceClientTest.java new file mode 100644 index 000000000000..5d337fafc20b --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlTiersServiceClientTest.java @@ -0,0 +1,122 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlTiersServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlTiersService mockSqlTiersService; + private LocalChannelProvider channelProvider; + private SqlTiersServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlTiersService = new MockSqlTiersService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlTiersService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlTiersServiceSettings settings = + SqlTiersServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlTiersServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listTest() throws Exception { + TiersListResponse expectedResponse = + TiersListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .build(); + mockSqlTiersService.addResponse(expectedResponse); + + SqlTiersListRequest request = + SqlTiersListRequest.newBuilder().setProject("project-309310695").build(); + + TiersListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlTiersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlTiersListRequest actualRequest = ((SqlTiersListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlTiersService.addException(exception); + + try { + SqlTiersListRequest request = + SqlTiersListRequest.newBuilder().setProject("project-309310695").build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlUsersServiceClientHttpJsonTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlUsersServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..1eff79fe7f51 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlUsersServiceClientHttpJsonTest.java @@ -0,0 +1,420 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +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.sql.v1beta4.stub.HttpJsonSqlUsersServiceStub; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlUsersServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SqlUsersServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSqlUsersServiceStub.getMethodDescriptors(), + SqlUsersServiceSettings.getDefaultEndpoint()); + SqlUsersServiceSettings settings = + SqlUsersServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SqlUsersServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlUsersServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlUsersDeleteRequest request = + SqlUsersDeleteRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance-7525") + .setName("name3373707") + .setProject("project-6911") + .build(); + + Operation actualResponse = client.delete(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 deleteExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlUsersDeleteRequest request = + SqlUsersDeleteRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance-7525") + .setName("name3373707") + .setProject("project-6911") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setKind("kind3292052") + .setPassword("password1216985755") + .setEtag("etag3123477") + .setName("name3373707") + .setHost("host3208616") + .setInstance("instance555127957") + .setProject("project-309310695") + .setIamEmail("iamEmail1687646791") + .setPasswordPolicy(UserPasswordValidationPolicy.newBuilder().build()) + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SqlUsersGetRequest request = + SqlUsersGetRequest.newBuilder() + .setInstance("instance-7525") + .setName("name-4959") + .setProject("project-6911") + .setHost("host3208616") + .build(); + + User actualResponse = client.get(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 getExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlUsersGetRequest request = + SqlUsersGetRequest.newBuilder() + .setInstance("instance-7525") + .setName("name-4959") + .setProject("project-6911") + .setHost("host3208616") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlUsersInsertRequest request = + SqlUsersInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(User.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(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 insertExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlUsersInsertRequest request = + SqlUsersInsertRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .setBody(User.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + UsersListResponse expectedResponse = + UsersListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockService.addResponse(expectedResponse); + + SqlUsersListRequest request = + SqlUsersListRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + + UsersListResponse actualResponse = client.list(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 listExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlUsersListRequest request = + SqlUsersListRequest.newBuilder() + .setInstance("instance-7525") + .setProject("project-6911") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SqlUsersUpdateRequest request = + SqlUsersUpdateRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance-7525") + .setName("name3373707") + .setProject("project-6911") + .addAllDatabaseRoles(new ArrayList()) + .setRevokeExistingRoles(true) + .setBody(User.newBuilder().build()) + .build(); + + Operation actualResponse = client.update(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 updateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SqlUsersUpdateRequest request = + SqlUsersUpdateRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance-7525") + .setName("name3373707") + .setProject("project-6911") + .addAllDatabaseRoles(new ArrayList()) + .setRevokeExistingRoles(true) + .setBody(User.newBuilder().build()) + .build(); + client.update(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlUsersServiceClientTest.java b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlUsersServiceClientTest.java new file mode 100644 index 000000000000..d4171bcf0ec6 --- /dev/null +++ b/java-sql/google-cloud-sql/src/test/java/com/google/cloud/sql/v1beta4/SqlUsersServiceClientTest.java @@ -0,0 +1,412 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SqlUsersServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSqlUsersService mockSqlUsersService; + private LocalChannelProvider channelProvider; + private SqlUsersServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSqlUsersService = new MockSqlUsersService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSqlUsersService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SqlUsersServiceSettings settings = + SqlUsersServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SqlUsersServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void deleteTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlUsersService.addResponse(expectedResponse); + + SqlUsersDeleteRequest request = + SqlUsersDeleteRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .build(); + + Operation actualResponse = client.delete(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlUsersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlUsersDeleteRequest actualRequest = ((SqlUsersDeleteRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getHost(), actualRequest.getHost()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlUsersService.addException(exception); + + try { + SqlUsersDeleteRequest request = + SqlUsersDeleteRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .build(); + client.delete(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setKind("kind3292052") + .setPassword("password1216985755") + .setEtag("etag3123477") + .setName("name3373707") + .setHost("host3208616") + .setInstance("instance555127957") + .setProject("project-309310695") + .setIamEmail("iamEmail1687646791") + .setPasswordPolicy(UserPasswordValidationPolicy.newBuilder().build()) + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockSqlUsersService.addResponse(expectedResponse); + + SqlUsersGetRequest request = + SqlUsersGetRequest.newBuilder() + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .setHost("host3208616") + .build(); + + User actualResponse = client.get(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlUsersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlUsersGetRequest actualRequest = ((SqlUsersGetRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getHost(), actualRequest.getHost()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlUsersService.addException(exception); + + try { + SqlUsersGetRequest request = + SqlUsersGetRequest.newBuilder() + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .setHost("host3208616") + .build(); + client.get(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlUsersService.addResponse(expectedResponse); + + SqlUsersInsertRequest request = + SqlUsersInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(User.newBuilder().build()) + .build(); + + Operation actualResponse = client.insert(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlUsersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlUsersInsertRequest actualRequest = ((SqlUsersInsertRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void insertExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlUsersService.addException(exception); + + try { + SqlUsersInsertRequest request = + SqlUsersInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(User.newBuilder().build()) + .build(); + client.insert(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTest() throws Exception { + UsersListResponse expectedResponse = + UsersListResponse.newBuilder() + .setKind("kind3292052") + .addAllItems(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockSqlUsersService.addResponse(expectedResponse); + + SqlUsersListRequest request = + SqlUsersListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + + UsersListResponse actualResponse = client.list(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlUsersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlUsersListRequest actualRequest = ((SqlUsersListRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlUsersService.addException(exception); + + try { + SqlUsersListRequest request = + SqlUsersListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + client.list(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateTest() throws Exception { + Operation expectedResponse = + Operation.newBuilder() + .setKind("kind3292052") + .setTargetLink("targetLink486368555") + .setUser("user3599307") + .setInsertTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setError(OperationErrors.newBuilder().build()) + .setApiWarning(ApiWarning.newBuilder().build()) + .setImportContext(ImportContext.newBuilder().build()) + .setExportContext(ExportContext.newBuilder().build()) + .setBackupContext(BackupContext.newBuilder().build()) + .setPreCheckMajorVersionUpgradeContext( + PreCheckMajorVersionUpgradeContext.newBuilder().build()) + .setName("name3373707") + .setTargetId("targetId-441951604") + .setSelfLink("selfLink1191800166") + .setTargetProject("targetProject1994636360") + .setAcquireSsrsLeaseContext(AcquireSsrsLeaseContext.newBuilder().build()) + .setSubOperationType(SqlSubOperationType.newBuilder().build()) + .build(); + mockSqlUsersService.addResponse(expectedResponse); + + SqlUsersUpdateRequest request = + SqlUsersUpdateRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .addAllDatabaseRoles(new ArrayList()) + .setRevokeExistingRoles(true) + .setBody(User.newBuilder().build()) + .build(); + + Operation actualResponse = client.update(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSqlUsersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SqlUsersUpdateRequest actualRequest = ((SqlUsersUpdateRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getHost(), actualRequest.getHost()); + Assert.assertEquals(request.getInstance(), actualRequest.getInstance()); + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getProject(), actualRequest.getProject()); + Assert.assertEquals(request.getDatabaseRolesList(), actualRequest.getDatabaseRolesList()); + Assert.assertEquals(request.getRevokeExistingRoles(), actualRequest.getRevokeExistingRoles()); + Assert.assertEquals(request.getBody(), actualRequest.getBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSqlUsersService.addException(exception); + + try { + SqlUsersUpdateRequest request = + SqlUsersUpdateRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .addAllDatabaseRoles(new ArrayList()) + .setRevokeExistingRoles(true) + .setBody(User.newBuilder().build()) + .build(); + client.update(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/pom.xml b/java-sql/grpc-google-cloud-sql-v1/pom.xml new file mode 100644 index 000000000000..e46e2803e85f --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-sql-v1 + 0.1.0-SNAPSHOT + grpc-google-cloud-sql-v1 + GRPC library for google-cloud-sql + + com.google.cloud + google-cloud-sql-parent + 0.1.0-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-sql-v1 + + + com.google.guava + guava + + + diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlAvailableDatabaseVersionsServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlAvailableDatabaseVersionsServiceGrpc.java new file mode 100644 index 000000000000..39d971b0ea46 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlAvailableDatabaseVersionsServiceGrpc.java @@ -0,0 +1,307 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + + +/** + * + * + *
+ * Service that exposes Cloud SQL database versions information. This
+ * service is only used internally.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlAvailableDatabaseVersionsServiceGrpc { + + private SqlAvailableDatabaseVersionsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.sql.v1.SqlAvailableDatabaseVersionsService"; + + // Static method descriptors that strictly reflect the proto. + /** Creates a new async stub that supports all call types for the service */ + public static SqlAvailableDatabaseVersionsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlAvailableDatabaseVersionsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlAvailableDatabaseVersionsServiceStub(channel, callOptions); + } + }; + return SqlAvailableDatabaseVersionsServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlAvailableDatabaseVersionsServiceBlockingV2Stub newBlockingV2Stub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory + factory = + new io.grpc.stub.AbstractStub.StubFactory< + SqlAvailableDatabaseVersionsServiceBlockingV2Stub>() { + @java.lang.Override + public SqlAvailableDatabaseVersionsServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlAvailableDatabaseVersionsServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlAvailableDatabaseVersionsServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlAvailableDatabaseVersionsServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory< + SqlAvailableDatabaseVersionsServiceBlockingStub>() { + @java.lang.Override + public SqlAvailableDatabaseVersionsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlAvailableDatabaseVersionsServiceBlockingStub(channel, callOptions); + } + }; + return SqlAvailableDatabaseVersionsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlAvailableDatabaseVersionsServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlAvailableDatabaseVersionsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlAvailableDatabaseVersionsServiceFutureStub(channel, callOptions); + } + }; + return SqlAvailableDatabaseVersionsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service that exposes Cloud SQL database versions information. This
+   * service is only used internally.
+   * 
+ */ + public interface AsyncService {} + + /** + * Base class for the server implementation of the service SqlAvailableDatabaseVersionsService. + * + *
+   * Service that exposes Cloud SQL database versions information. This
+   * service is only used internally.
+   * 
+ */ + public abstract static class SqlAvailableDatabaseVersionsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlAvailableDatabaseVersionsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service + * SqlAvailableDatabaseVersionsService. + * + *
+   * Service that exposes Cloud SQL database versions information. This
+   * service is only used internally.
+   * 
+ */ + public static final class SqlAvailableDatabaseVersionsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlAvailableDatabaseVersionsServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlAvailableDatabaseVersionsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlAvailableDatabaseVersionsServiceStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service + * SqlAvailableDatabaseVersionsService. + * + *
+   * Service that exposes Cloud SQL database versions information. This
+   * service is only used internally.
+   * 
+ */ + public static final class SqlAvailableDatabaseVersionsServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlAvailableDatabaseVersionsServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlAvailableDatabaseVersionsServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlAvailableDatabaseVersionsServiceBlockingV2Stub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service + * SqlAvailableDatabaseVersionsService. + * + *
+   * Service that exposes Cloud SQL database versions information. This
+   * service is only used internally.
+   * 
+ */ + public static final class SqlAvailableDatabaseVersionsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlAvailableDatabaseVersionsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlAvailableDatabaseVersionsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlAvailableDatabaseVersionsServiceBlockingStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * SqlAvailableDatabaseVersionsService. + * + *
+   * Service that exposes Cloud SQL database versions information. This
+   * service is only used internally.
+   * 
+ */ + public static final class SqlAvailableDatabaseVersionsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlAvailableDatabaseVersionsServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlAvailableDatabaseVersionsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlAvailableDatabaseVersionsServiceFutureStub(channel, callOptions); + } + } + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()).build(); + } + + private abstract static class SqlAvailableDatabaseVersionsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlAvailableDatabaseVersionsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlAvailableDatabaseVersionsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlAvailableDatabaseVersionsService"); + } + } + + private static final class SqlAvailableDatabaseVersionsServiceFileDescriptorSupplier + extends SqlAvailableDatabaseVersionsServiceBaseDescriptorSupplier { + SqlAvailableDatabaseVersionsServiceFileDescriptorSupplier() {} + } + + private static final class SqlAvailableDatabaseVersionsServiceMethodDescriptorSupplier + extends SqlAvailableDatabaseVersionsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlAvailableDatabaseVersionsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlAvailableDatabaseVersionsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor( + new SqlAvailableDatabaseVersionsServiceFileDescriptorSupplier()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsServiceGrpc.java new file mode 100644 index 000000000000..1acd9058d9e3 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsServiceGrpc.java @@ -0,0 +1,793 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for managing database backups.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlBackupRunsServiceGrpc { + + private SqlBackupRunsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1.SqlBackupRunsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Delete", + requestType = com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod; + if ((getDeleteMethod = SqlBackupRunsServiceGrpc.getDeleteMethod) == null) { + synchronized (SqlBackupRunsServiceGrpc.class) { + if ((getDeleteMethod = SqlBackupRunsServiceGrpc.getDeleteMethod) == null) { + SqlBackupRunsServiceGrpc.getDeleteMethod = + getDeleteMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Delete")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlBackupRunsServiceMethodDescriptorSupplier("Delete")) + .build(); + } + } + } + return getDeleteMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlBackupRunsGetRequest, com.google.cloud.sql.v1.BackupRun> + getGetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Get", + requestType = com.google.cloud.sql.v1.SqlBackupRunsGetRequest.class, + responseType = com.google.cloud.sql.v1.BackupRun.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlBackupRunsGetRequest, com.google.cloud.sql.v1.BackupRun> + getGetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlBackupRunsGetRequest, com.google.cloud.sql.v1.BackupRun> + getGetMethod; + if ((getGetMethod = SqlBackupRunsServiceGrpc.getGetMethod) == null) { + synchronized (SqlBackupRunsServiceGrpc.class) { + if ((getGetMethod = SqlBackupRunsServiceGrpc.getGetMethod) == null) { + SqlBackupRunsServiceGrpc.getGetMethod = + getGetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Get")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlBackupRunsGetRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.BackupRun.getDefaultInstance())) + .setSchemaDescriptor(new SqlBackupRunsServiceMethodDescriptorSupplier("Get")) + .build(); + } + } + } + return getGetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest, com.google.cloud.sql.v1.Operation> + getInsertMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Insert", + requestType = com.google.cloud.sql.v1.SqlBackupRunsInsertRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest, com.google.cloud.sql.v1.Operation> + getInsertMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest, com.google.cloud.sql.v1.Operation> + getInsertMethod; + if ((getInsertMethod = SqlBackupRunsServiceGrpc.getInsertMethod) == null) { + synchronized (SqlBackupRunsServiceGrpc.class) { + if ((getInsertMethod = SqlBackupRunsServiceGrpc.getInsertMethod) == null) { + SqlBackupRunsServiceGrpc.getInsertMethod = + getInsertMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Insert")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlBackupRunsServiceMethodDescriptorSupplier("Insert")) + .build(); + } + } + } + return getInsertMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlBackupRunsListRequest, + com.google.cloud.sql.v1.BackupRunsListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1.SqlBackupRunsListRequest.class, + responseType = com.google.cloud.sql.v1.BackupRunsListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlBackupRunsListRequest, + com.google.cloud.sql.v1.BackupRunsListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlBackupRunsListRequest, + com.google.cloud.sql.v1.BackupRunsListResponse> + getListMethod; + if ((getListMethod = SqlBackupRunsServiceGrpc.getListMethod) == null) { + synchronized (SqlBackupRunsServiceGrpc.class) { + if ((getListMethod = SqlBackupRunsServiceGrpc.getListMethod) == null) { + SqlBackupRunsServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlBackupRunsListRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.BackupRunsListResponse.getDefaultInstance())) + .setSchemaDescriptor(new SqlBackupRunsServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlBackupRunsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupRunsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceStub(channel, callOptions); + } + }; + return SqlBackupRunsServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlBackupRunsServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupRunsServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlBackupRunsServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlBackupRunsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupRunsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceBlockingStub(channel, callOptions); + } + }; + return SqlBackupRunsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlBackupRunsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupRunsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceFutureStub(channel, callOptions); + } + }; + return SqlBackupRunsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing database backups.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Deletes the backup taken by a backup run.
+     * 
+ */ + default void delete( + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup run.
+     * 
+ */ + default void get( + com.google.cloud.sql.v1.SqlBackupRunsGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new backup run on demand.
+     * 
+ */ + default void insert( + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getInsertMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all backup runs associated with the project or a given instance
+     * and configuration in the reverse chronological order of the backup
+     * initiation time.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1.SqlBackupRunsListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SqlBackupRunsService. + * + *
+   * Service for managing database backups.
+   * 
+ */ + public abstract static class SqlBackupRunsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlBackupRunsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlBackupRunsService. + * + *
+   * Service for managing database backups.
+   * 
+ */ + public static final class SqlBackupRunsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlBackupRunsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupRunsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the backup taken by a backup run.
+     * 
+ */ + public void delete( + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup run.
+     * 
+ */ + public void get( + com.google.cloud.sql.v1.SqlBackupRunsGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new backup run on demand.
+     * 
+ */ + public void insert( + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists all backup runs associated with the project or a given instance
+     * and configuration in the reverse chronological order of the backup
+     * initiation time.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1.SqlBackupRunsListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlBackupRunsService. + * + *
+   * Service for managing database backups.
+   * 
+ */ + public static final class SqlBackupRunsServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlBackupRunsServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupRunsServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the backup taken by a backup run.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation delete( + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup run.
+     * 
+ */ + public com.google.cloud.sql.v1.BackupRun get( + com.google.cloud.sql.v1.SqlBackupRunsGetRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new backup run on demand.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation insert( + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all backup runs associated with the project or a given instance
+     * and configuration in the reverse chronological order of the backup
+     * initiation time.
+     * 
+ */ + public com.google.cloud.sql.v1.BackupRunsListResponse list( + com.google.cloud.sql.v1.SqlBackupRunsListRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlBackupRunsService. + * + *
+   * Service for managing database backups.
+   * 
+ */ + public static final class SqlBackupRunsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlBackupRunsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupRunsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the backup taken by a backup run.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation delete( + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup run.
+     * 
+ */ + public com.google.cloud.sql.v1.BackupRun get( + com.google.cloud.sql.v1.SqlBackupRunsGetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new backup run on demand.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation insert( + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all backup runs associated with the project or a given instance
+     * and configuration in the reverse chronological order of the backup
+     * initiation time.
+     * 
+ */ + public com.google.cloud.sql.v1.BackupRunsListResponse list( + com.google.cloud.sql.v1.SqlBackupRunsListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlBackupRunsService. + * + *
+   * Service for managing database backups.
+   * 
+ */ + public static final class SqlBackupRunsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlBackupRunsServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupRunsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the backup taken by a backup run.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + delete(com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup run.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + get(com.google.cloud.sql.v1.SqlBackupRunsGetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new backup run on demand.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + insert(com.google.cloud.sql.v1.SqlBackupRunsInsertRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all backup runs associated with the project or a given instance
+     * and configuration in the reverse chronological order of the backup
+     * initiation time.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.BackupRunsListResponse> + list(com.google.cloud.sql.v1.SqlBackupRunsListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_DELETE = 0; + private static final int METHODID_GET = 1; + private static final int METHODID_INSERT = 2; + private static final int METHODID_LIST = 3; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_DELETE: + serviceImpl.delete( + (com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET: + serviceImpl.get( + (com.google.cloud.sql.v1.SqlBackupRunsGetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_INSERT: + serviceImpl.insert( + (com.google.cloud.sql.v1.SqlBackupRunsInsertRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1.SqlBackupRunsListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeleteMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_DELETE))) + .addMethod( + getGetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlBackupRunsGetRequest, + com.google.cloud.sql.v1.BackupRun>(service, METHODID_GET))) + .addMethod( + getInsertMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_INSERT))) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlBackupRunsListRequest, + com.google.cloud.sql.v1.BackupRunsListResponse>(service, METHODID_LIST))) + .build(); + } + + private abstract static class SqlBackupRunsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlBackupRunsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlBackupRunsService"); + } + } + + private static final class SqlBackupRunsServiceFileDescriptorSupplier + extends SqlBackupRunsServiceBaseDescriptorSupplier { + SqlBackupRunsServiceFileDescriptorSupplier() {} + } + + private static final class SqlBackupRunsServiceMethodDescriptorSupplier + extends SqlBackupRunsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlBackupRunsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlBackupRunsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlBackupRunsServiceFileDescriptorSupplier()) + .addMethod(getDeleteMethod()) + .addMethod(getGetMethod()) + .addMethod(getInsertMethod()) + .addMethod(getListMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupsServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupsServiceGrpc.java new file mode 100644 index 000000000000..732625a531b1 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupsServiceGrpc.java @@ -0,0 +1,878 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlBackupsServiceGrpc { + + private SqlBackupsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1.SqlBackupsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.CreateBackupRequest, com.google.cloud.sql.v1.Operation> + getCreateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBackup", + requestType = com.google.cloud.sql.v1.CreateBackupRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.CreateBackupRequest, com.google.cloud.sql.v1.Operation> + getCreateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.CreateBackupRequest, com.google.cloud.sql.v1.Operation> + getCreateBackupMethod; + if ((getCreateBackupMethod = SqlBackupsServiceGrpc.getCreateBackupMethod) == null) { + synchronized (SqlBackupsServiceGrpc.class) { + if ((getCreateBackupMethod = SqlBackupsServiceGrpc.getCreateBackupMethod) == null) { + SqlBackupsServiceGrpc.getCreateBackupMethod = + getCreateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.CreateBackupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlBackupsServiceMethodDescriptorSupplier("CreateBackup")) + .build(); + } + } + } + return getCreateBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.GetBackupRequest, com.google.cloud.sql.v1.Backup> + getGetBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBackup", + requestType = com.google.cloud.sql.v1.GetBackupRequest.class, + responseType = com.google.cloud.sql.v1.Backup.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.GetBackupRequest, com.google.cloud.sql.v1.Backup> + getGetBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.GetBackupRequest, com.google.cloud.sql.v1.Backup> + getGetBackupMethod; + if ((getGetBackupMethod = SqlBackupsServiceGrpc.getGetBackupMethod) == null) { + synchronized (SqlBackupsServiceGrpc.class) { + if ((getGetBackupMethod = SqlBackupsServiceGrpc.getGetBackupMethod) == null) { + SqlBackupsServiceGrpc.getGetBackupMethod = + getGetBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Backup.getDefaultInstance())) + .setSchemaDescriptor( + new SqlBackupsServiceMethodDescriptorSupplier("GetBackup")) + .build(); + } + } + } + return getGetBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.ListBackupsRequest, com.google.cloud.sql.v1.ListBackupsResponse> + getListBackupsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBackups", + requestType = com.google.cloud.sql.v1.ListBackupsRequest.class, + responseType = com.google.cloud.sql.v1.ListBackupsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.ListBackupsRequest, com.google.cloud.sql.v1.ListBackupsResponse> + getListBackupsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.ListBackupsRequest, com.google.cloud.sql.v1.ListBackupsResponse> + getListBackupsMethod; + if ((getListBackupsMethod = SqlBackupsServiceGrpc.getListBackupsMethod) == null) { + synchronized (SqlBackupsServiceGrpc.class) { + if ((getListBackupsMethod = SqlBackupsServiceGrpc.getListBackupsMethod) == null) { + SqlBackupsServiceGrpc.getListBackupsMethod = + getListBackupsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBackups")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.ListBackupsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.ListBackupsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new SqlBackupsServiceMethodDescriptorSupplier("ListBackups")) + .build(); + } + } + } + return getListBackupsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.UpdateBackupRequest, com.google.cloud.sql.v1.Operation> + getUpdateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBackup", + requestType = com.google.cloud.sql.v1.UpdateBackupRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.UpdateBackupRequest, com.google.cloud.sql.v1.Operation> + getUpdateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.UpdateBackupRequest, com.google.cloud.sql.v1.Operation> + getUpdateBackupMethod; + if ((getUpdateBackupMethod = SqlBackupsServiceGrpc.getUpdateBackupMethod) == null) { + synchronized (SqlBackupsServiceGrpc.class) { + if ((getUpdateBackupMethod = SqlBackupsServiceGrpc.getUpdateBackupMethod) == null) { + SqlBackupsServiceGrpc.getUpdateBackupMethod = + getUpdateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.UpdateBackupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlBackupsServiceMethodDescriptorSupplier("UpdateBackup")) + .build(); + } + } + } + return getUpdateBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.DeleteBackupRequest, com.google.cloud.sql.v1.Operation> + getDeleteBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBackup", + requestType = com.google.cloud.sql.v1.DeleteBackupRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.DeleteBackupRequest, com.google.cloud.sql.v1.Operation> + getDeleteBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.DeleteBackupRequest, com.google.cloud.sql.v1.Operation> + getDeleteBackupMethod; + if ((getDeleteBackupMethod = SqlBackupsServiceGrpc.getDeleteBackupMethod) == null) { + synchronized (SqlBackupsServiceGrpc.class) { + if ((getDeleteBackupMethod = SqlBackupsServiceGrpc.getDeleteBackupMethod) == null) { + SqlBackupsServiceGrpc.getDeleteBackupMethod = + getDeleteBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.DeleteBackupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlBackupsServiceMethodDescriptorSupplier("DeleteBackup")) + .build(); + } + } + } + return getDeleteBackupMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlBackupsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceStub(channel, callOptions); + } + }; + return SqlBackupsServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlBackupsServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupsServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlBackupsServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlBackupsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceBlockingStub(channel, callOptions); + } + }; + return SqlBackupsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlBackupsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceFutureStub(channel, callOptions); + } + }; + return SqlBackupsServiceFutureStub.newStub(factory, channel); + } + + /** */ + public interface AsyncService { + + /** + * + * + *
+     * Creates a backup for a Cloud SQL instance. This API can be used only to
+     * create on-demand backups.
+     * 
+ */ + default void createBackup( + com.google.cloud.sql.v1.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup.
+     * 
+ */ + default void getBackup( + com.google.cloud.sql.v1.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all backups associated with the project.
+     * 
+ */ + default void listBackups( + com.google.cloud.sql.v1.ListBackupsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListBackupsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the retention period and description of the backup. You can use
+     * this API to update final backups only.
+     * 
+ */ + default void updateBackup( + com.google.cloud.sql.v1.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the backup.
+     * 
+ */ + default void deleteBackup( + com.google.cloud.sql.v1.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBackupMethod(), responseObserver); + } + } + + /** Base class for the server implementation of the service SqlBackupsService. */ + public abstract static class SqlBackupsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlBackupsServiceGrpc.bindService(this); + } + } + + /** A stub to allow clients to do asynchronous rpc calls to service SqlBackupsService. */ + public static final class SqlBackupsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlBackupsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a backup for a Cloud SQL instance. This API can be used only to
+     * create on-demand backups.
+     * 
+ */ + public void createBackup( + com.google.cloud.sql.v1.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup.
+     * 
+ */ + public void getBackup( + com.google.cloud.sql.v1.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists all backups associated with the project.
+     * 
+ */ + public void listBackups( + com.google.cloud.sql.v1.ListBackupsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the retention period and description of the backup. You can use
+     * this API to update final backups only.
+     * 
+ */ + public void updateBackup( + com.google.cloud.sql.v1.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the backup.
+     * 
+ */ + public void deleteBackup( + com.google.cloud.sql.v1.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** A stub to allow clients to do synchronous rpc calls to service SqlBackupsService. */ + public static final class SqlBackupsServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlBackupsServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupsServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a backup for a Cloud SQL instance. This API can be used only to
+     * create on-demand backups.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation createBackup( + com.google.cloud.sql.v1.CreateBackupRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup.
+     * 
+ */ + public com.google.cloud.sql.v1.Backup getBackup( + com.google.cloud.sql.v1.GetBackupRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all backups associated with the project.
+     * 
+ */ + public com.google.cloud.sql.v1.ListBackupsResponse listBackups( + com.google.cloud.sql.v1.ListBackupsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListBackupsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the retention period and description of the backup. You can use
+     * this API to update final backups only.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation updateBackup( + com.google.cloud.sql.v1.UpdateBackupRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the backup.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation deleteBackup( + com.google.cloud.sql.v1.DeleteBackupRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteBackupMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do limited synchronous rpc calls to service SqlBackupsService. */ + public static final class SqlBackupsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlBackupsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a backup for a Cloud SQL instance. This API can be used only to
+     * create on-demand backups.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation createBackup( + com.google.cloud.sql.v1.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup.
+     * 
+ */ + public com.google.cloud.sql.v1.Backup getBackup( + com.google.cloud.sql.v1.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all backups associated with the project.
+     * 
+ */ + public com.google.cloud.sql.v1.ListBackupsResponse listBackups( + com.google.cloud.sql.v1.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBackupsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the retention period and description of the backup. You can use
+     * this API to update final backups only.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation updateBackup( + com.google.cloud.sql.v1.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the backup.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation deleteBackup( + com.google.cloud.sql.v1.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBackupMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlBackupsService. + */ + public static final class SqlBackupsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlBackupsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a backup for a Cloud SQL instance. This API can be used only to
+     * create on-demand backups.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createBackup(com.google.cloud.sql.v1.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getBackup(com.google.cloud.sql.v1.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all backups associated with the project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.ListBackupsResponse> + listBackups(com.google.cloud.sql.v1.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the retention period and description of the backup. You can use
+     * this API to update final backups only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateBackup(com.google.cloud.sql.v1.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteBackup(com.google.cloud.sql.v1.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_BACKUP = 0; + private static final int METHODID_GET_BACKUP = 1; + private static final int METHODID_LIST_BACKUPS = 2; + private static final int METHODID_UPDATE_BACKUP = 3; + private static final int METHODID_DELETE_BACKUP = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_BACKUP: + serviceImpl.createBackup( + (com.google.cloud.sql.v1.CreateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_BACKUP: + serviceImpl.getBackup( + (com.google.cloud.sql.v1.GetBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_BACKUPS: + serviceImpl.listBackups( + (com.google.cloud.sql.v1.ListBackupsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_BACKUP: + serviceImpl.updateBackup( + (com.google.cloud.sql.v1.UpdateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_BACKUP: + serviceImpl.deleteBackup( + (com.google.cloud.sql.v1.DeleteBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.CreateBackupRequest, com.google.cloud.sql.v1.Operation>( + service, METHODID_CREATE_BACKUP))) + .addMethod( + getGetBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.GetBackupRequest, com.google.cloud.sql.v1.Backup>( + service, METHODID_GET_BACKUP))) + .addMethod( + getListBackupsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.ListBackupsRequest, + com.google.cloud.sql.v1.ListBackupsResponse>(service, METHODID_LIST_BACKUPS))) + .addMethod( + getUpdateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.UpdateBackupRequest, com.google.cloud.sql.v1.Operation>( + service, METHODID_UPDATE_BACKUP))) + .addMethod( + getDeleteBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.DeleteBackupRequest, com.google.cloud.sql.v1.Operation>( + service, METHODID_DELETE_BACKUP))) + .build(); + } + + private abstract static class SqlBackupsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlBackupsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlBackupsService"); + } + } + + private static final class SqlBackupsServiceFileDescriptorSupplier + extends SqlBackupsServiceBaseDescriptorSupplier { + SqlBackupsServiceFileDescriptorSupplier() {} + } + + private static final class SqlBackupsServiceMethodDescriptorSupplier + extends SqlBackupsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlBackupsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlBackupsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlBackupsServiceFileDescriptorSupplier()) + .addMethod(getCreateBackupMethod()) + .addMethod(getGetBackupMethod()) + .addMethod(getListBackupsMethod()) + .addMethod(getUpdateBackupMethod()) + .addMethod(getDeleteBackupMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlConnectServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlConnectServiceGrpc.java new file mode 100644 index 000000000000..fd3d780d9271 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlConnectServiceGrpc.java @@ -0,0 +1,716 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Cloud SQL connect service.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlConnectServiceGrpc { + + private SqlConnectServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1.SqlConnectService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.GetConnectSettingsRequest, + com.google.cloud.sql.v1.ConnectSettings> + getGetConnectSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConnectSettings", + requestType = com.google.cloud.sql.v1.GetConnectSettingsRequest.class, + responseType = com.google.cloud.sql.v1.ConnectSettings.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.GetConnectSettingsRequest, + com.google.cloud.sql.v1.ConnectSettings> + getGetConnectSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.GetConnectSettingsRequest, + com.google.cloud.sql.v1.ConnectSettings> + getGetConnectSettingsMethod; + if ((getGetConnectSettingsMethod = SqlConnectServiceGrpc.getGetConnectSettingsMethod) == null) { + synchronized (SqlConnectServiceGrpc.class) { + if ((getGetConnectSettingsMethod = SqlConnectServiceGrpc.getGetConnectSettingsMethod) + == null) { + SqlConnectServiceGrpc.getGetConnectSettingsMethod = + getGetConnectSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConnectSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.GetConnectSettingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.ConnectSettings.getDefaultInstance())) + .setSchemaDescriptor( + new SqlConnectServiceMethodDescriptorSupplier("GetConnectSettings")) + .build(); + } + } + } + return getGetConnectSettingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.ResolveConnectSettingsRequest, + com.google.cloud.sql.v1.ConnectSettings> + getResolveConnectSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ResolveConnectSettings", + requestType = com.google.cloud.sql.v1.ResolveConnectSettingsRequest.class, + responseType = com.google.cloud.sql.v1.ConnectSettings.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.ResolveConnectSettingsRequest, + com.google.cloud.sql.v1.ConnectSettings> + getResolveConnectSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.ResolveConnectSettingsRequest, + com.google.cloud.sql.v1.ConnectSettings> + getResolveConnectSettingsMethod; + if ((getResolveConnectSettingsMethod = SqlConnectServiceGrpc.getResolveConnectSettingsMethod) + == null) { + synchronized (SqlConnectServiceGrpc.class) { + if ((getResolveConnectSettingsMethod = + SqlConnectServiceGrpc.getResolveConnectSettingsMethod) + == null) { + SqlConnectServiceGrpc.getResolveConnectSettingsMethod = + getResolveConnectSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ResolveConnectSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.ResolveConnectSettingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.ConnectSettings.getDefaultInstance())) + .setSchemaDescriptor( + new SqlConnectServiceMethodDescriptorSupplier("ResolveConnectSettings")) + .build(); + } + } + } + return getResolveConnectSettingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.GenerateEphemeralCertRequest, + com.google.cloud.sql.v1.GenerateEphemeralCertResponse> + getGenerateEphemeralCertMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateEphemeralCert", + requestType = com.google.cloud.sql.v1.GenerateEphemeralCertRequest.class, + responseType = com.google.cloud.sql.v1.GenerateEphemeralCertResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.GenerateEphemeralCertRequest, + com.google.cloud.sql.v1.GenerateEphemeralCertResponse> + getGenerateEphemeralCertMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.GenerateEphemeralCertRequest, + com.google.cloud.sql.v1.GenerateEphemeralCertResponse> + getGenerateEphemeralCertMethod; + if ((getGenerateEphemeralCertMethod = SqlConnectServiceGrpc.getGenerateEphemeralCertMethod) + == null) { + synchronized (SqlConnectServiceGrpc.class) { + if ((getGenerateEphemeralCertMethod = SqlConnectServiceGrpc.getGenerateEphemeralCertMethod) + == null) { + SqlConnectServiceGrpc.getGenerateEphemeralCertMethod = + getGenerateEphemeralCertMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GenerateEphemeralCert")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.GenerateEphemeralCertRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.GenerateEphemeralCertResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlConnectServiceMethodDescriptorSupplier("GenerateEphemeralCert")) + .build(); + } + } + } + return getGenerateEphemeralCertMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlConnectServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlConnectServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceStub(channel, callOptions); + } + }; + return SqlConnectServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlConnectServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlConnectServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlConnectServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlConnectServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlConnectServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceBlockingStub(channel, callOptions); + } + }; + return SqlConnectServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlConnectServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlConnectServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceFutureStub(channel, callOptions); + } + }; + return SqlConnectServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Cloud SQL connect service.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance.
+     * 
+ */ + default void getConnectSettings( + com.google.cloud.sql.v1.GetConnectSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetConnectSettingsMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance using the instance
+     * DNS name.
+     * 
+ */ + default void resolveConnectSettings( + com.google.cloud.sql.v1.ResolveConnectSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getResolveConnectSettingsMethod(), responseObserver); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + default void generateEphemeralCert( + com.google.cloud.sql.v1.GenerateEphemeralCertRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateEphemeralCertMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SqlConnectService. + * + *
+   * Cloud SQL connect service.
+   * 
+ */ + public abstract static class SqlConnectServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlConnectServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlConnectService. + * + *
+   * Cloud SQL connect service.
+   * 
+ */ + public static final class SqlConnectServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlConnectServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlConnectServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance.
+     * 
+ */ + public void getConnectSettings( + com.google.cloud.sql.v1.GetConnectSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetConnectSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance using the instance
+     * DNS name.
+     * 
+ */ + public void resolveConnectSettings( + com.google.cloud.sql.v1.ResolveConnectSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getResolveConnectSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public void generateEphemeralCert( + com.google.cloud.sql.v1.GenerateEphemeralCertRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGenerateEphemeralCertMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlConnectService. + * + *
+   * Cloud SQL connect service.
+   * 
+ */ + public static final class SqlConnectServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlConnectServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlConnectServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.ConnectSettings getConnectSettings( + com.google.cloud.sql.v1.GetConnectSettingsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetConnectSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance using the instance
+     * DNS name.
+     * 
+ */ + public com.google.cloud.sql.v1.ConnectSettings resolveConnectSettings( + com.google.cloud.sql.v1.ResolveConnectSettingsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getResolveConnectSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public com.google.cloud.sql.v1.GenerateEphemeralCertResponse generateEphemeralCert( + com.google.cloud.sql.v1.GenerateEphemeralCertRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGenerateEphemeralCertMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlConnectService. + * + *
+   * Cloud SQL connect service.
+   * 
+ */ + public static final class SqlConnectServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlConnectServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlConnectServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.ConnectSettings getConnectSettings( + com.google.cloud.sql.v1.GetConnectSettingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetConnectSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance using the instance
+     * DNS name.
+     * 
+ */ + public com.google.cloud.sql.v1.ConnectSettings resolveConnectSettings( + com.google.cloud.sql.v1.ResolveConnectSettingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getResolveConnectSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public com.google.cloud.sql.v1.GenerateEphemeralCertResponse generateEphemeralCert( + com.google.cloud.sql.v1.GenerateEphemeralCertRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGenerateEphemeralCertMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlConnectService. + * + *
+   * Cloud SQL connect service.
+   * 
+ */ + public static final class SqlConnectServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlConnectServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlConnectServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.ConnectSettings> + getConnectSettings(com.google.cloud.sql.v1.GetConnectSettingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetConnectSettingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance using the instance
+     * DNS name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.ConnectSettings> + resolveConnectSettings(com.google.cloud.sql.v1.ResolveConnectSettingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getResolveConnectSettingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.GenerateEphemeralCertResponse> + generateEphemeralCert(com.google.cloud.sql.v1.GenerateEphemeralCertRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGenerateEphemeralCertMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_CONNECT_SETTINGS = 0; + private static final int METHODID_RESOLVE_CONNECT_SETTINGS = 1; + private static final int METHODID_GENERATE_EPHEMERAL_CERT = 2; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_CONNECT_SETTINGS: + serviceImpl.getConnectSettings( + (com.google.cloud.sql.v1.GetConnectSettingsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_RESOLVE_CONNECT_SETTINGS: + serviceImpl.resolveConnectSettings( + (com.google.cloud.sql.v1.ResolveConnectSettingsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GENERATE_EPHEMERAL_CERT: + serviceImpl.generateEphemeralCert( + (com.google.cloud.sql.v1.GenerateEphemeralCertRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetConnectSettingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.GetConnectSettingsRequest, + com.google.cloud.sql.v1.ConnectSettings>( + service, METHODID_GET_CONNECT_SETTINGS))) + .addMethod( + getResolveConnectSettingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.ResolveConnectSettingsRequest, + com.google.cloud.sql.v1.ConnectSettings>( + service, METHODID_RESOLVE_CONNECT_SETTINGS))) + .addMethod( + getGenerateEphemeralCertMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.GenerateEphemeralCertRequest, + com.google.cloud.sql.v1.GenerateEphemeralCertResponse>( + service, METHODID_GENERATE_EPHEMERAL_CERT))) + .build(); + } + + private abstract static class SqlConnectServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlConnectServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlConnectProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlConnectService"); + } + } + + private static final class SqlConnectServiceFileDescriptorSupplier + extends SqlConnectServiceBaseDescriptorSupplier { + SqlConnectServiceFileDescriptorSupplier() {} + } + + private static final class SqlConnectServiceMethodDescriptorSupplier + extends SqlConnectServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlConnectServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlConnectServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlConnectServiceFileDescriptorSupplier()) + .addMethod(getGetConnectSettingsMethod()) + .addMethod(getResolveConnectSettingsMethod()) + .addMethod(getGenerateEphemeralCertMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesServiceGrpc.java new file mode 100644 index 000000000000..4a24f5aef159 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesServiceGrpc.java @@ -0,0 +1,1050 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to manage databases.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlDatabasesServiceGrpc { + + private SqlDatabasesServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1.SqlDatabasesService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Delete", + requestType = com.google.cloud.sql.v1.SqlDatabasesDeleteRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod; + if ((getDeleteMethod = SqlDatabasesServiceGrpc.getDeleteMethod) == null) { + synchronized (SqlDatabasesServiceGrpc.class) { + if ((getDeleteMethod = SqlDatabasesServiceGrpc.getDeleteMethod) == null) { + SqlDatabasesServiceGrpc.getDeleteMethod = + getDeleteMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Delete")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlDatabasesServiceMethodDescriptorSupplier("Delete")) + .build(); + } + } + } + return getDeleteMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesGetRequest, com.google.cloud.sql.v1.Database> + getGetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Get", + requestType = com.google.cloud.sql.v1.SqlDatabasesGetRequest.class, + responseType = com.google.cloud.sql.v1.Database.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesGetRequest, com.google.cloud.sql.v1.Database> + getGetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesGetRequest, com.google.cloud.sql.v1.Database> + getGetMethod; + if ((getGetMethod = SqlDatabasesServiceGrpc.getGetMethod) == null) { + synchronized (SqlDatabasesServiceGrpc.class) { + if ((getGetMethod = SqlDatabasesServiceGrpc.getGetMethod) == null) { + SqlDatabasesServiceGrpc.getGetMethod = + getGetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Get")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlDatabasesGetRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Database.getDefaultInstance())) + .setSchemaDescriptor(new SqlDatabasesServiceMethodDescriptorSupplier("Get")) + .build(); + } + } + } + return getGetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesInsertRequest, com.google.cloud.sql.v1.Operation> + getInsertMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Insert", + requestType = com.google.cloud.sql.v1.SqlDatabasesInsertRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesInsertRequest, com.google.cloud.sql.v1.Operation> + getInsertMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesInsertRequest, com.google.cloud.sql.v1.Operation> + getInsertMethod; + if ((getInsertMethod = SqlDatabasesServiceGrpc.getInsertMethod) == null) { + synchronized (SqlDatabasesServiceGrpc.class) { + if ((getInsertMethod = SqlDatabasesServiceGrpc.getInsertMethod) == null) { + SqlDatabasesServiceGrpc.getInsertMethod = + getInsertMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Insert")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlDatabasesInsertRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlDatabasesServiceMethodDescriptorSupplier("Insert")) + .build(); + } + } + } + return getInsertMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesListRequest, + com.google.cloud.sql.v1.DatabasesListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1.SqlDatabasesListRequest.class, + responseType = com.google.cloud.sql.v1.DatabasesListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesListRequest, + com.google.cloud.sql.v1.DatabasesListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesListRequest, + com.google.cloud.sql.v1.DatabasesListResponse> + getListMethod; + if ((getListMethod = SqlDatabasesServiceGrpc.getListMethod) == null) { + synchronized (SqlDatabasesServiceGrpc.class) { + if ((getListMethod = SqlDatabasesServiceGrpc.getListMethod) == null) { + SqlDatabasesServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlDatabasesListRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.DatabasesListResponse.getDefaultInstance())) + .setSchemaDescriptor(new SqlDatabasesServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest, com.google.cloud.sql.v1.Operation> + getPatchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Patch", + requestType = com.google.cloud.sql.v1.SqlDatabasesUpdateRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest, com.google.cloud.sql.v1.Operation> + getPatchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest, com.google.cloud.sql.v1.Operation> + getPatchMethod; + if ((getPatchMethod = SqlDatabasesServiceGrpc.getPatchMethod) == null) { + synchronized (SqlDatabasesServiceGrpc.class) { + if ((getPatchMethod = SqlDatabasesServiceGrpc.getPatchMethod) == null) { + SqlDatabasesServiceGrpc.getPatchMethod = + getPatchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Patch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlDatabasesServiceMethodDescriptorSupplier("Patch")) + .build(); + } + } + } + return getPatchMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest, com.google.cloud.sql.v1.Operation> + getUpdateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Update", + requestType = com.google.cloud.sql.v1.SqlDatabasesUpdateRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest, com.google.cloud.sql.v1.Operation> + getUpdateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest, com.google.cloud.sql.v1.Operation> + getUpdateMethod; + if ((getUpdateMethod = SqlDatabasesServiceGrpc.getUpdateMethod) == null) { + synchronized (SqlDatabasesServiceGrpc.class) { + if ((getUpdateMethod = SqlDatabasesServiceGrpc.getUpdateMethod) == null) { + SqlDatabasesServiceGrpc.getUpdateMethod = + getUpdateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Update")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlDatabasesServiceMethodDescriptorSupplier("Update")) + .build(); + } + } + } + return getUpdateMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlDatabasesServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlDatabasesServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceStub(channel, callOptions); + } + }; + return SqlDatabasesServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlDatabasesServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlDatabasesServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlDatabasesServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlDatabasesServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlDatabasesServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceBlockingStub(channel, callOptions); + } + }; + return SqlDatabasesServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlDatabasesServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlDatabasesServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceFutureStub(channel, callOptions); + } + }; + return SqlDatabasesServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to manage databases.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Deletes a database from a Cloud SQL instance.
+     * 
+ */ + default void delete( + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + default void get( + com.google.cloud.sql.v1.SqlDatabasesGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver); + } + + /** + * + * + *
+     * Inserts a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * **Note:** You can't modify the default character set and collation.
+     * 
+ */ + default void insert( + com.google.cloud.sql.v1.SqlDatabasesInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getInsertMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists databases in the specified Cloud SQL instance.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1.SqlDatabasesListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + + /** + * + * + *
+     * Partially updates a resource containing information about a database inside
+     * a Cloud SQL instance. This method supports patch semantics.
+     * 
+ */ + default void patch( + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPatchMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + default void update( + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SqlDatabasesService. + * + *
+   * Service to manage databases.
+   * 
+ */ + public abstract static class SqlDatabasesServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlDatabasesServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlDatabasesService. + * + *
+   * Service to manage databases.
+   * 
+ */ + public static final class SqlDatabasesServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlDatabasesServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlDatabasesServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a database from a Cloud SQL instance.
+     * 
+ */ + public void delete( + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public void get( + com.google.cloud.sql.v1.SqlDatabasesGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Inserts a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * **Note:** You can't modify the default character set and collation.
+     * 
+ */ + public void insert( + com.google.cloud.sql.v1.SqlDatabasesInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists databases in the specified Cloud SQL instance.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1.SqlDatabasesListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Partially updates a resource containing information about a database inside
+     * a Cloud SQL instance. This method supports patch semantics.
+     * 
+ */ + public void patch( + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPatchMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public void update( + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlDatabasesService. + * + *
+   * Service to manage databases.
+   * 
+ */ + public static final class SqlDatabasesServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlDatabasesServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlDatabasesServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a database from a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation delete( + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Database get( + com.google.cloud.sql.v1.SqlDatabasesGetRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Inserts a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * **Note:** You can't modify the default character set and collation.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation insert( + com.google.cloud.sql.v1.SqlDatabasesInsertRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists databases in the specified Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.DatabasesListResponse list( + com.google.cloud.sql.v1.SqlDatabasesListRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Partially updates a resource containing information about a database inside
+     * a Cloud SQL instance. This method supports patch semantics.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation patch( + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation update( + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlDatabasesService. + * + *
+   * Service to manage databases.
+   * 
+ */ + public static final class SqlDatabasesServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlDatabasesServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlDatabasesServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a database from a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation delete( + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Database get( + com.google.cloud.sql.v1.SqlDatabasesGetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Inserts a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * **Note:** You can't modify the default character set and collation.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation insert( + com.google.cloud.sql.v1.SqlDatabasesInsertRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists databases in the specified Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.DatabasesListResponse list( + com.google.cloud.sql.v1.SqlDatabasesListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Partially updates a resource containing information about a database inside
+     * a Cloud SQL instance. This method supports patch semantics.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation patch( + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation update( + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlDatabasesService. + * + *
+   * Service to manage databases.
+   * 
+ */ + public static final class SqlDatabasesServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlDatabasesServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlDatabasesServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a database from a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + delete(com.google.cloud.sql.v1.SqlDatabasesDeleteRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture get( + com.google.cloud.sql.v1.SqlDatabasesGetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Inserts a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * **Note:** You can't modify the default character set and collation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + insert(com.google.cloud.sql.v1.SqlDatabasesInsertRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists databases in the specified Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.DatabasesListResponse> + list(com.google.cloud.sql.v1.SqlDatabasesListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Partially updates a resource containing information about a database inside
+     * a Cloud SQL instance. This method supports patch semantics.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + patch(com.google.cloud.sql.v1.SqlDatabasesUpdateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPatchMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + update(com.google.cloud.sql.v1.SqlDatabasesUpdateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_DELETE = 0; + private static final int METHODID_GET = 1; + private static final int METHODID_INSERT = 2; + private static final int METHODID_LIST = 3; + private static final int METHODID_PATCH = 4; + private static final int METHODID_UPDATE = 5; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_DELETE: + serviceImpl.delete( + (com.google.cloud.sql.v1.SqlDatabasesDeleteRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET: + serviceImpl.get( + (com.google.cloud.sql.v1.SqlDatabasesGetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_INSERT: + serviceImpl.insert( + (com.google.cloud.sql.v1.SqlDatabasesInsertRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1.SqlDatabasesListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PATCH: + serviceImpl.patch( + (com.google.cloud.sql.v1.SqlDatabasesUpdateRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE: + serviceImpl.update( + (com.google.cloud.sql.v1.SqlDatabasesUpdateRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeleteMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_DELETE))) + .addMethod( + getGetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlDatabasesGetRequest, + com.google.cloud.sql.v1.Database>(service, METHODID_GET))) + .addMethod( + getInsertMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlDatabasesInsertRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_INSERT))) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlDatabasesListRequest, + com.google.cloud.sql.v1.DatabasesListResponse>(service, METHODID_LIST))) + .addMethod( + getPatchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_PATCH))) + .addMethod( + getUpdateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_UPDATE))) + .build(); + } + + private abstract static class SqlDatabasesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlDatabasesServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlDatabasesService"); + } + } + + private static final class SqlDatabasesServiceFileDescriptorSupplier + extends SqlDatabasesServiceBaseDescriptorSupplier { + SqlDatabasesServiceFileDescriptorSupplier() {} + } + + private static final class SqlDatabasesServiceMethodDescriptorSupplier + extends SqlDatabasesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlDatabasesServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlDatabasesServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlDatabasesServiceFileDescriptorSupplier()) + .addMethod(getDeleteMethod()) + .addMethod(getGetMethod()) + .addMethod(getInsertMethod()) + .addMethod(getListMethod()) + .addMethod(getPatchMethod()) + .addMethod(getUpdateMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlEventsServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlEventsServiceGrpc.java new file mode 100644 index 000000000000..e39fdd9c9fe6 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlEventsServiceGrpc.java @@ -0,0 +1,291 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + + +/** + * + * + *
+ * Service that exposes Cloud SQL event information. This
+ * service is only used internally.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlEventsServiceGrpc { + + private SqlEventsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1.SqlEventsService"; + + // Static method descriptors that strictly reflect the proto. + /** Creates a new async stub that supports all call types for the service */ + public static SqlEventsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlEventsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlEventsServiceStub(channel, callOptions); + } + }; + return SqlEventsServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlEventsServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlEventsServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlEventsServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlEventsServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlEventsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlEventsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlEventsServiceBlockingStub(channel, callOptions); + } + }; + return SqlEventsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlEventsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlEventsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlEventsServiceFutureStub(channel, callOptions); + } + }; + return SqlEventsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service that exposes Cloud SQL event information. This
+   * service is only used internally.
+   * 
+ */ + public interface AsyncService {} + + /** + * Base class for the server implementation of the service SqlEventsService. + * + *
+   * Service that exposes Cloud SQL event information. This
+   * service is only used internally.
+   * 
+ */ + public abstract static class SqlEventsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlEventsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlEventsService. + * + *
+   * Service that exposes Cloud SQL event information. This
+   * service is only used internally.
+   * 
+ */ + public static final class SqlEventsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlEventsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlEventsServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlEventsServiceStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlEventsService. + * + *
+   * Service that exposes Cloud SQL event information. This
+   * service is only used internally.
+   * 
+ */ + public static final class SqlEventsServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlEventsServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlEventsServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlEventsServiceBlockingV2Stub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlEventsService. + * + *
+   * Service that exposes Cloud SQL event information. This
+   * service is only used internally.
+   * 
+ */ + public static final class SqlEventsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlEventsServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlEventsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlEventsServiceBlockingStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlEventsService. + * + *
+   * Service that exposes Cloud SQL event information. This
+   * service is only used internally.
+   * 
+ */ + public static final class SqlEventsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlEventsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlEventsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlEventsServiceFutureStub(channel, callOptions); + } + } + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()).build(); + } + + private abstract static class SqlEventsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlEventsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlEventsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlEventsService"); + } + } + + private static final class SqlEventsServiceFileDescriptorSupplier + extends SqlEventsServiceBaseDescriptorSupplier { + SqlEventsServiceFileDescriptorSupplier() {} + } + + private static final class SqlEventsServiceMethodDescriptorSupplier + extends SqlEventsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlEventsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlEventsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlEventsServiceFileDescriptorSupplier()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFeatureEligibilityServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFeatureEligibilityServiceGrpc.java new file mode 100644 index 000000000000..94997db5ee95 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFeatureEligibilityServiceGrpc.java @@ -0,0 +1,292 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + + +/** + * + * + *
+ * Service to verify the eligibility of an instance for a given operation.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlFeatureEligibilityServiceGrpc { + + private SqlFeatureEligibilityServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.sql.v1.SqlFeatureEligibilityService"; + + // Static method descriptors that strictly reflect the proto. + /** Creates a new async stub that supports all call types for the service */ + public static SqlFeatureEligibilityServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlFeatureEligibilityServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFeatureEligibilityServiceStub(channel, callOptions); + } + }; + return SqlFeatureEligibilityServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlFeatureEligibilityServiceBlockingV2Stub newBlockingV2Stub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlFeatureEligibilityServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFeatureEligibilityServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlFeatureEligibilityServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlFeatureEligibilityServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlFeatureEligibilityServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFeatureEligibilityServiceBlockingStub(channel, callOptions); + } + }; + return SqlFeatureEligibilityServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlFeatureEligibilityServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlFeatureEligibilityServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFeatureEligibilityServiceFutureStub(channel, callOptions); + } + }; + return SqlFeatureEligibilityServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to verify the eligibility of an instance for a given operation.
+   * 
+ */ + public interface AsyncService {} + + /** + * Base class for the server implementation of the service SqlFeatureEligibilityService. + * + *
+   * Service to verify the eligibility of an instance for a given operation.
+   * 
+ */ + public abstract static class SqlFeatureEligibilityServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlFeatureEligibilityServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlFeatureEligibilityService. + * + *
+   * Service to verify the eligibility of an instance for a given operation.
+   * 
+ */ + public static final class SqlFeatureEligibilityServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlFeatureEligibilityServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlFeatureEligibilityServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFeatureEligibilityServiceStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlFeatureEligibilityService. + * + *
+   * Service to verify the eligibility of an instance for a given operation.
+   * 
+ */ + public static final class SqlFeatureEligibilityServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlFeatureEligibilityServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlFeatureEligibilityServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFeatureEligibilityServiceBlockingV2Stub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service + * SqlFeatureEligibilityService. + * + *
+   * Service to verify the eligibility of an instance for a given operation.
+   * 
+ */ + public static final class SqlFeatureEligibilityServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlFeatureEligibilityServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlFeatureEligibilityServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFeatureEligibilityServiceBlockingStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * SqlFeatureEligibilityService. + * + *
+   * Service to verify the eligibility of an instance for a given operation.
+   * 
+ */ + public static final class SqlFeatureEligibilityServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlFeatureEligibilityServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlFeatureEligibilityServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFeatureEligibilityServiceFutureStub(channel, callOptions); + } + } + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()).build(); + } + + private abstract static class SqlFeatureEligibilityServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlFeatureEligibilityServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlFeatureEligibilityProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlFeatureEligibilityService"); + } + } + + private static final class SqlFeatureEligibilityServiceFileDescriptorSupplier + extends SqlFeatureEligibilityServiceBaseDescriptorSupplier { + SqlFeatureEligibilityServiceFileDescriptorSupplier() {} + } + + private static final class SqlFeatureEligibilityServiceMethodDescriptorSupplier + extends SqlFeatureEligibilityServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlFeatureEligibilityServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlFeatureEligibilityServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlFeatureEligibilityServiceFileDescriptorSupplier()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagsServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagsServiceGrpc.java new file mode 100644 index 000000000000..24011155be7b --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagsServiceGrpc.java @@ -0,0 +1,410 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to manage database flags for Cloud SQL instances.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlFlagsServiceGrpc { + + private SqlFlagsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1.SqlFlagsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlFlagsListRequest, com.google.cloud.sql.v1.FlagsListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1.SqlFlagsListRequest.class, + responseType = com.google.cloud.sql.v1.FlagsListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlFlagsListRequest, com.google.cloud.sql.v1.FlagsListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlFlagsListRequest, com.google.cloud.sql.v1.FlagsListResponse> + getListMethod; + if ((getListMethod = SqlFlagsServiceGrpc.getListMethod) == null) { + synchronized (SqlFlagsServiceGrpc.class) { + if ((getListMethod = SqlFlagsServiceGrpc.getListMethod) == null) { + SqlFlagsServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlFlagsListRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.FlagsListResponse.getDefaultInstance())) + .setSchemaDescriptor(new SqlFlagsServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlFlagsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlFlagsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceStub(channel, callOptions); + } + }; + return SqlFlagsServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlFlagsServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlFlagsServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlFlagsServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlFlagsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlFlagsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceBlockingStub(channel, callOptions); + } + }; + return SqlFlagsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlFlagsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlFlagsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceFutureStub(channel, callOptions); + } + }; + return SqlFlagsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to manage database flags for Cloud SQL instances.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists all available database flags for Cloud SQL instances.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1.SqlFlagsListRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SqlFlagsService. + * + *
+   * Service to manage database flags for Cloud SQL instances.
+   * 
+ */ + public abstract static class SqlFlagsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlFlagsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlFlagsService. + * + *
+   * Service to manage database flags for Cloud SQL instances.
+   * 
+ */ + public static final class SqlFlagsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlFlagsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlFlagsServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available database flags for Cloud SQL instances.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1.SqlFlagsListRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlFlagsService. + * + *
+   * Service to manage database flags for Cloud SQL instances.
+   * 
+ */ + public static final class SqlFlagsServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlFlagsServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlFlagsServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available database flags for Cloud SQL instances.
+     * 
+ */ + public com.google.cloud.sql.v1.FlagsListResponse list( + com.google.cloud.sql.v1.SqlFlagsListRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlFlagsService. + * + *
+   * Service to manage database flags for Cloud SQL instances.
+   * 
+ */ + public static final class SqlFlagsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlFlagsServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlFlagsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available database flags for Cloud SQL instances.
+     * 
+ */ + public com.google.cloud.sql.v1.FlagsListResponse list( + com.google.cloud.sql.v1.SqlFlagsListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlFlagsService. + * + *
+   * Service to manage database flags for Cloud SQL instances.
+   * 
+ */ + public static final class SqlFlagsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlFlagsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlFlagsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available database flags for Cloud SQL instances.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.FlagsListResponse> + list(com.google.cloud.sql.v1.SqlFlagsListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1.SqlFlagsListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlFlagsListRequest, + com.google.cloud.sql.v1.FlagsListResponse>(service, METHODID_LIST))) + .build(); + } + + private abstract static class SqlFlagsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlFlagsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlFlagsService"); + } + } + + private static final class SqlFlagsServiceFileDescriptorSupplier + extends SqlFlagsServiceBaseDescriptorSupplier { + SqlFlagsServiceFileDescriptorSupplier() {} + } + + private static final class SqlFlagsServiceMethodDescriptorSupplier + extends SqlFlagsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlFlagsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlFlagsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlFlagsServiceFileDescriptorSupplier()) + .addMethod(getListMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlIamPoliciesServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlIamPoliciesServiceGrpc.java new file mode 100644 index 000000000000..4bc3495b47e2 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlIamPoliciesServiceGrpc.java @@ -0,0 +1,288 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + + +/** + * + * + *
+ * Service for providing IAM Meta APIs for Cloud SQL.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlIamPoliciesServiceGrpc { + + private SqlIamPoliciesServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1.SqlIamPoliciesService"; + + // Static method descriptors that strictly reflect the proto. + /** Creates a new async stub that supports all call types for the service */ + public static SqlIamPoliciesServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlIamPoliciesServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceStub(channel, callOptions); + } + }; + return SqlIamPoliciesServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlIamPoliciesServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlIamPoliciesServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlIamPoliciesServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlIamPoliciesServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlIamPoliciesServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceBlockingStub(channel, callOptions); + } + }; + return SqlIamPoliciesServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlIamPoliciesServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlIamPoliciesServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceFutureStub(channel, callOptions); + } + }; + return SqlIamPoliciesServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for providing IAM Meta APIs for Cloud SQL.
+   * 
+ */ + public interface AsyncService {} + + /** + * Base class for the server implementation of the service SqlIamPoliciesService. + * + *
+   * Service for providing IAM Meta APIs for Cloud SQL.
+   * 
+ */ + public abstract static class SqlIamPoliciesServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlIamPoliciesServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlIamPoliciesService. + * + *
+   * Service for providing IAM Meta APIs for Cloud SQL.
+   * 
+ */ + public static final class SqlIamPoliciesServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlIamPoliciesServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlIamPoliciesServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlIamPoliciesService. + * + *
+   * Service for providing IAM Meta APIs for Cloud SQL.
+   * 
+ */ + public static final class SqlIamPoliciesServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlIamPoliciesServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlIamPoliciesServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceBlockingV2Stub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlIamPoliciesService. + * + *
+   * Service for providing IAM Meta APIs for Cloud SQL.
+   * 
+ */ + public static final class SqlIamPoliciesServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlIamPoliciesServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlIamPoliciesServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceBlockingStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * SqlIamPoliciesService. + * + *
+   * Service for providing IAM Meta APIs for Cloud SQL.
+   * 
+ */ + public static final class SqlIamPoliciesServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlIamPoliciesServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlIamPoliciesServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceFutureStub(channel, callOptions); + } + } + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()).build(); + } + + private abstract static class SqlIamPoliciesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlIamPoliciesServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlIamPoliciesProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlIamPoliciesService"); + } + } + + private static final class SqlIamPoliciesServiceFileDescriptorSupplier + extends SqlIamPoliciesServiceBaseDescriptorSupplier { + SqlIamPoliciesServiceFileDescriptorSupplier() {} + } + + private static final class SqlIamPoliciesServiceMethodDescriptorSupplier + extends SqlIamPoliciesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlIamPoliciesServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlIamPoliciesServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlIamPoliciesServiceFileDescriptorSupplier()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstanceNamesServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstanceNamesServiceGrpc.java new file mode 100644 index 000000000000..540f4ecffd4a --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstanceNamesServiceGrpc.java @@ -0,0 +1,288 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + + +/** + * + * + *
+ * Cloud SQL instance names service.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlInstanceNamesServiceGrpc { + + private SqlInstanceNamesServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1.SqlInstanceNamesService"; + + // Static method descriptors that strictly reflect the proto. + /** Creates a new async stub that supports all call types for the service */ + public static SqlInstanceNamesServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlInstanceNamesServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstanceNamesServiceStub(channel, callOptions); + } + }; + return SqlInstanceNamesServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlInstanceNamesServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlInstanceNamesServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstanceNamesServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlInstanceNamesServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlInstanceNamesServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlInstanceNamesServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstanceNamesServiceBlockingStub(channel, callOptions); + } + }; + return SqlInstanceNamesServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlInstanceNamesServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlInstanceNamesServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstanceNamesServiceFutureStub(channel, callOptions); + } + }; + return SqlInstanceNamesServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Cloud SQL instance names service.
+   * 
+ */ + public interface AsyncService {} + + /** + * Base class for the server implementation of the service SqlInstanceNamesService. + * + *
+   * Cloud SQL instance names service.
+   * 
+ */ + public abstract static class SqlInstanceNamesServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlInstanceNamesServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlInstanceNamesService. + * + *
+   * Cloud SQL instance names service.
+   * 
+ */ + public static final class SqlInstanceNamesServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlInstanceNamesServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlInstanceNamesServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstanceNamesServiceStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlInstanceNamesService. + * + *
+   * Cloud SQL instance names service.
+   * 
+ */ + public static final class SqlInstanceNamesServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlInstanceNamesServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlInstanceNamesServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstanceNamesServiceBlockingV2Stub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlInstanceNamesService. + * + *
+   * Cloud SQL instance names service.
+   * 
+ */ + public static final class SqlInstanceNamesServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlInstanceNamesServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlInstanceNamesServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstanceNamesServiceBlockingStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * SqlInstanceNamesService. + * + *
+   * Cloud SQL instance names service.
+   * 
+ */ + public static final class SqlInstanceNamesServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlInstanceNamesServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlInstanceNamesServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstanceNamesServiceFutureStub(channel, callOptions); + } + } + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()).build(); + } + + private abstract static class SqlInstanceNamesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlInstanceNamesServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlInstanceNamesServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlInstanceNamesService"); + } + } + + private static final class SqlInstanceNamesServiceFileDescriptorSupplier + extends SqlInstanceNamesServiceBaseDescriptorSupplier { + SqlInstanceNamesServiceFileDescriptorSupplier() {} + } + + private static final class SqlInstanceNamesServiceMethodDescriptorSupplier + extends SqlInstanceNamesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlInstanceNamesServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlInstanceNamesServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlInstanceNamesServiceFileDescriptorSupplier()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesServiceGrpc.java new file mode 100644 index 000000000000..56db01fb44e1 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesServiceGrpc.java @@ -0,0 +1,6121 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlInstancesServiceGrpc { + + private SqlInstancesServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1.SqlInstancesService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest, com.google.cloud.sql.v1.Operation> + getAddServerCaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddServerCa", + requestType = com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest, com.google.cloud.sql.v1.Operation> + getAddServerCaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest, + com.google.cloud.sql.v1.Operation> + getAddServerCaMethod; + if ((getAddServerCaMethod = SqlInstancesServiceGrpc.getAddServerCaMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getAddServerCaMethod = SqlInstancesServiceGrpc.getAddServerCaMethod) == null) { + SqlInstancesServiceGrpc.getAddServerCaMethod = + getAddServerCaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AddServerCa")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("AddServerCa")) + .build(); + } + } + } + return getAddServerCaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest, + com.google.cloud.sql.v1.Operation> + getAddServerCertificateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddServerCertificate", + requestType = com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest, + com.google.cloud.sql.v1.Operation> + getAddServerCertificateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest, + com.google.cloud.sql.v1.Operation> + getAddServerCertificateMethod; + if ((getAddServerCertificateMethod = SqlInstancesServiceGrpc.getAddServerCertificateMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getAddServerCertificateMethod = SqlInstancesServiceGrpc.getAddServerCertificateMethod) + == null) { + SqlInstancesServiceGrpc.getAddServerCertificateMethod = + getAddServerCertificateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AddServerCertificate")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("AddServerCertificate")) + .build(); + } + } + } + return getAddServerCertificateMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest, + com.google.cloud.sql.v1.Operation> + getAddEntraIdCertificateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddEntraIdCertificate", + requestType = com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest, + com.google.cloud.sql.v1.Operation> + getAddEntraIdCertificateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest, + com.google.cloud.sql.v1.Operation> + getAddEntraIdCertificateMethod; + if ((getAddEntraIdCertificateMethod = SqlInstancesServiceGrpc.getAddEntraIdCertificateMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getAddEntraIdCertificateMethod = + SqlInstancesServiceGrpc.getAddEntraIdCertificateMethod) + == null) { + SqlInstancesServiceGrpc.getAddEntraIdCertificateMethod = + getAddEntraIdCertificateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AddEntraIdCertificate")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("AddEntraIdCertificate")) + .build(); + } + } + } + return getAddEntraIdCertificateMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesCloneRequest, com.google.cloud.sql.v1.Operation> + getCloneMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Clone", + requestType = com.google.cloud.sql.v1.SqlInstancesCloneRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesCloneRequest, com.google.cloud.sql.v1.Operation> + getCloneMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesCloneRequest, com.google.cloud.sql.v1.Operation> + getCloneMethod; + if ((getCloneMethod = SqlInstancesServiceGrpc.getCloneMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getCloneMethod = SqlInstancesServiceGrpc.getCloneMethod) == null) { + SqlInstancesServiceGrpc.getCloneMethod = + getCloneMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Clone")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesCloneRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlInstancesServiceMethodDescriptorSupplier("Clone")) + .build(); + } + } + } + return getCloneMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Delete", + requestType = com.google.cloud.sql.v1.SqlInstancesDeleteRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod; + if ((getDeleteMethod = SqlInstancesServiceGrpc.getDeleteMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getDeleteMethod = SqlInstancesServiceGrpc.getDeleteMethod) == null) { + SqlInstancesServiceGrpc.getDeleteMethod = + getDeleteMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Delete")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesDeleteRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Delete")) + .build(); + } + } + } + return getDeleteMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest, + com.google.cloud.sql.v1.Operation> + getDemoteMasterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DemoteMaster", + requestType = com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest, + com.google.cloud.sql.v1.Operation> + getDemoteMasterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest, + com.google.cloud.sql.v1.Operation> + getDemoteMasterMethod; + if ((getDemoteMasterMethod = SqlInstancesServiceGrpc.getDemoteMasterMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getDemoteMasterMethod = SqlInstancesServiceGrpc.getDemoteMasterMethod) == null) { + SqlInstancesServiceGrpc.getDemoteMasterMethod = + getDemoteMasterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DemoteMaster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("DemoteMaster")) + .build(); + } + } + } + return getDemoteMasterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesDemoteRequest, com.google.cloud.sql.v1.Operation> + getDemoteMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Demote", + requestType = com.google.cloud.sql.v1.SqlInstancesDemoteRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesDemoteRequest, com.google.cloud.sql.v1.Operation> + getDemoteMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesDemoteRequest, com.google.cloud.sql.v1.Operation> + getDemoteMethod; + if ((getDemoteMethod = SqlInstancesServiceGrpc.getDemoteMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getDemoteMethod = SqlInstancesServiceGrpc.getDemoteMethod) == null) { + SqlInstancesServiceGrpc.getDemoteMethod = + getDemoteMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Demote")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesDemoteRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Demote")) + .build(); + } + } + } + return getDemoteMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesExportRequest, com.google.cloud.sql.v1.Operation> + getExportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Export", + requestType = com.google.cloud.sql.v1.SqlInstancesExportRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesExportRequest, com.google.cloud.sql.v1.Operation> + getExportMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesExportRequest, com.google.cloud.sql.v1.Operation> + getExportMethod; + if ((getExportMethod = SqlInstancesServiceGrpc.getExportMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getExportMethod = SqlInstancesServiceGrpc.getExportMethod) == null) { + SqlInstancesServiceGrpc.getExportMethod = + getExportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Export")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesExportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Export")) + .build(); + } + } + } + return getExportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesFailoverRequest, com.google.cloud.sql.v1.Operation> + getFailoverMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Failover", + requestType = com.google.cloud.sql.v1.SqlInstancesFailoverRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesFailoverRequest, com.google.cloud.sql.v1.Operation> + getFailoverMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesFailoverRequest, com.google.cloud.sql.v1.Operation> + getFailoverMethod; + if ((getFailoverMethod = SqlInstancesServiceGrpc.getFailoverMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getFailoverMethod = SqlInstancesServiceGrpc.getFailoverMethod) == null) { + SqlInstancesServiceGrpc.getFailoverMethod = + getFailoverMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Failover")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesFailoverRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Failover")) + .build(); + } + } + } + return getFailoverMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesReencryptRequest, com.google.cloud.sql.v1.Operation> + getReencryptMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Reencrypt", + requestType = com.google.cloud.sql.v1.SqlInstancesReencryptRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesReencryptRequest, com.google.cloud.sql.v1.Operation> + getReencryptMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesReencryptRequest, com.google.cloud.sql.v1.Operation> + getReencryptMethod; + if ((getReencryptMethod = SqlInstancesServiceGrpc.getReencryptMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getReencryptMethod = SqlInstancesServiceGrpc.getReencryptMethod) == null) { + SqlInstancesServiceGrpc.getReencryptMethod = + getReencryptMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Reencrypt")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesReencryptRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Reencrypt")) + .build(); + } + } + } + return getReencryptMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesGetRequest, com.google.cloud.sql.v1.DatabaseInstance> + getGetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Get", + requestType = com.google.cloud.sql.v1.SqlInstancesGetRequest.class, + responseType = com.google.cloud.sql.v1.DatabaseInstance.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesGetRequest, com.google.cloud.sql.v1.DatabaseInstance> + getGetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesGetRequest, + com.google.cloud.sql.v1.DatabaseInstance> + getGetMethod; + if ((getGetMethod = SqlInstancesServiceGrpc.getGetMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getGetMethod = SqlInstancesServiceGrpc.getGetMethod) == null) { + SqlInstancesServiceGrpc.getGetMethod = + getGetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Get")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesGetRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance())) + .setSchemaDescriptor(new SqlInstancesServiceMethodDescriptorSupplier("Get")) + .build(); + } + } + } + return getGetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesImportRequest, com.google.cloud.sql.v1.Operation> + getImportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Import", + requestType = com.google.cloud.sql.v1.SqlInstancesImportRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesImportRequest, com.google.cloud.sql.v1.Operation> + getImportMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesImportRequest, com.google.cloud.sql.v1.Operation> + getImportMethod; + if ((getImportMethod = SqlInstancesServiceGrpc.getImportMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getImportMethod = SqlInstancesServiceGrpc.getImportMethod) == null) { + SqlInstancesServiceGrpc.getImportMethod = + getImportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Import")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesImportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Import")) + .build(); + } + } + } + return getImportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesInsertRequest, com.google.cloud.sql.v1.Operation> + getInsertMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Insert", + requestType = com.google.cloud.sql.v1.SqlInstancesInsertRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesInsertRequest, com.google.cloud.sql.v1.Operation> + getInsertMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesInsertRequest, com.google.cloud.sql.v1.Operation> + getInsertMethod; + if ((getInsertMethod = SqlInstancesServiceGrpc.getInsertMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getInsertMethod = SqlInstancesServiceGrpc.getInsertMethod) == null) { + SqlInstancesServiceGrpc.getInsertMethod = + getInsertMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Insert")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesInsertRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Insert")) + .build(); + } + } + } + return getInsertMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesListRequest, + com.google.cloud.sql.v1.InstancesListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1.SqlInstancesListRequest.class, + responseType = com.google.cloud.sql.v1.InstancesListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesListRequest, + com.google.cloud.sql.v1.InstancesListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesListRequest, + com.google.cloud.sql.v1.InstancesListResponse> + getListMethod; + if ((getListMethod = SqlInstancesServiceGrpc.getListMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getListMethod = SqlInstancesServiceGrpc.getListMethod) == null) { + SqlInstancesServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesListRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.InstancesListResponse.getDefaultInstance())) + .setSchemaDescriptor(new SqlInstancesServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest, + com.google.cloud.sql.v1.InstancesListServerCasResponse> + getListServerCasMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListServerCas", + requestType = com.google.cloud.sql.v1.SqlInstancesListServerCasRequest.class, + responseType = com.google.cloud.sql.v1.InstancesListServerCasResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest, + com.google.cloud.sql.v1.InstancesListServerCasResponse> + getListServerCasMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest, + com.google.cloud.sql.v1.InstancesListServerCasResponse> + getListServerCasMethod; + if ((getListServerCasMethod = SqlInstancesServiceGrpc.getListServerCasMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getListServerCasMethod = SqlInstancesServiceGrpc.getListServerCasMethod) == null) { + SqlInstancesServiceGrpc.getListServerCasMethod = + getListServerCasMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListServerCas")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.InstancesListServerCasResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("ListServerCas")) + .build(); + } + } + } + return getListServerCasMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest, + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse> + getListServerCertificatesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListServerCertificates", + requestType = com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest.class, + responseType = com.google.cloud.sql.v1.InstancesListServerCertificatesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest, + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse> + getListServerCertificatesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest, + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse> + getListServerCertificatesMethod; + if ((getListServerCertificatesMethod = SqlInstancesServiceGrpc.getListServerCertificatesMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getListServerCertificatesMethod = + SqlInstancesServiceGrpc.getListServerCertificatesMethod) + == null) { + SqlInstancesServiceGrpc.getListServerCertificatesMethod = + getListServerCertificatesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListServerCertificates")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("ListServerCertificates")) + .build(); + } + } + } + return getListServerCertificatesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest, + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse> + getListEntraIdCertificatesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListEntraIdCertificates", + requestType = com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest.class, + responseType = com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest, + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse> + getListEntraIdCertificatesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest, + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse> + getListEntraIdCertificatesMethod; + if ((getListEntraIdCertificatesMethod = + SqlInstancesServiceGrpc.getListEntraIdCertificatesMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getListEntraIdCertificatesMethod = + SqlInstancesServiceGrpc.getListEntraIdCertificatesMethod) + == null) { + SqlInstancesServiceGrpc.getListEntraIdCertificatesMethod = + getListEntraIdCertificatesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListEntraIdCertificates")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier( + "ListEntraIdCertificates")) + .build(); + } + } + } + return getListEntraIdCertificatesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPatchRequest, com.google.cloud.sql.v1.Operation> + getPatchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Patch", + requestType = com.google.cloud.sql.v1.SqlInstancesPatchRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPatchRequest, com.google.cloud.sql.v1.Operation> + getPatchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPatchRequest, com.google.cloud.sql.v1.Operation> + getPatchMethod; + if ((getPatchMethod = SqlInstancesServiceGrpc.getPatchMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getPatchMethod = SqlInstancesServiceGrpc.getPatchMethod) == null) { + SqlInstancesServiceGrpc.getPatchMethod = + getPatchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Patch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesPatchRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlInstancesServiceMethodDescriptorSupplier("Patch")) + .build(); + } + } + } + return getPatchMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest, + com.google.cloud.sql.v1.Operation> + getPromoteReplicaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PromoteReplica", + requestType = com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest, + com.google.cloud.sql.v1.Operation> + getPromoteReplicaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest, + com.google.cloud.sql.v1.Operation> + getPromoteReplicaMethod; + if ((getPromoteReplicaMethod = SqlInstancesServiceGrpc.getPromoteReplicaMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getPromoteReplicaMethod = SqlInstancesServiceGrpc.getPromoteReplicaMethod) == null) { + SqlInstancesServiceGrpc.getPromoteReplicaMethod = + getPromoteReplicaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PromoteReplica")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("PromoteReplica")) + .build(); + } + } + } + return getPromoteReplicaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest, com.google.cloud.sql.v1.Operation> + getSwitchoverMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Switchover", + requestType = com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest, com.google.cloud.sql.v1.Operation> + getSwitchoverMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest, + com.google.cloud.sql.v1.Operation> + getSwitchoverMethod; + if ((getSwitchoverMethod = SqlInstancesServiceGrpc.getSwitchoverMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getSwitchoverMethod = SqlInstancesServiceGrpc.getSwitchoverMethod) == null) { + SqlInstancesServiceGrpc.getSwitchoverMethod = + getSwitchoverMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Switchover")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Switchover")) + .build(); + } + } + } + return getSwitchoverMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest, + com.google.cloud.sql.v1.Operation> + getResetSslConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ResetSslConfig", + requestType = com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest, + com.google.cloud.sql.v1.Operation> + getResetSslConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest, + com.google.cloud.sql.v1.Operation> + getResetSslConfigMethod; + if ((getResetSslConfigMethod = SqlInstancesServiceGrpc.getResetSslConfigMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getResetSslConfigMethod = SqlInstancesServiceGrpc.getResetSslConfigMethod) == null) { + SqlInstancesServiceGrpc.getResetSslConfigMethod = + getResetSslConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ResetSslConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("ResetSslConfig")) + .build(); + } + } + } + return getResetSslConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRestartRequest, com.google.cloud.sql.v1.Operation> + getRestartMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Restart", + requestType = com.google.cloud.sql.v1.SqlInstancesRestartRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRestartRequest, com.google.cloud.sql.v1.Operation> + getRestartMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRestartRequest, com.google.cloud.sql.v1.Operation> + getRestartMethod; + if ((getRestartMethod = SqlInstancesServiceGrpc.getRestartMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getRestartMethod = SqlInstancesServiceGrpc.getRestartMethod) == null) { + SqlInstancesServiceGrpc.getRestartMethod = + getRestartMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Restart")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesRestartRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Restart")) + .build(); + } + } + } + return getRestartMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest, + com.google.cloud.sql.v1.Operation> + getRestoreBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RestoreBackup", + requestType = com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest, + com.google.cloud.sql.v1.Operation> + getRestoreBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest, + com.google.cloud.sql.v1.Operation> + getRestoreBackupMethod; + if ((getRestoreBackupMethod = SqlInstancesServiceGrpc.getRestoreBackupMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getRestoreBackupMethod = SqlInstancesServiceGrpc.getRestoreBackupMethod) == null) { + SqlInstancesServiceGrpc.getRestoreBackupMethod = + getRestoreBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RestoreBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("RestoreBackup")) + .build(); + } + } + } + return getRestoreBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest, + com.google.cloud.sql.v1.Operation> + getRotateServerCaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RotateServerCa", + requestType = com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest, + com.google.cloud.sql.v1.Operation> + getRotateServerCaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest, + com.google.cloud.sql.v1.Operation> + getRotateServerCaMethod; + if ((getRotateServerCaMethod = SqlInstancesServiceGrpc.getRotateServerCaMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getRotateServerCaMethod = SqlInstancesServiceGrpc.getRotateServerCaMethod) == null) { + SqlInstancesServiceGrpc.getRotateServerCaMethod = + getRotateServerCaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RotateServerCa")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("RotateServerCa")) + .build(); + } + } + } + return getRotateServerCaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest, + com.google.cloud.sql.v1.Operation> + getRotateServerCertificateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RotateServerCertificate", + requestType = com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest, + com.google.cloud.sql.v1.Operation> + getRotateServerCertificateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest, + com.google.cloud.sql.v1.Operation> + getRotateServerCertificateMethod; + if ((getRotateServerCertificateMethod = + SqlInstancesServiceGrpc.getRotateServerCertificateMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getRotateServerCertificateMethod = + SqlInstancesServiceGrpc.getRotateServerCertificateMethod) + == null) { + SqlInstancesServiceGrpc.getRotateServerCertificateMethod = + getRotateServerCertificateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RotateServerCertificate")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier( + "RotateServerCertificate")) + .build(); + } + } + } + return getRotateServerCertificateMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest, + com.google.cloud.sql.v1.Operation> + getRotateEntraIdCertificateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RotateEntraIdCertificate", + requestType = com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest, + com.google.cloud.sql.v1.Operation> + getRotateEntraIdCertificateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest, + com.google.cloud.sql.v1.Operation> + getRotateEntraIdCertificateMethod; + if ((getRotateEntraIdCertificateMethod = + SqlInstancesServiceGrpc.getRotateEntraIdCertificateMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getRotateEntraIdCertificateMethod = + SqlInstancesServiceGrpc.getRotateEntraIdCertificateMethod) + == null) { + SqlInstancesServiceGrpc.getRotateEntraIdCertificateMethod = + getRotateEntraIdCertificateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RotateEntraIdCertificate")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier( + "RotateEntraIdCertificate")) + .build(); + } + } + } + return getRotateEntraIdCertificateMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest, + com.google.cloud.sql.v1.Operation> + getStartReplicaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StartReplica", + requestType = com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest, + com.google.cloud.sql.v1.Operation> + getStartReplicaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest, + com.google.cloud.sql.v1.Operation> + getStartReplicaMethod; + if ((getStartReplicaMethod = SqlInstancesServiceGrpc.getStartReplicaMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getStartReplicaMethod = SqlInstancesServiceGrpc.getStartReplicaMethod) == null) { + SqlInstancesServiceGrpc.getStartReplicaMethod = + getStartReplicaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StartReplica")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("StartReplica")) + .build(); + } + } + } + return getStartReplicaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest, com.google.cloud.sql.v1.Operation> + getStopReplicaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StopReplica", + requestType = com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest, com.google.cloud.sql.v1.Operation> + getStopReplicaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest, + com.google.cloud.sql.v1.Operation> + getStopReplicaMethod; + if ((getStopReplicaMethod = SqlInstancesServiceGrpc.getStopReplicaMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getStopReplicaMethod = SqlInstancesServiceGrpc.getStopReplicaMethod) == null) { + SqlInstancesServiceGrpc.getStopReplicaMethod = + getStopReplicaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StopReplica")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("StopReplica")) + .build(); + } + } + } + return getStopReplicaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest, com.google.cloud.sql.v1.Operation> + getTruncateLogMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TruncateLog", + requestType = com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest, com.google.cloud.sql.v1.Operation> + getTruncateLogMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest, + com.google.cloud.sql.v1.Operation> + getTruncateLogMethod; + if ((getTruncateLogMethod = SqlInstancesServiceGrpc.getTruncateLogMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getTruncateLogMethod = SqlInstancesServiceGrpc.getTruncateLogMethod) == null) { + SqlInstancesServiceGrpc.getTruncateLogMethod = + getTruncateLogMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TruncateLog")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("TruncateLog")) + .build(); + } + } + } + return getTruncateLogMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesUpdateRequest, com.google.cloud.sql.v1.Operation> + getUpdateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Update", + requestType = com.google.cloud.sql.v1.SqlInstancesUpdateRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesUpdateRequest, com.google.cloud.sql.v1.Operation> + getUpdateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesUpdateRequest, com.google.cloud.sql.v1.Operation> + getUpdateMethod; + if ((getUpdateMethod = SqlInstancesServiceGrpc.getUpdateMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getUpdateMethod = SqlInstancesServiceGrpc.getUpdateMethod) == null) { + SqlInstancesServiceGrpc.getUpdateMethod = + getUpdateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Update")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesUpdateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Update")) + .build(); + } + } + } + return getUpdateMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest, + com.google.cloud.sql.v1.SslCert> + getCreateEphemeralMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateEphemeral", + requestType = com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest.class, + responseType = com.google.cloud.sql.v1.SslCert.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest, + com.google.cloud.sql.v1.SslCert> + getCreateEphemeralMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest, + com.google.cloud.sql.v1.SslCert> + getCreateEphemeralMethod; + if ((getCreateEphemeralMethod = SqlInstancesServiceGrpc.getCreateEphemeralMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getCreateEphemeralMethod = SqlInstancesServiceGrpc.getCreateEphemeralMethod) == null) { + SqlInstancesServiceGrpc.getCreateEphemeralMethod = + getCreateEphemeralMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateEphemeral")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SslCert.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("CreateEphemeral")) + .build(); + } + } + } + return getCreateEphemeralMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest, + com.google.cloud.sql.v1.Operation> + getRescheduleMaintenanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RescheduleMaintenance", + requestType = com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest, + com.google.cloud.sql.v1.Operation> + getRescheduleMaintenanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest, + com.google.cloud.sql.v1.Operation> + getRescheduleMaintenanceMethod; + if ((getRescheduleMaintenanceMethod = SqlInstancesServiceGrpc.getRescheduleMaintenanceMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getRescheduleMaintenanceMethod = + SqlInstancesServiceGrpc.getRescheduleMaintenanceMethod) + == null) { + SqlInstancesServiceGrpc.getRescheduleMaintenanceMethod = + getRescheduleMaintenanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RescheduleMaintenance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("RescheduleMaintenance")) + .build(); + } + } + } + return getRescheduleMaintenanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest, + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse> + getVerifyExternalSyncSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "VerifyExternalSyncSettings", + requestType = com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.class, + responseType = com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest, + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse> + getVerifyExternalSyncSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest, + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse> + getVerifyExternalSyncSettingsMethod; + if ((getVerifyExternalSyncSettingsMethod = + SqlInstancesServiceGrpc.getVerifyExternalSyncSettingsMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getVerifyExternalSyncSettingsMethod = + SqlInstancesServiceGrpc.getVerifyExternalSyncSettingsMethod) + == null) { + SqlInstancesServiceGrpc.getVerifyExternalSyncSettingsMethod = + getVerifyExternalSyncSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "VerifyExternalSyncSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier( + "VerifyExternalSyncSettings")) + .build(); + } + } + } + return getVerifyExternalSyncSettingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest, + com.google.cloud.sql.v1.Operation> + getStartExternalSyncMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StartExternalSync", + requestType = com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest, + com.google.cloud.sql.v1.Operation> + getStartExternalSyncMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest, + com.google.cloud.sql.v1.Operation> + getStartExternalSyncMethod; + if ((getStartExternalSyncMethod = SqlInstancesServiceGrpc.getStartExternalSyncMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getStartExternalSyncMethod = SqlInstancesServiceGrpc.getStartExternalSyncMethod) + == null) { + SqlInstancesServiceGrpc.getStartExternalSyncMethod = + getStartExternalSyncMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StartExternalSync")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("StartExternalSync")) + .build(); + } + } + } + return getStartExternalSyncMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest, + com.google.cloud.sql.v1.Operation> + getPerformDiskShrinkMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PerformDiskShrink", + requestType = com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest, + com.google.cloud.sql.v1.Operation> + getPerformDiskShrinkMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest, + com.google.cloud.sql.v1.Operation> + getPerformDiskShrinkMethod; + if ((getPerformDiskShrinkMethod = SqlInstancesServiceGrpc.getPerformDiskShrinkMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getPerformDiskShrinkMethod = SqlInstancesServiceGrpc.getPerformDiskShrinkMethod) + == null) { + SqlInstancesServiceGrpc.getPerformDiskShrinkMethod = + getPerformDiskShrinkMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PerformDiskShrink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("PerformDiskShrink")) + .build(); + } + } + } + return getPerformDiskShrinkMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest, + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse> + getGetDiskShrinkConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDiskShrinkConfig", + requestType = com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest.class, + responseType = com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest, + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse> + getGetDiskShrinkConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest, + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse> + getGetDiskShrinkConfigMethod; + if ((getGetDiskShrinkConfigMethod = SqlInstancesServiceGrpc.getGetDiskShrinkConfigMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getGetDiskShrinkConfigMethod = SqlInstancesServiceGrpc.getGetDiskShrinkConfigMethod) + == null) { + SqlInstancesServiceGrpc.getGetDiskShrinkConfigMethod = + getGetDiskShrinkConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetDiskShrinkConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("GetDiskShrinkConfig")) + .build(); + } + } + } + return getGetDiskShrinkConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest, + com.google.cloud.sql.v1.Operation> + getResetReplicaSizeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ResetReplicaSize", + requestType = com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest, + com.google.cloud.sql.v1.Operation> + getResetReplicaSizeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest, + com.google.cloud.sql.v1.Operation> + getResetReplicaSizeMethod; + if ((getResetReplicaSizeMethod = SqlInstancesServiceGrpc.getResetReplicaSizeMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getResetReplicaSizeMethod = SqlInstancesServiceGrpc.getResetReplicaSizeMethod) + == null) { + SqlInstancesServiceGrpc.getResetReplicaSizeMethod = + getResetReplicaSizeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ResetReplicaSize")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("ResetReplicaSize")) + .build(); + } + } + } + return getResetReplicaSizeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest, + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse> + getGetLatestRecoveryTimeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetLatestRecoveryTime", + requestType = com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest.class, + responseType = com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest, + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse> + getGetLatestRecoveryTimeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest, + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse> + getGetLatestRecoveryTimeMethod; + if ((getGetLatestRecoveryTimeMethod = SqlInstancesServiceGrpc.getGetLatestRecoveryTimeMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getGetLatestRecoveryTimeMethod = + SqlInstancesServiceGrpc.getGetLatestRecoveryTimeMethod) + == null) { + SqlInstancesServiceGrpc.getGetLatestRecoveryTimeMethod = + getGetLatestRecoveryTimeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetLatestRecoveryTime")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("GetLatestRecoveryTime")) + .build(); + } + } + } + return getGetLatestRecoveryTimeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse> + getExecuteSqlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ExecuteSql", + requestType = com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest.class, + responseType = com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse> + getExecuteSqlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse> + getExecuteSqlMethod; + if ((getExecuteSqlMethod = SqlInstancesServiceGrpc.getExecuteSqlMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getExecuteSqlMethod = SqlInstancesServiceGrpc.getExecuteSqlMethod) == null) { + SqlInstancesServiceGrpc.getExecuteSqlMethod = + getExecuteSqlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ExecuteSql")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("ExecuteSql")) + .build(); + } + } + } + return getExecuteSqlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest, + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse> + getAcquireSsrsLeaseMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AcquireSsrsLease", + requestType = com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest.class, + responseType = com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest, + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse> + getAcquireSsrsLeaseMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest, + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse> + getAcquireSsrsLeaseMethod; + if ((getAcquireSsrsLeaseMethod = SqlInstancesServiceGrpc.getAcquireSsrsLeaseMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getAcquireSsrsLeaseMethod = SqlInstancesServiceGrpc.getAcquireSsrsLeaseMethod) + == null) { + SqlInstancesServiceGrpc.getAcquireSsrsLeaseMethod = + getAcquireSsrsLeaseMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AcquireSsrsLease")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("AcquireSsrsLease")) + .build(); + } + } + } + return getAcquireSsrsLeaseMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest, + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse> + getReleaseSsrsLeaseMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReleaseSsrsLease", + requestType = com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest.class, + responseType = com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest, + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse> + getReleaseSsrsLeaseMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest, + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse> + getReleaseSsrsLeaseMethod; + if ((getReleaseSsrsLeaseMethod = SqlInstancesServiceGrpc.getReleaseSsrsLeaseMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getReleaseSsrsLeaseMethod = SqlInstancesServiceGrpc.getReleaseSsrsLeaseMethod) + == null) { + SqlInstancesServiceGrpc.getReleaseSsrsLeaseMethod = + getReleaseSsrsLeaseMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReleaseSsrsLease")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("ReleaseSsrsLease")) + .build(); + } + } + } + return getReleaseSsrsLeaseMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest, + com.google.cloud.sql.v1.Operation> + getPreCheckMajorVersionUpgradeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PreCheckMajorVersionUpgrade", + requestType = com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest, + com.google.cloud.sql.v1.Operation> + getPreCheckMajorVersionUpgradeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest, + com.google.cloud.sql.v1.Operation> + getPreCheckMajorVersionUpgradeMethod; + if ((getPreCheckMajorVersionUpgradeMethod = + SqlInstancesServiceGrpc.getPreCheckMajorVersionUpgradeMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getPreCheckMajorVersionUpgradeMethod = + SqlInstancesServiceGrpc.getPreCheckMajorVersionUpgradeMethod) + == null) { + SqlInstancesServiceGrpc.getPreCheckMajorVersionUpgradeMethod = + getPreCheckMajorVersionUpgradeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "PreCheckMajorVersionUpgrade")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier( + "PreCheckMajorVersionUpgrade")) + .build(); + } + } + } + return getPreCheckMajorVersionUpgradeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest, + com.google.cloud.sql.v1.Operation> + getPointInTimeRestoreMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PointInTimeRestore", + requestType = com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest, + com.google.cloud.sql.v1.Operation> + getPointInTimeRestoreMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest, + com.google.cloud.sql.v1.Operation> + getPointInTimeRestoreMethod; + if ((getPointInTimeRestoreMethod = SqlInstancesServiceGrpc.getPointInTimeRestoreMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getPointInTimeRestoreMethod = SqlInstancesServiceGrpc.getPointInTimeRestoreMethod) + == null) { + SqlInstancesServiceGrpc.getPointInTimeRestoreMethod = + getPointInTimeRestoreMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PointInTimeRestore")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("PointInTimeRestore")) + .build(); + } + } + } + return getPointInTimeRestoreMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlInstancesServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlInstancesServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceStub(channel, callOptions); + } + }; + return SqlInstancesServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlInstancesServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlInstancesServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlInstancesServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlInstancesServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlInstancesServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceBlockingStub(channel, callOptions); + } + }; + return SqlInstancesServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlInstancesServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlInstancesServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceFutureStub(channel, callOptions); + } + }; + return SqlInstancesServiceFutureStub.newStub(factory, channel); + } + + /** */ + public interface AsyncService { + + /** + * + * + *
+     * Adds a new trusted Certificate Authority (CA) version for the specified
+     * instance. Required to prepare for a certificate rotation. If a CA version
+     * was previously added but never used in a certificate rotation, this
+     * operation replaces that version. There cannot be more than one CA version
+     * waiting to be rotated in. For instances that have enabled Certificate
+     * Authority Service (CAS) based server CA, use AddServerCertificate to add a
+     * new server certificate.
+     * 
+ */ + default void addServerCa( + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddServerCaMethod(), responseObserver); + } + + /** + * + * + *
+     * Add a new trusted server certificate version for the specified instance
+     * using Certificate Authority Service (CAS) server CA. Required to prepare
+     * for a certificate rotation. If a server certificate version was previously
+     * added but never used in a certificate rotation, this operation replaces
+     * that version. There cannot be more than one certificate version waiting to
+     * be rotated in. For instances not using CAS server CA, use AddServerCa
+     * instead.
+     * 
+ */ + default void addServerCertificate( + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddServerCertificateMethod(), responseObserver); + } + + /** + * + * + *
+     * Adds a new Entra ID certificate for the specified instance. If an Entra ID
+     * certificate was previously added but never used in a certificate rotation,
+     * this operation replaces that version.
+     * 
+ */ + default void addEntraIdCertificate( + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddEntraIdCertificateMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a Cloud SQL instance as a clone of the source instance. Using this
+     * operation might cause your instance to restart.
+     * 
+ */ + default void clone( + com.google.cloud.sql.v1.SqlInstancesCloneRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCloneMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a Cloud SQL instance.
+     * 
+ */ + default void delete( + com.google.cloud.sql.v1.SqlInstancesDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteMethod(), responseObserver); + } + + /** + * + * + *
+     * Demotes the stand-alone instance to be a Cloud SQL read replica for an
+     * external database server.
+     * 
+ */ + default void demoteMaster( + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDemoteMasterMethod(), responseObserver); + } + + /** + * + * + *
+     * Demotes an existing standalone instance to be a Cloud SQL read replica
+     * for an external database server.
+     * 
+ */ + default void demote( + com.google.cloud.sql.v1.SqlInstancesDemoteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDemoteMethod(), responseObserver); + } + + /** + * + * + *
+     * Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL
+     * dump or CSV file.
+     * 
+ */ + default void export( + com.google.cloud.sql.v1.SqlInstancesExportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExportMethod(), responseObserver); + } + + /** + * + * + *
+     * Initiates a manual failover of a high availability (HA) primary instance
+     * to a standby instance, which becomes the primary instance. Users are
+     * then rerouted to the new primary. For more information, see the
+     * [Overview of high
+     * availability](https://cloud.google.com/sql/docs/mysql/high-availability)
+     * page in the Cloud SQL documentation.
+     * If using Legacy HA (MySQL only), this causes the instance to failover to
+     * its failover replica instance.
+     * 
+ */ + default void failover( + com.google.cloud.sql.v1.SqlInstancesFailoverRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getFailoverMethod(), responseObserver); + } + + /** + * + * + *
+     * Reencrypt CMEK instance with latest key version.
+     * 
+ */ + default void reencrypt( + com.google.cloud.sql.v1.SqlInstancesReencryptRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReencryptMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a Cloud SQL instance.
+     * 
+ */ + default void get( + com.google.cloud.sql.v1.SqlInstancesGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver); + } + + /** + * + * + *
+     * Imports data into a Cloud SQL instance from a SQL dump  or CSV file in
+     * Cloud Storage.
+     * 
+ */ + default void import_( + com.google.cloud.sql.v1.SqlInstancesImportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getImportMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Cloud SQL instance.
+     * 
+ */ + default void insert( + com.google.cloud.sql.v1.SqlInstancesInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getInsertMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists instances under a given project.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1.SqlInstancesListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all of the trusted Certificate Authorities (CAs) for the specified
+     * instance. There can be up to three CAs listed: the CA that was used to sign
+     * the certificate that is currently in use, a CA that has been added but not
+     * yet used to sign a certificate, and a CA used to sign a certificate that
+     * has previously rotated out.
+     * 
+ */ + default void listServerCas( + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListServerCasMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all versions of server certificates and certificate authorities (CAs)
+     * for the specified instance. There can be up to three sets of certs listed:
+     * the certificate that is currently in use, a future that has been added but
+     * not yet used to sign a certificate, and a certificate that has been rotated
+     * out. For instances not using Certificate Authority Service (CAS) server CA,
+     * use ListServerCas instead.
+     * 
+ */ + default void listServerCertificates( + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListServerCertificatesMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all versions of EntraID certificates for the specified instance.
+     * There can be up to three sets of certificates listed: the certificate that
+     * is currently in use, a future that has been added but not yet used to sign
+     * a certificate, and a certificate that has been rotated out.
+     * 
+ */ + default void listEntraIdCertificates( + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListEntraIdCertificatesMethod(), responseObserver); + } + + /** + * + * + *
+     * Partially updates settings of a Cloud SQL instance by merging the request
+     * with the current configuration. This method supports patch semantics.
+     * 
+ */ + default void patch( + com.google.cloud.sql.v1.SqlInstancesPatchRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPatchMethod(), responseObserver); + } + + /** + * + * + *
+     * Promotes the read replica instance to be an independent Cloud SQL
+     * primary instance.
+     * Using this operation might cause your instance to restart.
+     * 
+ */ + default void promoteReplica( + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPromoteReplicaMethod(), responseObserver); + } + + /** + * + * + *
+     * Switches over from the primary instance to the DR replica
+     * instance.
+     * 
+ */ + default void switchover( + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSwitchoverMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes all client certificates and generates a new server SSL certificate
+     * for the instance.
+     * 
+ */ + default void resetSslConfig( + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getResetSslConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Restarts a Cloud SQL instance.
+     * 
+ */ + default void restart( + com.google.cloud.sql.v1.SqlInstancesRestartRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRestartMethod(), responseObserver); + } + + /** + * + * + *
+     * Restores a backup of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + default void restoreBackup( + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRestoreBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Rotates the server certificate to one signed by the Certificate Authority
+     * (CA) version previously added with the addServerCA method. For instances
+     * that have enabled Certificate Authority Service (CAS) based server CA,
+     * use RotateServerCertificate to rotate the server certificate.
+     * 
+ */ + default void rotateServerCa( + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRotateServerCaMethod(), responseObserver); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addServerCertificate method. For instances not using Certificate Authority
+     * Service (CAS) server CA, use RotateServerCa instead.
+     * 
+ */ + default void rotateServerCertificate( + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRotateServerCertificateMethod(), responseObserver); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addEntraIdCertificate method.
+     * 
+ */ + default void rotateEntraIdCertificate( + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRotateEntraIdCertificateMethod(), responseObserver); + } + + /** + * + * + *
+     * Starts the replication in the read replica instance.
+     * 
+ */ + default void startReplica( + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStartReplicaMethod(), responseObserver); + } + + /** + * + * + *
+     * Stops the replication in the read replica instance.
+     * 
+ */ + default void stopReplica( + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStopReplicaMethod(), responseObserver); + } + + /** + * + * + *
+     * Truncate MySQL general and slow query log tables
+     * MySQL only.
+     * 
+ */ + default void truncateLog( + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTruncateLogMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates settings of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + default void update( + com.google.cloud.sql.v1.SqlInstancesUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateMethod(), responseObserver); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + default void createEphemeral( + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateEphemeralMethod(), responseObserver); + } + + /** + * + * + *
+     * Reschedules the maintenance on the given instance.
+     * 
+ */ + default void rescheduleMaintenance( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRescheduleMaintenanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Verify External primary instance external sync settings.
+     * 
+ */ + default void verifyExternalSyncSettings( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getVerifyExternalSyncSettingsMethod(), responseObserver); + } + + /** + * + * + *
+     * Start External primary instance migration.
+     * 
+ */ + default void startExternalSync( + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStartExternalSyncMethod(), responseObserver); + } + + /** + * + * + *
+     * Perform Disk Shrink on primary instance.
+     * 
+ */ + default void performDiskShrink( + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPerformDiskShrinkMethod(), responseObserver); + } + + /** + * + * + *
+     * Get Disk Shrink Config for a given instance.
+     * 
+ */ + default void getDiskShrinkConfig( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDiskShrinkConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Reset Replica Size to primary instance disk size.
+     * 
+ */ + default void resetReplicaSize( + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getResetReplicaSizeMethod(), responseObserver); + } + + /** + * + * + *
+     * Get Latest Recovery Time for a given instance.
+     * 
+ */ + default void getLatestRecoveryTime( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetLatestRecoveryTimeMethod(), responseObserver); + } + + /** + * + * + *
+     * Execute SQL statements.
+     * 
+ */ + default void executeSql( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExecuteSqlMethod(), responseObserver); + } + + /** + * + * + *
+     * Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + default void acquireSsrsLease( + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAcquireSsrsLeaseMethod(), responseObserver); + } + + /** + * + * + *
+     * Release a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + default void releaseSsrsLease( + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReleaseSsrsLeaseMethod(), responseObserver); + } + + /** + * + * + *
+     * Execute MVU Pre-checks
+     * 
+ */ + default void preCheckMajorVersionUpgrade( + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPreCheckMajorVersionUpgradeMethod(), responseObserver); + } + + /** + * + * + *
+     * Point in time restore for an instance managed by Google Cloud Backup and
+     * Disaster Recovery.
+     * 
+ */ + default void pointInTimeRestore( + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPointInTimeRestoreMethod(), responseObserver); + } + } + + /** Base class for the server implementation of the service SqlInstancesService. */ + public abstract static class SqlInstancesServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlInstancesServiceGrpc.bindService(this); + } + } + + /** A stub to allow clients to do asynchronous rpc calls to service SqlInstancesService. */ + public static final class SqlInstancesServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlInstancesServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlInstancesServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Adds a new trusted Certificate Authority (CA) version for the specified
+     * instance. Required to prepare for a certificate rotation. If a CA version
+     * was previously added but never used in a certificate rotation, this
+     * operation replaces that version. There cannot be more than one CA version
+     * waiting to be rotated in. For instances that have enabled Certificate
+     * Authority Service (CAS) based server CA, use AddServerCertificate to add a
+     * new server certificate.
+     * 
+ */ + public void addServerCa( + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddServerCaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Add a new trusted server certificate version for the specified instance
+     * using Certificate Authority Service (CAS) server CA. Required to prepare
+     * for a certificate rotation. If a server certificate version was previously
+     * added but never used in a certificate rotation, this operation replaces
+     * that version. There cannot be more than one certificate version waiting to
+     * be rotated in. For instances not using CAS server CA, use AddServerCa
+     * instead.
+     * 
+ */ + public void addServerCertificate( + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddServerCertificateMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Adds a new Entra ID certificate for the specified instance. If an Entra ID
+     * certificate was previously added but never used in a certificate rotation,
+     * this operation replaces that version.
+     * 
+ */ + public void addEntraIdCertificate( + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddEntraIdCertificateMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a Cloud SQL instance as a clone of the source instance. Using this
+     * operation might cause your instance to restart.
+     * 
+ */ + public void clone( + com.google.cloud.sql.v1.SqlInstancesCloneRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCloneMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Deletes a Cloud SQL instance.
+     * 
+ */ + public void delete( + com.google.cloud.sql.v1.SqlInstancesDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Demotes the stand-alone instance to be a Cloud SQL read replica for an
+     * external database server.
+     * 
+ */ + public void demoteMaster( + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDemoteMasterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Demotes an existing standalone instance to be a Cloud SQL read replica
+     * for an external database server.
+     * 
+ */ + public void demote( + com.google.cloud.sql.v1.SqlInstancesDemoteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDemoteMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL
+     * dump or CSV file.
+     * 
+ */ + public void export( + com.google.cloud.sql.v1.SqlInstancesExportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getExportMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Initiates a manual failover of a high availability (HA) primary instance
+     * to a standby instance, which becomes the primary instance. Users are
+     * then rerouted to the new primary. For more information, see the
+     * [Overview of high
+     * availability](https://cloud.google.com/sql/docs/mysql/high-availability)
+     * page in the Cloud SQL documentation.
+     * If using Legacy HA (MySQL only), this causes the instance to failover to
+     * its failover replica instance.
+     * 
+ */ + public void failover( + com.google.cloud.sql.v1.SqlInstancesFailoverRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFailoverMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Reencrypt CMEK instance with latest key version.
+     * 
+ */ + public void reencrypt( + com.google.cloud.sql.v1.SqlInstancesReencryptRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReencryptMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a Cloud SQL instance.
+     * 
+ */ + public void get( + com.google.cloud.sql.v1.SqlInstancesGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Imports data into a Cloud SQL instance from a SQL dump  or CSV file in
+     * Cloud Storage.
+     * 
+ */ + public void import_( + com.google.cloud.sql.v1.SqlInstancesImportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new Cloud SQL instance.
+     * 
+ */ + public void insert( + com.google.cloud.sql.v1.SqlInstancesInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists instances under a given project.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1.SqlInstancesListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists all of the trusted Certificate Authorities (CAs) for the specified
+     * instance. There can be up to three CAs listed: the CA that was used to sign
+     * the certificate that is currently in use, a CA that has been added but not
+     * yet used to sign a certificate, and a CA used to sign a certificate that
+     * has previously rotated out.
+     * 
+ */ + public void listServerCas( + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListServerCasMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all versions of server certificates and certificate authorities (CAs)
+     * for the specified instance. There can be up to three sets of certs listed:
+     * the certificate that is currently in use, a future that has been added but
+     * not yet used to sign a certificate, and a certificate that has been rotated
+     * out. For instances not using Certificate Authority Service (CAS) server CA,
+     * use ListServerCas instead.
+     * 
+ */ + public void listServerCertificates( + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListServerCertificatesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all versions of EntraID certificates for the specified instance.
+     * There can be up to three sets of certificates listed: the certificate that
+     * is currently in use, a future that has been added but not yet used to sign
+     * a certificate, and a certificate that has been rotated out.
+     * 
+ */ + public void listEntraIdCertificates( + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListEntraIdCertificatesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Partially updates settings of a Cloud SQL instance by merging the request
+     * with the current configuration. This method supports patch semantics.
+     * 
+ */ + public void patch( + com.google.cloud.sql.v1.SqlInstancesPatchRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPatchMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Promotes the read replica instance to be an independent Cloud SQL
+     * primary instance.
+     * Using this operation might cause your instance to restart.
+     * 
+ */ + public void promoteReplica( + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPromoteReplicaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Switches over from the primary instance to the DR replica
+     * instance.
+     * 
+ */ + public void switchover( + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSwitchoverMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Deletes all client certificates and generates a new server SSL certificate
+     * for the instance.
+     * 
+ */ + public void resetSslConfig( + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getResetSslConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Restarts a Cloud SQL instance.
+     * 
+ */ + public void restart( + com.google.cloud.sql.v1.SqlInstancesRestartRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRestartMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Restores a backup of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public void restoreBackup( + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRestoreBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Rotates the server certificate to one signed by the Certificate Authority
+     * (CA) version previously added with the addServerCA method. For instances
+     * that have enabled Certificate Authority Service (CAS) based server CA,
+     * use RotateServerCertificate to rotate the server certificate.
+     * 
+ */ + public void rotateServerCa( + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRotateServerCaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addServerCertificate method. For instances not using Certificate Authority
+     * Service (CAS) server CA, use RotateServerCa instead.
+     * 
+ */ + public void rotateServerCertificate( + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRotateServerCertificateMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addEntraIdCertificate method.
+     * 
+ */ + public void rotateEntraIdCertificate( + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRotateEntraIdCertificateMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Starts the replication in the read replica instance.
+     * 
+ */ + public void startReplica( + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStartReplicaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Stops the replication in the read replica instance.
+     * 
+ */ + public void stopReplica( + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStopReplicaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Truncate MySQL general and slow query log tables
+     * MySQL only.
+     * 
+ */ + public void truncateLog( + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTruncateLogMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates settings of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public void update( + com.google.cloud.sql.v1.SqlInstancesUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public void createEphemeral( + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateEphemeralMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Reschedules the maintenance on the given instance.
+     * 
+ */ + public void rescheduleMaintenance( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRescheduleMaintenanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Verify External primary instance external sync settings.
+     * 
+ */ + public void verifyExternalSyncSettings( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getVerifyExternalSyncSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Start External primary instance migration.
+     * 
+ */ + public void startExternalSync( + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStartExternalSyncMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Perform Disk Shrink on primary instance.
+     * 
+ */ + public void performDiskShrink( + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPerformDiskShrinkMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get Disk Shrink Config for a given instance.
+     * 
+ */ + public void getDiskShrinkConfig( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDiskShrinkConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Reset Replica Size to primary instance disk size.
+     * 
+ */ + public void resetReplicaSize( + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getResetReplicaSizeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get Latest Recovery Time for a given instance.
+     * 
+ */ + public void getLatestRecoveryTime( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetLatestRecoveryTimeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Execute SQL statements.
+     * 
+ */ + public void executeSql( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getExecuteSqlMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public void acquireSsrsLease( + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAcquireSsrsLeaseMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Release a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public void releaseSsrsLease( + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReleaseSsrsLeaseMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Execute MVU Pre-checks
+     * 
+ */ + public void preCheckMajorVersionUpgrade( + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPreCheckMajorVersionUpgradeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Point in time restore for an instance managed by Google Cloud Backup and
+     * Disaster Recovery.
+     * 
+ */ + public void pointInTimeRestore( + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPointInTimeRestoreMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** A stub to allow clients to do synchronous rpc calls to service SqlInstancesService. */ + public static final class SqlInstancesServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlInstancesServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlInstancesServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Adds a new trusted Certificate Authority (CA) version for the specified
+     * instance. Required to prepare for a certificate rotation. If a CA version
+     * was previously added but never used in a certificate rotation, this
+     * operation replaces that version. There cannot be more than one CA version
+     * waiting to be rotated in. For instances that have enabled Certificate
+     * Authority Service (CAS) based server CA, use AddServerCertificate to add a
+     * new server certificate.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation addServerCa( + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getAddServerCaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Add a new trusted server certificate version for the specified instance
+     * using Certificate Authority Service (CAS) server CA. Required to prepare
+     * for a certificate rotation. If a server certificate version was previously
+     * added but never used in a certificate rotation, this operation replaces
+     * that version. There cannot be more than one certificate version waiting to
+     * be rotated in. For instances not using CAS server CA, use AddServerCa
+     * instead.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation addServerCertificate( + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getAddServerCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Adds a new Entra ID certificate for the specified instance. If an Entra ID
+     * certificate was previously added but never used in a certificate rotation,
+     * this operation replaces that version.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation addEntraIdCertificate( + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getAddEntraIdCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a Cloud SQL instance as a clone of the source instance. Using this
+     * operation might cause your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation clone( + com.google.cloud.sql.v1.SqlInstancesCloneRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCloneMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation delete( + com.google.cloud.sql.v1.SqlInstancesDeleteRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Demotes the stand-alone instance to be a Cloud SQL read replica for an
+     * external database server.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation demoteMaster( + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDemoteMasterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Demotes an existing standalone instance to be a Cloud SQL read replica
+     * for an external database server.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation demote( + com.google.cloud.sql.v1.SqlInstancesDemoteRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDemoteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL
+     * dump or CSV file.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation export( + com.google.cloud.sql.v1.SqlInstancesExportRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getExportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Initiates a manual failover of a high availability (HA) primary instance
+     * to a standby instance, which becomes the primary instance. Users are
+     * then rerouted to the new primary. For more information, see the
+     * [Overview of high
+     * availability](https://cloud.google.com/sql/docs/mysql/high-availability)
+     * page in the Cloud SQL documentation.
+     * If using Legacy HA (MySQL only), this causes the instance to failover to
+     * its failover replica instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation failover( + com.google.cloud.sql.v1.SqlInstancesFailoverRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getFailoverMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reencrypt CMEK instance with latest key version.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation reencrypt( + com.google.cloud.sql.v1.SqlInstancesReencryptRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getReencryptMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.DatabaseInstance get( + com.google.cloud.sql.v1.SqlInstancesGetRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Imports data into a Cloud SQL instance from a SQL dump  or CSV file in
+     * Cloud Storage.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation import_( + com.google.cloud.sql.v1.SqlInstancesImportRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getImportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation insert( + com.google.cloud.sql.v1.SqlInstancesInsertRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists instances under a given project.
+     * 
+ */ + public com.google.cloud.sql.v1.InstancesListResponse list( + com.google.cloud.sql.v1.SqlInstancesListRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all of the trusted Certificate Authorities (CAs) for the specified
+     * instance. There can be up to three CAs listed: the CA that was used to sign
+     * the certificate that is currently in use, a CA that has been added but not
+     * yet used to sign a certificate, and a CA used to sign a certificate that
+     * has previously rotated out.
+     * 
+ */ + public com.google.cloud.sql.v1.InstancesListServerCasResponse listServerCas( + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListServerCasMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all versions of server certificates and certificate authorities (CAs)
+     * for the specified instance. There can be up to three sets of certs listed:
+     * the certificate that is currently in use, a future that has been added but
+     * not yet used to sign a certificate, and a certificate that has been rotated
+     * out. For instances not using Certificate Authority Service (CAS) server CA,
+     * use ListServerCas instead.
+     * 
+ */ + public com.google.cloud.sql.v1.InstancesListServerCertificatesResponse listServerCertificates( + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListServerCertificatesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all versions of EntraID certificates for the specified instance.
+     * There can be up to three sets of certificates listed: the certificate that
+     * is currently in use, a future that has been added but not yet used to sign
+     * a certificate, and a certificate that has been rotated out.
+     * 
+ */ + public com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse listEntraIdCertificates( + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListEntraIdCertificatesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Partially updates settings of a Cloud SQL instance by merging the request
+     * with the current configuration. This method supports patch semantics.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation patch( + com.google.cloud.sql.v1.SqlInstancesPatchRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Promotes the read replica instance to be an independent Cloud SQL
+     * primary instance.
+     * Using this operation might cause your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation promoteReplica( + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPromoteReplicaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Switches over from the primary instance to the DR replica
+     * instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation switchover( + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getSwitchoverMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes all client certificates and generates a new server SSL certificate
+     * for the instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation resetSslConfig( + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getResetSslConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Restarts a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation restart( + com.google.cloud.sql.v1.SqlInstancesRestartRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRestartMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Restores a backup of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation restoreBackup( + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRestoreBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Rotates the server certificate to one signed by the Certificate Authority
+     * (CA) version previously added with the addServerCA method. For instances
+     * that have enabled Certificate Authority Service (CAS) based server CA,
+     * use RotateServerCertificate to rotate the server certificate.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation rotateServerCa( + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRotateServerCaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addServerCertificate method. For instances not using Certificate Authority
+     * Service (CAS) server CA, use RotateServerCa instead.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation rotateServerCertificate( + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRotateServerCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addEntraIdCertificate method.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation rotateEntraIdCertificate( + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRotateEntraIdCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Starts the replication in the read replica instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation startReplica( + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getStartReplicaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Stops the replication in the read replica instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation stopReplica( + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getStopReplicaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Truncate MySQL general and slow query log tables
+     * MySQL only.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation truncateLog( + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getTruncateLogMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates settings of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation update( + com.google.cloud.sql.v1.SqlInstancesUpdateRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public com.google.cloud.sql.v1.SslCert createEphemeral( + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateEphemeralMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reschedules the maintenance on the given instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation rescheduleMaintenance( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRescheduleMaintenanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Verify External primary instance external sync settings.
+     * 
+ */ + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse + verifyExternalSyncSettings( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getVerifyExternalSyncSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Start External primary instance migration.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation startExternalSync( + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getStartExternalSyncMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Perform Disk Shrink on primary instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation performDiskShrink( + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPerformDiskShrinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get Disk Shrink Config for a given instance.
+     * 
+ */ + public com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse getDiskShrinkConfig( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetDiskShrinkConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reset Replica Size to primary instance disk size.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation resetReplicaSize( + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getResetReplicaSizeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get Latest Recovery Time for a given instance.
+     * 
+ */ + public com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse getLatestRecoveryTime( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetLatestRecoveryTimeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Execute SQL statements.
+     * 
+ */ + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse executeSql( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getExecuteSqlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse acquireSsrsLease( + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getAcquireSsrsLeaseMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Release a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse releaseSsrsLease( + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getReleaseSsrsLeaseMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Execute MVU Pre-checks
+     * 
+ */ + public com.google.cloud.sql.v1.Operation preCheckMajorVersionUpgrade( + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPreCheckMajorVersionUpgradeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Point in time restore for an instance managed by Google Cloud Backup and
+     * Disaster Recovery.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation pointInTimeRestore( + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPointInTimeRestoreMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do limited synchronous rpc calls to service SqlInstancesService. */ + public static final class SqlInstancesServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlInstancesServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlInstancesServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Adds a new trusted Certificate Authority (CA) version for the specified
+     * instance. Required to prepare for a certificate rotation. If a CA version
+     * was previously added but never used in a certificate rotation, this
+     * operation replaces that version. There cannot be more than one CA version
+     * waiting to be rotated in. For instances that have enabled Certificate
+     * Authority Service (CAS) based server CA, use AddServerCertificate to add a
+     * new server certificate.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation addServerCa( + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddServerCaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Add a new trusted server certificate version for the specified instance
+     * using Certificate Authority Service (CAS) server CA. Required to prepare
+     * for a certificate rotation. If a server certificate version was previously
+     * added but never used in a certificate rotation, this operation replaces
+     * that version. There cannot be more than one certificate version waiting to
+     * be rotated in. For instances not using CAS server CA, use AddServerCa
+     * instead.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation addServerCertificate( + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddServerCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Adds a new Entra ID certificate for the specified instance. If an Entra ID
+     * certificate was previously added but never used in a certificate rotation,
+     * this operation replaces that version.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation addEntraIdCertificate( + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddEntraIdCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a Cloud SQL instance as a clone of the source instance. Using this
+     * operation might cause your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation clone( + com.google.cloud.sql.v1.SqlInstancesCloneRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCloneMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation delete( + com.google.cloud.sql.v1.SqlInstancesDeleteRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Demotes the stand-alone instance to be a Cloud SQL read replica for an
+     * external database server.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation demoteMaster( + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDemoteMasterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Demotes an existing standalone instance to be a Cloud SQL read replica
+     * for an external database server.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation demote( + com.google.cloud.sql.v1.SqlInstancesDemoteRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDemoteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL
+     * dump or CSV file.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation export( + com.google.cloud.sql.v1.SqlInstancesExportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getExportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Initiates a manual failover of a high availability (HA) primary instance
+     * to a standby instance, which becomes the primary instance. Users are
+     * then rerouted to the new primary. For more information, see the
+     * [Overview of high
+     * availability](https://cloud.google.com/sql/docs/mysql/high-availability)
+     * page in the Cloud SQL documentation.
+     * If using Legacy HA (MySQL only), this causes the instance to failover to
+     * its failover replica instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation failover( + com.google.cloud.sql.v1.SqlInstancesFailoverRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFailoverMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reencrypt CMEK instance with latest key version.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation reencrypt( + com.google.cloud.sql.v1.SqlInstancesReencryptRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReencryptMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.DatabaseInstance get( + com.google.cloud.sql.v1.SqlInstancesGetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Imports data into a Cloud SQL instance from a SQL dump  or CSV file in
+     * Cloud Storage.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation import_( + com.google.cloud.sql.v1.SqlInstancesImportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation insert( + com.google.cloud.sql.v1.SqlInstancesInsertRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists instances under a given project.
+     * 
+ */ + public com.google.cloud.sql.v1.InstancesListResponse list( + com.google.cloud.sql.v1.SqlInstancesListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all of the trusted Certificate Authorities (CAs) for the specified
+     * instance. There can be up to three CAs listed: the CA that was used to sign
+     * the certificate that is currently in use, a CA that has been added but not
+     * yet used to sign a certificate, and a CA used to sign a certificate that
+     * has previously rotated out.
+     * 
+ */ + public com.google.cloud.sql.v1.InstancesListServerCasResponse listServerCas( + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListServerCasMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all versions of server certificates and certificate authorities (CAs)
+     * for the specified instance. There can be up to three sets of certs listed:
+     * the certificate that is currently in use, a future that has been added but
+     * not yet used to sign a certificate, and a certificate that has been rotated
+     * out. For instances not using Certificate Authority Service (CAS) server CA,
+     * use ListServerCas instead.
+     * 
+ */ + public com.google.cloud.sql.v1.InstancesListServerCertificatesResponse listServerCertificates( + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListServerCertificatesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all versions of EntraID certificates for the specified instance.
+     * There can be up to three sets of certificates listed: the certificate that
+     * is currently in use, a future that has been added but not yet used to sign
+     * a certificate, and a certificate that has been rotated out.
+     * 
+ */ + public com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse listEntraIdCertificates( + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListEntraIdCertificatesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Partially updates settings of a Cloud SQL instance by merging the request
+     * with the current configuration. This method supports patch semantics.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation patch( + com.google.cloud.sql.v1.SqlInstancesPatchRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Promotes the read replica instance to be an independent Cloud SQL
+     * primary instance.
+     * Using this operation might cause your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation promoteReplica( + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPromoteReplicaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Switches over from the primary instance to the DR replica
+     * instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation switchover( + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSwitchoverMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes all client certificates and generates a new server SSL certificate
+     * for the instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation resetSslConfig( + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getResetSslConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Restarts a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation restart( + com.google.cloud.sql.v1.SqlInstancesRestartRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestartMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Restores a backup of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation restoreBackup( + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestoreBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Rotates the server certificate to one signed by the Certificate Authority
+     * (CA) version previously added with the addServerCA method. For instances
+     * that have enabled Certificate Authority Service (CAS) based server CA,
+     * use RotateServerCertificate to rotate the server certificate.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation rotateServerCa( + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRotateServerCaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addServerCertificate method. For instances not using Certificate Authority
+     * Service (CAS) server CA, use RotateServerCa instead.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation rotateServerCertificate( + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRotateServerCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addEntraIdCertificate method.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation rotateEntraIdCertificate( + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRotateEntraIdCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Starts the replication in the read replica instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation startReplica( + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getStartReplicaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Stops the replication in the read replica instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation stopReplica( + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getStopReplicaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Truncate MySQL general and slow query log tables
+     * MySQL only.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation truncateLog( + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTruncateLogMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates settings of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation update( + com.google.cloud.sql.v1.SqlInstancesUpdateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public com.google.cloud.sql.v1.SslCert createEphemeral( + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateEphemeralMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reschedules the maintenance on the given instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation rescheduleMaintenance( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRescheduleMaintenanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Verify External primary instance external sync settings.
+     * 
+ */ + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse + verifyExternalSyncSettings( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getVerifyExternalSyncSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Start External primary instance migration.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation startExternalSync( + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getStartExternalSyncMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Perform Disk Shrink on primary instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation performDiskShrink( + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPerformDiskShrinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get Disk Shrink Config for a given instance.
+     * 
+ */ + public com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse getDiskShrinkConfig( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDiskShrinkConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reset Replica Size to primary instance disk size.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation resetReplicaSize( + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getResetReplicaSizeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get Latest Recovery Time for a given instance.
+     * 
+ */ + public com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse getLatestRecoveryTime( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetLatestRecoveryTimeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Execute SQL statements.
+     * 
+ */ + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse executeSql( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getExecuteSqlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse acquireSsrsLease( + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAcquireSsrsLeaseMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Release a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse releaseSsrsLease( + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReleaseSsrsLeaseMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Execute MVU Pre-checks
+     * 
+ */ + public com.google.cloud.sql.v1.Operation preCheckMajorVersionUpgrade( + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPreCheckMajorVersionUpgradeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Point in time restore for an instance managed by Google Cloud Backup and
+     * Disaster Recovery.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation pointInTimeRestore( + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPointInTimeRestoreMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlInstancesService. + */ + public static final class SqlInstancesServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlInstancesServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlInstancesServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Adds a new trusted Certificate Authority (CA) version for the specified
+     * instance. Required to prepare for a certificate rotation. If a CA version
+     * was previously added but never used in a certificate rotation, this
+     * operation replaces that version. There cannot be more than one CA version
+     * waiting to be rotated in. For instances that have enabled Certificate
+     * Authority Service (CAS) based server CA, use AddServerCertificate to add a
+     * new server certificate.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + addServerCa(com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddServerCaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Add a new trusted server certificate version for the specified instance
+     * using Certificate Authority Service (CAS) server CA. Required to prepare
+     * for a certificate rotation. If a server certificate version was previously
+     * added but never used in a certificate rotation, this operation replaces
+     * that version. There cannot be more than one certificate version waiting to
+     * be rotated in. For instances not using CAS server CA, use AddServerCa
+     * instead.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + addServerCertificate( + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddServerCertificateMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Adds a new Entra ID certificate for the specified instance. If an Entra ID
+     * certificate was previously added but never used in a certificate rotation,
+     * this operation replaces that version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + addEntraIdCertificate( + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddEntraIdCertificateMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a Cloud SQL instance as a clone of the source instance. Using this
+     * operation might cause your instance to restart.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + clone(com.google.cloud.sql.v1.SqlInstancesCloneRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCloneMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + delete(com.google.cloud.sql.v1.SqlInstancesDeleteRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Demotes the stand-alone instance to be a Cloud SQL read replica for an
+     * external database server.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + demoteMaster(com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDemoteMasterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Demotes an existing standalone instance to be a Cloud SQL read replica
+     * for an external database server.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + demote(com.google.cloud.sql.v1.SqlInstancesDemoteRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDemoteMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL
+     * dump or CSV file.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + export(com.google.cloud.sql.v1.SqlInstancesExportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getExportMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Initiates a manual failover of a high availability (HA) primary instance
+     * to a standby instance, which becomes the primary instance. Users are
+     * then rerouted to the new primary. For more information, see the
+     * [Overview of high
+     * availability](https://cloud.google.com/sql/docs/mysql/high-availability)
+     * page in the Cloud SQL documentation.
+     * If using Legacy HA (MySQL only), this causes the instance to failover to
+     * its failover replica instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + failover(com.google.cloud.sql.v1.SqlInstancesFailoverRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFailoverMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Reencrypt CMEK instance with latest key version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + reencrypt(com.google.cloud.sql.v1.SqlInstancesReencryptRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReencryptMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.DatabaseInstance> + get(com.google.cloud.sql.v1.SqlInstancesGetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Imports data into a Cloud SQL instance from a SQL dump  or CSV file in
+     * Cloud Storage.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + import_(com.google.cloud.sql.v1.SqlInstancesImportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + insert(com.google.cloud.sql.v1.SqlInstancesInsertRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists instances under a given project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.InstancesListResponse> + list(com.google.cloud.sql.v1.SqlInstancesListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all of the trusted Certificate Authorities (CAs) for the specified
+     * instance. There can be up to three CAs listed: the CA that was used to sign
+     * the certificate that is currently in use, a CA that has been added but not
+     * yet used to sign a certificate, and a CA used to sign a certificate that
+     * has previously rotated out.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.InstancesListServerCasResponse> + listServerCas(com.google.cloud.sql.v1.SqlInstancesListServerCasRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListServerCasMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all versions of server certificates and certificate authorities (CAs)
+     * for the specified instance. There can be up to three sets of certs listed:
+     * the certificate that is currently in use, a future that has been added but
+     * not yet used to sign a certificate, and a certificate that has been rotated
+     * out. For instances not using Certificate Authority Service (CAS) server CA,
+     * use ListServerCas instead.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse> + listServerCertificates( + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListServerCertificatesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all versions of EntraID certificates for the specified instance.
+     * There can be up to three sets of certificates listed: the certificate that
+     * is currently in use, a future that has been added but not yet used to sign
+     * a certificate, and a certificate that has been rotated out.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse> + listEntraIdCertificates( + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListEntraIdCertificatesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Partially updates settings of a Cloud SQL instance by merging the request
+     * with the current configuration. This method supports patch semantics.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + patch(com.google.cloud.sql.v1.SqlInstancesPatchRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPatchMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Promotes the read replica instance to be an independent Cloud SQL
+     * primary instance.
+     * Using this operation might cause your instance to restart.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + promoteReplica(com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPromoteReplicaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Switches over from the primary instance to the DR replica
+     * instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + switchover(com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSwitchoverMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes all client certificates and generates a new server SSL certificate
+     * for the instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + resetSslConfig(com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getResetSslConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Restarts a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + restart(com.google.cloud.sql.v1.SqlInstancesRestartRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestartMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Restores a backup of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + restoreBackup(com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestoreBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Rotates the server certificate to one signed by the Certificate Authority
+     * (CA) version previously added with the addServerCA method. For instances
+     * that have enabled Certificate Authority Service (CAS) based server CA,
+     * use RotateServerCertificate to rotate the server certificate.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + rotateServerCa(com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRotateServerCaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addServerCertificate method. For instances not using Certificate Authority
+     * Service (CAS) server CA, use RotateServerCa instead.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + rotateServerCertificate( + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRotateServerCertificateMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addEntraIdCertificate method.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + rotateEntraIdCertificate( + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRotateEntraIdCertificateMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Starts the replication in the read replica instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + startReplica(com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getStartReplicaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Stops the replication in the read replica instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + stopReplica(com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getStopReplicaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Truncate MySQL general and slow query log tables
+     * MySQL only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + truncateLog(com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTruncateLogMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates settings of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + update(com.google.cloud.sql.v1.SqlInstancesUpdateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createEphemeral(com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateEphemeralMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Reschedules the maintenance on the given instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + rescheduleMaintenance( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRescheduleMaintenanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Verify External primary instance external sync settings.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettings( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getVerifyExternalSyncSettingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Start External primary instance migration.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + startExternalSync(com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getStartExternalSyncMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Perform Disk Shrink on primary instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + performDiskShrink(com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPerformDiskShrinkMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get Disk Shrink Config for a given instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfig( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDiskShrinkConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Reset Replica Size to primary instance disk size.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + resetReplicaSize(com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getResetReplicaSizeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get Latest Recovery Time for a given instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTime( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetLatestRecoveryTimeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Execute SQL statements.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse> + executeSql(com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getExecuteSqlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLease(com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAcquireSsrsLeaseMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Release a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLease(com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReleaseSsrsLeaseMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Execute MVU Pre-checks
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + preCheckMajorVersionUpgrade( + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPreCheckMajorVersionUpgradeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Point in time restore for an instance managed by Google Cloud Backup and
+     * Disaster Recovery.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + pointInTimeRestore(com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPointInTimeRestoreMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_ADD_SERVER_CA = 0; + private static final int METHODID_ADD_SERVER_CERTIFICATE = 1; + private static final int METHODID_ADD_ENTRA_ID_CERTIFICATE = 2; + private static final int METHODID_CLONE = 3; + private static final int METHODID_DELETE = 4; + private static final int METHODID_DEMOTE_MASTER = 5; + private static final int METHODID_DEMOTE = 6; + private static final int METHODID_EXPORT = 7; + private static final int METHODID_FAILOVER = 8; + private static final int METHODID_REENCRYPT = 9; + private static final int METHODID_GET = 10; + private static final int METHODID_IMPORT = 11; + private static final int METHODID_INSERT = 12; + private static final int METHODID_LIST = 13; + private static final int METHODID_LIST_SERVER_CAS = 14; + private static final int METHODID_LIST_SERVER_CERTIFICATES = 15; + private static final int METHODID_LIST_ENTRA_ID_CERTIFICATES = 16; + private static final int METHODID_PATCH = 17; + private static final int METHODID_PROMOTE_REPLICA = 18; + private static final int METHODID_SWITCHOVER = 19; + private static final int METHODID_RESET_SSL_CONFIG = 20; + private static final int METHODID_RESTART = 21; + private static final int METHODID_RESTORE_BACKUP = 22; + private static final int METHODID_ROTATE_SERVER_CA = 23; + private static final int METHODID_ROTATE_SERVER_CERTIFICATE = 24; + private static final int METHODID_ROTATE_ENTRA_ID_CERTIFICATE = 25; + private static final int METHODID_START_REPLICA = 26; + private static final int METHODID_STOP_REPLICA = 27; + private static final int METHODID_TRUNCATE_LOG = 28; + private static final int METHODID_UPDATE = 29; + private static final int METHODID_CREATE_EPHEMERAL = 30; + private static final int METHODID_RESCHEDULE_MAINTENANCE = 31; + private static final int METHODID_VERIFY_EXTERNAL_SYNC_SETTINGS = 32; + private static final int METHODID_START_EXTERNAL_SYNC = 33; + private static final int METHODID_PERFORM_DISK_SHRINK = 34; + private static final int METHODID_GET_DISK_SHRINK_CONFIG = 35; + private static final int METHODID_RESET_REPLICA_SIZE = 36; + private static final int METHODID_GET_LATEST_RECOVERY_TIME = 37; + private static final int METHODID_EXECUTE_SQL = 38; + private static final int METHODID_ACQUIRE_SSRS_LEASE = 39; + private static final int METHODID_RELEASE_SSRS_LEASE = 40; + private static final int METHODID_PRE_CHECK_MAJOR_VERSION_UPGRADE = 41; + private static final int METHODID_POINT_IN_TIME_RESTORE = 42; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_ADD_SERVER_CA: + serviceImpl.addServerCa( + (com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ADD_SERVER_CERTIFICATE: + serviceImpl.addServerCertificate( + (com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ADD_ENTRA_ID_CERTIFICATE: + serviceImpl.addEntraIdCertificate( + (com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CLONE: + serviceImpl.clone( + (com.google.cloud.sql.v1.SqlInstancesCloneRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE: + serviceImpl.delete( + (com.google.cloud.sql.v1.SqlInstancesDeleteRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DEMOTE_MASTER: + serviceImpl.demoteMaster( + (com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DEMOTE: + serviceImpl.demote( + (com.google.cloud.sql.v1.SqlInstancesDemoteRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EXPORT: + serviceImpl.export( + (com.google.cloud.sql.v1.SqlInstancesExportRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_FAILOVER: + serviceImpl.failover( + (com.google.cloud.sql.v1.SqlInstancesFailoverRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REENCRYPT: + serviceImpl.reencrypt( + (com.google.cloud.sql.v1.SqlInstancesReencryptRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET: + serviceImpl.get( + (com.google.cloud.sql.v1.SqlInstancesGetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_IMPORT: + serviceImpl.import_( + (com.google.cloud.sql.v1.SqlInstancesImportRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_INSERT: + serviceImpl.insert( + (com.google.cloud.sql.v1.SqlInstancesInsertRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1.SqlInstancesListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SERVER_CAS: + serviceImpl.listServerCas( + (com.google.cloud.sql.v1.SqlInstancesListServerCasRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SERVER_CERTIFICATES: + serviceImpl.listServerCertificates( + (com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse>) + responseObserver); + break; + case METHODID_LIST_ENTRA_ID_CERTIFICATES: + serviceImpl.listEntraIdCertificates( + (com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse>) + responseObserver); + break; + case METHODID_PATCH: + serviceImpl.patch( + (com.google.cloud.sql.v1.SqlInstancesPatchRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PROMOTE_REPLICA: + serviceImpl.promoteReplica( + (com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SWITCHOVER: + serviceImpl.switchover( + (com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESET_SSL_CONFIG: + serviceImpl.resetSslConfig( + (com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESTART: + serviceImpl.restart( + (com.google.cloud.sql.v1.SqlInstancesRestartRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESTORE_BACKUP: + serviceImpl.restoreBackup( + (com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ROTATE_SERVER_CA: + serviceImpl.rotateServerCa( + (com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ROTATE_SERVER_CERTIFICATE: + serviceImpl.rotateServerCertificate( + (com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ROTATE_ENTRA_ID_CERTIFICATE: + serviceImpl.rotateEntraIdCertificate( + (com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_START_REPLICA: + serviceImpl.startReplica( + (com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_STOP_REPLICA: + serviceImpl.stopReplica( + (com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TRUNCATE_LOG: + serviceImpl.truncateLog( + (com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE: + serviceImpl.update( + (com.google.cloud.sql.v1.SqlInstancesUpdateRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_EPHEMERAL: + serviceImpl.createEphemeral( + (com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESCHEDULE_MAINTENANCE: + serviceImpl.rescheduleMaintenance( + (com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_VERIFY_EXTERNAL_SYNC_SETTINGS: + serviceImpl.verifyExternalSyncSettings( + (com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse>) + responseObserver); + break; + case METHODID_START_EXTERNAL_SYNC: + serviceImpl.startExternalSync( + (com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PERFORM_DISK_SHRINK: + serviceImpl.performDiskShrink( + (com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_DISK_SHRINK_CONFIG: + serviceImpl.getDiskShrinkConfig( + (com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse>) + responseObserver); + break; + case METHODID_RESET_REPLICA_SIZE: + serviceImpl.resetReplicaSize( + (com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_LATEST_RECOVERY_TIME: + serviceImpl.getLatestRecoveryTime( + (com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse>) + responseObserver); + break; + case METHODID_EXECUTE_SQL: + serviceImpl.executeSql( + (com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ACQUIRE_SSRS_LEASE: + serviceImpl.acquireSsrsLease( + (com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse>) + responseObserver); + break; + case METHODID_RELEASE_SSRS_LEASE: + serviceImpl.releaseSsrsLease( + (com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse>) + responseObserver); + break; + case METHODID_PRE_CHECK_MAJOR_VERSION_UPGRADE: + serviceImpl.preCheckMajorVersionUpgrade( + (com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_POINT_IN_TIME_RESTORE: + serviceImpl.pointInTimeRestore( + (com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getAddServerCaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_ADD_SERVER_CA))) + .addMethod( + getAddServerCertificateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_ADD_SERVER_CERTIFICATE))) + .addMethod( + getAddEntraIdCertificateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_ADD_ENTRA_ID_CERTIFICATE))) + .addMethod( + getCloneMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesCloneRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_CLONE))) + .addMethod( + getDeleteMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesDeleteRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_DELETE))) + .addMethod( + getDemoteMasterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_DEMOTE_MASTER))) + .addMethod( + getDemoteMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesDemoteRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_DEMOTE))) + .addMethod( + getExportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesExportRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_EXPORT))) + .addMethod( + getFailoverMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesFailoverRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_FAILOVER))) + .addMethod( + getReencryptMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesReencryptRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_REENCRYPT))) + .addMethod( + getGetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesGetRequest, + com.google.cloud.sql.v1.DatabaseInstance>(service, METHODID_GET))) + .addMethod( + getImportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesImportRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_IMPORT))) + .addMethod( + getInsertMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesInsertRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_INSERT))) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesListRequest, + com.google.cloud.sql.v1.InstancesListResponse>(service, METHODID_LIST))) + .addMethod( + getListServerCasMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest, + com.google.cloud.sql.v1.InstancesListServerCasResponse>( + service, METHODID_LIST_SERVER_CAS))) + .addMethod( + getListServerCertificatesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest, + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse>( + service, METHODID_LIST_SERVER_CERTIFICATES))) + .addMethod( + getListEntraIdCertificatesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest, + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse>( + service, METHODID_LIST_ENTRA_ID_CERTIFICATES))) + .addMethod( + getPatchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesPatchRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_PATCH))) + .addMethod( + getPromoteReplicaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_PROMOTE_REPLICA))) + .addMethod( + getSwitchoverMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_SWITCHOVER))) + .addMethod( + getResetSslConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_RESET_SSL_CONFIG))) + .addMethod( + getRestartMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesRestartRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_RESTART))) + .addMethod( + getRestoreBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_RESTORE_BACKUP))) + .addMethod( + getRotateServerCaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_ROTATE_SERVER_CA))) + .addMethod( + getRotateServerCertificateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest, + com.google.cloud.sql.v1.Operation>( + service, METHODID_ROTATE_SERVER_CERTIFICATE))) + .addMethod( + getRotateEntraIdCertificateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest, + com.google.cloud.sql.v1.Operation>( + service, METHODID_ROTATE_ENTRA_ID_CERTIFICATE))) + .addMethod( + getStartReplicaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_START_REPLICA))) + .addMethod( + getStopReplicaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_STOP_REPLICA))) + .addMethod( + getTruncateLogMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_TRUNCATE_LOG))) + .addMethod( + getUpdateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesUpdateRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_UPDATE))) + .addMethod( + getCreateEphemeralMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest, + com.google.cloud.sql.v1.SslCert>(service, METHODID_CREATE_EPHEMERAL))) + .addMethod( + getRescheduleMaintenanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_RESCHEDULE_MAINTENANCE))) + .addMethod( + getVerifyExternalSyncSettingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest, + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse>( + service, METHODID_VERIFY_EXTERNAL_SYNC_SETTINGS))) + .addMethod( + getStartExternalSyncMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_START_EXTERNAL_SYNC))) + .addMethod( + getPerformDiskShrinkMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_PERFORM_DISK_SHRINK))) + .addMethod( + getGetDiskShrinkConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest, + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse>( + service, METHODID_GET_DISK_SHRINK_CONFIG))) + .addMethod( + getResetReplicaSizeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_RESET_REPLICA_SIZE))) + .addMethod( + getGetLatestRecoveryTimeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest, + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse>( + service, METHODID_GET_LATEST_RECOVERY_TIME))) + .addMethod( + getExecuteSqlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse>( + service, METHODID_EXECUTE_SQL))) + .addMethod( + getAcquireSsrsLeaseMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest, + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse>( + service, METHODID_ACQUIRE_SSRS_LEASE))) + .addMethod( + getReleaseSsrsLeaseMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest, + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse>( + service, METHODID_RELEASE_SSRS_LEASE))) + .addMethod( + getPreCheckMajorVersionUpgradeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest, + com.google.cloud.sql.v1.Operation>( + service, METHODID_PRE_CHECK_MAJOR_VERSION_UPGRADE))) + .addMethod( + getPointInTimeRestoreMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_POINT_IN_TIME_RESTORE))) + .build(); + } + + private abstract static class SqlInstancesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlInstancesServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlInstancesService"); + } + } + + private static final class SqlInstancesServiceFileDescriptorSupplier + extends SqlInstancesServiceBaseDescriptorSupplier { + SqlInstancesServiceFileDescriptorSupplier() {} + } + + private static final class SqlInstancesServiceMethodDescriptorSupplier + extends SqlInstancesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlInstancesServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlInstancesServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlInstancesServiceFileDescriptorSupplier()) + .addMethod(getAddServerCaMethod()) + .addMethod(getAddServerCertificateMethod()) + .addMethod(getAddEntraIdCertificateMethod()) + .addMethod(getCloneMethod()) + .addMethod(getDeleteMethod()) + .addMethod(getDemoteMasterMethod()) + .addMethod(getDemoteMethod()) + .addMethod(getExportMethod()) + .addMethod(getFailoverMethod()) + .addMethod(getReencryptMethod()) + .addMethod(getGetMethod()) + .addMethod(getImportMethod()) + .addMethod(getInsertMethod()) + .addMethod(getListMethod()) + .addMethod(getListServerCasMethod()) + .addMethod(getListServerCertificatesMethod()) + .addMethod(getListEntraIdCertificatesMethod()) + .addMethod(getPatchMethod()) + .addMethod(getPromoteReplicaMethod()) + .addMethod(getSwitchoverMethod()) + .addMethod(getResetSslConfigMethod()) + .addMethod(getRestartMethod()) + .addMethod(getRestoreBackupMethod()) + .addMethod(getRotateServerCaMethod()) + .addMethod(getRotateServerCertificateMethod()) + .addMethod(getRotateEntraIdCertificateMethod()) + .addMethod(getStartReplicaMethod()) + .addMethod(getStopReplicaMethod()) + .addMethod(getTruncateLogMethod()) + .addMethod(getUpdateMethod()) + .addMethod(getCreateEphemeralMethod()) + .addMethod(getRescheduleMaintenanceMethod()) + .addMethod(getVerifyExternalSyncSettingsMethod()) + .addMethod(getStartExternalSyncMethod()) + .addMethod(getPerformDiskShrinkMethod()) + .addMethod(getGetDiskShrinkConfigMethod()) + .addMethod(getResetReplicaSizeMethod()) + .addMethod(getGetLatestRecoveryTimeMethod()) + .addMethod(getExecuteSqlMethod()) + .addMethod(getAcquireSsrsLeaseMethod()) + .addMethod(getReleaseSsrsLeaseMethod()) + .addMethod(getPreCheckMajorVersionUpgradeMethod()) + .addMethod(getPointInTimeRestoreMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsServiceGrpc.java new file mode 100644 index 000000000000..0cee9c8f6bff --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsServiceGrpc.java @@ -0,0 +1,666 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to fetch operations for database instances.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlOperationsServiceGrpc { + + private SqlOperationsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1.SqlOperationsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlOperationsGetRequest, com.google.cloud.sql.v1.Operation> + getGetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Get", + requestType = com.google.cloud.sql.v1.SqlOperationsGetRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlOperationsGetRequest, com.google.cloud.sql.v1.Operation> + getGetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlOperationsGetRequest, com.google.cloud.sql.v1.Operation> + getGetMethod; + if ((getGetMethod = SqlOperationsServiceGrpc.getGetMethod) == null) { + synchronized (SqlOperationsServiceGrpc.class) { + if ((getGetMethod = SqlOperationsServiceGrpc.getGetMethod) == null) { + SqlOperationsServiceGrpc.getGetMethod = + getGetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Get")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlOperationsGetRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlOperationsServiceMethodDescriptorSupplier("Get")) + .build(); + } + } + } + return getGetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlOperationsListRequest, + com.google.cloud.sql.v1.OperationsListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1.SqlOperationsListRequest.class, + responseType = com.google.cloud.sql.v1.OperationsListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlOperationsListRequest, + com.google.cloud.sql.v1.OperationsListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlOperationsListRequest, + com.google.cloud.sql.v1.OperationsListResponse> + getListMethod; + if ((getListMethod = SqlOperationsServiceGrpc.getListMethod) == null) { + synchronized (SqlOperationsServiceGrpc.class) { + if ((getListMethod = SqlOperationsServiceGrpc.getListMethod) == null) { + SqlOperationsServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlOperationsListRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.OperationsListResponse.getDefaultInstance())) + .setSchemaDescriptor(new SqlOperationsServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlOperationsCancelRequest, com.google.protobuf.Empty> + getCancelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Cancel", + requestType = com.google.cloud.sql.v1.SqlOperationsCancelRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlOperationsCancelRequest, com.google.protobuf.Empty> + getCancelMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlOperationsCancelRequest, com.google.protobuf.Empty> + getCancelMethod; + if ((getCancelMethod = SqlOperationsServiceGrpc.getCancelMethod) == null) { + synchronized (SqlOperationsServiceGrpc.class) { + if ((getCancelMethod = SqlOperationsServiceGrpc.getCancelMethod) == null) { + SqlOperationsServiceGrpc.getCancelMethod = + getCancelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Cancel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlOperationsCancelRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new SqlOperationsServiceMethodDescriptorSupplier("Cancel")) + .build(); + } + } + } + return getCancelMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlOperationsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlOperationsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceStub(channel, callOptions); + } + }; + return SqlOperationsServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlOperationsServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlOperationsServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlOperationsServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlOperationsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlOperationsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceBlockingStub(channel, callOptions); + } + }; + return SqlOperationsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlOperationsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlOperationsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceFutureStub(channel, callOptions); + } + }; + return SqlOperationsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to fetch operations for database instances.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Retrieves an instance operation that has been performed on an instance.
+     * 
+ */ + default void get( + com.google.cloud.sql.v1.SqlOperationsGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all instance operations that have been performed on the given Cloud
+     * SQL instance in the reverse chronological order of the start time.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1.SqlOperationsListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + + /** + * + * + *
+     * Cancels an instance operation that has been performed on an instance.
+     * 
+ */ + default void cancel( + com.google.cloud.sql.v1.SqlOperationsCancelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCancelMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SqlOperationsService. + * + *
+   * Service to fetch operations for database instances.
+   * 
+ */ + public abstract static class SqlOperationsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlOperationsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlOperationsService. + * + *
+   * Service to fetch operations for database instances.
+   * 
+ */ + public static final class SqlOperationsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlOperationsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlOperationsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves an instance operation that has been performed on an instance.
+     * 
+ */ + public void get( + com.google.cloud.sql.v1.SqlOperationsGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists all instance operations that have been performed on the given Cloud
+     * SQL instance in the reverse chronological order of the start time.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1.SqlOperationsListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Cancels an instance operation that has been performed on an instance.
+     * 
+ */ + public void cancel( + com.google.cloud.sql.v1.SqlOperationsCancelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCancelMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlOperationsService. + * + *
+   * Service to fetch operations for database instances.
+   * 
+ */ + public static final class SqlOperationsServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlOperationsServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlOperationsServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves an instance operation that has been performed on an instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation get( + com.google.cloud.sql.v1.SqlOperationsGetRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all instance operations that have been performed on the given Cloud
+     * SQL instance in the reverse chronological order of the start time.
+     * 
+ */ + public com.google.cloud.sql.v1.OperationsListResponse list( + com.google.cloud.sql.v1.SqlOperationsListRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Cancels an instance operation that has been performed on an instance.
+     * 
+ */ + public com.google.protobuf.Empty cancel( + com.google.cloud.sql.v1.SqlOperationsCancelRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCancelMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlOperationsService. + * + *
+   * Service to fetch operations for database instances.
+   * 
+ */ + public static final class SqlOperationsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlOperationsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlOperationsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves an instance operation that has been performed on an instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation get( + com.google.cloud.sql.v1.SqlOperationsGetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all instance operations that have been performed on the given Cloud
+     * SQL instance in the reverse chronological order of the start time.
+     * 
+ */ + public com.google.cloud.sql.v1.OperationsListResponse list( + com.google.cloud.sql.v1.SqlOperationsListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Cancels an instance operation that has been performed on an instance.
+     * 
+ */ + public com.google.protobuf.Empty cancel( + com.google.cloud.sql.v1.SqlOperationsCancelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCancelMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlOperationsService. + * + *
+   * Service to fetch operations for database instances.
+   * 
+ */ + public static final class SqlOperationsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlOperationsServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlOperationsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves an instance operation that has been performed on an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + get(com.google.cloud.sql.v1.SqlOperationsGetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all instance operations that have been performed on the given Cloud
+     * SQL instance in the reverse chronological order of the start time.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.OperationsListResponse> + list(com.google.cloud.sql.v1.SqlOperationsListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Cancels an instance operation that has been performed on an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture cancel( + com.google.cloud.sql.v1.SqlOperationsCancelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCancelMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET = 0; + private static final int METHODID_LIST = 1; + private static final int METHODID_CANCEL = 2; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET: + serviceImpl.get( + (com.google.cloud.sql.v1.SqlOperationsGetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1.SqlOperationsListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CANCEL: + serviceImpl.cancel( + (com.google.cloud.sql.v1.SqlOperationsCancelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlOperationsGetRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_GET))) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlOperationsListRequest, + com.google.cloud.sql.v1.OperationsListResponse>(service, METHODID_LIST))) + .addMethod( + getCancelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlOperationsCancelRequest, com.google.protobuf.Empty>( + service, METHODID_CANCEL))) + .build(); + } + + private abstract static class SqlOperationsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlOperationsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlOperationsService"); + } + } + + private static final class SqlOperationsServiceFileDescriptorSupplier + extends SqlOperationsServiceBaseDescriptorSupplier { + SqlOperationsServiceFileDescriptorSupplier() {} + } + + private static final class SqlOperationsServiceMethodDescriptorSupplier + extends SqlOperationsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlOperationsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlOperationsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlOperationsServiceFileDescriptorSupplier()) + .addMethod(getGetMethod()) + .addMethod(getListMethod()) + .addMethod(getCancelMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlRegionsServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlRegionsServiceGrpc.java new file mode 100644 index 000000000000..a3fba647102c --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlRegionsServiceGrpc.java @@ -0,0 +1,293 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + + +/** + * + * + *
+ * Service that exposes Cloud SQL region information. This service is only used
+ * internally and does not follow the same patterns as the other v1 RPCs.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlRegionsServiceGrpc { + + private SqlRegionsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1.SqlRegionsService"; + + // Static method descriptors that strictly reflect the proto. + /** Creates a new async stub that supports all call types for the service */ + public static SqlRegionsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlRegionsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlRegionsServiceStub(channel, callOptions); + } + }; + return SqlRegionsServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlRegionsServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlRegionsServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlRegionsServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlRegionsServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlRegionsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlRegionsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlRegionsServiceBlockingStub(channel, callOptions); + } + }; + return SqlRegionsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlRegionsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlRegionsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlRegionsServiceFutureStub(channel, callOptions); + } + }; + return SqlRegionsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service that exposes Cloud SQL region information. This service is only used
+   * internally and does not follow the same patterns as the other v1 RPCs.
+   * 
+ */ + public interface AsyncService {} + + /** + * Base class for the server implementation of the service SqlRegionsService. + * + *
+   * Service that exposes Cloud SQL region information. This service is only used
+   * internally and does not follow the same patterns as the other v1 RPCs.
+   * 
+ */ + public abstract static class SqlRegionsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlRegionsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlRegionsService. + * + *
+   * Service that exposes Cloud SQL region information. This service is only used
+   * internally and does not follow the same patterns as the other v1 RPCs.
+   * 
+ */ + public static final class SqlRegionsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlRegionsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlRegionsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlRegionsServiceStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlRegionsService. + * + *
+   * Service that exposes Cloud SQL region information. This service is only used
+   * internally and does not follow the same patterns as the other v1 RPCs.
+   * 
+ */ + public static final class SqlRegionsServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlRegionsServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlRegionsServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlRegionsServiceBlockingV2Stub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlRegionsService. + * + *
+   * Service that exposes Cloud SQL region information. This service is only used
+   * internally and does not follow the same patterns as the other v1 RPCs.
+   * 
+ */ + public static final class SqlRegionsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlRegionsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlRegionsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlRegionsServiceBlockingStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlRegionsService. + * + *
+   * Service that exposes Cloud SQL region information. This service is only used
+   * internally and does not follow the same patterns as the other v1 RPCs.
+   * 
+ */ + public static final class SqlRegionsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlRegionsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlRegionsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlRegionsServiceFutureStub(channel, callOptions); + } + } + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()).build(); + } + + private abstract static class SqlRegionsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlRegionsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlRegionsServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlRegionsService"); + } + } + + private static final class SqlRegionsServiceFileDescriptorSupplier + extends SqlRegionsServiceBaseDescriptorSupplier { + SqlRegionsServiceFileDescriptorSupplier() {} + } + + private static final class SqlRegionsServiceMethodDescriptorSupplier + extends SqlRegionsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlRegionsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlRegionsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlRegionsServiceFileDescriptorSupplier()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsServiceGrpc.java new file mode 100644 index 000000000000..f689265f463a --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsServiceGrpc.java @@ -0,0 +1,811 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to manage SSL certs for Cloud SQL instances.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlSslCertsServiceGrpc { + + private SqlSslCertsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1.SqlSslCertsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Delete", + requestType = com.google.cloud.sql.v1.SqlSslCertsDeleteRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod; + if ((getDeleteMethod = SqlSslCertsServiceGrpc.getDeleteMethod) == null) { + synchronized (SqlSslCertsServiceGrpc.class) { + if ((getDeleteMethod = SqlSslCertsServiceGrpc.getDeleteMethod) == null) { + SqlSslCertsServiceGrpc.getDeleteMethod = + getDeleteMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Delete")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlSslCertsServiceMethodDescriptorSupplier("Delete")) + .build(); + } + } + } + return getDeleteMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlSslCertsGetRequest, com.google.cloud.sql.v1.SslCert> + getGetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Get", + requestType = com.google.cloud.sql.v1.SqlSslCertsGetRequest.class, + responseType = com.google.cloud.sql.v1.SslCert.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlSslCertsGetRequest, com.google.cloud.sql.v1.SslCert> + getGetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlSslCertsGetRequest, com.google.cloud.sql.v1.SslCert> + getGetMethod; + if ((getGetMethod = SqlSslCertsServiceGrpc.getGetMethod) == null) { + synchronized (SqlSslCertsServiceGrpc.class) { + if ((getGetMethod = SqlSslCertsServiceGrpc.getGetMethod) == null) { + SqlSslCertsServiceGrpc.getGetMethod = + getGetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Get")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlSslCertsGetRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SslCert.getDefaultInstance())) + .setSchemaDescriptor(new SqlSslCertsServiceMethodDescriptorSupplier("Get")) + .build(); + } + } + } + return getGetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlSslCertsInsertRequest, + com.google.cloud.sql.v1.SslCertsInsertResponse> + getInsertMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Insert", + requestType = com.google.cloud.sql.v1.SqlSslCertsInsertRequest.class, + responseType = com.google.cloud.sql.v1.SslCertsInsertResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlSslCertsInsertRequest, + com.google.cloud.sql.v1.SslCertsInsertResponse> + getInsertMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlSslCertsInsertRequest, + com.google.cloud.sql.v1.SslCertsInsertResponse> + getInsertMethod; + if ((getInsertMethod = SqlSslCertsServiceGrpc.getInsertMethod) == null) { + synchronized (SqlSslCertsServiceGrpc.class) { + if ((getInsertMethod = SqlSslCertsServiceGrpc.getInsertMethod) == null) { + SqlSslCertsServiceGrpc.getInsertMethod = + getInsertMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Insert")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlSslCertsInsertRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SslCertsInsertResponse.getDefaultInstance())) + .setSchemaDescriptor(new SqlSslCertsServiceMethodDescriptorSupplier("Insert")) + .build(); + } + } + } + return getInsertMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlSslCertsListRequest, + com.google.cloud.sql.v1.SslCertsListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1.SqlSslCertsListRequest.class, + responseType = com.google.cloud.sql.v1.SslCertsListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlSslCertsListRequest, + com.google.cloud.sql.v1.SslCertsListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlSslCertsListRequest, + com.google.cloud.sql.v1.SslCertsListResponse> + getListMethod; + if ((getListMethod = SqlSslCertsServiceGrpc.getListMethod) == null) { + synchronized (SqlSslCertsServiceGrpc.class) { + if ((getListMethod = SqlSslCertsServiceGrpc.getListMethod) == null) { + SqlSslCertsServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlSslCertsListRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SslCertsListResponse.getDefaultInstance())) + .setSchemaDescriptor(new SqlSslCertsServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlSslCertsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlSslCertsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceStub(channel, callOptions); + } + }; + return SqlSslCertsServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlSslCertsServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlSslCertsServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlSslCertsServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlSslCertsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlSslCertsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceBlockingStub(channel, callOptions); + } + }; + return SqlSslCertsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlSslCertsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlSslCertsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceFutureStub(channel, callOptions); + } + }; + return SqlSslCertsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to manage SSL certs for Cloud SQL instances.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Deletes the SSL certificate. For First Generation instances, the
+     * certificate remains valid until the instance is restarted.
+     * 
+ */ + default void delete( + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a particular SSL certificate.  Does not include the private key
+     * (required for usage).  The private key must be saved from the response to
+     * initial creation.
+     * 
+ */ + default void get( + com.google.cloud.sql.v1.SqlSslCertsGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates an SSL certificate and returns it along with the private key and
+     * server certificate authority.  The new certificate will not be usable until
+     * the instance is restarted.
+     * 
+ */ + default void insert( + com.google.cloud.sql.v1.SqlSslCertsInsertRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getInsertMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all of the current SSL certificates for the instance.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1.SqlSslCertsListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SqlSslCertsService. + * + *
+   * Service to manage SSL certs for Cloud SQL instances.
+   * 
+ */ + public abstract static class SqlSslCertsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlSslCertsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlSslCertsService. + * + *
+   * Service to manage SSL certs for Cloud SQL instances.
+   * 
+ */ + public static final class SqlSslCertsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlSslCertsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlSslCertsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the SSL certificate. For First Generation instances, the
+     * certificate remains valid until the instance is restarted.
+     * 
+ */ + public void delete( + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves a particular SSL certificate.  Does not include the private key
+     * (required for usage).  The private key must be saved from the response to
+     * initial creation.
+     * 
+ */ + public void get( + com.google.cloud.sql.v1.SqlSslCertsGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates an SSL certificate and returns it along with the private key and
+     * server certificate authority.  The new certificate will not be usable until
+     * the instance is restarted.
+     * 
+ */ + public void insert( + com.google.cloud.sql.v1.SqlSslCertsInsertRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists all of the current SSL certificates for the instance.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1.SqlSslCertsListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlSslCertsService. + * + *
+   * Service to manage SSL certs for Cloud SQL instances.
+   * 
+ */ + public static final class SqlSslCertsServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlSslCertsServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlSslCertsServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the SSL certificate. For First Generation instances, the
+     * certificate remains valid until the instance is restarted.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation delete( + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a particular SSL certificate.  Does not include the private key
+     * (required for usage).  The private key must be saved from the response to
+     * initial creation.
+     * 
+ */ + public com.google.cloud.sql.v1.SslCert get( + com.google.cloud.sql.v1.SqlSslCertsGetRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates an SSL certificate and returns it along with the private key and
+     * server certificate authority.  The new certificate will not be usable until
+     * the instance is restarted.
+     * 
+ */ + public com.google.cloud.sql.v1.SslCertsInsertResponse insert( + com.google.cloud.sql.v1.SqlSslCertsInsertRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all of the current SSL certificates for the instance.
+     * 
+ */ + public com.google.cloud.sql.v1.SslCertsListResponse list( + com.google.cloud.sql.v1.SqlSslCertsListRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlSslCertsService. + * + *
+   * Service to manage SSL certs for Cloud SQL instances.
+   * 
+ */ + public static final class SqlSslCertsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlSslCertsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlSslCertsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the SSL certificate. For First Generation instances, the
+     * certificate remains valid until the instance is restarted.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation delete( + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a particular SSL certificate.  Does not include the private key
+     * (required for usage).  The private key must be saved from the response to
+     * initial creation.
+     * 
+ */ + public com.google.cloud.sql.v1.SslCert get( + com.google.cloud.sql.v1.SqlSslCertsGetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates an SSL certificate and returns it along with the private key and
+     * server certificate authority.  The new certificate will not be usable until
+     * the instance is restarted.
+     * 
+ */ + public com.google.cloud.sql.v1.SslCertsInsertResponse insert( + com.google.cloud.sql.v1.SqlSslCertsInsertRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all of the current SSL certificates for the instance.
+     * 
+ */ + public com.google.cloud.sql.v1.SslCertsListResponse list( + com.google.cloud.sql.v1.SqlSslCertsListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlSslCertsService. + * + *
+   * Service to manage SSL certs for Cloud SQL instances.
+   * 
+ */ + public static final class SqlSslCertsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlSslCertsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlSslCertsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the SSL certificate. For First Generation instances, the
+     * certificate remains valid until the instance is restarted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + delete(com.google.cloud.sql.v1.SqlSslCertsDeleteRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a particular SSL certificate.  Does not include the private key
+     * (required for usage).  The private key must be saved from the response to
+     * initial creation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture get( + com.google.cloud.sql.v1.SqlSslCertsGetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates an SSL certificate and returns it along with the private key and
+     * server certificate authority.  The new certificate will not be usable until
+     * the instance is restarted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.SslCertsInsertResponse> + insert(com.google.cloud.sql.v1.SqlSslCertsInsertRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all of the current SSL certificates for the instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.SslCertsListResponse> + list(com.google.cloud.sql.v1.SqlSslCertsListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_DELETE = 0; + private static final int METHODID_GET = 1; + private static final int METHODID_INSERT = 2; + private static final int METHODID_LIST = 3; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_DELETE: + serviceImpl.delete( + (com.google.cloud.sql.v1.SqlSslCertsDeleteRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET: + serviceImpl.get( + (com.google.cloud.sql.v1.SqlSslCertsGetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_INSERT: + serviceImpl.insert( + (com.google.cloud.sql.v1.SqlSslCertsInsertRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1.SqlSslCertsListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeleteMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_DELETE))) + .addMethod( + getGetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlSslCertsGetRequest, com.google.cloud.sql.v1.SslCert>( + service, METHODID_GET))) + .addMethod( + getInsertMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlSslCertsInsertRequest, + com.google.cloud.sql.v1.SslCertsInsertResponse>(service, METHODID_INSERT))) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlSslCertsListRequest, + com.google.cloud.sql.v1.SslCertsListResponse>(service, METHODID_LIST))) + .build(); + } + + private abstract static class SqlSslCertsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlSslCertsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlSslCertsService"); + } + } + + private static final class SqlSslCertsServiceFileDescriptorSupplier + extends SqlSslCertsServiceBaseDescriptorSupplier { + SqlSslCertsServiceFileDescriptorSupplier() {} + } + + private static final class SqlSslCertsServiceMethodDescriptorSupplier + extends SqlSslCertsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlSslCertsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlSslCertsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlSslCertsServiceFileDescriptorSupplier()) + .addMethod(getDeleteMethod()) + .addMethod(getGetMethod()) + .addMethod(getInsertMethod()) + .addMethod(getListMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlTiersServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlTiersServiceGrpc.java new file mode 100644 index 000000000000..02c46cc00ca0 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlTiersServiceGrpc.java @@ -0,0 +1,420 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for providing machine types (tiers) for Cloud SQL instances.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlTiersServiceGrpc { + + private SqlTiersServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1.SqlTiersService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlTiersListRequest, com.google.cloud.sql.v1.TiersListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1.SqlTiersListRequest.class, + responseType = com.google.cloud.sql.v1.TiersListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlTiersListRequest, com.google.cloud.sql.v1.TiersListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlTiersListRequest, com.google.cloud.sql.v1.TiersListResponse> + getListMethod; + if ((getListMethod = SqlTiersServiceGrpc.getListMethod) == null) { + synchronized (SqlTiersServiceGrpc.class) { + if ((getListMethod = SqlTiersServiceGrpc.getListMethod) == null) { + SqlTiersServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlTiersListRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.TiersListResponse.getDefaultInstance())) + .setSchemaDescriptor(new SqlTiersServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlTiersServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlTiersServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceStub(channel, callOptions); + } + }; + return SqlTiersServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlTiersServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlTiersServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlTiersServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlTiersServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlTiersServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceBlockingStub(channel, callOptions); + } + }; + return SqlTiersServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlTiersServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlTiersServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceFutureStub(channel, callOptions); + } + }; + return SqlTiersServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for providing machine types (tiers) for Cloud SQL instances.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists all available machine types (tiers) for Cloud SQL, for example,
+     * `db-custom-1-3840`. For more information, see
+     * https://cloud.google.com/sql/pricing.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1.SqlTiersListRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SqlTiersService. + * + *
+   * Service for providing machine types (tiers) for Cloud SQL instances.
+   * 
+ */ + public abstract static class SqlTiersServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlTiersServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlTiersService. + * + *
+   * Service for providing machine types (tiers) for Cloud SQL instances.
+   * 
+ */ + public static final class SqlTiersServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlTiersServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlTiersServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available machine types (tiers) for Cloud SQL, for example,
+     * `db-custom-1-3840`. For more information, see
+     * https://cloud.google.com/sql/pricing.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1.SqlTiersListRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlTiersService. + * + *
+   * Service for providing machine types (tiers) for Cloud SQL instances.
+   * 
+ */ + public static final class SqlTiersServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlTiersServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlTiersServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available machine types (tiers) for Cloud SQL, for example,
+     * `db-custom-1-3840`. For more information, see
+     * https://cloud.google.com/sql/pricing.
+     * 
+ */ + public com.google.cloud.sql.v1.TiersListResponse list( + com.google.cloud.sql.v1.SqlTiersListRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlTiersService. + * + *
+   * Service for providing machine types (tiers) for Cloud SQL instances.
+   * 
+ */ + public static final class SqlTiersServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlTiersServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlTiersServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available machine types (tiers) for Cloud SQL, for example,
+     * `db-custom-1-3840`. For more information, see
+     * https://cloud.google.com/sql/pricing.
+     * 
+ */ + public com.google.cloud.sql.v1.TiersListResponse list( + com.google.cloud.sql.v1.SqlTiersListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlTiersService. + * + *
+   * Service for providing machine types (tiers) for Cloud SQL instances.
+   * 
+ */ + public static final class SqlTiersServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlTiersServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlTiersServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available machine types (tiers) for Cloud SQL, for example,
+     * `db-custom-1-3840`. For more information, see
+     * https://cloud.google.com/sql/pricing.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.TiersListResponse> + list(com.google.cloud.sql.v1.SqlTiersListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1.SqlTiersListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlTiersListRequest, + com.google.cloud.sql.v1.TiersListResponse>(service, METHODID_LIST))) + .build(); + } + + private abstract static class SqlTiersServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlTiersServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlTiersProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlTiersService"); + } + } + + private static final class SqlTiersServiceFileDescriptorSupplier + extends SqlTiersServiceBaseDescriptorSupplier { + SqlTiersServiceFileDescriptorSupplier() {} + } + + private static final class SqlTiersServiceMethodDescriptorSupplier + extends SqlTiersServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlTiersServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlTiersServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlTiersServiceFileDescriptorSupplier()) + .addMethod(getListMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersServiceGrpc.java new file mode 100644 index 000000000000..053ef651f2d4 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersServiceGrpc.java @@ -0,0 +1,888 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Cloud SQL users service.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlUsersServiceGrpc { + + private SqlUsersServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1.SqlUsersService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Delete", + requestType = com.google.cloud.sql.v1.SqlUsersDeleteRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersDeleteRequest, com.google.cloud.sql.v1.Operation> + getDeleteMethod; + if ((getDeleteMethod = SqlUsersServiceGrpc.getDeleteMethod) == null) { + synchronized (SqlUsersServiceGrpc.class) { + if ((getDeleteMethod = SqlUsersServiceGrpc.getDeleteMethod) == null) { + SqlUsersServiceGrpc.getDeleteMethod = + getDeleteMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Delete")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlUsersDeleteRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlUsersServiceMethodDescriptorSupplier("Delete")) + .build(); + } + } + } + return getDeleteMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersGetRequest, com.google.cloud.sql.v1.User> + getGetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Get", + requestType = com.google.cloud.sql.v1.SqlUsersGetRequest.class, + responseType = com.google.cloud.sql.v1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersGetRequest, com.google.cloud.sql.v1.User> + getGetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersGetRequest, com.google.cloud.sql.v1.User> + getGetMethod; + if ((getGetMethod = SqlUsersServiceGrpc.getGetMethod) == null) { + synchronized (SqlUsersServiceGrpc.class) { + if ((getGetMethod = SqlUsersServiceGrpc.getGetMethod) == null) { + SqlUsersServiceGrpc.getGetMethod = + getGetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Get")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlUsersGetRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.User.getDefaultInstance())) + .setSchemaDescriptor(new SqlUsersServiceMethodDescriptorSupplier("Get")) + .build(); + } + } + } + return getGetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersInsertRequest, com.google.cloud.sql.v1.Operation> + getInsertMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Insert", + requestType = com.google.cloud.sql.v1.SqlUsersInsertRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersInsertRequest, com.google.cloud.sql.v1.Operation> + getInsertMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersInsertRequest, com.google.cloud.sql.v1.Operation> + getInsertMethod; + if ((getInsertMethod = SqlUsersServiceGrpc.getInsertMethod) == null) { + synchronized (SqlUsersServiceGrpc.class) { + if ((getInsertMethod = SqlUsersServiceGrpc.getInsertMethod) == null) { + SqlUsersServiceGrpc.getInsertMethod = + getInsertMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Insert")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlUsersInsertRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlUsersServiceMethodDescriptorSupplier("Insert")) + .build(); + } + } + } + return getInsertMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersListRequest, com.google.cloud.sql.v1.UsersListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1.SqlUsersListRequest.class, + responseType = com.google.cloud.sql.v1.UsersListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersListRequest, com.google.cloud.sql.v1.UsersListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersListRequest, com.google.cloud.sql.v1.UsersListResponse> + getListMethod; + if ((getListMethod = SqlUsersServiceGrpc.getListMethod) == null) { + synchronized (SqlUsersServiceGrpc.class) { + if ((getListMethod = SqlUsersServiceGrpc.getListMethod) == null) { + SqlUsersServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlUsersListRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.UsersListResponse.getDefaultInstance())) + .setSchemaDescriptor(new SqlUsersServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersUpdateRequest, com.google.cloud.sql.v1.Operation> + getUpdateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Update", + requestType = com.google.cloud.sql.v1.SqlUsersUpdateRequest.class, + responseType = com.google.cloud.sql.v1.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersUpdateRequest, com.google.cloud.sql.v1.Operation> + getUpdateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1.SqlUsersUpdateRequest, com.google.cloud.sql.v1.Operation> + getUpdateMethod; + if ((getUpdateMethod = SqlUsersServiceGrpc.getUpdateMethod) == null) { + synchronized (SqlUsersServiceGrpc.class) { + if ((getUpdateMethod = SqlUsersServiceGrpc.getUpdateMethod) == null) { + SqlUsersServiceGrpc.getUpdateMethod = + getUpdateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Update")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.SqlUsersUpdateRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlUsersServiceMethodDescriptorSupplier("Update")) + .build(); + } + } + } + return getUpdateMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlUsersServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlUsersServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceStub(channel, callOptions); + } + }; + return SqlUsersServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlUsersServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlUsersServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlUsersServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlUsersServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlUsersServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceBlockingStub(channel, callOptions); + } + }; + return SqlUsersServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlUsersServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlUsersServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceFutureStub(channel, callOptions); + } + }; + return SqlUsersServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Cloud SQL users service.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Deletes a user from a Cloud SQL instance.
+     * 
+ */ + default void delete( + com.google.cloud.sql.v1.SqlUsersDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a user.
+     * 
+ */ + default void get( + com.google.cloud.sql.v1.SqlUsersGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new user in a Cloud SQL instance.
+     * 
+ */ + default void insert( + com.google.cloud.sql.v1.SqlUsersInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getInsertMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists users in the specified Cloud SQL instance.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1.SqlUsersListRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an existing user in a Cloud SQL instance.
+     * 
+ */ + default void update( + com.google.cloud.sql.v1.SqlUsersUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SqlUsersService. + * + *
+   * Cloud SQL users service.
+   * 
+ */ + public abstract static class SqlUsersServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlUsersServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlUsersService. + * + *
+   * Cloud SQL users service.
+   * 
+ */ + public static final class SqlUsersServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlUsersServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlUsersServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a user from a Cloud SQL instance.
+     * 
+ */ + public void delete( + com.google.cloud.sql.v1.SqlUsersDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a user.
+     * 
+ */ + public void get( + com.google.cloud.sql.v1.SqlUsersGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new user in a Cloud SQL instance.
+     * 
+ */ + public void insert( + com.google.cloud.sql.v1.SqlUsersInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists users in the specified Cloud SQL instance.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1.SqlUsersListRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates an existing user in a Cloud SQL instance.
+     * 
+ */ + public void update( + com.google.cloud.sql.v1.SqlUsersUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlUsersService. + * + *
+   * Cloud SQL users service.
+   * 
+ */ + public static final class SqlUsersServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlUsersServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlUsersServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a user from a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation delete( + com.google.cloud.sql.v1.SqlUsersDeleteRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a user.
+     * 
+ */ + public com.google.cloud.sql.v1.User get(com.google.cloud.sql.v1.SqlUsersGetRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new user in a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation insert( + com.google.cloud.sql.v1.SqlUsersInsertRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists users in the specified Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.UsersListResponse list( + com.google.cloud.sql.v1.SqlUsersListRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing user in a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation update( + com.google.cloud.sql.v1.SqlUsersUpdateRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlUsersService. + * + *
+   * Cloud SQL users service.
+   * 
+ */ + public static final class SqlUsersServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlUsersServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlUsersServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a user from a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation delete( + com.google.cloud.sql.v1.SqlUsersDeleteRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a user.
+     * 
+ */ + public com.google.cloud.sql.v1.User get(com.google.cloud.sql.v1.SqlUsersGetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new user in a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation insert( + com.google.cloud.sql.v1.SqlUsersInsertRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists users in the specified Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.UsersListResponse list( + com.google.cloud.sql.v1.SqlUsersListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing user in a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1.Operation update( + com.google.cloud.sql.v1.SqlUsersUpdateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlUsersService. + * + *
+   * Cloud SQL users service.
+   * 
+ */ + public static final class SqlUsersServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlUsersServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlUsersServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a user from a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + delete(com.google.cloud.sql.v1.SqlUsersDeleteRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a user.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture get( + com.google.cloud.sql.v1.SqlUsersGetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new user in a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + insert(com.google.cloud.sql.v1.SqlUsersInsertRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists users in the specified Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1.UsersListResponse> + list(com.google.cloud.sql.v1.SqlUsersListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an existing user in a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + update(com.google.cloud.sql.v1.SqlUsersUpdateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_DELETE = 0; + private static final int METHODID_GET = 1; + private static final int METHODID_INSERT = 2; + private static final int METHODID_LIST = 3; + private static final int METHODID_UPDATE = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_DELETE: + serviceImpl.delete( + (com.google.cloud.sql.v1.SqlUsersDeleteRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET: + serviceImpl.get( + (com.google.cloud.sql.v1.SqlUsersGetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_INSERT: + serviceImpl.insert( + (com.google.cloud.sql.v1.SqlUsersInsertRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1.SqlUsersListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE: + serviceImpl.update( + (com.google.cloud.sql.v1.SqlUsersUpdateRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeleteMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlUsersDeleteRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_DELETE))) + .addMethod( + getGetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlUsersGetRequest, com.google.cloud.sql.v1.User>( + service, METHODID_GET))) + .addMethod( + getInsertMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlUsersInsertRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_INSERT))) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlUsersListRequest, + com.google.cloud.sql.v1.UsersListResponse>(service, METHODID_LIST))) + .addMethod( + getUpdateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1.SqlUsersUpdateRequest, + com.google.cloud.sql.v1.Operation>(service, METHODID_UPDATE))) + .build(); + } + + private abstract static class SqlUsersServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlUsersServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlUsersService"); + } + } + + private static final class SqlUsersServiceFileDescriptorSupplier + extends SqlUsersServiceBaseDescriptorSupplier { + SqlUsersServiceFileDescriptorSupplier() {} + } + + private static final class SqlUsersServiceMethodDescriptorSupplier + extends SqlUsersServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlUsersServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlUsersServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlUsersServiceFileDescriptorSupplier()) + .addMethod(getDeleteMethod()) + .addMethod(getGetMethod()) + .addMethod(getInsertMethod()) + .addMethod(getListMethod()) + .addMethod(getUpdateMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1beta4/pom.xml b/java-sql/grpc-google-cloud-sql-v1beta4/pom.xml new file mode 100644 index 000000000000..bfac490cf131 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1beta4/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-sql-v1beta4 + 0.1.0-SNAPSHOT + grpc-google-cloud-sql-v1beta4 + GRPC library for google-cloud-sql + + com.google.cloud + google-cloud-sql-parent + 0.1.0-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-sql-v1beta4 + + + com.google.guava + guava + + + diff --git a/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceGrpc.java new file mode 100644 index 000000000000..062363d19c3f --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceGrpc.java @@ -0,0 +1,777 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1beta4; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlBackupRunsServiceGrpc { + + private SqlBackupRunsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.sql.v1beta4.SqlBackupRunsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Delete", + requestType = com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod; + if ((getDeleteMethod = SqlBackupRunsServiceGrpc.getDeleteMethod) == null) { + synchronized (SqlBackupRunsServiceGrpc.class) { + if ((getDeleteMethod = SqlBackupRunsServiceGrpc.getDeleteMethod) == null) { + SqlBackupRunsServiceGrpc.getDeleteMethod = + getDeleteMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Delete")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlBackupRunsServiceMethodDescriptorSupplier("Delete")) + .build(); + } + } + } + return getDeleteMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest, + com.google.cloud.sql.v1beta4.BackupRun> + getGetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Get", + requestType = com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest.class, + responseType = com.google.cloud.sql.v1beta4.BackupRun.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest, + com.google.cloud.sql.v1beta4.BackupRun> + getGetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest, + com.google.cloud.sql.v1beta4.BackupRun> + getGetMethod; + if ((getGetMethod = SqlBackupRunsServiceGrpc.getGetMethod) == null) { + synchronized (SqlBackupRunsServiceGrpc.class) { + if ((getGetMethod = SqlBackupRunsServiceGrpc.getGetMethod) == null) { + SqlBackupRunsServiceGrpc.getGetMethod = + getGetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Get")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.BackupRun.getDefaultInstance())) + .setSchemaDescriptor(new SqlBackupRunsServiceMethodDescriptorSupplier("Get")) + .build(); + } + } + } + return getGetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest, + com.google.cloud.sql.v1beta4.Operation> + getInsertMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Insert", + requestType = com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest, + com.google.cloud.sql.v1beta4.Operation> + getInsertMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest, + com.google.cloud.sql.v1beta4.Operation> + getInsertMethod; + if ((getInsertMethod = SqlBackupRunsServiceGrpc.getInsertMethod) == null) { + synchronized (SqlBackupRunsServiceGrpc.class) { + if ((getInsertMethod = SqlBackupRunsServiceGrpc.getInsertMethod) == null) { + SqlBackupRunsServiceGrpc.getInsertMethod = + getInsertMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Insert")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlBackupRunsServiceMethodDescriptorSupplier("Insert")) + .build(); + } + } + } + return getInsertMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest, + com.google.cloud.sql.v1beta4.BackupRunsListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest.class, + responseType = com.google.cloud.sql.v1beta4.BackupRunsListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest, + com.google.cloud.sql.v1beta4.BackupRunsListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest, + com.google.cloud.sql.v1beta4.BackupRunsListResponse> + getListMethod; + if ((getListMethod = SqlBackupRunsServiceGrpc.getListMethod) == null) { + synchronized (SqlBackupRunsServiceGrpc.class) { + if ((getListMethod = SqlBackupRunsServiceGrpc.getListMethod) == null) { + SqlBackupRunsServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.BackupRunsListResponse + .getDefaultInstance())) + .setSchemaDescriptor(new SqlBackupRunsServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlBackupRunsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupRunsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceStub(channel, callOptions); + } + }; + return SqlBackupRunsServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlBackupRunsServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupRunsServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlBackupRunsServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlBackupRunsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupRunsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceBlockingStub(channel, callOptions); + } + }; + return SqlBackupRunsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlBackupRunsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupRunsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceFutureStub(channel, callOptions); + } + }; + return SqlBackupRunsServiceFutureStub.newStub(factory, channel); + } + + /** */ + public interface AsyncService { + + /** + * + * + *
+     * Deletes the backup taken by a backup run.
+     * 
+ */ + default void delete( + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup run.
+     * 
+ */ + default void get( + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new backup run on demand.
+     * 
+ */ + default void insert( + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getInsertMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all backup runs associated with the project or a given instance and
+     * configuration in the reverse chronological order of the backup initiation
+     * time.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + } + + /** Base class for the server implementation of the service SqlBackupRunsService. */ + public abstract static class SqlBackupRunsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlBackupRunsServiceGrpc.bindService(this); + } + } + + /** A stub to allow clients to do asynchronous rpc calls to service SqlBackupRunsService. */ + public static final class SqlBackupRunsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlBackupRunsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupRunsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the backup taken by a backup run.
+     * 
+ */ + public void delete( + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup run.
+     * 
+ */ + public void get( + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new backup run on demand.
+     * 
+ */ + public void insert( + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists all backup runs associated with the project or a given instance and
+     * configuration in the reverse chronological order of the backup initiation
+     * time.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + } + + /** A stub to allow clients to do synchronous rpc calls to service SqlBackupRunsService. */ + public static final class SqlBackupRunsServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlBackupRunsServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupRunsServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the backup taken by a backup run.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation delete( + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup run.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.BackupRun get( + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new backup run on demand.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation insert( + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all backup runs associated with the project or a given instance and
+     * configuration in the reverse chronological order of the backup initiation
+     * time.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.BackupRunsListResponse list( + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlBackupRunsService. + */ + public static final class SqlBackupRunsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlBackupRunsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupRunsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the backup taken by a backup run.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation delete( + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup run.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.BackupRun get( + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new backup run on demand.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation insert( + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all backup runs associated with the project or a given instance and
+     * configuration in the reverse chronological order of the backup initiation
+     * time.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.BackupRunsListResponse list( + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlBackupRunsService. + */ + public static final class SqlBackupRunsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlBackupRunsServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupRunsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupRunsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the backup taken by a backup run.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + delete(com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup run.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.BackupRun> + get(com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new backup run on demand.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + insert(com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all backup runs associated with the project or a given instance and
+     * configuration in the reverse chronological order of the backup initiation
+     * time.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.BackupRunsListResponse> + list(com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_DELETE = 0; + private static final int METHODID_GET = 1; + private static final int METHODID_INSERT = 2; + private static final int METHODID_LIST = 3; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_DELETE: + serviceImpl.delete( + (com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET: + serviceImpl.get( + (com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_INSERT: + serviceImpl.insert( + (com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeleteMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_DELETE))) + .addMethod( + getGetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest, + com.google.cloud.sql.v1beta4.BackupRun>(service, METHODID_GET))) + .addMethod( + getInsertMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_INSERT))) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest, + com.google.cloud.sql.v1beta4.BackupRunsListResponse>(service, METHODID_LIST))) + .build(); + } + + private abstract static class SqlBackupRunsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlBackupRunsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlBackupRunsService"); + } + } + + private static final class SqlBackupRunsServiceFileDescriptorSupplier + extends SqlBackupRunsServiceBaseDescriptorSupplier { + SqlBackupRunsServiceFileDescriptorSupplier() {} + } + + private static final class SqlBackupRunsServiceMethodDescriptorSupplier + extends SqlBackupRunsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlBackupRunsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlBackupRunsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlBackupRunsServiceFileDescriptorSupplier()) + .addMethod(getDeleteMethod()) + .addMethod(getGetMethod()) + .addMethod(getInsertMethod()) + .addMethod(getListMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceGrpc.java new file mode 100644 index 000000000000..c1d6bc5bba0e --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupsServiceGrpc.java @@ -0,0 +1,898 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1beta4; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlBackupsServiceGrpc { + + private SqlBackupsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1beta4.SqlBackupsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.CreateBackupRequest, com.google.cloud.sql.v1beta4.Operation> + getCreateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBackup", + requestType = com.google.cloud.sql.v1beta4.CreateBackupRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.CreateBackupRequest, com.google.cloud.sql.v1beta4.Operation> + getCreateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.CreateBackupRequest, + com.google.cloud.sql.v1beta4.Operation> + getCreateBackupMethod; + if ((getCreateBackupMethod = SqlBackupsServiceGrpc.getCreateBackupMethod) == null) { + synchronized (SqlBackupsServiceGrpc.class) { + if ((getCreateBackupMethod = SqlBackupsServiceGrpc.getCreateBackupMethod) == null) { + SqlBackupsServiceGrpc.getCreateBackupMethod = + getCreateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.CreateBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlBackupsServiceMethodDescriptorSupplier("CreateBackup")) + .build(); + } + } + } + return getCreateBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.GetBackupRequest, com.google.cloud.sql.v1beta4.Backup> + getGetBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBackup", + requestType = com.google.cloud.sql.v1beta4.GetBackupRequest.class, + responseType = com.google.cloud.sql.v1beta4.Backup.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.GetBackupRequest, com.google.cloud.sql.v1beta4.Backup> + getGetBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.GetBackupRequest, com.google.cloud.sql.v1beta4.Backup> + getGetBackupMethod; + if ((getGetBackupMethod = SqlBackupsServiceGrpc.getGetBackupMethod) == null) { + synchronized (SqlBackupsServiceGrpc.class) { + if ((getGetBackupMethod = SqlBackupsServiceGrpc.getGetBackupMethod) == null) { + SqlBackupsServiceGrpc.getGetBackupMethod = + getGetBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Backup.getDefaultInstance())) + .setSchemaDescriptor( + new SqlBackupsServiceMethodDescriptorSupplier("GetBackup")) + .build(); + } + } + } + return getGetBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.ListBackupsRequest, + com.google.cloud.sql.v1beta4.ListBackupsResponse> + getListBackupsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBackups", + requestType = com.google.cloud.sql.v1beta4.ListBackupsRequest.class, + responseType = com.google.cloud.sql.v1beta4.ListBackupsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.ListBackupsRequest, + com.google.cloud.sql.v1beta4.ListBackupsResponse> + getListBackupsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.ListBackupsRequest, + com.google.cloud.sql.v1beta4.ListBackupsResponse> + getListBackupsMethod; + if ((getListBackupsMethod = SqlBackupsServiceGrpc.getListBackupsMethod) == null) { + synchronized (SqlBackupsServiceGrpc.class) { + if ((getListBackupsMethod = SqlBackupsServiceGrpc.getListBackupsMethod) == null) { + SqlBackupsServiceGrpc.getListBackupsMethod = + getListBackupsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBackups")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.ListBackupsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.ListBackupsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlBackupsServiceMethodDescriptorSupplier("ListBackups")) + .build(); + } + } + } + return getListBackupsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.UpdateBackupRequest, com.google.cloud.sql.v1beta4.Operation> + getUpdateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBackup", + requestType = com.google.cloud.sql.v1beta4.UpdateBackupRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.UpdateBackupRequest, com.google.cloud.sql.v1beta4.Operation> + getUpdateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.UpdateBackupRequest, + com.google.cloud.sql.v1beta4.Operation> + getUpdateBackupMethod; + if ((getUpdateBackupMethod = SqlBackupsServiceGrpc.getUpdateBackupMethod) == null) { + synchronized (SqlBackupsServiceGrpc.class) { + if ((getUpdateBackupMethod = SqlBackupsServiceGrpc.getUpdateBackupMethod) == null) { + SqlBackupsServiceGrpc.getUpdateBackupMethod = + getUpdateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.UpdateBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlBackupsServiceMethodDescriptorSupplier("UpdateBackup")) + .build(); + } + } + } + return getUpdateBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.DeleteBackupRequest, com.google.cloud.sql.v1beta4.Operation> + getDeleteBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBackup", + requestType = com.google.cloud.sql.v1beta4.DeleteBackupRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.DeleteBackupRequest, com.google.cloud.sql.v1beta4.Operation> + getDeleteBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.DeleteBackupRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteBackupMethod; + if ((getDeleteBackupMethod = SqlBackupsServiceGrpc.getDeleteBackupMethod) == null) { + synchronized (SqlBackupsServiceGrpc.class) { + if ((getDeleteBackupMethod = SqlBackupsServiceGrpc.getDeleteBackupMethod) == null) { + SqlBackupsServiceGrpc.getDeleteBackupMethod = + getDeleteBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.DeleteBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlBackupsServiceMethodDescriptorSupplier("DeleteBackup")) + .build(); + } + } + } + return getDeleteBackupMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlBackupsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceStub(channel, callOptions); + } + }; + return SqlBackupsServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlBackupsServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupsServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlBackupsServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlBackupsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceBlockingStub(channel, callOptions); + } + }; + return SqlBackupsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlBackupsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlBackupsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceFutureStub(channel, callOptions); + } + }; + return SqlBackupsServiceFutureStub.newStub(factory, channel); + } + + /** */ + public interface AsyncService { + + /** + * + * + *
+     * Creates a backup for a Cloud SQL instance. This API can be used only to
+     * create on-demand backups.
+     * 
+ */ + default void createBackup( + com.google.cloud.sql.v1beta4.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup.
+     * 
+ */ + default void getBackup( + com.google.cloud.sql.v1beta4.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all backups associated with the project.
+     * 
+ */ + default void listBackups( + com.google.cloud.sql.v1beta4.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListBackupsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the retention period and the description of the backup. You can use
+     * this API to update final backups only.
+     * 
+ */ + default void updateBackup( + com.google.cloud.sql.v1beta4.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the backup.
+     * 
+ */ + default void deleteBackup( + com.google.cloud.sql.v1beta4.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBackupMethod(), responseObserver); + } + } + + /** Base class for the server implementation of the service SqlBackupsService. */ + public abstract static class SqlBackupsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlBackupsServiceGrpc.bindService(this); + } + } + + /** A stub to allow clients to do asynchronous rpc calls to service SqlBackupsService. */ + public static final class SqlBackupsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlBackupsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a backup for a Cloud SQL instance. This API can be used only to
+     * create on-demand backups.
+     * 
+ */ + public void createBackup( + com.google.cloud.sql.v1beta4.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup.
+     * 
+ */ + public void getBackup( + com.google.cloud.sql.v1beta4.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists all backups associated with the project.
+     * 
+ */ + public void listBackups( + com.google.cloud.sql.v1beta4.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the retention period and the description of the backup. You can use
+     * this API to update final backups only.
+     * 
+ */ + public void updateBackup( + com.google.cloud.sql.v1beta4.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the backup.
+     * 
+ */ + public void deleteBackup( + com.google.cloud.sql.v1beta4.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** A stub to allow clients to do synchronous rpc calls to service SqlBackupsService. */ + public static final class SqlBackupsServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlBackupsServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupsServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a backup for a Cloud SQL instance. This API can be used only to
+     * create on-demand backups.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation createBackup( + com.google.cloud.sql.v1beta4.CreateBackupRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Backup getBackup( + com.google.cloud.sql.v1beta4.GetBackupRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all backups associated with the project.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.ListBackupsResponse listBackups( + com.google.cloud.sql.v1beta4.ListBackupsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListBackupsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the retention period and the description of the backup. You can use
+     * this API to update final backups only.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation updateBackup( + com.google.cloud.sql.v1beta4.UpdateBackupRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the backup.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation deleteBackup( + com.google.cloud.sql.v1beta4.DeleteBackupRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteBackupMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do limited synchronous rpc calls to service SqlBackupsService. */ + public static final class SqlBackupsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlBackupsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a backup for a Cloud SQL instance. This API can be used only to
+     * create on-demand backups.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation createBackup( + com.google.cloud.sql.v1beta4.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Backup getBackup( + com.google.cloud.sql.v1beta4.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all backups associated with the project.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.ListBackupsResponse listBackups( + com.google.cloud.sql.v1beta4.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBackupsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the retention period and the description of the backup. You can use
+     * this API to update final backups only.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation updateBackup( + com.google.cloud.sql.v1beta4.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the backup.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation deleteBackup( + com.google.cloud.sql.v1beta4.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBackupMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlBackupsService. + */ + public static final class SqlBackupsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlBackupsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlBackupsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlBackupsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a backup for a Cloud SQL instance. This API can be used only to
+     * create on-demand backups.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + createBackup(com.google.cloud.sql.v1beta4.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getBackup(com.google.cloud.sql.v1beta4.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all backups associated with the project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.ListBackupsResponse> + listBackups(com.google.cloud.sql.v1beta4.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the retention period and the description of the backup. You can use
+     * this API to update final backups only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + updateBackup(com.google.cloud.sql.v1beta4.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + deleteBackup(com.google.cloud.sql.v1beta4.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_BACKUP = 0; + private static final int METHODID_GET_BACKUP = 1; + private static final int METHODID_LIST_BACKUPS = 2; + private static final int METHODID_UPDATE_BACKUP = 3; + private static final int METHODID_DELETE_BACKUP = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_BACKUP: + serviceImpl.createBackup( + (com.google.cloud.sql.v1beta4.CreateBackupRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_BACKUP: + serviceImpl.getBackup( + (com.google.cloud.sql.v1beta4.GetBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_BACKUPS: + serviceImpl.listBackups( + (com.google.cloud.sql.v1beta4.ListBackupsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_BACKUP: + serviceImpl.updateBackup( + (com.google.cloud.sql.v1beta4.UpdateBackupRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_BACKUP: + serviceImpl.deleteBackup( + (com.google.cloud.sql.v1beta4.DeleteBackupRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.CreateBackupRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_CREATE_BACKUP))) + .addMethod( + getGetBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.GetBackupRequest, + com.google.cloud.sql.v1beta4.Backup>(service, METHODID_GET_BACKUP))) + .addMethod( + getListBackupsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.ListBackupsRequest, + com.google.cloud.sql.v1beta4.ListBackupsResponse>( + service, METHODID_LIST_BACKUPS))) + .addMethod( + getUpdateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.UpdateBackupRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_UPDATE_BACKUP))) + .addMethod( + getDeleteBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.DeleteBackupRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_DELETE_BACKUP))) + .build(); + } + + private abstract static class SqlBackupsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlBackupsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlBackupsService"); + } + } + + private static final class SqlBackupsServiceFileDescriptorSupplier + extends SqlBackupsServiceBaseDescriptorSupplier { + SqlBackupsServiceFileDescriptorSupplier() {} + } + + private static final class SqlBackupsServiceMethodDescriptorSupplier + extends SqlBackupsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlBackupsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlBackupsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlBackupsServiceFileDescriptorSupplier()) + .addMethod(getCreateBackupMethod()) + .addMethod(getGetBackupMethod()) + .addMethod(getListBackupsMethod()) + .addMethod(getUpdateBackupMethod()) + .addMethod(getDeleteBackupMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlConnectServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlConnectServiceGrpc.java new file mode 100644 index 000000000000..65403dd71c07 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlConnectServiceGrpc.java @@ -0,0 +1,722 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1beta4; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Cloud SQL connect service.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlConnectServiceGrpc { + + private SqlConnectServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1beta4.SqlConnectService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest, + com.google.cloud.sql.v1beta4.ConnectSettings> + getGetConnectSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConnectSettings", + requestType = com.google.cloud.sql.v1beta4.GetConnectSettingsRequest.class, + responseType = com.google.cloud.sql.v1beta4.ConnectSettings.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest, + com.google.cloud.sql.v1beta4.ConnectSettings> + getGetConnectSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest, + com.google.cloud.sql.v1beta4.ConnectSettings> + getGetConnectSettingsMethod; + if ((getGetConnectSettingsMethod = SqlConnectServiceGrpc.getGetConnectSettingsMethod) == null) { + synchronized (SqlConnectServiceGrpc.class) { + if ((getGetConnectSettingsMethod = SqlConnectServiceGrpc.getGetConnectSettingsMethod) + == null) { + SqlConnectServiceGrpc.getGetConnectSettingsMethod = + getGetConnectSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConnectSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.ConnectSettings.getDefaultInstance())) + .setSchemaDescriptor( + new SqlConnectServiceMethodDescriptorSupplier("GetConnectSettings")) + .build(); + } + } + } + return getGetConnectSettingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest, + com.google.cloud.sql.v1beta4.ConnectSettings> + getResolveConnectSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ResolveConnectSettings", + requestType = com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest.class, + responseType = com.google.cloud.sql.v1beta4.ConnectSettings.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest, + com.google.cloud.sql.v1beta4.ConnectSettings> + getResolveConnectSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest, + com.google.cloud.sql.v1beta4.ConnectSettings> + getResolveConnectSettingsMethod; + if ((getResolveConnectSettingsMethod = SqlConnectServiceGrpc.getResolveConnectSettingsMethod) + == null) { + synchronized (SqlConnectServiceGrpc.class) { + if ((getResolveConnectSettingsMethod = + SqlConnectServiceGrpc.getResolveConnectSettingsMethod) + == null) { + SqlConnectServiceGrpc.getResolveConnectSettingsMethod = + getResolveConnectSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ResolveConnectSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.ConnectSettings.getDefaultInstance())) + .setSchemaDescriptor( + new SqlConnectServiceMethodDescriptorSupplier("ResolveConnectSettings")) + .build(); + } + } + } + return getResolveConnectSettingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest, + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse> + getGenerateEphemeralCertMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateEphemeralCert", + requestType = com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest.class, + responseType = com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest, + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse> + getGenerateEphemeralCertMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest, + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse> + getGenerateEphemeralCertMethod; + if ((getGenerateEphemeralCertMethod = SqlConnectServiceGrpc.getGenerateEphemeralCertMethod) + == null) { + synchronized (SqlConnectServiceGrpc.class) { + if ((getGenerateEphemeralCertMethod = SqlConnectServiceGrpc.getGenerateEphemeralCertMethod) + == null) { + SqlConnectServiceGrpc.getGenerateEphemeralCertMethod = + getGenerateEphemeralCertMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GenerateEphemeralCert")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlConnectServiceMethodDescriptorSupplier("GenerateEphemeralCert")) + .build(); + } + } + } + return getGenerateEphemeralCertMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlConnectServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlConnectServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceStub(channel, callOptions); + } + }; + return SqlConnectServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlConnectServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlConnectServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlConnectServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlConnectServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlConnectServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceBlockingStub(channel, callOptions); + } + }; + return SqlConnectServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlConnectServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlConnectServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceFutureStub(channel, callOptions); + } + }; + return SqlConnectServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Cloud SQL connect service.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance.
+     * 
+ */ + default void getConnectSettings( + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetConnectSettingsMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance using the instance
+     * DNS name.
+     * 
+ */ + default void resolveConnectSettings( + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getResolveConnectSettingsMethod(), responseObserver); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + default void generateEphemeralCert( + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateEphemeralCertMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SqlConnectService. + * + *
+   * Cloud SQL connect service.
+   * 
+ */ + public abstract static class SqlConnectServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlConnectServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlConnectService. + * + *
+   * Cloud SQL connect service.
+   * 
+ */ + public static final class SqlConnectServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlConnectServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlConnectServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance.
+     * 
+ */ + public void getConnectSettings( + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetConnectSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance using the instance
+     * DNS name.
+     * 
+ */ + public void resolveConnectSettings( + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getResolveConnectSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public void generateEphemeralCert( + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGenerateEphemeralCertMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlConnectService. + * + *
+   * Cloud SQL connect service.
+   * 
+ */ + public static final class SqlConnectServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlConnectServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlConnectServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.ConnectSettings getConnectSettings( + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetConnectSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance using the instance
+     * DNS name.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.ConnectSettings resolveConnectSettings( + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getResolveConnectSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse generateEphemeralCert( + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGenerateEphemeralCertMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlConnectService. + * + *
+   * Cloud SQL connect service.
+   * 
+ */ + public static final class SqlConnectServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlConnectServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlConnectServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.ConnectSettings getConnectSettings( + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetConnectSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance using the instance
+     * DNS name.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.ConnectSettings resolveConnectSettings( + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getResolveConnectSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse generateEphemeralCert( + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGenerateEphemeralCertMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlConnectService. + * + *
+   * Cloud SQL connect service.
+   * 
+ */ + public static final class SqlConnectServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlConnectServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlConnectServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlConnectServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.ConnectSettings> + getConnectSettings(com.google.cloud.sql.v1beta4.GetConnectSettingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetConnectSettingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves connect settings about a Cloud SQL instance using the instance
+     * DNS name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.ConnectSettings> + resolveConnectSettings(com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getResolveConnectSettingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse> + generateEphemeralCert(com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGenerateEphemeralCertMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_CONNECT_SETTINGS = 0; + private static final int METHODID_RESOLVE_CONNECT_SETTINGS = 1; + private static final int METHODID_GENERATE_EPHEMERAL_CERT = 2; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_CONNECT_SETTINGS: + serviceImpl.getConnectSettings( + (com.google.cloud.sql.v1beta4.GetConnectSettingsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_RESOLVE_CONNECT_SETTINGS: + serviceImpl.resolveConnectSettings( + (com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GENERATE_EPHEMERAL_CERT: + serviceImpl.generateEphemeralCert( + (com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetConnectSettingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest, + com.google.cloud.sql.v1beta4.ConnectSettings>( + service, METHODID_GET_CONNECT_SETTINGS))) + .addMethod( + getResolveConnectSettingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest, + com.google.cloud.sql.v1beta4.ConnectSettings>( + service, METHODID_RESOLVE_CONNECT_SETTINGS))) + .addMethod( + getGenerateEphemeralCertMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest, + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse>( + service, METHODID_GENERATE_EPHEMERAL_CERT))) + .build(); + } + + private abstract static class SqlConnectServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlConnectServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlConnectService"); + } + } + + private static final class SqlConnectServiceFileDescriptorSupplier + extends SqlConnectServiceBaseDescriptorSupplier { + SqlConnectServiceFileDescriptorSupplier() {} + } + + private static final class SqlConnectServiceMethodDescriptorSupplier + extends SqlConnectServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlConnectServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlConnectServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlConnectServiceFileDescriptorSupplier()) + .addMethod(getGetConnectSettingsMethod()) + .addMethod(getResolveConnectSettingsMethod()) + .addMethod(getGenerateEphemeralCertMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDataServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDataServiceGrpc.java new file mode 100644 index 000000000000..13e415acbecf --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDataServiceGrpc.java @@ -0,0 +1,469 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1beta4; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for streaming data to and from Cloud SQL instances.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlDataServiceGrpc { + + private SqlDataServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1beta4.SqlDataService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.StreamSqlDataRequest, + com.google.cloud.sql.v1beta4.StreamSqlDataResponse> + getStreamSqlDataMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamSqlData", + requestType = com.google.cloud.sql.v1beta4.StreamSqlDataRequest.class, + responseType = com.google.cloud.sql.v1beta4.StreamSqlDataResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.StreamSqlDataRequest, + com.google.cloud.sql.v1beta4.StreamSqlDataResponse> + getStreamSqlDataMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.StreamSqlDataRequest, + com.google.cloud.sql.v1beta4.StreamSqlDataResponse> + getStreamSqlDataMethod; + if ((getStreamSqlDataMethod = SqlDataServiceGrpc.getStreamSqlDataMethod) == null) { + synchronized (SqlDataServiceGrpc.class) { + if ((getStreamSqlDataMethod = SqlDataServiceGrpc.getStreamSqlDataMethod) == null) { + SqlDataServiceGrpc.getStreamSqlDataMethod = + getStreamSqlDataMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamSqlData")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.StreamSqlDataRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.StreamSqlDataResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlDataServiceMethodDescriptorSupplier("StreamSqlData")) + .build(); + } + } + } + return getStreamSqlDataMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlDataServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlDataServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDataServiceStub(channel, callOptions); + } + }; + return SqlDataServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlDataServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlDataServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDataServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlDataServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlDataServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlDataServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDataServiceBlockingStub(channel, callOptions); + } + }; + return SqlDataServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlDataServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlDataServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDataServiceFutureStub(channel, callOptions); + } + }; + return SqlDataServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for streaming data to and from Cloud SQL instances.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * `StreamSqlData` establishes a bidirectional stream to a Cloud SQL instance,
+     * and then streams data to and from the instance.
+     * The first message from the client MUST be a `StreamSqlDataRequest` request
+     * with configuration settings, including required values for the
+     * `connection_settings` field. Subsequent messages from the client may
+     * contain the `payload` field.
+     * Messages from the server may contain the `payload` field.
+     * The `payload` fields of the request and response streams contain the raw
+     * data of the database's native wire protocol (e.g., PostgreSQL wire
+     * protocol). The database client is responsible for generating and parsing
+     * this data.
+     * Any errors on initial connection (e.g., connection failure, authorization
+     * issues, network problems) will result in the stream being terminated with
+     * an appropriate RPC status exception.
+     * After a successful connection is made, if an error occurs, then the server
+     * terminates connection and returns the appropriate RPC status exception.
+     * Add the request params headers to the request to ensure that
+     * the streaming request is routed to the correct service for your database.
+     * Use this format for the request params header:
+     *    `x-goog-request-params`:
+     *        location_id={location_path}&instance_id={instance_path}`
+     *  `location_path` is `locations/{location_name}`
+     *  `instance_path` is `projects/{project_name}/instances/{instance_name}`
+     * for example:
+     *     `x-goog-request-params`:
+     *     `location_id=locations/us-central1&instance_id=projects/myproject/instances/instancename`
+     * 
+ */ + default io.grpc.stub.StreamObserver + streamSqlData( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getStreamSqlDataMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SqlDataService. + * + *
+   * Service for streaming data to and from Cloud SQL instances.
+   * 
+ */ + public abstract static class SqlDataServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlDataServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlDataService. + * + *
+   * Service for streaming data to and from Cloud SQL instances.
+   * 
+ */ + public static final class SqlDataServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlDataServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlDataServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDataServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * `StreamSqlData` establishes a bidirectional stream to a Cloud SQL instance,
+     * and then streams data to and from the instance.
+     * The first message from the client MUST be a `StreamSqlDataRequest` request
+     * with configuration settings, including required values for the
+     * `connection_settings` field. Subsequent messages from the client may
+     * contain the `payload` field.
+     * Messages from the server may contain the `payload` field.
+     * The `payload` fields of the request and response streams contain the raw
+     * data of the database's native wire protocol (e.g., PostgreSQL wire
+     * protocol). The database client is responsible for generating and parsing
+     * this data.
+     * Any errors on initial connection (e.g., connection failure, authorization
+     * issues, network problems) will result in the stream being terminated with
+     * an appropriate RPC status exception.
+     * After a successful connection is made, if an error occurs, then the server
+     * terminates connection and returns the appropriate RPC status exception.
+     * Add the request params headers to the request to ensure that
+     * the streaming request is routed to the correct service for your database.
+     * Use this format for the request params header:
+     *    `x-goog-request-params`:
+     *        location_id={location_path}&instance_id={instance_path}`
+     *  `location_path` is `locations/{location_name}`
+     *  `instance_path` is `projects/{project_name}/instances/{instance_name}`
+     * for example:
+     *     `x-goog-request-params`:
+     *     `location_id=locations/us-central1&instance_id=projects/myproject/instances/instancename`
+     * 
+ */ + public io.grpc.stub.StreamObserver + streamSqlData( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getStreamSqlDataMethod(), getCallOptions()), responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlDataService. + * + *
+   * Service for streaming data to and from Cloud SQL instances.
+   * 
+ */ + public static final class SqlDataServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlDataServiceBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlDataServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDataServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * `StreamSqlData` establishes a bidirectional stream to a Cloud SQL instance,
+     * and then streams data to and from the instance.
+     * The first message from the client MUST be a `StreamSqlDataRequest` request
+     * with configuration settings, including required values for the
+     * `connection_settings` field. Subsequent messages from the client may
+     * contain the `payload` field.
+     * Messages from the server may contain the `payload` field.
+     * The `payload` fields of the request and response streams contain the raw
+     * data of the database's native wire protocol (e.g., PostgreSQL wire
+     * protocol). The database client is responsible for generating and parsing
+     * this data.
+     * Any errors on initial connection (e.g., connection failure, authorization
+     * issues, network problems) will result in the stream being terminated with
+     * an appropriate RPC status exception.
+     * After a successful connection is made, if an error occurs, then the server
+     * terminates connection and returns the appropriate RPC status exception.
+     * Add the request params headers to the request to ensure that
+     * the streaming request is routed to the correct service for your database.
+     * Use this format for the request params header:
+     *    `x-goog-request-params`:
+     *        location_id={location_path}&instance_id={instance_path}`
+     *  `location_path` is `locations/{location_name}`
+     *  `instance_path` is `projects/{project_name}/instances/{instance_name}`
+     * for example:
+     *     `x-goog-request-params`:
+     *     `location_id=locations/us-central1&instance_id=projects/myproject/instances/instancename`
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.cloud.sql.v1beta4.StreamSqlDataRequest, + com.google.cloud.sql.v1beta4.StreamSqlDataResponse> + streamSqlData() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getStreamSqlDataMethod(), getCallOptions()); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlDataService. + * + *
+   * Service for streaming data to and from Cloud SQL instances.
+   * 
+ */ + public static final class SqlDataServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlDataServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlDataServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDataServiceBlockingStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlDataService. + * + *
+   * Service for streaming data to and from Cloud SQL instances.
+   * 
+ */ + public static final class SqlDataServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlDataServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlDataServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDataServiceFutureStub(channel, callOptions); + } + } + + private static final int METHODID_STREAM_SQL_DATA = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_STREAM_SQL_DATA: + return (io.grpc.stub.StreamObserver) + serviceImpl.streamSqlData( + (io.grpc.stub.StreamObserver) + responseObserver); + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStreamSqlDataMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.StreamSqlDataRequest, + com.google.cloud.sql.v1beta4.StreamSqlDataResponse>( + service, METHODID_STREAM_SQL_DATA))) + .build(); + } + + private abstract static class SqlDataServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlDataServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlDataService"); + } + } + + private static final class SqlDataServiceFileDescriptorSupplier + extends SqlDataServiceBaseDescriptorSupplier { + SqlDataServiceFileDescriptorSupplier() {} + } + + private static final class SqlDataServiceMethodDescriptorSupplier + extends SqlDataServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlDataServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlDataServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlDataServiceFileDescriptorSupplier()) + .addMethod(getStreamSqlDataMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceGrpc.java new file mode 100644 index 000000000000..d6bb1e436232 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesServiceGrpc.java @@ -0,0 +1,1044 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1beta4; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlDatabasesServiceGrpc { + + private SqlDatabasesServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.sql.v1beta4.SqlDatabasesService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Delete", + requestType = com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod; + if ((getDeleteMethod = SqlDatabasesServiceGrpc.getDeleteMethod) == null) { + synchronized (SqlDatabasesServiceGrpc.class) { + if ((getDeleteMethod = SqlDatabasesServiceGrpc.getDeleteMethod) == null) { + SqlDatabasesServiceGrpc.getDeleteMethod = + getDeleteMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Delete")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlDatabasesServiceMethodDescriptorSupplier("Delete")) + .build(); + } + } + } + return getDeleteMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest, + com.google.cloud.sql.v1beta4.Database> + getGetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Get", + requestType = com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest.class, + responseType = com.google.cloud.sql.v1beta4.Database.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest, + com.google.cloud.sql.v1beta4.Database> + getGetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest, + com.google.cloud.sql.v1beta4.Database> + getGetMethod; + if ((getGetMethod = SqlDatabasesServiceGrpc.getGetMethod) == null) { + synchronized (SqlDatabasesServiceGrpc.class) { + if ((getGetMethod = SqlDatabasesServiceGrpc.getGetMethod) == null) { + SqlDatabasesServiceGrpc.getGetMethod = + getGetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Get")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Database.getDefaultInstance())) + .setSchemaDescriptor(new SqlDatabasesServiceMethodDescriptorSupplier("Get")) + .build(); + } + } + } + return getGetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest, + com.google.cloud.sql.v1beta4.Operation> + getInsertMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Insert", + requestType = com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest, + com.google.cloud.sql.v1beta4.Operation> + getInsertMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest, + com.google.cloud.sql.v1beta4.Operation> + getInsertMethod; + if ((getInsertMethod = SqlDatabasesServiceGrpc.getInsertMethod) == null) { + synchronized (SqlDatabasesServiceGrpc.class) { + if ((getInsertMethod = SqlDatabasesServiceGrpc.getInsertMethod) == null) { + SqlDatabasesServiceGrpc.getInsertMethod = + getInsertMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Insert")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlDatabasesServiceMethodDescriptorSupplier("Insert")) + .build(); + } + } + } + return getInsertMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest, + com.google.cloud.sql.v1beta4.DatabasesListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1beta4.SqlDatabasesListRequest.class, + responseType = com.google.cloud.sql.v1beta4.DatabasesListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest, + com.google.cloud.sql.v1beta4.DatabasesListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest, + com.google.cloud.sql.v1beta4.DatabasesListResponse> + getListMethod; + if ((getListMethod = SqlDatabasesServiceGrpc.getListMethod) == null) { + synchronized (SqlDatabasesServiceGrpc.class) { + if ((getListMethod = SqlDatabasesServiceGrpc.getListMethod) == null) { + SqlDatabasesServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.DatabasesListResponse + .getDefaultInstance())) + .setSchemaDescriptor(new SqlDatabasesServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest, + com.google.cloud.sql.v1beta4.Operation> + getPatchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Patch", + requestType = com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest, + com.google.cloud.sql.v1beta4.Operation> + getPatchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest, + com.google.cloud.sql.v1beta4.Operation> + getPatchMethod; + if ((getPatchMethod = SqlDatabasesServiceGrpc.getPatchMethod) == null) { + synchronized (SqlDatabasesServiceGrpc.class) { + if ((getPatchMethod = SqlDatabasesServiceGrpc.getPatchMethod) == null) { + SqlDatabasesServiceGrpc.getPatchMethod = + getPatchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Patch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlDatabasesServiceMethodDescriptorSupplier("Patch")) + .build(); + } + } + } + return getPatchMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest, + com.google.cloud.sql.v1beta4.Operation> + getUpdateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Update", + requestType = com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest, + com.google.cloud.sql.v1beta4.Operation> + getUpdateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest, + com.google.cloud.sql.v1beta4.Operation> + getUpdateMethod; + if ((getUpdateMethod = SqlDatabasesServiceGrpc.getUpdateMethod) == null) { + synchronized (SqlDatabasesServiceGrpc.class) { + if ((getUpdateMethod = SqlDatabasesServiceGrpc.getUpdateMethod) == null) { + SqlDatabasesServiceGrpc.getUpdateMethod = + getUpdateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Update")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlDatabasesServiceMethodDescriptorSupplier("Update")) + .build(); + } + } + } + return getUpdateMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlDatabasesServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlDatabasesServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceStub(channel, callOptions); + } + }; + return SqlDatabasesServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlDatabasesServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlDatabasesServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlDatabasesServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlDatabasesServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlDatabasesServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceBlockingStub(channel, callOptions); + } + }; + return SqlDatabasesServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlDatabasesServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlDatabasesServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceFutureStub(channel, callOptions); + } + }; + return SqlDatabasesServiceFutureStub.newStub(factory, channel); + } + + /** */ + public interface AsyncService { + + /** + * + * + *
+     * Deletes a database from a Cloud SQL instance.
+     * 
+ */ + default void delete( + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + default void get( + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver); + } + + /** + * + * + *
+     * Inserts a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * **Note:** You can't modify the default character set and collation.
+     * 
+ */ + default void insert( + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getInsertMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists databases in the specified Cloud SQL instance.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + + /** + * + * + *
+     * Partially updates a resource containing information about a database inside
+     * a Cloud SQL instance. This method supports patch semantics.
+     * 
+ */ + default void patch( + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPatchMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + default void update( + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateMethod(), responseObserver); + } + } + + /** Base class for the server implementation of the service SqlDatabasesService. */ + public abstract static class SqlDatabasesServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlDatabasesServiceGrpc.bindService(this); + } + } + + /** A stub to allow clients to do asynchronous rpc calls to service SqlDatabasesService. */ + public static final class SqlDatabasesServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlDatabasesServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlDatabasesServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a database from a Cloud SQL instance.
+     * 
+ */ + public void delete( + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public void get( + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Inserts a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * **Note:** You can't modify the default character set and collation.
+     * 
+ */ + public void insert( + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists databases in the specified Cloud SQL instance.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Partially updates a resource containing information about a database inside
+     * a Cloud SQL instance. This method supports patch semantics.
+     * 
+ */ + public void patch( + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPatchMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public void update( + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateMethod(), getCallOptions()), request, responseObserver); + } + } + + /** A stub to allow clients to do synchronous rpc calls to service SqlDatabasesService. */ + public static final class SqlDatabasesServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlDatabasesServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlDatabasesServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a database from a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation delete( + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Database get( + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Inserts a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * **Note:** You can't modify the default character set and collation.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation insert( + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists databases in the specified Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.DatabasesListResponse list( + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Partially updates a resource containing information about a database inside
+     * a Cloud SQL instance. This method supports patch semantics.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation patch( + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation update( + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do limited synchronous rpc calls to service SqlDatabasesService. */ + public static final class SqlDatabasesServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlDatabasesServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlDatabasesServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a database from a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation delete( + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Database get( + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Inserts a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * **Note:** You can't modify the default character set and collation.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation insert( + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists databases in the specified Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.DatabasesListResponse list( + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Partially updates a resource containing information about a database inside
+     * a Cloud SQL instance. This method supports patch semantics.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation patch( + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation update( + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlDatabasesService. + */ + public static final class SqlDatabasesServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlDatabasesServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlDatabasesServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlDatabasesServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a database from a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + delete(com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + get(com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Inserts a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * **Note:** You can't modify the default character set and collation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + insert(com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists databases in the specified Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.DatabasesListResponse> + list(com.google.cloud.sql.v1beta4.SqlDatabasesListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Partially updates a resource containing information about a database inside
+     * a Cloud SQL instance. This method supports patch semantics.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + patch(com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPatchMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a resource containing information about a database inside a Cloud
+     * SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + update(com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_DELETE = 0; + private static final int METHODID_GET = 1; + private static final int METHODID_INSERT = 2; + private static final int METHODID_LIST = 3; + private static final int METHODID_PATCH = 4; + private static final int METHODID_UPDATE = 5; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_DELETE: + serviceImpl.delete( + (com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET: + serviceImpl.get( + (com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_INSERT: + serviceImpl.insert( + (com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1beta4.SqlDatabasesListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PATCH: + serviceImpl.patch( + (com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE: + serviceImpl.update( + (com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeleteMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_DELETE))) + .addMethod( + getGetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest, + com.google.cloud.sql.v1beta4.Database>(service, METHODID_GET))) + .addMethod( + getInsertMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_INSERT))) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest, + com.google.cloud.sql.v1beta4.DatabasesListResponse>(service, METHODID_LIST))) + .addMethod( + getPatchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_PATCH))) + .addMethod( + getUpdateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_UPDATE))) + .build(); + } + + private abstract static class SqlDatabasesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlDatabasesServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlDatabasesService"); + } + } + + private static final class SqlDatabasesServiceFileDescriptorSupplier + extends SqlDatabasesServiceBaseDescriptorSupplier { + SqlDatabasesServiceFileDescriptorSupplier() {} + } + + private static final class SqlDatabasesServiceMethodDescriptorSupplier + extends SqlDatabasesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlDatabasesServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlDatabasesServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlDatabasesServiceFileDescriptorSupplier()) + .addMethod(getDeleteMethod()) + .addMethod(getGetMethod()) + .addMethod(getInsertMethod()) + .addMethod(getListMethod()) + .addMethod(getPatchMethod()) + .addMethod(getUpdateMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceGrpc.java new file mode 100644 index 000000000000..e0e3e02a4040 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsServiceGrpc.java @@ -0,0 +1,374 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1beta4; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlFlagsServiceGrpc { + + private SqlFlagsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1beta4.SqlFlagsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlFlagsListRequest, + com.google.cloud.sql.v1beta4.FlagsListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1beta4.SqlFlagsListRequest.class, + responseType = com.google.cloud.sql.v1beta4.FlagsListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlFlagsListRequest, + com.google.cloud.sql.v1beta4.FlagsListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlFlagsListRequest, + com.google.cloud.sql.v1beta4.FlagsListResponse> + getListMethod; + if ((getListMethod = SqlFlagsServiceGrpc.getListMethod) == null) { + synchronized (SqlFlagsServiceGrpc.class) { + if ((getListMethod = SqlFlagsServiceGrpc.getListMethod) == null) { + SqlFlagsServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlFlagsListRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.FlagsListResponse.getDefaultInstance())) + .setSchemaDescriptor(new SqlFlagsServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlFlagsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlFlagsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceStub(channel, callOptions); + } + }; + return SqlFlagsServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlFlagsServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlFlagsServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlFlagsServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlFlagsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlFlagsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceBlockingStub(channel, callOptions); + } + }; + return SqlFlagsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlFlagsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlFlagsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceFutureStub(channel, callOptions); + } + }; + return SqlFlagsServiceFutureStub.newStub(factory, channel); + } + + /** */ + public interface AsyncService { + + /** + * + * + *
+     * Lists all available database flags for Cloud SQL instances.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1beta4.SqlFlagsListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + } + + /** Base class for the server implementation of the service SqlFlagsService. */ + public abstract static class SqlFlagsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlFlagsServiceGrpc.bindService(this); + } + } + + /** A stub to allow clients to do asynchronous rpc calls to service SqlFlagsService. */ + public static final class SqlFlagsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlFlagsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlFlagsServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available database flags for Cloud SQL instances.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1beta4.SqlFlagsListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + } + + /** A stub to allow clients to do synchronous rpc calls to service SqlFlagsService. */ + public static final class SqlFlagsServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlFlagsServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlFlagsServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available database flags for Cloud SQL instances.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.FlagsListResponse list( + com.google.cloud.sql.v1beta4.SqlFlagsListRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do limited synchronous rpc calls to service SqlFlagsService. */ + public static final class SqlFlagsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlFlagsServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlFlagsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available database flags for Cloud SQL instances.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.FlagsListResponse list( + com.google.cloud.sql.v1beta4.SqlFlagsListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do ListenableFuture-style rpc calls to service SqlFlagsService. */ + public static final class SqlFlagsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlFlagsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlFlagsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlFlagsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available database flags for Cloud SQL instances.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.FlagsListResponse> + list(com.google.cloud.sql.v1beta4.SqlFlagsListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1beta4.SqlFlagsListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlFlagsListRequest, + com.google.cloud.sql.v1beta4.FlagsListResponse>(service, METHODID_LIST))) + .build(); + } + + private abstract static class SqlFlagsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlFlagsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlFlagsService"); + } + } + + private static final class SqlFlagsServiceFileDescriptorSupplier + extends SqlFlagsServiceBaseDescriptorSupplier { + SqlFlagsServiceFileDescriptorSupplier() {} + } + + private static final class SqlFlagsServiceMethodDescriptorSupplier + extends SqlFlagsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlFlagsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlFlagsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlFlagsServiceFileDescriptorSupplier()) + .addMethod(getListMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlIamPoliciesServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlIamPoliciesServiceGrpc.java new file mode 100644 index 000000000000..a189aee1a571 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlIamPoliciesServiceGrpc.java @@ -0,0 +1,289 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1beta4; + + +/** + * + * + *
+ * Service for providing IAM Meta APIs for Cloud SQL.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlIamPoliciesServiceGrpc { + + private SqlIamPoliciesServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.sql.v1beta4.SqlIamPoliciesService"; + + // Static method descriptors that strictly reflect the proto. + /** Creates a new async stub that supports all call types for the service */ + public static SqlIamPoliciesServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlIamPoliciesServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceStub(channel, callOptions); + } + }; + return SqlIamPoliciesServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlIamPoliciesServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlIamPoliciesServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlIamPoliciesServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlIamPoliciesServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlIamPoliciesServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceBlockingStub(channel, callOptions); + } + }; + return SqlIamPoliciesServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlIamPoliciesServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlIamPoliciesServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceFutureStub(channel, callOptions); + } + }; + return SqlIamPoliciesServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for providing IAM Meta APIs for Cloud SQL.
+   * 
+ */ + public interface AsyncService {} + + /** + * Base class for the server implementation of the service SqlIamPoliciesService. + * + *
+   * Service for providing IAM Meta APIs for Cloud SQL.
+   * 
+ */ + public abstract static class SqlIamPoliciesServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlIamPoliciesServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlIamPoliciesService. + * + *
+   * Service for providing IAM Meta APIs for Cloud SQL.
+   * 
+ */ + public static final class SqlIamPoliciesServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlIamPoliciesServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlIamPoliciesServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlIamPoliciesService. + * + *
+   * Service for providing IAM Meta APIs for Cloud SQL.
+   * 
+ */ + public static final class SqlIamPoliciesServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlIamPoliciesServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlIamPoliciesServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceBlockingV2Stub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlIamPoliciesService. + * + *
+   * Service for providing IAM Meta APIs for Cloud SQL.
+   * 
+ */ + public static final class SqlIamPoliciesServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlIamPoliciesServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlIamPoliciesServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceBlockingStub(channel, callOptions); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * SqlIamPoliciesService. + * + *
+   * Service for providing IAM Meta APIs for Cloud SQL.
+   * 
+ */ + public static final class SqlIamPoliciesServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlIamPoliciesServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlIamPoliciesServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlIamPoliciesServiceFutureStub(channel, callOptions); + } + } + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()).build(); + } + + private abstract static class SqlIamPoliciesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlIamPoliciesServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlIamPoliciesProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlIamPoliciesService"); + } + } + + private static final class SqlIamPoliciesServiceFileDescriptorSupplier + extends SqlIamPoliciesServiceBaseDescriptorSupplier { + SqlIamPoliciesServiceFileDescriptorSupplier() {} + } + + private static final class SqlIamPoliciesServiceMethodDescriptorSupplier + extends SqlIamPoliciesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlIamPoliciesServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlIamPoliciesServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlIamPoliciesServiceFileDescriptorSupplier()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceGrpc.java new file mode 100644 index 000000000000..06b758d613f4 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesServiceGrpc.java @@ -0,0 +1,6275 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1beta4; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlInstancesServiceGrpc { + + private SqlInstancesServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.sql.v1beta4.SqlInstancesService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest, + com.google.cloud.sql.v1beta4.Operation> + getAddServerCaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddServerCa", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest, + com.google.cloud.sql.v1beta4.Operation> + getAddServerCaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest, + com.google.cloud.sql.v1beta4.Operation> + getAddServerCaMethod; + if ((getAddServerCaMethod = SqlInstancesServiceGrpc.getAddServerCaMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getAddServerCaMethod = SqlInstancesServiceGrpc.getAddServerCaMethod) == null) { + SqlInstancesServiceGrpc.getAddServerCaMethod = + getAddServerCaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AddServerCa")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("AddServerCa")) + .build(); + } + } + } + return getAddServerCaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest, + com.google.cloud.sql.v1beta4.Operation> + getAddServerCertificateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddServerCertificate", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest, + com.google.cloud.sql.v1beta4.Operation> + getAddServerCertificateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest, + com.google.cloud.sql.v1beta4.Operation> + getAddServerCertificateMethod; + if ((getAddServerCertificateMethod = SqlInstancesServiceGrpc.getAddServerCertificateMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getAddServerCertificateMethod = SqlInstancesServiceGrpc.getAddServerCertificateMethod) + == null) { + SqlInstancesServiceGrpc.getAddServerCertificateMethod = + getAddServerCertificateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AddServerCertificate")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("AddServerCertificate")) + .build(); + } + } + } + return getAddServerCertificateMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest, + com.google.cloud.sql.v1beta4.Operation> + getAddEntraIdCertificateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddEntraIdCertificate", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest, + com.google.cloud.sql.v1beta4.Operation> + getAddEntraIdCertificateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest, + com.google.cloud.sql.v1beta4.Operation> + getAddEntraIdCertificateMethod; + if ((getAddEntraIdCertificateMethod = SqlInstancesServiceGrpc.getAddEntraIdCertificateMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getAddEntraIdCertificateMethod = + SqlInstancesServiceGrpc.getAddEntraIdCertificateMethod) + == null) { + SqlInstancesServiceGrpc.getAddEntraIdCertificateMethod = + getAddEntraIdCertificateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AddEntraIdCertificate")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("AddEntraIdCertificate")) + .build(); + } + } + } + return getAddEntraIdCertificateMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest, + com.google.cloud.sql.v1beta4.Operation> + getCloneMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Clone", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest, + com.google.cloud.sql.v1beta4.Operation> + getCloneMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest, + com.google.cloud.sql.v1beta4.Operation> + getCloneMethod; + if ((getCloneMethod = SqlInstancesServiceGrpc.getCloneMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getCloneMethod = SqlInstancesServiceGrpc.getCloneMethod) == null) { + SqlInstancesServiceGrpc.getCloneMethod = + getCloneMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Clone")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlInstancesServiceMethodDescriptorSupplier("Clone")) + .build(); + } + } + } + return getCloneMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Delete", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod; + if ((getDeleteMethod = SqlInstancesServiceGrpc.getDeleteMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getDeleteMethod = SqlInstancesServiceGrpc.getDeleteMethod) == null) { + SqlInstancesServiceGrpc.getDeleteMethod = + getDeleteMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Delete")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Delete")) + .build(); + } + } + } + return getDeleteMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest, + com.google.cloud.sql.v1beta4.Operation> + getDemoteMasterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DemoteMaster", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest, + com.google.cloud.sql.v1beta4.Operation> + getDemoteMasterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest, + com.google.cloud.sql.v1beta4.Operation> + getDemoteMasterMethod; + if ((getDemoteMasterMethod = SqlInstancesServiceGrpc.getDemoteMasterMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getDemoteMasterMethod = SqlInstancesServiceGrpc.getDemoteMasterMethod) == null) { + SqlInstancesServiceGrpc.getDemoteMasterMethod = + getDemoteMasterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DemoteMaster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("DemoteMaster")) + .build(); + } + } + } + return getDemoteMasterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDemoteMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Demote", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDemoteMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDemoteMethod; + if ((getDemoteMethod = SqlInstancesServiceGrpc.getDemoteMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getDemoteMethod = SqlInstancesServiceGrpc.getDemoteMethod) == null) { + SqlInstancesServiceGrpc.getDemoteMethod = + getDemoteMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Demote")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Demote")) + .build(); + } + } + } + return getDemoteMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest, + com.google.cloud.sql.v1beta4.Operation> + getExportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Export", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesExportRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest, + com.google.cloud.sql.v1beta4.Operation> + getExportMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest, + com.google.cloud.sql.v1beta4.Operation> + getExportMethod; + if ((getExportMethod = SqlInstancesServiceGrpc.getExportMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getExportMethod = SqlInstancesServiceGrpc.getExportMethod) == null) { + SqlInstancesServiceGrpc.getExportMethod = + getExportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Export")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Export")) + .build(); + } + } + } + return getExportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest, + com.google.cloud.sql.v1beta4.Operation> + getFailoverMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Failover", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest, + com.google.cloud.sql.v1beta4.Operation> + getFailoverMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest, + com.google.cloud.sql.v1beta4.Operation> + getFailoverMethod; + if ((getFailoverMethod = SqlInstancesServiceGrpc.getFailoverMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getFailoverMethod = SqlInstancesServiceGrpc.getFailoverMethod) == null) { + SqlInstancesServiceGrpc.getFailoverMethod = + getFailoverMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Failover")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Failover")) + .build(); + } + } + } + return getFailoverMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest, + com.google.cloud.sql.v1beta4.Operation> + getReencryptMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Reencrypt", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest, + com.google.cloud.sql.v1beta4.Operation> + getReencryptMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest, + com.google.cloud.sql.v1beta4.Operation> + getReencryptMethod; + if ((getReencryptMethod = SqlInstancesServiceGrpc.getReencryptMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getReencryptMethod = SqlInstancesServiceGrpc.getReencryptMethod) == null) { + SqlInstancesServiceGrpc.getReencryptMethod = + getReencryptMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Reencrypt")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Reencrypt")) + .build(); + } + } + } + return getReencryptMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest, + com.google.cloud.sql.v1beta4.DatabaseInstance> + getGetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Get", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesGetRequest.class, + responseType = com.google.cloud.sql.v1beta4.DatabaseInstance.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest, + com.google.cloud.sql.v1beta4.DatabaseInstance> + getGetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest, + com.google.cloud.sql.v1beta4.DatabaseInstance> + getGetMethod; + if ((getGetMethod = SqlInstancesServiceGrpc.getGetMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getGetMethod = SqlInstancesServiceGrpc.getGetMethod) == null) { + SqlInstancesServiceGrpc.getGetMethod = + getGetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Get")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance())) + .setSchemaDescriptor(new SqlInstancesServiceMethodDescriptorSupplier("Get")) + .build(); + } + } + } + return getGetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest, + com.google.cloud.sql.v1beta4.Operation> + getImportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Import", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesImportRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest, + com.google.cloud.sql.v1beta4.Operation> + getImportMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest, + com.google.cloud.sql.v1beta4.Operation> + getImportMethod; + if ((getImportMethod = SqlInstancesServiceGrpc.getImportMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getImportMethod = SqlInstancesServiceGrpc.getImportMethod) == null) { + SqlInstancesServiceGrpc.getImportMethod = + getImportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Import")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Import")) + .build(); + } + } + } + return getImportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest, + com.google.cloud.sql.v1beta4.Operation> + getInsertMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Insert", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest, + com.google.cloud.sql.v1beta4.Operation> + getInsertMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest, + com.google.cloud.sql.v1beta4.Operation> + getInsertMethod; + if ((getInsertMethod = SqlInstancesServiceGrpc.getInsertMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getInsertMethod = SqlInstancesServiceGrpc.getInsertMethod) == null) { + SqlInstancesServiceGrpc.getInsertMethod = + getInsertMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Insert")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Insert")) + .build(); + } + } + } + return getInsertMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesListRequest, + com.google.cloud.sql.v1beta4.InstancesListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesListRequest.class, + responseType = com.google.cloud.sql.v1beta4.InstancesListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesListRequest, + com.google.cloud.sql.v1beta4.InstancesListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesListRequest, + com.google.cloud.sql.v1beta4.InstancesListResponse> + getListMethod; + if ((getListMethod = SqlInstancesServiceGrpc.getListMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getListMethod = SqlInstancesServiceGrpc.getListMethod) == null) { + SqlInstancesServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesListRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.InstancesListResponse + .getDefaultInstance())) + .setSchemaDescriptor(new SqlInstancesServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest, + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse> + getListServerCasMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListServerCas", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest.class, + responseType = com.google.cloud.sql.v1beta4.InstancesListServerCasResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest, + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse> + getListServerCasMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest, + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse> + getListServerCasMethod; + if ((getListServerCasMethod = SqlInstancesServiceGrpc.getListServerCasMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getListServerCasMethod = SqlInstancesServiceGrpc.getListServerCasMethod) == null) { + SqlInstancesServiceGrpc.getListServerCasMethod = + getListServerCasMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListServerCas")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("ListServerCas")) + .build(); + } + } + } + return getListServerCasMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest, + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse> + getListServerCertificatesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListServerCertificates", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest.class, + responseType = com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest, + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse> + getListServerCertificatesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest, + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse> + getListServerCertificatesMethod; + if ((getListServerCertificatesMethod = SqlInstancesServiceGrpc.getListServerCertificatesMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getListServerCertificatesMethod = + SqlInstancesServiceGrpc.getListServerCertificatesMethod) + == null) { + SqlInstancesServiceGrpc.getListServerCertificatesMethod = + getListServerCertificatesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListServerCertificates")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("ListServerCertificates")) + .build(); + } + } + } + return getListServerCertificatesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest, + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse> + getListEntraIdCertificatesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListEntraIdCertificates", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest.class, + responseType = com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest, + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse> + getListEntraIdCertificatesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest, + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse> + getListEntraIdCertificatesMethod; + if ((getListEntraIdCertificatesMethod = + SqlInstancesServiceGrpc.getListEntraIdCertificatesMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getListEntraIdCertificatesMethod = + SqlInstancesServiceGrpc.getListEntraIdCertificatesMethod) + == null) { + SqlInstancesServiceGrpc.getListEntraIdCertificatesMethod = + getListEntraIdCertificatesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListEntraIdCertificates")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4 + .SqlInstancesListEntraIdCertificatesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier( + "ListEntraIdCertificates")) + .build(); + } + } + } + return getListEntraIdCertificatesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest, + com.google.cloud.sql.v1beta4.Operation> + getPatchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Patch", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest, + com.google.cloud.sql.v1beta4.Operation> + getPatchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest, + com.google.cloud.sql.v1beta4.Operation> + getPatchMethod; + if ((getPatchMethod = SqlInstancesServiceGrpc.getPatchMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getPatchMethod = SqlInstancesServiceGrpc.getPatchMethod) == null) { + SqlInstancesServiceGrpc.getPatchMethod = + getPatchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Patch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlInstancesServiceMethodDescriptorSupplier("Patch")) + .build(); + } + } + } + return getPatchMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest, + com.google.cloud.sql.v1beta4.Operation> + getPromoteReplicaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PromoteReplica", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest, + com.google.cloud.sql.v1beta4.Operation> + getPromoteReplicaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest, + com.google.cloud.sql.v1beta4.Operation> + getPromoteReplicaMethod; + if ((getPromoteReplicaMethod = SqlInstancesServiceGrpc.getPromoteReplicaMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getPromoteReplicaMethod = SqlInstancesServiceGrpc.getPromoteReplicaMethod) == null) { + SqlInstancesServiceGrpc.getPromoteReplicaMethod = + getPromoteReplicaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PromoteReplica")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("PromoteReplica")) + .build(); + } + } + } + return getPromoteReplicaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest, + com.google.cloud.sql.v1beta4.Operation> + getSwitchoverMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Switchover", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest, + com.google.cloud.sql.v1beta4.Operation> + getSwitchoverMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest, + com.google.cloud.sql.v1beta4.Operation> + getSwitchoverMethod; + if ((getSwitchoverMethod = SqlInstancesServiceGrpc.getSwitchoverMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getSwitchoverMethod = SqlInstancesServiceGrpc.getSwitchoverMethod) == null) { + SqlInstancesServiceGrpc.getSwitchoverMethod = + getSwitchoverMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Switchover")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Switchover")) + .build(); + } + } + } + return getSwitchoverMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest, + com.google.cloud.sql.v1beta4.Operation> + getResetSslConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ResetSslConfig", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest, + com.google.cloud.sql.v1beta4.Operation> + getResetSslConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest, + com.google.cloud.sql.v1beta4.Operation> + getResetSslConfigMethod; + if ((getResetSslConfigMethod = SqlInstancesServiceGrpc.getResetSslConfigMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getResetSslConfigMethod = SqlInstancesServiceGrpc.getResetSslConfigMethod) == null) { + SqlInstancesServiceGrpc.getResetSslConfigMethod = + getResetSslConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ResetSslConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("ResetSslConfig")) + .build(); + } + } + } + return getResetSslConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest, + com.google.cloud.sql.v1beta4.Operation> + getRestartMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Restart", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest, + com.google.cloud.sql.v1beta4.Operation> + getRestartMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest, + com.google.cloud.sql.v1beta4.Operation> + getRestartMethod; + if ((getRestartMethod = SqlInstancesServiceGrpc.getRestartMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getRestartMethod = SqlInstancesServiceGrpc.getRestartMethod) == null) { + SqlInstancesServiceGrpc.getRestartMethod = + getRestartMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Restart")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Restart")) + .build(); + } + } + } + return getRestartMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest, + com.google.cloud.sql.v1beta4.Operation> + getRestoreBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RestoreBackup", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest, + com.google.cloud.sql.v1beta4.Operation> + getRestoreBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest, + com.google.cloud.sql.v1beta4.Operation> + getRestoreBackupMethod; + if ((getRestoreBackupMethod = SqlInstancesServiceGrpc.getRestoreBackupMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getRestoreBackupMethod = SqlInstancesServiceGrpc.getRestoreBackupMethod) == null) { + SqlInstancesServiceGrpc.getRestoreBackupMethod = + getRestoreBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RestoreBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("RestoreBackup")) + .build(); + } + } + } + return getRestoreBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest, + com.google.cloud.sql.v1beta4.Operation> + getRotateServerCaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RotateServerCa", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest, + com.google.cloud.sql.v1beta4.Operation> + getRotateServerCaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest, + com.google.cloud.sql.v1beta4.Operation> + getRotateServerCaMethod; + if ((getRotateServerCaMethod = SqlInstancesServiceGrpc.getRotateServerCaMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getRotateServerCaMethod = SqlInstancesServiceGrpc.getRotateServerCaMethod) == null) { + SqlInstancesServiceGrpc.getRotateServerCaMethod = + getRotateServerCaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RotateServerCa")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("RotateServerCa")) + .build(); + } + } + } + return getRotateServerCaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest, + com.google.cloud.sql.v1beta4.Operation> + getRotateServerCertificateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RotateServerCertificate", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest, + com.google.cloud.sql.v1beta4.Operation> + getRotateServerCertificateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest, + com.google.cloud.sql.v1beta4.Operation> + getRotateServerCertificateMethod; + if ((getRotateServerCertificateMethod = + SqlInstancesServiceGrpc.getRotateServerCertificateMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getRotateServerCertificateMethod = + SqlInstancesServiceGrpc.getRotateServerCertificateMethod) + == null) { + SqlInstancesServiceGrpc.getRotateServerCertificateMethod = + getRotateServerCertificateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RotateServerCertificate")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4 + .SqlInstancesRotateServerCertificateRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier( + "RotateServerCertificate")) + .build(); + } + } + } + return getRotateServerCertificateMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest, + com.google.cloud.sql.v1beta4.Operation> + getRotateEntraIdCertificateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RotateEntraIdCertificate", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest, + com.google.cloud.sql.v1beta4.Operation> + getRotateEntraIdCertificateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest, + com.google.cloud.sql.v1beta4.Operation> + getRotateEntraIdCertificateMethod; + if ((getRotateEntraIdCertificateMethod = + SqlInstancesServiceGrpc.getRotateEntraIdCertificateMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getRotateEntraIdCertificateMethod = + SqlInstancesServiceGrpc.getRotateEntraIdCertificateMethod) + == null) { + SqlInstancesServiceGrpc.getRotateEntraIdCertificateMethod = + getRotateEntraIdCertificateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RotateEntraIdCertificate")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4 + .SqlInstancesRotateEntraIdCertificateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier( + "RotateEntraIdCertificate")) + .build(); + } + } + } + return getRotateEntraIdCertificateMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest, + com.google.cloud.sql.v1beta4.Operation> + getStartReplicaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StartReplica", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest, + com.google.cloud.sql.v1beta4.Operation> + getStartReplicaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest, + com.google.cloud.sql.v1beta4.Operation> + getStartReplicaMethod; + if ((getStartReplicaMethod = SqlInstancesServiceGrpc.getStartReplicaMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getStartReplicaMethod = SqlInstancesServiceGrpc.getStartReplicaMethod) == null) { + SqlInstancesServiceGrpc.getStartReplicaMethod = + getStartReplicaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StartReplica")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("StartReplica")) + .build(); + } + } + } + return getStartReplicaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest, + com.google.cloud.sql.v1beta4.Operation> + getStopReplicaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StopReplica", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest, + com.google.cloud.sql.v1beta4.Operation> + getStopReplicaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest, + com.google.cloud.sql.v1beta4.Operation> + getStopReplicaMethod; + if ((getStopReplicaMethod = SqlInstancesServiceGrpc.getStopReplicaMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getStopReplicaMethod = SqlInstancesServiceGrpc.getStopReplicaMethod) == null) { + SqlInstancesServiceGrpc.getStopReplicaMethod = + getStopReplicaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StopReplica")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("StopReplica")) + .build(); + } + } + } + return getStopReplicaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest, + com.google.cloud.sql.v1beta4.Operation> + getTruncateLogMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TruncateLog", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest, + com.google.cloud.sql.v1beta4.Operation> + getTruncateLogMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest, + com.google.cloud.sql.v1beta4.Operation> + getTruncateLogMethod; + if ((getTruncateLogMethod = SqlInstancesServiceGrpc.getTruncateLogMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getTruncateLogMethod = SqlInstancesServiceGrpc.getTruncateLogMethod) == null) { + SqlInstancesServiceGrpc.getTruncateLogMethod = + getTruncateLogMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TruncateLog")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("TruncateLog")) + .build(); + } + } + } + return getTruncateLogMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest, + com.google.cloud.sql.v1beta4.Operation> + getUpdateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Update", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest, + com.google.cloud.sql.v1beta4.Operation> + getUpdateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest, + com.google.cloud.sql.v1beta4.Operation> + getUpdateMethod; + if ((getUpdateMethod = SqlInstancesServiceGrpc.getUpdateMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getUpdateMethod = SqlInstancesServiceGrpc.getUpdateMethod) == null) { + SqlInstancesServiceGrpc.getUpdateMethod = + getUpdateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Update")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("Update")) + .build(); + } + } + } + return getUpdateMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest, + com.google.cloud.sql.v1beta4.SslCert> + getCreateEphemeralMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateEphemeral", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest.class, + responseType = com.google.cloud.sql.v1beta4.SslCert.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest, + com.google.cloud.sql.v1beta4.SslCert> + getCreateEphemeralMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest, + com.google.cloud.sql.v1beta4.SslCert> + getCreateEphemeralMethod; + if ((getCreateEphemeralMethod = SqlInstancesServiceGrpc.getCreateEphemeralMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getCreateEphemeralMethod = SqlInstancesServiceGrpc.getCreateEphemeralMethod) == null) { + SqlInstancesServiceGrpc.getCreateEphemeralMethod = + getCreateEphemeralMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateEphemeral")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("CreateEphemeral")) + .build(); + } + } + } + return getCreateEphemeralMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest, + com.google.cloud.sql.v1beta4.Operation> + getRescheduleMaintenanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RescheduleMaintenance", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest, + com.google.cloud.sql.v1beta4.Operation> + getRescheduleMaintenanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest, + com.google.cloud.sql.v1beta4.Operation> + getRescheduleMaintenanceMethod; + if ((getRescheduleMaintenanceMethod = SqlInstancesServiceGrpc.getRescheduleMaintenanceMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getRescheduleMaintenanceMethod = + SqlInstancesServiceGrpc.getRescheduleMaintenanceMethod) + == null) { + SqlInstancesServiceGrpc.getRescheduleMaintenanceMethod = + getRescheduleMaintenanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RescheduleMaintenance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("RescheduleMaintenance")) + .build(); + } + } + } + return getRescheduleMaintenanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest, + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse> + getVerifyExternalSyncSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "VerifyExternalSyncSettings", + requestType = + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.class, + responseType = + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest, + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse> + getVerifyExternalSyncSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest, + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse> + getVerifyExternalSyncSettingsMethod; + if ((getVerifyExternalSyncSettingsMethod = + SqlInstancesServiceGrpc.getVerifyExternalSyncSettingsMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getVerifyExternalSyncSettingsMethod = + SqlInstancesServiceGrpc.getVerifyExternalSyncSettingsMethod) + == null) { + SqlInstancesServiceGrpc.getVerifyExternalSyncSettingsMethod = + getVerifyExternalSyncSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "VerifyExternalSyncSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4 + .SqlInstancesVerifyExternalSyncSettingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4 + .SqlInstancesVerifyExternalSyncSettingsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier( + "VerifyExternalSyncSettings")) + .build(); + } + } + } + return getVerifyExternalSyncSettingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest, + com.google.cloud.sql.v1beta4.Operation> + getStartExternalSyncMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StartExternalSync", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest, + com.google.cloud.sql.v1beta4.Operation> + getStartExternalSyncMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest, + com.google.cloud.sql.v1beta4.Operation> + getStartExternalSyncMethod; + if ((getStartExternalSyncMethod = SqlInstancesServiceGrpc.getStartExternalSyncMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getStartExternalSyncMethod = SqlInstancesServiceGrpc.getStartExternalSyncMethod) + == null) { + SqlInstancesServiceGrpc.getStartExternalSyncMethod = + getStartExternalSyncMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StartExternalSync")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("StartExternalSync")) + .build(); + } + } + } + return getStartExternalSyncMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest, + com.google.cloud.sql.v1beta4.Operation> + getPerformDiskShrinkMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PerformDiskShrink", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest, + com.google.cloud.sql.v1beta4.Operation> + getPerformDiskShrinkMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest, + com.google.cloud.sql.v1beta4.Operation> + getPerformDiskShrinkMethod; + if ((getPerformDiskShrinkMethod = SqlInstancesServiceGrpc.getPerformDiskShrinkMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getPerformDiskShrinkMethod = SqlInstancesServiceGrpc.getPerformDiskShrinkMethod) + == null) { + SqlInstancesServiceGrpc.getPerformDiskShrinkMethod = + getPerformDiskShrinkMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PerformDiskShrink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("PerformDiskShrink")) + .build(); + } + } + } + return getPerformDiskShrinkMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest, + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse> + getGetDiskShrinkConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDiskShrinkConfig", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest.class, + responseType = com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest, + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse> + getGetDiskShrinkConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest, + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse> + getGetDiskShrinkConfigMethod; + if ((getGetDiskShrinkConfigMethod = SqlInstancesServiceGrpc.getGetDiskShrinkConfigMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getGetDiskShrinkConfigMethod = SqlInstancesServiceGrpc.getGetDiskShrinkConfigMethod) + == null) { + SqlInstancesServiceGrpc.getGetDiskShrinkConfigMethod = + getGetDiskShrinkConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetDiskShrinkConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("GetDiskShrinkConfig")) + .build(); + } + } + } + return getGetDiskShrinkConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest, + com.google.cloud.sql.v1beta4.Operation> + getResetReplicaSizeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ResetReplicaSize", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest, + com.google.cloud.sql.v1beta4.Operation> + getResetReplicaSizeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest, + com.google.cloud.sql.v1beta4.Operation> + getResetReplicaSizeMethod; + if ((getResetReplicaSizeMethod = SqlInstancesServiceGrpc.getResetReplicaSizeMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getResetReplicaSizeMethod = SqlInstancesServiceGrpc.getResetReplicaSizeMethod) + == null) { + SqlInstancesServiceGrpc.getResetReplicaSizeMethod = + getResetReplicaSizeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ResetReplicaSize")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("ResetReplicaSize")) + .build(); + } + } + } + return getResetReplicaSizeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest, + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse> + getGetLatestRecoveryTimeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetLatestRecoveryTime", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest.class, + responseType = com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest, + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse> + getGetLatestRecoveryTimeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest, + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse> + getGetLatestRecoveryTimeMethod; + if ((getGetLatestRecoveryTimeMethod = SqlInstancesServiceGrpc.getGetLatestRecoveryTimeMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getGetLatestRecoveryTimeMethod = + SqlInstancesServiceGrpc.getGetLatestRecoveryTimeMethod) + == null) { + SqlInstancesServiceGrpc.getGetLatestRecoveryTimeMethod = + getGetLatestRecoveryTimeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetLatestRecoveryTime")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("GetLatestRecoveryTime")) + .build(); + } + } + } + return getGetLatestRecoveryTimeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse> + getExecuteSqlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ExecuteSql", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest.class, + responseType = com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse> + getExecuteSqlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse> + getExecuteSqlMethod; + if ((getExecuteSqlMethod = SqlInstancesServiceGrpc.getExecuteSqlMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getExecuteSqlMethod = SqlInstancesServiceGrpc.getExecuteSqlMethod) == null) { + SqlInstancesServiceGrpc.getExecuteSqlMethod = + getExecuteSqlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ExecuteSql")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("ExecuteSql")) + .build(); + } + } + } + return getExecuteSqlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest, + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse> + getAcquireSsrsLeaseMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AcquireSsrsLease", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest.class, + responseType = com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest, + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse> + getAcquireSsrsLeaseMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest, + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse> + getAcquireSsrsLeaseMethod; + if ((getAcquireSsrsLeaseMethod = SqlInstancesServiceGrpc.getAcquireSsrsLeaseMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getAcquireSsrsLeaseMethod = SqlInstancesServiceGrpc.getAcquireSsrsLeaseMethod) + == null) { + SqlInstancesServiceGrpc.getAcquireSsrsLeaseMethod = + getAcquireSsrsLeaseMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AcquireSsrsLease")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("AcquireSsrsLease")) + .build(); + } + } + } + return getAcquireSsrsLeaseMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest, + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse> + getReleaseSsrsLeaseMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReleaseSsrsLease", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest.class, + responseType = com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest, + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse> + getReleaseSsrsLeaseMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest, + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse> + getReleaseSsrsLeaseMethod; + if ((getReleaseSsrsLeaseMethod = SqlInstancesServiceGrpc.getReleaseSsrsLeaseMethod) == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getReleaseSsrsLeaseMethod = SqlInstancesServiceGrpc.getReleaseSsrsLeaseMethod) + == null) { + SqlInstancesServiceGrpc.getReleaseSsrsLeaseMethod = + getReleaseSsrsLeaseMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReleaseSsrsLease")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("ReleaseSsrsLease")) + .build(); + } + } + } + return getReleaseSsrsLeaseMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest, + com.google.cloud.sql.v1beta4.Operation> + getPreCheckMajorVersionUpgradeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PreCheckMajorVersionUpgrade", + requestType = + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest, + com.google.cloud.sql.v1beta4.Operation> + getPreCheckMajorVersionUpgradeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest, + com.google.cloud.sql.v1beta4.Operation> + getPreCheckMajorVersionUpgradeMethod; + if ((getPreCheckMajorVersionUpgradeMethod = + SqlInstancesServiceGrpc.getPreCheckMajorVersionUpgradeMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getPreCheckMajorVersionUpgradeMethod = + SqlInstancesServiceGrpc.getPreCheckMajorVersionUpgradeMethod) + == null) { + SqlInstancesServiceGrpc.getPreCheckMajorVersionUpgradeMethod = + getPreCheckMajorVersionUpgradeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "PreCheckMajorVersionUpgrade")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4 + .SqlInstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier( + "PreCheckMajorVersionUpgrade")) + .build(); + } + } + } + return getPreCheckMajorVersionUpgradeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest, + com.google.cloud.sql.v1beta4.Operation> + getPointInTimeRestoreMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PointInTimeRestore", + requestType = com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest, + com.google.cloud.sql.v1beta4.Operation> + getPointInTimeRestoreMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest, + com.google.cloud.sql.v1beta4.Operation> + getPointInTimeRestoreMethod; + if ((getPointInTimeRestoreMethod = SqlInstancesServiceGrpc.getPointInTimeRestoreMethod) + == null) { + synchronized (SqlInstancesServiceGrpc.class) { + if ((getPointInTimeRestoreMethod = SqlInstancesServiceGrpc.getPointInTimeRestoreMethod) + == null) { + SqlInstancesServiceGrpc.getPointInTimeRestoreMethod = + getPointInTimeRestoreMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PointInTimeRestore")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SqlInstancesServiceMethodDescriptorSupplier("PointInTimeRestore")) + .build(); + } + } + } + return getPointInTimeRestoreMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlInstancesServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlInstancesServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceStub(channel, callOptions); + } + }; + return SqlInstancesServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlInstancesServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlInstancesServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlInstancesServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlInstancesServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlInstancesServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceBlockingStub(channel, callOptions); + } + }; + return SqlInstancesServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlInstancesServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlInstancesServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceFutureStub(channel, callOptions); + } + }; + return SqlInstancesServiceFutureStub.newStub(factory, channel); + } + + /** */ + public interface AsyncService { + + /** + * + * + *
+     * Add a new trusted Certificate Authority (CA) version for the specified
+     * instance. Required to prepare for a certificate rotation. If a CA version
+     * was previously added but never used in a certificate rotation, this
+     * operation replaces that version. There cannot be more than one CA version
+     * waiting to be rotated in. For instances that have enabled Certificate
+     * Authority Service (CAS) based server CA, use AddServerCertificate to add a
+     * new server certificate.
+     * 
+ */ + default void addServerCa( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddServerCaMethod(), responseObserver); + } + + /** + * + * + *
+     * Add a new trusted server certificate version for the specified instance
+     * using Certificate Authority Service (CAS) server CA. Required to prepare
+     * for a certificate rotation. If a server certificate version was previously
+     * added but never used in a certificate rotation, this operation replaces
+     * that version. There cannot be more than one certificate version waiting to
+     * be rotated in. For instances not using CAS server CA, use AddServerCa
+     * instead.
+     * 
+ */ + default void addServerCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddServerCertificateMethod(), responseObserver); + } + + /** + * + * + *
+     * Adds a new Entra ID certificate for the specified instance. If an Entra ID
+     * certificate was previously added but never used in a certificate rotation,
+     * this operation replaces that version.
+     * 
+ */ + default void addEntraIdCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddEntraIdCertificateMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a Cloud SQL instance as a clone of the source instance. Using this
+     * operation might cause your instance to restart.
+     * 
+ */ + default void clone( + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCloneMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a Cloud SQL instance.
+     * 
+ */ + default void delete( + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteMethod(), responseObserver); + } + + /** + * + * + *
+     * Demotes the stand-alone instance to be a Cloud SQL read replica for an
+     * external database server.
+     * 
+ */ + default void demoteMaster( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDemoteMasterMethod(), responseObserver); + } + + /** + * + * + *
+     * Demotes an existing standalone instance to be a Cloud SQL read replica
+     * for an external database server.
+     * 
+ */ + default void demote( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDemoteMethod(), responseObserver); + } + + /** + * + * + *
+     * Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL
+     * dump or CSV file.
+     * 
+ */ + default void export( + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExportMethod(), responseObserver); + } + + /** + * + * + *
+     * Initiates a manual failover of a high availability (HA) primary instance
+     * to a standby instance, which becomes the primary instance. Users are
+     * then rerouted to the new primary. For more information, see the
+     * [Overview of high
+     * availability](https://cloud.google.com/sql/docs/mysql/high-availability)
+     * page in the Cloud SQL documentation.
+     * If using Legacy HA (MySQL only), this causes the instance to failover to
+     * its failover replica instance.
+     * 
+ */ + default void failover( + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getFailoverMethod(), responseObserver); + } + + /** + * + * + *
+     * Reencrypt CMEK instance with latest key version.
+     * 
+ */ + default void reencrypt( + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReencryptMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a Cloud SQL instance.
+     * 
+ */ + default void get( + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver); + } + + /** + * + * + *
+     * Imports data into a Cloud SQL instance from a SQL dump  or CSV file in
+     * Cloud Storage.
+     * 
+ */ + default void import_( + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getImportMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Cloud SQL instance.
+     * 
+ */ + default void insert( + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getInsertMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists instances under a given project.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1beta4.SqlInstancesListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all of the trusted Certificate Authorities (CAs) for the specified
+     * instance. There can be up to three CAs listed: the CA that was used to sign
+     * the certificate that is currently in use, a CA that has been added but not
+     * yet used to sign a certificate, and a CA used to sign a certificate that
+     * has previously rotated out.
+     * 
+ */ + default void listServerCas( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListServerCasMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all versions of server certificates and certificate authorities (CAs)
+     * for the specified instance. There can be up to three sets of certs listed:
+     * the certificate that is currently in use, a future that has been added but
+     * not yet used to sign a certificate, and a certificate that has been rotated
+     * out. For instances not using Certificate Authority Service (CAS) server CA,
+     * use ListServerCas instead.
+     * 
+ */ + default void listServerCertificates( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListServerCertificatesMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all versions of EntraID certificates for the specified instance.
+     * There can be up to three sets of certificates listed: the certificate that
+     * is currently in use, a future that has been added but not yet used to sign
+     * a certificate, and a certificate that has been rotated out.
+     * 
+ */ + default void listEntraIdCertificates( + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListEntraIdCertificatesMethod(), responseObserver); + } + + /** + * + * + *
+     * Partially updates settings of a Cloud SQL instance by merging the request
+     * with the current configuration. This method supports patch semantics.
+     * 
+ */ + default void patch( + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPatchMethod(), responseObserver); + } + + /** + * + * + *
+     * Promotes the read replica instance to be an independent Cloud SQL
+     * primary instance.
+     * Using this operation might cause your instance to restart.
+     * 
+ */ + default void promoteReplica( + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPromoteReplicaMethod(), responseObserver); + } + + /** + * + * + *
+     * Switches over from the primary instance to the DR replica
+     * instance.
+     * 
+ */ + default void switchover( + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSwitchoverMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes all client certificates and generates a new server SSL certificate
+     * for the instance.
+     * 
+ */ + default void resetSslConfig( + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getResetSslConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Restarts a Cloud SQL instance.
+     * 
+ */ + default void restart( + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRestartMethod(), responseObserver); + } + + /** + * + * + *
+     * Restores a backup of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + default void restoreBackup( + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRestoreBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Rotates the server certificate to one signed by the Certificate Authority
+     * (CA) version previously added with the addServerCA method. For instances
+     * that have enabled Certificate Authority Service (CAS) based server CA,
+     * use RotateServerCertificate to rotate the server certificate.
+     * 
+ */ + default void rotateServerCa( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRotateServerCaMethod(), responseObserver); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addServerCertificate method. For instances not using Certificate Authority
+     * Service (CAS) server CA, use RotateServerCa instead.
+     * 
+ */ + default void rotateServerCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRotateServerCertificateMethod(), responseObserver); + } + + /** + * + * + *
+     * Rotates the Entra Id certificate version to one previously added with the
+     * addEntraIdCertificate method.
+     * 
+ */ + default void rotateEntraIdCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRotateEntraIdCertificateMethod(), responseObserver); + } + + /** + * + * + *
+     * Starts the replication in the read replica instance.
+     * 
+ */ + default void startReplica( + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStartReplicaMethod(), responseObserver); + } + + /** + * + * + *
+     * Stops the replication in the read replica instance.
+     * 
+ */ + default void stopReplica( + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStopReplicaMethod(), responseObserver); + } + + /** + * + * + *
+     * Truncate MySQL general and slow query log tables
+     * MySQL only.
+     * 
+ */ + default void truncateLog( + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTruncateLogMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates settings of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + default void update( + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateMethod(), responseObserver); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + default void createEphemeral( + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateEphemeralMethod(), responseObserver); + } + + /** + * + * + *
+     * Reschedules the maintenance on the given instance.
+     * 
+ */ + default void rescheduleMaintenance( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRescheduleMaintenanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Verify External primary instance external sync settings.
+     * 
+ */ + default void verifyExternalSyncSettings( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getVerifyExternalSyncSettingsMethod(), responseObserver); + } + + /** + * + * + *
+     * Start External primary instance migration.
+     * 
+ */ + default void startExternalSync( + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStartExternalSyncMethod(), responseObserver); + } + + /** + * + * + *
+     * Perform Disk Shrink on primary instance.
+     * 
+ */ + default void performDiskShrink( + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPerformDiskShrinkMethod(), responseObserver); + } + + /** + * + * + *
+     * Get Disk Shrink Config for a given instance.
+     * 
+ */ + default void getDiskShrinkConfig( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDiskShrinkConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Reset Replica Size to primary instance disk size.
+     * 
+ */ + default void resetReplicaSize( + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getResetReplicaSizeMethod(), responseObserver); + } + + /** + * + * + *
+     * Get Latest Recovery Time for a given instance.
+     * 
+ */ + default void getLatestRecoveryTime( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetLatestRecoveryTimeMethod(), responseObserver); + } + + /** + * + * + *
+     * Execute SQL statements.
+     * 
+ */ + default void executeSql( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExecuteSqlMethod(), responseObserver); + } + + /** + * + * + *
+     * Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + default void acquireSsrsLease( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAcquireSsrsLeaseMethod(), responseObserver); + } + + /** + * + * + *
+     * Release a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + default void releaseSsrsLease( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReleaseSsrsLeaseMethod(), responseObserver); + } + + /** + * + * + *
+     * Execute MVU Pre-checks
+     * 
+ */ + default void preCheckMajorVersionUpgrade( + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPreCheckMajorVersionUpgradeMethod(), responseObserver); + } + + /** + * + * + *
+     * Point in time restore for an instance managed by Google Cloud Backup and
+     * Disaster Recovery.
+     * 
+ */ + default void pointInTimeRestore( + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPointInTimeRestoreMethod(), responseObserver); + } + } + + /** Base class for the server implementation of the service SqlInstancesService. */ + public abstract static class SqlInstancesServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlInstancesServiceGrpc.bindService(this); + } + } + + /** A stub to allow clients to do asynchronous rpc calls to service SqlInstancesService. */ + public static final class SqlInstancesServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlInstancesServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlInstancesServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Add a new trusted Certificate Authority (CA) version for the specified
+     * instance. Required to prepare for a certificate rotation. If a CA version
+     * was previously added but never used in a certificate rotation, this
+     * operation replaces that version. There cannot be more than one CA version
+     * waiting to be rotated in. For instances that have enabled Certificate
+     * Authority Service (CAS) based server CA, use AddServerCertificate to add a
+     * new server certificate.
+     * 
+ */ + public void addServerCa( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddServerCaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Add a new trusted server certificate version for the specified instance
+     * using Certificate Authority Service (CAS) server CA. Required to prepare
+     * for a certificate rotation. If a server certificate version was previously
+     * added but never used in a certificate rotation, this operation replaces
+     * that version. There cannot be more than one certificate version waiting to
+     * be rotated in. For instances not using CAS server CA, use AddServerCa
+     * instead.
+     * 
+ */ + public void addServerCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddServerCertificateMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Adds a new Entra ID certificate for the specified instance. If an Entra ID
+     * certificate was previously added but never used in a certificate rotation,
+     * this operation replaces that version.
+     * 
+ */ + public void addEntraIdCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddEntraIdCertificateMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a Cloud SQL instance as a clone of the source instance. Using this
+     * operation might cause your instance to restart.
+     * 
+ */ + public void clone( + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCloneMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Deletes a Cloud SQL instance.
+     * 
+ */ + public void delete( + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Demotes the stand-alone instance to be a Cloud SQL read replica for an
+     * external database server.
+     * 
+ */ + public void demoteMaster( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDemoteMasterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Demotes an existing standalone instance to be a Cloud SQL read replica
+     * for an external database server.
+     * 
+ */ + public void demote( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDemoteMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL
+     * dump or CSV file.
+     * 
+ */ + public void export( + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getExportMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Initiates a manual failover of a high availability (HA) primary instance
+     * to a standby instance, which becomes the primary instance. Users are
+     * then rerouted to the new primary. For more information, see the
+     * [Overview of high
+     * availability](https://cloud.google.com/sql/docs/mysql/high-availability)
+     * page in the Cloud SQL documentation.
+     * If using Legacy HA (MySQL only), this causes the instance to failover to
+     * its failover replica instance.
+     * 
+ */ + public void failover( + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFailoverMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Reencrypt CMEK instance with latest key version.
+     * 
+ */ + public void reencrypt( + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReencryptMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a Cloud SQL instance.
+     * 
+ */ + public void get( + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Imports data into a Cloud SQL instance from a SQL dump  or CSV file in
+     * Cloud Storage.
+     * 
+ */ + public void import_( + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new Cloud SQL instance.
+     * 
+ */ + public void insert( + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists instances under a given project.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1beta4.SqlInstancesListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists all of the trusted Certificate Authorities (CAs) for the specified
+     * instance. There can be up to three CAs listed: the CA that was used to sign
+     * the certificate that is currently in use, a CA that has been added but not
+     * yet used to sign a certificate, and a CA used to sign a certificate that
+     * has previously rotated out.
+     * 
+ */ + public void listServerCas( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListServerCasMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all versions of server certificates and certificate authorities (CAs)
+     * for the specified instance. There can be up to three sets of certs listed:
+     * the certificate that is currently in use, a future that has been added but
+     * not yet used to sign a certificate, and a certificate that has been rotated
+     * out. For instances not using Certificate Authority Service (CAS) server CA,
+     * use ListServerCas instead.
+     * 
+ */ + public void listServerCertificates( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListServerCertificatesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all versions of EntraID certificates for the specified instance.
+     * There can be up to three sets of certificates listed: the certificate that
+     * is currently in use, a future that has been added but not yet used to sign
+     * a certificate, and a certificate that has been rotated out.
+     * 
+ */ + public void listEntraIdCertificates( + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListEntraIdCertificatesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Partially updates settings of a Cloud SQL instance by merging the request
+     * with the current configuration. This method supports patch semantics.
+     * 
+ */ + public void patch( + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPatchMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Promotes the read replica instance to be an independent Cloud SQL
+     * primary instance.
+     * Using this operation might cause your instance to restart.
+     * 
+ */ + public void promoteReplica( + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPromoteReplicaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Switches over from the primary instance to the DR replica
+     * instance.
+     * 
+ */ + public void switchover( + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSwitchoverMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Deletes all client certificates and generates a new server SSL certificate
+     * for the instance.
+     * 
+ */ + public void resetSslConfig( + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getResetSslConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Restarts a Cloud SQL instance.
+     * 
+ */ + public void restart( + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRestartMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Restores a backup of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public void restoreBackup( + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRestoreBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Rotates the server certificate to one signed by the Certificate Authority
+     * (CA) version previously added with the addServerCA method. For instances
+     * that have enabled Certificate Authority Service (CAS) based server CA,
+     * use RotateServerCertificate to rotate the server certificate.
+     * 
+ */ + public void rotateServerCa( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRotateServerCaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addServerCertificate method. For instances not using Certificate Authority
+     * Service (CAS) server CA, use RotateServerCa instead.
+     * 
+ */ + public void rotateServerCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRotateServerCertificateMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Rotates the Entra Id certificate version to one previously added with the
+     * addEntraIdCertificate method.
+     * 
+ */ + public void rotateEntraIdCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRotateEntraIdCertificateMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Starts the replication in the read replica instance.
+     * 
+ */ + public void startReplica( + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStartReplicaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Stops the replication in the read replica instance.
+     * 
+ */ + public void stopReplica( + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStopReplicaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Truncate MySQL general and slow query log tables
+     * MySQL only.
+     * 
+ */ + public void truncateLog( + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTruncateLogMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates settings of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public void update( + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public void createEphemeral( + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateEphemeralMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Reschedules the maintenance on the given instance.
+     * 
+ */ + public void rescheduleMaintenance( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRescheduleMaintenanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Verify External primary instance external sync settings.
+     * 
+ */ + public void verifyExternalSyncSettings( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getVerifyExternalSyncSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Start External primary instance migration.
+     * 
+ */ + public void startExternalSync( + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStartExternalSyncMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Perform Disk Shrink on primary instance.
+     * 
+ */ + public void performDiskShrink( + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPerformDiskShrinkMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get Disk Shrink Config for a given instance.
+     * 
+ */ + public void getDiskShrinkConfig( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDiskShrinkConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Reset Replica Size to primary instance disk size.
+     * 
+ */ + public void resetReplicaSize( + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getResetReplicaSizeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get Latest Recovery Time for a given instance.
+     * 
+ */ + public void getLatestRecoveryTime( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetLatestRecoveryTimeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Execute SQL statements.
+     * 
+ */ + public void executeSql( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getExecuteSqlMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public void acquireSsrsLease( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAcquireSsrsLeaseMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Release a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public void releaseSsrsLease( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReleaseSsrsLeaseMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Execute MVU Pre-checks
+     * 
+ */ + public void preCheckMajorVersionUpgrade( + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPreCheckMajorVersionUpgradeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Point in time restore for an instance managed by Google Cloud Backup and
+     * Disaster Recovery.
+     * 
+ */ + public void pointInTimeRestore( + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPointInTimeRestoreMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** A stub to allow clients to do synchronous rpc calls to service SqlInstancesService. */ + public static final class SqlInstancesServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlInstancesServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlInstancesServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Add a new trusted Certificate Authority (CA) version for the specified
+     * instance. Required to prepare for a certificate rotation. If a CA version
+     * was previously added but never used in a certificate rotation, this
+     * operation replaces that version. There cannot be more than one CA version
+     * waiting to be rotated in. For instances that have enabled Certificate
+     * Authority Service (CAS) based server CA, use AddServerCertificate to add a
+     * new server certificate.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation addServerCa( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getAddServerCaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Add a new trusted server certificate version for the specified instance
+     * using Certificate Authority Service (CAS) server CA. Required to prepare
+     * for a certificate rotation. If a server certificate version was previously
+     * added but never used in a certificate rotation, this operation replaces
+     * that version. There cannot be more than one certificate version waiting to
+     * be rotated in. For instances not using CAS server CA, use AddServerCa
+     * instead.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation addServerCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getAddServerCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Adds a new Entra ID certificate for the specified instance. If an Entra ID
+     * certificate was previously added but never used in a certificate rotation,
+     * this operation replaces that version.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation addEntraIdCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getAddEntraIdCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a Cloud SQL instance as a clone of the source instance. Using this
+     * operation might cause your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation clone( + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCloneMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation delete( + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Demotes the stand-alone instance to be a Cloud SQL read replica for an
+     * external database server.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation demoteMaster( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDemoteMasterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Demotes an existing standalone instance to be a Cloud SQL read replica
+     * for an external database server.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation demote( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDemoteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL
+     * dump or CSV file.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation export( + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getExportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Initiates a manual failover of a high availability (HA) primary instance
+     * to a standby instance, which becomes the primary instance. Users are
+     * then rerouted to the new primary. For more information, see the
+     * [Overview of high
+     * availability](https://cloud.google.com/sql/docs/mysql/high-availability)
+     * page in the Cloud SQL documentation.
+     * If using Legacy HA (MySQL only), this causes the instance to failover to
+     * its failover replica instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation failover( + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getFailoverMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reencrypt CMEK instance with latest key version.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation reencrypt( + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getReencryptMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.DatabaseInstance get( + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Imports data into a Cloud SQL instance from a SQL dump  or CSV file in
+     * Cloud Storage.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation import_( + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getImportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation insert( + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists instances under a given project.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.InstancesListResponse list( + com.google.cloud.sql.v1beta4.SqlInstancesListRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all of the trusted Certificate Authorities (CAs) for the specified
+     * instance. There can be up to three CAs listed: the CA that was used to sign
+     * the certificate that is currently in use, a CA that has been added but not
+     * yet used to sign a certificate, and a CA used to sign a certificate that
+     * has previously rotated out.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.InstancesListServerCasResponse listServerCas( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListServerCasMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all versions of server certificates and certificate authorities (CAs)
+     * for the specified instance. There can be up to three sets of certs listed:
+     * the certificate that is currently in use, a future that has been added but
+     * not yet used to sign a certificate, and a certificate that has been rotated
+     * out. For instances not using Certificate Authority Service (CAS) server CA,
+     * use ListServerCas instead.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse + listServerCertificates( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListServerCertificatesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all versions of EntraID certificates for the specified instance.
+     * There can be up to three sets of certificates listed: the certificate that
+     * is currently in use, a future that has been added but not yet used to sign
+     * a certificate, and a certificate that has been rotated out.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse + listEntraIdCertificates( + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListEntraIdCertificatesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Partially updates settings of a Cloud SQL instance by merging the request
+     * with the current configuration. This method supports patch semantics.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation patch( + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Promotes the read replica instance to be an independent Cloud SQL
+     * primary instance.
+     * Using this operation might cause your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation promoteReplica( + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPromoteReplicaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Switches over from the primary instance to the DR replica
+     * instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation switchover( + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getSwitchoverMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes all client certificates and generates a new server SSL certificate
+     * for the instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation resetSslConfig( + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getResetSslConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Restarts a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation restart( + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRestartMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Restores a backup of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation restoreBackup( + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRestoreBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Rotates the server certificate to one signed by the Certificate Authority
+     * (CA) version previously added with the addServerCA method. For instances
+     * that have enabled Certificate Authority Service (CAS) based server CA,
+     * use RotateServerCertificate to rotate the server certificate.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation rotateServerCa( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRotateServerCaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addServerCertificate method. For instances not using Certificate Authority
+     * Service (CAS) server CA, use RotateServerCa instead.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation rotateServerCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRotateServerCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Rotates the Entra Id certificate version to one previously added with the
+     * addEntraIdCertificate method.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation rotateEntraIdCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRotateEntraIdCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Starts the replication in the read replica instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation startReplica( + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getStartReplicaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Stops the replication in the read replica instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation stopReplica( + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getStopReplicaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Truncate MySQL general and slow query log tables
+     * MySQL only.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation truncateLog( + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getTruncateLogMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates settings of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation update( + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SslCert createEphemeral( + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateEphemeralMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reschedules the maintenance on the given instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation rescheduleMaintenance( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRescheduleMaintenanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Verify External primary instance external sync settings.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + verifyExternalSyncSettings( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getVerifyExternalSyncSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Start External primary instance migration.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation startExternalSync( + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getStartExternalSyncMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Perform Disk Shrink on primary instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation performDiskShrink( + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPerformDiskShrinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get Disk Shrink Config for a given instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse getDiskShrinkConfig( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetDiskShrinkConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reset Replica Size to primary instance disk size.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation resetReplicaSize( + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getResetReplicaSizeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get Latest Recovery Time for a given instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse + getLatestRecoveryTime( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetLatestRecoveryTimeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Execute SQL statements.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse executeSql( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getExecuteSqlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse acquireSsrsLease( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getAcquireSsrsLeaseMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Release a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse releaseSsrsLease( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getReleaseSsrsLeaseMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Execute MVU Pre-checks
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation preCheckMajorVersionUpgrade( + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPreCheckMajorVersionUpgradeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Point in time restore for an instance managed by Google Cloud Backup and
+     * Disaster Recovery.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation pointInTimeRestore( + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPointInTimeRestoreMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do limited synchronous rpc calls to service SqlInstancesService. */ + public static final class SqlInstancesServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlInstancesServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlInstancesServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Add a new trusted Certificate Authority (CA) version for the specified
+     * instance. Required to prepare for a certificate rotation. If a CA version
+     * was previously added but never used in a certificate rotation, this
+     * operation replaces that version. There cannot be more than one CA version
+     * waiting to be rotated in. For instances that have enabled Certificate
+     * Authority Service (CAS) based server CA, use AddServerCertificate to add a
+     * new server certificate.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation addServerCa( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddServerCaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Add a new trusted server certificate version for the specified instance
+     * using Certificate Authority Service (CAS) server CA. Required to prepare
+     * for a certificate rotation. If a server certificate version was previously
+     * added but never used in a certificate rotation, this operation replaces
+     * that version. There cannot be more than one certificate version waiting to
+     * be rotated in. For instances not using CAS server CA, use AddServerCa
+     * instead.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation addServerCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddServerCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Adds a new Entra ID certificate for the specified instance. If an Entra ID
+     * certificate was previously added but never used in a certificate rotation,
+     * this operation replaces that version.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation addEntraIdCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddEntraIdCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a Cloud SQL instance as a clone of the source instance. Using this
+     * operation might cause your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation clone( + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCloneMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation delete( + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Demotes the stand-alone instance to be a Cloud SQL read replica for an
+     * external database server.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation demoteMaster( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDemoteMasterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Demotes an existing standalone instance to be a Cloud SQL read replica
+     * for an external database server.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation demote( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDemoteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL
+     * dump or CSV file.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation export( + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getExportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Initiates a manual failover of a high availability (HA) primary instance
+     * to a standby instance, which becomes the primary instance. Users are
+     * then rerouted to the new primary. For more information, see the
+     * [Overview of high
+     * availability](https://cloud.google.com/sql/docs/mysql/high-availability)
+     * page in the Cloud SQL documentation.
+     * If using Legacy HA (MySQL only), this causes the instance to failover to
+     * its failover replica instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation failover( + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFailoverMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reencrypt CMEK instance with latest key version.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation reencrypt( + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReencryptMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.DatabaseInstance get( + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Imports data into a Cloud SQL instance from a SQL dump  or CSV file in
+     * Cloud Storage.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation import_( + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation insert( + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists instances under a given project.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.InstancesListResponse list( + com.google.cloud.sql.v1beta4.SqlInstancesListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all of the trusted Certificate Authorities (CAs) for the specified
+     * instance. There can be up to three CAs listed: the CA that was used to sign
+     * the certificate that is currently in use, a CA that has been added but not
+     * yet used to sign a certificate, and a CA used to sign a certificate that
+     * has previously rotated out.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.InstancesListServerCasResponse listServerCas( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListServerCasMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all versions of server certificates and certificate authorities (CAs)
+     * for the specified instance. There can be up to three sets of certs listed:
+     * the certificate that is currently in use, a future that has been added but
+     * not yet used to sign a certificate, and a certificate that has been rotated
+     * out. For instances not using Certificate Authority Service (CAS) server CA,
+     * use ListServerCas instead.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse + listServerCertificates( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListServerCertificatesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all versions of EntraID certificates for the specified instance.
+     * There can be up to three sets of certificates listed: the certificate that
+     * is currently in use, a future that has been added but not yet used to sign
+     * a certificate, and a certificate that has been rotated out.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse + listEntraIdCertificates( + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListEntraIdCertificatesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Partially updates settings of a Cloud SQL instance by merging the request
+     * with the current configuration. This method supports patch semantics.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation patch( + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Promotes the read replica instance to be an independent Cloud SQL
+     * primary instance.
+     * Using this operation might cause your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation promoteReplica( + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPromoteReplicaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Switches over from the primary instance to the DR replica
+     * instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation switchover( + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSwitchoverMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes all client certificates and generates a new server SSL certificate
+     * for the instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation resetSslConfig( + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getResetSslConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Restarts a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation restart( + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestartMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Restores a backup of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation restoreBackup( + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestoreBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Rotates the server certificate to one signed by the Certificate Authority
+     * (CA) version previously added with the addServerCA method. For instances
+     * that have enabled Certificate Authority Service (CAS) based server CA,
+     * use RotateServerCertificate to rotate the server certificate.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation rotateServerCa( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRotateServerCaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addServerCertificate method. For instances not using Certificate Authority
+     * Service (CAS) server CA, use RotateServerCa instead.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation rotateServerCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRotateServerCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Rotates the Entra Id certificate version to one previously added with the
+     * addEntraIdCertificate method.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation rotateEntraIdCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRotateEntraIdCertificateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Starts the replication in the read replica instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation startReplica( + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getStartReplicaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Stops the replication in the read replica instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation stopReplica( + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getStopReplicaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Truncate MySQL general and slow query log tables
+     * MySQL only.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation truncateLog( + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTruncateLogMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates settings of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation update( + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SslCert createEphemeral( + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateEphemeralMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reschedules the maintenance on the given instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation rescheduleMaintenance( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRescheduleMaintenanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Verify External primary instance external sync settings.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + verifyExternalSyncSettings( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getVerifyExternalSyncSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Start External primary instance migration.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation startExternalSync( + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getStartExternalSyncMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Perform Disk Shrink on primary instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation performDiskShrink( + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPerformDiskShrinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get Disk Shrink Config for a given instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse getDiskShrinkConfig( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDiskShrinkConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reset Replica Size to primary instance disk size.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation resetReplicaSize( + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getResetReplicaSizeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get Latest Recovery Time for a given instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse + getLatestRecoveryTime( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetLatestRecoveryTimeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Execute SQL statements.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse executeSql( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getExecuteSqlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse acquireSsrsLease( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAcquireSsrsLeaseMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Release a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse releaseSsrsLease( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReleaseSsrsLeaseMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Execute MVU Pre-checks
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation preCheckMajorVersionUpgrade( + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPreCheckMajorVersionUpgradeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Point in time restore for an instance managed by Google Cloud Backup and
+     * Disaster Recovery.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation pointInTimeRestore( + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPointInTimeRestoreMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlInstancesService. + */ + public static final class SqlInstancesServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlInstancesServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlInstancesServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlInstancesServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Add a new trusted Certificate Authority (CA) version for the specified
+     * instance. Required to prepare for a certificate rotation. If a CA version
+     * was previously added but never used in a certificate rotation, this
+     * operation replaces that version. There cannot be more than one CA version
+     * waiting to be rotated in. For instances that have enabled Certificate
+     * Authority Service (CAS) based server CA, use AddServerCertificate to add a
+     * new server certificate.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + addServerCa(com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddServerCaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Add a new trusted server certificate version for the specified instance
+     * using Certificate Authority Service (CAS) server CA. Required to prepare
+     * for a certificate rotation. If a server certificate version was previously
+     * added but never used in a certificate rotation, this operation replaces
+     * that version. There cannot be more than one certificate version waiting to
+     * be rotated in. For instances not using CAS server CA, use AddServerCa
+     * instead.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + addServerCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddServerCertificateMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Adds a new Entra ID certificate for the specified instance. If an Entra ID
+     * certificate was previously added but never used in a certificate rotation,
+     * this operation replaces that version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + addEntraIdCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddEntraIdCertificateMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a Cloud SQL instance as a clone of the source instance. Using this
+     * operation might cause your instance to restart.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + clone(com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCloneMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + delete(com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Demotes the stand-alone instance to be a Cloud SQL read replica for an
+     * external database server.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + demoteMaster(com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDemoteMasterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Demotes an existing standalone instance to be a Cloud SQL read replica
+     * for an external database server.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + demote(com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDemoteMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL
+     * dump or CSV file.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + export(com.google.cloud.sql.v1beta4.SqlInstancesExportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getExportMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Initiates a manual failover of a high availability (HA) primary instance
+     * to a standby instance, which becomes the primary instance. Users are
+     * then rerouted to the new primary. For more information, see the
+     * [Overview of high
+     * availability](https://cloud.google.com/sql/docs/mysql/high-availability)
+     * page in the Cloud SQL documentation.
+     * If using Legacy HA (MySQL only), this causes the instance to failover to
+     * its failover replica instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + failover(com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFailoverMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Reencrypt CMEK instance with latest key version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + reencrypt(com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReencryptMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.DatabaseInstance> + get(com.google.cloud.sql.v1beta4.SqlInstancesGetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Imports data into a Cloud SQL instance from a SQL dump  or CSV file in
+     * Cloud Storage.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + import_(com.google.cloud.sql.v1beta4.SqlInstancesImportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + insert(com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists instances under a given project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.InstancesListResponse> + list(com.google.cloud.sql.v1beta4.SqlInstancesListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all of the trusted Certificate Authorities (CAs) for the specified
+     * instance. There can be up to three CAs listed: the CA that was used to sign
+     * the certificate that is currently in use, a CA that has been added but not
+     * yet used to sign a certificate, and a CA used to sign a certificate that
+     * has previously rotated out.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse> + listServerCas(com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListServerCasMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all versions of server certificates and certificate authorities (CAs)
+     * for the specified instance. There can be up to three sets of certs listed:
+     * the certificate that is currently in use, a future that has been added but
+     * not yet used to sign a certificate, and a certificate that has been rotated
+     * out. For instances not using Certificate Authority Service (CAS) server CA,
+     * use ListServerCas instead.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse> + listServerCertificates( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListServerCertificatesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all versions of EntraID certificates for the specified instance.
+     * There can be up to three sets of certificates listed: the certificate that
+     * is currently in use, a future that has been added but not yet used to sign
+     * a certificate, and a certificate that has been rotated out.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse> + listEntraIdCertificates( + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListEntraIdCertificatesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Partially updates settings of a Cloud SQL instance by merging the request
+     * with the current configuration. This method supports patch semantics.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + patch(com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPatchMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Promotes the read replica instance to be an independent Cloud SQL
+     * primary instance.
+     * Using this operation might cause your instance to restart.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + promoteReplica(com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPromoteReplicaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Switches over from the primary instance to the DR replica
+     * instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + switchover(com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSwitchoverMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes all client certificates and generates a new server SSL certificate
+     * for the instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + resetSslConfig(com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getResetSslConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Restarts a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + restart(com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestartMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Restores a backup of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + restoreBackup(com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestoreBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Rotates the server certificate to one signed by the Certificate Authority
+     * (CA) version previously added with the addServerCA method. For instances
+     * that have enabled Certificate Authority Service (CAS) based server CA,
+     * use RotateServerCertificate to rotate the server certificate.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + rotateServerCa(com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRotateServerCaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Rotates the server certificate version to one previously added with the
+     * addServerCertificate method. For instances not using Certificate Authority
+     * Service (CAS) server CA, use RotateServerCa instead.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + rotateServerCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRotateServerCertificateMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Rotates the Entra Id certificate version to one previously added with the
+     * addEntraIdCertificate method.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + rotateEntraIdCertificate( + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRotateEntraIdCertificateMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Starts the replication in the read replica instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + startReplica(com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getStartReplicaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Stops the replication in the read replica instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + stopReplica(com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getStopReplicaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Truncate MySQL general and slow query log tables
+     * MySQL only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + truncateLog(com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTruncateLogMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates settings of a Cloud SQL instance. Using this operation might cause
+     * your instance to restart.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + update(com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Generates a short-lived X509 certificate containing the provided public key
+     * and signed by a private key specific to the target instance. Users may use
+     * the certificate to authenticate as themselves when connecting to the
+     * database.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createEphemeral( + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateEphemeralMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Reschedules the maintenance on the given instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + rescheduleMaintenance( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRescheduleMaintenanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Verify External primary instance external sync settings.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse> + verifyExternalSyncSettings( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getVerifyExternalSyncSettingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Start External primary instance migration.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + startExternalSync( + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getStartExternalSyncMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Perform Disk Shrink on primary instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + performDiskShrink( + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPerformDiskShrinkMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get Disk Shrink Config for a given instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse> + getDiskShrinkConfig( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDiskShrinkConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Reset Replica Size to primary instance disk size.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + resetReplicaSize(com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getResetReplicaSizeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get Latest Recovery Time for a given instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse> + getLatestRecoveryTime( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetLatestRecoveryTimeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Execute SQL statements.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse> + executeSql(com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getExecuteSqlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse> + acquireSsrsLease(com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAcquireSsrsLeaseMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Release a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse> + releaseSsrsLease(com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReleaseSsrsLeaseMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Execute MVU Pre-checks
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + preCheckMajorVersionUpgrade( + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPreCheckMajorVersionUpgradeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Point in time restore for an instance managed by Google Cloud Backup and
+     * Disaster Recovery.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + pointInTimeRestore( + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPointInTimeRestoreMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_ADD_SERVER_CA = 0; + private static final int METHODID_ADD_SERVER_CERTIFICATE = 1; + private static final int METHODID_ADD_ENTRA_ID_CERTIFICATE = 2; + private static final int METHODID_CLONE = 3; + private static final int METHODID_DELETE = 4; + private static final int METHODID_DEMOTE_MASTER = 5; + private static final int METHODID_DEMOTE = 6; + private static final int METHODID_EXPORT = 7; + private static final int METHODID_FAILOVER = 8; + private static final int METHODID_REENCRYPT = 9; + private static final int METHODID_GET = 10; + private static final int METHODID_IMPORT = 11; + private static final int METHODID_INSERT = 12; + private static final int METHODID_LIST = 13; + private static final int METHODID_LIST_SERVER_CAS = 14; + private static final int METHODID_LIST_SERVER_CERTIFICATES = 15; + private static final int METHODID_LIST_ENTRA_ID_CERTIFICATES = 16; + private static final int METHODID_PATCH = 17; + private static final int METHODID_PROMOTE_REPLICA = 18; + private static final int METHODID_SWITCHOVER = 19; + private static final int METHODID_RESET_SSL_CONFIG = 20; + private static final int METHODID_RESTART = 21; + private static final int METHODID_RESTORE_BACKUP = 22; + private static final int METHODID_ROTATE_SERVER_CA = 23; + private static final int METHODID_ROTATE_SERVER_CERTIFICATE = 24; + private static final int METHODID_ROTATE_ENTRA_ID_CERTIFICATE = 25; + private static final int METHODID_START_REPLICA = 26; + private static final int METHODID_STOP_REPLICA = 27; + private static final int METHODID_TRUNCATE_LOG = 28; + private static final int METHODID_UPDATE = 29; + private static final int METHODID_CREATE_EPHEMERAL = 30; + private static final int METHODID_RESCHEDULE_MAINTENANCE = 31; + private static final int METHODID_VERIFY_EXTERNAL_SYNC_SETTINGS = 32; + private static final int METHODID_START_EXTERNAL_SYNC = 33; + private static final int METHODID_PERFORM_DISK_SHRINK = 34; + private static final int METHODID_GET_DISK_SHRINK_CONFIG = 35; + private static final int METHODID_RESET_REPLICA_SIZE = 36; + private static final int METHODID_GET_LATEST_RECOVERY_TIME = 37; + private static final int METHODID_EXECUTE_SQL = 38; + private static final int METHODID_ACQUIRE_SSRS_LEASE = 39; + private static final int METHODID_RELEASE_SSRS_LEASE = 40; + private static final int METHODID_PRE_CHECK_MAJOR_VERSION_UPGRADE = 41; + private static final int METHODID_POINT_IN_TIME_RESTORE = 42; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_ADD_SERVER_CA: + serviceImpl.addServerCa( + (com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ADD_SERVER_CERTIFICATE: + serviceImpl.addServerCertificate( + (com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ADD_ENTRA_ID_CERTIFICATE: + serviceImpl.addEntraIdCertificate( + (com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CLONE: + serviceImpl.clone( + (com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE: + serviceImpl.delete( + (com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DEMOTE_MASTER: + serviceImpl.demoteMaster( + (com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DEMOTE: + serviceImpl.demote( + (com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_EXPORT: + serviceImpl.export( + (com.google.cloud.sql.v1beta4.SqlInstancesExportRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_FAILOVER: + serviceImpl.failover( + (com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REENCRYPT: + serviceImpl.reencrypt( + (com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET: + serviceImpl.get( + (com.google.cloud.sql.v1beta4.SqlInstancesGetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_IMPORT: + serviceImpl.import_( + (com.google.cloud.sql.v1beta4.SqlInstancesImportRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_INSERT: + serviceImpl.insert( + (com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1beta4.SqlInstancesListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SERVER_CAS: + serviceImpl.listServerCas( + (com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse>) + responseObserver); + break; + case METHODID_LIST_SERVER_CERTIFICATES: + serviceImpl.listServerCertificates( + (com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse>) + responseObserver); + break; + case METHODID_LIST_ENTRA_ID_CERTIFICATES: + serviceImpl.listEntraIdCertificates( + (com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse>) + responseObserver); + break; + case METHODID_PATCH: + serviceImpl.patch( + (com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PROMOTE_REPLICA: + serviceImpl.promoteReplica( + (com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SWITCHOVER: + serviceImpl.switchover( + (com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_RESET_SSL_CONFIG: + serviceImpl.resetSslConfig( + (com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_RESTART: + serviceImpl.restart( + (com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_RESTORE_BACKUP: + serviceImpl.restoreBackup( + (com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ROTATE_SERVER_CA: + serviceImpl.rotateServerCa( + (com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ROTATE_SERVER_CERTIFICATE: + serviceImpl.rotateServerCertificate( + (com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ROTATE_ENTRA_ID_CERTIFICATE: + serviceImpl.rotateEntraIdCertificate( + (com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_START_REPLICA: + serviceImpl.startReplica( + (com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_STOP_REPLICA: + serviceImpl.stopReplica( + (com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_TRUNCATE_LOG: + serviceImpl.truncateLog( + (com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE: + serviceImpl.update( + (com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_EPHEMERAL: + serviceImpl.createEphemeral( + (com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESCHEDULE_MAINTENANCE: + serviceImpl.rescheduleMaintenance( + (com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_VERIFY_EXTERNAL_SYNC_SETTINGS: + serviceImpl.verifyExternalSyncSettings( + (com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse>) + responseObserver); + break; + case METHODID_START_EXTERNAL_SYNC: + serviceImpl.startExternalSync( + (com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PERFORM_DISK_SHRINK: + serviceImpl.performDiskShrink( + (com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_DISK_SHRINK_CONFIG: + serviceImpl.getDiskShrinkConfig( + (com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse>) + responseObserver); + break; + case METHODID_RESET_REPLICA_SIZE: + serviceImpl.resetReplicaSize( + (com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_LATEST_RECOVERY_TIME: + serviceImpl.getLatestRecoveryTime( + (com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse>) + responseObserver); + break; + case METHODID_EXECUTE_SQL: + serviceImpl.executeSql( + (com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse>) + responseObserver); + break; + case METHODID_ACQUIRE_SSRS_LEASE: + serviceImpl.acquireSsrsLease( + (com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse>) + responseObserver); + break; + case METHODID_RELEASE_SSRS_LEASE: + serviceImpl.releaseSsrsLease( + (com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse>) + responseObserver); + break; + case METHODID_PRE_CHECK_MAJOR_VERSION_UPGRADE: + serviceImpl.preCheckMajorVersionUpgrade( + (com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_POINT_IN_TIME_RESTORE: + serviceImpl.pointInTimeRestore( + (com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getAddServerCaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_ADD_SERVER_CA))) + .addMethod( + getAddServerCertificateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest, + com.google.cloud.sql.v1beta4.Operation>( + service, METHODID_ADD_SERVER_CERTIFICATE))) + .addMethod( + getAddEntraIdCertificateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest, + com.google.cloud.sql.v1beta4.Operation>( + service, METHODID_ADD_ENTRA_ID_CERTIFICATE))) + .addMethod( + getCloneMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_CLONE))) + .addMethod( + getDeleteMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_DELETE))) + .addMethod( + getDemoteMasterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_DEMOTE_MASTER))) + .addMethod( + getDemoteMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_DEMOTE))) + .addMethod( + getExportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_EXPORT))) + .addMethod( + getFailoverMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_FAILOVER))) + .addMethod( + getReencryptMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_REENCRYPT))) + .addMethod( + getGetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest, + com.google.cloud.sql.v1beta4.DatabaseInstance>(service, METHODID_GET))) + .addMethod( + getImportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_IMPORT))) + .addMethod( + getInsertMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_INSERT))) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesListRequest, + com.google.cloud.sql.v1beta4.InstancesListResponse>(service, METHODID_LIST))) + .addMethod( + getListServerCasMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest, + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse>( + service, METHODID_LIST_SERVER_CAS))) + .addMethod( + getListServerCertificatesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest, + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse>( + service, METHODID_LIST_SERVER_CERTIFICATES))) + .addMethod( + getListEntraIdCertificatesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest, + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse>( + service, METHODID_LIST_ENTRA_ID_CERTIFICATES))) + .addMethod( + getPatchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_PATCH))) + .addMethod( + getPromoteReplicaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_PROMOTE_REPLICA))) + .addMethod( + getSwitchoverMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_SWITCHOVER))) + .addMethod( + getResetSslConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_RESET_SSL_CONFIG))) + .addMethod( + getRestartMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_RESTART))) + .addMethod( + getRestoreBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_RESTORE_BACKUP))) + .addMethod( + getRotateServerCaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_ROTATE_SERVER_CA))) + .addMethod( + getRotateServerCertificateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest, + com.google.cloud.sql.v1beta4.Operation>( + service, METHODID_ROTATE_SERVER_CERTIFICATE))) + .addMethod( + getRotateEntraIdCertificateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest, + com.google.cloud.sql.v1beta4.Operation>( + service, METHODID_ROTATE_ENTRA_ID_CERTIFICATE))) + .addMethod( + getStartReplicaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_START_REPLICA))) + .addMethod( + getStopReplicaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_STOP_REPLICA))) + .addMethod( + getTruncateLogMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_TRUNCATE_LOG))) + .addMethod( + getUpdateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_UPDATE))) + .addMethod( + getCreateEphemeralMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest, + com.google.cloud.sql.v1beta4.SslCert>(service, METHODID_CREATE_EPHEMERAL))) + .addMethod( + getRescheduleMaintenanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest, + com.google.cloud.sql.v1beta4.Operation>( + service, METHODID_RESCHEDULE_MAINTENANCE))) + .addMethod( + getVerifyExternalSyncSettingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest, + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse>( + service, METHODID_VERIFY_EXTERNAL_SYNC_SETTINGS))) + .addMethod( + getStartExternalSyncMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_START_EXTERNAL_SYNC))) + .addMethod( + getPerformDiskShrinkMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_PERFORM_DISK_SHRINK))) + .addMethod( + getGetDiskShrinkConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest, + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse>( + service, METHODID_GET_DISK_SHRINK_CONFIG))) + .addMethod( + getResetReplicaSizeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_RESET_REPLICA_SIZE))) + .addMethod( + getGetLatestRecoveryTimeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest, + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse>( + service, METHODID_GET_LATEST_RECOVERY_TIME))) + .addMethod( + getExecuteSqlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse>( + service, METHODID_EXECUTE_SQL))) + .addMethod( + getAcquireSsrsLeaseMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest, + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse>( + service, METHODID_ACQUIRE_SSRS_LEASE))) + .addMethod( + getReleaseSsrsLeaseMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest, + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse>( + service, METHODID_RELEASE_SSRS_LEASE))) + .addMethod( + getPreCheckMajorVersionUpgradeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest, + com.google.cloud.sql.v1beta4.Operation>( + service, METHODID_PRE_CHECK_MAJOR_VERSION_UPGRADE))) + .addMethod( + getPointInTimeRestoreMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest, + com.google.cloud.sql.v1beta4.Operation>( + service, METHODID_POINT_IN_TIME_RESTORE))) + .build(); + } + + private abstract static class SqlInstancesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlInstancesServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlInstancesService"); + } + } + + private static final class SqlInstancesServiceFileDescriptorSupplier + extends SqlInstancesServiceBaseDescriptorSupplier { + SqlInstancesServiceFileDescriptorSupplier() {} + } + + private static final class SqlInstancesServiceMethodDescriptorSupplier + extends SqlInstancesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlInstancesServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlInstancesServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlInstancesServiceFileDescriptorSupplier()) + .addMethod(getAddServerCaMethod()) + .addMethod(getAddServerCertificateMethod()) + .addMethod(getAddEntraIdCertificateMethod()) + .addMethod(getCloneMethod()) + .addMethod(getDeleteMethod()) + .addMethod(getDemoteMasterMethod()) + .addMethod(getDemoteMethod()) + .addMethod(getExportMethod()) + .addMethod(getFailoverMethod()) + .addMethod(getReencryptMethod()) + .addMethod(getGetMethod()) + .addMethod(getImportMethod()) + .addMethod(getInsertMethod()) + .addMethod(getListMethod()) + .addMethod(getListServerCasMethod()) + .addMethod(getListServerCertificatesMethod()) + .addMethod(getListEntraIdCertificatesMethod()) + .addMethod(getPatchMethod()) + .addMethod(getPromoteReplicaMethod()) + .addMethod(getSwitchoverMethod()) + .addMethod(getResetSslConfigMethod()) + .addMethod(getRestartMethod()) + .addMethod(getRestoreBackupMethod()) + .addMethod(getRotateServerCaMethod()) + .addMethod(getRotateServerCertificateMethod()) + .addMethod(getRotateEntraIdCertificateMethod()) + .addMethod(getStartReplicaMethod()) + .addMethod(getStopReplicaMethod()) + .addMethod(getTruncateLogMethod()) + .addMethod(getUpdateMethod()) + .addMethod(getCreateEphemeralMethod()) + .addMethod(getRescheduleMaintenanceMethod()) + .addMethod(getVerifyExternalSyncSettingsMethod()) + .addMethod(getStartExternalSyncMethod()) + .addMethod(getPerformDiskShrinkMethod()) + .addMethod(getGetDiskShrinkConfigMethod()) + .addMethod(getResetReplicaSizeMethod()) + .addMethod(getGetLatestRecoveryTimeMethod()) + .addMethod(getExecuteSqlMethod()) + .addMethod(getAcquireSsrsLeaseMethod()) + .addMethod(getReleaseSsrsLeaseMethod()) + .addMethod(getPreCheckMajorVersionUpgradeMethod()) + .addMethod(getPointInTimeRestoreMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceGrpc.java new file mode 100644 index 000000000000..342b5847df60 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsServiceGrpc.java @@ -0,0 +1,644 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1beta4; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlOperationsServiceGrpc { + + private SqlOperationsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.sql.v1beta4.SqlOperationsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest, + com.google.cloud.sql.v1beta4.Operation> + getGetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Get", + requestType = com.google.cloud.sql.v1beta4.SqlOperationsGetRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest, + com.google.cloud.sql.v1beta4.Operation> + getGetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest, + com.google.cloud.sql.v1beta4.Operation> + getGetMethod; + if ((getGetMethod = SqlOperationsServiceGrpc.getGetMethod) == null) { + synchronized (SqlOperationsServiceGrpc.class) { + if ((getGetMethod = SqlOperationsServiceGrpc.getGetMethod) == null) { + SqlOperationsServiceGrpc.getGetMethod = + getGetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Get")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlOperationsServiceMethodDescriptorSupplier("Get")) + .build(); + } + } + } + return getGetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlOperationsListRequest, + com.google.cloud.sql.v1beta4.OperationsListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1beta4.SqlOperationsListRequest.class, + responseType = com.google.cloud.sql.v1beta4.OperationsListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlOperationsListRequest, + com.google.cloud.sql.v1beta4.OperationsListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlOperationsListRequest, + com.google.cloud.sql.v1beta4.OperationsListResponse> + getListMethod; + if ((getListMethod = SqlOperationsServiceGrpc.getListMethod) == null) { + synchronized (SqlOperationsServiceGrpc.class) { + if ((getListMethod = SqlOperationsServiceGrpc.getListMethod) == null) { + SqlOperationsServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlOperationsListRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.OperationsListResponse + .getDefaultInstance())) + .setSchemaDescriptor(new SqlOperationsServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest, com.google.protobuf.Empty> + getCancelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Cancel", + requestType = com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest, com.google.protobuf.Empty> + getCancelMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest, com.google.protobuf.Empty> + getCancelMethod; + if ((getCancelMethod = SqlOperationsServiceGrpc.getCancelMethod) == null) { + synchronized (SqlOperationsServiceGrpc.class) { + if ((getCancelMethod = SqlOperationsServiceGrpc.getCancelMethod) == null) { + SqlOperationsServiceGrpc.getCancelMethod = + getCancelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Cancel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new SqlOperationsServiceMethodDescriptorSupplier("Cancel")) + .build(); + } + } + } + return getCancelMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlOperationsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlOperationsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceStub(channel, callOptions); + } + }; + return SqlOperationsServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlOperationsServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlOperationsServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlOperationsServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlOperationsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlOperationsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceBlockingStub(channel, callOptions); + } + }; + return SqlOperationsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlOperationsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlOperationsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceFutureStub(channel, callOptions); + } + }; + return SqlOperationsServiceFutureStub.newStub(factory, channel); + } + + /** */ + public interface AsyncService { + + /** + * + * + *
+     * Retrieves an instance operation that has been performed on an instance.
+     * 
+ */ + default void get( + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all instance operations that have been performed on the given Cloud
+     * SQL instance in the reverse chronological order of the start time.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1beta4.SqlOperationsListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + + /** + * + * + *
+     * Cancels an instance operation that has been performed on an instance.
+     * Ordinarily, this method name should be `CancelSqlOperation`.
+     * 
+ */ + default void cancel( + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCancelMethod(), responseObserver); + } + } + + /** Base class for the server implementation of the service SqlOperationsService. */ + public abstract static class SqlOperationsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlOperationsServiceGrpc.bindService(this); + } + } + + /** A stub to allow clients to do asynchronous rpc calls to service SqlOperationsService. */ + public static final class SqlOperationsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlOperationsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlOperationsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves an instance operation that has been performed on an instance.
+     * 
+ */ + public void get( + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists all instance operations that have been performed on the given Cloud
+     * SQL instance in the reverse chronological order of the start time.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1beta4.SqlOperationsListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Cancels an instance operation that has been performed on an instance.
+     * Ordinarily, this method name should be `CancelSqlOperation`.
+     * 
+ */ + public void cancel( + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCancelMethod(), getCallOptions()), request, responseObserver); + } + } + + /** A stub to allow clients to do synchronous rpc calls to service SqlOperationsService. */ + public static final class SqlOperationsServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlOperationsServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlOperationsServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves an instance operation that has been performed on an instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation get( + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all instance operations that have been performed on the given Cloud
+     * SQL instance in the reverse chronological order of the start time.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.OperationsListResponse list( + com.google.cloud.sql.v1beta4.SqlOperationsListRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Cancels an instance operation that has been performed on an instance.
+     * Ordinarily, this method name should be `CancelSqlOperation`.
+     * 
+ */ + public com.google.protobuf.Empty cancel( + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCancelMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlOperationsService. + */ + public static final class SqlOperationsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlOperationsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlOperationsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves an instance operation that has been performed on an instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation get( + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all instance operations that have been performed on the given Cloud
+     * SQL instance in the reverse chronological order of the start time.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.OperationsListResponse list( + com.google.cloud.sql.v1beta4.SqlOperationsListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Cancels an instance operation that has been performed on an instance.
+     * Ordinarily, this method name should be `CancelSqlOperation`.
+     * 
+ */ + public com.google.protobuf.Empty cancel( + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCancelMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlOperationsService. + */ + public static final class SqlOperationsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlOperationsServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlOperationsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlOperationsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves an instance operation that has been performed on an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + get(com.google.cloud.sql.v1beta4.SqlOperationsGetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all instance operations that have been performed on the given Cloud
+     * SQL instance in the reverse chronological order of the start time.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.OperationsListResponse> + list(com.google.cloud.sql.v1beta4.SqlOperationsListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Cancels an instance operation that has been performed on an instance.
+     * Ordinarily, this method name should be `CancelSqlOperation`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture cancel( + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCancelMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET = 0; + private static final int METHODID_LIST = 1; + private static final int METHODID_CANCEL = 2; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET: + serviceImpl.get( + (com.google.cloud.sql.v1beta4.SqlOperationsGetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1beta4.SqlOperationsListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CANCEL: + serviceImpl.cancel( + (com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_GET))) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlOperationsListRequest, + com.google.cloud.sql.v1beta4.OperationsListResponse>(service, METHODID_LIST))) + .addMethod( + getCancelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest, + com.google.protobuf.Empty>(service, METHODID_CANCEL))) + .build(); + } + + private abstract static class SqlOperationsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlOperationsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlOperationsService"); + } + } + + private static final class SqlOperationsServiceFileDescriptorSupplier + extends SqlOperationsServiceBaseDescriptorSupplier { + SqlOperationsServiceFileDescriptorSupplier() {} + } + + private static final class SqlOperationsServiceMethodDescriptorSupplier + extends SqlOperationsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlOperationsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlOperationsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlOperationsServiceFileDescriptorSupplier()) + .addMethod(getGetMethod()) + .addMethod(getListMethod()) + .addMethod(getCancelMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceGrpc.java new file mode 100644 index 000000000000..d47f3a792eac --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsServiceGrpc.java @@ -0,0 +1,784 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1beta4; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlSslCertsServiceGrpc { + + private SqlSslCertsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1beta4.SqlSslCertsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Delete", + requestType = com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod; + if ((getDeleteMethod = SqlSslCertsServiceGrpc.getDeleteMethod) == null) { + synchronized (SqlSslCertsServiceGrpc.class) { + if ((getDeleteMethod = SqlSslCertsServiceGrpc.getDeleteMethod) == null) { + SqlSslCertsServiceGrpc.getDeleteMethod = + getDeleteMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Delete")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlSslCertsServiceMethodDescriptorSupplier("Delete")) + .build(); + } + } + } + return getDeleteMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest, com.google.cloud.sql.v1beta4.SslCert> + getGetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Get", + requestType = com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest.class, + responseType = com.google.cloud.sql.v1beta4.SslCert.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest, com.google.cloud.sql.v1beta4.SslCert> + getGetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest, + com.google.cloud.sql.v1beta4.SslCert> + getGetMethod; + if ((getGetMethod = SqlSslCertsServiceGrpc.getGetMethod) == null) { + synchronized (SqlSslCertsServiceGrpc.class) { + if ((getGetMethod = SqlSslCertsServiceGrpc.getGetMethod) == null) { + SqlSslCertsServiceGrpc.getGetMethod = + getGetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Get")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance())) + .setSchemaDescriptor(new SqlSslCertsServiceMethodDescriptorSupplier("Get")) + .build(); + } + } + } + return getGetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest, + com.google.cloud.sql.v1beta4.SslCertsInsertResponse> + getInsertMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Insert", + requestType = com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest.class, + responseType = com.google.cloud.sql.v1beta4.SslCertsInsertResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest, + com.google.cloud.sql.v1beta4.SslCertsInsertResponse> + getInsertMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest, + com.google.cloud.sql.v1beta4.SslCertsInsertResponse> + getInsertMethod; + if ((getInsertMethod = SqlSslCertsServiceGrpc.getInsertMethod) == null) { + synchronized (SqlSslCertsServiceGrpc.class) { + if ((getInsertMethod = SqlSslCertsServiceGrpc.getInsertMethod) == null) { + SqlSslCertsServiceGrpc.getInsertMethod = + getInsertMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Insert")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SslCertsInsertResponse + .getDefaultInstance())) + .setSchemaDescriptor(new SqlSslCertsServiceMethodDescriptorSupplier("Insert")) + .build(); + } + } + } + return getInsertMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest, + com.google.cloud.sql.v1beta4.SslCertsListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1beta4.SqlSslCertsListRequest.class, + responseType = com.google.cloud.sql.v1beta4.SslCertsListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest, + com.google.cloud.sql.v1beta4.SslCertsListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest, + com.google.cloud.sql.v1beta4.SslCertsListResponse> + getListMethod; + if ((getListMethod = SqlSslCertsServiceGrpc.getListMethod) == null) { + synchronized (SqlSslCertsServiceGrpc.class) { + if ((getListMethod = SqlSslCertsServiceGrpc.getListMethod) == null) { + SqlSslCertsServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SslCertsListResponse + .getDefaultInstance())) + .setSchemaDescriptor(new SqlSslCertsServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlSslCertsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlSslCertsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceStub(channel, callOptions); + } + }; + return SqlSslCertsServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlSslCertsServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlSslCertsServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlSslCertsServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlSslCertsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlSslCertsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceBlockingStub(channel, callOptions); + } + }; + return SqlSslCertsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlSslCertsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlSslCertsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceFutureStub(channel, callOptions); + } + }; + return SqlSslCertsServiceFutureStub.newStub(factory, channel); + } + + /** */ + public interface AsyncService { + + /** + * + * + *
+     * Deletes the SSL certificate. For First Generation instances, the
+     * certificate remains valid until the instance is restarted.
+     * 
+ */ + default void delete( + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a particular SSL certificate.  Does not include the private key
+     * (required for usage).  The private key must be saved from the response to
+     * initial creation.
+     * 
+ */ + default void get( + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates an SSL certificate and returns it along with the private key and
+     * server certificate authority.  The new certificate will not be usable until
+     * the instance is restarted.
+     * 
+ */ + default void insert( + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getInsertMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all of the current SSL certificates for the instance.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + } + + /** Base class for the server implementation of the service SqlSslCertsService. */ + public abstract static class SqlSslCertsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlSslCertsServiceGrpc.bindService(this); + } + } + + /** A stub to allow clients to do asynchronous rpc calls to service SqlSslCertsService. */ + public static final class SqlSslCertsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlSslCertsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlSslCertsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the SSL certificate. For First Generation instances, the
+     * certificate remains valid until the instance is restarted.
+     * 
+ */ + public void delete( + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves a particular SSL certificate.  Does not include the private key
+     * (required for usage).  The private key must be saved from the response to
+     * initial creation.
+     * 
+ */ + public void get( + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates an SSL certificate and returns it along with the private key and
+     * server certificate authority.  The new certificate will not be usable until
+     * the instance is restarted.
+     * 
+ */ + public void insert( + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists all of the current SSL certificates for the instance.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + } + + /** A stub to allow clients to do synchronous rpc calls to service SqlSslCertsService. */ + public static final class SqlSslCertsServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlSslCertsServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlSslCertsServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the SSL certificate. For First Generation instances, the
+     * certificate remains valid until the instance is restarted.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation delete( + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a particular SSL certificate.  Does not include the private key
+     * (required for usage).  The private key must be saved from the response to
+     * initial creation.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SslCert get( + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates an SSL certificate and returns it along with the private key and
+     * server certificate authority.  The new certificate will not be usable until
+     * the instance is restarted.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SslCertsInsertResponse insert( + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all of the current SSL certificates for the instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SslCertsListResponse list( + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do limited synchronous rpc calls to service SqlSslCertsService. */ + public static final class SqlSslCertsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlSslCertsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlSslCertsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the SSL certificate. For First Generation instances, the
+     * certificate remains valid until the instance is restarted.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation delete( + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a particular SSL certificate.  Does not include the private key
+     * (required for usage).  The private key must be saved from the response to
+     * initial creation.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SslCert get( + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates an SSL certificate and returns it along with the private key and
+     * server certificate authority.  The new certificate will not be usable until
+     * the instance is restarted.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SslCertsInsertResponse insert( + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all of the current SSL certificates for the instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.SslCertsListResponse list( + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlSslCertsService. + */ + public static final class SqlSslCertsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlSslCertsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlSslCertsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlSslCertsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes the SSL certificate. For First Generation instances, the
+     * certificate remains valid until the instance is restarted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + delete(com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a particular SSL certificate.  Does not include the private key
+     * (required for usage).  The private key must be saved from the response to
+     * initial creation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + get(com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates an SSL certificate and returns it along with the private key and
+     * server certificate authority.  The new certificate will not be usable until
+     * the instance is restarted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.SslCertsInsertResponse> + insert(com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all of the current SSL certificates for the instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.SslCertsListResponse> + list(com.google.cloud.sql.v1beta4.SqlSslCertsListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_DELETE = 0; + private static final int METHODID_GET = 1; + private static final int METHODID_INSERT = 2; + private static final int METHODID_LIST = 3; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_DELETE: + serviceImpl.delete( + (com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET: + serviceImpl.get( + (com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_INSERT: + serviceImpl.insert( + (com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1beta4.SqlSslCertsListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeleteMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_DELETE))) + .addMethod( + getGetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest, + com.google.cloud.sql.v1beta4.SslCert>(service, METHODID_GET))) + .addMethod( + getInsertMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest, + com.google.cloud.sql.v1beta4.SslCertsInsertResponse>(service, METHODID_INSERT))) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest, + com.google.cloud.sql.v1beta4.SslCertsListResponse>(service, METHODID_LIST))) + .build(); + } + + private abstract static class SqlSslCertsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlSslCertsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlSslCertsService"); + } + } + + private static final class SqlSslCertsServiceFileDescriptorSupplier + extends SqlSslCertsServiceBaseDescriptorSupplier { + SqlSslCertsServiceFileDescriptorSupplier() {} + } + + private static final class SqlSslCertsServiceMethodDescriptorSupplier + extends SqlSslCertsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlSslCertsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlSslCertsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlSslCertsServiceFileDescriptorSupplier()) + .addMethod(getDeleteMethod()) + .addMethod(getGetMethod()) + .addMethod(getInsertMethod()) + .addMethod(getListMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersServiceGrpc.java new file mode 100644 index 000000000000..faac0b006e7c --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersServiceGrpc.java @@ -0,0 +1,421 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1beta4; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for providing machine types (tiers) for Cloud SQL.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlTiersServiceGrpc { + + private SqlTiersServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1beta4.SqlTiersService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlTiersListRequest, + com.google.cloud.sql.v1beta4.TiersListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1beta4.SqlTiersListRequest.class, + responseType = com.google.cloud.sql.v1beta4.TiersListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlTiersListRequest, + com.google.cloud.sql.v1beta4.TiersListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlTiersListRequest, + com.google.cloud.sql.v1beta4.TiersListResponse> + getListMethod; + if ((getListMethod = SqlTiersServiceGrpc.getListMethod) == null) { + synchronized (SqlTiersServiceGrpc.class) { + if ((getListMethod = SqlTiersServiceGrpc.getListMethod) == null) { + SqlTiersServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlTiersListRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.TiersListResponse.getDefaultInstance())) + .setSchemaDescriptor(new SqlTiersServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlTiersServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlTiersServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceStub(channel, callOptions); + } + }; + return SqlTiersServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlTiersServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlTiersServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlTiersServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlTiersServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlTiersServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceBlockingStub(channel, callOptions); + } + }; + return SqlTiersServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlTiersServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlTiersServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceFutureStub(channel, callOptions); + } + }; + return SqlTiersServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for providing machine types (tiers) for Cloud SQL.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists all available machine types (tiers) for Cloud SQL, for example,
+     * `db-custom-1-3840`. For related information, see [Pricing](/sql/pricing).
+     * 
+ */ + default void list( + com.google.cloud.sql.v1beta4.SqlTiersListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SqlTiersService. + * + *
+   * Service for providing machine types (tiers) for Cloud SQL.
+   * 
+ */ + public abstract static class SqlTiersServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlTiersServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SqlTiersService. + * + *
+   * Service for providing machine types (tiers) for Cloud SQL.
+   * 
+ */ + public static final class SqlTiersServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlTiersServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlTiersServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available machine types (tiers) for Cloud SQL, for example,
+     * `db-custom-1-3840`. For related information, see [Pricing](/sql/pricing).
+     * 
+ */ + public void list( + com.google.cloud.sql.v1beta4.SqlTiersListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SqlTiersService. + * + *
+   * Service for providing machine types (tiers) for Cloud SQL.
+   * 
+ */ + public static final class SqlTiersServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlTiersServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlTiersServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available machine types (tiers) for Cloud SQL, for example,
+     * `db-custom-1-3840`. For related information, see [Pricing](/sql/pricing).
+     * 
+ */ + public com.google.cloud.sql.v1beta4.TiersListResponse list( + com.google.cloud.sql.v1beta4.SqlTiersListRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SqlTiersService. + * + *
+   * Service for providing machine types (tiers) for Cloud SQL.
+   * 
+ */ + public static final class SqlTiersServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlTiersServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlTiersServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available machine types (tiers) for Cloud SQL, for example,
+     * `db-custom-1-3840`. For related information, see [Pricing](/sql/pricing).
+     * 
+ */ + public com.google.cloud.sql.v1beta4.TiersListResponse list( + com.google.cloud.sql.v1beta4.SqlTiersListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SqlTiersService. + * + *
+   * Service for providing machine types (tiers) for Cloud SQL.
+   * 
+ */ + public static final class SqlTiersServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlTiersServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlTiersServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlTiersServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all available machine types (tiers) for Cloud SQL, for example,
+     * `db-custom-1-3840`. For related information, see [Pricing](/sql/pricing).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.TiersListResponse> + list(com.google.cloud.sql.v1beta4.SqlTiersListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1beta4.SqlTiersListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlTiersListRequest, + com.google.cloud.sql.v1beta4.TiersListResponse>(service, METHODID_LIST))) + .build(); + } + + private abstract static class SqlTiersServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlTiersServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlTiersService"); + } + } + + private static final class SqlTiersServiceFileDescriptorSupplier + extends SqlTiersServiceBaseDescriptorSupplier { + SqlTiersServiceFileDescriptorSupplier() {} + } + + private static final class SqlTiersServiceMethodDescriptorSupplier + extends SqlTiersServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlTiersServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlTiersServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlTiersServiceFileDescriptorSupplier()) + .addMethod(getListMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersServiceGrpc.java b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersServiceGrpc.java new file mode 100644 index 000000000000..0752990930b2 --- /dev/null +++ b/java-sql/grpc-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersServiceGrpc.java @@ -0,0 +1,872 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.sql.v1beta4; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SqlUsersServiceGrpc { + + private SqlUsersServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.sql.v1beta4.SqlUsersService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Delete", + requestType = com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest, + com.google.cloud.sql.v1beta4.Operation> + getDeleteMethod; + if ((getDeleteMethod = SqlUsersServiceGrpc.getDeleteMethod) == null) { + synchronized (SqlUsersServiceGrpc.class) { + if ((getDeleteMethod = SqlUsersServiceGrpc.getDeleteMethod) == null) { + SqlUsersServiceGrpc.getDeleteMethod = + getDeleteMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Delete")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlUsersServiceMethodDescriptorSupplier("Delete")) + .build(); + } + } + } + return getDeleteMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersGetRequest, com.google.cloud.sql.v1beta4.User> + getGetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Get", + requestType = com.google.cloud.sql.v1beta4.SqlUsersGetRequest.class, + responseType = com.google.cloud.sql.v1beta4.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersGetRequest, com.google.cloud.sql.v1beta4.User> + getGetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersGetRequest, com.google.cloud.sql.v1beta4.User> + getGetMethod; + if ((getGetMethod = SqlUsersServiceGrpc.getGetMethod) == null) { + synchronized (SqlUsersServiceGrpc.class) { + if ((getGetMethod = SqlUsersServiceGrpc.getGetMethod) == null) { + SqlUsersServiceGrpc.getGetMethod = + getGetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Get")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlUsersGetRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.User.getDefaultInstance())) + .setSchemaDescriptor(new SqlUsersServiceMethodDescriptorSupplier("Get")) + .build(); + } + } + } + return getGetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest, + com.google.cloud.sql.v1beta4.Operation> + getInsertMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Insert", + requestType = com.google.cloud.sql.v1beta4.SqlUsersInsertRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest, + com.google.cloud.sql.v1beta4.Operation> + getInsertMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest, + com.google.cloud.sql.v1beta4.Operation> + getInsertMethod; + if ((getInsertMethod = SqlUsersServiceGrpc.getInsertMethod) == null) { + synchronized (SqlUsersServiceGrpc.class) { + if ((getInsertMethod = SqlUsersServiceGrpc.getInsertMethod) == null) { + SqlUsersServiceGrpc.getInsertMethod = + getInsertMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Insert")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlUsersServiceMethodDescriptorSupplier("Insert")) + .build(); + } + } + } + return getInsertMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersListRequest, + com.google.cloud.sql.v1beta4.UsersListResponse> + getListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "List", + requestType = com.google.cloud.sql.v1beta4.SqlUsersListRequest.class, + responseType = com.google.cloud.sql.v1beta4.UsersListResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersListRequest, + com.google.cloud.sql.v1beta4.UsersListResponse> + getListMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersListRequest, + com.google.cloud.sql.v1beta4.UsersListResponse> + getListMethod; + if ((getListMethod = SqlUsersServiceGrpc.getListMethod) == null) { + synchronized (SqlUsersServiceGrpc.class) { + if ((getListMethod = SqlUsersServiceGrpc.getListMethod) == null) { + SqlUsersServiceGrpc.getListMethod = + getListMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "List")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlUsersListRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.UsersListResponse.getDefaultInstance())) + .setSchemaDescriptor(new SqlUsersServiceMethodDescriptorSupplier("List")) + .build(); + } + } + } + return getListMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest, + com.google.cloud.sql.v1beta4.Operation> + getUpdateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Update", + requestType = com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest.class, + responseType = com.google.cloud.sql.v1beta4.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest, + com.google.cloud.sql.v1beta4.Operation> + getUpdateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest, + com.google.cloud.sql.v1beta4.Operation> + getUpdateMethod; + if ((getUpdateMethod = SqlUsersServiceGrpc.getUpdateMethod) == null) { + synchronized (SqlUsersServiceGrpc.class) { + if ((getUpdateMethod = SqlUsersServiceGrpc.getUpdateMethod) == null) { + SqlUsersServiceGrpc.getUpdateMethod = + getUpdateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Update")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.sql.v1beta4.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SqlUsersServiceMethodDescriptorSupplier("Update")) + .build(); + } + } + } + return getUpdateMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SqlUsersServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlUsersServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceStub(channel, callOptions); + } + }; + return SqlUsersServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SqlUsersServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlUsersServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceBlockingV2Stub(channel, callOptions); + } + }; + return SqlUsersServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SqlUsersServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlUsersServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceBlockingStub(channel, callOptions); + } + }; + return SqlUsersServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SqlUsersServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SqlUsersServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceFutureStub(channel, callOptions); + } + }; + return SqlUsersServiceFutureStub.newStub(factory, channel); + } + + /** */ + public interface AsyncService { + + /** + * + * + *
+     * Deletes a user from a Cloud SQL instance.
+     * 
+ */ + default void delete( + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a user.
+     * 
+ */ + default void get( + com.google.cloud.sql.v1beta4.SqlUsersGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new user in a Cloud SQL instance.
+     * 
+ */ + default void insert( + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getInsertMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists users in the specified Cloud SQL instance.
+     * 
+ */ + default void list( + com.google.cloud.sql.v1beta4.SqlUsersListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an existing user in a Cloud SQL instance.
+     * 
+ */ + default void update( + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateMethod(), responseObserver); + } + } + + /** Base class for the server implementation of the service SqlUsersService. */ + public abstract static class SqlUsersServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SqlUsersServiceGrpc.bindService(this); + } + } + + /** A stub to allow clients to do asynchronous rpc calls to service SqlUsersService. */ + public static final class SqlUsersServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SqlUsersServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlUsersServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a user from a Cloud SQL instance.
+     * 
+ */ + public void delete( + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a user.
+     * 
+ */ + public void get( + com.google.cloud.sql.v1beta4.SqlUsersGetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new user in a Cloud SQL instance.
+     * 
+ */ + public void insert( + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists users in the specified Cloud SQL instance.
+     * 
+ */ + public void list( + com.google.cloud.sql.v1beta4.SqlUsersListRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates an existing user in a Cloud SQL instance.
+     * 
+ */ + public void update( + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateMethod(), getCallOptions()), request, responseObserver); + } + } + + /** A stub to allow clients to do synchronous rpc calls to service SqlUsersService. */ + public static final class SqlUsersServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SqlUsersServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlUsersServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a user from a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation delete( + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a user.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.User get( + com.google.cloud.sql.v1beta4.SqlUsersGetRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new user in a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation insert( + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists users in the specified Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.UsersListResponse list( + com.google.cloud.sql.v1beta4.SqlUsersListRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing user in a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation update( + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do limited synchronous rpc calls to service SqlUsersService. */ + public static final class SqlUsersServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SqlUsersServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlUsersServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a user from a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation delete( + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a user.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.User get( + com.google.cloud.sql.v1beta4.SqlUsersGetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new user in a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation insert( + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInsertMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists users in the specified Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.UsersListResponse list( + com.google.cloud.sql.v1beta4.SqlUsersListRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing user in a Cloud SQL instance.
+     * 
+ */ + public com.google.cloud.sql.v1beta4.Operation update( + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do ListenableFuture-style rpc calls to service SqlUsersService. */ + public static final class SqlUsersServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SqlUsersServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SqlUsersServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SqlUsersServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes a user from a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + delete(com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about a user.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + get(com.google.cloud.sql.v1beta4.SqlUsersGetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new user in a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + insert(com.google.cloud.sql.v1beta4.SqlUsersInsertRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInsertMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists users in the specified Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.UsersListResponse> + list(com.google.cloud.sql.v1beta4.SqlUsersListRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an existing user in a Cloud SQL instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.sql.v1beta4.Operation> + update(com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_DELETE = 0; + private static final int METHODID_GET = 1; + private static final int METHODID_INSERT = 2; + private static final int METHODID_LIST = 3; + private static final int METHODID_UPDATE = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_DELETE: + serviceImpl.delete( + (com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET: + serviceImpl.get( + (com.google.cloud.sql.v1beta4.SqlUsersGetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_INSERT: + serviceImpl.insert( + (com.google.cloud.sql.v1beta4.SqlUsersInsertRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST: + serviceImpl.list( + (com.google.cloud.sql.v1beta4.SqlUsersListRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE: + serviceImpl.update( + (com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeleteMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_DELETE))) + .addMethod( + getGetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlUsersGetRequest, + com.google.cloud.sql.v1beta4.User>(service, METHODID_GET))) + .addMethod( + getInsertMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_INSERT))) + .addMethod( + getListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlUsersListRequest, + com.google.cloud.sql.v1beta4.UsersListResponse>(service, METHODID_LIST))) + .addMethod( + getUpdateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest, + com.google.cloud.sql.v1beta4.Operation>(service, METHODID_UPDATE))) + .build(); + } + + private abstract static class SqlUsersServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SqlUsersServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SqlUsersService"); + } + } + + private static final class SqlUsersServiceFileDescriptorSupplier + extends SqlUsersServiceBaseDescriptorSupplier { + SqlUsersServiceFileDescriptorSupplier() {} + } + + private static final class SqlUsersServiceMethodDescriptorSupplier + extends SqlUsersServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SqlUsersServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SqlUsersServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SqlUsersServiceFileDescriptorSupplier()) + .addMethod(getDeleteMethod()) + .addMethod(getGetMethod()) + .addMethod(getInsertMethod()) + .addMethod(getListMethod()) + .addMethod(getUpdateMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-sql/pom.xml b/java-sql/pom.xml new file mode 100644 index 000000000000..34fbb19cb8f6 --- /dev/null +++ b/java-sql/pom.xml @@ -0,0 +1,70 @@ + + + 4.0.0 + com.google.cloud + google-cloud-sql-parent + pom + 0.1.0-SNAPSHOT + Google Cloud SQL Admin Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.89.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-sql-parent + + + + + + + com.google.cloud + google-cloud-sql + 0.1.0-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-sql-v1 + 0.1.0-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-sql-v1beta4 + 0.1.0-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-sql-v1 + 0.1.0-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-sql-v1beta4 + 0.1.0-SNAPSHOT + + + + + + + + google-cloud-sql + grpc-google-cloud-sql-v1 + grpc-google-cloud-sql-v1beta4 + proto-google-cloud-sql-v1 + proto-google-cloud-sql-v1beta4 + + google-cloud-sql-bom + + + \ No newline at end of file diff --git a/java-sql/proto-google-cloud-sql-v1/clirr-ignored-differences.xml b/java-sql/proto-google-cloud-sql-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..429a499eb891 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/clirr-ignored-differences.xml @@ -0,0 +1,80 @@ + + + + + 7012 + com/google/cloud/sql/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/sql/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/sql/v1/*OrBuilder + boolean has*(*) + + + + 7006 + com/google/cloud/sql/v1/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/cloud/sql/v1/** + * addRepeatedField(*) + ** + + + 7006 + com/google/cloud/sql/v1/** + * clear() + ** + + + 7006 + com/google/cloud/sql/v1/** + * clearField(*) + ** + + + 7006 + com/google/cloud/sql/v1/** + * clearOneof(*) + ** + + + 7006 + com/google/cloud/sql/v1/** + * clone() + ** + + + 7006 + com/google/cloud/sql/v1/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/cloud/sql/v1/** + * setField(*) + ** + + + 7006 + com/google/cloud/sql/v1/** + * setRepeatedField(*) + ** + + + 7006 + com/google/cloud/sql/v1/** + * setUnknownFields(*) + ** + + diff --git a/java-sql/proto-google-cloud-sql-v1/pom.xml b/java-sql/proto-google-cloud-sql-v1/pom.xml new file mode 100644 index 000000000000..ad98c9245528 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/pom.xml @@ -0,0 +1,41 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-sql-v1 + 0.1.0-SNAPSHOT + proto-google-cloud-sql-v1 + Proto library for google-cloud-sql + + com.google.cloud + google-cloud-sql-parent + 0.1.0-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 + + + org.jspecify + jspecify + + + diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AclEntry.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AclEntry.java new file mode 100644 index 000000000000..0d328f10aab6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AclEntry.java @@ -0,0 +1,1286 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * An entry for an Access Control list.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.AclEntry} + */ +@com.google.protobuf.Generated +public final class AclEntry extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.AclEntry) + AclEntryOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AclEntry"); + } + + // Use AclEntry.newBuilder() to construct. + private AclEntry(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AclEntry() { + value_ = ""; + name_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AclEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AclEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.AclEntry.class, com.google.cloud.sql.v1.AclEntry.Builder.class); + } + + private int bitField0_; + public static final int VALUE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + + /** + * + * + *
+   * The allowlisted value for the access control list.
+   * 
+ * + * string value = 1; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + + /** + * + * + *
+   * The allowlisted value for the access control list.
+   * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRATION_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp expirationTime_; + + /** + * + * + *
+   * The time when this access control entry expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return Whether the expirationTime field is set. + */ + @java.lang.Override + public boolean hasExpirationTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time when this access control entry expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return The expirationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpirationTime() { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + + /** + * + * + *
+   * The time when this access control entry expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder() { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + + public static final int NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Optional. A label to identify this entry.
+   * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+   * Optional. A label to identify this entry.
+   * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 KIND_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#aclEntry`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#aclEntry`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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.GeneratedMessage.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, value_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getExpirationTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, value_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExpirationTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.AclEntry)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.AclEntry other = (com.google.cloud.sql.v1.AclEntry) obj; + + if (!getValue().equals(other.getValue())) return false; + if (hasExpirationTime() != other.hasExpirationTime()) return false; + if (hasExpirationTime()) { + if (!getExpirationTime().equals(other.getExpirationTime())) return false; + } + if (!getName().equals(other.getName())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + if (hasExpirationTime()) { + hash = (37 * hash) + EXPIRATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpirationTime().hashCode(); + } + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.AclEntry parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.AclEntry parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AclEntry parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.AclEntry parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AclEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.AclEntry parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AclEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.AclEntry parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AclEntry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.AclEntry parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AclEntry parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.AclEntry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.AclEntry prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * An entry for an Access Control list.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.AclEntry} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.AclEntry) + com.google.cloud.sql.v1.AclEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AclEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AclEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.AclEntry.class, + com.google.cloud.sql.v1.AclEntry.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.AclEntry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetExpirationTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = ""; + expirationTime_ = null; + if (expirationTimeBuilder_ != null) { + expirationTimeBuilder_.dispose(); + expirationTimeBuilder_ = null; + } + name_ = ""; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AclEntry_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.AclEntry getDefaultInstanceForType() { + return com.google.cloud.sql.v1.AclEntry.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.AclEntry build() { + com.google.cloud.sql.v1.AclEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.AclEntry buildPartial() { + com.google.cloud.sql.v1.AclEntry result = new com.google.cloud.sql.v1.AclEntry(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.AclEntry result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.expirationTime_ = + expirationTimeBuilder_ == null ? expirationTime_ : expirationTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.kind_ = kind_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.AclEntry) { + return mergeFrom((com.google.cloud.sql.v1.AclEntry) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.AclEntry other) { + if (other == com.google.cloud.sql.v1.AclEntry.getDefaultInstance()) return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasExpirationTime()) { + mergeExpirationTime(other.getExpirationTime()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + value_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetExpirationTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + kind_ = 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 value_ = ""; + + /** + * + * + *
+     * The allowlisted value for the access control list.
+     * 
+ * + * string value = 1; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The allowlisted value for the access control list.
+     * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The allowlisted value for the access control list.
+     * 
+ * + * string value = 1; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The allowlisted value for the access control list.
+     * 
+ * + * string value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The allowlisted value for the access control list.
+     * 
+ * + * string value = 1; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expirationTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expirationTimeBuilder_; + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return Whether the expirationTime field is set. + */ + public boolean hasExpirationTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return The expirationTime. + */ + public com.google.protobuf.Timestamp getExpirationTime() { + if (expirationTimeBuilder_ == null) { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } else { + return expirationTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder setExpirationTime(com.google.protobuf.Timestamp value) { + if (expirationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expirationTime_ = value; + } else { + expirationTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder setExpirationTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expirationTimeBuilder_ == null) { + expirationTime_ = builderForValue.build(); + } else { + expirationTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder mergeExpirationTime(com.google.protobuf.Timestamp value) { + if (expirationTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && expirationTime_ != null + && expirationTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpirationTimeBuilder().mergeFrom(value); + } else { + expirationTime_ = value; + } + } else { + expirationTimeBuilder_.mergeFrom(value); + } + if (expirationTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder clearExpirationTime() { + bitField0_ = (bitField0_ & ~0x00000002); + expirationTime_ = null; + if (expirationTimeBuilder_ != null) { + expirationTimeBuilder_.dispose(); + expirationTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getExpirationTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetExpirationTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder() { + if (expirationTimeBuilder_ != null) { + return expirationTimeBuilder_.getMessageOrBuilder(); + } else { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExpirationTimeFieldBuilder() { + if (expirationTimeBuilder_ == null) { + expirationTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpirationTime(), getParentForChildren(), isClean()); + expirationTime_ = null; + } + return expirationTimeBuilder_; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Optional. A label to identify this entry.
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+     * Optional. A label to identify this entry.
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+     * Optional. A label to identify this entry.
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A label to identify this entry.
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A label to identify this entry.
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#aclEntry`.
+     * 
+ * + * string kind = 4; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#aclEntry`.
+     * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#aclEntry`.
+     * 
+ * + * string kind = 4; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#aclEntry`.
+     * 
+ * + * string kind = 4; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#aclEntry`.
+     * 
+ * + * string kind = 4; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.AclEntry) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.AclEntry) + private static final com.google.cloud.sql.v1.AclEntry DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.AclEntry(); + } + + public static com.google.cloud.sql.v1.AclEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AclEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.AclEntry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AclEntryOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AclEntryOrBuilder.java new file mode 100644 index 000000000000..58b00f5d3a5f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AclEntryOrBuilder.java @@ -0,0 +1,149 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface AclEntryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.AclEntry) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The allowlisted value for the access control list.
+   * 
+ * + * string value = 1; + * + * @return The value. + */ + java.lang.String getValue(); + + /** + * + * + *
+   * The allowlisted value for the access control list.
+   * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+   * The time when this access control entry expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return Whether the expirationTime field is set. + */ + boolean hasExpirationTime(); + + /** + * + * + *
+   * The time when this access control entry expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return The expirationTime. + */ + com.google.protobuf.Timestamp getExpirationTime(); + + /** + * + * + *
+   * The time when this access control entry expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder(); + + /** + * + * + *
+   * Optional. A label to identify this entry.
+   * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Optional. A label to identify this entry.
+   * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * This is always `sql#aclEntry`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#aclEntry`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AcquireSsrsLeaseContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AcquireSsrsLeaseContext.java new file mode 100644 index 000000000000..3da095ab25f6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AcquireSsrsLeaseContext.java @@ -0,0 +1,1387 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Acquire SSRS lease context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.AcquireSsrsLeaseContext} + */ +@com.google.protobuf.Generated +public final class AcquireSsrsLeaseContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.AcquireSsrsLeaseContext) + AcquireSsrsLeaseContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AcquireSsrsLeaseContext"); + } + + // Use AcquireSsrsLeaseContext.newBuilder() to construct. + private AcquireSsrsLeaseContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AcquireSsrsLeaseContext() { + setupLogin_ = ""; + serviceLogin_ = ""; + reportDatabase_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AcquireSsrsLeaseContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AcquireSsrsLeaseContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.AcquireSsrsLeaseContext.class, + com.google.cloud.sql.v1.AcquireSsrsLeaseContext.Builder.class); + } + + private int bitField0_; + public static final int SETUP_LOGIN_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object setupLogin_ = ""; + + /** + * + * + *
+   * The username to be used as the setup login to connect to the database
+   * server for SSRS setup.
+   * 
+ * + * optional string setup_login = 1; + * + * @return Whether the setupLogin field is set. + */ + @java.lang.Override + public boolean hasSetupLogin() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The username to be used as the setup login to connect to the database
+   * server for SSRS setup.
+   * 
+ * + * optional string setup_login = 1; + * + * @return The setupLogin. + */ + @java.lang.Override + public java.lang.String getSetupLogin() { + java.lang.Object ref = setupLogin_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + setupLogin_ = s; + return s; + } + } + + /** + * + * + *
+   * The username to be used as the setup login to connect to the database
+   * server for SSRS setup.
+   * 
+ * + * optional string setup_login = 1; + * + * @return The bytes for setupLogin. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSetupLoginBytes() { + java.lang.Object ref = setupLogin_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + setupLogin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_LOGIN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceLogin_ = ""; + + /** + * + * + *
+   * The username to be used as the service login to connect to the report
+   * database for SSRS setup.
+   * 
+ * + * optional string service_login = 2; + * + * @return Whether the serviceLogin field is set. + */ + @java.lang.Override + public boolean hasServiceLogin() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The username to be used as the service login to connect to the report
+   * database for SSRS setup.
+   * 
+ * + * optional string service_login = 2; + * + * @return The serviceLogin. + */ + @java.lang.Override + public java.lang.String getServiceLogin() { + java.lang.Object ref = serviceLogin_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceLogin_ = s; + return s; + } + } + + /** + * + * + *
+   * The username to be used as the service login to connect to the report
+   * database for SSRS setup.
+   * 
+ * + * optional string service_login = 2; + * + * @return The bytes for serviceLogin. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceLoginBytes() { + java.lang.Object ref = serviceLogin_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceLogin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPORT_DATABASE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object reportDatabase_ = ""; + + /** + * + * + *
+   * The report database to be used for SSRS setup.
+   * 
+ * + * optional string report_database = 3; + * + * @return Whether the reportDatabase field is set. + */ + @java.lang.Override + public boolean hasReportDatabase() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The report database to be used for SSRS setup.
+   * 
+ * + * optional string report_database = 3; + * + * @return The reportDatabase. + */ + @java.lang.Override + public java.lang.String getReportDatabase() { + java.lang.Object ref = reportDatabase_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reportDatabase_ = s; + return s; + } + } + + /** + * + * + *
+   * The report database to be used for SSRS setup.
+   * 
+ * + * optional string report_database = 3; + * + * @return The bytes for reportDatabase. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReportDatabaseBytes() { + java.lang.Object ref = reportDatabase_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reportDatabase_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DURATION_FIELD_NUMBER = 4; + private com.google.protobuf.Duration duration_; + + /** + * + * + *
+   * Lease duration needed for SSRS setup.
+   * 
+ * + * optional .google.protobuf.Duration duration = 4; + * + * @return Whether the duration field is set. + */ + @java.lang.Override + public boolean hasDuration() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Lease duration needed for SSRS setup.
+   * 
+ * + * optional .google.protobuf.Duration duration = 4; + * + * @return The duration. + */ + @java.lang.Override + public com.google.protobuf.Duration getDuration() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + + /** + * + * + *
+   * Lease duration needed for SSRS setup.
+   * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, setupLogin_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, serviceLogin_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, reportDatabase_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(4, getDuration()); + } + 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.GeneratedMessage.computeStringSize(1, setupLogin_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, serviceLogin_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, reportDatabase_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDuration()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.AcquireSsrsLeaseContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.AcquireSsrsLeaseContext other = + (com.google.cloud.sql.v1.AcquireSsrsLeaseContext) obj; + + if (hasSetupLogin() != other.hasSetupLogin()) return false; + if (hasSetupLogin()) { + if (!getSetupLogin().equals(other.getSetupLogin())) return false; + } + if (hasServiceLogin() != other.hasServiceLogin()) return false; + if (hasServiceLogin()) { + if (!getServiceLogin().equals(other.getServiceLogin())) return false; + } + if (hasReportDatabase() != other.hasReportDatabase()) return false; + if (hasReportDatabase()) { + if (!getReportDatabase().equals(other.getReportDatabase())) return false; + } + if (hasDuration() != other.hasDuration()) return false; + if (hasDuration()) { + if (!getDuration().equals(other.getDuration())) return false; + } + if (!getUnknownFields().equals(other.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 (hasSetupLogin()) { + hash = (37 * hash) + SETUP_LOGIN_FIELD_NUMBER; + hash = (53 * hash) + getSetupLogin().hashCode(); + } + if (hasServiceLogin()) { + hash = (37 * hash) + SERVICE_LOGIN_FIELD_NUMBER; + hash = (53 * hash) + getServiceLogin().hashCode(); + } + if (hasReportDatabase()) { + hash = (37 * hash) + REPORT_DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getReportDatabase().hashCode(); + } + if (hasDuration()) { + hash = (37 * hash) + DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDuration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.AcquireSsrsLeaseContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.AcquireSsrsLeaseContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AcquireSsrsLeaseContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.AcquireSsrsLeaseContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AcquireSsrsLeaseContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.AcquireSsrsLeaseContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AcquireSsrsLeaseContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.AcquireSsrsLeaseContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AcquireSsrsLeaseContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.AcquireSsrsLeaseContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AcquireSsrsLeaseContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.AcquireSsrsLeaseContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.AcquireSsrsLeaseContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Acquire SSRS lease context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.AcquireSsrsLeaseContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.AcquireSsrsLeaseContext) + com.google.cloud.sql.v1.AcquireSsrsLeaseContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AcquireSsrsLeaseContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AcquireSsrsLeaseContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.AcquireSsrsLeaseContext.class, + com.google.cloud.sql.v1.AcquireSsrsLeaseContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.AcquireSsrsLeaseContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetDurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + setupLogin_ = ""; + serviceLogin_ = ""; + reportDatabase_ = ""; + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AcquireSsrsLeaseContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.AcquireSsrsLeaseContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.AcquireSsrsLeaseContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.AcquireSsrsLeaseContext build() { + com.google.cloud.sql.v1.AcquireSsrsLeaseContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.AcquireSsrsLeaseContext buildPartial() { + com.google.cloud.sql.v1.AcquireSsrsLeaseContext result = + new com.google.cloud.sql.v1.AcquireSsrsLeaseContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.AcquireSsrsLeaseContext result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.setupLogin_ = setupLogin_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.serviceLogin_ = serviceLogin_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.reportDatabase_ = reportDatabase_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.duration_ = durationBuilder_ == null ? duration_ : durationBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.AcquireSsrsLeaseContext) { + return mergeFrom((com.google.cloud.sql.v1.AcquireSsrsLeaseContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.AcquireSsrsLeaseContext other) { + if (other == com.google.cloud.sql.v1.AcquireSsrsLeaseContext.getDefaultInstance()) + return this; + if (other.hasSetupLogin()) { + setupLogin_ = other.setupLogin_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasServiceLogin()) { + serviceLogin_ = other.serviceLogin_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasReportDatabase()) { + reportDatabase_ = other.reportDatabase_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasDuration()) { + mergeDuration(other.getDuration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + setupLogin_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + serviceLogin_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + reportDatabase_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object setupLogin_ = ""; + + /** + * + * + *
+     * The username to be used as the setup login to connect to the database
+     * server for SSRS setup.
+     * 
+ * + * optional string setup_login = 1; + * + * @return Whether the setupLogin field is set. + */ + public boolean hasSetupLogin() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The username to be used as the setup login to connect to the database
+     * server for SSRS setup.
+     * 
+ * + * optional string setup_login = 1; + * + * @return The setupLogin. + */ + public java.lang.String getSetupLogin() { + java.lang.Object ref = setupLogin_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + setupLogin_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The username to be used as the setup login to connect to the database
+     * server for SSRS setup.
+     * 
+ * + * optional string setup_login = 1; + * + * @return The bytes for setupLogin. + */ + public com.google.protobuf.ByteString getSetupLoginBytes() { + java.lang.Object ref = setupLogin_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + setupLogin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The username to be used as the setup login to connect to the database
+     * server for SSRS setup.
+     * 
+ * + * optional string setup_login = 1; + * + * @param value The setupLogin to set. + * @return This builder for chaining. + */ + public Builder setSetupLogin(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + setupLogin_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The username to be used as the setup login to connect to the database
+     * server for SSRS setup.
+     * 
+ * + * optional string setup_login = 1; + * + * @return This builder for chaining. + */ + public Builder clearSetupLogin() { + setupLogin_ = getDefaultInstance().getSetupLogin(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The username to be used as the setup login to connect to the database
+     * server for SSRS setup.
+     * 
+ * + * optional string setup_login = 1; + * + * @param value The bytes for setupLogin to set. + * @return This builder for chaining. + */ + public Builder setSetupLoginBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + setupLogin_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object serviceLogin_ = ""; + + /** + * + * + *
+     * The username to be used as the service login to connect to the report
+     * database for SSRS setup.
+     * 
+ * + * optional string service_login = 2; + * + * @return Whether the serviceLogin field is set. + */ + public boolean hasServiceLogin() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The username to be used as the service login to connect to the report
+     * database for SSRS setup.
+     * 
+ * + * optional string service_login = 2; + * + * @return The serviceLogin. + */ + public java.lang.String getServiceLogin() { + java.lang.Object ref = serviceLogin_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceLogin_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The username to be used as the service login to connect to the report
+     * database for SSRS setup.
+     * 
+ * + * optional string service_login = 2; + * + * @return The bytes for serviceLogin. + */ + public com.google.protobuf.ByteString getServiceLoginBytes() { + java.lang.Object ref = serviceLogin_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceLogin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The username to be used as the service login to connect to the report
+     * database for SSRS setup.
+     * 
+ * + * optional string service_login = 2; + * + * @param value The serviceLogin to set. + * @return This builder for chaining. + */ + public Builder setServiceLogin(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceLogin_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The username to be used as the service login to connect to the report
+     * database for SSRS setup.
+     * 
+ * + * optional string service_login = 2; + * + * @return This builder for chaining. + */ + public Builder clearServiceLogin() { + serviceLogin_ = getDefaultInstance().getServiceLogin(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The username to be used as the service login to connect to the report
+     * database for SSRS setup.
+     * 
+ * + * optional string service_login = 2; + * + * @param value The bytes for serviceLogin to set. + * @return This builder for chaining. + */ + public Builder setServiceLoginBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceLogin_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object reportDatabase_ = ""; + + /** + * + * + *
+     * The report database to be used for SSRS setup.
+     * 
+ * + * optional string report_database = 3; + * + * @return Whether the reportDatabase field is set. + */ + public boolean hasReportDatabase() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The report database to be used for SSRS setup.
+     * 
+ * + * optional string report_database = 3; + * + * @return The reportDatabase. + */ + public java.lang.String getReportDatabase() { + java.lang.Object ref = reportDatabase_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reportDatabase_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The report database to be used for SSRS setup.
+     * 
+ * + * optional string report_database = 3; + * + * @return The bytes for reportDatabase. + */ + public com.google.protobuf.ByteString getReportDatabaseBytes() { + java.lang.Object ref = reportDatabase_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reportDatabase_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The report database to be used for SSRS setup.
+     * 
+ * + * optional string report_database = 3; + * + * @param value The reportDatabase to set. + * @return This builder for chaining. + */ + public Builder setReportDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + reportDatabase_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The report database to be used for SSRS setup.
+     * 
+ * + * optional string report_database = 3; + * + * @return This builder for chaining. + */ + public Builder clearReportDatabase() { + reportDatabase_ = getDefaultInstance().getReportDatabase(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The report database to be used for SSRS setup.
+     * 
+ * + * optional string report_database = 3; + * + * @param value The bytes for reportDatabase to set. + * @return This builder for chaining. + */ + public Builder setReportDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + reportDatabase_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Duration duration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + durationBuilder_; + + /** + * + * + *
+     * Lease duration needed for SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + * + * @return Whether the duration field is set. + */ + public boolean hasDuration() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Lease duration needed for SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + * + * @return The duration. + */ + public com.google.protobuf.Duration getDuration() { + if (durationBuilder_ == null) { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } else { + return durationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Lease duration needed for SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + public Builder setDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + duration_ = value; + } else { + durationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Lease duration needed for SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (durationBuilder_ == null) { + duration_ = builderForValue.build(); + } else { + durationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Lease duration needed for SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + public Builder mergeDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && duration_ != null + && duration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDurationBuilder().mergeFrom(value); + } else { + duration_ = value; + } + } else { + durationBuilder_.mergeFrom(value); + } + if (duration_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Lease duration needed for SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + public Builder clearDuration() { + bitField0_ = (bitField0_ & ~0x00000008); + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Lease duration needed for SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + public com.google.protobuf.Duration.Builder getDurationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetDurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Lease duration needed for SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + if (durationBuilder_ != null) { + return durationBuilder_.getMessageOrBuilder(); + } else { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + } + + /** + * + * + *
+     * Lease duration needed for SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetDurationFieldBuilder() { + if (durationBuilder_ == null) { + durationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDuration(), getParentForChildren(), isClean()); + duration_ = null; + } + return durationBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.AcquireSsrsLeaseContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.AcquireSsrsLeaseContext) + private static final com.google.cloud.sql.v1.AcquireSsrsLeaseContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.AcquireSsrsLeaseContext(); + } + + public static com.google.cloud.sql.v1.AcquireSsrsLeaseContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AcquireSsrsLeaseContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.AcquireSsrsLeaseContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AcquireSsrsLeaseContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AcquireSsrsLeaseContextOrBuilder.java new file mode 100644 index 000000000000..7d5e3da3b585 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AcquireSsrsLeaseContextOrBuilder.java @@ -0,0 +1,188 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface AcquireSsrsLeaseContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.AcquireSsrsLeaseContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The username to be used as the setup login to connect to the database
+   * server for SSRS setup.
+   * 
+ * + * optional string setup_login = 1; + * + * @return Whether the setupLogin field is set. + */ + boolean hasSetupLogin(); + + /** + * + * + *
+   * The username to be used as the setup login to connect to the database
+   * server for SSRS setup.
+   * 
+ * + * optional string setup_login = 1; + * + * @return The setupLogin. + */ + java.lang.String getSetupLogin(); + + /** + * + * + *
+   * The username to be used as the setup login to connect to the database
+   * server for SSRS setup.
+   * 
+ * + * optional string setup_login = 1; + * + * @return The bytes for setupLogin. + */ + com.google.protobuf.ByteString getSetupLoginBytes(); + + /** + * + * + *
+   * The username to be used as the service login to connect to the report
+   * database for SSRS setup.
+   * 
+ * + * optional string service_login = 2; + * + * @return Whether the serviceLogin field is set. + */ + boolean hasServiceLogin(); + + /** + * + * + *
+   * The username to be used as the service login to connect to the report
+   * database for SSRS setup.
+   * 
+ * + * optional string service_login = 2; + * + * @return The serviceLogin. + */ + java.lang.String getServiceLogin(); + + /** + * + * + *
+   * The username to be used as the service login to connect to the report
+   * database for SSRS setup.
+   * 
+ * + * optional string service_login = 2; + * + * @return The bytes for serviceLogin. + */ + com.google.protobuf.ByteString getServiceLoginBytes(); + + /** + * + * + *
+   * The report database to be used for SSRS setup.
+   * 
+ * + * optional string report_database = 3; + * + * @return Whether the reportDatabase field is set. + */ + boolean hasReportDatabase(); + + /** + * + * + *
+   * The report database to be used for SSRS setup.
+   * 
+ * + * optional string report_database = 3; + * + * @return The reportDatabase. + */ + java.lang.String getReportDatabase(); + + /** + * + * + *
+   * The report database to be used for SSRS setup.
+   * 
+ * + * optional string report_database = 3; + * + * @return The bytes for reportDatabase. + */ + com.google.protobuf.ByteString getReportDatabaseBytes(); + + /** + * + * + *
+   * Lease duration needed for SSRS setup.
+   * 
+ * + * optional .google.protobuf.Duration duration = 4; + * + * @return Whether the duration field is set. + */ + boolean hasDuration(); + + /** + * + * + *
+   * Lease duration needed for SSRS setup.
+   * 
+ * + * optional .google.protobuf.Duration duration = 4; + * + * @return The duration. + */ + com.google.protobuf.Duration getDuration(); + + /** + * + * + *
+   * Lease duration needed for SSRS setup.
+   * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AdvancedMachineFeatures.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AdvancedMachineFeatures.java new file mode 100644 index 000000000000..3bec2c57acee --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AdvancedMachineFeatures.java @@ -0,0 +1,503 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Specifies options for controlling advanced machine features.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.AdvancedMachineFeatures} + */ +@com.google.protobuf.Generated +public final class AdvancedMachineFeatures extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.AdvancedMachineFeatures) + AdvancedMachineFeaturesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AdvancedMachineFeatures"); + } + + // Use AdvancedMachineFeatures.newBuilder() to construct. + private AdvancedMachineFeatures(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AdvancedMachineFeatures() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AdvancedMachineFeatures_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AdvancedMachineFeatures_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.AdvancedMachineFeatures.class, + com.google.cloud.sql.v1.AdvancedMachineFeatures.Builder.class); + } + + public static final int THREADS_PER_CORE_FIELD_NUMBER = 1; + private int threadsPerCore_ = 0; + + /** + * + * + *
+   * The number of threads per physical core.
+   * 
+ * + * int32 threads_per_core = 1; + * + * @return The threadsPerCore. + */ + @java.lang.Override + public int getThreadsPerCore() { + return threadsPerCore_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (threadsPerCore_ != 0) { + output.writeInt32(1, threadsPerCore_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (threadsPerCore_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, threadsPerCore_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.AdvancedMachineFeatures)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.AdvancedMachineFeatures other = + (com.google.cloud.sql.v1.AdvancedMachineFeatures) obj; + + if (getThreadsPerCore() != other.getThreadsPerCore()) return false; + if (!getUnknownFields().equals(other.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) + THREADS_PER_CORE_FIELD_NUMBER; + hash = (53 * hash) + getThreadsPerCore(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.AdvancedMachineFeatures parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.AdvancedMachineFeatures parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AdvancedMachineFeatures parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.AdvancedMachineFeatures parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AdvancedMachineFeatures parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.AdvancedMachineFeatures parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AdvancedMachineFeatures parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.AdvancedMachineFeatures parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AdvancedMachineFeatures parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.AdvancedMachineFeatures parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AdvancedMachineFeatures parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.AdvancedMachineFeatures parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.AdvancedMachineFeatures prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specifies options for controlling advanced machine features.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.AdvancedMachineFeatures} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.AdvancedMachineFeatures) + com.google.cloud.sql.v1.AdvancedMachineFeaturesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AdvancedMachineFeatures_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AdvancedMachineFeatures_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.AdvancedMachineFeatures.class, + com.google.cloud.sql.v1.AdvancedMachineFeatures.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.AdvancedMachineFeatures.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + threadsPerCore_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_AdvancedMachineFeatures_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.AdvancedMachineFeatures getDefaultInstanceForType() { + return com.google.cloud.sql.v1.AdvancedMachineFeatures.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.AdvancedMachineFeatures build() { + com.google.cloud.sql.v1.AdvancedMachineFeatures result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.AdvancedMachineFeatures buildPartial() { + com.google.cloud.sql.v1.AdvancedMachineFeatures result = + new com.google.cloud.sql.v1.AdvancedMachineFeatures(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.AdvancedMachineFeatures result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.threadsPerCore_ = threadsPerCore_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.AdvancedMachineFeatures) { + return mergeFrom((com.google.cloud.sql.v1.AdvancedMachineFeatures) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.AdvancedMachineFeatures other) { + if (other == com.google.cloud.sql.v1.AdvancedMachineFeatures.getDefaultInstance()) + return this; + if (other.getThreadsPerCore() != 0) { + setThreadsPerCore(other.getThreadsPerCore()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + threadsPerCore_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int threadsPerCore_; + + /** + * + * + *
+     * The number of threads per physical core.
+     * 
+ * + * int32 threads_per_core = 1; + * + * @return The threadsPerCore. + */ + @java.lang.Override + public int getThreadsPerCore() { + return threadsPerCore_; + } + + /** + * + * + *
+     * The number of threads per physical core.
+     * 
+ * + * int32 threads_per_core = 1; + * + * @param value The threadsPerCore to set. + * @return This builder for chaining. + */ + public Builder setThreadsPerCore(int value) { + + threadsPerCore_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of threads per physical core.
+     * 
+ * + * int32 threads_per_core = 1; + * + * @return This builder for chaining. + */ + public Builder clearThreadsPerCore() { + bitField0_ = (bitField0_ & ~0x00000001); + threadsPerCore_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.AdvancedMachineFeatures) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.AdvancedMachineFeatures) + private static final com.google.cloud.sql.v1.AdvancedMachineFeatures DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.AdvancedMachineFeatures(); + } + + public static com.google.cloud.sql.v1.AdvancedMachineFeatures getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AdvancedMachineFeatures parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.AdvancedMachineFeatures getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AdvancedMachineFeaturesOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AdvancedMachineFeaturesOrBuilder.java new file mode 100644 index 000000000000..bffa1a629328 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AdvancedMachineFeaturesOrBuilder.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface AdvancedMachineFeaturesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.AdvancedMachineFeatures) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The number of threads per physical core.
+   * 
+ * + * int32 threads_per_core = 1; + * + * @return The threadsPerCore. + */ + int getThreadsPerCore(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ApiWarning.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ApiWarning.java new file mode 100644 index 000000000000..f175223c992d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ApiWarning.java @@ -0,0 +1,1162 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * An Admin API warning message.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ApiWarning} + */ +@com.google.protobuf.Generated +public final class ApiWarning extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ApiWarning) + ApiWarningOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ApiWarning"); + } + + // Use ApiWarning.newBuilder() to construct. + private ApiWarning(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ApiWarning() { + code_ = 0; + message_ = ""; + region_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ApiWarning_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ApiWarning_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ApiWarning.class, + com.google.cloud.sql.v1.ApiWarning.Builder.class); + } + + /** Protobuf enum {@code google.cloud.sql.v1.ApiWarning.SqlApiWarningCode} */ + public enum SqlApiWarningCode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * An unknown or unset warning type from Cloud SQL API.
+     * 
+ * + * SQL_API_WARNING_CODE_UNSPECIFIED = 0; + */ + SQL_API_WARNING_CODE_UNSPECIFIED(0), + /** + * + * + *
+     * Warning when one or more regions are not reachable.  The returned result
+     * set may be incomplete.
+     * 
+ * + * REGION_UNREACHABLE = 1; + */ + REGION_UNREACHABLE(1), + /** + * + * + *
+     * Warning when user provided maxResults parameter exceeds the limit.  The
+     * returned result set may be incomplete.
+     * 
+ * + * MAX_RESULTS_EXCEEDS_LIMIT = 2; + */ + MAX_RESULTS_EXCEEDS_LIMIT(2), + /** + * + * + *
+     * Warning when user tries to create/update a user with credentials that
+     * have previously been compromised by a public data breach.
+     * 
+ * + * COMPROMISED_CREDENTIALS = 3; + */ + COMPROMISED_CREDENTIALS(3), + /** + * + * + *
+     * Warning when the operation succeeds but some non-critical workflow state
+     * failed.
+     * 
+ * + * INTERNAL_STATE_FAILURE = 4; + */ + INTERNAL_STATE_FAILURE(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlApiWarningCode"); + } + + /** + * + * + *
+     * An unknown or unset warning type from Cloud SQL API.
+     * 
+ * + * SQL_API_WARNING_CODE_UNSPECIFIED = 0; + */ + public static final int SQL_API_WARNING_CODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Warning when one or more regions are not reachable.  The returned result
+     * set may be incomplete.
+     * 
+ * + * REGION_UNREACHABLE = 1; + */ + public static final int REGION_UNREACHABLE_VALUE = 1; + + /** + * + * + *
+     * Warning when user provided maxResults parameter exceeds the limit.  The
+     * returned result set may be incomplete.
+     * 
+ * + * MAX_RESULTS_EXCEEDS_LIMIT = 2; + */ + public static final int MAX_RESULTS_EXCEEDS_LIMIT_VALUE = 2; + + /** + * + * + *
+     * Warning when user tries to create/update a user with credentials that
+     * have previously been compromised by a public data breach.
+     * 
+ * + * COMPROMISED_CREDENTIALS = 3; + */ + public static final int COMPROMISED_CREDENTIALS_VALUE = 3; + + /** + * + * + *
+     * Warning when the operation succeeds but some non-critical workflow state
+     * failed.
+     * 
+ * + * INTERNAL_STATE_FAILURE = 4; + */ + public static final int INTERNAL_STATE_FAILURE_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 SqlApiWarningCode 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 SqlApiWarningCode forNumber(int value) { + switch (value) { + case 0: + return SQL_API_WARNING_CODE_UNSPECIFIED; + case 1: + return REGION_UNREACHABLE; + case 2: + return MAX_RESULTS_EXCEEDS_LIMIT; + case 3: + return COMPROMISED_CREDENTIALS; + case 4: + return INTERNAL_STATE_FAILURE; + 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 SqlApiWarningCode findValueByNumber(int number) { + return SqlApiWarningCode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.ApiWarning.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlApiWarningCode[] VALUES = values(); + + public static SqlApiWarningCode 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 SqlApiWarningCode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.ApiWarning.SqlApiWarningCode) + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_ = 0; + + /** + * + * + *
+   * Code to uniquely identify the warning type.
+   * 
+ * + * .google.cloud.sql.v1.ApiWarning.SqlApiWarningCode code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + + /** + * + * + *
+   * Code to uniquely identify the warning type.
+   * 
+ * + * .google.cloud.sql.v1.ApiWarning.SqlApiWarningCode code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ApiWarning.SqlApiWarningCode getCode() { + com.google.cloud.sql.v1.ApiWarning.SqlApiWarningCode result = + com.google.cloud.sql.v1.ApiWarning.SqlApiWarningCode.forNumber(code_); + return result == null + ? com.google.cloud.sql.v1.ApiWarning.SqlApiWarningCode.UNRECOGNIZED + : result; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
+   * The warning message.
+   * 
+ * + * string message = 2; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + + /** + * + * + *
+   * The warning message.
+   * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REGION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object region_ = ""; + + /** + * + * + *
+   * The region name for REGION_UNREACHABLE warning.
+   * 
+ * + * string region = 3; + * + * @return The region. + */ + @java.lang.Override + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } + } + + /** + * + * + *
+   * The region name for REGION_UNREACHABLE warning.
+   * 
+ * + * string region = 3; + * + * @return The bytes for region. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = 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 (code_ + != com.google.cloud.sql.v1.ApiWarning.SqlApiWarningCode.SQL_API_WARNING_CODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, code_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, message_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, region_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ + != com.google.cloud.sql.v1.ApiWarning.SqlApiWarningCode.SQL_API_WARNING_CODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, code_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, message_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, region_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ApiWarning)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ApiWarning other = (com.google.cloud.sql.v1.ApiWarning) obj; + + if (code_ != other.code_) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (!getRegion().equals(other.getRegion())) return false; + if (!getUnknownFields().equals(other.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) + CODE_FIELD_NUMBER; + hash = (53 * hash) + code_; + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ApiWarning parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ApiWarning parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ApiWarning parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ApiWarning parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ApiWarning parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ApiWarning parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ApiWarning parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ApiWarning parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ApiWarning parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ApiWarning parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ApiWarning parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ApiWarning parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.ApiWarning prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * An Admin API warning message.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ApiWarning} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ApiWarning) + com.google.cloud.sql.v1.ApiWarningOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ApiWarning_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ApiWarning_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ApiWarning.class, + com.google.cloud.sql.v1.ApiWarning.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ApiWarning.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = 0; + message_ = ""; + region_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ApiWarning_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ApiWarning getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ApiWarning.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ApiWarning build() { + com.google.cloud.sql.v1.ApiWarning result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ApiWarning buildPartial() { + com.google.cloud.sql.v1.ApiWarning result = new com.google.cloud.sql.v1.ApiWarning(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ApiWarning result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.message_ = message_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.region_ = region_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ApiWarning) { + return mergeFrom((com.google.cloud.sql.v1.ApiWarning) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ApiWarning other) { + if (other == com.google.cloud.sql.v1.ApiWarning.getDefaultInstance()) return this; + if (other.code_ != 0) { + setCodeValue(other.getCodeValue()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getRegion().isEmpty()) { + region_ = other.region_; + 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 8: + { + code_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + region_ = 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 int code_ = 0; + + /** + * + * + *
+     * Code to uniquely identify the warning type.
+     * 
+ * + * .google.cloud.sql.v1.ApiWarning.SqlApiWarningCode code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + + /** + * + * + *
+     * Code to uniquely identify the warning type.
+     * 
+ * + * .google.cloud.sql.v1.ApiWarning.SqlApiWarningCode code = 1; + * + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + code_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Code to uniquely identify the warning type.
+     * 
+ * + * .google.cloud.sql.v1.ApiWarning.SqlApiWarningCode code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ApiWarning.SqlApiWarningCode getCode() { + com.google.cloud.sql.v1.ApiWarning.SqlApiWarningCode result = + com.google.cloud.sql.v1.ApiWarning.SqlApiWarningCode.forNumber(code_); + return result == null + ? com.google.cloud.sql.v1.ApiWarning.SqlApiWarningCode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Code to uniquely identify the warning type.
+     * 
+ * + * .google.cloud.sql.v1.ApiWarning.SqlApiWarningCode code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(com.google.cloud.sql.v1.ApiWarning.SqlApiWarningCode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + code_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Code to uniquely identify the warning type.
+     * 
+ * + * .google.cloud.sql.v1.ApiWarning.SqlApiWarningCode code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + bitField0_ = (bitField0_ & ~0x00000001); + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + + /** + * + * + *
+     * The warning message.
+     * 
+ * + * string message = 2; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The warning message.
+     * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The warning message.
+     * 
+ * + * string message = 2; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The warning message.
+     * 
+ * + * string message = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The warning message.
+     * 
+ * + * string message = 2; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object region_ = ""; + + /** + * + * + *
+     * The region name for REGION_UNREACHABLE warning.
+     * 
+ * + * string region = 3; + * + * @return The region. + */ + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The region name for REGION_UNREACHABLE warning.
+     * 
+ * + * string region = 3; + * + * @return The bytes for region. + */ + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The region name for REGION_UNREACHABLE warning.
+     * 
+ * + * string region = 3; + * + * @param value The region to set. + * @return This builder for chaining. + */ + public Builder setRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + region_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The region name for REGION_UNREACHABLE warning.
+     * 
+ * + * string region = 3; + * + * @return This builder for chaining. + */ + public Builder clearRegion() { + region_ = getDefaultInstance().getRegion(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The region name for REGION_UNREACHABLE warning.
+     * 
+ * + * string region = 3; + * + * @param value The bytes for region to set. + * @return This builder for chaining. + */ + public Builder setRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + region_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ApiWarning) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ApiWarning) + private static final com.google.cloud.sql.v1.ApiWarning DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ApiWarning(); + } + + public static com.google.cloud.sql.v1.ApiWarning getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ApiWarning parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ApiWarning getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ApiWarningOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ApiWarningOrBuilder.java new file mode 100644 index 000000000000..265315dc0612 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ApiWarningOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ApiWarningOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ApiWarning) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Code to uniquely identify the warning type.
+   * 
+ * + * .google.cloud.sql.v1.ApiWarning.SqlApiWarningCode code = 1; + * + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + + /** + * + * + *
+   * Code to uniquely identify the warning type.
+   * 
+ * + * .google.cloud.sql.v1.ApiWarning.SqlApiWarningCode code = 1; + * + * @return The code. + */ + com.google.cloud.sql.v1.ApiWarning.SqlApiWarningCode getCode(); + + /** + * + * + *
+   * The warning message.
+   * 
+ * + * string message = 2; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
+   * The warning message.
+   * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
+   * The region name for REGION_UNREACHABLE warning.
+   * 
+ * + * string region = 3; + * + * @return The region. + */ + java.lang.String getRegion(); + + /** + * + * + *
+   * The region name for REGION_UNREACHABLE warning.
+   * 
+ * + * string region = 3; + * + * @return The bytes for region. + */ + com.google.protobuf.ByteString getRegionBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AutoDnsStatus.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AutoDnsStatus.java new file mode 100644 index 000000000000..2c753f580398 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AutoDnsStatus.java @@ -0,0 +1,214 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The status of automated DNS provisioning.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.AutoDnsStatus} + */ +@com.google.protobuf.Generated +public enum AutoDnsStatus implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified status. This means status is missing from dependency service.
+   * 
+ * + * AUTO_DNS_STATUS_UNSPECIFIED = 0; + */ + AUTO_DNS_STATUS_UNSPECIFIED(0), + /** + * + * + *
+   * DNS provisioning is OK.
+   * 
+ * + * AUTO_DNS_OK = 1; + */ + AUTO_DNS_OK(1), + /** + * + * + *
+   * DNS provisioning failed.
+   * 
+ * + * AUTO_DNS_FAILED = 2; + */ + AUTO_DNS_FAILED(2), + /** + * + * + *
+   * DNS provisioning status is not recognized by Cloud SQL.
+   * 
+ * + * AUTO_DNS_UNKNOWN = 3; + */ + AUTO_DNS_UNKNOWN(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AutoDnsStatus"); + } + + /** + * + * + *
+   * Unspecified status. This means status is missing from dependency service.
+   * 
+ * + * AUTO_DNS_STATUS_UNSPECIFIED = 0; + */ + public static final int AUTO_DNS_STATUS_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * DNS provisioning is OK.
+   * 
+ * + * AUTO_DNS_OK = 1; + */ + public static final int AUTO_DNS_OK_VALUE = 1; + + /** + * + * + *
+   * DNS provisioning failed.
+   * 
+ * + * AUTO_DNS_FAILED = 2; + */ + public static final int AUTO_DNS_FAILED_VALUE = 2; + + /** + * + * + *
+   * DNS provisioning status is not recognized by Cloud SQL.
+   * 
+ * + * AUTO_DNS_UNKNOWN = 3; + */ + public static final int AUTO_DNS_UNKNOWN_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 AutoDnsStatus 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 AutoDnsStatus forNumber(int value) { + switch (value) { + case 0: + return AUTO_DNS_STATUS_UNSPECIFIED; + case 1: + return AUTO_DNS_OK; + case 2: + return AUTO_DNS_FAILED; + case 3: + return AUTO_DNS_UNKNOWN; + 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 AutoDnsStatus findValueByNumber(int number) { + return AutoDnsStatus.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor().getEnumTypes().get(11); + } + + private static final AutoDnsStatus[] VALUES = values(); + + public static AutoDnsStatus 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 AutoDnsStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.AutoDnsStatus) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AvailableDatabaseVersion.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AvailableDatabaseVersion.java new file mode 100644 index 000000000000..06a9c6a82e0e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AvailableDatabaseVersion.java @@ -0,0 +1,1097 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * An available database version. It can be a major or a minor version.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.AvailableDatabaseVersion} + */ +@com.google.protobuf.Generated +public final class AvailableDatabaseVersion extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.AvailableDatabaseVersion) + AvailableDatabaseVersionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AvailableDatabaseVersion"); + } + + // Use AvailableDatabaseVersion.newBuilder() to construct. + private AvailableDatabaseVersion(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AvailableDatabaseVersion() { + majorVersion_ = ""; + name_ = ""; + displayName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_AvailableDatabaseVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_AvailableDatabaseVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.AvailableDatabaseVersion.class, + com.google.cloud.sql.v1.AvailableDatabaseVersion.Builder.class); + } + + private int bitField0_; + public static final int MAJOR_VERSION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object majorVersion_ = ""; + + /** + * + * + *
+   * The version's major version name.
+   * 
+ * + * optional string major_version = 3; + * + * @return Whether the majorVersion field is set. + */ + @java.lang.Override + public boolean hasMajorVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The version's major version name.
+   * 
+ * + * optional string major_version = 3; + * + * @return The majorVersion. + */ + @java.lang.Override + public java.lang.String getMajorVersion() { + java.lang.Object ref = majorVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + majorVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * The version's major version name.
+   * 
+ * + * optional string major_version = 3; + * + * @return The bytes for majorVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMajorVersionBytes() { + java.lang.Object ref = majorVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + majorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The database version name. For MySQL 8.0, this string provides the database
+   * major and minor version.
+   * 
+ * + * optional string name = 8; + * + * @return Whether the name field is set. + */ + @java.lang.Override + public boolean hasName() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The database version name. For MySQL 8.0, this string provides the database
+   * major and minor version.
+   * 
+ * + * optional string name = 8; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The database version name. For MySQL 8.0, this string provides the database
+   * major and minor version.
+   * 
+ * + * optional string name = 8; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
+   * The database version's display name.
+   * 
+ * + * optional string display_name = 9; + * + * @return Whether the displayName field is set. + */ + @java.lang.Override + public boolean hasDisplayName() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The database version's display name.
+   * 
+ * + * optional string display_name = 9; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
+   * The database version's display name.
+   * 
+ * + * optional string display_name = 9; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, majorVersion_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, name_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, displayName_); + } + 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.GeneratedMessage.computeStringSize(3, majorVersion_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, name_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, displayName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.AvailableDatabaseVersion)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.AvailableDatabaseVersion other = + (com.google.cloud.sql.v1.AvailableDatabaseVersion) obj; + + if (hasMajorVersion() != other.hasMajorVersion()) return false; + if (hasMajorVersion()) { + if (!getMajorVersion().equals(other.getMajorVersion())) return false; + } + if (hasName() != other.hasName()) return false; + if (hasName()) { + if (!getName().equals(other.getName())) return false; + } + if (hasDisplayName() != other.hasDisplayName()) return false; + if (hasDisplayName()) { + if (!getDisplayName().equals(other.getDisplayName())) return false; + } + if (!getUnknownFields().equals(other.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 (hasMajorVersion()) { + hash = (37 * hash) + MAJOR_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getMajorVersion().hashCode(); + } + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasDisplayName()) { + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.AvailableDatabaseVersion parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.AvailableDatabaseVersion parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AvailableDatabaseVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.AvailableDatabaseVersion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AvailableDatabaseVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.AvailableDatabaseVersion parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AvailableDatabaseVersion parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.AvailableDatabaseVersion parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AvailableDatabaseVersion parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.AvailableDatabaseVersion parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.AvailableDatabaseVersion parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.AvailableDatabaseVersion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.AvailableDatabaseVersion prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * An available database version. It can be a major or a minor version.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.AvailableDatabaseVersion} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.AvailableDatabaseVersion) + com.google.cloud.sql.v1.AvailableDatabaseVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_AvailableDatabaseVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_AvailableDatabaseVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.AvailableDatabaseVersion.class, + com.google.cloud.sql.v1.AvailableDatabaseVersion.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.AvailableDatabaseVersion.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + majorVersion_ = ""; + name_ = ""; + displayName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_AvailableDatabaseVersion_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.AvailableDatabaseVersion getDefaultInstanceForType() { + return com.google.cloud.sql.v1.AvailableDatabaseVersion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.AvailableDatabaseVersion build() { + com.google.cloud.sql.v1.AvailableDatabaseVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.AvailableDatabaseVersion buildPartial() { + com.google.cloud.sql.v1.AvailableDatabaseVersion result = + new com.google.cloud.sql.v1.AvailableDatabaseVersion(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.AvailableDatabaseVersion result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.majorVersion_ = majorVersion_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.displayName_ = displayName_; + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.AvailableDatabaseVersion) { + return mergeFrom((com.google.cloud.sql.v1.AvailableDatabaseVersion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.AvailableDatabaseVersion other) { + if (other == com.google.cloud.sql.v1.AvailableDatabaseVersion.getDefaultInstance()) + return this; + if (other.hasMajorVersion()) { + majorVersion_ = other.majorVersion_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasName()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasDisplayName()) { + displayName_ = other.displayName_; + 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 26: + { + majorVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 26 + case 66: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 66 + case 74: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object majorVersion_ = ""; + + /** + * + * + *
+     * The version's major version name.
+     * 
+ * + * optional string major_version = 3; + * + * @return Whether the majorVersion field is set. + */ + public boolean hasMajorVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The version's major version name.
+     * 
+ * + * optional string major_version = 3; + * + * @return The majorVersion. + */ + public java.lang.String getMajorVersion() { + java.lang.Object ref = majorVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + majorVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The version's major version name.
+     * 
+ * + * optional string major_version = 3; + * + * @return The bytes for majorVersion. + */ + public com.google.protobuf.ByteString getMajorVersionBytes() { + java.lang.Object ref = majorVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + majorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The version's major version name.
+     * 
+ * + * optional string major_version = 3; + * + * @param value The majorVersion to set. + * @return This builder for chaining. + */ + public Builder setMajorVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + majorVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The version's major version name.
+     * 
+ * + * optional string major_version = 3; + * + * @return This builder for chaining. + */ + public Builder clearMajorVersion() { + majorVersion_ = getDefaultInstance().getMajorVersion(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The version's major version name.
+     * 
+ * + * optional string major_version = 3; + * + * @param value The bytes for majorVersion to set. + * @return This builder for chaining. + */ + public Builder setMajorVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + majorVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The database version name. For MySQL 8.0, this string provides the database
+     * major and minor version.
+     * 
+ * + * optional string name = 8; + * + * @return Whether the name field is set. + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The database version name. For MySQL 8.0, this string provides the database
+     * major and minor version.
+     * 
+ * + * optional string name = 8; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The database version name. For MySQL 8.0, this string provides the database
+     * major and minor version.
+     * 
+ * + * optional string name = 8; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The database version name. For MySQL 8.0, this string provides the database
+     * major and minor version.
+     * 
+ * + * optional string name = 8; + * + * @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; + } + + /** + * + * + *
+     * The database version name. For MySQL 8.0, this string provides the database
+     * major and minor version.
+     * 
+ * + * optional string name = 8; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version name. For MySQL 8.0, this string provides the database
+     * major and minor version.
+     * 
+ * + * optional string name = 8; + * + * @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; + } + + private java.lang.Object displayName_ = ""; + + /** + * + * + *
+     * The database version's display name.
+     * 
+ * + * optional string display_name = 9; + * + * @return Whether the displayName field is set. + */ + public boolean hasDisplayName() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The database version's display name.
+     * 
+ * + * optional string display_name = 9; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The database version's display name.
+     * 
+ * + * optional string display_name = 9; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The database version's display name.
+     * 
+ * + * optional string display_name = 9; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version's display name.
+     * 
+ * + * optional string display_name = 9; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version's display name.
+     * 
+ * + * optional string display_name = 9; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.AvailableDatabaseVersion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.AvailableDatabaseVersion) + private static final com.google.cloud.sql.v1.AvailableDatabaseVersion DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.AvailableDatabaseVersion(); + } + + public static com.google.cloud.sql.v1.AvailableDatabaseVersion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AvailableDatabaseVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.AvailableDatabaseVersion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AvailableDatabaseVersionOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AvailableDatabaseVersionOrBuilder.java new file mode 100644 index 000000000000..a395a014652f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/AvailableDatabaseVersionOrBuilder.java @@ -0,0 +1,148 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface AvailableDatabaseVersionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.AvailableDatabaseVersion) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The version's major version name.
+   * 
+ * + * optional string major_version = 3; + * + * @return Whether the majorVersion field is set. + */ + boolean hasMajorVersion(); + + /** + * + * + *
+   * The version's major version name.
+   * 
+ * + * optional string major_version = 3; + * + * @return The majorVersion. + */ + java.lang.String getMajorVersion(); + + /** + * + * + *
+   * The version's major version name.
+   * 
+ * + * optional string major_version = 3; + * + * @return The bytes for majorVersion. + */ + com.google.protobuf.ByteString getMajorVersionBytes(); + + /** + * + * + *
+   * The database version name. For MySQL 8.0, this string provides the database
+   * major and minor version.
+   * 
+ * + * optional string name = 8; + * + * @return Whether the name field is set. + */ + boolean hasName(); + + /** + * + * + *
+   * The database version name. For MySQL 8.0, this string provides the database
+   * major and minor version.
+   * 
+ * + * optional string name = 8; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The database version name. For MySQL 8.0, this string provides the database
+   * major and minor version.
+   * 
+ * + * optional string name = 8; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The database version's display name.
+   * 
+ * + * optional string display_name = 9; + * + * @return Whether the displayName field is set. + */ + boolean hasDisplayName(); + + /** + * + * + *
+   * The database version's display name.
+   * 
+ * + * optional string display_name = 9; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
+   * The database version's display name.
+   * 
+ * + * optional string display_name = 9; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Backup.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Backup.java new file mode 100644 index 000000000000..04fa375eee65 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Backup.java @@ -0,0 +1,6115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * A backup resource.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Backup} + */ +@com.google.protobuf.Generated +public final class Backup extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.Backup) + BackupOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Backup"); + } + + // Use Backup.newBuilder() to construct. + private Backup(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Backup() { + name_ = ""; + kind_ = ""; + selfLink_ = ""; + type_ = 0; + description_ = ""; + instance_ = ""; + location_ = ""; + state_ = 0; + kmsKey_ = ""; + kmsKeyVersion_ = ""; + backupKind_ = 0; + timeZone_ = ""; + databaseVersion_ = 0; + backupRun_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_Backup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Backup.class, com.google.cloud.sql.v1.Backup.Builder.class); + } + + /** + * + * + *
+   * The backup type.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.Backup.SqlBackupType} + */ + public enum SqlBackupType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * This is an unknown backup type.
+     * 
+ * + * SQL_BACKUP_TYPE_UNSPECIFIED = 0; + */ + SQL_BACKUP_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The backup schedule triggers a backup automatically.
+     * 
+ * + * AUTOMATED = 1; + */ + AUTOMATED(1), + /** + * + * + *
+     * The user triggers a backup manually.
+     * 
+ * + * ON_DEMAND = 2; + */ + ON_DEMAND(2), + /** + * + * + *
+     * The backup created when instance is deleted.
+     * 
+ * + * FINAL = 3; + */ + FINAL(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupType"); + } + + /** + * + * + *
+     * This is an unknown backup type.
+     * 
+ * + * SQL_BACKUP_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_BACKUP_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The backup schedule triggers a backup automatically.
+     * 
+ * + * AUTOMATED = 1; + */ + public static final int AUTOMATED_VALUE = 1; + + /** + * + * + *
+     * The user triggers a backup manually.
+     * 
+ * + * ON_DEMAND = 2; + */ + public static final int ON_DEMAND_VALUE = 2; + + /** + * + * + *
+     * The backup created when instance is deleted.
+     * 
+ * + * FINAL = 3; + */ + public static final int FINAL_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 SqlBackupType 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 SqlBackupType forNumber(int value) { + switch (value) { + case 0: + return SQL_BACKUP_TYPE_UNSPECIFIED; + case 1: + return AUTOMATED; + case 2: + return ON_DEMAND; + case 3: + return FINAL; + 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 SqlBackupType findValueByNumber(int number) { + return SqlBackupType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.Backup.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlBackupType[] VALUES = values(); + + public static SqlBackupType 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 SqlBackupType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.Backup.SqlBackupType) + } + + /** + * + * + *
+   * The backup's state
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.Backup.SqlBackupState} + */ + public enum SqlBackupState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the backup is unknown.
+     * 
+ * + * SQL_BACKUP_STATE_UNSPECIFIED = 0; + */ + SQL_BACKUP_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The backup that's added to a queue.
+     * 
+ * + * ENQUEUED = 1; + */ + ENQUEUED(1), + /** + * + * + *
+     * The backup is in progress.
+     * 
+ * + * RUNNING = 2; + */ + RUNNING(2), + /** + * + * + *
+     * The backup failed.
+     * 
+ * + * FAILED = 3; + */ + FAILED(3), + /** + * + * + *
+     * The backup is successful.
+     * 
+ * + * SUCCESSFUL = 4; + */ + SUCCESSFUL(4), + /** + * + * + *
+     * The backup is being deleted.
+     * 
+ * + * DELETING = 5; + */ + DELETING(5), + /** + * + * + *
+     * Deletion of the backup failed.
+     * 
+ * + * DELETION_FAILED = 6; + */ + DELETION_FAILED(6), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupState"); + } + + /** + * + * + *
+     * The state of the backup is unknown.
+     * 
+ * + * SQL_BACKUP_STATE_UNSPECIFIED = 0; + */ + public static final int SQL_BACKUP_STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The backup that's added to a queue.
+     * 
+ * + * ENQUEUED = 1; + */ + public static final int ENQUEUED_VALUE = 1; + + /** + * + * + *
+     * The backup is in progress.
+     * 
+ * + * RUNNING = 2; + */ + public static final int RUNNING_VALUE = 2; + + /** + * + * + *
+     * The backup failed.
+     * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + + /** + * + * + *
+     * The backup is successful.
+     * 
+ * + * SUCCESSFUL = 4; + */ + public static final int SUCCESSFUL_VALUE = 4; + + /** + * + * + *
+     * The backup is being deleted.
+     * 
+ * + * DELETING = 5; + */ + public static final int DELETING_VALUE = 5; + + /** + * + * + *
+     * Deletion of the backup failed.
+     * 
+ * + * DELETION_FAILED = 6; + */ + public static final int DELETION_FAILED_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SqlBackupState 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 SqlBackupState forNumber(int value) { + switch (value) { + case 0: + return SQL_BACKUP_STATE_UNSPECIFIED; + case 1: + return ENQUEUED; + case 2: + return RUNNING; + case 3: + return FAILED; + case 4: + return SUCCESSFUL; + case 5: + return DELETING; + case 6: + return DELETION_FAILED; + 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 SqlBackupState findValueByNumber(int number) { + return SqlBackupState.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.Backup.getDescriptor().getEnumTypes().get(1); + } + + private static final SqlBackupState[] VALUES = values(); + + public static SqlBackupState 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 SqlBackupState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.Backup.SqlBackupState) + } + + private int bitField0_; + private int expirationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object expiration_; + + public enum ExpirationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TTL_DAYS(16), + EXPIRY_TIME(17), + EXPIRATION_NOT_SET(0); + private final int value; + + private ExpirationCase(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 ExpirationCase valueOf(int value) { + return forNumber(value); + } + + public static ExpirationCase forNumber(int value) { + switch (value) { + case 16: + return TTL_DAYS; + case 17: + return EXPIRY_TIME; + case 0: + return EXPIRATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Output only. The resource name of the backup.
+   * Format: projects/{project}/backups/{backup}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The resource name of the backup.
+   * Format: projects/{project}/backups/{backup}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * Output only. This is always `sql#backup`.
+   * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. This is always `sql#backup`.
+   * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELF_LINK_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object selfLink_ = ""; + + /** + * + * + *
+   * Output only. The URI of this resource.
+   * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The selfLink. + */ + @java.lang.Override + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The URI of this resource.
+   * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for selfLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 4; + private int type_ = 0; + + /** + * + * + *
+   * Output only. The type of this backup. The type can be "AUTOMATED",
+   * "ON_DEMAND" or “FINAL”.
+   * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * Output only. The type of this backup. The type can be "AUTOMATED",
+   * "ON_DEMAND" or “FINAL”.
+   * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Backup.SqlBackupType getType() { + com.google.cloud.sql.v1.Backup.SqlBackupType result = + com.google.cloud.sql.v1.Backup.SqlBackupType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1.Backup.SqlBackupType.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * The description of this backup.
+   * 
+ * + * string description = 5; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + + /** + * + * + *
+   * The description of this backup.
+   * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * The name of the source database instance.
+   * 
+ * + * string instance = 6; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the source database instance.
+   * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + + /** + * + * + *
+   * The storage location of the backups. The location can be multi-regional.
+   * 
+ * + * string location = 7; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + + /** + * + * + *
+   * The storage location of the backups. The location can be multi-regional.
+   * 
+ * + * string location = 7; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_INTERVAL_FIELD_NUMBER = 8; + private com.google.type.Interval backupInterval_; + + /** + * + * + *
+   * Output only. This output contains the following values:
+   * start_time: All database writes up to this time are available.
+   * end_time: Any database writes after this time aren't available.
+   * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupInterval field is set. + */ + @java.lang.Override + public boolean hasBackupInterval() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. This output contains the following values:
+   * start_time: All database writes up to this time are available.
+   * end_time: Any database writes after this time aren't available.
+   * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupInterval. + */ + @java.lang.Override + public com.google.type.Interval getBackupInterval() { + return backupInterval_ == null + ? com.google.type.Interval.getDefaultInstance() + : backupInterval_; + } + + /** + * + * + *
+   * Output only. This output contains the following values:
+   * start_time: All database writes up to this time are available.
+   * end_time: Any database writes after this time aren't available.
+   * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.type.IntervalOrBuilder getBackupIntervalOrBuilder() { + return backupInterval_ == null + ? com.google.type.Interval.getDefaultInstance() + : backupInterval_; + } + + public static final int STATE_FIELD_NUMBER = 9; + private int state_ = 0; + + /** + * + * + *
+   * Output only. The status of this backup.
+   * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+   * Output only. The status of this backup.
+   * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Backup.SqlBackupState getState() { + com.google.cloud.sql.v1.Backup.SqlBackupState result = + com.google.cloud.sql.v1.Backup.SqlBackupState.forNumber(state_); + return result == null ? com.google.cloud.sql.v1.Backup.SqlBackupState.UNRECOGNIZED : result; + } + + public static final int ERROR_FIELD_NUMBER = 10; + private com.google.cloud.sql.v1.OperationError error_; + + /** + * + * + *
+   * Output only. Information about why the backup operation fails (for example,
+   * when the backup state fails).
+   * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. Information about why the backup operation fails (for example,
+   * when the backup state fails).
+   * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The error. + */ + @java.lang.Override + public com.google.cloud.sql.v1.OperationError getError() { + return error_ == null ? com.google.cloud.sql.v1.OperationError.getDefaultInstance() : error_; + } + + /** + * + * + *
+   * Output only. Information about why the backup operation fails (for example,
+   * when the backup state fails).
+   * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.OperationErrorOrBuilder getErrorOrBuilder() { + return error_ == null ? com.google.cloud.sql.v1.OperationError.getDefaultInstance() : error_; + } + + public static final int KMS_KEY_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKey_ = ""; + + /** + * + * + *
+   * Output only. This output contains the encryption configuration for a backup
+   * and the resource name of the KMS key for disk encryption.
+   * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsKey. + */ + @java.lang.Override + public java.lang.String getKmsKey() { + java.lang.Object ref = kmsKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKey_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. This output contains the encryption configuration for a backup
+   * and the resource name of the KMS key for disk encryption.
+   * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyBytes() { + java.lang.Object ref = kmsKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KMS_KEY_VERSION_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyVersion_ = ""; + + /** + * + * + *
+   * Output only. This output contains the encryption status for a backup and
+   * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+   * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsKeyVersion. + */ + @java.lang.Override + public java.lang.String getKmsKeyVersion() { + java.lang.Object ref = kmsKeyVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. This output contains the encryption status for a backup and
+   * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+   * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsKeyVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyVersionBytes() { + java.lang.Object ref = kmsKeyVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_KIND_FIELD_NUMBER = 13; + private int backupKind_ = 0; + + /** + * + * + *
+   * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for backupKind. + */ + @java.lang.Override + public int getBackupKindValue() { + return backupKind_; + } + + /** + * + * + *
+   * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupKind. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupKind getBackupKind() { + com.google.cloud.sql.v1.SqlBackupKind result = + com.google.cloud.sql.v1.SqlBackupKind.forNumber(backupKind_); + return result == null ? com.google.cloud.sql.v1.SqlBackupKind.UNRECOGNIZED : result; + } + + public static final int TIME_ZONE_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object timeZone_ = ""; + + /** + * + * + *
+   * Output only. This output contains a backup time zone. If a Cloud SQL for
+   * SQL Server instance has a different time zone from the backup's time zone,
+   * then the restore to the instance doesn't happen.
+   * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The timeZone. + */ + @java.lang.Override + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. This output contains a backup time zone. If a Cloud SQL for
+   * SQL Server instance has a different time zone from the backup's time zone,
+   * then the restore to the instance doesn't happen.
+   * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for timeZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TTL_DAYS_FIELD_NUMBER = 16; + + /** + * + * + *
+   * Input only. The time-to-live (TTL) interval for this resource (in days).
+   * For example: ttlDays:7, means 7 days from the current time. The
+   * expiration time can't exceed 365 days from the time that the backup is
+   * created.
+   * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttlDays field is set. + */ + @java.lang.Override + public boolean hasTtlDays() { + return expirationCase_ == 16; + } + + /** + * + * + *
+   * Input only. The time-to-live (TTL) interval for this resource (in days).
+   * For example: ttlDays:7, means 7 days from the current time. The
+   * expiration time can't exceed 365 days from the time that the backup is
+   * created.
+   * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttlDays. + */ + @java.lang.Override + public long getTtlDays() { + if (expirationCase_ == 16) { + return (java.lang.Long) expiration_; + } + return 0L; + } + + public static final int EXPIRY_TIME_FIELD_NUMBER = 17; + + /** + * + * + *
+   * Backup expiration time.
+   * A UTC timestamp of when this backup expired.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + * + * @return Whether the expiryTime field is set. + */ + @java.lang.Override + public boolean hasExpiryTime() { + return expirationCase_ == 17; + } + + /** + * + * + *
+   * Backup expiration time.
+   * A UTC timestamp of when this backup expired.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + * + * @return The expiryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpiryTime() { + if (expirationCase_ == 17) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + /** + * + * + *
+   * Backup expiration time.
+   * A UTC timestamp of when this backup expired.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder() { + if (expirationCase_ == 17) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int DATABASE_VERSION_FIELD_NUMBER = 20; + private int databaseVersion_ = 0; + + /** + * + * + *
+   * Output only. The database version of the instance of at the time this
+   * backup was made.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+   * Output only. The database version of the instance of at the time this
+   * backup was made.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1.SqlDatabaseVersion result = + com.google.cloud.sql.v1.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + public static final int MAX_CHARGEABLE_BYTES_FIELD_NUMBER = 23; + private long maxChargeableBytes_ = 0L; + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maxChargeableBytes field is set. + */ + @java.lang.Override + public boolean hasMaxChargeableBytes() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maxChargeableBytes. + */ + @java.lang.Override + public long getMaxChargeableBytes() { + return maxChargeableBytes_; + } + + public static final int INSTANCE_DELETION_TIME_FIELD_NUMBER = 24; + private com.google.protobuf.Timestamp instanceDeletionTime_; + + /** + * + * + *
+   * Optional. Output only. Timestamp in UTC of when the instance associated
+   * with this backup is deleted.
+   * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceDeletionTime field is set. + */ + @java.lang.Override + public boolean hasInstanceDeletionTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. Output only. Timestamp in UTC of when the instance associated
+   * with this backup is deleted.
+   * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceDeletionTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getInstanceDeletionTime() { + return instanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : instanceDeletionTime_; + } + + /** + * + * + *
+   * Optional. Output only. Timestamp in UTC of when the instance associated
+   * with this backup is deleted.
+   * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getInstanceDeletionTimeOrBuilder() { + return instanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : instanceDeletionTime_; + } + + public static final int INSTANCE_SETTINGS_FIELD_NUMBER = 25; + private com.google.cloud.sql.v1.DatabaseInstance instanceSettings_; + + /** + * + * + *
+   * Optional. Output only. The instance setting of the source instance that's
+   * associated with this backup.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceSettings field is set. + */ + @java.lang.Override + public boolean hasInstanceSettings() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Optional. Output only. The instance setting of the source instance that's
+   * associated with this backup.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceSettings. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance getInstanceSettings() { + return instanceSettings_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : instanceSettings_; + } + + /** + * + * + *
+   * Optional. Output only. The instance setting of the source instance that's
+   * associated with this backup.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getInstanceSettingsOrBuilder() { + return instanceSettings_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : instanceSettings_; + } + + public static final int BACKUP_RUN_FIELD_NUMBER = 26; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupRun_ = ""; + + /** + * + * + *
+   * Output only. The mapping to backup run resource used for IAM validations.
+   * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupRun. + */ + @java.lang.Override + public java.lang.String getBackupRun() { + java.lang.Object ref = backupRun_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupRun_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The mapping to backup run resource used for IAM validations.
+   * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupRun. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupRunBytes() { + java.lang.Object ref = backupRun_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupRun_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SATISFIES_PZS_FIELD_NUMBER = 27; + private com.google.protobuf.BoolValue satisfiesPzs_; + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzs() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSatisfiesPzs() { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + + public static final int SATISFIES_PZI_FIELD_NUMBER = 28; + private com.google.protobuf.BoolValue satisfiesPzi_; + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzi field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzi() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzi. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSatisfiesPzi() { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPziOrBuilder() { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, selfLink_); + } + if (type_ + != com.google.cloud.sql.v1.Backup.SqlBackupType.SQL_BACKUP_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, location_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(8, getBackupInterval()); + } + if (state_ + != com.google.cloud.sql.v1.Backup.SqlBackupState.SQL_BACKUP_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(9, state_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(10, getError()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kmsKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, kmsKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kmsKeyVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, kmsKeyVersion_); + } + if (backupKind_ + != com.google.cloud.sql.v1.SqlBackupKind.SQL_BACKUP_KIND_UNSPECIFIED.getNumber()) { + output.writeEnum(13, backupKind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(timeZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 15, timeZone_); + } + if (expirationCase_ == 16) { + output.writeInt64(16, (long) ((java.lang.Long) expiration_)); + } + if (expirationCase_ == 17) { + output.writeMessage(17, (com.google.protobuf.Timestamp) expiration_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(20, databaseVersion_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt64(23, maxChargeableBytes_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(24, getInstanceDeletionTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(25, getInstanceSettings()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backupRun_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 26, backupRun_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(27, getSatisfiesPzs()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(28, getSatisfiesPzi()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, selfLink_); + } + if (type_ + != com.google.cloud.sql.v1.Backup.SqlBackupType.SQL_BACKUP_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, location_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getBackupInterval()); + } + if (state_ + != com.google.cloud.sql.v1.Backup.SqlBackupState.SQL_BACKUP_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, state_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getError()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kmsKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, kmsKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kmsKeyVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, kmsKeyVersion_); + } + if (backupKind_ + != com.google.cloud.sql.v1.SqlBackupKind.SQL_BACKUP_KIND_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, backupKind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(timeZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(15, timeZone_); + } + if (expirationCase_ == 16) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 16, (long) ((java.lang.Long) expiration_)); + } + if (expirationCase_ == 17) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 17, (com.google.protobuf.Timestamp) expiration_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(20, databaseVersion_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(23, maxChargeableBytes_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(24, getInstanceDeletionTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, getInstanceSettings()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backupRun_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(26, backupRun_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(27, getSatisfiesPzs()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(28, getSatisfiesPzi()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.Backup)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.Backup other = (com.google.cloud.sql.v1.Backup) obj; + + if (!getName().equals(other.getName())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getSelfLink().equals(other.getSelfLink())) return false; + if (type_ != other.type_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (hasBackupInterval() != other.hasBackupInterval()) return false; + if (hasBackupInterval()) { + if (!getBackupInterval().equals(other.getBackupInterval())) return false; + } + if (state_ != other.state_) return false; + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (!getKmsKey().equals(other.getKmsKey())) return false; + if (!getKmsKeyVersion().equals(other.getKmsKeyVersion())) return false; + if (backupKind_ != other.backupKind_) return false; + if (!getTimeZone().equals(other.getTimeZone())) return false; + if (databaseVersion_ != other.databaseVersion_) return false; + if (hasMaxChargeableBytes() != other.hasMaxChargeableBytes()) return false; + if (hasMaxChargeableBytes()) { + if (getMaxChargeableBytes() != other.getMaxChargeableBytes()) return false; + } + if (hasInstanceDeletionTime() != other.hasInstanceDeletionTime()) return false; + if (hasInstanceDeletionTime()) { + if (!getInstanceDeletionTime().equals(other.getInstanceDeletionTime())) return false; + } + if (hasInstanceSettings() != other.hasInstanceSettings()) return false; + if (hasInstanceSettings()) { + if (!getInstanceSettings().equals(other.getInstanceSettings())) return false; + } + if (!getBackupRun().equals(other.getBackupRun())) return false; + if (hasSatisfiesPzs() != other.hasSatisfiesPzs()) return false; + if (hasSatisfiesPzs()) { + if (!getSatisfiesPzs().equals(other.getSatisfiesPzs())) return false; + } + if (hasSatisfiesPzi() != other.hasSatisfiesPzi()) return false; + if (hasSatisfiesPzi()) { + if (!getSatisfiesPzi().equals(other.getSatisfiesPzi())) return false; + } + if (!getExpirationCase().equals(other.getExpirationCase())) return false; + switch (expirationCase_) { + case 16: + if (getTtlDays() != other.getTtlDays()) return false; + break; + case 17: + if (!getExpiryTime().equals(other.getExpiryTime())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + SELF_LINK_FIELD_NUMBER; + hash = (53 * hash) + getSelfLink().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + if (hasBackupInterval()) { + hash = (37 * hash) + BACKUP_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getBackupInterval().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (37 * hash) + KMS_KEY_FIELD_NUMBER; + hash = (53 * hash) + getKmsKey().hashCode(); + hash = (37 * hash) + KMS_KEY_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyVersion().hashCode(); + hash = (37 * hash) + BACKUP_KIND_FIELD_NUMBER; + hash = (53 * hash) + backupKind_; + hash = (37 * hash) + TIME_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getTimeZone().hashCode(); + hash = (37 * hash) + DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + databaseVersion_; + if (hasMaxChargeableBytes()) { + hash = (37 * hash) + MAX_CHARGEABLE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxChargeableBytes()); + } + if (hasInstanceDeletionTime()) { + hash = (37 * hash) + INSTANCE_DELETION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getInstanceDeletionTime().hashCode(); + } + if (hasInstanceSettings()) { + hash = (37 * hash) + INSTANCE_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getInstanceSettings().hashCode(); + } + hash = (37 * hash) + BACKUP_RUN_FIELD_NUMBER; + hash = (53 * hash) + getBackupRun().hashCode(); + if (hasSatisfiesPzs()) { + hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; + hash = (53 * hash) + getSatisfiesPzs().hashCode(); + } + if (hasSatisfiesPzi()) { + hash = (37 * hash) + SATISFIES_PZI_FIELD_NUMBER; + hash = (53 * hash) + getSatisfiesPzi().hashCode(); + } + switch (expirationCase_) { + case 16: + hash = (37 * hash) + TTL_DAYS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTtlDays()); + break; + case 17: + hash = (37 * hash) + EXPIRY_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpiryTime().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.Backup parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Backup parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Backup parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Backup parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Backup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Backup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Backup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Backup parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Backup parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Backup parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Backup parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Backup parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.Backup prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A backup resource.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Backup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.Backup) + com.google.cloud.sql.v1.BackupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_Backup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Backup.class, com.google.cloud.sql.v1.Backup.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.Backup.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackupIntervalFieldBuilder(); + internalGetErrorFieldBuilder(); + internalGetInstanceDeletionTimeFieldBuilder(); + internalGetInstanceSettingsFieldBuilder(); + internalGetSatisfiesPzsFieldBuilder(); + internalGetSatisfiesPziFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + kind_ = ""; + selfLink_ = ""; + type_ = 0; + description_ = ""; + instance_ = ""; + location_ = ""; + backupInterval_ = null; + if (backupIntervalBuilder_ != null) { + backupIntervalBuilder_.dispose(); + backupIntervalBuilder_ = null; + } + state_ = 0; + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + kmsKey_ = ""; + kmsKeyVersion_ = ""; + backupKind_ = 0; + timeZone_ = ""; + if (expiryTimeBuilder_ != null) { + expiryTimeBuilder_.clear(); + } + databaseVersion_ = 0; + maxChargeableBytes_ = 0L; + instanceDeletionTime_ = null; + if (instanceDeletionTimeBuilder_ != null) { + instanceDeletionTimeBuilder_.dispose(); + instanceDeletionTimeBuilder_ = null; + } + instanceSettings_ = null; + if (instanceSettingsBuilder_ != null) { + instanceSettingsBuilder_.dispose(); + instanceSettingsBuilder_ = null; + } + backupRun_ = ""; + satisfiesPzs_ = null; + if (satisfiesPzsBuilder_ != null) { + satisfiesPzsBuilder_.dispose(); + satisfiesPzsBuilder_ = null; + } + satisfiesPzi_ = null; + if (satisfiesPziBuilder_ != null) { + satisfiesPziBuilder_.dispose(); + satisfiesPziBuilder_ = null; + } + expirationCase_ = 0; + expiration_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_Backup_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Backup getDefaultInstanceForType() { + return com.google.cloud.sql.v1.Backup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.Backup build() { + com.google.cloud.sql.v1.Backup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Backup buildPartial() { + com.google.cloud.sql.v1.Backup result = new com.google.cloud.sql.v1.Backup(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.Backup result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.selfLink_ = selfLink_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.location_ = location_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000080) != 0)) { + result.backupInterval_ = + backupIntervalBuilder_ == null ? backupInterval_ : backupIntervalBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.kmsKey_ = kmsKey_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.kmsKeyVersion_ = kmsKeyVersion_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.backupKind_ = backupKind_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.timeZone_ = timeZone_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.databaseVersion_ = databaseVersion_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.maxChargeableBytes_ = maxChargeableBytes_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.instanceDeletionTime_ = + instanceDeletionTimeBuilder_ == null + ? instanceDeletionTime_ + : instanceDeletionTimeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.instanceSettings_ = + instanceSettingsBuilder_ == null ? instanceSettings_ : instanceSettingsBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.backupRun_ = backupRun_; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.satisfiesPzs_ = + satisfiesPzsBuilder_ == null ? satisfiesPzs_ : satisfiesPzsBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.satisfiesPzi_ = + satisfiesPziBuilder_ == null ? satisfiesPzi_ : satisfiesPziBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.sql.v1.Backup result) { + result.expirationCase_ = expirationCase_; + result.expiration_ = this.expiration_; + if (expirationCase_ == 17 && expiryTimeBuilder_ != null) { + result.expiration_ = expiryTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.Backup) { + return mergeFrom((com.google.cloud.sql.v1.Backup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.Backup other) { + if (other == com.google.cloud.sql.v1.Backup.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSelfLink().isEmpty()) { + selfLink_ = other.selfLink_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasBackupInterval()) { + mergeBackupInterval(other.getBackupInterval()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (!other.getKmsKey().isEmpty()) { + kmsKey_ = other.kmsKey_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (!other.getKmsKeyVersion().isEmpty()) { + kmsKeyVersion_ = other.kmsKeyVersion_; + bitField0_ |= 0x00000800; + onChanged(); + } + if (other.backupKind_ != 0) { + setBackupKindValue(other.getBackupKindValue()); + } + if (!other.getTimeZone().isEmpty()) { + timeZone_ = other.timeZone_; + bitField0_ |= 0x00002000; + onChanged(); + } + if (other.databaseVersion_ != 0) { + setDatabaseVersionValue(other.getDatabaseVersionValue()); + } + if (other.hasMaxChargeableBytes()) { + setMaxChargeableBytes(other.getMaxChargeableBytes()); + } + if (other.hasInstanceDeletionTime()) { + mergeInstanceDeletionTime(other.getInstanceDeletionTime()); + } + if (other.hasInstanceSettings()) { + mergeInstanceSettings(other.getInstanceSettings()); + } + if (!other.getBackupRun().isEmpty()) { + backupRun_ = other.backupRun_; + bitField0_ |= 0x00100000; + onChanged(); + } + if (other.hasSatisfiesPzs()) { + mergeSatisfiesPzs(other.getSatisfiesPzs()); + } + if (other.hasSatisfiesPzi()) { + mergeSatisfiesPzi(other.getSatisfiesPzi()); + } + switch (other.getExpirationCase()) { + case TTL_DAYS: + { + setTtlDays(other.getTtlDays()); + break; + } + case EXPIRY_TIME: + { + mergeExpiryTime(other.getExpiryTime()); + break; + } + case EXPIRATION_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_ |= 0x00000001; + break; + } // case 10 + case 18: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + selfLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage( + internalGetBackupIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 82: + { + input.readMessage(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + kmsKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + kmsKeyVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 104: + { + backupKind_ = input.readEnum(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 122: + { + timeZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00002000; + break; + } // case 122 + case 128: + { + expiration_ = input.readInt64(); + expirationCase_ = 16; + break; + } // case 128 + case 138: + { + input.readMessage( + internalGetExpiryTimeFieldBuilder().getBuilder(), extensionRegistry); + expirationCase_ = 17; + break; + } // case 138 + case 160: + { + databaseVersion_ = input.readEnum(); + bitField0_ |= 0x00010000; + break; + } // case 160 + case 184: + { + maxChargeableBytes_ = input.readInt64(); + bitField0_ |= 0x00020000; + break; + } // case 184 + case 194: + { + input.readMessage( + internalGetInstanceDeletionTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 194 + case 202: + { + input.readMessage( + internalGetInstanceSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 202 + case 210: + { + backupRun_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00100000; + break; + } // case 210 + case 218: + { + input.readMessage( + internalGetSatisfiesPzsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00200000; + break; + } // case 218 + case 226: + { + input.readMessage( + internalGetSatisfiesPziFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00400000; + break; + } // case 226 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int expirationCase_ = 0; + private java.lang.Object expiration_; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public Builder clearExpiration() { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. The resource name of the backup.
+     * Format: projects/{project}/backups/{backup}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The resource name of the backup.
+     * Format: projects/{project}/backups/{backup}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The resource name of the backup.
+     * Format: projects/{project}/backups/{backup}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource name of the backup.
+     * Format: projects/{project}/backups/{backup}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource name of the backup.
+     * Format: projects/{project}/backups/{backup}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * Output only. This is always `sql#backup`.
+     * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. This is always `sql#backup`.
+     * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. This is always `sql#backup`.
+     * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This is always `sql#backup`.
+     * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This is always `sql#backup`.
+     * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object selfLink_ = ""; + + /** + * + * + *
+     * Output only. The URI of this resource.
+     * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The selfLink. + */ + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The URI of this resource.
+     * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for selfLink. + */ + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The URI of this resource.
+     * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selfLink_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The URI of this resource.
+     * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSelfLink() { + selfLink_ = getDefaultInstance().getSelfLink(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The URI of this resource.
+     * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selfLink_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int type_ = 0; + + /** + * + * + *
+     * Output only. The type of this backup. The type can be "AUTOMATED",
+     * "ON_DEMAND" or “FINAL”.
+     * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * Output only. The type of this backup. The type can be "AUTOMATED",
+     * "ON_DEMAND" or “FINAL”.
+     * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The type of this backup. The type can be "AUTOMATED",
+     * "ON_DEMAND" or “FINAL”.
+     * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Backup.SqlBackupType getType() { + com.google.cloud.sql.v1.Backup.SqlBackupType result = + com.google.cloud.sql.v1.Backup.SqlBackupType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1.Backup.SqlBackupType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The type of this backup. The type can be "AUTOMATED",
+     * "ON_DEMAND" or “FINAL”.
+     * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.sql.v1.Backup.SqlBackupType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The type of this backup. The type can be "AUTOMATED",
+     * "ON_DEMAND" or “FINAL”.
+     * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000008); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * The description of this backup.
+     * 
+ * + * string description = 5; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The description of this backup.
+     * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The description of this backup.
+     * 
+ * + * string description = 5; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The description of this backup.
+     * 
+ * + * string description = 5; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * The description of this backup.
+     * 
+ * + * string description = 5; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * The name of the source database instance.
+     * 
+ * + * string instance = 6; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the source database instance.
+     * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the source database instance.
+     * 
+ * + * string instance = 6; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the source database instance.
+     * 
+ * + * string instance = 6; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the source database instance.
+     * 
+ * + * string instance = 6; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object location_ = ""; + + /** + * + * + *
+     * The storage location of the backups. The location can be multi-regional.
+     * 
+ * + * string location = 7; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The storage location of the backups. The location can be multi-regional.
+     * 
+ * + * string location = 7; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The storage location of the backups. The location can be multi-regional.
+     * 
+ * + * string location = 7; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The storage location of the backups. The location can be multi-regional.
+     * 
+ * + * string location = 7; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * The storage location of the backups. The location can be multi-regional.
+     * 
+ * + * string location = 7; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.type.Interval backupInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + backupIntervalBuilder_; + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupInterval field is set. + */ + public boolean hasBackupInterval() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupInterval. + */ + public com.google.type.Interval getBackupInterval() { + if (backupIntervalBuilder_ == null) { + return backupInterval_ == null + ? com.google.type.Interval.getDefaultInstance() + : backupInterval_; + } else { + return backupIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBackupInterval(com.google.type.Interval value) { + if (backupIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupInterval_ = value; + } else { + backupIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBackupInterval(com.google.type.Interval.Builder builderForValue) { + if (backupIntervalBuilder_ == null) { + backupInterval_ = builderForValue.build(); + } else { + backupIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeBackupInterval(com.google.type.Interval value) { + if (backupIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && backupInterval_ != null + && backupInterval_ != com.google.type.Interval.getDefaultInstance()) { + getBackupIntervalBuilder().mergeFrom(value); + } else { + backupInterval_ = value; + } + } else { + backupIntervalBuilder_.mergeFrom(value); + } + if (backupInterval_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearBackupInterval() { + bitField0_ = (bitField0_ & ~0x00000080); + backupInterval_ = null; + if (backupIntervalBuilder_ != null) { + backupIntervalBuilder_.dispose(); + backupIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.type.Interval.Builder getBackupIntervalBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetBackupIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.type.IntervalOrBuilder getBackupIntervalOrBuilder() { + if (backupIntervalBuilder_ != null) { + return backupIntervalBuilder_.getMessageOrBuilder(); + } else { + return backupInterval_ == null + ? com.google.type.Interval.getDefaultInstance() + : backupInterval_; + } + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + internalGetBackupIntervalFieldBuilder() { + if (backupIntervalBuilder_ == null) { + backupIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder>( + getBackupInterval(), getParentForChildren(), isClean()); + backupInterval_ = null; + } + return backupIntervalBuilder_; + } + + private int state_ = 0; + + /** + * + * + *
+     * Output only. The status of this backup.
+     * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+     * Output only. The status of this backup.
+     * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupState state = 9 [(.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_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of this backup.
+     * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Backup.SqlBackupState getState() { + com.google.cloud.sql.v1.Backup.SqlBackupState result = + com.google.cloud.sql.v1.Backup.SqlBackupState.forNumber(state_); + return result == null ? com.google.cloud.sql.v1.Backup.SqlBackupState.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The status of this backup.
+     * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.sql.v1.Backup.SqlBackupState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of this backup.
+     * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000100); + state_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.OperationError error_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.OperationError, + com.google.cloud.sql.v1.OperationError.Builder, + com.google.cloud.sql.v1.OperationErrorOrBuilder> + errorBuilder_; + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The error. + */ + public com.google.cloud.sql.v1.OperationError getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.cloud.sql.v1.OperationError.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setError(com.google.cloud.sql.v1.OperationError value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setError(com.google.cloud.sql.v1.OperationError.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeError(com.google.cloud.sql.v1.OperationError value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && error_ != null + && error_ != com.google.cloud.sql.v1.OperationError.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000200); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.OperationError.Builder getErrorBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.OperationErrorOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.cloud.sql.v1.OperationError.getDefaultInstance() + : error_; + } + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.OperationError, + com.google.cloud.sql.v1.OperationError.Builder, + com.google.cloud.sql.v1.OperationErrorOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.OperationError, + com.google.cloud.sql.v1.OperationError.Builder, + com.google.cloud.sql.v1.OperationErrorOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + private java.lang.Object kmsKey_ = ""; + + /** + * + * + *
+     * Output only. This output contains the encryption configuration for a backup
+     * and the resource name of the KMS key for disk encryption.
+     * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsKey. + */ + public java.lang.String getKmsKey() { + java.lang.Object ref = kmsKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. This output contains the encryption configuration for a backup
+     * and the resource name of the KMS key for disk encryption.
+     * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsKey. + */ + public com.google.protobuf.ByteString getKmsKeyBytes() { + java.lang.Object ref = kmsKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. This output contains the encryption configuration for a backup
+     * and the resource name of the KMS key for disk encryption.
+     * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The kmsKey to set. + * @return This builder for chaining. + */ + public Builder setKmsKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKey_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains the encryption configuration for a backup
+     * and the resource name of the KMS key for disk encryption.
+     * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearKmsKey() { + kmsKey_ = getDefaultInstance().getKmsKey(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains the encryption configuration for a backup
+     * and the resource name of the KMS key for disk encryption.
+     * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for kmsKey to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKey_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object kmsKeyVersion_ = ""; + + /** + * + * + *
+     * Output only. This output contains the encryption status for a backup and
+     * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+     * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsKeyVersion. + */ + public java.lang.String getKmsKeyVersion() { + java.lang.Object ref = kmsKeyVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. This output contains the encryption status for a backup and
+     * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+     * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsKeyVersion. + */ + public com.google.protobuf.ByteString getKmsKeyVersionBytes() { + java.lang.Object ref = kmsKeyVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. This output contains the encryption status for a backup and
+     * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+     * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The kmsKeyVersion to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyVersion_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains the encryption status for a backup and
+     * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+     * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyVersion() { + kmsKeyVersion_ = getDefaultInstance().getKmsKeyVersion(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains the encryption status for a backup and
+     * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+     * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for kmsKeyVersion to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyVersion_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private int backupKind_ = 0; + + /** + * + * + *
+     * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for backupKind. + */ + @java.lang.Override + public int getBackupKindValue() { + return backupKind_; + } + + /** + * + * + *
+     * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for backupKind to set. + * @return This builder for chaining. + */ + public Builder setBackupKindValue(int value) { + backupKind_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupKind. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupKind getBackupKind() { + com.google.cloud.sql.v1.SqlBackupKind result = + com.google.cloud.sql.v1.SqlBackupKind.forNumber(backupKind_); + return result == null ? com.google.cloud.sql.v1.SqlBackupKind.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The backupKind to set. + * @return This builder for chaining. + */ + public Builder setBackupKind(com.google.cloud.sql.v1.SqlBackupKind value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00001000; + backupKind_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearBackupKind() { + bitField0_ = (bitField0_ & ~0x00001000); + backupKind_ = 0; + onChanged(); + return this; + } + + private java.lang.Object timeZone_ = ""; + + /** + * + * + *
+     * Output only. This output contains a backup time zone. If a Cloud SQL for
+     * SQL Server instance has a different time zone from the backup's time zone,
+     * then the restore to the instance doesn't happen.
+     * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The timeZone. + */ + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. This output contains a backup time zone. If a Cloud SQL for
+     * SQL Server instance has a different time zone from the backup's time zone,
+     * then the restore to the instance doesn't happen.
+     * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for timeZone. + */ + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. This output contains a backup time zone. If a Cloud SQL for
+     * SQL Server instance has a different time zone from the backup's time zone,
+     * then the restore to the instance doesn't happen.
+     * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + timeZone_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains a backup time zone. If a Cloud SQL for
+     * SQL Server instance has a different time zone from the backup's time zone,
+     * then the restore to the instance doesn't happen.
+     * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTimeZone() { + timeZone_ = getDefaultInstance().getTimeZone(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains a backup time zone. If a Cloud SQL for
+     * SQL Server instance has a different time zone from the backup's time zone,
+     * then the restore to the instance doesn't happen.
+     * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + timeZone_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. The time-to-live (TTL) interval for this resource (in days).
+     * For example: ttlDays:7, means 7 days from the current time. The
+     * expiration time can't exceed 365 days from the time that the backup is
+     * created.
+     * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttlDays field is set. + */ + public boolean hasTtlDays() { + return expirationCase_ == 16; + } + + /** + * + * + *
+     * Input only. The time-to-live (TTL) interval for this resource (in days).
+     * For example: ttlDays:7, means 7 days from the current time. The
+     * expiration time can't exceed 365 days from the time that the backup is
+     * created.
+     * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttlDays. + */ + public long getTtlDays() { + if (expirationCase_ == 16) { + return (java.lang.Long) expiration_; + } + return 0L; + } + + /** + * + * + *
+     * Input only. The time-to-live (TTL) interval for this resource (in days).
+     * For example: ttlDays:7, means 7 days from the current time. The
+     * expiration time can't exceed 365 days from the time that the backup is
+     * created.
+     * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param value The ttlDays to set. + * @return This builder for chaining. + */ + public Builder setTtlDays(long value) { + + expirationCase_ = 16; + expiration_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. The time-to-live (TTL) interval for this resource (in days).
+     * For example: ttlDays:7, means 7 days from the current time. The
+     * expiration time can't exceed 365 days from the time that the backup is
+     * created.
+     * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTtlDays() { + if (expirationCase_ == 16) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expiryTimeBuilder_; + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this backup expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + * + * @return Whether the expiryTime field is set. + */ + @java.lang.Override + public boolean hasExpiryTime() { + return expirationCase_ == 17; + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this backup expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + * + * @return The expiryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpiryTime() { + if (expiryTimeBuilder_ == null) { + if (expirationCase_ == 17) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (expirationCase_ == 17) { + return expiryTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this backup expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + public Builder setExpiryTime(com.google.protobuf.Timestamp value) { + if (expiryTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + expiryTimeBuilder_.setMessage(value); + } + expirationCase_ = 17; + return this; + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this backup expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + public Builder setExpiryTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expiryTimeBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + expiryTimeBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 17; + return this; + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this backup expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + public Builder mergeExpiryTime(com.google.protobuf.Timestamp value) { + if (expiryTimeBuilder_ == null) { + if (expirationCase_ == 17 + && expiration_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 17) { + expiryTimeBuilder_.mergeFrom(value); + } else { + expiryTimeBuilder_.setMessage(value); + } + } + expirationCase_ = 17; + return this; + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this backup expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + public Builder clearExpiryTime() { + if (expiryTimeBuilder_ == null) { + if (expirationCase_ == 17) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 17) { + expirationCase_ = 0; + expiration_ = null; + } + expiryTimeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this backup expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + public com.google.protobuf.Timestamp.Builder getExpiryTimeBuilder() { + return internalGetExpiryTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this backup expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder() { + if ((expirationCase_ == 17) && (expiryTimeBuilder_ != null)) { + return expiryTimeBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 17) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this backup expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExpiryTimeFieldBuilder() { + if (expiryTimeBuilder_ == null) { + if (!(expirationCase_ == 17)) { + expiration_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + expiryTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 17; + onChanged(); + return expiryTimeBuilder_; + } + + private int databaseVersion_ = 0; + + /** + * + * + *
+     * Output only. The database version of the instance of at the time this
+     * backup was made.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+     * Output only. The database version of the instance of at the time this
+     * backup was made.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersionValue(int value) { + databaseVersion_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The database version of the instance of at the time this
+     * backup was made.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1.SqlDatabaseVersion result = + com.google.cloud.sql.v1.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The database version of the instance of at the time this
+     * backup was made.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersion(com.google.cloud.sql.v1.SqlDatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00010000; + databaseVersion_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The database version of the instance of at the time this
+     * backup was made.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDatabaseVersion() { + bitField0_ = (bitField0_ & ~0x00010000); + databaseVersion_ = 0; + onChanged(); + return this; + } + + private long maxChargeableBytes_; + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maxChargeableBytes field is set. + */ + @java.lang.Override + public boolean hasMaxChargeableBytes() { + return ((bitField0_ & 0x00020000) != 0); + } + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maxChargeableBytes. + */ + @java.lang.Override + public long getMaxChargeableBytes() { + return maxChargeableBytes_; + } + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The maxChargeableBytes to set. + * @return This builder for chaining. + */ + public Builder setMaxChargeableBytes(long value) { + + maxChargeableBytes_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearMaxChargeableBytes() { + bitField0_ = (bitField0_ & ~0x00020000); + maxChargeableBytes_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp instanceDeletionTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + instanceDeletionTimeBuilder_; + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceDeletionTime field is set. + */ + public boolean hasInstanceDeletionTime() { + return ((bitField0_ & 0x00040000) != 0); + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceDeletionTime. + */ + public com.google.protobuf.Timestamp getInstanceDeletionTime() { + if (instanceDeletionTimeBuilder_ == null) { + return instanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : instanceDeletionTime_; + } else { + return instanceDeletionTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setInstanceDeletionTime(com.google.protobuf.Timestamp value) { + if (instanceDeletionTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instanceDeletionTime_ = value; + } else { + instanceDeletionTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setInstanceDeletionTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (instanceDeletionTimeBuilder_ == null) { + instanceDeletionTime_ = builderForValue.build(); + } else { + instanceDeletionTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeInstanceDeletionTime(com.google.protobuf.Timestamp value) { + if (instanceDeletionTimeBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) + && instanceDeletionTime_ != null + && instanceDeletionTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getInstanceDeletionTimeBuilder().mergeFrom(value); + } else { + instanceDeletionTime_ = value; + } + } else { + instanceDeletionTimeBuilder_.mergeFrom(value); + } + if (instanceDeletionTime_ != null) { + bitField0_ |= 0x00040000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearInstanceDeletionTime() { + bitField0_ = (bitField0_ & ~0x00040000); + instanceDeletionTime_ = null; + if (instanceDeletionTimeBuilder_ != null) { + instanceDeletionTimeBuilder_.dispose(); + instanceDeletionTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getInstanceDeletionTimeBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return internalGetInstanceDeletionTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getInstanceDeletionTimeOrBuilder() { + if (instanceDeletionTimeBuilder_ != null) { + return instanceDeletionTimeBuilder_.getMessageOrBuilder(); + } else { + return instanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : instanceDeletionTime_; + } + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetInstanceDeletionTimeFieldBuilder() { + if (instanceDeletionTimeBuilder_ == null) { + instanceDeletionTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getInstanceDeletionTime(), getParentForChildren(), isClean()); + instanceDeletionTime_ = null; + } + return instanceDeletionTimeBuilder_; + } + + private com.google.cloud.sql.v1.DatabaseInstance instanceSettings_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder> + instanceSettingsBuilder_; + + /** + * + * + *
+     * Optional. Output only. The instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceSettings field is set. + */ + public boolean hasInstanceSettings() { + return ((bitField0_ & 0x00080000) != 0); + } + + /** + * + * + *
+     * Optional. Output only. The instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceSettings. + */ + public com.google.cloud.sql.v1.DatabaseInstance getInstanceSettings() { + if (instanceSettingsBuilder_ == null) { + return instanceSettings_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : instanceSettings_; + } else { + return instanceSettingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Output only. The instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setInstanceSettings(com.google.cloud.sql.v1.DatabaseInstance value) { + if (instanceSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instanceSettings_ = value; + } else { + instanceSettingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. The instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setInstanceSettings( + com.google.cloud.sql.v1.DatabaseInstance.Builder builderForValue) { + if (instanceSettingsBuilder_ == null) { + instanceSettings_ = builderForValue.build(); + } else { + instanceSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. The instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeInstanceSettings(com.google.cloud.sql.v1.DatabaseInstance value) { + if (instanceSettingsBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0) + && instanceSettings_ != null + && instanceSettings_ != com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance()) { + getInstanceSettingsBuilder().mergeFrom(value); + } else { + instanceSettings_ = value; + } + } else { + instanceSettingsBuilder_.mergeFrom(value); + } + if (instanceSettings_ != null) { + bitField0_ |= 0x00080000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Output only. The instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearInstanceSettings() { + bitField0_ = (bitField0_ & ~0x00080000); + instanceSettings_ = null; + if (instanceSettingsBuilder_ != null) { + instanceSettingsBuilder_.dispose(); + instanceSettingsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. The instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DatabaseInstance.Builder getInstanceSettingsBuilder() { + bitField0_ |= 0x00080000; + onChanged(); + return internalGetInstanceSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Output only. The instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getInstanceSettingsOrBuilder() { + if (instanceSettingsBuilder_ != null) { + return instanceSettingsBuilder_.getMessageOrBuilder(); + } else { + return instanceSettings_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : instanceSettings_; + } + } + + /** + * + * + *
+     * Optional. Output only. The instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder> + internalGetInstanceSettingsFieldBuilder() { + if (instanceSettingsBuilder_ == null) { + instanceSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder>( + getInstanceSettings(), getParentForChildren(), isClean()); + instanceSettings_ = null; + } + return instanceSettingsBuilder_; + } + + private java.lang.Object backupRun_ = ""; + + /** + * + * + *
+     * Output only. The mapping to backup run resource used for IAM validations.
+     * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupRun. + */ + public java.lang.String getBackupRun() { + java.lang.Object ref = backupRun_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupRun_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The mapping to backup run resource used for IAM validations.
+     * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupRun. + */ + public com.google.protobuf.ByteString getBackupRunBytes() { + java.lang.Object ref = backupRun_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupRun_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The mapping to backup run resource used for IAM validations.
+     * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The backupRun to set. + * @return This builder for chaining. + */ + public Builder setBackupRun(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupRun_ = value; + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The mapping to backup run resource used for IAM validations.
+     * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearBackupRun() { + backupRun_ = getDefaultInstance().getBackupRun(); + bitField0_ = (bitField0_ & ~0x00100000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The mapping to backup run resource used for IAM validations.
+     * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for backupRun to set. + * @return This builder for chaining. + */ + public Builder setBackupRunBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupRun_ = value; + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue satisfiesPzs_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + satisfiesPzsBuilder_; + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + public boolean hasSatisfiesPzs() { + return ((bitField0_ & 0x00200000) != 0); + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + public com.google.protobuf.BoolValue getSatisfiesPzs() { + if (satisfiesPzsBuilder_ == null) { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } else { + return satisfiesPzsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + satisfiesPzs_ = value; + } else { + satisfiesPzsBuilder_.setMessage(value); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue.Builder builderForValue) { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = builderForValue.build(); + } else { + satisfiesPzsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (((bitField0_ & 0x00200000) != 0) + && satisfiesPzs_ != null + && satisfiesPzs_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getSatisfiesPzsBuilder().mergeFrom(value); + } else { + satisfiesPzs_ = value; + } + } else { + satisfiesPzsBuilder_.mergeFrom(value); + } + if (satisfiesPzs_ != null) { + bitField0_ |= 0x00200000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSatisfiesPzs() { + bitField0_ = (bitField0_ & ~0x00200000); + satisfiesPzs_ = null; + if (satisfiesPzsBuilder_ != null) { + satisfiesPzsBuilder_.dispose(); + satisfiesPzsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValue.Builder getSatisfiesPzsBuilder() { + bitField0_ |= 0x00200000; + onChanged(); + return internalGetSatisfiesPzsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + if (satisfiesPzsBuilder_ != null) { + return satisfiesPzsBuilder_.getMessageOrBuilder(); + } else { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetSatisfiesPzsFieldBuilder() { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSatisfiesPzs(), getParentForChildren(), isClean()); + satisfiesPzs_ = null; + } + return satisfiesPzsBuilder_; + } + + private com.google.protobuf.BoolValue satisfiesPzi_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + satisfiesPziBuilder_; + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzi field is set. + */ + public boolean hasSatisfiesPzi() { + return ((bitField0_ & 0x00400000) != 0); + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzi. + */ + public com.google.protobuf.BoolValue getSatisfiesPzi() { + if (satisfiesPziBuilder_ == null) { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } else { + return satisfiesPziBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzi(com.google.protobuf.BoolValue value) { + if (satisfiesPziBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + satisfiesPzi_ = value; + } else { + satisfiesPziBuilder_.setMessage(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzi(com.google.protobuf.BoolValue.Builder builderForValue) { + if (satisfiesPziBuilder_ == null) { + satisfiesPzi_ = builderForValue.build(); + } else { + satisfiesPziBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSatisfiesPzi(com.google.protobuf.BoolValue value) { + if (satisfiesPziBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0) + && satisfiesPzi_ != null + && satisfiesPzi_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getSatisfiesPziBuilder().mergeFrom(value); + } else { + satisfiesPzi_ = value; + } + } else { + satisfiesPziBuilder_.mergeFrom(value); + } + if (satisfiesPzi_ != null) { + bitField0_ |= 0x00400000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSatisfiesPzi() { + bitField0_ = (bitField0_ & ~0x00400000); + satisfiesPzi_ = null; + if (satisfiesPziBuilder_ != null) { + satisfiesPziBuilder_.dispose(); + satisfiesPziBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValue.Builder getSatisfiesPziBuilder() { + bitField0_ |= 0x00400000; + onChanged(); + return internalGetSatisfiesPziFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPziOrBuilder() { + if (satisfiesPziBuilder_ != null) { + return satisfiesPziBuilder_.getMessageOrBuilder(); + } else { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetSatisfiesPziFieldBuilder() { + if (satisfiesPziBuilder_ == null) { + satisfiesPziBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSatisfiesPzi(), getParentForChildren(), isClean()); + satisfiesPzi_ = null; + } + return satisfiesPziBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.Backup) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.Backup) + private static final com.google.cloud.sql.v1.Backup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.Backup(); + } + + public static com.google.cloud.sql.v1.Backup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Backup parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Backup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupConfiguration.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupConfiguration.java new file mode 100644 index 000000000000..da1e5019cbef --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupConfiguration.java @@ -0,0 +1,3680 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance backup configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.BackupConfiguration} + */ +@com.google.protobuf.Generated +public final class BackupConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.BackupConfiguration) + BackupConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupConfiguration"); + } + + // Use BackupConfiguration.newBuilder() to construct. + private BackupConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackupConfiguration() { + startTime_ = ""; + kind_ = ""; + location_ = ""; + transactionalLogStorageState_ = 0; + backupTier_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.BackupConfiguration.class, + com.google.cloud.sql.v1.BackupConfiguration.Builder.class); + } + + /** + * + * + *
+   * This value contains the storage location of the transactional logs
+   * used to perform point-in-time recovery (PITR) for the database.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState} + */ + public enum TransactionalLogStorageState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED = 0; + */ + TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The transaction logs used for PITR for the instance are stored
+     * on a data disk.
+     * 
+ * + * DISK = 1; + */ + DISK(1), + /** + * + * + *
+     * The transaction logs used for PITR for the instance are switching from
+     * being stored on a data disk to being stored in Cloud Storage.
+     * Only applicable to MySQL.
+     * 
+ * + * SWITCHING_TO_CLOUD_STORAGE = 2; + */ + SWITCHING_TO_CLOUD_STORAGE(2), + /** + * + * + *
+     * The transaction logs used for PITR for the instance are now stored
+     * in Cloud Storage. Previously, they were stored on a data disk.
+     * Only applicable to MySQL.
+     * 
+ * + * SWITCHED_TO_CLOUD_STORAGE = 3; + */ + SWITCHED_TO_CLOUD_STORAGE(3), + /** + * + * + *
+     * The transaction logs used for PITR for the instance are stored in
+     * Cloud Storage. Only applicable to MySQL and PostgreSQL.
+     * 
+ * + * CLOUD_STORAGE = 4; + */ + CLOUD_STORAGE(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TransactionalLogStorageState"); + } + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED = 0; + */ + public static final int TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The transaction logs used for PITR for the instance are stored
+     * on a data disk.
+     * 
+ * + * DISK = 1; + */ + public static final int DISK_VALUE = 1; + + /** + * + * + *
+     * The transaction logs used for PITR for the instance are switching from
+     * being stored on a data disk to being stored in Cloud Storage.
+     * Only applicable to MySQL.
+     * 
+ * + * SWITCHING_TO_CLOUD_STORAGE = 2; + */ + public static final int SWITCHING_TO_CLOUD_STORAGE_VALUE = 2; + + /** + * + * + *
+     * The transaction logs used for PITR for the instance are now stored
+     * in Cloud Storage. Previously, they were stored on a data disk.
+     * Only applicable to MySQL.
+     * 
+ * + * SWITCHED_TO_CLOUD_STORAGE = 3; + */ + public static final int SWITCHED_TO_CLOUD_STORAGE_VALUE = 3; + + /** + * + * + *
+     * The transaction logs used for PITR for the instance are stored in
+     * Cloud Storage. Only applicable to MySQL and PostgreSQL.
+     * 
+ * + * CLOUD_STORAGE = 4; + */ + public static final int CLOUD_STORAGE_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 TransactionalLogStorageState 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 TransactionalLogStorageState forNumber(int value) { + switch (value) { + case 0: + return TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED; + case 1: + return DISK; + case 2: + return SWITCHING_TO_CLOUD_STORAGE; + case 3: + return SWITCHED_TO_CLOUD_STORAGE; + case 4: + return CLOUD_STORAGE; + 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 TransactionalLogStorageState findValueByNumber(int number) { + return TransactionalLogStorageState.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.BackupConfiguration.getDescriptor().getEnumTypes().get(0); + } + + private static final TransactionalLogStorageState[] VALUES = values(); + + public static TransactionalLogStorageState 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 TransactionalLogStorageState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState) + } + + /** + * + * + *
+   * Backup tier that manages the backups for the instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.BackupConfiguration.BackupTier} + */ + public enum BackupTier implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * BACKUP_TIER_UNSPECIFIED = 0; + */ + BACKUP_TIER_UNSPECIFIED(0), + /** + * + * + *
+     * Instance is managed by Cloud SQL.
+     * 
+ * + * STANDARD = 1; + */ + STANDARD(1), + /** + * + * + *
+     * Deprecated: ADVANCED is deprecated. Please use ENHANCED instead.
+     * 
+ * + * ADVANCED = 2 [deprecated = true]; + */ + @java.lang.Deprecated + ADVANCED(2), + /** + * + * + *
+     * Instance is managed by Google Cloud Backup and DR Service.
+     * 
+ * + * ENHANCED = 3; + */ + ENHANCED(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupTier"); + } + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * BACKUP_TIER_UNSPECIFIED = 0; + */ + public static final int BACKUP_TIER_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Instance is managed by Cloud SQL.
+     * 
+ * + * STANDARD = 1; + */ + public static final int STANDARD_VALUE = 1; + + /** + * + * + *
+     * Deprecated: ADVANCED is deprecated. Please use ENHANCED instead.
+     * 
+ * + * ADVANCED = 2 [deprecated = true]; + */ + @java.lang.Deprecated public static final int ADVANCED_VALUE = 2; + + /** + * + * + *
+     * Instance is managed by Google Cloud Backup and DR Service.
+     * 
+ * + * ENHANCED = 3; + */ + public static final int ENHANCED_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 BackupTier 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 BackupTier forNumber(int value) { + switch (value) { + case 0: + return BACKUP_TIER_UNSPECIFIED; + case 1: + return STANDARD; + case 2: + return ADVANCED; + case 3: + return ENHANCED; + 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 BackupTier findValueByNumber(int number) { + return BackupTier.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.BackupConfiguration.getDescriptor().getEnumTypes().get(1); + } + + private static final BackupTier[] VALUES = values(); + + public static BackupTier 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 BackupTier(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.BackupConfiguration.BackupTier) + } + + private int bitField0_; + public static final int START_TIME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object startTime_ = ""; + + /** + * + * + *
+   * Start time for the daily backup configuration in UTC timezone in the 24
+   * hour format - `HH:MM`.
+   * 
+ * + * string start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public java.lang.String getStartTime() { + java.lang.Object ref = startTime_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startTime_ = s; + return s; + } + } + + /** + * + * + *
+   * Start time for the daily backup configuration in UTC timezone in the 24
+   * hour format - `HH:MM`.
+   * 
+ * + * string start_time = 1; + * + * @return The bytes for startTime. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStartTimeBytes() { + java.lang.Object ref = startTime_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + startTime_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLED_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue enabled_; + + /** + * + * + *
+   * Whether this configuration is enabled.
+   * 
+ * + * .google.protobuf.BoolValue enabled = 2; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Whether this configuration is enabled.
+   * 
+ * + * .google.protobuf.BoolValue enabled = 2; + * + * @return The enabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnabled() { + return enabled_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enabled_; + } + + /** + * + * + *
+   * Whether this configuration is enabled.
+   * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getEnabledOrBuilder() { + return enabled_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enabled_; + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#backupConfiguration`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#backupConfiguration`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BINARY_LOG_ENABLED_FIELD_NUMBER = 4; + private com.google.protobuf.BoolValue binaryLogEnabled_; + + /** + * + * + *
+   * (MySQL only) Whether binary log is enabled. If backup configuration is
+   * disabled, binarylog must be disabled as well.
+   * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + * + * @return Whether the binaryLogEnabled field is set. + */ + @java.lang.Override + public boolean hasBinaryLogEnabled() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * (MySQL only) Whether binary log is enabled. If backup configuration is
+   * disabled, binarylog must be disabled as well.
+   * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + * + * @return The binaryLogEnabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getBinaryLogEnabled() { + return binaryLogEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : binaryLogEnabled_; + } + + /** + * + * + *
+   * (MySQL only) Whether binary log is enabled. If backup configuration is
+   * disabled, binarylog must be disabled as well.
+   * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getBinaryLogEnabledOrBuilder() { + return binaryLogEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : binaryLogEnabled_; + } + + public static final int REPLICATION_LOG_ARCHIVING_ENABLED_FIELD_NUMBER = 5; + private com.google.protobuf.BoolValue replicationLogArchivingEnabled_; + + /** + * + * + *
+   * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+   * will be removed from a future version of the API. Use
+   * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+   * instead.
+   * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @deprecated google.cloud.sql.v1.BackupConfiguration.replication_log_archiving_enabled is + * deprecated. See google/cloud/sql/v1/cloud_sql_resources.proto;l=169 + * @return Whether the replicationLogArchivingEnabled field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasReplicationLogArchivingEnabled() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+   * will be removed from a future version of the API. Use
+   * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+   * instead.
+   * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @deprecated google.cloud.sql.v1.BackupConfiguration.replication_log_archiving_enabled is + * deprecated. See google/cloud/sql/v1/cloud_sql_resources.proto;l=169 + * @return The replicationLogArchivingEnabled. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.BoolValue getReplicationLogArchivingEnabled() { + return replicationLogArchivingEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : replicationLogArchivingEnabled_; + } + + /** + * + * + *
+   * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+   * will be removed from a future version of the API. Use
+   * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+   * instead.
+   * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.BoolValueOrBuilder getReplicationLogArchivingEnabledOrBuilder() { + return replicationLogArchivingEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : replicationLogArchivingEnabled_; + } + + public static final int LOCATION_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + + /** + * + * + *
+   * Location of the backup
+   * 
+ * + * string location = 6; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + + /** + * + * + *
+   * Location of the backup
+   * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POINT_IN_TIME_RECOVERY_ENABLED_FIELD_NUMBER = 7; + private com.google.protobuf.BoolValue pointInTimeRecoveryEnabled_; + + /** + * + * + *
+   * Whether point in time recovery is enabled.
+   * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + * + * @return Whether the pointInTimeRecoveryEnabled field is set. + */ + @java.lang.Override + public boolean hasPointInTimeRecoveryEnabled() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Whether point in time recovery is enabled.
+   * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + * + * @return The pointInTimeRecoveryEnabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getPointInTimeRecoveryEnabled() { + return pointInTimeRecoveryEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : pointInTimeRecoveryEnabled_; + } + + /** + * + * + *
+   * Whether point in time recovery is enabled.
+   * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getPointInTimeRecoveryEnabledOrBuilder() { + return pointInTimeRecoveryEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : pointInTimeRecoveryEnabled_; + } + + public static final int BACKUP_RETENTION_SETTINGS_FIELD_NUMBER = 8; + private com.google.cloud.sql.v1.BackupRetentionSettings backupRetentionSettings_; + + /** + * + * + *
+   * Backup retention settings.
+   * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + * + * @return Whether the backupRetentionSettings field is set. + */ + @java.lang.Override + public boolean hasBackupRetentionSettings() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Backup retention settings.
+   * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + * + * @return The backupRetentionSettings. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupRetentionSettings getBackupRetentionSettings() { + return backupRetentionSettings_ == null + ? com.google.cloud.sql.v1.BackupRetentionSettings.getDefaultInstance() + : backupRetentionSettings_; + } + + /** + * + * + *
+   * Backup retention settings.
+   * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupRetentionSettingsOrBuilder + getBackupRetentionSettingsOrBuilder() { + return backupRetentionSettings_ == null + ? com.google.cloud.sql.v1.BackupRetentionSettings.getDefaultInstance() + : backupRetentionSettings_; + } + + public static final int TRANSACTION_LOG_RETENTION_DAYS_FIELD_NUMBER = 9; + private com.google.protobuf.Int32Value transactionLogRetentionDays_; + + /** + * + * + *
+   * The number of days of transaction logs we retain for point in time
+   * restore, from 1-7.
+   * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + * + * @return Whether the transactionLogRetentionDays field is set. + */ + @java.lang.Override + public boolean hasTransactionLogRetentionDays() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * The number of days of transaction logs we retain for point in time
+   * restore, from 1-7.
+   * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + * + * @return The transactionLogRetentionDays. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getTransactionLogRetentionDays() { + return transactionLogRetentionDays_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : transactionLogRetentionDays_; + } + + /** + * + * + *
+   * The number of days of transaction logs we retain for point in time
+   * restore, from 1-7.
+   * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getTransactionLogRetentionDaysOrBuilder() { + return transactionLogRetentionDays_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : transactionLogRetentionDays_; + } + + public static final int TRANSACTIONAL_LOG_STORAGE_STATE_FIELD_NUMBER = 10; + private int transactionalLogStorageState_ = 0; + + /** + * + * + *
+   * Output only. This value contains the storage location of transactional logs
+   * used to perform point-in-time recovery (PITR) for the database.
+   * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the transactionalLogStorageState field is set. + */ + @java.lang.Override + public boolean hasTransactionalLogStorageState() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Output only. This value contains the storage location of transactional logs
+   * used to perform point-in-time recovery (PITR) for the database.
+   * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for transactionalLogStorageState. + */ + @java.lang.Override + public int getTransactionalLogStorageStateValue() { + return transactionalLogStorageState_; + } + + /** + * + * + *
+   * Output only. This value contains the storage location of transactional logs
+   * used to perform point-in-time recovery (PITR) for the database.
+   * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The transactionalLogStorageState. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState + getTransactionalLogStorageState() { + com.google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState result = + com.google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState.forNumber( + transactionalLogStorageState_); + return result == null + ? com.google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState.UNRECOGNIZED + : result; + } + + public static final int BACKUP_TIER_FIELD_NUMBER = 11; + private int backupTier_ = 0; + + /** + * + * + *
+   * Output only. Backup tier that manages the backups for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.BackupTier backup_tier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupTier field is set. + */ + @java.lang.Override + public boolean hasBackupTier() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * Output only. Backup tier that manages the backups for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.BackupTier backup_tier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for backupTier. + */ + @java.lang.Override + public int getBackupTierValue() { + return backupTier_; + } + + /** + * + * + *
+   * Output only. Backup tier that manages the backups for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.BackupTier backup_tier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupTier. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupConfiguration.BackupTier getBackupTier() { + com.google.cloud.sql.v1.BackupConfiguration.BackupTier result = + com.google.cloud.sql.v1.BackupConfiguration.BackupTier.forNumber(backupTier_); + return result == null + ? com.google.cloud.sql.v1.BackupConfiguration.BackupTier.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.GeneratedMessage.isStringEmpty(startTime_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, startTime_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getEnabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getBinaryLogEnabled()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getReplicationLogArchivingEnabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, location_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(7, getPointInTimeRecoveryEnabled()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(8, getBackupRetentionSettings()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(9, getTransactionLogRetentionDays()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeEnum(10, transactionalLogStorageState_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeEnum(11, backupTier_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(startTime_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, startTime_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEnabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getBinaryLogEnabled()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, getReplicationLogArchivingEnabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, location_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, getPointInTimeRecoveryEnabled()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(8, getBackupRetentionSettings()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, getTransactionLogRetentionDays()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize(10, transactionalLogStorageState_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, backupTier_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.BackupConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.BackupConfiguration other = + (com.google.cloud.sql.v1.BackupConfiguration) obj; + + if (!getStartTime().equals(other.getStartTime())) return false; + if (hasEnabled() != other.hasEnabled()) return false; + if (hasEnabled()) { + if (!getEnabled().equals(other.getEnabled())) return false; + } + if (!getKind().equals(other.getKind())) return false; + if (hasBinaryLogEnabled() != other.hasBinaryLogEnabled()) return false; + if (hasBinaryLogEnabled()) { + if (!getBinaryLogEnabled().equals(other.getBinaryLogEnabled())) return false; + } + if (hasReplicationLogArchivingEnabled() != other.hasReplicationLogArchivingEnabled()) + return false; + if (hasReplicationLogArchivingEnabled()) { + if (!getReplicationLogArchivingEnabled().equals(other.getReplicationLogArchivingEnabled())) + return false; + } + if (!getLocation().equals(other.getLocation())) return false; + if (hasPointInTimeRecoveryEnabled() != other.hasPointInTimeRecoveryEnabled()) return false; + if (hasPointInTimeRecoveryEnabled()) { + if (!getPointInTimeRecoveryEnabled().equals(other.getPointInTimeRecoveryEnabled())) + return false; + } + if (hasBackupRetentionSettings() != other.hasBackupRetentionSettings()) return false; + if (hasBackupRetentionSettings()) { + if (!getBackupRetentionSettings().equals(other.getBackupRetentionSettings())) return false; + } + if (hasTransactionLogRetentionDays() != other.hasTransactionLogRetentionDays()) return false; + if (hasTransactionLogRetentionDays()) { + if (!getTransactionLogRetentionDays().equals(other.getTransactionLogRetentionDays())) + return false; + } + if (hasTransactionalLogStorageState() != other.hasTransactionalLogStorageState()) return false; + if (hasTransactionalLogStorageState()) { + if (transactionalLogStorageState_ != other.transactionalLogStorageState_) return false; + } + if (hasBackupTier() != other.hasBackupTier()) return false; + if (hasBackupTier()) { + if (backupTier_ != other.backupTier_) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + if (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getEnabled().hashCode(); + } + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasBinaryLogEnabled()) { + hash = (37 * hash) + BINARY_LOG_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getBinaryLogEnabled().hashCode(); + } + if (hasReplicationLogArchivingEnabled()) { + hash = (37 * hash) + REPLICATION_LOG_ARCHIVING_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getReplicationLogArchivingEnabled().hashCode(); + } + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + if (hasPointInTimeRecoveryEnabled()) { + hash = (37 * hash) + POINT_IN_TIME_RECOVERY_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getPointInTimeRecoveryEnabled().hashCode(); + } + if (hasBackupRetentionSettings()) { + hash = (37 * hash) + BACKUP_RETENTION_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getBackupRetentionSettings().hashCode(); + } + if (hasTransactionLogRetentionDays()) { + hash = (37 * hash) + TRANSACTION_LOG_RETENTION_DAYS_FIELD_NUMBER; + hash = (53 * hash) + getTransactionLogRetentionDays().hashCode(); + } + if (hasTransactionalLogStorageState()) { + hash = (37 * hash) + TRANSACTIONAL_LOG_STORAGE_STATE_FIELD_NUMBER; + hash = (53 * hash) + transactionalLogStorageState_; + } + if (hasBackupTier()) { + hash = (37 * hash) + BACKUP_TIER_FIELD_NUMBER; + hash = (53 * hash) + backupTier_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.BackupConfiguration parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.BackupConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance backup configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.BackupConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.BackupConfiguration) + com.google.cloud.sql.v1.BackupConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.BackupConfiguration.class, + com.google.cloud.sql.v1.BackupConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.BackupConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEnabledFieldBuilder(); + internalGetBinaryLogEnabledFieldBuilder(); + internalGetReplicationLogArchivingEnabledFieldBuilder(); + internalGetPointInTimeRecoveryEnabledFieldBuilder(); + internalGetBackupRetentionSettingsFieldBuilder(); + internalGetTransactionLogRetentionDaysFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startTime_ = ""; + enabled_ = null; + if (enabledBuilder_ != null) { + enabledBuilder_.dispose(); + enabledBuilder_ = null; + } + kind_ = ""; + binaryLogEnabled_ = null; + if (binaryLogEnabledBuilder_ != null) { + binaryLogEnabledBuilder_.dispose(); + binaryLogEnabledBuilder_ = null; + } + replicationLogArchivingEnabled_ = null; + if (replicationLogArchivingEnabledBuilder_ != null) { + replicationLogArchivingEnabledBuilder_.dispose(); + replicationLogArchivingEnabledBuilder_ = null; + } + location_ = ""; + pointInTimeRecoveryEnabled_ = null; + if (pointInTimeRecoveryEnabledBuilder_ != null) { + pointInTimeRecoveryEnabledBuilder_.dispose(); + pointInTimeRecoveryEnabledBuilder_ = null; + } + backupRetentionSettings_ = null; + if (backupRetentionSettingsBuilder_ != null) { + backupRetentionSettingsBuilder_.dispose(); + backupRetentionSettingsBuilder_ = null; + } + transactionLogRetentionDays_ = null; + if (transactionLogRetentionDaysBuilder_ != null) { + transactionLogRetentionDaysBuilder_.dispose(); + transactionLogRetentionDaysBuilder_ = null; + } + transactionalLogStorageState_ = 0; + backupTier_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupConfiguration getDefaultInstanceForType() { + return com.google.cloud.sql.v1.BackupConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupConfiguration build() { + com.google.cloud.sql.v1.BackupConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupConfiguration buildPartial() { + com.google.cloud.sql.v1.BackupConfiguration result = + new com.google.cloud.sql.v1.BackupConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.BackupConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startTime_ = startTime_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.enabled_ = enabledBuilder_ == null ? enabled_ : enabledBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.binaryLogEnabled_ = + binaryLogEnabledBuilder_ == null ? binaryLogEnabled_ : binaryLogEnabledBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.replicationLogArchivingEnabled_ = + replicationLogArchivingEnabledBuilder_ == null + ? replicationLogArchivingEnabled_ + : replicationLogArchivingEnabledBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pointInTimeRecoveryEnabled_ = + pointInTimeRecoveryEnabledBuilder_ == null + ? pointInTimeRecoveryEnabled_ + : pointInTimeRecoveryEnabledBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.backupRetentionSettings_ = + backupRetentionSettingsBuilder_ == null + ? backupRetentionSettings_ + : backupRetentionSettingsBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.transactionLogRetentionDays_ = + transactionLogRetentionDaysBuilder_ == null + ? transactionLogRetentionDays_ + : transactionLogRetentionDaysBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.transactionalLogStorageState_ = transactionalLogStorageState_; + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.backupTier_ = backupTier_; + to_bitField0_ |= 0x00000080; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.BackupConfiguration) { + return mergeFrom((com.google.cloud.sql.v1.BackupConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.BackupConfiguration other) { + if (other == com.google.cloud.sql.v1.BackupConfiguration.getDefaultInstance()) return this; + if (!other.getStartTime().isEmpty()) { + startTime_ = other.startTime_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasEnabled()) { + mergeEnabled(other.getEnabled()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasBinaryLogEnabled()) { + mergeBinaryLogEnabled(other.getBinaryLogEnabled()); + } + if (other.hasReplicationLogArchivingEnabled()) { + mergeReplicationLogArchivingEnabled(other.getReplicationLogArchivingEnabled()); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasPointInTimeRecoveryEnabled()) { + mergePointInTimeRecoveryEnabled(other.getPointInTimeRecoveryEnabled()); + } + if (other.hasBackupRetentionSettings()) { + mergeBackupRetentionSettings(other.getBackupRetentionSettings()); + } + if (other.hasTransactionLogRetentionDays()) { + mergeTransactionLogRetentionDays(other.getTransactionLogRetentionDays()); + } + if (other.hasTransactionalLogStorageState()) { + setTransactionalLogStorageStateValue(other.getTransactionalLogStorageStateValue()); + } + if (other.hasBackupTier()) { + setBackupTierValue(other.getBackupTierValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + startTime_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetEnabledFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetBinaryLogEnabledFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetReplicationLogArchivingEnabledFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetPointInTimeRecoveryEnabledFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage( + internalGetBackupRetentionSettingsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + input.readMessage( + internalGetTransactionLogRetentionDaysFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 80: + { + transactionalLogStorageState_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: + { + backupTier_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 88 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object startTime_ = ""; + + /** + * + * + *
+     * Start time for the daily backup configuration in UTC timezone in the 24
+     * hour format - `HH:MM`.
+     * 
+ * + * string start_time = 1; + * + * @return The startTime. + */ + public java.lang.String getStartTime() { + java.lang.Object ref = startTime_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startTime_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Start time for the daily backup configuration in UTC timezone in the 24
+     * hour format - `HH:MM`.
+     * 
+ * + * string start_time = 1; + * + * @return The bytes for startTime. + */ + public com.google.protobuf.ByteString getStartTimeBytes() { + java.lang.Object ref = startTime_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + startTime_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Start time for the daily backup configuration in UTC timezone in the 24
+     * hour format - `HH:MM`.
+     * 
+ * + * string start_time = 1; + * + * @param value The startTime to set. + * @return This builder for chaining. + */ + public Builder setStartTime(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Start time for the daily backup configuration in UTC timezone in the 24
+     * hour format - `HH:MM`.
+     * 
+ * + * string start_time = 1; + * + * @return This builder for chaining. + */ + public Builder clearStartTime() { + startTime_ = getDefaultInstance().getStartTime(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Start time for the daily backup configuration in UTC timezone in the 24
+     * hour format - `HH:MM`.
+     * 
+ * + * string start_time = 1; + * + * @param value The bytes for startTime to set. + * @return This builder for chaining. + */ + public Builder setStartTimeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + startTime_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue enabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + enabledBuilder_; + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + * + * @return Whether the enabled field is set. + */ + public boolean hasEnabled() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + * + * @return The enabled. + */ + public com.google.protobuf.BoolValue getEnabled() { + if (enabledBuilder_ == null) { + return enabled_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enabled_; + } else { + return enabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + public Builder setEnabled(com.google.protobuf.BoolValue value) { + if (enabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enabled_ = value; + } else { + enabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + public Builder setEnabled(com.google.protobuf.BoolValue.Builder builderForValue) { + if (enabledBuilder_ == null) { + enabled_ = builderForValue.build(); + } else { + enabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + public Builder mergeEnabled(com.google.protobuf.BoolValue value) { + if (enabledBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && enabled_ != null + && enabled_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getEnabledBuilder().mergeFrom(value); + } else { + enabled_ = value; + } + } else { + enabledBuilder_.mergeFrom(value); + } + if (enabled_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000002); + enabled_ = null; + if (enabledBuilder_ != null) { + enabledBuilder_.dispose(); + enabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + public com.google.protobuf.BoolValue.Builder getEnabledBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + public com.google.protobuf.BoolValueOrBuilder getEnabledOrBuilder() { + if (enabledBuilder_ != null) { + return enabledBuilder_.getMessageOrBuilder(); + } else { + return enabled_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enabled_; + } + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetEnabledFieldBuilder() { + if (enabledBuilder_ == null) { + enabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getEnabled(), getParentForChildren(), isClean()); + enabled_ = null; + } + return enabledBuilder_; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#backupConfiguration`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupConfiguration`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupConfiguration`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupConfiguration`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupConfiguration`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue binaryLogEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + binaryLogEnabledBuilder_; + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + * + * @return Whether the binaryLogEnabled field is set. + */ + public boolean hasBinaryLogEnabled() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + * + * @return The binaryLogEnabled. + */ + public com.google.protobuf.BoolValue getBinaryLogEnabled() { + if (binaryLogEnabledBuilder_ == null) { + return binaryLogEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : binaryLogEnabled_; + } else { + return binaryLogEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + public Builder setBinaryLogEnabled(com.google.protobuf.BoolValue value) { + if (binaryLogEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + binaryLogEnabled_ = value; + } else { + binaryLogEnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + public Builder setBinaryLogEnabled(com.google.protobuf.BoolValue.Builder builderForValue) { + if (binaryLogEnabledBuilder_ == null) { + binaryLogEnabled_ = builderForValue.build(); + } else { + binaryLogEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + public Builder mergeBinaryLogEnabled(com.google.protobuf.BoolValue value) { + if (binaryLogEnabledBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && binaryLogEnabled_ != null + && binaryLogEnabled_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getBinaryLogEnabledBuilder().mergeFrom(value); + } else { + binaryLogEnabled_ = value; + } + } else { + binaryLogEnabledBuilder_.mergeFrom(value); + } + if (binaryLogEnabled_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + public Builder clearBinaryLogEnabled() { + bitField0_ = (bitField0_ & ~0x00000008); + binaryLogEnabled_ = null; + if (binaryLogEnabledBuilder_ != null) { + binaryLogEnabledBuilder_.dispose(); + binaryLogEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + public com.google.protobuf.BoolValue.Builder getBinaryLogEnabledBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetBinaryLogEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + public com.google.protobuf.BoolValueOrBuilder getBinaryLogEnabledOrBuilder() { + if (binaryLogEnabledBuilder_ != null) { + return binaryLogEnabledBuilder_.getMessageOrBuilder(); + } else { + return binaryLogEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : binaryLogEnabled_; + } + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetBinaryLogEnabledFieldBuilder() { + if (binaryLogEnabledBuilder_ == null) { + binaryLogEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getBinaryLogEnabled(), getParentForChildren(), isClean()); + binaryLogEnabled_ = null; + } + return binaryLogEnabledBuilder_; + } + + private com.google.protobuf.BoolValue replicationLogArchivingEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + replicationLogArchivingEnabledBuilder_; + + /** + * + * + *
+     * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+     * will be removed from a future version of the API. Use
+     * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+     * instead.
+     * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @deprecated google.cloud.sql.v1.BackupConfiguration.replication_log_archiving_enabled is + * deprecated. See google/cloud/sql/v1/cloud_sql_resources.proto;l=169 + * @return Whether the replicationLogArchivingEnabled field is set. + */ + @java.lang.Deprecated + public boolean hasReplicationLogArchivingEnabled() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+     * will be removed from a future version of the API. Use
+     * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+     * instead.
+     * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @deprecated google.cloud.sql.v1.BackupConfiguration.replication_log_archiving_enabled is + * deprecated. See google/cloud/sql/v1/cloud_sql_resources.proto;l=169 + * @return The replicationLogArchivingEnabled. + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValue getReplicationLogArchivingEnabled() { + if (replicationLogArchivingEnabledBuilder_ == null) { + return replicationLogArchivingEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : replicationLogArchivingEnabled_; + } else { + return replicationLogArchivingEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+     * will be removed from a future version of the API. Use
+     * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+     * instead.
+     * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Deprecated + public Builder setReplicationLogArchivingEnabled(com.google.protobuf.BoolValue value) { + if (replicationLogArchivingEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replicationLogArchivingEnabled_ = value; + } else { + replicationLogArchivingEnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+     * will be removed from a future version of the API. Use
+     * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+     * instead.
+     * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Deprecated + public Builder setReplicationLogArchivingEnabled( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (replicationLogArchivingEnabledBuilder_ == null) { + replicationLogArchivingEnabled_ = builderForValue.build(); + } else { + replicationLogArchivingEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+     * will be removed from a future version of the API. Use
+     * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+     * instead.
+     * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Deprecated + public Builder mergeReplicationLogArchivingEnabled(com.google.protobuf.BoolValue value) { + if (replicationLogArchivingEnabledBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && replicationLogArchivingEnabled_ != null + && replicationLogArchivingEnabled_ + != com.google.protobuf.BoolValue.getDefaultInstance()) { + getReplicationLogArchivingEnabledBuilder().mergeFrom(value); + } else { + replicationLogArchivingEnabled_ = value; + } + } else { + replicationLogArchivingEnabledBuilder_.mergeFrom(value); + } + if (replicationLogArchivingEnabled_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+     * will be removed from a future version of the API. Use
+     * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+     * instead.
+     * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Deprecated + public Builder clearReplicationLogArchivingEnabled() { + bitField0_ = (bitField0_ & ~0x00000010); + replicationLogArchivingEnabled_ = null; + if (replicationLogArchivingEnabledBuilder_ != null) { + replicationLogArchivingEnabledBuilder_.dispose(); + replicationLogArchivingEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+     * will be removed from a future version of the API. Use
+     * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+     * instead.
+     * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValue.Builder getReplicationLogArchivingEnabledBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetReplicationLogArchivingEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+     * will be removed from a future version of the API. Use
+     * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+     * instead.
+     * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValueOrBuilder getReplicationLogArchivingEnabledOrBuilder() { + if (replicationLogArchivingEnabledBuilder_ != null) { + return replicationLogArchivingEnabledBuilder_.getMessageOrBuilder(); + } else { + return replicationLogArchivingEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : replicationLogArchivingEnabled_; + } + } + + /** + * + * + *
+     * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+     * will be removed from a future version of the API. Use
+     * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+     * instead.
+     * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetReplicationLogArchivingEnabledFieldBuilder() { + if (replicationLogArchivingEnabledBuilder_ == null) { + replicationLogArchivingEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getReplicationLogArchivingEnabled(), getParentForChildren(), isClean()); + replicationLogArchivingEnabled_ = null; + } + return replicationLogArchivingEnabledBuilder_; + } + + private java.lang.Object location_ = ""; + + /** + * + * + *
+     * Location of the backup
+     * 
+ * + * string location = 6; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Location of the backup
+     * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Location of the backup
+     * 
+ * + * string location = 6; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Location of the backup
+     * 
+ * + * string location = 6; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Location of the backup
+     * 
+ * + * string location = 6; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue pointInTimeRecoveryEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + pointInTimeRecoveryEnabledBuilder_; + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + * + * @return Whether the pointInTimeRecoveryEnabled field is set. + */ + public boolean hasPointInTimeRecoveryEnabled() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + * + * @return The pointInTimeRecoveryEnabled. + */ + public com.google.protobuf.BoolValue getPointInTimeRecoveryEnabled() { + if (pointInTimeRecoveryEnabledBuilder_ == null) { + return pointInTimeRecoveryEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : pointInTimeRecoveryEnabled_; + } else { + return pointInTimeRecoveryEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + public Builder setPointInTimeRecoveryEnabled(com.google.protobuf.BoolValue value) { + if (pointInTimeRecoveryEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pointInTimeRecoveryEnabled_ = value; + } else { + pointInTimeRecoveryEnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + public Builder setPointInTimeRecoveryEnabled( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (pointInTimeRecoveryEnabledBuilder_ == null) { + pointInTimeRecoveryEnabled_ = builderForValue.build(); + } else { + pointInTimeRecoveryEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + public Builder mergePointInTimeRecoveryEnabled(com.google.protobuf.BoolValue value) { + if (pointInTimeRecoveryEnabledBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && pointInTimeRecoveryEnabled_ != null + && pointInTimeRecoveryEnabled_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getPointInTimeRecoveryEnabledBuilder().mergeFrom(value); + } else { + pointInTimeRecoveryEnabled_ = value; + } + } else { + pointInTimeRecoveryEnabledBuilder_.mergeFrom(value); + } + if (pointInTimeRecoveryEnabled_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + public Builder clearPointInTimeRecoveryEnabled() { + bitField0_ = (bitField0_ & ~0x00000040); + pointInTimeRecoveryEnabled_ = null; + if (pointInTimeRecoveryEnabledBuilder_ != null) { + pointInTimeRecoveryEnabledBuilder_.dispose(); + pointInTimeRecoveryEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + public com.google.protobuf.BoolValue.Builder getPointInTimeRecoveryEnabledBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetPointInTimeRecoveryEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + public com.google.protobuf.BoolValueOrBuilder getPointInTimeRecoveryEnabledOrBuilder() { + if (pointInTimeRecoveryEnabledBuilder_ != null) { + return pointInTimeRecoveryEnabledBuilder_.getMessageOrBuilder(); + } else { + return pointInTimeRecoveryEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : pointInTimeRecoveryEnabled_; + } + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetPointInTimeRecoveryEnabledFieldBuilder() { + if (pointInTimeRecoveryEnabledBuilder_ == null) { + pointInTimeRecoveryEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getPointInTimeRecoveryEnabled(), getParentForChildren(), isClean()); + pointInTimeRecoveryEnabled_ = null; + } + return pointInTimeRecoveryEnabledBuilder_; + } + + private com.google.cloud.sql.v1.BackupRetentionSettings backupRetentionSettings_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupRetentionSettings, + com.google.cloud.sql.v1.BackupRetentionSettings.Builder, + com.google.cloud.sql.v1.BackupRetentionSettingsOrBuilder> + backupRetentionSettingsBuilder_; + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + * + * @return Whether the backupRetentionSettings field is set. + */ + public boolean hasBackupRetentionSettings() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + * + * @return The backupRetentionSettings. + */ + public com.google.cloud.sql.v1.BackupRetentionSettings getBackupRetentionSettings() { + if (backupRetentionSettingsBuilder_ == null) { + return backupRetentionSettings_ == null + ? com.google.cloud.sql.v1.BackupRetentionSettings.getDefaultInstance() + : backupRetentionSettings_; + } else { + return backupRetentionSettingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + */ + public Builder setBackupRetentionSettings( + com.google.cloud.sql.v1.BackupRetentionSettings value) { + if (backupRetentionSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupRetentionSettings_ = value; + } else { + backupRetentionSettingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + */ + public Builder setBackupRetentionSettings( + com.google.cloud.sql.v1.BackupRetentionSettings.Builder builderForValue) { + if (backupRetentionSettingsBuilder_ == null) { + backupRetentionSettings_ = builderForValue.build(); + } else { + backupRetentionSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + */ + public Builder mergeBackupRetentionSettings( + com.google.cloud.sql.v1.BackupRetentionSettings value) { + if (backupRetentionSettingsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && backupRetentionSettings_ != null + && backupRetentionSettings_ + != com.google.cloud.sql.v1.BackupRetentionSettings.getDefaultInstance()) { + getBackupRetentionSettingsBuilder().mergeFrom(value); + } else { + backupRetentionSettings_ = value; + } + } else { + backupRetentionSettingsBuilder_.mergeFrom(value); + } + if (backupRetentionSettings_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + */ + public Builder clearBackupRetentionSettings() { + bitField0_ = (bitField0_ & ~0x00000080); + backupRetentionSettings_ = null; + if (backupRetentionSettingsBuilder_ != null) { + backupRetentionSettingsBuilder_.dispose(); + backupRetentionSettingsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + */ + public com.google.cloud.sql.v1.BackupRetentionSettings.Builder + getBackupRetentionSettingsBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetBackupRetentionSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + */ + public com.google.cloud.sql.v1.BackupRetentionSettingsOrBuilder + getBackupRetentionSettingsOrBuilder() { + if (backupRetentionSettingsBuilder_ != null) { + return backupRetentionSettingsBuilder_.getMessageOrBuilder(); + } else { + return backupRetentionSettings_ == null + ? com.google.cloud.sql.v1.BackupRetentionSettings.getDefaultInstance() + : backupRetentionSettings_; + } + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupRetentionSettings, + com.google.cloud.sql.v1.BackupRetentionSettings.Builder, + com.google.cloud.sql.v1.BackupRetentionSettingsOrBuilder> + internalGetBackupRetentionSettingsFieldBuilder() { + if (backupRetentionSettingsBuilder_ == null) { + backupRetentionSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupRetentionSettings, + com.google.cloud.sql.v1.BackupRetentionSettings.Builder, + com.google.cloud.sql.v1.BackupRetentionSettingsOrBuilder>( + getBackupRetentionSettings(), getParentForChildren(), isClean()); + backupRetentionSettings_ = null; + } + return backupRetentionSettingsBuilder_; + } + + private com.google.protobuf.Int32Value transactionLogRetentionDays_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + transactionLogRetentionDaysBuilder_; + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + * + * @return Whether the transactionLogRetentionDays field is set. + */ + public boolean hasTransactionLogRetentionDays() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + * + * @return The transactionLogRetentionDays. + */ + public com.google.protobuf.Int32Value getTransactionLogRetentionDays() { + if (transactionLogRetentionDaysBuilder_ == null) { + return transactionLogRetentionDays_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : transactionLogRetentionDays_; + } else { + return transactionLogRetentionDaysBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + public Builder setTransactionLogRetentionDays(com.google.protobuf.Int32Value value) { + if (transactionLogRetentionDaysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transactionLogRetentionDays_ = value; + } else { + transactionLogRetentionDaysBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + public Builder setTransactionLogRetentionDays( + com.google.protobuf.Int32Value.Builder builderForValue) { + if (transactionLogRetentionDaysBuilder_ == null) { + transactionLogRetentionDays_ = builderForValue.build(); + } else { + transactionLogRetentionDaysBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + public Builder mergeTransactionLogRetentionDays(com.google.protobuf.Int32Value value) { + if (transactionLogRetentionDaysBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && transactionLogRetentionDays_ != null + && transactionLogRetentionDays_ + != com.google.protobuf.Int32Value.getDefaultInstance()) { + getTransactionLogRetentionDaysBuilder().mergeFrom(value); + } else { + transactionLogRetentionDays_ = value; + } + } else { + transactionLogRetentionDaysBuilder_.mergeFrom(value); + } + if (transactionLogRetentionDays_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + public Builder clearTransactionLogRetentionDays() { + bitField0_ = (bitField0_ & ~0x00000100); + transactionLogRetentionDays_ = null; + if (transactionLogRetentionDaysBuilder_ != null) { + transactionLogRetentionDaysBuilder_.dispose(); + transactionLogRetentionDaysBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + public com.google.protobuf.Int32Value.Builder getTransactionLogRetentionDaysBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetTransactionLogRetentionDaysFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + public com.google.protobuf.Int32ValueOrBuilder getTransactionLogRetentionDaysOrBuilder() { + if (transactionLogRetentionDaysBuilder_ != null) { + return transactionLogRetentionDaysBuilder_.getMessageOrBuilder(); + } else { + return transactionLogRetentionDays_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : transactionLogRetentionDays_; + } + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetTransactionLogRetentionDaysFieldBuilder() { + if (transactionLogRetentionDaysBuilder_ == null) { + transactionLogRetentionDaysBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getTransactionLogRetentionDays(), getParentForChildren(), isClean()); + transactionLogRetentionDays_ = null; + } + return transactionLogRetentionDaysBuilder_; + } + + private int transactionalLogStorageState_ = 0; + + /** + * + * + *
+     * Output only. This value contains the storage location of transactional logs
+     * used to perform point-in-time recovery (PITR) for the database.
+     * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the transactionalLogStorageState field is set. + */ + @java.lang.Override + public boolean hasTransactionalLogStorageState() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Output only. This value contains the storage location of transactional logs
+     * used to perform point-in-time recovery (PITR) for the database.
+     * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for transactionalLogStorageState. + */ + @java.lang.Override + public int getTransactionalLogStorageStateValue() { + return transactionalLogStorageState_; + } + + /** + * + * + *
+     * Output only. This value contains the storage location of transactional logs
+     * used to perform point-in-time recovery (PITR) for the database.
+     * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for transactionalLogStorageState to set. + * @return This builder for chaining. + */ + public Builder setTransactionalLogStorageStateValue(int value) { + transactionalLogStorageState_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This value contains the storage location of transactional logs
+     * used to perform point-in-time recovery (PITR) for the database.
+     * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The transactionalLogStorageState. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState + getTransactionalLogStorageState() { + com.google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState result = + com.google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState.forNumber( + transactionalLogStorageState_); + return result == null + ? com.google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. This value contains the storage location of transactional logs
+     * used to perform point-in-time recovery (PITR) for the database.
+     * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The transactionalLogStorageState to set. + * @return This builder for chaining. + */ + public Builder setTransactionalLogStorageState( + com.google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + transactionalLogStorageState_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This value contains the storage location of transactional logs
+     * used to perform point-in-time recovery (PITR) for the database.
+     * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransactionalLogStorageState() { + bitField0_ = (bitField0_ & ~0x00000200); + transactionalLogStorageState_ = 0; + onChanged(); + return this; + } + + private int backupTier_ = 0; + + /** + * + * + *
+     * Output only. Backup tier that manages the backups for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.BackupTier backup_tier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupTier field is set. + */ + @java.lang.Override + public boolean hasBackupTier() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Output only. Backup tier that manages the backups for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.BackupTier backup_tier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for backupTier. + */ + @java.lang.Override + public int getBackupTierValue() { + return backupTier_; + } + + /** + * + * + *
+     * Output only. Backup tier that manages the backups for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.BackupTier backup_tier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for backupTier to set. + * @return This builder for chaining. + */ + public Builder setBackupTierValue(int value) { + backupTier_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Backup tier that manages the backups for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.BackupTier backup_tier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupTier. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupConfiguration.BackupTier getBackupTier() { + com.google.cloud.sql.v1.BackupConfiguration.BackupTier result = + com.google.cloud.sql.v1.BackupConfiguration.BackupTier.forNumber(backupTier_); + return result == null + ? com.google.cloud.sql.v1.BackupConfiguration.BackupTier.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. Backup tier that manages the backups for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.BackupTier backup_tier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The backupTier to set. + * @return This builder for chaining. + */ + public Builder setBackupTier(com.google.cloud.sql.v1.BackupConfiguration.BackupTier value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + backupTier_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Backup tier that manages the backups for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.BackupTier backup_tier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearBackupTier() { + bitField0_ = (bitField0_ & ~0x00000400); + backupTier_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.BackupConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.BackupConfiguration) + private static final com.google.cloud.sql.v1.BackupConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.BackupConfiguration(); + } + + public static com.google.cloud.sql.v1.BackupConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupConfigurationOrBuilder.java new file mode 100644 index 000000000000..67aa6569c296 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupConfigurationOrBuilder.java @@ -0,0 +1,452 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface BackupConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.BackupConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Start time for the daily backup configuration in UTC timezone in the 24
+   * hour format - `HH:MM`.
+   * 
+ * + * string start_time = 1; + * + * @return The startTime. + */ + java.lang.String getStartTime(); + + /** + * + * + *
+   * Start time for the daily backup configuration in UTC timezone in the 24
+   * hour format - `HH:MM`.
+   * 
+ * + * string start_time = 1; + * + * @return The bytes for startTime. + */ + com.google.protobuf.ByteString getStartTimeBytes(); + + /** + * + * + *
+   * Whether this configuration is enabled.
+   * 
+ * + * .google.protobuf.BoolValue enabled = 2; + * + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + + /** + * + * + *
+   * Whether this configuration is enabled.
+   * 
+ * + * .google.protobuf.BoolValue enabled = 2; + * + * @return The enabled. + */ + com.google.protobuf.BoolValue getEnabled(); + + /** + * + * + *
+   * Whether this configuration is enabled.
+   * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + com.google.protobuf.BoolValueOrBuilder getEnabledOrBuilder(); + + /** + * + * + *
+   * This is always `sql#backupConfiguration`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#backupConfiguration`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * (MySQL only) Whether binary log is enabled. If backup configuration is
+   * disabled, binarylog must be disabled as well.
+   * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + * + * @return Whether the binaryLogEnabled field is set. + */ + boolean hasBinaryLogEnabled(); + + /** + * + * + *
+   * (MySQL only) Whether binary log is enabled. If backup configuration is
+   * disabled, binarylog must be disabled as well.
+   * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + * + * @return The binaryLogEnabled. + */ + com.google.protobuf.BoolValue getBinaryLogEnabled(); + + /** + * + * + *
+   * (MySQL only) Whether binary log is enabled. If backup configuration is
+   * disabled, binarylog must be disabled as well.
+   * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + com.google.protobuf.BoolValueOrBuilder getBinaryLogEnabledOrBuilder(); + + /** + * + * + *
+   * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+   * will be removed from a future version of the API. Use
+   * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+   * instead.
+   * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @deprecated google.cloud.sql.v1.BackupConfiguration.replication_log_archiving_enabled is + * deprecated. See google/cloud/sql/v1/cloud_sql_resources.proto;l=169 + * @return Whether the replicationLogArchivingEnabled field is set. + */ + @java.lang.Deprecated + boolean hasReplicationLogArchivingEnabled(); + + /** + * + * + *
+   * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+   * will be removed from a future version of the API. Use
+   * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+   * instead.
+   * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @deprecated google.cloud.sql.v1.BackupConfiguration.replication_log_archiving_enabled is + * deprecated. See google/cloud/sql/v1/cloud_sql_resources.proto;l=169 + * @return The replicationLogArchivingEnabled. + */ + @java.lang.Deprecated + com.google.protobuf.BoolValue getReplicationLogArchivingEnabled(); + + /** + * + * + *
+   * Optional. Deprecated: replication_log_archiving_enabled is deprecated and
+   * will be removed from a future version of the API. Use
+   * [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
+   * instead.
+   * 
+ * + * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Deprecated + com.google.protobuf.BoolValueOrBuilder getReplicationLogArchivingEnabledOrBuilder(); + + /** + * + * + *
+   * Location of the backup
+   * 
+ * + * string location = 6; + * + * @return The location. + */ + java.lang.String getLocation(); + + /** + * + * + *
+   * Location of the backup
+   * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Whether point in time recovery is enabled.
+   * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + * + * @return Whether the pointInTimeRecoveryEnabled field is set. + */ + boolean hasPointInTimeRecoveryEnabled(); + + /** + * + * + *
+   * Whether point in time recovery is enabled.
+   * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + * + * @return The pointInTimeRecoveryEnabled. + */ + com.google.protobuf.BoolValue getPointInTimeRecoveryEnabled(); + + /** + * + * + *
+   * Whether point in time recovery is enabled.
+   * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + com.google.protobuf.BoolValueOrBuilder getPointInTimeRecoveryEnabledOrBuilder(); + + /** + * + * + *
+   * Backup retention settings.
+   * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + * + * @return Whether the backupRetentionSettings field is set. + */ + boolean hasBackupRetentionSettings(); + + /** + * + * + *
+   * Backup retention settings.
+   * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + * + * @return The backupRetentionSettings. + */ + com.google.cloud.sql.v1.BackupRetentionSettings getBackupRetentionSettings(); + + /** + * + * + *
+   * Backup retention settings.
+   * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings backup_retention_settings = 8; + */ + com.google.cloud.sql.v1.BackupRetentionSettingsOrBuilder getBackupRetentionSettingsOrBuilder(); + + /** + * + * + *
+   * The number of days of transaction logs we retain for point in time
+   * restore, from 1-7.
+   * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + * + * @return Whether the transactionLogRetentionDays field is set. + */ + boolean hasTransactionLogRetentionDays(); + + /** + * + * + *
+   * The number of days of transaction logs we retain for point in time
+   * restore, from 1-7.
+   * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + * + * @return The transactionLogRetentionDays. + */ + com.google.protobuf.Int32Value getTransactionLogRetentionDays(); + + /** + * + * + *
+   * The number of days of transaction logs we retain for point in time
+   * restore, from 1-7.
+   * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + com.google.protobuf.Int32ValueOrBuilder getTransactionLogRetentionDaysOrBuilder(); + + /** + * + * + *
+   * Output only. This value contains the storage location of transactional logs
+   * used to perform point-in-time recovery (PITR) for the database.
+   * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the transactionalLogStorageState field is set. + */ + boolean hasTransactionalLogStorageState(); + + /** + * + * + *
+   * Output only. This value contains the storage location of transactional logs
+   * used to perform point-in-time recovery (PITR) for the database.
+   * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for transactionalLogStorageState. + */ + int getTransactionalLogStorageStateValue(); + + /** + * + * + *
+   * Output only. This value contains the storage location of transactional logs
+   * used to perform point-in-time recovery (PITR) for the database.
+   * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The transactionalLogStorageState. + */ + com.google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState + getTransactionalLogStorageState(); + + /** + * + * + *
+   * Output only. Backup tier that manages the backups for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.BackupTier backup_tier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupTier field is set. + */ + boolean hasBackupTier(); + + /** + * + * + *
+   * Output only. Backup tier that manages the backups for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.BackupTier backup_tier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for backupTier. + */ + int getBackupTierValue(); + + /** + * + * + *
+   * Output only. Backup tier that manages the backups for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.BackupConfiguration.BackupTier backup_tier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupTier. + */ + com.google.cloud.sql.v1.BackupConfiguration.BackupTier getBackupTier(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupContext.java new file mode 100644 index 000000000000..372931c9bec4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupContext.java @@ -0,0 +1,886 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Backup context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.BackupContext} + */ +@com.google.protobuf.Generated +public final class BackupContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.BackupContext) + BackupContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupContext"); + } + + // Use BackupContext.newBuilder() to construct. + private BackupContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackupContext() { + kind_ = ""; + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.BackupContext.class, + com.google.cloud.sql.v1.BackupContext.Builder.class); + } + + public static final int BACKUP_ID_FIELD_NUMBER = 1; + private long backupId_ = 0L; + + /** + * + * + *
+   * The identifier of the backup.
+   * 
+ * + * int64 backup_id = 1; + * + * @return The backupId. + */ + @java.lang.Override + public long getBackupId() { + return backupId_; + } + + public static final int KIND_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#backupContext`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#backupContext`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the backup.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * string name = 3; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the backup.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * string name = 3; + * + * @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 (backupId_ != 0L) { + output.writeInt64(1, backupId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (backupId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, backupId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, 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.sql.v1.BackupContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.BackupContext other = (com.google.cloud.sql.v1.BackupContext) obj; + + if (getBackupId() != other.getBackupId()) return false; + if (!getKind().equals(other.getKind())) return false; + 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) + BACKUP_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getBackupId()); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().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.sql.v1.BackupContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupContext parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.BackupContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Backup context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.BackupContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.BackupContext) + com.google.cloud.sql.v1.BackupContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.BackupContext.class, + com.google.cloud.sql.v1.BackupContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.BackupContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backupId_ = 0L; + kind_ = ""; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.BackupContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupContext build() { + com.google.cloud.sql.v1.BackupContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupContext buildPartial() { + com.google.cloud.sql.v1.BackupContext result = + new com.google.cloud.sql.v1.BackupContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.BackupContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backupId_ = backupId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.BackupContext) { + return mergeFrom((com.google.cloud.sql.v1.BackupContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.BackupContext other) { + if (other == com.google.cloud.sql.v1.BackupContext.getDefaultInstance()) return this; + if (other.getBackupId() != 0L) { + setBackupId(other.getBackupId()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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 8: + { + backupId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + name_ = 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 long backupId_; + + /** + * + * + *
+     * The identifier of the backup.
+     * 
+ * + * int64 backup_id = 1; + * + * @return The backupId. + */ + @java.lang.Override + public long getBackupId() { + return backupId_; + } + + /** + * + * + *
+     * The identifier of the backup.
+     * 
+ * + * int64 backup_id = 1; + * + * @param value The backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupId(long value) { + + backupId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The identifier of the backup.
+     * 
+ * + * int64 backup_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearBackupId() { + bitField0_ = (bitField0_ & ~0x00000001); + backupId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#backupContext`.
+     * 
+ * + * string kind = 2; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupContext`.
+     * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupContext`.
+     * 
+ * + * string kind = 2; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupContext`.
+     * 
+ * + * string kind = 2; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupContext`.
+     * 
+ * + * string kind = 2; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the backup.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * string name = 3; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the backup.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * string name = 3; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the backup.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * string name = 3; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * string name = 3; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * string name = 3; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.BackupContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.BackupContext) + private static final com.google.cloud.sql.v1.BackupContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.BackupContext(); + } + + public static com.google.cloud.sql.v1.BackupContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupContextOrBuilder.java new file mode 100644 index 000000000000..57d83831a45d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupContextOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface BackupContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.BackupContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The identifier of the backup.
+   * 
+ * + * int64 backup_id = 1; + * + * @return The backupId. + */ + long getBackupId(); + + /** + * + * + *
+   * This is always `sql#backupContext`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#backupContext`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The name of the backup.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * string name = 3; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the backup.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * string name = 3; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupName.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupName.java new file mode 100644 index 000000000000..5c7bb414b86f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupName.java @@ -0,0 +1,194 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.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; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@NullMarked +@Generated("by gapic-generator-java") +public class BackupName implements ResourceName { + private static final PathTemplate PROJECT_BACKUP = + PathTemplate.createWithoutUrlEncoding("projects/{project}/backups/{backup}"); + private volatile Map fieldValuesMap; + private final String project; + private final String backup; + + @Deprecated + protected BackupName() { + project = null; + backup = null; + } + + private BackupName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + backup = Preconditions.checkNotNull(builder.getBackup()); + } + + public String getProject() { + return project; + } + + public String getBackup() { + return backup; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BackupName of(String project, String backup) { + return newBuilder().setProject(project).setBackup(backup).build(); + } + + public static String format(String project, String backup) { + return newBuilder().setProject(project).setBackup(backup).build().toString(); + } + + public static @Nullable BackupName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_BACKUP.validatedMatch( + formattedString, "BackupName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("backup")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List<@Nullable BackupName> values) { + List list = new ArrayList<>(values.size()); + for (BackupName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_BACKUP.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (backup != null) { + fieldMapBuilder.put("backup", backup); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_BACKUP.instantiate("project", project, "backup", backup); + } + + @Override + public boolean equals(@Nullable Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + BackupName that = ((BackupName) o); + return Objects.equals(this.project, that.project) && Objects.equals(this.backup, that.backup); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(backup); + return h; + } + + /** Builder for projects/{project}/backups/{backup}. */ + public static class Builder { + private String project; + private String backup; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getBackup() { + return backup; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setBackup(String backup) { + this.backup = backup; + return this; + } + + private Builder(BackupName backupName) { + this.project = backupName.project; + this.backup = backupName.backup; + } + + public BackupName build() { + return new BackupName(this); + } + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupOrBuilder.java new file mode 100644 index 000000000000..f6bc4f961990 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupOrBuilder.java @@ -0,0 +1,806 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface BackupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.Backup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the backup.
+   * Format: projects/{project}/backups/{backup}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Output only. The resource name of the backup.
+   * Format: projects/{project}/backups/{backup}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. This is always `sql#backup`.
+   * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * Output only. This is always `sql#backup`.
+   * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Output only. The URI of this resource.
+   * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The selfLink. + */ + java.lang.String getSelfLink(); + + /** + * + * + *
+   * Output only. The URI of this resource.
+   * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for selfLink. + */ + com.google.protobuf.ByteString getSelfLinkBytes(); + + /** + * + * + *
+   * Output only. The type of this backup. The type can be "AUTOMATED",
+   * "ON_DEMAND" or “FINAL”.
+   * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * Output only. The type of this backup. The type can be "AUTOMATED",
+   * "ON_DEMAND" or “FINAL”.
+   * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + com.google.cloud.sql.v1.Backup.SqlBackupType getType(); + + /** + * + * + *
+   * The description of this backup.
+   * 
+ * + * string description = 5; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * The description of this backup.
+   * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * The name of the source database instance.
+   * 
+ * + * string instance = 6; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * The name of the source database instance.
+   * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * The storage location of the backups. The location can be multi-regional.
+   * 
+ * + * string location = 7; + * + * @return The location. + */ + java.lang.String getLocation(); + + /** + * + * + *
+   * The storage location of the backups. The location can be multi-regional.
+   * 
+ * + * string location = 7; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Output only. This output contains the following values:
+   * start_time: All database writes up to this time are available.
+   * end_time: Any database writes after this time aren't available.
+   * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupInterval field is set. + */ + boolean hasBackupInterval(); + + /** + * + * + *
+   * Output only. This output contains the following values:
+   * start_time: All database writes up to this time are available.
+   * end_time: Any database writes after this time aren't available.
+   * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupInterval. + */ + com.google.type.Interval getBackupInterval(); + + /** + * + * + *
+   * Output only. This output contains the following values:
+   * start_time: All database writes up to this time are available.
+   * end_time: Any database writes after this time aren't available.
+   * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.type.IntervalOrBuilder getBackupIntervalOrBuilder(); + + /** + * + * + *
+   * Output only. The status of this backup.
+   * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+   * Output only. The status of this backup.
+   * 
+ * + * + * .google.cloud.sql.v1.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.sql.v1.Backup.SqlBackupState getState(); + + /** + * + * + *
+   * Output only. Information about why the backup operation fails (for example,
+   * when the backup state fails).
+   * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
+   * Output only. Information about why the backup operation fails (for example,
+   * when the backup state fails).
+   * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The error. + */ + com.google.cloud.sql.v1.OperationError getError(); + + /** + * + * + *
+   * Output only. Information about why the backup operation fails (for example,
+   * when the backup state fails).
+   * 
+ * + * + * .google.cloud.sql.v1.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.OperationErrorOrBuilder getErrorOrBuilder(); + + /** + * + * + *
+   * Output only. This output contains the encryption configuration for a backup
+   * and the resource name of the KMS key for disk encryption.
+   * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsKey. + */ + java.lang.String getKmsKey(); + + /** + * + * + *
+   * Output only. This output contains the encryption configuration for a backup
+   * and the resource name of the KMS key for disk encryption.
+   * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsKey. + */ + com.google.protobuf.ByteString getKmsKeyBytes(); + + /** + * + * + *
+   * Output only. This output contains the encryption status for a backup and
+   * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+   * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsKeyVersion. + */ + java.lang.String getKmsKeyVersion(); + + /** + * + * + *
+   * Output only. This output contains the encryption status for a backup and
+   * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+   * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsKeyVersion. + */ + com.google.protobuf.ByteString getKmsKeyVersionBytes(); + + /** + * + * + *
+   * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for backupKind. + */ + int getBackupKindValue(); + + /** + * + * + *
+   * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupKind. + */ + com.google.cloud.sql.v1.SqlBackupKind getBackupKind(); + + /** + * + * + *
+   * Output only. This output contains a backup time zone. If a Cloud SQL for
+   * SQL Server instance has a different time zone from the backup's time zone,
+   * then the restore to the instance doesn't happen.
+   * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The timeZone. + */ + java.lang.String getTimeZone(); + + /** + * + * + *
+   * Output only. This output contains a backup time zone. If a Cloud SQL for
+   * SQL Server instance has a different time zone from the backup's time zone,
+   * then the restore to the instance doesn't happen.
+   * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for timeZone. + */ + com.google.protobuf.ByteString getTimeZoneBytes(); + + /** + * + * + *
+   * Input only. The time-to-live (TTL) interval for this resource (in days).
+   * For example: ttlDays:7, means 7 days from the current time. The
+   * expiration time can't exceed 365 days from the time that the backup is
+   * created.
+   * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttlDays field is set. + */ + boolean hasTtlDays(); + + /** + * + * + *
+   * Input only. The time-to-live (TTL) interval for this resource (in days).
+   * For example: ttlDays:7, means 7 days from the current time. The
+   * expiration time can't exceed 365 days from the time that the backup is
+   * created.
+   * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttlDays. + */ + long getTtlDays(); + + /** + * + * + *
+   * Backup expiration time.
+   * A UTC timestamp of when this backup expired.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + * + * @return Whether the expiryTime field is set. + */ + boolean hasExpiryTime(); + + /** + * + * + *
+   * Backup expiration time.
+   * A UTC timestamp of when this backup expired.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + * + * @return The expiryTime. + */ + com.google.protobuf.Timestamp getExpiryTime(); + + /** + * + * + *
+   * Backup expiration time.
+   * A UTC timestamp of when this backup expired.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The database version of the instance of at the time this
+   * backup was made.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + int getDatabaseVersionValue(); + + /** + * + * + *
+   * Output only. The database version of the instance of at the time this
+   * backup was made.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + com.google.cloud.sql.v1.SqlDatabaseVersion getDatabaseVersion(); + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maxChargeableBytes field is set. + */ + boolean hasMaxChargeableBytes(); + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maxChargeableBytes. + */ + long getMaxChargeableBytes(); + + /** + * + * + *
+   * Optional. Output only. Timestamp in UTC of when the instance associated
+   * with this backup is deleted.
+   * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceDeletionTime field is set. + */ + boolean hasInstanceDeletionTime(); + + /** + * + * + *
+   * Optional. Output only. Timestamp in UTC of when the instance associated
+   * with this backup is deleted.
+   * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceDeletionTime. + */ + com.google.protobuf.Timestamp getInstanceDeletionTime(); + + /** + * + * + *
+   * Optional. Output only. Timestamp in UTC of when the instance associated
+   * with this backup is deleted.
+   * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getInstanceDeletionTimeOrBuilder(); + + /** + * + * + *
+   * Optional. Output only. The instance setting of the source instance that's
+   * associated with this backup.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceSettings field is set. + */ + boolean hasInstanceSettings(); + + /** + * + * + *
+   * Optional. Output only. The instance setting of the source instance that's
+   * associated with this backup.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceSettings. + */ + com.google.cloud.sql.v1.DatabaseInstance getInstanceSettings(); + + /** + * + * + *
+   * Optional. Output only. The instance setting of the source instance that's
+   * associated with this backup.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getInstanceSettingsOrBuilder(); + + /** + * + * + *
+   * Output only. The mapping to backup run resource used for IAM validations.
+   * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupRun. + */ + java.lang.String getBackupRun(); + + /** + * + * + *
+   * Output only. The mapping to backup run resource used for IAM validations.
+   * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupRun. + */ + com.google.protobuf.ByteString getBackupRunBytes(); + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + boolean hasSatisfiesPzs(); + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + com.google.protobuf.BoolValue getSatisfiesPzs(); + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder(); + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzi field is set. + */ + boolean hasSatisfiesPzi(); + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzi. + */ + com.google.protobuf.BoolValue getSatisfiesPzi(); + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.BoolValueOrBuilder getSatisfiesPziOrBuilder(); + + com.google.cloud.sql.v1.Backup.ExpirationCase getExpirationCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupReencryptionConfig.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupReencryptionConfig.java new file mode 100644 index 000000000000..c3e984db0d4a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupReencryptionConfig.java @@ -0,0 +1,918 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Backup Reencryption Config
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.BackupReencryptionConfig} + */ +@com.google.protobuf.Generated +public final class BackupReencryptionConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.BackupReencryptionConfig) + BackupReencryptionConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupReencryptionConfig"); + } + + // Use BackupReencryptionConfig.newBuilder() to construct. + private BackupReencryptionConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackupReencryptionConfig() { + backupType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_BackupReencryptionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_BackupReencryptionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.BackupReencryptionConfig.class, + com.google.cloud.sql.v1.BackupReencryptionConfig.Builder.class); + } + + /** + * + * + *
+   * Backup type for re-encryption
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.BackupReencryptionConfig.BackupType} + */ + public enum BackupType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown backup type, will be defaulted to AUTOMATIC backup type
+     * 
+ * + * BACKUP_TYPE_UNSPECIFIED = 0; + */ + BACKUP_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Reencrypt automatic backups
+     * 
+ * + * AUTOMATED = 1; + */ + AUTOMATED(1), + /** + * + * + *
+     * Reencrypt on-demand backups
+     * 
+ * + * ON_DEMAND = 2; + */ + ON_DEMAND(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupType"); + } + + /** + * + * + *
+     * Unknown backup type, will be defaulted to AUTOMATIC backup type
+     * 
+ * + * BACKUP_TYPE_UNSPECIFIED = 0; + */ + public static final int BACKUP_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Reencrypt automatic backups
+     * 
+ * + * AUTOMATED = 1; + */ + public static final int AUTOMATED_VALUE = 1; + + /** + * + * + *
+     * Reencrypt on-demand backups
+     * 
+ * + * ON_DEMAND = 2; + */ + public static final int ON_DEMAND_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 BackupType 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 BackupType forNumber(int value) { + switch (value) { + case 0: + return BACKUP_TYPE_UNSPECIFIED; + case 1: + return AUTOMATED; + case 2: + return ON_DEMAND; + 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 BackupType findValueByNumber(int number) { + return BackupType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.BackupReencryptionConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final BackupType[] VALUES = values(); + + public static BackupType 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 BackupType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.BackupReencryptionConfig.BackupType) + } + + private int bitField0_; + public static final int BACKUP_LIMIT_FIELD_NUMBER = 1; + private int backupLimit_ = 0; + + /** + * + * + *
+   * Backup re-encryption limit
+   * 
+ * + * optional int32 backup_limit = 1; + * + * @return Whether the backupLimit field is set. + */ + @java.lang.Override + public boolean hasBackupLimit() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Backup re-encryption limit
+   * 
+ * + * optional int32 backup_limit = 1; + * + * @return The backupLimit. + */ + @java.lang.Override + public int getBackupLimit() { + return backupLimit_; + } + + public static final int BACKUP_TYPE_FIELD_NUMBER = 2; + private int backupType_ = 0; + + /** + * + * + *
+   * Type of backups users want to re-encrypt.
+   * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2; + * + * @return Whether the backupType field is set. + */ + @java.lang.Override + public boolean hasBackupType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Type of backups users want to re-encrypt.
+   * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2; + * + * @return The enum numeric value on the wire for backupType. + */ + @java.lang.Override + public int getBackupTypeValue() { + return backupType_; + } + + /** + * + * + *
+   * Type of backups users want to re-encrypt.
+   * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2; + * + * @return The backupType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupReencryptionConfig.BackupType getBackupType() { + com.google.cloud.sql.v1.BackupReencryptionConfig.BackupType result = + com.google.cloud.sql.v1.BackupReencryptionConfig.BackupType.forNumber(backupType_); + return result == null + ? com.google.cloud.sql.v1.BackupReencryptionConfig.BackupType.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, backupLimit_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeEnum(2, backupType_); + } + 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, backupLimit_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, backupType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.BackupReencryptionConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.BackupReencryptionConfig other = + (com.google.cloud.sql.v1.BackupReencryptionConfig) obj; + + if (hasBackupLimit() != other.hasBackupLimit()) return false; + if (hasBackupLimit()) { + if (getBackupLimit() != other.getBackupLimit()) return false; + } + if (hasBackupType() != other.hasBackupType()) return false; + if (hasBackupType()) { + if (backupType_ != other.backupType_) return false; + } + if (!getUnknownFields().equals(other.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 (hasBackupLimit()) { + hash = (37 * hash) + BACKUP_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getBackupLimit(); + } + if (hasBackupType()) { + hash = (37 * hash) + BACKUP_TYPE_FIELD_NUMBER; + hash = (53 * hash) + backupType_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.BackupReencryptionConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupReencryptionConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupReencryptionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupReencryptionConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupReencryptionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupReencryptionConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupReencryptionConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupReencryptionConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupReencryptionConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupReencryptionConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupReencryptionConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupReencryptionConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.BackupReencryptionConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Backup Reencryption Config
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.BackupReencryptionConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.BackupReencryptionConfig) + com.google.cloud.sql.v1.BackupReencryptionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_BackupReencryptionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_BackupReencryptionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.BackupReencryptionConfig.class, + com.google.cloud.sql.v1.BackupReencryptionConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.BackupReencryptionConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backupLimit_ = 0; + backupType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_BackupReencryptionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupReencryptionConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.BackupReencryptionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupReencryptionConfig build() { + com.google.cloud.sql.v1.BackupReencryptionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupReencryptionConfig buildPartial() { + com.google.cloud.sql.v1.BackupReencryptionConfig result = + new com.google.cloud.sql.v1.BackupReencryptionConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.BackupReencryptionConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backupLimit_ = backupLimit_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupType_ = backupType_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.BackupReencryptionConfig) { + return mergeFrom((com.google.cloud.sql.v1.BackupReencryptionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.BackupReencryptionConfig other) { + if (other == com.google.cloud.sql.v1.BackupReencryptionConfig.getDefaultInstance()) + return this; + if (other.hasBackupLimit()) { + setBackupLimit(other.getBackupLimit()); + } + if (other.hasBackupType()) { + setBackupTypeValue(other.getBackupTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + backupLimit_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + backupType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int backupLimit_; + + /** + * + * + *
+     * Backup re-encryption limit
+     * 
+ * + * optional int32 backup_limit = 1; + * + * @return Whether the backupLimit field is set. + */ + @java.lang.Override + public boolean hasBackupLimit() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Backup re-encryption limit
+     * 
+ * + * optional int32 backup_limit = 1; + * + * @return The backupLimit. + */ + @java.lang.Override + public int getBackupLimit() { + return backupLimit_; + } + + /** + * + * + *
+     * Backup re-encryption limit
+     * 
+ * + * optional int32 backup_limit = 1; + * + * @param value The backupLimit to set. + * @return This builder for chaining. + */ + public Builder setBackupLimit(int value) { + + backupLimit_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Backup re-encryption limit
+     * 
+ * + * optional int32 backup_limit = 1; + * + * @return This builder for chaining. + */ + public Builder clearBackupLimit() { + bitField0_ = (bitField0_ & ~0x00000001); + backupLimit_ = 0; + onChanged(); + return this; + } + + private int backupType_ = 0; + + /** + * + * + *
+     * Type of backups users want to re-encrypt.
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @return Whether the backupType field is set. + */ + @java.lang.Override + public boolean hasBackupType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Type of backups users want to re-encrypt.
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @return The enum numeric value on the wire for backupType. + */ + @java.lang.Override + public int getBackupTypeValue() { + return backupType_; + } + + /** + * + * + *
+     * Type of backups users want to re-encrypt.
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @param value The enum numeric value on the wire for backupType to set. + * @return This builder for chaining. + */ + public Builder setBackupTypeValue(int value) { + backupType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Type of backups users want to re-encrypt.
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @return The backupType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupReencryptionConfig.BackupType getBackupType() { + com.google.cloud.sql.v1.BackupReencryptionConfig.BackupType result = + com.google.cloud.sql.v1.BackupReencryptionConfig.BackupType.forNumber(backupType_); + return result == null + ? com.google.cloud.sql.v1.BackupReencryptionConfig.BackupType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Type of backups users want to re-encrypt.
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @param value The backupType to set. + * @return This builder for chaining. + */ + public Builder setBackupType( + com.google.cloud.sql.v1.BackupReencryptionConfig.BackupType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + backupType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Type of backups users want to re-encrypt.
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearBackupType() { + bitField0_ = (bitField0_ & ~0x00000002); + backupType_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.BackupReencryptionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.BackupReencryptionConfig) + private static final com.google.cloud.sql.v1.BackupReencryptionConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.BackupReencryptionConfig(); + } + + public static com.google.cloud.sql.v1.BackupReencryptionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupReencryptionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupReencryptionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupReencryptionConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupReencryptionConfigOrBuilder.java new file mode 100644 index 000000000000..5ef86e656fdf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupReencryptionConfigOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface BackupReencryptionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.BackupReencryptionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Backup re-encryption limit
+   * 
+ * + * optional int32 backup_limit = 1; + * + * @return Whether the backupLimit field is set. + */ + boolean hasBackupLimit(); + + /** + * + * + *
+   * Backup re-encryption limit
+   * 
+ * + * optional int32 backup_limit = 1; + * + * @return The backupLimit. + */ + int getBackupLimit(); + + /** + * + * + *
+   * Type of backups users want to re-encrypt.
+   * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2; + * + * @return Whether the backupType field is set. + */ + boolean hasBackupType(); + + /** + * + * + *
+   * Type of backups users want to re-encrypt.
+   * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2; + * + * @return The enum numeric value on the wire for backupType. + */ + int getBackupTypeValue(); + + /** + * + * + *
+   * Type of backups users want to re-encrypt.
+   * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2; + * + * @return The backupType. + */ + com.google.cloud.sql.v1.BackupReencryptionConfig.BackupType getBackupType(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRetentionSettings.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRetentionSettings.java new file mode 100644 index 000000000000..ff8e28e5294b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRetentionSettings.java @@ -0,0 +1,1036 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * We currently only support backup retention by specifying the number
+ * of backups we will retain.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.BackupRetentionSettings} + */ +@com.google.protobuf.Generated +public final class BackupRetentionSettings extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.BackupRetentionSettings) + BackupRetentionSettingsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupRetentionSettings"); + } + + // Use BackupRetentionSettings.newBuilder() to construct. + private BackupRetentionSettings(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackupRetentionSettings() { + retentionUnit_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupRetentionSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupRetentionSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.BackupRetentionSettings.class, + com.google.cloud.sql.v1.BackupRetentionSettings.Builder.class); + } + + /** + * + * + *
+   * The units that retained_backups specifies, we only support COUNT.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit} + */ + public enum RetentionUnit implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Backup retention unit is unspecified, will be treated as COUNT.
+     * 
+ * + * RETENTION_UNIT_UNSPECIFIED = 0; + */ + RETENTION_UNIT_UNSPECIFIED(0), + /** + * + * + *
+     * Retention will be by count, eg. "retain the most recent 7 backups".
+     * 
+ * + * COUNT = 1; + */ + COUNT(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RetentionUnit"); + } + + /** + * + * + *
+     * Backup retention unit is unspecified, will be treated as COUNT.
+     * 
+ * + * RETENTION_UNIT_UNSPECIFIED = 0; + */ + public static final int RETENTION_UNIT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Retention will be by count, eg. "retain the most recent 7 backups".
+     * 
+ * + * COUNT = 1; + */ + public static final int COUNT_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RetentionUnit 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 RetentionUnit forNumber(int value) { + switch (value) { + case 0: + return RETENTION_UNIT_UNSPECIFIED; + case 1: + return COUNT; + 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 RetentionUnit findValueByNumber(int number) { + return RetentionUnit.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.BackupRetentionSettings.getDescriptor().getEnumTypes().get(0); + } + + private static final RetentionUnit[] VALUES = values(); + + public static RetentionUnit 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 RetentionUnit(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit) + } + + private int bitField0_; + public static final int RETENTION_UNIT_FIELD_NUMBER = 1; + private int retentionUnit_ = 0; + + /** + * + * + *
+   * The unit that 'retained_backups' represents.
+   * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * @return The enum numeric value on the wire for retentionUnit. + */ + @java.lang.Override + public int getRetentionUnitValue() { + return retentionUnit_; + } + + /** + * + * + *
+   * The unit that 'retained_backups' represents.
+   * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * @return The retentionUnit. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit getRetentionUnit() { + com.google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit result = + com.google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit.forNumber(retentionUnit_); + return result == null + ? com.google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit.UNRECOGNIZED + : result; + } + + public static final int RETAINED_BACKUPS_FIELD_NUMBER = 2; + private com.google.protobuf.Int32Value retainedBackups_; + + /** + * + * + *
+   * Depending on the value of retention_unit, this is used to determine
+   * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+   * retain this many backups.
+   * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + * + * @return Whether the retainedBackups field is set. + */ + @java.lang.Override + public boolean hasRetainedBackups() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Depending on the value of retention_unit, this is used to determine
+   * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+   * retain this many backups.
+   * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + * + * @return The retainedBackups. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getRetainedBackups() { + return retainedBackups_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : retainedBackups_; + } + + /** + * + * + *
+   * Depending on the value of retention_unit, this is used to determine
+   * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+   * retain this many backups.
+   * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getRetainedBackupsOrBuilder() { + return retainedBackups_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : retainedBackups_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (retentionUnit_ + != com.google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit.RETENTION_UNIT_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, retentionUnit_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getRetainedBackups()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (retentionUnit_ + != com.google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit.RETENTION_UNIT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, retentionUnit_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRetainedBackups()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.BackupRetentionSettings)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.BackupRetentionSettings other = + (com.google.cloud.sql.v1.BackupRetentionSettings) obj; + + if (retentionUnit_ != other.retentionUnit_) return false; + if (hasRetainedBackups() != other.hasRetainedBackups()) return false; + if (hasRetainedBackups()) { + if (!getRetainedBackups().equals(other.getRetainedBackups())) return false; + } + if (!getUnknownFields().equals(other.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) + RETENTION_UNIT_FIELD_NUMBER; + hash = (53 * hash) + retentionUnit_; + if (hasRetainedBackups()) { + hash = (37 * hash) + RETAINED_BACKUPS_FIELD_NUMBER; + hash = (53 * hash) + getRetainedBackups().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.BackupRetentionSettings parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupRetentionSettings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRetentionSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupRetentionSettings parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRetentionSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupRetentionSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRetentionSettings parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupRetentionSettings parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRetentionSettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupRetentionSettings parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRetentionSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupRetentionSettings parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.BackupRetentionSettings prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * We currently only support backup retention by specifying the number
+   * of backups we will retain.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.BackupRetentionSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.BackupRetentionSettings) + com.google.cloud.sql.v1.BackupRetentionSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupRetentionSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupRetentionSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.BackupRetentionSettings.class, + com.google.cloud.sql.v1.BackupRetentionSettings.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.BackupRetentionSettings.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRetainedBackupsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + retentionUnit_ = 0; + retainedBackups_ = null; + if (retainedBackupsBuilder_ != null) { + retainedBackupsBuilder_.dispose(); + retainedBackupsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_BackupRetentionSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupRetentionSettings getDefaultInstanceForType() { + return com.google.cloud.sql.v1.BackupRetentionSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupRetentionSettings build() { + com.google.cloud.sql.v1.BackupRetentionSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupRetentionSettings buildPartial() { + com.google.cloud.sql.v1.BackupRetentionSettings result = + new com.google.cloud.sql.v1.BackupRetentionSettings(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.BackupRetentionSettings result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.retentionUnit_ = retentionUnit_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.retainedBackups_ = + retainedBackupsBuilder_ == null ? retainedBackups_ : retainedBackupsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.BackupRetentionSettings) { + return mergeFrom((com.google.cloud.sql.v1.BackupRetentionSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.BackupRetentionSettings other) { + if (other == com.google.cloud.sql.v1.BackupRetentionSettings.getDefaultInstance()) + return this; + if (other.retentionUnit_ != 0) { + setRetentionUnitValue(other.getRetentionUnitValue()); + } + if (other.hasRetainedBackups()) { + mergeRetainedBackups(other.getRetainedBackups()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + retentionUnit_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetRetainedBackupsFieldBuilder().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 retentionUnit_ = 0; + + /** + * + * + *
+     * The unit that 'retained_backups' represents.
+     * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * @return The enum numeric value on the wire for retentionUnit. + */ + @java.lang.Override + public int getRetentionUnitValue() { + return retentionUnit_; + } + + /** + * + * + *
+     * The unit that 'retained_backups' represents.
+     * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * @param value The enum numeric value on the wire for retentionUnit to set. + * @return This builder for chaining. + */ + public Builder setRetentionUnitValue(int value) { + retentionUnit_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unit that 'retained_backups' represents.
+     * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * @return The retentionUnit. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit getRetentionUnit() { + com.google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit result = + com.google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit.forNumber(retentionUnit_); + return result == null + ? com.google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The unit that 'retained_backups' represents.
+     * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * @param value The retentionUnit to set. + * @return This builder for chaining. + */ + public Builder setRetentionUnit( + com.google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + retentionUnit_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unit that 'retained_backups' represents.
+     * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * @return This builder for chaining. + */ + public Builder clearRetentionUnit() { + bitField0_ = (bitField0_ & ~0x00000001); + retentionUnit_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Int32Value retainedBackups_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + retainedBackupsBuilder_; + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + * + * @return Whether the retainedBackups field is set. + */ + public boolean hasRetainedBackups() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + * + * @return The retainedBackups. + */ + public com.google.protobuf.Int32Value getRetainedBackups() { + if (retainedBackupsBuilder_ == null) { + return retainedBackups_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : retainedBackups_; + } else { + return retainedBackupsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + public Builder setRetainedBackups(com.google.protobuf.Int32Value value) { + if (retainedBackupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retainedBackups_ = value; + } else { + retainedBackupsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + public Builder setRetainedBackups(com.google.protobuf.Int32Value.Builder builderForValue) { + if (retainedBackupsBuilder_ == null) { + retainedBackups_ = builderForValue.build(); + } else { + retainedBackupsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + public Builder mergeRetainedBackups(com.google.protobuf.Int32Value value) { + if (retainedBackupsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && retainedBackups_ != null + && retainedBackups_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getRetainedBackupsBuilder().mergeFrom(value); + } else { + retainedBackups_ = value; + } + } else { + retainedBackupsBuilder_.mergeFrom(value); + } + if (retainedBackups_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + public Builder clearRetainedBackups() { + bitField0_ = (bitField0_ & ~0x00000002); + retainedBackups_ = null; + if (retainedBackupsBuilder_ != null) { + retainedBackupsBuilder_.dispose(); + retainedBackupsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + public com.google.protobuf.Int32Value.Builder getRetainedBackupsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetRetainedBackupsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + public com.google.protobuf.Int32ValueOrBuilder getRetainedBackupsOrBuilder() { + if (retainedBackupsBuilder_ != null) { + return retainedBackupsBuilder_.getMessageOrBuilder(); + } else { + return retainedBackups_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : retainedBackups_; + } + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetRetainedBackupsFieldBuilder() { + if (retainedBackupsBuilder_ == null) { + retainedBackupsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getRetainedBackups(), getParentForChildren(), isClean()); + retainedBackups_ = null; + } + return retainedBackupsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.BackupRetentionSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.BackupRetentionSettings) + private static final com.google.cloud.sql.v1.BackupRetentionSettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.BackupRetentionSettings(); + } + + public static com.google.cloud.sql.v1.BackupRetentionSettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupRetentionSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupRetentionSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRetentionSettingsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRetentionSettingsOrBuilder.java new file mode 100644 index 000000000000..1ccb328652bd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRetentionSettingsOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface BackupRetentionSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.BackupRetentionSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unit that 'retained_backups' represents.
+   * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * @return The enum numeric value on the wire for retentionUnit. + */ + int getRetentionUnitValue(); + + /** + * + * + *
+   * The unit that 'retained_backups' represents.
+   * 
+ * + * .google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * @return The retentionUnit. + */ + com.google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit getRetentionUnit(); + + /** + * + * + *
+   * Depending on the value of retention_unit, this is used to determine
+   * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+   * retain this many backups.
+   * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + * + * @return Whether the retainedBackups field is set. + */ + boolean hasRetainedBackups(); + + /** + * + * + *
+   * Depending on the value of retention_unit, this is used to determine
+   * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+   * retain this many backups.
+   * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + * + * @return The retainedBackups. + */ + com.google.protobuf.Int32Value getRetainedBackups(); + + /** + * + * + *
+   * Depending on the value of retention_unit, this is used to determine
+   * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+   * retain this many backups.
+   * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + com.google.protobuf.Int32ValueOrBuilder getRetainedBackupsOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRun.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRun.java new file mode 100644 index 000000000000..6134212e40f7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRun.java @@ -0,0 +1,4552 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * A BackupRun resource.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.BackupRun} + */ +@com.google.protobuf.Generated +public final class BackupRun extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.BackupRun) + BackupRunOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupRun"); + } + + // Use BackupRun.newBuilder() to construct. + private BackupRun(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackupRun() { + kind_ = ""; + status_ = 0; + type_ = 0; + description_ = ""; + instance_ = ""; + selfLink_ = ""; + location_ = ""; + databaseVersion_ = 0; + backupKind_ = 0; + timeZone_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_BackupRun_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_BackupRun_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.BackupRun.class, + com.google.cloud.sql.v1.BackupRun.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#backupRun`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#backupRun`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 2; + private int status_ = 0; + + /** + * + * + *
+   * The status of this run.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackupRunStatus status = 2; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
+   * The status of this run.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackupRunStatus status = 2; + * + * @return The status. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunStatus getStatus() { + com.google.cloud.sql.v1.SqlBackupRunStatus result = + com.google.cloud.sql.v1.SqlBackupRunStatus.forNumber(status_); + return result == null ? com.google.cloud.sql.v1.SqlBackupRunStatus.UNRECOGNIZED : result; + } + + public static final int ENQUEUED_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp enqueuedTime_; + + /** + * + * + *
+   * The time the run was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + * + * @return Whether the enqueuedTime field is set. + */ + @java.lang.Override + public boolean hasEnqueuedTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time the run was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + * + * @return The enqueuedTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEnqueuedTime() { + return enqueuedTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : enqueuedTime_; + } + + /** + * + * + *
+   * The time the run was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEnqueuedTimeOrBuilder() { + return enqueuedTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : enqueuedTime_; + } + + public static final int ID_FIELD_NUMBER = 4; + private long id_ = 0L; + + /** + * + * + *
+   * The identifier for this backup run. Unique only for a specific Cloud SQL
+   * instance.
+   * 
+ * + * int64 id = 4; + * + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int START_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The time the backup operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time the backup operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The time the backup operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * The time the backup operation completed in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The time the backup operation completed in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * The time the backup operation completed in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int ERROR_FIELD_NUMBER = 7; + private com.google.cloud.sql.v1.OperationError error_; + + /** + * + * + *
+   * Information about why the backup operation failed. This is only present if
+   * the run has the FAILED status.
+   * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Information about why the backup operation failed. This is only present if
+   * the run has the FAILED status.
+   * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + * + * @return The error. + */ + @java.lang.Override + public com.google.cloud.sql.v1.OperationError getError() { + return error_ == null ? com.google.cloud.sql.v1.OperationError.getDefaultInstance() : error_; + } + + /** + * + * + *
+   * Information about why the backup operation failed. This is only present if
+   * the run has the FAILED status.
+   * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + */ + @java.lang.Override + public com.google.cloud.sql.v1.OperationErrorOrBuilder getErrorOrBuilder() { + return error_ == null ? com.google.cloud.sql.v1.OperationError.getDefaultInstance() : error_; + } + + public static final int TYPE_FIELD_NUMBER = 8; + private int type_ = 0; + + /** + * + * + *
+   * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+   * This field defaults to "ON_DEMAND" and is ignored, when specified for
+   * insert requests.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackupRunType type = 8; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+   * This field defaults to "ON_DEMAND" and is ignored, when specified for
+   * insert requests.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackupRunType type = 8; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunType getType() { + com.google.cloud.sql.v1.SqlBackupRunType result = + com.google.cloud.sql.v1.SqlBackupRunType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1.SqlBackupRunType.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * The description of this run, only applicable to on-demand backups.
+   * 
+ * + * string description = 9; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + + /** + * + * + *
+   * The description of this run, only applicable to on-demand backups.
+   * 
+ * + * string description = 9; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WINDOW_START_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp windowStartTime_; + + /** + * + * + *
+   * The start time of the backup window during which this the backup was
+   * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+   * example `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + * + * @return Whether the windowStartTime field is set. + */ + @java.lang.Override + public boolean hasWindowStartTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * The start time of the backup window during which this the backup was
+   * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+   * example `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + * + * @return The windowStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getWindowStartTime() { + return windowStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : windowStartTime_; + } + + /** + * + * + *
+   * The start time of the backup window during which this the backup was
+   * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+   * example `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getWindowStartTimeOrBuilder() { + return windowStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : windowStartTime_; + } + + public static final int INSTANCE_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 11; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 11; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELF_LINK_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object selfLink_ = ""; + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 12; + * + * @return The selfLink. + */ + @java.lang.Override + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } + } + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 12; + * + * @return The bytes for selfLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + + /** + * + * + *
+   * Location of the backups.
+   * 
+ * + * string location = 13; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + + /** + * + * + *
+   * Location of the backups.
+   * 
+ * + * string location = 13; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_VERSION_FIELD_NUMBER = 15; + private int databaseVersion_ = 0; + + /** + * + * + *
+   * Output only. The instance database version at the time this backup was
+   * made.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+   * Output only. The instance database version at the time this backup was
+   * made.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1.SqlDatabaseVersion result = + com.google.cloud.sql.v1.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + public static final int DISK_ENCRYPTION_CONFIGURATION_FIELD_NUMBER = 16; + private com.google.cloud.sql.v1.DiskEncryptionConfiguration diskEncryptionConfiguration_; + + /** + * + * + *
+   * Encryption configuration specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + * + * @return Whether the diskEncryptionConfiguration field is set. + */ + @java.lang.Override + public boolean hasDiskEncryptionConfiguration() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Encryption configuration specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + * + * @return The diskEncryptionConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionConfiguration getDiskEncryptionConfiguration() { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } + + /** + * + * + *
+   * Encryption configuration specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionConfigurationOrBuilder + getDiskEncryptionConfigurationOrBuilder() { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } + + public static final int DISK_ENCRYPTION_STATUS_FIELD_NUMBER = 17; + private com.google.cloud.sql.v1.DiskEncryptionStatus diskEncryptionStatus_; + + /** + * + * + *
+   * Encryption status specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + * + * @return Whether the diskEncryptionStatus field is set. + */ + @java.lang.Override + public boolean hasDiskEncryptionStatus() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Encryption status specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + * + * @return The diskEncryptionStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionStatus getDiskEncryptionStatus() { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } + + /** + * + * + *
+   * Encryption status specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + */ + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionStatusOrBuilder getDiskEncryptionStatusOrBuilder() { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } + + public static final int BACKUP_KIND_FIELD_NUMBER = 19; + private int backupKind_ = 0; + + /** + * + * + *
+   * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 19; + * + * @return The enum numeric value on the wire for backupKind. + */ + @java.lang.Override + public int getBackupKindValue() { + return backupKind_; + } + + /** + * + * + *
+   * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 19; + * + * @return The backupKind. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupKind getBackupKind() { + com.google.cloud.sql.v1.SqlBackupKind result = + com.google.cloud.sql.v1.SqlBackupKind.forNumber(backupKind_); + return result == null ? com.google.cloud.sql.v1.SqlBackupKind.UNRECOGNIZED : result; + } + + public static final int TIME_ZONE_FIELD_NUMBER = 23; + + @SuppressWarnings("serial") + private volatile java.lang.Object timeZone_ = ""; + + /** + * + * + *
+   * Backup time zone to prevent restores to an instance with
+   * a different time zone. Now relevant only for SQL Server.
+   * 
+ * + * string time_zone = 23; + * + * @return The timeZone. + */ + @java.lang.Override + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } + } + + /** + * + * + *
+   * Backup time zone to prevent restores to an instance with
+   * a different time zone. Now relevant only for SQL Server.
+   * 
+ * + * string time_zone = 23; + * + * @return The bytes for timeZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_CHARGEABLE_BYTES_FIELD_NUMBER = 24; + private long maxChargeableBytes_ = 0L; + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maxChargeableBytes field is set. + */ + @java.lang.Override + public boolean hasMaxChargeableBytes() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maxChargeableBytes. + */ + @java.lang.Override + public long getMaxChargeableBytes() { + return maxChargeableBytes_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (status_ + != com.google.cloud.sql.v1.SqlBackupRunStatus.SQL_BACKUP_RUN_STATUS_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, status_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getEnqueuedTime()); + } + if (id_ != 0L) { + output.writeInt64(4, id_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(6, getEndTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(7, getError()); + } + if (type_ + != com.google.cloud.sql.v1.SqlBackupRunType.SQL_BACKUP_RUN_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, description_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(10, getWindowStartTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, selfLink_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 13, location_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(15, databaseVersion_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(16, getDiskEncryptionConfiguration()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(17, getDiskEncryptionStatus()); + } + if (backupKind_ + != com.google.cloud.sql.v1.SqlBackupKind.SQL_BACKUP_KIND_UNSPECIFIED.getNumber()) { + output.writeEnum(19, backupKind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(timeZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 23, timeZone_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeInt64(24, maxChargeableBytes_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (status_ + != com.google.cloud.sql.v1.SqlBackupRunStatus.SQL_BACKUP_RUN_STATUS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, status_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEnqueuedTime()); + } + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, id_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getEndTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getError()); + } + if (type_ + != com.google.cloud.sql.v1.SqlBackupRunType.SQL_BACKUP_RUN_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, description_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getWindowStartTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, selfLink_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(13, location_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(15, databaseVersion_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 16, getDiskEncryptionConfiguration()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(17, getDiskEncryptionStatus()); + } + if (backupKind_ + != com.google.cloud.sql.v1.SqlBackupKind.SQL_BACKUP_KIND_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(19, backupKind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(timeZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(23, timeZone_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(24, maxChargeableBytes_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.BackupRun)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.BackupRun other = (com.google.cloud.sql.v1.BackupRun) obj; + + if (!getKind().equals(other.getKind())) return false; + if (status_ != other.status_) return false; + if (hasEnqueuedTime() != other.hasEnqueuedTime()) return false; + if (hasEnqueuedTime()) { + if (!getEnqueuedTime().equals(other.getEnqueuedTime())) return false; + } + if (getId() != other.getId()) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (type_ != other.type_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasWindowStartTime() != other.hasWindowStartTime()) return false; + if (hasWindowStartTime()) { + if (!getWindowStartTime().equals(other.getWindowStartTime())) return false; + } + if (!getInstance().equals(other.getInstance())) return false; + if (!getSelfLink().equals(other.getSelfLink())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (databaseVersion_ != other.databaseVersion_) return false; + if (hasDiskEncryptionConfiguration() != other.hasDiskEncryptionConfiguration()) return false; + if (hasDiskEncryptionConfiguration()) { + if (!getDiskEncryptionConfiguration().equals(other.getDiskEncryptionConfiguration())) + return false; + } + if (hasDiskEncryptionStatus() != other.hasDiskEncryptionStatus()) return false; + if (hasDiskEncryptionStatus()) { + if (!getDiskEncryptionStatus().equals(other.getDiskEncryptionStatus())) return false; + } + if (backupKind_ != other.backupKind_) return false; + if (!getTimeZone().equals(other.getTimeZone())) return false; + if (hasMaxChargeableBytes() != other.hasMaxChargeableBytes()) return false; + if (hasMaxChargeableBytes()) { + if (getMaxChargeableBytes() != other.getMaxChargeableBytes()) return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + if (hasEnqueuedTime()) { + hash = (37 * hash) + ENQUEUED_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEnqueuedTime().hashCode(); + } + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getId()); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasWindowStartTime()) { + hash = (37 * hash) + WINDOW_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getWindowStartTime().hashCode(); + } + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + SELF_LINK_FIELD_NUMBER; + hash = (53 * hash) + getSelfLink().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (37 * hash) + DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + databaseVersion_; + if (hasDiskEncryptionConfiguration()) { + hash = (37 * hash) + DISK_ENCRYPTION_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getDiskEncryptionConfiguration().hashCode(); + } + if (hasDiskEncryptionStatus()) { + hash = (37 * hash) + DISK_ENCRYPTION_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getDiskEncryptionStatus().hashCode(); + } + hash = (37 * hash) + BACKUP_KIND_FIELD_NUMBER; + hash = (53 * hash) + backupKind_; + hash = (37 * hash) + TIME_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getTimeZone().hashCode(); + if (hasMaxChargeableBytes()) { + hash = (37 * hash) + MAX_CHARGEABLE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxChargeableBytes()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.BackupRun parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupRun parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRun parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupRun parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRun parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupRun parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRun parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupRun parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRun parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupRun parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRun parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupRun parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.BackupRun prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A BackupRun resource.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.BackupRun} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.BackupRun) + com.google.cloud.sql.v1.BackupRunOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_BackupRun_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_BackupRun_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.BackupRun.class, + com.google.cloud.sql.v1.BackupRun.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.BackupRun.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEnqueuedTimeFieldBuilder(); + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + internalGetErrorFieldBuilder(); + internalGetWindowStartTimeFieldBuilder(); + internalGetDiskEncryptionConfigurationFieldBuilder(); + internalGetDiskEncryptionStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + status_ = 0; + enqueuedTime_ = null; + if (enqueuedTimeBuilder_ != null) { + enqueuedTimeBuilder_.dispose(); + enqueuedTimeBuilder_ = null; + } + id_ = 0L; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + type_ = 0; + description_ = ""; + windowStartTime_ = null; + if (windowStartTimeBuilder_ != null) { + windowStartTimeBuilder_.dispose(); + windowStartTimeBuilder_ = null; + } + instance_ = ""; + selfLink_ = ""; + location_ = ""; + databaseVersion_ = 0; + diskEncryptionConfiguration_ = null; + if (diskEncryptionConfigurationBuilder_ != null) { + diskEncryptionConfigurationBuilder_.dispose(); + diskEncryptionConfigurationBuilder_ = null; + } + diskEncryptionStatus_ = null; + if (diskEncryptionStatusBuilder_ != null) { + diskEncryptionStatusBuilder_.dispose(); + diskEncryptionStatusBuilder_ = null; + } + backupKind_ = 0; + timeZone_ = ""; + maxChargeableBytes_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_BackupRun_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupRun getDefaultInstanceForType() { + return com.google.cloud.sql.v1.BackupRun.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupRun build() { + com.google.cloud.sql.v1.BackupRun result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupRun buildPartial() { + com.google.cloud.sql.v1.BackupRun result = new com.google.cloud.sql.v1.BackupRun(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.BackupRun result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.status_ = status_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.enqueuedTime_ = + enqueuedTimeBuilder_ == null ? enqueuedTime_ : enqueuedTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.windowStartTime_ = + windowStartTimeBuilder_ == null ? windowStartTime_ : windowStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.selfLink_ = selfLink_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.databaseVersion_ = databaseVersion_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.diskEncryptionConfiguration_ = + diskEncryptionConfigurationBuilder_ == null + ? diskEncryptionConfiguration_ + : diskEncryptionConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.diskEncryptionStatus_ = + diskEncryptionStatusBuilder_ == null + ? diskEncryptionStatus_ + : diskEncryptionStatusBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.backupKind_ = backupKind_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.timeZone_ = timeZone_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.maxChargeableBytes_ = maxChargeableBytes_; + to_bitField0_ |= 0x00000080; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.BackupRun) { + return mergeFrom((com.google.cloud.sql.v1.BackupRun) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.BackupRun other) { + if (other == com.google.cloud.sql.v1.BackupRun.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + if (other.hasEnqueuedTime()) { + mergeEnqueuedTime(other.getEnqueuedTime()); + } + if (other.getId() != 0L) { + setId(other.getId()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.hasWindowStartTime()) { + mergeWindowStartTime(other.getWindowStartTime()); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (!other.getSelfLink().isEmpty()) { + selfLink_ = other.selfLink_; + bitField0_ |= 0x00000800; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (other.databaseVersion_ != 0) { + setDatabaseVersionValue(other.getDatabaseVersionValue()); + } + if (other.hasDiskEncryptionConfiguration()) { + mergeDiskEncryptionConfiguration(other.getDiskEncryptionConfiguration()); + } + if (other.hasDiskEncryptionStatus()) { + mergeDiskEncryptionStatus(other.getDiskEncryptionStatus()); + } + if (other.backupKind_ != 0) { + setBackupKindValue(other.getBackupKindValue()); + } + if (!other.getTimeZone().isEmpty()) { + timeZone_ = other.timeZone_; + bitField0_ |= 0x00020000; + onChanged(); + } + if (other.hasMaxChargeableBytes()) { + setMaxChargeableBytes(other.getMaxChargeableBytes()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + status_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage( + internalGetEnqueuedTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + id_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 74: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + input.readMessage( + internalGetWindowStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + selfLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 106: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 120: + { + databaseVersion_ = input.readEnum(); + bitField0_ |= 0x00002000; + break; + } // case 120 + case 130: + { + input.readMessage( + internalGetDiskEncryptionConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00004000; + break; + } // case 130 + case 138: + { + input.readMessage( + internalGetDiskEncryptionStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00008000; + break; + } // case 138 + case 152: + { + backupKind_ = input.readEnum(); + bitField0_ |= 0x00010000; + break; + } // case 152 + case 186: + { + timeZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00020000; + break; + } // case 186 + case 192: + { + maxChargeableBytes_ = input.readInt64(); + bitField0_ |= 0x00040000; + break; + } // case 192 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#backupRun`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupRun`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupRun`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupRun`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupRun`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int status_ = 0; + + /** + * + * + *
+     * The status of this run.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupRunStatus status = 2; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
+     * The status of this run.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupRunStatus status = 2; + * + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + status_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The status of this run.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupRunStatus status = 2; + * + * @return The status. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunStatus getStatus() { + com.google.cloud.sql.v1.SqlBackupRunStatus result = + com.google.cloud.sql.v1.SqlBackupRunStatus.forNumber(status_); + return result == null ? com.google.cloud.sql.v1.SqlBackupRunStatus.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The status of this run.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupRunStatus status = 2; + * + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(com.google.cloud.sql.v1.SqlBackupRunStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + status_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The status of this run.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupRunStatus status = 2; + * + * @return This builder for chaining. + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000002); + status_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp enqueuedTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + enqueuedTimeBuilder_; + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + * + * @return Whether the enqueuedTime field is set. + */ + public boolean hasEnqueuedTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + * + * @return The enqueuedTime. + */ + public com.google.protobuf.Timestamp getEnqueuedTime() { + if (enqueuedTimeBuilder_ == null) { + return enqueuedTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : enqueuedTime_; + } else { + return enqueuedTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + public Builder setEnqueuedTime(com.google.protobuf.Timestamp value) { + if (enqueuedTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enqueuedTime_ = value; + } else { + enqueuedTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + public Builder setEnqueuedTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (enqueuedTimeBuilder_ == null) { + enqueuedTime_ = builderForValue.build(); + } else { + enqueuedTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + public Builder mergeEnqueuedTime(com.google.protobuf.Timestamp value) { + if (enqueuedTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && enqueuedTime_ != null + && enqueuedTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEnqueuedTimeBuilder().mergeFrom(value); + } else { + enqueuedTime_ = value; + } + } else { + enqueuedTimeBuilder_.mergeFrom(value); + } + if (enqueuedTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + public Builder clearEnqueuedTime() { + bitField0_ = (bitField0_ & ~0x00000004); + enqueuedTime_ = null; + if (enqueuedTimeBuilder_ != null) { + enqueuedTimeBuilder_.dispose(); + enqueuedTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEnqueuedTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEnqueuedTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEnqueuedTimeOrBuilder() { + if (enqueuedTimeBuilder_ != null) { + return enqueuedTimeBuilder_.getMessageOrBuilder(); + } else { + return enqueuedTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : enqueuedTime_; + } + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEnqueuedTimeFieldBuilder() { + if (enqueuedTimeBuilder_ == null) { + enqueuedTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEnqueuedTime(), getParentForChildren(), isClean()); + enqueuedTime_ = null; + } + return enqueuedTimeBuilder_; + } + + private long id_; + + /** + * + * + *
+     * The identifier for this backup run. Unique only for a specific Cloud SQL
+     * instance.
+     * 
+ * + * int64 id = 4; + * + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + /** + * + * + *
+     * The identifier for this backup run. Unique only for a specific Cloud SQL
+     * instance.
+     * 
+ * + * int64 id = 4; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The identifier for this backup run. Unique only for a specific Cloud SQL
+     * instance.
+     * 
+ * + * int64 id = 4; + * + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000008); + id_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000010); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + * + * @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(); + } + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000020); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private com.google.cloud.sql.v1.OperationError error_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.OperationError, + com.google.cloud.sql.v1.OperationError.Builder, + com.google.cloud.sql.v1.OperationErrorOrBuilder> + errorBuilder_; + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + * + * @return The error. + */ + public com.google.cloud.sql.v1.OperationError getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.cloud.sql.v1.OperationError.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + */ + public Builder setError(com.google.cloud.sql.v1.OperationError value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + */ + public Builder setError(com.google.cloud.sql.v1.OperationError.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + */ + public Builder mergeError(com.google.cloud.sql.v1.OperationError value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && error_ != null + && error_ != com.google.cloud.sql.v1.OperationError.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000040); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + */ + public com.google.cloud.sql.v1.OperationError.Builder getErrorBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + */ + public com.google.cloud.sql.v1.OperationErrorOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.cloud.sql.v1.OperationError.getDefaultInstance() + : error_; + } + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.OperationError, + com.google.cloud.sql.v1.OperationError.Builder, + com.google.cloud.sql.v1.OperationErrorOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.OperationError, + com.google.cloud.sql.v1.OperationError.Builder, + com.google.cloud.sql.v1.OperationErrorOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + private int type_ = 0; + + /** + * + * + *
+     * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+     * This field defaults to "ON_DEMAND" and is ignored, when specified for
+     * insert requests.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupRunType type = 8; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+     * This field defaults to "ON_DEMAND" and is ignored, when specified for
+     * insert requests.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupRunType type = 8; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+     * This field defaults to "ON_DEMAND" and is ignored, when specified for
+     * insert requests.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupRunType type = 8; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunType getType() { + com.google.cloud.sql.v1.SqlBackupRunType result = + com.google.cloud.sql.v1.SqlBackupRunType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1.SqlBackupRunType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+     * This field defaults to "ON_DEMAND" and is ignored, when specified for
+     * insert requests.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupRunType type = 8; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.sql.v1.SqlBackupRunType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+     * This field defaults to "ON_DEMAND" and is ignored, when specified for
+     * insert requests.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupRunType type = 8; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000080); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * The description of this run, only applicable to on-demand backups.
+     * 
+ * + * string description = 9; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The description of this run, only applicable to on-demand backups.
+     * 
+ * + * string description = 9; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The description of this run, only applicable to on-demand backups.
+     * 
+ * + * string description = 9; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The description of this run, only applicable to on-demand backups.
+     * 
+ * + * string description = 9; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
+     * The description of this run, only applicable to on-demand backups.
+     * 
+ * + * string description = 9; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp windowStartTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + windowStartTimeBuilder_; + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + * + * @return Whether the windowStartTime field is set. + */ + public boolean hasWindowStartTime() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + * + * @return The windowStartTime. + */ + public com.google.protobuf.Timestamp getWindowStartTime() { + if (windowStartTimeBuilder_ == null) { + return windowStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : windowStartTime_; + } else { + return windowStartTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + public Builder setWindowStartTime(com.google.protobuf.Timestamp value) { + if (windowStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + windowStartTime_ = value; + } else { + windowStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + public Builder setWindowStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (windowStartTimeBuilder_ == null) { + windowStartTime_ = builderForValue.build(); + } else { + windowStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + public Builder mergeWindowStartTime(com.google.protobuf.Timestamp value) { + if (windowStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && windowStartTime_ != null + && windowStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getWindowStartTimeBuilder().mergeFrom(value); + } else { + windowStartTime_ = value; + } + } else { + windowStartTimeBuilder_.mergeFrom(value); + } + if (windowStartTime_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + public Builder clearWindowStartTime() { + bitField0_ = (bitField0_ & ~0x00000200); + windowStartTime_ = null; + if (windowStartTimeBuilder_ != null) { + windowStartTimeBuilder_.dispose(); + windowStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + public com.google.protobuf.Timestamp.Builder getWindowStartTimeBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetWindowStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getWindowStartTimeOrBuilder() { + if (windowStartTimeBuilder_ != null) { + return windowStartTimeBuilder_.getMessageOrBuilder(); + } else { + return windowStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : windowStartTime_; + } + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetWindowStartTimeFieldBuilder() { + if (windowStartTimeBuilder_ == null) { + windowStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getWindowStartTime(), getParentForChildren(), isClean()); + windowStartTime_ = null; + } + return windowStartTimeBuilder_; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 11; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 11; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 11; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 11; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 11; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object selfLink_ = ""; + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 12; + * + * @return The selfLink. + */ + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 12; + * + * @return The bytes for selfLink. + */ + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 12; + * + * @param value The selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selfLink_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 12; + * + * @return This builder for chaining. + */ + public Builder clearSelfLink() { + selfLink_ = getDefaultInstance().getSelfLink(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 12; + * + * @param value The bytes for selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selfLink_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private java.lang.Object location_ = ""; + + /** + * + * + *
+     * Location of the backups.
+     * 
+ * + * string location = 13; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Location of the backups.
+     * 
+ * + * string location = 13; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Location of the backups.
+     * 
+ * + * string location = 13; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Location of the backups.
+     * 
+ * + * string location = 13; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Location of the backups.
+     * 
+ * + * string location = 13; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private int databaseVersion_ = 0; + + /** + * + * + *
+     * Output only. The instance database version at the time this backup was
+     * made.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+     * Output only. The instance database version at the time this backup was
+     * made.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersionValue(int value) { + databaseVersion_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The instance database version at the time this backup was
+     * made.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1.SqlDatabaseVersion result = + com.google.cloud.sql.v1.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The instance database version at the time this backup was
+     * made.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersion(com.google.cloud.sql.v1.SqlDatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00002000; + databaseVersion_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The instance database version at the time this backup was
+     * made.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDatabaseVersion() { + bitField0_ = (bitField0_ & ~0x00002000); + databaseVersion_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.DiskEncryptionConfiguration diskEncryptionConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DiskEncryptionConfiguration, + com.google.cloud.sql.v1.DiskEncryptionConfiguration.Builder, + com.google.cloud.sql.v1.DiskEncryptionConfigurationOrBuilder> + diskEncryptionConfigurationBuilder_; + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + * + * @return Whether the diskEncryptionConfiguration field is set. + */ + public boolean hasDiskEncryptionConfiguration() { + return ((bitField0_ & 0x00004000) != 0); + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + * + * @return The diskEncryptionConfiguration. + */ + public com.google.cloud.sql.v1.DiskEncryptionConfiguration getDiskEncryptionConfiguration() { + if (diskEncryptionConfigurationBuilder_ == null) { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } else { + return diskEncryptionConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + public Builder setDiskEncryptionConfiguration( + com.google.cloud.sql.v1.DiskEncryptionConfiguration value) { + if (diskEncryptionConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + diskEncryptionConfiguration_ = value; + } else { + diskEncryptionConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + public Builder setDiskEncryptionConfiguration( + com.google.cloud.sql.v1.DiskEncryptionConfiguration.Builder builderForValue) { + if (diskEncryptionConfigurationBuilder_ == null) { + diskEncryptionConfiguration_ = builderForValue.build(); + } else { + diskEncryptionConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + public Builder mergeDiskEncryptionConfiguration( + com.google.cloud.sql.v1.DiskEncryptionConfiguration value) { + if (diskEncryptionConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0) + && diskEncryptionConfiguration_ != null + && diskEncryptionConfiguration_ + != com.google.cloud.sql.v1.DiskEncryptionConfiguration.getDefaultInstance()) { + getDiskEncryptionConfigurationBuilder().mergeFrom(value); + } else { + diskEncryptionConfiguration_ = value; + } + } else { + diskEncryptionConfigurationBuilder_.mergeFrom(value); + } + if (diskEncryptionConfiguration_ != null) { + bitField0_ |= 0x00004000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + public Builder clearDiskEncryptionConfiguration() { + bitField0_ = (bitField0_ & ~0x00004000); + diskEncryptionConfiguration_ = null; + if (diskEncryptionConfigurationBuilder_ != null) { + diskEncryptionConfigurationBuilder_.dispose(); + diskEncryptionConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + public com.google.cloud.sql.v1.DiskEncryptionConfiguration.Builder + getDiskEncryptionConfigurationBuilder() { + bitField0_ |= 0x00004000; + onChanged(); + return internalGetDiskEncryptionConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + public com.google.cloud.sql.v1.DiskEncryptionConfigurationOrBuilder + getDiskEncryptionConfigurationOrBuilder() { + if (diskEncryptionConfigurationBuilder_ != null) { + return diskEncryptionConfigurationBuilder_.getMessageOrBuilder(); + } else { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DiskEncryptionConfiguration, + com.google.cloud.sql.v1.DiskEncryptionConfiguration.Builder, + com.google.cloud.sql.v1.DiskEncryptionConfigurationOrBuilder> + internalGetDiskEncryptionConfigurationFieldBuilder() { + if (diskEncryptionConfigurationBuilder_ == null) { + diskEncryptionConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DiskEncryptionConfiguration, + com.google.cloud.sql.v1.DiskEncryptionConfiguration.Builder, + com.google.cloud.sql.v1.DiskEncryptionConfigurationOrBuilder>( + getDiskEncryptionConfiguration(), getParentForChildren(), isClean()); + diskEncryptionConfiguration_ = null; + } + return diskEncryptionConfigurationBuilder_; + } + + private com.google.cloud.sql.v1.DiskEncryptionStatus diskEncryptionStatus_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DiskEncryptionStatus, + com.google.cloud.sql.v1.DiskEncryptionStatus.Builder, + com.google.cloud.sql.v1.DiskEncryptionStatusOrBuilder> + diskEncryptionStatusBuilder_; + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + * + * @return Whether the diskEncryptionStatus field is set. + */ + public boolean hasDiskEncryptionStatus() { + return ((bitField0_ & 0x00008000) != 0); + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + * + * @return The diskEncryptionStatus. + */ + public com.google.cloud.sql.v1.DiskEncryptionStatus getDiskEncryptionStatus() { + if (diskEncryptionStatusBuilder_ == null) { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } else { + return diskEncryptionStatusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + */ + public Builder setDiskEncryptionStatus(com.google.cloud.sql.v1.DiskEncryptionStatus value) { + if (diskEncryptionStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + diskEncryptionStatus_ = value; + } else { + diskEncryptionStatusBuilder_.setMessage(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + */ + public Builder setDiskEncryptionStatus( + com.google.cloud.sql.v1.DiskEncryptionStatus.Builder builderForValue) { + if (diskEncryptionStatusBuilder_ == null) { + diskEncryptionStatus_ = builderForValue.build(); + } else { + diskEncryptionStatusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + */ + public Builder mergeDiskEncryptionStatus(com.google.cloud.sql.v1.DiskEncryptionStatus value) { + if (diskEncryptionStatusBuilder_ == null) { + if (((bitField0_ & 0x00008000) != 0) + && diskEncryptionStatus_ != null + && diskEncryptionStatus_ + != com.google.cloud.sql.v1.DiskEncryptionStatus.getDefaultInstance()) { + getDiskEncryptionStatusBuilder().mergeFrom(value); + } else { + diskEncryptionStatus_ = value; + } + } else { + diskEncryptionStatusBuilder_.mergeFrom(value); + } + if (diskEncryptionStatus_ != null) { + bitField0_ |= 0x00008000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + */ + public Builder clearDiskEncryptionStatus() { + bitField0_ = (bitField0_ & ~0x00008000); + diskEncryptionStatus_ = null; + if (diskEncryptionStatusBuilder_ != null) { + diskEncryptionStatusBuilder_.dispose(); + diskEncryptionStatusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + */ + public com.google.cloud.sql.v1.DiskEncryptionStatus.Builder getDiskEncryptionStatusBuilder() { + bitField0_ |= 0x00008000; + onChanged(); + return internalGetDiskEncryptionStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + */ + public com.google.cloud.sql.v1.DiskEncryptionStatusOrBuilder + getDiskEncryptionStatusOrBuilder() { + if (diskEncryptionStatusBuilder_ != null) { + return diskEncryptionStatusBuilder_.getMessageOrBuilder(); + } else { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DiskEncryptionStatus, + com.google.cloud.sql.v1.DiskEncryptionStatus.Builder, + com.google.cloud.sql.v1.DiskEncryptionStatusOrBuilder> + internalGetDiskEncryptionStatusFieldBuilder() { + if (diskEncryptionStatusBuilder_ == null) { + diskEncryptionStatusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DiskEncryptionStatus, + com.google.cloud.sql.v1.DiskEncryptionStatus.Builder, + com.google.cloud.sql.v1.DiskEncryptionStatusOrBuilder>( + getDiskEncryptionStatus(), getParentForChildren(), isClean()); + diskEncryptionStatus_ = null; + } + return diskEncryptionStatusBuilder_; + } + + private int backupKind_ = 0; + + /** + * + * + *
+     * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 19; + * + * @return The enum numeric value on the wire for backupKind. + */ + @java.lang.Override + public int getBackupKindValue() { + return backupKind_; + } + + /** + * + * + *
+     * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 19; + * + * @param value The enum numeric value on the wire for backupKind to set. + * @return This builder for chaining. + */ + public Builder setBackupKindValue(int value) { + backupKind_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 19; + * + * @return The backupKind. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupKind getBackupKind() { + com.google.cloud.sql.v1.SqlBackupKind result = + com.google.cloud.sql.v1.SqlBackupKind.forNumber(backupKind_); + return result == null ? com.google.cloud.sql.v1.SqlBackupKind.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 19; + * + * @param value The backupKind to set. + * @return This builder for chaining. + */ + public Builder setBackupKind(com.google.cloud.sql.v1.SqlBackupKind value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00010000; + backupKind_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 19; + * + * @return This builder for chaining. + */ + public Builder clearBackupKind() { + bitField0_ = (bitField0_ & ~0x00010000); + backupKind_ = 0; + onChanged(); + return this; + } + + private java.lang.Object timeZone_ = ""; + + /** + * + * + *
+     * Backup time zone to prevent restores to an instance with
+     * a different time zone. Now relevant only for SQL Server.
+     * 
+ * + * string time_zone = 23; + * + * @return The timeZone. + */ + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Backup time zone to prevent restores to an instance with
+     * a different time zone. Now relevant only for SQL Server.
+     * 
+ * + * string time_zone = 23; + * + * @return The bytes for timeZone. + */ + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Backup time zone to prevent restores to an instance with
+     * a different time zone. Now relevant only for SQL Server.
+     * 
+ * + * string time_zone = 23; + * + * @param value The timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + timeZone_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Backup time zone to prevent restores to an instance with
+     * a different time zone. Now relevant only for SQL Server.
+     * 
+ * + * string time_zone = 23; + * + * @return This builder for chaining. + */ + public Builder clearTimeZone() { + timeZone_ = getDefaultInstance().getTimeZone(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Backup time zone to prevent restores to an instance with
+     * a different time zone. Now relevant only for SQL Server.
+     * 
+ * + * string time_zone = 23; + * + * @param value The bytes for timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + timeZone_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + private long maxChargeableBytes_; + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maxChargeableBytes field is set. + */ + @java.lang.Override + public boolean hasMaxChargeableBytes() { + return ((bitField0_ & 0x00040000) != 0); + } + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maxChargeableBytes. + */ + @java.lang.Override + public long getMaxChargeableBytes() { + return maxChargeableBytes_; + } + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The maxChargeableBytes to set. + * @return This builder for chaining. + */ + public Builder setMaxChargeableBytes(long value) { + + maxChargeableBytes_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearMaxChargeableBytes() { + bitField0_ = (bitField0_ & ~0x00040000); + maxChargeableBytes_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.BackupRun) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.BackupRun) + private static final com.google.cloud.sql.v1.BackupRun DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.BackupRun(); + } + + public static com.google.cloud.sql.v1.BackupRun getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupRun parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupRun getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRunOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRunOrBuilder.java new file mode 100644 index 000000000000..3d8438f8398a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRunOrBuilder.java @@ -0,0 +1,632 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface BackupRunOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.BackupRun) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#backupRun`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#backupRun`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The status of this run.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackupRunStatus status = 2; + * + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + + /** + * + * + *
+   * The status of this run.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackupRunStatus status = 2; + * + * @return The status. + */ + com.google.cloud.sql.v1.SqlBackupRunStatus getStatus(); + + /** + * + * + *
+   * The time the run was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + * + * @return Whether the enqueuedTime field is set. + */ + boolean hasEnqueuedTime(); + + /** + * + * + *
+   * The time the run was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + * + * @return The enqueuedTime. + */ + com.google.protobuf.Timestamp getEnqueuedTime(); + + /** + * + * + *
+   * The time the run was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEnqueuedTimeOrBuilder(); + + /** + * + * + *
+   * The identifier for this backup run. Unique only for a specific Cloud SQL
+   * instance.
+   * 
+ * + * int64 id = 4; + * + * @return The id. + */ + long getId(); + + /** + * + * + *
+   * The time the backup operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The time the backup operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The time the backup operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The time the backup operation completed in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * The time the backup operation completed in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * The time the backup operation completed in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Information about why the backup operation failed. This is only present if
+   * the run has the FAILED status.
+   * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
+   * Information about why the backup operation failed. This is only present if
+   * the run has the FAILED status.
+   * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + * + * @return The error. + */ + com.google.cloud.sql.v1.OperationError getError(); + + /** + * + * + *
+   * Information about why the backup operation failed. This is only present if
+   * the run has the FAILED status.
+   * 
+ * + * .google.cloud.sql.v1.OperationError error = 7; + */ + com.google.cloud.sql.v1.OperationErrorOrBuilder getErrorOrBuilder(); + + /** + * + * + *
+   * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+   * This field defaults to "ON_DEMAND" and is ignored, when specified for
+   * insert requests.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackupRunType type = 8; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+   * This field defaults to "ON_DEMAND" and is ignored, when specified for
+   * insert requests.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackupRunType type = 8; + * + * @return The type. + */ + com.google.cloud.sql.v1.SqlBackupRunType getType(); + + /** + * + * + *
+   * The description of this run, only applicable to on-demand backups.
+   * 
+ * + * string description = 9; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * The description of this run, only applicable to on-demand backups.
+   * 
+ * + * string description = 9; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * The start time of the backup window during which this the backup was
+   * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+   * example `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + * + * @return Whether the windowStartTime field is set. + */ + boolean hasWindowStartTime(); + + /** + * + * + *
+   * The start time of the backup window during which this the backup was
+   * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+   * example `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + * + * @return The windowStartTime. + */ + com.google.protobuf.Timestamp getWindowStartTime(); + + /** + * + * + *
+   * The start time of the backup window during which this the backup was
+   * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+   * example `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + com.google.protobuf.TimestampOrBuilder getWindowStartTimeOrBuilder(); + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 11; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 11; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 12; + * + * @return The selfLink. + */ + java.lang.String getSelfLink(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 12; + * + * @return The bytes for selfLink. + */ + com.google.protobuf.ByteString getSelfLinkBytes(); + + /** + * + * + *
+   * Location of the backups.
+   * 
+ * + * string location = 13; + * + * @return The location. + */ + java.lang.String getLocation(); + + /** + * + * + *
+   * Location of the backups.
+   * 
+ * + * string location = 13; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Output only. The instance database version at the time this backup was
+   * made.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + int getDatabaseVersionValue(); + + /** + * + * + *
+   * Output only. The instance database version at the time this backup was
+   * made.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + com.google.cloud.sql.v1.SqlDatabaseVersion getDatabaseVersion(); + + /** + * + * + *
+   * Encryption configuration specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + * + * @return Whether the diskEncryptionConfiguration field is set. + */ + boolean hasDiskEncryptionConfiguration(); + + /** + * + * + *
+   * Encryption configuration specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + * + * @return The diskEncryptionConfiguration. + */ + com.google.cloud.sql.v1.DiskEncryptionConfiguration getDiskEncryptionConfiguration(); + + /** + * + * + *
+   * Encryption configuration specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + com.google.cloud.sql.v1.DiskEncryptionConfigurationOrBuilder + getDiskEncryptionConfigurationOrBuilder(); + + /** + * + * + *
+   * Encryption status specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + * + * @return Whether the diskEncryptionStatus field is set. + */ + boolean hasDiskEncryptionStatus(); + + /** + * + * + *
+   * Encryption status specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + * + * @return The diskEncryptionStatus. + */ + com.google.cloud.sql.v1.DiskEncryptionStatus getDiskEncryptionStatus(); + + /** + * + * + *
+   * Encryption status specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 17; + */ + com.google.cloud.sql.v1.DiskEncryptionStatusOrBuilder getDiskEncryptionStatusOrBuilder(); + + /** + * + * + *
+   * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 19; + * + * @return The enum numeric value on the wire for backupKind. + */ + int getBackupKindValue(); + + /** + * + * + *
+   * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackupKind backup_kind = 19; + * + * @return The backupKind. + */ + com.google.cloud.sql.v1.SqlBackupKind getBackupKind(); + + /** + * + * + *
+   * Backup time zone to prevent restores to an instance with
+   * a different time zone. Now relevant only for SQL Server.
+   * 
+ * + * string time_zone = 23; + * + * @return The timeZone. + */ + java.lang.String getTimeZone(); + + /** + * + * + *
+   * Backup time zone to prevent restores to an instance with
+   * a different time zone. Now relevant only for SQL Server.
+   * 
+ * + * string time_zone = 23; + * + * @return The bytes for timeZone. + */ + com.google.protobuf.ByteString getTimeZoneBytes(); + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maxChargeableBytes field is set. + */ + boolean hasMaxChargeableBytes(); + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maxChargeableBytes. + */ + long getMaxChargeableBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRunsListResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRunsListResponse.java new file mode 100644 index 000000000000..017d3dd1cc8e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRunsListResponse.java @@ -0,0 +1,1302 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Backup run list results.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.BackupRunsListResponse} + */ +@com.google.protobuf.Generated +public final class BackupRunsListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.BackupRunsListResponse) + BackupRunsListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupRunsListResponse"); + } + + // Use BackupRunsListResponse.newBuilder() to construct. + private BackupRunsListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackupRunsListResponse() { + kind_ = ""; + items_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_BackupRunsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_BackupRunsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.BackupRunsListResponse.class, + com.google.cloud.sql.v1.BackupRunsListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#backupRunsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#backupRunsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupRun getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupRunOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.BackupRunsListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.BackupRunsListResponse other = + (com.google.cloud.sql.v1.BackupRunsListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.BackupRunsListResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupRunsListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRunsListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupRunsListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRunsListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BackupRunsListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRunsListResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupRunsListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRunsListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupRunsListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BackupRunsListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BackupRunsListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.BackupRunsListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Backup run list results.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.BackupRunsListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.BackupRunsListResponse) + com.google.cloud.sql.v1.BackupRunsListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_BackupRunsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_BackupRunsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.BackupRunsListResponse.class, + com.google.cloud.sql.v1.BackupRunsListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.BackupRunsListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_BackupRunsListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupRunsListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1.BackupRunsListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupRunsListResponse build() { + com.google.cloud.sql.v1.BackupRunsListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupRunsListResponse buildPartial() { + com.google.cloud.sql.v1.BackupRunsListResponse result = + new com.google.cloud.sql.v1.BackupRunsListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.BackupRunsListResponse result) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.BackupRunsListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.BackupRunsListResponse) { + return mergeFrom((com.google.cloud.sql.v1.BackupRunsListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.BackupRunsListResponse other) { + if (other == com.google.cloud.sql.v1.BackupRunsListResponse.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1.BackupRun m = + input.readMessage( + com.google.cloud.sql.v1.BackupRun.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#backupRunsList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupRunsList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupRunsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupRunsList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupRunsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.BackupRun, + com.google.cloud.sql.v1.BackupRun.Builder, + com.google.cloud.sql.v1.BackupRunOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public com.google.cloud.sql.v1.BackupRun getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.BackupRun value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.BackupRun.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1.BackupRun value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.BackupRun value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1.BackupRun.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.BackupRun.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public com.google.cloud.sql.v1.BackupRun.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public com.google.cloud.sql.v1.BackupRunOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public com.google.cloud.sql.v1.BackupRun.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.BackupRun.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public com.google.cloud.sql.v1.BackupRun.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.BackupRun.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.BackupRun, + com.google.cloud.sql.v1.BackupRun.Builder, + com.google.cloud.sql.v1.BackupRunOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.BackupRun, + com.google.cloud.sql.v1.BackupRun.Builder, + com.google.cloud.sql.v1.BackupRunOrBuilder>( + items_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.BackupRunsListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.BackupRunsListResponse) + private static final com.google.cloud.sql.v1.BackupRunsListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.BackupRunsListResponse(); + } + + public static com.google.cloud.sql.v1.BackupRunsListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupRunsListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BackupRunsListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRunsListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRunsListResponseOrBuilder.java new file mode 100644 index 000000000000..c46bb60a3fee --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BackupRunsListResponseOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface BackupRunsListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.BackupRunsListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#backupRunsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#backupRunsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + com.google.cloud.sql.v1.BackupRun getItems(int index); + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + int getItemsCount(); + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + java.util.List getItemsOrBuilderList(); + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1.BackupRun items = 2; + */ + com.google.cloud.sql.v1.BackupRunOrBuilder getItemsOrBuilder(int index); + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BakType.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BakType.java new file mode 100644 index 000000000000..57ba64181b25 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BakType.java @@ -0,0 +1,206 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf enum {@code google.cloud.sql.v1.BakType} */ +@com.google.protobuf.Generated +public enum BakType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Default type.
+   * 
+ * + * BAK_TYPE_UNSPECIFIED = 0; + */ + BAK_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Full backup.
+   * 
+ * + * FULL = 1; + */ + FULL(1), + /** + * + * + *
+   * Differential backup.
+   * 
+ * + * DIFF = 2; + */ + DIFF(2), + /** + * + * + *
+   * Transaction Log backup
+   * 
+ * + * TLOG = 3; + */ + TLOG(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BakType"); + } + + /** + * + * + *
+   * Default type.
+   * 
+ * + * BAK_TYPE_UNSPECIFIED = 0; + */ + public static final int BAK_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Full backup.
+   * 
+ * + * FULL = 1; + */ + public static final int FULL_VALUE = 1; + + /** + * + * + *
+   * Differential backup.
+   * 
+ * + * DIFF = 2; + */ + public static final int DIFF_VALUE = 2; + + /** + * + * + *
+   * Transaction Log backup
+   * 
+ * + * TLOG = 3; + */ + public static final int TLOG_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 BakType 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 BakType forNumber(int value) { + switch (value) { + case 0: + return BAK_TYPE_UNSPECIFIED; + case 1: + return FULL; + case 2: + return DIFF; + case 3: + return TLOG; + 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 BakType findValueByNumber(int number) { + return BakType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor().getEnumTypes().get(1); + } + + private static final BakType[] VALUES = values(); + + public static BakType 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 BakType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.BakType) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BinLogCoordinates.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BinLogCoordinates.java new file mode 100644 index 000000000000..93b3a9dc3268 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BinLogCoordinates.java @@ -0,0 +1,881 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Binary log coordinates.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.BinLogCoordinates} + */ +@com.google.protobuf.Generated +public final class BinLogCoordinates extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.BinLogCoordinates) + BinLogCoordinatesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BinLogCoordinates"); + } + + // Use BinLogCoordinates.newBuilder() to construct. + private BinLogCoordinates(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BinLogCoordinates() { + binLogFileName_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_BinLogCoordinates_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_BinLogCoordinates_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.BinLogCoordinates.class, + com.google.cloud.sql.v1.BinLogCoordinates.Builder.class); + } + + public static final int BIN_LOG_FILE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object binLogFileName_ = ""; + + /** + * + * + *
+   * Name of the binary log file for a Cloud SQL instance.
+   * 
+ * + * string bin_log_file_name = 1; + * + * @return The binLogFileName. + */ + @java.lang.Override + public java.lang.String getBinLogFileName() { + java.lang.Object ref = binLogFileName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + binLogFileName_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the binary log file for a Cloud SQL instance.
+   * 
+ * + * string bin_log_file_name = 1; + * + * @return The bytes for binLogFileName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBinLogFileNameBytes() { + java.lang.Object ref = binLogFileName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + binLogFileName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BIN_LOG_POSITION_FIELD_NUMBER = 2; + private long binLogPosition_ = 0L; + + /** + * + * + *
+   * Position (offset) within the binary log file.
+   * 
+ * + * int64 bin_log_position = 2; + * + * @return The binLogPosition. + */ + @java.lang.Override + public long getBinLogPosition() { + return binLogPosition_; + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#binLogCoordinates`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#binLogCoordinates`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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.GeneratedMessage.isStringEmpty(binLogFileName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, binLogFileName_); + } + if (binLogPosition_ != 0L) { + output.writeInt64(2, binLogPosition_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(binLogFileName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, binLogFileName_); + } + if (binLogPosition_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, binLogPosition_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.BinLogCoordinates)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.BinLogCoordinates other = + (com.google.cloud.sql.v1.BinLogCoordinates) obj; + + if (!getBinLogFileName().equals(other.getBinLogFileName())) return false; + if (getBinLogPosition() != other.getBinLogPosition()) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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) + BIN_LOG_FILE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getBinLogFileName().hashCode(); + hash = (37 * hash) + BIN_LOG_POSITION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getBinLogPosition()); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.BinLogCoordinates parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BinLogCoordinates parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BinLogCoordinates parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BinLogCoordinates parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BinLogCoordinates parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.BinLogCoordinates parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BinLogCoordinates parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BinLogCoordinates parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BinLogCoordinates parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BinLogCoordinates parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.BinLogCoordinates parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.BinLogCoordinates parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.BinLogCoordinates prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Binary log coordinates.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.BinLogCoordinates} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.BinLogCoordinates) + com.google.cloud.sql.v1.BinLogCoordinatesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_BinLogCoordinates_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_BinLogCoordinates_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.BinLogCoordinates.class, + com.google.cloud.sql.v1.BinLogCoordinates.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.BinLogCoordinates.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + binLogFileName_ = ""; + binLogPosition_ = 0L; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_BinLogCoordinates_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BinLogCoordinates getDefaultInstanceForType() { + return com.google.cloud.sql.v1.BinLogCoordinates.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.BinLogCoordinates build() { + com.google.cloud.sql.v1.BinLogCoordinates result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BinLogCoordinates buildPartial() { + com.google.cloud.sql.v1.BinLogCoordinates result = + new com.google.cloud.sql.v1.BinLogCoordinates(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.BinLogCoordinates result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.binLogFileName_ = binLogFileName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.binLogPosition_ = binLogPosition_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.BinLogCoordinates) { + return mergeFrom((com.google.cloud.sql.v1.BinLogCoordinates) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.BinLogCoordinates other) { + if (other == com.google.cloud.sql.v1.BinLogCoordinates.getDefaultInstance()) return this; + if (!other.getBinLogFileName().isEmpty()) { + binLogFileName_ = other.binLogFileName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getBinLogPosition() != 0L) { + setBinLogPosition(other.getBinLogPosition()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + binLogFileName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + binLogPosition_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object binLogFileName_ = ""; + + /** + * + * + *
+     * Name of the binary log file for a Cloud SQL instance.
+     * 
+ * + * string bin_log_file_name = 1; + * + * @return The binLogFileName. + */ + public java.lang.String getBinLogFileName() { + java.lang.Object ref = binLogFileName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + binLogFileName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the binary log file for a Cloud SQL instance.
+     * 
+ * + * string bin_log_file_name = 1; + * + * @return The bytes for binLogFileName. + */ + public com.google.protobuf.ByteString getBinLogFileNameBytes() { + java.lang.Object ref = binLogFileName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + binLogFileName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the binary log file for a Cloud SQL instance.
+     * 
+ * + * string bin_log_file_name = 1; + * + * @param value The binLogFileName to set. + * @return This builder for chaining. + */ + public Builder setBinLogFileName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + binLogFileName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the binary log file for a Cloud SQL instance.
+     * 
+ * + * string bin_log_file_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearBinLogFileName() { + binLogFileName_ = getDefaultInstance().getBinLogFileName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the binary log file for a Cloud SQL instance.
+     * 
+ * + * string bin_log_file_name = 1; + * + * @param value The bytes for binLogFileName to set. + * @return This builder for chaining. + */ + public Builder setBinLogFileNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + binLogFileName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long binLogPosition_; + + /** + * + * + *
+     * Position (offset) within the binary log file.
+     * 
+ * + * int64 bin_log_position = 2; + * + * @return The binLogPosition. + */ + @java.lang.Override + public long getBinLogPosition() { + return binLogPosition_; + } + + /** + * + * + *
+     * Position (offset) within the binary log file.
+     * 
+ * + * int64 bin_log_position = 2; + * + * @param value The binLogPosition to set. + * @return This builder for chaining. + */ + public Builder setBinLogPosition(long value) { + + binLogPosition_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Position (offset) within the binary log file.
+     * 
+ * + * int64 bin_log_position = 2; + * + * @return This builder for chaining. + */ + public Builder clearBinLogPosition() { + bitField0_ = (bitField0_ & ~0x00000002); + binLogPosition_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#binLogCoordinates`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#binLogCoordinates`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#binLogCoordinates`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#binLogCoordinates`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#binLogCoordinates`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.BinLogCoordinates) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.BinLogCoordinates) + private static final com.google.cloud.sql.v1.BinLogCoordinates DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.BinLogCoordinates(); + } + + public static com.google.cloud.sql.v1.BinLogCoordinates getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BinLogCoordinates parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.BinLogCoordinates getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BinLogCoordinatesOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BinLogCoordinatesOrBuilder.java new file mode 100644 index 000000000000..6dd9ae2a7d7c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/BinLogCoordinatesOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface BinLogCoordinatesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.BinLogCoordinates) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the binary log file for a Cloud SQL instance.
+   * 
+ * + * string bin_log_file_name = 1; + * + * @return The binLogFileName. + */ + java.lang.String getBinLogFileName(); + + /** + * + * + *
+   * Name of the binary log file for a Cloud SQL instance.
+   * 
+ * + * string bin_log_file_name = 1; + * + * @return The bytes for binLogFileName. + */ + com.google.protobuf.ByteString getBinLogFileNameBytes(); + + /** + * + * + *
+   * Position (offset) within the binary log file.
+   * 
+ * + * int64 bin_log_position = 2; + * + * @return The binLogPosition. + */ + long getBinLogPosition(); + + /** + * + * + *
+   * This is always `sql#binLogCoordinates`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#binLogCoordinates`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloneContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloneContext.java new file mode 100644 index 000000000000..c916dc0ce0ff --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloneContext.java @@ -0,0 +1,3369 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance clone context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.CloneContext} + */ +@com.google.protobuf.Generated +public final class CloneContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.CloneContext) + CloneContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloneContext"); + } + + // Use CloneContext.newBuilder() to construct. + private CloneContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CloneContext() { + kind_ = ""; + destinationInstanceName_ = ""; + allocatedIpRange_ = ""; + databaseNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + preferredZone_ = ""; + preferredSecondaryZone_ = ""; + destinationProject_ = ""; + destinationNetwork_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_CloneContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_CloneContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.CloneContext.class, + com.google.cloud.sql.v1.CloneContext.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#cloneContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#cloneContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PITR_TIMESTAMP_MS_FIELD_NUMBER = 2; + private long pitrTimestampMs_ = 0L; + + /** + * + * + *
+   * Reserved for future use.
+   * 
+ * + * int64 pitr_timestamp_ms = 2; + * + * @return The pitrTimestampMs. + */ + @java.lang.Override + public long getPitrTimestampMs() { + return pitrTimestampMs_; + } + + public static final int DESTINATION_INSTANCE_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object destinationInstanceName_ = ""; + + /** + * + * + *
+   * Required. Name of the Cloud SQL instance to be created as a clone.
+   * 
+ * + * string destination_instance_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The destinationInstanceName. + */ + @java.lang.Override + public java.lang.String getDestinationInstanceName() { + java.lang.Object ref = destinationInstanceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationInstanceName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Name of the Cloud SQL instance to be created as a clone.
+   * 
+ * + * string destination_instance_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for destinationInstanceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationInstanceNameBytes() { + java.lang.Object ref = destinationInstanceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationInstanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BIN_LOG_COORDINATES_FIELD_NUMBER = 4; + private com.google.cloud.sql.v1.BinLogCoordinates binLogCoordinates_; + + /** + * + * + *
+   * Binary log coordinates, if specified, identify the position up to which the
+   * source instance is cloned. If not specified, the source instance is
+   * cloned up to the most recent binary log coordinates.
+   * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + * + * @return Whether the binLogCoordinates field is set. + */ + @java.lang.Override + public boolean hasBinLogCoordinates() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Binary log coordinates, if specified, identify the position up to which the
+   * source instance is cloned. If not specified, the source instance is
+   * cloned up to the most recent binary log coordinates.
+   * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + * + * @return The binLogCoordinates. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BinLogCoordinates getBinLogCoordinates() { + return binLogCoordinates_ == null + ? com.google.cloud.sql.v1.BinLogCoordinates.getDefaultInstance() + : binLogCoordinates_; + } + + /** + * + * + *
+   * Binary log coordinates, if specified, identify the position up to which the
+   * source instance is cloned. If not specified, the source instance is
+   * cloned up to the most recent binary log coordinates.
+   * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1.BinLogCoordinatesOrBuilder getBinLogCoordinatesOrBuilder() { + return binLogCoordinates_ == null + ? com.google.cloud.sql.v1.BinLogCoordinates.getDefaultInstance() + : binLogCoordinates_; + } + + public static final int POINT_IN_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp pointInTime_; + + /** + * + * + *
+   * Timestamp, if specified, identifies the time to which the source instance
+   * is cloned.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + * + * @return Whether the pointInTime field is set. + */ + @java.lang.Override + public boolean hasPointInTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Timestamp, if specified, identifies the time to which the source instance
+   * is cloned.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + * + * @return The pointInTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPointInTime() { + return pointInTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : pointInTime_; + } + + /** + * + * + *
+   * Timestamp, if specified, identifies the time to which the source instance
+   * is cloned.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder() { + return pointInTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : pointInTime_; + } + + public static final int ALLOCATED_IP_RANGE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object allocatedIpRange_ = ""; + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the cloned instance
+   * ip will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?.
+   * Reserved for future use.
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The allocatedIpRange. + */ + @java.lang.Override + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the cloned instance
+   * ip will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?.
+   * Reserved for future use.
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The bytes for allocatedIpRange. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_NAMES_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList databaseNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @return A list containing the databaseNames. + */ + public com.google.protobuf.ProtocolStringList getDatabaseNamesList() { + return databaseNames_; + } + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @return The count of databaseNames. + */ + public int getDatabaseNamesCount() { + return databaseNames_.size(); + } + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @param index The index of the element to return. + * @return The databaseNames at the given index. + */ + public java.lang.String getDatabaseNames(int index) { + return databaseNames_.get(index); + } + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @param index The index of the value to return. + * @return The bytes of the databaseNames at the given index. + */ + public com.google.protobuf.ByteString getDatabaseNamesBytes(int index) { + return databaseNames_.getByteString(index); + } + + public static final int PREFERRED_ZONE_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object preferredZone_ = ""; + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of an instance to the
+   * specified zone. If no zone is specified, clone to the same primary zone as
+   * the source instance. This field applies to all DB types.
+   * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the preferredZone field is set. + */ + @java.lang.Override + public boolean hasPreferredZone() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of an instance to the
+   * specified zone. If no zone is specified, clone to the same primary zone as
+   * the source instance. This field applies to all DB types.
+   * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The preferredZone. + */ + @java.lang.Override + public java.lang.String getPreferredZone() { + java.lang.Object ref = preferredZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredZone_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of an instance to the
+   * specified zone. If no zone is specified, clone to the same primary zone as
+   * the source instance. This field applies to all DB types.
+   * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for preferredZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPreferredZoneBytes() { + java.lang.Object ref = preferredZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PREFERRED_SECONDARY_ZONE_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object preferredSecondaryZone_ = ""; + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of a regional
+   * instance in the specified zones. If not specified, clone to the same
+   * secondary zone as the source instance. This value cannot be the same as the
+   * preferred_zone field. This field applies to all DB types.
+   * 
+ * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the preferredSecondaryZone field is set. + */ + @java.lang.Override + public boolean hasPreferredSecondaryZone() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of a regional
+   * instance in the specified zones. If not specified, clone to the same
+   * secondary zone as the source instance. This value cannot be the same as the
+   * preferred_zone field. This field applies to all DB types.
+   * 
+ * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The preferredSecondaryZone. + */ + @java.lang.Override + public java.lang.String getPreferredSecondaryZone() { + java.lang.Object ref = preferredSecondaryZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredSecondaryZone_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of a regional
+   * instance in the specified zones. If not specified, clone to the same
+   * secondary zone as the source instance. This value cannot be the same as the
+   * preferred_zone field. This field applies to all DB types.
+   * 
+ * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for preferredSecondaryZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPreferredSecondaryZoneBytes() { + java.lang.Object ref = preferredSecondaryZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredSecondaryZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_INSTANCE_DELETION_TIME_FIELD_NUMBER = 12; + private com.google.protobuf.Timestamp sourceInstanceDeletionTime_; + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + * + * @return Whether the sourceInstanceDeletionTime field is set. + */ + @java.lang.Override + public boolean hasSourceInstanceDeletionTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + * + * @return The sourceInstanceDeletionTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSourceInstanceDeletionTime() { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSourceInstanceDeletionTimeOrBuilder() { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } + + public static final int DESTINATION_PROJECT_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private volatile java.lang.Object destinationProject_ = ""; + + /** + * + * + *
+   * Optional. The project ID of the destination project where the cloned
+   * instance will be created. To perform a cross-project clone, this field is
+   * required. If not specified, the clone is created in the same project
+   * as the source instance.
+   * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the destinationProject field is set. + */ + @java.lang.Override + public boolean hasDestinationProject() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Optional. The project ID of the destination project where the cloned
+   * instance will be created. To perform a cross-project clone, this field is
+   * required. If not specified, the clone is created in the same project
+   * as the source instance.
+   * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The destinationProject. + */ + @java.lang.Override + public java.lang.String getDestinationProject() { + java.lang.Object ref = destinationProject_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationProject_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The project ID of the destination project where the cloned
+   * instance will be created. To perform a cross-project clone, this field is
+   * required. If not specified, the clone is created in the same project
+   * as the source instance.
+   * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for destinationProject. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationProjectBytes() { + java.lang.Object ref = destinationProject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATION_NETWORK_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object destinationNetwork_ = ""; + + /** + * + * + *
+   * Optional. The fully qualified URI of the VPC network to which the cloned
+   * instance will be connected via private services access for private IP. For
+   * example:`projects/my-network-project/global/networks/my-network`. This
+   * field is only required for cross-project cloning.
+   * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the destinationNetwork field is set. + */ + @java.lang.Override + public boolean hasDestinationNetwork() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Optional. The fully qualified URI of the VPC network to which the cloned
+   * instance will be connected via private services access for private IP. For
+   * example:`projects/my-network-project/global/networks/my-network`. This
+   * field is only required for cross-project cloning.
+   * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The destinationNetwork. + */ + @java.lang.Override + public java.lang.String getDestinationNetwork() { + java.lang.Object ref = destinationNetwork_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationNetwork_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The fully qualified URI of the VPC network to which the cloned
+   * instance will be connected via private services access for private IP. For
+   * example:`projects/my-network-project/global/networks/my-network`. This
+   * field is only required for cross-project cloning.
+   * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destinationNetwork. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationNetworkBytes() { + java.lang.Object ref = destinationNetwork_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationNetwork_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (pitrTimestampMs_ != 0L) { + output.writeInt64(2, pitrTimestampMs_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(destinationInstanceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, destinationInstanceName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getBinLogCoordinates()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getPointInTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatedIpRange_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, allocatedIpRange_); + } + for (int i = 0; i < databaseNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, databaseNames_.getRaw(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 10, preferredZone_); + } + if (((bitField0_ & 0x00000008) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, preferredSecondaryZone_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(12, getSourceInstanceDeletionTime()); + } + if (((bitField0_ & 0x00000020) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 13, destinationProject_); + } + if (((bitField0_ & 0x00000040) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 14, destinationNetwork_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (pitrTimestampMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, pitrTimestampMs_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(destinationInstanceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, destinationInstanceName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getBinLogCoordinates()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getPointInTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatedIpRange_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, allocatedIpRange_); + } + { + int dataSize = 0; + for (int i = 0; i < databaseNames_.size(); i++) { + dataSize += computeStringSizeNoTag(databaseNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getDatabaseNamesList().size(); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(10, preferredZone_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, preferredSecondaryZone_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 12, getSourceInstanceDeletionTime()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(13, destinationProject_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(14, destinationNetwork_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.CloneContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.CloneContext other = (com.google.cloud.sql.v1.CloneContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (getPitrTimestampMs() != other.getPitrTimestampMs()) return false; + if (!getDestinationInstanceName().equals(other.getDestinationInstanceName())) return false; + if (hasBinLogCoordinates() != other.hasBinLogCoordinates()) return false; + if (hasBinLogCoordinates()) { + if (!getBinLogCoordinates().equals(other.getBinLogCoordinates())) return false; + } + if (hasPointInTime() != other.hasPointInTime()) return false; + if (hasPointInTime()) { + if (!getPointInTime().equals(other.getPointInTime())) return false; + } + if (!getAllocatedIpRange().equals(other.getAllocatedIpRange())) return false; + if (!getDatabaseNamesList().equals(other.getDatabaseNamesList())) return false; + if (hasPreferredZone() != other.hasPreferredZone()) return false; + if (hasPreferredZone()) { + if (!getPreferredZone().equals(other.getPreferredZone())) return false; + } + if (hasPreferredSecondaryZone() != other.hasPreferredSecondaryZone()) return false; + if (hasPreferredSecondaryZone()) { + if (!getPreferredSecondaryZone().equals(other.getPreferredSecondaryZone())) return false; + } + if (hasSourceInstanceDeletionTime() != other.hasSourceInstanceDeletionTime()) return false; + if (hasSourceInstanceDeletionTime()) { + if (!getSourceInstanceDeletionTime().equals(other.getSourceInstanceDeletionTime())) + return false; + } + if (hasDestinationProject() != other.hasDestinationProject()) return false; + if (hasDestinationProject()) { + if (!getDestinationProject().equals(other.getDestinationProject())) return false; + } + if (hasDestinationNetwork() != other.hasDestinationNetwork()) return false; + if (hasDestinationNetwork()) { + if (!getDestinationNetwork().equals(other.getDestinationNetwork())) return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + PITR_TIMESTAMP_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPitrTimestampMs()); + hash = (37 * hash) + DESTINATION_INSTANCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDestinationInstanceName().hashCode(); + if (hasBinLogCoordinates()) { + hash = (37 * hash) + BIN_LOG_COORDINATES_FIELD_NUMBER; + hash = (53 * hash) + getBinLogCoordinates().hashCode(); + } + if (hasPointInTime()) { + hash = (37 * hash) + POINT_IN_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPointInTime().hashCode(); + } + hash = (37 * hash) + ALLOCATED_IP_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getAllocatedIpRange().hashCode(); + if (getDatabaseNamesCount() > 0) { + hash = (37 * hash) + DATABASE_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseNamesList().hashCode(); + } + if (hasPreferredZone()) { + hash = (37 * hash) + PREFERRED_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getPreferredZone().hashCode(); + } + if (hasPreferredSecondaryZone()) { + hash = (37 * hash) + PREFERRED_SECONDARY_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getPreferredSecondaryZone().hashCode(); + } + if (hasSourceInstanceDeletionTime()) { + hash = (37 * hash) + SOURCE_INSTANCE_DELETION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSourceInstanceDeletionTime().hashCode(); + } + if (hasDestinationProject()) { + hash = (37 * hash) + DESTINATION_PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getDestinationProject().hashCode(); + } + if (hasDestinationNetwork()) { + hash = (37 * hash) + DESTINATION_NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getDestinationNetwork().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.CloneContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.CloneContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.CloneContext parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.CloneContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.CloneContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.CloneContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.CloneContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.CloneContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.CloneContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.CloneContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.CloneContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.CloneContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.CloneContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance clone context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.CloneContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.CloneContext) + com.google.cloud.sql.v1.CloneContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_CloneContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_CloneContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.CloneContext.class, + com.google.cloud.sql.v1.CloneContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.CloneContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBinLogCoordinatesFieldBuilder(); + internalGetPointInTimeFieldBuilder(); + internalGetSourceInstanceDeletionTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + pitrTimestampMs_ = 0L; + destinationInstanceName_ = ""; + binLogCoordinates_ = null; + if (binLogCoordinatesBuilder_ != null) { + binLogCoordinatesBuilder_.dispose(); + binLogCoordinatesBuilder_ = null; + } + pointInTime_ = null; + if (pointInTimeBuilder_ != null) { + pointInTimeBuilder_.dispose(); + pointInTimeBuilder_ = null; + } + allocatedIpRange_ = ""; + databaseNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + preferredZone_ = ""; + preferredSecondaryZone_ = ""; + sourceInstanceDeletionTime_ = null; + if (sourceInstanceDeletionTimeBuilder_ != null) { + sourceInstanceDeletionTimeBuilder_.dispose(); + sourceInstanceDeletionTimeBuilder_ = null; + } + destinationProject_ = ""; + destinationNetwork_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_CloneContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.CloneContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.CloneContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.CloneContext build() { + com.google.cloud.sql.v1.CloneContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.CloneContext buildPartial() { + com.google.cloud.sql.v1.CloneContext result = new com.google.cloud.sql.v1.CloneContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.CloneContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pitrTimestampMs_ = pitrTimestampMs_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.destinationInstanceName_ = destinationInstanceName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.binLogCoordinates_ = + binLogCoordinatesBuilder_ == null + ? binLogCoordinates_ + : binLogCoordinatesBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pointInTime_ = + pointInTimeBuilder_ == null ? pointInTime_ : pointInTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.allocatedIpRange_ = allocatedIpRange_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + databaseNames_.makeImmutable(); + result.databaseNames_ = databaseNames_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.preferredZone_ = preferredZone_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.preferredSecondaryZone_ = preferredSecondaryZone_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.sourceInstanceDeletionTime_ = + sourceInstanceDeletionTimeBuilder_ == null + ? sourceInstanceDeletionTime_ + : sourceInstanceDeletionTimeBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.destinationProject_ = destinationProject_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.destinationNetwork_ = destinationNetwork_; + to_bitField0_ |= 0x00000040; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.CloneContext) { + return mergeFrom((com.google.cloud.sql.v1.CloneContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.CloneContext other) { + if (other == com.google.cloud.sql.v1.CloneContext.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPitrTimestampMs() != 0L) { + setPitrTimestampMs(other.getPitrTimestampMs()); + } + if (!other.getDestinationInstanceName().isEmpty()) { + destinationInstanceName_ = other.destinationInstanceName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasBinLogCoordinates()) { + mergeBinLogCoordinates(other.getBinLogCoordinates()); + } + if (other.hasPointInTime()) { + mergePointInTime(other.getPointInTime()); + } + if (!other.getAllocatedIpRange().isEmpty()) { + allocatedIpRange_ = other.allocatedIpRange_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.databaseNames_.isEmpty()) { + if (databaseNames_.isEmpty()) { + databaseNames_ = other.databaseNames_; + bitField0_ |= 0x00000040; + } else { + ensureDatabaseNamesIsMutable(); + databaseNames_.addAll(other.databaseNames_); + } + onChanged(); + } + if (other.hasPreferredZone()) { + preferredZone_ = other.preferredZone_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.hasPreferredSecondaryZone()) { + preferredSecondaryZone_ = other.preferredSecondaryZone_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.hasSourceInstanceDeletionTime()) { + mergeSourceInstanceDeletionTime(other.getSourceInstanceDeletionTime()); + } + if (other.hasDestinationProject()) { + destinationProject_ = other.destinationProject_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (other.hasDestinationNetwork()) { + destinationNetwork_ = other.destinationNetwork_; + bitField0_ |= 0x00000800; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pitrTimestampMs_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + destinationInstanceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetBinLogCoordinatesFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetPointInTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + allocatedIpRange_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDatabaseNamesIsMutable(); + databaseNames_.add(s); + break; + } // case 74 + case 82: + { + preferredZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 82 + case 90: + { + preferredSecondaryZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 90 + case 98: + { + input.readMessage( + internalGetSourceInstanceDeletionTimeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 98 + case 106: + { + destinationProject_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 106 + case 114: + { + destinationNetwork_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 114 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#cloneContext`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#cloneContext`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#cloneContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#cloneContext`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#cloneContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long pitrTimestampMs_; + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * int64 pitr_timestamp_ms = 2; + * + * @return The pitrTimestampMs. + */ + @java.lang.Override + public long getPitrTimestampMs() { + return pitrTimestampMs_; + } + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * int64 pitr_timestamp_ms = 2; + * + * @param value The pitrTimestampMs to set. + * @return This builder for chaining. + */ + public Builder setPitrTimestampMs(long value) { + + pitrTimestampMs_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * int64 pitr_timestamp_ms = 2; + * + * @return This builder for chaining. + */ + public Builder clearPitrTimestampMs() { + bitField0_ = (bitField0_ & ~0x00000002); + pitrTimestampMs_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object destinationInstanceName_ = ""; + + /** + * + * + *
+     * Required. Name of the Cloud SQL instance to be created as a clone.
+     * 
+ * + * string destination_instance_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The destinationInstanceName. + */ + public java.lang.String getDestinationInstanceName() { + java.lang.Object ref = destinationInstanceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationInstanceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Name of the Cloud SQL instance to be created as a clone.
+     * 
+ * + * string destination_instance_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for destinationInstanceName. + */ + public com.google.protobuf.ByteString getDestinationInstanceNameBytes() { + java.lang.Object ref = destinationInstanceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationInstanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Name of the Cloud SQL instance to be created as a clone.
+     * 
+ * + * string destination_instance_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The destinationInstanceName to set. + * @return This builder for chaining. + */ + public Builder setDestinationInstanceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationInstanceName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Name of the Cloud SQL instance to be created as a clone.
+     * 
+ * + * string destination_instance_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDestinationInstanceName() { + destinationInstanceName_ = getDefaultInstance().getDestinationInstanceName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Name of the Cloud SQL instance to be created as a clone.
+     * 
+ * + * string destination_instance_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for destinationInstanceName to set. + * @return This builder for chaining. + */ + public Builder setDestinationInstanceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationInstanceName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.BinLogCoordinates binLogCoordinates_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BinLogCoordinates, + com.google.cloud.sql.v1.BinLogCoordinates.Builder, + com.google.cloud.sql.v1.BinLogCoordinatesOrBuilder> + binLogCoordinatesBuilder_; + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + * + * @return Whether the binLogCoordinates field is set. + */ + public boolean hasBinLogCoordinates() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + * + * @return The binLogCoordinates. + */ + public com.google.cloud.sql.v1.BinLogCoordinates getBinLogCoordinates() { + if (binLogCoordinatesBuilder_ == null) { + return binLogCoordinates_ == null + ? com.google.cloud.sql.v1.BinLogCoordinates.getDefaultInstance() + : binLogCoordinates_; + } else { + return binLogCoordinatesBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + */ + public Builder setBinLogCoordinates(com.google.cloud.sql.v1.BinLogCoordinates value) { + if (binLogCoordinatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + binLogCoordinates_ = value; + } else { + binLogCoordinatesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + */ + public Builder setBinLogCoordinates( + com.google.cloud.sql.v1.BinLogCoordinates.Builder builderForValue) { + if (binLogCoordinatesBuilder_ == null) { + binLogCoordinates_ = builderForValue.build(); + } else { + binLogCoordinatesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + */ + public Builder mergeBinLogCoordinates(com.google.cloud.sql.v1.BinLogCoordinates value) { + if (binLogCoordinatesBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && binLogCoordinates_ != null + && binLogCoordinates_ + != com.google.cloud.sql.v1.BinLogCoordinates.getDefaultInstance()) { + getBinLogCoordinatesBuilder().mergeFrom(value); + } else { + binLogCoordinates_ = value; + } + } else { + binLogCoordinatesBuilder_.mergeFrom(value); + } + if (binLogCoordinates_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + */ + public Builder clearBinLogCoordinates() { + bitField0_ = (bitField0_ & ~0x00000008); + binLogCoordinates_ = null; + if (binLogCoordinatesBuilder_ != null) { + binLogCoordinatesBuilder_.dispose(); + binLogCoordinatesBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + */ + public com.google.cloud.sql.v1.BinLogCoordinates.Builder getBinLogCoordinatesBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetBinLogCoordinatesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + */ + public com.google.cloud.sql.v1.BinLogCoordinatesOrBuilder getBinLogCoordinatesOrBuilder() { + if (binLogCoordinatesBuilder_ != null) { + return binLogCoordinatesBuilder_.getMessageOrBuilder(); + } else { + return binLogCoordinates_ == null + ? com.google.cloud.sql.v1.BinLogCoordinates.getDefaultInstance() + : binLogCoordinates_; + } + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BinLogCoordinates, + com.google.cloud.sql.v1.BinLogCoordinates.Builder, + com.google.cloud.sql.v1.BinLogCoordinatesOrBuilder> + internalGetBinLogCoordinatesFieldBuilder() { + if (binLogCoordinatesBuilder_ == null) { + binLogCoordinatesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BinLogCoordinates, + com.google.cloud.sql.v1.BinLogCoordinates.Builder, + com.google.cloud.sql.v1.BinLogCoordinatesOrBuilder>( + getBinLogCoordinates(), getParentForChildren(), isClean()); + binLogCoordinates_ = null; + } + return binLogCoordinatesBuilder_; + } + + private com.google.protobuf.Timestamp pointInTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + pointInTimeBuilder_; + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + * + * @return Whether the pointInTime field is set. + */ + public boolean hasPointInTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + * + * @return The pointInTime. + */ + public com.google.protobuf.Timestamp getPointInTime() { + if (pointInTimeBuilder_ == null) { + return pointInTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : pointInTime_; + } else { + return pointInTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + public Builder setPointInTime(com.google.protobuf.Timestamp value) { + if (pointInTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pointInTime_ = value; + } else { + pointInTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + public Builder setPointInTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (pointInTimeBuilder_ == null) { + pointInTime_ = builderForValue.build(); + } else { + pointInTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + public Builder mergePointInTime(com.google.protobuf.Timestamp value) { + if (pointInTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && pointInTime_ != null + && pointInTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getPointInTimeBuilder().mergeFrom(value); + } else { + pointInTime_ = value; + } + } else { + pointInTimeBuilder_.mergeFrom(value); + } + if (pointInTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + public Builder clearPointInTime() { + bitField0_ = (bitField0_ & ~0x00000010); + pointInTime_ = null; + if (pointInTimeBuilder_ != null) { + pointInTimeBuilder_.dispose(); + pointInTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getPointInTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetPointInTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder() { + if (pointInTimeBuilder_ != null) { + return pointInTimeBuilder_.getMessageOrBuilder(); + } else { + return pointInTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : pointInTime_; + } + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetPointInTimeFieldBuilder() { + if (pointInTimeBuilder_ == null) { + pointInTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPointInTime(), getParentForChildren(), isClean()); + pointInTime_ = null; + } + return pointInTimeBuilder_; + } + + private java.lang.Object allocatedIpRange_ = ""; + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the cloned instance
+     * ip will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?.
+     * Reserved for future use.
+     * 
+ * + * string allocated_ip_range = 6; + * + * @return The allocatedIpRange. + */ + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the cloned instance
+     * ip will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?.
+     * Reserved for future use.
+     * 
+ * + * string allocated_ip_range = 6; + * + * @return The bytes for allocatedIpRange. + */ + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the cloned instance
+     * ip will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?.
+     * Reserved for future use.
+     * 
+ * + * string allocated_ip_range = 6; + * + * @param value The allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRange(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + allocatedIpRange_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the cloned instance
+     * ip will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?.
+     * Reserved for future use.
+     * 
+ * + * string allocated_ip_range = 6; + * + * @return This builder for chaining. + */ + public Builder clearAllocatedIpRange() { + allocatedIpRange_ = getDefaultInstance().getAllocatedIpRange(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the cloned instance
+     * ip will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?.
+     * Reserved for future use.
+     * 
+ * + * string allocated_ip_range = 6; + * + * @param value The bytes for allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRangeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + allocatedIpRange_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList databaseNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDatabaseNamesIsMutable() { + if (!databaseNames_.isModifiable()) { + databaseNames_ = new com.google.protobuf.LazyStringArrayList(databaseNames_); + } + bitField0_ |= 0x00000040; + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @return A list containing the databaseNames. + */ + public com.google.protobuf.ProtocolStringList getDatabaseNamesList() { + databaseNames_.makeImmutable(); + return databaseNames_; + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @return The count of databaseNames. + */ + public int getDatabaseNamesCount() { + return databaseNames_.size(); + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @param index The index of the element to return. + * @return The databaseNames at the given index. + */ + public java.lang.String getDatabaseNames(int index) { + return databaseNames_.get(index); + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @param index The index of the value to return. + * @return The bytes of the databaseNames at the given index. + */ + public com.google.protobuf.ByteString getDatabaseNamesBytes(int index) { + return databaseNames_.getByteString(index); + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @param index The index to set the value at. + * @param value The databaseNames to set. + * @return This builder for chaining. + */ + public Builder setDatabaseNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseNamesIsMutable(); + databaseNames_.set(index, value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @param value The databaseNames to add. + * @return This builder for chaining. + */ + public Builder addDatabaseNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseNamesIsMutable(); + databaseNames_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @param values The databaseNames to add. + * @return This builder for chaining. + */ + public Builder addAllDatabaseNames(java.lang.Iterable values) { + ensureDatabaseNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, databaseNames_); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseNames() { + databaseNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @param value The bytes of the databaseNames to add. + * @return This builder for chaining. + */ + public Builder addDatabaseNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDatabaseNamesIsMutable(); + databaseNames_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object preferredZone_ = ""; + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of an instance to the
+     * specified zone. If no zone is specified, clone to the same primary zone as
+     * the source instance. This field applies to all DB types.
+     * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the preferredZone field is set. + */ + public boolean hasPreferredZone() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of an instance to the
+     * specified zone. If no zone is specified, clone to the same primary zone as
+     * the source instance. This field applies to all DB types.
+     * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The preferredZone. + */ + public java.lang.String getPreferredZone() { + java.lang.Object ref = preferredZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of an instance to the
+     * specified zone. If no zone is specified, clone to the same primary zone as
+     * the source instance. This field applies to all DB types.
+     * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for preferredZone. + */ + public com.google.protobuf.ByteString getPreferredZoneBytes() { + java.lang.Object ref = preferredZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of an instance to the
+     * specified zone. If no zone is specified, clone to the same primary zone as
+     * the source instance. This field applies to all DB types.
+     * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The preferredZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + preferredZone_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of an instance to the
+     * specified zone. If no zone is specified, clone to the same primary zone as
+     * the source instance. This field applies to all DB types.
+     * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPreferredZone() { + preferredZone_ = getDefaultInstance().getPreferredZone(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of an instance to the
+     * specified zone. If no zone is specified, clone to the same primary zone as
+     * the source instance. This field applies to all DB types.
+     * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for preferredZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + preferredZone_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object preferredSecondaryZone_ = ""; + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of a regional
+     * instance in the specified zones. If not specified, clone to the same
+     * secondary zone as the source instance. This value cannot be the same as the
+     * preferred_zone field. This field applies to all DB types.
+     * 
+ * + * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the preferredSecondaryZone field is set. + */ + public boolean hasPreferredSecondaryZone() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of a regional
+     * instance in the specified zones. If not specified, clone to the same
+     * secondary zone as the source instance. This value cannot be the same as the
+     * preferred_zone field. This field applies to all DB types.
+     * 
+ * + * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The preferredSecondaryZone. + */ + public java.lang.String getPreferredSecondaryZone() { + java.lang.Object ref = preferredSecondaryZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredSecondaryZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of a regional
+     * instance in the specified zones. If not specified, clone to the same
+     * secondary zone as the source instance. This value cannot be the same as the
+     * preferred_zone field. This field applies to all DB types.
+     * 
+ * + * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for preferredSecondaryZone. + */ + public com.google.protobuf.ByteString getPreferredSecondaryZoneBytes() { + java.lang.Object ref = preferredSecondaryZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredSecondaryZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of a regional
+     * instance in the specified zones. If not specified, clone to the same
+     * secondary zone as the source instance. This value cannot be the same as the
+     * preferred_zone field. This field applies to all DB types.
+     * 
+ * + * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The preferredSecondaryZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredSecondaryZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + preferredSecondaryZone_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of a regional
+     * instance in the specified zones. If not specified, clone to the same
+     * secondary zone as the source instance. This value cannot be the same as the
+     * preferred_zone field. This field applies to all DB types.
+     * 
+ * + * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPreferredSecondaryZone() { + preferredSecondaryZone_ = getDefaultInstance().getPreferredSecondaryZone(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of a regional
+     * instance in the specified zones. If not specified, clone to the same
+     * secondary zone as the source instance. This value cannot be the same as the
+     * preferred_zone field. This field applies to all DB types.
+     * 
+ * + * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for preferredSecondaryZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredSecondaryZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + preferredSecondaryZone_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp sourceInstanceDeletionTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + sourceInstanceDeletionTimeBuilder_; + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + * + * @return Whether the sourceInstanceDeletionTime field is set. + */ + public boolean hasSourceInstanceDeletionTime() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + * + * @return The sourceInstanceDeletionTime. + */ + public com.google.protobuf.Timestamp getSourceInstanceDeletionTime() { + if (sourceInstanceDeletionTimeBuilder_ == null) { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } else { + return sourceInstanceDeletionTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + public Builder setSourceInstanceDeletionTime(com.google.protobuf.Timestamp value) { + if (sourceInstanceDeletionTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceInstanceDeletionTime_ = value; + } else { + sourceInstanceDeletionTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + public Builder setSourceInstanceDeletionTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (sourceInstanceDeletionTimeBuilder_ == null) { + sourceInstanceDeletionTime_ = builderForValue.build(); + } else { + sourceInstanceDeletionTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + public Builder mergeSourceInstanceDeletionTime(com.google.protobuf.Timestamp value) { + if (sourceInstanceDeletionTimeBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && sourceInstanceDeletionTime_ != null + && sourceInstanceDeletionTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getSourceInstanceDeletionTimeBuilder().mergeFrom(value); + } else { + sourceInstanceDeletionTime_ = value; + } + } else { + sourceInstanceDeletionTimeBuilder_.mergeFrom(value); + } + if (sourceInstanceDeletionTime_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + public Builder clearSourceInstanceDeletionTime() { + bitField0_ = (bitField0_ & ~0x00000200); + sourceInstanceDeletionTime_ = null; + if (sourceInstanceDeletionTimeBuilder_ != null) { + sourceInstanceDeletionTimeBuilder_.dispose(); + sourceInstanceDeletionTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + public com.google.protobuf.Timestamp.Builder getSourceInstanceDeletionTimeBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetSourceInstanceDeletionTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + public com.google.protobuf.TimestampOrBuilder getSourceInstanceDeletionTimeOrBuilder() { + if (sourceInstanceDeletionTimeBuilder_ != null) { + return sourceInstanceDeletionTimeBuilder_.getMessageOrBuilder(); + } else { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetSourceInstanceDeletionTimeFieldBuilder() { + if (sourceInstanceDeletionTimeBuilder_ == null) { + sourceInstanceDeletionTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSourceInstanceDeletionTime(), getParentForChildren(), isClean()); + sourceInstanceDeletionTime_ = null; + } + return sourceInstanceDeletionTimeBuilder_; + } + + private java.lang.Object destinationProject_ = ""; + + /** + * + * + *
+     * Optional. The project ID of the destination project where the cloned
+     * instance will be created. To perform a cross-project clone, this field is
+     * required. If not specified, the clone is created in the same project
+     * as the source instance.
+     * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the destinationProject field is set. + */ + public boolean hasDestinationProject() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Optional. The project ID of the destination project where the cloned
+     * instance will be created. To perform a cross-project clone, this field is
+     * required. If not specified, the clone is created in the same project
+     * as the source instance.
+     * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The destinationProject. + */ + public java.lang.String getDestinationProject() { + java.lang.Object ref = destinationProject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationProject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The project ID of the destination project where the cloned
+     * instance will be created. To perform a cross-project clone, this field is
+     * required. If not specified, the clone is created in the same project
+     * as the source instance.
+     * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for destinationProject. + */ + public com.google.protobuf.ByteString getDestinationProjectBytes() { + java.lang.Object ref = destinationProject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The project ID of the destination project where the cloned
+     * instance will be created. To perform a cross-project clone, this field is
+     * required. If not specified, the clone is created in the same project
+     * as the source instance.
+     * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The destinationProject to set. + * @return This builder for chaining. + */ + public Builder setDestinationProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationProject_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The project ID of the destination project where the cloned
+     * instance will be created. To perform a cross-project clone, this field is
+     * required. If not specified, the clone is created in the same project
+     * as the source instance.
+     * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearDestinationProject() { + destinationProject_ = getDefaultInstance().getDestinationProject(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The project ID of the destination project where the cloned
+     * instance will be created. To perform a cross-project clone, this field is
+     * required. If not specified, the clone is created in the same project
+     * as the source instance.
+     * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for destinationProject to set. + * @return This builder for chaining. + */ + public Builder setDestinationProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationProject_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object destinationNetwork_ = ""; + + /** + * + * + *
+     * Optional. The fully qualified URI of the VPC network to which the cloned
+     * instance will be connected via private services access for private IP. For
+     * example:`projects/my-network-project/global/networks/my-network`. This
+     * field is only required for cross-project cloning.
+     * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the destinationNetwork field is set. + */ + public boolean hasDestinationNetwork() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Optional. The fully qualified URI of the VPC network to which the cloned
+     * instance will be connected via private services access for private IP. For
+     * example:`projects/my-network-project/global/networks/my-network`. This
+     * field is only required for cross-project cloning.
+     * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The destinationNetwork. + */ + public java.lang.String getDestinationNetwork() { + java.lang.Object ref = destinationNetwork_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationNetwork_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The fully qualified URI of the VPC network to which the cloned
+     * instance will be connected via private services access for private IP. For
+     * example:`projects/my-network-project/global/networks/my-network`. This
+     * field is only required for cross-project cloning.
+     * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destinationNetwork. + */ + public com.google.protobuf.ByteString getDestinationNetworkBytes() { + java.lang.Object ref = destinationNetwork_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The fully qualified URI of the VPC network to which the cloned
+     * instance will be connected via private services access for private IP. For
+     * example:`projects/my-network-project/global/networks/my-network`. This
+     * field is only required for cross-project cloning.
+     * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The destinationNetwork to set. + * @return This builder for chaining. + */ + public Builder setDestinationNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationNetwork_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The fully qualified URI of the VPC network to which the cloned
+     * instance will be connected via private services access for private IP. For
+     * example:`projects/my-network-project/global/networks/my-network`. This
+     * field is only required for cross-project cloning.
+     * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDestinationNetwork() { + destinationNetwork_ = getDefaultInstance().getDestinationNetwork(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The fully qualified URI of the VPC network to which the cloned
+     * instance will be connected via private services access for private IP. For
+     * example:`projects/my-network-project/global/networks/my-network`. This
+     * field is only required for cross-project cloning.
+     * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for destinationNetwork to set. + * @return This builder for chaining. + */ + public Builder setDestinationNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationNetwork_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.CloneContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.CloneContext) + private static final com.google.cloud.sql.v1.CloneContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.CloneContext(); + } + + public static com.google.cloud.sql.v1.CloneContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloneContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.CloneContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloneContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloneContextOrBuilder.java new file mode 100644 index 000000000000..b1095016845f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloneContextOrBuilder.java @@ -0,0 +1,513 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface CloneContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.CloneContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#cloneContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#cloneContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Reserved for future use.
+   * 
+ * + * int64 pitr_timestamp_ms = 2; + * + * @return The pitrTimestampMs. + */ + long getPitrTimestampMs(); + + /** + * + * + *
+   * Required. Name of the Cloud SQL instance to be created as a clone.
+   * 
+ * + * string destination_instance_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The destinationInstanceName. + */ + java.lang.String getDestinationInstanceName(); + + /** + * + * + *
+   * Required. Name of the Cloud SQL instance to be created as a clone.
+   * 
+ * + * string destination_instance_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for destinationInstanceName. + */ + com.google.protobuf.ByteString getDestinationInstanceNameBytes(); + + /** + * + * + *
+   * Binary log coordinates, if specified, identify the position up to which the
+   * source instance is cloned. If not specified, the source instance is
+   * cloned up to the most recent binary log coordinates.
+   * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + * + * @return Whether the binLogCoordinates field is set. + */ + boolean hasBinLogCoordinates(); + + /** + * + * + *
+   * Binary log coordinates, if specified, identify the position up to which the
+   * source instance is cloned. If not specified, the source instance is
+   * cloned up to the most recent binary log coordinates.
+   * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + * + * @return The binLogCoordinates. + */ + com.google.cloud.sql.v1.BinLogCoordinates getBinLogCoordinates(); + + /** + * + * + *
+   * Binary log coordinates, if specified, identify the position up to which the
+   * source instance is cloned. If not specified, the source instance is
+   * cloned up to the most recent binary log coordinates.
+   * 
+ * + * .google.cloud.sql.v1.BinLogCoordinates bin_log_coordinates = 4; + */ + com.google.cloud.sql.v1.BinLogCoordinatesOrBuilder getBinLogCoordinatesOrBuilder(); + + /** + * + * + *
+   * Timestamp, if specified, identifies the time to which the source instance
+   * is cloned.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + * + * @return Whether the pointInTime field is set. + */ + boolean hasPointInTime(); + + /** + * + * + *
+   * Timestamp, if specified, identifies the time to which the source instance
+   * is cloned.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + * + * @return The pointInTime. + */ + com.google.protobuf.Timestamp getPointInTime(); + + /** + * + * + *
+   * Timestamp, if specified, identifies the time to which the source instance
+   * is cloned.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder(); + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the cloned instance
+   * ip will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?.
+   * Reserved for future use.
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The allocatedIpRange. + */ + java.lang.String getAllocatedIpRange(); + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the cloned instance
+   * ip will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?.
+   * Reserved for future use.
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The bytes for allocatedIpRange. + */ + com.google.protobuf.ByteString getAllocatedIpRangeBytes(); + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @return A list containing the databaseNames. + */ + java.util.List getDatabaseNamesList(); + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @return The count of databaseNames. + */ + int getDatabaseNamesCount(); + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @param index The index of the element to return. + * @return The databaseNames at the given index. + */ + java.lang.String getDatabaseNames(int index); + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @param index The index of the value to return. + * @return The bytes of the databaseNames at the given index. + */ + com.google.protobuf.ByteString getDatabaseNamesBytes(int index); + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of an instance to the
+   * specified zone. If no zone is specified, clone to the same primary zone as
+   * the source instance. This field applies to all DB types.
+   * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the preferredZone field is set. + */ + boolean hasPreferredZone(); + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of an instance to the
+   * specified zone. If no zone is specified, clone to the same primary zone as
+   * the source instance. This field applies to all DB types.
+   * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The preferredZone. + */ + java.lang.String getPreferredZone(); + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of an instance to the
+   * specified zone. If no zone is specified, clone to the same primary zone as
+   * the source instance. This field applies to all DB types.
+   * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for preferredZone. + */ + com.google.protobuf.ByteString getPreferredZoneBytes(); + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of a regional
+   * instance in the specified zones. If not specified, clone to the same
+   * secondary zone as the source instance. This value cannot be the same as the
+   * preferred_zone field. This field applies to all DB types.
+   * 
+ * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the preferredSecondaryZone field is set. + */ + boolean hasPreferredSecondaryZone(); + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of a regional
+   * instance in the specified zones. If not specified, clone to the same
+   * secondary zone as the source instance. This value cannot be the same as the
+   * preferred_zone field. This field applies to all DB types.
+   * 
+ * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The preferredSecondaryZone. + */ + java.lang.String getPreferredSecondaryZone(); + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of a regional
+   * instance in the specified zones. If not specified, clone to the same
+   * secondary zone as the source instance. This value cannot be the same as the
+   * preferred_zone field. This field applies to all DB types.
+   * 
+ * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for preferredSecondaryZone. + */ + com.google.protobuf.ByteString getPreferredSecondaryZoneBytes(); + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + * + * @return Whether the sourceInstanceDeletionTime field is set. + */ + boolean hasSourceInstanceDeletionTime(); + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + * + * @return The sourceInstanceDeletionTime. + */ + com.google.protobuf.Timestamp getSourceInstanceDeletionTime(); + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + com.google.protobuf.TimestampOrBuilder getSourceInstanceDeletionTimeOrBuilder(); + + /** + * + * + *
+   * Optional. The project ID of the destination project where the cloned
+   * instance will be created. To perform a cross-project clone, this field is
+   * required. If not specified, the clone is created in the same project
+   * as the source instance.
+   * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the destinationProject field is set. + */ + boolean hasDestinationProject(); + + /** + * + * + *
+   * Optional. The project ID of the destination project where the cloned
+   * instance will be created. To perform a cross-project clone, this field is
+   * required. If not specified, the clone is created in the same project
+   * as the source instance.
+   * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The destinationProject. + */ + java.lang.String getDestinationProject(); + + /** + * + * + *
+   * Optional. The project ID of the destination project where the cloned
+   * instance will be created. To perform a cross-project clone, this field is
+   * required. If not specified, the clone is created in the same project
+   * as the source instance.
+   * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for destinationProject. + */ + com.google.protobuf.ByteString getDestinationProjectBytes(); + + /** + * + * + *
+   * Optional. The fully qualified URI of the VPC network to which the cloned
+   * instance will be connected via private services access for private IP. For
+   * example:`projects/my-network-project/global/networks/my-network`. This
+   * field is only required for cross-project cloning.
+   * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the destinationNetwork field is set. + */ + boolean hasDestinationNetwork(); + + /** + * + * + *
+   * Optional. The fully qualified URI of the VPC network to which the cloned
+   * instance will be connected via private services access for private IP. For
+   * example:`projects/my-network-project/global/networks/my-network`. This
+   * field is only required for cross-project cloning.
+   * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The destinationNetwork. + */ + java.lang.String getDestinationNetwork(); + + /** + * + * + *
+   * Optional. The fully qualified URI of the VPC network to which the cloned
+   * instance will be connected via private services access for private IP. For
+   * example:`projects/my-network-project/global/networks/my-network`. This
+   * field is only required for cross-project cloning.
+   * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destinationNetwork. + */ + com.google.protobuf.ByteString getDestinationNetworkBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlAvailableDatabaseVersionsProto.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlAvailableDatabaseVersionsProto.java new file mode 100644 index 000000000000..4f7ac9cbbb08 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlAvailableDatabaseVersionsProto.java @@ -0,0 +1,85 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_available_database_versions.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public final class CloudSqlAvailableDatabaseVersionsProto + extends com.google.protobuf.GeneratedFile { + private CloudSqlAvailableDatabaseVersionsProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlAvailableDatabaseVersionsProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n?google/cloud/sql/v1/cloud_sql_availabl" + + "e_database_versions.proto\022\023google.cloud." + + "sql.v1\032\034google/api/annotations.proto\032\027go" + + "ogle/api/client.proto\032\037google/api/field_" + + "behavior.proto\032\031google/api/resource.prot" + + "o2A\n#SqlAvailableDatabaseVersionsService" + + "\032\032\312A\027sqladmin.googleapis.comBn\n\027com.goog" + + "le.cloud.sql.v1B&CloudSqlAvailableDataba" + + "seVersionsProtoP\001Z)cloud.google.com/go/s" + + "ql/apiv1/sqlpb;sqlpbb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlBackupRunsProto.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlBackupRunsProto.java new file mode 100644 index 000000000000..e1d1dc5a1de3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlBackupRunsProto.java @@ -0,0 +1,240 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public final class CloudSqlBackupRunsProto extends com.google.protobuf.GeneratedFile { + private CloudSqlBackupRunsProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlBackupRunsProto"); + } + + 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_sql_v1_SqlBackupRunsDeleteRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlBackupRunsDeleteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlBackupRunsGetRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlBackupRunsGetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlBackupRunsInsertRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlBackupRunsInsertRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlBackupRunsListRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlBackupRunsListRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_BackupRun_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_BackupRun_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_BackupRunsListResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_BackupRunsListResponse_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/sql/v1/cloud_sql_backup_r" + + "uns.proto\022\023google.cloud.sql.v1\032\034google/a" + + "pi/annotations.proto\032\027google/api/client." + + "proto\032\037google/api/field_behavior.proto\032-" + + "google/cloud/sql/v1/cloud_sql_resources." + + "proto\032\037google/protobuf/timestamp.proto\"K" + + "\n\032SqlBackupRunsDeleteRequest\022\n\n\002id\030\001 \001(\003" + + "\022\020\n\010instance\030\002 \001(\t\022\017\n\007project\030\003 \001(\t\"H\n\027S" + + "qlBackupRunsGetRequest\022\n\n\002id\030\001 \001(\003\022\020\n\010in" + + "stance\030\002 \001(\t\022\017\n\007project\030\003 \001(\t\"m\n\032SqlBack" + + "upRunsInsertRequest\022\020\n\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022,\n\004body\030d \001(\0132\036.google.cl" + + "oud.sql.v1.BackupRun\"f\n\030SqlBackupRunsLis" + + "tRequest\022\020\n\010instance\030\001 \001(\t\022\023\n\013max_result" + + "s\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\017\n\007project\030\004" + + " \001(\t\"\324\006\n\tBackupRun\022\014\n\004kind\030\001 \001(\t\0227\n\006stat" + + "us\030\002 \001(\0162\'.google.cloud.sql.v1.SqlBackup" + + "RunStatus\0221\n\renqueued_time\030\003 \001(\0132\032.googl" + + "e.protobuf.Timestamp\022\n\n\002id\030\004 \001(\003\022.\n\nstar" + + "t_time\030\005 \001(\0132\032.google.protobuf.Timestamp" + + "\022,\n\010end_time\030\006 \001(\0132\032.google.protobuf.Tim" + + "estamp\0222\n\005error\030\007 \001(\0132#.google.cloud.sql" + + ".v1.OperationError\0223\n\004type\030\010 \001(\0162%.googl" + + "e.cloud.sql.v1.SqlBackupRunType\022\023\n\013descr" + + "iption\030\t \001(\t\0225\n\021window_start_time\030\n \001(\0132" + + "\032.google.protobuf.Timestamp\022\020\n\010instance\030" + + "\013 \001(\t\022\021\n\tself_link\030\014 \001(\t\022\020\n\010location\030\r \001" + + "(\t\022F\n\020database_version\030\017 \001(\0162\'.google.cl" + + "oud.sql.v1.SqlDatabaseVersionB\003\340A\003\022W\n\035di" + + "sk_encryption_configuration\030\020 \001(\01320.goog" + + "le.cloud.sql.v1.DiskEncryptionConfigurat" + + "ion\022I\n\026disk_encryption_status\030\021 \001(\0132).go" + + "ogle.cloud.sql.v1.DiskEncryptionStatus\0227" + + "\n\013backup_kind\030\023 \001(\0162\".google.cloud.sql.v" + + "1.SqlBackupKind\022\021\n\ttime_zone\030\027 \001(\t\022&\n\024ma" + + "x_chargeable_bytes\030\030 \001(\003B\003\340A\003H\000\210\001\001B\027\n\025_m" + + "ax_chargeable_bytes\"n\n\026BackupRunsListRes" + + "ponse\022\014\n\004kind\030\001 \001(\t\022-\n\005items\030\002 \003(\0132\036.goo" + + "gle.cloud.sql.v1.BackupRun\022\027\n\017next_page_" + + "token\030\003 \001(\t*\304\001\n\022SqlBackupRunStatus\022%\n!SQ" + + "L_BACKUP_RUN_STATUS_UNSPECIFIED\020\000\022\014\n\010ENQ" + + "UEUED\020\001\022\013\n\007OVERDUE\020\002\022\013\n\007RUNNING\020\003\022\n\n\006FAI" + + "LED\020\004\022\016\n\nSUCCESSFUL\020\005\022\013\n\007SKIPPED\020\006\022\024\n\020DE" + + "LETION_PENDING\020\007\022\023\n\017DELETION_FAILED\020\010\022\013\n" + + "\007DELETED\020\t*L\n\rSqlBackupKind\022\037\n\033SQL_BACKU" + + "P_KIND_UNSPECIFIED\020\000\022\014\n\010SNAPSHOT\020\001\022\014\n\010PH" + + "YSICAL\020\002*U\n\020SqlBackupRunType\022#\n\037SQL_BACK" + + "UP_RUN_TYPE_UNSPECIFIED\020\000\022\r\n\tAUTOMATED\020\001" + + "\022\r\n\tON_DEMAND\020\0022\227\006\n\024SqlBackupRunsService" + + "\022\236\001\n\006Delete\022/.google.cloud.sql.v1.SqlBac" + + "kupRunsDeleteRequest\032\036.google.cloud.sql." + + "v1.Operation\"C\202\323\344\223\002=*;/v1/projects/{proj" + + "ect}/instances/{instance}/backupRuns/{id" + + "}\022\230\001\n\003Get\022,.google.cloud.sql.v1.SqlBacku" + + "pRunsGetRequest\032\036.google.cloud.sql.v1.Ba" + + "ckupRun\"C\202\323\344\223\002=\022;/v1/projects/{project}/" + + "instances/{instance}/backupRuns/{id}\022\237\001\n" + + "\006Insert\022/.google.cloud.sql.v1.SqlBackupR" + + "unsInsertRequest\032\036.google.cloud.sql.v1.O" + + "peration\"D\202\323\344\223\002>\"6/v1/projects/{project}" + + "/instances/{instance}/backupRuns:\004body\022\242" + + "\001\n\004List\022-.google.cloud.sql.v1.SqlBackupR" + + "unsListRequest\032+.google.cloud.sql.v1.Bac" + + "kupRunsListResponse\">\202\323\344\223\0028\0226/v1/project" + + "s/{project}/instances/{instance}/backupR" + + "uns\032|\312A\027sqladmin.googleapis.com\322A_https:" + + "//www.googleapis.com/auth/cloud-platform" + + ",https://www.googleapis.com/auth/sqlserv" + + "ice.adminB_\n\027com.google.cloud.sql.v1B\027Cl" + + "oudSqlBackupRunsProtoP\001Z)cloud.google.co" + + "m/go/sql/apiv1/sqlpb;sqlpbb\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.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_sql_v1_SqlBackupRunsDeleteRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_sql_v1_SqlBackupRunsDeleteRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlBackupRunsDeleteRequest_descriptor, + new java.lang.String[] { + "Id", "Instance", "Project", + }); + internal_static_google_cloud_sql_v1_SqlBackupRunsGetRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_sql_v1_SqlBackupRunsGetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlBackupRunsGetRequest_descriptor, + new java.lang.String[] { + "Id", "Instance", "Project", + }); + internal_static_google_cloud_sql_v1_SqlBackupRunsInsertRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_sql_v1_SqlBackupRunsInsertRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlBackupRunsInsertRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1_SqlBackupRunsListRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_sql_v1_SqlBackupRunsListRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlBackupRunsListRequest_descriptor, + new java.lang.String[] { + "Instance", "MaxResults", "PageToken", "Project", + }); + internal_static_google_cloud_sql_v1_BackupRun_descriptor = getDescriptor().getMessageType(4); + internal_static_google_cloud_sql_v1_BackupRun_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_BackupRun_descriptor, + new java.lang.String[] { + "Kind", + "Status", + "EnqueuedTime", + "Id", + "StartTime", + "EndTime", + "Error", + "Type", + "Description", + "WindowStartTime", + "Instance", + "SelfLink", + "Location", + "DatabaseVersion", + "DiskEncryptionConfiguration", + "DiskEncryptionStatus", + "BackupKind", + "TimeZone", + "MaxChargeableBytes", + }); + internal_static_google_cloud_sql_v1_BackupRunsListResponse_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_cloud_sql_v1_BackupRunsListResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_BackupRunsListResponse_descriptor, + new java.lang.String[] { + "Kind", "Items", "NextPageToken", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlBackupsProto.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlBackupsProto.java new file mode 100644 index 000000000000..27d58ebe048a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlBackupsProto.java @@ -0,0 +1,304 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public final class CloudSqlBackupsProto extends com.google.protobuf.GeneratedFile { + private CloudSqlBackupsProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlBackupsProto"); + } + + 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_sql_v1_CreateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_CreateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_GetBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_GetBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ListBackupsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ListBackupsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ListBackupsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ListBackupsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_UpdateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_UpdateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DeleteBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DeleteBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_Backup_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_Backup_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/sql/v1/cloud_sql_backups." + + "proto\022\023google.cloud.sql.v1\032\034google/api/a" + + "nnotations.proto\032\027google/api/client.prot" + + "o\032\037google/api/field_behavior.proto\032\031goog" + + "le/api/resource.proto\032/google/cloud/sql/v1/cloud_sql_backup_runs.proto\032-google/c" + + "loud/sql/v1/cloud_sql_instances.proto\032-g" + + "oogle/cloud/sql/v1/cloud_sql_resources.proto\032" + + " google/protobuf/field_mask.proto\032\037" + + "google/protobuf/timestamp.proto\032\036google/" + + "protobuf/wrappers.proto\032\032google/type/interval.proto\"\177\n" + + "\023CreateBackupRequest\0226\n" + + "\006parent\030\001 \001(\tB&\340A\002\372A" + + " \022\036sqladmin.googleapis.com/Backup\0220\n" + + "\006backup\030\002 \001(\0132\033.google.cloud.sql.v1.BackupB\003\340A\002\"H\n" + + "\020GetBackupRequest\0224\n" + + "\004name\030\001 \001(\tB&\340A\002\372A \n" + + "\036sqladmin.googleapis.com/Backup\"\203\001\n" + + "\022ListBackupsRequest\0226\n" + + "\006parent\030\001 \001(\tB&\340A\002\372A" + + " \022\036sqladmin.googleapis.com/Backup\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\022\016\n" + + "\006filter\030\004 \001(\t\"\217\001\n" + + "\023ListBackupsResponse\022,\n" + + "\007backups\030\001 \003(\0132\033.google.cloud.sql.v1.Backup\022\027\n" + + "\017next_page_token\030\002 \001(\t\0221\n" + + "\010warnings\030\003 \003(\0132\037.google.cloud.sql.v1.ApiWarning\"x\n" + + "\023UpdateBackupRequest\0220\n" + + "\006backup\030\001 \001(\0132\033.google.cloud.sql.v1.BackupB\003\340A\002\022/\n" + + "\013update_mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"K\n" + + "\023DeleteBackupRequest\0224\n" + + "\004name\030\001 \001(\tB&\340A\002\372A \n" + + "\036sqladmin.googleapis.com/Backup\"\243\n\n" + + "\006Backup\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\003\022\021\n" + + "\004kind\030\002 \001(\tB\003\340A\003\022\026\n" + + "\tself_link\030\003 \001(\tB\003\340A\003\022<\n" + + "\004type\030\004" + + " \001(\0162).google.cloud.sql.v1.Backup.SqlBackupTypeB\003\340A\003\022\023\n" + + "\013description\030\005 \001(\t\022\020\n" + + "\010instance\030\006 \001(\t\022\020\n" + + "\010location\030\007 \001(\t\0223\n" + + "\017backup_interval\030\010 \001(\0132\025.google.type.IntervalB\003\340A\003\022>\n" + + "\005state\030\t \001(\0162*.goog" + + "le.cloud.sql.v1.Backup.SqlBackupStateB\003\340A\003\0227\n" + + "\005error\030\n" + + " \001(\0132#.google.cloud.sql.v1.OperationErrorB\003\340A\003\022\024\n" + + "\007kms_key\030\013 \001(\tB\003\340A\003\022\034\n" + + "\017kms_key_version\030\014 \001(\tB\003\340A\003\022<\n" + + "\013backup_kind\030\r" + + " \001(\0162\".google.cloud.sql.v1.SqlBackupKindB\003\340A\003\022\026\n" + + "\ttime_zone\030\017 \001(\tB\003\340A\003\022\027\n" + + "\010ttl_days\030\020 \001(\003B\003\340A\004H\000\0221\n" + + "\013expiry_time\030\021 \001(\0132\032.google.protobuf.TimestampH\000\022F\n" + + "\020database_version\030\024" + + " \001(\0162\'.google.cloud.sql.v1.SqlDatabaseVersionB\003\340A\003\022&\n" + + "\024max_chargeable_bytes\030\027 \001(\003B\003\340A\003H\001\210\001\001\022B\n" + + "\026instance_deletion_time\030\030" + + " \001(\0132\032.google.protobuf.TimestampB\006\340A\001\340A\003\022H\n" + + "\021instance_settings\030\031 \001(\013" + + "2%.google.cloud.sql.v1.DatabaseInstanceB\006\340A\001\340A\003\022\027\n\n" + + "backup_run\030\032 \001(\tB\003\340A\003\0226\n\r" + + "satisfies_pzs\030\033 \001(\0132\032.google.protobuf.BoolValueB\003\340A\003\0226\n\r" + + "satisfies_pzi\030\034 \001(\0132\032.google.protobuf.BoolValueB\003\340A\003\"Y\n\r" + + "SqlBackupType\022\037\n" + + "\033SQL_BACKUP_TYPE_UNSPECIFIED\020\000\022\r\n" + + "\tAUTOMATED\020\001\022\r\n" + + "\tON_DEMAND\020\002\022\t\n" + + "\005FINAL\020\003\"\214\001\n" + + "\016SqlBackupState\022 \n" + + "\034SQL_BACKUP_STATE_UNSPECIFIED\020\000\022\014\n" + + "\010ENQUEUED\020\001\022\013\n" + + "\007RUNNING\020\002\022\n\n" + + "\006FAILED\020\003\022\016\n\n" + + "SUCCESSFUL\020\004\022\014\n" + + "\010DELETING\020\005\022\023\n" + + "\017DELETION_FAILED\020\006:H\352AE\n" + + "\036sqladmin.googleapis.com/Backup\022#projects/{project}/backups/{backup}B\014\n\n" + + "expirationB\027\n" + + "\025_max_chargeable_bytes2\370\006\n" + + "\021SqlBackupsService\022\232\001\n" + + "\014CreateBackup\022(.google.cloud.sql.v1.CreateB" + + "ackupRequest\032\036.google.cloud.sql.v1.Operation\"@\332A\016parent," + + " backup\202\323\344\223\002)\"\037/v1/{parent=projects/*}/backups:\006backup\022\177\n" + + "\tGetBackup\022%.google.cloud.sql.v1.GetBackupReque" + + "st\032\033.google.cloud.sql.v1.Backup\".\332A\004name" + + "\202\323\344\223\002!\022\037/v1/{name=projects/*/backups/*}\022\222\001\n" + + "\013ListBackups\022\'.google.cloud.sql.v1.Li" + + "stBackupsRequest\032(.google.cloud.sql.v1.L" + + "istBackupsResponse\"0\332A\006parent\202\323\344\223\002!\022\037/v1/{parent=projects/*}/backups\022\246\001\n" + + "\014UpdateBackup\022(.google.cloud.sql.v1.UpdateBackup" + + "Request\032\036.google.cloud.sql.v1.Operation\"L\332A\023backup," + + " update_mask\202\323\344\223\00202&/v1/{back" + + "up.name=projects/*/backups/*}:\006backup\022\210\001\n" + + "\014DeleteBackup\022(.google.cloud.sql.v1.Del" + + "eteBackupRequest\032\036.google.cloud.sql.v1.O" + + "peration\".\332A\004name\202\323\344\223\002!*\037/v1/{name=proje" + + "cts/*/backups/*}\032|\312A\027sqladmin.googleapis" + + ".com\322A_https://www.googleapis.com/auth/c" + + "loud-platform,https://www.googleapis.com/auth/sqlservice.adminB\\\n" + + "\027com.google.cloud.sql.v1B\024CloudSqlBackupsProtoP\001Z)cloud" + + ".google.com/go/sql/apiv1/sqlpb;sqlpbb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.sql.v1.CloudSqlBackupRunsProto.getDescriptor(), + com.google.cloud.sql.v1.CloudSqlServiceProto.getDescriptor(), + com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + com.google.type.IntervalProto.getDescriptor(), + }); + internal_static_google_cloud_sql_v1_CreateBackupRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_sql_v1_CreateBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_CreateBackupRequest_descriptor, + new java.lang.String[] { + "Parent", "Backup", + }); + internal_static_google_cloud_sql_v1_GetBackupRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_sql_v1_GetBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_GetBackupRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_sql_v1_ListBackupsRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_sql_v1_ListBackupsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ListBackupsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", + }); + internal_static_google_cloud_sql_v1_ListBackupsResponse_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_sql_v1_ListBackupsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ListBackupsResponse_descriptor, + new java.lang.String[] { + "Backups", "NextPageToken", "Warnings", + }); + internal_static_google_cloud_sql_v1_UpdateBackupRequest_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_cloud_sql_v1_UpdateBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_UpdateBackupRequest_descriptor, + new java.lang.String[] { + "Backup", "UpdateMask", + }); + internal_static_google_cloud_sql_v1_DeleteBackupRequest_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_cloud_sql_v1_DeleteBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_DeleteBackupRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_sql_v1_Backup_descriptor = getDescriptor().getMessageType(6); + internal_static_google_cloud_sql_v1_Backup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_Backup_descriptor, + new java.lang.String[] { + "Name", + "Kind", + "SelfLink", + "Type", + "Description", + "Instance", + "Location", + "BackupInterval", + "State", + "Error", + "KmsKey", + "KmsKeyVersion", + "BackupKind", + "TimeZone", + "TtlDays", + "ExpiryTime", + "DatabaseVersion", + "MaxChargeableBytes", + "InstanceDeletionTime", + "InstanceSettings", + "BackupRun", + "SatisfiesPzs", + "SatisfiesPzi", + "Expiration", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.sql.v1.CloudSqlBackupRunsProto.getDescriptor(); + com.google.cloud.sql.v1.CloudSqlServiceProto.getDescriptor(); + com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + com.google.type.IntervalProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlConnectProto.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlConnectProto.java new file mode 100644 index 000000000000..b62bd59fb8ac --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlConnectProto.java @@ -0,0 +1,238 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public final class CloudSqlConnectProto extends com.google.protobuf.GeneratedFile { + private CloudSqlConnectProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlConnectProto"); + } + + 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_sql_v1_GetConnectSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_GetConnectSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ResolveConnectSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ResolveConnectSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ConnectSettings_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ConnectSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ConnectSettings_ConnectPoolNodeConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ConnectSettings_ConnectPoolNodeConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_GenerateEphemeralCertRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_GenerateEphemeralCertRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_GenerateEphemeralCertResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_GenerateEphemeralCertResponse_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/sql/v1/cloud_sql_connect." + + "proto\022\023google.cloud.sql.v1\032\034google/api/a" + + "nnotations.proto\032\027google/api/client.prot" + + "o\032\037google/api/field_behavior.proto\032-goog" + + "le/cloud/sql/v1/cloud_sql_resources.prot" + + "o\032\036google/protobuf/duration.proto\032\037googl" + + "e/protobuf/timestamp.proto\"r\n\031GetConnect" + + "SettingsRequest\022\020\n\010instance\030\001 \001(\t\022\017\n\007pro" + + "ject\030\002 \001(\t\0222\n\tread_time\030\007 \001(\0132\032.google.p" + + "rotobuf.TimestampB\003\340A\001\"M\n\035ResolveConnect" + + "SettingsRequest\022\025\n\010dns_name\030\001 \001(\tB\003\340A\002\022\025" + + "\n\010location\030\002 \001(\tB\003\340A\002\"\221\t\n\017ConnectSetting" + + "s\022\014\n\004kind\030\001 \001(\t\0224\n\016server_ca_cert\030\002 \001(\0132" + + "\034.google.cloud.sql.v1.SslCert\0224\n\014ip_addr" + + "esses\030\003 \003(\0132\036.google.cloud.sql.v1.IpMapp" + + "ing\022\016\n\006region\030\004 \001(\t\022A\n\020database_version\030" + + "\037 \001(\0162\'.google.cloud.sql.v1.SqlDatabaseV" + + "ersion\0229\n\014backend_type\030 \001(\0162#.google.cl" + + "oud.sql.v1.SqlBackendType\022\023\n\013psc_enabled" + + "\030! \001(\010\022\020\n\010dns_name\030\" \001(\t\022C\n\016server_ca_mo" + + "de\030# \001(\0162+.google.cloud.sql.v1.ConnectSe" + + "ttings.CaMode\022(\n custom_subject_alternat" + + "ive_names\030% \003(\t\022;\n\tdns_names\030& \003(\0132#.goo" + + "gle.cloud.sql.v1.DnsNameMappingB\003\340A\003\022\027\n\n" + + "node_count\030? \001(\005H\000\210\001\001\022N\n\005nodes\030@ \003(\0132:.g" + + "oogle.cloud.sql.v1.ConnectSettings.Conne" + + "ctPoolNodeConfigB\003\340A\003\022]\n\024mdx_protocol_su" + + "pport\030\' \003(\01627.google.cloud.sql.v1.Connec" + + "tSettings.MdxProtocolSupportB\006\340A\003\340A\001\022\037\n\017" + + "connection_name\030( \001(\tB\006\340A\003\340A\001\032\331\001\n\025Connec" + + "tPoolNodeConfig\022\026\n\004name\030\001 \001(\tB\003\340A\003H\000\210\001\001\022" + + "9\n\014ip_addresses\030\002 \003(\0132\036.google.cloud.sql" + + ".v1.IpMappingB\003\340A\003\022\032\n\010dns_name\030\003 \001(\tB\003\340A" + + "\003H\001\210\001\001\022;\n\tdns_names\030\004 \003(\0132#.google.cloud" + + ".sql.v1.DnsNameMappingB\003\340A\003B\007\n\005_nameB\013\n\t" + + "_dns_name\"y\n\006CaMode\022\027\n\023CA_MODE_UNSPECIFI" + + "ED\020\000\022\036\n\032GOOGLE_MANAGED_INTERNAL_CA\020\001\022\031\n\025" + + "GOOGLE_MANAGED_CAS_CA\020\002\022\033\n\027CUSTOMER_MANA" + + "GED_CAS_CA\020\003\"T\n\022MdxProtocolSupport\022$\n MD" + + "X_PROTOCOL_SUPPORT_UNSPECIFIED\020\000\022\030\n\024CLIE" + + "NT_PROTOCOL_TYPE\020\001B\r\n\013_node_count\"\366\001\n\034Ge" + + "nerateEphemeralCertRequest\022\020\n\010instance\030\001" + + " \001(\t\022\017\n\007project\030\002 \001(\t\022\036\n\npublic_key\030\003 \001(" + + "\tR\npublic_key\022\'\n\014access_token\030\004 \001(\tB\003\340A\001" + + "R\014access_token\0222\n\tread_time\030\007 \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\001\0226\n\016valid_dura" + + "tion\030\014 \001(\0132\031.google.protobuf.DurationB\003\340" + + "A\001\"U\n\035GenerateEphemeralCertResponse\0224\n\016e" + + "phemeral_cert\030\001 \001(\0132\034.google.cloud.sql.v" + + "1.SslCert2\317\005\n\021SqlConnectService\022\257\001\n\022GetC" + + "onnectSettings\022..google.cloud.sql.v1.Get" + + "ConnectSettingsRequest\032$.google.cloud.sq" + + "l.v1.ConnectSettings\"C\202\323\344\223\002=\022;/v1/projec" + + "ts/{project}/instances/{instance}/connec" + + "tSettings\022\272\001\n\026ResolveConnectSettings\0222.g" + + "oogle.cloud.sql.v1.ResolveConnectSetting" + + "sRequest\032$.google.cloud.sql.v1.ConnectSe" + + "ttings\"F\202\323\344\223\002@\022>/v1/locations/{location}" + + "/dns/{dns_name}:resolveConnectSettings\022\314" + + "\001\n\025GenerateEphemeralCert\0221.google.cloud." + + "sql.v1.GenerateEphemeralCertRequest\0322.go" + + "ogle.cloud.sql.v1.GenerateEphemeralCertR" + + "esponse\"L\202\323\344\223\002F\"A/v1/projects/{project}/" + + "instances/{instance}:generateEphemeralCe" + + "rt:\001*\032|\312A\027sqladmin.googleapis.com\322A_http" + + "s://www.googleapis.com/auth/cloud-platfo" + + "rm,https://www.googleapis.com/auth/sqlse" + + "rvice.adminB\\\n\027com.google.cloud.sql.v1B\024" + + "CloudSqlConnectProtoP\001Z)cloud.google.com" + + "/go/sql/apiv1/sqlpb;sqlpbb\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.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_sql_v1_GetConnectSettingsRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_sql_v1_GetConnectSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_GetConnectSettingsRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "ReadTime", + }); + internal_static_google_cloud_sql_v1_ResolveConnectSettingsRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_sql_v1_ResolveConnectSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ResolveConnectSettingsRequest_descriptor, + new java.lang.String[] { + "DnsName", "Location", + }); + internal_static_google_cloud_sql_v1_ConnectSettings_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_sql_v1_ConnectSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ConnectSettings_descriptor, + new java.lang.String[] { + "Kind", + "ServerCaCert", + "IpAddresses", + "Region", + "DatabaseVersion", + "BackendType", + "PscEnabled", + "DnsName", + "ServerCaMode", + "CustomSubjectAlternativeNames", + "DnsNames", + "NodeCount", + "Nodes", + "MdxProtocolSupport", + "ConnectionName", + }); + internal_static_google_cloud_sql_v1_ConnectSettings_ConnectPoolNodeConfig_descriptor = + internal_static_google_cloud_sql_v1_ConnectSettings_descriptor.getNestedType(0); + internal_static_google_cloud_sql_v1_ConnectSettings_ConnectPoolNodeConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ConnectSettings_ConnectPoolNodeConfig_descriptor, + new java.lang.String[] { + "Name", "IpAddresses", "DnsName", "DnsNames", + }); + internal_static_google_cloud_sql_v1_GenerateEphemeralCertRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_sql_v1_GenerateEphemeralCertRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_GenerateEphemeralCertRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "PublicKey", "AccessToken", "ReadTime", "ValidDuration", + }); + internal_static_google_cloud_sql_v1_GenerateEphemeralCertResponse_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_cloud_sql_v1_GenerateEphemeralCertResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_GenerateEphemeralCertResponse_descriptor, + new java.lang.String[] { + "EphemeralCert", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlDatabasesProto.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlDatabasesProto.java new file mode 100644 index 000000000000..354ca9430aa2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlDatabasesProto.java @@ -0,0 +1,200 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_databases.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public final class CloudSqlDatabasesProto extends com.google.protobuf.GeneratedFile { + private CloudSqlDatabasesProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlDatabasesProto"); + } + + 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_sql_v1_SqlDatabasesDeleteRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlDatabasesDeleteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlDatabasesGetRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlDatabasesGetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlDatabasesInsertRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlDatabasesInsertRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlDatabasesListRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlDatabasesListRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlDatabasesUpdateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlDatabasesUpdateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DatabasesListResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DatabasesListResponse_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/sql/v1/cloud_sql_database" + + "s.proto\022\023google.cloud.sql.v1\032\034google/api" + + "/annotations.proto\032\027google/api/client.pr" + + "oto\032-google/cloud/sql/v1/cloud_sql_resources.proto\"P\n" + + "\031SqlDatabasesDeleteRequest\022\020\n" + + "\010database\030\001 \001(\t\022\020\n" + + "\010instance\030\002 \001(\t\022\017\n" + + "\007project\030\003 \001(\t\"M\n" + + "\026SqlDatabasesGetRequest\022\020\n" + + "\010database\030\001 \001(\t\022\020\n" + + "\010instance\030\002 \001(\t\022\017\n" + + "\007project\030\003 \001(\t\"k\n" + + "\031SqlDatabasesInsertRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022+\n" + + "\004body\030d \001(\0132\035.google.cloud.sql.v1.Database\"<\n" + + "\027SqlDatabasesListRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"}\n" + + "\031SqlDatabasesUpdateRequest\022\020\n" + + "\010database\030\001 \001(\t\022\020\n" + + "\010instance\030\002 \001(\t\022\017\n" + + "\007project\030\003 \001(\t\022+\n" + + "\004body\030d \001(\0132\035.google.cloud.sql.v1.Database\"S\n" + + "\025DatabasesListResponse\022\014\n" + + "\004kind\030\001 \001(\t\022,\n" + + "\005items\030\002 \003(\0132\035.google.cloud.sql.v1.Database2\355\010\n" + + "\023SqlDatabasesService\022\242\001\n" + + "\006Delete\022..google.cloud.sql.v1.SqlDatabasesDeleteRequest\032\036." + + "google.cloud.sql.v1.Operation\"H\202\323\344\223\002B*@/" + + "v1/projects/{project}/instances/{instance}/databases/{database}\022\233\001\n" + + "\003Get\022+.google.cloud.sql.v1.SqlDatabasesGetRequest\032\035.g" + + "oogle.cloud.sql.v1.Database\"H\202\323\344\223\002B\022@/v1" + + "/projects/{project}/instances/{instance}/databases/{database}\022\235\001\n" + + "\006Insert\022..google.cloud.sql.v1.SqlDatabasesInsertRequest" + + "\032\036.google.cloud.sql.v1.Operation\"C\202\323\344\223\002=" + + "\"5/v1/projects/{project}/instances/{instance}/databases:\004body\022\237\001\n" + + "\004List\022,.google.cloud.sql.v1.SqlDatabasesListRequest\032*.g" + + "oogle.cloud.sql.v1.DatabasesListResponse" + + "\"=\202\323\344\223\0027\0225/v1/projects/{project}/instances/{instance}/databases\022\247\001\n" + + "\005Patch\022..google.cloud.sql.v1.SqlDatabasesUpdateReques" + + "t\032\036.google.cloud.sql.v1.Operation\"N\202\323\344\223\002" + + "H2@/v1/projects/{project}/instances/{instance}/databases/{database}:\004body\022\250\001\n" + + "\006Update\022..google.cloud.sql.v1.SqlDatabasesU" + + "pdateRequest\032\036.google.cloud.sql.v1.Opera" + + "tion\"N\202\323\344\223\002H\032@/v1/projects/{project}/ins" + + "tances/{instance}/databases/{database}:\004" + + "body\032|\312A\027sqladmin.googleapis.com\322A_https" + + "://www.googleapis.com/auth/cloud-platfor" + + "m,https://www.googleapis.com/auth/sqlservice.adminB^\n" + + "\027com.google.cloud.sql.v1B\026CloudSqlDatabasesProtoP\001Z)cloud.google.co" + + "m/go/sql/apiv1/sqlpb;sqlpbb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor(), + }); + internal_static_google_cloud_sql_v1_SqlDatabasesDeleteRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_sql_v1_SqlDatabasesDeleteRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlDatabasesDeleteRequest_descriptor, + new java.lang.String[] { + "Database", "Instance", "Project", + }); + internal_static_google_cloud_sql_v1_SqlDatabasesGetRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_sql_v1_SqlDatabasesGetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlDatabasesGetRequest_descriptor, + new java.lang.String[] { + "Database", "Instance", "Project", + }); + internal_static_google_cloud_sql_v1_SqlDatabasesInsertRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_sql_v1_SqlDatabasesInsertRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlDatabasesInsertRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1_SqlDatabasesListRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_sql_v1_SqlDatabasesListRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlDatabasesListRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1_SqlDatabasesUpdateRequest_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_cloud_sql_v1_SqlDatabasesUpdateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlDatabasesUpdateRequest_descriptor, + new java.lang.String[] { + "Database", "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1_DatabasesListResponse_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_cloud_sql_v1_DatabasesListResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_DatabasesListResponse_descriptor, + new java.lang.String[] { + "Kind", "Items", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlEventsProto.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlEventsProto.java new file mode 100644 index 000000000000..237b4984965b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlEventsProto.java @@ -0,0 +1,83 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_events.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public final class CloudSqlEventsProto extends com.google.protobuf.GeneratedFile { + private CloudSqlEventsProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlEventsProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n*google/cloud/sql/v1/cloud_sql_events.p" + + "roto\022\023google.cloud.sql.v1\032\034google/api/an" + + "notations.proto\032\027google/api/client.proto" + + "\032\037google/api/field_behavior.proto\032\031googl" + + "e/api/resource.proto2.\n\020SqlEventsService" + + "\032\032\312A\027sqladmin.googleapis.comB[\n\027com.goog" + + "le.cloud.sql.v1B\023CloudSqlEventsProtoP\001Z)" + + "cloud.google.com/go/sql/apiv1/sqlpb;sqlp" + + "bb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlFeatureEligibilityProto.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlFeatureEligibilityProto.java new file mode 100644 index 000000000000..02b051d00e90 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlFeatureEligibilityProto.java @@ -0,0 +1,81 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_feature_eligibility.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public final class CloudSqlFeatureEligibilityProto extends com.google.protobuf.GeneratedFile { + private CloudSqlFeatureEligibilityProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlFeatureEligibilityProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n7google/cloud/sql/v1/cloud_sql_feature_" + + "eligibility.proto\022\023google.cloud.sql.v1\032\034" + + "google/api/annotations.proto\032\027google/api" + + "/client.proto\032\037google/api/field_behavior" + + ".proto2:\n\034SqlFeatureEligibilityService\032\032" + + "\312A\027sqladmin.googleapis.comBg\n\027com.google" + + ".cloud.sql.v1B\037CloudSqlFeatureEligibilit" + + "yProtoP\001Z)cloud.google.com/go/sql/apiv1/" + + "sqlpb;sqlpbb\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(), + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlFlagsProto.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlFlagsProto.java new file mode 100644 index 000000000000..2db11db15030 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlFlagsProto.java @@ -0,0 +1,181 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_flags.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public final class CloudSqlFlagsProto extends com.google.protobuf.GeneratedFile { + private CloudSqlFlagsProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlFlagsProto"); + } + + 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_sql_v1_SqlFlagsListRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlFlagsListRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_FlagsListResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_FlagsListResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_Flag_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_Flag_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/sql/v1/cloud_sql_flags.pr" + + "oto\022\023google.cloud.sql.v1\032\034google/api/ann" + + "otations.proto\032\027google/api/client.proto\032" + + "\037google/api/field_behavior.proto\032-google" + + "/cloud/sql/v1/cloud_sql_resources.proto\032\036google/protobuf/wrappers.proto\"\177\n" + + "\023SqlFlagsListRequest\022\030\n" + + "\020database_version\030\001 \001(\t\022?\n\n" + + "flag_scope\030\003" + + " \001(\0162!.google.cloud.sql.v1.SqlFlagScopeB\003\340A\001H\000\210\001\001B\r\n" + + "\013_flag_scope\"K\n" + + "\021FlagsListResponse\022\014\n" + + "\004kind\030\001 \001(\t\022(\n" + + "\005items\030\002 \003(\0132\031.google.cloud.sql.v1.Flag\"\273\004\n" + + "\004Flag\022\014\n" + + "\004name\030\001 \001(\t\022.\n" + + "\004type\030\002 \001(\0162 .google.cloud.sql.v1.SqlFlagType\022;\n\n" + + "applies_to\030\003 \003(\0162\'.google.cloud.sql.v1.SqlDatabaseVersion\022\035\n" + + "\025allowed_string_values\030\004 \003(\t\022.\n" + + "\tmin_value\030\005 \001(\0132\033.google.protobuf.Int64Value\022.\n" + + "\tmax_value\030\006 \001(\0132\033.google.protobuf.Int64Value\0224\n" + + "\020requires_restart\030\007 \001(\0132\032.google.protobuf.BoolValue\022\014\n" + + "\004kind\030\010 \001(\t\022+\n" + + "\007in_beta\030\t \001(\0132\032.google.protobuf.BoolValue\022\032\n" + + "\022allowed_int_values\030\n" + + " \003(\003\0225\n" + + "\n" + + "flag_scope\030\017 \001(\0162!.google.cloud.sql.v1.SqlFlagScope\022\"\n" + + "\030recommended_string_value\030\020 \001(\tH\000\022<\n" + + "\025recommended_int_value\030\021" + + " \001(\0132\033.google.protobuf.Int64ValueH\000B\023\n" + + "\021recommended_value*\227\001\n" + + "\013SqlFlagType\022\035\n" + + "\031SQL_FLAG_TYPE_UNSPECIFIED\020\000\022\013\n" + + "\007BOOLEAN\020\001\022\n\n" + + "\006STRING\020\002\022\013\n" + + "\007INTEGER\020\003\022\010\n" + + "\004NONE\020\004\022\031\n" + + "\025MYSQL_TIMEZONE_OFFSET\020\005\022\t\n" + + "\005FLOAT\020\006\022\023\n" + + "\017REPEATED_STRING\020\007*o\n" + + "\014SqlFlagScope\022\036\n" + + "\032SQL_FLAG_SCOPE_UNSPECIFIED\020\000\022\033\n" + + "\027SQL_FLAG_SCOPE_DATABASE\020\001\022\"\n" + + "\036SQL_FLAG_SCOPE_CONNECTION_POOL\020\0022\374\001\n" + + "\017SqlFlagsService\022k\n" + + "\004List\022(.google.clou" + + "d.sql.v1.SqlFlagsListRequest\032&.google.cloud.sql.v1.FlagsListResponse\"\021\202\323\344\223\002\013\022" + + "\t/v1/flags\032|\312A\027sqladmin.googleapis.com\322A_ht" + + "tps://www.googleapis.com/auth/cloud-plat" + + "form,https://www.googleapis.com/auth/sqlservice.adminBZ\n" + + "\027com.google.cloud.sql.v1B\022CloudSqlFlagsProtoP\001Z)cloud.google.com" + + "/go/sql/apiv1/sqlpb;sqlpbb\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.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + }); + internal_static_google_cloud_sql_v1_SqlFlagsListRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_sql_v1_SqlFlagsListRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlFlagsListRequest_descriptor, + new java.lang.String[] { + "DatabaseVersion", "FlagScope", + }); + internal_static_google_cloud_sql_v1_FlagsListResponse_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_sql_v1_FlagsListResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_FlagsListResponse_descriptor, + new java.lang.String[] { + "Kind", "Items", + }); + internal_static_google_cloud_sql_v1_Flag_descriptor = getDescriptor().getMessageType(2); + internal_static_google_cloud_sql_v1_Flag_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_Flag_descriptor, + new java.lang.String[] { + "Name", + "Type", + "AppliesTo", + "AllowedStringValues", + "MinValue", + "MaxValue", + "RequiresRestart", + "Kind", + "InBeta", + "AllowedIntValues", + "FlagScope", + "RecommendedStringValue", + "RecommendedIntValue", + "RecommendedValue", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlIamPoliciesProto.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlIamPoliciesProto.java new file mode 100644 index 000000000000..5c07bca70422 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlIamPoliciesProto.java @@ -0,0 +1,78 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_iam_policies.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public final class CloudSqlIamPoliciesProto extends com.google.protobuf.GeneratedFile { + private CloudSqlIamPoliciesProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlIamPoliciesProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/sql/v1/cloud_sql_iam_poli" + + "cies.proto\022\023google.cloud.sql.v1\032\034google/" + + "api/annotations.proto\032\027google/api/client" + + ".proto23\n\025SqlIamPoliciesService\032\032\312A\027sqla" + + "dmin.googleapis.comB`\n\027com.google.cloud." + + "sql.v1B\030CloudSqlIamPoliciesProtoP\001Z)clou" + + "d.google.com/go/sql/apiv1/sqlpb;sqlpbb\006p" + + "roto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlInstanceNamesServiceProto.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlInstanceNamesServiceProto.java new file mode 100644 index 000000000000..e2e2357d8166 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlInstanceNamesServiceProto.java @@ -0,0 +1,81 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instance_names.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public final class CloudSqlInstanceNamesServiceProto extends com.google.protobuf.GeneratedFile { + private CloudSqlInstanceNamesServiceProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlInstanceNamesServiceProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n2google/cloud/sql/v1/cloud_sql_instance" + + "_names.proto\022\023google.cloud.sql.v1\032\034googl" + + "e/api/annotations.proto\032\027google/api/clie" + + "nt.proto\032\037google/api/field_behavior.prot" + + "o25\n\027SqlInstanceNamesService\032\032\312A\027sqladmi" + + "n.googleapis.comBi\n\027com.google.cloud.sql" + + ".v1B!CloudSqlInstanceNamesServiceProtoP\001" + + "Z)cloud.google.com/go/sql/apiv1/sqlpb;sq" + + "lpbb\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(), + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlOperationsProto.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlOperationsProto.java new file mode 100644 index 000000000000..f65c305bb411 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlOperationsProto.java @@ -0,0 +1,160 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_operations.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public final class CloudSqlOperationsProto extends com.google.protobuf.GeneratedFile { + private CloudSqlOperationsProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlOperationsProto"); + } + + 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_sql_v1_SqlOperationsGetRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlOperationsGetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlOperationsListRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlOperationsListRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_OperationsListResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_OperationsListResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlOperationsCancelRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlOperationsCancelRequest_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/sql/v1/cloud_sql_operatio" + + "ns.proto\022\023google.cloud.sql.v1\032\034google/ap" + + "i/annotations.proto\032\027google/api/client.p" + + "roto\032\037google/api/field_behavior.proto\032-g" + + "oogle/cloud/sql/v1/cloud_sql_resources.p" + + "roto\032\033google/protobuf/empty.proto\"G\n\027Sql" + + "OperationsGetRequest\022\026\n\toperation\030\001 \001(\tB" + + "\003\340A\002\022\024\n\007project\030\002 \001(\tB\003\340A\002\"f\n\030SqlOperati" + + "onsListRequest\022\020\n\010instance\030\001 \001(\t\022\023\n\013max_" + + "results\030\002 \001(\r\022\022\n\npage_token\030\003 \001(\t\022\017\n\007pro" + + "ject\030\004 \001(\t\"n\n\026OperationsListResponse\022\014\n\004" + + "kind\030\001 \001(\t\022-\n\005items\030\002 \003(\0132\036.google.cloud" + + ".sql.v1.Operation\022\027\n\017next_page_token\030\003 \001" + + "(\t\"@\n\032SqlOperationsCancelRequest\022\021\n\toper" + + "ation\030\001 \001(\t\022\017\n\007project\030\002 \001(\t2\303\004\n\024SqlOper" + + "ationsService\022\212\001\n\003Get\022,.google.cloud.sql" + + ".v1.SqlOperationsGetRequest\032\036.google.clo" + + "ud.sql.v1.Operation\"5\202\323\344\223\002/\022-/v1/project" + + "s/{project}/operations/{operation}\022\215\001\n\004L" + + "ist\022-.google.cloud.sql.v1.SqlOperationsL" + + "istRequest\032+.google.cloud.sql.v1.Operati" + + "onsListResponse\")\202\323\344\223\002#\022!/v1/projects/{p" + + "roject}/operations\022\217\001\n\006Cancel\022/.google.c" + + "loud.sql.v1.SqlOperationsCancelRequest\032\026" + + ".google.protobuf.Empty\"<\202\323\344\223\0026\"4/v1/proj" + + "ects/{project}/operations/{operation}/ca" + + "ncel\032|\312A\027sqladmin.googleapis.com\322A_https" + + "://www.googleapis.com/auth/cloud-platfor" + + "m,https://www.googleapis.com/auth/sqlser" + + "vice.adminB_\n\027com.google.cloud.sql.v1B\027C" + + "loudSqlOperationsProtoP\001Z)cloud.google.c" + + "om/go/sql/apiv1/sqlpb;sqlpbb\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.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + }); + internal_static_google_cloud_sql_v1_SqlOperationsGetRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_sql_v1_SqlOperationsGetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlOperationsGetRequest_descriptor, + new java.lang.String[] { + "Operation", "Project", + }); + internal_static_google_cloud_sql_v1_SqlOperationsListRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_sql_v1_SqlOperationsListRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlOperationsListRequest_descriptor, + new java.lang.String[] { + "Instance", "MaxResults", "PageToken", "Project", + }); + internal_static_google_cloud_sql_v1_OperationsListResponse_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_sql_v1_OperationsListResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_OperationsListResponse_descriptor, + new java.lang.String[] { + "Kind", "Items", "NextPageToken", + }); + internal_static_google_cloud_sql_v1_SqlOperationsCancelRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_sql_v1_SqlOperationsCancelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlOperationsCancelRequest_descriptor, + new java.lang.String[] { + "Operation", "Project", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlRegionsServiceProto.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlRegionsServiceProto.java new file mode 100644 index 000000000000..6e2791a03d33 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlRegionsServiceProto.java @@ -0,0 +1,83 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_regions.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public final class CloudSqlRegionsServiceProto extends com.google.protobuf.GeneratedFile { + private CloudSqlRegionsServiceProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlRegionsServiceProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n+google/cloud/sql/v1/cloud_sql_regions." + + "proto\022\023google.cloud.sql.v1\032\034google/api/a" + + "nnotations.proto\032\027google/api/client.prot" + + "o\032\037google/api/field_behavior.proto\032\031goog" + + "le/api/resource.proto2/\n\021SqlRegionsServi" + + "ce\032\032\312A\027sqladmin.googleapis.comBc\n\027com.go" + + "ogle.cloud.sql.v1B\033CloudSqlRegionsServic" + + "eProtoP\001Z)cloud.google.com/go/sql/apiv1/" + + "sqlpb;sqlpbb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlResourcesProto.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlResourcesProto.java new file mode 100644 index 000000000000..6d55aa31d1d5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlResourcesProto.java @@ -0,0 +1,1862 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public final class CloudSqlResourcesProto extends com.google.protobuf.GeneratedFile { + private CloudSqlResourcesProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlResourcesProto"); + } + + 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_sql_v1_AclEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_AclEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ApiWarning_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ApiWarning_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_BackupRetentionSettings_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_BackupRetentionSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_BackupConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_BackupConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_PerformDiskShrinkContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_PerformDiskShrinkContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_PreCheckResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_PreCheckResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_PreCheckMajorVersionUpgradeContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_PreCheckMajorVersionUpgradeContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_BackupContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_BackupContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_Database_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_Database_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlServerDatabaseDetails_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlServerDatabaseDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DatabaseFlags_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DatabaseFlags_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_MySqlSyncConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_MySqlSyncConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SyncFlags_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SyncFlags_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstanceReference_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstanceReference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DemoteMasterConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DemoteMasterConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DemoteMasterMySqlReplicaConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DemoteMasterMySqlReplicaConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ExportContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ExportContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ExportContext_SqlCsvExportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ExportContext_SqlCsvExportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_MysqlExportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_MysqlExportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_PostgresExportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_PostgresExportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ExportContext_SqlBakExportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ExportContext_SqlBakExportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ExportContext_SqlTdeExportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ExportContext_SqlTdeExportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ImportContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ImportContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_PostgresImportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_PostgresImportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ImportContext_SqlCsvImportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ImportContext_SqlCsvImportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_EncryptionOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_EncryptionOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ImportContext_SqlTdeImportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ImportContext_SqlTdeImportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_IpConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_IpConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_PscConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_PscConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_PscAutoConnectionConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_PscAutoConnectionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_LocationPreference_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_LocationPreference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_MaintenanceWindow_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_MaintenanceWindow_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DenyMaintenancePeriod_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DenyMaintenancePeriod_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InsightsConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InsightsConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_MySqlReplicaConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_MySqlReplicaConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DiskEncryptionConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DiskEncryptionConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DiskEncryptionStatus_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DiskEncryptionStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_IpMapping_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_IpMapping_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlSubOperationType_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlSubOperationType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_Operation_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_Operation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_OperationError_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_OperationError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_OperationErrors_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_OperationErrors_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_PasswordValidationPolicy_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_PasswordValidationPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DataCacheConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DataCacheConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_FinalBackupConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_FinalBackupConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_Settings_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_Settings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_Settings_UserLabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_Settings_UserLabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_PerformanceCaptureConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_PerformanceCaptureConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ConnectionPoolFlags_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ConnectionPoolFlags_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ConnectionPoolConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ConnectionPoolConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_TargetMetric_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_TargetMetric_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_AdvancedMachineFeatures_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_AdvancedMachineFeatures_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SslCert_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SslCert_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SslCertDetail_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SslCertDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlActiveDirectoryConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlActiveDirectoryConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlServerAuditConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlServerAuditConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlServerEntraIdConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlServerEntraIdConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_AcquireSsrsLeaseContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_AcquireSsrsLeaseContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DnsNameMapping_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DnsNameMapping_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/sql/v1/cloud_sql_resource" + + "s.proto\022\023google.cloud.sql.v1\032\037google/api" + + "/field_behavior.proto\032\033google/api/field_" + + "info.proto\032\031google/api/resource.proto\032\036g" + + "oogle/protobuf/duration.proto\032\037google/pr" + + "otobuf/timestamp.proto\032\036google/protobuf/wrappers.proto\"o\n" + + "\010AclEntry\022\r\n" + + "\005value\030\001 \001(\t\0223\n" + + "\017expiration_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022\021\n" + + "\004name\030\003 \001(\tB\003\340A\001\022\014\n" + + "\004kind\030\004 \001(\t\"\232\002\n\n" + + "ApiWarning\022?\n" + + "\004code\030\001 \001(\01621.g" + + "oogle.cloud.sql.v1.ApiWarning.SqlApiWarningCode\022\017\n" + + "\007message\030\002 \001(\t\022\016\n" + + "\006region\030\003 \001(\t\"\251\001\n" + + "\021SqlApiWarningCode\022$\n" + + " SQL_API_WARNING_CODE_UNSPECIFIED\020\000\022\026\n" + + "\022REGION_UNREACHABLE\020\001\022\035\n" + + "\031MAX_RESULTS_EXCEEDS_LIMIT\020\002\022\033\n" + + "\027COMPROMISED_CREDENTIALS\020\003\022\032\n" + + "\026INTERNAL_STATE_FAILURE\020\004\"\340\001\n" + + "\027BackupRetentionSettings\022R\n" + + "\016retention_unit\030\001 \001(\0162:.google.cloud." + + "sql.v1.BackupRetentionSettings.RetentionUnit\0225\n" + + "\020retained_backups\030\002 \001(\0132\033.google.protobuf.Int32Value\":\n\r" + + "RetentionUnit\022\036\n" + + "\032RETENTION_UNIT_UNSPECIFIED\020\000\022\t\n" + + "\005COUNT\020\001\"\337\007\n" + + "\023BackupConfiguration\022\022\n\n" + + "start_time\030\001 \001(\t\022+\n" + + "\007enabled\030\002 \001(\0132\032.google.protobuf.BoolValue\022\014\n" + + "\004kind\030\003 \001(\t\0226\n" + + "\022binary_log_enabled\030\004 \001(\0132\032.google.protobuf.BoolValue\022L\n" + + "!replication_log_archiving_enabled\030\005" + + " \001(\0132\032.google.protobuf.BoolValueB\005\030\001\340A\001\022\020\n" + + "\010location\030\006 \001(\t\022B\n" + + "\036point_in_time_recovery_enabled\030\007" + + " \001(\0132\032.google.protobuf.BoolValue\022O\n" + + "\031backup_retention_settings\030\010 \001(\0132,." + + "google.cloud.sql.v1.BackupRetentionSettings\022C\n" + + "\036transaction_log_retention_days\030\t" + + " \001(\0132\033.google.protobuf.Int32Value\022x\n" + + "\037transactional_log_storage_state\030\n" + + " \001(\0162E.goog" + + "le.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageStateB\003\340A\003H\000\210\001\001\022R\n" + + "\013backup_tier\030\013 \001(\01623.google.cloud.sql.v1.Ba" + + "ckupConfiguration.BackupTierB\003\340A\003H\001\210\001\001\"\253\001\n" + + "\034TransactionalLogStorageState\022/\n" + + "+TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED\020\000\022\010\n" + + "\004DISK\020\001\022\036\n" + + "\032SWITCHING_TO_CLOUD_STORAGE\020\002\022\035\n" + + "\031SWITCHED_TO_CLOUD_STORAGE\020\003\022\021\n\r" + + "CLOUD_STORAGE\020\004\"W\n\n" + + "BackupTier\022\033\n" + + "\027BACKUP_TIER_UNSPECIFIED\020\000\022\014\n" + + "\010STANDARD\020\001\022\020\n" + + "\010ADVANCED\020\002\032\002\010\001\022\014\n" + + "\010ENHANCED\020\003B\"\n" + + " _transactional_log_storage_stateB\016\n" + + "\014_backup_tier\"2\n" + + "\030PerformDiskShrinkContext\022\026\n" + + "\016target_size_gb\030\001 \001(\003\"\374\001\n" + + "\020PreCheckResponse\022\024\n" + + "\007message\030\002 \001(\tH\000\210\001\001\022L\n" + + "\014message_type\030\003 \001(\01621.google." + + "cloud.sql.v1.PreCheckResponse.MessageTypeH\001\210\001\001\022\030\n" + + "\020actions_required\030\004 \003(\t\"M\n" + + "\013MessageType\022\034\n" + + "\030MESSAGE_TYPE_UNSPECIFIED\020\000\022\010\n" + + "\004INFO\020\001\022\013\n" + + "\007WARNING\020\002\022\t\n" + + "\005ERROR\020\003B\n\n" + + "\010_messageB\017\n\r" + + "_message_type\"\316\001\n" + + "\"PreCheckMajorVersionUpgradeContext\022M\n" + + "\027target_database_version\030\001" + + " \001(\0162\'.google.cloud.sql.v1.SqlDatabaseVersionB\003\340A\002\022F\n" + + "\022pre_check_response\030\002" + + " \003(\0132%.google.cloud.sql.v1.PreCheckResponseB\003\340A\003\022\021\n" + + "\004kind\030\003 \001(\tB\003\340A\001\">\n\r" + + "BackupContext\022\021\n" + + "\tbackup_id\030\001 \001(\003\022\014\n" + + "\004kind\030\002 \001(\t\022\014\n" + + "\004name\030\003 \001(\t\"\367\001\n" + + "\010Database\022\014\n" + + "\004kind\030\001 \001(\t\022\017\n" + + "\007charset\030\002 \001(\t\022\021\n" + + "\tcollation\030\003 \001(\t\022\014\n" + + "\004etag\030\004 \001(\t\022\014\n" + + "\004name\030\005 \001(\t\022\020\n" + + "\010instance\030\006 \001(\t\022\021\n" + + "\tself_link\030\007 \001(\t\022\017\n" + + "\007project\030\010 \001(\t\022S\n" + + "\032sqlserver_database_details\030\t \001(\0132-.goo" + + "gle.cloud.sql.v1.SqlServerDatabaseDetailsH\000B\022\n" + + "\020database_details\"O\n" + + "\030SqlServerDatabaseDetails\022\033\n" + + "\023compatibility_level\030\001 \001(\005\022\026\n" + + "\016recovery_model\030\002 \001(\t\",\n\r" + + "DatabaseFlags\022\014\n" + + "\004name\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t\"M\n" + + "\017MySqlSyncConfig\022:\n" + + "\022initial_sync_flags\030\001 \003(\0132\036.google.cloud.sql.v1.SyncFlags\"(\n" + + "\tSyncFlags\022\014\n" + + "\004name\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t\"B\n" + + "\021InstanceReference\022\014\n" + + "\004name\030\001 \001(\t\022\016\n" + + "\006region\030\002 \001(\t\022\017\n" + + "\007project\030\003 \001(\t\"\212\001\n" + + "\031DemoteMasterConfiguration\022\014\n" + + "\004kind\030\001 \001(\t\022_\n" + + "\033mysql_replica_configuration\030\002 \001(\0132:.google.cloud.sql." + + "v1.DemoteMasterMySqlReplicaConfiguration\"\241\001\n" + + "%DemoteMasterMySqlReplicaConfiguration\022\014\n" + + "\004kind\030\001 \001(\t\022\020\n" + + "\010username\030\002 \001(\t\022\020\n" + + "\010password\030\003 \001(\t\022\022\n\n" + + "client_key\030\004 \001(\t\022\032\n" + + "\022client_certificate\030\005 \001(\t\022\026\n" + + "\016ca_certificate\030\006 \001(\t\"\201\016\n\r" + + "ExportContext\022\013\n" + + "\003uri\030\001 \001(\t\022\021\n" + + "\tdatabases\030\002 \003(\t\022\014\n" + + "\004kind\030\003 \001(\t\022O\n" + + "\022sql_export_options\030\004" + + " \001(\01323.google.cloud.sql.v1.ExportContext.SqlExportOptions\022R\n" + + "\022csv_export_options\030\005" + + " \001(\01326.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions\0223\n" + + "\tfile_type\030\006 \001(\0162 .google.cloud.sql.v1.SqlFileType\022+\n" + + "\007offload\030\010 \001(\0132\032.google.protobuf.BoolValue\022R\n" + + "\022bak_export_options\030\t \001(\0132" + + "6.google.cloud.sql.v1.ExportContext.SqlBakExportOptions\022W\n" + + "\022tde_export_options\030\n" + + " \001(\01326.google.cloud.sql.v1.ExportContext.SqlTdeExportOptionsB\003\340A\001\032\231\001\n" + + "\023SqlCsvExportOptions\022\024\n" + + "\014select_query\030\001 \001(\t\022\030\n" + + "\020escape_character\030\002 \001(\t\022\027\n" + + "\017quote_character\030\003 \001(\t\022\034\n" + + "\024fields_terminated_by\030\004 \001(\t\022\033\n" + + "\023lines_terminated_by\030\006 \001(\t\032\325\004\n" + + "\020SqlExportOptions\022\016\n" + + "\006tables\030\001 \003(\t\022/\n" + + "\013schema_only\030\002 \001(\0132\032.google.protobuf.BoolValue\022d\n" + + "\024mysql_export_options\030\003 \001(\0132F.google.cloud.sql.v1.E" + + "xportContext.SqlExportOptions.MysqlExportOptions\0221\n" + + "\007threads\030\004 \001(\0132\033.google.protobuf.Int32ValueB\003\340A\001\0221\n" + + "\010parallel\030\005 \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\022o\n" + + "\027postgres_export_options\030\006 \001(\0132I.google.cloud.s" + + "ql.v1.ExportContext.SqlExportOptions.PostgresExportOptionsB\003\340A\001\032F\n" + + "\022MysqlExportOptions\0220\n" + + "\013master_data\030\001 \001(\0132\033.google.protobuf.Int32Value\032{\n" + + "\025PostgresExportOptions\022.\n" + + "\005clean\030\001 \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\0222\n" + + "\tif_exists\030\002" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\032\215\003\n" + + "\023SqlBakExportOptions\022+\n" + + "\007striped\030\001 \001(\0132\032.google.protobuf.BoolValue\0221\n" + + "\014stripe_count\030\002 \001(\0132\033.google.protobuf.Int32Value\022.\n" + + "\010bak_type\030\004 \001(\0162\034.google.cloud.sql.v1.BakType\0221\n" + + "\tcopy_only\030\005 \001(\0132\032.google.protobuf.BoolValueB\002\030\001\0225\n" + + "\021differential_base\030\006 \001(\0132\032.google.protobuf.BoolValue\022>\n" + + "\025export_log_start_time\030\007" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\001\022<\n" + + "\023export_log_end_time\030\010" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\001\032\211\001\n" + + "\023SqlTdeExportOptions\022\035\n" + + "\020certificate_path\030\001 \001(\tB\003\340A\002\022\035\n" + + "\020private_key_path\030\002 \001(\tB\003\340A\002\022!\n" + + "\024private_key_password\030\003 \001(\tB\003\340A\002\022\021\n" + + "\004name\030\005 \001(\tB\003\340A\002\"\216\r\n\r" + + "ImportContext\022\013\n" + + "\003uri\030\001 \001(\t\022\020\n" + + "\010database\030\002 \001(\t\022\014\n" + + "\004kind\030\003 \001(\t\0223\n" + + "\tfile_type\030\004 \001(\0162 .google.cloud.sql.v1.SqlFileType\022R\n" + + "\022csv_import_options\030\005 \001(\01326.google.cloud." + + "sql.v1.ImportContext.SqlCsvImportOptions\022\023\n" + + "\013import_user\030\006 \001(\t\022R\n" + + "\022bak_import_options\030\007" + + " \001(\01326.google.cloud.sql.v1.ImportContext.SqlBakImportOptions\022T\n" + + "\022sql_import_options\030\010" + + " \001(\01323.google.cloud.sql.v1.ImportContext.SqlImportOptionsB\003\340A\001\022W\n" + + "\022tde_import_options\030\t \001(\01326.google.cloud.sql.v" + + "1.ImportContext.SqlTdeImportOptionsB\003\340A\001\032\346\002\n" + + "\020SqlImportOptions\0221\n" + + "\007threads\030\001 \001(\0132\033.google.protobuf.Int32ValueB\003\340A\001\0221\n" + + "\010parallel\030\002 \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\022o\n" + + "\027postgres_import_options\030\003 \001(\0132I.g" + + "oogle.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptionsB\003\340A\001\032{\n" + + "\025PostgresImportOptions\022.\n" + + "\005clean\030\001 \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\0222\n" + + "\tif_exists\030\002" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\032\243\001\n" + + "\023SqlCsvImportOptions\022\r\n" + + "\005table\030\001 \001(\t\022\017\n" + + "\007columns\030\002 \003(\t\022\030\n" + + "\020escape_character\030\004 \001(\t\022\027\n" + + "\017quote_character\030\005 \001(\t\022\034\n" + + "\024fields_terminated_by\030\006 \001(\t\022\033\n" + + "\023lines_terminated_by\030\010 \001(\t\032\223\004\n" + + "\023SqlBakImportOptions\022d\n" + + "\022encryption_options\030\001 \001(\0132H.google.cloud.sql.v" + + "1.ImportContext.SqlBakImportOptions.EncryptionOptions\022+\n" + + "\007striped\030\002 \001(\0132\032.google.protobuf.BoolValue\022/\n" + + "\013no_recovery\030\004 \001(\0132\032.google.protobuf.BoolValue\0221\n\r" + + "recovery_only\030\005 \001(\0132\032.google.protobuf.BoolValue\022.\n" + + "\010bak_type\030\006 \001(\0162\034.google.cloud.sql.v1.BakType\0220\n" + + "\007stop_at\030\007 \001(\0132\032.google.protobuf.TimestampB\003\340A\001\022\031\n" + + "\014stop_at_mark\030\010 \001(\tB\003\340A\001\032\207\001\n" + + "\021EncryptionOptions\022\021\n" + + "\tcert_path\030\001 \001(\t\022\020\n" + + "\010pvk_path\030\002 \001(\t\022\024\n" + + "\014pvk_password\030\003 \001(\t\0227\n" + + "\016keep_encrypted\030\005" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\032\211\001\n" + + "\023SqlTdeImportOptions\022\035\n" + + "\020certificate_path\030\001 \001(\tB\003\340A\002\022\035\n" + + "\020private_key_path\030\002 \001(\tB\003\340A\002\022!\n" + + "\024private_key_password\030\003 \001(\tB\003\340A\002\022\021\n" + + "\004name\030\005 \001(\tB\003\340A\002\"\273\t\n" + + "\017IpConfiguration\0220\n" + + "\014ipv4_enabled\030\001 \001(\0132\032.google.protobuf.BoolValue\022\027\n" + + "\017private_network\030\002 \001(\t\022/\n" + + "\013require_ssl\030\003 \001(\0132\032.google.protobuf.BoolValue\022:\n" + + "\023authorized_networks\030\004 \003(\0132\035.google.cloud.sql.v1.AclEntry\022\032\n" + + "\022allocated_ip_range\030\006 \001(\t\022Q\n" + + "-enable_private_path_for_google_cloud_services\030\007" + + " \001(\0132\032.google.protobuf.BoolValue\022>\n" + + "\010ssl_mode\030\010 \001(\0162,.google.cloud.sql.v1.IpConfiguration.SslMode\0227\n\n" + + "psc_config\030\t \001(\0132\036.google.cloud.sql.v1.PscConfigH\000\210\001\001\022H\n" + + "\016server_ca_mode\030\n" + + " \001(\0162+.google.cloud.sql.v1.IpConfiguration.CaModeH\001\210\001\001\022-\n" + + " custom_subject_alternative_names\030\013 \003(\tB\003\340A\001\022 \n" + + "\016server_ca_pool\030\014 \001(\tB\003\340A\001H\002\210\001\001\022v\n" + + " server_certificate_rotation_mode\030\020 \001(\0162B.goo" + + "gle.cloud.sql.v1.IpConfiguration.ServerCertificateRotationModeB\003\340A\001H\003\210\001\001\"\205\001\n" + + "\007SslMode\022\030\n" + + "\024SSL_MODE_UNSPECIFIED\020\000\022#\n" + + "\037ALLOW_UNENCRYPTED_AND_ENCRYPTED\020\001\022\022\n" + + "\016ENCRYPTED_ONLY\020\002\022\'\n" + + "#TRUSTED_CLIENT_CERTIFICATE_REQUIRED\020\003\"y\n" + + "\006CaMode\022\027\n" + + "\023CA_MODE_UNSPECIFIED\020\000\022\036\n" + + "\032GOOGLE_MANAGED_INTERNAL_CA\020\001\022\031\n" + + "\025GOOGLE_MANAGED_CAS_CA\020\002\022\033\n" + + "\027CUSTOMER_MANAGED_CAS_CA\020\003\"\227\001\n" + + "\035ServerCertificateRotationMode\0220\n" + + ",SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED\020\000\022\031\n" + + "\025NO_AUTOMATIC_ROTATION\020\001\022)\n" + + "%AUTOMATIC_ROTATION_DURING_MAINTENANCE\020\002B\r\n" + + "\013_psc_configB\021\n" + + "\017_server_ca_modeB\021\n" + + "\017_server_ca_poolB#\n" + + "!_server_certificate_rotation_mode\"\306\003\n" + + "\tPscConfig\022\030\n" + + "\013psc_enabled\030\001 \001(\010H\000\210\001\001\022&\n" + + "\031allowed_consumer_projects\030\002 \003(\tB\003\340A\001\022O\n" + + "\024psc_auto_connections\030\003" + + " \003(\0132,.google.cloud.sql.v1.PscAutoConnectionConfigB\003\340A\001\022#\n" + + "\026network_attachment_uri\030\004 \001(\tB\003\340A\001\022&\n" + + "\024psc_auto_dns_enabled\030\005 \001(\010B\003\340A\001H\001\210\001\001\0220\n" + + "\036psc_write_endpoint_dns_enabled\030\006" + + " \001(\010B\003\340A\001H\002\210\001\001\0224\n" + + "\"psc_auto_connection_policy_enabled\030\007" + + " \001(\010B\003\340A\001H\003\210\001\001B\016\n" + + "\014_psc_enabledB\027\n" + + "\025_psc_auto_dns_enabledB!\n" + + "\037_psc_write_endpoint_dns_enabledB%\n" + + "#_psc_auto_connection_policy_enabled\"\272\005\n" + + "\027PscAutoConnectionConfig\022\035\n" + + "\020consumer_project\030\001 \001(\tB\003\340A\001\022\035\n" + + "\020consumer_network\030\002 \001(\tB\003\340A\001\022!\n\n" + + "ip_address\030\003 \001(" + + "\tB\010\342\214\317\327\010\002\010\004H\000\210\001\001\022\023\n" + + "\006status\030\004 \001(\tH\001\210\001\001\022$\n" + + "\027consumer_network_status\030\005 \001(\tH\002\210\001\001\022^\n" + + "\031service_connection_policy\030\006 \001(\tB6\340A\003\372A0\n" + + ".compute.googleapis.com/ServiceConnectionPolicyH\003\210\001\001\022;\n" + + ")service_connection_policy_creation_result\030\007 \001(" + + "\tB\003\340A\003H\004\210\001\001\022N\n" + + "\030instance_auto_dns_status\030\010" + + " \001(\0162\".google.cloud.sql.v1.AutoDnsStatusB\003\340A\003H\005\210\001\001\022T\n" + + "\036write_endpoint_auto_dns_status\030\t" + + " \001(\0162\".google.cloud.sql.v1.AutoDnsStatusB\003\340A\003H\006\210\001\001B\r\n" + + "\013_ip_addressB\t\n" + + "\007_statusB\032\n" + + "\030_consumer_network_statusB\034\n" + + "\032_service_connection_policyB,\n" + + "*_service_connection_policy_creation_resultB\033\n" + + "\031_instance_auto_dns_statusB!\n" + + "\037_write_endpoint_auto_dns_status\"l\n" + + "\022LocationPreference\022\"\n" + + "\026follow_gae_application\030\001 \001(\tB\002\030\001\022\014\n" + + "\004zone\030\002 \001(\t\022\026\n" + + "\016secondary_zone\030\004 \001(\t\022\014\n" + + "\004kind\030\003 \001(\t\"\261\001\n" + + "\021MaintenanceWindow\022)\n" + + "\004hour\030\001 \001(\0132\033.google.protobuf.Int32Value\022(\n" + + "\003day\030\002 \001(\0132\033.google.protobuf.Int32Value\0229\n" + + "\014update_track\030\003 \001(\0162#.google.cloud.sql.v1.SqlUpdateTrack\022\014\n" + + "\004kind\030\004 \001(\t\"K\n" + + "\025DenyMaintenancePeriod\022\022\n\n" + + "start_date\030\001 \001(\t\022\020\n" + + "\010end_date\030\002 \001(\t\022\014\n" + + "\004time\030\003 \001(\t\"\261\002\n" + + "\016InsightsConfig\022\036\n" + + "\026query_insights_enabled\030\001 \001(\010\022\035\n" + + "\025record_client_address\030\002 \001(\010\022\037\n" + + "\027record_application_tags\030\003 \001(\010\0228\n" + + "\023query_string_length\030\004 \001(\0132\033.google.protobuf.Int32Value\022;\n" + + "\026query_plans_per_minute\030\005 \001(\0132\033.google.protobuf.Int32Value\022H\n" + + "\037enhanced_query_insights_enabled\030\010" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\"\373\002\n" + + "\031MySqlReplicaConfiguration\022\026\n" + + "\016dump_file_path\030\001 \001(\t\022\020\n" + + "\010username\030\002 \001(\t\022\020\n" + + "\010password\030\003 \001(\t\022;\n" + + "\026connect_retry_interval\030\004 \001(\0132\033.google.protobuf.Int32Value\022<\n" + + "\027master_heartbeat_period\030\005" + + " \001(\0132\033.google.protobuf.Int64Value\022\026\n" + + "\016ca_certificate\030\006 \001(\t\022\032\n" + + "\022client_certificate\030\007 \001(\t\022\022\n\n" + + "client_key\030\010 \001(\t\022\022\n\n" + + "ssl_cipher\030\t \001(\t\022=\n" + + "\031verify_server_certificate\030\n" + + " \001(\0132\032.google.protobuf.BoolValue\022\014\n" + + "\004kind\030\013 \001(\t\"A\n" + + "\033DiskEncryptionConfiguration\022\024\n" + + "\014kms_key_name\030\001 \001(\t\022\014\n" + + "\004kind\030\002 \001(\t\"B\n" + + "\024DiskEncryptionStatus\022\034\n" + + "\024kms_key_version_name\030\001 \001(\t\022\014\n" + + "\004kind\030\002 \001(\t\"\210\001\n" + + "\tIpMapping\0223\n" + + "\004type\030\001 \001(\0162%.google.cloud.sql.v1.SqlIpAddressType\022\022\n\n" + + "ip_address\030\002 \001(\t\0222\n" + + "\016time_to_retire\030\003 \001(\0132\032.google.protobuf.Timestamp\"s\n" + + "\023SqlSubOperationType\022C\n" + + "\020maintenance_type\030\001" + + " \001(\0162\'.google.cloud.sql.v1.SqlMaintenanceTypeH\000B\027\n" + + "\025sub_operation_details\"\217\021\n" + + "\tOperation\022\014\n" + + "\004kind\030\001 \001(\t\022\023\n" + + "\013target_link\030\002 \001(\t\022A\n" + + "\006status\030\003" + + " \001(\01621.google.cloud.sql.v1.Operation.SqlOperationStatus\022\014\n" + + "\004user\030\004 \001(\t\022/\n" + + "\013insert_time\030\005 \001(\0132\032.google.protobuf.Timestamp\022.\n\n" + + "start_time\030\006 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\007 \001(\0132\032.google.protobuf.Timestamp\0223\n" + + "\005error\030\010 \001(\0132$.google.cloud.sql.v1.OperationErrors\0224\n" + + "\013api_warning\030\023 \001(\0132\037.google.cloud.sql.v1.ApiWarning\022G\n" + + "\016operation_type\030\t" + + " \001(\0162/.google.cloud.sql.v1.Operation.SqlOperationType\022:\n" + + "\016import_context\030\n" + + " \001(\0132\".google.cloud.sql.v1.ImportContext\022:\n" + + "\016export_context\030\013 \001(\0132\".google.cloud.sql.v1.ExportContext\022:\n" + + "\016backup_context\030\021 \001(\0132\".google.cloud.sql.v1.BackupContext\022h\n" + + "\'pre_check_major_version_upgrade_context\0302 \001(\01327.google.cloud.s" + + "ql.v1.PreCheckMajorVersionUpgradeContext\022\014\n" + + "\004name\030\014 \001(\t\022\021\n" + + "\ttarget_id\030\r" + + " \001(\t\022\021\n" + + "\tself_link\030\016 \001(\t\022\026\n" + + "\016target_project\030\017 \001(\t\022P\n" + + "\032acquire_ssrs_lease_context\030\024 \001(\0132,.googl" + + "e.cloud.sql.v1.AcquireSsrsLeaseContext\022I\n" + + "\022sub_operation_type\0300" + + " \001(\0132(.google.cloud.sql.v1.SqlSubOperationTypeB\003\340A\001\"\343\010\n" + + "\020SqlOperationType\022\"\n" + + "\036SQL_OPERATION_TYPE_UNSPECIFIED\020\000\022\n\n" + + "\006IMPORT\020\001\022\n\n" + + "\006EXPORT\020\002\022\n\n" + + "\006CREATE\020\003\022\n\n" + + "\006UPDATE\020\004\022\n\n" + + "\006DELETE\020\005\022\013\n" + + "\007RESTART\020\006\022\016\n" + + "\006BACKUP\020\007\032\002\010\001\022\020\n" + + "\010SNAPSHOT\020\010\032\002\010\001\022\021\n" + + "\r" + + "BACKUP_VOLUME\020\t\022\021\n\r" + + "DELETE_VOLUME\020\n" + + "\022\022\n" + + "\016RESTORE_VOLUME\020\013\022\017\n" + + "\013INJECT_USER\020\014\022\t\n" + + "\005CLONE\020\016\022\020\n" + + "\014STOP_REPLICA\020\017\022\021\n\r" + + "START_REPLICA\020\020\022\023\n" + + "\017PROMOTE_REPLICA\020\021\022\022\n" + + "\016CREATE_REPLICA\020\022\022\017\n" + + "\013CREATE_USER\020\023\022\017\n" + + "\013DELETE_USER\020\024\022\017\n" + + "\013UPDATE_USER\020\025\022\023\n" + + "\017CREATE_DATABASE\020\026\022\023\n" + + "\017DELETE_DATABASE\020\027\022\023\n" + + "\017UPDATE_DATABASE\020\030\022\014\n" + + "\010FAILOVER\020\031\022\021\n\r" + + "DELETE_BACKUP\020\032\022\024\n" + + "\020RECREATE_REPLICA\020\033\022\020\n" + + "\014TRUNCATE_LOG\020\034\022\021\n\r" + + "DEMOTE_MASTER\020\035\022\017\n" + + "\013MAINTENANCE\020\036\022\031\n" + + "\021ENABLE_PRIVATE_IP\020\037\032\002\010\001\022\031\n" + + "\021DEFER_MAINTENANCE\020 \032\002\010\001\022\024\n" + + "\014CREATE_CLONE\020!\032\002\010\001\022\032\n" + + "\026RESCHEDULE_MAINTENANCE\020\"\022\027\n" + + "\023START_EXTERNAL_SYNC\020#\022\017\n" + + "\013LOG_CLEANUP\020$\022\020\n" + + "\014AUTO_RESTART\020%\022\r\n" + + "\tREENCRYPT\020&\022\016\n\n" + + "SWITCHOVER\020\'\022\021\n\r" + + "UPDATE_BACKUP\020(\022\026\n" + + "\022ACQUIRE_SSRS_LEASE\020*\022\026\n" + + "\022RELEASE_SSRS_LEASE\020+\022\033\n" + + "\027RECONFIGURE_OLD_PRIMARY\020,\022\033\n" + + "\023CLUSTER_MAINTENANCE\020-\032\002\010\001\022 \n" + + "\030SELF_SERVICE_MAINTENANCE\020.\032\002\010\001\022\031\n" + + "\025SWITCHOVER_TO_REPLICA\020/\022\031\n" + + "\025MAJOR_VERSION_UPGRADE\0200\022\027\n" + + "\017ADVANCED_BACKUP\0201\032\002\010\001\022\021\n\r" + + "MANAGE_BACKUP\0202\022\023\n" + + "\017ENHANCED_BACKUP\0203\022\024\n" + + "\020REPAIR_READ_POOL\0204\022\024\n" + + "\020CREATE_READ_POOL\0205\022#\n" + + "\037PRE_CHECK_MAJOR_VERSION_UPGRADE\0206\022\023\n" + + "\017SETUP_MIGRATION\0207\"^\n" + + "\022SqlOperationStatus\022$\n" + + " SQL_OPERATION_STATUS_UNSPECIFIED\020\000\022\013\n" + + "\007PENDING\020\001\022\013\n" + + "\007RUNNING\020\002\022\010\n" + + "\004DONE\020\003\"=\n" + + "\016OperationError\022\014\n" + + "\004kind\030\001 \001(\t\022\014\n" + + "\004code\030\002 \001(\t\022\017\n" + + "\007message\030\003 \001(\t\"T\n" + + "\017OperationErrors\022\014\n" + + "\004kind\030\001 \001(\t\0223\n" + + "\006errors\030\002 \003(\0132#.google.cloud.sql.v1.OperationError\"\224\004\n" + + "\030PasswordValidationPolicy\022/\n\n" + + "min_length\030\001 \001(\0132\033.google.protobuf.Int32Value\022L\n\n" + + "complexity\030\002 \001(\01628.google.cloud.sq" + + "l.v1.PasswordValidationPolicy.Complexity\0223\n" + + "\016reuse_interval\030\003 \001(\0132\033.google.protobuf.Int32Value\022?\n" + + "\033disallow_username_substring\030\004" + + " \001(\0132\032.google.protobuf.BoolValue\022;\n" + + "\030password_change_interval\030\005 \001(\0132\031.google.protobuf.Duration\022:\n" + + "\026enable_password_policy\030\006 \001(\0132\032.google.protobuf.BoolValue\022H\n" + + " disallow_compromised_credentials\030\007" + + " \001(\0132\032.google.protobuf.BoolValueB\002\030\001\"@\n\n" + + "Complexity\022\032\n" + + "\026COMPLEXITY_UNSPECIFIED\020\000\022\026\n" + + "\022COMPLEXITY_DEFAULT\020\001\"-\n" + + "\017DataCacheConfig\022\032\n" + + "\022data_cache_enabled\030\001 \001(\010\"e\n" + + "\021FinalBackupConfig\022\024\n" + + "\007enabled\030\001 \001(\010H\000\210\001\001\022\033\n" + + "\016retention_days\030\003 \001(\005H\001\210\001\001B\n\n" + + "\010_enabledB\021\n" + + "\017_retention_days\"\357\033\n" + + "\010Settings\0225\n" + + "\020settings_version\030\001 \001(\0132\033.google.protobuf.Int64Value\022\'\n" + + "\033authorized_gae_applications\030\002 \003(\tB\002\030\001\022\014\n" + + "\004tier\030\003 \001(\t\022\014\n" + + "\004kind\030\004 \001(\t\022B\n" + + "\013user_labels\030\005" + + " \003(\0132-.google.cloud.sql.v1.Settings.UserLabelsEntry\022C\n" + + "\021availability_type\030\006 \001(" + + "\0162(.google.cloud.sql.v1.SqlAvailabilityType\0229\n" + + "\014pricing_plan\030\007 \001(\0162#.google.cloud.sql.v1.SqlPricingPlan\022E\n" + + "\020replication_type\030\010" + + " \001(\0162\'.google.cloud.sql.v1.SqlReplicationTypeB\002\030\001\022>\n" + + "\031storage_auto_resize_limit\030\t \001(\0132\033.google.protobuf.Int64Value\022L\n" + + "\021activation_policy\030\n" + + " \001(\01621.google.cloud.sql.v1.Settings.SqlActivationPolicy\022>\n" + + "\020ip_configuration\030\013 \001(\0132$.google.cloud.sql.v1.IpConfiguration\0227\n" + + "\023storage_auto_resize\030\014 \001(\0132\032.google.protobuf.BoolValue\022D\n" + + "\023location_preference\030\r" + + " \001(\0132\'.google.cloud.sql.v1.LocationPreference\022:\n" + + "\016database_flags\030\016 \003(\0132\".google.cloud.sql.v1.DatabaseFlags\022<\n" + + "\016data_disk_type\030\017 \001(\0162$.google.cloud.sql.v1.SqlDataDiskType\022B\n" + + "\022maintenance_window\030\020" + + " \001(\0132&.google.cloud.sql.v1.MaintenanceWindow\022F\n" + + "\024backup_configuration\030\021" + + " \001(\0132(.google.cloud.sql.v1.BackupConfiguration\022@\n" + + "\034database_replication_enabled\030\022" + + " \001(\0132\032.google.protobuf.BoolValue\022F\n" + + "\036crash_safe_replication_enabled\030\023" + + " \001(\0132\032.google.protobuf.BoolValueB\002\030\001\0226\n" + + "\021data_disk_size_gb\030\024 \001(\0132\033.google.protobuf.Int64Value\022N\n" + + "\027active_directory_config\030\026 \001(\0132-.go" + + "ogle.cloud.sql.v1.SqlActiveDirectoryConfig\022\021\n" + + "\tcollation\030\027 \001(\t\022L\n" + + "\030deny_maintenance_periods\030\030" + + " \003(\0132*.google.cloud.sql.v1.DenyMaintenancePeriod\022<\n" + + "\017insights_config\030\031 \001(\0132#.google.cloud.sql.v1.InsightsConfig\022Q\n" + + "\032password_validation_policy\030\033 \001(\0132-." + + "google.cloud.sql.v1.PasswordValidationPolicy\022J\n" + + "\027sql_server_audit_config\030\035 \001(\0132)." + + "google.cloud.sql.v1.SqlServerAuditConfig\022;\n" + + "\007edition\030& \001(\0162%.google.cloud.sql.v1.Settings.EditionB\003\340A\001\022Q\n" + + "\025connector_enforcement\030 " + + " \001(\01622.google.cloud.sql.v1.Settings.ConnectorEnforcement\022?\n" + + "\033deletion_protection_enabled\030!" + + " \001(\0132\032.google.protobuf.BoolValue\022\021\n" + + "\ttime_zone\030\" \001(\t\022O\n" + + "\031advanced_machine_features\030#" + + " \001(\0132,.google.cloud.sql.v1.AdvancedMachineFeatures\022?\n" + + "\021data_cache_config\030% \001(\0132$.google.cloud.sql.v1.DataCacheConfig\022E\n" + + "\033replication_lag_max_seconds\030\'" + + " \001(\0132\033.google.protobuf.Int32ValueB\003\340A\001\022E\n" + + "\034enable_google_ml_integration\030(" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\022D\n" + + "\033enable_dataplex_integration\030)" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\022A\n" + + "\030retain_backups_on_delete\030*" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\022,\n" + + "\032data_disk_provisioned_iops\030+ \001(\003B\003\340A\001H\000\210\001\001\0222\n" + + " data_disk_provisioned_throughput\030, \001(\003B\003\340A\001H\001\210\001\001\022S\n" + + "\026conne", + "ction_pool_config\030-" + + " \001(\0132).google.cloud.sql.v1.ConnectionPoolConfigB\003\340A\001H\002\210\001\001\022M\n" + + "\023final_backup_config\030/" + + " \001(\0132&.google.cloud.sql.v1.FinalBackupConfigB\003\340A\001H\003\210\001\001\022[\n" + + "\033read_pool_auto_scale_config\0300 \001(\0132,.googl" + + "e.cloud.sql.v1.ReadPoolAutoScaleConfigB\003\340A\001H\004\210\001\001\022A\n" + + "\030accelerated_replica_mode\0301" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\022&\n" + + "\024auto_upgrade_enabled\0302 \001(\010B\003\340A\001H\005\210\001\001\022H\n" + + "\016entraid_config\0304" + + " \001(\0132+.google.cloud.sql.v1.SqlServerEntraIdConfigB\003\340A\001\022I\n" + + "\017data_api_access\0305" + + " \001(\0162+.google.cloud.sql.v1.Settings.DataApiAccessH\006\210\001\001\022V\n" + + "\032performance_capture_config\0306" + + " \001(\0132-.google.cloud.sql.v1.PerformanceCaptureConfigB\003\340A\001\0321\n" + + "\017UserLabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"f\n" + + "\023SqlActivationPolicy\022%\n" + + "!SQL_ACTIVATION_POLICY_UNSPECIFIED\020\000\022\n\n" + + "\006ALWAYS\020\001\022\t\n" + + "\005NEVER\020\002\022\021\n" + + "\tON_DEMAND\020\003\032\002\010\001\"V\n" + + "\007Edition\022\027\n" + + "\023EDITION_UNSPECIFIED\020\000\022\016\n\n" + + "ENTERPRISE\020\002\022\023\n" + + "\017ENTERPRISE_PLUS\020\003\022\r\n" + + "\tDEVELOPER\020\005\"]\n" + + "\024ConnectorEnforcement\022%\n" + + "!CONNECTOR_ENFORCEMENT_UNSPECIFIED\020\000\022\020\n" + + "\014NOT_REQUIRED\020\001\022\014\n" + + "\010REQUIRED\020\002\"[\n\r" + + "DataApiAccess\022\037\n" + + "\033DATA_API_ACCESS_UNSPECIFIED\020\000\022\025\n" + + "\021DISALLOW_DATA_API\020\001\022\022\n" + + "\016ALLOW_DATA_API\020\002B\035\n" + + "\033_data_disk_provisioned_iopsB#\n" + + "!_data_disk_provisioned_throughputB\031\n" + + "\027_connection_pool_configB\026\n" + + "\024_final_backup_configB\036\n" + + "\034_read_pool_auto_scale_configB\027\n" + + "\025_auto_upgrade_enabledB\022\n" + + "\020_data_api_access\"\205\n\n" + + "\030PerformanceCaptureConfig\022\031\n" + + "\007enabled\030\001 \001(\010B\003\340A\001H\000\210\001\001\022*\n" + + "\030probing_interval_seconds\030\002 \001(\005B\003\340A\001H\001\210\001\001\022!\n" + + "\017probe_threshold\030\003 \001(\005B\003\340A\001H\002\210\001\001\022+\n" + + "\031running_threads_threshold\030\004 \001(\005B\003\340A\001H\003\210\001\001\0221\n" + + "\037seconds_behind_source_threshold\030\005" + + " \001(\005B\003\340A\001H\004\210\001\001\0220\n" + + "\036transaction_duration_threshold\030\010" + + " \001(\005B\003\340A\001H\005\210\001\001\0223\n" + + "!cpu_utilization_threshold_percent\030\t" + + " \001(\005B\003\340A\001H\006\210\001\001\0220\n" + + "\036memory_usage_threshold_percent\030\n" + + " \001(\005B\003\340A\001H\007\210\001\001\0227\n" + + "%transaction_lock_wait_threshold_count\030\013" + + " \001(\005B\003\340A\001H\010\210\001\001\0220\n" + + "\036semaphore_wait_threshold_count\030\014 \001(\005B\003\340A\001H" + + "\t\210\001\001\0225\n" + + "#history_list_length_threshold_count\030\r" + + " \001(\005B\003\340A\001H\n" + + "\210\001\001\0224\n" + + "\"transaction_kill_threshold_seconds\030\016" + + " \001(\005B\003\340A\001H\013\210\001\001\0221\n" + + "$transaction_kill_excluded_user_hosts\030\020 \003(\tB\003\340A\001\022j\n" + + "\025transaction_kill_type\030\021 \001(\0162A.google.cloud.sql" + + ".v1.PerformanceCaptureConfig.TransactionKillTypeB\003\340A\001H\014\210\001\001\"n\n" + + "\023TransactionKillType\022%\n" + + "!TRANSACTION_KILL_TYPE_UNSPECIFIED\020\000\022\032\n" + + "\026READ_ONLY_TRANSACTIONS\020\001\022\024\n" + + "\020ALL_TRANSACTIONS\020\002B\n\n" + + "\010_enabledB\033\n" + + "\031_probing_interval_secondsB\022\n" + + "\020_probe_thresholdB\034\n" + + "\032_running_threads_thresholdB\"\n" + + " _seconds_behind_source_thresholdB!\n" + + "\037_transaction_duration_thresholdB$\n" + + "\"_cpu_utilization_threshold_percentB!\n" + + "\037_memory_usage_threshold_percentB(\n" + + "&_transaction_lock_wait_threshold_countB!\n" + + "\037_semaphore_wait_threshold_countB&\n" + + "$_history_list_length_threshold_countB%\n" + + "#_transaction_kill_threshold_secondsB\030\n" + + "\026_transaction_kill_type\"<\n" + + "\023ConnectionPoolFlags\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\022\022\n" + + "\005value\030\002 \001(\tB\003\340A\002\"\315\001\n" + + "\024ConnectionPoolConfig\022\'\n" + + "\032connection_pooling_enabled\030\001 \001(\010H\000\210\001\001\022<\n" + + "\005flags\030\010" + + " \003(\0132(.google.cloud.sql.v1.ConnectionPoolFlagsB\003\340A\001\022\036\n" + + "\014pooler_count\030\t \001(\005B\003\340A\003H\001\210\001\001B\035\n" + + "\033_connection_pooling_enabledB\017\n\r" + + "_pooler_count\"\221\004\n" + + "\027ReadPoolAutoScaleConfig\022\024\n" + + "\007enabled\030\001 \001(\010H\000\210\001\001\022\033\n" + + "\016min_node_count\030\002 \001(\005H\001\210\001\001\022\033\n" + + "\016max_node_count\030\003 \001(\005H\002\210\001\001\022V\n" + + "\016target_metrics\030\004 \003(\01329.google.c" + + "loud.sql.v1.ReadPoolAutoScaleConfig.TargetMetricB\003\340A\001\022\035\n" + + "\020disable_scale_in\030\005 \001(\010H\003\210\001\001\022&\n" + + "\031scale_in_cooldown_seconds\030\006 \001(\005H\004\210\001\001\022\'\n" + + "\032scale_out_cooldown_seconds\030\007 \001(\005H\005\210\001\001\032Z\n" + + "\014TargetMetric\022\023\n" + + "\006metric\030\001 \001(\tH\000\210\001\001\022\031\n" + + "\014target_value\030\002 \001(\002H\001\210\001\001B\t\n" + + "\007_metricB\017\n\r" + + "_target_valueB\n\n" + + "\010_enabledB\021\n" + + "\017_min_node_countB\021\n" + + "\017_max_node_countB\023\n" + + "\021_disable_scale_inB\034\n" + + "\032_scale_in_cooldown_secondsB\035\n" + + "\033_scale_out_cooldown_seconds\"3\n" + + "\027AdvancedMachineFeatures\022\030\n" + + "\020threads_per_core\030\001 \001(\005\"\373\001\n" + + "\007SslCert\022\014\n" + + "\004kind\030\001 \001(\t\022\032\n" + + "\022cert_serial_number\030\002 \001(\t\022\014\n" + + "\004cert\030\003 \001(\t\022/\n" + + "\013create_time\030\004 \001(\0132\032.google.protobuf.Timestamp\022\023\n" + + "\013common_name\030\005 \001(\t\0223\n" + + "\017expiration_time\030\006 \001(\0132\032.google.protobuf.Timestamp\022\030\n" + + "\020sha1_fingerprint\030\007 \001(\t\022\020\n" + + "\010instance\030\010 \001(\t\022\021\n" + + "\tself_link\030\t \001(\t\"Z\n\r" + + "SslCertDetail\022/\n" + + "\tcert_info\030\001 \001(\0132\034.google.cloud.sql.v1.SslCert\022\030\n" + + "\020cert_private_key\030\002 \001(\t\"\250\003\n" + + "\030SqlActiveDirectoryConfig\022\014\n" + + "\004kind\030\001 \001(\t\022\016\n" + + "\006domain\030\002 \001(\t\022T\n" + + "\004mode\030\003 \001(\0162A.google.cloud.sql" + + ".v1.SqlActiveDirectoryConfig.ActiveDirectoryModeB\003\340A\001\022 \n" + + "\013dns_servers\030\004 \003(\tB\013\340A\001\342\214\317\327\010\002\010\002\022)\n" + + "\034admin_credential_secret_name\030\005 \001(\tB\003\340A\001\022 \n" + + "\023organizational_unit\030\006 \001(\tB\003\340A\001\"\250\001\n" + + "\023ActiveDirectoryMode\022%\n" + + "!ACTIVE_DIRECTORY_MODE_UNSPECIFIED\020\000\022\034\n" + + "\030MANAGED_ACTIVE_DIRECTORY\020\001\022%\n" + + "\035SELF_MANAGED_ACTIVE_DIRECTORY\020\002\032\002\010\001\022%\n" + + "!CUSTOMER_MANAGED_ACTIVE_DIRECTORY\020\003\"\237\001\n" + + "\024SqlServerAuditConfig\022\014\n" + + "\004kind\030\001 \001(\t\022\016\n" + + "\006bucket\030\002 \001(\t\0225\n" + + "\022retention_interval\030\003 \001(\0132\031.google.protobuf.Duration\0222\n" + + "\017upload_interval\030\004 \001(\0132\031.google.protobuf.Duration\"`\n" + + "\026SqlServerEntraIdConfig\022\021\n" + + "\004kind\030\001 \001(\tB\003\340A\003\022\026\n" + + "\ttenant_id\030\002 \001(\tB\003\340A\001\022\033\n" + + "\016application_id\030\003 \001(\tB\003\340A\001\"\342\001\n" + + "\027AcquireSsrsLeaseContext\022\030\n" + + "\013setup_login\030\001 \001(\tH\000\210\001\001\022\032\n\r" + + "service_login\030\002 \001(\tH\001\210\001\001\022\034\n" + + "\017report_database\030\003 \001(\tH\002\210\001\001\0220\n" + + "\010duration\030\004 \001(\0132\031.google.protobuf.DurationH\003\210\001\001B\016\n" + + "\014_setup_loginB\020\n" + + "\016_service_loginB\022\n" + + "\020_report_databaseB\013\n" + + "\t_duration\"\237\004\n" + + "\016DnsNameMapping\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\003\022P\n" + + "\017connection_type\030\002" + + " \001(\01622.google.cloud.sql.v1.DnsNameMapping.ConnectionTypeB\003\340A\003\022D\n" + + "\tdns_scope\030\003 " + + "\001(\0162,.google.cloud.sql.v1.DnsNameMapping.DnsScopeB\003\340A\003\022N\n" + + "\016record_manager\030\004 \001(\01621" + + ".google.cloud.sql.v1.DnsNameMapping.RecordManagerB\003\340A\003\"w\n" + + "\016ConnectionType\022\037\n" + + "\033CONNECTION_TYPE_UNSPECIFIED\020\000\022\n\n" + + "\006PUBLIC\020\001\022\033\n" + + "\027PRIVATE_SERVICES_ACCESS\020\002\022\033\n" + + "\027PRIVATE_SERVICE_CONNECT\020\003\"@\n" + + "\010DnsScope\022\031\n" + + "\025DNS_SCOPE_UNSPECIFIED\020\000\022\014\n" + + "\010INSTANCE\020\001\022\013\n" + + "\007CLUSTER\020\002\"W\n\r" + + "RecordManager\022\036\n" + + "\032RECORD_MANAGER_UNSPECIFIED\020\000\022\014\n" + + "\010CUSTOMER\020\001\022\030\n" + + "\024CLOUD_SQL_AUTOMATION\020\002*P\n" + + "\013SqlFileType\022\035\n" + + "\031SQL_FILE_TYPE_UNSPECIFIED\020\000\022\007\n" + + "\003SQL\020\001\022\007\n" + + "\003CSV\020\002\022\007\n" + + "\003BAK\020\004\022\007\n" + + "\003TDE\020\010*A\n" + + "\007BakType\022\030\n" + + "\024BAK_TYPE_UNSPECIFIED\020\000\022\010\n" + + "\004FULL\020\001\022\010\n" + + "\004DIFF\020\002\022\010\n" + + "\004TLOG\020\003*\314\001\n" + + "\022SqlMaintenanceType\022$\n" + + " SQL_MAINTENANCE_TYPE_UNSPECIFIED\020\000\022\030\n" + + "\024INSTANCE_MAINTENANCE\020\001\022 \n" + + "\034REPLICA_INCLUDED_MAINTENANCE\020\002\022%\n" + + "!INSTANCE_SELF_SERVICE_MAINTENANCE\020\003\022-\n" + + ")REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE\020\004*c\n" + + "\016SqlBackendType\022 \n" + + "\034SQL_BACKEND_TYPE_UNSPECIFIED\020\000\022\021\n" + + "\tFIRST_GEN\020\001\032\002\010\001\022\016\n" + + "\n" + + "SECOND_GEN\020\002\022\014\n" + + "\010EXTERNAL\020\003*u\n" + + "\020SqlIpAddressType\022#\n" + + "\037SQL_IP_ADDRESS_TYPE_UNSPECIFIED\020\000\022\013\n" + + "\007PRIMARY\020\001\022\014\n" + + "\010OUTGOING\020\002\022\013\n" + + "\007PRIVATE\020\003\022\024\n" + + "\020MIGRATED_1ST_GEN\020\004*\277\t\n" + + "\022SqlDatabaseVersion\022$\n" + + " SQL_DATABASE_VERSION_UNSPECIFIED\020\000\022\021\n" + + "\tMYSQL_5_1\020\002\032\002\010\001\022\021\n" + + "\tMYSQL_5_5\020\003\032\002\010\001\022\r\n" + + "\tMYSQL_5_6\020\005\022\r\n" + + "\tMYSQL_5_7\020\006\022\r\n" + + "\tMYSQL_8_0\020\024\022\020\n" + + "\014MYSQL_8_0_18\020)\022\020\n" + + "\014MYSQL_8_0_26\020U\022\020\n" + + "\014MYSQL_8_0_27\020o\022\021\n" + + "\014MYSQL_8_0_28\020\204\001\022\025\n" + + "\014MYSQL_8_0_29\020\224\001\032\002\010\001\022\021\n" + + "\014MYSQL_8_0_30\020\256\001\022\021\n" + + "\014MYSQL_8_0_31\020\305\001\022\021\n" + + "\014MYSQL_8_0_32\020\325\001\022\021\n" + + "\014MYSQL_8_0_33\020\356\001\022\021\n" + + "\014MYSQL_8_0_34\020\357\001\022\021\n" + + "\014MYSQL_8_0_35\020\360\001\022\021\n" + + "\014MYSQL_8_0_36\020\361\001\022\021\n" + + "\014MYSQL_8_0_37\020\343\002\022\021\n" + + "\014MYSQL_8_0_39\020\345\002\022\021\n" + + "\014MYSQL_8_0_40\020\346\002\022\021\n" + + "\014MYSQL_8_0_41\020\350\003\022\021\n" + + "\014MYSQL_8_0_42\020\351\003\022\021\n" + + "\014MYSQL_8_0_43\020\251\004\022\021\n" + + "\014MYSQL_8_0_44\020\252\004\022\021\n" + + "\014MYSQL_8_0_45\020\253\004\022\021\n" + + "\014MYSQL_8_0_46\020\254\004\022\016\n" + + "\tMYSQL_8_4\020\216\003\022\016\n" + + "\tMYSQL_9_7\020\216\005\022\033\n" + + "\027SQLSERVER_2017_STANDARD\020\013\022\035\n" + + "\031SQLSERVER_2017_ENTERPRISE\020\016\022\032\n" + + "\026SQLSERVER_2017_EXPRESS\020\017\022\026\n" + + "\022SQLSERVER_2017_WEB\020\020\022\020\n" + + "\014POSTGRES_9_6\020\t\022\017\n" + + "\013POSTGRES_10\020\022\022\017\n" + + "\013POSTGRES_11\020\n" + + "\022\017\n" + + "\013POSTGRES_12\020\023\022\017\n" + + "\013POSTGRES_13\020\027\022\017\n" + + "\013POSTGRES_14\020n\022\020\n" + + "\013POSTGRES_15\020\254\001\022\020\n" + + "\013POSTGRES_16\020\220\002\022\020\n" + + "\013POSTGRES_17\020\230\003\022\020\n" + + "\013POSTGRES_18\020\255\004\022\020\n" + + "\013POSTGRES_19\020\254\005\022\020\n" + + "\013POSTGRES_20\020\215\006\022\033\n" + + "\027SQLSERVER_2019_STANDARD\020\032\022\035\n" + + "\031SQLSERVER_2019_ENTERPRISE\020\033\022\032\n" + + "\026SQLSERVER_2019_EXPRESS\020\034\022\026\n" + + "\022SQLSERVER_2019_WEB\020\035\022\034\n" + + "\027SQLSERVER_2022_STANDARD\020\307\001\022\036\n" + + "\031SQLSERVER_2022_ENTERPRISE\020\310\001\022\033\n" + + "\026SQLSERVER_2022_EXPRESS\020\311\001\022\027\n" + + "\022SQLSERVER_2022_WEB\020\312\001\022\034\n" + + "\027SQLSERVER_2025_STANDARD\020\245\004\022\036\n" + + "\031SQLSERVER_2025_ENTERPRISE\020\246\004\022\033\n" + + "\026SQLSERVER_2025_EXPRESS\020\247\004*L\n" + + "\016SqlPricingPlan\022 \n" + + "\034SQL_PRICING_PLAN_UNSPECIFIED\020\000\022\013\n" + + "\007PACKAGE\020\001\022\013\n" + + "\007PER_USE\020\002*]\n" + + "\022SqlReplicationType\022$\n" + + " SQL_REPLICATION_TYPE_UNSPECIFIED\020\000\022\017\n" + + "\013SYNCHRONOUS\020\001\022\020\n" + + "\014ASYNCHRONOUS\020\002*\201\001\n" + + "\017SqlDataDiskType\022\"\n" + + "\036SQL_DATA_DISK_TYPE_UNSPECIFIED\020\000\022\n\n" + + "\006PD_SSD\020\001\022\n\n" + + "\006PD_HDD\020\002\022\032\n" + + "\022OBSOLETE_LOCAL_SSD\020\003\032\002\010\001\022\026\n" + + "\022HYPERDISK_BALANCED\020\004*U\n" + + "\023SqlAvailabilityType\022%\n" + + "!SQL_AVAILABILITY_TYPE_UNSPECIFIED\020\000\022\t\n" + + "\005ZONAL\020\001\022\014\n" + + "\010REGIONAL\020\002*U\n" + + "\016SqlUpdateTrack\022 \n" + + "\034SQL_UPDATE_TRACK_UNSPECIFIED\020\000\022\n\n" + + "\006canary\020\001\022\n\n" + + "\006stable\020\002\022\t\n" + + "\005week5\020\003*l\n\r" + + "AutoDnsStatus\022\037\n" + + "\033AUTO_DNS_STATUS_UNSPECIFIED\020\000\022\017\n" + + "\013AUTO_DNS_OK\020\001\022\023\n" + + "\017AUTO_DNS_FAILED\020\002\022\024\n" + + "\020AUTO_DNS_UNKNOWN\020\003B\273\002\n" + + "\027com.google.cloud.sql.v1B\026CloudSqlResources" + + "ProtoP\001Z)cloud.google.com/go/sql/apiv1/sqlpb;sqlpb\352A\213\001\n" + + ".compute.googleapis.com/ServiceConnectionPolicy\022Yprojects/{projec" + + "t}/regions/{region}/serviceConnectionPolicies/{service_connection_policy}\352AK\n" + + " cloudsql.googleapis.com/Instance\022\'projects" + + "/{project}/instances/{instance}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.FieldInfoProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + }); + internal_static_google_cloud_sql_v1_AclEntry_descriptor = getDescriptor().getMessageType(0); + internal_static_google_cloud_sql_v1_AclEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_AclEntry_descriptor, + new java.lang.String[] { + "Value", "ExpirationTime", "Name", "Kind", + }); + internal_static_google_cloud_sql_v1_ApiWarning_descriptor = getDescriptor().getMessageType(1); + internal_static_google_cloud_sql_v1_ApiWarning_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ApiWarning_descriptor, + new java.lang.String[] { + "Code", "Message", "Region", + }); + internal_static_google_cloud_sql_v1_BackupRetentionSettings_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_sql_v1_BackupRetentionSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_BackupRetentionSettings_descriptor, + new java.lang.String[] { + "RetentionUnit", "RetainedBackups", + }); + internal_static_google_cloud_sql_v1_BackupConfiguration_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_sql_v1_BackupConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_BackupConfiguration_descriptor, + new java.lang.String[] { + "StartTime", + "Enabled", + "Kind", + "BinaryLogEnabled", + "ReplicationLogArchivingEnabled", + "Location", + "PointInTimeRecoveryEnabled", + "BackupRetentionSettings", + "TransactionLogRetentionDays", + "TransactionalLogStorageState", + "BackupTier", + }); + internal_static_google_cloud_sql_v1_PerformDiskShrinkContext_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_cloud_sql_v1_PerformDiskShrinkContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_PerformDiskShrinkContext_descriptor, + new java.lang.String[] { + "TargetSizeGb", + }); + internal_static_google_cloud_sql_v1_PreCheckResponse_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_cloud_sql_v1_PreCheckResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_PreCheckResponse_descriptor, + new java.lang.String[] { + "Message", "MessageType", "ActionsRequired", + }); + internal_static_google_cloud_sql_v1_PreCheckMajorVersionUpgradeContext_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_cloud_sql_v1_PreCheckMajorVersionUpgradeContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_PreCheckMajorVersionUpgradeContext_descriptor, + new java.lang.String[] { + "TargetDatabaseVersion", "PreCheckResponse", "Kind", + }); + internal_static_google_cloud_sql_v1_BackupContext_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_cloud_sql_v1_BackupContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_BackupContext_descriptor, + new java.lang.String[] { + "BackupId", "Kind", "Name", + }); + internal_static_google_cloud_sql_v1_Database_descriptor = getDescriptor().getMessageType(8); + internal_static_google_cloud_sql_v1_Database_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_Database_descriptor, + new java.lang.String[] { + "Kind", + "Charset", + "Collation", + "Etag", + "Name", + "Instance", + "SelfLink", + "Project", + "SqlserverDatabaseDetails", + "DatabaseDetails", + }); + internal_static_google_cloud_sql_v1_SqlServerDatabaseDetails_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_cloud_sql_v1_SqlServerDatabaseDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlServerDatabaseDetails_descriptor, + new java.lang.String[] { + "CompatibilityLevel", "RecoveryModel", + }); + internal_static_google_cloud_sql_v1_DatabaseFlags_descriptor = + getDescriptor().getMessageType(10); + internal_static_google_cloud_sql_v1_DatabaseFlags_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_DatabaseFlags_descriptor, + new java.lang.String[] { + "Name", "Value", + }); + internal_static_google_cloud_sql_v1_MySqlSyncConfig_descriptor = + getDescriptor().getMessageType(11); + internal_static_google_cloud_sql_v1_MySqlSyncConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_MySqlSyncConfig_descriptor, + new java.lang.String[] { + "InitialSyncFlags", + }); + internal_static_google_cloud_sql_v1_SyncFlags_descriptor = getDescriptor().getMessageType(12); + internal_static_google_cloud_sql_v1_SyncFlags_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SyncFlags_descriptor, + new java.lang.String[] { + "Name", "Value", + }); + internal_static_google_cloud_sql_v1_InstanceReference_descriptor = + getDescriptor().getMessageType(13); + internal_static_google_cloud_sql_v1_InstanceReference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_InstanceReference_descriptor, + new java.lang.String[] { + "Name", "Region", "Project", + }); + internal_static_google_cloud_sql_v1_DemoteMasterConfiguration_descriptor = + getDescriptor().getMessageType(14); + internal_static_google_cloud_sql_v1_DemoteMasterConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_DemoteMasterConfiguration_descriptor, + new java.lang.String[] { + "Kind", "MysqlReplicaConfiguration", + }); + internal_static_google_cloud_sql_v1_DemoteMasterMySqlReplicaConfiguration_descriptor = + getDescriptor().getMessageType(15); + internal_static_google_cloud_sql_v1_DemoteMasterMySqlReplicaConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_DemoteMasterMySqlReplicaConfiguration_descriptor, + new java.lang.String[] { + "Kind", "Username", "Password", "ClientKey", "ClientCertificate", "CaCertificate", + }); + internal_static_google_cloud_sql_v1_ExportContext_descriptor = + getDescriptor().getMessageType(16); + internal_static_google_cloud_sql_v1_ExportContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ExportContext_descriptor, + new java.lang.String[] { + "Uri", + "Databases", + "Kind", + "SqlExportOptions", + "CsvExportOptions", + "FileType", + "Offload", + "BakExportOptions", + "TdeExportOptions", + }); + internal_static_google_cloud_sql_v1_ExportContext_SqlCsvExportOptions_descriptor = + internal_static_google_cloud_sql_v1_ExportContext_descriptor.getNestedType(0); + internal_static_google_cloud_sql_v1_ExportContext_SqlCsvExportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ExportContext_SqlCsvExportOptions_descriptor, + new java.lang.String[] { + "SelectQuery", + "EscapeCharacter", + "QuoteCharacter", + "FieldsTerminatedBy", + "LinesTerminatedBy", + }); + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_descriptor = + internal_static_google_cloud_sql_v1_ExportContext_descriptor.getNestedType(1); + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_descriptor, + new java.lang.String[] { + "Tables", + "SchemaOnly", + "MysqlExportOptions", + "Threads", + "Parallel", + "PostgresExportOptions", + }); + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_MysqlExportOptions_descriptor = + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_descriptor.getNestedType( + 0); + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_MysqlExportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_MysqlExportOptions_descriptor, + new java.lang.String[] { + "MasterData", + }); + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_PostgresExportOptions_descriptor = + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_descriptor.getNestedType( + 1); + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_PostgresExportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_PostgresExportOptions_descriptor, + new java.lang.String[] { + "Clean", "IfExists", + }); + internal_static_google_cloud_sql_v1_ExportContext_SqlBakExportOptions_descriptor = + internal_static_google_cloud_sql_v1_ExportContext_descriptor.getNestedType(2); + internal_static_google_cloud_sql_v1_ExportContext_SqlBakExportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ExportContext_SqlBakExportOptions_descriptor, + new java.lang.String[] { + "Striped", + "StripeCount", + "BakType", + "CopyOnly", + "DifferentialBase", + "ExportLogStartTime", + "ExportLogEndTime", + }); + internal_static_google_cloud_sql_v1_ExportContext_SqlTdeExportOptions_descriptor = + internal_static_google_cloud_sql_v1_ExportContext_descriptor.getNestedType(3); + internal_static_google_cloud_sql_v1_ExportContext_SqlTdeExportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ExportContext_SqlTdeExportOptions_descriptor, + new java.lang.String[] { + "CertificatePath", "PrivateKeyPath", "PrivateKeyPassword", "Name", + }); + internal_static_google_cloud_sql_v1_ImportContext_descriptor = + getDescriptor().getMessageType(17); + internal_static_google_cloud_sql_v1_ImportContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ImportContext_descriptor, + new java.lang.String[] { + "Uri", + "Database", + "Kind", + "FileType", + "CsvImportOptions", + "ImportUser", + "BakImportOptions", + "SqlImportOptions", + "TdeImportOptions", + }); + internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_descriptor = + internal_static_google_cloud_sql_v1_ImportContext_descriptor.getNestedType(0); + internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_descriptor, + new java.lang.String[] { + "Threads", "Parallel", "PostgresImportOptions", + }); + internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_PostgresImportOptions_descriptor = + internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_descriptor.getNestedType( + 0); + internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_PostgresImportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_PostgresImportOptions_descriptor, + new java.lang.String[] { + "Clean", "IfExists", + }); + internal_static_google_cloud_sql_v1_ImportContext_SqlCsvImportOptions_descriptor = + internal_static_google_cloud_sql_v1_ImportContext_descriptor.getNestedType(1); + internal_static_google_cloud_sql_v1_ImportContext_SqlCsvImportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ImportContext_SqlCsvImportOptions_descriptor, + new java.lang.String[] { + "Table", + "Columns", + "EscapeCharacter", + "QuoteCharacter", + "FieldsTerminatedBy", + "LinesTerminatedBy", + }); + internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_descriptor = + internal_static_google_cloud_sql_v1_ImportContext_descriptor.getNestedType(2); + internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_descriptor, + new java.lang.String[] { + "EncryptionOptions", + "Striped", + "NoRecovery", + "RecoveryOnly", + "BakType", + "StopAt", + "StopAtMark", + }); + internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_EncryptionOptions_descriptor = + internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_descriptor + .getNestedType(0); + internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_EncryptionOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_EncryptionOptions_descriptor, + new java.lang.String[] { + "CertPath", "PvkPath", "PvkPassword", "KeepEncrypted", + }); + internal_static_google_cloud_sql_v1_ImportContext_SqlTdeImportOptions_descriptor = + internal_static_google_cloud_sql_v1_ImportContext_descriptor.getNestedType(3); + internal_static_google_cloud_sql_v1_ImportContext_SqlTdeImportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ImportContext_SqlTdeImportOptions_descriptor, + new java.lang.String[] { + "CertificatePath", "PrivateKeyPath", "PrivateKeyPassword", "Name", + }); + internal_static_google_cloud_sql_v1_IpConfiguration_descriptor = + getDescriptor().getMessageType(18); + internal_static_google_cloud_sql_v1_IpConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_IpConfiguration_descriptor, + new java.lang.String[] { + "Ipv4Enabled", + "PrivateNetwork", + "RequireSsl", + "AuthorizedNetworks", + "AllocatedIpRange", + "EnablePrivatePathForGoogleCloudServices", + "SslMode", + "PscConfig", + "ServerCaMode", + "CustomSubjectAlternativeNames", + "ServerCaPool", + "ServerCertificateRotationMode", + }); + internal_static_google_cloud_sql_v1_PscConfig_descriptor = getDescriptor().getMessageType(19); + internal_static_google_cloud_sql_v1_PscConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_PscConfig_descriptor, + new java.lang.String[] { + "PscEnabled", + "AllowedConsumerProjects", + "PscAutoConnections", + "NetworkAttachmentUri", + "PscAutoDnsEnabled", + "PscWriteEndpointDnsEnabled", + "PscAutoConnectionPolicyEnabled", + }); + internal_static_google_cloud_sql_v1_PscAutoConnectionConfig_descriptor = + getDescriptor().getMessageType(20); + internal_static_google_cloud_sql_v1_PscAutoConnectionConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_PscAutoConnectionConfig_descriptor, + new java.lang.String[] { + "ConsumerProject", + "ConsumerNetwork", + "IpAddress", + "Status", + "ConsumerNetworkStatus", + "ServiceConnectionPolicy", + "ServiceConnectionPolicyCreationResult", + "InstanceAutoDnsStatus", + "WriteEndpointAutoDnsStatus", + }); + internal_static_google_cloud_sql_v1_LocationPreference_descriptor = + getDescriptor().getMessageType(21); + internal_static_google_cloud_sql_v1_LocationPreference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_LocationPreference_descriptor, + new java.lang.String[] { + "FollowGaeApplication", "Zone", "SecondaryZone", "Kind", + }); + internal_static_google_cloud_sql_v1_MaintenanceWindow_descriptor = + getDescriptor().getMessageType(22); + internal_static_google_cloud_sql_v1_MaintenanceWindow_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_MaintenanceWindow_descriptor, + new java.lang.String[] { + "Hour", "Day", "UpdateTrack", "Kind", + }); + internal_static_google_cloud_sql_v1_DenyMaintenancePeriod_descriptor = + getDescriptor().getMessageType(23); + internal_static_google_cloud_sql_v1_DenyMaintenancePeriod_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_DenyMaintenancePeriod_descriptor, + new java.lang.String[] { + "StartDate", "EndDate", "Time", + }); + internal_static_google_cloud_sql_v1_InsightsConfig_descriptor = + getDescriptor().getMessageType(24); + internal_static_google_cloud_sql_v1_InsightsConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_InsightsConfig_descriptor, + new java.lang.String[] { + "QueryInsightsEnabled", + "RecordClientAddress", + "RecordApplicationTags", + "QueryStringLength", + "QueryPlansPerMinute", + "EnhancedQueryInsightsEnabled", + }); + internal_static_google_cloud_sql_v1_MySqlReplicaConfiguration_descriptor = + getDescriptor().getMessageType(25); + internal_static_google_cloud_sql_v1_MySqlReplicaConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_MySqlReplicaConfiguration_descriptor, + new java.lang.String[] { + "DumpFilePath", + "Username", + "Password", + "ConnectRetryInterval", + "MasterHeartbeatPeriod", + "CaCertificate", + "ClientCertificate", + "ClientKey", + "SslCipher", + "VerifyServerCertificate", + "Kind", + }); + internal_static_google_cloud_sql_v1_DiskEncryptionConfiguration_descriptor = + getDescriptor().getMessageType(26); + internal_static_google_cloud_sql_v1_DiskEncryptionConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_DiskEncryptionConfiguration_descriptor, + new java.lang.String[] { + "KmsKeyName", "Kind", + }); + internal_static_google_cloud_sql_v1_DiskEncryptionStatus_descriptor = + getDescriptor().getMessageType(27); + internal_static_google_cloud_sql_v1_DiskEncryptionStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_DiskEncryptionStatus_descriptor, + new java.lang.String[] { + "KmsKeyVersionName", "Kind", + }); + internal_static_google_cloud_sql_v1_IpMapping_descriptor = getDescriptor().getMessageType(28); + internal_static_google_cloud_sql_v1_IpMapping_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_IpMapping_descriptor, + new java.lang.String[] { + "Type", "IpAddress", "TimeToRetire", + }); + internal_static_google_cloud_sql_v1_SqlSubOperationType_descriptor = + getDescriptor().getMessageType(29); + internal_static_google_cloud_sql_v1_SqlSubOperationType_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlSubOperationType_descriptor, + new java.lang.String[] { + "MaintenanceType", "SubOperationDetails", + }); + internal_static_google_cloud_sql_v1_Operation_descriptor = getDescriptor().getMessageType(30); + internal_static_google_cloud_sql_v1_Operation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_Operation_descriptor, + new java.lang.String[] { + "Kind", + "TargetLink", + "Status", + "User", + "InsertTime", + "StartTime", + "EndTime", + "Error", + "ApiWarning", + "OperationType", + "ImportContext", + "ExportContext", + "BackupContext", + "PreCheckMajorVersionUpgradeContext", + "Name", + "TargetId", + "SelfLink", + "TargetProject", + "AcquireSsrsLeaseContext", + "SubOperationType", + }); + internal_static_google_cloud_sql_v1_OperationError_descriptor = + getDescriptor().getMessageType(31); + internal_static_google_cloud_sql_v1_OperationError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_OperationError_descriptor, + new java.lang.String[] { + "Kind", "Code", "Message", + }); + internal_static_google_cloud_sql_v1_OperationErrors_descriptor = + getDescriptor().getMessageType(32); + internal_static_google_cloud_sql_v1_OperationErrors_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_OperationErrors_descriptor, + new java.lang.String[] { + "Kind", "Errors", + }); + internal_static_google_cloud_sql_v1_PasswordValidationPolicy_descriptor = + getDescriptor().getMessageType(33); + internal_static_google_cloud_sql_v1_PasswordValidationPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_PasswordValidationPolicy_descriptor, + new java.lang.String[] { + "MinLength", + "Complexity", + "ReuseInterval", + "DisallowUsernameSubstring", + "PasswordChangeInterval", + "EnablePasswordPolicy", + "DisallowCompromisedCredentials", + }); + internal_static_google_cloud_sql_v1_DataCacheConfig_descriptor = + getDescriptor().getMessageType(34); + internal_static_google_cloud_sql_v1_DataCacheConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_DataCacheConfig_descriptor, + new java.lang.String[] { + "DataCacheEnabled", + }); + internal_static_google_cloud_sql_v1_FinalBackupConfig_descriptor = + getDescriptor().getMessageType(35); + internal_static_google_cloud_sql_v1_FinalBackupConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_FinalBackupConfig_descriptor, + new java.lang.String[] { + "Enabled", "RetentionDays", + }); + internal_static_google_cloud_sql_v1_Settings_descriptor = getDescriptor().getMessageType(36); + internal_static_google_cloud_sql_v1_Settings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_Settings_descriptor, + new java.lang.String[] { + "SettingsVersion", + "AuthorizedGaeApplications", + "Tier", + "Kind", + "UserLabels", + "AvailabilityType", + "PricingPlan", + "ReplicationType", + "StorageAutoResizeLimit", + "ActivationPolicy", + "IpConfiguration", + "StorageAutoResize", + "LocationPreference", + "DatabaseFlags", + "DataDiskType", + "MaintenanceWindow", + "BackupConfiguration", + "DatabaseReplicationEnabled", + "CrashSafeReplicationEnabled", + "DataDiskSizeGb", + "ActiveDirectoryConfig", + "Collation", + "DenyMaintenancePeriods", + "InsightsConfig", + "PasswordValidationPolicy", + "SqlServerAuditConfig", + "Edition", + "ConnectorEnforcement", + "DeletionProtectionEnabled", + "TimeZone", + "AdvancedMachineFeatures", + "DataCacheConfig", + "ReplicationLagMaxSeconds", + "EnableGoogleMlIntegration", + "EnableDataplexIntegration", + "RetainBackupsOnDelete", + "DataDiskProvisionedIops", + "DataDiskProvisionedThroughput", + "ConnectionPoolConfig", + "FinalBackupConfig", + "ReadPoolAutoScaleConfig", + "AcceleratedReplicaMode", + "AutoUpgradeEnabled", + "EntraidConfig", + "DataApiAccess", + "PerformanceCaptureConfig", + }); + internal_static_google_cloud_sql_v1_Settings_UserLabelsEntry_descriptor = + internal_static_google_cloud_sql_v1_Settings_descriptor.getNestedType(0); + internal_static_google_cloud_sql_v1_Settings_UserLabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_Settings_UserLabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_sql_v1_PerformanceCaptureConfig_descriptor = + getDescriptor().getMessageType(37); + internal_static_google_cloud_sql_v1_PerformanceCaptureConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_PerformanceCaptureConfig_descriptor, + new java.lang.String[] { + "Enabled", + "ProbingIntervalSeconds", + "ProbeThreshold", + "RunningThreadsThreshold", + "SecondsBehindSourceThreshold", + "TransactionDurationThreshold", + "CpuUtilizationThresholdPercent", + "MemoryUsageThresholdPercent", + "TransactionLockWaitThresholdCount", + "SemaphoreWaitThresholdCount", + "HistoryListLengthThresholdCount", + "TransactionKillThresholdSeconds", + "TransactionKillExcludedUserHosts", + "TransactionKillType", + }); + internal_static_google_cloud_sql_v1_ConnectionPoolFlags_descriptor = + getDescriptor().getMessageType(38); + internal_static_google_cloud_sql_v1_ConnectionPoolFlags_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ConnectionPoolFlags_descriptor, + new java.lang.String[] { + "Name", "Value", + }); + internal_static_google_cloud_sql_v1_ConnectionPoolConfig_descriptor = + getDescriptor().getMessageType(39); + internal_static_google_cloud_sql_v1_ConnectionPoolConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ConnectionPoolConfig_descriptor, + new java.lang.String[] { + "ConnectionPoolingEnabled", "Flags", "PoolerCount", + }); + internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_descriptor = + getDescriptor().getMessageType(40); + internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_descriptor, + new java.lang.String[] { + "Enabled", + "MinNodeCount", + "MaxNodeCount", + "TargetMetrics", + "DisableScaleIn", + "ScaleInCooldownSeconds", + "ScaleOutCooldownSeconds", + }); + internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_TargetMetric_descriptor = + internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_descriptor.getNestedType(0); + internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_TargetMetric_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_TargetMetric_descriptor, + new java.lang.String[] { + "Metric", "TargetValue", + }); + internal_static_google_cloud_sql_v1_AdvancedMachineFeatures_descriptor = + getDescriptor().getMessageType(41); + internal_static_google_cloud_sql_v1_AdvancedMachineFeatures_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_AdvancedMachineFeatures_descriptor, + new java.lang.String[] { + "ThreadsPerCore", + }); + internal_static_google_cloud_sql_v1_SslCert_descriptor = getDescriptor().getMessageType(42); + internal_static_google_cloud_sql_v1_SslCert_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SslCert_descriptor, + new java.lang.String[] { + "Kind", + "CertSerialNumber", + "Cert", + "CreateTime", + "CommonName", + "ExpirationTime", + "Sha1Fingerprint", + "Instance", + "SelfLink", + }); + internal_static_google_cloud_sql_v1_SslCertDetail_descriptor = + getDescriptor().getMessageType(43); + internal_static_google_cloud_sql_v1_SslCertDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SslCertDetail_descriptor, + new java.lang.String[] { + "CertInfo", "CertPrivateKey", + }); + internal_static_google_cloud_sql_v1_SqlActiveDirectoryConfig_descriptor = + getDescriptor().getMessageType(44); + internal_static_google_cloud_sql_v1_SqlActiveDirectoryConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlActiveDirectoryConfig_descriptor, + new java.lang.String[] { + "Kind", + "Domain", + "Mode", + "DnsServers", + "AdminCredentialSecretName", + "OrganizationalUnit", + }); + internal_static_google_cloud_sql_v1_SqlServerAuditConfig_descriptor = + getDescriptor().getMessageType(45); + internal_static_google_cloud_sql_v1_SqlServerAuditConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlServerAuditConfig_descriptor, + new java.lang.String[] { + "Kind", "Bucket", "RetentionInterval", "UploadInterval", + }); + internal_static_google_cloud_sql_v1_SqlServerEntraIdConfig_descriptor = + getDescriptor().getMessageType(46); + internal_static_google_cloud_sql_v1_SqlServerEntraIdConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlServerEntraIdConfig_descriptor, + new java.lang.String[] { + "Kind", "TenantId", "ApplicationId", + }); + internal_static_google_cloud_sql_v1_AcquireSsrsLeaseContext_descriptor = + getDescriptor().getMessageType(47); + internal_static_google_cloud_sql_v1_AcquireSsrsLeaseContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_AcquireSsrsLeaseContext_descriptor, + new java.lang.String[] { + "SetupLogin", "ServiceLogin", "ReportDatabase", "Duration", + }); + internal_static_google_cloud_sql_v1_DnsNameMapping_descriptor = + getDescriptor().getMessageType(48); + internal_static_google_cloud_sql_v1_DnsNameMapping_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_DnsNameMapping_descriptor, + new java.lang.String[] { + "Name", "ConnectionType", "DnsScope", "RecordManager", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.FieldInfoProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.FieldInfoProto.fieldInfo); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlServiceProto.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlServiceProto.java new file mode 100644 index 000000000000..b28ed2e4c17b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CloudSqlServiceProto.java @@ -0,0 +1,2348 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public final class CloudSqlServiceProto extends com.google.protobuf.GeneratedFile { + private CloudSqlServiceProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlServiceProto"); + } + + 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_sql_v1_SqlInstancesAddServerCaRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesAddServerCaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesAddServerCertificateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesAddServerCertificateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesAddEntraIdCertificateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesAddEntraIdCertificateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesCloneRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesCloneRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesDeleteRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesDeleteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesDemoteMasterRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesDemoteMasterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesDemoteRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesDemoteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesExportRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesExportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesFailoverRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesFailoverRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesGetRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesGetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesImportRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesImportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesInsertRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesInsertRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesListRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesListRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesListServerCasRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesListServerCasRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesListServerCertificatesRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesListServerCertificatesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesListEntraIdCertificatesRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesListEntraIdCertificatesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesPatchRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesPatchRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesPromoteReplicaRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesPromoteReplicaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesSwitchoverRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesSwitchoverRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesResetSslConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesResetSslConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesRestartRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesRestartRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesRestoreBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesRestoreBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesRotateServerCaRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesRotateServerCaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesRotateServerCertificateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesRotateServerCertificateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesRotateEntraIdCertificateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesRotateEntraIdCertificateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesStartReplicaRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesStartReplicaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesStopReplicaRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesStopReplicaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesTruncateLogRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesTruncateLogRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesPerformDiskShrinkRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesPerformDiskShrinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesUpdateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesUpdateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesReencryptRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesReencryptRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesReencryptRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesReencryptRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_BackupReencryptionConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_BackupReencryptionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ExternalSyncSelectedObject_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ExternalSyncSelectedObject_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesGetDiskShrinkConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesGetDiskShrinkConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesVerifyExternalSyncSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesVerifyExternalSyncSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesStartExternalSyncRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesStartExternalSyncRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesResetReplicaSizeRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesResetReplicaSizeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesCreateEphemeralCertRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesCreateEphemeralCertRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesCloneRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesCloneRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesDemoteMasterRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesDemoteMasterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesDemoteRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesDemoteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesExportRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesExportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesFailoverRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesFailoverRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SslCertsCreateEphemeralRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SslCertsCreateEphemeralRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesImportRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesImportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesPreCheckMajorVersionUpgradeRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesPreCheckMajorVersionUpgradeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesListResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesListResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesListServerCasResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesListServerCasResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesListServerCertificatesResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesListServerCertificatesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesListEntraIdCertificatesResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesListEntraIdCertificatesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesRestoreBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesRestoreBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesRotateServerCaRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesRotateServerCaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesRotateServerCertificateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesRotateServerCertificateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesRotateEntraIdCertificateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesRotateEntraIdCertificateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesTruncateLogRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesTruncateLogRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_InstancesAcquireSsrsLeaseRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_InstancesAcquireSsrsLeaseRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesPreCheckMajorVersionUpgradeRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesPreCheckMajorVersionUpgradeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesVerifyExternalSyncSettingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesVerifyExternalSyncSettingsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesGetDiskShrinkConfigResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesGetDiskShrinkConfigResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesGetLatestRecoveryTimeRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesGetLatestRecoveryTimeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesGetLatestRecoveryTimeResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesGetLatestRecoveryTimeResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_CloneContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_CloneContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_PointInTimeRestoreContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_PointInTimeRestoreContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_BinLogCoordinates_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_BinLogCoordinates_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DatabaseInstance_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DatabaseInstance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DatabaseInstance_SqlFailoverReplica_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DatabaseInstance_SqlFailoverReplica_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DatabaseInstance_SqlScheduledMaintenance_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DatabaseInstance_SqlScheduledMaintenance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DatabaseInstance_SqlOutOfDiskReport_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DatabaseInstance_SqlOutOfDiskReport_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DatabaseInstance_PoolNodeConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DatabaseInstance_PoolNodeConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DatabaseInstance_TagsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DatabaseInstance_TagsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_GeminiInstanceConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_GeminiInstanceConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ReplicationCluster_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ReplicationCluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_AvailableDatabaseVersion_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_AvailableDatabaseVersion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequestBody_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequestBody_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DemoteMasterContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DemoteMasterContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_DemoteContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_DemoteContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_FailoverContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_FailoverContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_RestoreBackupContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_RestoreBackupContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_RotateServerCaContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_RotateServerCaContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_RotateServerCertificateContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_RotateServerCertificateContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_RotateEntraIdCertificateContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_RotateEntraIdCertificateContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_TruncateLogContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_TruncateLogContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlExternalSyncSettingError_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlExternalSyncSettingError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SelectedObjects_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SelectedObjects_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_OnPremisesConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_OnPremisesConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ReplicaConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ReplicaConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_ExecuteSqlPayload_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_ExecuteSqlPayload_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlResponse_Message_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlResponse_Message_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_QueryResult_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_QueryResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_Column_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_Column_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_Row_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_Row_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_Value_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_Value_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_Metadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_Metadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesAcquireSsrsLeaseRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesAcquireSsrsLeaseRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesAcquireSsrsLeaseResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesAcquireSsrsLeaseResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesReleaseSsrsLeaseRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesReleaseSsrsLeaseRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesReleaseSsrsLeaseResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesReleaseSsrsLeaseResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1_SqlInstancesPointInTimeRestoreRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1_SqlInstancesPointInTimeRestoreRequest_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/sql/v1/cloud_sql_instance" + + "s.proto\022\023google.cloud.sql.v1\032\034google/api" + + "/annotations.proto\032\027google/api/client.pr" + + "oto\032\037google/api/field_behavior.proto\032\031go" + + "ogle/api/resource.proto\032-google/cloud/sq" + + "l/v1/cloud_sql_resources.proto\032\036google/p" + + "rotobuf/duration.proto\032\037google/protobuf/" + + "timestamp.proto\032\036google/protobuf/wrappers.proto\032\027google/rpc/status.proto\"C\n" + + "\036SqlInstancesAddServerCaRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"L\n" + + "\'SqlInstancesAddServerCertificateRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"W\n" + + "(SqlInstancesAddEntraIdCertificateRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\"\206\001\n" + + "\030SqlInstancesCloneRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\022=\n" + + "\004body\030d \001(\0132*.g" + + "oogle.cloud.sql.v1.InstancesCloneRequestB\003\340A\002\"\230\002\n" + + "\031SqlInstancesDeleteRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022 \n" + + "\023enable_final_backup\030\007 \001(\010H\001\210\001\001\022$\n" + + "\025final_backup_ttl_days\030\004 \001(\003B\003\340A\001H\000\022C\n" + + "\030final_backup_expiry_time\030\006" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\001H\000\022%\n" + + "\030final_backup_description\030\005 \001(\tB\003\340A\001B\014\n\n" + + "expirationB\026\n" + + "\024_enable_final_backup\"\205\001\n" + + "\037SqlInstancesDemoteMasterRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022?\n" + + "\004body\030d \001(\01321.google.cloud.sql.v1.InstancesDemoteMasterRequest\"\210\001\n" + + "\031SqlInstancesDemoteRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\022>\n" + + "\004body\030d \001(\0132+.goog" + + "le.cloud.sql.v1.InstancesDemoteRequestB\003\340A\002\"y\n" + + "\031SqlInstancesExportRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\0229\n" + + "\004body\030d \001(\0132+.google.cloud.sql.v1.InstancesExportRequest\"}\n" + + "\033SqlInstancesFailoverRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022;\n" + + "\004body\030d \001(\0132-.google.cloud.sql.v1.InstancesFailoverRequest\"E\n" + + "\026SqlInstancesGetRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\"y\n" + + "\031SqlInstancesImportRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\0229\n" + + "\004body\030d \001(\0132+.google.cloud.sql.v1.InstancesImportRequest\"a\n" + + "\031SqlInstancesInsertRequest\022\017\n" + + "\007project\030\001 \001(\t\0223\n" + + "\004body\030d \001(\0132%.google.cloud.sql.v1.DatabaseInstance\"c\n" + + "\027SqlInstancesListRequest\022\016\n" + + "\006filter\030\001 \001(\t\022\023\n" + + "\013max_results\030\002 \001(\r" + + "\022\022\n\n" + + "page_token\030\003 \001(\t\022\017\n" + + "\007project\030\004 \001(\t\"E\n" + + " SqlInstancesListServerCasRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"X\n" + + ")SqlInstancesListServerCertificatesRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\"Y\n" + + "*SqlInstancesListEntraIdCertificatesRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\"\220\002\n" + + "\030SqlInstancesPatchRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022*\n" + + "\030reconcile_psc_networking\030\004 \001(\010B\003\340A\001H\000\210\001\001\0220\n" + + "\036reconcile_psc_networking_force\030\005" + + " \001(\010B\003\340A\001H\001\210\001\001\0223\n" + + "\004body\030d \001(\0132%.google.cloud.sql.v1.DatabaseInstanceB\033\n" + + "\031_reconcile_psc_networkingB!\n" + + "\037_reconcile_psc_networking_force\"X\n" + + "!SqlInstancesPromoteReplicaRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022\020\n" + + "\010failover\030\003 \001(\010\"v\n" + + "\035SqlInstancesSwitchoverRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\0222\n\n" + + "db_timeout\030\003 \001(\0132\031.google.protobuf.DurationB\003\340A\001\"\356\001\n" + + "!SqlInstancesResetSslConfigRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022V\n" + + "\004mode\030\003 \001(\0162C.google" + + ".cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslModeB\003\340A\001\"N\n" + + "\014ResetSslMode\022\036\n" + + "\032RESET_SSL_MODE_UNSPECIFIED\020\000\022\007\n" + + "\003ALL\020\001\022\025\n" + + "\021SYNC_FROM_PRIMARY\020\002\"?\n" + + "\032SqlInstancesRestartRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"\207\001\n" + + " SqlInstancesRestoreBackupRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022@\n" + + "\004body\030d" + + " \001(\01322.google.cloud.sql.v1.InstancesRestoreBackupRequest\"\211\001\n" + + "!SqlInstancesRotateServerCaRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022A\n" + + "\004body\030d \001(\01323.go" + + "ogle.cloud.sql.v1.InstancesRotateServerCaRequest\"\252\001\n" + + "*SqlInstancesRotateServerCertificateRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\022O\n" + + "\004body\030d \001(\0132<.goo" + + "gle.cloud.sql.v1.InstancesRotateServerCertificateRequestB\003\340A\001\"\254\001\n" + + "+SqlInstancesRotateEntraIdCertificateRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\022P\n" + + "\004body\030d" + + " \001(\0132=.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequestB\003\340A\001\"D\n" + + "\037SqlInstancesStartReplicaRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"C\n" + + "\036SqlInstancesStopReplicaRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"\203\001\n" + + "\036SqlInstancesTruncateLogRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022>\n" + + "\004body\030d \001(\01320.google.cloud.sql.v1.InstancesTruncateLogRequest\"\206\001\n" + + "$SqlInstancesPerformDiskShrinkRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022;\n" + + "\004body\030d \001(\0132-.google.cloud.sql.v1.PerformDiskShrinkContext\"s\n" + + "\031SqlInstancesUpdateRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\0223\n" + + "\004body\030d \001(\0132%.google.cloud.sql.v1.DatabaseInstance\"\236\001\n" + + "(SqlInstancesRescheduleMaintenanceRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022O\n" + + "\004body\030d \001(\0132A.google.cloud.sql.v1." + + "SqlInstancesRescheduleMaintenanceRequestBody\"\177\n" + + "\034SqlInstancesReencryptRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022<\n" + + "\004body\030\003 \001(\0132..google.cloud.sql.v1.InstancesReencryptRequest\"\222\001\n" + + "\031InstancesReencryptRequest\022V\n" + + "\032backup_reencryption_config\030\001 \001(\0132" + + "-.google.cloud.sql.v1.BackupReencryptionConfigH\000\210\001\001B\035\n" + + "\033_backup_reencryption_config\"\363\001\n" + + "\030BackupReencryptionConfig\022\031\n" + + "\014backup_limit\030\001 \001(\005H\000\210\001\001\022R\n" + + "\013backup_type\030\002 \001(\0162" + + "8.google.cloud.sql.v1.BackupReencryptionConfig.BackupTypeH\001\210\001\001\"G\n\n" + + "BackupType\022\033\n" + + "\027BACKUP_TYPE_UNSPECIFIED\020\000\022\r\n" + + "\tAUTOMATED\020\001\022\r\n" + + "\tON_DEMAND\020\002B\017\n\r" + + "_backup_limitB\016\n" + + "\014_backup_type\".\n" + + "\032ExternalSyncSelectedObject\022\020\n" + + "\010database\030\001 \001(\t\"K\n" + + "&SqlInstancesGetDiskShrinkConfigRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"\205\006\n" + + "-SqlInstancesVerifyExternalSyncSettingsRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022\036\n" + + "\026verify_connection_only\030\003 \001(\010\022f\n" + + "\tsync_mode\030\004 \001(\0162S.google.c" + + "loud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode\022$\n" + + "\027verify_replication_only\030\005 \001(\010B\003\340A\001\022F\n" + + "\021mysql_sync_config\030\006" + + " \001(\0132$.google.cloud.sql.v1.MySqlSyncConfigB\003\340A\001H\000\022m\n" + + "\016migration_type\030\007 \001(\0162P.google.cloud.sql.v1.SqlInstan" + + "cesVerifyExternalSyncSettingsRequest.MigrationTypeB\003\340A\001\022P\n" + + "\023sync_parallel_level\030\010" + + " \001(\0162..google.cloud.sql.v1.ExternalSyncParallelLevelB\003\340A\001\022N\n" + + "\020selected_objects\030\t " + + "\003(\0132/.google.cloud.sql.v1.ExternalSyncSelectedObjectB\003\340A\001\"O\n" + + "\020ExternalSyncMode\022\"\n" + + "\036EXTERNAL_SYNC_MODE_UNSPECIFIED\020\000\022\n\n" + + "\006ONLINE\020\001\022\013\n" + + "\007OFFLINE\020\002\"J\n\r" + + "MigrationType\022\036\n" + + "\032MIGRATION_TYPE_UNSPECIFIED\020\000\022\013\n" + + "\007LOGICAL\020\001\022\014\n" + + "\010PHYSICAL\020\002B\r\n" + + "\013sync_config\"\207\004\n" + + "$SqlInstancesStartExternalSyncRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022f\n" + + "\tsync_mode\030\003 \001(\0162S.google.cloud.sql.v1.SqlInstancesV" + + "erifyExternalSyncSettingsRequest.ExternalSyncMode\022\031\n" + + "\021skip_verification\030\004 \001(\010\022A\n" + + "\021mysql_sync_config\030\006" + + " \001(\0132$.google.cloud.sql.v1.MySqlSyncConfigH\000\022P\n" + + "\023sync_parallel_level\030\007" + + " \001(\0162..google.cloud.sql.v1.ExternalSyncParallelLevelB\003\340A\001\022m\n" + + "\016migration_type\030\010 \001(\0162P.google.cloud.sql.v1.SqlInsta" + + "ncesVerifyExternalSyncSettingsRequest.MigrationTypeB\003\340A\001\022&\n" + + "\031replica_overwrite_enabled\030\t \001(\010B\003\340A\001B\r\n" + + "\013sync_config\"H\n" + + "#SqlInstancesResetReplicaSizeRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"\216\001\n" + + "&SqlInstancesCreateEphemeralCertRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022A\n" + + "\004body\030d \001(\01323.google.cloud.sql.v1.SslCertsCreateEphemeralRequest\"V\n" + + "\025InstancesCloneRequest\022=\n\r" + + "clone_context\030\001 \001(\0132!.google.cloud.sql.v1.CloneContextB\003\340A\002\"g\n" + + "\034InstancesDemoteMasterRequest\022G\n" + + "\025demote_master_context\030\001 \001(" + + "\0132(.google.cloud.sql.v1.DemoteMasterContext\"Y\n" + + "\026InstancesDemoteRequest\022?\n" + + "\016demote_context\030\001" + + " \001(\0132\".google.cloud.sql.v1.DemoteContextB\003\340A\002\"T\n" + + "\026InstancesExportRequest\022:\n" + + "\016export_context\030\001 \001(\0132\".google.cloud.sql.v1.ExportContext\"Z\n" + + "\030InstancesFailoverRequest\022>\n" + + "\020failover_context\030\001 \001(\0132$.google.cloud.sql.v1.FailoverContext\"d\n" + + "\036SslCertsCreateEphemeralRequest\022\036\n\n" + + "public_key\030\001 \001(\tR\n" + + "public_key\022\"\n" + + "\014access_token\030\002 \001(\tR\014access_token\"T\n" + + "\026InstancesImportRequest\022:\n" + + "\016import_context\030\001 \001(\0132\".google.cloud.sql.v1.ImportContext\"\234\001\n" + + "+InstancesPreCheckMajorVersionUpgradeRequest\022m\n" + + "\'pre_check_major_version_upgrade_context\030\001 \001(\01327." + + "google.cloud.sql.v1.PreCheckMajorVersionUpgradeContextB\003\340A\002\"\247\001\n" + + "\025InstancesListResponse\022\014\n" + + "\004kind\030\001 \001(\t\0221\n" + + "\010warnings\030\002 \003(\0132\037.google.cloud.sql.v1.ApiWarning\0224\n" + + "\005items\030\003 \003(\0132%.google.cloud.sql.v1.DatabaseInstance\022\027\n" + + "\017next_page_token\030\004 \001(\t\"s\n" + + "\036InstancesListServerCasResponse\022+\n" + + "\005certs\030\001 \003(\0132\034.google.cloud.sql.v1.SslCert\022\026\n" + + "\016active_version\030\002 \001(\t\022\014\n" + + "\004kind\030\003 \001(\t\"\263\001\n" + + "\'InstancesListServerCertificatesResponse\022.\n" + + "\010ca_certs\030\001 \003(\0132\034.google.cloud.sql.v1.SslCert\0222\n" + + "\014server_certs\030\002 \003(\0132\034.google.cloud.sql.v1.SslCert\022\026\n" + + "\016active_version\030\003 \001(\t\022\014\n" + + "\004kind\030\004 \001(\t\"}\n" + + "(InstancesListEntraIdCertificatesResponse\022+\n" + + "\005certs\030\001 \003(\0132\034.google.cloud.sql.v1.SslCert\022\026\n" + + "\016active_version\030\002 \001(\t\022\014\n" + + "\004kind\030\003 \001(\t\"\347\002\n" + + "\035InstancesRestoreBackupRequest\022I\n" + + "\026restore_backup_context\030\001 \001(" + + "\0132).google.cloud.sql.v1.RestoreBackupContext\0223\n" + + "\006backup\030\002 \001(\tB#\372A \n" + + "\036sqladmin.googleapis.com/Backup\022<\n" + + "\017backupdr_backup\030\004 \001(\tB#\372A \n" + + "\036backupdr.googleapis.com/Backup\022M\n" + + "\031restore_instance_settings\030\003 \001(\0132%.goo" + + "gle.cloud.sql.v1.DatabaseInstanceB\003\340A\001\0229\n" + + ",restore_instance_clear_overrides_field_names\030\005 \003(\tB\003\340A\001\"n\n" + + "\036InstancesRotateServerCaRequest\022L\n" + + "\030rotate_server_ca_context\030\001" + + " \001(\0132*.google.cloud.sql.v1.RotateServerCaContext\"\216\001\n" + + "\'InstancesRotateServerCertificateRequest\022c\n" + + "!rotate_server_certificate_context\030\001" + + " \001(\01323.google.cloud.sql.v1.RotateServerCertificateContextB\003\340A\001\"\222\001\n" + + "(InstancesRotateEntraIdCertificateRequest\022f\n" + + "#rotate_entra_id_certificate_context\030\001" + + " \001(\01324.google.cloud.sql.v1.RotateEntraIdCertificateContextB\003\340A\001\"d\n" + + "\033InstancesTruncateLogRequest\022E\n" + + "\024truncate_log_context\030\001" + + " \001(\0132\'.google.cloud.sql.v1.TruncateLogContext\"t\n" + + " InstancesAcquireSsrsLeaseRequest\022P\n" + + "\032acquire_ssrs_lease_context\030\001 \001(\0132,." + + "google.cloud.sql.v1.AcquireSsrsLeaseContext\"\262\001\n" + + ".SqlInstancesPreCheckMajorVersionUpgradeRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\022S\n" + + "\004body\030\003 \001(\0132@.goog" + + "le.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequestB\003\340A\002\"\304\001\n" + + ".SqlInstancesVerifyExternalSyncSettingsResponse\022\014\n" + + "\004kind\030\001 \001(\t\022@\n" + + "\006errors\030\002 \003(\01320.google.cloud.sql.v1.SqlExternalSyncSettingError\022B\n" + + "\010warnings\030\003 \003(\01320.google.cloud.sql.v1.SqlExternalSyncSettingError\"h\n" + + "\'SqlInstancesGetDiskShrinkConfigResponse\022\014\n" + + "\004kind\030\001 \001(\t\022\036\n" + + "\026minimal_target_size_gb\030\002 \001(\003\022\017\n" + + "\007message\030\003 \001(\t\"\267\001\n" + + "(SqlInstancesGetLatestRecoveryTimeRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022F\n" + + "\035source_instance_deletion_time\030\003" + + " \001(\0132\032.google.protobuf.TimestampH\000\210\001\001B \n" + + "\036_source_instance_deletion_time\"\257\001\n" + + ")SqlInstancesGetLatestRecoveryTimeResponse\022\014\n" + + "\004kind\030\001 \001(\t\0228\n" + + "\024latest_recovery_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022:\n" + + "\026earliest_recovery_time\030\003" + + " \001(\0132\032.google.protobuf.Timestamp\"\224\005\n" + + "\014CloneContext\022\014\n" + + "\004kind\030\001 \001(\t\022\031\n" + + "\021pitr_timestamp_ms\030\002 \001(\003\022&\n" + + "\031destination_instance_name\030\003 \001(\tB\003\340A\002\022C\n" + + "\023bin_log_coordinates\030\004" + + " \001(\0132&.google.cloud.sql.v1.BinLogCoordinates\0221\n\r" + + "point_in_time\030\005 \001(\0132\032.google.protobuf.Timestamp\022\032\n" + + "\022allocated_ip_range\030\006 \001(\t\022\026\n" + + "\016database_names\030\t \003(\t\022 \n" + + "\016preferred_zone\030\n" + + " \001(\tB\003\340A\001H\000\210\001\001\022*\n" + + "\030preferred_secondary_zone\030\013 \001(\tB\003\340A\001H\001\210\001\001\022F\n" + + "\035source_instance_deletion_time\030\014" + + " \001(\0132\032.google.protobuf.TimestampH\002\210\001\001\022%\n" + + "\023destination_project\030\r" + + " \001(\tB\003\340A\001H\003\210\001\001\022H\n" + + "\023destination_network\030\016 \001(\tB&\340A\001\372A \n" + + "\036compute.googleapis.com/NetworkH\004\210\001\001B\021\n" + + "\017_preferred_zoneB\033\n" + + "\031_preferred_secondary_zoneB \n" + + "\036_source_instance_deletion_timeB\026\n" + + "\024_destination_projectB\026\n" + + "\024_destination_network\"\313\004\n" + + "\031PointInTimeRestoreContext\022\027\n\n" + + "datasource\030\001 \001(\tH\000\210\001\001\0226\n\r" + + "point_in_time\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340A\002\022\034\n" + + "\017target_instance\030\003 \001(\tH\001\210\001\001\022!\n" + + "\017private_network\030\004 \001(\tB\003\340A\001H\002\210\001\001\022$\n" + + "\022allocated_ip_range\030\005 \001(\tB\003\340A\001H\003\210\001\001\022 \n" + + "\016preferred_zone\030\006 \001(\tB\003\340A\001H\004\210\001\001\022*\n" + + "\030preferred_secondary_zone\030\t \001(\tB\003\340A\001H\005\210\001\001\022L\n" + + "\030target_instance_settings\030\013 \001" + + "(\0132%.google.cloud.sql.v1.DatabaseInstanceB\003\340A\001\0227\n" + + "*target_instance_clear_settings_field_names\030\014 \003(\tB\003\340A\001\022\030\n" + + "\006region\030\r" + + " \001(\tB\003\340A\001H\006\210\001\001B\r\n" + + "\013_datasourceB\022\n" + + "\020_target_instanceB\022\n" + + "\020_private_networkB\025\n" + + "\023_allocated_ip_rangeB\021\n" + + "\017_preferred_zoneB\033\n" + + "\031_preferred_secondary_zoneB\t\n" + + "\007_region\"V\n" + + "\021BinLogCoordinates\022\031\n" + + "\021bin_log_file_name\030\001 \001(\t\022\030\n" + + "\020bin_log_position\030\002 \001(\003\022\014\n" + + "\004kind\030\003 \001(\t\"\200#\n" + + "\020DatabaseInstance\022\014\n" + + "\004kind\030\001 \001(\t\022E\n" + + "\005state\030\002" + + " \001(\01626.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState\022A\n" + + "\020database_version\030\003" + + " \001(\0162\'.google.cloud.sql.v1.SqlDatabaseVersion\022/\n" + + "\010settings\030\004 \001(\0132\035.google.cloud.sql.v1.Settings\022\014\n" + + "\004etag\030\005 \001(\t\022R\n" + + "\020failover_replica\030\006" + + " \001(\01328.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica\022\034\n" + + "\024master_instance_name\030\007 \001(\t\022\025\n\r" + + "replica_names\030\010 \003(\t\0226\n\r" + + "max_disk_size\030\t \001(\0132\033.google.protobuf.Int64ValueB\002\030\001\022:\n" + + "\021current_disk_size\030\n" + + " \001(\0132\033.google.protobuf.Int64ValueB\002\030\001\0224\n" + + "\014ip_addresses\030\013 \003(\0132\036.google.cloud.sql.v1.IpMapping\0224\n" + + "\016server_ca_cert\030\014 \001(\0132\034.google.cloud.sql.v1.SslCert\022;\n\r" + + "instance_type\030\r" + + " \001(\0162$.google.cloud.sql.v1.SqlInstanceType\022\017\n" + + "\007project\030\016 \001(\t\022\030\n" + + "\014ipv6_address\030\017 \001(\tB\002\030\001\022%\n" + + "\035service_account_email_address\030\020 \001(\t\022O\n" + + "\031on_premises_configuration\030\021" + + " \001(\0132,.google.cloud.sql.v1.OnPremisesConfiguration\022H\n" + + "\025replica_configuration\030\022" + + " \001(\0132).google.cloud.sql.v1.ReplicaConfiguration\0229\n" + + "\014backend_type\030\023 \001(\0162#.google.cloud.sql.v1.SqlBackendType\022\021\n" + + "\tself_link\030\024 \001(\t\022C\n" + + "\021suspension_reason\030\025" + + " \003(\0162(.google.cloud.sql.v1.SqlSuspensionReason\022\027\n" + + "\017connection_name\030\026 \001(\t\022\014\n" + + "\004name\030\027 \001(\t\022\016\n" + + "\006region\030\030 \001(\t\022\020\n" + + "\010gce_zone\030\031 \001(\t\022\032\n" + + "\022secondary_gce_zone\030\" \001(\t\022W\n" + + "\035disk_encryption_configuration\030\032" + + " \001(\01320.google.cloud.sql.v1.DiskEncryptionConfiguration\022I\n" + + "\026disk_encryption_status\030\033" + + " \001(\0132).google.cloud.sql.v1.DiskEncryptionStatus\022\025\n\r" + + "root_password\030\035 \001(\t\022\\\n" + + "\025scheduled_maintenance\030\036 \001(\0132=.go" + + "ogle.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance\0221\n\r" + + "satisfies_pzs\030# \001(\0132\032.google.protobuf.BoolValue\022\'\n" + + "\032database_installed_version\030( \001(\tB\003\340A\003\022Y\n" + + "\022out_of_disk_report\030& \001(\01328.google.cloud.sql.v1" + + ".DatabaseInstance.SqlOutOfDiskReportH\000\210\001\001\0224\n" + + "\013create_time\030\' \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022+\n" + + "\036available_maintenance_versions\030) \003(\tB\003\340A\003\022\033\n" + + "\023maintenance_version\030* \001(\t\022X\n" + + "\034upgradable_database_versions\030-" + + " \003(\0132-.google.cloud.sql.v1.AvailableDatabaseVersionB\003\340A\003\022c\n" + + "\030sql_network_architecture\030/ \001(\0162<.google.cloud.sql.v1.Data" + + "baseInstance.SqlNetworkArchitectureH\001\210\001\001\022-\n" + + "\033psc_service_attachment_link\0300 \001(\tB\003\340A\003H\002\210\001\001\022\032\n" + + "\010dns_name\0301 \001(\tB\003\340A\003H\003\210\001\001\022$\n" + + "\020primary_dns_name\0303 \001(\tB\005\030\001\340A\003H\004\210\001\001\022 \n" + + "\016write_endpoint\0304 \001(\tB\003\340A\003H\005\210\001\001\022I\n" + + "\023replication_cluster\0306" + + " \001(\0132\'.google.cloud.sql.v1.ReplicationClusterB\003\340A\001\022E\n\r" + + "gemini_config\0307" + + " \001(\0132).google.cloud.sql.v1.GeminiInstanceConfigH\006\210\001\001\0226\n\r" + + "satisfies_pzi\0308 \001(\0132\032.google.protobuf.BoolValueB\003\340A\003\022^\n" + + "0switch_transaction_logs_to_cloud_storage_enabled\0309" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\004H\007\210\001\001\022X\n" + + "*include_replicas_for_major_version_upgrade\030;" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\004H\010\210\001\001\022H\n" + + "\004tags\030< \003(\0132/.google.cloud.sql.v1.DatabaseInstance.TagsEntryB" + + "\t\340A\004\340A\005\340A\001\022\027\n\n" + + "node_count\030? \001(\005H\t\210\001\001\022H\n" + + "\005nodes\030@" + + " \003(\01324.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfigB\003\340A\003\022;\n" + + "\tdns_names\030C \003(\0132#.google.cloud.sql.v1.DnsNameMappingB\003\340A\003\032Q\n" + + "\022SqlFailoverReplica\022\014\n" + + "\004name\030\001 \001(\t\022-\n" + + "\tavailable\030\002 \001(\0132\032.google.protobuf.BoolValue\032\324\001\n" + + "\027SqlScheduledMaintenance\022.\n\n" + + "start_time\030\001 \001(\0132\032.google.protobuf.Timestamp\022\025\n" + + "\tcan_defer\030\002 \001(\010B\002\030\001\022\026\n" + + "\016can_reschedule\030\003 \001(\010\022?\n" + + "\026schedule_deadline_time\030\004" + + " \001(\0132\032.google.protobuf.TimestampH\000\210\001\001B\031\n" + + "\027_schedule_deadline_time\032\325\002\n" + + "\022SqlOutOfDiskReport\022n\n" + + "\025sql_out_of_disk_state\030\001 \001(\0162J.google.cloud.sql.v1.DatabaseInstance" + + ".SqlOutOfDiskReport.SqlOutOfDiskStateH\000\210\001\001\0221\n" + + "$sql_min_recommended_increase_size_gb\030\002 \001(\005H\001\210\001\001\"Y\n" + + "\021SqlOutOfDiskState\022%\n" + + "!SQL_OUT_OF_DISK_STATE_UNSPECIFIED\020\000\022\n\n" + + "\006NORMAL\020\001\022\021\n\r" + + "SOFT_SHUTDOWN\020\002B\030\n" + + "\026_sql_out_of_disk_stateB\'\n" + + "%_sql_min_recommended_increase_size_gb\032\366\003\n" + + "\016PoolNodeConfig\022\026\n" + + "\004name\030\001 \001(\tB\003\340A\003H\000\210\001\001\022\032\n" + + "\010gce_zone\030\002 \001(\tB\003\340A\003H\001\210\001\001\0229\n" + + "\014ip_addresses\030\003" + + " \003(\0132\036.google.cloud.sql.v1.IpMappingB\003\340A\003\022\032\n" + + "\010dns_name\030\004 \001(\tB\003\340A\003H\002\210\001\001\022O\n" + + "\005state\030\005 \001(\01626.google.cloud." + + "sql.v1.DatabaseInstance.SqlInstanceStateB\003\340A\003H\003\210\001\001\022;\n" + + "\tdns_names\030\006" + + " \003(\0132#.google.cloud.sql.v1.DnsNameMappingB\003\340A\003\022-\n" + + "\033psc_service_attachment_link\030\007 \001(\tB\003\340A\003H\004\210\001\001\022O\n" + + "\024psc_auto_connections\030\010 \003(\0132,.google.cl" + + "oud.sql.v1.PscAutoConnectionConfigB\003\340A\003B\007\n" + + "\005_nameB\013\n" + + "\t_gce_zoneB\013\n" + + "\t_dns_nameB\010\n" + + "\006_stateB\036\n" + + "\034_psc_service_attachment_link\032+\n" + + "\tTagsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"\303\001\n" + + "\020SqlInstanceState\022\"\n" + + "\036SQL_INSTANCE_STATE_UNSPECIFIED\020\000\022\014\n" + + "\010RUNNABLE\020\001\022\r\n" + + "\tSUSPENDED\020\002\022\022\n" + + "\016PENDING_DELETE\020\003\022\022\n" + + "\016PENDING_CREATE\020\004\022\017\n" + + "\013MAINTENANCE\020\005\022\n\n" + + "\006FAILED\020\006\022\032\n" + + "\022ONLINE_MAINTENANCE\020\007\032\002\010\001\022\r\n" + + "\tREPAIRING\020\010\"~\n" + + "\026SqlNetworkArchitecture\022(\n" + + "$SQL_NETWORK_ARCHITECTURE_UNSPECIFIED\020\000\022\034\n" + + "\030NEW_NETWORK_ARCHITECTURE\020\001\022\034\n" + + "\030OLD_NETWORK_ARCHITECTURE\020\002B\025\n" + + "\023_out_of_disk_reportB\033\n" + + "\031_sql_network_architectureB\036\n" + + "\034_psc_service_attachment_linkB\013\n" + + "\t_dns_nameB\023\n" + + "\021_primary_dns_nameB\021\n" + + "\017_write_endpointB\020\n" + + "\016_gemini_configB3\n" + + "1_switch_transaction_logs_to_cloud_storage_enabledB-\n" + + "+_include_replicas_for_major_version_upgradeB\r\n" + + "\013_node_count\"\246\003\n" + + "\024GeminiInstanceConfig\022\032\n" + + "\010entitled\030\001 \001(\010B\003\340A\003H\000\210\001\001\022,\n" + + "\032google_vacuum_mgmt_enabled\030\002 \001(\010B\003\340A\003H\001\210\001\001\022,\n" + + "\032oom_session_cancel_enabled\030\003 \001(\010B\003\340A\003H\002\210\001\001\022&\n" + + "\024active_query_enabled\030\004 \001(\010B\003\340A\003H\003\210\001\001\022\'\n" + + "\025index_advisor_enabled\030\005 \001(\010B\003\340A\003H\004\210\001\001\022*\n" + + "\030flag_recommender_enabled\030\006 \001(\010B\003\340A\003H\005\210\001\001B\013\n" + + "\t_entitledB\035\n" + + "\033_google_vacuum_mgmt_enabledB\035\n" + + "\033_oom_session_cancel_enabledB\027\n" + + "\025_active_query_enabledB\030\n" + + "\026_index_advisor_enabledB\033\n" + + "\031_flag_recommender_enabled\"u\n" + + "\022ReplicationCluster\022\037\n" + + "\022psa_write_endpoint\030\001 \001(\tB\003\340A\003\022%\n", + "\030failover_dr_replica_name\030\002 \001(\tB\003\340A\001\022\027\n\n" + + "dr_replica\030\004 \001(\010B\003\340A\003\"\220\001\n" + + "\030AvailableDatabaseVersion\022\032\n\r" + + "major_version\030\003 \001(\tH\000\210\001\001\022\021\n" + + "\004name\030\010 \001(\tH\001\210\001\001\022\031\n" + + "\014display_name\030\t \001(\tH\002\210\001\001B\020\n" + + "\016_major_versionB\007\n" + + "\005_nameB\017\n\r" + + "_display_name\"\262\003\n" + + ",SqlInstancesRescheduleMaintenanceRequestBody\022`\n\n" + + "reschedule\030\003 \001(\0132L." + + "google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule\032\257\001\n\n" + + "Reschedule\022i\n" + + "\017reschedule_type\030\001 \001(\0162P.go" + + "ogle.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType\0226\n" + + "\r" + + "schedule_time\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340A\001\"n\n" + + "\016RescheduleType\022\037\n" + + "\033RESCHEDULE_TYPE_UNSPECIFIED\020\000\022\r\n" + + "\tIMMEDIATE\020\001\022\031\n" + + "\025NEXT_AVAILABLE_WINDOW\020\002\022\021\n\r" + + "SPECIFIC_TIME\020\003\"\355\001\n" + + "\023DemoteMasterContext\022\014\n" + + "\004kind\030\001 \001(\t\022;\n" + + "\027verify_gtid_consistency\030\002 \001(\0132\032.google.protobuf.BoolValue\022\034\n" + + "\024master_instance_name\030\003 \001(\t\022M\n" + + "\025replica_configuration\030\004" + + " \001(\0132..google.cloud.sql.v1.DemoteMasterConfiguration\022\036\n" + + "\026skip_replication_setup\030\005 \001(\010\"O\n\r" + + "DemoteContext\022\014\n" + + "\004kind\030\001 \001(\t\0220\n" + + "#source_representative_instance_name\030\002 \001(\tB\003\340A\002\"9\n" + + "\017FailoverContext\022\030\n" + + "\020settings_version\030\001 \001(\003\022\014\n" + + "\004kind\030\002 \001(\t\"a\n" + + "\024RestoreBackupContext\022\014\n" + + "\004kind\030\001 \001(\t\022\025\n\r" + + "backup_run_id\030\002 \001(\003\022\023\n" + + "\013instance_id\030\003 \001(\t\022\017\n" + + "\007project\030\004 \001(\t\";\n" + + "\025RotateServerCaContext\022\014\n" + + "\004kind\030\001 \001(\t\022\024\n" + + "\014next_version\030\002 \001(\t\"I\n" + + "\036RotateServerCertificateContext\022\021\n" + + "\004kind\030\001 \001(\tB\003\340A\001\022\024\n" + + "\014next_version\030\002 \001(\t\"O\n" + + "\037RotateEntraIdCertificateContext\022\021\n" + + "\004kind\030\001 \001(\tB\003\340A\001\022\031\n" + + "\014next_version\030\002 \001(\tB\003\340A\001\"4\n" + + "\022TruncateLogContext\022\014\n" + + "\004kind\030\001 \001(\t\022\020\n" + + "\010log_type\030\002 \001(\t\"\337\020\n" + + "\033SqlExternalSyncSettingError\022\014\n" + + "\004kind\030\001 \001(\t\022^\n" + + "\004type\030\002 \001(\0162P.google.cloud.sql.v1.Sq" + + "lExternalSyncSettingError.SqlExternalSyncSettingErrorType\022\016\n" + + "\006detail\030\003 \001(\t\"\301\017\n" + + "\037SqlExternalSyncSettingErrorType\0224\n" + + "0SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED\020\000\022\026\n" + + "\022CONNECTION_FAILURE\020\001\022\026\n" + + "\022BINLOG_NOT_ENABLED\020\002\022!\n" + + "\035INCOMPATIBLE_DATABASE_VERSION\020\003\022\031\n" + + "\025REPLICA_ALREADY_SETUP\020\004\022\032\n" + + "\026INSUFFICIENT_PRIVILEGE\020\005\022\036\n" + + "\032UNSUPPORTED_MIGRATION_TYPE\020\006\022\032\n" + + "\026NO_PGLOGICAL_INSTALLED\020\007\022!\n" + + "\035PGLOGICAL_NODE_ALREADY_EXISTS\020\010\022\025\n" + + "\021INVALID_WAL_LEVEL\020\t\022\"\n" + + "\036INVALID_SHARED_PRELOAD_LIBRARY\020\n" + + "\022&\n" + + "\"INSUFFICIENT_MAX_REPLICATION_SLOTS\020\013\022 \n" + + "\034INSUFFICIENT_MAX_WAL_SENDERS\020\014\022%\n" + + "!INSUFFICIENT_MAX_WORKER_PROCESSES\020\r" + + "\022\032\n" + + "\026UNSUPPORTED_EXTENSIONS\020\016\022#\n" + + "\037INVALID_RDS_LOGICAL_REPLICATION\020\017\022\031\n" + + "\025INVALID_LOGGING_SETUP\020\020\022\024\n" + + "\020INVALID_DB_PARAM\020\021\022\031\n" + + "\025UNSUPPORTED_GTID_MODE\020\022\022\037\n" + + "\033SQLSERVER_AGENT_NOT_RUNNING\020\023\022 \n" + + "\034UNSUPPORTED_TABLE_DEFINITION\020\024\022\027\n" + + "\023UNSUPPORTED_DEFINER\020\025\022!\n" + + "\035SQLSERVER_SERVERNAME_MISMATCH\020\026\022\031\n" + + "\025PRIMARY_ALREADY_SETUP\020\027\022\035\n" + + "\031UNSUPPORTED_BINLOG_FORMAT\020\030\022\034\n" + + "\030BINLOG_RETENTION_SETTING\020\031\022\036\n" + + "\032UNSUPPORTED_STORAGE_ENGINE\020\032\022\032\n" + + "\026LIMITED_SUPPORT_TABLES\020\033\022\034\n" + + "\030EXISTING_DATA_IN_REPLICA\020\034\022\037\n" + + "\033MISSING_OPTIONAL_PRIVILEGES\020\035\022 \n" + + "\034RISKY_BACKUP_ADMIN_PRIVILEGE\020\036\022 \n" + + "\034INSUFFICIENT_GCS_PERMISSIONS\020\037\022\025\n" + + "\021INVALID_FILE_INFO\020 \022!\n" + + "\035UNSUPPORTED_DATABASE_SETTINGS\020!\0220\n" + + ",MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE\020\"\022\024\n" + + "\020LOCAL_INFILE_OFF\020#\022\036\n" + + "\032TURN_ON_PITR_AFTER_PROMOTE\020$\022\'\n" + + "#INCOMPATIBLE_DATABASE_MINOR_VERSION\020%\022\034\n" + + "\030SOURCE_MAX_SUBSCRIPTIONS\020&\022\035\n" + + "\031UNABLE_TO_VERIFY_DEFINERS\020\'\022#\n" + + "\037SUBSCRIPTION_CALCULATION_STATUS\020(\022\031\n" + + "\025PG_SUBSCRIPTION_COUNT\020)\022\032\n" + + "\026PG_SYNC_PARALLEL_LEVEL\020*\022\032\n" + + "\026INSUFFICIENT_DISK_SIZE\020+\022\035\n" + + "\031INSUFFICIENT_MACHINE_TIER\020,\022\'\n" + + "#UNSUPPORTED_EXTENSIONS_NOT_MIGRATED\020-\022\033\n" + + "\027EXTENSIONS_NOT_MIGRATED\020.\022#\n" + + "\037PG_CRON_FLAG_ENABLED_IN_REPLICA\020/\022%\n" + + "!EXTENSIONS_NOT_ENABLED_IN_REPLICA\0200\022\027\n" + + "\023UNSUPPORTED_COLUMNS\0201\022 \n" + + "\034USERS_NOT_CREATED_IN_REPLICA\0202\022\036\n" + + "\032UNSUPPORTED_SYSTEM_OBJECTS\0203\022,\n" + + "(UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY\0204\022(\n" + + "$SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE\0205\0224\n" + + "0PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI\0206\0221\n" + + "-SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS\0207\022\032\n" + + "\026PROMPT_DELETE_EXISTING\0208\022\030\n" + + "\024WILL_DELETE_EXISTING\0209\022-\n" + + ")PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE\020:\"(\n" + + "\017SelectedObjects\022\025\n" + + "\010database\030\001 \001(\tB\003\340A\002\"\347\003\n" + + "\027OnPremisesConfiguration\022\021\n" + + "\thost_port\030\001 \001(\t\022\014\n" + + "\004kind\030\002 \001(\t\022\020\n" + + "\010username\030\003 \001(\t\022\020\n" + + "\010password\030\004 \001(\t\022\026\n" + + "\016ca_certificate\030\005 \001(\t\022\032\n" + + "\022client_certificate\030\006 \001(\t\022\022\n\n" + + "client_key\030\007 \001(\t\022\026\n" + + "\016dump_file_path\030\010 \001(\t\022?\n" + + "\017source_instance\030\017 \001(\0132&.google.cloud.sql.v1.InstanceReference\022C\n" + + "\020selected_objects\030\020" + + " \003(\0132$.google.cloud.sql.v1.SelectedObjectsB\003\340A\001\022O\n\n" + + "ssl_option\030\022" + + " \001(\01626.google.cloud.sql.v1.OnPremisesConfiguration.SslOptionB\003\340A\001\"P\n" + + "\tSslOption\022\032\n" + + "\026SSL_OPTION_UNSPECIFIED\020\000\022\013\n" + + "\007DISABLE\020\001\022\013\n" + + "\007REQUIRE\020\002\022\r\n" + + "\tVERIFY_CA\020\003\"\353\001\n" + + "\024ReplicaConfiguration\022\014\n" + + "\004kind\030\001 \001(\t\022S\n" + + "\033mysql_replica_configuration\030\002" + + " \001(\0132..google.cloud.sql.v1.MySqlReplicaConfiguration\0223\n" + + "\017failover_target\030\003 \001(\0132\032.google.protobuf.BoolValue\022;\n" + + "\022cascadable_replica\030\005" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\"\202\001\n" + + "\035SqlInstancesExecuteSqlRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\0224\n" + + "\004body\030d \001(\0132&.google.cloud.sql.v1.ExecuteSqlPayload\"\204\003\n" + + "\021ExecuteSqlPayload\022\021\n" + + "\004user\030\001 \001(\tB\003\340A\001\022\032\n\r" + + "sql_statement\030\002 \001(\tB\003\340A\002\022\025\n" + + "\010database\030\003 \001(\tB\003\340A\001\022\035\n" + + "\016auto_iam_authn\030\013 \001(\010B\003\340A\001H\000\022\026\n" + + "\trow_limit\030\n" + + " \001(\003B\003\340A\001\022Z\n" + + "\023partial_result_mode\030\r" + + " \001(\01628.google.cloud.sql." + + "v1.ExecuteSqlPayload.PartialResultModeB\003\340A\001\022\030\n" + + "\013application\030\020 \001(\tB\003\340A\001\"k\n" + + "\021PartialResultMode\022#\n" + + "\037PARTIAL_RESULT_MODE_UNSPECIFIED\020\000\022\027\n" + + "\023FAIL_PARTIAL_RESULT\020\001\022\030\n" + + "\024ALLOW_PARTIAL_RESULT\020\002B\017\n\r" + + "user_password\"\310\002\n" + + "\036SqlInstancesExecuteSqlResponse\022M\n" + + "\010messages\030\t" + + " \003(\0132;.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message\022/\n" + + "\010metadata\030\006 \001(\0132\035.google.cloud.sql.v1.Metadata\0221\n" + + "\007results\030\007 \003(\0132 .google.cloud.sql.v1.QueryResult\022\"\n" + + "\006status\030\010 \001(\0132\022.google.rpc.Status\032O\n" + + "\007Message\022\024\n" + + "\007message\030\001 \001(\tH\000\210\001\001\022\025\n" + + "\010severity\030\002 \001(\tH\001\210\001\001B\n\n" + + "\010_messageB\013\n" + + "\t_severity\"\260\001\n" + + "\013QueryResult\022,\n" + + "\007columns\030\001 \003(\0132\033.google.cloud.sql.v1.Column\022&\n" + + "\004rows\030\002 \003(\0132\030.google.cloud.sql.v1.Row\022\017\n" + + "\007message\030\003 \001(\t\022\026\n" + + "\016partial_result\030\004 \001(\010\022\"\n" + + "\006status\030\010 \001(\0132\022.google.rpc.Status\"$\n" + + "\006Column\022\014\n" + + "\004name\030\001 \001(\t\022\014\n" + + "\004type\030\002 \001(\t\"1\n" + + "\003Row\022*\n" + + "\006values\030\001 \003(\0132\032.google.cloud.sql.v1.Value\"*\n" + + "\005Value\022\r\n" + + "\005value\030\001 \001(\t\022\022\n\n" + + "null_value\030\002 \001(\010\"K\n" + + "\010Metadata\022?\n" + + "\034sql_statement_execution_time\030\001" + + " \001(\0132\031.google.protobuf.Duration\"\234\001\n" + + "#SqlInstancesAcquireSsrsLeaseRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\022H\n" + + "\004body\030d" + + " \001(\01325.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequestB\003\340A\002\"<\n" + + "$SqlInstancesAcquireSsrsLeaseResponse\022\024\n" + + "\014operation_id\030\001 \001(\t\"R\n" + + "#SqlInstancesReleaseSsrsLeaseRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\"<\n" + + "$SqlInstancesReleaseSsrsLeaseResponse\022\024\n" + + "\014operation_id\030\001 \001(\t\"\202\001\n" + + "%SqlInstancesPointInTimeRestoreRequest\022\023\n" + + "\006parent\030\001 \001(\tB\003\340A\002\022D\n" + + "\007context\030d \001" + + "(\0132..google.cloud.sql.v1.PointInTimeRestoreContextB\003\340A\002*h\n" + + "\031ExternalSyncParallelLevel\022,\n" + + "(EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED\020\000\022\007\n" + + "\003MIN\020\001\022\013\n" + + "\007OPTIMAL\020\002\022\007\n" + + "\003MAX\020\003*\231\001\n" + + "\017SqlInstanceType\022!\n" + + "\035SQL_INSTANCE_TYPE_UNSPECIFIED\020\000\022\026\n" + + "\022CLOUD_SQL_INSTANCE\020\001\022\030\n" + + "\024ON_PREMISES_INSTANCE\020\002\022\031\n" + + "\025READ_REPLICA_INSTANCE\020\003\022\026\n" + + "\022READ_POOL_INSTANCE\020\005*\235\001\n" + + "\023SqlSuspensionReason\022%\n" + + "!SQL_SUSPENSION_REASON_UNSPECIFIED\020\000\022\021\n\r" + + "BILLING_ISSUE\020\002\022\017\n" + + "\013LEGAL_ISSUE\020\003\022\025\n" + + "\021OPERATIONAL_ISSUE\020\004\022\021\n\r" + + "KMS_KEY_ISSUE\020\005\022\021\n\r" + + "PROJECT_ABUSE\020\0102\231>\n" + + "\023SqlInstancesService\022\243\001\n" + + "\013AddServerCa\0223.google.cloud.sql.v1.SqlInstancesAddServe" + + "rCaRequest\032\036.google.cloud.sql.v1.Operati" + + "on\"?\202\323\344\223\0029\"7/v1/projects/{project}/instances/{instance}/addServerCa\022\276\001\n" + + "\024AddServerCertificate\022<.google.cloud.sql.v1.SqlIn" + + "stancesAddServerCertificateRequest\032\036.goo" + + "gle.cloud.sql.v1.Operation\"H\202\323\344\223\002B\"@/v1/" + + "projects/{project}/instances/{instance}/addServerCertificate\022\301\001\n" + + "\025AddEntraIdCertificate\022=.google.cloud.sql.v1.SqlInstance" + + "sAddEntraIdCertificateRequest\032\036.google.c" + + "loud.sql.v1.Operation\"I\202\323\344\223\002C\"A/v1/proje" + + "cts/{project}/instances/{instance}/addEntraIdCertificate\022\227\001\n" + + "\005Clone\022-.google.cloud.sql.v1.SqlInstancesCloneRequest\032\036.goog" + + "le.cloud.sql.v1.Operation\"?\202\323\344\223\0029\"1/v1/p" + + "rojects/{project}/instances/{instance}/clone:\004body\022\215\001\n" + + "\006Delete\022..google.cloud.sql.v1.SqlInstancesDeleteRequest\032\036.google.c" + + "loud.sql.v1.Operation\"3\202\323\344\223\002-*+/v1/projects/{project}/instances/{instance}\022\254\001\n" + + "\014DemoteMaster\0224.google.cloud.sql.v1.SqlIns" + + "tancesDemoteMasterRequest\032\036.google.cloud" + + ".sql.v1.Operation\"F\202\323\344\223\002@\"8/v1/projects/" + + "{project}/instances/{instance}/demoteMaster:\004body\022\232\001\n" + + "\006Demote\022..google.cloud.sql.v1.SqlInstancesDemoteRequest\032\036.google.cl" + + "oud.sql.v1.Operation\"@\202\323\344\223\002:\"2/v1/projec" + + "ts/{project}/instances/{instance}/demote:\004body\022\232\001\n" + + "\006Export\022..google.cloud.sql.v1.SqlInstancesExportRequest\032\036.google.cloud" + + ".sql.v1.Operation\"@\202\323\344\223\002:\"2/v1/projects/" + + "{project}/instances/{instance}/export:\004body\022\240\001\n" + + "\010Failover\0220.google.cloud.sql.v1.SqlInstancesFailoverRequest\032\036.google.clou" + + "d.sql.v1.Operation\"B\202\323\344\223\002<\"4/v1/projects" + + "/{project}/instances/{instance}/failover:\004body\022\243\001\n" + + "\tReencrypt\0221.google.cloud.sql.v1.SqlInstancesReencryptRequest\032\036.google" + + ".cloud.sql.v1.Operation\"C\202\323\344\223\002=\"5/v1/pro" + + "jects/{project}/instances/{instance}/reencrypt:\004body\022\216\001\n" + + "\003Get\022+.google.cloud.sql.v1.SqlInstancesGetRequest\032%.google.cloud" + + ".sql.v1.DatabaseInstance\"3\202\323\344\223\002-\022+/v1/pr" + + "ojects/{project}/instances/{instance}\022\232\001\n" + + "\006Import\022..google.cloud.sql.v1.SqlInstan" + + "cesImportRequest\032\036.google.cloud.sql.v1.O" + + "peration\"@\202\323\344\223\002:\"2/v1/projects/{project}/instances/{instance}/import:\004body\022\210\001\n" + + "\006Insert\022..google.cloud.sql.v1.SqlInstances" + + "InsertRequest\032\036.google.cloud.sql.v1.Operation\".\202\323\344\223\002(\"" + + " /v1/projects/{project}/instances:\004body\022\212\001\n" + + "\004List\022,.google.cloud.sql.v1.SqlInstancesListRequest\032*.google.cl" + + "oud.sql.v1.InstancesListResponse\"(\202\323\344\223\002\"\022" + + " /v1/projects/{project}/instances\022\276\001\n\r" + + "ListServerCas\0225.google.cloud.sql.v1.SqlIn" + + "stancesListServerCasRequest\0323.google.cloud.sql.v1.InstancesListServerCasResponse" + + "\"A\202\323\344\223\002;\0229/v1/projects/{project}/instances/{instance}/listServerCas\022\342\001\n" + + "\026ListServerCertificates\022>.google.cloud.sql.v1.Sql" + + "InstancesListServerCertificatesRequest\032<.google.cloud.sql.v1.InstancesListServer" + + "CertificatesResponse\"J\202\323\344\223\002D\022B/v1/projec" + + "ts/{project}/instances/{instance}/listServerCertificates\022\346\001\n" + + "\027ListEntraIdCertificates\022?.google.cloud.sql.v1.SqlInstancesL" + + "istEntraIdCertificatesRequest\032=.google.cloud.sql.v1.InstancesListEntraIdCertific" + + "atesResponse\"K\202\323\344\223\002E\022C/v1/projects/{proj" + + "ect}/instances/{instance}/listEntraIdCertificates\022\221\001\n" + + "\005Patch\022-.google.cloud.sql.v1.SqlInstancesPatchRequest\032\036.google.clou" + + "d.sql.v1.Operation\"9\202\323\344\223\00232+/v1/projects" + + "/{project}/instances/{instance}:\004body\022\254\001\n" + + "\016PromoteReplica\0226.google.cloud.sql.v1.S" + + "qlInstancesPromoteReplicaRequest\032\036.googl" + + "e.cloud.sql.v1.Operation\"B\202\323\344\223\002<\":/v1/pr" + + "ojects/{project}/instances/{instance}/promoteReplica\022\240\001\n\n" + + "Switchover\0222.google.cloud.sql.v1.SqlInstancesSwitchoverRequest\032" + + "\036.google.cloud.sql.v1.Operation\">\202\323\344\223\0028\"" + + "6/v1/projects/{project}/instances/{instance}/switchover\022\254\001\n" + + "\016ResetSslConfig\0226.google.cloud.sql.v1.SqlInstancesResetSslCon" + + "figRequest\032\036.google.cloud.sql.v1.Operati" + + "on\"B\202\323\344\223\002<\":/v1/projects/{project}/instances/{instance}/resetSslConfig\022\227\001\n" + + "\007Restart\022/.google.cloud.sql.v1.SqlInstancesRes" + + "tartRequest\032\036.google.cloud.sql.v1.Operat" + + "ion\";\202\323\344\223\0025\"3/v1/projects/{project}/instances/{instance}/restart\022\257\001\n\r" + + "RestoreBackup\0225.google.cloud.sql.v1.SqlInstancesRes" + + "toreBackupRequest\032\036.google.cloud.sql.v1." + + "Operation\"G\202\323\344\223\002A\"9/v1/projects/{project" + + "}/instances/{instance}/restoreBackup:\004body\022\262\001\n" + + "\016RotateServerCa\0226.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest\032\036." + + "google.cloud.sql.v1.Operation\"H\202\323\344\223\002B\":/" + + "v1/projects/{project}/instances/{instance}/rotateServerCa:\004body\022\315\001\n" + + "\027RotateServerCertificate\022?.google.cloud.sql.v1.SqlIns" + + "tancesRotateServerCertificateRequest\032\036.g" + + "oogle.cloud.sql.v1.Operation\"Q\202\323\344\223\002K\"C/v" + + "1/projects/{project}/instances/{instance}/rotateServerCertificate:\004body\022\320\001\n" + + "\030RotateEntraIdCertificate\022@.google.cloud.sql." + + "v1.SqlInstancesRotateEntraIdCertificateR" + + "equest\032\036.google.cloud.sql.v1.Operation\"R" + + "\202\323\344\223\002L\"D/v1/projects/{project}/instances" + + "/{instance}/rotateEntraIdCertificate:\004body\022\246\001\n" + + "\014StartReplica\0224.google.cloud.sql.v1.SqlInstancesStartReplicaRequest\032\036.goog" + + "le.cloud.sql.v1.Operation\"@\202\323\344\223\002:\"8/v1/p" + + "rojects/{project}/instances/{instance}/startReplica\022\243\001\n" + + "\013StopReplica\0223.google.cloud.sql.v1.SqlInstancesStopReplicaRequest" + + "\032\036.google.cloud.sql.v1.Operation\"?\202\323\344\223\0029" + + "\"7/v1/projects/{project}/instances/{instance}/stopReplica\022\251\001\n" + + "\013TruncateLog\0223.google.cloud.sql.v1.SqlInstancesTruncateLogR" + + "equest\032\036.google.cloud.sql.v1.Operation\"E" + + "\202\323\344\223\002?\"7/v1/projects/{project}/instances/{instance}/truncateLog:\004body\022\223\001\n" + + "\006Update\022..google.cloud.sql.v1.SqlInstancesUpdat" + + "eRequest\032\036.google.cloud.sql.v1.Operation" + + "\"9\202\323\344\223\0023\032+/v1/projects/{project}/instances/{instance}:\004body\022\267\001\n" + + "\017CreateEphemeral\022;.google.cloud.sql.v1.SqlInstancesCreate" + + "EphemeralCertRequest\032\034.google.cloud.sql." + + "v1.SslCert\"I\202\323\344\223\002C\";/v1/projects/{projec" + + "t}/instances/{instance}/createEphemeral:\004body\022\307\001\n" + + "\025RescheduleMaintenance\022=.google.cloud.sql.v1.SqlInstancesRescheduleMain" + + "tenanceRequest\032\036.google.cloud.sql.v1.Ope" + + "ration\"O\202\323\344\223\002I\"A/v1/projects/{project}/i" + + "nstances/{instance}/rescheduleMaintenance:\004body\022\370\001\n" + + "\032VerifyExternalSyncSettings\022B.google.cloud.sql.v1.SqlInstancesVerifyE" + + "xternalSyncSettingsRequest\032C.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncS" + + "ettingsResponse\"Q\202\323\344\223\002K\"F/v1/projects/{p" + + "roject}/instances/{instance}/verifyExternalSyncSettings:\001*\022\270\001\n" + + "\021StartExternalSync\0229.google.cloud.sql.v1.SqlInstancesStart" + + "ExternalSyncRequest\032\036.google.cloud.sql.v" + + "1.Operation\"H\202\323\344\223\002B\"=/v1/projects/{proje" + + "ct}/instances/{instance}/startExternalSync:\001*\022\273\001\n" + + "\021PerformDiskShrink\0229.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkR" + + "equest\032\036.google.cloud.sql.v1.Operation\"K" + + "\202\323\344\223\002E\"=/v1/projects/{project}/instances/{instance}/performDiskShrink:\004body\022\331\001\n" + + "\023GetDiskShrinkConfig\022;.google.cloud.sql.v" + + "1.SqlInstancesGetDiskShrinkConfigRequest\032<.google.cloud.sql.v1.SqlInstancesGetDi" + + "skShrinkConfigResponse\"G\202\323\344\223\002A\022?/v1/proj" + + "ects/{project}/instances/{instance}/getDiskShrinkConfig\022\265\001\n" + + "\020ResetReplicaSize\0228.google.cloud.sql.v1.SqlInstancesResetRepl" + + "icaSizeRequest\032\036.google.cloud.sql.v1.Ope" + + "ration\"G\202\323\344\223\002A\".google.cloud.sql.v1.SqlInstan" + + "cesGetLatestRecoveryTimeResponse\"I\202\323\344\223\002C" + + "\022A/v1/projects/{project}/instances/{instance}/getLatestRecoveryTime\022\273\001\n\n" + + "ExecuteSql\0222.google.cloud.sql.v1.SqlInstancesExe" + + "cuteSqlRequest\0323.google.cloud.sql.v1.Sql" + + "InstancesExecuteSqlResponse\"D\202\323\344\223\002>\"6/v1" + + "/projects/{project}/instances/{instance}/executeSql:\004body\022\323\001\n" + + "\020AcquireSsrsLease\0228.google.cloud.sql.v1.SqlInstancesAcquire" + + "SsrsLeaseRequest\0329.google.cloud.sql.v1.S" + + "qlInstancesAcquireSsrsLeaseResponse\"J\202\323\344" + + "\223\002D\"\"\n" + + "\024SqlServerUserDetails\022\020\n" + + "\010disabled\030\001 \001(\010\022\024\n" + + "\014server_roles\030\002 \003(\t\"h\n" + + "\021UsersListResponse\022\014\n" + + "\004kind\030\001 \001(\t\022(\n" + + "\005items\030\002 \003(\0132\031.google.cloud.sql.v1.User\022\033\n" + + "\017next_page_token\030\003 \001(\tB\002\030\0012\365\006\n" + + "\017SqlUsersService\022\217\001\n" + + "\006Delete\022*.google.cloud.sql.v1.SqlUsersDeleteRe" + + "quest\032\036.google.cloud.sql.v1.Operation\"9\202" + + "\323\344\223\0023*1/v1/projects/{project}/instances/{instance}/users\022\213\001\n" + + "\003Get\022\'.google.cloud.sql.v1.SqlUsersGetRequest\032\031.google.cloud" + + ".sql.v1.User\"@\202\323\344\223\002:\0228/v1/projects/{proj" + + "ect}/instances/{instance}/users/{name}\022\225\001\n" + + "\006Insert\022*.google.cloud.sql.v1.SqlUsers" + + "InsertRequest\032\036.google.cloud.sql.v1.Oper" + + "ation\"?\202\323\344\223\0029\"1/v1/projects/{project}/instances/{instance}/users:\004body\022\223\001\n" + + "\004List\022(.google.cloud.sql.v1.SqlUsersListReques" + + "t\032&.google.cloud.sql.v1.UsersListRespons" + + "e\"9\202\323\344\223\0023\0221/v1/projects/{project}/instances/{instance}/users\022\225\001\n" + + "\006Update\022*.google.cloud.sql.v1.SqlUsersUpdateRequest\032\036.go" + + "ogle.cloud.sql.v1.Operation\"?\202\323\344\223\0029\0321/v1" + + "/projects/{project}/instances/{instance}" + + "/users:\004body\032|\312A\027sqladmin.googleapis.com" + + "\322A_https://www.googleapis.com/auth/cloud" + + "-platform,https://www.googleapis.com/auth/sqlservice.adminBZ\n" + + "\027com.google.cloud.sql.v1B\022CloudSqlUsersProtoP\001Z)cloud.googl" + + "e.com/go/sql/apiv1/sqlpb;sqlpbb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_sql_v1_SqlUsersDeleteRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_sql_v1_SqlUsersDeleteRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlUsersDeleteRequest_descriptor, + new java.lang.String[] { + "Host", "Instance", "Name", "Project", + }); + internal_static_google_cloud_sql_v1_SqlUsersGetRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_sql_v1_SqlUsersGetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlUsersGetRequest_descriptor, + new java.lang.String[] { + "Instance", "Name", "Project", "Host", + }); + internal_static_google_cloud_sql_v1_SqlUsersInsertRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_sql_v1_SqlUsersInsertRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlUsersInsertRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1_SqlUsersListRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_sql_v1_SqlUsersListRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlUsersListRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1_SqlUsersUpdateRequest_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_cloud_sql_v1_SqlUsersUpdateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlUsersUpdateRequest_descriptor, + new java.lang.String[] { + "Host", "Instance", "Name", "Project", "DatabaseRoles", "RevokeExistingRoles", "Body", + }); + internal_static_google_cloud_sql_v1_UserPasswordValidationPolicy_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_cloud_sql_v1_UserPasswordValidationPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_UserPasswordValidationPolicy_descriptor, + new java.lang.String[] { + "AllowedFailedAttempts", + "PasswordExpirationDuration", + "EnableFailedAttemptsCheck", + "Status", + "EnablePasswordVerification", + }); + internal_static_google_cloud_sql_v1_PasswordStatus_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_cloud_sql_v1_PasswordStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_PasswordStatus_descriptor, + new java.lang.String[] { + "Locked", "PasswordExpirationTime", + }); + internal_static_google_cloud_sql_v1_User_descriptor = getDescriptor().getMessageType(7); + internal_static_google_cloud_sql_v1_User_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_User_descriptor, + new java.lang.String[] { + "Kind", + "Password", + "Etag", + "Name", + "Host", + "Instance", + "Project", + "Type", + "SqlserverUserDetails", + "IamEmail", + "PasswordPolicy", + "DualPasswordType", + "IamStatus", + "DatabaseRoles", + "UserDetails", + }); + internal_static_google_cloud_sql_v1_SqlServerUserDetails_descriptor = + getDescriptor().getMessageType(8); + internal_static_google_cloud_sql_v1_SqlServerUserDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_SqlServerUserDetails_descriptor, + new java.lang.String[] { + "Disabled", "ServerRoles", + }); + internal_static_google_cloud_sql_v1_UsersListResponse_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_cloud_sql_v1_UsersListResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1_UsersListResponse_descriptor, + new java.lang.String[] { + "Kind", "Items", "NextPageToken", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Column.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Column.java new file mode 100644 index 000000000000..6bf1fcbe36e6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Column.java @@ -0,0 +1,779 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Contains the name and datatype of a column.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Column} + */ +@com.google.protobuf.Generated +public final class Column extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.Column) + ColumnOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Column"); + } + + // Use Column.newBuilder() to construct. + private Column(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Column() { + name_ = ""; + type_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Column_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Column_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Column.class, com.google.cloud.sql.v1.Column.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Name of the column.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the column.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + + /** + * + * + *
+   * Datatype of the column.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + + /** + * + * + *
+   * Datatype of the column.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, type_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, type_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.Column)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.Column other = (com.google.cloud.sql.v1.Column) obj; + + if (!getName().equals(other.getName())) return false; + if (!getType().equals(other.getType())) return false; + if (!getUnknownFields().equals(other.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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.Column parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Column parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Column parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Column parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Column parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Column parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Column parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Column parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Column parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Column parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Column parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Column parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.Column prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Contains the name and datatype of a column.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Column} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.Column) + com.google.cloud.sql.v1.ColumnOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Column_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Column_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Column.class, com.google.cloud.sql.v1.Column.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.Column.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + type_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Column_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Column getDefaultInstanceForType() { + return com.google.cloud.sql.v1.Column.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.Column build() { + com.google.cloud.sql.v1.Column result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Column buildPartial() { + com.google.cloud.sql.v1.Column result = new com.google.cloud.sql.v1.Column(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.Column result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = type_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.Column) { + return mergeFrom((com.google.cloud.sql.v1.Column) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.Column other) { + if (other == com.google.cloud.sql.v1.Column.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + 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: + { + type_ = 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_ = ""; + + /** + * + * + *
+     * Name of the column.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the column.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the column.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the column.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the column.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + + /** + * + * + *
+     * Datatype of the column.
+     * 
+ * + * string type = 2; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Datatype of the column.
+     * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Datatype of the column.
+     * 
+ * + * string type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Datatype of the column.
+     * 
+ * + * string type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Datatype of the column.
+     * 
+ * + * string type = 2; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.Column) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.Column) + private static final com.google.cloud.sql.v1.Column DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.Column(); + } + + public static com.google.cloud.sql.v1.Column getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Column parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Column getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ColumnOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ColumnOrBuilder.java new file mode 100644 index 000000000000..8af765c5e4d5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ColumnOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ColumnOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.Column) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the column.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Name of the column.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Datatype of the column.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + java.lang.String getType(); + + /** + * + * + *
+   * Datatype of the column.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectSettings.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectSettings.java new file mode 100644 index 000000000000..c35021a423c7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectSettings.java @@ -0,0 +1,7323 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Connect settings retrieval response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ConnectSettings} + */ +@com.google.protobuf.Generated +public final class ConnectSettings extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ConnectSettings) + ConnectSettingsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ConnectSettings"); + } + + // Use ConnectSettings.newBuilder() to construct. + private ConnectSettings(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ConnectSettings() { + kind_ = ""; + ipAddresses_ = java.util.Collections.emptyList(); + region_ = ""; + databaseVersion_ = 0; + backendType_ = 0; + dnsName_ = ""; + serverCaMode_ = 0; + customSubjectAlternativeNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + dnsNames_ = java.util.Collections.emptyList(); + nodes_ = java.util.Collections.emptyList(); + mdxProtocolSupport_ = emptyIntList(); + connectionName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ConnectSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ConnectSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ConnectSettings.class, + com.google.cloud.sql.v1.ConnectSettings.Builder.class); + } + + /** + * + * + *
+   * Various Certificate Authority (CA) modes for certificate signing.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.ConnectSettings.CaMode} + */ + public enum CaMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * CA mode is unknown.
+     * 
+ * + * CA_MODE_UNSPECIFIED = 0; + */ + CA_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Google-managed self-signed internal CA.
+     * 
+ * + * GOOGLE_MANAGED_INTERNAL_CA = 1; + */ + GOOGLE_MANAGED_INTERNAL_CA(1), + /** + * + * + *
+     * Google-managed regional CA part of root CA hierarchy hosted on Google
+     * Cloud's Certificate Authority Service (CAS).
+     * 
+ * + * GOOGLE_MANAGED_CAS_CA = 2; + */ + GOOGLE_MANAGED_CAS_CA(2), + /** + * + * + *
+     * Customer-managed CA hosted on Google Cloud's Certificate Authority
+     * Service (CAS).
+     * 
+ * + * CUSTOMER_MANAGED_CAS_CA = 3; + */ + CUSTOMER_MANAGED_CAS_CA(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CaMode"); + } + + /** + * + * + *
+     * CA mode is unknown.
+     * 
+ * + * CA_MODE_UNSPECIFIED = 0; + */ + public static final int CA_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Google-managed self-signed internal CA.
+     * 
+ * + * GOOGLE_MANAGED_INTERNAL_CA = 1; + */ + public static final int GOOGLE_MANAGED_INTERNAL_CA_VALUE = 1; + + /** + * + * + *
+     * Google-managed regional CA part of root CA hierarchy hosted on Google
+     * Cloud's Certificate Authority Service (CAS).
+     * 
+ * + * GOOGLE_MANAGED_CAS_CA = 2; + */ + public static final int GOOGLE_MANAGED_CAS_CA_VALUE = 2; + + /** + * + * + *
+     * Customer-managed CA hosted on Google Cloud's Certificate Authority
+     * Service (CAS).
+     * 
+ * + * CUSTOMER_MANAGED_CAS_CA = 3; + */ + public static final int CUSTOMER_MANAGED_CAS_CA_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CaMode 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 CaMode forNumber(int value) { + switch (value) { + case 0: + return CA_MODE_UNSPECIFIED; + case 1: + return GOOGLE_MANAGED_INTERNAL_CA; + case 2: + return GOOGLE_MANAGED_CAS_CA; + case 3: + return CUSTOMER_MANAGED_CAS_CA; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CaMode findValueByNumber(int number) { + return CaMode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.ConnectSettings.getDescriptor().getEnumTypes().get(0); + } + + private static final CaMode[] VALUES = values(); + + public static CaMode 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 CaMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.ConnectSettings.CaMode) + } + + /** + * + * + *
+   * MdxProtocolSupport describes parts of the MDX protocol supported by this
+   * instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport} + */ + public enum MdxProtocolSupport implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * MDX_PROTOCOL_SUPPORT_UNSPECIFIED = 0; + */ + MDX_PROTOCOL_SUPPORT_UNSPECIFIED(0), + /** + * + * + *
+     * Client should send the client protocol type in the MDX request.
+     * 
+ * + * CLIENT_PROTOCOL_TYPE = 1; + */ + CLIENT_PROTOCOL_TYPE(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MdxProtocolSupport"); + } + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * MDX_PROTOCOL_SUPPORT_UNSPECIFIED = 0; + */ + public static final int MDX_PROTOCOL_SUPPORT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Client should send the client protocol type in the MDX request.
+     * 
+ * + * CLIENT_PROTOCOL_TYPE = 1; + */ + public static final int CLIENT_PROTOCOL_TYPE_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MdxProtocolSupport 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 MdxProtocolSupport forNumber(int value) { + switch (value) { + case 0: + return MDX_PROTOCOL_SUPPORT_UNSPECIFIED; + case 1: + return CLIENT_PROTOCOL_TYPE; + 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 MdxProtocolSupport findValueByNumber(int number) { + return MdxProtocolSupport.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.ConnectSettings.getDescriptor().getEnumTypes().get(1); + } + + private static final MdxProtocolSupport[] VALUES = values(); + + public static MdxProtocolSupport 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 MdxProtocolSupport(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport) + } + + public interface ConnectPoolNodeConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. The name of the read pool node. Doesn't include the project
+     * ID.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the name field is set. + */ + boolean hasName(); + + /** + * + * + *
+     * Output only. The name of the read pool node. Doesn't include the project
+     * ID.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+     * Output only. The name of the read pool node. Doesn't include the project
+     * ID.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getIpAddressesList(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.IpMapping getIpAddresses(int index); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getIpAddressesCount(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getIpAddressesOrBuilderList(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.IpMappingOrBuilder getIpAddressesOrBuilder(int index); + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + boolean hasDnsName(); + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + java.lang.String getDnsName(); + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + com.google.protobuf.ByteString getDnsNameBytes(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getDnsNamesList(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.DnsNameMapping getDnsNames(int index); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getDnsNamesCount(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getDnsNamesOrBuilderList(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index); + } + + /** + * + * + *
+   * Details of a single read pool node of a read pool.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig} + */ + public static final class ConnectPoolNodeConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig) + ConnectPoolNodeConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ConnectPoolNodeConfig"); + } + + // Use ConnectPoolNodeConfig.newBuilder() to construct. + private ConnectPoolNodeConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ConnectPoolNodeConfig() { + name_ = ""; + ipAddresses_ = java.util.Collections.emptyList(); + dnsName_ = ""; + dnsNames_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ConnectSettings_ConnectPoolNodeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ConnectSettings_ConnectPoolNodeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.class, + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. The name of the read pool node. Doesn't include the project
+     * ID.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the name field is set. + */ + @java.lang.Override + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Output only. The name of the read pool node. Doesn't include the project
+     * ID.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The name of the read pool node. Doesn't include the project
+     * ID.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESSES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List ipAddresses_; + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getIpAddressesList() { + return ipAddresses_; + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getIpAddressesOrBuilderList() { + return ipAddresses_; + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getIpAddressesCount() { + return ipAddresses_.size(); + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpMapping getIpAddresses(int index) { + return ipAddresses_.get(index); + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + return ipAddresses_.get(index); + } + + public static final int DNS_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object dnsName_ = ""; + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + @java.lang.Override + public boolean hasDnsName() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + @java.lang.Override + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DNS_NAMES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List dnsNames_; + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getDnsNamesList() { + return dnsNames_; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDnsNamesOrBuilderList() { + return dnsNames_; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getDnsNamesCount() { + return dnsNames_.size(); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMapping getDnsNames(int index) { + return dnsNames_.get(index); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + return dnsNames_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + output.writeMessage(2, ipAddresses_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, dnsName_); + } + for (int i = 0; i < dnsNames_.size(); i++) { + output.writeMessage(4, dnsNames_.get(i)); + } + 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.GeneratedMessage.computeStringSize(1, name_); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, ipAddresses_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, dnsName_); + } + for (int i = 0; i < dnsNames_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, dnsNames_.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.sql.v1.ConnectSettings.ConnectPoolNodeConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig other = + (com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig) obj; + + if (hasName() != other.hasName()) return false; + if (hasName()) { + if (!getName().equals(other.getName())) return false; + } + if (!getIpAddressesList().equals(other.getIpAddressesList())) return false; + if (hasDnsName() != other.hasDnsName()) return false; + if (hasDnsName()) { + if (!getDnsName().equals(other.getDnsName())) return false; + } + if (!getDnsNamesList().equals(other.getDnsNamesList())) return false; + if (!getUnknownFields().equals(other.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 (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (getIpAddressesCount() > 0) { + hash = (37 * hash) + IP_ADDRESSES_FIELD_NUMBER; + hash = (53 * hash) + getIpAddressesList().hashCode(); + } + if (hasDnsName()) { + hash = (37 * hash) + DNS_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDnsName().hashCode(); + } + if (getDnsNamesCount() > 0) { + hash = (37 * hash) + DNS_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getDnsNamesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Details of a single read pool node of a read pool.
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig) + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ConnectSettings_ConnectPoolNodeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ConnectSettings_ConnectPoolNodeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.class, + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + } else { + ipAddresses_ = null; + ipAddressesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + dnsName_ = ""; + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + } else { + dnsNames_ = null; + dnsNamesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ConnectSettings_ConnectPoolNodeConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig build() { + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig buildPartial() { + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig result = + new com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig result) { + if (ipAddressesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + ipAddresses_ = java.util.Collections.unmodifiableList(ipAddresses_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.ipAddresses_ = ipAddresses_; + } else { + result.ipAddresses_ = ipAddressesBuilder_.build(); + } + if (dnsNamesBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + dnsNames_ = java.util.Collections.unmodifiableList(dnsNames_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.dnsNames_ = dnsNames_; + } else { + result.dnsNames_ = dnsNamesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dnsName_ = dnsName_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig) { + return mergeFrom((com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig other) { + if (other + == com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.getDefaultInstance()) + return this; + if (other.hasName()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (ipAddressesBuilder_ == null) { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddresses_.isEmpty()) { + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureIpAddressesIsMutable(); + ipAddresses_.addAll(other.ipAddresses_); + } + onChanged(); + } + } else { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddressesBuilder_.isEmpty()) { + ipAddressesBuilder_.dispose(); + ipAddressesBuilder_ = null; + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000002); + ipAddressesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetIpAddressesFieldBuilder() + : null; + } else { + ipAddressesBuilder_.addAllMessages(other.ipAddresses_); + } + } + } + if (other.hasDnsName()) { + dnsName_ = other.dnsName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (dnsNamesBuilder_ == null) { + if (!other.dnsNames_.isEmpty()) { + if (dnsNames_.isEmpty()) { + dnsNames_ = other.dnsNames_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureDnsNamesIsMutable(); + dnsNames_.addAll(other.dnsNames_); + } + onChanged(); + } + } else { + if (!other.dnsNames_.isEmpty()) { + if (dnsNamesBuilder_.isEmpty()) { + dnsNamesBuilder_.dispose(); + dnsNamesBuilder_ = null; + dnsNames_ = other.dnsNames_; + bitField0_ = (bitField0_ & ~0x00000008); + dnsNamesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDnsNamesFieldBuilder() + : null; + } else { + dnsNamesBuilder_.addAllMessages(other.dnsNames_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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: + { + com.google.cloud.sql.v1.IpMapping m = + input.readMessage( + com.google.cloud.sql.v1.IpMapping.parser(), extensionRegistry); + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(m); + } else { + ipAddressesBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + dnsName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.cloud.sql.v1.DnsNameMapping m = + input.readMessage( + com.google.cloud.sql.v1.DnsNameMapping.parser(), extensionRegistry); + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(m); + } else { + dnsNamesBuilder_.addMessage(m); + } + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+       * Output only. The name of the read pool node. Doesn't include the project
+       * ID.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the name field is set. + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Output only. The name of the read pool node. Doesn't include the project
+       * ID.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The name of the read pool node. Doesn't include the project
+       * ID.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The name of the read pool node. Doesn't include the project
+       * ID.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The name of the read pool node. Doesn't include the project
+       * ID.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The name of the read pool node. Doesn't include the project
+       * ID.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List ipAddresses_ = + java.util.Collections.emptyList(); + + private void ensureIpAddressesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + ipAddresses_ = new java.util.ArrayList(ipAddresses_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.IpMapping, + com.google.cloud.sql.v1.IpMapping.Builder, + com.google.cloud.sql.v1.IpMappingOrBuilder> + ipAddressesBuilder_; + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getIpAddressesList() { + if (ipAddressesBuilder_ == null) { + return java.util.Collections.unmodifiableList(ipAddresses_); + } else { + return ipAddressesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getIpAddressesCount() { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.size(); + } else { + return ipAddressesBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.IpMapping getIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setIpAddresses(int index, com.google.cloud.sql.v1.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, value); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setIpAddresses( + int index, com.google.cloud.sql.v1.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses(com.google.cloud.sql.v1.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses(int index, com.google.cloud.sql.v1.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses(com.google.cloud.sql.v1.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses( + int index, com.google.cloud.sql.v1.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllIpAddresses( + java.lang.Iterable values) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipAddresses_); + onChanged(); + } else { + ipAddressesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearIpAddresses() { + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + ipAddressesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.remove(index); + onChanged(); + } else { + ipAddressesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.IpMapping.Builder getIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getIpAddressesOrBuilderList() { + if (ipAddressesBuilder_ != null) { + return ipAddressesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(ipAddresses_); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.IpMapping.Builder addIpAddressesBuilder() { + return internalGetIpAddressesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.IpMapping.Builder addIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getIpAddressesBuilderList() { + return internalGetIpAddressesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.IpMapping, + com.google.cloud.sql.v1.IpMapping.Builder, + com.google.cloud.sql.v1.IpMappingOrBuilder> + internalGetIpAddressesFieldBuilder() { + if (ipAddressesBuilder_ == null) { + ipAddressesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.IpMapping, + com.google.cloud.sql.v1.IpMapping.Builder, + com.google.cloud.sql.v1.IpMappingOrBuilder>( + ipAddresses_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + ipAddresses_ = null; + } + return ipAddressesBuilder_; + } + + private java.lang.Object dnsName_ = ""; + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + public boolean hasDnsName() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dnsName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDnsName() { + dnsName_ = getDefaultInstance().getDnsName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dnsName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List dnsNames_ = + java.util.Collections.emptyList(); + + private void ensureDnsNamesIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + dnsNames_ = new java.util.ArrayList(dnsNames_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DnsNameMapping, + com.google.cloud.sql.v1.DnsNameMapping.Builder, + com.google.cloud.sql.v1.DnsNameMappingOrBuilder> + dnsNamesBuilder_; + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getDnsNamesList() { + if (dnsNamesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dnsNames_); + } else { + return dnsNamesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getDnsNamesCount() { + if (dnsNamesBuilder_ == null) { + return dnsNames_.size(); + } else { + return dnsNamesBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping getDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames(int index, com.google.cloud.sql.v1.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.set(index, value); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames( + int index, com.google.cloud.sql.v1.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.set(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(com.google.cloud.sql.v1.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(int index, com.google.cloud.sql.v1.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(index, value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(com.google.cloud.sql.v1.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames( + int index, com.google.cloud.sql.v1.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllDnsNames( + java.lang.Iterable values) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dnsNames_); + onChanged(); + } else { + dnsNamesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDnsNames() { + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + dnsNamesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.remove(index); + onChanged(); + } else { + dnsNamesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping.Builder getDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDnsNamesOrBuilderList() { + if (dnsNamesBuilder_ != null) { + return dnsNamesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dnsNames_); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping.Builder addDnsNamesBuilder() { + return internalGetDnsNamesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping.Builder addDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDnsNamesBuilderList() { + return internalGetDnsNamesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DnsNameMapping, + com.google.cloud.sql.v1.DnsNameMapping.Builder, + com.google.cloud.sql.v1.DnsNameMappingOrBuilder> + internalGetDnsNamesFieldBuilder() { + if (dnsNamesBuilder_ == null) { + dnsNamesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DnsNameMapping, + com.google.cloud.sql.v1.DnsNameMapping.Builder, + com.google.cloud.sql.v1.DnsNameMappingOrBuilder>( + dnsNames_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + dnsNames_ = null; + } + return dnsNamesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig) + private static final com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig(); + } + + public static com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectPoolNodeConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#connectSettings`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#connectSettings`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVER_CA_CERT_FIELD_NUMBER = 2; + private com.google.cloud.sql.v1.SslCert serverCaCert_; + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + * + * @return Whether the serverCaCert field is set. + */ + @java.lang.Override + public boolean hasServerCaCert() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + * + * @return The serverCaCert. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCert getServerCaCert() { + return serverCaCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : serverCaCert_; + } + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertOrBuilder getServerCaCertOrBuilder() { + return serverCaCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : serverCaCert_; + } + + public static final int IP_ADDRESSES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List ipAddresses_; + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + @java.lang.Override + public java.util.List getIpAddressesList() { + return ipAddresses_; + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + @java.lang.Override + public java.util.List + getIpAddressesOrBuilderList() { + return ipAddresses_; + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + @java.lang.Override + public int getIpAddressesCount() { + return ipAddresses_.size(); + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpMapping getIpAddresses(int index) { + return ipAddresses_.get(index); + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + return ipAddresses_.get(index); + } + + public static final int REGION_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object region_ = ""; + + /** + * + * + *
+   * The cloud region for the instance. For example, `us-central1`,
+   * `europe-west1`. The region cannot be changed after instance creation.
+   * 
+ * + * string region = 4; + * + * @return The region. + */ + @java.lang.Override + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } + } + + /** + * + * + *
+   * The cloud region for the instance. For example, `us-central1`,
+   * `europe-west1`. The region cannot be changed after instance creation.
+   * 
+ * + * string region = 4; + * + * @return The bytes for region. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_VERSION_FIELD_NUMBER = 31; + private int databaseVersion_ = 0; + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion`
+   * field cannot be changed after instance creation.
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+   * or `MYSQL_5_6`.
+   * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+   * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+   * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+   * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 31; + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion`
+   * field cannot be changed after instance creation.
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+   * or `MYSQL_5_6`.
+   * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+   * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+   * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+   * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 31; + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1.SqlDatabaseVersion result = + com.google.cloud.sql.v1.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + public static final int BACKEND_TYPE_FIELD_NUMBER = 32; + private int backendType_ = 0; + + /** + * + * + *
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 32; + * + * @return The enum numeric value on the wire for backendType. + */ + @java.lang.Override + public int getBackendTypeValue() { + return backendType_; + } + + /** + * + * + *
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 32; + * + * @return The backendType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackendType getBackendType() { + com.google.cloud.sql.v1.SqlBackendType result = + com.google.cloud.sql.v1.SqlBackendType.forNumber(backendType_); + return result == null ? com.google.cloud.sql.v1.SqlBackendType.UNRECOGNIZED : result; + } + + public static final int PSC_ENABLED_FIELD_NUMBER = 33; + private boolean pscEnabled_ = false; + + /** + * + * + *
+   * Whether PSC connectivity is enabled for this instance.
+   * 
+ * + * bool psc_enabled = 33; + * + * @return The pscEnabled. + */ + @java.lang.Override + public boolean getPscEnabled() { + return pscEnabled_; + } + + public static final int DNS_NAME_FIELD_NUMBER = 34; + + @SuppressWarnings("serial") + private volatile java.lang.Object dnsName_ = ""; + + /** + * + * + *
+   * The dns name of the instance.
+   * 
+ * + * string dns_name = 34; + * + * @return The dnsName. + */ + @java.lang.Override + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } + } + + /** + * + * + *
+   * The dns name of the instance.
+   * 
+ * + * string dns_name = 34; + * + * @return The bytes for dnsName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVER_CA_MODE_FIELD_NUMBER = 35; + private int serverCaMode_ = 0; + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * .google.cloud.sql.v1.ConnectSettings.CaMode server_ca_mode = 35; + * + * @return The enum numeric value on the wire for serverCaMode. + */ + @java.lang.Override + public int getServerCaModeValue() { + return serverCaMode_; + } + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * .google.cloud.sql.v1.ConnectSettings.CaMode server_ca_mode = 35; + * + * @return The serverCaMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ConnectSettings.CaMode getServerCaMode() { + com.google.cloud.sql.v1.ConnectSettings.CaMode result = + com.google.cloud.sql.v1.ConnectSettings.CaMode.forNumber(serverCaMode_); + return result == null ? com.google.cloud.sql.v1.ConnectSettings.CaMode.UNRECOGNIZED : result; + } + + public static final int CUSTOM_SUBJECT_ALTERNATIVE_NAMES_FIELD_NUMBER = 37; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList customSubjectAlternativeNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @return A list containing the customSubjectAlternativeNames. + */ + public com.google.protobuf.ProtocolStringList getCustomSubjectAlternativeNamesList() { + return customSubjectAlternativeNames_; + } + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @return The count of customSubjectAlternativeNames. + */ + public int getCustomSubjectAlternativeNamesCount() { + return customSubjectAlternativeNames_.size(); + } + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param index The index of the element to return. + * @return The customSubjectAlternativeNames at the given index. + */ + public java.lang.String getCustomSubjectAlternativeNames(int index) { + return customSubjectAlternativeNames_.get(index); + } + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param index The index of the value to return. + * @return The bytes of the customSubjectAlternativeNames at the given index. + */ + public com.google.protobuf.ByteString getCustomSubjectAlternativeNamesBytes(int index) { + return customSubjectAlternativeNames_.getByteString(index); + } + + public static final int DNS_NAMES_FIELD_NUMBER = 38; + + @SuppressWarnings("serial") + private java.util.List dnsNames_; + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getDnsNamesList() { + return dnsNames_; + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDnsNamesOrBuilderList() { + return dnsNames_; + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getDnsNamesCount() { + return dnsNames_.size(); + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMapping getDnsNames(int index) { + return dnsNames_.get(index); + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + return dnsNames_.get(index); + } + + public static final int NODE_COUNT_FIELD_NUMBER = 63; + private int nodeCount_ = 0; + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return Whether the nodeCount field is set. + */ + @java.lang.Override + public boolean hasNodeCount() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + + public static final int NODES_FIELD_NUMBER = 64; + + @SuppressWarnings("serial") + private java.util.List nodes_; + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getNodesList() { + return nodes_; + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfigOrBuilder> + getNodesOrBuilderList() { + return nodes_; + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getNodesCount() { + return nodes_.size(); + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig getNodes(int index) { + return nodes_.get(index); + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfigOrBuilder getNodesOrBuilder( + int index) { + return nodes_.get(index); + } + + public static final int MDX_PROTOCOL_SUPPORT_FIELD_NUMBER = 39; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList mdxProtocolSupport_ = emptyIntList(); + + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport> + mdxProtocolSupport_converter_ = + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport>() { + public com.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport convert(int from) { + com.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport result = + com.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport.forNumber(from); + return result == null + ? com.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport.UNRECOGNIZED + : result; + } + }; + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the mdxProtocolSupport. + */ + @java.lang.Override + public java.util.List + getMdxProtocolSupportList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport>( + mdxProtocolSupport_, mdxProtocolSupport_converter_); + } + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of mdxProtocolSupport. + */ + @java.lang.Override + public int getMdxProtocolSupportCount() { + return mdxProtocolSupport_.size(); + } + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The mdxProtocolSupport at the given index. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport getMdxProtocolSupport( + int index) { + return mdxProtocolSupport_converter_.convert(mdxProtocolSupport_.getInt(index)); + } + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for mdxProtocolSupport. + */ + @java.lang.Override + public java.util.List getMdxProtocolSupportValueList() { + return mdxProtocolSupport_; + } + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of mdxProtocolSupport at the given index. + */ + @java.lang.Override + public int getMdxProtocolSupportValue(int index) { + return mdxProtocolSupport_.getInt(index); + } + + private int mdxProtocolSupportMemoizedSerializedSize; + + public static final int CONNECTION_NAME_FIELD_NUMBER = 40; + + @SuppressWarnings("serial") + private volatile java.lang.Object connectionName_ = ""; + + /** + * + * + *
+   * Optional. Output only. Connection name of the Cloud SQL instance used in
+   * connection strings, in the format project:region:instance.
+   * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The connectionName. + */ + @java.lang.Override + public java.lang.String getConnectionName() { + java.lang.Object ref = connectionName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Output only. Connection name of the Cloud SQL instance used in
+   * connection strings, in the format project:region:instance.
+   * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for connectionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConnectionNameBytes() { + java.lang.Object ref = connectionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionName_ = 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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getServerCaCert()); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + output.writeMessage(3, ipAddresses_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, region_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(31, databaseVersion_); + } + if (backendType_ + != com.google.cloud.sql.v1.SqlBackendType.SQL_BACKEND_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(32, backendType_); + } + if (pscEnabled_ != false) { + output.writeBool(33, pscEnabled_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dnsName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 34, dnsName_); + } + if (serverCaMode_ + != com.google.cloud.sql.v1.ConnectSettings.CaMode.CA_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(35, serverCaMode_); + } + for (int i = 0; i < customSubjectAlternativeNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 37, customSubjectAlternativeNames_.getRaw(i)); + } + for (int i = 0; i < dnsNames_.size(); i++) { + output.writeMessage(38, dnsNames_.get(i)); + } + if (getMdxProtocolSupportList().size() > 0) { + output.writeUInt32NoTag(314); + output.writeUInt32NoTag(mdxProtocolSupportMemoizedSerializedSize); + } + for (int i = 0; i < mdxProtocolSupport_.size(); i++) { + output.writeEnumNoTag(mdxProtocolSupport_.getInt(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(connectionName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 40, connectionName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(63, nodeCount_); + } + for (int i = 0; i < nodes_.size(); i++) { + output.writeMessage(64, nodes_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getServerCaCert()); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, ipAddresses_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, region_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(31, databaseVersion_); + } + if (backendType_ + != com.google.cloud.sql.v1.SqlBackendType.SQL_BACKEND_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(32, backendType_); + } + if (pscEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(33, pscEnabled_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dnsName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(34, dnsName_); + } + if (serverCaMode_ + != com.google.cloud.sql.v1.ConnectSettings.CaMode.CA_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(35, serverCaMode_); + } + { + int dataSize = 0; + for (int i = 0; i < customSubjectAlternativeNames_.size(); i++) { + dataSize += computeStringSizeNoTag(customSubjectAlternativeNames_.getRaw(i)); + } + size += dataSize; + size += 2 * getCustomSubjectAlternativeNamesList().size(); + } + for (int i = 0; i < dnsNames_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(38, dnsNames_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < mdxProtocolSupport_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag( + mdxProtocolSupport_.getInt(i)); + } + size += dataSize; + if (!getMdxProtocolSupportList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + mdxProtocolSupportMemoizedSerializedSize = dataSize; + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(connectionName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(40, connectionName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(63, nodeCount_); + } + for (int i = 0; i < nodes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(64, nodes_.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.sql.v1.ConnectSettings)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ConnectSettings other = (com.google.cloud.sql.v1.ConnectSettings) obj; + + if (!getKind().equals(other.getKind())) return false; + if (hasServerCaCert() != other.hasServerCaCert()) return false; + if (hasServerCaCert()) { + if (!getServerCaCert().equals(other.getServerCaCert())) return false; + } + if (!getIpAddressesList().equals(other.getIpAddressesList())) return false; + if (!getRegion().equals(other.getRegion())) return false; + if (databaseVersion_ != other.databaseVersion_) return false; + if (backendType_ != other.backendType_) return false; + if (getPscEnabled() != other.getPscEnabled()) return false; + if (!getDnsName().equals(other.getDnsName())) return false; + if (serverCaMode_ != other.serverCaMode_) return false; + if (!getCustomSubjectAlternativeNamesList() + .equals(other.getCustomSubjectAlternativeNamesList())) return false; + if (!getDnsNamesList().equals(other.getDnsNamesList())) return false; + if (hasNodeCount() != other.hasNodeCount()) return false; + if (hasNodeCount()) { + if (getNodeCount() != other.getNodeCount()) return false; + } + if (!getNodesList().equals(other.getNodesList())) return false; + if (!mdxProtocolSupport_.equals(other.mdxProtocolSupport_)) return false; + if (!getConnectionName().equals(other.getConnectionName())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasServerCaCert()) { + hash = (37 * hash) + SERVER_CA_CERT_FIELD_NUMBER; + hash = (53 * hash) + getServerCaCert().hashCode(); + } + if (getIpAddressesCount() > 0) { + hash = (37 * hash) + IP_ADDRESSES_FIELD_NUMBER; + hash = (53 * hash) + getIpAddressesList().hashCode(); + } + hash = (37 * hash) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegion().hashCode(); + hash = (37 * hash) + DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + databaseVersion_; + hash = (37 * hash) + BACKEND_TYPE_FIELD_NUMBER; + hash = (53 * hash) + backendType_; + hash = (37 * hash) + PSC_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPscEnabled()); + hash = (37 * hash) + DNS_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDnsName().hashCode(); + hash = (37 * hash) + SERVER_CA_MODE_FIELD_NUMBER; + hash = (53 * hash) + serverCaMode_; + if (getCustomSubjectAlternativeNamesCount() > 0) { + hash = (37 * hash) + CUSTOM_SUBJECT_ALTERNATIVE_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getCustomSubjectAlternativeNamesList().hashCode(); + } + if (getDnsNamesCount() > 0) { + hash = (37 * hash) + DNS_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getDnsNamesList().hashCode(); + } + if (hasNodeCount()) { + hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getNodeCount(); + } + if (getNodesCount() > 0) { + hash = (37 * hash) + NODES_FIELD_NUMBER; + hash = (53 * hash) + getNodesList().hashCode(); + } + if (getMdxProtocolSupportCount() > 0) { + hash = (37 * hash) + MDX_PROTOCOL_SUPPORT_FIELD_NUMBER; + hash = (53 * hash) + mdxProtocolSupport_.hashCode(); + } + hash = (37 * hash) + CONNECTION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getConnectionName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ConnectSettings parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ConnectSettings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ConnectSettings parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ConnectSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectSettings parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ConnectSettings parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectSettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ConnectSettings parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ConnectSettings parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.ConnectSettings prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Connect settings retrieval response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ConnectSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ConnectSettings) + com.google.cloud.sql.v1.ConnectSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ConnectSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ConnectSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ConnectSettings.class, + com.google.cloud.sql.v1.ConnectSettings.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ConnectSettings.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetServerCaCertFieldBuilder(); + internalGetIpAddressesFieldBuilder(); + internalGetDnsNamesFieldBuilder(); + internalGetNodesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + serverCaCert_ = null; + if (serverCaCertBuilder_ != null) { + serverCaCertBuilder_.dispose(); + serverCaCertBuilder_ = null; + } + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + } else { + ipAddresses_ = null; + ipAddressesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + region_ = ""; + databaseVersion_ = 0; + backendType_ = 0; + pscEnabled_ = false; + dnsName_ = ""; + serverCaMode_ = 0; + customSubjectAlternativeNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + } else { + dnsNames_ = null; + dnsNamesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + nodeCount_ = 0; + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + } else { + nodes_ = null; + nodesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00001000); + mdxProtocolSupport_ = emptyIntList(); + connectionName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ConnectSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectSettings getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ConnectSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectSettings build() { + com.google.cloud.sql.v1.ConnectSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectSettings buildPartial() { + com.google.cloud.sql.v1.ConnectSettings result = + new com.google.cloud.sql.v1.ConnectSettings(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.ConnectSettings result) { + if (ipAddressesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + ipAddresses_ = java.util.Collections.unmodifiableList(ipAddresses_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.ipAddresses_ = ipAddresses_; + } else { + result.ipAddresses_ = ipAddressesBuilder_.build(); + } + if (dnsNamesBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + dnsNames_ = java.util.Collections.unmodifiableList(dnsNames_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.dnsNames_ = dnsNames_; + } else { + result.dnsNames_ = dnsNamesBuilder_.build(); + } + if (nodesBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0)) { + nodes_ = java.util.Collections.unmodifiableList(nodes_); + bitField0_ = (bitField0_ & ~0x00001000); + } + result.nodes_ = nodes_; + } else { + result.nodes_ = nodesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.ConnectSettings result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.serverCaCert_ = + serverCaCertBuilder_ == null ? serverCaCert_ : serverCaCertBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.region_ = region_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.databaseVersion_ = databaseVersion_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.backendType_ = backendType_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pscEnabled_ = pscEnabled_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.dnsName_ = dnsName_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.serverCaMode_ = serverCaMode_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + customSubjectAlternativeNames_.makeImmutable(); + result.customSubjectAlternativeNames_ = customSubjectAlternativeNames_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.nodeCount_ = nodeCount_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + mdxProtocolSupport_.makeImmutable(); + result.mdxProtocolSupport_ = mdxProtocolSupport_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.connectionName_ = connectionName_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ConnectSettings) { + return mergeFrom((com.google.cloud.sql.v1.ConnectSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ConnectSettings other) { + if (other == com.google.cloud.sql.v1.ConnectSettings.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasServerCaCert()) { + mergeServerCaCert(other.getServerCaCert()); + } + if (ipAddressesBuilder_ == null) { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddresses_.isEmpty()) { + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureIpAddressesIsMutable(); + ipAddresses_.addAll(other.ipAddresses_); + } + onChanged(); + } + } else { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddressesBuilder_.isEmpty()) { + ipAddressesBuilder_.dispose(); + ipAddressesBuilder_ = null; + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000004); + ipAddressesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetIpAddressesFieldBuilder() + : null; + } else { + ipAddressesBuilder_.addAllMessages(other.ipAddresses_); + } + } + } + if (!other.getRegion().isEmpty()) { + region_ = other.region_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.databaseVersion_ != 0) { + setDatabaseVersionValue(other.getDatabaseVersionValue()); + } + if (other.backendType_ != 0) { + setBackendTypeValue(other.getBackendTypeValue()); + } + if (other.getPscEnabled() != false) { + setPscEnabled(other.getPscEnabled()); + } + if (!other.getDnsName().isEmpty()) { + dnsName_ = other.dnsName_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.serverCaMode_ != 0) { + setServerCaModeValue(other.getServerCaModeValue()); + } + if (!other.customSubjectAlternativeNames_.isEmpty()) { + if (customSubjectAlternativeNames_.isEmpty()) { + customSubjectAlternativeNames_ = other.customSubjectAlternativeNames_; + bitField0_ |= 0x00000200; + } else { + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.addAll(other.customSubjectAlternativeNames_); + } + onChanged(); + } + if (dnsNamesBuilder_ == null) { + if (!other.dnsNames_.isEmpty()) { + if (dnsNames_.isEmpty()) { + dnsNames_ = other.dnsNames_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureDnsNamesIsMutable(); + dnsNames_.addAll(other.dnsNames_); + } + onChanged(); + } + } else { + if (!other.dnsNames_.isEmpty()) { + if (dnsNamesBuilder_.isEmpty()) { + dnsNamesBuilder_.dispose(); + dnsNamesBuilder_ = null; + dnsNames_ = other.dnsNames_; + bitField0_ = (bitField0_ & ~0x00000400); + dnsNamesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDnsNamesFieldBuilder() + : null; + } else { + dnsNamesBuilder_.addAllMessages(other.dnsNames_); + } + } + } + if (other.hasNodeCount()) { + setNodeCount(other.getNodeCount()); + } + if (nodesBuilder_ == null) { + if (!other.nodes_.isEmpty()) { + if (nodes_.isEmpty()) { + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00001000); + } else { + ensureNodesIsMutable(); + nodes_.addAll(other.nodes_); + } + onChanged(); + } + } else { + if (!other.nodes_.isEmpty()) { + if (nodesBuilder_.isEmpty()) { + nodesBuilder_.dispose(); + nodesBuilder_ = null; + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00001000); + nodesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetNodesFieldBuilder() + : null; + } else { + nodesBuilder_.addAllMessages(other.nodes_); + } + } + } + if (!other.mdxProtocolSupport_.isEmpty()) { + if (mdxProtocolSupport_.isEmpty()) { + mdxProtocolSupport_ = other.mdxProtocolSupport_; + mdxProtocolSupport_.makeImmutable(); + bitField0_ |= 0x00002000; + } else { + ensureMdxProtocolSupportIsMutable(); + mdxProtocolSupport_.addAll(other.mdxProtocolSupport_); + } + onChanged(); + } + if (!other.getConnectionName().isEmpty()) { + connectionName_ = other.connectionName_; + bitField0_ |= 0x00004000; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetServerCaCertFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.cloud.sql.v1.IpMapping m = + input.readMessage( + com.google.cloud.sql.v1.IpMapping.parser(), extensionRegistry); + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(m); + } else { + ipAddressesBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + region_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 248: + { + databaseVersion_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 248 + case 256: + { + backendType_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 256 + case 264: + { + pscEnabled_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 264 + case 274: + { + dnsName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 274 + case 280: + { + serverCaMode_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 280 + case 298: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.add(s); + break; + } // case 298 + case 306: + { + com.google.cloud.sql.v1.DnsNameMapping m = + input.readMessage( + com.google.cloud.sql.v1.DnsNameMapping.parser(), extensionRegistry); + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(m); + } else { + dnsNamesBuilder_.addMessage(m); + } + break; + } // case 306 + case 312: + { + int tmpRaw = input.readEnum(); + ensureMdxProtocolSupportIsMutable(); + mdxProtocolSupport_.addInt(tmpRaw); + break; + } // case 312 + case 314: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureMdxProtocolSupportIsMutable(); + while (input.getBytesUntilLimit() > 0) { + mdxProtocolSupport_.addInt(input.readEnum()); + } + input.popLimit(limit); + break; + } // case 314 + case 322: + { + connectionName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 322 + case 504: + { + nodeCount_ = input.readInt32(); + bitField0_ |= 0x00000800; + break; + } // case 504 + case 514: + { + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig m = + input.readMessage( + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.parser(), + extensionRegistry); + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(m); + } else { + nodesBuilder_.addMessage(m); + } + break; + } // case 514 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#connectSettings`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#connectSettings`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#connectSettings`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#connectSettings`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#connectSettings`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.SslCert serverCaCert_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + serverCaCertBuilder_; + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + * + * @return Whether the serverCaCert field is set. + */ + public boolean hasServerCaCert() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + * + * @return The serverCaCert. + */ + public com.google.cloud.sql.v1.SslCert getServerCaCert() { + if (serverCaCertBuilder_ == null) { + return serverCaCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : serverCaCert_; + } else { + return serverCaCertBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + */ + public Builder setServerCaCert(com.google.cloud.sql.v1.SslCert value) { + if (serverCaCertBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serverCaCert_ = value; + } else { + serverCaCertBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + */ + public Builder setServerCaCert(com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (serverCaCertBuilder_ == null) { + serverCaCert_ = builderForValue.build(); + } else { + serverCaCertBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + */ + public Builder mergeServerCaCert(com.google.cloud.sql.v1.SslCert value) { + if (serverCaCertBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && serverCaCert_ != null + && serverCaCert_ != com.google.cloud.sql.v1.SslCert.getDefaultInstance()) { + getServerCaCertBuilder().mergeFrom(value); + } else { + serverCaCert_ = value; + } + } else { + serverCaCertBuilder_.mergeFrom(value); + } + if (serverCaCert_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + */ + public Builder clearServerCaCert() { + bitField0_ = (bitField0_ & ~0x00000002); + serverCaCert_ = null; + if (serverCaCertBuilder_ != null) { + serverCaCertBuilder_.dispose(); + serverCaCertBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + */ + public com.google.cloud.sql.v1.SslCert.Builder getServerCaCertBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetServerCaCertFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + */ + public com.google.cloud.sql.v1.SslCertOrBuilder getServerCaCertOrBuilder() { + if (serverCaCertBuilder_ != null) { + return serverCaCertBuilder_.getMessageOrBuilder(); + } else { + return serverCaCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : serverCaCert_; + } + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + internalGetServerCaCertFieldBuilder() { + if (serverCaCertBuilder_ == null) { + serverCaCertBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder>( + getServerCaCert(), getParentForChildren(), isClean()); + serverCaCert_ = null; + } + return serverCaCertBuilder_; + } + + private java.util.List ipAddresses_ = + java.util.Collections.emptyList(); + + private void ensureIpAddressesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + ipAddresses_ = new java.util.ArrayList(ipAddresses_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.IpMapping, + com.google.cloud.sql.v1.IpMapping.Builder, + com.google.cloud.sql.v1.IpMappingOrBuilder> + ipAddressesBuilder_; + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public java.util.List getIpAddressesList() { + if (ipAddressesBuilder_ == null) { + return java.util.Collections.unmodifiableList(ipAddresses_); + } else { + return ipAddressesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public int getIpAddressesCount() { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.size(); + } else { + return ipAddressesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public com.google.cloud.sql.v1.IpMapping getIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public Builder setIpAddresses(int index, com.google.cloud.sql.v1.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, value); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public Builder setIpAddresses( + int index, com.google.cloud.sql.v1.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public Builder addIpAddresses(com.google.cloud.sql.v1.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public Builder addIpAddresses(int index, com.google.cloud.sql.v1.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public Builder addIpAddresses(com.google.cloud.sql.v1.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public Builder addIpAddresses( + int index, com.google.cloud.sql.v1.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public Builder addAllIpAddresses( + java.lang.Iterable values) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipAddresses_); + onChanged(); + } else { + ipAddressesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public Builder clearIpAddresses() { + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + ipAddressesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public Builder removeIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.remove(index); + onChanged(); + } else { + ipAddressesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public com.google.cloud.sql.v1.IpMapping.Builder getIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public com.google.cloud.sql.v1.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public java.util.List + getIpAddressesOrBuilderList() { + if (ipAddressesBuilder_ != null) { + return ipAddressesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(ipAddresses_); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public com.google.cloud.sql.v1.IpMapping.Builder addIpAddressesBuilder() { + return internalGetIpAddressesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public com.google.cloud.sql.v1.IpMapping.Builder addIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + public java.util.List getIpAddressesBuilderList() { + return internalGetIpAddressesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.IpMapping, + com.google.cloud.sql.v1.IpMapping.Builder, + com.google.cloud.sql.v1.IpMappingOrBuilder> + internalGetIpAddressesFieldBuilder() { + if (ipAddressesBuilder_ == null) { + ipAddressesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.IpMapping, + com.google.cloud.sql.v1.IpMapping.Builder, + com.google.cloud.sql.v1.IpMappingOrBuilder>( + ipAddresses_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + ipAddresses_ = null; + } + return ipAddressesBuilder_; + } + + private java.lang.Object region_ = ""; + + /** + * + * + *
+     * The cloud region for the instance. For example, `us-central1`,
+     * `europe-west1`. The region cannot be changed after instance creation.
+     * 
+ * + * string region = 4; + * + * @return The region. + */ + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The cloud region for the instance. For example, `us-central1`,
+     * `europe-west1`. The region cannot be changed after instance creation.
+     * 
+ * + * string region = 4; + * + * @return The bytes for region. + */ + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The cloud region for the instance. For example, `us-central1`,
+     * `europe-west1`. The region cannot be changed after instance creation.
+     * 
+ * + * string region = 4; + * + * @param value The region to set. + * @return This builder for chaining. + */ + public Builder setRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + region_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The cloud region for the instance. For example, `us-central1`,
+     * `europe-west1`. The region cannot be changed after instance creation.
+     * 
+ * + * string region = 4; + * + * @return This builder for chaining. + */ + public Builder clearRegion() { + region_ = getDefaultInstance().getRegion(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The cloud region for the instance. For example, `us-central1`,
+     * `europe-west1`. The region cannot be changed after instance creation.
+     * 
+ * + * string region = 4; + * + * @param value The bytes for region to set. + * @return This builder for chaining. + */ + public Builder setRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + region_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int databaseVersion_ = 0; + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion`
+     * field cannot be changed after instance creation.
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+     * or `MYSQL_5_6`.
+     * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+     * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+     * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+     * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 31; + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion`
+     * field cannot be changed after instance creation.
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+     * or `MYSQL_5_6`.
+     * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+     * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+     * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+     * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 31; + * + * @param value The enum numeric value on the wire for databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersionValue(int value) { + databaseVersion_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion`
+     * field cannot be changed after instance creation.
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+     * or `MYSQL_5_6`.
+     * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+     * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+     * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+     * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 31; + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1.SqlDatabaseVersion result = + com.google.cloud.sql.v1.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion`
+     * field cannot be changed after instance creation.
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+     * or `MYSQL_5_6`.
+     * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+     * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+     * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+     * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 31; + * + * @param value The databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersion(com.google.cloud.sql.v1.SqlDatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + databaseVersion_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion`
+     * field cannot be changed after instance creation.
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+     * or `MYSQL_5_6`.
+     * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+     * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+     * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+     * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 31; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseVersion() { + bitField0_ = (bitField0_ & ~0x00000010); + databaseVersion_ = 0; + onChanged(); + return this; + } + + private int backendType_ = 0; + + /** + * + * + *
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 32; + * + * @return The enum numeric value on the wire for backendType. + */ + @java.lang.Override + public int getBackendTypeValue() { + return backendType_; + } + + /** + * + * + *
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 32; + * + * @param value The enum numeric value on the wire for backendType to set. + * @return This builder for chaining. + */ + public Builder setBackendTypeValue(int value) { + backendType_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 32; + * + * @return The backendType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackendType getBackendType() { + com.google.cloud.sql.v1.SqlBackendType result = + com.google.cloud.sql.v1.SqlBackendType.forNumber(backendType_); + return result == null ? com.google.cloud.sql.v1.SqlBackendType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 32; + * + * @param value The backendType to set. + * @return This builder for chaining. + */ + public Builder setBackendType(com.google.cloud.sql.v1.SqlBackendType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + backendType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 32; + * + * @return This builder for chaining. + */ + public Builder clearBackendType() { + bitField0_ = (bitField0_ & ~0x00000020); + backendType_ = 0; + onChanged(); + return this; + } + + private boolean pscEnabled_; + + /** + * + * + *
+     * Whether PSC connectivity is enabled for this instance.
+     * 
+ * + * bool psc_enabled = 33; + * + * @return The pscEnabled. + */ + @java.lang.Override + public boolean getPscEnabled() { + return pscEnabled_; + } + + /** + * + * + *
+     * Whether PSC connectivity is enabled for this instance.
+     * 
+ * + * bool psc_enabled = 33; + * + * @param value The pscEnabled to set. + * @return This builder for chaining. + */ + public Builder setPscEnabled(boolean value) { + + pscEnabled_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether PSC connectivity is enabled for this instance.
+     * 
+ * + * bool psc_enabled = 33; + * + * @return This builder for chaining. + */ + public Builder clearPscEnabled() { + bitField0_ = (bitField0_ & ~0x00000040); + pscEnabled_ = false; + onChanged(); + return this; + } + + private java.lang.Object dnsName_ = ""; + + /** + * + * + *
+     * The dns name of the instance.
+     * 
+ * + * string dns_name = 34; + * + * @return The dnsName. + */ + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The dns name of the instance.
+     * 
+ * + * string dns_name = 34; + * + * @return The bytes for dnsName. + */ + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The dns name of the instance.
+     * 
+ * + * string dns_name = 34; + * + * @param value The dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dnsName_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The dns name of the instance.
+     * 
+ * + * string dns_name = 34; + * + * @return This builder for chaining. + */ + public Builder clearDnsName() { + dnsName_ = getDefaultInstance().getDnsName(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * The dns name of the instance.
+     * 
+ * + * string dns_name = 34; + * + * @param value The bytes for dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dnsName_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private int serverCaMode_ = 0; + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * .google.cloud.sql.v1.ConnectSettings.CaMode server_ca_mode = 35; + * + * @return The enum numeric value on the wire for serverCaMode. + */ + @java.lang.Override + public int getServerCaModeValue() { + return serverCaMode_; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * .google.cloud.sql.v1.ConnectSettings.CaMode server_ca_mode = 35; + * + * @param value The enum numeric value on the wire for serverCaMode to set. + * @return This builder for chaining. + */ + public Builder setServerCaModeValue(int value) { + serverCaMode_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * .google.cloud.sql.v1.ConnectSettings.CaMode server_ca_mode = 35; + * + * @return The serverCaMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ConnectSettings.CaMode getServerCaMode() { + com.google.cloud.sql.v1.ConnectSettings.CaMode result = + com.google.cloud.sql.v1.ConnectSettings.CaMode.forNumber(serverCaMode_); + return result == null ? com.google.cloud.sql.v1.ConnectSettings.CaMode.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * .google.cloud.sql.v1.ConnectSettings.CaMode server_ca_mode = 35; + * + * @param value The serverCaMode to set. + * @return This builder for chaining. + */ + public Builder setServerCaMode(com.google.cloud.sql.v1.ConnectSettings.CaMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + serverCaMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * .google.cloud.sql.v1.ConnectSettings.CaMode server_ca_mode = 35; + * + * @return This builder for chaining. + */ + public Builder clearServerCaMode() { + bitField0_ = (bitField0_ & ~0x00000100); + serverCaMode_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList customSubjectAlternativeNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureCustomSubjectAlternativeNamesIsMutable() { + if (!customSubjectAlternativeNames_.isModifiable()) { + customSubjectAlternativeNames_ = + new com.google.protobuf.LazyStringArrayList(customSubjectAlternativeNames_); + } + bitField0_ |= 0x00000200; + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @return A list containing the customSubjectAlternativeNames. + */ + public com.google.protobuf.ProtocolStringList getCustomSubjectAlternativeNamesList() { + customSubjectAlternativeNames_.makeImmutable(); + return customSubjectAlternativeNames_; + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @return The count of customSubjectAlternativeNames. + */ + public int getCustomSubjectAlternativeNamesCount() { + return customSubjectAlternativeNames_.size(); + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param index The index of the element to return. + * @return The customSubjectAlternativeNames at the given index. + */ + public java.lang.String getCustomSubjectAlternativeNames(int index) { + return customSubjectAlternativeNames_.get(index); + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param index The index of the value to return. + * @return The bytes of the customSubjectAlternativeNames at the given index. + */ + public com.google.protobuf.ByteString getCustomSubjectAlternativeNamesBytes(int index) { + return customSubjectAlternativeNames_.getByteString(index); + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param index The index to set the value at. + * @param value The customSubjectAlternativeNames to set. + * @return This builder for chaining. + */ + public Builder setCustomSubjectAlternativeNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.set(index, value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param value The customSubjectAlternativeNames to add. + * @return This builder for chaining. + */ + public Builder addCustomSubjectAlternativeNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.add(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param values The customSubjectAlternativeNames to add. + * @return This builder for chaining. + */ + public Builder addAllCustomSubjectAlternativeNames( + java.lang.Iterable values) { + ensureCustomSubjectAlternativeNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, customSubjectAlternativeNames_); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @return This builder for chaining. + */ + public Builder clearCustomSubjectAlternativeNames() { + customSubjectAlternativeNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param value The bytes of the customSubjectAlternativeNames to add. + * @return This builder for chaining. + */ + public Builder addCustomSubjectAlternativeNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.add(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.util.List dnsNames_ = + java.util.Collections.emptyList(); + + private void ensureDnsNamesIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + dnsNames_ = new java.util.ArrayList(dnsNames_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DnsNameMapping, + com.google.cloud.sql.v1.DnsNameMapping.Builder, + com.google.cloud.sql.v1.DnsNameMappingOrBuilder> + dnsNamesBuilder_; + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getDnsNamesList() { + if (dnsNamesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dnsNames_); + } else { + return dnsNamesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getDnsNamesCount() { + if (dnsNamesBuilder_ == null) { + return dnsNames_.size(); + } else { + return dnsNamesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping getDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames(int index, com.google.cloud.sql.v1.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.set(index, value); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames( + int index, com.google.cloud.sql.v1.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.set(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(com.google.cloud.sql.v1.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(int index, com.google.cloud.sql.v1.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(index, value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(com.google.cloud.sql.v1.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames( + int index, com.google.cloud.sql.v1.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllDnsNames( + java.lang.Iterable values) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dnsNames_); + onChanged(); + } else { + dnsNamesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDnsNames() { + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + dnsNamesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.remove(index); + onChanged(); + } else { + dnsNamesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping.Builder getDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDnsNamesOrBuilderList() { + if (dnsNamesBuilder_ != null) { + return dnsNamesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dnsNames_); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping.Builder addDnsNamesBuilder() { + return internalGetDnsNamesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping.Builder addDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getDnsNamesBuilderList() { + return internalGetDnsNamesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DnsNameMapping, + com.google.cloud.sql.v1.DnsNameMapping.Builder, + com.google.cloud.sql.v1.DnsNameMappingOrBuilder> + internalGetDnsNamesFieldBuilder() { + if (dnsNamesBuilder_ == null) { + dnsNamesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DnsNameMapping, + com.google.cloud.sql.v1.DnsNameMapping.Builder, + com.google.cloud.sql.v1.DnsNameMappingOrBuilder>( + dnsNames_, ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean()); + dnsNames_ = null; + } + return dnsNamesBuilder_; + } + + private int nodeCount_; + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @return Whether the nodeCount field is set. + */ + @java.lang.Override + public boolean hasNodeCount() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @param value The nodeCount to set. + * @return This builder for chaining. + */ + public Builder setNodeCount(int value) { + + nodeCount_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @return This builder for chaining. + */ + public Builder clearNodeCount() { + bitField0_ = (bitField0_ & ~0x00000800); + nodeCount_ = 0; + onChanged(); + return this; + } + + private java.util.List nodes_ = + java.util.Collections.emptyList(); + + private void ensureNodesIsMutable() { + if (!((bitField0_ & 0x00001000) != 0)) { + nodes_ = + new java.util.ArrayList( + nodes_); + bitField0_ |= 0x00001000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig, + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.Builder, + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfigOrBuilder> + nodesBuilder_; + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNodesList() { + if (nodesBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodes_); + } else { + return nodesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getNodesCount() { + if (nodesBuilder_ == null) { + return nodes_.size(); + } else { + return nodesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig getNodes(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodes( + int index, com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.set(index, value); + onChanged(); + } else { + nodesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodes( + int index, + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.set(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes(com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(value); + onChanged(); + } else { + nodesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + int index, com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(index, value); + onChanged(); + } else { + nodesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + int index, + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllNodes( + java.lang.Iterable + values) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, nodes_); + onChanged(); + } else { + nodesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearNodes() { + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + } else { + nodesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeNodes(int index) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.remove(index); + onChanged(); + } else { + nodesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.Builder getNodesBuilder( + int index) { + return internalGetNodesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfigOrBuilder getNodesOrBuilder( + int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + ? extends com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfigOrBuilder> + getNodesOrBuilderList() { + if (nodesBuilder_ != null) { + return nodesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodes_); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.Builder addNodesBuilder() { + return internalGetNodesFieldBuilder() + .addBuilder( + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.Builder addNodesBuilder( + int index) { + return internalGetNodesFieldBuilder() + .addBuilder( + index, + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNodesBuilderList() { + return internalGetNodesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig, + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.Builder, + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfigOrBuilder> + internalGetNodesFieldBuilder() { + if (nodesBuilder_ == null) { + nodesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig, + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.Builder, + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfigOrBuilder>( + nodes_, ((bitField0_ & 0x00001000) != 0), getParentForChildren(), isClean()); + nodes_ = null; + } + return nodesBuilder_; + } + + private com.google.protobuf.Internal.IntList mdxProtocolSupport_ = emptyIntList(); + + private void ensureMdxProtocolSupportIsMutable() { + if (!mdxProtocolSupport_.isModifiable()) { + mdxProtocolSupport_ = makeMutableCopy(mdxProtocolSupport_); + } + bitField0_ |= 0x00002000; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the mdxProtocolSupport. + */ + public java.util.List + getMdxProtocolSupportList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport>( + mdxProtocolSupport_, mdxProtocolSupport_converter_); + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of mdxProtocolSupport. + */ + public int getMdxProtocolSupportCount() { + return mdxProtocolSupport_.size(); + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The mdxProtocolSupport at the given index. + */ + public com.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport getMdxProtocolSupport( + int index) { + return mdxProtocolSupport_converter_.convert(mdxProtocolSupport_.getInt(index)); + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The mdxProtocolSupport to set. + * @return This builder for chaining. + */ + public Builder setMdxProtocolSupport( + int index, com.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMdxProtocolSupportIsMutable(); + mdxProtocolSupport_.setInt(index, value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mdxProtocolSupport to add. + * @return This builder for chaining. + */ + public Builder addMdxProtocolSupport( + com.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMdxProtocolSupportIsMutable(); + mdxProtocolSupport_.addInt(value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The mdxProtocolSupport to add. + * @return This builder for chaining. + */ + public Builder addAllMdxProtocolSupport( + java.lang.Iterable + values) { + ensureMdxProtocolSupportIsMutable(); + for (com.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport value : values) { + mdxProtocolSupport_.addInt(value.getNumber()); + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMdxProtocolSupport() { + mdxProtocolSupport_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for mdxProtocolSupport. + */ + public java.util.List getMdxProtocolSupportValueList() { + mdxProtocolSupport_.makeImmutable(); + return mdxProtocolSupport_; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of mdxProtocolSupport at the given index. + */ + public int getMdxProtocolSupportValue(int index) { + return mdxProtocolSupport_.getInt(index); + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for mdxProtocolSupport to set. + * @return This builder for chaining. + */ + public Builder setMdxProtocolSupportValue(int index, int value) { + ensureMdxProtocolSupportIsMutable(); + mdxProtocolSupport_.setInt(index, value); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for mdxProtocolSupport to add. + * @return This builder for chaining. + */ + public Builder addMdxProtocolSupportValue(int value) { + ensureMdxProtocolSupportIsMutable(); + mdxProtocolSupport_.addInt(value); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The enum numeric values on the wire for mdxProtocolSupport to add. + * @return This builder for chaining. + */ + public Builder addAllMdxProtocolSupportValue(java.lang.Iterable values) { + ensureMdxProtocolSupportIsMutable(); + for (int value : values) { + mdxProtocolSupport_.addInt(value); + } + onChanged(); + return this; + } + + private java.lang.Object connectionName_ = ""; + + /** + * + * + *
+     * Optional. Output only. Connection name of the Cloud SQL instance used in
+     * connection strings, in the format project:region:instance.
+     * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The connectionName. + */ + public java.lang.String getConnectionName() { + java.lang.Object ref = connectionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Output only. Connection name of the Cloud SQL instance used in
+     * connection strings, in the format project:region:instance.
+     * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for connectionName. + */ + public com.google.protobuf.ByteString getConnectionNameBytes() { + java.lang.Object ref = connectionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Output only. Connection name of the Cloud SQL instance used in
+     * connection strings, in the format project:region:instance.
+     * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The connectionName to set. + * @return This builder for chaining. + */ + public Builder setConnectionName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + connectionName_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. Connection name of the Cloud SQL instance used in
+     * connection strings, in the format project:region:instance.
+     * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearConnectionName() { + connectionName_ = getDefaultInstance().getConnectionName(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. Connection name of the Cloud SQL instance used in
+     * connection strings, in the format project:region:instance.
+     * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for connectionName to set. + * @return This builder for chaining. + */ + public Builder setConnectionNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + connectionName_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ConnectSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ConnectSettings) + private static final com.google.cloud.sql.v1.ConnectSettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ConnectSettings(); + } + + public static com.google.cloud.sql.v1.ConnectSettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectSettingsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectSettingsOrBuilder.java new file mode 100644 index 000000000000..0888764936fb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectSettingsOrBuilder.java @@ -0,0 +1,666 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ConnectSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ConnectSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#connectSettings`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#connectSettings`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + * + * @return Whether the serverCaCert field is set. + */ + boolean hasServerCaCert(); + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + * + * @return The serverCaCert. + */ + com.google.cloud.sql.v1.SslCert getServerCaCert(); + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 2; + */ + com.google.cloud.sql.v1.SslCertOrBuilder getServerCaCertOrBuilder(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + java.util.List getIpAddressesList(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + com.google.cloud.sql.v1.IpMapping getIpAddresses(int index); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + int getIpAddressesCount(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + java.util.List + getIpAddressesOrBuilderList(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3; + */ + com.google.cloud.sql.v1.IpMappingOrBuilder getIpAddressesOrBuilder(int index); + + /** + * + * + *
+   * The cloud region for the instance. For example, `us-central1`,
+   * `europe-west1`. The region cannot be changed after instance creation.
+   * 
+ * + * string region = 4; + * + * @return The region. + */ + java.lang.String getRegion(); + + /** + * + * + *
+   * The cloud region for the instance. For example, `us-central1`,
+   * `europe-west1`. The region cannot be changed after instance creation.
+   * 
+ * + * string region = 4; + * + * @return The bytes for region. + */ + com.google.protobuf.ByteString getRegionBytes(); + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion`
+   * field cannot be changed after instance creation.
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+   * or `MYSQL_5_6`.
+   * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+   * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+   * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+   * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 31; + * + * @return The enum numeric value on the wire for databaseVersion. + */ + int getDatabaseVersionValue(); + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion`
+   * field cannot be changed after instance creation.
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+   * or `MYSQL_5_6`.
+   * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+   * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+   * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+   * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 31; + * + * @return The databaseVersion. + */ + com.google.cloud.sql.v1.SqlDatabaseVersion getDatabaseVersion(); + + /** + * + * + *
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 32; + * + * @return The enum numeric value on the wire for backendType. + */ + int getBackendTypeValue(); + + /** + * + * + *
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 32; + * + * @return The backendType. + */ + com.google.cloud.sql.v1.SqlBackendType getBackendType(); + + /** + * + * + *
+   * Whether PSC connectivity is enabled for this instance.
+   * 
+ * + * bool psc_enabled = 33; + * + * @return The pscEnabled. + */ + boolean getPscEnabled(); + + /** + * + * + *
+   * The dns name of the instance.
+   * 
+ * + * string dns_name = 34; + * + * @return The dnsName. + */ + java.lang.String getDnsName(); + + /** + * + * + *
+   * The dns name of the instance.
+   * 
+ * + * string dns_name = 34; + * + * @return The bytes for dnsName. + */ + com.google.protobuf.ByteString getDnsNameBytes(); + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * .google.cloud.sql.v1.ConnectSettings.CaMode server_ca_mode = 35; + * + * @return The enum numeric value on the wire for serverCaMode. + */ + int getServerCaModeValue(); + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * .google.cloud.sql.v1.ConnectSettings.CaMode server_ca_mode = 35; + * + * @return The serverCaMode. + */ + com.google.cloud.sql.v1.ConnectSettings.CaMode getServerCaMode(); + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @return A list containing the customSubjectAlternativeNames. + */ + java.util.List getCustomSubjectAlternativeNamesList(); + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @return The count of customSubjectAlternativeNames. + */ + int getCustomSubjectAlternativeNamesCount(); + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param index The index of the element to return. + * @return The customSubjectAlternativeNames at the given index. + */ + java.lang.String getCustomSubjectAlternativeNames(int index); + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param index The index of the value to return. + * @return The bytes of the customSubjectAlternativeNames at the given index. + */ + com.google.protobuf.ByteString getCustomSubjectAlternativeNamesBytes(int index); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getDnsNamesList(); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.DnsNameMapping getDnsNames(int index); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getDnsNamesCount(); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getDnsNamesOrBuilderList(); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index); + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return Whether the nodeCount field is set. + */ + boolean hasNodeCount(); + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return The nodeCount. + */ + int getNodeCount(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getNodesList(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig getNodes(int index); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getNodesCount(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getNodesOrBuilderList(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfigOrBuilder getNodesOrBuilder( + int index); + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the mdxProtocolSupport. + */ + java.util.List + getMdxProtocolSupportList(); + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of mdxProtocolSupport. + */ + int getMdxProtocolSupportCount(); + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The mdxProtocolSupport at the given index. + */ + com.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport getMdxProtocolSupport(int index); + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for mdxProtocolSupport. + */ + java.util.List getMdxProtocolSupportValueList(); + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of mdxProtocolSupport at the given index. + */ + int getMdxProtocolSupportValue(int index); + + /** + * + * + *
+   * Optional. Output only. Connection name of the Cloud SQL instance used in
+   * connection strings, in the format project:region:instance.
+   * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The connectionName. + */ + java.lang.String getConnectionName(); + + /** + * + * + *
+   * Optional. Output only. Connection name of the Cloud SQL instance used in
+   * connection strings, in the format project:region:instance.
+   * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for connectionName. + */ + com.google.protobuf.ByteString getConnectionNameBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectionPoolConfig.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectionPoolConfig.java new file mode 100644 index 000000000000..e44dc103cf01 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectionPoolConfig.java @@ -0,0 +1,1239 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The managed connection pooling configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ConnectionPoolConfig} + */ +@com.google.protobuf.Generated +public final class ConnectionPoolConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ConnectionPoolConfig) + ConnectionPoolConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ConnectionPoolConfig"); + } + + // Use ConnectionPoolConfig.newBuilder() to construct. + private ConnectionPoolConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ConnectionPoolConfig() { + flags_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ConnectionPoolConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ConnectionPoolConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ConnectionPoolConfig.class, + com.google.cloud.sql.v1.ConnectionPoolConfig.Builder.class); + } + + private int bitField0_; + public static final int CONNECTION_POOLING_ENABLED_FIELD_NUMBER = 1; + private boolean connectionPoolingEnabled_ = false; + + /** + * + * + *
+   * Whether managed connection pooling is enabled.
+   * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @return Whether the connectionPoolingEnabled field is set. + */ + @java.lang.Override + public boolean hasConnectionPoolingEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Whether managed connection pooling is enabled.
+   * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @return The connectionPoolingEnabled. + */ + @java.lang.Override + public boolean getConnectionPoolingEnabled() { + return connectionPoolingEnabled_; + } + + public static final int FLAGS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private java.util.List flags_; + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getFlagsList() { + return flags_; + } + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getFlagsOrBuilderList() { + return flags_; + } + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getFlagsCount() { + return flags_.size(); + } + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ConnectionPoolFlags getFlags(int index) { + return flags_.get(index); + } + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ConnectionPoolFlagsOrBuilder getFlagsOrBuilder(int index) { + return flags_.get(index); + } + + public static final int POOLER_COUNT_FIELD_NUMBER = 9; + private int poolerCount_ = 0; + + /** + * + * + *
+   * Output only. Number of connection poolers.
+   * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the poolerCount field is set. + */ + @java.lang.Override + public boolean hasPoolerCount() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. Number of connection poolers.
+   * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The poolerCount. + */ + @java.lang.Override + public int getPoolerCount() { + return poolerCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, connectionPoolingEnabled_); + } + for (int i = 0; i < flags_.size(); i++) { + output.writeMessage(8, flags_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(9, poolerCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, connectionPoolingEnabled_); + } + for (int i = 0; i < flags_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, flags_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, poolerCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ConnectionPoolConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ConnectionPoolConfig other = + (com.google.cloud.sql.v1.ConnectionPoolConfig) obj; + + if (hasConnectionPoolingEnabled() != other.hasConnectionPoolingEnabled()) return false; + if (hasConnectionPoolingEnabled()) { + if (getConnectionPoolingEnabled() != other.getConnectionPoolingEnabled()) return false; + } + if (!getFlagsList().equals(other.getFlagsList())) return false; + if (hasPoolerCount() != other.hasPoolerCount()) return false; + if (hasPoolerCount()) { + if (getPoolerCount() != other.getPoolerCount()) return false; + } + if (!getUnknownFields().equals(other.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 (hasConnectionPoolingEnabled()) { + hash = (37 * hash) + CONNECTION_POOLING_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getConnectionPoolingEnabled()); + } + if (getFlagsCount() > 0) { + hash = (37 * hash) + FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getFlagsList().hashCode(); + } + if (hasPoolerCount()) { + hash = (37 * hash) + POOLER_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPoolerCount(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ConnectionPoolConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ConnectionPoolConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectionPoolConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ConnectionPoolConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectionPoolConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ConnectionPoolConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectionPoolConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ConnectionPoolConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectionPoolConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ConnectionPoolConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectionPoolConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ConnectionPoolConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.ConnectionPoolConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The managed connection pooling configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ConnectionPoolConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ConnectionPoolConfig) + com.google.cloud.sql.v1.ConnectionPoolConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ConnectionPoolConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ConnectionPoolConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ConnectionPoolConfig.class, + com.google.cloud.sql.v1.ConnectionPoolConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ConnectionPoolConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + connectionPoolingEnabled_ = false; + if (flagsBuilder_ == null) { + flags_ = java.util.Collections.emptyList(); + } else { + flags_ = null; + flagsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + poolerCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ConnectionPoolConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectionPoolConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ConnectionPoolConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectionPoolConfig build() { + com.google.cloud.sql.v1.ConnectionPoolConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectionPoolConfig buildPartial() { + com.google.cloud.sql.v1.ConnectionPoolConfig result = + new com.google.cloud.sql.v1.ConnectionPoolConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.ConnectionPoolConfig result) { + if (flagsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + flags_ = java.util.Collections.unmodifiableList(flags_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.flags_ = flags_; + } else { + result.flags_ = flagsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.ConnectionPoolConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.connectionPoolingEnabled_ = connectionPoolingEnabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.poolerCount_ = poolerCount_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ConnectionPoolConfig) { + return mergeFrom((com.google.cloud.sql.v1.ConnectionPoolConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ConnectionPoolConfig other) { + if (other == com.google.cloud.sql.v1.ConnectionPoolConfig.getDefaultInstance()) return this; + if (other.hasConnectionPoolingEnabled()) { + setConnectionPoolingEnabled(other.getConnectionPoolingEnabled()); + } + if (flagsBuilder_ == null) { + if (!other.flags_.isEmpty()) { + if (flags_.isEmpty()) { + flags_ = other.flags_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFlagsIsMutable(); + flags_.addAll(other.flags_); + } + onChanged(); + } + } else { + if (!other.flags_.isEmpty()) { + if (flagsBuilder_.isEmpty()) { + flagsBuilder_.dispose(); + flagsBuilder_ = null; + flags_ = other.flags_; + bitField0_ = (bitField0_ & ~0x00000002); + flagsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetFlagsFieldBuilder() + : null; + } else { + flagsBuilder_.addAllMessages(other.flags_); + } + } + } + if (other.hasPoolerCount()) { + setPoolerCount(other.getPoolerCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + connectionPoolingEnabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 66: + { + com.google.cloud.sql.v1.ConnectionPoolFlags m = + input.readMessage( + com.google.cloud.sql.v1.ConnectionPoolFlags.parser(), extensionRegistry); + if (flagsBuilder_ == null) { + ensureFlagsIsMutable(); + flags_.add(m); + } else { + flagsBuilder_.addMessage(m); + } + break; + } // case 66 + case 72: + { + poolerCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + 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 bitField0_; + + private boolean connectionPoolingEnabled_; + + /** + * + * + *
+     * Whether managed connection pooling is enabled.
+     * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @return Whether the connectionPoolingEnabled field is set. + */ + @java.lang.Override + public boolean hasConnectionPoolingEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Whether managed connection pooling is enabled.
+     * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @return The connectionPoolingEnabled. + */ + @java.lang.Override + public boolean getConnectionPoolingEnabled() { + return connectionPoolingEnabled_; + } + + /** + * + * + *
+     * Whether managed connection pooling is enabled.
+     * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @param value The connectionPoolingEnabled to set. + * @return This builder for chaining. + */ + public Builder setConnectionPoolingEnabled(boolean value) { + + connectionPoolingEnabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether managed connection pooling is enabled.
+     * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearConnectionPoolingEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + connectionPoolingEnabled_ = false; + onChanged(); + return this; + } + + private java.util.List flags_ = + java.util.Collections.emptyList(); + + private void ensureFlagsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + flags_ = new java.util.ArrayList(flags_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ConnectionPoolFlags, + com.google.cloud.sql.v1.ConnectionPoolFlags.Builder, + com.google.cloud.sql.v1.ConnectionPoolFlagsOrBuilder> + flagsBuilder_; + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getFlagsList() { + if (flagsBuilder_ == null) { + return java.util.Collections.unmodifiableList(flags_); + } else { + return flagsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getFlagsCount() { + if (flagsBuilder_ == null) { + return flags_.size(); + } else { + return flagsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ConnectionPoolFlags getFlags(int index) { + if (flagsBuilder_ == null) { + return flags_.get(index); + } else { + return flagsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFlags(int index, com.google.cloud.sql.v1.ConnectionPoolFlags value) { + if (flagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlagsIsMutable(); + flags_.set(index, value); + onChanged(); + } else { + flagsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFlags( + int index, com.google.cloud.sql.v1.ConnectionPoolFlags.Builder builderForValue) { + if (flagsBuilder_ == null) { + ensureFlagsIsMutable(); + flags_.set(index, builderForValue.build()); + onChanged(); + } else { + flagsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addFlags(com.google.cloud.sql.v1.ConnectionPoolFlags value) { + if (flagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlagsIsMutable(); + flags_.add(value); + onChanged(); + } else { + flagsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addFlags(int index, com.google.cloud.sql.v1.ConnectionPoolFlags value) { + if (flagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlagsIsMutable(); + flags_.add(index, value); + onChanged(); + } else { + flagsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addFlags(com.google.cloud.sql.v1.ConnectionPoolFlags.Builder builderForValue) { + if (flagsBuilder_ == null) { + ensureFlagsIsMutable(); + flags_.add(builderForValue.build()); + onChanged(); + } else { + flagsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addFlags( + int index, com.google.cloud.sql.v1.ConnectionPoolFlags.Builder builderForValue) { + if (flagsBuilder_ == null) { + ensureFlagsIsMutable(); + flags_.add(index, builderForValue.build()); + onChanged(); + } else { + flagsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllFlags( + java.lang.Iterable values) { + if (flagsBuilder_ == null) { + ensureFlagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, flags_); + onChanged(); + } else { + flagsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFlags() { + if (flagsBuilder_ == null) { + flags_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + flagsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeFlags(int index) { + if (flagsBuilder_ == null) { + ensureFlagsIsMutable(); + flags_.remove(index); + onChanged(); + } else { + flagsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ConnectionPoolFlags.Builder getFlagsBuilder(int index) { + return internalGetFlagsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ConnectionPoolFlagsOrBuilder getFlagsOrBuilder(int index) { + if (flagsBuilder_ == null) { + return flags_.get(index); + } else { + return flagsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getFlagsOrBuilderList() { + if (flagsBuilder_ != null) { + return flagsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(flags_); + } + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ConnectionPoolFlags.Builder addFlagsBuilder() { + return internalGetFlagsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.ConnectionPoolFlags.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ConnectionPoolFlags.Builder addFlagsBuilder(int index) { + return internalGetFlagsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.ConnectionPoolFlags.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getFlagsBuilderList() { + return internalGetFlagsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ConnectionPoolFlags, + com.google.cloud.sql.v1.ConnectionPoolFlags.Builder, + com.google.cloud.sql.v1.ConnectionPoolFlagsOrBuilder> + internalGetFlagsFieldBuilder() { + if (flagsBuilder_ == null) { + flagsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ConnectionPoolFlags, + com.google.cloud.sql.v1.ConnectionPoolFlags.Builder, + com.google.cloud.sql.v1.ConnectionPoolFlagsOrBuilder>( + flags_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + flags_ = null; + } + return flagsBuilder_; + } + + private int poolerCount_; + + /** + * + * + *
+     * Output only. Number of connection poolers.
+     * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the poolerCount field is set. + */ + @java.lang.Override + public boolean hasPoolerCount() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Output only. Number of connection poolers.
+     * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The poolerCount. + */ + @java.lang.Override + public int getPoolerCount() { + return poolerCount_; + } + + /** + * + * + *
+     * Output only. Number of connection poolers.
+     * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The poolerCount to set. + * @return This builder for chaining. + */ + public Builder setPoolerCount(int value) { + + poolerCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Number of connection poolers.
+     * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPoolerCount() { + bitField0_ = (bitField0_ & ~0x00000004); + poolerCount_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ConnectionPoolConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ConnectionPoolConfig) + private static final com.google.cloud.sql.v1.ConnectionPoolConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ConnectionPoolConfig(); + } + + public static com.google.cloud.sql.v1.ConnectionPoolConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionPoolConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectionPoolConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectionPoolConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectionPoolConfigOrBuilder.java new file mode 100644 index 000000000000..50ef2a1a3225 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectionPoolConfigOrBuilder.java @@ -0,0 +1,146 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ConnectionPoolConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ConnectionPoolConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether managed connection pooling is enabled.
+   * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @return Whether the connectionPoolingEnabled field is set. + */ + boolean hasConnectionPoolingEnabled(); + + /** + * + * + *
+   * Whether managed connection pooling is enabled.
+   * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @return The connectionPoolingEnabled. + */ + boolean getConnectionPoolingEnabled(); + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getFlagsList(); + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.ConnectionPoolFlags getFlags(int index); + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getFlagsCount(); + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getFlagsOrBuilderList(); + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.ConnectionPoolFlagsOrBuilder getFlagsOrBuilder(int index); + + /** + * + * + *
+   * Output only. Number of connection poolers.
+   * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the poolerCount field is set. + */ + boolean hasPoolerCount(); + + /** + * + * + *
+   * Output only. Number of connection poolers.
+   * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The poolerCount. + */ + int getPoolerCount(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectionPoolFlags.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectionPoolFlags.java new file mode 100644 index 000000000000..96d8b8706ce8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectionPoolFlags.java @@ -0,0 +1,800 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Connection pool flags for Cloud SQL instances managed connection pool
+ * configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ConnectionPoolFlags} + */ +@com.google.protobuf.Generated +public final class ConnectionPoolFlags extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ConnectionPoolFlags) + ConnectionPoolFlagsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ConnectionPoolFlags"); + } + + // Use ConnectionPoolFlags.newBuilder() to construct. + private ConnectionPoolFlags(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ConnectionPoolFlags() { + name_ = ""; + value_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ConnectionPoolFlags_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ConnectionPoolFlags_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ConnectionPoolFlags.class, + com.google.cloud.sql.v1.ConnectionPoolFlags.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The name of the flag.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name of the flag.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + + /** + * + * + *
+   * Required. The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ConnectionPoolFlags)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ConnectionPoolFlags other = + (com.google.cloud.sql.v1.ConnectionPoolFlags) obj; + + if (!getName().equals(other.getName())) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ConnectionPoolFlags parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ConnectionPoolFlags parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectionPoolFlags parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ConnectionPoolFlags parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectionPoolFlags parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ConnectionPoolFlags parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectionPoolFlags parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ConnectionPoolFlags parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectionPoolFlags parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ConnectionPoolFlags parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ConnectionPoolFlags parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ConnectionPoolFlags parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.ConnectionPoolFlags prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Connection pool flags for Cloud SQL instances managed connection pool
+   * configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ConnectionPoolFlags} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ConnectionPoolFlags) + com.google.cloud.sql.v1.ConnectionPoolFlagsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ConnectionPoolFlags_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ConnectionPoolFlags_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ConnectionPoolFlags.class, + com.google.cloud.sql.v1.ConnectionPoolFlags.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ConnectionPoolFlags.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + value_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ConnectionPoolFlags_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectionPoolFlags getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ConnectionPoolFlags.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectionPoolFlags build() { + com.google.cloud.sql.v1.ConnectionPoolFlags result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectionPoolFlags buildPartial() { + com.google.cloud.sql.v1.ConnectionPoolFlags result = + new com.google.cloud.sql.v1.ConnectionPoolFlags(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ConnectionPoolFlags result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ConnectionPoolFlags) { + return mergeFrom((com.google.cloud.sql.v1.ConnectionPoolFlags) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ConnectionPoolFlags other) { + if (other == com.google.cloud.sql.v1.ConnectionPoolFlags.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + 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: + { + value_ = 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 flag.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name of the flag.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name of the flag.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the flag.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the flag.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + + /** + * + * + *
+     * Required. The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ConnectionPoolFlags) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ConnectionPoolFlags) + private static final com.google.cloud.sql.v1.ConnectionPoolFlags DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ConnectionPoolFlags(); + } + + public static com.google.cloud.sql.v1.ConnectionPoolFlags getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionPoolFlags parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ConnectionPoolFlags getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectionPoolFlagsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectionPoolFlagsOrBuilder.java new file mode 100644 index 000000000000..cea0079e4ab3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ConnectionPoolFlagsOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ConnectionPoolFlagsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ConnectionPoolFlags) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the flag.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The name of the flag.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + java.lang.String getValue(); + + /** + * + * + *
+   * Required. The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CreateBackupRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CreateBackupRequest.java new file mode 100644 index 000000000000..d9c68b17c023 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CreateBackupRequest.java @@ -0,0 +1,908 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The request payload to create the backup
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.CreateBackupRequest} + */ +@com.google.protobuf.Generated +public final class CreateBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.CreateBackupRequest) + CreateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateBackupRequest"); + } + + // Use CreateBackupRequest.newBuilder() to construct. + private CreateBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateBackupRequest() { + parent_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.CreateBackupRequest.class, + com.google.cloud.sql.v1.CreateBackupRequest.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 backup is created.
+   * Format: projects/{project}
+   * 
+ * + * + * 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 backup is created.
+   * Format: projects/{project}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_FIELD_NUMBER = 2; + private com.google.cloud.sql.v1.Backup backup_; + + /** + * + * + *
+   * Required. The Backup to create.
+   * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The Backup to create.
+   * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backup. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Backup getBackup() { + return backup_ == null ? com.google.cloud.sql.v1.Backup.getDefaultInstance() : backup_; + } + + /** + * + * + *
+   * Required. The Backup to create.
+   * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupOrBuilder getBackupOrBuilder() { + return backup_ == null ? com.google.cloud.sql.v1.Backup.getDefaultInstance() : backup_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getBackup()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBackup()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.CreateBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.CreateBackupRequest other = + (com.google.cloud.sql.v1.CreateBackupRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.CreateBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.CreateBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.CreateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.CreateBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.CreateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.CreateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.CreateBackupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.CreateBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.CreateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.CreateBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.CreateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.CreateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.CreateBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request payload to create the backup
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.CreateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.CreateBackupRequest) + com.google.cloud.sql.v1.CreateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.CreateBackupRequest.class, + com.google.cloud.sql.v1.CreateBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.CreateBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackupFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_CreateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.CreateBackupRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.CreateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.CreateBackupRequest build() { + com.google.cloud.sql.v1.CreateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.CreateBackupRequest buildPartial() { + com.google.cloud.sql.v1.CreateBackupRequest result = + new com.google.cloud.sql.v1.CreateBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.CreateBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backup_ = backupBuilder_ == null ? backup_ : backupBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.CreateBackupRequest) { + return mergeFrom((com.google.cloud.sql.v1.CreateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.CreateBackupRequest other) { + if (other == com.google.cloud.sql.v1.CreateBackupRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetBackupFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The parent resource where this backup is created.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 backup is created.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 backup is created.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 backup is created.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 backup is created.
+     * Format: projects/{project}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.Backup backup_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Backup, + com.google.cloud.sql.v1.Backup.Builder, + com.google.cloud.sql.v1.BackupOrBuilder> + backupBuilder_; + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.cloud.sql.v1.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null ? com.google.cloud.sql.v1.Backup.getDefaultInstance() : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.sql.v1.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + } else { + backupBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.sql.v1.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.cloud.sql.v1.Backup value) { + if (backupBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && backup_ != null + && backup_ != com.google.cloud.sql.v1.Backup.getDefaultInstance()) { + getBackupBuilder().mergeFrom(value); + } else { + backup_ = value; + } + } else { + backupBuilder_.mergeFrom(value); + } + if (backup_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + bitField0_ = (bitField0_ & ~0x00000002); + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.Backup.Builder getBackupBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetBackupFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null ? com.google.cloud.sql.v1.Backup.getDefaultInstance() : backup_; + } + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Backup, + com.google.cloud.sql.v1.Backup.Builder, + com.google.cloud.sql.v1.BackupOrBuilder> + internalGetBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Backup, + com.google.cloud.sql.v1.Backup.Builder, + com.google.cloud.sql.v1.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.CreateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.CreateBackupRequest) + private static final com.google.cloud.sql.v1.CreateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.CreateBackupRequest(); + } + + public static com.google.cloud.sql.v1.CreateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.CreateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CreateBackupRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CreateBackupRequestOrBuilder.java new file mode 100644 index 000000000000..46d411dcfa99 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/CreateBackupRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface CreateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.CreateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource where this backup is created.
+   * Format: projects/{project}
+   * 
+ * + * + * 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 backup is created.
+   * Format: projects/{project}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The Backup to create.
+   * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + + /** + * + * + *
+   * Required. The Backup to create.
+   * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backup. + */ + com.google.cloud.sql.v1.Backup getBackup(); + + /** + * + * + *
+   * Required. The Backup to create.
+   * 
+ * + * .google.cloud.sql.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.sql.v1.BackupOrBuilder getBackupOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DataCacheConfig.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DataCacheConfig.java new file mode 100644 index 000000000000..e669ab67fd4f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DataCacheConfig.java @@ -0,0 +1,501 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Data cache configurations.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DataCacheConfig} + */ +@com.google.protobuf.Generated +public final class DataCacheConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DataCacheConfig) + DataCacheConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DataCacheConfig"); + } + + // Use DataCacheConfig.newBuilder() to construct. + private DataCacheConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DataCacheConfig() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DataCacheConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DataCacheConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DataCacheConfig.class, + com.google.cloud.sql.v1.DataCacheConfig.Builder.class); + } + + public static final int DATA_CACHE_ENABLED_FIELD_NUMBER = 1; + private boolean dataCacheEnabled_ = false; + + /** + * + * + *
+   * Whether data cache is enabled for the instance.
+   * 
+ * + * bool data_cache_enabled = 1; + * + * @return The dataCacheEnabled. + */ + @java.lang.Override + public boolean getDataCacheEnabled() { + return dataCacheEnabled_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (dataCacheEnabled_ != false) { + output.writeBool(1, dataCacheEnabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dataCacheEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, dataCacheEnabled_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.DataCacheConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DataCacheConfig other = (com.google.cloud.sql.v1.DataCacheConfig) obj; + + if (getDataCacheEnabled() != other.getDataCacheEnabled()) return false; + if (!getUnknownFields().equals(other.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) + DATA_CACHE_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDataCacheEnabled()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DataCacheConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DataCacheConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DataCacheConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DataCacheConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DataCacheConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DataCacheConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DataCacheConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DataCacheConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DataCacheConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DataCacheConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DataCacheConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DataCacheConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.DataCacheConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Data cache configurations.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DataCacheConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DataCacheConfig) + com.google.cloud.sql.v1.DataCacheConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DataCacheConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DataCacheConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DataCacheConfig.class, + com.google.cloud.sql.v1.DataCacheConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DataCacheConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dataCacheEnabled_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DataCacheConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DataCacheConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DataCacheConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DataCacheConfig build() { + com.google.cloud.sql.v1.DataCacheConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DataCacheConfig buildPartial() { + com.google.cloud.sql.v1.DataCacheConfig result = + new com.google.cloud.sql.v1.DataCacheConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.DataCacheConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dataCacheEnabled_ = dataCacheEnabled_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DataCacheConfig) { + return mergeFrom((com.google.cloud.sql.v1.DataCacheConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DataCacheConfig other) { + if (other == com.google.cloud.sql.v1.DataCacheConfig.getDefaultInstance()) return this; + if (other.getDataCacheEnabled() != false) { + setDataCacheEnabled(other.getDataCacheEnabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + dataCacheEnabled_ = input.readBool(); + 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 boolean dataCacheEnabled_; + + /** + * + * + *
+     * Whether data cache is enabled for the instance.
+     * 
+ * + * bool data_cache_enabled = 1; + * + * @return The dataCacheEnabled. + */ + @java.lang.Override + public boolean getDataCacheEnabled() { + return dataCacheEnabled_; + } + + /** + * + * + *
+     * Whether data cache is enabled for the instance.
+     * 
+ * + * bool data_cache_enabled = 1; + * + * @param value The dataCacheEnabled to set. + * @return This builder for chaining. + */ + public Builder setDataCacheEnabled(boolean value) { + + dataCacheEnabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether data cache is enabled for the instance.
+     * 
+ * + * bool data_cache_enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearDataCacheEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + dataCacheEnabled_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DataCacheConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DataCacheConfig) + private static final com.google.cloud.sql.v1.DataCacheConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DataCacheConfig(); + } + + public static com.google.cloud.sql.v1.DataCacheConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataCacheConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DataCacheConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DataCacheConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DataCacheConfigOrBuilder.java new file mode 100644 index 000000000000..f00c66007b56 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DataCacheConfigOrBuilder.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface DataCacheConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DataCacheConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether data cache is enabled for the instance.
+   * 
+ * + * bool data_cache_enabled = 1; + * + * @return The dataCacheEnabled. + */ + boolean getDataCacheEnabled(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Database.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Database.java new file mode 100644 index 000000000000..9e419d7e8836 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Database.java @@ -0,0 +1,2258 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Represents a SQL database on the Cloud SQL instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Database} + */ +@com.google.protobuf.Generated +public final class Database extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.Database) + DatabaseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Database"); + } + + // Use Database.newBuilder() to construct. + private Database(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Database() { + kind_ = ""; + charset_ = ""; + collation_ = ""; + etag_ = ""; + name_ = ""; + instance_ = ""; + selfLink_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Database_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Database_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Database.class, com.google.cloud.sql.v1.Database.Builder.class); + } + + private int databaseDetailsCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object databaseDetails_; + + public enum DatabaseDetailsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SQLSERVER_DATABASE_DETAILS(9), + DATABASEDETAILS_NOT_SET(0); + private final int value; + + private DatabaseDetailsCase(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 DatabaseDetailsCase valueOf(int value) { + return forNumber(value); + } + + public static DatabaseDetailsCase forNumber(int value) { + switch (value) { + case 9: + return SQLSERVER_DATABASE_DETAILS; + case 0: + return DATABASEDETAILS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DatabaseDetailsCase getDatabaseDetailsCase() { + return DatabaseDetailsCase.forNumber(databaseDetailsCase_); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#database`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#database`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CHARSET_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object charset_ = ""; + + /** + * + * + *
+   * The Cloud SQL charset value.
+   * 
+ * + * string charset = 2; + * + * @return The charset. + */ + @java.lang.Override + public java.lang.String getCharset() { + java.lang.Object ref = charset_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + charset_ = s; + return s; + } + } + + /** + * + * + *
+   * The Cloud SQL charset value.
+   * 
+ * + * string charset = 2; + * + * @return The bytes for charset. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCharsetBytes() { + java.lang.Object ref = charset_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + charset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLLATION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object collation_ = ""; + + /** + * + * + *
+   * The Cloud SQL collation value.
+   * 
+ * + * string collation = 3; + * + * @return The collation. + */ + @java.lang.Override + public java.lang.String getCollation() { + java.lang.Object ref = collation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collation_ = s; + return s; + } + } + + /** + * + * + *
+   * The Cloud SQL collation value.
+   * 
+ * + * string collation = 3; + * + * @return The bytes for collation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCollationBytes() { + java.lang.Object ref = collation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 4; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 4; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the database in the Cloud SQL instance. This does not include
+   * the project ID or instance name.
+   * 
+ * + * string name = 5; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the database in the Cloud SQL instance. This does not include
+   * the project ID or instance name.
+   * 
+ * + * string name = 5; + * + * @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 INSTANCE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string instance = 6; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELF_LINK_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object selfLink_ = ""; + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 7; + * + * @return The selfLink. + */ + @java.lang.Override + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } + } + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 7; + * + * @return The bytes for selfLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 8; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 8; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SQLSERVER_DATABASE_DETAILS_FIELD_NUMBER = 9; + + /** + * .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + * @return Whether the sqlserverDatabaseDetails field is set. + */ + @java.lang.Override + public boolean hasSqlserverDatabaseDetails() { + return databaseDetailsCase_ == 9; + } + + /** + * .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + * @return The sqlserverDatabaseDetails. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerDatabaseDetails getSqlserverDatabaseDetails() { + if (databaseDetailsCase_ == 9) { + return (com.google.cloud.sql.v1.SqlServerDatabaseDetails) databaseDetails_; + } + return com.google.cloud.sql.v1.SqlServerDatabaseDetails.getDefaultInstance(); + } + + /** .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerDatabaseDetailsOrBuilder + getSqlserverDatabaseDetailsOrBuilder() { + if (databaseDetailsCase_ == 9) { + return (com.google.cloud.sql.v1.SqlServerDatabaseDetails) databaseDetails_; + } + return com.google.cloud.sql.v1.SqlServerDatabaseDetails.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(charset_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, charset_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(collation_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, collation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, selfLink_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, project_); + } + if (databaseDetailsCase_ == 9) { + output.writeMessage(9, (com.google.cloud.sql.v1.SqlServerDatabaseDetails) databaseDetails_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(charset_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, charset_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(collation_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, collation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, selfLink_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, project_); + } + if (databaseDetailsCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.cloud.sql.v1.SqlServerDatabaseDetails) databaseDetails_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.Database)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.Database other = (com.google.cloud.sql.v1.Database) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getCharset().equals(other.getCharset())) return false; + if (!getCollation().equals(other.getCollation())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getName().equals(other.getName())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getSelfLink().equals(other.getSelfLink())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getDatabaseDetailsCase().equals(other.getDatabaseDetailsCase())) return false; + switch (databaseDetailsCase_) { + case 9: + if (!getSqlserverDatabaseDetails().equals(other.getSqlserverDatabaseDetails())) + 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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + CHARSET_FIELD_NUMBER; + hash = (53 * hash) + getCharset().hashCode(); + hash = (37 * hash) + COLLATION_FIELD_NUMBER; + hash = (53 * hash) + getCollation().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + SELF_LINK_FIELD_NUMBER; + hash = (53 * hash) + getSelfLink().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + switch (databaseDetailsCase_) { + case 9: + hash = (37 * hash) + SQLSERVER_DATABASE_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getSqlserverDatabaseDetails().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.Database parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Database parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Database parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Database parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Database parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Database parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Database parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Database parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Database parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Database parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Database parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Database parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.Database prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Represents a SQL database on the Cloud SQL instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Database} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.Database) + com.google.cloud.sql.v1.DatabaseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Database_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Database_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Database.class, + com.google.cloud.sql.v1.Database.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.Database.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + charset_ = ""; + collation_ = ""; + etag_ = ""; + name_ = ""; + instance_ = ""; + selfLink_ = ""; + project_ = ""; + if (sqlserverDatabaseDetailsBuilder_ != null) { + sqlserverDatabaseDetailsBuilder_.clear(); + } + databaseDetailsCase_ = 0; + databaseDetails_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Database_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Database getDefaultInstanceForType() { + return com.google.cloud.sql.v1.Database.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.Database build() { + com.google.cloud.sql.v1.Database result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Database buildPartial() { + com.google.cloud.sql.v1.Database result = new com.google.cloud.sql.v1.Database(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.Database result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.charset_ = charset_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.collation_ = collation_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.selfLink_ = selfLink_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.project_ = project_; + } + } + + private void buildPartialOneofs(com.google.cloud.sql.v1.Database result) { + result.databaseDetailsCase_ = databaseDetailsCase_; + result.databaseDetails_ = this.databaseDetails_; + if (databaseDetailsCase_ == 9 && sqlserverDatabaseDetailsBuilder_ != null) { + result.databaseDetails_ = sqlserverDatabaseDetailsBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.Database) { + return mergeFrom((com.google.cloud.sql.v1.Database) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.Database other) { + if (other == com.google.cloud.sql.v1.Database.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getCharset().isEmpty()) { + charset_ = other.charset_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getCollation().isEmpty()) { + collation_ = other.collation_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getSelfLink().isEmpty()) { + selfLink_ = other.selfLink_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000080; + onChanged(); + } + switch (other.getDatabaseDetailsCase()) { + case SQLSERVER_DATABASE_DETAILS: + { + mergeSqlserverDatabaseDetails(other.getSqlserverDatabaseDetails()); + break; + } + case DATABASEDETAILS_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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + charset_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + collation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + selfLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + input.readMessage( + internalGetSqlserverDatabaseDetailsFieldBuilder().getBuilder(), + extensionRegistry); + databaseDetailsCase_ = 9; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int databaseDetailsCase_ = 0; + private java.lang.Object databaseDetails_; + + public DatabaseDetailsCase getDatabaseDetailsCase() { + return DatabaseDetailsCase.forNumber(databaseDetailsCase_); + } + + public Builder clearDatabaseDetails() { + databaseDetailsCase_ = 0; + databaseDetails_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#database`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#database`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#database`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#database`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#database`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object charset_ = ""; + + /** + * + * + *
+     * The Cloud SQL charset value.
+     * 
+ * + * string charset = 2; + * + * @return The charset. + */ + public java.lang.String getCharset() { + java.lang.Object ref = charset_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + charset_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Cloud SQL charset value.
+     * 
+ * + * string charset = 2; + * + * @return The bytes for charset. + */ + public com.google.protobuf.ByteString getCharsetBytes() { + java.lang.Object ref = charset_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + charset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Cloud SQL charset value.
+     * 
+ * + * string charset = 2; + * + * @param value The charset to set. + * @return This builder for chaining. + */ + public Builder setCharset(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + charset_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud SQL charset value.
+     * 
+ * + * string charset = 2; + * + * @return This builder for chaining. + */ + public Builder clearCharset() { + charset_ = getDefaultInstance().getCharset(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud SQL charset value.
+     * 
+ * + * string charset = 2; + * + * @param value The bytes for charset to set. + * @return This builder for chaining. + */ + public Builder setCharsetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + charset_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object collation_ = ""; + + /** + * + * + *
+     * The Cloud SQL collation value.
+     * 
+ * + * string collation = 3; + * + * @return The collation. + */ + public java.lang.String getCollation() { + java.lang.Object ref = collation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Cloud SQL collation value.
+     * 
+ * + * string collation = 3; + * + * @return The bytes for collation. + */ + public com.google.protobuf.ByteString getCollationBytes() { + java.lang.Object ref = collation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Cloud SQL collation value.
+     * 
+ * + * string collation = 3; + * + * @param value The collation to set. + * @return This builder for chaining. + */ + public Builder setCollation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + collation_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud SQL collation value.
+     * 
+ * + * string collation = 3; + * + * @return This builder for chaining. + */ + public Builder clearCollation() { + collation_ = getDefaultInstance().getCollation(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud SQL collation value.
+     * 
+ * + * string collation = 3; + * + * @param value The bytes for collation to set. + * @return This builder for chaining. + */ + public Builder setCollationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + collation_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 4; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 4; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 4; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 4; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 4; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the database in the Cloud SQL instance. This does not include
+     * the project ID or instance name.
+     * 
+ * + * string name = 5; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the database in the Cloud SQL instance. This does not include
+     * the project ID or instance name.
+     * 
+ * + * string name = 5; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the database in the Cloud SQL instance. This does not include
+     * the project ID or instance name.
+     * 
+ * + * string name = 5; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the database in the Cloud SQL instance. This does not include
+     * the project ID or instance name.
+     * 
+ * + * string name = 5; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the database in the Cloud SQL instance. This does not include
+     * the project ID or instance name.
+     * 
+ * + * string name = 5; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string instance = 6; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string instance = 6; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string instance = 6; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string instance = 6; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object selfLink_ = ""; + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 7; + * + * @return The selfLink. + */ + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 7; + * + * @return The bytes for selfLink. + */ + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 7; + * + * @param value The selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selfLink_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 7; + * + * @return This builder for chaining. + */ + public Builder clearSelfLink() { + selfLink_ = getDefaultInstance().getSelfLink(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 7; + * + * @param value The bytes for selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selfLink_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 8; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 8; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 8; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 8; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 8; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlServerDatabaseDetails, + com.google.cloud.sql.v1.SqlServerDatabaseDetails.Builder, + com.google.cloud.sql.v1.SqlServerDatabaseDetailsOrBuilder> + sqlserverDatabaseDetailsBuilder_; + + /** + * .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + * @return Whether the sqlserverDatabaseDetails field is set. + */ + @java.lang.Override + public boolean hasSqlserverDatabaseDetails() { + return databaseDetailsCase_ == 9; + } + + /** + * .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + * @return The sqlserverDatabaseDetails. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerDatabaseDetails getSqlserverDatabaseDetails() { + if (sqlserverDatabaseDetailsBuilder_ == null) { + if (databaseDetailsCase_ == 9) { + return (com.google.cloud.sql.v1.SqlServerDatabaseDetails) databaseDetails_; + } + return com.google.cloud.sql.v1.SqlServerDatabaseDetails.getDefaultInstance(); + } else { + if (databaseDetailsCase_ == 9) { + return sqlserverDatabaseDetailsBuilder_.getMessage(); + } + return com.google.cloud.sql.v1.SqlServerDatabaseDetails.getDefaultInstance(); + } + } + + /** + * .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; + */ + public Builder setSqlserverDatabaseDetails( + com.google.cloud.sql.v1.SqlServerDatabaseDetails value) { + if (sqlserverDatabaseDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + databaseDetails_ = value; + onChanged(); + } else { + sqlserverDatabaseDetailsBuilder_.setMessage(value); + } + databaseDetailsCase_ = 9; + return this; + } + + /** + * .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; + */ + public Builder setSqlserverDatabaseDetails( + com.google.cloud.sql.v1.SqlServerDatabaseDetails.Builder builderForValue) { + if (sqlserverDatabaseDetailsBuilder_ == null) { + databaseDetails_ = builderForValue.build(); + onChanged(); + } else { + sqlserverDatabaseDetailsBuilder_.setMessage(builderForValue.build()); + } + databaseDetailsCase_ = 9; + return this; + } + + /** + * .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; + */ + public Builder mergeSqlserverDatabaseDetails( + com.google.cloud.sql.v1.SqlServerDatabaseDetails value) { + if (sqlserverDatabaseDetailsBuilder_ == null) { + if (databaseDetailsCase_ == 9 + && databaseDetails_ + != com.google.cloud.sql.v1.SqlServerDatabaseDetails.getDefaultInstance()) { + databaseDetails_ = + com.google.cloud.sql.v1.SqlServerDatabaseDetails.newBuilder( + (com.google.cloud.sql.v1.SqlServerDatabaseDetails) databaseDetails_) + .mergeFrom(value) + .buildPartial(); + } else { + databaseDetails_ = value; + } + onChanged(); + } else { + if (databaseDetailsCase_ == 9) { + sqlserverDatabaseDetailsBuilder_.mergeFrom(value); + } else { + sqlserverDatabaseDetailsBuilder_.setMessage(value); + } + } + databaseDetailsCase_ = 9; + return this; + } + + /** + * .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; + */ + public Builder clearSqlserverDatabaseDetails() { + if (sqlserverDatabaseDetailsBuilder_ == null) { + if (databaseDetailsCase_ == 9) { + databaseDetailsCase_ = 0; + databaseDetails_ = null; + onChanged(); + } + } else { + if (databaseDetailsCase_ == 9) { + databaseDetailsCase_ = 0; + databaseDetails_ = null; + } + sqlserverDatabaseDetailsBuilder_.clear(); + } + return this; + } + + /** + * .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; + */ + public com.google.cloud.sql.v1.SqlServerDatabaseDetails.Builder + getSqlserverDatabaseDetailsBuilder() { + return internalGetSqlserverDatabaseDetailsFieldBuilder().getBuilder(); + } + + /** + * .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerDatabaseDetailsOrBuilder + getSqlserverDatabaseDetailsOrBuilder() { + if ((databaseDetailsCase_ == 9) && (sqlserverDatabaseDetailsBuilder_ != null)) { + return sqlserverDatabaseDetailsBuilder_.getMessageOrBuilder(); + } else { + if (databaseDetailsCase_ == 9) { + return (com.google.cloud.sql.v1.SqlServerDatabaseDetails) databaseDetails_; + } + return com.google.cloud.sql.v1.SqlServerDatabaseDetails.getDefaultInstance(); + } + } + + /** + * .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlServerDatabaseDetails, + com.google.cloud.sql.v1.SqlServerDatabaseDetails.Builder, + com.google.cloud.sql.v1.SqlServerDatabaseDetailsOrBuilder> + internalGetSqlserverDatabaseDetailsFieldBuilder() { + if (sqlserverDatabaseDetailsBuilder_ == null) { + if (!(databaseDetailsCase_ == 9)) { + databaseDetails_ = com.google.cloud.sql.v1.SqlServerDatabaseDetails.getDefaultInstance(); + } + sqlserverDatabaseDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlServerDatabaseDetails, + com.google.cloud.sql.v1.SqlServerDatabaseDetails.Builder, + com.google.cloud.sql.v1.SqlServerDatabaseDetailsOrBuilder>( + (com.google.cloud.sql.v1.SqlServerDatabaseDetails) databaseDetails_, + getParentForChildren(), + isClean()); + databaseDetails_ = null; + } + databaseDetailsCase_ = 9; + onChanged(); + return sqlserverDatabaseDetailsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.Database) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.Database) + private static final com.google.cloud.sql.v1.Database DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.Database(); + } + + public static com.google.cloud.sql.v1.Database getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Database parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Database getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseFlags.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseFlags.java new file mode 100644 index 000000000000..dac2664ee5f0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseFlags.java @@ -0,0 +1,824 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database flags for Cloud SQL instances.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DatabaseFlags} + */ +@com.google.protobuf.Generated +public final class DatabaseFlags extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DatabaseFlags) + DatabaseFlagsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DatabaseFlags"); + } + + // Use DatabaseFlags.newBuilder() to construct. + private DatabaseFlags(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DatabaseFlags() { + name_ = ""; + value_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DatabaseFlags_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DatabaseFlags_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DatabaseFlags.class, + com.google.cloud.sql.v1.DatabaseFlags.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the flag. These flags are passed at instance startup, so
+   * include both server options and system variables. Flags are
+   * specified with underscores, not hyphens. For more information, see
+   * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+   * in the Cloud SQL documentation.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the flag. These flags are passed at instance startup, so
+   * include both server options and system variables. Flags are
+   * specified with underscores, not hyphens. For more information, see
+   * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+   * in the Cloud SQL documentation.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + + /** + * + * + *
+   * The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + + /** + * + * + *
+   * The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.DatabaseFlags)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DatabaseFlags other = (com.google.cloud.sql.v1.DatabaseFlags) obj; + + if (!getName().equals(other.getName())) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DatabaseFlags parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseFlags parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseFlags parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseFlags parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseFlags parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseFlags parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseFlags parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseFlags parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseFlags parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseFlags parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseFlags parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseFlags parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.DatabaseFlags prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database flags for Cloud SQL instances.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DatabaseFlags} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DatabaseFlags) + com.google.cloud.sql.v1.DatabaseFlagsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DatabaseFlags_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DatabaseFlags_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DatabaseFlags.class, + com.google.cloud.sql.v1.DatabaseFlags.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DatabaseFlags.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + value_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DatabaseFlags_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseFlags getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DatabaseFlags.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseFlags build() { + com.google.cloud.sql.v1.DatabaseFlags result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseFlags buildPartial() { + com.google.cloud.sql.v1.DatabaseFlags result = + new com.google.cloud.sql.v1.DatabaseFlags(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.DatabaseFlags result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DatabaseFlags) { + return mergeFrom((com.google.cloud.sql.v1.DatabaseFlags) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DatabaseFlags other) { + if (other == com.google.cloud.sql.v1.DatabaseFlags.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + 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: + { + value_ = 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_ = ""; + + /** + * + * + *
+     * The name of the flag. These flags are passed at instance startup, so
+     * include both server options and system variables. Flags are
+     * specified with underscores, not hyphens. For more information, see
+     * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+     * in the Cloud SQL documentation.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the flag. These flags are passed at instance startup, so
+     * include both server options and system variables. Flags are
+     * specified with underscores, not hyphens. For more information, see
+     * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+     * in the Cloud SQL documentation.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the flag. These flags are passed at instance startup, so
+     * include both server options and system variables. Flags are
+     * specified with underscores, not hyphens. For more information, see
+     * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+     * in the Cloud SQL documentation.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the flag. These flags are passed at instance startup, so
+     * include both server options and system variables. Flags are
+     * specified with underscores, not hyphens. For more information, see
+     * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+     * in the Cloud SQL documentation.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the flag. These flags are passed at instance startup, so
+     * include both server options and system variables. Flags are
+     * specified with underscores, not hyphens. For more information, see
+     * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+     * in the Cloud SQL documentation.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + + /** + * + * + *
+     * The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DatabaseFlags) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DatabaseFlags) + private static final com.google.cloud.sql.v1.DatabaseFlags DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DatabaseFlags(); + } + + public static com.google.cloud.sql.v1.DatabaseFlags getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DatabaseFlags parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseFlags getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseFlagsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseFlagsOrBuilder.java new file mode 100644 index 000000000000..571d5a960a13 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseFlagsOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface DatabaseFlagsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DatabaseFlags) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the flag. These flags are passed at instance startup, so
+   * include both server options and system variables. Flags are
+   * specified with underscores, not hyphens. For more information, see
+   * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+   * in the Cloud SQL documentation.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the flag. These flags are passed at instance startup, so
+   * include both server options and system variables. Flags are
+   * specified with underscores, not hyphens. For more information, see
+   * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+   * in the Cloud SQL documentation.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The value. + */ + java.lang.String getValue(); + + /** + * + * + *
+   * The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseInstance.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseInstance.java new file mode 100644 index 000000000000..b1f81d0ca53d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseInstance.java @@ -0,0 +1,22328 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * A Cloud SQL instance resource.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DatabaseInstance} + */ +@com.google.protobuf.Generated +public final class DatabaseInstance extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DatabaseInstance) + DatabaseInstanceOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DatabaseInstance"); + } + + // Use DatabaseInstance.newBuilder() to construct. + private DatabaseInstance(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DatabaseInstance() { + kind_ = ""; + state_ = 0; + databaseVersion_ = 0; + etag_ = ""; + masterInstanceName_ = ""; + replicaNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + ipAddresses_ = java.util.Collections.emptyList(); + instanceType_ = 0; + project_ = ""; + ipv6Address_ = ""; + serviceAccountEmailAddress_ = ""; + backendType_ = 0; + selfLink_ = ""; + suspensionReason_ = emptyIntList(); + connectionName_ = ""; + name_ = ""; + region_ = ""; + gceZone_ = ""; + secondaryGceZone_ = ""; + rootPassword_ = ""; + databaseInstalledVersion_ = ""; + availableMaintenanceVersions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + maintenanceVersion_ = ""; + upgradableDatabaseVersions_ = java.util.Collections.emptyList(); + sqlNetworkArchitecture_ = 0; + pscServiceAttachmentLink_ = ""; + dnsName_ = ""; + primaryDnsName_ = ""; + writeEndpoint_ = ""; + nodes_ = java.util.Collections.emptyList(); + dnsNames_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 60: + return internalGetTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DatabaseInstance.class, + com.google.cloud.sql.v1.DatabaseInstance.Builder.class); + } + + /** + * + * + *
+   * The current serving state of the database instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.DatabaseInstance.SqlInstanceState} + */ + public enum SqlInstanceState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * SQL_INSTANCE_STATE_UNSPECIFIED = 0; + */ + SQL_INSTANCE_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The instance is running, or has been stopped by owner.
+     * 
+ * + * RUNNABLE = 1; + */ + RUNNABLE(1), + /** + * + * + *
+     * The instance is not available, for example due to problems with billing.
+     * 
+ * + * SUSPENDED = 2; + */ + SUSPENDED(2), + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * PENDING_DELETE = 3; + */ + PENDING_DELETE(3), + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * PENDING_CREATE = 4; + */ + PENDING_CREATE(4), + /** + * + * + *
+     * The instance is down for maintenance.
+     * 
+ * + * MAINTENANCE = 5; + */ + MAINTENANCE(5), + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * maintenance.
+     * 
+ * + * FAILED = 6; + */ + FAILED(6), + /** + * + * + *
+     * Deprecated
+     * 
+ * + * ONLINE_MAINTENANCE = 7 [deprecated = true]; + */ + @java.lang.Deprecated + ONLINE_MAINTENANCE(7), + /** + * + * + *
+     * (Applicable to read pool nodes only.) The read pool node needs to be
+     * repaired. The database might be unavailable.
+     * 
+ * + * REPAIRING = 8; + */ + REPAIRING(8), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstanceState"); + } + + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * SQL_INSTANCE_STATE_UNSPECIFIED = 0; + */ + public static final int SQL_INSTANCE_STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The instance is running, or has been stopped by owner.
+     * 
+ * + * RUNNABLE = 1; + */ + public static final int RUNNABLE_VALUE = 1; + + /** + * + * + *
+     * The instance is not available, for example due to problems with billing.
+     * 
+ * + * SUSPENDED = 2; + */ + public static final int SUSPENDED_VALUE = 2; + + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * PENDING_DELETE = 3; + */ + public static final int PENDING_DELETE_VALUE = 3; + + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * PENDING_CREATE = 4; + */ + public static final int PENDING_CREATE_VALUE = 4; + + /** + * + * + *
+     * The instance is down for maintenance.
+     * 
+ * + * MAINTENANCE = 5; + */ + public static final int MAINTENANCE_VALUE = 5; + + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * maintenance.
+     * 
+ * + * FAILED = 6; + */ + public static final int FAILED_VALUE = 6; + + /** + * + * + *
+     * Deprecated
+     * 
+ * + * ONLINE_MAINTENANCE = 7 [deprecated = true]; + */ + @java.lang.Deprecated public static final int ONLINE_MAINTENANCE_VALUE = 7; + + /** + * + * + *
+     * (Applicable to read pool nodes only.) The read pool node needs to be
+     * repaired. The database might be unavailable.
+     * 
+ * + * REPAIRING = 8; + */ + public static final int REPAIRING_VALUE = 8; + + 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 SqlInstanceState 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 SqlInstanceState forNumber(int value) { + switch (value) { + case 0: + return SQL_INSTANCE_STATE_UNSPECIFIED; + case 1: + return RUNNABLE; + case 2: + return SUSPENDED; + case 3: + return PENDING_DELETE; + case 4: + return PENDING_CREATE; + case 5: + return MAINTENANCE; + case 6: + return FAILED; + case 7: + return ONLINE_MAINTENANCE; + case 8: + return REPAIRING; + 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 SqlInstanceState findValueByNumber(int number) { + return SqlInstanceState.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.DatabaseInstance.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlInstanceState[] VALUES = values(); + + public static SqlInstanceState 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 SqlInstanceState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.DatabaseInstance.SqlInstanceState) + } + + /** + * + * + *
+   * The SQL network architecture for the instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture} + */ + public enum SqlNetworkArchitecture implements com.google.protobuf.ProtocolMessageEnum { + /** SQL_NETWORK_ARCHITECTURE_UNSPECIFIED = 0; */ + SQL_NETWORK_ARCHITECTURE_UNSPECIFIED(0), + /** + * + * + *
+     * The instance uses the new network architecture.
+     * 
+ * + * NEW_NETWORK_ARCHITECTURE = 1; + */ + NEW_NETWORK_ARCHITECTURE(1), + /** + * + * + *
+     * The instance uses the old network architecture.
+     * 
+ * + * OLD_NETWORK_ARCHITECTURE = 2; + */ + OLD_NETWORK_ARCHITECTURE(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlNetworkArchitecture"); + } + + /** SQL_NETWORK_ARCHITECTURE_UNSPECIFIED = 0; */ + public static final int SQL_NETWORK_ARCHITECTURE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The instance uses the new network architecture.
+     * 
+ * + * NEW_NETWORK_ARCHITECTURE = 1; + */ + public static final int NEW_NETWORK_ARCHITECTURE_VALUE = 1; + + /** + * + * + *
+     * The instance uses the old network architecture.
+     * 
+ * + * OLD_NETWORK_ARCHITECTURE = 2; + */ + public static final int OLD_NETWORK_ARCHITECTURE_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 SqlNetworkArchitecture 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 SqlNetworkArchitecture forNumber(int value) { + switch (value) { + case 0: + return SQL_NETWORK_ARCHITECTURE_UNSPECIFIED; + case 1: + return NEW_NETWORK_ARCHITECTURE; + case 2: + return OLD_NETWORK_ARCHITECTURE; + 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 SqlNetworkArchitecture findValueByNumber(int number) { + return SqlNetworkArchitecture.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.DatabaseInstance.getDescriptor().getEnumTypes().get(1); + } + + private static final SqlNetworkArchitecture[] VALUES = values(); + + public static SqlNetworkArchitecture 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 SqlNetworkArchitecture(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture) + } + + public interface SqlFailoverReplicaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the failover replica. If specified at instance creation, a
+     * failover replica is created for the instance. The name
+     * doesn't include the project ID.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+     * The name of the failover replica. If specified at instance creation, a
+     * failover replica is created for the instance. The name
+     * doesn't include the project ID.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * The availability status of the failover replica. A false status indicates
+     * that the failover replica is out of sync. The primary instance can only
+     * failover to the failover replica when the status is true.
+     * 
+ * + * .google.protobuf.BoolValue available = 2; + * + * @return Whether the available field is set. + */ + boolean hasAvailable(); + + /** + * + * + *
+     * The availability status of the failover replica. A false status indicates
+     * that the failover replica is out of sync. The primary instance can only
+     * failover to the failover replica when the status is true.
+     * 
+ * + * .google.protobuf.BoolValue available = 2; + * + * @return The available. + */ + com.google.protobuf.BoolValue getAvailable(); + + /** + * + * + *
+     * The availability status of the failover replica. A false status indicates
+     * that the failover replica is out of sync. The primary instance can only
+     * failover to the failover replica when the status is true.
+     * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + com.google.protobuf.BoolValueOrBuilder getAvailableOrBuilder(); + } + + /** Protobuf type {@code google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica} */ + public static final class SqlFailoverReplica extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica) + SqlFailoverReplicaOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlFailoverReplica"); + } + + // Use SqlFailoverReplica.newBuilder() to construct. + private SqlFailoverReplica(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlFailoverReplica() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlFailoverReplica_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlFailoverReplica_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.class, + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the failover replica. If specified at instance creation, a
+     * failover replica is created for the instance. The name
+     * doesn't include the project ID.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+     * The name of the failover replica. If specified at instance creation, a
+     * failover replica is created for the instance. The name
+     * doesn't include the project ID.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AVAILABLE_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue available_; + + /** + * + * + *
+     * The availability status of the failover replica. A false status indicates
+     * that the failover replica is out of sync. The primary instance can only
+     * failover to the failover replica when the status is true.
+     * 
+ * + * .google.protobuf.BoolValue available = 2; + * + * @return Whether the available field is set. + */ + @java.lang.Override + public boolean hasAvailable() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The availability status of the failover replica. A false status indicates
+     * that the failover replica is out of sync. The primary instance can only
+     * failover to the failover replica when the status is true.
+     * 
+ * + * .google.protobuf.BoolValue available = 2; + * + * @return The available. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getAvailable() { + return available_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : available_; + } + + /** + * + * + *
+     * The availability status of the failover replica. A false status indicates
+     * that the failover replica is out of sync. The primary instance can only
+     * failover to the failover replica when the status is true.
+     * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getAvailableOrBuilder() { + return available_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : available_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAvailable()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAvailable()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica other = + (com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica) obj; + + if (!getName().equals(other.getName())) return false; + if (hasAvailable() != other.hasAvailable()) return false; + if (hasAvailable()) { + if (!getAvailable().equals(other.getAvailable())) return false; + } + if (!getUnknownFields().equals(other.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 (hasAvailable()) { + hash = (37 * hash) + AVAILABLE_FIELD_NUMBER; + hash = (53 * hash) + getAvailable().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica) + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplicaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlFailoverReplica_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlFailoverReplica_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.class, + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAvailableFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + available_ = null; + if (availableBuilder_ != null) { + availableBuilder_.dispose(); + availableBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlFailoverReplica_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica build() { + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica buildPartial() { + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica result = + new com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.available_ = availableBuilder_ == null ? available_ : availableBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica) { + return mergeFrom((com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica other) { + if (other + == com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasAvailable()) { + mergeAvailable(other.getAvailable()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetAvailableFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+       * The name of the failover replica. If specified at instance creation, a
+       * failover replica is created for the instance. The name
+       * doesn't include the project ID.
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The name of the failover replica. If specified at instance creation, a
+       * failover replica is created for the instance. The name
+       * doesn't include the project ID.
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The name of the failover replica. If specified at instance creation, a
+       * failover replica is created for the instance. The name
+       * doesn't include the project ID.
+       * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The name of the failover replica. If specified at instance creation, a
+       * failover replica is created for the instance. The name
+       * doesn't include the project ID.
+       * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The name of the failover replica. If specified at instance creation, a
+       * failover replica is created for the instance. The name
+       * doesn't include the project ID.
+       * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue available_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + availableBuilder_; + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + * + * @return Whether the available field is set. + */ + public boolean hasAvailable() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + * + * @return The available. + */ + public com.google.protobuf.BoolValue getAvailable() { + if (availableBuilder_ == null) { + return available_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : available_; + } else { + return availableBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + public Builder setAvailable(com.google.protobuf.BoolValue value) { + if (availableBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + available_ = value; + } else { + availableBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + public Builder setAvailable(com.google.protobuf.BoolValue.Builder builderForValue) { + if (availableBuilder_ == null) { + available_ = builderForValue.build(); + } else { + availableBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + public Builder mergeAvailable(com.google.protobuf.BoolValue value) { + if (availableBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && available_ != null + && available_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getAvailableBuilder().mergeFrom(value); + } else { + available_ = value; + } + } else { + availableBuilder_.mergeFrom(value); + } + if (available_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + public Builder clearAvailable() { + bitField0_ = (bitField0_ & ~0x00000002); + available_ = null; + if (availableBuilder_ != null) { + availableBuilder_.dispose(); + availableBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + public com.google.protobuf.BoolValue.Builder getAvailableBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetAvailableFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + public com.google.protobuf.BoolValueOrBuilder getAvailableOrBuilder() { + if (availableBuilder_ != null) { + return availableBuilder_.getMessageOrBuilder(); + } else { + return available_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : available_; + } + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetAvailableFieldBuilder() { + if (availableBuilder_ == null) { + availableBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getAvailable(), getParentForChildren(), isClean()); + available_ = null; + } + return availableBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica) + private static final com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica(); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlFailoverReplica parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlScheduledMaintenanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * bool can_defer = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.can_defer is + * deprecated. See google/cloud/sql/v1/cloud_sql_instances.proto;l=1457 + * @return The canDefer. + */ + @java.lang.Deprecated + boolean getCanDefer(); + + /** + * + * + *
+     * If the scheduled maintenance can be rescheduled.
+     * 
+ * + * bool can_reschedule = 3; + * + * @return The canReschedule. + */ + boolean getCanReschedule(); + + /** + * + * + *
+     * Maintenance cannot be rescheduled to start beyond this deadline.
+     * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + * + * @return Whether the scheduleDeadlineTime field is set. + */ + boolean hasScheduleDeadlineTime(); + + /** + * + * + *
+     * Maintenance cannot be rescheduled to start beyond this deadline.
+     * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + * + * @return The scheduleDeadlineTime. + */ + com.google.protobuf.Timestamp getScheduleDeadlineTime(); + + /** + * + * + *
+     * Maintenance cannot be rescheduled to start beyond this deadline.
+     * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getScheduleDeadlineTimeOrBuilder(); + } + + /** + * + * + *
+   * Any scheduled maintenance for this instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance} + */ + public static final class SqlScheduledMaintenance extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance) + SqlScheduledMaintenanceOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlScheduledMaintenance"); + } + + // Use SqlScheduledMaintenance.newBuilder() to construct. + private SqlScheduledMaintenance(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlScheduledMaintenance() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlScheduledMaintenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlScheduledMaintenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.class, + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.Builder.class); + } + + private int bitField0_; + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int CAN_DEFER_FIELD_NUMBER = 2; + private boolean canDefer_ = false; + + /** + * bool can_defer = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.can_defer is + * deprecated. See google/cloud/sql/v1/cloud_sql_instances.proto;l=1457 + * @return The canDefer. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean getCanDefer() { + return canDefer_; + } + + public static final int CAN_RESCHEDULE_FIELD_NUMBER = 3; + private boolean canReschedule_ = false; + + /** + * + * + *
+     * If the scheduled maintenance can be rescheduled.
+     * 
+ * + * bool can_reschedule = 3; + * + * @return The canReschedule. + */ + @java.lang.Override + public boolean getCanReschedule() { + return canReschedule_; + } + + public static final int SCHEDULE_DEADLINE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp scheduleDeadlineTime_; + + /** + * + * + *
+     * Maintenance cannot be rescheduled to start beyond this deadline.
+     * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + * + * @return Whether the scheduleDeadlineTime field is set. + */ + @java.lang.Override + public boolean hasScheduleDeadlineTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Maintenance cannot be rescheduled to start beyond this deadline.
+     * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + * + * @return The scheduleDeadlineTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getScheduleDeadlineTime() { + return scheduleDeadlineTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleDeadlineTime_; + } + + /** + * + * + *
+     * Maintenance cannot be rescheduled to start beyond this deadline.
+     * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getScheduleDeadlineTimeOrBuilder() { + return scheduleDeadlineTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleDeadlineTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getStartTime()); + } + if (canDefer_ != false) { + output.writeBool(2, canDefer_); + } + if (canReschedule_ != false) { + output.writeBool(3, canReschedule_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getScheduleDeadlineTime()); + } + 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, getStartTime()); + } + if (canDefer_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, canDefer_); + } + if (canReschedule_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, canReschedule_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, getScheduleDeadlineTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance other = + (com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance) obj; + + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (getCanDefer() != other.getCanDefer()) return false; + if (getCanReschedule() != other.getCanReschedule()) return false; + if (hasScheduleDeadlineTime() != other.hasScheduleDeadlineTime()) return false; + if (hasScheduleDeadlineTime()) { + if (!getScheduleDeadlineTime().equals(other.getScheduleDeadlineTime())) return false; + } + if (!getUnknownFields().equals(other.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 (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + hash = (37 * hash) + CAN_DEFER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCanDefer()); + hash = (37 * hash) + CAN_RESCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCanReschedule()); + if (hasScheduleDeadlineTime()) { + hash = (37 * hash) + SCHEDULE_DEADLINE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getScheduleDeadlineTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Any scheduled maintenance for this instance.
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance) + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlScheduledMaintenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlScheduledMaintenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.class, + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + internalGetScheduleDeadlineTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + canDefer_ = false; + canReschedule_ = false; + scheduleDeadlineTime_ = null; + if (scheduleDeadlineTimeBuilder_ != null) { + scheduleDeadlineTimeBuilder_.dispose(); + scheduleDeadlineTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlScheduledMaintenance_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance build() { + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance buildPartial() { + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance result = + new com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.canDefer_ = canDefer_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.canReschedule_ = canReschedule_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.scheduleDeadlineTime_ = + scheduleDeadlineTimeBuilder_ == null + ? scheduleDeadlineTime_ + : scheduleDeadlineTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance) { + return mergeFrom( + (com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance other) { + if (other + == com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance + .getDefaultInstance()) return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.getCanDefer() != false) { + setCanDefer(other.getCanDefer()); + } + if (other.getCanReschedule() != false) { + setCanReschedule(other.getCanReschedule()); + } + if (other.hasScheduleDeadlineTime()) { + mergeScheduleDeadlineTime(other.getScheduleDeadlineTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + canDefer_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + canReschedule_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage( + internalGetScheduleDeadlineTimeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000001); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTime_; + } + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private boolean canDefer_; + + /** + * bool can_defer = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.can_defer is + * deprecated. See google/cloud/sql/v1/cloud_sql_instances.proto;l=1457 + * @return The canDefer. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean getCanDefer() { + return canDefer_; + } + + /** + * bool can_defer = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.can_defer is + * deprecated. See google/cloud/sql/v1/cloud_sql_instances.proto;l=1457 + * @param value The canDefer to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setCanDefer(boolean value) { + + canDefer_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * bool can_defer = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.can_defer is + * deprecated. See google/cloud/sql/v1/cloud_sql_instances.proto;l=1457 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearCanDefer() { + bitField0_ = (bitField0_ & ~0x00000002); + canDefer_ = false; + onChanged(); + return this; + } + + private boolean canReschedule_; + + /** + * + * + *
+       * If the scheduled maintenance can be rescheduled.
+       * 
+ * + * bool can_reschedule = 3; + * + * @return The canReschedule. + */ + @java.lang.Override + public boolean getCanReschedule() { + return canReschedule_; + } + + /** + * + * + *
+       * If the scheduled maintenance can be rescheduled.
+       * 
+ * + * bool can_reschedule = 3; + * + * @param value The canReschedule to set. + * @return This builder for chaining. + */ + public Builder setCanReschedule(boolean value) { + + canReschedule_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * If the scheduled maintenance can be rescheduled.
+       * 
+ * + * bool can_reschedule = 3; + * + * @return This builder for chaining. + */ + public Builder clearCanReschedule() { + bitField0_ = (bitField0_ & ~0x00000004); + canReschedule_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp scheduleDeadlineTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + scheduleDeadlineTimeBuilder_; + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + * + * @return Whether the scheduleDeadlineTime field is set. + */ + public boolean hasScheduleDeadlineTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + * + * @return The scheduleDeadlineTime. + */ + public com.google.protobuf.Timestamp getScheduleDeadlineTime() { + if (scheduleDeadlineTimeBuilder_ == null) { + return scheduleDeadlineTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleDeadlineTime_; + } else { + return scheduleDeadlineTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + public Builder setScheduleDeadlineTime(com.google.protobuf.Timestamp value) { + if (scheduleDeadlineTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scheduleDeadlineTime_ = value; + } else { + scheduleDeadlineTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + public Builder setScheduleDeadlineTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (scheduleDeadlineTimeBuilder_ == null) { + scheduleDeadlineTime_ = builderForValue.build(); + } else { + scheduleDeadlineTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + public Builder mergeScheduleDeadlineTime(com.google.protobuf.Timestamp value) { + if (scheduleDeadlineTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && scheduleDeadlineTime_ != null + && scheduleDeadlineTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getScheduleDeadlineTimeBuilder().mergeFrom(value); + } else { + scheduleDeadlineTime_ = value; + } + } else { + scheduleDeadlineTimeBuilder_.mergeFrom(value); + } + if (scheduleDeadlineTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + public Builder clearScheduleDeadlineTime() { + bitField0_ = (bitField0_ & ~0x00000008); + scheduleDeadlineTime_ = null; + if (scheduleDeadlineTimeBuilder_ != null) { + scheduleDeadlineTimeBuilder_.dispose(); + scheduleDeadlineTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getScheduleDeadlineTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetScheduleDeadlineTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getScheduleDeadlineTimeOrBuilder() { + if (scheduleDeadlineTimeBuilder_ != null) { + return scheduleDeadlineTimeBuilder_.getMessageOrBuilder(); + } else { + return scheduleDeadlineTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleDeadlineTime_; + } + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetScheduleDeadlineTimeFieldBuilder() { + if (scheduleDeadlineTimeBuilder_ == null) { + scheduleDeadlineTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getScheduleDeadlineTime(), getParentForChildren(), isClean()); + scheduleDeadlineTime_ = null; + } + return scheduleDeadlineTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance) + private static final com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance(); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlScheduledMaintenance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlOutOfDiskReportOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * This field represents the state generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return Whether the sqlOutOfDiskState field is set. + */ + boolean hasSqlOutOfDiskState(); + + /** + * + * + *
+     * This field represents the state generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return The enum numeric value on the wire for sqlOutOfDiskState. + */ + int getSqlOutOfDiskStateValue(); + + /** + * + * + *
+     * This field represents the state generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return The sqlOutOfDiskState. + */ + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState + getSqlOutOfDiskState(); + + /** + * + * + *
+     * The minimum recommended increase size in GigaBytes
+     * This field is consumed by the frontend
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @return Whether the sqlMinRecommendedIncreaseSizeGb field is set. + */ + boolean hasSqlMinRecommendedIncreaseSizeGb(); + + /** + * + * + *
+     * The minimum recommended increase size in GigaBytes
+     * This field is consumed by the frontend
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @return The sqlMinRecommendedIncreaseSizeGb. + */ + int getSqlMinRecommendedIncreaseSizeGb(); + } + + /** + * + * + *
+   * This message wraps up the information written by out-of-disk detection job.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport} + */ + public static final class SqlOutOfDiskReport extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport) + SqlOutOfDiskReportOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlOutOfDiskReport"); + } + + // Use SqlOutOfDiskReport.newBuilder() to construct. + private SqlOutOfDiskReport(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlOutOfDiskReport() { + sqlOutOfDiskState_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlOutOfDiskReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlOutOfDiskReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.class, + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.Builder.class); + } + + /** + * + * + *
+     * This enum lists all possible states regarding out-of-disk issues.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState} + */ + public enum SqlOutOfDiskState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified state
+       * 
+ * + * SQL_OUT_OF_DISK_STATE_UNSPECIFIED = 0; + */ + SQL_OUT_OF_DISK_STATE_UNSPECIFIED(0), + /** + * + * + *
+       * The instance has plenty space on data disk
+       * 
+ * + * NORMAL = 1; + */ + NORMAL(1), + /** + * + * + *
+       * Data disk is almost used up. It is shutdown to prevent data
+       * corruption.
+       * 
+ * + * SOFT_SHUTDOWN = 2; + */ + SOFT_SHUTDOWN(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlOutOfDiskState"); + } + + /** + * + * + *
+       * Unspecified state
+       * 
+ * + * SQL_OUT_OF_DISK_STATE_UNSPECIFIED = 0; + */ + public static final int SQL_OUT_OF_DISK_STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+       * The instance has plenty space on data disk
+       * 
+ * + * NORMAL = 1; + */ + public static final int NORMAL_VALUE = 1; + + /** + * + * + *
+       * Data disk is almost used up. It is shutdown to prevent data
+       * corruption.
+       * 
+ * + * SOFT_SHUTDOWN = 2; + */ + public static final int SOFT_SHUTDOWN_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 SqlOutOfDiskState 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 SqlOutOfDiskState forNumber(int value) { + switch (value) { + case 0: + return SQL_OUT_OF_DISK_STATE_UNSPECIFIED; + case 1: + return NORMAL; + case 2: + return SOFT_SHUTDOWN; + 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 SqlOutOfDiskState findValueByNumber(int number) { + return SqlOutOfDiskState.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final SqlOutOfDiskState[] VALUES = values(); + + public static SqlOutOfDiskState 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 SqlOutOfDiskState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState) + } + + private int bitField0_; + public static final int SQL_OUT_OF_DISK_STATE_FIELD_NUMBER = 1; + private int sqlOutOfDiskState_ = 0; + + /** + * + * + *
+     * This field represents the state generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return Whether the sqlOutOfDiskState field is set. + */ + @java.lang.Override + public boolean hasSqlOutOfDiskState() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * This field represents the state generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return The enum numeric value on the wire for sqlOutOfDiskState. + */ + @java.lang.Override + public int getSqlOutOfDiskStateValue() { + return sqlOutOfDiskState_; + } + + /** + * + * + *
+     * This field represents the state generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return The sqlOutOfDiskState. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState + getSqlOutOfDiskState() { + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState result = + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState.forNumber( + sqlOutOfDiskState_); + return result == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState + .UNRECOGNIZED + : result; + } + + public static final int SQL_MIN_RECOMMENDED_INCREASE_SIZE_GB_FIELD_NUMBER = 2; + private int sqlMinRecommendedIncreaseSizeGb_ = 0; + + /** + * + * + *
+     * The minimum recommended increase size in GigaBytes
+     * This field is consumed by the frontend
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @return Whether the sqlMinRecommendedIncreaseSizeGb field is set. + */ + @java.lang.Override + public boolean hasSqlMinRecommendedIncreaseSizeGb() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The minimum recommended increase size in GigaBytes
+     * This field is consumed by the frontend
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @return The sqlMinRecommendedIncreaseSizeGb. + */ + @java.lang.Override + public int getSqlMinRecommendedIncreaseSizeGb() { + return sqlMinRecommendedIncreaseSizeGb_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.writeEnum(1, sqlOutOfDiskState_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(2, sqlMinRecommendedIncreaseSizeGb_); + } + 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.computeEnumSize(1, sqlOutOfDiskState_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 2, sqlMinRecommendedIncreaseSizeGb_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport other = + (com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport) obj; + + if (hasSqlOutOfDiskState() != other.hasSqlOutOfDiskState()) return false; + if (hasSqlOutOfDiskState()) { + if (sqlOutOfDiskState_ != other.sqlOutOfDiskState_) return false; + } + if (hasSqlMinRecommendedIncreaseSizeGb() != other.hasSqlMinRecommendedIncreaseSizeGb()) + return false; + if (hasSqlMinRecommendedIncreaseSizeGb()) { + if (getSqlMinRecommendedIncreaseSizeGb() != other.getSqlMinRecommendedIncreaseSizeGb()) + return false; + } + if (!getUnknownFields().equals(other.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 (hasSqlOutOfDiskState()) { + hash = (37 * hash) + SQL_OUT_OF_DISK_STATE_FIELD_NUMBER; + hash = (53 * hash) + sqlOutOfDiskState_; + } + if (hasSqlMinRecommendedIncreaseSizeGb()) { + hash = (37 * hash) + SQL_MIN_RECOMMENDED_INCREASE_SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + getSqlMinRecommendedIncreaseSizeGb(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * This message wraps up the information written by out-of-disk detection job.
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport) + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReportOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlOutOfDiskReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlOutOfDiskReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.class, + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sqlOutOfDiskState_ = 0; + sqlMinRecommendedIncreaseSizeGb_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_SqlOutOfDiskReport_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport build() { + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport buildPartial() { + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport result = + new com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sqlOutOfDiskState_ = sqlOutOfDiskState_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sqlMinRecommendedIncreaseSizeGb_ = sqlMinRecommendedIncreaseSizeGb_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport) { + return mergeFrom((com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport other) { + if (other + == com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.getDefaultInstance()) + return this; + if (other.hasSqlOutOfDiskState()) { + setSqlOutOfDiskStateValue(other.getSqlOutOfDiskStateValue()); + } + if (other.hasSqlMinRecommendedIncreaseSizeGb()) { + setSqlMinRecommendedIncreaseSizeGb(other.getSqlMinRecommendedIncreaseSizeGb()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + sqlOutOfDiskState_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + sqlMinRecommendedIncreaseSizeGb_ = 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 sqlOutOfDiskState_ = 0; + + /** + * + * + *
+       * This field represents the state generated by the proactive database
+       * wellness job for OutOfDisk issues.
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * *  the proactive database wellness job
+       * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return Whether the sqlOutOfDiskState field is set. + */ + @java.lang.Override + public boolean hasSqlOutOfDiskState() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * This field represents the state generated by the proactive database
+       * wellness job for OutOfDisk issues.
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * *  the proactive database wellness job
+       * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return The enum numeric value on the wire for sqlOutOfDiskState. + */ + @java.lang.Override + public int getSqlOutOfDiskStateValue() { + return sqlOutOfDiskState_; + } + + /** + * + * + *
+       * This field represents the state generated by the proactive database
+       * wellness job for OutOfDisk issues.
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * *  the proactive database wellness job
+       * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @param value The enum numeric value on the wire for sqlOutOfDiskState to set. + * @return This builder for chaining. + */ + public Builder setSqlOutOfDiskStateValue(int value) { + sqlOutOfDiskState_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * This field represents the state generated by the proactive database
+       * wellness job for OutOfDisk issues.
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * *  the proactive database wellness job
+       * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return The sqlOutOfDiskState. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState + getSqlOutOfDiskState() { + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState result = + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState.forNumber( + sqlOutOfDiskState_); + return result == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * This field represents the state generated by the proactive database
+       * wellness job for OutOfDisk issues.
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * *  the proactive database wellness job
+       * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @param value The sqlOutOfDiskState to set. + * @return This builder for chaining. + */ + public Builder setSqlOutOfDiskState( + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + sqlOutOfDiskState_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * This field represents the state generated by the proactive database
+       * wellness job for OutOfDisk issues.
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * *  the proactive database wellness job
+       * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearSqlOutOfDiskState() { + bitField0_ = (bitField0_ & ~0x00000001); + sqlOutOfDiskState_ = 0; + onChanged(); + return this; + } + + private int sqlMinRecommendedIncreaseSizeGb_; + + /** + * + * + *
+       * The minimum recommended increase size in GigaBytes
+       * This field is consumed by the frontend
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @return Whether the sqlMinRecommendedIncreaseSizeGb field is set. + */ + @java.lang.Override + public boolean hasSqlMinRecommendedIncreaseSizeGb() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The minimum recommended increase size in GigaBytes
+       * This field is consumed by the frontend
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @return The sqlMinRecommendedIncreaseSizeGb. + */ + @java.lang.Override + public int getSqlMinRecommendedIncreaseSizeGb() { + return sqlMinRecommendedIncreaseSizeGb_; + } + + /** + * + * + *
+       * The minimum recommended increase size in GigaBytes
+       * This field is consumed by the frontend
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @param value The sqlMinRecommendedIncreaseSizeGb to set. + * @return This builder for chaining. + */ + public Builder setSqlMinRecommendedIncreaseSizeGb(int value) { + + sqlMinRecommendedIncreaseSizeGb_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The minimum recommended increase size in GigaBytes
+       * This field is consumed by the frontend
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @return This builder for chaining. + */ + public Builder clearSqlMinRecommendedIncreaseSizeGb() { + bitField0_ = (bitField0_ & ~0x00000002); + sqlMinRecommendedIncreaseSizeGb_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport) + private static final com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport(); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlOutOfDiskReport parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PoolNodeConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. The name of the read pool node, to be used for retrieving
+     * metrics and logs.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the name field is set. + */ + boolean hasName(); + + /** + * + * + *
+     * Output only. The name of the read pool node, to be used for retrieving
+     * metrics and logs.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+     * Output only. The name of the read pool node, to be used for retrieving
+     * metrics and logs.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * Output only. The zone of the read pool node.
+     * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the gceZone field is set. + */ + boolean hasGceZone(); + + /** + * + * + *
+     * Output only. The zone of the read pool node.
+     * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The gceZone. + */ + java.lang.String getGceZone(); + + /** + * + * + *
+     * Output only. The zone of the read pool node.
+     * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for gceZone. + */ + com.google.protobuf.ByteString getGceZoneBytes(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getIpAddressesList(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.IpMapping getIpAddresses(int index); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getIpAddressesCount(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getIpAddressesOrBuilderList(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.IpMappingOrBuilder getIpAddressesOrBuilder(int index); + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + boolean hasDnsName(); + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + java.lang.String getDnsName(); + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + com.google.protobuf.ByteString getDnsNameBytes(); + + /** + * + * + *
+     * Output only. The current state of the read pool node.
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the state field is set. + */ + boolean hasState(); + + /** + * + * + *
+     * Output only. The current state of the read pool node.
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+     * Output only. The current state of the read pool node.
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState getState(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getDnsNamesList(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.DnsNameMapping getDnsNames(int index); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getDnsNamesCount(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getDnsNamesOrBuilderList(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index); + + /** + * + * + *
+     * Output only. The Private Service Connect (PSC) service attachment of the
+     * read pool node.
+     * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscServiceAttachmentLink field is set. + */ + boolean hasPscServiceAttachmentLink(); + + /** + * + * + *
+     * Output only. The Private Service Connect (PSC) service attachment of the
+     * read pool node.
+     * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscServiceAttachmentLink. + */ + java.lang.String getPscServiceAttachmentLink(); + + /** + * + * + *
+     * Output only. The Private Service Connect (PSC) service attachment of the
+     * read pool node.
+     * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for pscServiceAttachmentLink. + */ + com.google.protobuf.ByteString getPscServiceAttachmentLinkBytes(); + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getPscAutoConnectionsList(); + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.PscAutoConnectionConfig getPscAutoConnections(int index); + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getPscAutoConnectionsCount(); + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getPscAutoConnectionsOrBuilderList(); + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.PscAutoConnectionConfigOrBuilder getPscAutoConnectionsOrBuilder( + int index); + } + + /** + * + * + *
+   * Details of a single read pool node of a read pool.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig} + */ + public static final class PoolNodeConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig) + PoolNodeConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PoolNodeConfig"); + } + + // Use PoolNodeConfig.newBuilder() to construct. + private PoolNodeConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PoolNodeConfig() { + name_ = ""; + gceZone_ = ""; + ipAddresses_ = java.util.Collections.emptyList(); + dnsName_ = ""; + state_ = 0; + dnsNames_ = java.util.Collections.emptyList(); + pscServiceAttachmentLink_ = ""; + pscAutoConnections_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_PoolNodeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_PoolNodeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.class, + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. The name of the read pool node, to be used for retrieving
+     * metrics and logs.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the name field is set. + */ + @java.lang.Override + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Output only. The name of the read pool node, to be used for retrieving
+     * metrics and logs.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The name of the read pool node, to be used for retrieving
+     * metrics and logs.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GCE_ZONE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object gceZone_ = ""; + + /** + * + * + *
+     * Output only. The zone of the read pool node.
+     * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the gceZone field is set. + */ + @java.lang.Override + public boolean hasGceZone() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. The zone of the read pool node.
+     * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The gceZone. + */ + @java.lang.Override + public java.lang.String getGceZone() { + java.lang.Object ref = gceZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gceZone_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The zone of the read pool node.
+     * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for gceZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGceZoneBytes() { + java.lang.Object ref = gceZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESSES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List ipAddresses_; + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getIpAddressesList() { + return ipAddresses_; + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getIpAddressesOrBuilderList() { + return ipAddresses_; + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getIpAddressesCount() { + return ipAddresses_.size(); + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpMapping getIpAddresses(int index) { + return ipAddresses_.get(index); + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + return ipAddresses_.get(index); + } + + public static final int DNS_NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object dnsName_ = ""; + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + @java.lang.Override + public boolean hasDnsName() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + @java.lang.Override + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 5; + private int state_ = 0; + + /** + * + * + *
+     * Output only. The current state of the read pool node.
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the state field is set. + */ + @java.lang.Override + public boolean hasState() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Output only. The current state of the read pool node.
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState 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. The current state of the read pool node.
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState getState() { + com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState result = + com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState.forNumber(state_); + return result == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState.UNRECOGNIZED + : result; + } + + public static final int DNS_NAMES_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private java.util.List dnsNames_; + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getDnsNamesList() { + return dnsNames_; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDnsNamesOrBuilderList() { + return dnsNames_; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getDnsNamesCount() { + return dnsNames_.size(); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMapping getDnsNames(int index) { + return dnsNames_.get(index); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + return dnsNames_.get(index); + } + + public static final int PSC_SERVICE_ATTACHMENT_LINK_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object pscServiceAttachmentLink_ = ""; + + /** + * + * + *
+     * Output only. The Private Service Connect (PSC) service attachment of the
+     * read pool node.
+     * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscServiceAttachmentLink field is set. + */ + @java.lang.Override + public boolean hasPscServiceAttachmentLink() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Output only. The Private Service Connect (PSC) service attachment of the
+     * read pool node.
+     * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscServiceAttachmentLink. + */ + @java.lang.Override + public java.lang.String getPscServiceAttachmentLink() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pscServiceAttachmentLink_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The Private Service Connect (PSC) service attachment of the
+     * read pool node.
+     * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for pscServiceAttachmentLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPscServiceAttachmentLinkBytes() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pscServiceAttachmentLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PSC_AUTO_CONNECTIONS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private java.util.List pscAutoConnections_; + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getPscAutoConnectionsList() { + return pscAutoConnections_; + } + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getPscAutoConnectionsOrBuilderList() { + return pscAutoConnections_; + } + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getPscAutoConnectionsCount() { + return pscAutoConnections_.size(); + } + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.PscAutoConnectionConfig getPscAutoConnections(int index) { + return pscAutoConnections_.get(index); + } + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.PscAutoConnectionConfigOrBuilder getPscAutoConnectionsOrBuilder( + int index) { + return pscAutoConnections_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, gceZone_); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + output.writeMessage(3, ipAddresses_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, dnsName_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeEnum(5, state_); + } + for (int i = 0; i < dnsNames_.size(); i++) { + output.writeMessage(6, dnsNames_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, pscServiceAttachmentLink_); + } + for (int i = 0; i < pscAutoConnections_.size(); i++) { + output.writeMessage(8, pscAutoConnections_.get(i)); + } + 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.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, gceZone_); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, ipAddresses_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, dnsName_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_); + } + for (int i = 0; i < dnsNames_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, dnsNames_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.GeneratedMessage.computeStringSize(7, pscServiceAttachmentLink_); + } + for (int i = 0; i < pscAutoConnections_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(8, pscAutoConnections_.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.sql.v1.DatabaseInstance.PoolNodeConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig other = + (com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig) obj; + + if (hasName() != other.hasName()) return false; + if (hasName()) { + if (!getName().equals(other.getName())) return false; + } + if (hasGceZone() != other.hasGceZone()) return false; + if (hasGceZone()) { + if (!getGceZone().equals(other.getGceZone())) return false; + } + if (!getIpAddressesList().equals(other.getIpAddressesList())) return false; + if (hasDnsName() != other.hasDnsName()) return false; + if (hasDnsName()) { + if (!getDnsName().equals(other.getDnsName())) return false; + } + if (hasState() != other.hasState()) return false; + if (hasState()) { + if (state_ != other.state_) return false; + } + if (!getDnsNamesList().equals(other.getDnsNamesList())) return false; + if (hasPscServiceAttachmentLink() != other.hasPscServiceAttachmentLink()) return false; + if (hasPscServiceAttachmentLink()) { + if (!getPscServiceAttachmentLink().equals(other.getPscServiceAttachmentLink())) + return false; + } + if (!getPscAutoConnectionsList().equals(other.getPscAutoConnectionsList())) return false; + if (!getUnknownFields().equals(other.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 (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasGceZone()) { + hash = (37 * hash) + GCE_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getGceZone().hashCode(); + } + if (getIpAddressesCount() > 0) { + hash = (37 * hash) + IP_ADDRESSES_FIELD_NUMBER; + hash = (53 * hash) + getIpAddressesList().hashCode(); + } + if (hasDnsName()) { + hash = (37 * hash) + DNS_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDnsName().hashCode(); + } + if (hasState()) { + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + } + if (getDnsNamesCount() > 0) { + hash = (37 * hash) + DNS_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getDnsNamesList().hashCode(); + } + if (hasPscServiceAttachmentLink()) { + hash = (37 * hash) + PSC_SERVICE_ATTACHMENT_LINK_FIELD_NUMBER; + hash = (53 * hash) + getPscServiceAttachmentLink().hashCode(); + } + if (getPscAutoConnectionsCount() > 0) { + hash = (37 * hash) + PSC_AUTO_CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPscAutoConnectionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Details of a single read pool node of a read pool.
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig) + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_PoolNodeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_PoolNodeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.class, + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + gceZone_ = ""; + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + } else { + ipAddresses_ = null; + ipAddressesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + dnsName_ = ""; + state_ = 0; + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + } else { + dnsNames_ = null; + dnsNamesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + pscServiceAttachmentLink_ = ""; + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnections_ = java.util.Collections.emptyList(); + } else { + pscAutoConnections_ = null; + pscAutoConnectionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_PoolNodeConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig build() { + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig buildPartial() { + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig result = + new com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig result) { + if (ipAddressesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + ipAddresses_ = java.util.Collections.unmodifiableList(ipAddresses_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.ipAddresses_ = ipAddresses_; + } else { + result.ipAddresses_ = ipAddressesBuilder_.build(); + } + if (dnsNamesBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + dnsNames_ = java.util.Collections.unmodifiableList(dnsNames_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.dnsNames_ = dnsNames_; + } else { + result.dnsNames_ = dnsNamesBuilder_.build(); + } + if (pscAutoConnectionsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + pscAutoConnections_ = java.util.Collections.unmodifiableList(pscAutoConnections_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.pscAutoConnections_ = pscAutoConnections_; + } else { + result.pscAutoConnections_ = pscAutoConnectionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.gceZone_ = gceZone_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.dnsName_ = dnsName_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.state_ = state_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pscServiceAttachmentLink_ = pscServiceAttachmentLink_; + to_bitField0_ |= 0x00000010; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig) { + return mergeFrom((com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig other) { + if (other == com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.getDefaultInstance()) + return this; + if (other.hasName()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasGceZone()) { + gceZone_ = other.gceZone_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (ipAddressesBuilder_ == null) { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddresses_.isEmpty()) { + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureIpAddressesIsMutable(); + ipAddresses_.addAll(other.ipAddresses_); + } + onChanged(); + } + } else { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddressesBuilder_.isEmpty()) { + ipAddressesBuilder_.dispose(); + ipAddressesBuilder_ = null; + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000004); + ipAddressesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetIpAddressesFieldBuilder() + : null; + } else { + ipAddressesBuilder_.addAllMessages(other.ipAddresses_); + } + } + } + if (other.hasDnsName()) { + dnsName_ = other.dnsName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasState()) { + setStateValue(other.getStateValue()); + } + if (dnsNamesBuilder_ == null) { + if (!other.dnsNames_.isEmpty()) { + if (dnsNames_.isEmpty()) { + dnsNames_ = other.dnsNames_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureDnsNamesIsMutable(); + dnsNames_.addAll(other.dnsNames_); + } + onChanged(); + } + } else { + if (!other.dnsNames_.isEmpty()) { + if (dnsNamesBuilder_.isEmpty()) { + dnsNamesBuilder_.dispose(); + dnsNamesBuilder_ = null; + dnsNames_ = other.dnsNames_; + bitField0_ = (bitField0_ & ~0x00000020); + dnsNamesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDnsNamesFieldBuilder() + : null; + } else { + dnsNamesBuilder_.addAllMessages(other.dnsNames_); + } + } + } + if (other.hasPscServiceAttachmentLink()) { + pscServiceAttachmentLink_ = other.pscServiceAttachmentLink_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (pscAutoConnectionsBuilder_ == null) { + if (!other.pscAutoConnections_.isEmpty()) { + if (pscAutoConnections_.isEmpty()) { + pscAutoConnections_ = other.pscAutoConnections_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.addAll(other.pscAutoConnections_); + } + onChanged(); + } + } else { + if (!other.pscAutoConnections_.isEmpty()) { + if (pscAutoConnectionsBuilder_.isEmpty()) { + pscAutoConnectionsBuilder_.dispose(); + pscAutoConnectionsBuilder_ = null; + pscAutoConnections_ = other.pscAutoConnections_; + bitField0_ = (bitField0_ & ~0x00000080); + pscAutoConnectionsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPscAutoConnectionsFieldBuilder() + : null; + } else { + pscAutoConnectionsBuilder_.addAllMessages(other.pscAutoConnections_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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: + { + gceZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.cloud.sql.v1.IpMapping m = + input.readMessage( + com.google.cloud.sql.v1.IpMapping.parser(), extensionRegistry); + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(m); + } else { + ipAddressesBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + dnsName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + com.google.cloud.sql.v1.DnsNameMapping m = + input.readMessage( + com.google.cloud.sql.v1.DnsNameMapping.parser(), extensionRegistry); + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(m); + } else { + dnsNamesBuilder_.addMessage(m); + } + break; + } // case 50 + case 58: + { + pscServiceAttachmentLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + com.google.cloud.sql.v1.PscAutoConnectionConfig m = + input.readMessage( + com.google.cloud.sql.v1.PscAutoConnectionConfig.parser(), + extensionRegistry); + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(m); + } else { + pscAutoConnectionsBuilder_.addMessage(m); + } + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+       * Output only. The name of the read pool node, to be used for retrieving
+       * metrics and logs.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the name field is set. + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Output only. The name of the read pool node, to be used for retrieving
+       * metrics and logs.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The name of the read pool node, to be used for retrieving
+       * metrics and logs.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The name of the read pool node, to be used for retrieving
+       * metrics and logs.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The name of the read pool node, to be used for retrieving
+       * metrics and logs.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The name of the read pool node, to be used for retrieving
+       * metrics and logs.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object gceZone_ = ""; + + /** + * + * + *
+       * Output only. The zone of the read pool node.
+       * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the gceZone field is set. + */ + public boolean hasGceZone() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Output only. The zone of the read pool node.
+       * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The gceZone. + */ + public java.lang.String getGceZone() { + java.lang.Object ref = gceZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gceZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The zone of the read pool node.
+       * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for gceZone. + */ + public com.google.protobuf.ByteString getGceZoneBytes() { + java.lang.Object ref = gceZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The zone of the read pool node.
+       * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The gceZone to set. + * @return This builder for chaining. + */ + public Builder setGceZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + gceZone_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The zone of the read pool node.
+       * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearGceZone() { + gceZone_ = getDefaultInstance().getGceZone(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The zone of the read pool node.
+       * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for gceZone to set. + * @return This builder for chaining. + */ + public Builder setGceZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + gceZone_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List ipAddresses_ = + java.util.Collections.emptyList(); + + private void ensureIpAddressesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + ipAddresses_ = new java.util.ArrayList(ipAddresses_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.IpMapping, + com.google.cloud.sql.v1.IpMapping.Builder, + com.google.cloud.sql.v1.IpMappingOrBuilder> + ipAddressesBuilder_; + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getIpAddressesList() { + if (ipAddressesBuilder_ == null) { + return java.util.Collections.unmodifiableList(ipAddresses_); + } else { + return ipAddressesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getIpAddressesCount() { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.size(); + } else { + return ipAddressesBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.IpMapping getIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setIpAddresses(int index, com.google.cloud.sql.v1.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, value); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setIpAddresses( + int index, com.google.cloud.sql.v1.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses(com.google.cloud.sql.v1.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses(int index, com.google.cloud.sql.v1.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses(com.google.cloud.sql.v1.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses( + int index, com.google.cloud.sql.v1.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllIpAddresses( + java.lang.Iterable values) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipAddresses_); + onChanged(); + } else { + ipAddressesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearIpAddresses() { + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + ipAddressesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.remove(index); + onChanged(); + } else { + ipAddressesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.IpMapping.Builder getIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getIpAddressesOrBuilderList() { + if (ipAddressesBuilder_ != null) { + return ipAddressesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(ipAddresses_); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.IpMapping.Builder addIpAddressesBuilder() { + return internalGetIpAddressesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.IpMapping.Builder addIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getIpAddressesBuilderList() { + return internalGetIpAddressesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.IpMapping, + com.google.cloud.sql.v1.IpMapping.Builder, + com.google.cloud.sql.v1.IpMappingOrBuilder> + internalGetIpAddressesFieldBuilder() { + if (ipAddressesBuilder_ == null) { + ipAddressesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.IpMapping, + com.google.cloud.sql.v1.IpMapping.Builder, + com.google.cloud.sql.v1.IpMappingOrBuilder>( + ipAddresses_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + ipAddresses_ = null; + } + return ipAddressesBuilder_; + } + + private java.lang.Object dnsName_ = ""; + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + public boolean hasDnsName() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dnsName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDnsName() { + dnsName_ = getDefaultInstance().getDnsName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dnsName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int state_ = 0; + + /** + * + * + *
+       * Output only. The current state of the read pool node.
+       * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the state field is set. + */ + @java.lang.Override + public boolean hasState() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+       * Output only. The current state of the read pool node.
+       * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState 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. The current state of the read pool node.
+       * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState 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. The current state of the read pool node.
+       * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState getState() { + com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState result = + com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState.forNumber(state_); + return result == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * Output only. The current state of the read pool node.
+       * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState 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.sql.v1.DatabaseInstance.SqlInstanceState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The current state of the read pool node.
+       * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState 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 java.util.List dnsNames_ = + java.util.Collections.emptyList(); + + private void ensureDnsNamesIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + dnsNames_ = new java.util.ArrayList(dnsNames_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DnsNameMapping, + com.google.cloud.sql.v1.DnsNameMapping.Builder, + com.google.cloud.sql.v1.DnsNameMappingOrBuilder> + dnsNamesBuilder_; + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getDnsNamesList() { + if (dnsNamesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dnsNames_); + } else { + return dnsNamesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getDnsNamesCount() { + if (dnsNamesBuilder_ == null) { + return dnsNames_.size(); + } else { + return dnsNamesBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping getDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames(int index, com.google.cloud.sql.v1.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.set(index, value); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames( + int index, com.google.cloud.sql.v1.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.set(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(com.google.cloud.sql.v1.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(int index, com.google.cloud.sql.v1.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(index, value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(com.google.cloud.sql.v1.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames( + int index, com.google.cloud.sql.v1.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllDnsNames( + java.lang.Iterable values) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dnsNames_); + onChanged(); + } else { + dnsNamesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDnsNames() { + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + dnsNamesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.remove(index); + onChanged(); + } else { + dnsNamesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping.Builder getDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDnsNamesOrBuilderList() { + if (dnsNamesBuilder_ != null) { + return dnsNamesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dnsNames_); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping.Builder addDnsNamesBuilder() { + return internalGetDnsNamesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping.Builder addDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDnsNamesBuilderList() { + return internalGetDnsNamesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DnsNameMapping, + com.google.cloud.sql.v1.DnsNameMapping.Builder, + com.google.cloud.sql.v1.DnsNameMappingOrBuilder> + internalGetDnsNamesFieldBuilder() { + if (dnsNamesBuilder_ == null) { + dnsNamesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DnsNameMapping, + com.google.cloud.sql.v1.DnsNameMapping.Builder, + com.google.cloud.sql.v1.DnsNameMappingOrBuilder>( + dnsNames_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); + dnsNames_ = null; + } + return dnsNamesBuilder_; + } + + private java.lang.Object pscServiceAttachmentLink_ = ""; + + /** + * + * + *
+       * Output only. The Private Service Connect (PSC) service attachment of the
+       * read pool node.
+       * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscServiceAttachmentLink field is set. + */ + public boolean hasPscServiceAttachmentLink() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+       * Output only. The Private Service Connect (PSC) service attachment of the
+       * read pool node.
+       * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscServiceAttachmentLink. + */ + public java.lang.String getPscServiceAttachmentLink() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pscServiceAttachmentLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The Private Service Connect (PSC) service attachment of the
+       * read pool node.
+       * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for pscServiceAttachmentLink. + */ + public com.google.protobuf.ByteString getPscServiceAttachmentLinkBytes() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pscServiceAttachmentLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The Private Service Connect (PSC) service attachment of the
+       * read pool node.
+       * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The pscServiceAttachmentLink to set. + * @return This builder for chaining. + */ + public Builder setPscServiceAttachmentLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pscServiceAttachmentLink_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The Private Service Connect (PSC) service attachment of the
+       * read pool node.
+       * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearPscServiceAttachmentLink() { + pscServiceAttachmentLink_ = getDefaultInstance().getPscServiceAttachmentLink(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The Private Service Connect (PSC) service attachment of the
+       * read pool node.
+       * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for pscServiceAttachmentLink to set. + * @return This builder for chaining. + */ + public Builder setPscServiceAttachmentLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pscServiceAttachmentLink_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.util.List pscAutoConnections_ = + java.util.Collections.emptyList(); + + private void ensurePscAutoConnectionsIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + pscAutoConnections_ = + new java.util.ArrayList( + pscAutoConnections_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.PscAutoConnectionConfig, + com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder, + com.google.cloud.sql.v1.PscAutoConnectionConfigOrBuilder> + pscAutoConnectionsBuilder_; + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPscAutoConnectionsList() { + if (pscAutoConnectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pscAutoConnections_); + } else { + return pscAutoConnectionsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getPscAutoConnectionsCount() { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.size(); + } else { + return pscAutoConnectionsBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.PscAutoConnectionConfig getPscAutoConnections(int index) { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.get(index); + } else { + return pscAutoConnectionsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPscAutoConnections( + int index, com.google.cloud.sql.v1.PscAutoConnectionConfig value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.set(index, value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPscAutoConnections( + int index, com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.set(index, builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscAutoConnections(com.google.cloud.sql.v1.PscAutoConnectionConfig value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscAutoConnections( + int index, com.google.cloud.sql.v1.PscAutoConnectionConfig value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(index, value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscAutoConnections( + com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscAutoConnections( + int index, com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(index, builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPscAutoConnections() { + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + pscAutoConnectionsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removePscAutoConnections(int index) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.remove(index); + onChanged(); + } else { + pscAutoConnectionsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder getPscAutoConnectionsBuilder( + int index) { + return internalGetPscAutoConnectionsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.PscAutoConnectionConfigOrBuilder + getPscAutoConnectionsOrBuilder(int index) { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.get(index); + } else { + return pscAutoConnectionsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPscAutoConnectionsOrBuilderList() { + if (pscAutoConnectionsBuilder_ != null) { + return pscAutoConnectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pscAutoConnections_); + } + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder + addPscAutoConnectionsBuilder() { + return internalGetPscAutoConnectionsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.PscAutoConnectionConfig.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder addPscAutoConnectionsBuilder( + int index) { + return internalGetPscAutoConnectionsFieldBuilder() + .addBuilder( + index, com.google.cloud.sql.v1.PscAutoConnectionConfig.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPscAutoConnectionsBuilderList() { + return internalGetPscAutoConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.PscAutoConnectionConfig, + com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder, + com.google.cloud.sql.v1.PscAutoConnectionConfigOrBuilder> + internalGetPscAutoConnectionsFieldBuilder() { + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.PscAutoConnectionConfig, + com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder, + com.google.cloud.sql.v1.PscAutoConnectionConfigOrBuilder>( + pscAutoConnections_, + ((bitField0_ & 0x00000080) != 0), + getParentForChildren(), + isClean()); + pscAutoConnections_ = null; + } + return pscAutoConnectionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig) + private static final com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig(); + } + + public static com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PoolNodeConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#instance`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#instance`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 2; + private int state_ = 0; + + /** + * + * + *
+   * The current serving state of the Cloud SQL instance.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 2; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+   * The current serving state of the Cloud SQL instance.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 2; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState getState() { + com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState result = + com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState.forNumber(state_); + return result == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState.UNRECOGNIZED + : result; + } + + public static final int DATABASE_VERSION_FIELD_NUMBER = 3; + private int databaseVersion_ = 0; + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion` field cannot
+   * be changed after instance creation.
+   * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 3; + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion` field cannot
+   * be changed after instance creation.
+   * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 3; + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1.SqlDatabaseVersion result = + com.google.cloud.sql.v1.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + public static final int SETTINGS_FIELD_NUMBER = 4; + private com.google.cloud.sql.v1.Settings settings_; + + /** + * + * + *
+   * The user settings.
+   * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + * + * @return Whether the settings field is set. + */ + @java.lang.Override + public boolean hasSettings() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The user settings.
+   * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + * + * @return The settings. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Settings getSettings() { + return settings_ == null ? com.google.cloud.sql.v1.Settings.getDefaultInstance() : settings_; + } + + /** + * + * + *
+   * The user settings.
+   * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SettingsOrBuilder getSettingsOrBuilder() { + return settings_ == null ? com.google.cloud.sql.v1.Settings.getDefaultInstance() : settings_; + } + + public static final int ETAG_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API. Use the `settings.settingsVersion` field instead.
+   * 
+ * + * string etag = 5; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API. Use the `settings.settingsVersion` field instead.
+   * 
+ * + * string etag = 5; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FAILOVER_REPLICA_FIELD_NUMBER = 6; + private com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failoverReplica_; + + /** + * + * + *
+   * The name and status of the failover replica.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + * @return Whether the failoverReplica field is set. + */ + @java.lang.Override + public boolean hasFailoverReplica() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The name and status of the failover replica.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + * @return The failoverReplica. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica getFailoverReplica() { + return failoverReplica_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.getDefaultInstance() + : failoverReplica_; + } + + /** + * + * + *
+   * The name and status of the failover replica.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplicaOrBuilder + getFailoverReplicaOrBuilder() { + return failoverReplica_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.getDefaultInstance() + : failoverReplica_; + } + + public static final int MASTER_INSTANCE_NAME_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object masterInstanceName_ = ""; + + /** + * + * + *
+   * The name of the instance which will act as primary in the replication
+   * setup.
+   * 
+ * + * string master_instance_name = 7; + * + * @return The masterInstanceName. + */ + @java.lang.Override + public java.lang.String getMasterInstanceName() { + java.lang.Object ref = masterInstanceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + masterInstanceName_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the instance which will act as primary in the replication
+   * setup.
+   * 
+ * + * string master_instance_name = 7; + * + * @return The bytes for masterInstanceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMasterInstanceNameBytes() { + java.lang.Object ref = masterInstanceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + masterInstanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPLICA_NAMES_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList replicaNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @return A list containing the replicaNames. + */ + public com.google.protobuf.ProtocolStringList getReplicaNamesList() { + return replicaNames_; + } + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @return The count of replicaNames. + */ + public int getReplicaNamesCount() { + return replicaNames_.size(); + } + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @param index The index of the element to return. + * @return The replicaNames at the given index. + */ + public java.lang.String getReplicaNames(int index) { + return replicaNames_.get(index); + } + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @param index The index of the value to return. + * @return The bytes of the replicaNames at the given index. + */ + public com.google.protobuf.ByteString getReplicaNamesBytes(int index) { + return replicaNames_.getByteString(index); + } + + public static final int MAX_DISK_SIZE_FIELD_NUMBER = 9; + private com.google.protobuf.Int64Value maxDiskSize_; + + /** + * + * + *
+   * The maximum disk size of the instance in bytes.
+   * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.max_disk_size is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1573 + * @return Whether the maxDiskSize field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasMaxDiskSize() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The maximum disk size of the instance in bytes.
+   * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.max_disk_size is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1573 + * @return The maxDiskSize. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.Int64Value getMaxDiskSize() { + return maxDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : maxDiskSize_; + } + + /** + * + * + *
+   * The maximum disk size of the instance in bytes.
+   * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.Int64ValueOrBuilder getMaxDiskSizeOrBuilder() { + return maxDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : maxDiskSize_; + } + + public static final int CURRENT_DISK_SIZE_FIELD_NUMBER = 10; + private com.google.protobuf.Int64Value currentDiskSize_; + + /** + * + * + *
+   * The current disk usage of the instance in bytes. This property has been
+   * deprecated. Use the
+   * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+   * Monitoring API instead. Please see [this
+   * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+   * for details.
+   * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.current_disk_size is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1581 + * @return Whether the currentDiskSize field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasCurrentDiskSize() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * The current disk usage of the instance in bytes. This property has been
+   * deprecated. Use the
+   * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+   * Monitoring API instead. Please see [this
+   * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+   * for details.
+   * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.current_disk_size is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1581 + * @return The currentDiskSize. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.Int64Value getCurrentDiskSize() { + return currentDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : currentDiskSize_; + } + + /** + * + * + *
+   * The current disk usage of the instance in bytes. This property has been
+   * deprecated. Use the
+   * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+   * Monitoring API instead. Please see [this
+   * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+   * for details.
+   * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.Int64ValueOrBuilder getCurrentDiskSizeOrBuilder() { + return currentDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : currentDiskSize_; + } + + public static final int IP_ADDRESSES_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private java.util.List ipAddresses_; + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + @java.lang.Override + public java.util.List getIpAddressesList() { + return ipAddresses_; + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + @java.lang.Override + public java.util.List + getIpAddressesOrBuilderList() { + return ipAddresses_; + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + @java.lang.Override + public int getIpAddressesCount() { + return ipAddresses_.size(); + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpMapping getIpAddresses(int index) { + return ipAddresses_.get(index); + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + return ipAddresses_.get(index); + } + + public static final int SERVER_CA_CERT_FIELD_NUMBER = 12; + private com.google.cloud.sql.v1.SslCert serverCaCert_; + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + * + * @return Whether the serverCaCert field is set. + */ + @java.lang.Override + public boolean hasServerCaCert() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + * + * @return The serverCaCert. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCert getServerCaCert() { + return serverCaCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : serverCaCert_; + } + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertOrBuilder getServerCaCertOrBuilder() { + return serverCaCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : serverCaCert_; + } + + public static final int INSTANCE_TYPE_FIELD_NUMBER = 13; + private int instanceType_ = 0; + + /** + * + * + *
+   * The instance type.
+   * 
+ * + * .google.cloud.sql.v1.SqlInstanceType instance_type = 13; + * + * @return The enum numeric value on the wire for instanceType. + */ + @java.lang.Override + public int getInstanceTypeValue() { + return instanceType_; + } + + /** + * + * + *
+   * The instance type.
+   * 
+ * + * .google.cloud.sql.v1.SqlInstanceType instance_type = 13; + * + * @return The instanceType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstanceType getInstanceType() { + com.google.cloud.sql.v1.SqlInstanceType result = + com.google.cloud.sql.v1.SqlInstanceType.forNumber(instanceType_); + return result == null ? com.google.cloud.sql.v1.SqlInstanceType.UNRECOGNIZED : result; + } + + public static final int PROJECT_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL instance. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 14; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL instance. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 14; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IPV6_ADDRESS_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipv6Address_ = ""; + + /** + * + * + *
+   * The IPv6 address assigned to the instance.
+   * (Deprecated) This property was applicable only
+   * to First Generation instances.
+   * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1599 + * @return The ipv6Address. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getIpv6Address() { + java.lang.Object ref = ipv6Address_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipv6Address_ = s; + return s; + } + } + + /** + * + * + *
+   * The IPv6 address assigned to the instance.
+   * (Deprecated) This property was applicable only
+   * to First Generation instances.
+   * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1599 + * @return The bytes for ipv6Address. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getIpv6AddressBytes() { + java.lang.Object ref = ipv6Address_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipv6Address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_EMAIL_ADDRESS_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceAccountEmailAddress_ = ""; + + /** + * + * + *
+   * The service account email address assigned to the instance.\This
+   * property is read-only.
+   * 
+ * + * string service_account_email_address = 16; + * + * @return The serviceAccountEmailAddress. + */ + @java.lang.Override + public java.lang.String getServiceAccountEmailAddress() { + java.lang.Object ref = serviceAccountEmailAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmailAddress_ = s; + return s; + } + } + + /** + * + * + *
+   * The service account email address assigned to the instance.\This
+   * property is read-only.
+   * 
+ * + * string service_account_email_address = 16; + * + * @return The bytes for serviceAccountEmailAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountEmailAddressBytes() { + java.lang.Object ref = serviceAccountEmailAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmailAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ON_PREMISES_CONFIGURATION_FIELD_NUMBER = 17; + private com.google.cloud.sql.v1.OnPremisesConfiguration onPremisesConfiguration_; + + /** + * + * + *
+   * Configuration specific to on-premises instances.
+   * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + * + * @return Whether the onPremisesConfiguration field is set. + */ + @java.lang.Override + public boolean hasOnPremisesConfiguration() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Configuration specific to on-premises instances.
+   * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + * + * @return The onPremisesConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1.OnPremisesConfiguration getOnPremisesConfiguration() { + return onPremisesConfiguration_ == null + ? com.google.cloud.sql.v1.OnPremisesConfiguration.getDefaultInstance() + : onPremisesConfiguration_; + } + + /** + * + * + *
+   * Configuration specific to on-premises instances.
+   * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + */ + @java.lang.Override + public com.google.cloud.sql.v1.OnPremisesConfigurationOrBuilder + getOnPremisesConfigurationOrBuilder() { + return onPremisesConfiguration_ == null + ? com.google.cloud.sql.v1.OnPremisesConfiguration.getDefaultInstance() + : onPremisesConfiguration_; + } + + public static final int REPLICA_CONFIGURATION_FIELD_NUMBER = 18; + private com.google.cloud.sql.v1.ReplicaConfiguration replicaConfiguration_; + + /** + * + * + *
+   * Configuration specific to failover replicas and read replicas.
+   * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + * + * @return Whether the replicaConfiguration field is set. + */ + @java.lang.Override + public boolean hasReplicaConfiguration() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Configuration specific to failover replicas and read replicas.
+   * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + * + * @return The replicaConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ReplicaConfiguration getReplicaConfiguration() { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1.ReplicaConfiguration.getDefaultInstance() + : replicaConfiguration_; + } + + /** + * + * + *
+   * Configuration specific to failover replicas and read replicas.
+   * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ReplicaConfigurationOrBuilder getReplicaConfigurationOrBuilder() { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1.ReplicaConfiguration.getDefaultInstance() + : replicaConfiguration_; + } + + public static final int BACKEND_TYPE_FIELD_NUMBER = 19; + private int backendType_ = 0; + + /** + * + * + *
+   * The backend type.
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   *
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 19; + * + * @return The enum numeric value on the wire for backendType. + */ + @java.lang.Override + public int getBackendTypeValue() { + return backendType_; + } + + /** + * + * + *
+   * The backend type.
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   *
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 19; + * + * @return The backendType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackendType getBackendType() { + com.google.cloud.sql.v1.SqlBackendType result = + com.google.cloud.sql.v1.SqlBackendType.forNumber(backendType_); + return result == null ? com.google.cloud.sql.v1.SqlBackendType.UNRECOGNIZED : result; + } + + public static final int SELF_LINK_FIELD_NUMBER = 20; + + @SuppressWarnings("serial") + private volatile java.lang.Object selfLink_ = ""; + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 20; + * + * @return The selfLink. + */ + @java.lang.Override + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } + } + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 20; + * + * @return The bytes for selfLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUSPENSION_REASON_FIELD_NUMBER = 21; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList suspensionReason_ = emptyIntList(); + + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.cloud.sql.v1.SqlSuspensionReason> + suspensionReason_converter_ = + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.cloud.sql.v1.SqlSuspensionReason>() { + public com.google.cloud.sql.v1.SqlSuspensionReason convert(int from) { + com.google.cloud.sql.v1.SqlSuspensionReason result = + com.google.cloud.sql.v1.SqlSuspensionReason.forNumber(from); + return result == null + ? com.google.cloud.sql.v1.SqlSuspensionReason.UNRECOGNIZED + : result; + } + }; + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @return A list containing the suspensionReason. + */ + @java.lang.Override + public java.util.List getSuspensionReasonList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.cloud.sql.v1.SqlSuspensionReason>( + suspensionReason_, suspensionReason_converter_); + } + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @return The count of suspensionReason. + */ + @java.lang.Override + public int getSuspensionReasonCount() { + return suspensionReason_.size(); + } + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index of the element to return. + * @return The suspensionReason at the given index. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlSuspensionReason getSuspensionReason(int index) { + return suspensionReason_converter_.convert(suspensionReason_.getInt(index)); + } + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @return A list containing the enum numeric values on the wire for suspensionReason. + */ + @java.lang.Override + public java.util.List getSuspensionReasonValueList() { + return suspensionReason_; + } + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of suspensionReason at the given index. + */ + @java.lang.Override + public int getSuspensionReasonValue(int index) { + return suspensionReason_.getInt(index); + } + + private int suspensionReasonMemoizedSerializedSize; + + public static final int CONNECTION_NAME_FIELD_NUMBER = 22; + + @SuppressWarnings("serial") + private volatile java.lang.Object connectionName_ = ""; + + /** + * + * + *
+   * Connection name of the Cloud SQL instance used in connection strings.
+   * 
+ * + * string connection_name = 22; + * + * @return The connectionName. + */ + @java.lang.Override + public java.lang.String getConnectionName() { + java.lang.Object ref = connectionName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionName_ = s; + return s; + } + } + + /** + * + * + *
+   * Connection name of the Cloud SQL instance used in connection strings.
+   * 
+ * + * string connection_name = 22; + * + * @return The bytes for connectionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConnectionNameBytes() { + java.lang.Object ref = connectionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 23; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string name = 23; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string name = 23; + * + * @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 REGION_FIELD_NUMBER = 24; + + @SuppressWarnings("serial") + private volatile java.lang.Object region_ = ""; + + /** + * + * + *
+   * The geographical region of the Cloud SQL instance.
+   *
+   * It can be one of the
+   * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+   * where Cloud SQL operates:
+   *
+   * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+   * The default value is `us-central1`.
+   * 
+ * + * string region = 24; + * + * @return The region. + */ + @java.lang.Override + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } + } + + /** + * + * + *
+   * The geographical region of the Cloud SQL instance.
+   *
+   * It can be one of the
+   * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+   * where Cloud SQL operates:
+   *
+   * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+   * The default value is `us-central1`.
+   * 
+ * + * string region = 24; + * + * @return The bytes for region. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GCE_ZONE_FIELD_NUMBER = 25; + + @SuppressWarnings("serial") + private volatile java.lang.Object gceZone_ = ""; + + /** + * + * + *
+   * The Compute Engine zone that the instance is currently serving from. This
+   * value could be different from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary zone. WARNING:
+   * Changing this might restart the instance.
+   * 
+ * + * string gce_zone = 25; + * + * @return The gceZone. + */ + @java.lang.Override + public java.lang.String getGceZone() { + java.lang.Object ref = gceZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gceZone_ = s; + return s; + } + } + + /** + * + * + *
+   * The Compute Engine zone that the instance is currently serving from. This
+   * value could be different from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary zone. WARNING:
+   * Changing this might restart the instance.
+   * 
+ * + * string gce_zone = 25; + * + * @return The bytes for gceZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGceZoneBytes() { + java.lang.Object ref = gceZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SECONDARY_GCE_ZONE_FIELD_NUMBER = 34; + + @SuppressWarnings("serial") + private volatile java.lang.Object secondaryGceZone_ = ""; + + /** + * + * + *
+   * The Compute Engine zone that the failover instance is currently serving
+   * from for a regional instance. This value could be different
+   * from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary/failover zone.
+   * 
+ * + * string secondary_gce_zone = 34; + * + * @return The secondaryGceZone. + */ + @java.lang.Override + public java.lang.String getSecondaryGceZone() { + java.lang.Object ref = secondaryGceZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secondaryGceZone_ = s; + return s; + } + } + + /** + * + * + *
+   * The Compute Engine zone that the failover instance is currently serving
+   * from for a regional instance. This value could be different
+   * from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary/failover zone.
+   * 
+ * + * string secondary_gce_zone = 34; + * + * @return The bytes for secondaryGceZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSecondaryGceZoneBytes() { + java.lang.Object ref = secondaryGceZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secondaryGceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISK_ENCRYPTION_CONFIGURATION_FIELD_NUMBER = 26; + private com.google.cloud.sql.v1.DiskEncryptionConfiguration diskEncryptionConfiguration_; + + /** + * + * + *
+   * Disk encryption configuration specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + * + * @return Whether the diskEncryptionConfiguration field is set. + */ + @java.lang.Override + public boolean hasDiskEncryptionConfiguration() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * Disk encryption configuration specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + * + * @return The diskEncryptionConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionConfiguration getDiskEncryptionConfiguration() { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } + + /** + * + * + *
+   * Disk encryption configuration specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionConfigurationOrBuilder + getDiskEncryptionConfigurationOrBuilder() { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } + + public static final int DISK_ENCRYPTION_STATUS_FIELD_NUMBER = 27; + private com.google.cloud.sql.v1.DiskEncryptionStatus diskEncryptionStatus_; + + /** + * + * + *
+   * Disk encryption status specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + * + * @return Whether the diskEncryptionStatus field is set. + */ + @java.lang.Override + public boolean hasDiskEncryptionStatus() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+   * Disk encryption status specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + * + * @return The diskEncryptionStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionStatus getDiskEncryptionStatus() { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } + + /** + * + * + *
+   * Disk encryption status specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + */ + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionStatusOrBuilder getDiskEncryptionStatusOrBuilder() { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } + + public static final int ROOT_PASSWORD_FIELD_NUMBER = 29; + + @SuppressWarnings("serial") + private volatile java.lang.Object rootPassword_ = ""; + + /** + * + * + *
+   * Initial root password. Use only on creation. You must set root passwords
+   * before you can connect to PostgreSQL instances.
+   * 
+ * + * string root_password = 29; + * + * @return The rootPassword. + */ + @java.lang.Override + public java.lang.String getRootPassword() { + java.lang.Object ref = rootPassword_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rootPassword_ = s; + return s; + } + } + + /** + * + * + *
+   * Initial root password. Use only on creation. You must set root passwords
+   * before you can connect to PostgreSQL instances.
+   * 
+ * + * string root_password = 29; + * + * @return The bytes for rootPassword. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRootPasswordBytes() { + java.lang.Object ref = rootPassword_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rootPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCHEDULED_MAINTENANCE_FIELD_NUMBER = 30; + private com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduledMaintenance_; + + /** + * + * + *
+   * The start time of any upcoming scheduled maintenance for this instance.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + * + * @return Whether the scheduledMaintenance field is set. + */ + @java.lang.Override + public boolean hasScheduledMaintenance() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+   * The start time of any upcoming scheduled maintenance for this instance.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + * + * @return The scheduledMaintenance. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance + getScheduledMaintenance() { + return scheduledMaintenance_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.getDefaultInstance() + : scheduledMaintenance_; + } + + /** + * + * + *
+   * The start time of any upcoming scheduled maintenance for this instance.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenanceOrBuilder + getScheduledMaintenanceOrBuilder() { + return scheduledMaintenance_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.getDefaultInstance() + : scheduledMaintenance_; + } + + public static final int SATISFIES_PZS_FIELD_NUMBER = 35; + private com.google.protobuf.BoolValue satisfiesPzs_; + + /** + * + * + *
+   * This status indicates whether the instance satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + * + * @return Whether the satisfiesPzs field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzs() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+   * This status indicates whether the instance satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSatisfiesPzs() { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + + /** + * + * + *
+   * This status indicates whether the instance satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + + public static final int DATABASE_INSTALLED_VERSION_FIELD_NUMBER = 40; + + @SuppressWarnings("serial") + private volatile java.lang.Object databaseInstalledVersion_ = ""; + + /** + * + * + *
+   * Output only. Stores the current database version running on the instance
+   * including minor version such as `MYSQL_8_0_18`.
+   * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseInstalledVersion. + */ + @java.lang.Override + public java.lang.String getDatabaseInstalledVersion() { + java.lang.Object ref = databaseInstalledVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + databaseInstalledVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. Stores the current database version running on the instance
+   * including minor version such as `MYSQL_8_0_18`.
+   * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for databaseInstalledVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseInstalledVersionBytes() { + java.lang.Object ref = databaseInstalledVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + databaseInstalledVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OUT_OF_DISK_REPORT_FIELD_NUMBER = 38; + private com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport outOfDiskReport_; + + /** + * + * + *
+   * This field represents the report generated by the proactive database
+   * wellness job for OutOfDisk issues.
+   * *  Writers:
+   * *  the proactive database wellness job for OOD.
+   * *  Readers:
+   * *  the proactive database wellness job
+   * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + * + * @return Whether the outOfDiskReport field is set. + */ + @java.lang.Override + public boolean hasOutOfDiskReport() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+   * This field represents the report generated by the proactive database
+   * wellness job for OutOfDisk issues.
+   * *  Writers:
+   * *  the proactive database wellness job for OOD.
+   * *  Readers:
+   * *  the proactive database wellness job
+   * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + * + * @return The outOfDiskReport. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport getOutOfDiskReport() { + return outOfDiskReport_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.getDefaultInstance() + : outOfDiskReport_; + } + + /** + * + * + *
+   * This field represents the report generated by the proactive database
+   * wellness job for OutOfDisk issues.
+   * *  Writers:
+   * *  the proactive database wellness job for OOD.
+   * *  Readers:
+   * *  the proactive database wellness job
+   * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReportOrBuilder + getOutOfDiskReportOrBuilder() { + return outOfDiskReport_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.getDefaultInstance() + : outOfDiskReport_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 39; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * Output only. The time when the instance was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00001000) != 0); + } + + /** + * + * + *
+   * Output only. The time when the instance was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * Output only. The time when the instance was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 39 [(.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 AVAILABLE_MAINTENANCE_VERSIONS_FIELD_NUMBER = 41; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList availableMaintenanceVersions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the availableMaintenanceVersions. + */ + public com.google.protobuf.ProtocolStringList getAvailableMaintenanceVersionsList() { + return availableMaintenanceVersions_; + } + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of availableMaintenanceVersions. + */ + public int getAvailableMaintenanceVersionsCount() { + return availableMaintenanceVersions_.size(); + } + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The availableMaintenanceVersions at the given index. + */ + public java.lang.String getAvailableMaintenanceVersions(int index) { + return availableMaintenanceVersions_.get(index); + } + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the availableMaintenanceVersions at the given index. + */ + public com.google.protobuf.ByteString getAvailableMaintenanceVersionsBytes(int index) { + return availableMaintenanceVersions_.getByteString(index); + } + + public static final int MAINTENANCE_VERSION_FIELD_NUMBER = 42; + + @SuppressWarnings("serial") + private volatile java.lang.Object maintenanceVersion_ = ""; + + /** + * + * + *
+   * The current software version on the instance.
+   * 
+ * + * string maintenance_version = 42; + * + * @return The maintenanceVersion. + */ + @java.lang.Override + public java.lang.String getMaintenanceVersion() { + java.lang.Object ref = maintenanceVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + maintenanceVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * The current software version on the instance.
+   * 
+ * + * string maintenance_version = 42; + * + * @return The bytes for maintenanceVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMaintenanceVersionBytes() { + java.lang.Object ref = maintenanceVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + maintenanceVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UPGRADABLE_DATABASE_VERSIONS_FIELD_NUMBER = 45; + + @SuppressWarnings("serial") + private java.util.List + upgradableDatabaseVersions_; + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getUpgradableDatabaseVersionsList() { + return upgradableDatabaseVersions_; + } + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getUpgradableDatabaseVersionsOrBuilderList() { + return upgradableDatabaseVersions_; + } + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getUpgradableDatabaseVersionsCount() { + return upgradableDatabaseVersions_.size(); + } + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.AvailableDatabaseVersion getUpgradableDatabaseVersions(int index) { + return upgradableDatabaseVersions_.get(index); + } + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.AvailableDatabaseVersionOrBuilder + getUpgradableDatabaseVersionsOrBuilder(int index) { + return upgradableDatabaseVersions_.get(index); + } + + public static final int SQL_NETWORK_ARCHITECTURE_FIELD_NUMBER = 47; + private int sqlNetworkArchitecture_ = 0; + + /** + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return Whether the sqlNetworkArchitecture field is set. + */ + @java.lang.Override + public boolean hasSqlNetworkArchitecture() { + return ((bitField0_ & 0x00002000) != 0); + } + + /** + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return The enum numeric value on the wire for sqlNetworkArchitecture. + */ + @java.lang.Override + public int getSqlNetworkArchitectureValue() { + return sqlNetworkArchitecture_; + } + + /** + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return The sqlNetworkArchitecture. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture + getSqlNetworkArchitecture() { + com.google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture result = + com.google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture.forNumber( + sqlNetworkArchitecture_); + return result == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture.UNRECOGNIZED + : result; + } + + public static final int PSC_SERVICE_ATTACHMENT_LINK_FIELD_NUMBER = 48; + + @SuppressWarnings("serial") + private volatile java.lang.Object pscServiceAttachmentLink_ = ""; + + /** + * + * + *
+   * Output only. The link to service attachment of PSC instance.
+   * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscServiceAttachmentLink field is set. + */ + @java.lang.Override + public boolean hasPscServiceAttachmentLink() { + return ((bitField0_ & 0x00004000) != 0); + } + + /** + * + * + *
+   * Output only. The link to service attachment of PSC instance.
+   * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscServiceAttachmentLink. + */ + @java.lang.Override + public java.lang.String getPscServiceAttachmentLink() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pscServiceAttachmentLink_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The link to service attachment of PSC instance.
+   * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for pscServiceAttachmentLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPscServiceAttachmentLinkBytes() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pscServiceAttachmentLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DNS_NAME_FIELD_NUMBER = 49; + + @SuppressWarnings("serial") + private volatile java.lang.Object dnsName_ = ""; + + /** + * + * + *
+   * Output only. The dns name of the instance.
+   * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + @java.lang.Override + public boolean hasDnsName() { + return ((bitField0_ & 0x00008000) != 0); + } + + /** + * + * + *
+   * Output only. The dns name of the instance.
+   * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + @java.lang.Override + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The dns name of the instance.
+   * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIMARY_DNS_NAME_FIELD_NUMBER = 51; + + @SuppressWarnings("serial") + private volatile java.lang.Object primaryDnsName_ = ""; + + /** + * + * + *
+   * Output only. DEPRECATED: please use write_endpoint instead.
+   * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1711 + * @return Whether the primaryDnsName field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasPrimaryDnsName() { + return ((bitField0_ & 0x00010000) != 0); + } + + /** + * + * + *
+   * Output only. DEPRECATED: please use write_endpoint instead.
+   * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1711 + * @return The primaryDnsName. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getPrimaryDnsName() { + java.lang.Object ref = primaryDnsName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryDnsName_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. DEPRECATED: please use write_endpoint instead.
+   * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1711 + * @return The bytes for primaryDnsName. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getPrimaryDnsNameBytes() { + java.lang.Object ref = primaryDnsName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryDnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WRITE_ENDPOINT_FIELD_NUMBER = 52; + + @SuppressWarnings("serial") + private volatile java.lang.Object writeEndpoint_ = ""; + + /** + * + * + *
+   * Output only. The dns name of the primary instance in a replication group.
+   * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the writeEndpoint field is set. + */ + @java.lang.Override + public boolean hasWriteEndpoint() { + return ((bitField0_ & 0x00020000) != 0); + } + + /** + * + * + *
+   * Output only. The dns name of the primary instance in a replication group.
+   * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The writeEndpoint. + */ + @java.lang.Override + public java.lang.String getWriteEndpoint() { + java.lang.Object ref = writeEndpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + writeEndpoint_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The dns name of the primary instance in a replication group.
+   * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for writeEndpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWriteEndpointBytes() { + java.lang.Object ref = writeEndpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + writeEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPLICATION_CLUSTER_FIELD_NUMBER = 54; + private com.google.cloud.sql.v1.ReplicationCluster replicationCluster_; + + /** + * + * + *
+   * Optional. A primary instance and disaster recovery (DR) replica pair.
+   * A DR replica is a cross-region replica that you designate
+   * for failover in the event that the primary instance
+   * experiences regional failure.
+   * Applicable to MySQL and PostgreSQL.
+   * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the replicationCluster field is set. + */ + @java.lang.Override + public boolean hasReplicationCluster() { + return ((bitField0_ & 0x00040000) != 0); + } + + /** + * + * + *
+   * Optional. A primary instance and disaster recovery (DR) replica pair.
+   * A DR replica is a cross-region replica that you designate
+   * for failover in the event that the primary instance
+   * experiences regional failure.
+   * Applicable to MySQL and PostgreSQL.
+   * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The replicationCluster. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ReplicationCluster getReplicationCluster() { + return replicationCluster_ == null + ? com.google.cloud.sql.v1.ReplicationCluster.getDefaultInstance() + : replicationCluster_; + } + + /** + * + * + *
+   * Optional. A primary instance and disaster recovery (DR) replica pair.
+   * A DR replica is a cross-region replica that you designate
+   * for failover in the event that the primary instance
+   * experiences regional failure.
+   * Applicable to MySQL and PostgreSQL.
+   * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ReplicationClusterOrBuilder getReplicationClusterOrBuilder() { + return replicationCluster_ == null + ? com.google.cloud.sql.v1.ReplicationCluster.getDefaultInstance() + : replicationCluster_; + } + + public static final int GEMINI_CONFIG_FIELD_NUMBER = 55; + private com.google.cloud.sql.v1.GeminiInstanceConfig geminiConfig_; + + /** + * + * + *
+   * Gemini instance configuration.
+   * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + * + * @return Whether the geminiConfig field is set. + */ + @java.lang.Override + public boolean hasGeminiConfig() { + return ((bitField0_ & 0x00080000) != 0); + } + + /** + * + * + *
+   * Gemini instance configuration.
+   * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + * + * @return The geminiConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.GeminiInstanceConfig getGeminiConfig() { + return geminiConfig_ == null + ? com.google.cloud.sql.v1.GeminiInstanceConfig.getDefaultInstance() + : geminiConfig_; + } + + /** + * + * + *
+   * Gemini instance configuration.
+   * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + */ + @java.lang.Override + public com.google.cloud.sql.v1.GeminiInstanceConfigOrBuilder getGeminiConfigOrBuilder() { + return geminiConfig_ == null + ? com.google.cloud.sql.v1.GeminiInstanceConfig.getDefaultInstance() + : geminiConfig_; + } + + public static final int SATISFIES_PZI_FIELD_NUMBER = 56; + private com.google.protobuf.BoolValue satisfiesPzi_; + + /** + * + * + *
+   * Output only. This status indicates whether the instance satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzi field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzi() { + return ((bitField0_ & 0x00100000) != 0); + } + + /** + * + * + *
+   * Output only. This status indicates whether the instance satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzi. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSatisfiesPzi() { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } + + /** + * + * + *
+   * Output only. This status indicates whether the instance satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPziOrBuilder() { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } + + public static final int SWITCH_TRANSACTION_LOGS_TO_CLOUD_STORAGE_ENABLED_FIELD_NUMBER = 57; + private com.google.protobuf.BoolValue switchTransactionLogsToCloudStorageEnabled_; + + /** + * + * + *
+   * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+   * recovery log files from a data disk to Cloud Storage.
+   * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the switchTransactionLogsToCloudStorageEnabled field is set. + */ + @java.lang.Override + public boolean hasSwitchTransactionLogsToCloudStorageEnabled() { + return ((bitField0_ & 0x00200000) != 0); + } + + /** + * + * + *
+   * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+   * recovery log files from a data disk to Cloud Storage.
+   * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The switchTransactionLogsToCloudStorageEnabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSwitchTransactionLogsToCloudStorageEnabled() { + return switchTransactionLogsToCloudStorageEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : switchTransactionLogsToCloudStorageEnabled_; + } + + /** + * + * + *
+   * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+   * recovery log files from a data disk to Cloud Storage.
+   * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder + getSwitchTransactionLogsToCloudStorageEnabledOrBuilder() { + return switchTransactionLogsToCloudStorageEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : switchTransactionLogsToCloudStorageEnabled_; + } + + public static final int INCLUDE_REPLICAS_FOR_MAJOR_VERSION_UPGRADE_FIELD_NUMBER = 59; + private com.google.protobuf.BoolValue includeReplicasForMajorVersionUpgrade_; + + /** + * + * + *
+   * Input only. Determines whether an in-place major version upgrade of
+   * replicas happens when an in-place major version upgrade of a primary
+   * instance is initiated.
+   * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the includeReplicasForMajorVersionUpgrade field is set. + */ + @java.lang.Override + public boolean hasIncludeReplicasForMajorVersionUpgrade() { + return ((bitField0_ & 0x00400000) != 0); + } + + /** + * + * + *
+   * Input only. Determines whether an in-place major version upgrade of
+   * replicas happens when an in-place major version upgrade of a primary
+   * instance is initiated.
+   * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The includeReplicasForMajorVersionUpgrade. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getIncludeReplicasForMajorVersionUpgrade() { + return includeReplicasForMajorVersionUpgrade_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : includeReplicasForMajorVersionUpgrade_; + } + + /** + * + * + *
+   * Input only. Determines whether an in-place major version upgrade of
+   * replicas happens when an in-place major version upgrade of a primary
+   * instance is initiated.
+   * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder + getIncludeReplicasForMajorVersionUpgradeOrBuilder() { + return includeReplicasForMajorVersionUpgrade_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : includeReplicasForMajorVersionUpgrade_; + } + + public static final int TAGS_FIELD_NUMBER = 60; + + private static final class TagsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_TagsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField tags_; + + private com.google.protobuf.MapField internalGetTags() { + if (tags_ == null) { + return com.google.protobuf.MapField.emptyMapField(TagsDefaultEntryHolder.defaultEntry); + } + return tags_; + } + + public int getTagsCount() { + return internalGetTags().getMap().size(); + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTags().getMap().containsKey(key); + } + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTags() { + return getTagsMap(); + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getTagsMap() { + return internalGetTags().getMap(); + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getTagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NODE_COUNT_FIELD_NUMBER = 63; + private int nodeCount_ = 0; + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return Whether the nodeCount field is set. + */ + @java.lang.Override + public boolean hasNodeCount() { + return ((bitField0_ & 0x00800000) != 0); + } + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + + public static final int NODES_FIELD_NUMBER = 64; + + @SuppressWarnings("serial") + private java.util.List nodes_; + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getNodesList() { + return nodes_; + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getNodesOrBuilderList() { + return nodes_; + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getNodesCount() { + return nodes_.size(); + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig getNodes(int index) { + return nodes_.get(index); + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfigOrBuilder getNodesOrBuilder( + int index) { + return nodes_.get(index); + } + + public static final int DNS_NAMES_FIELD_NUMBER = 67; + + @SuppressWarnings("serial") + private java.util.List dnsNames_; + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getDnsNamesList() { + return dnsNames_; + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDnsNamesOrBuilderList() { + return dnsNames_; + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getDnsNamesCount() { + return dnsNames_.size(); + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMapping getDnsNames(int index) { + return dnsNames_.get(index); + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + return dnsNames_.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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (state_ + != com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState.SQL_INSTANCE_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, state_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, databaseVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getSettings()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, etag_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getFailoverReplica()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(masterInstanceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, masterInstanceName_); + } + for (int i = 0; i < replicaNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, replicaNames_.getRaw(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(9, getMaxDiskSize()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(10, getCurrentDiskSize()); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + output.writeMessage(11, ipAddresses_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(12, getServerCaCert()); + } + if (instanceType_ + != com.google.cloud.sql.v1.SqlInstanceType.SQL_INSTANCE_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(13, instanceType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 14, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(ipv6Address_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 15, ipv6Address_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceAccountEmailAddress_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 16, serviceAccountEmailAddress_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(17, getOnPremisesConfiguration()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(18, getReplicaConfiguration()); + } + if (backendType_ + != com.google.cloud.sql.v1.SqlBackendType.SQL_BACKEND_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(19, backendType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 20, selfLink_); + } + if (getSuspensionReasonList().size() > 0) { + output.writeUInt32NoTag(170); + output.writeUInt32NoTag(suspensionReasonMemoizedSerializedSize); + } + for (int i = 0; i < suspensionReason_.size(); i++) { + output.writeEnumNoTag(suspensionReason_.getInt(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(connectionName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 22, connectionName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 23, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 24, region_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(gceZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 25, gceZone_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(26, getDiskEncryptionConfiguration()); + } + if (((bitField0_ & 0x00000100) != 0)) { + output.writeMessage(27, getDiskEncryptionStatus()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(rootPassword_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 29, rootPassword_); + } + if (((bitField0_ & 0x00000200) != 0)) { + output.writeMessage(30, getScheduledMaintenance()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(secondaryGceZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 34, secondaryGceZone_); + } + if (((bitField0_ & 0x00000400) != 0)) { + output.writeMessage(35, getSatisfiesPzs()); + } + if (((bitField0_ & 0x00000800) != 0)) { + output.writeMessage(38, getOutOfDiskReport()); + } + if (((bitField0_ & 0x00001000) != 0)) { + output.writeMessage(39, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(databaseInstalledVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 40, databaseInstalledVersion_); + } + for (int i = 0; i < availableMaintenanceVersions_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 41, availableMaintenanceVersions_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(maintenanceVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 42, maintenanceVersion_); + } + for (int i = 0; i < upgradableDatabaseVersions_.size(); i++) { + output.writeMessage(45, upgradableDatabaseVersions_.get(i)); + } + if (((bitField0_ & 0x00002000) != 0)) { + output.writeEnum(47, sqlNetworkArchitecture_); + } + if (((bitField0_ & 0x00004000) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 48, pscServiceAttachmentLink_); + } + if (((bitField0_ & 0x00008000) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 49, dnsName_); + } + if (((bitField0_ & 0x00010000) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 51, primaryDnsName_); + } + if (((bitField0_ & 0x00020000) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 52, writeEndpoint_); + } + if (((bitField0_ & 0x00040000) != 0)) { + output.writeMessage(54, getReplicationCluster()); + } + if (((bitField0_ & 0x00080000) != 0)) { + output.writeMessage(55, getGeminiConfig()); + } + if (((bitField0_ & 0x00100000) != 0)) { + output.writeMessage(56, getSatisfiesPzi()); + } + if (((bitField0_ & 0x00200000) != 0)) { + output.writeMessage(57, getSwitchTransactionLogsToCloudStorageEnabled()); + } + if (((bitField0_ & 0x00400000) != 0)) { + output.writeMessage(59, getIncludeReplicasForMajorVersionUpgrade()); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetTags(), TagsDefaultEntryHolder.defaultEntry, 60); + if (((bitField0_ & 0x00800000) != 0)) { + output.writeInt32(63, nodeCount_); + } + for (int i = 0; i < nodes_.size(); i++) { + output.writeMessage(64, nodes_.get(i)); + } + for (int i = 0; i < dnsNames_.size(); i++) { + output.writeMessage(67, dnsNames_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (state_ + != com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState.SQL_INSTANCE_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, state_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, databaseVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getSettings()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, etag_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getFailoverReplica()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(masterInstanceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, masterInstanceName_); + } + { + int dataSize = 0; + for (int i = 0; i < replicaNames_.size(); i++) { + dataSize += computeStringSizeNoTag(replicaNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getReplicaNamesList().size(); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getMaxDiskSize()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getCurrentDiskSize()); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, ipAddresses_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getServerCaCert()); + } + if (instanceType_ + != com.google.cloud.sql.v1.SqlInstanceType.SQL_INSTANCE_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, instanceType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(14, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(ipv6Address_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(15, ipv6Address_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceAccountEmailAddress_)) { + size += + com.google.protobuf.GeneratedMessage.computeStringSize(16, serviceAccountEmailAddress_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 17, getOnPremisesConfiguration()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(18, getReplicaConfiguration()); + } + if (backendType_ + != com.google.cloud.sql.v1.SqlBackendType.SQL_BACKEND_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(19, backendType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(20, selfLink_); + } + { + int dataSize = 0; + for (int i = 0; i < suspensionReason_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(suspensionReason_.getInt(i)); + } + size += dataSize; + if (!getSuspensionReasonList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + suspensionReasonMemoizedSerializedSize = dataSize; + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(connectionName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(22, connectionName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(23, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(24, region_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(gceZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(25, gceZone_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 26, getDiskEncryptionConfiguration()); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(27, getDiskEncryptionStatus()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(rootPassword_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(29, rootPassword_); + } + if (((bitField0_ & 0x00000200) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(30, getScheduledMaintenance()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(secondaryGceZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(34, secondaryGceZone_); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(35, getSatisfiesPzs()); + } + if (((bitField0_ & 0x00000800) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(38, getOutOfDiskReport()); + } + if (((bitField0_ & 0x00001000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(39, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(databaseInstalledVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(40, databaseInstalledVersion_); + } + { + int dataSize = 0; + for (int i = 0; i < availableMaintenanceVersions_.size(); i++) { + dataSize += computeStringSizeNoTag(availableMaintenanceVersions_.getRaw(i)); + } + size += dataSize; + size += 2 * getAvailableMaintenanceVersionsList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(maintenanceVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(42, maintenanceVersion_); + } + for (int i = 0; i < upgradableDatabaseVersions_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 45, upgradableDatabaseVersions_.get(i)); + } + if (((bitField0_ & 0x00002000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(47, sqlNetworkArchitecture_); + } + if (((bitField0_ & 0x00004000) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(48, pscServiceAttachmentLink_); + } + if (((bitField0_ & 0x00008000) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(49, dnsName_); + } + if (((bitField0_ & 0x00010000) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(51, primaryDnsName_); + } + if (((bitField0_ & 0x00020000) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(52, writeEndpoint_); + } + if (((bitField0_ & 0x00040000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(54, getReplicationCluster()); + } + if (((bitField0_ & 0x00080000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(55, getGeminiConfig()); + } + if (((bitField0_ & 0x00100000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(56, getSatisfiesPzi()); + } + if (((bitField0_ & 0x00200000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 57, getSwitchTransactionLogsToCloudStorageEnabled()); + } + if (((bitField0_ & 0x00400000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 59, getIncludeReplicasForMajorVersionUpgrade()); + } + for (java.util.Map.Entry entry : + internalGetTags().getMap().entrySet()) { + com.google.protobuf.MapEntry tags__ = + TagsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(60, tags__); + } + if (((bitField0_ & 0x00800000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(63, nodeCount_); + } + for (int i = 0; i < nodes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(64, nodes_.get(i)); + } + for (int i = 0; i < dnsNames_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(67, dnsNames_.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.sql.v1.DatabaseInstance)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DatabaseInstance other = (com.google.cloud.sql.v1.DatabaseInstance) obj; + + if (!getKind().equals(other.getKind())) return false; + if (state_ != other.state_) return false; + if (databaseVersion_ != other.databaseVersion_) return false; + if (hasSettings() != other.hasSettings()) return false; + if (hasSettings()) { + if (!getSettings().equals(other.getSettings())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (hasFailoverReplica() != other.hasFailoverReplica()) return false; + if (hasFailoverReplica()) { + if (!getFailoverReplica().equals(other.getFailoverReplica())) return false; + } + if (!getMasterInstanceName().equals(other.getMasterInstanceName())) return false; + if (!getReplicaNamesList().equals(other.getReplicaNamesList())) return false; + if (hasMaxDiskSize() != other.hasMaxDiskSize()) return false; + if (hasMaxDiskSize()) { + if (!getMaxDiskSize().equals(other.getMaxDiskSize())) return false; + } + if (hasCurrentDiskSize() != other.hasCurrentDiskSize()) return false; + if (hasCurrentDiskSize()) { + if (!getCurrentDiskSize().equals(other.getCurrentDiskSize())) return false; + } + if (!getIpAddressesList().equals(other.getIpAddressesList())) return false; + if (hasServerCaCert() != other.hasServerCaCert()) return false; + if (hasServerCaCert()) { + if (!getServerCaCert().equals(other.getServerCaCert())) return false; + } + if (instanceType_ != other.instanceType_) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getIpv6Address().equals(other.getIpv6Address())) return false; + if (!getServiceAccountEmailAddress().equals(other.getServiceAccountEmailAddress())) + return false; + if (hasOnPremisesConfiguration() != other.hasOnPremisesConfiguration()) return false; + if (hasOnPremisesConfiguration()) { + if (!getOnPremisesConfiguration().equals(other.getOnPremisesConfiguration())) return false; + } + if (hasReplicaConfiguration() != other.hasReplicaConfiguration()) return false; + if (hasReplicaConfiguration()) { + if (!getReplicaConfiguration().equals(other.getReplicaConfiguration())) return false; + } + if (backendType_ != other.backendType_) return false; + if (!getSelfLink().equals(other.getSelfLink())) return false; + if (!suspensionReason_.equals(other.suspensionReason_)) return false; + if (!getConnectionName().equals(other.getConnectionName())) return false; + if (!getName().equals(other.getName())) return false; + if (!getRegion().equals(other.getRegion())) return false; + if (!getGceZone().equals(other.getGceZone())) return false; + if (!getSecondaryGceZone().equals(other.getSecondaryGceZone())) return false; + if (hasDiskEncryptionConfiguration() != other.hasDiskEncryptionConfiguration()) return false; + if (hasDiskEncryptionConfiguration()) { + if (!getDiskEncryptionConfiguration().equals(other.getDiskEncryptionConfiguration())) + return false; + } + if (hasDiskEncryptionStatus() != other.hasDiskEncryptionStatus()) return false; + if (hasDiskEncryptionStatus()) { + if (!getDiskEncryptionStatus().equals(other.getDiskEncryptionStatus())) return false; + } + if (!getRootPassword().equals(other.getRootPassword())) return false; + if (hasScheduledMaintenance() != other.hasScheduledMaintenance()) return false; + if (hasScheduledMaintenance()) { + if (!getScheduledMaintenance().equals(other.getScheduledMaintenance())) return false; + } + if (hasSatisfiesPzs() != other.hasSatisfiesPzs()) return false; + if (hasSatisfiesPzs()) { + if (!getSatisfiesPzs().equals(other.getSatisfiesPzs())) return false; + } + if (!getDatabaseInstalledVersion().equals(other.getDatabaseInstalledVersion())) return false; + if (hasOutOfDiskReport() != other.hasOutOfDiskReport()) return false; + if (hasOutOfDiskReport()) { + if (!getOutOfDiskReport().equals(other.getOutOfDiskReport())) return false; + } + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getAvailableMaintenanceVersionsList().equals(other.getAvailableMaintenanceVersionsList())) + return false; + if (!getMaintenanceVersion().equals(other.getMaintenanceVersion())) return false; + if (!getUpgradableDatabaseVersionsList().equals(other.getUpgradableDatabaseVersionsList())) + return false; + if (hasSqlNetworkArchitecture() != other.hasSqlNetworkArchitecture()) return false; + if (hasSqlNetworkArchitecture()) { + if (sqlNetworkArchitecture_ != other.sqlNetworkArchitecture_) return false; + } + if (hasPscServiceAttachmentLink() != other.hasPscServiceAttachmentLink()) return false; + if (hasPscServiceAttachmentLink()) { + if (!getPscServiceAttachmentLink().equals(other.getPscServiceAttachmentLink())) return false; + } + if (hasDnsName() != other.hasDnsName()) return false; + if (hasDnsName()) { + if (!getDnsName().equals(other.getDnsName())) return false; + } + if (hasPrimaryDnsName() != other.hasPrimaryDnsName()) return false; + if (hasPrimaryDnsName()) { + if (!getPrimaryDnsName().equals(other.getPrimaryDnsName())) return false; + } + if (hasWriteEndpoint() != other.hasWriteEndpoint()) return false; + if (hasWriteEndpoint()) { + if (!getWriteEndpoint().equals(other.getWriteEndpoint())) return false; + } + if (hasReplicationCluster() != other.hasReplicationCluster()) return false; + if (hasReplicationCluster()) { + if (!getReplicationCluster().equals(other.getReplicationCluster())) return false; + } + if (hasGeminiConfig() != other.hasGeminiConfig()) return false; + if (hasGeminiConfig()) { + if (!getGeminiConfig().equals(other.getGeminiConfig())) return false; + } + if (hasSatisfiesPzi() != other.hasSatisfiesPzi()) return false; + if (hasSatisfiesPzi()) { + if (!getSatisfiesPzi().equals(other.getSatisfiesPzi())) return false; + } + if (hasSwitchTransactionLogsToCloudStorageEnabled() + != other.hasSwitchTransactionLogsToCloudStorageEnabled()) return false; + if (hasSwitchTransactionLogsToCloudStorageEnabled()) { + if (!getSwitchTransactionLogsToCloudStorageEnabled() + .equals(other.getSwitchTransactionLogsToCloudStorageEnabled())) return false; + } + if (hasIncludeReplicasForMajorVersionUpgrade() + != other.hasIncludeReplicasForMajorVersionUpgrade()) return false; + if (hasIncludeReplicasForMajorVersionUpgrade()) { + if (!getIncludeReplicasForMajorVersionUpgrade() + .equals(other.getIncludeReplicasForMajorVersionUpgrade())) return false; + } + if (!internalGetTags().equals(other.internalGetTags())) return false; + if (hasNodeCount() != other.hasNodeCount()) return false; + if (hasNodeCount()) { + if (getNodeCount() != other.getNodeCount()) return false; + } + if (!getNodesList().equals(other.getNodesList())) return false; + if (!getDnsNamesList().equals(other.getDnsNamesList())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + databaseVersion_; + if (hasSettings()) { + hash = (37 * hash) + SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getSettings().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (hasFailoverReplica()) { + hash = (37 * hash) + FAILOVER_REPLICA_FIELD_NUMBER; + hash = (53 * hash) + getFailoverReplica().hashCode(); + } + hash = (37 * hash) + MASTER_INSTANCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMasterInstanceName().hashCode(); + if (getReplicaNamesCount() > 0) { + hash = (37 * hash) + REPLICA_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getReplicaNamesList().hashCode(); + } + if (hasMaxDiskSize()) { + hash = (37 * hash) + MAX_DISK_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getMaxDiskSize().hashCode(); + } + if (hasCurrentDiskSize()) { + hash = (37 * hash) + CURRENT_DISK_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getCurrentDiskSize().hashCode(); + } + if (getIpAddressesCount() > 0) { + hash = (37 * hash) + IP_ADDRESSES_FIELD_NUMBER; + hash = (53 * hash) + getIpAddressesList().hashCode(); + } + if (hasServerCaCert()) { + hash = (37 * hash) + SERVER_CA_CERT_FIELD_NUMBER; + hash = (53 * hash) + getServerCaCert().hashCode(); + } + hash = (37 * hash) + INSTANCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + instanceType_; + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + IPV6_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpv6Address().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccountEmailAddress().hashCode(); + if (hasOnPremisesConfiguration()) { + hash = (37 * hash) + ON_PREMISES_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getOnPremisesConfiguration().hashCode(); + } + if (hasReplicaConfiguration()) { + hash = (37 * hash) + REPLICA_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getReplicaConfiguration().hashCode(); + } + hash = (37 * hash) + BACKEND_TYPE_FIELD_NUMBER; + hash = (53 * hash) + backendType_; + hash = (37 * hash) + SELF_LINK_FIELD_NUMBER; + hash = (53 * hash) + getSelfLink().hashCode(); + if (getSuspensionReasonCount() > 0) { + hash = (37 * hash) + SUSPENSION_REASON_FIELD_NUMBER; + hash = (53 * hash) + suspensionReason_.hashCode(); + } + hash = (37 * hash) + CONNECTION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getConnectionName().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegion().hashCode(); + hash = (37 * hash) + GCE_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getGceZone().hashCode(); + hash = (37 * hash) + SECONDARY_GCE_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getSecondaryGceZone().hashCode(); + if (hasDiskEncryptionConfiguration()) { + hash = (37 * hash) + DISK_ENCRYPTION_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getDiskEncryptionConfiguration().hashCode(); + } + if (hasDiskEncryptionStatus()) { + hash = (37 * hash) + DISK_ENCRYPTION_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getDiskEncryptionStatus().hashCode(); + } + hash = (37 * hash) + ROOT_PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getRootPassword().hashCode(); + if (hasScheduledMaintenance()) { + hash = (37 * hash) + SCHEDULED_MAINTENANCE_FIELD_NUMBER; + hash = (53 * hash) + getScheduledMaintenance().hashCode(); + } + if (hasSatisfiesPzs()) { + hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; + hash = (53 * hash) + getSatisfiesPzs().hashCode(); + } + hash = (37 * hash) + DATABASE_INSTALLED_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseInstalledVersion().hashCode(); + if (hasOutOfDiskReport()) { + hash = (37 * hash) + OUT_OF_DISK_REPORT_FIELD_NUMBER; + hash = (53 * hash) + getOutOfDiskReport().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (getAvailableMaintenanceVersionsCount() > 0) { + hash = (37 * hash) + AVAILABLE_MAINTENANCE_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getAvailableMaintenanceVersionsList().hashCode(); + } + hash = (37 * hash) + MAINTENANCE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceVersion().hashCode(); + if (getUpgradableDatabaseVersionsCount() > 0) { + hash = (37 * hash) + UPGRADABLE_DATABASE_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getUpgradableDatabaseVersionsList().hashCode(); + } + if (hasSqlNetworkArchitecture()) { + hash = (37 * hash) + SQL_NETWORK_ARCHITECTURE_FIELD_NUMBER; + hash = (53 * hash) + sqlNetworkArchitecture_; + } + if (hasPscServiceAttachmentLink()) { + hash = (37 * hash) + PSC_SERVICE_ATTACHMENT_LINK_FIELD_NUMBER; + hash = (53 * hash) + getPscServiceAttachmentLink().hashCode(); + } + if (hasDnsName()) { + hash = (37 * hash) + DNS_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDnsName().hashCode(); + } + if (hasPrimaryDnsName()) { + hash = (37 * hash) + PRIMARY_DNS_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryDnsName().hashCode(); + } + if (hasWriteEndpoint()) { + hash = (37 * hash) + WRITE_ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getWriteEndpoint().hashCode(); + } + if (hasReplicationCluster()) { + hash = (37 * hash) + REPLICATION_CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getReplicationCluster().hashCode(); + } + if (hasGeminiConfig()) { + hash = (37 * hash) + GEMINI_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getGeminiConfig().hashCode(); + } + if (hasSatisfiesPzi()) { + hash = (37 * hash) + SATISFIES_PZI_FIELD_NUMBER; + hash = (53 * hash) + getSatisfiesPzi().hashCode(); + } + if (hasSwitchTransactionLogsToCloudStorageEnabled()) { + hash = (37 * hash) + SWITCH_TRANSACTION_LOGS_TO_CLOUD_STORAGE_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getSwitchTransactionLogsToCloudStorageEnabled().hashCode(); + } + if (hasIncludeReplicasForMajorVersionUpgrade()) { + hash = (37 * hash) + INCLUDE_REPLICAS_FOR_MAJOR_VERSION_UPGRADE_FIELD_NUMBER; + hash = (53 * hash) + getIncludeReplicasForMajorVersionUpgrade().hashCode(); + } + if (!internalGetTags().getMap().isEmpty()) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetTags().hashCode(); + } + if (hasNodeCount()) { + hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getNodeCount(); + } + if (getNodesCount() > 0) { + hash = (37 * hash) + NODES_FIELD_NUMBER; + hash = (53 * hash) + getNodesList().hashCode(); + } + if (getDnsNamesCount() > 0) { + hash = (37 * hash) + DNS_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getDnsNamesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DatabaseInstance parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabaseInstance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabaseInstance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabaseInstance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.DatabaseInstance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A Cloud SQL instance resource.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DatabaseInstance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DatabaseInstance) + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 60: + return internalGetTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 60: + return internalGetMutableTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DatabaseInstance.class, + com.google.cloud.sql.v1.DatabaseInstance.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DatabaseInstance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSettingsFieldBuilder(); + internalGetFailoverReplicaFieldBuilder(); + internalGetMaxDiskSizeFieldBuilder(); + internalGetCurrentDiskSizeFieldBuilder(); + internalGetIpAddressesFieldBuilder(); + internalGetServerCaCertFieldBuilder(); + internalGetOnPremisesConfigurationFieldBuilder(); + internalGetReplicaConfigurationFieldBuilder(); + internalGetDiskEncryptionConfigurationFieldBuilder(); + internalGetDiskEncryptionStatusFieldBuilder(); + internalGetScheduledMaintenanceFieldBuilder(); + internalGetSatisfiesPzsFieldBuilder(); + internalGetOutOfDiskReportFieldBuilder(); + internalGetCreateTimeFieldBuilder(); + internalGetUpgradableDatabaseVersionsFieldBuilder(); + internalGetReplicationClusterFieldBuilder(); + internalGetGeminiConfigFieldBuilder(); + internalGetSatisfiesPziFieldBuilder(); + internalGetSwitchTransactionLogsToCloudStorageEnabledFieldBuilder(); + internalGetIncludeReplicasForMajorVersionUpgradeFieldBuilder(); + internalGetNodesFieldBuilder(); + internalGetDnsNamesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bitField1_ = 0; + kind_ = ""; + state_ = 0; + databaseVersion_ = 0; + settings_ = null; + if (settingsBuilder_ != null) { + settingsBuilder_.dispose(); + settingsBuilder_ = null; + } + etag_ = ""; + failoverReplica_ = null; + if (failoverReplicaBuilder_ != null) { + failoverReplicaBuilder_.dispose(); + failoverReplicaBuilder_ = null; + } + masterInstanceName_ = ""; + replicaNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + maxDiskSize_ = null; + if (maxDiskSizeBuilder_ != null) { + maxDiskSizeBuilder_.dispose(); + maxDiskSizeBuilder_ = null; + } + currentDiskSize_ = null; + if (currentDiskSizeBuilder_ != null) { + currentDiskSizeBuilder_.dispose(); + currentDiskSizeBuilder_ = null; + } + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + } else { + ipAddresses_ = null; + ipAddressesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + serverCaCert_ = null; + if (serverCaCertBuilder_ != null) { + serverCaCertBuilder_.dispose(); + serverCaCertBuilder_ = null; + } + instanceType_ = 0; + project_ = ""; + ipv6Address_ = ""; + serviceAccountEmailAddress_ = ""; + onPremisesConfiguration_ = null; + if (onPremisesConfigurationBuilder_ != null) { + onPremisesConfigurationBuilder_.dispose(); + onPremisesConfigurationBuilder_ = null; + } + replicaConfiguration_ = null; + if (replicaConfigurationBuilder_ != null) { + replicaConfigurationBuilder_.dispose(); + replicaConfigurationBuilder_ = null; + } + backendType_ = 0; + selfLink_ = ""; + suspensionReason_ = emptyIntList(); + connectionName_ = ""; + name_ = ""; + region_ = ""; + gceZone_ = ""; + secondaryGceZone_ = ""; + diskEncryptionConfiguration_ = null; + if (diskEncryptionConfigurationBuilder_ != null) { + diskEncryptionConfigurationBuilder_.dispose(); + diskEncryptionConfigurationBuilder_ = null; + } + diskEncryptionStatus_ = null; + if (diskEncryptionStatusBuilder_ != null) { + diskEncryptionStatusBuilder_.dispose(); + diskEncryptionStatusBuilder_ = null; + } + rootPassword_ = ""; + scheduledMaintenance_ = null; + if (scheduledMaintenanceBuilder_ != null) { + scheduledMaintenanceBuilder_.dispose(); + scheduledMaintenanceBuilder_ = null; + } + satisfiesPzs_ = null; + if (satisfiesPzsBuilder_ != null) { + satisfiesPzsBuilder_.dispose(); + satisfiesPzsBuilder_ = null; + } + databaseInstalledVersion_ = ""; + outOfDiskReport_ = null; + if (outOfDiskReportBuilder_ != null) { + outOfDiskReportBuilder_.dispose(); + outOfDiskReportBuilder_ = null; + } + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + availableMaintenanceVersions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + maintenanceVersion_ = ""; + if (upgradableDatabaseVersionsBuilder_ == null) { + upgradableDatabaseVersions_ = java.util.Collections.emptyList(); + } else { + upgradableDatabaseVersions_ = null; + upgradableDatabaseVersionsBuilder_.clear(); + } + bitField1_ = (bitField1_ & ~0x00000010); + sqlNetworkArchitecture_ = 0; + pscServiceAttachmentLink_ = ""; + dnsName_ = ""; + primaryDnsName_ = ""; + writeEndpoint_ = ""; + replicationCluster_ = null; + if (replicationClusterBuilder_ != null) { + replicationClusterBuilder_.dispose(); + replicationClusterBuilder_ = null; + } + geminiConfig_ = null; + if (geminiConfigBuilder_ != null) { + geminiConfigBuilder_.dispose(); + geminiConfigBuilder_ = null; + } + satisfiesPzi_ = null; + if (satisfiesPziBuilder_ != null) { + satisfiesPziBuilder_.dispose(); + satisfiesPziBuilder_ = null; + } + switchTransactionLogsToCloudStorageEnabled_ = null; + if (switchTransactionLogsToCloudStorageEnabledBuilder_ != null) { + switchTransactionLogsToCloudStorageEnabledBuilder_.dispose(); + switchTransactionLogsToCloudStorageEnabledBuilder_ = null; + } + includeReplicasForMajorVersionUpgrade_ = null; + if (includeReplicasForMajorVersionUpgradeBuilder_ != null) { + includeReplicasForMajorVersionUpgradeBuilder_.dispose(); + includeReplicasForMajorVersionUpgradeBuilder_ = null; + } + internalGetMutableTags().clear(); + nodeCount_ = 0; + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + } else { + nodes_ = null; + nodesBuilder_.clear(); + } + bitField1_ = (bitField1_ & ~0x00020000); + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + } else { + dnsNames_ = null; + dnsNamesBuilder_.clear(); + } + bitField1_ = (bitField1_ & ~0x00040000); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DatabaseInstance_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance build() { + com.google.cloud.sql.v1.DatabaseInstance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance buildPartial() { + com.google.cloud.sql.v1.DatabaseInstance result = + new com.google.cloud.sql.v1.DatabaseInstance(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + if (bitField1_ != 0) { + buildPartial1(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.DatabaseInstance result) { + if (ipAddressesBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + ipAddresses_ = java.util.Collections.unmodifiableList(ipAddresses_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.ipAddresses_ = ipAddresses_; + } else { + result.ipAddresses_ = ipAddressesBuilder_.build(); + } + if (upgradableDatabaseVersionsBuilder_ == null) { + if (((bitField1_ & 0x00000010) != 0)) { + upgradableDatabaseVersions_ = + java.util.Collections.unmodifiableList(upgradableDatabaseVersions_); + bitField1_ = (bitField1_ & ~0x00000010); + } + result.upgradableDatabaseVersions_ = upgradableDatabaseVersions_; + } else { + result.upgradableDatabaseVersions_ = upgradableDatabaseVersionsBuilder_.build(); + } + if (nodesBuilder_ == null) { + if (((bitField1_ & 0x00020000) != 0)) { + nodes_ = java.util.Collections.unmodifiableList(nodes_); + bitField1_ = (bitField1_ & ~0x00020000); + } + result.nodes_ = nodes_; + } else { + result.nodes_ = nodesBuilder_.build(); + } + if (dnsNamesBuilder_ == null) { + if (((bitField1_ & 0x00040000) != 0)) { + dnsNames_ = java.util.Collections.unmodifiableList(dnsNames_); + bitField1_ = (bitField1_ & ~0x00040000); + } + result.dnsNames_ = dnsNames_; + } else { + result.dnsNames_ = dnsNamesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.DatabaseInstance result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.databaseVersion_ = databaseVersion_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.settings_ = settingsBuilder_ == null ? settings_ : settingsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.failoverReplica_ = + failoverReplicaBuilder_ == null ? failoverReplica_ : failoverReplicaBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.masterInstanceName_ = masterInstanceName_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + replicaNames_.makeImmutable(); + result.replicaNames_ = replicaNames_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.maxDiskSize_ = + maxDiskSizeBuilder_ == null ? maxDiskSize_ : maxDiskSizeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.currentDiskSize_ = + currentDiskSizeBuilder_ == null ? currentDiskSize_ : currentDiskSizeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.serverCaCert_ = + serverCaCertBuilder_ == null ? serverCaCert_ : serverCaCertBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.instanceType_ = instanceType_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.ipv6Address_ = ipv6Address_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.serviceAccountEmailAddress_ = serviceAccountEmailAddress_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.onPremisesConfiguration_ = + onPremisesConfigurationBuilder_ == null + ? onPremisesConfiguration_ + : onPremisesConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.replicaConfiguration_ = + replicaConfigurationBuilder_ == null + ? replicaConfiguration_ + : replicaConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.backendType_ = backendType_; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.selfLink_ = selfLink_; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + suspensionReason_.makeImmutable(); + result.suspensionReason_ = suspensionReason_; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.connectionName_ = connectionName_; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.region_ = region_; + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.gceZone_ = gceZone_; + } + if (((from_bitField0_ & 0x02000000) != 0)) { + result.secondaryGceZone_ = secondaryGceZone_; + } + if (((from_bitField0_ & 0x04000000) != 0)) { + result.diskEncryptionConfiguration_ = + diskEncryptionConfigurationBuilder_ == null + ? diskEncryptionConfiguration_ + : diskEncryptionConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x08000000) != 0)) { + result.diskEncryptionStatus_ = + diskEncryptionStatusBuilder_ == null + ? diskEncryptionStatus_ + : diskEncryptionStatusBuilder_.build(); + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x10000000) != 0)) { + result.rootPassword_ = rootPassword_; + } + if (((from_bitField0_ & 0x20000000) != 0)) { + result.scheduledMaintenance_ = + scheduledMaintenanceBuilder_ == null + ? scheduledMaintenance_ + : scheduledMaintenanceBuilder_.build(); + to_bitField0_ |= 0x00000200; + } + if (((from_bitField0_ & 0x40000000) != 0)) { + result.satisfiesPzs_ = + satisfiesPzsBuilder_ == null ? satisfiesPzs_ : satisfiesPzsBuilder_.build(); + to_bitField0_ |= 0x00000400; + } + if (((from_bitField0_ & 0x80000000) != 0)) { + result.databaseInstalledVersion_ = databaseInstalledVersion_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartial1(com.google.cloud.sql.v1.DatabaseInstance result) { + int from_bitField1_ = bitField1_; + int to_bitField0_ = 0; + if (((from_bitField1_ & 0x00000001) != 0)) { + result.outOfDiskReport_ = + outOfDiskReportBuilder_ == null ? outOfDiskReport_ : outOfDiskReportBuilder_.build(); + to_bitField0_ |= 0x00000800; + } + if (((from_bitField1_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00001000; + } + if (((from_bitField1_ & 0x00000004) != 0)) { + availableMaintenanceVersions_.makeImmutable(); + result.availableMaintenanceVersions_ = availableMaintenanceVersions_; + } + if (((from_bitField1_ & 0x00000008) != 0)) { + result.maintenanceVersion_ = maintenanceVersion_; + } + if (((from_bitField1_ & 0x00000020) != 0)) { + result.sqlNetworkArchitecture_ = sqlNetworkArchitecture_; + to_bitField0_ |= 0x00002000; + } + if (((from_bitField1_ & 0x00000040) != 0)) { + result.pscServiceAttachmentLink_ = pscServiceAttachmentLink_; + to_bitField0_ |= 0x00004000; + } + if (((from_bitField1_ & 0x00000080) != 0)) { + result.dnsName_ = dnsName_; + to_bitField0_ |= 0x00008000; + } + if (((from_bitField1_ & 0x00000100) != 0)) { + result.primaryDnsName_ = primaryDnsName_; + to_bitField0_ |= 0x00010000; + } + if (((from_bitField1_ & 0x00000200) != 0)) { + result.writeEndpoint_ = writeEndpoint_; + to_bitField0_ |= 0x00020000; + } + if (((from_bitField1_ & 0x00000400) != 0)) { + result.replicationCluster_ = + replicationClusterBuilder_ == null + ? replicationCluster_ + : replicationClusterBuilder_.build(); + to_bitField0_ |= 0x00040000; + } + if (((from_bitField1_ & 0x00000800) != 0)) { + result.geminiConfig_ = + geminiConfigBuilder_ == null ? geminiConfig_ : geminiConfigBuilder_.build(); + to_bitField0_ |= 0x00080000; + } + if (((from_bitField1_ & 0x00001000) != 0)) { + result.satisfiesPzi_ = + satisfiesPziBuilder_ == null ? satisfiesPzi_ : satisfiesPziBuilder_.build(); + to_bitField0_ |= 0x00100000; + } + if (((from_bitField1_ & 0x00002000) != 0)) { + result.switchTransactionLogsToCloudStorageEnabled_ = + switchTransactionLogsToCloudStorageEnabledBuilder_ == null + ? switchTransactionLogsToCloudStorageEnabled_ + : switchTransactionLogsToCloudStorageEnabledBuilder_.build(); + to_bitField0_ |= 0x00200000; + } + if (((from_bitField1_ & 0x00004000) != 0)) { + result.includeReplicasForMajorVersionUpgrade_ = + includeReplicasForMajorVersionUpgradeBuilder_ == null + ? includeReplicasForMajorVersionUpgrade_ + : includeReplicasForMajorVersionUpgradeBuilder_.build(); + to_bitField0_ |= 0x00400000; + } + if (((from_bitField1_ & 0x00008000) != 0)) { + result.tags_ = internalGetTags(); + result.tags_.makeImmutable(); + } + if (((from_bitField1_ & 0x00010000) != 0)) { + result.nodeCount_ = nodeCount_; + to_bitField0_ |= 0x00800000; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DatabaseInstance) { + return mergeFrom((com.google.cloud.sql.v1.DatabaseInstance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DatabaseInstance other) { + if (other == com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.databaseVersion_ != 0) { + setDatabaseVersionValue(other.getDatabaseVersionValue()); + } + if (other.hasSettings()) { + mergeSettings(other.getSettings()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasFailoverReplica()) { + mergeFailoverReplica(other.getFailoverReplica()); + } + if (!other.getMasterInstanceName().isEmpty()) { + masterInstanceName_ = other.masterInstanceName_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.replicaNames_.isEmpty()) { + if (replicaNames_.isEmpty()) { + replicaNames_ = other.replicaNames_; + bitField0_ |= 0x00000080; + } else { + ensureReplicaNamesIsMutable(); + replicaNames_.addAll(other.replicaNames_); + } + onChanged(); + } + if (other.hasMaxDiskSize()) { + mergeMaxDiskSize(other.getMaxDiskSize()); + } + if (other.hasCurrentDiskSize()) { + mergeCurrentDiskSize(other.getCurrentDiskSize()); + } + if (ipAddressesBuilder_ == null) { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddresses_.isEmpty()) { + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureIpAddressesIsMutable(); + ipAddresses_.addAll(other.ipAddresses_); + } + onChanged(); + } + } else { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddressesBuilder_.isEmpty()) { + ipAddressesBuilder_.dispose(); + ipAddressesBuilder_ = null; + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000400); + ipAddressesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetIpAddressesFieldBuilder() + : null; + } else { + ipAddressesBuilder_.addAllMessages(other.ipAddresses_); + } + } + } + if (other.hasServerCaCert()) { + mergeServerCaCert(other.getServerCaCert()); + } + if (other.instanceType_ != 0) { + setInstanceTypeValue(other.getInstanceTypeValue()); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00002000; + onChanged(); + } + if (!other.getIpv6Address().isEmpty()) { + ipv6Address_ = other.ipv6Address_; + bitField0_ |= 0x00004000; + onChanged(); + } + if (!other.getServiceAccountEmailAddress().isEmpty()) { + serviceAccountEmailAddress_ = other.serviceAccountEmailAddress_; + bitField0_ |= 0x00008000; + onChanged(); + } + if (other.hasOnPremisesConfiguration()) { + mergeOnPremisesConfiguration(other.getOnPremisesConfiguration()); + } + if (other.hasReplicaConfiguration()) { + mergeReplicaConfiguration(other.getReplicaConfiguration()); + } + if (other.backendType_ != 0) { + setBackendTypeValue(other.getBackendTypeValue()); + } + if (!other.getSelfLink().isEmpty()) { + selfLink_ = other.selfLink_; + bitField0_ |= 0x00080000; + onChanged(); + } + if (!other.suspensionReason_.isEmpty()) { + if (suspensionReason_.isEmpty()) { + suspensionReason_ = other.suspensionReason_; + suspensionReason_.makeImmutable(); + bitField0_ |= 0x00100000; + } else { + ensureSuspensionReasonIsMutable(); + suspensionReason_.addAll(other.suspensionReason_); + } + onChanged(); + } + if (!other.getConnectionName().isEmpty()) { + connectionName_ = other.connectionName_; + bitField0_ |= 0x00200000; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00400000; + onChanged(); + } + if (!other.getRegion().isEmpty()) { + region_ = other.region_; + bitField0_ |= 0x00800000; + onChanged(); + } + if (!other.getGceZone().isEmpty()) { + gceZone_ = other.gceZone_; + bitField0_ |= 0x01000000; + onChanged(); + } + if (!other.getSecondaryGceZone().isEmpty()) { + secondaryGceZone_ = other.secondaryGceZone_; + bitField0_ |= 0x02000000; + onChanged(); + } + if (other.hasDiskEncryptionConfiguration()) { + mergeDiskEncryptionConfiguration(other.getDiskEncryptionConfiguration()); + } + if (other.hasDiskEncryptionStatus()) { + mergeDiskEncryptionStatus(other.getDiskEncryptionStatus()); + } + if (!other.getRootPassword().isEmpty()) { + rootPassword_ = other.rootPassword_; + bitField0_ |= 0x10000000; + onChanged(); + } + if (other.hasScheduledMaintenance()) { + mergeScheduledMaintenance(other.getScheduledMaintenance()); + } + if (other.hasSatisfiesPzs()) { + mergeSatisfiesPzs(other.getSatisfiesPzs()); + } + if (!other.getDatabaseInstalledVersion().isEmpty()) { + databaseInstalledVersion_ = other.databaseInstalledVersion_; + bitField0_ |= 0x80000000; + onChanged(); + } + if (other.hasOutOfDiskReport()) { + mergeOutOfDiskReport(other.getOutOfDiskReport()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.availableMaintenanceVersions_.isEmpty()) { + if (availableMaintenanceVersions_.isEmpty()) { + availableMaintenanceVersions_ = other.availableMaintenanceVersions_; + bitField1_ |= 0x00000004; + } else { + ensureAvailableMaintenanceVersionsIsMutable(); + availableMaintenanceVersions_.addAll(other.availableMaintenanceVersions_); + } + onChanged(); + } + if (!other.getMaintenanceVersion().isEmpty()) { + maintenanceVersion_ = other.maintenanceVersion_; + bitField1_ |= 0x00000008; + onChanged(); + } + if (upgradableDatabaseVersionsBuilder_ == null) { + if (!other.upgradableDatabaseVersions_.isEmpty()) { + if (upgradableDatabaseVersions_.isEmpty()) { + upgradableDatabaseVersions_ = other.upgradableDatabaseVersions_; + bitField1_ = (bitField1_ & ~0x00000010); + } else { + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.addAll(other.upgradableDatabaseVersions_); + } + onChanged(); + } + } else { + if (!other.upgradableDatabaseVersions_.isEmpty()) { + if (upgradableDatabaseVersionsBuilder_.isEmpty()) { + upgradableDatabaseVersionsBuilder_.dispose(); + upgradableDatabaseVersionsBuilder_ = null; + upgradableDatabaseVersions_ = other.upgradableDatabaseVersions_; + bitField1_ = (bitField1_ & ~0x00000010); + upgradableDatabaseVersionsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetUpgradableDatabaseVersionsFieldBuilder() + : null; + } else { + upgradableDatabaseVersionsBuilder_.addAllMessages(other.upgradableDatabaseVersions_); + } + } + } + if (other.hasSqlNetworkArchitecture()) { + setSqlNetworkArchitectureValue(other.getSqlNetworkArchitectureValue()); + } + if (other.hasPscServiceAttachmentLink()) { + pscServiceAttachmentLink_ = other.pscServiceAttachmentLink_; + bitField1_ |= 0x00000040; + onChanged(); + } + if (other.hasDnsName()) { + dnsName_ = other.dnsName_; + bitField1_ |= 0x00000080; + onChanged(); + } + if (other.hasPrimaryDnsName()) { + primaryDnsName_ = other.primaryDnsName_; + bitField1_ |= 0x00000100; + onChanged(); + } + if (other.hasWriteEndpoint()) { + writeEndpoint_ = other.writeEndpoint_; + bitField1_ |= 0x00000200; + onChanged(); + } + if (other.hasReplicationCluster()) { + mergeReplicationCluster(other.getReplicationCluster()); + } + if (other.hasGeminiConfig()) { + mergeGeminiConfig(other.getGeminiConfig()); + } + if (other.hasSatisfiesPzi()) { + mergeSatisfiesPzi(other.getSatisfiesPzi()); + } + if (other.hasSwitchTransactionLogsToCloudStorageEnabled()) { + mergeSwitchTransactionLogsToCloudStorageEnabled( + other.getSwitchTransactionLogsToCloudStorageEnabled()); + } + if (other.hasIncludeReplicasForMajorVersionUpgrade()) { + mergeIncludeReplicasForMajorVersionUpgrade( + other.getIncludeReplicasForMajorVersionUpgrade()); + } + internalGetMutableTags().mergeFrom(other.internalGetTags()); + bitField1_ |= 0x00008000; + if (other.hasNodeCount()) { + setNodeCount(other.getNodeCount()); + } + if (nodesBuilder_ == null) { + if (!other.nodes_.isEmpty()) { + if (nodes_.isEmpty()) { + nodes_ = other.nodes_; + bitField1_ = (bitField1_ & ~0x00020000); + } else { + ensureNodesIsMutable(); + nodes_.addAll(other.nodes_); + } + onChanged(); + } + } else { + if (!other.nodes_.isEmpty()) { + if (nodesBuilder_.isEmpty()) { + nodesBuilder_.dispose(); + nodesBuilder_ = null; + nodes_ = other.nodes_; + bitField1_ = (bitField1_ & ~0x00020000); + nodesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetNodesFieldBuilder() + : null; + } else { + nodesBuilder_.addAllMessages(other.nodes_); + } + } + } + if (dnsNamesBuilder_ == null) { + if (!other.dnsNames_.isEmpty()) { + if (dnsNames_.isEmpty()) { + dnsNames_ = other.dnsNames_; + bitField1_ = (bitField1_ & ~0x00040000); + } else { + ensureDnsNamesIsMutable(); + dnsNames_.addAll(other.dnsNames_); + } + onChanged(); + } + } else { + if (!other.dnsNames_.isEmpty()) { + if (dnsNamesBuilder_.isEmpty()) { + dnsNamesBuilder_.dispose(); + dnsNamesBuilder_ = null; + dnsNames_ = other.dnsNames_; + bitField1_ = (bitField1_ & ~0x00040000); + dnsNamesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDnsNamesFieldBuilder() + : null; + } else { + dnsNamesBuilder_.addAllMessages(other.dnsNames_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + databaseVersion_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage( + internalGetSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetFailoverReplicaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + masterInstanceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureReplicaNamesIsMutable(); + replicaNames_.add(s); + break; + } // case 66 + case 74: + { + input.readMessage( + internalGetMaxDiskSizeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + input.readMessage( + internalGetCurrentDiskSizeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + com.google.cloud.sql.v1.IpMapping m = + input.readMessage( + com.google.cloud.sql.v1.IpMapping.parser(), extensionRegistry); + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(m); + } else { + ipAddressesBuilder_.addMessage(m); + } + break; + } // case 90 + case 98: + { + input.readMessage( + internalGetServerCaCertFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 104: + { + instanceType_ = input.readEnum(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 114: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 122: + { + ipv6Address_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 122 + case 130: + { + serviceAccountEmailAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 130 + case 138: + { + input.readMessage( + internalGetOnPremisesConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 138 + case 146: + { + input.readMessage( + internalGetReplicaConfigurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 146 + case 152: + { + backendType_ = input.readEnum(); + bitField0_ |= 0x00040000; + break; + } // case 152 + case 162: + { + selfLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00080000; + break; + } // case 162 + case 168: + { + int tmpRaw = input.readEnum(); + ensureSuspensionReasonIsMutable(); + suspensionReason_.addInt(tmpRaw); + break; + } // case 168 + case 170: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureSuspensionReasonIsMutable(); + while (input.getBytesUntilLimit() > 0) { + suspensionReason_.addInt(input.readEnum()); + } + input.popLimit(limit); + break; + } // case 170 + case 178: + { + connectionName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00200000; + break; + } // case 178 + case 186: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00400000; + break; + } // case 186 + case 194: + { + region_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00800000; + break; + } // case 194 + case 202: + { + gceZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x01000000; + break; + } // case 202 + case 210: + { + input.readMessage( + internalGetDiskEncryptionConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x04000000; + break; + } // case 210 + case 218: + { + input.readMessage( + internalGetDiskEncryptionStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x08000000; + break; + } // case 218 + case 234: + { + rootPassword_ = input.readStringRequireUtf8(); + bitField0_ |= 0x10000000; + break; + } // case 234 + case 242: + { + input.readMessage( + internalGetScheduledMaintenanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x20000000; + break; + } // case 242 + case 274: + { + secondaryGceZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x02000000; + break; + } // case 274 + case 282: + { + input.readMessage( + internalGetSatisfiesPzsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x40000000; + break; + } // case 282 + case 306: + { + input.readMessage( + internalGetOutOfDiskReportFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000001; + break; + } // case 306 + case 314: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000002; + break; + } // case 314 + case 322: + { + databaseInstalledVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x80000000; + break; + } // case 322 + case 330: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAvailableMaintenanceVersionsIsMutable(); + availableMaintenanceVersions_.add(s); + break; + } // case 330 + case 338: + { + maintenanceVersion_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000008; + break; + } // case 338 + case 362: + { + com.google.cloud.sql.v1.AvailableDatabaseVersion m = + input.readMessage( + com.google.cloud.sql.v1.AvailableDatabaseVersion.parser(), + extensionRegistry); + if (upgradableDatabaseVersionsBuilder_ == null) { + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.add(m); + } else { + upgradableDatabaseVersionsBuilder_.addMessage(m); + } + break; + } // case 362 + case 376: + { + sqlNetworkArchitecture_ = input.readEnum(); + bitField1_ |= 0x00000020; + break; + } // case 376 + case 386: + { + pscServiceAttachmentLink_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000040; + break; + } // case 386 + case 394: + { + dnsName_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000080; + break; + } // case 394 + case 410: + { + primaryDnsName_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000100; + break; + } // case 410 + case 418: + { + writeEndpoint_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000200; + break; + } // case 418 + case 434: + { + input.readMessage( + internalGetReplicationClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000400; + break; + } // case 434 + case 442: + { + input.readMessage( + internalGetGeminiConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000800; + break; + } // case 442 + case 450: + { + input.readMessage( + internalGetSatisfiesPziFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00001000; + break; + } // case 450 + case 458: + { + input.readMessage( + internalGetSwitchTransactionLogsToCloudStorageEnabledFieldBuilder() + .getBuilder(), + extensionRegistry); + bitField1_ |= 0x00002000; + break; + } // case 458 + case 474: + { + input.readMessage( + internalGetIncludeReplicasForMajorVersionUpgradeFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00004000; + break; + } // case 474 + case 482: + { + com.google.protobuf.MapEntry tags__ = + input.readMessage( + TagsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableTags().getMutableMap().put(tags__.getKey(), tags__.getValue()); + bitField1_ |= 0x00008000; + break; + } // case 482 + case 504: + { + nodeCount_ = input.readInt32(); + bitField1_ |= 0x00010000; + break; + } // case 504 + case 514: + { + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig m = + input.readMessage( + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.parser(), + extensionRegistry); + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(m); + } else { + nodesBuilder_.addMessage(m); + } + break; + } // case 514 + case 538: + { + com.google.cloud.sql.v1.DnsNameMapping m = + input.readMessage( + com.google.cloud.sql.v1.DnsNameMapping.parser(), extensionRegistry); + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(m); + } else { + dnsNamesBuilder_.addMessage(m); + } + break; + } // case 538 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 bitField1_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#instance`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instance`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instance`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instance`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instance`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int state_ = 0; + + /** + * + * + *
+     * The current serving state of the Cloud SQL instance.
+     * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 2; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+     * The current serving state of the Cloud SQL instance.
+     * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 2; + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The current serving state of the Cloud SQL instance.
+     * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 2; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState getState() { + com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState result = + com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState.forNumber(state_); + return result == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The current serving state of the Cloud SQL instance.
+     * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 2; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The current serving state of the Cloud SQL instance.
+     * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 2; + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000002); + state_ = 0; + onChanged(); + return this; + } + + private int databaseVersion_ = 0; + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion` field cannot
+     * be changed after instance creation.
+     * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 3; + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion` field cannot
+     * be changed after instance creation.
+     * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 3; + * + * @param value The enum numeric value on the wire for databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersionValue(int value) { + databaseVersion_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion` field cannot
+     * be changed after instance creation.
+     * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 3; + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1.SqlDatabaseVersion result = + com.google.cloud.sql.v1.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion` field cannot
+     * be changed after instance creation.
+     * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 3; + * + * @param value The databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersion(com.google.cloud.sql.v1.SqlDatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + databaseVersion_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion` field cannot
+     * be changed after instance creation.
+     * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 3; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseVersion() { + bitField0_ = (bitField0_ & ~0x00000004); + databaseVersion_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.Settings settings_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Settings, + com.google.cloud.sql.v1.Settings.Builder, + com.google.cloud.sql.v1.SettingsOrBuilder> + settingsBuilder_; + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + * + * @return Whether the settings field is set. + */ + public boolean hasSettings() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + * + * @return The settings. + */ + public com.google.cloud.sql.v1.Settings getSettings() { + if (settingsBuilder_ == null) { + return settings_ == null + ? com.google.cloud.sql.v1.Settings.getDefaultInstance() + : settings_; + } else { + return settingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + */ + public Builder setSettings(com.google.cloud.sql.v1.Settings value) { + if (settingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + settings_ = value; + } else { + settingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + */ + public Builder setSettings(com.google.cloud.sql.v1.Settings.Builder builderForValue) { + if (settingsBuilder_ == null) { + settings_ = builderForValue.build(); + } else { + settingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + */ + public Builder mergeSettings(com.google.cloud.sql.v1.Settings value) { + if (settingsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && settings_ != null + && settings_ != com.google.cloud.sql.v1.Settings.getDefaultInstance()) { + getSettingsBuilder().mergeFrom(value); + } else { + settings_ = value; + } + } else { + settingsBuilder_.mergeFrom(value); + } + if (settings_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + */ + public Builder clearSettings() { + bitField0_ = (bitField0_ & ~0x00000008); + settings_ = null; + if (settingsBuilder_ != null) { + settingsBuilder_.dispose(); + settingsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + */ + public com.google.cloud.sql.v1.Settings.Builder getSettingsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + */ + public com.google.cloud.sql.v1.SettingsOrBuilder getSettingsOrBuilder() { + if (settingsBuilder_ != null) { + return settingsBuilder_.getMessageOrBuilder(); + } else { + return settings_ == null + ? com.google.cloud.sql.v1.Settings.getDefaultInstance() + : settings_; + } + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Settings, + com.google.cloud.sql.v1.Settings.Builder, + com.google.cloud.sql.v1.SettingsOrBuilder> + internalGetSettingsFieldBuilder() { + if (settingsBuilder_ == null) { + settingsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Settings, + com.google.cloud.sql.v1.Settings.Builder, + com.google.cloud.sql.v1.SettingsOrBuilder>( + getSettings(), getParentForChildren(), isClean()); + settings_ = null; + } + return settingsBuilder_; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API. Use the `settings.settingsVersion` field instead.
+     * 
+ * + * string etag = 5; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API. Use the `settings.settingsVersion` field instead.
+     * 
+ * + * string etag = 5; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API. Use the `settings.settingsVersion` field instead.
+     * 
+ * + * string etag = 5; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API. Use the `settings.settingsVersion` field instead.
+     * 
+ * + * string etag = 5; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API. Use the `settings.settingsVersion` field instead.
+     * 
+ * + * string etag = 5; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failoverReplica_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica, + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.Builder, + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplicaOrBuilder> + failoverReplicaBuilder_; + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + * @return Whether the failoverReplica field is set. + */ + public boolean hasFailoverReplica() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + * @return The failoverReplica. + */ + public com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica getFailoverReplica() { + if (failoverReplicaBuilder_ == null) { + return failoverReplica_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.getDefaultInstance() + : failoverReplica_; + } else { + return failoverReplicaBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + */ + public Builder setFailoverReplica( + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica value) { + if (failoverReplicaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + failoverReplica_ = value; + } else { + failoverReplicaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + */ + public Builder setFailoverReplica( + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.Builder builderForValue) { + if (failoverReplicaBuilder_ == null) { + failoverReplica_ = builderForValue.build(); + } else { + failoverReplicaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + */ + public Builder mergeFailoverReplica( + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica value) { + if (failoverReplicaBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && failoverReplica_ != null + && failoverReplica_ + != com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica + .getDefaultInstance()) { + getFailoverReplicaBuilder().mergeFrom(value); + } else { + failoverReplica_ = value; + } + } else { + failoverReplicaBuilder_.mergeFrom(value); + } + if (failoverReplica_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + */ + public Builder clearFailoverReplica() { + bitField0_ = (bitField0_ & ~0x00000020); + failoverReplica_ = null; + if (failoverReplicaBuilder_ != null) { + failoverReplicaBuilder_.dispose(); + failoverReplicaBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + */ + public com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.Builder + getFailoverReplicaBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetFailoverReplicaFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + */ + public com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplicaOrBuilder + getFailoverReplicaOrBuilder() { + if (failoverReplicaBuilder_ != null) { + return failoverReplicaBuilder_.getMessageOrBuilder(); + } else { + return failoverReplica_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.getDefaultInstance() + : failoverReplica_; + } + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica, + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.Builder, + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplicaOrBuilder> + internalGetFailoverReplicaFieldBuilder() { + if (failoverReplicaBuilder_ == null) { + failoverReplicaBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica, + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.Builder, + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplicaOrBuilder>( + getFailoverReplica(), getParentForChildren(), isClean()); + failoverReplica_ = null; + } + return failoverReplicaBuilder_; + } + + private java.lang.Object masterInstanceName_ = ""; + + /** + * + * + *
+     * The name of the instance which will act as primary in the replication
+     * setup.
+     * 
+ * + * string master_instance_name = 7; + * + * @return The masterInstanceName. + */ + public java.lang.String getMasterInstanceName() { + java.lang.Object ref = masterInstanceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + masterInstanceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the instance which will act as primary in the replication
+     * setup.
+     * 
+ * + * string master_instance_name = 7; + * + * @return The bytes for masterInstanceName. + */ + public com.google.protobuf.ByteString getMasterInstanceNameBytes() { + java.lang.Object ref = masterInstanceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + masterInstanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the instance which will act as primary in the replication
+     * setup.
+     * 
+ * + * string master_instance_name = 7; + * + * @param value The masterInstanceName to set. + * @return This builder for chaining. + */ + public Builder setMasterInstanceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + masterInstanceName_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the instance which will act as primary in the replication
+     * setup.
+     * 
+ * + * string master_instance_name = 7; + * + * @return This builder for chaining. + */ + public Builder clearMasterInstanceName() { + masterInstanceName_ = getDefaultInstance().getMasterInstanceName(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the instance which will act as primary in the replication
+     * setup.
+     * 
+ * + * string master_instance_name = 7; + * + * @param value The bytes for masterInstanceName to set. + * @return This builder for chaining. + */ + public Builder setMasterInstanceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + masterInstanceName_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList replicaNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureReplicaNamesIsMutable() { + if (!replicaNames_.isModifiable()) { + replicaNames_ = new com.google.protobuf.LazyStringArrayList(replicaNames_); + } + bitField0_ |= 0x00000080; + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @return A list containing the replicaNames. + */ + public com.google.protobuf.ProtocolStringList getReplicaNamesList() { + replicaNames_.makeImmutable(); + return replicaNames_; + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @return The count of replicaNames. + */ + public int getReplicaNamesCount() { + return replicaNames_.size(); + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @param index The index of the element to return. + * @return The replicaNames at the given index. + */ + public java.lang.String getReplicaNames(int index) { + return replicaNames_.get(index); + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @param index The index of the value to return. + * @return The bytes of the replicaNames at the given index. + */ + public com.google.protobuf.ByteString getReplicaNamesBytes(int index) { + return replicaNames_.getByteString(index); + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @param index The index to set the value at. + * @param value The replicaNames to set. + * @return This builder for chaining. + */ + public Builder setReplicaNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureReplicaNamesIsMutable(); + replicaNames_.set(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @param value The replicaNames to add. + * @return This builder for chaining. + */ + public Builder addReplicaNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureReplicaNamesIsMutable(); + replicaNames_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @param values The replicaNames to add. + * @return This builder for chaining. + */ + public Builder addAllReplicaNames(java.lang.Iterable values) { + ensureReplicaNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, replicaNames_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @return This builder for chaining. + */ + public Builder clearReplicaNames() { + replicaNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @param value The bytes of the replicaNames to add. + * @return This builder for chaining. + */ + public Builder addReplicaNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureReplicaNamesIsMutable(); + replicaNames_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.protobuf.Int64Value maxDiskSize_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + maxDiskSizeBuilder_; + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.max_disk_size is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1573 + * @return Whether the maxDiskSize field is set. + */ + @java.lang.Deprecated + public boolean hasMaxDiskSize() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.max_disk_size is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1573 + * @return The maxDiskSize. + */ + @java.lang.Deprecated + public com.google.protobuf.Int64Value getMaxDiskSize() { + if (maxDiskSizeBuilder_ == null) { + return maxDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : maxDiskSize_; + } else { + return maxDiskSizeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setMaxDiskSize(com.google.protobuf.Int64Value value) { + if (maxDiskSizeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxDiskSize_ = value; + } else { + maxDiskSizeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setMaxDiskSize(com.google.protobuf.Int64Value.Builder builderForValue) { + if (maxDiskSizeBuilder_ == null) { + maxDiskSize_ = builderForValue.build(); + } else { + maxDiskSizeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder mergeMaxDiskSize(com.google.protobuf.Int64Value value) { + if (maxDiskSizeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && maxDiskSize_ != null + && maxDiskSize_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getMaxDiskSizeBuilder().mergeFrom(value); + } else { + maxDiskSize_ = value; + } + } else { + maxDiskSizeBuilder_.mergeFrom(value); + } + if (maxDiskSize_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder clearMaxDiskSize() { + bitField0_ = (bitField0_ & ~0x00000100); + maxDiskSize_ = null; + if (maxDiskSizeBuilder_ != null) { + maxDiskSizeBuilder_.dispose(); + maxDiskSizeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.Int64Value.Builder getMaxDiskSizeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetMaxDiskSizeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.Int64ValueOrBuilder getMaxDiskSizeOrBuilder() { + if (maxDiskSizeBuilder_ != null) { + return maxDiskSizeBuilder_.getMessageOrBuilder(); + } else { + return maxDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : maxDiskSize_; + } + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetMaxDiskSizeFieldBuilder() { + if (maxDiskSizeBuilder_ == null) { + maxDiskSizeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getMaxDiskSize(), getParentForChildren(), isClean()); + maxDiskSize_ = null; + } + return maxDiskSizeBuilder_; + } + + private com.google.protobuf.Int64Value currentDiskSize_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + currentDiskSizeBuilder_; + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.current_disk_size is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1581 + * @return Whether the currentDiskSize field is set. + */ + @java.lang.Deprecated + public boolean hasCurrentDiskSize() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.current_disk_size is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1581 + * @return The currentDiskSize. + */ + @java.lang.Deprecated + public com.google.protobuf.Int64Value getCurrentDiskSize() { + if (currentDiskSizeBuilder_ == null) { + return currentDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : currentDiskSize_; + } else { + return currentDiskSizeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setCurrentDiskSize(com.google.protobuf.Int64Value value) { + if (currentDiskSizeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + currentDiskSize_ = value; + } else { + currentDiskSizeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setCurrentDiskSize(com.google.protobuf.Int64Value.Builder builderForValue) { + if (currentDiskSizeBuilder_ == null) { + currentDiskSize_ = builderForValue.build(); + } else { + currentDiskSizeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder mergeCurrentDiskSize(com.google.protobuf.Int64Value value) { + if (currentDiskSizeBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && currentDiskSize_ != null + && currentDiskSize_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getCurrentDiskSizeBuilder().mergeFrom(value); + } else { + currentDiskSize_ = value; + } + } else { + currentDiskSizeBuilder_.mergeFrom(value); + } + if (currentDiskSize_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder clearCurrentDiskSize() { + bitField0_ = (bitField0_ & ~0x00000200); + currentDiskSize_ = null; + if (currentDiskSizeBuilder_ != null) { + currentDiskSizeBuilder_.dispose(); + currentDiskSizeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.Int64Value.Builder getCurrentDiskSizeBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetCurrentDiskSizeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.Int64ValueOrBuilder getCurrentDiskSizeOrBuilder() { + if (currentDiskSizeBuilder_ != null) { + return currentDiskSizeBuilder_.getMessageOrBuilder(); + } else { + return currentDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : currentDiskSize_; + } + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetCurrentDiskSizeFieldBuilder() { + if (currentDiskSizeBuilder_ == null) { + currentDiskSizeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getCurrentDiskSize(), getParentForChildren(), isClean()); + currentDiskSize_ = null; + } + return currentDiskSizeBuilder_; + } + + private java.util.List ipAddresses_ = + java.util.Collections.emptyList(); + + private void ensureIpAddressesIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + ipAddresses_ = new java.util.ArrayList(ipAddresses_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.IpMapping, + com.google.cloud.sql.v1.IpMapping.Builder, + com.google.cloud.sql.v1.IpMappingOrBuilder> + ipAddressesBuilder_; + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public java.util.List getIpAddressesList() { + if (ipAddressesBuilder_ == null) { + return java.util.Collections.unmodifiableList(ipAddresses_); + } else { + return ipAddressesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public int getIpAddressesCount() { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.size(); + } else { + return ipAddressesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public com.google.cloud.sql.v1.IpMapping getIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public Builder setIpAddresses(int index, com.google.cloud.sql.v1.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, value); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public Builder setIpAddresses( + int index, com.google.cloud.sql.v1.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public Builder addIpAddresses(com.google.cloud.sql.v1.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public Builder addIpAddresses(int index, com.google.cloud.sql.v1.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public Builder addIpAddresses(com.google.cloud.sql.v1.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public Builder addIpAddresses( + int index, com.google.cloud.sql.v1.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public Builder addAllIpAddresses( + java.lang.Iterable values) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipAddresses_); + onChanged(); + } else { + ipAddressesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public Builder clearIpAddresses() { + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + ipAddressesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public Builder removeIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.remove(index); + onChanged(); + } else { + ipAddressesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public com.google.cloud.sql.v1.IpMapping.Builder getIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public com.google.cloud.sql.v1.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public java.util.List + getIpAddressesOrBuilderList() { + if (ipAddressesBuilder_ != null) { + return ipAddressesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(ipAddresses_); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public com.google.cloud.sql.v1.IpMapping.Builder addIpAddressesBuilder() { + return internalGetIpAddressesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public com.google.cloud.sql.v1.IpMapping.Builder addIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + public java.util.List getIpAddressesBuilderList() { + return internalGetIpAddressesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.IpMapping, + com.google.cloud.sql.v1.IpMapping.Builder, + com.google.cloud.sql.v1.IpMappingOrBuilder> + internalGetIpAddressesFieldBuilder() { + if (ipAddressesBuilder_ == null) { + ipAddressesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.IpMapping, + com.google.cloud.sql.v1.IpMapping.Builder, + com.google.cloud.sql.v1.IpMappingOrBuilder>( + ipAddresses_, ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean()); + ipAddresses_ = null; + } + return ipAddressesBuilder_; + } + + private com.google.cloud.sql.v1.SslCert serverCaCert_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + serverCaCertBuilder_; + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + * + * @return Whether the serverCaCert field is set. + */ + public boolean hasServerCaCert() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + * + * @return The serverCaCert. + */ + public com.google.cloud.sql.v1.SslCert getServerCaCert() { + if (serverCaCertBuilder_ == null) { + return serverCaCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : serverCaCert_; + } else { + return serverCaCertBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + */ + public Builder setServerCaCert(com.google.cloud.sql.v1.SslCert value) { + if (serverCaCertBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serverCaCert_ = value; + } else { + serverCaCertBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + */ + public Builder setServerCaCert(com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (serverCaCertBuilder_ == null) { + serverCaCert_ = builderForValue.build(); + } else { + serverCaCertBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + */ + public Builder mergeServerCaCert(com.google.cloud.sql.v1.SslCert value) { + if (serverCaCertBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && serverCaCert_ != null + && serverCaCert_ != com.google.cloud.sql.v1.SslCert.getDefaultInstance()) { + getServerCaCertBuilder().mergeFrom(value); + } else { + serverCaCert_ = value; + } + } else { + serverCaCertBuilder_.mergeFrom(value); + } + if (serverCaCert_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + */ + public Builder clearServerCaCert() { + bitField0_ = (bitField0_ & ~0x00000800); + serverCaCert_ = null; + if (serverCaCertBuilder_ != null) { + serverCaCertBuilder_.dispose(); + serverCaCertBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + */ + public com.google.cloud.sql.v1.SslCert.Builder getServerCaCertBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return internalGetServerCaCertFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + */ + public com.google.cloud.sql.v1.SslCertOrBuilder getServerCaCertOrBuilder() { + if (serverCaCertBuilder_ != null) { + return serverCaCertBuilder_.getMessageOrBuilder(); + } else { + return serverCaCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : serverCaCert_; + } + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + internalGetServerCaCertFieldBuilder() { + if (serverCaCertBuilder_ == null) { + serverCaCertBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder>( + getServerCaCert(), getParentForChildren(), isClean()); + serverCaCert_ = null; + } + return serverCaCertBuilder_; + } + + private int instanceType_ = 0; + + /** + * + * + *
+     * The instance type.
+     * 
+ * + * .google.cloud.sql.v1.SqlInstanceType instance_type = 13; + * + * @return The enum numeric value on the wire for instanceType. + */ + @java.lang.Override + public int getInstanceTypeValue() { + return instanceType_; + } + + /** + * + * + *
+     * The instance type.
+     * 
+ * + * .google.cloud.sql.v1.SqlInstanceType instance_type = 13; + * + * @param value The enum numeric value on the wire for instanceType to set. + * @return This builder for chaining. + */ + public Builder setInstanceTypeValue(int value) { + instanceType_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The instance type.
+     * 
+ * + * .google.cloud.sql.v1.SqlInstanceType instance_type = 13; + * + * @return The instanceType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstanceType getInstanceType() { + com.google.cloud.sql.v1.SqlInstanceType result = + com.google.cloud.sql.v1.SqlInstanceType.forNumber(instanceType_); + return result == null ? com.google.cloud.sql.v1.SqlInstanceType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The instance type.
+     * 
+ * + * .google.cloud.sql.v1.SqlInstanceType instance_type = 13; + * + * @param value The instanceType to set. + * @return This builder for chaining. + */ + public Builder setInstanceType(com.google.cloud.sql.v1.SqlInstanceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00001000; + instanceType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The instance type.
+     * 
+ * + * .google.cloud.sql.v1.SqlInstanceType instance_type = 13; + * + * @return This builder for chaining. + */ + public Builder clearInstanceType() { + bitField0_ = (bitField0_ & ~0x00001000); + instanceType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL instance. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 14; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL instance. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 14; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL instance. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 14; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL instance. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 14; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL instance. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 14; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + private java.lang.Object ipv6Address_ = ""; + + /** + * + * + *
+     * The IPv6 address assigned to the instance.
+     * (Deprecated) This property was applicable only
+     * to First Generation instances.
+     * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1599 + * @return The ipv6Address. + */ + @java.lang.Deprecated + public java.lang.String getIpv6Address() { + java.lang.Object ref = ipv6Address_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipv6Address_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The IPv6 address assigned to the instance.
+     * (Deprecated) This property was applicable only
+     * to First Generation instances.
+     * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1599 + * @return The bytes for ipv6Address. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getIpv6AddressBytes() { + java.lang.Object ref = ipv6Address_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipv6Address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The IPv6 address assigned to the instance.
+     * (Deprecated) This property was applicable only
+     * to First Generation instances.
+     * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1599 + * @param value The ipv6Address to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setIpv6Address(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ipv6Address_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The IPv6 address assigned to the instance.
+     * (Deprecated) This property was applicable only
+     * to First Generation instances.
+     * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1599 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearIpv6Address() { + ipv6Address_ = getDefaultInstance().getIpv6Address(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The IPv6 address assigned to the instance.
+     * (Deprecated) This property was applicable only
+     * to First Generation instances.
+     * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1599 + * @param value The bytes for ipv6Address to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setIpv6AddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ipv6Address_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + private java.lang.Object serviceAccountEmailAddress_ = ""; + + /** + * + * + *
+     * The service account email address assigned to the instance.\This
+     * property is read-only.
+     * 
+ * + * string service_account_email_address = 16; + * + * @return The serviceAccountEmailAddress. + */ + public java.lang.String getServiceAccountEmailAddress() { + java.lang.Object ref = serviceAccountEmailAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmailAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The service account email address assigned to the instance.\This
+     * property is read-only.
+     * 
+ * + * string service_account_email_address = 16; + * + * @return The bytes for serviceAccountEmailAddress. + */ + public com.google.protobuf.ByteString getServiceAccountEmailAddressBytes() { + java.lang.Object ref = serviceAccountEmailAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmailAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The service account email address assigned to the instance.\This
+     * property is read-only.
+     * 
+ * + * string service_account_email_address = 16; + * + * @param value The serviceAccountEmailAddress to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmailAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceAccountEmailAddress_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The service account email address assigned to the instance.\This
+     * property is read-only.
+     * 
+ * + * string service_account_email_address = 16; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccountEmailAddress() { + serviceAccountEmailAddress_ = getDefaultInstance().getServiceAccountEmailAddress(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The service account email address assigned to the instance.\This
+     * property is read-only.
+     * 
+ * + * string service_account_email_address = 16; + * + * @param value The bytes for serviceAccountEmailAddress to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmailAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceAccountEmailAddress_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.OnPremisesConfiguration onPremisesConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.OnPremisesConfiguration, + com.google.cloud.sql.v1.OnPremisesConfiguration.Builder, + com.google.cloud.sql.v1.OnPremisesConfigurationOrBuilder> + onPremisesConfigurationBuilder_; + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + * + * @return Whether the onPremisesConfiguration field is set. + */ + public boolean hasOnPremisesConfiguration() { + return ((bitField0_ & 0x00010000) != 0); + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + * + * @return The onPremisesConfiguration. + */ + public com.google.cloud.sql.v1.OnPremisesConfiguration getOnPremisesConfiguration() { + if (onPremisesConfigurationBuilder_ == null) { + return onPremisesConfiguration_ == null + ? com.google.cloud.sql.v1.OnPremisesConfiguration.getDefaultInstance() + : onPremisesConfiguration_; + } else { + return onPremisesConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + */ + public Builder setOnPremisesConfiguration( + com.google.cloud.sql.v1.OnPremisesConfiguration value) { + if (onPremisesConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + onPremisesConfiguration_ = value; + } else { + onPremisesConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + */ + public Builder setOnPremisesConfiguration( + com.google.cloud.sql.v1.OnPremisesConfiguration.Builder builderForValue) { + if (onPremisesConfigurationBuilder_ == null) { + onPremisesConfiguration_ = builderForValue.build(); + } else { + onPremisesConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + */ + public Builder mergeOnPremisesConfiguration( + com.google.cloud.sql.v1.OnPremisesConfiguration value) { + if (onPremisesConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && onPremisesConfiguration_ != null + && onPremisesConfiguration_ + != com.google.cloud.sql.v1.OnPremisesConfiguration.getDefaultInstance()) { + getOnPremisesConfigurationBuilder().mergeFrom(value); + } else { + onPremisesConfiguration_ = value; + } + } else { + onPremisesConfigurationBuilder_.mergeFrom(value); + } + if (onPremisesConfiguration_ != null) { + bitField0_ |= 0x00010000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + */ + public Builder clearOnPremisesConfiguration() { + bitField0_ = (bitField0_ & ~0x00010000); + onPremisesConfiguration_ = null; + if (onPremisesConfigurationBuilder_ != null) { + onPremisesConfigurationBuilder_.dispose(); + onPremisesConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + */ + public com.google.cloud.sql.v1.OnPremisesConfiguration.Builder + getOnPremisesConfigurationBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return internalGetOnPremisesConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + */ + public com.google.cloud.sql.v1.OnPremisesConfigurationOrBuilder + getOnPremisesConfigurationOrBuilder() { + if (onPremisesConfigurationBuilder_ != null) { + return onPremisesConfigurationBuilder_.getMessageOrBuilder(); + } else { + return onPremisesConfiguration_ == null + ? com.google.cloud.sql.v1.OnPremisesConfiguration.getDefaultInstance() + : onPremisesConfiguration_; + } + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.OnPremisesConfiguration, + com.google.cloud.sql.v1.OnPremisesConfiguration.Builder, + com.google.cloud.sql.v1.OnPremisesConfigurationOrBuilder> + internalGetOnPremisesConfigurationFieldBuilder() { + if (onPremisesConfigurationBuilder_ == null) { + onPremisesConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.OnPremisesConfiguration, + com.google.cloud.sql.v1.OnPremisesConfiguration.Builder, + com.google.cloud.sql.v1.OnPremisesConfigurationOrBuilder>( + getOnPremisesConfiguration(), getParentForChildren(), isClean()); + onPremisesConfiguration_ = null; + } + return onPremisesConfigurationBuilder_; + } + + private com.google.cloud.sql.v1.ReplicaConfiguration replicaConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ReplicaConfiguration, + com.google.cloud.sql.v1.ReplicaConfiguration.Builder, + com.google.cloud.sql.v1.ReplicaConfigurationOrBuilder> + replicaConfigurationBuilder_; + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + * + * @return Whether the replicaConfiguration field is set. + */ + public boolean hasReplicaConfiguration() { + return ((bitField0_ & 0x00020000) != 0); + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + * + * @return The replicaConfiguration. + */ + public com.google.cloud.sql.v1.ReplicaConfiguration getReplicaConfiguration() { + if (replicaConfigurationBuilder_ == null) { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1.ReplicaConfiguration.getDefaultInstance() + : replicaConfiguration_; + } else { + return replicaConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + */ + public Builder setReplicaConfiguration(com.google.cloud.sql.v1.ReplicaConfiguration value) { + if (replicaConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replicaConfiguration_ = value; + } else { + replicaConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + */ + public Builder setReplicaConfiguration( + com.google.cloud.sql.v1.ReplicaConfiguration.Builder builderForValue) { + if (replicaConfigurationBuilder_ == null) { + replicaConfiguration_ = builderForValue.build(); + } else { + replicaConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + */ + public Builder mergeReplicaConfiguration(com.google.cloud.sql.v1.ReplicaConfiguration value) { + if (replicaConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) + && replicaConfiguration_ != null + && replicaConfiguration_ + != com.google.cloud.sql.v1.ReplicaConfiguration.getDefaultInstance()) { + getReplicaConfigurationBuilder().mergeFrom(value); + } else { + replicaConfiguration_ = value; + } + } else { + replicaConfigurationBuilder_.mergeFrom(value); + } + if (replicaConfiguration_ != null) { + bitField0_ |= 0x00020000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + */ + public Builder clearReplicaConfiguration() { + bitField0_ = (bitField0_ & ~0x00020000); + replicaConfiguration_ = null; + if (replicaConfigurationBuilder_ != null) { + replicaConfigurationBuilder_.dispose(); + replicaConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + */ + public com.google.cloud.sql.v1.ReplicaConfiguration.Builder getReplicaConfigurationBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return internalGetReplicaConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + */ + public com.google.cloud.sql.v1.ReplicaConfigurationOrBuilder + getReplicaConfigurationOrBuilder() { + if (replicaConfigurationBuilder_ != null) { + return replicaConfigurationBuilder_.getMessageOrBuilder(); + } else { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1.ReplicaConfiguration.getDefaultInstance() + : replicaConfiguration_; + } + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ReplicaConfiguration, + com.google.cloud.sql.v1.ReplicaConfiguration.Builder, + com.google.cloud.sql.v1.ReplicaConfigurationOrBuilder> + internalGetReplicaConfigurationFieldBuilder() { + if (replicaConfigurationBuilder_ == null) { + replicaConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ReplicaConfiguration, + com.google.cloud.sql.v1.ReplicaConfiguration.Builder, + com.google.cloud.sql.v1.ReplicaConfigurationOrBuilder>( + getReplicaConfiguration(), getParentForChildren(), isClean()); + replicaConfiguration_ = null; + } + return replicaConfigurationBuilder_; + } + + private int backendType_ = 0; + + /** + * + * + *
+     * The backend type.
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     *
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 19; + * + * @return The enum numeric value on the wire for backendType. + */ + @java.lang.Override + public int getBackendTypeValue() { + return backendType_; + } + + /** + * + * + *
+     * The backend type.
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     *
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 19; + * + * @param value The enum numeric value on the wire for backendType to set. + * @return This builder for chaining. + */ + public Builder setBackendTypeValue(int value) { + backendType_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The backend type.
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     *
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 19; + * + * @return The backendType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackendType getBackendType() { + com.google.cloud.sql.v1.SqlBackendType result = + com.google.cloud.sql.v1.SqlBackendType.forNumber(backendType_); + return result == null ? com.google.cloud.sql.v1.SqlBackendType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The backend type.
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     *
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 19; + * + * @param value The backendType to set. + * @return This builder for chaining. + */ + public Builder setBackendType(com.google.cloud.sql.v1.SqlBackendType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00040000; + backendType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The backend type.
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     *
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 19; + * + * @return This builder for chaining. + */ + public Builder clearBackendType() { + bitField0_ = (bitField0_ & ~0x00040000); + backendType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object selfLink_ = ""; + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 20; + * + * @return The selfLink. + */ + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 20; + * + * @return The bytes for selfLink. + */ + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 20; + * + * @param value The selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selfLink_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 20; + * + * @return This builder for chaining. + */ + public Builder clearSelfLink() { + selfLink_ = getDefaultInstance().getSelfLink(); + bitField0_ = (bitField0_ & ~0x00080000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 20; + * + * @param value The bytes for selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selfLink_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList suspensionReason_ = emptyIntList(); + + private void ensureSuspensionReasonIsMutable() { + if (!suspensionReason_.isModifiable()) { + suspensionReason_ = makeMutableCopy(suspensionReason_); + } + bitField0_ |= 0x00100000; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @return A list containing the suspensionReason. + */ + public java.util.List getSuspensionReasonList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.cloud.sql.v1.SqlSuspensionReason>( + suspensionReason_, suspensionReason_converter_); + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @return The count of suspensionReason. + */ + public int getSuspensionReasonCount() { + return suspensionReason_.size(); + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index of the element to return. + * @return The suspensionReason at the given index. + */ + public com.google.cloud.sql.v1.SqlSuspensionReason getSuspensionReason(int index) { + return suspensionReason_converter_.convert(suspensionReason_.getInt(index)); + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index to set the value at. + * @param value The suspensionReason to set. + * @return This builder for chaining. + */ + public Builder setSuspensionReason( + int index, com.google.cloud.sql.v1.SqlSuspensionReason value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSuspensionReasonIsMutable(); + suspensionReason_.setInt(index, value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @param value The suspensionReason to add. + * @return This builder for chaining. + */ + public Builder addSuspensionReason(com.google.cloud.sql.v1.SqlSuspensionReason value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSuspensionReasonIsMutable(); + suspensionReason_.addInt(value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @param values The suspensionReason to add. + * @return This builder for chaining. + */ + public Builder addAllSuspensionReason( + java.lang.Iterable values) { + ensureSuspensionReasonIsMutable(); + for (com.google.cloud.sql.v1.SqlSuspensionReason value : values) { + suspensionReason_.addInt(value.getNumber()); + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @return This builder for chaining. + */ + public Builder clearSuspensionReason() { + suspensionReason_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00100000); + onChanged(); + return this; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @return A list containing the enum numeric values on the wire for suspensionReason. + */ + public java.util.List getSuspensionReasonValueList() { + suspensionReason_.makeImmutable(); + return suspensionReason_; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of suspensionReason at the given index. + */ + public int getSuspensionReasonValue(int index) { + return suspensionReason_.getInt(index); + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for suspensionReason to set. + * @return This builder for chaining. + */ + public Builder setSuspensionReasonValue(int index, int value) { + ensureSuspensionReasonIsMutable(); + suspensionReason_.setInt(index, value); + onChanged(); + return this; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @param value The enum numeric value on the wire for suspensionReason to add. + * @return This builder for chaining. + */ + public Builder addSuspensionReasonValue(int value) { + ensureSuspensionReasonIsMutable(); + suspensionReason_.addInt(value); + onChanged(); + return this; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @param values The enum numeric values on the wire for suspensionReason to add. + * @return This builder for chaining. + */ + public Builder addAllSuspensionReasonValue(java.lang.Iterable values) { + ensureSuspensionReasonIsMutable(); + for (int value : values) { + suspensionReason_.addInt(value); + } + onChanged(); + return this; + } + + private java.lang.Object connectionName_ = ""; + + /** + * + * + *
+     * Connection name of the Cloud SQL instance used in connection strings.
+     * 
+ * + * string connection_name = 22; + * + * @return The connectionName. + */ + public java.lang.String getConnectionName() { + java.lang.Object ref = connectionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Connection name of the Cloud SQL instance used in connection strings.
+     * 
+ * + * string connection_name = 22; + * + * @return The bytes for connectionName. + */ + public com.google.protobuf.ByteString getConnectionNameBytes() { + java.lang.Object ref = connectionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Connection name of the Cloud SQL instance used in connection strings.
+     * 
+ * + * string connection_name = 22; + * + * @param value The connectionName to set. + * @return This builder for chaining. + */ + public Builder setConnectionName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + connectionName_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Connection name of the Cloud SQL instance used in connection strings.
+     * 
+ * + * string connection_name = 22; + * + * @return This builder for chaining. + */ + public Builder clearConnectionName() { + connectionName_ = getDefaultInstance().getConnectionName(); + bitField0_ = (bitField0_ & ~0x00200000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Connection name of the Cloud SQL instance used in connection strings.
+     * 
+ * + * string connection_name = 22; + * + * @param value The bytes for connectionName to set. + * @return This builder for chaining. + */ + public Builder setConnectionNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + connectionName_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string name = 23; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string name = 23; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string name = 23; + * + * @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_ |= 0x00400000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string name = 23; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00400000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string name = 23; + * + * @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_ |= 0x00400000; + onChanged(); + return this; + } + + private java.lang.Object region_ = ""; + + /** + * + * + *
+     * The geographical region of the Cloud SQL instance.
+     *
+     * It can be one of the
+     * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+     * where Cloud SQL operates:
+     *
+     * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+     * The default value is `us-central1`.
+     * 
+ * + * string region = 24; + * + * @return The region. + */ + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The geographical region of the Cloud SQL instance.
+     *
+     * It can be one of the
+     * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+     * where Cloud SQL operates:
+     *
+     * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+     * The default value is `us-central1`.
+     * 
+ * + * string region = 24; + * + * @return The bytes for region. + */ + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The geographical region of the Cloud SQL instance.
+     *
+     * It can be one of the
+     * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+     * where Cloud SQL operates:
+     *
+     * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+     * The default value is `us-central1`.
+     * 
+ * + * string region = 24; + * + * @param value The region to set. + * @return This builder for chaining. + */ + public Builder setRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + region_ = value; + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The geographical region of the Cloud SQL instance.
+     *
+     * It can be one of the
+     * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+     * where Cloud SQL operates:
+     *
+     * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+     * The default value is `us-central1`.
+     * 
+ * + * string region = 24; + * + * @return This builder for chaining. + */ + public Builder clearRegion() { + region_ = getDefaultInstance().getRegion(); + bitField0_ = (bitField0_ & ~0x00800000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The geographical region of the Cloud SQL instance.
+     *
+     * It can be one of the
+     * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+     * where Cloud SQL operates:
+     *
+     * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+     * The default value is `us-central1`.
+     * 
+ * + * string region = 24; + * + * @param value The bytes for region to set. + * @return This builder for chaining. + */ + public Builder setRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + region_ = value; + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + + private java.lang.Object gceZone_ = ""; + + /** + * + * + *
+     * The Compute Engine zone that the instance is currently serving from. This
+     * value could be different from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary zone. WARNING:
+     * Changing this might restart the instance.
+     * 
+ * + * string gce_zone = 25; + * + * @return The gceZone. + */ + public java.lang.String getGceZone() { + java.lang.Object ref = gceZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gceZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Compute Engine zone that the instance is currently serving from. This
+     * value could be different from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary zone. WARNING:
+     * Changing this might restart the instance.
+     * 
+ * + * string gce_zone = 25; + * + * @return The bytes for gceZone. + */ + public com.google.protobuf.ByteString getGceZoneBytes() { + java.lang.Object ref = gceZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Compute Engine zone that the instance is currently serving from. This
+     * value could be different from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary zone. WARNING:
+     * Changing this might restart the instance.
+     * 
+ * + * string gce_zone = 25; + * + * @param value The gceZone to set. + * @return This builder for chaining. + */ + public Builder setGceZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + gceZone_ = value; + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Compute Engine zone that the instance is currently serving from. This
+     * value could be different from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary zone. WARNING:
+     * Changing this might restart the instance.
+     * 
+ * + * string gce_zone = 25; + * + * @return This builder for chaining. + */ + public Builder clearGceZone() { + gceZone_ = getDefaultInstance().getGceZone(); + bitField0_ = (bitField0_ & ~0x01000000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Compute Engine zone that the instance is currently serving from. This
+     * value could be different from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary zone. WARNING:
+     * Changing this might restart the instance.
+     * 
+ * + * string gce_zone = 25; + * + * @param value The bytes for gceZone to set. + * @return This builder for chaining. + */ + public Builder setGceZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + gceZone_ = value; + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + + private java.lang.Object secondaryGceZone_ = ""; + + /** + * + * + *
+     * The Compute Engine zone that the failover instance is currently serving
+     * from for a regional instance. This value could be different
+     * from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary/failover zone.
+     * 
+ * + * string secondary_gce_zone = 34; + * + * @return The secondaryGceZone. + */ + public java.lang.String getSecondaryGceZone() { + java.lang.Object ref = secondaryGceZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secondaryGceZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Compute Engine zone that the failover instance is currently serving
+     * from for a regional instance. This value could be different
+     * from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary/failover zone.
+     * 
+ * + * string secondary_gce_zone = 34; + * + * @return The bytes for secondaryGceZone. + */ + public com.google.protobuf.ByteString getSecondaryGceZoneBytes() { + java.lang.Object ref = secondaryGceZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secondaryGceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Compute Engine zone that the failover instance is currently serving
+     * from for a regional instance. This value could be different
+     * from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary/failover zone.
+     * 
+ * + * string secondary_gce_zone = 34; + * + * @param value The secondaryGceZone to set. + * @return This builder for chaining. + */ + public Builder setSecondaryGceZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + secondaryGceZone_ = value; + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Compute Engine zone that the failover instance is currently serving
+     * from for a regional instance. This value could be different
+     * from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary/failover zone.
+     * 
+ * + * string secondary_gce_zone = 34; + * + * @return This builder for chaining. + */ + public Builder clearSecondaryGceZone() { + secondaryGceZone_ = getDefaultInstance().getSecondaryGceZone(); + bitField0_ = (bitField0_ & ~0x02000000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Compute Engine zone that the failover instance is currently serving
+     * from for a regional instance. This value could be different
+     * from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary/failover zone.
+     * 
+ * + * string secondary_gce_zone = 34; + * + * @param value The bytes for secondaryGceZone to set. + * @return This builder for chaining. + */ + public Builder setSecondaryGceZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + secondaryGceZone_ = value; + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.DiskEncryptionConfiguration diskEncryptionConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DiskEncryptionConfiguration, + com.google.cloud.sql.v1.DiskEncryptionConfiguration.Builder, + com.google.cloud.sql.v1.DiskEncryptionConfigurationOrBuilder> + diskEncryptionConfigurationBuilder_; + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + * + * @return Whether the diskEncryptionConfiguration field is set. + */ + public boolean hasDiskEncryptionConfiguration() { + return ((bitField0_ & 0x04000000) != 0); + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + * + * @return The diskEncryptionConfiguration. + */ + public com.google.cloud.sql.v1.DiskEncryptionConfiguration getDiskEncryptionConfiguration() { + if (diskEncryptionConfigurationBuilder_ == null) { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } else { + return diskEncryptionConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + public Builder setDiskEncryptionConfiguration( + com.google.cloud.sql.v1.DiskEncryptionConfiguration value) { + if (diskEncryptionConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + diskEncryptionConfiguration_ = value; + } else { + diskEncryptionConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + public Builder setDiskEncryptionConfiguration( + com.google.cloud.sql.v1.DiskEncryptionConfiguration.Builder builderForValue) { + if (diskEncryptionConfigurationBuilder_ == null) { + diskEncryptionConfiguration_ = builderForValue.build(); + } else { + diskEncryptionConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + public Builder mergeDiskEncryptionConfiguration( + com.google.cloud.sql.v1.DiskEncryptionConfiguration value) { + if (diskEncryptionConfigurationBuilder_ == null) { + if (((bitField0_ & 0x04000000) != 0) + && diskEncryptionConfiguration_ != null + && diskEncryptionConfiguration_ + != com.google.cloud.sql.v1.DiskEncryptionConfiguration.getDefaultInstance()) { + getDiskEncryptionConfigurationBuilder().mergeFrom(value); + } else { + diskEncryptionConfiguration_ = value; + } + } else { + diskEncryptionConfigurationBuilder_.mergeFrom(value); + } + if (diskEncryptionConfiguration_ != null) { + bitField0_ |= 0x04000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + public Builder clearDiskEncryptionConfiguration() { + bitField0_ = (bitField0_ & ~0x04000000); + diskEncryptionConfiguration_ = null; + if (diskEncryptionConfigurationBuilder_ != null) { + diskEncryptionConfigurationBuilder_.dispose(); + diskEncryptionConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + public com.google.cloud.sql.v1.DiskEncryptionConfiguration.Builder + getDiskEncryptionConfigurationBuilder() { + bitField0_ |= 0x04000000; + onChanged(); + return internalGetDiskEncryptionConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + public com.google.cloud.sql.v1.DiskEncryptionConfigurationOrBuilder + getDiskEncryptionConfigurationOrBuilder() { + if (diskEncryptionConfigurationBuilder_ != null) { + return diskEncryptionConfigurationBuilder_.getMessageOrBuilder(); + } else { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DiskEncryptionConfiguration, + com.google.cloud.sql.v1.DiskEncryptionConfiguration.Builder, + com.google.cloud.sql.v1.DiskEncryptionConfigurationOrBuilder> + internalGetDiskEncryptionConfigurationFieldBuilder() { + if (diskEncryptionConfigurationBuilder_ == null) { + diskEncryptionConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DiskEncryptionConfiguration, + com.google.cloud.sql.v1.DiskEncryptionConfiguration.Builder, + com.google.cloud.sql.v1.DiskEncryptionConfigurationOrBuilder>( + getDiskEncryptionConfiguration(), getParentForChildren(), isClean()); + diskEncryptionConfiguration_ = null; + } + return diskEncryptionConfigurationBuilder_; + } + + private com.google.cloud.sql.v1.DiskEncryptionStatus diskEncryptionStatus_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DiskEncryptionStatus, + com.google.cloud.sql.v1.DiskEncryptionStatus.Builder, + com.google.cloud.sql.v1.DiskEncryptionStatusOrBuilder> + diskEncryptionStatusBuilder_; + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + * + * @return Whether the diskEncryptionStatus field is set. + */ + public boolean hasDiskEncryptionStatus() { + return ((bitField0_ & 0x08000000) != 0); + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + * + * @return The diskEncryptionStatus. + */ + public com.google.cloud.sql.v1.DiskEncryptionStatus getDiskEncryptionStatus() { + if (diskEncryptionStatusBuilder_ == null) { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } else { + return diskEncryptionStatusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + */ + public Builder setDiskEncryptionStatus(com.google.cloud.sql.v1.DiskEncryptionStatus value) { + if (diskEncryptionStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + diskEncryptionStatus_ = value; + } else { + diskEncryptionStatusBuilder_.setMessage(value); + } + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + */ + public Builder setDiskEncryptionStatus( + com.google.cloud.sql.v1.DiskEncryptionStatus.Builder builderForValue) { + if (diskEncryptionStatusBuilder_ == null) { + diskEncryptionStatus_ = builderForValue.build(); + } else { + diskEncryptionStatusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + */ + public Builder mergeDiskEncryptionStatus(com.google.cloud.sql.v1.DiskEncryptionStatus value) { + if (diskEncryptionStatusBuilder_ == null) { + if (((bitField0_ & 0x08000000) != 0) + && diskEncryptionStatus_ != null + && diskEncryptionStatus_ + != com.google.cloud.sql.v1.DiskEncryptionStatus.getDefaultInstance()) { + getDiskEncryptionStatusBuilder().mergeFrom(value); + } else { + diskEncryptionStatus_ = value; + } + } else { + diskEncryptionStatusBuilder_.mergeFrom(value); + } + if (diskEncryptionStatus_ != null) { + bitField0_ |= 0x08000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + */ + public Builder clearDiskEncryptionStatus() { + bitField0_ = (bitField0_ & ~0x08000000); + diskEncryptionStatus_ = null; + if (diskEncryptionStatusBuilder_ != null) { + diskEncryptionStatusBuilder_.dispose(); + diskEncryptionStatusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + */ + public com.google.cloud.sql.v1.DiskEncryptionStatus.Builder getDiskEncryptionStatusBuilder() { + bitField0_ |= 0x08000000; + onChanged(); + return internalGetDiskEncryptionStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + */ + public com.google.cloud.sql.v1.DiskEncryptionStatusOrBuilder + getDiskEncryptionStatusOrBuilder() { + if (diskEncryptionStatusBuilder_ != null) { + return diskEncryptionStatusBuilder_.getMessageOrBuilder(); + } else { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DiskEncryptionStatus, + com.google.cloud.sql.v1.DiskEncryptionStatus.Builder, + com.google.cloud.sql.v1.DiskEncryptionStatusOrBuilder> + internalGetDiskEncryptionStatusFieldBuilder() { + if (diskEncryptionStatusBuilder_ == null) { + diskEncryptionStatusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DiskEncryptionStatus, + com.google.cloud.sql.v1.DiskEncryptionStatus.Builder, + com.google.cloud.sql.v1.DiskEncryptionStatusOrBuilder>( + getDiskEncryptionStatus(), getParentForChildren(), isClean()); + diskEncryptionStatus_ = null; + } + return diskEncryptionStatusBuilder_; + } + + private java.lang.Object rootPassword_ = ""; + + /** + * + * + *
+     * Initial root password. Use only on creation. You must set root passwords
+     * before you can connect to PostgreSQL instances.
+     * 
+ * + * string root_password = 29; + * + * @return The rootPassword. + */ + public java.lang.String getRootPassword() { + java.lang.Object ref = rootPassword_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rootPassword_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Initial root password. Use only on creation. You must set root passwords
+     * before you can connect to PostgreSQL instances.
+     * 
+ * + * string root_password = 29; + * + * @return The bytes for rootPassword. + */ + public com.google.protobuf.ByteString getRootPasswordBytes() { + java.lang.Object ref = rootPassword_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rootPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Initial root password. Use only on creation. You must set root passwords
+     * before you can connect to PostgreSQL instances.
+     * 
+ * + * string root_password = 29; + * + * @param value The rootPassword to set. + * @return This builder for chaining. + */ + public Builder setRootPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + rootPassword_ = value; + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Initial root password. Use only on creation. You must set root passwords
+     * before you can connect to PostgreSQL instances.
+     * 
+ * + * string root_password = 29; + * + * @return This builder for chaining. + */ + public Builder clearRootPassword() { + rootPassword_ = getDefaultInstance().getRootPassword(); + bitField0_ = (bitField0_ & ~0x10000000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Initial root password. Use only on creation. You must set root passwords
+     * before you can connect to PostgreSQL instances.
+     * 
+ * + * string root_password = 29; + * + * @param value The bytes for rootPassword to set. + * @return This builder for chaining. + */ + public Builder setRootPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + rootPassword_ = value; + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduledMaintenance_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance, + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.Builder, + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenanceOrBuilder> + scheduledMaintenanceBuilder_; + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + * + * @return Whether the scheduledMaintenance field is set. + */ + public boolean hasScheduledMaintenance() { + return ((bitField0_ & 0x20000000) != 0); + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + * + * @return The scheduledMaintenance. + */ + public com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance + getScheduledMaintenance() { + if (scheduledMaintenanceBuilder_ == null) { + return scheduledMaintenance_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.getDefaultInstance() + : scheduledMaintenance_; + } else { + return scheduledMaintenanceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + public Builder setScheduledMaintenance( + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance value) { + if (scheduledMaintenanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scheduledMaintenance_ = value; + } else { + scheduledMaintenanceBuilder_.setMessage(value); + } + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + public Builder setScheduledMaintenance( + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.Builder builderForValue) { + if (scheduledMaintenanceBuilder_ == null) { + scheduledMaintenance_ = builderForValue.build(); + } else { + scheduledMaintenanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + public Builder mergeScheduledMaintenance( + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance value) { + if (scheduledMaintenanceBuilder_ == null) { + if (((bitField0_ & 0x20000000) != 0) + && scheduledMaintenance_ != null + && scheduledMaintenance_ + != com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance + .getDefaultInstance()) { + getScheduledMaintenanceBuilder().mergeFrom(value); + } else { + scheduledMaintenance_ = value; + } + } else { + scheduledMaintenanceBuilder_.mergeFrom(value); + } + if (scheduledMaintenance_ != null) { + bitField0_ |= 0x20000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + public Builder clearScheduledMaintenance() { + bitField0_ = (bitField0_ & ~0x20000000); + scheduledMaintenance_ = null; + if (scheduledMaintenanceBuilder_ != null) { + scheduledMaintenanceBuilder_.dispose(); + scheduledMaintenanceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + public com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.Builder + getScheduledMaintenanceBuilder() { + bitField0_ |= 0x20000000; + onChanged(); + return internalGetScheduledMaintenanceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + public com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenanceOrBuilder + getScheduledMaintenanceOrBuilder() { + if (scheduledMaintenanceBuilder_ != null) { + return scheduledMaintenanceBuilder_.getMessageOrBuilder(); + } else { + return scheduledMaintenance_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.getDefaultInstance() + : scheduledMaintenance_; + } + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance, + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.Builder, + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenanceOrBuilder> + internalGetScheduledMaintenanceFieldBuilder() { + if (scheduledMaintenanceBuilder_ == null) { + scheduledMaintenanceBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance, + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.Builder, + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenanceOrBuilder>( + getScheduledMaintenance(), getParentForChildren(), isClean()); + scheduledMaintenance_ = null; + } + return scheduledMaintenanceBuilder_; + } + + private com.google.protobuf.BoolValue satisfiesPzs_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + satisfiesPzsBuilder_; + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + * + * @return Whether the satisfiesPzs field is set. + */ + public boolean hasSatisfiesPzs() { + return ((bitField0_ & 0x40000000) != 0); + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + * + * @return The satisfiesPzs. + */ + public com.google.protobuf.BoolValue getSatisfiesPzs() { + if (satisfiesPzsBuilder_ == null) { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } else { + return satisfiesPzsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + satisfiesPzs_ = value; + } else { + satisfiesPzsBuilder_.setMessage(value); + } + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue.Builder builderForValue) { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = builderForValue.build(); + } else { + satisfiesPzsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + public Builder mergeSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (((bitField0_ & 0x40000000) != 0) + && satisfiesPzs_ != null + && satisfiesPzs_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getSatisfiesPzsBuilder().mergeFrom(value); + } else { + satisfiesPzs_ = value; + } + } else { + satisfiesPzsBuilder_.mergeFrom(value); + } + if (satisfiesPzs_ != null) { + bitField0_ |= 0x40000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + public Builder clearSatisfiesPzs() { + bitField0_ = (bitField0_ & ~0x40000000); + satisfiesPzs_ = null; + if (satisfiesPzsBuilder_ != null) { + satisfiesPzsBuilder_.dispose(); + satisfiesPzsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + public com.google.protobuf.BoolValue.Builder getSatisfiesPzsBuilder() { + bitField0_ |= 0x40000000; + onChanged(); + return internalGetSatisfiesPzsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + if (satisfiesPzsBuilder_ != null) { + return satisfiesPzsBuilder_.getMessageOrBuilder(); + } else { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetSatisfiesPzsFieldBuilder() { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSatisfiesPzs(), getParentForChildren(), isClean()); + satisfiesPzs_ = null; + } + return satisfiesPzsBuilder_; + } + + private java.lang.Object databaseInstalledVersion_ = ""; + + /** + * + * + *
+     * Output only. Stores the current database version running on the instance
+     * including minor version such as `MYSQL_8_0_18`.
+     * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseInstalledVersion. + */ + public java.lang.String getDatabaseInstalledVersion() { + java.lang.Object ref = databaseInstalledVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + databaseInstalledVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. Stores the current database version running on the instance
+     * including minor version such as `MYSQL_8_0_18`.
+     * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for databaseInstalledVersion. + */ + public com.google.protobuf.ByteString getDatabaseInstalledVersionBytes() { + java.lang.Object ref = databaseInstalledVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + databaseInstalledVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. Stores the current database version running on the instance
+     * including minor version such as `MYSQL_8_0_18`.
+     * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The databaseInstalledVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseInstalledVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + databaseInstalledVersion_ = value; + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Stores the current database version running on the instance
+     * including minor version such as `MYSQL_8_0_18`.
+     * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDatabaseInstalledVersion() { + databaseInstalledVersion_ = getDefaultInstance().getDatabaseInstalledVersion(); + bitField0_ = (bitField0_ & ~0x80000000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Stores the current database version running on the instance
+     * including minor version such as `MYSQL_8_0_18`.
+     * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for databaseInstalledVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseInstalledVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + databaseInstalledVersion_ = value; + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport outOfDiskReport_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport, + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.Builder, + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReportOrBuilder> + outOfDiskReportBuilder_; + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + * + * @return Whether the outOfDiskReport field is set. + */ + public boolean hasOutOfDiskReport() { + return ((bitField1_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + * + * @return The outOfDiskReport. + */ + public com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport getOutOfDiskReport() { + if (outOfDiskReportBuilder_ == null) { + return outOfDiskReport_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.getDefaultInstance() + : outOfDiskReport_; + } else { + return outOfDiskReportBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + public Builder setOutOfDiskReport( + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport value) { + if (outOfDiskReportBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outOfDiskReport_ = value; + } else { + outOfDiskReportBuilder_.setMessage(value); + } + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + public Builder setOutOfDiskReport( + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.Builder builderForValue) { + if (outOfDiskReportBuilder_ == null) { + outOfDiskReport_ = builderForValue.build(); + } else { + outOfDiskReportBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + public Builder mergeOutOfDiskReport( + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport value) { + if (outOfDiskReportBuilder_ == null) { + if (((bitField1_ & 0x00000001) != 0) + && outOfDiskReport_ != null + && outOfDiskReport_ + != com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport + .getDefaultInstance()) { + getOutOfDiskReportBuilder().mergeFrom(value); + } else { + outOfDiskReport_ = value; + } + } else { + outOfDiskReportBuilder_.mergeFrom(value); + } + if (outOfDiskReport_ != null) { + bitField1_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + public Builder clearOutOfDiskReport() { + bitField1_ = (bitField1_ & ~0x00000001); + outOfDiskReport_ = null; + if (outOfDiskReportBuilder_ != null) { + outOfDiskReportBuilder_.dispose(); + outOfDiskReportBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + public com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.Builder + getOutOfDiskReportBuilder() { + bitField1_ |= 0x00000001; + onChanged(); + return internalGetOutOfDiskReportFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + public com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReportOrBuilder + getOutOfDiskReportOrBuilder() { + if (outOfDiskReportBuilder_ != null) { + return outOfDiskReportBuilder_.getMessageOrBuilder(); + } else { + return outOfDiskReport_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.getDefaultInstance() + : outOfDiskReport_; + } + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport, + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.Builder, + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReportOrBuilder> + internalGetOutOfDiskReportFieldBuilder() { + if (outOfDiskReportBuilder_ == null) { + outOfDiskReportBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport, + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.Builder, + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReportOrBuilder>( + getOutOfDiskReport(), getParentForChildren(), isClean()); + outOfDiskReport_ = null; + } + return outOfDiskReportBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField1_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.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); + } + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.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()); + } + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField1_ & 0x00000002) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField1_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField1_ = (bitField1_ & ~0x00000002); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField1_ |= 0x00000002; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.LazyStringArrayList availableMaintenanceVersions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAvailableMaintenanceVersionsIsMutable() { + if (!availableMaintenanceVersions_.isModifiable()) { + availableMaintenanceVersions_ = + new com.google.protobuf.LazyStringArrayList(availableMaintenanceVersions_); + } + bitField1_ |= 0x00000004; + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the availableMaintenanceVersions. + */ + public com.google.protobuf.ProtocolStringList getAvailableMaintenanceVersionsList() { + availableMaintenanceVersions_.makeImmutable(); + return availableMaintenanceVersions_; + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of availableMaintenanceVersions. + */ + public int getAvailableMaintenanceVersionsCount() { + return availableMaintenanceVersions_.size(); + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The availableMaintenanceVersions at the given index. + */ + public java.lang.String getAvailableMaintenanceVersions(int index) { + return availableMaintenanceVersions_.get(index); + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the availableMaintenanceVersions at the given index. + */ + public com.google.protobuf.ByteString getAvailableMaintenanceVersionsBytes(int index) { + return availableMaintenanceVersions_.getByteString(index); + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The availableMaintenanceVersions to set. + * @return This builder for chaining. + */ + public Builder setAvailableMaintenanceVersions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAvailableMaintenanceVersionsIsMutable(); + availableMaintenanceVersions_.set(index, value); + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The availableMaintenanceVersions to add. + * @return This builder for chaining. + */ + public Builder addAvailableMaintenanceVersions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAvailableMaintenanceVersionsIsMutable(); + availableMaintenanceVersions_.add(value); + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The availableMaintenanceVersions to add. + * @return This builder for chaining. + */ + public Builder addAllAvailableMaintenanceVersions(java.lang.Iterable values) { + ensureAvailableMaintenanceVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, availableMaintenanceVersions_); + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearAvailableMaintenanceVersions() { + availableMaintenanceVersions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField1_ = (bitField1_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes of the availableMaintenanceVersions to add. + * @return This builder for chaining. + */ + public Builder addAvailableMaintenanceVersionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAvailableMaintenanceVersionsIsMutable(); + availableMaintenanceVersions_.add(value); + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object maintenanceVersion_ = ""; + + /** + * + * + *
+     * The current software version on the instance.
+     * 
+ * + * string maintenance_version = 42; + * + * @return The maintenanceVersion. + */ + public java.lang.String getMaintenanceVersion() { + java.lang.Object ref = maintenanceVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + maintenanceVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The current software version on the instance.
+     * 
+ * + * string maintenance_version = 42; + * + * @return The bytes for maintenanceVersion. + */ + public com.google.protobuf.ByteString getMaintenanceVersionBytes() { + java.lang.Object ref = maintenanceVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + maintenanceVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The current software version on the instance.
+     * 
+ * + * string maintenance_version = 42; + * + * @param value The maintenanceVersion to set. + * @return This builder for chaining. + */ + public Builder setMaintenanceVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceVersion_ = value; + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The current software version on the instance.
+     * 
+ * + * string maintenance_version = 42; + * + * @return This builder for chaining. + */ + public Builder clearMaintenanceVersion() { + maintenanceVersion_ = getDefaultInstance().getMaintenanceVersion(); + bitField1_ = (bitField1_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The current software version on the instance.
+     * 
+ * + * string maintenance_version = 42; + * + * @param value The bytes for maintenanceVersion to set. + * @return This builder for chaining. + */ + public Builder setMaintenanceVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + maintenanceVersion_ = value; + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + + private java.util.List + upgradableDatabaseVersions_ = java.util.Collections.emptyList(); + + private void ensureUpgradableDatabaseVersionsIsMutable() { + if (!((bitField1_ & 0x00000010) != 0)) { + upgradableDatabaseVersions_ = + new java.util.ArrayList( + upgradableDatabaseVersions_); + bitField1_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.AvailableDatabaseVersion, + com.google.cloud.sql.v1.AvailableDatabaseVersion.Builder, + com.google.cloud.sql.v1.AvailableDatabaseVersionOrBuilder> + upgradableDatabaseVersionsBuilder_; + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getUpgradableDatabaseVersionsList() { + if (upgradableDatabaseVersionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(upgradableDatabaseVersions_); + } else { + return upgradableDatabaseVersionsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getUpgradableDatabaseVersionsCount() { + if (upgradableDatabaseVersionsBuilder_ == null) { + return upgradableDatabaseVersions_.size(); + } else { + return upgradableDatabaseVersionsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.AvailableDatabaseVersion getUpgradableDatabaseVersions( + int index) { + if (upgradableDatabaseVersionsBuilder_ == null) { + return upgradableDatabaseVersions_.get(index); + } else { + return upgradableDatabaseVersionsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpgradableDatabaseVersions( + int index, com.google.cloud.sql.v1.AvailableDatabaseVersion value) { + if (upgradableDatabaseVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.set(index, value); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpgradableDatabaseVersions( + int index, com.google.cloud.sql.v1.AvailableDatabaseVersion.Builder builderForValue) { + if (upgradableDatabaseVersionsBuilder_ == null) { + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.set(index, builderForValue.build()); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpgradableDatabaseVersions( + com.google.cloud.sql.v1.AvailableDatabaseVersion value) { + if (upgradableDatabaseVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.add(value); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpgradableDatabaseVersions( + int index, com.google.cloud.sql.v1.AvailableDatabaseVersion value) { + if (upgradableDatabaseVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.add(index, value); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpgradableDatabaseVersions( + com.google.cloud.sql.v1.AvailableDatabaseVersion.Builder builderForValue) { + if (upgradableDatabaseVersionsBuilder_ == null) { + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.add(builderForValue.build()); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpgradableDatabaseVersions( + int index, com.google.cloud.sql.v1.AvailableDatabaseVersion.Builder builderForValue) { + if (upgradableDatabaseVersionsBuilder_ == null) { + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.add(index, builderForValue.build()); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllUpgradableDatabaseVersions( + java.lang.Iterable values) { + if (upgradableDatabaseVersionsBuilder_ == null) { + ensureUpgradableDatabaseVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, upgradableDatabaseVersions_); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpgradableDatabaseVersions() { + if (upgradableDatabaseVersionsBuilder_ == null) { + upgradableDatabaseVersions_ = java.util.Collections.emptyList(); + bitField1_ = (bitField1_ & ~0x00000010); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeUpgradableDatabaseVersions(int index) { + if (upgradableDatabaseVersionsBuilder_ == null) { + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.remove(index); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.AvailableDatabaseVersion.Builder + getUpgradableDatabaseVersionsBuilder(int index) { + return internalGetUpgradableDatabaseVersionsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.AvailableDatabaseVersionOrBuilder + getUpgradableDatabaseVersionsOrBuilder(int index) { + if (upgradableDatabaseVersionsBuilder_ == null) { + return upgradableDatabaseVersions_.get(index); + } else { + return upgradableDatabaseVersionsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getUpgradableDatabaseVersionsOrBuilderList() { + if (upgradableDatabaseVersionsBuilder_ != null) { + return upgradableDatabaseVersionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(upgradableDatabaseVersions_); + } + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.AvailableDatabaseVersion.Builder + addUpgradableDatabaseVersionsBuilder() { + return internalGetUpgradableDatabaseVersionsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.AvailableDatabaseVersion.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.AvailableDatabaseVersion.Builder + addUpgradableDatabaseVersionsBuilder(int index) { + return internalGetUpgradableDatabaseVersionsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.AvailableDatabaseVersion.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getUpgradableDatabaseVersionsBuilderList() { + return internalGetUpgradableDatabaseVersionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.AvailableDatabaseVersion, + com.google.cloud.sql.v1.AvailableDatabaseVersion.Builder, + com.google.cloud.sql.v1.AvailableDatabaseVersionOrBuilder> + internalGetUpgradableDatabaseVersionsFieldBuilder() { + if (upgradableDatabaseVersionsBuilder_ == null) { + upgradableDatabaseVersionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.AvailableDatabaseVersion, + com.google.cloud.sql.v1.AvailableDatabaseVersion.Builder, + com.google.cloud.sql.v1.AvailableDatabaseVersionOrBuilder>( + upgradableDatabaseVersions_, + ((bitField1_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + upgradableDatabaseVersions_ = null; + } + return upgradableDatabaseVersionsBuilder_; + } + + private int sqlNetworkArchitecture_ = 0; + + /** + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return Whether the sqlNetworkArchitecture field is set. + */ + @java.lang.Override + public boolean hasSqlNetworkArchitecture() { + return ((bitField1_ & 0x00000020) != 0); + } + + /** + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return The enum numeric value on the wire for sqlNetworkArchitecture. + */ + @java.lang.Override + public int getSqlNetworkArchitectureValue() { + return sqlNetworkArchitecture_; + } + + /** + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @param value The enum numeric value on the wire for sqlNetworkArchitecture to set. + * @return This builder for chaining. + */ + public Builder setSqlNetworkArchitectureValue(int value) { + sqlNetworkArchitecture_ = value; + bitField1_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return The sqlNetworkArchitecture. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture + getSqlNetworkArchitecture() { + com.google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture result = + com.google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture.forNumber( + sqlNetworkArchitecture_); + return result == null + ? com.google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture.UNRECOGNIZED + : result; + } + + /** + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @param value The sqlNetworkArchitecture to set. + * @return This builder for chaining. + */ + public Builder setSqlNetworkArchitecture( + com.google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture value) { + if (value == null) { + throw new NullPointerException(); + } + bitField1_ |= 0x00000020; + sqlNetworkArchitecture_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return This builder for chaining. + */ + public Builder clearSqlNetworkArchitecture() { + bitField1_ = (bitField1_ & ~0x00000020); + sqlNetworkArchitecture_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pscServiceAttachmentLink_ = ""; + + /** + * + * + *
+     * Output only. The link to service attachment of PSC instance.
+     * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscServiceAttachmentLink field is set. + */ + public boolean hasPscServiceAttachmentLink() { + return ((bitField1_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Output only. The link to service attachment of PSC instance.
+     * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscServiceAttachmentLink. + */ + public java.lang.String getPscServiceAttachmentLink() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pscServiceAttachmentLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The link to service attachment of PSC instance.
+     * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for pscServiceAttachmentLink. + */ + public com.google.protobuf.ByteString getPscServiceAttachmentLinkBytes() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pscServiceAttachmentLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The link to service attachment of PSC instance.
+     * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The pscServiceAttachmentLink to set. + * @return This builder for chaining. + */ + public Builder setPscServiceAttachmentLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pscServiceAttachmentLink_ = value; + bitField1_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The link to service attachment of PSC instance.
+     * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearPscServiceAttachmentLink() { + pscServiceAttachmentLink_ = getDefaultInstance().getPscServiceAttachmentLink(); + bitField1_ = (bitField1_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The link to service attachment of PSC instance.
+     * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for pscServiceAttachmentLink to set. + * @return This builder for chaining. + */ + public Builder setPscServiceAttachmentLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pscServiceAttachmentLink_ = value; + bitField1_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object dnsName_ = ""; + + /** + * + * + *
+     * Output only. The dns name of the instance.
+     * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + public boolean hasDnsName() { + return ((bitField1_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Output only. The dns name of the instance.
+     * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The dns name of the instance.
+     * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The dns name of the instance.
+     * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dnsName_ = value; + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The dns name of the instance.
+     * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDnsName() { + dnsName_ = getDefaultInstance().getDnsName(); + bitField1_ = (bitField1_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The dns name of the instance.
+     * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dnsName_ = value; + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object primaryDnsName_ = ""; + + /** + * + * + *
+     * Output only. DEPRECATED: please use write_endpoint instead.
+     * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1711 + * @return Whether the primaryDnsName field is set. + */ + @java.lang.Deprecated + public boolean hasPrimaryDnsName() { + return ((bitField1_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Output only. DEPRECATED: please use write_endpoint instead.
+     * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1711 + * @return The primaryDnsName. + */ + @java.lang.Deprecated + public java.lang.String getPrimaryDnsName() { + java.lang.Object ref = primaryDnsName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryDnsName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. DEPRECATED: please use write_endpoint instead.
+     * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1711 + * @return The bytes for primaryDnsName. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getPrimaryDnsNameBytes() { + java.lang.Object ref = primaryDnsName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryDnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. DEPRECATED: please use write_endpoint instead.
+     * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1711 + * @param value The primaryDnsName to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setPrimaryDnsName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + primaryDnsName_ = value; + bitField1_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. DEPRECATED: please use write_endpoint instead.
+     * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1711 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearPrimaryDnsName() { + primaryDnsName_ = getDefaultInstance().getPrimaryDnsName(); + bitField1_ = (bitField1_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. DEPRECATED: please use write_endpoint instead.
+     * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1711 + * @param value The bytes for primaryDnsName to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setPrimaryDnsNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + primaryDnsName_ = value; + bitField1_ |= 0x00000100; + onChanged(); + return this; + } + + private java.lang.Object writeEndpoint_ = ""; + + /** + * + * + *
+     * Output only. The dns name of the primary instance in a replication group.
+     * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writeEndpoint field is set. + */ + public boolean hasWriteEndpoint() { + return ((bitField1_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Output only. The dns name of the primary instance in a replication group.
+     * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writeEndpoint. + */ + public java.lang.String getWriteEndpoint() { + java.lang.Object ref = writeEndpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + writeEndpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The dns name of the primary instance in a replication group.
+     * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for writeEndpoint. + */ + public com.google.protobuf.ByteString getWriteEndpointBytes() { + java.lang.Object ref = writeEndpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + writeEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The dns name of the primary instance in a replication group.
+     * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The writeEndpoint to set. + * @return This builder for chaining. + */ + public Builder setWriteEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + writeEndpoint_ = value; + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The dns name of the primary instance in a replication group.
+     * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearWriteEndpoint() { + writeEndpoint_ = getDefaultInstance().getWriteEndpoint(); + bitField1_ = (bitField1_ & ~0x00000200); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The dns name of the primary instance in a replication group.
+     * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for writeEndpoint to set. + * @return This builder for chaining. + */ + public Builder setWriteEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + writeEndpoint_ = value; + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.ReplicationCluster replicationCluster_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ReplicationCluster, + com.google.cloud.sql.v1.ReplicationCluster.Builder, + com.google.cloud.sql.v1.ReplicationClusterOrBuilder> + replicationClusterBuilder_; + + /** + * + * + *
+     * Optional. A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the replicationCluster field is set. + */ + public boolean hasReplicationCluster() { + return ((bitField1_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Optional. A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The replicationCluster. + */ + public com.google.cloud.sql.v1.ReplicationCluster getReplicationCluster() { + if (replicationClusterBuilder_ == null) { + return replicationCluster_ == null + ? com.google.cloud.sql.v1.ReplicationCluster.getDefaultInstance() + : replicationCluster_; + } else { + return replicationClusterBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReplicationCluster(com.google.cloud.sql.v1.ReplicationCluster value) { + if (replicationClusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replicationCluster_ = value; + } else { + replicationClusterBuilder_.setMessage(value); + } + bitField1_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReplicationCluster( + com.google.cloud.sql.v1.ReplicationCluster.Builder builderForValue) { + if (replicationClusterBuilder_ == null) { + replicationCluster_ = builderForValue.build(); + } else { + replicationClusterBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeReplicationCluster(com.google.cloud.sql.v1.ReplicationCluster value) { + if (replicationClusterBuilder_ == null) { + if (((bitField1_ & 0x00000400) != 0) + && replicationCluster_ != null + && replicationCluster_ + != com.google.cloud.sql.v1.ReplicationCluster.getDefaultInstance()) { + getReplicationClusterBuilder().mergeFrom(value); + } else { + replicationCluster_ = value; + } + } else { + replicationClusterBuilder_.mergeFrom(value); + } + if (replicationCluster_ != null) { + bitField1_ |= 0x00000400; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearReplicationCluster() { + bitField1_ = (bitField1_ & ~0x00000400); + replicationCluster_ = null; + if (replicationClusterBuilder_ != null) { + replicationClusterBuilder_.dispose(); + replicationClusterBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ReplicationCluster.Builder getReplicationClusterBuilder() { + bitField1_ |= 0x00000400; + onChanged(); + return internalGetReplicationClusterFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ReplicationClusterOrBuilder getReplicationClusterOrBuilder() { + if (replicationClusterBuilder_ != null) { + return replicationClusterBuilder_.getMessageOrBuilder(); + } else { + return replicationCluster_ == null + ? com.google.cloud.sql.v1.ReplicationCluster.getDefaultInstance() + : replicationCluster_; + } + } + + /** + * + * + *
+     * Optional. A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ReplicationCluster, + com.google.cloud.sql.v1.ReplicationCluster.Builder, + com.google.cloud.sql.v1.ReplicationClusterOrBuilder> + internalGetReplicationClusterFieldBuilder() { + if (replicationClusterBuilder_ == null) { + replicationClusterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ReplicationCluster, + com.google.cloud.sql.v1.ReplicationCluster.Builder, + com.google.cloud.sql.v1.ReplicationClusterOrBuilder>( + getReplicationCluster(), getParentForChildren(), isClean()); + replicationCluster_ = null; + } + return replicationClusterBuilder_; + } + + private com.google.cloud.sql.v1.GeminiInstanceConfig geminiConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.GeminiInstanceConfig, + com.google.cloud.sql.v1.GeminiInstanceConfig.Builder, + com.google.cloud.sql.v1.GeminiInstanceConfigOrBuilder> + geminiConfigBuilder_; + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + * + * @return Whether the geminiConfig field is set. + */ + public boolean hasGeminiConfig() { + return ((bitField1_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + * + * @return The geminiConfig. + */ + public com.google.cloud.sql.v1.GeminiInstanceConfig getGeminiConfig() { + if (geminiConfigBuilder_ == null) { + return geminiConfig_ == null + ? com.google.cloud.sql.v1.GeminiInstanceConfig.getDefaultInstance() + : geminiConfig_; + } else { + return geminiConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + */ + public Builder setGeminiConfig(com.google.cloud.sql.v1.GeminiInstanceConfig value) { + if (geminiConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + geminiConfig_ = value; + } else { + geminiConfigBuilder_.setMessage(value); + } + bitField1_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + */ + public Builder setGeminiConfig( + com.google.cloud.sql.v1.GeminiInstanceConfig.Builder builderForValue) { + if (geminiConfigBuilder_ == null) { + geminiConfig_ = builderForValue.build(); + } else { + geminiConfigBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + */ + public Builder mergeGeminiConfig(com.google.cloud.sql.v1.GeminiInstanceConfig value) { + if (geminiConfigBuilder_ == null) { + if (((bitField1_ & 0x00000800) != 0) + && geminiConfig_ != null + && geminiConfig_ != com.google.cloud.sql.v1.GeminiInstanceConfig.getDefaultInstance()) { + getGeminiConfigBuilder().mergeFrom(value); + } else { + geminiConfig_ = value; + } + } else { + geminiConfigBuilder_.mergeFrom(value); + } + if (geminiConfig_ != null) { + bitField1_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + */ + public Builder clearGeminiConfig() { + bitField1_ = (bitField1_ & ~0x00000800); + geminiConfig_ = null; + if (geminiConfigBuilder_ != null) { + geminiConfigBuilder_.dispose(); + geminiConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + */ + public com.google.cloud.sql.v1.GeminiInstanceConfig.Builder getGeminiConfigBuilder() { + bitField1_ |= 0x00000800; + onChanged(); + return internalGetGeminiConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + */ + public com.google.cloud.sql.v1.GeminiInstanceConfigOrBuilder getGeminiConfigOrBuilder() { + if (geminiConfigBuilder_ != null) { + return geminiConfigBuilder_.getMessageOrBuilder(); + } else { + return geminiConfig_ == null + ? com.google.cloud.sql.v1.GeminiInstanceConfig.getDefaultInstance() + : geminiConfig_; + } + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.GeminiInstanceConfig, + com.google.cloud.sql.v1.GeminiInstanceConfig.Builder, + com.google.cloud.sql.v1.GeminiInstanceConfigOrBuilder> + internalGetGeminiConfigFieldBuilder() { + if (geminiConfigBuilder_ == null) { + geminiConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.GeminiInstanceConfig, + com.google.cloud.sql.v1.GeminiInstanceConfig.Builder, + com.google.cloud.sql.v1.GeminiInstanceConfigOrBuilder>( + getGeminiConfig(), getParentForChildren(), isClean()); + geminiConfig_ = null; + } + return geminiConfigBuilder_; + } + + private com.google.protobuf.BoolValue satisfiesPzi_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + satisfiesPziBuilder_; + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzi field is set. + */ + public boolean hasSatisfiesPzi() { + return ((bitField1_ & 0x00001000) != 0); + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzi. + */ + public com.google.protobuf.BoolValue getSatisfiesPzi() { + if (satisfiesPziBuilder_ == null) { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } else { + return satisfiesPziBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzi(com.google.protobuf.BoolValue value) { + if (satisfiesPziBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + satisfiesPzi_ = value; + } else { + satisfiesPziBuilder_.setMessage(value); + } + bitField1_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzi(com.google.protobuf.BoolValue.Builder builderForValue) { + if (satisfiesPziBuilder_ == null) { + satisfiesPzi_ = builderForValue.build(); + } else { + satisfiesPziBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSatisfiesPzi(com.google.protobuf.BoolValue value) { + if (satisfiesPziBuilder_ == null) { + if (((bitField1_ & 0x00001000) != 0) + && satisfiesPzi_ != null + && satisfiesPzi_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getSatisfiesPziBuilder().mergeFrom(value); + } else { + satisfiesPzi_ = value; + } + } else { + satisfiesPziBuilder_.mergeFrom(value); + } + if (satisfiesPzi_ != null) { + bitField1_ |= 0x00001000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSatisfiesPzi() { + bitField1_ = (bitField1_ & ~0x00001000); + satisfiesPzi_ = null; + if (satisfiesPziBuilder_ != null) { + satisfiesPziBuilder_.dispose(); + satisfiesPziBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValue.Builder getSatisfiesPziBuilder() { + bitField1_ |= 0x00001000; + onChanged(); + return internalGetSatisfiesPziFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPziOrBuilder() { + if (satisfiesPziBuilder_ != null) { + return satisfiesPziBuilder_.getMessageOrBuilder(); + } else { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetSatisfiesPziFieldBuilder() { + if (satisfiesPziBuilder_ == null) { + satisfiesPziBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSatisfiesPzi(), getParentForChildren(), isClean()); + satisfiesPzi_ = null; + } + return satisfiesPziBuilder_; + } + + private com.google.protobuf.BoolValue switchTransactionLogsToCloudStorageEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + switchTransactionLogsToCloudStorageEnabledBuilder_; + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the switchTransactionLogsToCloudStorageEnabled field is set. + */ + public boolean hasSwitchTransactionLogsToCloudStorageEnabled() { + return ((bitField1_ & 0x00002000) != 0); + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The switchTransactionLogsToCloudStorageEnabled. + */ + public com.google.protobuf.BoolValue getSwitchTransactionLogsToCloudStorageEnabled() { + if (switchTransactionLogsToCloudStorageEnabledBuilder_ == null) { + return switchTransactionLogsToCloudStorageEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : switchTransactionLogsToCloudStorageEnabled_; + } else { + return switchTransactionLogsToCloudStorageEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setSwitchTransactionLogsToCloudStorageEnabled( + com.google.protobuf.BoolValue value) { + if (switchTransactionLogsToCloudStorageEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + switchTransactionLogsToCloudStorageEnabled_ = value; + } else { + switchTransactionLogsToCloudStorageEnabledBuilder_.setMessage(value); + } + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setSwitchTransactionLogsToCloudStorageEnabled( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (switchTransactionLogsToCloudStorageEnabledBuilder_ == null) { + switchTransactionLogsToCloudStorageEnabled_ = builderForValue.build(); + } else { + switchTransactionLogsToCloudStorageEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder mergeSwitchTransactionLogsToCloudStorageEnabled( + com.google.protobuf.BoolValue value) { + if (switchTransactionLogsToCloudStorageEnabledBuilder_ == null) { + if (((bitField1_ & 0x00002000) != 0) + && switchTransactionLogsToCloudStorageEnabled_ != null + && switchTransactionLogsToCloudStorageEnabled_ + != com.google.protobuf.BoolValue.getDefaultInstance()) { + getSwitchTransactionLogsToCloudStorageEnabledBuilder().mergeFrom(value); + } else { + switchTransactionLogsToCloudStorageEnabled_ = value; + } + } else { + switchTransactionLogsToCloudStorageEnabledBuilder_.mergeFrom(value); + } + if (switchTransactionLogsToCloudStorageEnabled_ != null) { + bitField1_ |= 0x00002000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder clearSwitchTransactionLogsToCloudStorageEnabled() { + bitField1_ = (bitField1_ & ~0x00002000); + switchTransactionLogsToCloudStorageEnabled_ = null; + if (switchTransactionLogsToCloudStorageEnabledBuilder_ != null) { + switchTransactionLogsToCloudStorageEnabledBuilder_.dispose(); + switchTransactionLogsToCloudStorageEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValue.Builder + getSwitchTransactionLogsToCloudStorageEnabledBuilder() { + bitField1_ |= 0x00002000; + onChanged(); + return internalGetSwitchTransactionLogsToCloudStorageEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValueOrBuilder + getSwitchTransactionLogsToCloudStorageEnabledOrBuilder() { + if (switchTransactionLogsToCloudStorageEnabledBuilder_ != null) { + return switchTransactionLogsToCloudStorageEnabledBuilder_.getMessageOrBuilder(); + } else { + return switchTransactionLogsToCloudStorageEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : switchTransactionLogsToCloudStorageEnabled_; + } + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetSwitchTransactionLogsToCloudStorageEnabledFieldBuilder() { + if (switchTransactionLogsToCloudStorageEnabledBuilder_ == null) { + switchTransactionLogsToCloudStorageEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSwitchTransactionLogsToCloudStorageEnabled(), getParentForChildren(), isClean()); + switchTransactionLogsToCloudStorageEnabled_ = null; + } + return switchTransactionLogsToCloudStorageEnabledBuilder_; + } + + private com.google.protobuf.BoolValue includeReplicasForMajorVersionUpgrade_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + includeReplicasForMajorVersionUpgradeBuilder_; + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the includeReplicasForMajorVersionUpgrade field is set. + */ + public boolean hasIncludeReplicasForMajorVersionUpgrade() { + return ((bitField1_ & 0x00004000) != 0); + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The includeReplicasForMajorVersionUpgrade. + */ + public com.google.protobuf.BoolValue getIncludeReplicasForMajorVersionUpgrade() { + if (includeReplicasForMajorVersionUpgradeBuilder_ == null) { + return includeReplicasForMajorVersionUpgrade_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : includeReplicasForMajorVersionUpgrade_; + } else { + return includeReplicasForMajorVersionUpgradeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setIncludeReplicasForMajorVersionUpgrade(com.google.protobuf.BoolValue value) { + if (includeReplicasForMajorVersionUpgradeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + includeReplicasForMajorVersionUpgrade_ = value; + } else { + includeReplicasForMajorVersionUpgradeBuilder_.setMessage(value); + } + bitField1_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setIncludeReplicasForMajorVersionUpgrade( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (includeReplicasForMajorVersionUpgradeBuilder_ == null) { + includeReplicasForMajorVersionUpgrade_ = builderForValue.build(); + } else { + includeReplicasForMajorVersionUpgradeBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder mergeIncludeReplicasForMajorVersionUpgrade(com.google.protobuf.BoolValue value) { + if (includeReplicasForMajorVersionUpgradeBuilder_ == null) { + if (((bitField1_ & 0x00004000) != 0) + && includeReplicasForMajorVersionUpgrade_ != null + && includeReplicasForMajorVersionUpgrade_ + != com.google.protobuf.BoolValue.getDefaultInstance()) { + getIncludeReplicasForMajorVersionUpgradeBuilder().mergeFrom(value); + } else { + includeReplicasForMajorVersionUpgrade_ = value; + } + } else { + includeReplicasForMajorVersionUpgradeBuilder_.mergeFrom(value); + } + if (includeReplicasForMajorVersionUpgrade_ != null) { + bitField1_ |= 0x00004000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder clearIncludeReplicasForMajorVersionUpgrade() { + bitField1_ = (bitField1_ & ~0x00004000); + includeReplicasForMajorVersionUpgrade_ = null; + if (includeReplicasForMajorVersionUpgradeBuilder_ != null) { + includeReplicasForMajorVersionUpgradeBuilder_.dispose(); + includeReplicasForMajorVersionUpgradeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValue.Builder getIncludeReplicasForMajorVersionUpgradeBuilder() { + bitField1_ |= 0x00004000; + onChanged(); + return internalGetIncludeReplicasForMajorVersionUpgradeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValueOrBuilder + getIncludeReplicasForMajorVersionUpgradeOrBuilder() { + if (includeReplicasForMajorVersionUpgradeBuilder_ != null) { + return includeReplicasForMajorVersionUpgradeBuilder_.getMessageOrBuilder(); + } else { + return includeReplicasForMajorVersionUpgrade_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : includeReplicasForMajorVersionUpgrade_; + } + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetIncludeReplicasForMajorVersionUpgradeFieldBuilder() { + if (includeReplicasForMajorVersionUpgradeBuilder_ == null) { + includeReplicasForMajorVersionUpgradeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getIncludeReplicasForMajorVersionUpgrade(), getParentForChildren(), isClean()); + includeReplicasForMajorVersionUpgrade_ = null; + } + return includeReplicasForMajorVersionUpgradeBuilder_; + } + + private com.google.protobuf.MapField tags_; + + private com.google.protobuf.MapField internalGetTags() { + if (tags_ == null) { + return com.google.protobuf.MapField.emptyMapField(TagsDefaultEntryHolder.defaultEntry); + } + return tags_; + } + + private com.google.protobuf.MapField + internalGetMutableTags() { + if (tags_ == null) { + tags_ = com.google.protobuf.MapField.newMapField(TagsDefaultEntryHolder.defaultEntry); + } + if (!tags_.isMutable()) { + tags_ = tags_.copy(); + } + bitField1_ |= 0x00008000; + onChanged(); + return tags_; + } + + public int getTagsCount() { + return internalGetTags().getMap().size(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+     * this instance. You must represent each item in the map as:
+     * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+     *
+     * For example, a single resource can have the following tags:
+     * ```
+     * "123/environment": "production",
+     * "123/costCenter": "marketing",
+     * ```
+     *
+     * For more information on tag creation and management, see
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+     * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTags().getMap().containsKey(key); + } + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTags() { + return getTagsMap(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+     * this instance. You must represent each item in the map as:
+     * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+     *
+     * For example, a single resource can have the following tags:
+     * ```
+     * "123/environment": "production",
+     * "123/costCenter": "marketing",
+     * ```
+     *
+     * For more information on tag creation and management, see
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+     * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getTagsMap() { + return internalGetTags().getMap(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+     * this instance. You must represent each item in the map as:
+     * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+     *
+     * For example, a single resource can have the following tags:
+     * ```
+     * "123/environment": "production",
+     * "123/costCenter": "marketing",
+     * ```
+     *
+     * For more information on tag creation and management, see
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+     * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+     * this instance. You must represent each item in the map as:
+     * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+     *
+     * For example, a single resource can have the following tags:
+     * ```
+     * "123/environment": "production",
+     * "123/costCenter": "marketing",
+     * ```
+     *
+     * For more information on tag creation and management, see
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+     * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getTagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearTags() { + bitField1_ = (bitField1_ & ~0x00008000); + internalGetMutableTags().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+     * this instance. You must represent each item in the map as:
+     * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+     *
+     * For example, a single resource can have the following tags:
+     * ```
+     * "123/environment": "production",
+     * "123/costCenter": "marketing",
+     * ```
+     *
+     * For more information on tag creation and management, see
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+     * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableTags().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableTags() { + bitField1_ |= 0x00008000; + return internalGetMutableTags().getMutableMap(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+     * this instance. You must represent each item in the map as:
+     * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+     *
+     * For example, a single resource can have the following tags:
+     * ```
+     * "123/environment": "production",
+     * "123/costCenter": "marketing",
+     * ```
+     *
+     * For more information on tag creation and management, see
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+     * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putTags(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableTags().getMutableMap().put(key, value); + bitField1_ |= 0x00008000; + return this; + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+     * this instance. You must represent each item in the map as:
+     * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+     *
+     * For example, a single resource can have the following tags:
+     * ```
+     * "123/environment": "production",
+     * "123/costCenter": "marketing",
+     * ```
+     *
+     * For more information on tag creation and management, see
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+     * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllTags(java.util.Map values) { + internalGetMutableTags().getMutableMap().putAll(values); + bitField1_ |= 0x00008000; + return this; + } + + private int nodeCount_; + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @return Whether the nodeCount field is set. + */ + @java.lang.Override + public boolean hasNodeCount() { + return ((bitField1_ & 0x00010000) != 0); + } + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @param value The nodeCount to set. + * @return This builder for chaining. + */ + public Builder setNodeCount(int value) { + + nodeCount_ = value; + bitField1_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @return This builder for chaining. + */ + public Builder clearNodeCount() { + bitField1_ = (bitField1_ & ~0x00010000); + nodeCount_ = 0; + onChanged(); + return this; + } + + private java.util.List nodes_ = + java.util.Collections.emptyList(); + + private void ensureNodesIsMutable() { + if (!((bitField1_ & 0x00020000) != 0)) { + nodes_ = + new java.util.ArrayList( + nodes_); + bitField1_ |= 0x00020000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig, + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.Builder, + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfigOrBuilder> + nodesBuilder_; + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getNodesList() { + if (nodesBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodes_); + } else { + return nodesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getNodesCount() { + if (nodesBuilder_ == null) { + return nodes_.size(); + } else { + return nodesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig getNodes(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodes( + int index, com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.set(index, value); + onChanged(); + } else { + nodesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodes( + int index, + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.set(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes(com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(value); + onChanged(); + } else { + nodesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + int index, com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(index, value); + onChanged(); + } else { + nodesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + int index, + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllNodes( + java.lang.Iterable + values) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, nodes_); + onChanged(); + } else { + nodesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearNodes() { + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + bitField1_ = (bitField1_ & ~0x00020000); + onChanged(); + } else { + nodesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeNodes(int index) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.remove(index); + onChanged(); + } else { + nodesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.Builder getNodesBuilder( + int index) { + return internalGetNodesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfigOrBuilder getNodesOrBuilder( + int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + ? extends com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfigOrBuilder> + getNodesOrBuilderList() { + if (nodesBuilder_ != null) { + return nodesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodes_); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.Builder addNodesBuilder() { + return internalGetNodesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.Builder addNodesBuilder( + int index) { + return internalGetNodesFieldBuilder() + .addBuilder( + index, com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNodesBuilderList() { + return internalGetNodesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig, + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.Builder, + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfigOrBuilder> + internalGetNodesFieldBuilder() { + if (nodesBuilder_ == null) { + nodesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig, + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.Builder, + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfigOrBuilder>( + nodes_, ((bitField1_ & 0x00020000) != 0), getParentForChildren(), isClean()); + nodes_ = null; + } + return nodesBuilder_; + } + + private java.util.List dnsNames_ = + java.util.Collections.emptyList(); + + private void ensureDnsNamesIsMutable() { + if (!((bitField1_ & 0x00040000) != 0)) { + dnsNames_ = new java.util.ArrayList(dnsNames_); + bitField1_ |= 0x00040000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DnsNameMapping, + com.google.cloud.sql.v1.DnsNameMapping.Builder, + com.google.cloud.sql.v1.DnsNameMappingOrBuilder> + dnsNamesBuilder_; + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getDnsNamesList() { + if (dnsNamesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dnsNames_); + } else { + return dnsNamesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getDnsNamesCount() { + if (dnsNamesBuilder_ == null) { + return dnsNames_.size(); + } else { + return dnsNamesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping getDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames(int index, com.google.cloud.sql.v1.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.set(index, value); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames( + int index, com.google.cloud.sql.v1.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.set(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(com.google.cloud.sql.v1.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(int index, com.google.cloud.sql.v1.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(index, value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(com.google.cloud.sql.v1.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames( + int index, com.google.cloud.sql.v1.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllDnsNames( + java.lang.Iterable values) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dnsNames_); + onChanged(); + } else { + dnsNamesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDnsNames() { + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + bitField1_ = (bitField1_ & ~0x00040000); + onChanged(); + } else { + dnsNamesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.remove(index); + onChanged(); + } else { + dnsNamesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping.Builder getDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDnsNamesOrBuilderList() { + if (dnsNamesBuilder_ != null) { + return dnsNamesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dnsNames_); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping.Builder addDnsNamesBuilder() { + return internalGetDnsNamesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.DnsNameMapping.Builder addDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getDnsNamesBuilderList() { + return internalGetDnsNamesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DnsNameMapping, + com.google.cloud.sql.v1.DnsNameMapping.Builder, + com.google.cloud.sql.v1.DnsNameMappingOrBuilder> + internalGetDnsNamesFieldBuilder() { + if (dnsNamesBuilder_ == null) { + dnsNamesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DnsNameMapping, + com.google.cloud.sql.v1.DnsNameMapping.Builder, + com.google.cloud.sql.v1.DnsNameMappingOrBuilder>( + dnsNames_, ((bitField1_ & 0x00040000) != 0), getParentForChildren(), isClean()); + dnsNames_ = null; + } + return dnsNamesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DatabaseInstance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DatabaseInstance) + private static final com.google.cloud.sql.v1.DatabaseInstance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DatabaseInstance(); + } + + public static com.google.cloud.sql.v1.DatabaseInstance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DatabaseInstance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseInstanceOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseInstanceOrBuilder.java new file mode 100644 index 000000000000..35cd8df7f221 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseInstanceOrBuilder.java @@ -0,0 +1,2178 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface DatabaseInstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DatabaseInstance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#instance`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#instance`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The current serving state of the Cloud SQL instance.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 2; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+   * The current serving state of the Cloud SQL instance.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlInstanceState state = 2; + * + * @return The state. + */ + com.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState getState(); + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion` field cannot
+   * be changed after instance creation.
+   * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 3; + * + * @return The enum numeric value on the wire for databaseVersion. + */ + int getDatabaseVersionValue(); + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion` field cannot
+   * be changed after instance creation.
+   * 
+ * + * .google.cloud.sql.v1.SqlDatabaseVersion database_version = 3; + * + * @return The databaseVersion. + */ + com.google.cloud.sql.v1.SqlDatabaseVersion getDatabaseVersion(); + + /** + * + * + *
+   * The user settings.
+   * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + * + * @return Whether the settings field is set. + */ + boolean hasSettings(); + + /** + * + * + *
+   * The user settings.
+   * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + * + * @return The settings. + */ + com.google.cloud.sql.v1.Settings getSettings(); + + /** + * + * + *
+   * The user settings.
+   * 
+ * + * .google.cloud.sql.v1.Settings settings = 4; + */ + com.google.cloud.sql.v1.SettingsOrBuilder getSettingsOrBuilder(); + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API. Use the `settings.settingsVersion` field instead.
+   * 
+ * + * string etag = 5; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API. Use the `settings.settingsVersion` field instead.
+   * 
+ * + * string etag = 5; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * The name and status of the failover replica.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + * @return Whether the failoverReplica field is set. + */ + boolean hasFailoverReplica(); + + /** + * + * + *
+   * The name and status of the failover replica.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + * @return The failoverReplica. + */ + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica getFailoverReplica(); + + /** + * + * + *
+   * The name and status of the failover replica.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + */ + com.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplicaOrBuilder + getFailoverReplicaOrBuilder(); + + /** + * + * + *
+   * The name of the instance which will act as primary in the replication
+   * setup.
+   * 
+ * + * string master_instance_name = 7; + * + * @return The masterInstanceName. + */ + java.lang.String getMasterInstanceName(); + + /** + * + * + *
+   * The name of the instance which will act as primary in the replication
+   * setup.
+   * 
+ * + * string master_instance_name = 7; + * + * @return The bytes for masterInstanceName. + */ + com.google.protobuf.ByteString getMasterInstanceNameBytes(); + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @return A list containing the replicaNames. + */ + java.util.List getReplicaNamesList(); + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @return The count of replicaNames. + */ + int getReplicaNamesCount(); + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @param index The index of the element to return. + * @return The replicaNames at the given index. + */ + java.lang.String getReplicaNames(int index); + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @param index The index of the value to return. + * @return The bytes of the replicaNames at the given index. + */ + com.google.protobuf.ByteString getReplicaNamesBytes(int index); + + /** + * + * + *
+   * The maximum disk size of the instance in bytes.
+   * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.max_disk_size is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1573 + * @return Whether the maxDiskSize field is set. + */ + @java.lang.Deprecated + boolean hasMaxDiskSize(); + + /** + * + * + *
+   * The maximum disk size of the instance in bytes.
+   * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.max_disk_size is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1573 + * @return The maxDiskSize. + */ + @java.lang.Deprecated + com.google.protobuf.Int64Value getMaxDiskSize(); + + /** + * + * + *
+   * The maximum disk size of the instance in bytes.
+   * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Deprecated + com.google.protobuf.Int64ValueOrBuilder getMaxDiskSizeOrBuilder(); + + /** + * + * + *
+   * The current disk usage of the instance in bytes. This property has been
+   * deprecated. Use the
+   * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+   * Monitoring API instead. Please see [this
+   * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+   * for details.
+   * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.current_disk_size is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1581 + * @return Whether the currentDiskSize field is set. + */ + @java.lang.Deprecated + boolean hasCurrentDiskSize(); + + /** + * + * + *
+   * The current disk usage of the instance in bytes. This property has been
+   * deprecated. Use the
+   * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+   * Monitoring API instead. Please see [this
+   * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+   * for details.
+   * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.current_disk_size is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1581 + * @return The currentDiskSize. + */ + @java.lang.Deprecated + com.google.protobuf.Int64Value getCurrentDiskSize(); + + /** + * + * + *
+   * The current disk usage of the instance in bytes. This property has been
+   * deprecated. Use the
+   * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+   * Monitoring API instead. Please see [this
+   * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+   * for details.
+   * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Deprecated + com.google.protobuf.Int64ValueOrBuilder getCurrentDiskSizeOrBuilder(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + java.util.List getIpAddressesList(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + com.google.cloud.sql.v1.IpMapping getIpAddresses(int index); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + int getIpAddressesCount(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + java.util.List + getIpAddressesOrBuilderList(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.IpMapping ip_addresses = 11; + */ + com.google.cloud.sql.v1.IpMappingOrBuilder getIpAddressesOrBuilder(int index); + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + * + * @return Whether the serverCaCert field is set. + */ + boolean hasServerCaCert(); + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + * + * @return The serverCaCert. + */ + com.google.cloud.sql.v1.SslCert getServerCaCert(); + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 12; + */ + com.google.cloud.sql.v1.SslCertOrBuilder getServerCaCertOrBuilder(); + + /** + * + * + *
+   * The instance type.
+   * 
+ * + * .google.cloud.sql.v1.SqlInstanceType instance_type = 13; + * + * @return The enum numeric value on the wire for instanceType. + */ + int getInstanceTypeValue(); + + /** + * + * + *
+   * The instance type.
+   * 
+ * + * .google.cloud.sql.v1.SqlInstanceType instance_type = 13; + * + * @return The instanceType. + */ + com.google.cloud.sql.v1.SqlInstanceType getInstanceType(); + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL instance. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 14; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL instance. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 14; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * The IPv6 address assigned to the instance.
+   * (Deprecated) This property was applicable only
+   * to First Generation instances.
+   * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1599 + * @return The ipv6Address. + */ + @java.lang.Deprecated + java.lang.String getIpv6Address(); + + /** + * + * + *
+   * The IPv6 address assigned to the instance.
+   * (Deprecated) This property was applicable only
+   * to First Generation instances.
+   * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1599 + * @return The bytes for ipv6Address. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getIpv6AddressBytes(); + + /** + * + * + *
+   * The service account email address assigned to the instance.\This
+   * property is read-only.
+   * 
+ * + * string service_account_email_address = 16; + * + * @return The serviceAccountEmailAddress. + */ + java.lang.String getServiceAccountEmailAddress(); + + /** + * + * + *
+   * The service account email address assigned to the instance.\This
+   * property is read-only.
+   * 
+ * + * string service_account_email_address = 16; + * + * @return The bytes for serviceAccountEmailAddress. + */ + com.google.protobuf.ByteString getServiceAccountEmailAddressBytes(); + + /** + * + * + *
+   * Configuration specific to on-premises instances.
+   * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + * + * @return Whether the onPremisesConfiguration field is set. + */ + boolean hasOnPremisesConfiguration(); + + /** + * + * + *
+   * Configuration specific to on-premises instances.
+   * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + * + * @return The onPremisesConfiguration. + */ + com.google.cloud.sql.v1.OnPremisesConfiguration getOnPremisesConfiguration(); + + /** + * + * + *
+   * Configuration specific to on-premises instances.
+   * 
+ * + * .google.cloud.sql.v1.OnPremisesConfiguration on_premises_configuration = 17; + */ + com.google.cloud.sql.v1.OnPremisesConfigurationOrBuilder getOnPremisesConfigurationOrBuilder(); + + /** + * + * + *
+   * Configuration specific to failover replicas and read replicas.
+   * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + * + * @return Whether the replicaConfiguration field is set. + */ + boolean hasReplicaConfiguration(); + + /** + * + * + *
+   * Configuration specific to failover replicas and read replicas.
+   * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + * + * @return The replicaConfiguration. + */ + com.google.cloud.sql.v1.ReplicaConfiguration getReplicaConfiguration(); + + /** + * + * + *
+   * Configuration specific to failover replicas and read replicas.
+   * 
+ * + * .google.cloud.sql.v1.ReplicaConfiguration replica_configuration = 18; + */ + com.google.cloud.sql.v1.ReplicaConfigurationOrBuilder getReplicaConfigurationOrBuilder(); + + /** + * + * + *
+   * The backend type.
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   *
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 19; + * + * @return The enum numeric value on the wire for backendType. + */ + int getBackendTypeValue(); + + /** + * + * + *
+   * The backend type.
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   *
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1.SqlBackendType backend_type = 19; + * + * @return The backendType. + */ + com.google.cloud.sql.v1.SqlBackendType getBackendType(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 20; + * + * @return The selfLink. + */ + java.lang.String getSelfLink(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 20; + * + * @return The bytes for selfLink. + */ + com.google.protobuf.ByteString getSelfLinkBytes(); + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @return A list containing the suspensionReason. + */ + java.util.List getSuspensionReasonList(); + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @return The count of suspensionReason. + */ + int getSuspensionReasonCount(); + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index of the element to return. + * @return The suspensionReason at the given index. + */ + com.google.cloud.sql.v1.SqlSuspensionReason getSuspensionReason(int index); + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @return A list containing the enum numeric values on the wire for suspensionReason. + */ + java.util.List getSuspensionReasonValueList(); + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of suspensionReason at the given index. + */ + int getSuspensionReasonValue(int index); + + /** + * + * + *
+   * Connection name of the Cloud SQL instance used in connection strings.
+   * 
+ * + * string connection_name = 22; + * + * @return The connectionName. + */ + java.lang.String getConnectionName(); + + /** + * + * + *
+   * Connection name of the Cloud SQL instance used in connection strings.
+   * 
+ * + * string connection_name = 22; + * + * @return The bytes for connectionName. + */ + com.google.protobuf.ByteString getConnectionNameBytes(); + + /** + * + * + *
+   * Name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string name = 23; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string name = 23; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The geographical region of the Cloud SQL instance.
+   *
+   * It can be one of the
+   * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+   * where Cloud SQL operates:
+   *
+   * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+   * The default value is `us-central1`.
+   * 
+ * + * string region = 24; + * + * @return The region. + */ + java.lang.String getRegion(); + + /** + * + * + *
+   * The geographical region of the Cloud SQL instance.
+   *
+   * It can be one of the
+   * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+   * where Cloud SQL operates:
+   *
+   * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+   * The default value is `us-central1`.
+   * 
+ * + * string region = 24; + * + * @return The bytes for region. + */ + com.google.protobuf.ByteString getRegionBytes(); + + /** + * + * + *
+   * The Compute Engine zone that the instance is currently serving from. This
+   * value could be different from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary zone. WARNING:
+   * Changing this might restart the instance.
+   * 
+ * + * string gce_zone = 25; + * + * @return The gceZone. + */ + java.lang.String getGceZone(); + + /** + * + * + *
+   * The Compute Engine zone that the instance is currently serving from. This
+   * value could be different from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary zone. WARNING:
+   * Changing this might restart the instance.
+   * 
+ * + * string gce_zone = 25; + * + * @return The bytes for gceZone. + */ + com.google.protobuf.ByteString getGceZoneBytes(); + + /** + * + * + *
+   * The Compute Engine zone that the failover instance is currently serving
+   * from for a regional instance. This value could be different
+   * from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary/failover zone.
+   * 
+ * + * string secondary_gce_zone = 34; + * + * @return The secondaryGceZone. + */ + java.lang.String getSecondaryGceZone(); + + /** + * + * + *
+   * The Compute Engine zone that the failover instance is currently serving
+   * from for a regional instance. This value could be different
+   * from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary/failover zone.
+   * 
+ * + * string secondary_gce_zone = 34; + * + * @return The bytes for secondaryGceZone. + */ + com.google.protobuf.ByteString getSecondaryGceZoneBytes(); + + /** + * + * + *
+   * Disk encryption configuration specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + * + * @return Whether the diskEncryptionConfiguration field is set. + */ + boolean hasDiskEncryptionConfiguration(); + + /** + * + * + *
+   * Disk encryption configuration specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + * + * @return The diskEncryptionConfiguration. + */ + com.google.cloud.sql.v1.DiskEncryptionConfiguration getDiskEncryptionConfiguration(); + + /** + * + * + *
+   * Disk encryption configuration specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + com.google.cloud.sql.v1.DiskEncryptionConfigurationOrBuilder + getDiskEncryptionConfigurationOrBuilder(); + + /** + * + * + *
+   * Disk encryption status specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + * + * @return Whether the diskEncryptionStatus field is set. + */ + boolean hasDiskEncryptionStatus(); + + /** + * + * + *
+   * Disk encryption status specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + * + * @return The diskEncryptionStatus. + */ + com.google.cloud.sql.v1.DiskEncryptionStatus getDiskEncryptionStatus(); + + /** + * + * + *
+   * Disk encryption status specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1.DiskEncryptionStatus disk_encryption_status = 27; + */ + com.google.cloud.sql.v1.DiskEncryptionStatusOrBuilder getDiskEncryptionStatusOrBuilder(); + + /** + * + * + *
+   * Initial root password. Use only on creation. You must set root passwords
+   * before you can connect to PostgreSQL instances.
+   * 
+ * + * string root_password = 29; + * + * @return The rootPassword. + */ + java.lang.String getRootPassword(); + + /** + * + * + *
+   * Initial root password. Use only on creation. You must set root passwords
+   * before you can connect to PostgreSQL instances.
+   * 
+ * + * string root_password = 29; + * + * @return The bytes for rootPassword. + */ + com.google.protobuf.ByteString getRootPasswordBytes(); + + /** + * + * + *
+   * The start time of any upcoming scheduled maintenance for this instance.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + * + * @return Whether the scheduledMaintenance field is set. + */ + boolean hasScheduledMaintenance(); + + /** + * + * + *
+   * The start time of any upcoming scheduled maintenance for this instance.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + * + * @return The scheduledMaintenance. + */ + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance getScheduledMaintenance(); + + /** + * + * + *
+   * The start time of any upcoming scheduled maintenance for this instance.
+   * 
+ * + * .google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + com.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenanceOrBuilder + getScheduledMaintenanceOrBuilder(); + + /** + * + * + *
+   * This status indicates whether the instance satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + * + * @return Whether the satisfiesPzs field is set. + */ + boolean hasSatisfiesPzs(); + + /** + * + * + *
+   * This status indicates whether the instance satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + * + * @return The satisfiesPzs. + */ + com.google.protobuf.BoolValue getSatisfiesPzs(); + + /** + * + * + *
+   * This status indicates whether the instance satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder(); + + /** + * + * + *
+   * Output only. Stores the current database version running on the instance
+   * including minor version such as `MYSQL_8_0_18`.
+   * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseInstalledVersion. + */ + java.lang.String getDatabaseInstalledVersion(); + + /** + * + * + *
+   * Output only. Stores the current database version running on the instance
+   * including minor version such as `MYSQL_8_0_18`.
+   * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for databaseInstalledVersion. + */ + com.google.protobuf.ByteString getDatabaseInstalledVersionBytes(); + + /** + * + * + *
+   * This field represents the report generated by the proactive database
+   * wellness job for OutOfDisk issues.
+   * *  Writers:
+   * *  the proactive database wellness job for OOD.
+   * *  Readers:
+   * *  the proactive database wellness job
+   * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + * + * @return Whether the outOfDiskReport field is set. + */ + boolean hasOutOfDiskReport(); + + /** + * + * + *
+   * This field represents the report generated by the proactive database
+   * wellness job for OutOfDisk issues.
+   * *  Writers:
+   * *  the proactive database wellness job for OOD.
+   * *  Readers:
+   * *  the proactive database wellness job
+   * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + * + * @return The outOfDiskReport. + */ + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport getOutOfDiskReport(); + + /** + * + * + *
+   * This field represents the report generated by the proactive database
+   * wellness job for OutOfDisk issues.
+   * *  Writers:
+   * *  the proactive database wellness job for OOD.
+   * *  Readers:
+   * *  the proactive database wellness job
+   * 
+ * + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + com.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReportOrBuilder + getOutOfDiskReportOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the instance was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * Output only. The time when the instance was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * Output only. The time when the instance was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the availableMaintenanceVersions. + */ + java.util.List getAvailableMaintenanceVersionsList(); + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of availableMaintenanceVersions. + */ + int getAvailableMaintenanceVersionsCount(); + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The availableMaintenanceVersions at the given index. + */ + java.lang.String getAvailableMaintenanceVersions(int index); + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the availableMaintenanceVersions at the given index. + */ + com.google.protobuf.ByteString getAvailableMaintenanceVersionsBytes(int index); + + /** + * + * + *
+   * The current software version on the instance.
+   * 
+ * + * string maintenance_version = 42; + * + * @return The maintenanceVersion. + */ + java.lang.String getMaintenanceVersion(); + + /** + * + * + *
+   * The current software version on the instance.
+   * 
+ * + * string maintenance_version = 42; + * + * @return The bytes for maintenanceVersion. + */ + com.google.protobuf.ByteString getMaintenanceVersionBytes(); + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getUpgradableDatabaseVersionsList(); + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.AvailableDatabaseVersion getUpgradableDatabaseVersions(int index); + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getUpgradableDatabaseVersionsCount(); + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getUpgradableDatabaseVersionsOrBuilderList(); + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.AvailableDatabaseVersionOrBuilder getUpgradableDatabaseVersionsOrBuilder( + int index); + + /** + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return Whether the sqlNetworkArchitecture field is set. + */ + boolean hasSqlNetworkArchitecture(); + + /** + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return The enum numeric value on the wire for sqlNetworkArchitecture. + */ + int getSqlNetworkArchitectureValue(); + + /** + * + * optional .google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return The sqlNetworkArchitecture. + */ + com.google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture getSqlNetworkArchitecture(); + + /** + * + * + *
+   * Output only. The link to service attachment of PSC instance.
+   * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscServiceAttachmentLink field is set. + */ + boolean hasPscServiceAttachmentLink(); + + /** + * + * + *
+   * Output only. The link to service attachment of PSC instance.
+   * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscServiceAttachmentLink. + */ + java.lang.String getPscServiceAttachmentLink(); + + /** + * + * + *
+   * Output only. The link to service attachment of PSC instance.
+   * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for pscServiceAttachmentLink. + */ + com.google.protobuf.ByteString getPscServiceAttachmentLinkBytes(); + + /** + * + * + *
+   * Output only. The dns name of the instance.
+   * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + boolean hasDnsName(); + + /** + * + * + *
+   * Output only. The dns name of the instance.
+   * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + java.lang.String getDnsName(); + + /** + * + * + *
+   * Output only. The dns name of the instance.
+   * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + com.google.protobuf.ByteString getDnsNameBytes(); + + /** + * + * + *
+   * Output only. DEPRECATED: please use write_endpoint instead.
+   * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1711 + * @return Whether the primaryDnsName field is set. + */ + @java.lang.Deprecated + boolean hasPrimaryDnsName(); + + /** + * + * + *
+   * Output only. DEPRECATED: please use write_endpoint instead.
+   * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1711 + * @return The primaryDnsName. + */ + @java.lang.Deprecated + java.lang.String getPrimaryDnsName(); + + /** + * + * + *
+   * Output only. DEPRECATED: please use write_endpoint instead.
+   * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1/cloud_sql_instances.proto;l=1711 + * @return The bytes for primaryDnsName. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getPrimaryDnsNameBytes(); + + /** + * + * + *
+   * Output only. The dns name of the primary instance in a replication group.
+   * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the writeEndpoint field is set. + */ + boolean hasWriteEndpoint(); + + /** + * + * + *
+   * Output only. The dns name of the primary instance in a replication group.
+   * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The writeEndpoint. + */ + java.lang.String getWriteEndpoint(); + + /** + * + * + *
+   * Output only. The dns name of the primary instance in a replication group.
+   * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for writeEndpoint. + */ + com.google.protobuf.ByteString getWriteEndpointBytes(); + + /** + * + * + *
+   * Optional. A primary instance and disaster recovery (DR) replica pair.
+   * A DR replica is a cross-region replica that you designate
+   * for failover in the event that the primary instance
+   * experiences regional failure.
+   * Applicable to MySQL and PostgreSQL.
+   * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the replicationCluster field is set. + */ + boolean hasReplicationCluster(); + + /** + * + * + *
+   * Optional. A primary instance and disaster recovery (DR) replica pair.
+   * A DR replica is a cross-region replica that you designate
+   * for failover in the event that the primary instance
+   * experiences regional failure.
+   * Applicable to MySQL and PostgreSQL.
+   * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The replicationCluster. + */ + com.google.cloud.sql.v1.ReplicationCluster getReplicationCluster(); + + /** + * + * + *
+   * Optional. A primary instance and disaster recovery (DR) replica pair.
+   * A DR replica is a cross-region replica that you designate
+   * for failover in the event that the primary instance
+   * experiences regional failure.
+   * Applicable to MySQL and PostgreSQL.
+   * 
+ * + * + * .google.cloud.sql.v1.ReplicationCluster replication_cluster = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.ReplicationClusterOrBuilder getReplicationClusterOrBuilder(); + + /** + * + * + *
+   * Gemini instance configuration.
+   * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + * + * @return Whether the geminiConfig field is set. + */ + boolean hasGeminiConfig(); + + /** + * + * + *
+   * Gemini instance configuration.
+   * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + * + * @return The geminiConfig. + */ + com.google.cloud.sql.v1.GeminiInstanceConfig getGeminiConfig(); + + /** + * + * + *
+   * Gemini instance configuration.
+   * 
+ * + * optional .google.cloud.sql.v1.GeminiInstanceConfig gemini_config = 55; + */ + com.google.cloud.sql.v1.GeminiInstanceConfigOrBuilder getGeminiConfigOrBuilder(); + + /** + * + * + *
+   * Output only. This status indicates whether the instance satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzi field is set. + */ + boolean hasSatisfiesPzi(); + + /** + * + * + *
+   * Output only. This status indicates whether the instance satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzi. + */ + com.google.protobuf.BoolValue getSatisfiesPzi(); + + /** + * + * + *
+   * Output only. This status indicates whether the instance satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.BoolValueOrBuilder getSatisfiesPziOrBuilder(); + + /** + * + * + *
+   * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+   * recovery log files from a data disk to Cloud Storage.
+   * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the switchTransactionLogsToCloudStorageEnabled field is set. + */ + boolean hasSwitchTransactionLogsToCloudStorageEnabled(); + + /** + * + * + *
+   * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+   * recovery log files from a data disk to Cloud Storage.
+   * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The switchTransactionLogsToCloudStorageEnabled. + */ + com.google.protobuf.BoolValue getSwitchTransactionLogsToCloudStorageEnabled(); + + /** + * + * + *
+   * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+   * recovery log files from a data disk to Cloud Storage.
+   * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + com.google.protobuf.BoolValueOrBuilder getSwitchTransactionLogsToCloudStorageEnabledOrBuilder(); + + /** + * + * + *
+   * Input only. Determines whether an in-place major version upgrade of
+   * replicas happens when an in-place major version upgrade of a primary
+   * instance is initiated.
+   * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the includeReplicasForMajorVersionUpgrade field is set. + */ + boolean hasIncludeReplicasForMajorVersionUpgrade(); + + /** + * + * + *
+   * Input only. Determines whether an in-place major version upgrade of
+   * replicas happens when an in-place major version upgrade of a primary
+   * instance is initiated.
+   * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The includeReplicasForMajorVersionUpgrade. + */ + com.google.protobuf.BoolValue getIncludeReplicasForMajorVersionUpgrade(); + + /** + * + * + *
+   * Input only. Determines whether an in-place major version upgrade of
+   * replicas happens when an in-place major version upgrade of a primary
+   * instance is initiated.
+   * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + com.google.protobuf.BoolValueOrBuilder getIncludeReplicasForMajorVersionUpgradeOrBuilder(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + int getTagsCount(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsTags(java.lang.String key); + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getTags(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getTagsMap(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getTagsOrThrow(java.lang.String key); + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return Whether the nodeCount field is set. + */ + boolean hasNodeCount(); + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return The nodeCount. + */ + int getNodeCount(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getNodesList(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig getNodes(int index); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getNodesCount(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getNodesOrBuilderList(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfigOrBuilder getNodesOrBuilder(int index); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getDnsNamesList(); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.DnsNameMapping getDnsNames(int index); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getDnsNamesCount(); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getDnsNamesOrBuilderList(); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseOrBuilder.java new file mode 100644 index 000000000000..99de7f31dda3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabaseOrBuilder.java @@ -0,0 +1,261 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface DatabaseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.Database) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#database`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#database`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The Cloud SQL charset value.
+   * 
+ * + * string charset = 2; + * + * @return The charset. + */ + java.lang.String getCharset(); + + /** + * + * + *
+   * The Cloud SQL charset value.
+   * 
+ * + * string charset = 2; + * + * @return The bytes for charset. + */ + com.google.protobuf.ByteString getCharsetBytes(); + + /** + * + * + *
+   * The Cloud SQL collation value.
+   * 
+ * + * string collation = 3; + * + * @return The collation. + */ + java.lang.String getCollation(); + + /** + * + * + *
+   * The Cloud SQL collation value.
+   * 
+ * + * string collation = 3; + * + * @return The bytes for collation. + */ + com.google.protobuf.ByteString getCollationBytes(); + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 4; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 4; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * The name of the database in the Cloud SQL instance. This does not include
+   * the project ID or instance name.
+   * 
+ * + * string name = 5; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the database in the Cloud SQL instance. This does not include
+   * the project ID or instance name.
+   * 
+ * + * string name = 5; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string instance = 6; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 7; + * + * @return The selfLink. + */ + java.lang.String getSelfLink(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 7; + * + * @return The bytes for selfLink. + */ + com.google.protobuf.ByteString getSelfLinkBytes(); + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 8; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 8; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + * @return Whether the sqlserverDatabaseDetails field is set. + */ + boolean hasSqlserverDatabaseDetails(); + + /** + * .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + * @return The sqlserverDatabaseDetails. + */ + com.google.cloud.sql.v1.SqlServerDatabaseDetails getSqlserverDatabaseDetails(); + + /** .google.cloud.sql.v1.SqlServerDatabaseDetails sqlserver_database_details = 9; */ + com.google.cloud.sql.v1.SqlServerDatabaseDetailsOrBuilder getSqlserverDatabaseDetailsOrBuilder(); + + com.google.cloud.sql.v1.Database.DatabaseDetailsCase getDatabaseDetailsCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabasesListResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabasesListResponse.java new file mode 100644 index 000000000000..94a66aad40d5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabasesListResponse.java @@ -0,0 +1,1105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_databases.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database list response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DatabasesListResponse} + */ +@com.google.protobuf.Generated +public final class DatabasesListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DatabasesListResponse) + DatabasesListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DatabasesListResponse"); + } + + // Use DatabasesListResponse.newBuilder() to construct. + private DatabasesListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DatabasesListResponse() { + kind_ = ""; + items_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_DatabasesListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_DatabasesListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DatabasesListResponse.class, + com.google.cloud.sql.v1.DatabasesListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#databasesList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#databasesList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.Database getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.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.sql.v1.DatabasesListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DatabasesListResponse other = + (com.google.cloud.sql.v1.DatabasesListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DatabasesListResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabasesListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabasesListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabasesListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabasesListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DatabasesListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabasesListResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabasesListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabasesListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabasesListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DatabasesListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DatabasesListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.DatabasesListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database list response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DatabasesListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DatabasesListResponse) + com.google.cloud.sql.v1.DatabasesListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_DatabasesListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_DatabasesListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DatabasesListResponse.class, + com.google.cloud.sql.v1.DatabasesListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DatabasesListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_DatabasesListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabasesListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DatabasesListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabasesListResponse build() { + com.google.cloud.sql.v1.DatabasesListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabasesListResponse buildPartial() { + com.google.cloud.sql.v1.DatabasesListResponse result = + new com.google.cloud.sql.v1.DatabasesListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.DatabasesListResponse result) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.DatabasesListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DatabasesListResponse) { + return mergeFrom((com.google.cloud.sql.v1.DatabasesListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DatabasesListResponse other) { + if (other == com.google.cloud.sql.v1.DatabasesListResponse.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1.Database m = + input.readMessage(com.google.cloud.sql.v1.Database.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#databasesList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#databasesList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#databasesList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#databasesList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#databasesList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Database, + com.google.cloud.sql.v1.Database.Builder, + com.google.cloud.sql.v1.DatabaseOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public com.google.cloud.sql.v1.Database getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.Database value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.Database.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1.Database value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.Database value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1.Database.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.Database.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public com.google.cloud.sql.v1.Database.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public com.google.cloud.sql.v1.DatabaseOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public com.google.cloud.sql.v1.Database.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.Database.getDefaultInstance()); + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public com.google.cloud.sql.v1.Database.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.Database.getDefaultInstance()); + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Database, + com.google.cloud.sql.v1.Database.Builder, + com.google.cloud.sql.v1.DatabaseOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Database, + com.google.cloud.sql.v1.Database.Builder, + com.google.cloud.sql.v1.DatabaseOrBuilder>( + items_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DatabasesListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DatabasesListResponse) + private static final com.google.cloud.sql.v1.DatabasesListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DatabasesListResponse(); + } + + public static com.google.cloud.sql.v1.DatabasesListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DatabasesListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DatabasesListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabasesListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabasesListResponseOrBuilder.java new file mode 100644 index 000000000000..9d77bf58e229 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DatabasesListResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_databases.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface DatabasesListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DatabasesListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#databasesList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#databasesList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + com.google.cloud.sql.v1.Database getItems(int index); + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + int getItemsCount(); + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + java.util.List getItemsOrBuilderList(); + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.Database items = 2; + */ + com.google.cloud.sql.v1.DatabaseOrBuilder getItemsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DeleteBackupRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DeleteBackupRequest.java new file mode 100644 index 000000000000..10078fce05db --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DeleteBackupRequest.java @@ -0,0 +1,616 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The request payload to delete the backup.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DeleteBackupRequest} + */ +@com.google.protobuf.Generated +public final class DeleteBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DeleteBackupRequest) + DeleteBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteBackupRequest"); + } + + // Use DeleteBackupRequest.newBuilder() to construct. + private DeleteBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteBackupRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DeleteBackupRequest.class, + com.google.cloud.sql.v1.DeleteBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The name of the backup to delete.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * 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 backup to delete.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.sql.v1.DeleteBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DeleteBackupRequest other = + (com.google.cloud.sql.v1.DeleteBackupRequest) 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.sql.v1.DeleteBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DeleteBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DeleteBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DeleteBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DeleteBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DeleteBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DeleteBackupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DeleteBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DeleteBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DeleteBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DeleteBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DeleteBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.DeleteBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request payload to delete the backup.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DeleteBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DeleteBackupRequest) + com.google.cloud.sql.v1.DeleteBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DeleteBackupRequest.class, + com.google.cloud.sql.v1.DeleteBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DeleteBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DeleteBackupRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DeleteBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DeleteBackupRequest build() { + com.google.cloud.sql.v1.DeleteBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DeleteBackupRequest buildPartial() { + com.google.cloud.sql.v1.DeleteBackupRequest result = + new com.google.cloud.sql.v1.DeleteBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.DeleteBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DeleteBackupRequest) { + return mergeFrom((com.google.cloud.sql.v1.DeleteBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DeleteBackupRequest other) { + if (other == com.google.cloud.sql.v1.DeleteBackupRequest.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 backup to delete.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to delete.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to delete.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to delete.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to delete.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DeleteBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DeleteBackupRequest) + private static final com.google.cloud.sql.v1.DeleteBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DeleteBackupRequest(); + } + + public static com.google.cloud.sql.v1.DeleteBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DeleteBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DeleteBackupRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DeleteBackupRequestOrBuilder.java new file mode 100644 index 000000000000..62d43b715700 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DeleteBackupRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface DeleteBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DeleteBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the backup to delete.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The name of the backup to delete.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * 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-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteContext.java new file mode 100644 index 000000000000..93b516875eec --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteContext.java @@ -0,0 +1,808 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * This context is used to demote an existing standalone instance to be
+ * a Cloud SQL read replica for an external database server.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DemoteContext} + */ +@com.google.protobuf.Generated +public final class DemoteContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DemoteContext) + DemoteContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DemoteContext"); + } + + // Use DemoteContext.newBuilder() to construct. + private DemoteContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DemoteContext() { + kind_ = ""; + sourceRepresentativeInstanceName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DemoteContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DemoteContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DemoteContext.class, + com.google.cloud.sql.v1.DemoteContext.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#demoteContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#demoteContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_REPRESENTATIVE_INSTANCE_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceRepresentativeInstanceName_ = ""; + + /** + * + * + *
+   * Required. The name of the instance which acts as the on-premises primary
+   * instance in the replication setup.
+   * 
+ * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sourceRepresentativeInstanceName. + */ + @java.lang.Override + public java.lang.String getSourceRepresentativeInstanceName() { + java.lang.Object ref = sourceRepresentativeInstanceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceRepresentativeInstanceName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name of the instance which acts as the on-premises primary
+   * instance in the replication setup.
+   * 
+ * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for sourceRepresentativeInstanceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceRepresentativeInstanceNameBytes() { + java.lang.Object ref = sourceRepresentativeInstanceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceRepresentativeInstanceName_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceRepresentativeInstanceName_)) { + com.google.protobuf.GeneratedMessage.writeString( + output, 2, sourceRepresentativeInstanceName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceRepresentativeInstanceName_)) { + size += + com.google.protobuf.GeneratedMessage.computeStringSize( + 2, sourceRepresentativeInstanceName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.DemoteContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DemoteContext other = (com.google.cloud.sql.v1.DemoteContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getSourceRepresentativeInstanceName().equals(other.getSourceRepresentativeInstanceName())) + return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + SOURCE_REPRESENTATIVE_INSTANCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSourceRepresentativeInstanceName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DemoteContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DemoteContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteContext parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DemoteContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DemoteContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DemoteContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DemoteContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DemoteContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.DemoteContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * This context is used to demote an existing standalone instance to be
+   * a Cloud SQL read replica for an external database server.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DemoteContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DemoteContext) + com.google.cloud.sql.v1.DemoteContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DemoteContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DemoteContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DemoteContext.class, + com.google.cloud.sql.v1.DemoteContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DemoteContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + sourceRepresentativeInstanceName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DemoteContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DemoteContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteContext build() { + com.google.cloud.sql.v1.DemoteContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteContext buildPartial() { + com.google.cloud.sql.v1.DemoteContext result = + new com.google.cloud.sql.v1.DemoteContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.DemoteContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sourceRepresentativeInstanceName_ = sourceRepresentativeInstanceName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DemoteContext) { + return mergeFrom((com.google.cloud.sql.v1.DemoteContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DemoteContext other) { + if (other == com.google.cloud.sql.v1.DemoteContext.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getSourceRepresentativeInstanceName().isEmpty()) { + sourceRepresentativeInstanceName_ = other.sourceRepresentativeInstanceName_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + sourceRepresentativeInstanceName_ = 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#demoteContext`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteContext`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteContext`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object sourceRepresentativeInstanceName_ = ""; + + /** + * + * + *
+     * Required. The name of the instance which acts as the on-premises primary
+     * instance in the replication setup.
+     * 
+ * + * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sourceRepresentativeInstanceName. + */ + public java.lang.String getSourceRepresentativeInstanceName() { + java.lang.Object ref = sourceRepresentativeInstanceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceRepresentativeInstanceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name of the instance which acts as the on-premises primary
+     * instance in the replication setup.
+     * 
+ * + * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for sourceRepresentativeInstanceName. + */ + public com.google.protobuf.ByteString getSourceRepresentativeInstanceNameBytes() { + java.lang.Object ref = sourceRepresentativeInstanceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceRepresentativeInstanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name of the instance which acts as the on-premises primary
+     * instance in the replication setup.
+     * 
+ * + * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The sourceRepresentativeInstanceName to set. + * @return This builder for chaining. + */ + public Builder setSourceRepresentativeInstanceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceRepresentativeInstanceName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the instance which acts as the on-premises primary
+     * instance in the replication setup.
+     * 
+ * + * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearSourceRepresentativeInstanceName() { + sourceRepresentativeInstanceName_ = + getDefaultInstance().getSourceRepresentativeInstanceName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the instance which acts as the on-premises primary
+     * instance in the replication setup.
+     * 
+ * + * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The bytes for sourceRepresentativeInstanceName to set. + * @return This builder for chaining. + */ + public Builder setSourceRepresentativeInstanceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceRepresentativeInstanceName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DemoteContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DemoteContext) + private static final com.google.cloud.sql.v1.DemoteContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DemoteContext(); + } + + public static com.google.cloud.sql.v1.DemoteContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DemoteContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteContextOrBuilder.java new file mode 100644 index 000000000000..b91cdbf8b16b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteContextOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface DemoteContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DemoteContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#demoteContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#demoteContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Required. The name of the instance which acts as the on-premises primary
+   * instance in the replication setup.
+   * 
+ * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sourceRepresentativeInstanceName. + */ + java.lang.String getSourceRepresentativeInstanceName(); + + /** + * + * + *
+   * Required. The name of the instance which acts as the on-premises primary
+   * instance in the replication setup.
+   * 
+ * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for sourceRepresentativeInstanceName. + */ + com.google.protobuf.ByteString getSourceRepresentativeInstanceNameBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterConfiguration.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterConfiguration.java new file mode 100644 index 000000000000..c11ba33c34e9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterConfiguration.java @@ -0,0 +1,992 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Read-replica configuration for connecting to the on-premises primary
+ * instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DemoteMasterConfiguration} + */ +@com.google.protobuf.Generated +public final class DemoteMasterConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DemoteMasterConfiguration) + DemoteMasterConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DemoteMasterConfiguration"); + } + + // Use DemoteMasterConfiguration.newBuilder() to construct. + private DemoteMasterConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DemoteMasterConfiguration() { + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DemoteMasterConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DemoteMasterConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DemoteMasterConfiguration.class, + com.google.cloud.sql.v1.DemoteMasterConfiguration.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#demoteMasterConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#demoteMasterConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MYSQL_REPLICA_CONFIGURATION_FIELD_NUMBER = 2; + private com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysqlReplicaConfiguration_; + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return Whether the mysqlReplicaConfiguration field is set. + */ + @java.lang.Override + public boolean hasMysqlReplicaConfiguration() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return The mysqlReplicaConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration + getMysqlReplicaConfiguration() { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.getDefaultInstance() + : mysqlReplicaConfiguration_; + } + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfigurationOrBuilder + getMysqlReplicaConfigurationOrBuilder() { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.getDefaultInstance() + : mysqlReplicaConfiguration_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getMysqlReplicaConfiguration()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getMysqlReplicaConfiguration()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.DemoteMasterConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DemoteMasterConfiguration other = + (com.google.cloud.sql.v1.DemoteMasterConfiguration) obj; + + if (!getKind().equals(other.getKind())) return false; + if (hasMysqlReplicaConfiguration() != other.hasMysqlReplicaConfiguration()) return false; + if (hasMysqlReplicaConfiguration()) { + if (!getMysqlReplicaConfiguration().equals(other.getMysqlReplicaConfiguration())) + return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasMysqlReplicaConfiguration()) { + hash = (37 * hash) + MYSQL_REPLICA_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getMysqlReplicaConfiguration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DemoteMasterConfiguration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DemoteMasterConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DemoteMasterConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DemoteMasterConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DemoteMasterConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DemoteMasterConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DemoteMasterConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.DemoteMasterConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Read-replica configuration for connecting to the on-premises primary
+   * instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DemoteMasterConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DemoteMasterConfiguration) + com.google.cloud.sql.v1.DemoteMasterConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DemoteMasterConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DemoteMasterConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DemoteMasterConfiguration.class, + com.google.cloud.sql.v1.DemoteMasterConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DemoteMasterConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMysqlReplicaConfigurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + mysqlReplicaConfiguration_ = null; + if (mysqlReplicaConfigurationBuilder_ != null) { + mysqlReplicaConfigurationBuilder_.dispose(); + mysqlReplicaConfigurationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DemoteMasterConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterConfiguration getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DemoteMasterConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterConfiguration build() { + com.google.cloud.sql.v1.DemoteMasterConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterConfiguration buildPartial() { + com.google.cloud.sql.v1.DemoteMasterConfiguration result = + new com.google.cloud.sql.v1.DemoteMasterConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.DemoteMasterConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mysqlReplicaConfiguration_ = + mysqlReplicaConfigurationBuilder_ == null + ? mysqlReplicaConfiguration_ + : mysqlReplicaConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DemoteMasterConfiguration) { + return mergeFrom((com.google.cloud.sql.v1.DemoteMasterConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DemoteMasterConfiguration other) { + if (other == com.google.cloud.sql.v1.DemoteMasterConfiguration.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasMysqlReplicaConfiguration()) { + mergeMysqlReplicaConfiguration(other.getMysqlReplicaConfiguration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetMysqlReplicaConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#demoteMasterConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteMasterConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteMasterConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteMasterConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteMasterConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration + mysqlReplicaConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration, + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.Builder, + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfigurationOrBuilder> + mysqlReplicaConfigurationBuilder_; + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return Whether the mysqlReplicaConfiguration field is set. + */ + public boolean hasMysqlReplicaConfiguration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return The mysqlReplicaConfiguration. + */ + public com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration + getMysqlReplicaConfiguration() { + if (mysqlReplicaConfigurationBuilder_ == null) { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.getDefaultInstance() + : mysqlReplicaConfiguration_; + } else { + return mysqlReplicaConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public Builder setMysqlReplicaConfiguration( + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration value) { + if (mysqlReplicaConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mysqlReplicaConfiguration_ = value; + } else { + mysqlReplicaConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public Builder setMysqlReplicaConfiguration( + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.Builder builderForValue) { + if (mysqlReplicaConfigurationBuilder_ == null) { + mysqlReplicaConfiguration_ = builderForValue.build(); + } else { + mysqlReplicaConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public Builder mergeMysqlReplicaConfiguration( + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration value) { + if (mysqlReplicaConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && mysqlReplicaConfiguration_ != null + && mysqlReplicaConfiguration_ + != com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration + .getDefaultInstance()) { + getMysqlReplicaConfigurationBuilder().mergeFrom(value); + } else { + mysqlReplicaConfiguration_ = value; + } + } else { + mysqlReplicaConfigurationBuilder_.mergeFrom(value); + } + if (mysqlReplicaConfiguration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public Builder clearMysqlReplicaConfiguration() { + bitField0_ = (bitField0_ & ~0x00000002); + mysqlReplicaConfiguration_ = null; + if (mysqlReplicaConfigurationBuilder_ != null) { + mysqlReplicaConfigurationBuilder_.dispose(); + mysqlReplicaConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.Builder + getMysqlReplicaConfigurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetMysqlReplicaConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfigurationOrBuilder + getMysqlReplicaConfigurationOrBuilder() { + if (mysqlReplicaConfigurationBuilder_ != null) { + return mysqlReplicaConfigurationBuilder_.getMessageOrBuilder(); + } else { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.getDefaultInstance() + : mysqlReplicaConfiguration_; + } + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration, + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.Builder, + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfigurationOrBuilder> + internalGetMysqlReplicaConfigurationFieldBuilder() { + if (mysqlReplicaConfigurationBuilder_ == null) { + mysqlReplicaConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration, + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.Builder, + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfigurationOrBuilder>( + getMysqlReplicaConfiguration(), getParentForChildren(), isClean()); + mysqlReplicaConfiguration_ = null; + } + return mysqlReplicaConfigurationBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DemoteMasterConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DemoteMasterConfiguration) + private static final com.google.cloud.sql.v1.DemoteMasterConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DemoteMasterConfiguration(); + } + + public static com.google.cloud.sql.v1.DemoteMasterConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DemoteMasterConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterConfigurationOrBuilder.java new file mode 100644 index 000000000000..31ed7a6011c6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterConfigurationOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface DemoteMasterConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DemoteMasterConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#demoteMasterConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#demoteMasterConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return Whether the mysqlReplicaConfiguration field is set. + */ + boolean hasMysqlReplicaConfiguration(); + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return The mysqlReplicaConfiguration. + */ + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration getMysqlReplicaConfiguration(); + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * + * .google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfigurationOrBuilder + getMysqlReplicaConfigurationOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterContext.java new file mode 100644 index 000000000000..b6cc034d7dc5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterContext.java @@ -0,0 +1,1560 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance demote primary instance context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DemoteMasterContext} + */ +@com.google.protobuf.Generated +public final class DemoteMasterContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DemoteMasterContext) + DemoteMasterContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DemoteMasterContext"); + } + + // Use DemoteMasterContext.newBuilder() to construct. + private DemoteMasterContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DemoteMasterContext() { + kind_ = ""; + masterInstanceName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DemoteMasterContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DemoteMasterContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DemoteMasterContext.class, + com.google.cloud.sql.v1.DemoteMasterContext.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#demoteMasterContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#demoteMasterContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERIFY_GTID_CONSISTENCY_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue verifyGtidConsistency_; + + /** + * + * + *
+   * Verify the GTID consistency for demote operation. Default value:
+   * `True`. Setting this flag to `false` enables you to bypass the GTID
+   * consistency check between on-premises primary instance and Cloud SQL
+   * instance during the demotion operation but also exposes you to the risk of
+   * future replication failures. Change the value only if you know the reason
+   * for the GTID divergence and are confident that doing so will not cause any
+   * replication issues.
+   * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + * + * @return Whether the verifyGtidConsistency field is set. + */ + @java.lang.Override + public boolean hasVerifyGtidConsistency() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Verify the GTID consistency for demote operation. Default value:
+   * `True`. Setting this flag to `false` enables you to bypass the GTID
+   * consistency check between on-premises primary instance and Cloud SQL
+   * instance during the demotion operation but also exposes you to the risk of
+   * future replication failures. Change the value only if you know the reason
+   * for the GTID divergence and are confident that doing so will not cause any
+   * replication issues.
+   * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + * + * @return The verifyGtidConsistency. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getVerifyGtidConsistency() { + return verifyGtidConsistency_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyGtidConsistency_; + } + + /** + * + * + *
+   * Verify the GTID consistency for demote operation. Default value:
+   * `True`. Setting this flag to `false` enables you to bypass the GTID
+   * consistency check between on-premises primary instance and Cloud SQL
+   * instance during the demotion operation but also exposes you to the risk of
+   * future replication failures. Change the value only if you know the reason
+   * for the GTID divergence and are confident that doing so will not cause any
+   * replication issues.
+   * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getVerifyGtidConsistencyOrBuilder() { + return verifyGtidConsistency_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyGtidConsistency_; + } + + public static final int MASTER_INSTANCE_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object masterInstanceName_ = ""; + + /** + * + * + *
+   * The name of the instance which will act as on-premises primary instance
+   * in the replication setup.
+   * 
+ * + * string master_instance_name = 3; + * + * @return The masterInstanceName. + */ + @java.lang.Override + public java.lang.String getMasterInstanceName() { + java.lang.Object ref = masterInstanceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + masterInstanceName_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the instance which will act as on-premises primary instance
+   * in the replication setup.
+   * 
+ * + * string master_instance_name = 3; + * + * @return The bytes for masterInstanceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMasterInstanceNameBytes() { + java.lang.Object ref = masterInstanceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + masterInstanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPLICA_CONFIGURATION_FIELD_NUMBER = 4; + private com.google.cloud.sql.v1.DemoteMasterConfiguration replicaConfiguration_; + + /** + * + * + *
+   * Configuration specific to read-replicas replicating from the on-premises
+   * primary instance.
+   * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + * + * @return Whether the replicaConfiguration field is set. + */ + @java.lang.Override + public boolean hasReplicaConfiguration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Configuration specific to read-replicas replicating from the on-premises
+   * primary instance.
+   * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + * + * @return The replicaConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterConfiguration getReplicaConfiguration() { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1.DemoteMasterConfiguration.getDefaultInstance() + : replicaConfiguration_; + } + + /** + * + * + *
+   * Configuration specific to read-replicas replicating from the on-premises
+   * primary instance.
+   * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterConfigurationOrBuilder + getReplicaConfigurationOrBuilder() { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1.DemoteMasterConfiguration.getDefaultInstance() + : replicaConfiguration_; + } + + public static final int SKIP_REPLICATION_SETUP_FIELD_NUMBER = 5; + private boolean skipReplicationSetup_ = false; + + /** + * + * + *
+   * Flag to skip replication setup on the instance.
+   * 
+ * + * bool skip_replication_setup = 5; + * + * @return The skipReplicationSetup. + */ + @java.lang.Override + public boolean getSkipReplicationSetup() { + return skipReplicationSetup_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getVerifyGtidConsistency()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(masterInstanceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, masterInstanceName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getReplicaConfiguration()); + } + if (skipReplicationSetup_ != false) { + output.writeBool(5, skipReplicationSetup_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getVerifyGtidConsistency()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(masterInstanceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, masterInstanceName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, getReplicaConfiguration()); + } + if (skipReplicationSetup_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, skipReplicationSetup_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.DemoteMasterContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DemoteMasterContext other = + (com.google.cloud.sql.v1.DemoteMasterContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (hasVerifyGtidConsistency() != other.hasVerifyGtidConsistency()) return false; + if (hasVerifyGtidConsistency()) { + if (!getVerifyGtidConsistency().equals(other.getVerifyGtidConsistency())) return false; + } + if (!getMasterInstanceName().equals(other.getMasterInstanceName())) return false; + if (hasReplicaConfiguration() != other.hasReplicaConfiguration()) return false; + if (hasReplicaConfiguration()) { + if (!getReplicaConfiguration().equals(other.getReplicaConfiguration())) return false; + } + if (getSkipReplicationSetup() != other.getSkipReplicationSetup()) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasVerifyGtidConsistency()) { + hash = (37 * hash) + VERIFY_GTID_CONSISTENCY_FIELD_NUMBER; + hash = (53 * hash) + getVerifyGtidConsistency().hashCode(); + } + hash = (37 * hash) + MASTER_INSTANCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMasterInstanceName().hashCode(); + if (hasReplicaConfiguration()) { + hash = (37 * hash) + REPLICA_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getReplicaConfiguration().hashCode(); + } + hash = (37 * hash) + SKIP_REPLICATION_SETUP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSkipReplicationSetup()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DemoteMasterContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DemoteMasterContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DemoteMasterContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DemoteMasterContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DemoteMasterContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DemoteMasterContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DemoteMasterContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.DemoteMasterContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance demote primary instance context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DemoteMasterContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DemoteMasterContext) + com.google.cloud.sql.v1.DemoteMasterContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DemoteMasterContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DemoteMasterContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DemoteMasterContext.class, + com.google.cloud.sql.v1.DemoteMasterContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DemoteMasterContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetVerifyGtidConsistencyFieldBuilder(); + internalGetReplicaConfigurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + verifyGtidConsistency_ = null; + if (verifyGtidConsistencyBuilder_ != null) { + verifyGtidConsistencyBuilder_.dispose(); + verifyGtidConsistencyBuilder_ = null; + } + masterInstanceName_ = ""; + replicaConfiguration_ = null; + if (replicaConfigurationBuilder_ != null) { + replicaConfigurationBuilder_.dispose(); + replicaConfigurationBuilder_ = null; + } + skipReplicationSetup_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_DemoteMasterContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DemoteMasterContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterContext build() { + com.google.cloud.sql.v1.DemoteMasterContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterContext buildPartial() { + com.google.cloud.sql.v1.DemoteMasterContext result = + new com.google.cloud.sql.v1.DemoteMasterContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.DemoteMasterContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.verifyGtidConsistency_ = + verifyGtidConsistencyBuilder_ == null + ? verifyGtidConsistency_ + : verifyGtidConsistencyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.masterInstanceName_ = masterInstanceName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.replicaConfiguration_ = + replicaConfigurationBuilder_ == null + ? replicaConfiguration_ + : replicaConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.skipReplicationSetup_ = skipReplicationSetup_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DemoteMasterContext) { + return mergeFrom((com.google.cloud.sql.v1.DemoteMasterContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DemoteMasterContext other) { + if (other == com.google.cloud.sql.v1.DemoteMasterContext.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasVerifyGtidConsistency()) { + mergeVerifyGtidConsistency(other.getVerifyGtidConsistency()); + } + if (!other.getMasterInstanceName().isEmpty()) { + masterInstanceName_ = other.masterInstanceName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasReplicaConfiguration()) { + mergeReplicaConfiguration(other.getReplicaConfiguration()); + } + if (other.getSkipReplicationSetup() != false) { + setSkipReplicationSetup(other.getSkipReplicationSetup()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetVerifyGtidConsistencyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + masterInstanceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetReplicaConfigurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + skipReplicationSetup_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#demoteMasterContext`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteMasterContext`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteMasterContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteMasterContext`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteMasterContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue verifyGtidConsistency_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + verifyGtidConsistencyBuilder_; + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + * + * @return Whether the verifyGtidConsistency field is set. + */ + public boolean hasVerifyGtidConsistency() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + * + * @return The verifyGtidConsistency. + */ + public com.google.protobuf.BoolValue getVerifyGtidConsistency() { + if (verifyGtidConsistencyBuilder_ == null) { + return verifyGtidConsistency_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyGtidConsistency_; + } else { + return verifyGtidConsistencyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + public Builder setVerifyGtidConsistency(com.google.protobuf.BoolValue value) { + if (verifyGtidConsistencyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + verifyGtidConsistency_ = value; + } else { + verifyGtidConsistencyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + public Builder setVerifyGtidConsistency(com.google.protobuf.BoolValue.Builder builderForValue) { + if (verifyGtidConsistencyBuilder_ == null) { + verifyGtidConsistency_ = builderForValue.build(); + } else { + verifyGtidConsistencyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + public Builder mergeVerifyGtidConsistency(com.google.protobuf.BoolValue value) { + if (verifyGtidConsistencyBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && verifyGtidConsistency_ != null + && verifyGtidConsistency_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getVerifyGtidConsistencyBuilder().mergeFrom(value); + } else { + verifyGtidConsistency_ = value; + } + } else { + verifyGtidConsistencyBuilder_.mergeFrom(value); + } + if (verifyGtidConsistency_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + public Builder clearVerifyGtidConsistency() { + bitField0_ = (bitField0_ & ~0x00000002); + verifyGtidConsistency_ = null; + if (verifyGtidConsistencyBuilder_ != null) { + verifyGtidConsistencyBuilder_.dispose(); + verifyGtidConsistencyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + public com.google.protobuf.BoolValue.Builder getVerifyGtidConsistencyBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetVerifyGtidConsistencyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + public com.google.protobuf.BoolValueOrBuilder getVerifyGtidConsistencyOrBuilder() { + if (verifyGtidConsistencyBuilder_ != null) { + return verifyGtidConsistencyBuilder_.getMessageOrBuilder(); + } else { + return verifyGtidConsistency_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyGtidConsistency_; + } + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetVerifyGtidConsistencyFieldBuilder() { + if (verifyGtidConsistencyBuilder_ == null) { + verifyGtidConsistencyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getVerifyGtidConsistency(), getParentForChildren(), isClean()); + verifyGtidConsistency_ = null; + } + return verifyGtidConsistencyBuilder_; + } + + private java.lang.Object masterInstanceName_ = ""; + + /** + * + * + *
+     * The name of the instance which will act as on-premises primary instance
+     * in the replication setup.
+     * 
+ * + * string master_instance_name = 3; + * + * @return The masterInstanceName. + */ + public java.lang.String getMasterInstanceName() { + java.lang.Object ref = masterInstanceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + masterInstanceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the instance which will act as on-premises primary instance
+     * in the replication setup.
+     * 
+ * + * string master_instance_name = 3; + * + * @return The bytes for masterInstanceName. + */ + public com.google.protobuf.ByteString getMasterInstanceNameBytes() { + java.lang.Object ref = masterInstanceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + masterInstanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the instance which will act as on-premises primary instance
+     * in the replication setup.
+     * 
+ * + * string master_instance_name = 3; + * + * @param value The masterInstanceName to set. + * @return This builder for chaining. + */ + public Builder setMasterInstanceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + masterInstanceName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the instance which will act as on-premises primary instance
+     * in the replication setup.
+     * 
+ * + * string master_instance_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearMasterInstanceName() { + masterInstanceName_ = getDefaultInstance().getMasterInstanceName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the instance which will act as on-premises primary instance
+     * in the replication setup.
+     * 
+ * + * string master_instance_name = 3; + * + * @param value The bytes for masterInstanceName to set. + * @return This builder for chaining. + */ + public Builder setMasterInstanceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + masterInstanceName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.DemoteMasterConfiguration replicaConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DemoteMasterConfiguration, + com.google.cloud.sql.v1.DemoteMasterConfiguration.Builder, + com.google.cloud.sql.v1.DemoteMasterConfigurationOrBuilder> + replicaConfigurationBuilder_; + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + * + * @return Whether the replicaConfiguration field is set. + */ + public boolean hasReplicaConfiguration() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + * + * @return The replicaConfiguration. + */ + public com.google.cloud.sql.v1.DemoteMasterConfiguration getReplicaConfiguration() { + if (replicaConfigurationBuilder_ == null) { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1.DemoteMasterConfiguration.getDefaultInstance() + : replicaConfiguration_; + } else { + return replicaConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + */ + public Builder setReplicaConfiguration( + com.google.cloud.sql.v1.DemoteMasterConfiguration value) { + if (replicaConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replicaConfiguration_ = value; + } else { + replicaConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + */ + public Builder setReplicaConfiguration( + com.google.cloud.sql.v1.DemoteMasterConfiguration.Builder builderForValue) { + if (replicaConfigurationBuilder_ == null) { + replicaConfiguration_ = builderForValue.build(); + } else { + replicaConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + */ + public Builder mergeReplicaConfiguration( + com.google.cloud.sql.v1.DemoteMasterConfiguration value) { + if (replicaConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && replicaConfiguration_ != null + && replicaConfiguration_ + != com.google.cloud.sql.v1.DemoteMasterConfiguration.getDefaultInstance()) { + getReplicaConfigurationBuilder().mergeFrom(value); + } else { + replicaConfiguration_ = value; + } + } else { + replicaConfigurationBuilder_.mergeFrom(value); + } + if (replicaConfiguration_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + */ + public Builder clearReplicaConfiguration() { + bitField0_ = (bitField0_ & ~0x00000008); + replicaConfiguration_ = null; + if (replicaConfigurationBuilder_ != null) { + replicaConfigurationBuilder_.dispose(); + replicaConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + */ + public com.google.cloud.sql.v1.DemoteMasterConfiguration.Builder + getReplicaConfigurationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetReplicaConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + */ + public com.google.cloud.sql.v1.DemoteMasterConfigurationOrBuilder + getReplicaConfigurationOrBuilder() { + if (replicaConfigurationBuilder_ != null) { + return replicaConfigurationBuilder_.getMessageOrBuilder(); + } else { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1.DemoteMasterConfiguration.getDefaultInstance() + : replicaConfiguration_; + } + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DemoteMasterConfiguration, + com.google.cloud.sql.v1.DemoteMasterConfiguration.Builder, + com.google.cloud.sql.v1.DemoteMasterConfigurationOrBuilder> + internalGetReplicaConfigurationFieldBuilder() { + if (replicaConfigurationBuilder_ == null) { + replicaConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DemoteMasterConfiguration, + com.google.cloud.sql.v1.DemoteMasterConfiguration.Builder, + com.google.cloud.sql.v1.DemoteMasterConfigurationOrBuilder>( + getReplicaConfiguration(), getParentForChildren(), isClean()); + replicaConfiguration_ = null; + } + return replicaConfigurationBuilder_; + } + + private boolean skipReplicationSetup_; + + /** + * + * + *
+     * Flag to skip replication setup on the instance.
+     * 
+ * + * bool skip_replication_setup = 5; + * + * @return The skipReplicationSetup. + */ + @java.lang.Override + public boolean getSkipReplicationSetup() { + return skipReplicationSetup_; + } + + /** + * + * + *
+     * Flag to skip replication setup on the instance.
+     * 
+ * + * bool skip_replication_setup = 5; + * + * @param value The skipReplicationSetup to set. + * @return This builder for chaining. + */ + public Builder setSkipReplicationSetup(boolean value) { + + skipReplicationSetup_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Flag to skip replication setup on the instance.
+     * 
+ * + * bool skip_replication_setup = 5; + * + * @return This builder for chaining. + */ + public Builder clearSkipReplicationSetup() { + bitField0_ = (bitField0_ & ~0x00000010); + skipReplicationSetup_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DemoteMasterContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DemoteMasterContext) + private static final com.google.cloud.sql.v1.DemoteMasterContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DemoteMasterContext(); + } + + public static com.google.cloud.sql.v1.DemoteMasterContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DemoteMasterContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterContextOrBuilder.java new file mode 100644 index 000000000000..c94d6af69787 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterContextOrBuilder.java @@ -0,0 +1,190 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface DemoteMasterContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DemoteMasterContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#demoteMasterContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#demoteMasterContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Verify the GTID consistency for demote operation. Default value:
+   * `True`. Setting this flag to `false` enables you to bypass the GTID
+   * consistency check between on-premises primary instance and Cloud SQL
+   * instance during the demotion operation but also exposes you to the risk of
+   * future replication failures. Change the value only if you know the reason
+   * for the GTID divergence and are confident that doing so will not cause any
+   * replication issues.
+   * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + * + * @return Whether the verifyGtidConsistency field is set. + */ + boolean hasVerifyGtidConsistency(); + + /** + * + * + *
+   * Verify the GTID consistency for demote operation. Default value:
+   * `True`. Setting this flag to `false` enables you to bypass the GTID
+   * consistency check between on-premises primary instance and Cloud SQL
+   * instance during the demotion operation but also exposes you to the risk of
+   * future replication failures. Change the value only if you know the reason
+   * for the GTID divergence and are confident that doing so will not cause any
+   * replication issues.
+   * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + * + * @return The verifyGtidConsistency. + */ + com.google.protobuf.BoolValue getVerifyGtidConsistency(); + + /** + * + * + *
+   * Verify the GTID consistency for demote operation. Default value:
+   * `True`. Setting this flag to `false` enables you to bypass the GTID
+   * consistency check between on-premises primary instance and Cloud SQL
+   * instance during the demotion operation but also exposes you to the risk of
+   * future replication failures. Change the value only if you know the reason
+   * for the GTID divergence and are confident that doing so will not cause any
+   * replication issues.
+   * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + com.google.protobuf.BoolValueOrBuilder getVerifyGtidConsistencyOrBuilder(); + + /** + * + * + *
+   * The name of the instance which will act as on-premises primary instance
+   * in the replication setup.
+   * 
+ * + * string master_instance_name = 3; + * + * @return The masterInstanceName. + */ + java.lang.String getMasterInstanceName(); + + /** + * + * + *
+   * The name of the instance which will act as on-premises primary instance
+   * in the replication setup.
+   * 
+ * + * string master_instance_name = 3; + * + * @return The bytes for masterInstanceName. + */ + com.google.protobuf.ByteString getMasterInstanceNameBytes(); + + /** + * + * + *
+   * Configuration specific to read-replicas replicating from the on-premises
+   * primary instance.
+   * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + * + * @return Whether the replicaConfiguration field is set. + */ + boolean hasReplicaConfiguration(); + + /** + * + * + *
+   * Configuration specific to read-replicas replicating from the on-premises
+   * primary instance.
+   * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + * + * @return The replicaConfiguration. + */ + com.google.cloud.sql.v1.DemoteMasterConfiguration getReplicaConfiguration(); + + /** + * + * + *
+   * Configuration specific to read-replicas replicating from the on-premises
+   * primary instance.
+   * 
+ * + * .google.cloud.sql.v1.DemoteMasterConfiguration replica_configuration = 4; + */ + com.google.cloud.sql.v1.DemoteMasterConfigurationOrBuilder getReplicaConfigurationOrBuilder(); + + /** + * + * + *
+   * Flag to skip replication setup on the instance.
+   * 
+ * + * bool skip_replication_setup = 5; + * + * @return The skipReplicationSetup. + */ + boolean getSkipReplicationSetup(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterMySqlReplicaConfiguration.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterMySqlReplicaConfiguration.java new file mode 100644 index 000000000000..b26cdf45c788 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterMySqlReplicaConfiguration.java @@ -0,0 +1,1562 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Read-replica configuration specific to MySQL databases.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration} + */ +@com.google.protobuf.Generated +public final class DemoteMasterMySqlReplicaConfiguration + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration) + DemoteMasterMySqlReplicaConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DemoteMasterMySqlReplicaConfiguration"); + } + + // Use DemoteMasterMySqlReplicaConfiguration.newBuilder() to construct. + private DemoteMasterMySqlReplicaConfiguration( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DemoteMasterMySqlReplicaConfiguration() { + kind_ = ""; + username_ = ""; + password_ = ""; + clientKey_ = ""; + clientCertificate_ = ""; + caCertificate_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DemoteMasterMySqlReplicaConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DemoteMasterMySqlReplicaConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.class, + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERNAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object username_ = ""; + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } + } + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_KEY_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object clientKey_ = ""; + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate. The format of the replica's
+   * private key can be either PKCS #1 or PKCS #8.
+   * 
+ * + * string client_key = 4; + * + * @return The clientKey. + */ + @java.lang.Override + public java.lang.String getClientKey() { + java.lang.Object ref = clientKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientKey_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate. The format of the replica's
+   * private key can be either PKCS #1 or PKCS #8.
+   * 
+ * + * string client_key = 4; + * + * @return The bytes for clientKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientKeyBytes() { + java.lang.Object ref = clientKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_CERTIFICATE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object clientCertificate_ = ""; + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 5; + * + * @return The clientCertificate. + */ + @java.lang.Override + public java.lang.String getClientCertificate() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientCertificate_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 5; + * + * @return The bytes for clientCertificate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientCertificateBytes() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CA_CERTIFICATE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object caCertificate_ = ""; + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The caCertificate. + */ + @java.lang.Override + public java.lang.String getCaCertificate() { + java.lang.Object ref = caCertificate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCertificate_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The bytes for caCertificate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCaCertificateBytes() { + java.lang.Object ref = caCertificate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCertificate_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(username_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, username_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, password_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, clientKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientCertificate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, clientCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(caCertificate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, caCertificate_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(username_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, username_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, password_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, clientKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientCertificate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, clientCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(caCertificate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, caCertificate_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration other = + (com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getUsername().equals(other.getUsername())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (!getClientKey().equals(other.getClientKey())) return false; + if (!getClientCertificate().equals(other.getClientCertificate())) return false; + if (!getCaCertificate().equals(other.getCaCertificate())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (37 * hash) + CLIENT_KEY_FIELD_NUMBER; + hash = (53 * hash) + getClientKey().hashCode(); + hash = (37 * hash) + CLIENT_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getClientCertificate().hashCode(); + hash = (37 * hash) + CA_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getCaCertificate().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Read-replica configuration specific to MySQL databases.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration) + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DemoteMasterMySqlReplicaConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DemoteMasterMySqlReplicaConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.class, + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + username_ = ""; + password_ = ""; + clientKey_ = ""; + clientCertificate_ = ""; + caCertificate_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DemoteMasterMySqlReplicaConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration build() { + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration buildPartial() { + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration result = + new com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.username_ = username_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.password_ = password_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.clientKey_ = clientKey_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.clientCertificate_ = clientCertificate_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.caCertificate_ = caCertificate_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration) { + return mergeFrom((com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration other) { + if (other + == com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getClientKey().isEmpty()) { + clientKey_ = other.clientKey_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getClientCertificate().isEmpty()) { + clientCertificate_ = other.clientCertificate_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getCaCertificate().isEmpty()) { + caCertificate_ = other.caCertificate_; + bitField0_ |= 0x00000020; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + username_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + clientKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + clientCertificate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + caCertificate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object username_ = ""; + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + username_ = getDefaultInstance().getUsername(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object clientKey_ = ""; + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate. The format of the replica's
+     * private key can be either PKCS #1 or PKCS #8.
+     * 
+ * + * string client_key = 4; + * + * @return The clientKey. + */ + public java.lang.String getClientKey() { + java.lang.Object ref = clientKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate. The format of the replica's
+     * private key can be either PKCS #1 or PKCS #8.
+     * 
+ * + * string client_key = 4; + * + * @return The bytes for clientKey. + */ + public com.google.protobuf.ByteString getClientKeyBytes() { + java.lang.Object ref = clientKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate. The format of the replica's
+     * private key can be either PKCS #1 or PKCS #8.
+     * 
+ * + * string client_key = 4; + * + * @param value The clientKey to set. + * @return This builder for chaining. + */ + public Builder setClientKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clientKey_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate. The format of the replica's
+     * private key can be either PKCS #1 or PKCS #8.
+     * 
+ * + * string client_key = 4; + * + * @return This builder for chaining. + */ + public Builder clearClientKey() { + clientKey_ = getDefaultInstance().getClientKey(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate. The format of the replica's
+     * private key can be either PKCS #1 or PKCS #8.
+     * 
+ * + * string client_key = 4; + * + * @param value The bytes for clientKey to set. + * @return This builder for chaining. + */ + public Builder setClientKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clientKey_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object clientCertificate_ = ""; + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 5; + * + * @return The clientCertificate. + */ + public java.lang.String getClientCertificate() { + java.lang.Object ref = clientCertificate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientCertificate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 5; + * + * @return The bytes for clientCertificate. + */ + public com.google.protobuf.ByteString getClientCertificateBytes() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 5; + * + * @param value The clientCertificate to set. + * @return This builder for chaining. + */ + public Builder setClientCertificate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clientCertificate_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 5; + * + * @return This builder for chaining. + */ + public Builder clearClientCertificate() { + clientCertificate_ = getDefaultInstance().getClientCertificate(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 5; + * + * @param value The bytes for clientCertificate to set. + * @return This builder for chaining. + */ + public Builder setClientCertificateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clientCertificate_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object caCertificate_ = ""; + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @return The caCertificate. + */ + public java.lang.String getCaCertificate() { + java.lang.Object ref = caCertificate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCertificate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @return The bytes for caCertificate. + */ + public com.google.protobuf.ByteString getCaCertificateBytes() { + java.lang.Object ref = caCertificate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @param value The caCertificate to set. + * @return This builder for chaining. + */ + public Builder setCaCertificate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + caCertificate_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @return This builder for chaining. + */ + public Builder clearCaCertificate() { + caCertificate_ = getDefaultInstance().getCaCertificate(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @param value The bytes for caCertificate to set. + * @return This builder for chaining. + */ + public Builder setCaCertificateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + caCertificate_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration) + private static final com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration(); + } + + public static com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DemoteMasterMySqlReplicaConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterMySqlReplicaConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterMySqlReplicaConfigurationOrBuilder.java new file mode 100644 index 000000000000..131a40407012 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DemoteMasterMySqlReplicaConfigurationOrBuilder.java @@ -0,0 +1,188 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface DemoteMasterMySqlReplicaConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The username. + */ + java.lang.String getUsername(); + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The password. + */ + java.lang.String getPassword(); + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate. The format of the replica's
+   * private key can be either PKCS #1 or PKCS #8.
+   * 
+ * + * string client_key = 4; + * + * @return The clientKey. + */ + java.lang.String getClientKey(); + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate. The format of the replica's
+   * private key can be either PKCS #1 or PKCS #8.
+   * 
+ * + * string client_key = 4; + * + * @return The bytes for clientKey. + */ + com.google.protobuf.ByteString getClientKeyBytes(); + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 5; + * + * @return The clientCertificate. + */ + java.lang.String getClientCertificate(); + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 5; + * + * @return The bytes for clientCertificate. + */ + com.google.protobuf.ByteString getClientCertificateBytes(); + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The caCertificate. + */ + java.lang.String getCaCertificate(); + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The bytes for caCertificate. + */ + com.google.protobuf.ByteString getCaCertificateBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DenyMaintenancePeriod.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DenyMaintenancePeriod.java new file mode 100644 index 000000000000..07a7fe49dbfd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DenyMaintenancePeriod.java @@ -0,0 +1,1024 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Deny maintenance Periods. This specifies a date range during when all CSA
+ * rollout will be denied.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DenyMaintenancePeriod} + */ +@com.google.protobuf.Generated +public final class DenyMaintenancePeriod extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DenyMaintenancePeriod) + DenyMaintenancePeriodOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DenyMaintenancePeriod"); + } + + // Use DenyMaintenancePeriod.newBuilder() to construct. + private DenyMaintenancePeriod(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DenyMaintenancePeriod() { + startDate_ = ""; + endDate_ = ""; + time_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DenyMaintenancePeriod_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DenyMaintenancePeriod_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DenyMaintenancePeriod.class, + com.google.cloud.sql.v1.DenyMaintenancePeriod.Builder.class); + } + + public static final int START_DATE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object startDate_ = ""; + + /** + * + * + *
+   * "deny maintenance period" start date. If the year of the start date is
+   * empty, the year of the end date also must be empty. In this case, it means
+   * the deny maintenance period recurs every year. The date is in format
+   * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string start_date = 1; + * + * @return The startDate. + */ + @java.lang.Override + public java.lang.String getStartDate() { + java.lang.Object ref = startDate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startDate_ = s; + return s; + } + } + + /** + * + * + *
+   * "deny maintenance period" start date. If the year of the start date is
+   * empty, the year of the end date also must be empty. In this case, it means
+   * the deny maintenance period recurs every year. The date is in format
+   * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string start_date = 1; + * + * @return The bytes for startDate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStartDateBytes() { + java.lang.Object ref = startDate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + startDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int END_DATE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object endDate_ = ""; + + /** + * + * + *
+   * "deny maintenance period" end date. If the year of the end date is empty,
+   * the year of the start date also must be empty. In this case, it means the
+   * no maintenance interval recurs every year. The date is in format yyyy-mm-dd
+   * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string end_date = 2; + * + * @return The endDate. + */ + @java.lang.Override + public java.lang.String getEndDate() { + java.lang.Object ref = endDate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endDate_ = s; + return s; + } + } + + /** + * + * + *
+   * "deny maintenance period" end date. If the year of the end date is empty,
+   * the year of the start date also must be empty. In this case, it means the
+   * no maintenance interval recurs every year. The date is in format yyyy-mm-dd
+   * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string end_date = 2; + * + * @return The bytes for endDate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndDateBytes() { + java.lang.Object ref = endDate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object time_ = ""; + + /** + * + * + *
+   * Time in UTC when the "deny maintenance period" starts on start_date and
+   * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+   * 
+ * + * string time = 3; + * + * @return The time. + */ + @java.lang.Override + public java.lang.String getTime() { + java.lang.Object ref = time_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + time_ = s; + return s; + } + } + + /** + * + * + *
+   * Time in UTC when the "deny maintenance period" starts on start_date and
+   * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+   * 
+ * + * string time = 3; + * + * @return The bytes for time. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTimeBytes() { + java.lang.Object ref = time_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + time_ = 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.GeneratedMessage.isStringEmpty(startDate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, startDate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(endDate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, endDate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(time_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, time_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(startDate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, startDate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(endDate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, endDate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(time_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, time_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.DenyMaintenancePeriod)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DenyMaintenancePeriod other = + (com.google.cloud.sql.v1.DenyMaintenancePeriod) obj; + + if (!getStartDate().equals(other.getStartDate())) return false; + if (!getEndDate().equals(other.getEndDate())) return false; + if (!getTime().equals(other.getTime())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + START_DATE_FIELD_NUMBER; + hash = (53 * hash) + getStartDate().hashCode(); + hash = (37 * hash) + END_DATE_FIELD_NUMBER; + hash = (53 * hash) + getEndDate().hashCode(); + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + getTime().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DenyMaintenancePeriod parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DenyMaintenancePeriod parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DenyMaintenancePeriod parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DenyMaintenancePeriod parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DenyMaintenancePeriod parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DenyMaintenancePeriod parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DenyMaintenancePeriod parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DenyMaintenancePeriod parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DenyMaintenancePeriod parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DenyMaintenancePeriod parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DenyMaintenancePeriod parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DenyMaintenancePeriod parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.DenyMaintenancePeriod prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Deny maintenance Periods. This specifies a date range during when all CSA
+   * rollout will be denied.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DenyMaintenancePeriod} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DenyMaintenancePeriod) + com.google.cloud.sql.v1.DenyMaintenancePeriodOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DenyMaintenancePeriod_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DenyMaintenancePeriod_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DenyMaintenancePeriod.class, + com.google.cloud.sql.v1.DenyMaintenancePeriod.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DenyMaintenancePeriod.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startDate_ = ""; + endDate_ = ""; + time_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DenyMaintenancePeriod_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DenyMaintenancePeriod getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DenyMaintenancePeriod.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DenyMaintenancePeriod build() { + com.google.cloud.sql.v1.DenyMaintenancePeriod result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DenyMaintenancePeriod buildPartial() { + com.google.cloud.sql.v1.DenyMaintenancePeriod result = + new com.google.cloud.sql.v1.DenyMaintenancePeriod(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.DenyMaintenancePeriod result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startDate_ = startDate_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endDate_ = endDate_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.time_ = time_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DenyMaintenancePeriod) { + return mergeFrom((com.google.cloud.sql.v1.DenyMaintenancePeriod) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DenyMaintenancePeriod other) { + if (other == com.google.cloud.sql.v1.DenyMaintenancePeriod.getDefaultInstance()) return this; + if (!other.getStartDate().isEmpty()) { + startDate_ = other.startDate_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEndDate().isEmpty()) { + endDate_ = other.endDate_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getTime().isEmpty()) { + time_ = other.time_; + 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: + { + startDate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + endDate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + time_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object startDate_ = ""; + + /** + * + * + *
+     * "deny maintenance period" start date. If the year of the start date is
+     * empty, the year of the end date also must be empty. In this case, it means
+     * the deny maintenance period recurs every year. The date is in format
+     * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string start_date = 1; + * + * @return The startDate. + */ + public java.lang.String getStartDate() { + java.lang.Object ref = startDate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startDate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * "deny maintenance period" start date. If the year of the start date is
+     * empty, the year of the end date also must be empty. In this case, it means
+     * the deny maintenance period recurs every year. The date is in format
+     * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string start_date = 1; + * + * @return The bytes for startDate. + */ + public com.google.protobuf.ByteString getStartDateBytes() { + java.lang.Object ref = startDate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + startDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * "deny maintenance period" start date. If the year of the start date is
+     * empty, the year of the end date also must be empty. In this case, it means
+     * the deny maintenance period recurs every year. The date is in format
+     * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string start_date = 1; + * + * @param value The startDate to set. + * @return This builder for chaining. + */ + public Builder setStartDate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + startDate_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * "deny maintenance period" start date. If the year of the start date is
+     * empty, the year of the end date also must be empty. In this case, it means
+     * the deny maintenance period recurs every year. The date is in format
+     * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string start_date = 1; + * + * @return This builder for chaining. + */ + public Builder clearStartDate() { + startDate_ = getDefaultInstance().getStartDate(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * "deny maintenance period" start date. If the year of the start date is
+     * empty, the year of the end date also must be empty. In this case, it means
+     * the deny maintenance period recurs every year. The date is in format
+     * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string start_date = 1; + * + * @param value The bytes for startDate to set. + * @return This builder for chaining. + */ + public Builder setStartDateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + startDate_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object endDate_ = ""; + + /** + * + * + *
+     * "deny maintenance period" end date. If the year of the end date is empty,
+     * the year of the start date also must be empty. In this case, it means the
+     * no maintenance interval recurs every year. The date is in format yyyy-mm-dd
+     * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string end_date = 2; + * + * @return The endDate. + */ + public java.lang.String getEndDate() { + java.lang.Object ref = endDate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endDate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * "deny maintenance period" end date. If the year of the end date is empty,
+     * the year of the start date also must be empty. In this case, it means the
+     * no maintenance interval recurs every year. The date is in format yyyy-mm-dd
+     * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string end_date = 2; + * + * @return The bytes for endDate. + */ + public com.google.protobuf.ByteString getEndDateBytes() { + java.lang.Object ref = endDate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * "deny maintenance period" end date. If the year of the end date is empty,
+     * the year of the start date also must be empty. In this case, it means the
+     * no maintenance interval recurs every year. The date is in format yyyy-mm-dd
+     * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string end_date = 2; + * + * @param value The endDate to set. + * @return This builder for chaining. + */ + public Builder setEndDate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endDate_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * "deny maintenance period" end date. If the year of the end date is empty,
+     * the year of the start date also must be empty. In this case, it means the
+     * no maintenance interval recurs every year. The date is in format yyyy-mm-dd
+     * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string end_date = 2; + * + * @return This builder for chaining. + */ + public Builder clearEndDate() { + endDate_ = getDefaultInstance().getEndDate(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * "deny maintenance period" end date. If the year of the end date is empty,
+     * the year of the start date also must be empty. In this case, it means the
+     * no maintenance interval recurs every year. The date is in format yyyy-mm-dd
+     * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string end_date = 2; + * + * @param value The bytes for endDate to set. + * @return This builder for chaining. + */ + public Builder setEndDateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endDate_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object time_ = ""; + + /** + * + * + *
+     * Time in UTC when the "deny maintenance period" starts on start_date and
+     * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+     * 
+ * + * string time = 3; + * + * @return The time. + */ + public java.lang.String getTime() { + java.lang.Object ref = time_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + time_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Time in UTC when the "deny maintenance period" starts on start_date and
+     * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+     * 
+ * + * string time = 3; + * + * @return The bytes for time. + */ + public com.google.protobuf.ByteString getTimeBytes() { + java.lang.Object ref = time_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + time_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Time in UTC when the "deny maintenance period" starts on start_date and
+     * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+     * 
+ * + * string time = 3; + * + * @param value The time to set. + * @return This builder for chaining. + */ + public Builder setTime(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + time_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Time in UTC when the "deny maintenance period" starts on start_date and
+     * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+     * 
+ * + * string time = 3; + * + * @return This builder for chaining. + */ + public Builder clearTime() { + time_ = getDefaultInstance().getTime(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Time in UTC when the "deny maintenance period" starts on start_date and
+     * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+     * 
+ * + * string time = 3; + * + * @param value The bytes for time to set. + * @return This builder for chaining. + */ + public Builder setTimeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + time_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DenyMaintenancePeriod) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DenyMaintenancePeriod) + private static final com.google.cloud.sql.v1.DenyMaintenancePeriod DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DenyMaintenancePeriod(); + } + + public static com.google.cloud.sql.v1.DenyMaintenancePeriod getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DenyMaintenancePeriod parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DenyMaintenancePeriod getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DenyMaintenancePeriodOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DenyMaintenancePeriodOrBuilder.java new file mode 100644 index 000000000000..b17c217b53cd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DenyMaintenancePeriodOrBuilder.java @@ -0,0 +1,120 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface DenyMaintenancePeriodOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DenyMaintenancePeriod) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * "deny maintenance period" start date. If the year of the start date is
+   * empty, the year of the end date also must be empty. In this case, it means
+   * the deny maintenance period recurs every year. The date is in format
+   * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string start_date = 1; + * + * @return The startDate. + */ + java.lang.String getStartDate(); + + /** + * + * + *
+   * "deny maintenance period" start date. If the year of the start date is
+   * empty, the year of the end date also must be empty. In this case, it means
+   * the deny maintenance period recurs every year. The date is in format
+   * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string start_date = 1; + * + * @return The bytes for startDate. + */ + com.google.protobuf.ByteString getStartDateBytes(); + + /** + * + * + *
+   * "deny maintenance period" end date. If the year of the end date is empty,
+   * the year of the start date also must be empty. In this case, it means the
+   * no maintenance interval recurs every year. The date is in format yyyy-mm-dd
+   * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string end_date = 2; + * + * @return The endDate. + */ + java.lang.String getEndDate(); + + /** + * + * + *
+   * "deny maintenance period" end date. If the year of the end date is empty,
+   * the year of the start date also must be empty. In this case, it means the
+   * no maintenance interval recurs every year. The date is in format yyyy-mm-dd
+   * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string end_date = 2; + * + * @return The bytes for endDate. + */ + com.google.protobuf.ByteString getEndDateBytes(); + + /** + * + * + *
+   * Time in UTC when the "deny maintenance period" starts on start_date and
+   * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+   * 
+ * + * string time = 3; + * + * @return The time. + */ + java.lang.String getTime(); + + /** + * + * + *
+   * Time in UTC when the "deny maintenance period" starts on start_date and
+   * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+   * 
+ * + * string time = 3; + * + * @return The bytes for time. + */ + com.google.protobuf.ByteString getTimeBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DiskEncryptionConfiguration.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DiskEncryptionConfiguration.java new file mode 100644 index 000000000000..d5d1042e693e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DiskEncryptionConfiguration.java @@ -0,0 +1,785 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Disk encryption configuration for an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DiskEncryptionConfiguration} + */ +@com.google.protobuf.Generated +public final class DiskEncryptionConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DiskEncryptionConfiguration) + DiskEncryptionConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DiskEncryptionConfiguration"); + } + + // Use DiskEncryptionConfiguration.newBuilder() to construct. + private DiskEncryptionConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DiskEncryptionConfiguration() { + kmsKeyName_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DiskEncryptionConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DiskEncryptionConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DiskEncryptionConfiguration.class, + com.google.cloud.sql.v1.DiskEncryptionConfiguration.Builder.class); + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyName_ = ""; + + /** + * + * + *
+   * Resource name of KMS key for disk encryption
+   * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } + } + + /** + * + * + *
+   * Resource name of KMS key for disk encryption
+   * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#diskEncryptionConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#diskEncryptionConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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.GeneratedMessage.isStringEmpty(kmsKeyName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.DiskEncryptionConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DiskEncryptionConfiguration other = + (com.google.cloud.sql.v1.DiskEncryptionConfiguration) obj; + + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DiskEncryptionConfiguration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DiskEncryptionConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DiskEncryptionConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DiskEncryptionConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DiskEncryptionConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DiskEncryptionConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DiskEncryptionConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DiskEncryptionConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DiskEncryptionConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DiskEncryptionConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DiskEncryptionConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DiskEncryptionConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.DiskEncryptionConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Disk encryption configuration for an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DiskEncryptionConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DiskEncryptionConfiguration) + com.google.cloud.sql.v1.DiskEncryptionConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DiskEncryptionConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DiskEncryptionConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DiskEncryptionConfiguration.class, + com.google.cloud.sql.v1.DiskEncryptionConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DiskEncryptionConfiguration.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kmsKeyName_ = ""; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DiskEncryptionConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionConfiguration getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DiskEncryptionConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionConfiguration build() { + com.google.cloud.sql.v1.DiskEncryptionConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionConfiguration buildPartial() { + com.google.cloud.sql.v1.DiskEncryptionConfiguration result = + new com.google.cloud.sql.v1.DiskEncryptionConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.DiskEncryptionConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kmsKeyName_ = kmsKeyName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DiskEncryptionConfiguration) { + return mergeFrom((com.google.cloud.sql.v1.DiskEncryptionConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DiskEncryptionConfiguration other) { + if (other == com.google.cloud.sql.v1.DiskEncryptionConfiguration.getDefaultInstance()) + return this; + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + kmsKeyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + kind_ = 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 kmsKeyName_ = ""; + + /** + * + * + *
+     * Resource name of KMS key for disk encryption
+     * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Resource name of KMS key for disk encryption
+     * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Resource name of KMS key for disk encryption
+     * 
+ * + * string kms_key_name = 1; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Resource name of KMS key for disk encryption
+     * 
+ * + * string kms_key_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Resource name of KMS key for disk encryption
+     * 
+ * + * string kms_key_name = 1; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#diskEncryptionConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DiskEncryptionConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DiskEncryptionConfiguration) + private static final com.google.cloud.sql.v1.DiskEncryptionConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DiskEncryptionConfiguration(); + } + + public static com.google.cloud.sql.v1.DiskEncryptionConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DiskEncryptionConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DiskEncryptionConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DiskEncryptionConfigurationOrBuilder.java new file mode 100644 index 000000000000..eb353e21458c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DiskEncryptionConfigurationOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface DiskEncryptionConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DiskEncryptionConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of KMS key for disk encryption
+   * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + + /** + * + * + *
+   * Resource name of KMS key for disk encryption
+   * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); + + /** + * + * + *
+   * This is always `sql#diskEncryptionConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#diskEncryptionConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DiskEncryptionStatus.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DiskEncryptionStatus.java new file mode 100644 index 000000000000..f90b509b6bad --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DiskEncryptionStatus.java @@ -0,0 +1,784 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Disk encryption status for an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DiskEncryptionStatus} + */ +@com.google.protobuf.Generated +public final class DiskEncryptionStatus extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DiskEncryptionStatus) + DiskEncryptionStatusOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DiskEncryptionStatus"); + } + + // Use DiskEncryptionStatus.newBuilder() to construct. + private DiskEncryptionStatus(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DiskEncryptionStatus() { + kmsKeyVersionName_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DiskEncryptionStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DiskEncryptionStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DiskEncryptionStatus.class, + com.google.cloud.sql.v1.DiskEncryptionStatus.Builder.class); + } + + public static final int KMS_KEY_VERSION_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyVersionName_ = ""; + + /** + * + * + *
+   * KMS key version used to encrypt the Cloud SQL instance resource
+   * 
+ * + * string kms_key_version_name = 1; + * + * @return The kmsKeyVersionName. + */ + @java.lang.Override + public java.lang.String getKmsKeyVersionName() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersionName_ = s; + return s; + } + } + + /** + * + * + *
+   * KMS key version used to encrypt the Cloud SQL instance resource
+   * 
+ * + * string kms_key_version_name = 1; + * + * @return The bytes for kmsKeyVersionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyVersionNameBytes() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#diskEncryptionStatus`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#diskEncryptionStatus`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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.GeneratedMessage.isStringEmpty(kmsKeyVersionName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kmsKeyVersionName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kmsKeyVersionName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kmsKeyVersionName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.DiskEncryptionStatus)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DiskEncryptionStatus other = + (com.google.cloud.sql.v1.DiskEncryptionStatus) obj; + + if (!getKmsKeyVersionName().equals(other.getKmsKeyVersionName())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KMS_KEY_VERSION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyVersionName().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DiskEncryptionStatus parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DiskEncryptionStatus parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DiskEncryptionStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DiskEncryptionStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DiskEncryptionStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DiskEncryptionStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DiskEncryptionStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DiskEncryptionStatus parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DiskEncryptionStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DiskEncryptionStatus parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DiskEncryptionStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DiskEncryptionStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.DiskEncryptionStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Disk encryption status for an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DiskEncryptionStatus} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DiskEncryptionStatus) + com.google.cloud.sql.v1.DiskEncryptionStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DiskEncryptionStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DiskEncryptionStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DiskEncryptionStatus.class, + com.google.cloud.sql.v1.DiskEncryptionStatus.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DiskEncryptionStatus.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kmsKeyVersionName_ = ""; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DiskEncryptionStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionStatus getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DiskEncryptionStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionStatus build() { + com.google.cloud.sql.v1.DiskEncryptionStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionStatus buildPartial() { + com.google.cloud.sql.v1.DiskEncryptionStatus result = + new com.google.cloud.sql.v1.DiskEncryptionStatus(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.DiskEncryptionStatus result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kmsKeyVersionName_ = kmsKeyVersionName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DiskEncryptionStatus) { + return mergeFrom((com.google.cloud.sql.v1.DiskEncryptionStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DiskEncryptionStatus other) { + if (other == com.google.cloud.sql.v1.DiskEncryptionStatus.getDefaultInstance()) return this; + if (!other.getKmsKeyVersionName().isEmpty()) { + kmsKeyVersionName_ = other.kmsKeyVersionName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + kmsKeyVersionName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + kind_ = 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 kmsKeyVersionName_ = ""; + + /** + * + * + *
+     * KMS key version used to encrypt the Cloud SQL instance resource
+     * 
+ * + * string kms_key_version_name = 1; + * + * @return The kmsKeyVersionName. + */ + public java.lang.String getKmsKeyVersionName() { + java.lang.Object ref = kmsKeyVersionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * KMS key version used to encrypt the Cloud SQL instance resource
+     * 
+ * + * string kms_key_version_name = 1; + * + * @return The bytes for kmsKeyVersionName. + */ + public com.google.protobuf.ByteString getKmsKeyVersionNameBytes() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * KMS key version used to encrypt the Cloud SQL instance resource
+     * 
+ * + * string kms_key_version_name = 1; + * + * @param value The kmsKeyVersionName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyVersionName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * KMS key version used to encrypt the Cloud SQL instance resource
+     * 
+ * + * string kms_key_version_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyVersionName() { + kmsKeyVersionName_ = getDefaultInstance().getKmsKeyVersionName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * KMS key version used to encrypt the Cloud SQL instance resource
+     * 
+ * + * string kms_key_version_name = 1; + * + * @param value The bytes for kmsKeyVersionName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyVersionName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#diskEncryptionStatus`.
+     * 
+ * + * string kind = 2; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionStatus`.
+     * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionStatus`.
+     * 
+ * + * string kind = 2; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionStatus`.
+     * 
+ * + * string kind = 2; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionStatus`.
+     * 
+ * + * string kind = 2; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DiskEncryptionStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DiskEncryptionStatus) + private static final com.google.cloud.sql.v1.DiskEncryptionStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DiskEncryptionStatus(); + } + + public static com.google.cloud.sql.v1.DiskEncryptionStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DiskEncryptionStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DiskEncryptionStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DiskEncryptionStatusOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DiskEncryptionStatusOrBuilder.java new file mode 100644 index 000000000000..0fbaef14defe --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DiskEncryptionStatusOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface DiskEncryptionStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DiskEncryptionStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * KMS key version used to encrypt the Cloud SQL instance resource
+   * 
+ * + * string kms_key_version_name = 1; + * + * @return The kmsKeyVersionName. + */ + java.lang.String getKmsKeyVersionName(); + + /** + * + * + *
+   * KMS key version used to encrypt the Cloud SQL instance resource
+   * 
+ * + * string kms_key_version_name = 1; + * + * @return The bytes for kmsKeyVersionName. + */ + com.google.protobuf.ByteString getKmsKeyVersionNameBytes(); + + /** + * + * + *
+   * This is always `sql#diskEncryptionStatus`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#diskEncryptionStatus`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DnsNameMapping.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DnsNameMapping.java new file mode 100644 index 000000000000..f1783928cc3e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DnsNameMapping.java @@ -0,0 +1,1656 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * DNS metadata.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DnsNameMapping} + */ +@com.google.protobuf.Generated +public final class DnsNameMapping extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.DnsNameMapping) + DnsNameMappingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DnsNameMapping"); + } + + // Use DnsNameMapping.newBuilder() to construct. + private DnsNameMapping(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DnsNameMapping() { + name_ = ""; + connectionType_ = 0; + dnsScope_ = 0; + recordManager_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DnsNameMapping_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DnsNameMapping_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DnsNameMapping.class, + com.google.cloud.sql.v1.DnsNameMapping.Builder.class); + } + + /** + * + * + *
+   * The connection type of the DNS name.
+   * This enum is not frozen, and new values may be added in the future.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.DnsNameMapping.ConnectionType} + */ + public enum ConnectionType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown connection type.
+     * 
+ * + * CONNECTION_TYPE_UNSPECIFIED = 0; + */ + CONNECTION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Public IP.
+     * 
+ * + * PUBLIC = 1; + */ + PUBLIC(1), + /** + * + * + *
+     * Private services access (private IP).
+     * 
+ * + * PRIVATE_SERVICES_ACCESS = 2; + */ + PRIVATE_SERVICES_ACCESS(2), + /** + * + * + *
+     * Private Service Connect.
+     * 
+ * + * PRIVATE_SERVICE_CONNECT = 3; + */ + PRIVATE_SERVICE_CONNECT(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ConnectionType"); + } + + /** + * + * + *
+     * Unknown connection type.
+     * 
+ * + * CONNECTION_TYPE_UNSPECIFIED = 0; + */ + public static final int CONNECTION_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Public IP.
+     * 
+ * + * PUBLIC = 1; + */ + public static final int PUBLIC_VALUE = 1; + + /** + * + * + *
+     * Private services access (private IP).
+     * 
+ * + * PRIVATE_SERVICES_ACCESS = 2; + */ + public static final int PRIVATE_SERVICES_ACCESS_VALUE = 2; + + /** + * + * + *
+     * Private Service Connect.
+     * 
+ * + * PRIVATE_SERVICE_CONNECT = 3; + */ + public static final int PRIVATE_SERVICE_CONNECT_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 PUBLIC; + case 2: + return PRIVATE_SERVICES_ACCESS; + case 3: + return PRIVATE_SERVICE_CONNECT; + 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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.DnsNameMapping.getDescriptor().getEnumTypes().get(0); + } + + 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.sql.v1.DnsNameMapping.ConnectionType) + } + + /** + * + * + *
+   * The scope that the DNS name applies to.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.DnsNameMapping.DnsScope} + */ + public enum DnsScope implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * DNS scope not set. This value should not be used.
+     * 
+ * + * DNS_SCOPE_UNSPECIFIED = 0; + */ + DNS_SCOPE_UNSPECIFIED(0), + /** + * + * + *
+     * Indicates an instance-level DNS name.
+     * 
+ * + * INSTANCE = 1; + */ + INSTANCE(1), + /** + * + * + *
+     * Indicates a cluster-level DNS name.
+     * 
+ * + * CLUSTER = 2; + */ + CLUSTER(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DnsScope"); + } + + /** + * + * + *
+     * DNS scope not set. This value should not be used.
+     * 
+ * + * DNS_SCOPE_UNSPECIFIED = 0; + */ + public static final int DNS_SCOPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Indicates an instance-level DNS name.
+     * 
+ * + * INSTANCE = 1; + */ + public static final int INSTANCE_VALUE = 1; + + /** + * + * + *
+     * Indicates a cluster-level DNS name.
+     * 
+ * + * 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 DnsScope 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 DnsScope forNumber(int value) { + switch (value) { + case 0: + return DNS_SCOPE_UNSPECIFIED; + case 1: + return INSTANCE; + 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 DnsScope findValueByNumber(int number) { + return DnsScope.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.DnsNameMapping.getDescriptor().getEnumTypes().get(1); + } + + private static final DnsScope[] VALUES = values(); + + public static DnsScope 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 DnsScope(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.DnsNameMapping.DnsScope) + } + + /** + * + * + *
+   * The system responsible for managing the DNS record.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.DnsNameMapping.RecordManager} + */ + public enum RecordManager implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Record manager not set. This value should not be used.
+     * 
+ * + * RECORD_MANAGER_UNSPECIFIED = 0; + */ + RECORD_MANAGER_UNSPECIFIED(0), + /** + * + * + *
+     * The record may be managed by the customer. It is not automatically
+     * managed by Cloud SQL automation.
+     * 
+ * + * CUSTOMER = 1; + */ + CUSTOMER(1), + /** + * + * + *
+     * The record is managed by Cloud SQL, which will create, update,
+     * and delete the DNS records for the zone automatically when
+     * the Cloud SQL database instance is created or updated.
+     * 
+ * + * CLOUD_SQL_AUTOMATION = 2; + */ + CLOUD_SQL_AUTOMATION(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RecordManager"); + } + + /** + * + * + *
+     * Record manager not set. This value should not be used.
+     * 
+ * + * RECORD_MANAGER_UNSPECIFIED = 0; + */ + public static final int RECORD_MANAGER_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The record may be managed by the customer. It is not automatically
+     * managed by Cloud SQL automation.
+     * 
+ * + * CUSTOMER = 1; + */ + public static final int CUSTOMER_VALUE = 1; + + /** + * + * + *
+     * The record is managed by Cloud SQL, which will create, update,
+     * and delete the DNS records for the zone automatically when
+     * the Cloud SQL database instance is created or updated.
+     * 
+ * + * CLOUD_SQL_AUTOMATION = 2; + */ + public static final int CLOUD_SQL_AUTOMATION_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 RecordManager 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 RecordManager forNumber(int value) { + switch (value) { + case 0: + return RECORD_MANAGER_UNSPECIFIED; + case 1: + return CUSTOMER; + case 2: + return CLOUD_SQL_AUTOMATION; + 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 RecordManager findValueByNumber(int number) { + return RecordManager.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.DnsNameMapping.getDescriptor().getEnumTypes().get(2); + } + + private static final RecordManager[] VALUES = values(); + + public static RecordManager 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 RecordManager(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.DnsNameMapping.RecordManager) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Output only. The DNS name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The DNS name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONNECTION_TYPE_FIELD_NUMBER = 2; + private int connectionType_ = 0; + + /** + * + * + *
+   * Output only. The connection type of the DNS name.
+   * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.ConnectionType connection_type = 2 [(.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. The connection type of the DNS name.
+   * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.ConnectionType connection_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMapping.ConnectionType getConnectionType() { + com.google.cloud.sql.v1.DnsNameMapping.ConnectionType result = + com.google.cloud.sql.v1.DnsNameMapping.ConnectionType.forNumber(connectionType_); + return result == null + ? com.google.cloud.sql.v1.DnsNameMapping.ConnectionType.UNRECOGNIZED + : result; + } + + public static final int DNS_SCOPE_FIELD_NUMBER = 3; + private int dnsScope_ = 0; + + /** + * + * + *
+   * Output only. The scope that the DNS name applies to.
+   * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for dnsScope. + */ + @java.lang.Override + public int getDnsScopeValue() { + return dnsScope_; + } + + /** + * + * + *
+   * Output only. The scope that the DNS name applies to.
+   * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The dnsScope. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMapping.DnsScope getDnsScope() { + com.google.cloud.sql.v1.DnsNameMapping.DnsScope result = + com.google.cloud.sql.v1.DnsNameMapping.DnsScope.forNumber(dnsScope_); + return result == null ? com.google.cloud.sql.v1.DnsNameMapping.DnsScope.UNRECOGNIZED : result; + } + + public static final int RECORD_MANAGER_FIELD_NUMBER = 4; + private int recordManager_ = 0; + + /** + * + * + *
+   * Output only. The manager for this DNS record.
+   * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for recordManager. + */ + @java.lang.Override + public int getRecordManagerValue() { + return recordManager_; + } + + /** + * + * + *
+   * Output only. The manager for this DNS record.
+   * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The recordManager. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMapping.RecordManager getRecordManager() { + com.google.cloud.sql.v1.DnsNameMapping.RecordManager result = + com.google.cloud.sql.v1.DnsNameMapping.RecordManager.forNumber(recordManager_); + return result == null + ? com.google.cloud.sql.v1.DnsNameMapping.RecordManager.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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (connectionType_ + != com.google.cloud.sql.v1.DnsNameMapping.ConnectionType.CONNECTION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, connectionType_); + } + if (dnsScope_ + != com.google.cloud.sql.v1.DnsNameMapping.DnsScope.DNS_SCOPE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, dnsScope_); + } + if (recordManager_ + != com.google.cloud.sql.v1.DnsNameMapping.RecordManager.RECORD_MANAGER_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, recordManager_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (connectionType_ + != com.google.cloud.sql.v1.DnsNameMapping.ConnectionType.CONNECTION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, connectionType_); + } + if (dnsScope_ + != com.google.cloud.sql.v1.DnsNameMapping.DnsScope.DNS_SCOPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, dnsScope_); + } + if (recordManager_ + != com.google.cloud.sql.v1.DnsNameMapping.RecordManager.RECORD_MANAGER_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, recordManager_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.DnsNameMapping)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.DnsNameMapping other = (com.google.cloud.sql.v1.DnsNameMapping) obj; + + if (!getName().equals(other.getName())) return false; + if (connectionType_ != other.connectionType_) return false; + if (dnsScope_ != other.dnsScope_) return false; + if (recordManager_ != other.recordManager_) return false; + if (!getUnknownFields().equals(other.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) + CONNECTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + connectionType_; + hash = (37 * hash) + DNS_SCOPE_FIELD_NUMBER; + hash = (53 * hash) + dnsScope_; + hash = (37 * hash) + RECORD_MANAGER_FIELD_NUMBER; + hash = (53 * hash) + recordManager_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.DnsNameMapping parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DnsNameMapping parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DnsNameMapping parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DnsNameMapping parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DnsNameMapping parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.DnsNameMapping parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DnsNameMapping parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DnsNameMapping parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DnsNameMapping parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DnsNameMapping parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.DnsNameMapping parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.DnsNameMapping parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.DnsNameMapping prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * DNS metadata.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.DnsNameMapping} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.DnsNameMapping) + com.google.cloud.sql.v1.DnsNameMappingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DnsNameMapping_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DnsNameMapping_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.DnsNameMapping.class, + com.google.cloud.sql.v1.DnsNameMapping.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.DnsNameMapping.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + connectionType_ = 0; + dnsScope_ = 0; + recordManager_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_DnsNameMapping_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMapping getDefaultInstanceForType() { + return com.google.cloud.sql.v1.DnsNameMapping.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMapping build() { + com.google.cloud.sql.v1.DnsNameMapping result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMapping buildPartial() { + com.google.cloud.sql.v1.DnsNameMapping result = + new com.google.cloud.sql.v1.DnsNameMapping(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.DnsNameMapping result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.connectionType_ = connectionType_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dnsScope_ = dnsScope_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.recordManager_ = recordManager_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.DnsNameMapping) { + return mergeFrom((com.google.cloud.sql.v1.DnsNameMapping) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.DnsNameMapping other) { + if (other == com.google.cloud.sql.v1.DnsNameMapping.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.connectionType_ != 0) { + setConnectionTypeValue(other.getConnectionTypeValue()); + } + if (other.dnsScope_ != 0) { + setDnsScopeValue(other.getDnsScopeValue()); + } + if (other.recordManager_ != 0) { + setRecordManagerValue(other.getRecordManagerValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + connectionType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + dnsScope_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + recordManager_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. The DNS name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The DNS name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The DNS name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The DNS name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The DNS name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int connectionType_ = 0; + + /** + * + * + *
+     * Output only. The connection type of the DNS name.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.ConnectionType connection_type = 2 [(.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. The connection type of the DNS name.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.ConnectionType connection_type = 2 [(.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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The connection type of the DNS name.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.ConnectionType connection_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMapping.ConnectionType getConnectionType() { + com.google.cloud.sql.v1.DnsNameMapping.ConnectionType result = + com.google.cloud.sql.v1.DnsNameMapping.ConnectionType.forNumber(connectionType_); + return result == null + ? com.google.cloud.sql.v1.DnsNameMapping.ConnectionType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. The connection type of the DNS name.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.ConnectionType connection_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The connectionType to set. + * @return This builder for chaining. + */ + public Builder setConnectionType(com.google.cloud.sql.v1.DnsNameMapping.ConnectionType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + connectionType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The connection type of the DNS name.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.ConnectionType connection_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearConnectionType() { + bitField0_ = (bitField0_ & ~0x00000002); + connectionType_ = 0; + onChanged(); + return this; + } + + private int dnsScope_ = 0; + + /** + * + * + *
+     * Output only. The scope that the DNS name applies to.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for dnsScope. + */ + @java.lang.Override + public int getDnsScopeValue() { + return dnsScope_; + } + + /** + * + * + *
+     * Output only. The scope that the DNS name applies to.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for dnsScope to set. + * @return This builder for chaining. + */ + public Builder setDnsScopeValue(int value) { + dnsScope_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The scope that the DNS name applies to.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The dnsScope. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMapping.DnsScope getDnsScope() { + com.google.cloud.sql.v1.DnsNameMapping.DnsScope result = + com.google.cloud.sql.v1.DnsNameMapping.DnsScope.forNumber(dnsScope_); + return result == null ? com.google.cloud.sql.v1.DnsNameMapping.DnsScope.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The scope that the DNS name applies to.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The dnsScope to set. + * @return This builder for chaining. + */ + public Builder setDnsScope(com.google.cloud.sql.v1.DnsNameMapping.DnsScope value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + dnsScope_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The scope that the DNS name applies to.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDnsScope() { + bitField0_ = (bitField0_ & ~0x00000004); + dnsScope_ = 0; + onChanged(); + return this; + } + + private int recordManager_ = 0; + + /** + * + * + *
+     * Output only. The manager for this DNS record.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for recordManager. + */ + @java.lang.Override + public int getRecordManagerValue() { + return recordManager_; + } + + /** + * + * + *
+     * Output only. The manager for this DNS record.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for recordManager to set. + * @return This builder for chaining. + */ + public Builder setRecordManagerValue(int value) { + recordManager_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The manager for this DNS record.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The recordManager. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMapping.RecordManager getRecordManager() { + com.google.cloud.sql.v1.DnsNameMapping.RecordManager result = + com.google.cloud.sql.v1.DnsNameMapping.RecordManager.forNumber(recordManager_); + return result == null + ? com.google.cloud.sql.v1.DnsNameMapping.RecordManager.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. The manager for this DNS record.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The recordManager to set. + * @return This builder for chaining. + */ + public Builder setRecordManager(com.google.cloud.sql.v1.DnsNameMapping.RecordManager value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + recordManager_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The manager for this DNS record.
+     * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearRecordManager() { + bitField0_ = (bitField0_ & ~0x00000008); + recordManager_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.DnsNameMapping) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.DnsNameMapping) + private static final com.google.cloud.sql.v1.DnsNameMapping DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.DnsNameMapping(); + } + + public static com.google.cloud.sql.v1.DnsNameMapping getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DnsNameMapping parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.DnsNameMapping getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DnsNameMappingOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DnsNameMappingOrBuilder.java new file mode 100644 index 000000000000..e398e7bbfa87 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/DnsNameMappingOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface DnsNameMappingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.DnsNameMapping) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The DNS name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Output only. The DNS name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The connection type of the DNS name.
+   * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.ConnectionType connection_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionType. + */ + int getConnectionTypeValue(); + + /** + * + * + *
+   * Output only. The connection type of the DNS name.
+   * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.ConnectionType connection_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + com.google.cloud.sql.v1.DnsNameMapping.ConnectionType getConnectionType(); + + /** + * + * + *
+   * Output only. The scope that the DNS name applies to.
+   * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for dnsScope. + */ + int getDnsScopeValue(); + + /** + * + * + *
+   * Output only. The scope that the DNS name applies to.
+   * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The dnsScope. + */ + com.google.cloud.sql.v1.DnsNameMapping.DnsScope getDnsScope(); + + /** + * + * + *
+   * Output only. The manager for this DNS record.
+   * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for recordManager. + */ + int getRecordManagerValue(); + + /** + * + * + *
+   * Output only. The manager for this DNS record.
+   * 
+ * + * + * .google.cloud.sql.v1.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The recordManager. + */ + com.google.cloud.sql.v1.DnsNameMapping.RecordManager getRecordManager(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExecuteSqlPayload.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExecuteSqlPayload.java new file mode 100644 index 000000000000..4cd0498d372d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExecuteSqlPayload.java @@ -0,0 +1,1899 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The request payload used to execute SQL statements.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ExecuteSqlPayload} + */ +@com.google.protobuf.Generated +public final class ExecuteSqlPayload extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ExecuteSqlPayload) + ExecuteSqlPayloadOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExecuteSqlPayload"); + } + + // Use ExecuteSqlPayload.newBuilder() to construct. + private ExecuteSqlPayload(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ExecuteSqlPayload() { + user_ = ""; + sqlStatement_ = ""; + database_ = ""; + partialResultMode_ = 0; + application_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ExecuteSqlPayload_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ExecuteSqlPayload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExecuteSqlPayload.class, + com.google.cloud.sql.v1.ExecuteSqlPayload.Builder.class); + } + + /** + * + * + *
+   * Controls how the API should respond when the SQL execution result exceeds
+   * 10 MB.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode} + */ + public enum PartialResultMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified mode, effectively the same as `FAIL_PARTIAL_RESULT`.
+     * 
+ * + * PARTIAL_RESULT_MODE_UNSPECIFIED = 0; + */ + PARTIAL_RESULT_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Throw an error if the result exceeds 10 MB or if only a partial result
+     * can be retrieved. Don't return the result.
+     * 
+ * + * FAIL_PARTIAL_RESULT = 1; + */ + FAIL_PARTIAL_RESULT(1), + /** + * + * + *
+     * Return a truncated result and set `partial_result` to true if the result
+     * exceeds 10 MB or if only a partial result can be retrieved due to error.
+     * Don't throw an error.
+     * 
+ * + * ALLOW_PARTIAL_RESULT = 2; + */ + ALLOW_PARTIAL_RESULT(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PartialResultMode"); + } + + /** + * + * + *
+     * Unspecified mode, effectively the same as `FAIL_PARTIAL_RESULT`.
+     * 
+ * + * PARTIAL_RESULT_MODE_UNSPECIFIED = 0; + */ + public static final int PARTIAL_RESULT_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Throw an error if the result exceeds 10 MB or if only a partial result
+     * can be retrieved. Don't return the result.
+     * 
+ * + * FAIL_PARTIAL_RESULT = 1; + */ + public static final int FAIL_PARTIAL_RESULT_VALUE = 1; + + /** + * + * + *
+     * Return a truncated result and set `partial_result` to true if the result
+     * exceeds 10 MB or if only a partial result can be retrieved due to error.
+     * Don't throw an error.
+     * 
+ * + * ALLOW_PARTIAL_RESULT = 2; + */ + public static final int ALLOW_PARTIAL_RESULT_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 PartialResultMode 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 PartialResultMode forNumber(int value) { + switch (value) { + case 0: + return PARTIAL_RESULT_MODE_UNSPECIFIED; + case 1: + return FAIL_PARTIAL_RESULT; + case 2: + return ALLOW_PARTIAL_RESULT; + 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 PartialResultMode findValueByNumber(int number) { + return PartialResultMode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.ExecuteSqlPayload.getDescriptor().getEnumTypes().get(0); + } + + private static final PartialResultMode[] VALUES = values(); + + public static PartialResultMode 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 PartialResultMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode) + } + + private int userPasswordCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object userPassword_; + + public enum UserPasswordCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AUTO_IAM_AUTHN(11), + USERPASSWORD_NOT_SET(0); + private final int value; + + private UserPasswordCase(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 UserPasswordCase valueOf(int value) { + return forNumber(value); + } + + public static UserPasswordCase forNumber(int value) { + switch (value) { + case 11: + return AUTO_IAM_AUTHN; + case 0: + return USERPASSWORD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public UserPasswordCase getUserPasswordCase() { + return UserPasswordCase.forNumber(userPasswordCase_); + } + + public static final int USER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object user_ = ""; + + /** + * + * + *
+   * Optional. The name of an existing database user to connect to the database.
+   * When `auto_iam_authn` is set to true, this field is ignored and the API
+   * caller's IAM user is used.
+   * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The user. + */ + @java.lang.Override + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The name of an existing database user to connect to the database.
+   * When `auto_iam_authn` is set to true, this field is ignored and the API
+   * caller's IAM user is used.
+   * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for user. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SQL_STATEMENT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object sqlStatement_ = ""; + + /** + * + * + *
+   * Required. SQL statements to run on the database. It can be a single
+   * statement or a sequence of statements separated by semicolons.
+   * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sqlStatement. + */ + @java.lang.Override + public java.lang.String getSqlStatement() { + java.lang.Object ref = sqlStatement_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sqlStatement_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. SQL statements to run on the database. It can be a single
+   * statement or a sequence of statements separated by semicolons.
+   * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for sqlStatement. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSqlStatementBytes() { + java.lang.Object ref = sqlStatement_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sqlStatement_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * Optional. Name of the database on which the statement will be executed.
+   * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Name of the database on which the statement will be executed.
+   * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTO_IAM_AUTHN_FIELD_NUMBER = 11; + + /** + * + * + *
+   * Optional. When set to `true`, the API caller identity associated with the
+   * request is used for database authentication. The API caller must be an
+   * IAM user in the database.
+   * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the autoIamAuthn field is set. + */ + @java.lang.Override + public boolean hasAutoIamAuthn() { + return userPasswordCase_ == 11; + } + + /** + * + * + *
+   * Optional. When set to `true`, the API caller identity associated with the
+   * request is used for database authentication. The API caller must be an
+   * IAM user in the database.
+   * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The autoIamAuthn. + */ + @java.lang.Override + public boolean getAutoIamAuthn() { + if (userPasswordCase_ == 11) { + return (java.lang.Boolean) userPassword_; + } + return false; + } + + public static final int ROW_LIMIT_FIELD_NUMBER = 10; + private long rowLimit_ = 0L; + + /** + * + * + *
+   * Optional. The maximum number of rows returned per SQL statement.
+   * 
+ * + * int64 row_limit = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The rowLimit. + */ + @java.lang.Override + public long getRowLimit() { + return rowLimit_; + } + + public static final int PARTIAL_RESULT_MODE_FIELD_NUMBER = 13; + private int partialResultMode_ = 0; + + /** + * + * + *
+   * Optional. Controls how the API should respond when the SQL execution result
+   * is incomplete due to the size limit or another error. The default mode is
+   * to throw an error.
+   * 
+ * + * + * .google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for partialResultMode. + */ + @java.lang.Override + public int getPartialResultModeValue() { + return partialResultMode_; + } + + /** + * + * + *
+   * Optional. Controls how the API should respond when the SQL execution result
+   * is incomplete due to the size limit or another error. The default mode is
+   * to throw an error.
+   * 
+ * + * + * .google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The partialResultMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode getPartialResultMode() { + com.google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode result = + com.google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode.forNumber(partialResultMode_); + return result == null + ? com.google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode.UNRECOGNIZED + : result; + } + + public static final int APPLICATION_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private volatile java.lang.Object application_ = ""; + + /** + * + * + *
+   * Optional. Specifies the name of the application that is making the request.
+   * This field is used for telemetry. Only alphanumeric characters, dashes, and
+   * underscores are allowed. The maximum length is 32 characters.
+   * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The application. + */ + @java.lang.Override + public java.lang.String getApplication() { + java.lang.Object ref = application_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + application_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Specifies the name of the application that is making the request.
+   * This field is used for telemetry. Only alphanumeric characters, dashes, and
+   * underscores are allowed. The maximum length is 32 characters.
+   * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for application. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApplicationBytes() { + java.lang.Object ref = application_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + application_ = 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.GeneratedMessage.isStringEmpty(user_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, user_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sqlStatement_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, sqlStatement_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, database_); + } + if (rowLimit_ != 0L) { + output.writeInt64(10, rowLimit_); + } + if (userPasswordCase_ == 11) { + output.writeBool(11, (boolean) ((java.lang.Boolean) userPassword_)); + } + if (partialResultMode_ + != com.google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode + .PARTIAL_RESULT_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(13, partialResultMode_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(application_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 16, application_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(user_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, user_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sqlStatement_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, sqlStatement_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, database_); + } + if (rowLimit_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(10, rowLimit_); + } + if (userPasswordCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 11, (boolean) ((java.lang.Boolean) userPassword_)); + } + if (partialResultMode_ + != com.google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode + .PARTIAL_RESULT_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, partialResultMode_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(application_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(16, application_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ExecuteSqlPayload)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ExecuteSqlPayload other = + (com.google.cloud.sql.v1.ExecuteSqlPayload) obj; + + if (!getUser().equals(other.getUser())) return false; + if (!getSqlStatement().equals(other.getSqlStatement())) return false; + if (!getDatabase().equals(other.getDatabase())) return false; + if (getRowLimit() != other.getRowLimit()) return false; + if (partialResultMode_ != other.partialResultMode_) return false; + if (!getApplication().equals(other.getApplication())) return false; + if (!getUserPasswordCase().equals(other.getUserPasswordCase())) return false; + switch (userPasswordCase_) { + case 11: + if (getAutoIamAuthn() != other.getAutoIamAuthn()) 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) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + hash = (37 * hash) + SQL_STATEMENT_FIELD_NUMBER; + hash = (53 * hash) + getSqlStatement().hashCode(); + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + ROW_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRowLimit()); + hash = (37 * hash) + PARTIAL_RESULT_MODE_FIELD_NUMBER; + hash = (53 * hash) + partialResultMode_; + hash = (37 * hash) + APPLICATION_FIELD_NUMBER; + hash = (53 * hash) + getApplication().hashCode(); + switch (userPasswordCase_) { + case 11: + hash = (37 * hash) + AUTO_IAM_AUTHN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAutoIamAuthn()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ExecuteSqlPayload parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExecuteSqlPayload parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExecuteSqlPayload parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExecuteSqlPayload parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExecuteSqlPayload parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExecuteSqlPayload parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExecuteSqlPayload parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExecuteSqlPayload parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExecuteSqlPayload parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExecuteSqlPayload parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExecuteSqlPayload parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExecuteSqlPayload parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.ExecuteSqlPayload prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request payload used to execute SQL statements.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ExecuteSqlPayload} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ExecuteSqlPayload) + com.google.cloud.sql.v1.ExecuteSqlPayloadOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ExecuteSqlPayload_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ExecuteSqlPayload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExecuteSqlPayload.class, + com.google.cloud.sql.v1.ExecuteSqlPayload.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ExecuteSqlPayload.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + user_ = ""; + sqlStatement_ = ""; + database_ = ""; + rowLimit_ = 0L; + partialResultMode_ = 0; + application_ = ""; + userPasswordCase_ = 0; + userPassword_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ExecuteSqlPayload_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExecuteSqlPayload getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ExecuteSqlPayload.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExecuteSqlPayload build() { + com.google.cloud.sql.v1.ExecuteSqlPayload result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExecuteSqlPayload buildPartial() { + com.google.cloud.sql.v1.ExecuteSqlPayload result = + new com.google.cloud.sql.v1.ExecuteSqlPayload(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ExecuteSqlPayload result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.user_ = user_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sqlStatement_ = sqlStatement_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.database_ = database_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.rowLimit_ = rowLimit_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.partialResultMode_ = partialResultMode_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.application_ = application_; + } + } + + private void buildPartialOneofs(com.google.cloud.sql.v1.ExecuteSqlPayload result) { + result.userPasswordCase_ = userPasswordCase_; + result.userPassword_ = this.userPassword_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ExecuteSqlPayload) { + return mergeFrom((com.google.cloud.sql.v1.ExecuteSqlPayload) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ExecuteSqlPayload other) { + if (other == com.google.cloud.sql.v1.ExecuteSqlPayload.getDefaultInstance()) return this; + if (!other.getUser().isEmpty()) { + user_ = other.user_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getSqlStatement().isEmpty()) { + sqlStatement_ = other.sqlStatement_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getRowLimit() != 0L) { + setRowLimit(other.getRowLimit()); + } + if (other.partialResultMode_ != 0) { + setPartialResultModeValue(other.getPartialResultModeValue()); + } + if (!other.getApplication().isEmpty()) { + application_ = other.application_; + bitField0_ |= 0x00000040; + onChanged(); + } + switch (other.getUserPasswordCase()) { + case AUTO_IAM_AUTHN: + { + setAutoIamAuthn(other.getAutoIamAuthn()); + break; + } + case USERPASSWORD_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: + { + user_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + sqlStatement_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + database_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 80: + { + rowLimit_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 80 + case 88: + { + userPassword_ = input.readBool(); + userPasswordCase_ = 11; + break; + } // case 88 + case 104: + { + partialResultMode_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 104 + case 130: + { + application_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 130 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int userPasswordCase_ = 0; + private java.lang.Object userPassword_; + + public UserPasswordCase getUserPasswordCase() { + return UserPasswordCase.forNumber(userPasswordCase_); + } + + public Builder clearUserPassword() { + userPasswordCase_ = 0; + userPassword_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object user_ = ""; + + /** + * + * + *
+     * Optional. The name of an existing database user to connect to the database.
+     * When `auto_iam_authn` is set to true, this field is ignored and the API
+     * caller's IAM user is used.
+     * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The user. + */ + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The name of an existing database user to connect to the database.
+     * When `auto_iam_authn` is set to true, this field is ignored and the API
+     * caller's IAM user is used.
+     * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for user. + */ + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The name of an existing database user to connect to the database.
+     * When `auto_iam_authn` is set to true, this field is ignored and the API
+     * caller's IAM user is used.
+     * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The user to set. + * @return This builder for chaining. + */ + public Builder setUser(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of an existing database user to connect to the database.
+     * When `auto_iam_authn` is set to true, this field is ignored and the API
+     * caller's IAM user is used.
+     * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearUser() { + user_ = getDefaultInstance().getUser(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of an existing database user to connect to the database.
+     * When `auto_iam_authn` is set to true, this field is ignored and the API
+     * caller's IAM user is used.
+     * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for user to set. + * @return This builder for chaining. + */ + public Builder setUserBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + user_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object sqlStatement_ = ""; + + /** + * + * + *
+     * Required. SQL statements to run on the database. It can be a single
+     * statement or a sequence of statements separated by semicolons.
+     * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sqlStatement. + */ + public java.lang.String getSqlStatement() { + java.lang.Object ref = sqlStatement_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sqlStatement_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. SQL statements to run on the database. It can be a single
+     * statement or a sequence of statements separated by semicolons.
+     * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for sqlStatement. + */ + public com.google.protobuf.ByteString getSqlStatementBytes() { + java.lang.Object ref = sqlStatement_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sqlStatement_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. SQL statements to run on the database. It can be a single
+     * statement or a sequence of statements separated by semicolons.
+     * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The sqlStatement to set. + * @return This builder for chaining. + */ + public Builder setSqlStatement(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sqlStatement_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. SQL statements to run on the database. It can be a single
+     * statement or a sequence of statements separated by semicolons.
+     * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearSqlStatement() { + sqlStatement_ = getDefaultInstance().getSqlStatement(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. SQL statements to run on the database. It can be a single
+     * statement or a sequence of statements separated by semicolons.
+     * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for sqlStatement to set. + * @return This builder for chaining. + */ + public Builder setSqlStatementBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sqlStatement_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object database_ = ""; + + /** + * + * + *
+     * Optional. Name of the database on which the statement will be executed.
+     * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Name of the database on which the statement will be executed.
+     * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Name of the database on which the statement will be executed.
+     * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + database_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Name of the database on which the statement will be executed.
+     * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Name of the database on which the statement will be executed.
+     * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + database_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When set to `true`, the API caller identity associated with the
+     * request is used for database authentication. The API caller must be an
+     * IAM user in the database.
+     * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the autoIamAuthn field is set. + */ + public boolean hasAutoIamAuthn() { + return userPasswordCase_ == 11; + } + + /** + * + * + *
+     * Optional. When set to `true`, the API caller identity associated with the
+     * request is used for database authentication. The API caller must be an
+     * IAM user in the database.
+     * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The autoIamAuthn. + */ + public boolean getAutoIamAuthn() { + if (userPasswordCase_ == 11) { + return (java.lang.Boolean) userPassword_; + } + return false; + } + + /** + * + * + *
+     * Optional. When set to `true`, the API caller identity associated with the
+     * request is used for database authentication. The API caller must be an
+     * IAM user in the database.
+     * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The autoIamAuthn to set. + * @return This builder for chaining. + */ + public Builder setAutoIamAuthn(boolean value) { + + userPasswordCase_ = 11; + userPassword_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When set to `true`, the API caller identity associated with the
+     * request is used for database authentication. The API caller must be an
+     * IAM user in the database.
+     * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAutoIamAuthn() { + if (userPasswordCase_ == 11) { + userPasswordCase_ = 0; + userPassword_ = null; + onChanged(); + } + return this; + } + + private long rowLimit_; + + /** + * + * + *
+     * Optional. The maximum number of rows returned per SQL statement.
+     * 
+ * + * int64 row_limit = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The rowLimit. + */ + @java.lang.Override + public long getRowLimit() { + return rowLimit_; + } + + /** + * + * + *
+     * Optional. The maximum number of rows returned per SQL statement.
+     * 
+ * + * int64 row_limit = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The rowLimit to set. + * @return This builder for chaining. + */ + public Builder setRowLimit(long value) { + + rowLimit_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of rows returned per SQL statement.
+     * 
+ * + * int64 row_limit = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRowLimit() { + bitField0_ = (bitField0_ & ~0x00000010); + rowLimit_ = 0L; + onChanged(); + return this; + } + + private int partialResultMode_ = 0; + + /** + * + * + *
+     * Optional. Controls how the API should respond when the SQL execution result
+     * is incomplete due to the size limit or another error. The default mode is
+     * to throw an error.
+     * 
+ * + * + * .google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for partialResultMode. + */ + @java.lang.Override + public int getPartialResultModeValue() { + return partialResultMode_; + } + + /** + * + * + *
+     * Optional. Controls how the API should respond when the SQL execution result
+     * is incomplete due to the size limit or another error. The default mode is
+     * to throw an error.
+     * 
+ * + * + * .google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for partialResultMode to set. + * @return This builder for chaining. + */ + public Builder setPartialResultModeValue(int value) { + partialResultMode_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Controls how the API should respond when the SQL execution result
+     * is incomplete due to the size limit or another error. The default mode is
+     * to throw an error.
+     * 
+ * + * + * .google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The partialResultMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode getPartialResultMode() { + com.google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode result = + com.google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode.forNumber(partialResultMode_); + return result == null + ? com.google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. Controls how the API should respond when the SQL execution result
+     * is incomplete due to the size limit or another error. The default mode is
+     * to throw an error.
+     * 
+ * + * + * .google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The partialResultMode to set. + * @return This builder for chaining. + */ + public Builder setPartialResultMode( + com.google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + partialResultMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Controls how the API should respond when the SQL execution result
+     * is incomplete due to the size limit or another error. The default mode is
+     * to throw an error.
+     * 
+ * + * + * .google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPartialResultMode() { + bitField0_ = (bitField0_ & ~0x00000020); + partialResultMode_ = 0; + onChanged(); + return this; + } + + private java.lang.Object application_ = ""; + + /** + * + * + *
+     * Optional. Specifies the name of the application that is making the request.
+     * This field is used for telemetry. Only alphanumeric characters, dashes, and
+     * underscores are allowed. The maximum length is 32 characters.
+     * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The application. + */ + public java.lang.String getApplication() { + java.lang.Object ref = application_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + application_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Specifies the name of the application that is making the request.
+     * This field is used for telemetry. Only alphanumeric characters, dashes, and
+     * underscores are allowed. The maximum length is 32 characters.
+     * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for application. + */ + public com.google.protobuf.ByteString getApplicationBytes() { + java.lang.Object ref = application_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + application_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Specifies the name of the application that is making the request.
+     * This field is used for telemetry. Only alphanumeric characters, dashes, and
+     * underscores are allowed. The maximum length is 32 characters.
+     * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The application to set. + * @return This builder for chaining. + */ + public Builder setApplication(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + application_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the name of the application that is making the request.
+     * This field is used for telemetry. Only alphanumeric characters, dashes, and
+     * underscores are allowed. The maximum length is 32 characters.
+     * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearApplication() { + application_ = getDefaultInstance().getApplication(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the name of the application that is making the request.
+     * This field is used for telemetry. Only alphanumeric characters, dashes, and
+     * underscores are allowed. The maximum length is 32 characters.
+     * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for application to set. + * @return This builder for chaining. + */ + public Builder setApplicationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + application_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ExecuteSqlPayload) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ExecuteSqlPayload) + private static final com.google.cloud.sql.v1.ExecuteSqlPayload DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ExecuteSqlPayload(); + } + + public static com.google.cloud.sql.v1.ExecuteSqlPayload getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExecuteSqlPayload parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExecuteSqlPayload getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExecuteSqlPayloadOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExecuteSqlPayloadOrBuilder.java new file mode 100644 index 000000000000..762daf1156af --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExecuteSqlPayloadOrBuilder.java @@ -0,0 +1,221 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ExecuteSqlPayloadOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ExecuteSqlPayload) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The name of an existing database user to connect to the database.
+   * When `auto_iam_authn` is set to true, this field is ignored and the API
+   * caller's IAM user is used.
+   * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The user. + */ + java.lang.String getUser(); + + /** + * + * + *
+   * Optional. The name of an existing database user to connect to the database.
+   * When `auto_iam_authn` is set to true, this field is ignored and the API
+   * caller's IAM user is used.
+   * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for user. + */ + com.google.protobuf.ByteString getUserBytes(); + + /** + * + * + *
+   * Required. SQL statements to run on the database. It can be a single
+   * statement or a sequence of statements separated by semicolons.
+   * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sqlStatement. + */ + java.lang.String getSqlStatement(); + + /** + * + * + *
+   * Required. SQL statements to run on the database. It can be a single
+   * statement or a sequence of statements separated by semicolons.
+   * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for sqlStatement. + */ + com.google.protobuf.ByteString getSqlStatementBytes(); + + /** + * + * + *
+   * Optional. Name of the database on which the statement will be executed.
+   * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * Optional. Name of the database on which the statement will be executed.
+   * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * Optional. When set to `true`, the API caller identity associated with the
+   * request is used for database authentication. The API caller must be an
+   * IAM user in the database.
+   * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the autoIamAuthn field is set. + */ + boolean hasAutoIamAuthn(); + + /** + * + * + *
+   * Optional. When set to `true`, the API caller identity associated with the
+   * request is used for database authentication. The API caller must be an
+   * IAM user in the database.
+   * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The autoIamAuthn. + */ + boolean getAutoIamAuthn(); + + /** + * + * + *
+   * Optional. The maximum number of rows returned per SQL statement.
+   * 
+ * + * int64 row_limit = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The rowLimit. + */ + long getRowLimit(); + + /** + * + * + *
+   * Optional. Controls how the API should respond when the SQL execution result
+   * is incomplete due to the size limit or another error. The default mode is
+   * to throw an error.
+   * 
+ * + * + * .google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for partialResultMode. + */ + int getPartialResultModeValue(); + + /** + * + * + *
+   * Optional. Controls how the API should respond when the SQL execution result
+   * is incomplete due to the size limit or another error. The default mode is
+   * to throw an error.
+   * 
+ * + * + * .google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The partialResultMode. + */ + com.google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode getPartialResultMode(); + + /** + * + * + *
+   * Optional. Specifies the name of the application that is making the request.
+   * This field is used for telemetry. Only alphanumeric characters, dashes, and
+   * underscores are allowed. The maximum length is 32 characters.
+   * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The application. + */ + java.lang.String getApplication(); + + /** + * + * + *
+   * Optional. Specifies the name of the application that is making the request.
+   * This field is used for telemetry. Only alphanumeric characters, dashes, and
+   * underscores are allowed. The maximum length is 32 characters.
+   * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for application. + */ + com.google.protobuf.ByteString getApplicationBytes(); + + com.google.cloud.sql.v1.ExecuteSqlPayload.UserPasswordCase getUserPasswordCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExportContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExportContext.java new file mode 100644 index 000000000000..bd181cd1540c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExportContext.java @@ -0,0 +1,12779 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance export context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ExportContext} + */ +@com.google.protobuf.Generated +public final class ExportContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ExportContext) + ExportContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExportContext"); + } + + // Use ExportContext.newBuilder() to construct. + private ExportContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ExportContext() { + uri_ = ""; + databases_ = com.google.protobuf.LazyStringArrayList.emptyList(); + kind_ = ""; + fileType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExportContext.class, + com.google.cloud.sql.v1.ExportContext.Builder.class); + } + + public interface SqlCsvExportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ExportContext.SqlCsvExportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The select query used to extract the data.
+     * 
+ * + * string select_query = 1; + * + * @return The selectQuery. + */ + java.lang.String getSelectQuery(); + + /** + * + * + *
+     * The select query used to extract the data.
+     * 
+ * + * string select_query = 1; + * + * @return The bytes for selectQuery. + */ + com.google.protobuf.ByteString getSelectQueryBytes(); + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 2; + * + * @return The escapeCharacter. + */ + java.lang.String getEscapeCharacter(); + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 2; + * + * @return The bytes for escapeCharacter. + */ + com.google.protobuf.ByteString getEscapeCharacterBytes(); + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 3; + * + * @return The quoteCharacter. + */ + java.lang.String getQuoteCharacter(); + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 3; + * + * @return The bytes for quoteCharacter. + */ + com.google.protobuf.ByteString getQuoteCharacterBytes(); + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 4; + * + * @return The fieldsTerminatedBy. + */ + java.lang.String getFieldsTerminatedBy(); + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 4; + * + * @return The bytes for fieldsTerminatedBy. + */ + com.google.protobuf.ByteString getFieldsTerminatedByBytes(); + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 6; + * + * @return The linesTerminatedBy. + */ + java.lang.String getLinesTerminatedBy(); + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 6; + * + * @return The bytes for linesTerminatedBy. + */ + com.google.protobuf.ByteString getLinesTerminatedByBytes(); + } + + /** Protobuf type {@code google.cloud.sql.v1.ExportContext.SqlCsvExportOptions} */ + public static final class SqlCsvExportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ExportContext.SqlCsvExportOptions) + SqlCsvExportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlCsvExportOptions"); + } + + // Use SqlCsvExportOptions.newBuilder() to construct. + private SqlCsvExportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlCsvExportOptions() { + selectQuery_ = ""; + escapeCharacter_ = ""; + quoteCharacter_ = ""; + fieldsTerminatedBy_ = ""; + linesTerminatedBy_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlCsvExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlCsvExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.class, + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.Builder.class); + } + + public static final int SELECT_QUERY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object selectQuery_ = ""; + + /** + * + * + *
+     * The select query used to extract the data.
+     * 
+ * + * string select_query = 1; + * + * @return The selectQuery. + */ + @java.lang.Override + public java.lang.String getSelectQuery() { + java.lang.Object ref = selectQuery_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selectQuery_ = s; + return s; + } + } + + /** + * + * + *
+     * The select query used to extract the data.
+     * 
+ * + * string select_query = 1; + * + * @return The bytes for selectQuery. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelectQueryBytes() { + java.lang.Object ref = selectQuery_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selectQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ESCAPE_CHARACTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object escapeCharacter_ = ""; + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 2; + * + * @return The escapeCharacter. + */ + @java.lang.Override + public java.lang.String getEscapeCharacter() { + java.lang.Object ref = escapeCharacter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + escapeCharacter_ = s; + return s; + } + } + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 2; + * + * @return The bytes for escapeCharacter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEscapeCharacterBytes() { + java.lang.Object ref = escapeCharacter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + escapeCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTE_CHARACTER_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object quoteCharacter_ = ""; + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 3; + * + * @return The quoteCharacter. + */ + @java.lang.Override + public java.lang.String getQuoteCharacter() { + java.lang.Object ref = quoteCharacter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quoteCharacter_ = s; + return s; + } + } + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 3; + * + * @return The bytes for quoteCharacter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQuoteCharacterBytes() { + java.lang.Object ref = quoteCharacter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quoteCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIELDS_TERMINATED_BY_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object fieldsTerminatedBy_ = ""; + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 4; + * + * @return The fieldsTerminatedBy. + */ + @java.lang.Override + public java.lang.String getFieldsTerminatedBy() { + java.lang.Object ref = fieldsTerminatedBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldsTerminatedBy_ = s; + return s; + } + } + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 4; + * + * @return The bytes for fieldsTerminatedBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFieldsTerminatedByBytes() { + java.lang.Object ref = fieldsTerminatedBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldsTerminatedBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINES_TERMINATED_BY_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object linesTerminatedBy_ = ""; + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 6; + * + * @return The linesTerminatedBy. + */ + @java.lang.Override + public java.lang.String getLinesTerminatedBy() { + java.lang.Object ref = linesTerminatedBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + linesTerminatedBy_ = s; + return s; + } + } + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 6; + * + * @return The bytes for linesTerminatedBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLinesTerminatedByBytes() { + java.lang.Object ref = linesTerminatedBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + linesTerminatedBy_ = 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.GeneratedMessage.isStringEmpty(selectQuery_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, selectQuery_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(escapeCharacter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, escapeCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(quoteCharacter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, quoteCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fieldsTerminatedBy_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, fieldsTerminatedBy_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(linesTerminatedBy_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, linesTerminatedBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selectQuery_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, selectQuery_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(escapeCharacter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, escapeCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(quoteCharacter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, quoteCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fieldsTerminatedBy_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, fieldsTerminatedBy_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(linesTerminatedBy_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, linesTerminatedBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions other = + (com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions) obj; + + if (!getSelectQuery().equals(other.getSelectQuery())) return false; + if (!getEscapeCharacter().equals(other.getEscapeCharacter())) return false; + if (!getQuoteCharacter().equals(other.getQuoteCharacter())) return false; + if (!getFieldsTerminatedBy().equals(other.getFieldsTerminatedBy())) return false; + if (!getLinesTerminatedBy().equals(other.getLinesTerminatedBy())) return false; + if (!getUnknownFields().equals(other.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) + SELECT_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getSelectQuery().hashCode(); + hash = (37 * hash) + ESCAPE_CHARACTER_FIELD_NUMBER; + hash = (53 * hash) + getEscapeCharacter().hashCode(); + hash = (37 * hash) + QUOTE_CHARACTER_FIELD_NUMBER; + hash = (53 * hash) + getQuoteCharacter().hashCode(); + hash = (37 * hash) + FIELDS_TERMINATED_BY_FIELD_NUMBER; + hash = (53 * hash) + getFieldsTerminatedBy().hashCode(); + hash = (37 * hash) + LINES_TERMINATED_BY_FIELD_NUMBER; + hash = (53 * hash) + getLinesTerminatedBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.ExportContext.SqlCsvExportOptions} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ExportContext.SqlCsvExportOptions) + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlCsvExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlCsvExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.class, + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + selectQuery_ = ""; + escapeCharacter_ = ""; + quoteCharacter_ = ""; + fieldsTerminatedBy_ = ""; + linesTerminatedBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlCsvExportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions build() { + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions buildPartial() { + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions result = + new com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.selectQuery_ = selectQuery_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.escapeCharacter_ = escapeCharacter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.quoteCharacter_ = quoteCharacter_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.fieldsTerminatedBy_ = fieldsTerminatedBy_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.linesTerminatedBy_ = linesTerminatedBy_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions) { + return mergeFrom((com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions other) { + if (other == com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.getDefaultInstance()) + return this; + if (!other.getSelectQuery().isEmpty()) { + selectQuery_ = other.selectQuery_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEscapeCharacter().isEmpty()) { + escapeCharacter_ = other.escapeCharacter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getQuoteCharacter().isEmpty()) { + quoteCharacter_ = other.quoteCharacter_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFieldsTerminatedBy().isEmpty()) { + fieldsTerminatedBy_ = other.fieldsTerminatedBy_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getLinesTerminatedBy().isEmpty()) { + linesTerminatedBy_ = other.linesTerminatedBy_; + 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: + { + selectQuery_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + escapeCharacter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + quoteCharacter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + fieldsTerminatedBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 50: + { + linesTerminatedBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object selectQuery_ = ""; + + /** + * + * + *
+       * The select query used to extract the data.
+       * 
+ * + * string select_query = 1; + * + * @return The selectQuery. + */ + public java.lang.String getSelectQuery() { + java.lang.Object ref = selectQuery_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selectQuery_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The select query used to extract the data.
+       * 
+ * + * string select_query = 1; + * + * @return The bytes for selectQuery. + */ + public com.google.protobuf.ByteString getSelectQueryBytes() { + java.lang.Object ref = selectQuery_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selectQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The select query used to extract the data.
+       * 
+ * + * string select_query = 1; + * + * @param value The selectQuery to set. + * @return This builder for chaining. + */ + public Builder setSelectQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selectQuery_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The select query used to extract the data.
+       * 
+ * + * string select_query = 1; + * + * @return This builder for chaining. + */ + public Builder clearSelectQuery() { + selectQuery_ = getDefaultInstance().getSelectQuery(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The select query used to extract the data.
+       * 
+ * + * string select_query = 1; + * + * @param value The bytes for selectQuery to set. + * @return This builder for chaining. + */ + public Builder setSelectQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selectQuery_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object escapeCharacter_ = ""; + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 2; + * + * @return The escapeCharacter. + */ + public java.lang.String getEscapeCharacter() { + java.lang.Object ref = escapeCharacter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + escapeCharacter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 2; + * + * @return The bytes for escapeCharacter. + */ + public com.google.protobuf.ByteString getEscapeCharacterBytes() { + java.lang.Object ref = escapeCharacter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + escapeCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 2; + * + * @param value The escapeCharacter to set. + * @return This builder for chaining. + */ + public Builder setEscapeCharacter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + escapeCharacter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 2; + * + * @return This builder for chaining. + */ + public Builder clearEscapeCharacter() { + escapeCharacter_ = getDefaultInstance().getEscapeCharacter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 2; + * + * @param value The bytes for escapeCharacter to set. + * @return This builder for chaining. + */ + public Builder setEscapeCharacterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + escapeCharacter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object quoteCharacter_ = ""; + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 3; + * + * @return The quoteCharacter. + */ + public java.lang.String getQuoteCharacter() { + java.lang.Object ref = quoteCharacter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quoteCharacter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 3; + * + * @return The bytes for quoteCharacter. + */ + public com.google.protobuf.ByteString getQuoteCharacterBytes() { + java.lang.Object ref = quoteCharacter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quoteCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 3; + * + * @param value The quoteCharacter to set. + * @return This builder for chaining. + */ + public Builder setQuoteCharacter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quoteCharacter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 3; + * + * @return This builder for chaining. + */ + public Builder clearQuoteCharacter() { + quoteCharacter_ = getDefaultInstance().getQuoteCharacter(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 3; + * + * @param value The bytes for quoteCharacter to set. + * @return This builder for chaining. + */ + public Builder setQuoteCharacterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quoteCharacter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object fieldsTerminatedBy_ = ""; + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 4; + * + * @return The fieldsTerminatedBy. + */ + public java.lang.String getFieldsTerminatedBy() { + java.lang.Object ref = fieldsTerminatedBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldsTerminatedBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 4; + * + * @return The bytes for fieldsTerminatedBy. + */ + public com.google.protobuf.ByteString getFieldsTerminatedByBytes() { + java.lang.Object ref = fieldsTerminatedBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldsTerminatedBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 4; + * + * @param value The fieldsTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setFieldsTerminatedBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fieldsTerminatedBy_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 4; + * + * @return This builder for chaining. + */ + public Builder clearFieldsTerminatedBy() { + fieldsTerminatedBy_ = getDefaultInstance().getFieldsTerminatedBy(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 4; + * + * @param value The bytes for fieldsTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setFieldsTerminatedByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fieldsTerminatedBy_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object linesTerminatedBy_ = ""; + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 6; + * + * @return The linesTerminatedBy. + */ + public java.lang.String getLinesTerminatedBy() { + java.lang.Object ref = linesTerminatedBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + linesTerminatedBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 6; + * + * @return The bytes for linesTerminatedBy. + */ + public com.google.protobuf.ByteString getLinesTerminatedByBytes() { + java.lang.Object ref = linesTerminatedBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + linesTerminatedBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 6; + * + * @param value The linesTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setLinesTerminatedBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + linesTerminatedBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 6; + * + * @return This builder for chaining. + */ + public Builder clearLinesTerminatedBy() { + linesTerminatedBy_ = getDefaultInstance().getLinesTerminatedBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 6; + * + * @param value The bytes for linesTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setLinesTerminatedByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + linesTerminatedBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ExportContext.SqlCsvExportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ExportContext.SqlCsvExportOptions) + private static final com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions(); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlCsvExportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlExportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ExportContext.SqlExportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @return A list containing the tables. + */ + java.util.List getTablesList(); + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @return The count of tables. + */ + int getTablesCount(); + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @param index The index of the element to return. + * @return The tables at the given index. + */ + java.lang.String getTables(int index); + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @param index The index of the value to return. + * @return The bytes of the tables at the given index. + */ + com.google.protobuf.ByteString getTablesBytes(int index); + + /** + * + * + *
+     * Export only schemas.
+     * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + * + * @return Whether the schemaOnly field is set. + */ + boolean hasSchemaOnly(); + + /** + * + * + *
+     * Export only schemas.
+     * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + * + * @return The schemaOnly. + */ + com.google.protobuf.BoolValue getSchemaOnly(); + + /** + * + * + *
+     * Export only schemas.
+     * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + com.google.protobuf.BoolValueOrBuilder getSchemaOnlyOrBuilder(); + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + * + * @return Whether the mysqlExportOptions field is set. + */ + boolean hasMysqlExportOptions(); + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + * + * @return The mysqlExportOptions. + */ + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + getMysqlExportOptions(); + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptionsOrBuilder + getMysqlExportOptionsOrBuilder(); + + /** + * + * + *
+     * Optional. The number of threads to use for parallel export.
+     * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the threads field is set. + */ + boolean hasThreads(); + + /** + * + * + *
+     * Optional. The number of threads to use for parallel export.
+     * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The threads. + */ + com.google.protobuf.Int32Value getThreads(); + + /** + * + * + *
+     * Optional. The number of threads to use for parallel export.
+     * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.Int32ValueOrBuilder getThreadsOrBuilder(); + + /** + * + * + *
+     * Optional. Whether or not the export should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parallel field is set. + */ + boolean hasParallel(); + + /** + * + * + *
+     * Optional. Whether or not the export should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parallel. + */ + com.google.protobuf.BoolValue getParallel(); + + /** + * + * + *
+     * Optional. Whether or not the export should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getParallelOrBuilder(); + + /** + * + * + *
+     * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the postgresExportOptions field is set. + */ + boolean hasPostgresExportOptions(); + + /** + * + * + *
+     * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The postgresExportOptions. + */ + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + getPostgresExportOptions(); + + /** + * + * + *
+     * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptionsOrBuilder + getPostgresExportOptionsOrBuilder(); + } + + /** Protobuf type {@code google.cloud.sql.v1.ExportContext.SqlExportOptions} */ + public static final class SqlExportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ExportContext.SqlExportOptions) + SqlExportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlExportOptions"); + } + + // Use SqlExportOptions.newBuilder() to construct. + private SqlExportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlExportOptions() { + tables_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.class, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.Builder.class); + } + + public interface MysqlExportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Option to include SQL statement required to set up replication. If set
+       * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+       * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+       * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+       * has no effect. If set to any value other than `1`, --set-gtid-purged
+       * is set to OFF.
+       * 
+ * + * .google.protobuf.Int32Value master_data = 1; + * + * @return Whether the masterData field is set. + */ + boolean hasMasterData(); + + /** + * + * + *
+       * Option to include SQL statement required to set up replication. If set
+       * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+       * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+       * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+       * has no effect. If set to any value other than `1`, --set-gtid-purged
+       * is set to OFF.
+       * 
+ * + * .google.protobuf.Int32Value master_data = 1; + * + * @return The masterData. + */ + com.google.protobuf.Int32Value getMasterData(); + + /** + * + * + *
+       * Option to include SQL statement required to set up replication. If set
+       * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+       * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+       * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+       * has no effect. If set to any value other than `1`, --set-gtid-purged
+       * is set to OFF.
+       * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + com.google.protobuf.Int32ValueOrBuilder getMasterDataOrBuilder(); + } + + /** + * + * + *
+     * Options for exporting from MySQL.
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions} + */ + public static final class MysqlExportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions) + MysqlExportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MysqlExportOptions"); + } + + // Use MysqlExportOptions.newBuilder() to construct. + private MysqlExportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MysqlExportOptions() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_MysqlExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_MysqlExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.class, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.Builder + .class); + } + + private int bitField0_; + public static final int MASTER_DATA_FIELD_NUMBER = 1; + private com.google.protobuf.Int32Value masterData_; + + /** + * + * + *
+       * Option to include SQL statement required to set up replication. If set
+       * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+       * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+       * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+       * has no effect. If set to any value other than `1`, --set-gtid-purged
+       * is set to OFF.
+       * 
+ * + * .google.protobuf.Int32Value master_data = 1; + * + * @return Whether the masterData field is set. + */ + @java.lang.Override + public boolean hasMasterData() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Option to include SQL statement required to set up replication. If set
+       * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+       * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+       * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+       * has no effect. If set to any value other than `1`, --set-gtid-purged
+       * is set to OFF.
+       * 
+ * + * .google.protobuf.Int32Value master_data = 1; + * + * @return The masterData. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getMasterData() { + return masterData_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : masterData_; + } + + /** + * + * + *
+       * Option to include SQL statement required to set up replication. If set
+       * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+       * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+       * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+       * has no effect. If set to any value other than `1`, --set-gtid-purged
+       * is set to OFF.
+       * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getMasterDataOrBuilder() { + return masterData_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : masterData_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getMasterData()); + } + 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, getMasterData()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions other = + (com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions) obj; + + if (hasMasterData() != other.hasMasterData()) return false; + if (hasMasterData()) { + if (!getMasterData().equals(other.getMasterData())) return false; + } + if (!getUnknownFields().equals(other.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 (hasMasterData()) { + hash = (37 * hash) + MASTER_DATA_FIELD_NUMBER; + hash = (53 * hash) + getMasterData().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Options for exporting from MySQL.
+       * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions) + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_MysqlExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_MysqlExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.class, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.Builder + .class); + } + + // Construct using + // com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMasterDataFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + masterData_ = null; + if (masterDataBuilder_ != null) { + masterDataBuilder_.dispose(); + masterDataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_MysqlExportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions build() { + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + buildPartial() { + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions result = + new com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.masterData_ = + masterDataBuilder_ == null ? masterData_ : masterDataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions) { + return mergeFrom( + (com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions other) { + if (other + == com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + .getDefaultInstance()) return this; + if (other.hasMasterData()) { + mergeMasterData(other.getMasterData()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetMasterDataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Int32Value masterData_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + masterDataBuilder_; + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + * + * @return Whether the masterData field is set. + */ + public boolean hasMasterData() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + * + * @return The masterData. + */ + public com.google.protobuf.Int32Value getMasterData() { + if (masterDataBuilder_ == null) { + return masterData_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : masterData_; + } else { + return masterDataBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + public Builder setMasterData(com.google.protobuf.Int32Value value) { + if (masterDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + masterData_ = value; + } else { + masterDataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + public Builder setMasterData(com.google.protobuf.Int32Value.Builder builderForValue) { + if (masterDataBuilder_ == null) { + masterData_ = builderForValue.build(); + } else { + masterDataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + public Builder mergeMasterData(com.google.protobuf.Int32Value value) { + if (masterDataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && masterData_ != null + && masterData_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getMasterDataBuilder().mergeFrom(value); + } else { + masterData_ = value; + } + } else { + masterDataBuilder_.mergeFrom(value); + } + if (masterData_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + public Builder clearMasterData() { + bitField0_ = (bitField0_ & ~0x00000001); + masterData_ = null; + if (masterDataBuilder_ != null) { + masterDataBuilder_.dispose(); + masterDataBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + public com.google.protobuf.Int32Value.Builder getMasterDataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetMasterDataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + public com.google.protobuf.Int32ValueOrBuilder getMasterDataOrBuilder() { + if (masterDataBuilder_ != null) { + return masterDataBuilder_.getMessageOrBuilder(); + } else { + return masterData_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : masterData_; + } + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetMasterDataFieldBuilder() { + if (masterDataBuilder_ == null) { + masterDataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getMasterData(), getParentForChildren(), isClean()); + masterData_ = null; + } + return masterDataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions) + private static final com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions(); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MysqlExportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PostgresExportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+       * SQL statements. Use these statements to delete database objects before
+       * running the import operation.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clean field is set. + */ + boolean hasClean(); + + /** + * + * + *
+       * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+       * SQL statements. Use these statements to delete database objects before
+       * running the import operation.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clean. + */ + com.google.protobuf.BoolValue getClean(); + + /** + * + * + *
+       * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+       * SQL statements. Use these statements to delete database objects before
+       * running the import operation.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getCleanOrBuilder(); + + /** + * + * + *
+       * Optional. Option to include an IF EXISTS SQL statement with each DROP
+       * statement produced by clean.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the ifExists field is set. + */ + boolean hasIfExists(); + + /** + * + * + *
+       * Optional. Option to include an IF EXISTS SQL statement with each DROP
+       * statement produced by clean.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The ifExists. + */ + com.google.protobuf.BoolValue getIfExists(); + + /** + * + * + *
+       * Optional. Option to include an IF EXISTS SQL statement with each DROP
+       * statement produced by clean.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getIfExistsOrBuilder(); + } + + /** + * + * + *
+     * Options for exporting from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * Protobuf type {@code + * google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions} + */ + public static final class PostgresExportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions) + PostgresExportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PostgresExportOptions"); + } + + // Use PostgresExportOptions.newBuilder() to construct. + private PostgresExportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PostgresExportOptions() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_PostgresExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_PostgresExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.class, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.Builder + .class); + } + + private int bitField0_; + public static final int CLEAN_FIELD_NUMBER = 1; + private com.google.protobuf.BoolValue clean_; + + /** + * + * + *
+       * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+       * SQL statements. Use these statements to delete database objects before
+       * running the import operation.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clean field is set. + */ + @java.lang.Override + public boolean hasClean() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+       * SQL statements. Use these statements to delete database objects before
+       * running the import operation.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clean. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getClean() { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } + + /** + * + * + *
+       * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+       * SQL statements. Use these statements to delete database objects before
+       * running the import operation.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getCleanOrBuilder() { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } + + public static final int IF_EXISTS_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue ifExists_; + + /** + * + * + *
+       * Optional. Option to include an IF EXISTS SQL statement with each DROP
+       * statement produced by clean.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the ifExists field is set. + */ + @java.lang.Override + public boolean hasIfExists() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Optional. Option to include an IF EXISTS SQL statement with each DROP
+       * statement produced by clean.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The ifExists. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getIfExists() { + return ifExists_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : ifExists_; + } + + /** + * + * + *
+       * Optional. Option to include an IF EXISTS SQL statement with each DROP
+       * statement produced by clean.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getIfExistsOrBuilder() { + return ifExists_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : ifExists_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getClean()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getIfExists()); + } + 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, getClean()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getIfExists()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions other = + (com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions) obj; + + if (hasClean() != other.hasClean()) return false; + if (hasClean()) { + if (!getClean().equals(other.getClean())) return false; + } + if (hasIfExists() != other.hasIfExists()) return false; + if (hasIfExists()) { + if (!getIfExists().equals(other.getIfExists())) return false; + } + if (!getUnknownFields().equals(other.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 (hasClean()) { + hash = (37 * hash) + CLEAN_FIELD_NUMBER; + hash = (53 * hash) + getClean().hashCode(); + } + if (hasIfExists()) { + hash = (37 * hash) + IF_EXISTS_FIELD_NUMBER; + hash = (53 * hash) + getIfExists().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * Protobuf type {@code + * google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions) + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_PostgresExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_PostgresExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + .class, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + .Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCleanFieldBuilder(); + internalGetIfExistsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + clean_ = null; + if (cleanBuilder_ != null) { + cleanBuilder_.dispose(); + cleanBuilder_ = null; + } + ifExists_ = null; + if (ifExistsBuilder_ != null) { + ifExistsBuilder_.dispose(); + ifExistsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_PostgresExportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + build() { + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + buildPartial() { + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions result = + new com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.clean_ = cleanBuilder_ == null ? clean_ : cleanBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ifExists_ = ifExistsBuilder_ == null ? ifExists_ : ifExistsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions) { + return mergeFrom( + (com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions other) { + if (other + == com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + .getDefaultInstance()) return this; + if (other.hasClean()) { + mergeClean(other.getClean()); + } + if (other.hasIfExists()) { + mergeIfExists(other.getIfExists()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetCleanFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetIfExistsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.BoolValue clean_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + cleanBuilder_; + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clean field is set. + */ + public boolean hasClean() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clean. + */ + public com.google.protobuf.BoolValue getClean() { + if (cleanBuilder_ == null) { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } else { + return cleanBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setClean(com.google.protobuf.BoolValue value) { + if (cleanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clean_ = value; + } else { + cleanBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setClean(com.google.protobuf.BoolValue.Builder builderForValue) { + if (cleanBuilder_ == null) { + clean_ = builderForValue.build(); + } else { + cleanBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeClean(com.google.protobuf.BoolValue value) { + if (cleanBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && clean_ != null + && clean_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getCleanBuilder().mergeFrom(value); + } else { + clean_ = value; + } + } else { + cleanBuilder_.mergeFrom(value); + } + if (clean_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearClean() { + bitField0_ = (bitField0_ & ~0x00000001); + clean_ = null; + if (cleanBuilder_ != null) { + cleanBuilder_.dispose(); + cleanBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getCleanBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetCleanFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getCleanOrBuilder() { + if (cleanBuilder_ != null) { + return cleanBuilder_.getMessageOrBuilder(); + } else { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetCleanFieldBuilder() { + if (cleanBuilder_ == null) { + cleanBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getClean(), getParentForChildren(), isClean()); + clean_ = null; + } + return cleanBuilder_; + } + + private com.google.protobuf.BoolValue ifExists_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + ifExistsBuilder_; + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the ifExists field is set. + */ + public boolean hasIfExists() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The ifExists. + */ + public com.google.protobuf.BoolValue getIfExists() { + if (ifExistsBuilder_ == null) { + return ifExists_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : ifExists_; + } else { + return ifExistsBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setIfExists(com.google.protobuf.BoolValue value) { + if (ifExistsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ifExists_ = value; + } else { + ifExistsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setIfExists(com.google.protobuf.BoolValue.Builder builderForValue) { + if (ifExistsBuilder_ == null) { + ifExists_ = builderForValue.build(); + } else { + ifExistsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeIfExists(com.google.protobuf.BoolValue value) { + if (ifExistsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && ifExists_ != null + && ifExists_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getIfExistsBuilder().mergeFrom(value); + } else { + ifExists_ = value; + } + } else { + ifExistsBuilder_.mergeFrom(value); + } + if (ifExists_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearIfExists() { + bitField0_ = (bitField0_ & ~0x00000002); + ifExists_ = null; + if (ifExistsBuilder_ != null) { + ifExistsBuilder_.dispose(); + ifExistsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getIfExistsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetIfExistsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getIfExistsOrBuilder() { + if (ifExistsBuilder_ != null) { + return ifExistsBuilder_.getMessageOrBuilder(); + } else { + return ifExists_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : ifExists_; + } + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetIfExistsFieldBuilder() { + if (ifExistsBuilder_ == null) { + ifExistsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getIfExists(), getParentForChildren(), isClean()); + ifExists_ = null; + } + return ifExistsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions) + private static final com.google.cloud.sql.v1.ExportContext.SqlExportOptions + .PostgresExportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions(); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PostgresExportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int TABLES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList tables_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @return A list containing the tables. + */ + public com.google.protobuf.ProtocolStringList getTablesList() { + return tables_; + } + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @return The count of tables. + */ + public int getTablesCount() { + return tables_.size(); + } + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @param index The index of the element to return. + * @return The tables at the given index. + */ + public java.lang.String getTables(int index) { + return tables_.get(index); + } + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @param index The index of the value to return. + * @return The bytes of the tables at the given index. + */ + public com.google.protobuf.ByteString getTablesBytes(int index) { + return tables_.getByteString(index); + } + + public static final int SCHEMA_ONLY_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue schemaOnly_; + + /** + * + * + *
+     * Export only schemas.
+     * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + * + * @return Whether the schemaOnly field is set. + */ + @java.lang.Override + public boolean hasSchemaOnly() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Export only schemas.
+     * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + * + * @return The schemaOnly. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSchemaOnly() { + return schemaOnly_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : schemaOnly_; + } + + /** + * + * + *
+     * Export only schemas.
+     * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getSchemaOnlyOrBuilder() { + return schemaOnly_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : schemaOnly_; + } + + public static final int MYSQL_EXPORT_OPTIONS_FIELD_NUMBER = 3; + private com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + mysqlExportOptions_; + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + * + * @return Whether the mysqlExportOptions field is set. + */ + @java.lang.Override + public boolean hasMysqlExportOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + * + * @return The mysqlExportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + getMysqlExportOptions() { + return mysqlExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + .getDefaultInstance() + : mysqlExportOptions_; + } + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptionsOrBuilder + getMysqlExportOptionsOrBuilder() { + return mysqlExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + .getDefaultInstance() + : mysqlExportOptions_; + } + + public static final int THREADS_FIELD_NUMBER = 4; + private com.google.protobuf.Int32Value threads_; + + /** + * + * + *
+     * Optional. The number of threads to use for parallel export.
+     * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the threads field is set. + */ + @java.lang.Override + public boolean hasThreads() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. The number of threads to use for parallel export.
+     * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The threads. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getThreads() { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } + + /** + * + * + *
+     * Optional. The number of threads to use for parallel export.
+     * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getThreadsOrBuilder() { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } + + public static final int PARALLEL_FIELD_NUMBER = 5; + private com.google.protobuf.BoolValue parallel_; + + /** + * + * + *
+     * Optional. Whether or not the export should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parallel field is set. + */ + @java.lang.Override + public boolean hasParallel() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. Whether or not the export should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parallel. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getParallel() { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } + + /** + * + * + *
+     * Optional. Whether or not the export should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getParallelOrBuilder() { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } + + public static final int POSTGRES_EXPORT_OPTIONS_FIELD_NUMBER = 6; + private com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + postgresExportOptions_; + + /** + * + * + *
+     * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the postgresExportOptions field is set. + */ + @java.lang.Override + public boolean hasPostgresExportOptions() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The postgresExportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + getPostgresExportOptions() { + return postgresExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + .getDefaultInstance() + : postgresExportOptions_; + } + + /** + * + * + *
+     * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptionsOrBuilder + getPostgresExportOptionsOrBuilder() { + return postgresExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + .getDefaultInstance() + : postgresExportOptions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 < tables_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tables_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSchemaOnly()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getMysqlExportOptions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getThreads()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(5, getParallel()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(6, getPostgresExportOptions()); + } + 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 < tables_.size(); i++) { + dataSize += computeStringSizeNoTag(tables_.getRaw(i)); + } + size += dataSize; + size += 1 * getTablesList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSchemaOnly()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMysqlExportOptions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getThreads()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getParallel()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(6, getPostgresExportOptions()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ExportContext.SqlExportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ExportContext.SqlExportOptions other = + (com.google.cloud.sql.v1.ExportContext.SqlExportOptions) obj; + + if (!getTablesList().equals(other.getTablesList())) return false; + if (hasSchemaOnly() != other.hasSchemaOnly()) return false; + if (hasSchemaOnly()) { + if (!getSchemaOnly().equals(other.getSchemaOnly())) return false; + } + if (hasMysqlExportOptions() != other.hasMysqlExportOptions()) return false; + if (hasMysqlExportOptions()) { + if (!getMysqlExportOptions().equals(other.getMysqlExportOptions())) return false; + } + if (hasThreads() != other.hasThreads()) return false; + if (hasThreads()) { + if (!getThreads().equals(other.getThreads())) return false; + } + if (hasParallel() != other.hasParallel()) return false; + if (hasParallel()) { + if (!getParallel().equals(other.getParallel())) return false; + } + if (hasPostgresExportOptions() != other.hasPostgresExportOptions()) return false; + if (hasPostgresExportOptions()) { + if (!getPostgresExportOptions().equals(other.getPostgresExportOptions())) return false; + } + if (!getUnknownFields().equals(other.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 (getTablesCount() > 0) { + hash = (37 * hash) + TABLES_FIELD_NUMBER; + hash = (53 * hash) + getTablesList().hashCode(); + } + if (hasSchemaOnly()) { + hash = (37 * hash) + SCHEMA_ONLY_FIELD_NUMBER; + hash = (53 * hash) + getSchemaOnly().hashCode(); + } + if (hasMysqlExportOptions()) { + hash = (37 * hash) + MYSQL_EXPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getMysqlExportOptions().hashCode(); + } + if (hasThreads()) { + hash = (37 * hash) + THREADS_FIELD_NUMBER; + hash = (53 * hash) + getThreads().hashCode(); + } + if (hasParallel()) { + hash = (37 * hash) + PARALLEL_FIELD_NUMBER; + hash = (53 * hash) + getParallel().hashCode(); + } + if (hasPostgresExportOptions()) { + hash = (37 * hash) + POSTGRES_EXPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPostgresExportOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.ExportContext.SqlExportOptions} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ExportContext.SqlExportOptions) + com.google.cloud.sql.v1.ExportContext.SqlExportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.class, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ExportContext.SqlExportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSchemaOnlyFieldBuilder(); + internalGetMysqlExportOptionsFieldBuilder(); + internalGetThreadsFieldBuilder(); + internalGetParallelFieldBuilder(); + internalGetPostgresExportOptionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tables_ = com.google.protobuf.LazyStringArrayList.emptyList(); + schemaOnly_ = null; + if (schemaOnlyBuilder_ != null) { + schemaOnlyBuilder_.dispose(); + schemaOnlyBuilder_ = null; + } + mysqlExportOptions_ = null; + if (mysqlExportOptionsBuilder_ != null) { + mysqlExportOptionsBuilder_.dispose(); + mysqlExportOptionsBuilder_ = null; + } + threads_ = null; + if (threadsBuilder_ != null) { + threadsBuilder_.dispose(); + threadsBuilder_ = null; + } + parallel_ = null; + if (parallelBuilder_ != null) { + parallelBuilder_.dispose(); + parallelBuilder_ = null; + } + postgresExportOptions_ = null; + if (postgresExportOptionsBuilder_ != null) { + postgresExportOptionsBuilder_.dispose(); + postgresExportOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlExportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ExportContext.SqlExportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions build() { + com.google.cloud.sql.v1.ExportContext.SqlExportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions buildPartial() { + com.google.cloud.sql.v1.ExportContext.SqlExportOptions result = + new com.google.cloud.sql.v1.ExportContext.SqlExportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ExportContext.SqlExportOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + tables_.makeImmutable(); + result.tables_ = tables_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.schemaOnly_ = + schemaOnlyBuilder_ == null ? schemaOnly_ : schemaOnlyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.mysqlExportOptions_ = + mysqlExportOptionsBuilder_ == null + ? mysqlExportOptions_ + : mysqlExportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.threads_ = threadsBuilder_ == null ? threads_ : threadsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.parallel_ = parallelBuilder_ == null ? parallel_ : parallelBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.postgresExportOptions_ = + postgresExportOptionsBuilder_ == null + ? postgresExportOptions_ + : postgresExportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ExportContext.SqlExportOptions) { + return mergeFrom((com.google.cloud.sql.v1.ExportContext.SqlExportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ExportContext.SqlExportOptions other) { + if (other == com.google.cloud.sql.v1.ExportContext.SqlExportOptions.getDefaultInstance()) + return this; + if (!other.tables_.isEmpty()) { + if (tables_.isEmpty()) { + tables_ = other.tables_; + bitField0_ |= 0x00000001; + } else { + ensureTablesIsMutable(); + tables_.addAll(other.tables_); + } + onChanged(); + } + if (other.hasSchemaOnly()) { + mergeSchemaOnly(other.getSchemaOnly()); + } + if (other.hasMysqlExportOptions()) { + mergeMysqlExportOptions(other.getMysqlExportOptions()); + } + if (other.hasThreads()) { + mergeThreads(other.getThreads()); + } + if (other.hasParallel()) { + mergeParallel(other.getParallel()); + } + if (other.hasPostgresExportOptions()) { + mergePostgresExportOptions(other.getPostgresExportOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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(); + ensureTablesIsMutable(); + tables_.add(s); + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetSchemaOnlyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetMysqlExportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetThreadsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetParallelFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetPostgresExportOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList tables_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureTablesIsMutable() { + if (!tables_.isModifiable()) { + tables_ = new com.google.protobuf.LazyStringArrayList(tables_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @return A list containing the tables. + */ + public com.google.protobuf.ProtocolStringList getTablesList() { + tables_.makeImmutable(); + return tables_; + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @return The count of tables. + */ + public int getTablesCount() { + return tables_.size(); + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @param index The index of the element to return. + * @return The tables at the given index. + */ + public java.lang.String getTables(int index) { + return tables_.get(index); + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @param index The index of the value to return. + * @return The bytes of the tables at the given index. + */ + public com.google.protobuf.ByteString getTablesBytes(int index) { + return tables_.getByteString(index); + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @param index The index to set the value at. + * @param value The tables to set. + * @return This builder for chaining. + */ + public Builder setTables(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTablesIsMutable(); + tables_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @param value The tables to add. + * @return This builder for chaining. + */ + public Builder addTables(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTablesIsMutable(); + tables_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @param values The tables to add. + * @return This builder for chaining. + */ + public Builder addAllTables(java.lang.Iterable values) { + ensureTablesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tables_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @return This builder for chaining. + */ + public Builder clearTables() { + tables_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @param value The bytes of the tables to add. + * @return This builder for chaining. + */ + public Builder addTablesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTablesIsMutable(); + tables_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue schemaOnly_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + schemaOnlyBuilder_; + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + * + * @return Whether the schemaOnly field is set. + */ + public boolean hasSchemaOnly() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + * + * @return The schemaOnly. + */ + public com.google.protobuf.BoolValue getSchemaOnly() { + if (schemaOnlyBuilder_ == null) { + return schemaOnly_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : schemaOnly_; + } else { + return schemaOnlyBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + public Builder setSchemaOnly(com.google.protobuf.BoolValue value) { + if (schemaOnlyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schemaOnly_ = value; + } else { + schemaOnlyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + public Builder setSchemaOnly(com.google.protobuf.BoolValue.Builder builderForValue) { + if (schemaOnlyBuilder_ == null) { + schemaOnly_ = builderForValue.build(); + } else { + schemaOnlyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + public Builder mergeSchemaOnly(com.google.protobuf.BoolValue value) { + if (schemaOnlyBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && schemaOnly_ != null + && schemaOnly_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getSchemaOnlyBuilder().mergeFrom(value); + } else { + schemaOnly_ = value; + } + } else { + schemaOnlyBuilder_.mergeFrom(value); + } + if (schemaOnly_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + public Builder clearSchemaOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + schemaOnly_ = null; + if (schemaOnlyBuilder_ != null) { + schemaOnlyBuilder_.dispose(); + schemaOnlyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + public com.google.protobuf.BoolValue.Builder getSchemaOnlyBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetSchemaOnlyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + public com.google.protobuf.BoolValueOrBuilder getSchemaOnlyOrBuilder() { + if (schemaOnlyBuilder_ != null) { + return schemaOnlyBuilder_.getMessageOrBuilder(); + } else { + return schemaOnly_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : schemaOnly_; + } + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetSchemaOnlyFieldBuilder() { + if (schemaOnlyBuilder_ == null) { + schemaOnlyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSchemaOnly(), getParentForChildren(), isClean()); + schemaOnly_ = null; + } + return schemaOnlyBuilder_; + } + + private com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + mysqlExportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptionsOrBuilder> + mysqlExportOptionsBuilder_; + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + * + * @return Whether the mysqlExportOptions field is set. + */ + public boolean hasMysqlExportOptions() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + * + * @return The mysqlExportOptions. + */ + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + getMysqlExportOptions() { + if (mysqlExportOptionsBuilder_ == null) { + return mysqlExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + .getDefaultInstance() + : mysqlExportOptions_; + } else { + return mysqlExportOptionsBuilder_.getMessage(); + } + } + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + public Builder setMysqlExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions value) { + if (mysqlExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mysqlExportOptions_ = value; + } else { + mysqlExportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + public Builder setMysqlExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.Builder + builderForValue) { + if (mysqlExportOptionsBuilder_ == null) { + mysqlExportOptions_ = builderForValue.build(); + } else { + mysqlExportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + public Builder mergeMysqlExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions value) { + if (mysqlExportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && mysqlExportOptions_ != null + && mysqlExportOptions_ + != com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + .getDefaultInstance()) { + getMysqlExportOptionsBuilder().mergeFrom(value); + } else { + mysqlExportOptions_ = value; + } + } else { + mysqlExportOptionsBuilder_.mergeFrom(value); + } + if (mysqlExportOptions_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + public Builder clearMysqlExportOptions() { + bitField0_ = (bitField0_ & ~0x00000004); + mysqlExportOptions_ = null; + if (mysqlExportOptionsBuilder_ != null) { + mysqlExportOptionsBuilder_.dispose(); + mysqlExportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.Builder + getMysqlExportOptionsBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetMysqlExportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptionsOrBuilder + getMysqlExportOptionsOrBuilder() { + if (mysqlExportOptionsBuilder_ != null) { + return mysqlExportOptionsBuilder_.getMessageOrBuilder(); + } else { + return mysqlExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions + .getDefaultInstance() + : mysqlExportOptions_; + } + } + + /** + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptionsOrBuilder> + internalGetMysqlExportOptionsFieldBuilder() { + if (mysqlExportOptionsBuilder_ == null) { + mysqlExportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions + .MysqlExportOptionsOrBuilder>( + getMysqlExportOptions(), getParentForChildren(), isClean()); + mysqlExportOptions_ = null; + } + return mysqlExportOptionsBuilder_; + } + + private com.google.protobuf.Int32Value threads_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + threadsBuilder_; + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the threads field is set. + */ + public boolean hasThreads() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The threads. + */ + public com.google.protobuf.Int32Value getThreads() { + if (threadsBuilder_ == null) { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } else { + return threadsBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setThreads(com.google.protobuf.Int32Value value) { + if (threadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + threads_ = value; + } else { + threadsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setThreads(com.google.protobuf.Int32Value.Builder builderForValue) { + if (threadsBuilder_ == null) { + threads_ = builderForValue.build(); + } else { + threadsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeThreads(com.google.protobuf.Int32Value value) { + if (threadsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && threads_ != null + && threads_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getThreadsBuilder().mergeFrom(value); + } else { + threads_ = value; + } + } else { + threadsBuilder_.mergeFrom(value); + } + if (threads_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearThreads() { + bitField0_ = (bitField0_ & ~0x00000008); + threads_ = null; + if (threadsBuilder_ != null) { + threadsBuilder_.dispose(); + threadsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Int32Value.Builder getThreadsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetThreadsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Int32ValueOrBuilder getThreadsOrBuilder() { + if (threadsBuilder_ != null) { + return threadsBuilder_.getMessageOrBuilder(); + } else { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetThreadsFieldBuilder() { + if (threadsBuilder_ == null) { + threadsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getThreads(), getParentForChildren(), isClean()); + threads_ = null; + } + return threadsBuilder_; + } + + private com.google.protobuf.BoolValue parallel_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + parallelBuilder_; + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parallel field is set. + */ + public boolean hasParallel() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parallel. + */ + public com.google.protobuf.BoolValue getParallel() { + if (parallelBuilder_ == null) { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } else { + return parallelBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setParallel(com.google.protobuf.BoolValue value) { + if (parallelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parallel_ = value; + } else { + parallelBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setParallel(com.google.protobuf.BoolValue.Builder builderForValue) { + if (parallelBuilder_ == null) { + parallel_ = builderForValue.build(); + } else { + parallelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeParallel(com.google.protobuf.BoolValue value) { + if (parallelBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && parallel_ != null + && parallel_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getParallelBuilder().mergeFrom(value); + } else { + parallel_ = value; + } + } else { + parallelBuilder_.mergeFrom(value); + } + if (parallel_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearParallel() { + bitField0_ = (bitField0_ & ~0x00000010); + parallel_ = null; + if (parallelBuilder_ != null) { + parallelBuilder_.dispose(); + parallelBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getParallelBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetParallelFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getParallelOrBuilder() { + if (parallelBuilder_ != null) { + return parallelBuilder_.getMessageOrBuilder(); + } else { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetParallelFieldBuilder() { + if (parallelBuilder_ == null) { + parallelBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getParallel(), getParentForChildren(), isClean()); + parallel_ = null; + } + return parallelBuilder_; + } + + private com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + postgresExportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptionsOrBuilder> + postgresExportOptionsBuilder_; + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the postgresExportOptions field is set. + */ + public boolean hasPostgresExportOptions() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The postgresExportOptions. + */ + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + getPostgresExportOptions() { + if (postgresExportOptionsBuilder_ == null) { + return postgresExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + .getDefaultInstance() + : postgresExportOptions_; + } else { + return postgresExportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPostgresExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions value) { + if (postgresExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + postgresExportOptions_ = value; + } else { + postgresExportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPostgresExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.Builder + builderForValue) { + if (postgresExportOptionsBuilder_ == null) { + postgresExportOptions_ = builderForValue.build(); + } else { + postgresExportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergePostgresExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions value) { + if (postgresExportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && postgresExportOptions_ != null + && postgresExportOptions_ + != com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + .getDefaultInstance()) { + getPostgresExportOptionsBuilder().mergeFrom(value); + } else { + postgresExportOptions_ = value; + } + } else { + postgresExportOptionsBuilder_.mergeFrom(value); + } + if (postgresExportOptions_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPostgresExportOptions() { + bitField0_ = (bitField0_ & ~0x00000020); + postgresExportOptions_ = null; + if (postgresExportOptionsBuilder_ != null) { + postgresExportOptionsBuilder_.dispose(); + postgresExportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.Builder + getPostgresExportOptionsBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetPostgresExportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptionsOrBuilder + getPostgresExportOptionsOrBuilder() { + if (postgresExportOptionsBuilder_ != null) { + return postgresExportOptionsBuilder_.getMessageOrBuilder(); + } else { + return postgresExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + .getDefaultInstance() + : postgresExportOptions_; + } + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptionsOrBuilder> + internalGetPostgresExportOptionsFieldBuilder() { + if (postgresExportOptionsBuilder_ == null) { + postgresExportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions + .Builder, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions + .PostgresExportOptionsOrBuilder>( + getPostgresExportOptions(), getParentForChildren(), isClean()); + postgresExportOptions_ = null; + } + return postgresExportOptionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ExportContext.SqlExportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ExportContext.SqlExportOptions) + private static final com.google.cloud.sql.v1.ExportContext.SqlExportOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ExportContext.SqlExportOptions(); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlExportOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlExportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlBakExportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ExportContext.SqlBakExportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Whether or not the export should be striped.
+     * 
+ * + * .google.protobuf.BoolValue striped = 1; + * + * @return Whether the striped field is set. + */ + boolean hasStriped(); + + /** + * + * + *
+     * Whether or not the export should be striped.
+     * 
+ * + * .google.protobuf.BoolValue striped = 1; + * + * @return The striped. + */ + com.google.protobuf.BoolValue getStriped(); + + /** + * + * + *
+     * Whether or not the export should be striped.
+     * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + com.google.protobuf.BoolValueOrBuilder getStripedOrBuilder(); + + /** + * + * + *
+     * Option for specifying how many stripes to use for the export.
+     * If blank, and the value of the striped field is true,
+     * the number of stripes is automatically chosen.
+     * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + * + * @return Whether the stripeCount field is set. + */ + boolean hasStripeCount(); + + /** + * + * + *
+     * Option for specifying how many stripes to use for the export.
+     * If blank, and the value of the striped field is true,
+     * the number of stripes is automatically chosen.
+     * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + * + * @return The stripeCount. + */ + com.google.protobuf.Int32Value getStripeCount(); + + /** + * + * + *
+     * Option for specifying how many stripes to use for the export.
+     * If blank, and the value of the striped field is true,
+     * the number of stripes is automatically chosen.
+     * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + com.google.protobuf.Int32ValueOrBuilder getStripeCountOrBuilder(); + + /** + * + * + *
+     * Type of this bak file will be export, FULL or DIFF, SQL Server only
+     * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 4; + * + * @return The enum numeric value on the wire for bakType. + */ + int getBakTypeValue(); + + /** + * + * + *
+     * Type of this bak file will be export, FULL or DIFF, SQL Server only
+     * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 4; + * + * @return The bakType. + */ + com.google.cloud.sql.v1.BakType getBakType(); + + /** + * + * + *
+     * Deprecated: copy_only is deprecated. Use differential_base instead
+     * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.ExportContext.SqlBakExportOptions.copy_only is deprecated. + * See google/cloud/sql/v1/cloud_sql_resources.proto;l=486 + * @return Whether the copyOnly field is set. + */ + @java.lang.Deprecated + boolean hasCopyOnly(); + + /** + * + * + *
+     * Deprecated: copy_only is deprecated. Use differential_base instead
+     * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.ExportContext.SqlBakExportOptions.copy_only is deprecated. + * See google/cloud/sql/v1/cloud_sql_resources.proto;l=486 + * @return The copyOnly. + */ + @java.lang.Deprecated + com.google.protobuf.BoolValue getCopyOnly(); + + /** + * + * + *
+     * Deprecated: copy_only is deprecated. Use differential_base instead
+     * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Deprecated + com.google.protobuf.BoolValueOrBuilder getCopyOnlyOrBuilder(); + + /** + * + * + *
+     * Whether or not the backup can be used as a differential base
+     * copy_only backup can not be served as differential base
+     * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + * + * @return Whether the differentialBase field is set. + */ + boolean hasDifferentialBase(); + + /** + * + * + *
+     * Whether or not the backup can be used as a differential base
+     * copy_only backup can not be served as differential base
+     * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + * + * @return The differentialBase. + */ + com.google.protobuf.BoolValue getDifferentialBase(); + + /** + * + * + *
+     * Whether or not the backup can be used as a differential base
+     * copy_only backup can not be served as differential base
+     * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + com.google.protobuf.BoolValueOrBuilder getDifferentialBaseOrBuilder(); + + /** + * + * + *
+     * Optional. The begin timestamp when transaction log will be included in
+     * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+     * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs from the beginning of retention period will be included.
+     * Only applied to Cloud SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exportLogStartTime field is set. + */ + boolean hasExportLogStartTime(); + + /** + * + * + *
+     * Optional. The begin timestamp when transaction log will be included in
+     * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+     * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs from the beginning of retention period will be included.
+     * Only applied to Cloud SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exportLogStartTime. + */ + com.google.protobuf.Timestamp getExportLogStartTime(); + + /** + * + * + *
+     * Optional. The begin timestamp when transaction log will be included in
+     * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+     * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs from the beginning of retention period will be included.
+     * Only applied to Cloud SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getExportLogStartTimeOrBuilder(); + + /** + * + * + *
+     * Optional. The end timestamp when transaction log will be included in the
+     * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+     * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs until current time will be included. Only applied to Cloud
+     * SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exportLogEndTime field is set. + */ + boolean hasExportLogEndTime(); + + /** + * + * + *
+     * Optional. The end timestamp when transaction log will be included in the
+     * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+     * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs until current time will be included. Only applied to Cloud
+     * SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exportLogEndTime. + */ + com.google.protobuf.Timestamp getExportLogEndTime(); + + /** + * + * + *
+     * Optional. The end timestamp when transaction log will be included in the
+     * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+     * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs until current time will be included. Only applied to Cloud
+     * SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getExportLogEndTimeOrBuilder(); + } + + /** + * + * + *
+   * Options for exporting BAK files (SQL Server-only)
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ExportContext.SqlBakExportOptions} + */ + public static final class SqlBakExportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ExportContext.SqlBakExportOptions) + SqlBakExportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBakExportOptions"); + } + + // Use SqlBakExportOptions.newBuilder() to construct. + private SqlBakExportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlBakExportOptions() { + bakType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlBakExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlBakExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.class, + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.Builder.class); + } + + private int bitField0_; + public static final int STRIPED_FIELD_NUMBER = 1; + private com.google.protobuf.BoolValue striped_; + + /** + * + * + *
+     * Whether or not the export should be striped.
+     * 
+ * + * .google.protobuf.BoolValue striped = 1; + * + * @return Whether the striped field is set. + */ + @java.lang.Override + public boolean hasStriped() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Whether or not the export should be striped.
+     * 
+ * + * .google.protobuf.BoolValue striped = 1; + * + * @return The striped. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getStriped() { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } + + /** + * + * + *
+     * Whether or not the export should be striped.
+     * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getStripedOrBuilder() { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } + + public static final int STRIPE_COUNT_FIELD_NUMBER = 2; + private com.google.protobuf.Int32Value stripeCount_; + + /** + * + * + *
+     * Option for specifying how many stripes to use for the export.
+     * If blank, and the value of the striped field is true,
+     * the number of stripes is automatically chosen.
+     * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + * + * @return Whether the stripeCount field is set. + */ + @java.lang.Override + public boolean hasStripeCount() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Option for specifying how many stripes to use for the export.
+     * If blank, and the value of the striped field is true,
+     * the number of stripes is automatically chosen.
+     * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + * + * @return The stripeCount. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getStripeCount() { + return stripeCount_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : stripeCount_; + } + + /** + * + * + *
+     * Option for specifying how many stripes to use for the export.
+     * If blank, and the value of the striped field is true,
+     * the number of stripes is automatically chosen.
+     * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getStripeCountOrBuilder() { + return stripeCount_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : stripeCount_; + } + + public static final int BAK_TYPE_FIELD_NUMBER = 4; + private int bakType_ = 0; + + /** + * + * + *
+     * Type of this bak file will be export, FULL or DIFF, SQL Server only
+     * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 4; + * + * @return The enum numeric value on the wire for bakType. + */ + @java.lang.Override + public int getBakTypeValue() { + return bakType_; + } + + /** + * + * + *
+     * Type of this bak file will be export, FULL or DIFF, SQL Server only
+     * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 4; + * + * @return The bakType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BakType getBakType() { + com.google.cloud.sql.v1.BakType result = com.google.cloud.sql.v1.BakType.forNumber(bakType_); + return result == null ? com.google.cloud.sql.v1.BakType.UNRECOGNIZED : result; + } + + public static final int COPY_ONLY_FIELD_NUMBER = 5; + private com.google.protobuf.BoolValue copyOnly_; + + /** + * + * + *
+     * Deprecated: copy_only is deprecated. Use differential_base instead
+     * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.ExportContext.SqlBakExportOptions.copy_only is deprecated. + * See google/cloud/sql/v1/cloud_sql_resources.proto;l=486 + * @return Whether the copyOnly field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasCopyOnly() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Deprecated: copy_only is deprecated. Use differential_base instead
+     * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.ExportContext.SqlBakExportOptions.copy_only is deprecated. + * See google/cloud/sql/v1/cloud_sql_resources.proto;l=486 + * @return The copyOnly. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.BoolValue getCopyOnly() { + return copyOnly_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : copyOnly_; + } + + /** + * + * + *
+     * Deprecated: copy_only is deprecated. Use differential_base instead
+     * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.BoolValueOrBuilder getCopyOnlyOrBuilder() { + return copyOnly_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : copyOnly_; + } + + public static final int DIFFERENTIAL_BASE_FIELD_NUMBER = 6; + private com.google.protobuf.BoolValue differentialBase_; + + /** + * + * + *
+     * Whether or not the backup can be used as a differential base
+     * copy_only backup can not be served as differential base
+     * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + * + * @return Whether the differentialBase field is set. + */ + @java.lang.Override + public boolean hasDifferentialBase() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Whether or not the backup can be used as a differential base
+     * copy_only backup can not be served as differential base
+     * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + * + * @return The differentialBase. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getDifferentialBase() { + return differentialBase_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : differentialBase_; + } + + /** + * + * + *
+     * Whether or not the backup can be used as a differential base
+     * copy_only backup can not be served as differential base
+     * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getDifferentialBaseOrBuilder() { + return differentialBase_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : differentialBase_; + } + + public static final int EXPORT_LOG_START_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp exportLogStartTime_; + + /** + * + * + *
+     * Optional. The begin timestamp when transaction log will be included in
+     * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+     * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs from the beginning of retention period will be included.
+     * Only applied to Cloud SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exportLogStartTime field is set. + */ + @java.lang.Override + public boolean hasExportLogStartTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. The begin timestamp when transaction log will be included in
+     * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+     * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs from the beginning of retention period will be included.
+     * Only applied to Cloud SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exportLogStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExportLogStartTime() { + return exportLogStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogStartTime_; + } + + /** + * + * + *
+     * Optional. The begin timestamp when transaction log will be included in
+     * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+     * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs from the beginning of retention period will be included.
+     * Only applied to Cloud SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExportLogStartTimeOrBuilder() { + return exportLogStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogStartTime_; + } + + public static final int EXPORT_LOG_END_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp exportLogEndTime_; + + /** + * + * + *
+     * Optional. The end timestamp when transaction log will be included in the
+     * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+     * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs until current time will be included. Only applied to Cloud
+     * SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exportLogEndTime field is set. + */ + @java.lang.Override + public boolean hasExportLogEndTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. The end timestamp when transaction log will be included in the
+     * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+     * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs until current time will be included. Only applied to Cloud
+     * SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exportLogEndTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExportLogEndTime() { + return exportLogEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogEndTime_; + } + + /** + * + * + *
+     * Optional. The end timestamp when transaction log will be included in the
+     * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+     * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs until current time will be included. Only applied to Cloud
+     * SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExportLogEndTimeOrBuilder() { + return exportLogEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogEndTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getStriped()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getStripeCount()); + } + if (bakType_ != com.google.cloud.sql.v1.BakType.BAK_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, bakType_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getCopyOnly()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(6, getDifferentialBase()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(7, getExportLogStartTime()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(8, getExportLogEndTime()); + } + 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, getStriped()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStripeCount()); + } + if (bakType_ != com.google.cloud.sql.v1.BakType.BAK_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, bakType_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCopyOnly()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDifferentialBase()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(7, getExportLogStartTime()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getExportLogEndTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions other = + (com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions) obj; + + if (hasStriped() != other.hasStriped()) return false; + if (hasStriped()) { + if (!getStriped().equals(other.getStriped())) return false; + } + if (hasStripeCount() != other.hasStripeCount()) return false; + if (hasStripeCount()) { + if (!getStripeCount().equals(other.getStripeCount())) return false; + } + if (bakType_ != other.bakType_) return false; + if (hasCopyOnly() != other.hasCopyOnly()) return false; + if (hasCopyOnly()) { + if (!getCopyOnly().equals(other.getCopyOnly())) return false; + } + if (hasDifferentialBase() != other.hasDifferentialBase()) return false; + if (hasDifferentialBase()) { + if (!getDifferentialBase().equals(other.getDifferentialBase())) return false; + } + if (hasExportLogStartTime() != other.hasExportLogStartTime()) return false; + if (hasExportLogStartTime()) { + if (!getExportLogStartTime().equals(other.getExportLogStartTime())) return false; + } + if (hasExportLogEndTime() != other.hasExportLogEndTime()) return false; + if (hasExportLogEndTime()) { + if (!getExportLogEndTime().equals(other.getExportLogEndTime())) return false; + } + if (!getUnknownFields().equals(other.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 (hasStriped()) { + hash = (37 * hash) + STRIPED_FIELD_NUMBER; + hash = (53 * hash) + getStriped().hashCode(); + } + if (hasStripeCount()) { + hash = (37 * hash) + STRIPE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getStripeCount().hashCode(); + } + hash = (37 * hash) + BAK_TYPE_FIELD_NUMBER; + hash = (53 * hash) + bakType_; + if (hasCopyOnly()) { + hash = (37 * hash) + COPY_ONLY_FIELD_NUMBER; + hash = (53 * hash) + getCopyOnly().hashCode(); + } + if (hasDifferentialBase()) { + hash = (37 * hash) + DIFFERENTIAL_BASE_FIELD_NUMBER; + hash = (53 * hash) + getDifferentialBase().hashCode(); + } + if (hasExportLogStartTime()) { + hash = (37 * hash) + EXPORT_LOG_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExportLogStartTime().hashCode(); + } + if (hasExportLogEndTime()) { + hash = (37 * hash) + EXPORT_LOG_END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExportLogEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Options for exporting BAK files (SQL Server-only)
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ExportContext.SqlBakExportOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ExportContext.SqlBakExportOptions) + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlBakExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlBakExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.class, + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStripedFieldBuilder(); + internalGetStripeCountFieldBuilder(); + internalGetCopyOnlyFieldBuilder(); + internalGetDifferentialBaseFieldBuilder(); + internalGetExportLogStartTimeFieldBuilder(); + internalGetExportLogEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + striped_ = null; + if (stripedBuilder_ != null) { + stripedBuilder_.dispose(); + stripedBuilder_ = null; + } + stripeCount_ = null; + if (stripeCountBuilder_ != null) { + stripeCountBuilder_.dispose(); + stripeCountBuilder_ = null; + } + bakType_ = 0; + copyOnly_ = null; + if (copyOnlyBuilder_ != null) { + copyOnlyBuilder_.dispose(); + copyOnlyBuilder_ = null; + } + differentialBase_ = null; + if (differentialBaseBuilder_ != null) { + differentialBaseBuilder_.dispose(); + differentialBaseBuilder_ = null; + } + exportLogStartTime_ = null; + if (exportLogStartTimeBuilder_ != null) { + exportLogStartTimeBuilder_.dispose(); + exportLogStartTimeBuilder_ = null; + } + exportLogEndTime_ = null; + if (exportLogEndTimeBuilder_ != null) { + exportLogEndTimeBuilder_.dispose(); + exportLogEndTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlBakExportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions build() { + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions buildPartial() { + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions result = + new com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.striped_ = stripedBuilder_ == null ? striped_ : stripedBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.stripeCount_ = + stripeCountBuilder_ == null ? stripeCount_ : stripeCountBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.bakType_ = bakType_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.copyOnly_ = copyOnlyBuilder_ == null ? copyOnly_ : copyOnlyBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.differentialBase_ = + differentialBaseBuilder_ == null + ? differentialBase_ + : differentialBaseBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.exportLogStartTime_ = + exportLogStartTimeBuilder_ == null + ? exportLogStartTime_ + : exportLogStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.exportLogEndTime_ = + exportLogEndTimeBuilder_ == null + ? exportLogEndTime_ + : exportLogEndTimeBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions) { + return mergeFrom((com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions other) { + if (other == com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.getDefaultInstance()) + return this; + if (other.hasStriped()) { + mergeStriped(other.getStriped()); + } + if (other.hasStripeCount()) { + mergeStripeCount(other.getStripeCount()); + } + if (other.bakType_ != 0) { + setBakTypeValue(other.getBakTypeValue()); + } + if (other.hasCopyOnly()) { + mergeCopyOnly(other.getCopyOnly()); + } + if (other.hasDifferentialBase()) { + mergeDifferentialBase(other.getDifferentialBase()); + } + if (other.hasExportLogStartTime()) { + mergeExportLogStartTime(other.getExportLogStartTime()); + } + if (other.hasExportLogEndTime()) { + mergeExportLogEndTime(other.getExportLogEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetStripedFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStripeCountFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 32: + { + bakType_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: + { + input.readMessage( + internalGetCopyOnlyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetDifferentialBaseFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetExportLogStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 66: + { + input.readMessage( + internalGetExportLogEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.BoolValue striped_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + stripedBuilder_; + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + * + * @return Whether the striped field is set. + */ + public boolean hasStriped() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + * + * @return The striped. + */ + public com.google.protobuf.BoolValue getStriped() { + if (stripedBuilder_ == null) { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } else { + return stripedBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + public Builder setStriped(com.google.protobuf.BoolValue value) { + if (stripedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + striped_ = value; + } else { + stripedBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + public Builder setStriped(com.google.protobuf.BoolValue.Builder builderForValue) { + if (stripedBuilder_ == null) { + striped_ = builderForValue.build(); + } else { + stripedBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + public Builder mergeStriped(com.google.protobuf.BoolValue value) { + if (stripedBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && striped_ != null + && striped_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getStripedBuilder().mergeFrom(value); + } else { + striped_ = value; + } + } else { + stripedBuilder_.mergeFrom(value); + } + if (striped_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + public Builder clearStriped() { + bitField0_ = (bitField0_ & ~0x00000001); + striped_ = null; + if (stripedBuilder_ != null) { + stripedBuilder_.dispose(); + stripedBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + public com.google.protobuf.BoolValue.Builder getStripedBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetStripedFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + public com.google.protobuf.BoolValueOrBuilder getStripedOrBuilder() { + if (stripedBuilder_ != null) { + return stripedBuilder_.getMessageOrBuilder(); + } else { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetStripedFieldBuilder() { + if (stripedBuilder_ == null) { + stripedBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getStriped(), getParentForChildren(), isClean()); + striped_ = null; + } + return stripedBuilder_; + } + + private com.google.protobuf.Int32Value stripeCount_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + stripeCountBuilder_; + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + * + * @return Whether the stripeCount field is set. + */ + public boolean hasStripeCount() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + * + * @return The stripeCount. + */ + public com.google.protobuf.Int32Value getStripeCount() { + if (stripeCountBuilder_ == null) { + return stripeCount_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : stripeCount_; + } else { + return stripeCountBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + public Builder setStripeCount(com.google.protobuf.Int32Value value) { + if (stripeCountBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stripeCount_ = value; + } else { + stripeCountBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + public Builder setStripeCount(com.google.protobuf.Int32Value.Builder builderForValue) { + if (stripeCountBuilder_ == null) { + stripeCount_ = builderForValue.build(); + } else { + stripeCountBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + public Builder mergeStripeCount(com.google.protobuf.Int32Value value) { + if (stripeCountBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && stripeCount_ != null + && stripeCount_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getStripeCountBuilder().mergeFrom(value); + } else { + stripeCount_ = value; + } + } else { + stripeCountBuilder_.mergeFrom(value); + } + if (stripeCount_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + public Builder clearStripeCount() { + bitField0_ = (bitField0_ & ~0x00000002); + stripeCount_ = null; + if (stripeCountBuilder_ != null) { + stripeCountBuilder_.dispose(); + stripeCountBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + public com.google.protobuf.Int32Value.Builder getStripeCountBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStripeCountFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + public com.google.protobuf.Int32ValueOrBuilder getStripeCountOrBuilder() { + if (stripeCountBuilder_ != null) { + return stripeCountBuilder_.getMessageOrBuilder(); + } else { + return stripeCount_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : stripeCount_; + } + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetStripeCountFieldBuilder() { + if (stripeCountBuilder_ == null) { + stripeCountBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getStripeCount(), getParentForChildren(), isClean()); + stripeCount_ = null; + } + return stripeCountBuilder_; + } + + private int bakType_ = 0; + + /** + * + * + *
+       * Type of this bak file will be export, FULL or DIFF, SQL Server only
+       * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 4; + * + * @return The enum numeric value on the wire for bakType. + */ + @java.lang.Override + public int getBakTypeValue() { + return bakType_; + } + + /** + * + * + *
+       * Type of this bak file will be export, FULL or DIFF, SQL Server only
+       * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 4; + * + * @param value The enum numeric value on the wire for bakType to set. + * @return This builder for chaining. + */ + public Builder setBakTypeValue(int value) { + bakType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Type of this bak file will be export, FULL or DIFF, SQL Server only
+       * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 4; + * + * @return The bakType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BakType getBakType() { + com.google.cloud.sql.v1.BakType result = + com.google.cloud.sql.v1.BakType.forNumber(bakType_); + return result == null ? com.google.cloud.sql.v1.BakType.UNRECOGNIZED : result; + } + + /** + * + * + *
+       * Type of this bak file will be export, FULL or DIFF, SQL Server only
+       * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 4; + * + * @param value The bakType to set. + * @return This builder for chaining. + */ + public Builder setBakType(com.google.cloud.sql.v1.BakType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + bakType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Type of this bak file will be export, FULL or DIFF, SQL Server only
+       * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 4; + * + * @return This builder for chaining. + */ + public Builder clearBakType() { + bitField0_ = (bitField0_ & ~0x00000004); + bakType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue copyOnly_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + copyOnlyBuilder_; + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.ExportContext.SqlBakExportOptions.copy_only is deprecated. + * See google/cloud/sql/v1/cloud_sql_resources.proto;l=486 + * @return Whether the copyOnly field is set. + */ + @java.lang.Deprecated + public boolean hasCopyOnly() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.ExportContext.SqlBakExportOptions.copy_only is deprecated. + * See google/cloud/sql/v1/cloud_sql_resources.proto;l=486 + * @return The copyOnly. + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValue getCopyOnly() { + if (copyOnlyBuilder_ == null) { + return copyOnly_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : copyOnly_; + } else { + return copyOnlyBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setCopyOnly(com.google.protobuf.BoolValue value) { + if (copyOnlyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + copyOnly_ = value; + } else { + copyOnlyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setCopyOnly(com.google.protobuf.BoolValue.Builder builderForValue) { + if (copyOnlyBuilder_ == null) { + copyOnly_ = builderForValue.build(); + } else { + copyOnlyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder mergeCopyOnly(com.google.protobuf.BoolValue value) { + if (copyOnlyBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && copyOnly_ != null + && copyOnly_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getCopyOnlyBuilder().mergeFrom(value); + } else { + copyOnly_ = value; + } + } else { + copyOnlyBuilder_.mergeFrom(value); + } + if (copyOnly_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder clearCopyOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + copyOnly_ = null; + if (copyOnlyBuilder_ != null) { + copyOnlyBuilder_.dispose(); + copyOnlyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValue.Builder getCopyOnlyBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetCopyOnlyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValueOrBuilder getCopyOnlyOrBuilder() { + if (copyOnlyBuilder_ != null) { + return copyOnlyBuilder_.getMessageOrBuilder(); + } else { + return copyOnly_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : copyOnly_; + } + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetCopyOnlyFieldBuilder() { + if (copyOnlyBuilder_ == null) { + copyOnlyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getCopyOnly(), getParentForChildren(), isClean()); + copyOnly_ = null; + } + return copyOnlyBuilder_; + } + + private com.google.protobuf.BoolValue differentialBase_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + differentialBaseBuilder_; + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + * + * @return Whether the differentialBase field is set. + */ + public boolean hasDifferentialBase() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + * + * @return The differentialBase. + */ + public com.google.protobuf.BoolValue getDifferentialBase() { + if (differentialBaseBuilder_ == null) { + return differentialBase_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : differentialBase_; + } else { + return differentialBaseBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + public Builder setDifferentialBase(com.google.protobuf.BoolValue value) { + if (differentialBaseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + differentialBase_ = value; + } else { + differentialBaseBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + public Builder setDifferentialBase(com.google.protobuf.BoolValue.Builder builderForValue) { + if (differentialBaseBuilder_ == null) { + differentialBase_ = builderForValue.build(); + } else { + differentialBaseBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + public Builder mergeDifferentialBase(com.google.protobuf.BoolValue value) { + if (differentialBaseBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && differentialBase_ != null + && differentialBase_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getDifferentialBaseBuilder().mergeFrom(value); + } else { + differentialBase_ = value; + } + } else { + differentialBaseBuilder_.mergeFrom(value); + } + if (differentialBase_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + public Builder clearDifferentialBase() { + bitField0_ = (bitField0_ & ~0x00000010); + differentialBase_ = null; + if (differentialBaseBuilder_ != null) { + differentialBaseBuilder_.dispose(); + differentialBaseBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + public com.google.protobuf.BoolValue.Builder getDifferentialBaseBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetDifferentialBaseFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + public com.google.protobuf.BoolValueOrBuilder getDifferentialBaseOrBuilder() { + if (differentialBaseBuilder_ != null) { + return differentialBaseBuilder_.getMessageOrBuilder(); + } else { + return differentialBase_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : differentialBase_; + } + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetDifferentialBaseFieldBuilder() { + if (differentialBaseBuilder_ == null) { + differentialBaseBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getDifferentialBase(), getParentForChildren(), isClean()); + differentialBase_ = null; + } + return differentialBaseBuilder_; + } + + private com.google.protobuf.Timestamp exportLogStartTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + exportLogStartTimeBuilder_; + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exportLogStartTime field is set. + */ + public boolean hasExportLogStartTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exportLogStartTime. + */ + public com.google.protobuf.Timestamp getExportLogStartTime() { + if (exportLogStartTimeBuilder_ == null) { + return exportLogStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogStartTime_; + } else { + return exportLogStartTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExportLogStartTime(com.google.protobuf.Timestamp value) { + if (exportLogStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + exportLogStartTime_ = value; + } else { + exportLogStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExportLogStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (exportLogStartTimeBuilder_ == null) { + exportLogStartTime_ = builderForValue.build(); + } else { + exportLogStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeExportLogStartTime(com.google.protobuf.Timestamp value) { + if (exportLogStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && exportLogStartTime_ != null + && exportLogStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExportLogStartTimeBuilder().mergeFrom(value); + } else { + exportLogStartTime_ = value; + } + } else { + exportLogStartTimeBuilder_.mergeFrom(value); + } + if (exportLogStartTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearExportLogStartTime() { + bitField0_ = (bitField0_ & ~0x00000020); + exportLogStartTime_ = null; + if (exportLogStartTimeBuilder_ != null) { + exportLogStartTimeBuilder_.dispose(); + exportLogStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getExportLogStartTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetExportLogStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExportLogStartTimeOrBuilder() { + if (exportLogStartTimeBuilder_ != null) { + return exportLogStartTimeBuilder_.getMessageOrBuilder(); + } else { + return exportLogStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogStartTime_; + } + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExportLogStartTimeFieldBuilder() { + if (exportLogStartTimeBuilder_ == null) { + exportLogStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExportLogStartTime(), getParentForChildren(), isClean()); + exportLogStartTime_ = null; + } + return exportLogStartTimeBuilder_; + } + + private com.google.protobuf.Timestamp exportLogEndTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + exportLogEndTimeBuilder_; + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exportLogEndTime field is set. + */ + public boolean hasExportLogEndTime() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exportLogEndTime. + */ + public com.google.protobuf.Timestamp getExportLogEndTime() { + if (exportLogEndTimeBuilder_ == null) { + return exportLogEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogEndTime_; + } else { + return exportLogEndTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExportLogEndTime(com.google.protobuf.Timestamp value) { + if (exportLogEndTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + exportLogEndTime_ = value; + } else { + exportLogEndTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExportLogEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (exportLogEndTimeBuilder_ == null) { + exportLogEndTime_ = builderForValue.build(); + } else { + exportLogEndTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeExportLogEndTime(com.google.protobuf.Timestamp value) { + if (exportLogEndTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && exportLogEndTime_ != null + && exportLogEndTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExportLogEndTimeBuilder().mergeFrom(value); + } else { + exportLogEndTime_ = value; + } + } else { + exportLogEndTimeBuilder_.mergeFrom(value); + } + if (exportLogEndTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearExportLogEndTime() { + bitField0_ = (bitField0_ & ~0x00000040); + exportLogEndTime_ = null; + if (exportLogEndTimeBuilder_ != null) { + exportLogEndTimeBuilder_.dispose(); + exportLogEndTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getExportLogEndTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetExportLogEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExportLogEndTimeOrBuilder() { + if (exportLogEndTimeBuilder_ != null) { + return exportLogEndTimeBuilder_.getMessageOrBuilder(); + } else { + return exportLogEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogEndTime_; + } + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExportLogEndTimeFieldBuilder() { + if (exportLogEndTimeBuilder_ == null) { + exportLogEndTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExportLogEndTime(), getParentForChildren(), isClean()); + exportLogEndTime_ = null; + } + return exportLogEndTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ExportContext.SqlBakExportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ExportContext.SqlBakExportOptions) + private static final com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions(); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlBakExportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlTdeExportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ExportContext.SqlTdeExportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the bucket.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The certificatePath. + */ + java.lang.String getCertificatePath(); + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the bucket.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for certificatePath. + */ + com.google.protobuf.ByteString getCertificatePathBytes(); + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the location.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPath. + */ + java.lang.String getPrivateKeyPath(); + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the location.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPath. + */ + com.google.protobuf.ByteString getPrivateKeyPathBytes(); + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPassword. + */ + java.lang.String getPrivateKeyPassword(); + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPassword. + */ + com.google.protobuf.ByteString getPrivateKeyPasswordBytes(); + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + } + + /** Protobuf type {@code google.cloud.sql.v1.ExportContext.SqlTdeExportOptions} */ + public static final class SqlTdeExportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ExportContext.SqlTdeExportOptions) + SqlTdeExportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlTdeExportOptions"); + } + + // Use SqlTdeExportOptions.newBuilder() to construct. + private SqlTdeExportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlTdeExportOptions() { + certificatePath_ = ""; + privateKeyPath_ = ""; + privateKeyPassword_ = ""; + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlTdeExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlTdeExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.class, + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.Builder.class); + } + + public static final int CERTIFICATE_PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object certificatePath_ = ""; + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the bucket.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The certificatePath. + */ + @java.lang.Override + public java.lang.String getCertificatePath() { + java.lang.Object ref = certificatePath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certificatePath_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the bucket.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for certificatePath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCertificatePathBytes() { + java.lang.Object ref = certificatePath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certificatePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIVATE_KEY_PATH_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object privateKeyPath_ = ""; + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the location.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPath. + */ + @java.lang.Override + public java.lang.String getPrivateKeyPath() { + java.lang.Object ref = privateKeyPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPath_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the location.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrivateKeyPathBytes() { + java.lang.Object ref = privateKeyPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIVATE_KEY_PASSWORD_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object privateKeyPassword_ = ""; + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPassword. + */ + @java.lang.Override + public java.lang.String getPrivateKeyPassword() { + java.lang.Object ref = privateKeyPassword_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPassword_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPassword. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrivateKeyPasswordBytes() { + java.lang.Object ref = privateKeyPassword_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(certificatePath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, certificatePath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, privateKeyPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPassword_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, privateKeyPassword_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(certificatePath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, certificatePath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, privateKeyPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPassword_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, privateKeyPassword_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, 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.sql.v1.ExportContext.SqlTdeExportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions other = + (com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions) obj; + + if (!getCertificatePath().equals(other.getCertificatePath())) return false; + if (!getPrivateKeyPath().equals(other.getPrivateKeyPath())) return false; + if (!getPrivateKeyPassword().equals(other.getPrivateKeyPassword())) return false; + 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) + CERTIFICATE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getCertificatePath().hashCode(); + hash = (37 * hash) + PRIVATE_KEY_PATH_FIELD_NUMBER; + hash = (53 * hash) + getPrivateKeyPath().hashCode(); + hash = (37 * hash) + PRIVATE_KEY_PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPrivateKeyPassword().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.sql.v1.ExportContext.SqlTdeExportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.ExportContext.SqlTdeExportOptions} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ExportContext.SqlTdeExportOptions) + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlTdeExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlTdeExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.class, + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + certificatePath_ = ""; + privateKeyPath_ = ""; + privateKeyPassword_ = ""; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_SqlTdeExportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions build() { + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions buildPartial() { + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions result = + new com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.certificatePath_ = certificatePath_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.privateKeyPath_ = privateKeyPath_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.privateKeyPassword_ = privateKeyPassword_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions) { + return mergeFrom((com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions other) { + if (other == com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.getDefaultInstance()) + return this; + if (!other.getCertificatePath().isEmpty()) { + certificatePath_ = other.certificatePath_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPrivateKeyPath().isEmpty()) { + privateKeyPath_ = other.privateKeyPath_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPrivateKeyPassword().isEmpty()) { + privateKeyPassword_ = other.privateKeyPassword_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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: + { + certificatePath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + privateKeyPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + privateKeyPassword_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 certificatePath_ = ""; + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the bucket.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The certificatePath. + */ + public java.lang.String getCertificatePath() { + java.lang.Object ref = certificatePath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certificatePath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the bucket.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for certificatePath. + */ + public com.google.protobuf.ByteString getCertificatePathBytes() { + java.lang.Object ref = certificatePath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certificatePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the bucket.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The certificatePath to set. + * @return This builder for chaining. + */ + public Builder setCertificatePath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + certificatePath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the bucket.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCertificatePath() { + certificatePath_ = getDefaultInstance().getCertificatePath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the bucket.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for certificatePath to set. + * @return This builder for chaining. + */ + public Builder setCertificatePathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + certificatePath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object privateKeyPath_ = ""; + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPath. + */ + public java.lang.String getPrivateKeyPath() { + java.lang.Object ref = privateKeyPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPath. + */ + public com.google.protobuf.ByteString getPrivateKeyPathBytes() { + java.lang.Object ref = privateKeyPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The privateKeyPath to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + privateKeyPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPrivateKeyPath() { + privateKeyPath_ = getDefaultInstance().getPrivateKeyPath(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for privateKeyPath to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + privateKeyPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object privateKeyPassword_ = ""; + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPassword. + */ + public java.lang.String getPrivateKeyPassword() { + java.lang.Object ref = privateKeyPassword_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPassword_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPassword. + */ + public com.google.protobuf.ByteString getPrivateKeyPasswordBytes() { + java.lang.Object ref = privateKeyPassword_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The privateKeyPassword to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + privateKeyPassword_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPrivateKeyPassword() { + privateKeyPassword_ = getDefaultInstance().getPrivateKeyPassword(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for privateKeyPassword to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + privateKeyPassword_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ExportContext.SqlTdeExportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ExportContext.SqlTdeExportOptions) + private static final com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions(); + } + + public static com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlTdeExportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object uri_ = ""; + + /** + * + * + *
+   * The path to the file in Google Cloud Storage where the export will be
+   * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+   * already exists, the request succeeds, but the operation fails. If
+   * `fileType` is `SQL` and the filename ends with .gz,
+   * the contents are compressed.
+   * 
+ * + * string uri = 1; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + + /** + * + * + *
+   * The path to the file in Google Cloud Storage where the export will be
+   * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+   * already exists, the request succeeds, but the operation fails. If
+   * `fileType` is `SQL` and the filename ends with .gz,
+   * the contents are compressed.
+   * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList databases_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are exported.
+   * This excludes system databases and Cloud SQL databases used to manage
+   * internal operations. Exporting all user databases is only available for
+   * directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @return A list containing the databases. + */ + public com.google.protobuf.ProtocolStringList getDatabasesList() { + return databases_; + } + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are exported.
+   * This excludes system databases and Cloud SQL databases used to manage
+   * internal operations. Exporting all user databases is only available for
+   * directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @return The count of databases. + */ + public int getDatabasesCount() { + return databases_.size(); + } + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are exported.
+   * This excludes system databases and Cloud SQL databases used to manage
+   * internal operations. Exporting all user databases is only available for
+   * directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @param index The index of the element to return. + * @return The databases at the given index. + */ + public java.lang.String getDatabases(int index) { + return databases_.get(index); + } + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are exported.
+   * This excludes system databases and Cloud SQL databases used to manage
+   * internal operations. Exporting all user databases is only available for
+   * directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @param index The index of the value to return. + * @return The bytes of the databases at the given index. + */ + public com.google.protobuf.ByteString getDatabasesBytes(int index) { + return databases_.getByteString(index); + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#exportContext`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#exportContext`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SQL_EXPORT_OPTIONS_FIELD_NUMBER = 4; + private com.google.cloud.sql.v1.ExportContext.SqlExportOptions sqlExportOptions_; + + /** + * + * + *
+   * Options for exporting data as SQL statements.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + * + * @return Whether the sqlExportOptions field is set. + */ + @java.lang.Override + public boolean hasSqlExportOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Options for exporting data as SQL statements.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + * + * @return The sqlExportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions getSqlExportOptions() { + return sqlExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlExportOptions.getDefaultInstance() + : sqlExportOptions_; + } + + /** + * + * + *
+   * Options for exporting data as SQL statements.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlExportOptionsOrBuilder + getSqlExportOptionsOrBuilder() { + return sqlExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlExportOptions.getDefaultInstance() + : sqlExportOptions_; + } + + public static final int CSV_EXPORT_OPTIONS_FIELD_NUMBER = 5; + private com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csvExportOptions_; + + /** + * + * + *
+   * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+   * instances only.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + * @return Whether the csvExportOptions field is set. + */ + @java.lang.Override + public boolean hasCsvExportOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+   * instances only.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + * @return The csvExportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions getCsvExportOptions() { + return csvExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.getDefaultInstance() + : csvExportOptions_; + } + + /** + * + * + *
+   * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+   * instances only.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptionsOrBuilder + getCsvExportOptionsOrBuilder() { + return csvExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.getDefaultInstance() + : csvExportOptions_; + } + + public static final int FILE_TYPE_FIELD_NUMBER = 6; + private int fileType_ = 0; + + /** + * + * + *
+   * The file type for the specified uri.
+   * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 6; + * + * @return The enum numeric value on the wire for fileType. + */ + @java.lang.Override + public int getFileTypeValue() { + return fileType_; + } + + /** + * + * + *
+   * The file type for the specified uri.
+   * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 6; + * + * @return The fileType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlFileType getFileType() { + com.google.cloud.sql.v1.SqlFileType result = + com.google.cloud.sql.v1.SqlFileType.forNumber(fileType_); + return result == null ? com.google.cloud.sql.v1.SqlFileType.UNRECOGNIZED : result; + } + + public static final int OFFLOAD_FIELD_NUMBER = 8; + private com.google.protobuf.BoolValue offload_; + + /** + * + * + *
+   * Whether to perform a serverless export.
+   * 
+ * + * .google.protobuf.BoolValue offload = 8; + * + * @return Whether the offload field is set. + */ + @java.lang.Override + public boolean hasOffload() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Whether to perform a serverless export.
+   * 
+ * + * .google.protobuf.BoolValue offload = 8; + * + * @return The offload. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getOffload() { + return offload_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : offload_; + } + + /** + * + * + *
+   * Whether to perform a serverless export.
+   * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getOffloadOrBuilder() { + return offload_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : offload_; + } + + public static final int BAK_EXPORT_OPTIONS_FIELD_NUMBER = 9; + private com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions bakExportOptions_; + + /** + * + * + *
+   * Options for exporting data as BAK files.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + * @return Whether the bakExportOptions field is set. + */ + @java.lang.Override + public boolean hasBakExportOptions() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Options for exporting data as BAK files.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + * @return The bakExportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions getBakExportOptions() { + return bakExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.getDefaultInstance() + : bakExportOptions_; + } + + /** + * + * + *
+   * Options for exporting data as BAK files.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlBakExportOptionsOrBuilder + getBakExportOptionsOrBuilder() { + return bakExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.getDefaultInstance() + : bakExportOptions_; + } + + public static final int TDE_EXPORT_OPTIONS_FIELD_NUMBER = 10; + private com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tdeExportOptions_; + + /** + * + * + *
+   * Optional. Export parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tdeExportOptions field is set. + */ + @java.lang.Override + public boolean hasTdeExportOptions() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Optional. Export parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tdeExportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions getTdeExportOptions() { + return tdeExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.getDefaultInstance() + : tdeExportOptions_; + } + + /** + * + * + *
+   * Optional. Export parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptionsOrBuilder + getTdeExportOptionsOrBuilder() { + return tdeExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.getDefaultInstance() + : tdeExportOptions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, uri_); + } + for (int i = 0; i < databases_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, databases_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getSqlExportOptions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getCsvExportOptions()); + } + if (fileType_ != com.google.cloud.sql.v1.SqlFileType.SQL_FILE_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, fileType_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(8, getOffload()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(9, getBakExportOptions()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(10, getTdeExportOptions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, uri_); + } + { + int dataSize = 0; + for (int i = 0; i < databases_.size(); i++) { + dataSize += computeStringSizeNoTag(databases_.getRaw(i)); + } + size += dataSize; + size += 1 * getDatabasesList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getSqlExportOptions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCsvExportOptions()); + } + if (fileType_ != com.google.cloud.sql.v1.SqlFileType.SQL_FILE_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, fileType_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getOffload()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getBakExportOptions()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getTdeExportOptions()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ExportContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ExportContext other = (com.google.cloud.sql.v1.ExportContext) obj; + + if (!getUri().equals(other.getUri())) return false; + if (!getDatabasesList().equals(other.getDatabasesList())) return false; + if (!getKind().equals(other.getKind())) return false; + if (hasSqlExportOptions() != other.hasSqlExportOptions()) return false; + if (hasSqlExportOptions()) { + if (!getSqlExportOptions().equals(other.getSqlExportOptions())) return false; + } + if (hasCsvExportOptions() != other.hasCsvExportOptions()) return false; + if (hasCsvExportOptions()) { + if (!getCsvExportOptions().equals(other.getCsvExportOptions())) return false; + } + if (fileType_ != other.fileType_) return false; + if (hasOffload() != other.hasOffload()) return false; + if (hasOffload()) { + if (!getOffload().equals(other.getOffload())) return false; + } + if (hasBakExportOptions() != other.hasBakExportOptions()) return false; + if (hasBakExportOptions()) { + if (!getBakExportOptions().equals(other.getBakExportOptions())) return false; + } + if (hasTdeExportOptions() != other.hasTdeExportOptions()) return false; + if (hasTdeExportOptions()) { + if (!getTdeExportOptions().equals(other.getTdeExportOptions())) return false; + } + if (!getUnknownFields().equals(other.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) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + if (getDatabasesCount() > 0) { + hash = (37 * hash) + DATABASES_FIELD_NUMBER; + hash = (53 * hash) + getDatabasesList().hashCode(); + } + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasSqlExportOptions()) { + hash = (37 * hash) + SQL_EXPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getSqlExportOptions().hashCode(); + } + if (hasCsvExportOptions()) { + hash = (37 * hash) + CSV_EXPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getCsvExportOptions().hashCode(); + } + hash = (37 * hash) + FILE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + fileType_; + if (hasOffload()) { + hash = (37 * hash) + OFFLOAD_FIELD_NUMBER; + hash = (53 * hash) + getOffload().hashCode(); + } + if (hasBakExportOptions()) { + hash = (37 * hash) + BAK_EXPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getBakExportOptions().hashCode(); + } + if (hasTdeExportOptions()) { + hash = (37 * hash) + TDE_EXPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getTdeExportOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ExportContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExportContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExportContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExportContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.ExportContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance export context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ExportContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ExportContext) + com.google.cloud.sql.v1.ExportContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExportContext.class, + com.google.cloud.sql.v1.ExportContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ExportContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSqlExportOptionsFieldBuilder(); + internalGetCsvExportOptionsFieldBuilder(); + internalGetOffloadFieldBuilder(); + internalGetBakExportOptionsFieldBuilder(); + internalGetTdeExportOptionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + uri_ = ""; + databases_ = com.google.protobuf.LazyStringArrayList.emptyList(); + kind_ = ""; + sqlExportOptions_ = null; + if (sqlExportOptionsBuilder_ != null) { + sqlExportOptionsBuilder_.dispose(); + sqlExportOptionsBuilder_ = null; + } + csvExportOptions_ = null; + if (csvExportOptionsBuilder_ != null) { + csvExportOptionsBuilder_.dispose(); + csvExportOptionsBuilder_ = null; + } + fileType_ = 0; + offload_ = null; + if (offloadBuilder_ != null) { + offloadBuilder_.dispose(); + offloadBuilder_ = null; + } + bakExportOptions_ = null; + if (bakExportOptionsBuilder_ != null) { + bakExportOptionsBuilder_.dispose(); + bakExportOptionsBuilder_ = null; + } + tdeExportOptions_ = null; + if (tdeExportOptionsBuilder_ != null) { + tdeExportOptionsBuilder_.dispose(); + tdeExportOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ExportContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ExportContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext build() { + com.google.cloud.sql.v1.ExportContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext buildPartial() { + com.google.cloud.sql.v1.ExportContext result = + new com.google.cloud.sql.v1.ExportContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ExportContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.uri_ = uri_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + databases_.makeImmutable(); + result.databases_ = databases_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.sqlExportOptions_ = + sqlExportOptionsBuilder_ == null ? sqlExportOptions_ : sqlExportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.csvExportOptions_ = + csvExportOptionsBuilder_ == null ? csvExportOptions_ : csvExportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.fileType_ = fileType_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.offload_ = offloadBuilder_ == null ? offload_ : offloadBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.bakExportOptions_ = + bakExportOptionsBuilder_ == null ? bakExportOptions_ : bakExportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.tdeExportOptions_ = + tdeExportOptionsBuilder_ == null ? tdeExportOptions_ : tdeExportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ExportContext) { + return mergeFrom((com.google.cloud.sql.v1.ExportContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ExportContext other) { + if (other == com.google.cloud.sql.v1.ExportContext.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.databases_.isEmpty()) { + if (databases_.isEmpty()) { + databases_ = other.databases_; + bitField0_ |= 0x00000002; + } else { + ensureDatabasesIsMutable(); + databases_.addAll(other.databases_); + } + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasSqlExportOptions()) { + mergeSqlExportOptions(other.getSqlExportOptions()); + } + if (other.hasCsvExportOptions()) { + mergeCsvExportOptions(other.getCsvExportOptions()); + } + if (other.fileType_ != 0) { + setFileTypeValue(other.getFileTypeValue()); + } + if (other.hasOffload()) { + mergeOffload(other.getOffload()); + } + if (other.hasBakExportOptions()) { + mergeBakExportOptions(other.getBakExportOptions()); + } + if (other.hasTdeExportOptions()) { + mergeTdeExportOptions(other.getTdeExportOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDatabasesIsMutable(); + databases_.add(s); + break; + } // case 18 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetSqlExportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetCsvExportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + fileType_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 66: + { + input.readMessage(internalGetOffloadFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 66 + case 74: + { + input.readMessage( + internalGetBakExportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 74 + case 82: + { + input.readMessage( + internalGetTdeExportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object uri_ = ""; + + /** + * + * + *
+     * The path to the file in Google Cloud Storage where the export will be
+     * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+     * already exists, the request succeeds, but the operation fails. If
+     * `fileType` is `SQL` and the filename ends with .gz,
+     * the contents are compressed.
+     * 
+ * + * string uri = 1; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The path to the file in Google Cloud Storage where the export will be
+     * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+     * already exists, the request succeeds, but the operation fails. If
+     * `fileType` is `SQL` and the filename ends with .gz,
+     * the contents are compressed.
+     * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The path to the file in Google Cloud Storage where the export will be
+     * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+     * already exists, the request succeeds, but the operation fails. If
+     * `fileType` is `SQL` and the filename ends with .gz,
+     * the contents are compressed.
+     * 
+ * + * string uri = 1; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The path to the file in Google Cloud Storage where the export will be
+     * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+     * already exists, the request succeeds, but the operation fails. If
+     * `fileType` is `SQL` and the filename ends with .gz,
+     * the contents are compressed.
+     * 
+ * + * string uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The path to the file in Google Cloud Storage where the export will be
+     * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+     * already exists, the request succeeds, but the operation fails. If
+     * `fileType` is `SQL` and the filename ends with .gz,
+     * the contents are compressed.
+     * 
+ * + * string uri = 1; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList databases_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDatabasesIsMutable() { + if (!databases_.isModifiable()) { + databases_ = new com.google.protobuf.LazyStringArrayList(databases_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are exported.
+     * This excludes system databases and Cloud SQL databases used to manage
+     * internal operations. Exporting all user databases is only available for
+     * directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @return A list containing the databases. + */ + public com.google.protobuf.ProtocolStringList getDatabasesList() { + databases_.makeImmutable(); + return databases_; + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are exported.
+     * This excludes system databases and Cloud SQL databases used to manage
+     * internal operations. Exporting all user databases is only available for
+     * directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @return The count of databases. + */ + public int getDatabasesCount() { + return databases_.size(); + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are exported.
+     * This excludes system databases and Cloud SQL databases used to manage
+     * internal operations. Exporting all user databases is only available for
+     * directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @param index The index of the element to return. + * @return The databases at the given index. + */ + public java.lang.String getDatabases(int index) { + return databases_.get(index); + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are exported.
+     * This excludes system databases and Cloud SQL databases used to manage
+     * internal operations. Exporting all user databases is only available for
+     * directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @param index The index of the value to return. + * @return The bytes of the databases at the given index. + */ + public com.google.protobuf.ByteString getDatabasesBytes(int index) { + return databases_.getByteString(index); + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are exported.
+     * This excludes system databases and Cloud SQL databases used to manage
+     * internal operations. Exporting all user databases is only available for
+     * directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @param index The index to set the value at. + * @param value The databases to set. + * @return This builder for chaining. + */ + public Builder setDatabases(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabasesIsMutable(); + databases_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are exported.
+     * This excludes system databases and Cloud SQL databases used to manage
+     * internal operations. Exporting all user databases is only available for
+     * directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @param value The databases to add. + * @return This builder for chaining. + */ + public Builder addDatabases(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabasesIsMutable(); + databases_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are exported.
+     * This excludes system databases and Cloud SQL databases used to manage
+     * internal operations. Exporting all user databases is only available for
+     * directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @param values The databases to add. + * @return This builder for chaining. + */ + public Builder addAllDatabases(java.lang.Iterable values) { + ensureDatabasesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, databases_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are exported.
+     * This excludes system databases and Cloud SQL databases used to manage
+     * internal operations. Exporting all user databases is only available for
+     * directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @return This builder for chaining. + */ + public Builder clearDatabases() { + databases_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are exported.
+     * This excludes system databases and Cloud SQL databases used to manage
+     * internal operations. Exporting all user databases is only available for
+     * directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @param value The bytes of the databases to add. + * @return This builder for chaining. + */ + public Builder addDatabasesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDatabasesIsMutable(); + databases_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#exportContext`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#exportContext`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#exportContext`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#exportContext`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#exportContext`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.ExportContext.SqlExportOptions sqlExportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlExportOptionsOrBuilder> + sqlExportOptionsBuilder_; + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + * + * @return Whether the sqlExportOptions field is set. + */ + public boolean hasSqlExportOptions() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + * + * @return The sqlExportOptions. + */ + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions getSqlExportOptions() { + if (sqlExportOptionsBuilder_ == null) { + return sqlExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlExportOptions.getDefaultInstance() + : sqlExportOptions_; + } else { + return sqlExportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + */ + public Builder setSqlExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions value) { + if (sqlExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sqlExportOptions_ = value; + } else { + sqlExportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + */ + public Builder setSqlExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.Builder builderForValue) { + if (sqlExportOptionsBuilder_ == null) { + sqlExportOptions_ = builderForValue.build(); + } else { + sqlExportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + */ + public Builder mergeSqlExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlExportOptions value) { + if (sqlExportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && sqlExportOptions_ != null + && sqlExportOptions_ + != com.google.cloud.sql.v1.ExportContext.SqlExportOptions.getDefaultInstance()) { + getSqlExportOptionsBuilder().mergeFrom(value); + } else { + sqlExportOptions_ = value; + } + } else { + sqlExportOptionsBuilder_.mergeFrom(value); + } + if (sqlExportOptions_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + */ + public Builder clearSqlExportOptions() { + bitField0_ = (bitField0_ & ~0x00000008); + sqlExportOptions_ = null; + if (sqlExportOptionsBuilder_ != null) { + sqlExportOptionsBuilder_.dispose(); + sqlExportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + */ + public com.google.cloud.sql.v1.ExportContext.SqlExportOptions.Builder + getSqlExportOptionsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetSqlExportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + */ + public com.google.cloud.sql.v1.ExportContext.SqlExportOptionsOrBuilder + getSqlExportOptionsOrBuilder() { + if (sqlExportOptionsBuilder_ != null) { + return sqlExportOptionsBuilder_.getMessageOrBuilder(); + } else { + return sqlExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlExportOptions.getDefaultInstance() + : sqlExportOptions_; + } + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlExportOptionsOrBuilder> + internalGetSqlExportOptionsFieldBuilder() { + if (sqlExportOptionsBuilder_ == null) { + sqlExportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlExportOptionsOrBuilder>( + getSqlExportOptions(), getParentForChildren(), isClean()); + sqlExportOptions_ = null; + } + return sqlExportOptionsBuilder_; + } + + private com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csvExportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptionsOrBuilder> + csvExportOptionsBuilder_; + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + * @return Whether the csvExportOptions field is set. + */ + public boolean hasCsvExportOptions() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + * @return The csvExportOptions. + */ + public com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions getCsvExportOptions() { + if (csvExportOptionsBuilder_ == null) { + return csvExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.getDefaultInstance() + : csvExportOptions_; + } else { + return csvExportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + */ + public Builder setCsvExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions value) { + if (csvExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + csvExportOptions_ = value; + } else { + csvExportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + */ + public Builder setCsvExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.Builder builderForValue) { + if (csvExportOptionsBuilder_ == null) { + csvExportOptions_ = builderForValue.build(); + } else { + csvExportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + */ + public Builder mergeCsvExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions value) { + if (csvExportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && csvExportOptions_ != null + && csvExportOptions_ + != com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.getDefaultInstance()) { + getCsvExportOptionsBuilder().mergeFrom(value); + } else { + csvExportOptions_ = value; + } + } else { + csvExportOptionsBuilder_.mergeFrom(value); + } + if (csvExportOptions_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + */ + public Builder clearCsvExportOptions() { + bitField0_ = (bitField0_ & ~0x00000010); + csvExportOptions_ = null; + if (csvExportOptionsBuilder_ != null) { + csvExportOptionsBuilder_.dispose(); + csvExportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + */ + public com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.Builder + getCsvExportOptionsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetCsvExportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + */ + public com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptionsOrBuilder + getCsvExportOptionsOrBuilder() { + if (csvExportOptionsBuilder_ != null) { + return csvExportOptionsBuilder_.getMessageOrBuilder(); + } else { + return csvExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.getDefaultInstance() + : csvExportOptions_; + } + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptionsOrBuilder> + internalGetCsvExportOptionsFieldBuilder() { + if (csvExportOptionsBuilder_ == null) { + csvExportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptionsOrBuilder>( + getCsvExportOptions(), getParentForChildren(), isClean()); + csvExportOptions_ = null; + } + return csvExportOptionsBuilder_; + } + + private int fileType_ = 0; + + /** + * + * + *
+     * The file type for the specified uri.
+     * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 6; + * + * @return The enum numeric value on the wire for fileType. + */ + @java.lang.Override + public int getFileTypeValue() { + return fileType_; + } + + /** + * + * + *
+     * The file type for the specified uri.
+     * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 6; + * + * @param value The enum numeric value on the wire for fileType to set. + * @return This builder for chaining. + */ + public Builder setFileTypeValue(int value) { + fileType_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The file type for the specified uri.
+     * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 6; + * + * @return The fileType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlFileType getFileType() { + com.google.cloud.sql.v1.SqlFileType result = + com.google.cloud.sql.v1.SqlFileType.forNumber(fileType_); + return result == null ? com.google.cloud.sql.v1.SqlFileType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The file type for the specified uri.
+     * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 6; + * + * @param value The fileType to set. + * @return This builder for chaining. + */ + public Builder setFileType(com.google.cloud.sql.v1.SqlFileType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + fileType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The file type for the specified uri.
+     * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 6; + * + * @return This builder for chaining. + */ + public Builder clearFileType() { + bitField0_ = (bitField0_ & ~0x00000020); + fileType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue offload_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + offloadBuilder_; + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + * + * @return Whether the offload field is set. + */ + public boolean hasOffload() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + * + * @return The offload. + */ + public com.google.protobuf.BoolValue getOffload() { + if (offloadBuilder_ == null) { + return offload_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : offload_; + } else { + return offloadBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + public Builder setOffload(com.google.protobuf.BoolValue value) { + if (offloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + offload_ = value; + } else { + offloadBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + public Builder setOffload(com.google.protobuf.BoolValue.Builder builderForValue) { + if (offloadBuilder_ == null) { + offload_ = builderForValue.build(); + } else { + offloadBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + public Builder mergeOffload(com.google.protobuf.BoolValue value) { + if (offloadBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && offload_ != null + && offload_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getOffloadBuilder().mergeFrom(value); + } else { + offload_ = value; + } + } else { + offloadBuilder_.mergeFrom(value); + } + if (offload_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + public Builder clearOffload() { + bitField0_ = (bitField0_ & ~0x00000040); + offload_ = null; + if (offloadBuilder_ != null) { + offloadBuilder_.dispose(); + offloadBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + public com.google.protobuf.BoolValue.Builder getOffloadBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetOffloadFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + public com.google.protobuf.BoolValueOrBuilder getOffloadOrBuilder() { + if (offloadBuilder_ != null) { + return offloadBuilder_.getMessageOrBuilder(); + } else { + return offload_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : offload_; + } + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetOffloadFieldBuilder() { + if (offloadBuilder_ == null) { + offloadBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getOffload(), getParentForChildren(), isClean()); + offload_ = null; + } + return offloadBuilder_; + } + + private com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions bakExportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptionsOrBuilder> + bakExportOptionsBuilder_; + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + * @return Whether the bakExportOptions field is set. + */ + public boolean hasBakExportOptions() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + * @return The bakExportOptions. + */ + public com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions getBakExportOptions() { + if (bakExportOptionsBuilder_ == null) { + return bakExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.getDefaultInstance() + : bakExportOptions_; + } else { + return bakExportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + */ + public Builder setBakExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions value) { + if (bakExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bakExportOptions_ = value; + } else { + bakExportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + */ + public Builder setBakExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.Builder builderForValue) { + if (bakExportOptionsBuilder_ == null) { + bakExportOptions_ = builderForValue.build(); + } else { + bakExportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + */ + public Builder mergeBakExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions value) { + if (bakExportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && bakExportOptions_ != null + && bakExportOptions_ + != com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.getDefaultInstance()) { + getBakExportOptionsBuilder().mergeFrom(value); + } else { + bakExportOptions_ = value; + } + } else { + bakExportOptionsBuilder_.mergeFrom(value); + } + if (bakExportOptions_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + */ + public Builder clearBakExportOptions() { + bitField0_ = (bitField0_ & ~0x00000080); + bakExportOptions_ = null; + if (bakExportOptionsBuilder_ != null) { + bakExportOptionsBuilder_.dispose(); + bakExportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + */ + public com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.Builder + getBakExportOptionsBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetBakExportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + */ + public com.google.cloud.sql.v1.ExportContext.SqlBakExportOptionsOrBuilder + getBakExportOptionsOrBuilder() { + if (bakExportOptionsBuilder_ != null) { + return bakExportOptionsBuilder_.getMessageOrBuilder(); + } else { + return bakExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.getDefaultInstance() + : bakExportOptions_; + } + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptionsOrBuilder> + internalGetBakExportOptionsFieldBuilder() { + if (bakExportOptionsBuilder_ == null) { + bakExportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptionsOrBuilder>( + getBakExportOptions(), getParentForChildren(), isClean()); + bakExportOptions_ = null; + } + return bakExportOptionsBuilder_; + } + + private com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tdeExportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptionsOrBuilder> + tdeExportOptionsBuilder_; + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tdeExportOptions field is set. + */ + public boolean hasTdeExportOptions() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tdeExportOptions. + */ + public com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions getTdeExportOptions() { + if (tdeExportOptionsBuilder_ == null) { + return tdeExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.getDefaultInstance() + : tdeExportOptions_; + } else { + return tdeExportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTdeExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions value) { + if (tdeExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tdeExportOptions_ = value; + } else { + tdeExportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTdeExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.Builder builderForValue) { + if (tdeExportOptionsBuilder_ == null) { + tdeExportOptions_ = builderForValue.build(); + } else { + tdeExportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeTdeExportOptions( + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions value) { + if (tdeExportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && tdeExportOptions_ != null + && tdeExportOptions_ + != com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.getDefaultInstance()) { + getTdeExportOptionsBuilder().mergeFrom(value); + } else { + tdeExportOptions_ = value; + } + } else { + tdeExportOptionsBuilder_.mergeFrom(value); + } + if (tdeExportOptions_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTdeExportOptions() { + bitField0_ = (bitField0_ & ~0x00000100); + tdeExportOptions_ = null; + if (tdeExportOptionsBuilder_ != null) { + tdeExportOptionsBuilder_.dispose(); + tdeExportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.Builder + getTdeExportOptionsBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetTdeExportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptionsOrBuilder + getTdeExportOptionsOrBuilder() { + if (tdeExportOptionsBuilder_ != null) { + return tdeExportOptionsBuilder_.getMessageOrBuilder(); + } else { + return tdeExportOptions_ == null + ? com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.getDefaultInstance() + : tdeExportOptions_; + } + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptionsOrBuilder> + internalGetTdeExportOptionsFieldBuilder() { + if (tdeExportOptionsBuilder_ == null) { + tdeExportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions, + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.Builder, + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptionsOrBuilder>( + getTdeExportOptions(), getParentForChildren(), isClean()); + tdeExportOptions_ = null; + } + return tdeExportOptionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ExportContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ExportContext) + private static final com.google.cloud.sql.v1.ExportContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ExportContext(); + } + + public static com.google.cloud.sql.v1.ExportContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExportContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExportContextOrBuilder.java new file mode 100644 index 000000000000..e683750aeaa2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExportContextOrBuilder.java @@ -0,0 +1,418 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ExportContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ExportContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The path to the file in Google Cloud Storage where the export will be
+   * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+   * already exists, the request succeeds, but the operation fails. If
+   * `fileType` is `SQL` and the filename ends with .gz,
+   * the contents are compressed.
+   * 
+ * + * string uri = 1; + * + * @return The uri. + */ + java.lang.String getUri(); + + /** + * + * + *
+   * The path to the file in Google Cloud Storage where the export will be
+   * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+   * already exists, the request succeeds, but the operation fails. If
+   * `fileType` is `SQL` and the filename ends with .gz,
+   * the contents are compressed.
+   * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are exported.
+   * This excludes system databases and Cloud SQL databases used to manage
+   * internal operations. Exporting all user databases is only available for
+   * directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @return A list containing the databases. + */ + java.util.List getDatabasesList(); + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are exported.
+   * This excludes system databases and Cloud SQL databases used to manage
+   * internal operations. Exporting all user databases is only available for
+   * directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @return The count of databases. + */ + int getDatabasesCount(); + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are exported.
+   * This excludes system databases and Cloud SQL databases used to manage
+   * internal operations. Exporting all user databases is only available for
+   * directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @param index The index of the element to return. + * @return The databases at the given index. + */ + java.lang.String getDatabases(int index); + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are exported.
+   * This excludes system databases and Cloud SQL databases used to manage
+   * internal operations. Exporting all user databases is only available for
+   * directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @param index The index of the value to return. + * @return The bytes of the databases at the given index. + */ + com.google.protobuf.ByteString getDatabasesBytes(int index); + + /** + * + * + *
+   * This is always `sql#exportContext`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#exportContext`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Options for exporting data as SQL statements.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + * + * @return Whether the sqlExportOptions field is set. + */ + boolean hasSqlExportOptions(); + + /** + * + * + *
+   * Options for exporting data as SQL statements.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + * + * @return The sqlExportOptions. + */ + com.google.cloud.sql.v1.ExportContext.SqlExportOptions getSqlExportOptions(); + + /** + * + * + *
+   * Options for exporting data as SQL statements.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlExportOptions sql_export_options = 4; + */ + com.google.cloud.sql.v1.ExportContext.SqlExportOptionsOrBuilder getSqlExportOptionsOrBuilder(); + + /** + * + * + *
+   * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+   * instances only.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + * @return Whether the csvExportOptions field is set. + */ + boolean hasCsvExportOptions(); + + /** + * + * + *
+   * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+   * instances only.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + * @return The csvExportOptions. + */ + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions getCsvExportOptions(); + + /** + * + * + *
+   * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+   * instances only.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlCsvExportOptions csv_export_options = 5; + */ + com.google.cloud.sql.v1.ExportContext.SqlCsvExportOptionsOrBuilder getCsvExportOptionsOrBuilder(); + + /** + * + * + *
+   * The file type for the specified uri.
+   * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 6; + * + * @return The enum numeric value on the wire for fileType. + */ + int getFileTypeValue(); + + /** + * + * + *
+   * The file type for the specified uri.
+   * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 6; + * + * @return The fileType. + */ + com.google.cloud.sql.v1.SqlFileType getFileType(); + + /** + * + * + *
+   * Whether to perform a serverless export.
+   * 
+ * + * .google.protobuf.BoolValue offload = 8; + * + * @return Whether the offload field is set. + */ + boolean hasOffload(); + + /** + * + * + *
+   * Whether to perform a serverless export.
+   * 
+ * + * .google.protobuf.BoolValue offload = 8; + * + * @return The offload. + */ + com.google.protobuf.BoolValue getOffload(); + + /** + * + * + *
+   * Whether to perform a serverless export.
+   * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + com.google.protobuf.BoolValueOrBuilder getOffloadOrBuilder(); + + /** + * + * + *
+   * Options for exporting data as BAK files.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + * @return Whether the bakExportOptions field is set. + */ + boolean hasBakExportOptions(); + + /** + * + * + *
+   * Options for exporting data as BAK files.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + * @return The bakExportOptions. + */ + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptions getBakExportOptions(); + + /** + * + * + *
+   * Options for exporting data as BAK files.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext.SqlBakExportOptions bak_export_options = 9; + */ + com.google.cloud.sql.v1.ExportContext.SqlBakExportOptionsOrBuilder getBakExportOptionsOrBuilder(); + + /** + * + * + *
+   * Optional. Export parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tdeExportOptions field is set. + */ + boolean hasTdeExportOptions(); + + /** + * + * + *
+   * Optional. Export parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tdeExportOptions. + */ + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions getTdeExportOptions(); + + /** + * + * + *
+   * Optional. Export parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.ExportContext.SqlTdeExportOptionsOrBuilder getTdeExportOptionsOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExternalSyncParallelLevel.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExternalSyncParallelLevel.java new file mode 100644 index 000000000000..1158162de22b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExternalSyncParallelLevel.java @@ -0,0 +1,217 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * External Sync parallel level.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.ExternalSyncParallelLevel} + */ +@com.google.protobuf.Generated +public enum ExternalSyncParallelLevel implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unknown sync parallel level. Will be defaulted to OPTIMAL.
+   * 
+ * + * EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED = 0; + */ + EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED(0), + /** + * + * + *
+   * Minimal parallel level.
+   * 
+ * + * MIN = 1; + */ + MIN(1), + /** + * + * + *
+   * Optimal parallel level.
+   * 
+ * + * OPTIMAL = 2; + */ + OPTIMAL(2), + /** + * + * + *
+   * Maximum parallel level.
+   * 
+ * + * MAX = 3; + */ + MAX(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExternalSyncParallelLevel"); + } + + /** + * + * + *
+   * Unknown sync parallel level. Will be defaulted to OPTIMAL.
+   * 
+ * + * EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED = 0; + */ + public static final int EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Minimal parallel level.
+   * 
+ * + * MIN = 1; + */ + public static final int MIN_VALUE = 1; + + /** + * + * + *
+   * Optimal parallel level.
+   * 
+ * + * OPTIMAL = 2; + */ + public static final int OPTIMAL_VALUE = 2; + + /** + * + * + *
+   * Maximum parallel level.
+   * 
+ * + * MAX = 3; + */ + public static final int MAX_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 ExternalSyncParallelLevel 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 ExternalSyncParallelLevel forNumber(int value) { + switch (value) { + case 0: + return EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED; + case 1: + return MIN; + case 2: + return OPTIMAL; + case 3: + return MAX; + 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 ExternalSyncParallelLevel findValueByNumber(int number) { + return ExternalSyncParallelLevel.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto.getDescriptor().getEnumTypes().get(0); + } + + private static final ExternalSyncParallelLevel[] VALUES = values(); + + public static ExternalSyncParallelLevel 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 ExternalSyncParallelLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.ExternalSyncParallelLevel) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExternalSyncSelectedObject.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExternalSyncSelectedObject.java new file mode 100644 index 000000000000..f1f689782ab1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExternalSyncSelectedObject.java @@ -0,0 +1,596 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The selected object that Cloud SQL migrates.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ExternalSyncSelectedObject} + */ +@com.google.protobuf.Generated +public final class ExternalSyncSelectedObject extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ExternalSyncSelectedObject) + ExternalSyncSelectedObjectOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExternalSyncSelectedObject"); + } + + // Use ExternalSyncSelectedObject.newBuilder() to construct. + private ExternalSyncSelectedObject(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ExternalSyncSelectedObject() { + database_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ExternalSyncSelectedObject_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ExternalSyncSelectedObject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExternalSyncSelectedObject.class, + com.google.cloud.sql.v1.ExternalSyncSelectedObject.Builder.class); + } + + public static final int DATABASE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * The name of the database that Cloud SQL migrates.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the database that Cloud SQL migrates.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = 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.GeneratedMessage.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, database_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, database_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ExternalSyncSelectedObject)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ExternalSyncSelectedObject other = + (com.google.cloud.sql.v1.ExternalSyncSelectedObject) obj; + + if (!getDatabase().equals(other.getDatabase())) return false; + if (!getUnknownFields().equals(other.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) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ExternalSyncSelectedObject parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExternalSyncSelectedObject parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExternalSyncSelectedObject parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExternalSyncSelectedObject parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExternalSyncSelectedObject parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ExternalSyncSelectedObject parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExternalSyncSelectedObject parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExternalSyncSelectedObject parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExternalSyncSelectedObject parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExternalSyncSelectedObject parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ExternalSyncSelectedObject parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ExternalSyncSelectedObject parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.ExternalSyncSelectedObject prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The selected object that Cloud SQL migrates.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ExternalSyncSelectedObject} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ExternalSyncSelectedObject) + com.google.cloud.sql.v1.ExternalSyncSelectedObjectOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ExternalSyncSelectedObject_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ExternalSyncSelectedObject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ExternalSyncSelectedObject.class, + com.google.cloud.sql.v1.ExternalSyncSelectedObject.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ExternalSyncSelectedObject.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + database_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ExternalSyncSelectedObject_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExternalSyncSelectedObject getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ExternalSyncSelectedObject.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExternalSyncSelectedObject build() { + com.google.cloud.sql.v1.ExternalSyncSelectedObject result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExternalSyncSelectedObject buildPartial() { + com.google.cloud.sql.v1.ExternalSyncSelectedObject result = + new com.google.cloud.sql.v1.ExternalSyncSelectedObject(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ExternalSyncSelectedObject result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.database_ = database_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ExternalSyncSelectedObject) { + return mergeFrom((com.google.cloud.sql.v1.ExternalSyncSelectedObject) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ExternalSyncSelectedObject other) { + if (other == com.google.cloud.sql.v1.ExternalSyncSelectedObject.getDefaultInstance()) + return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + 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: + { + database_ = 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 database_ = ""; + + /** + * + * + *
+     * The name of the database that Cloud SQL migrates.
+     * 
+ * + * string database = 1; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the database that Cloud SQL migrates.
+     * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the database that Cloud SQL migrates.
+     * 
+ * + * string database = 1; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the database that Cloud SQL migrates.
+     * 
+ * + * string database = 1; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the database that Cloud SQL migrates.
+     * 
+ * + * string database = 1; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ExternalSyncSelectedObject) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ExternalSyncSelectedObject) + private static final com.google.cloud.sql.v1.ExternalSyncSelectedObject DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ExternalSyncSelectedObject(); + } + + public static com.google.cloud.sql.v1.ExternalSyncSelectedObject getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExternalSyncSelectedObject parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ExternalSyncSelectedObject getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExternalSyncSelectedObjectOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExternalSyncSelectedObjectOrBuilder.java new file mode 100644 index 000000000000..299fc5e8c5f1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ExternalSyncSelectedObjectOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ExternalSyncSelectedObjectOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ExternalSyncSelectedObject) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the database that Cloud SQL migrates.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * The name of the database that Cloud SQL migrates.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FailoverContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FailoverContext.java new file mode 100644 index 000000000000..fc2c30d23a99 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FailoverContext.java @@ -0,0 +1,695 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance failover context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.FailoverContext} + */ +@com.google.protobuf.Generated +public final class FailoverContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.FailoverContext) + FailoverContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FailoverContext"); + } + + // Use FailoverContext.newBuilder() to construct. + private FailoverContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FailoverContext() { + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_FailoverContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_FailoverContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.FailoverContext.class, + com.google.cloud.sql.v1.FailoverContext.Builder.class); + } + + public static final int SETTINGS_VERSION_FIELD_NUMBER = 1; + private long settingsVersion_ = 0L; + + /** + * + * + *
+   * The current settings version of this instance. Request will be rejected if
+   * this version doesn't match the current settings version.
+   * 
+ * + * int64 settings_version = 1; + * + * @return The settingsVersion. + */ + @java.lang.Override + public long getSettingsVersion() { + return settingsVersion_; + } + + public static final int KIND_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#failoverContext`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#failoverContext`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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 (settingsVersion_ != 0L) { + output.writeInt64(1, settingsVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (settingsVersion_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, settingsVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.FailoverContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.FailoverContext other = (com.google.cloud.sql.v1.FailoverContext) obj; + + if (getSettingsVersion() != other.getSettingsVersion()) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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) + SETTINGS_VERSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSettingsVersion()); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.FailoverContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.FailoverContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FailoverContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.FailoverContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FailoverContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.FailoverContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FailoverContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.FailoverContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FailoverContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.FailoverContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FailoverContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.FailoverContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.FailoverContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance failover context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.FailoverContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.FailoverContext) + com.google.cloud.sql.v1.FailoverContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_FailoverContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_FailoverContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.FailoverContext.class, + com.google.cloud.sql.v1.FailoverContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.FailoverContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + settingsVersion_ = 0L; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_FailoverContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.FailoverContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.FailoverContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.FailoverContext build() { + com.google.cloud.sql.v1.FailoverContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.FailoverContext buildPartial() { + com.google.cloud.sql.v1.FailoverContext result = + new com.google.cloud.sql.v1.FailoverContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.FailoverContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.settingsVersion_ = settingsVersion_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.FailoverContext) { + return mergeFrom((com.google.cloud.sql.v1.FailoverContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.FailoverContext other) { + if (other == com.google.cloud.sql.v1.FailoverContext.getDefaultInstance()) return this; + if (other.getSettingsVersion() != 0L) { + setSettingsVersion(other.getSettingsVersion()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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 8: + { + settingsVersion_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + kind_ = 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 long settingsVersion_; + + /** + * + * + *
+     * The current settings version of this instance. Request will be rejected if
+     * this version doesn't match the current settings version.
+     * 
+ * + * int64 settings_version = 1; + * + * @return The settingsVersion. + */ + @java.lang.Override + public long getSettingsVersion() { + return settingsVersion_; + } + + /** + * + * + *
+     * The current settings version of this instance. Request will be rejected if
+     * this version doesn't match the current settings version.
+     * 
+ * + * int64 settings_version = 1; + * + * @param value The settingsVersion to set. + * @return This builder for chaining. + */ + public Builder setSettingsVersion(long value) { + + settingsVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The current settings version of this instance. Request will be rejected if
+     * this version doesn't match the current settings version.
+     * 
+ * + * int64 settings_version = 1; + * + * @return This builder for chaining. + */ + public Builder clearSettingsVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + settingsVersion_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#failoverContext`.
+     * 
+ * + * string kind = 2; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#failoverContext`.
+     * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#failoverContext`.
+     * 
+ * + * string kind = 2; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#failoverContext`.
+     * 
+ * + * string kind = 2; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#failoverContext`.
+     * 
+ * + * string kind = 2; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.FailoverContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.FailoverContext) + private static final com.google.cloud.sql.v1.FailoverContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.FailoverContext(); + } + + public static com.google.cloud.sql.v1.FailoverContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailoverContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.FailoverContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FailoverContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FailoverContextOrBuilder.java new file mode 100644 index 000000000000..145a7aabf48e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FailoverContextOrBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface FailoverContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.FailoverContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The current settings version of this instance. Request will be rejected if
+   * this version doesn't match the current settings version.
+   * 
+ * + * int64 settings_version = 1; + * + * @return The settingsVersion. + */ + long getSettingsVersion(); + + /** + * + * + *
+   * This is always `sql#failoverContext`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#failoverContext`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FinalBackupConfig.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FinalBackupConfig.java new file mode 100644 index 000000000000..456a33ad1237 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FinalBackupConfig.java @@ -0,0 +1,690 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Config used to determine the final backup settings for the instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.FinalBackupConfig} + */ +@com.google.protobuf.Generated +public final class FinalBackupConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.FinalBackupConfig) + FinalBackupConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FinalBackupConfig"); + } + + // Use FinalBackupConfig.newBuilder() to construct. + private FinalBackupConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FinalBackupConfig() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_FinalBackupConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_FinalBackupConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.FinalBackupConfig.class, + com.google.cloud.sql.v1.FinalBackupConfig.Builder.class); + } + + private int bitField0_; + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + + /** + * + * + *
+   * Whether the final backup is enabled for the instance.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Whether the final backup is enabled for the instance.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + public static final int RETENTION_DAYS_FIELD_NUMBER = 3; + private int retentionDays_ = 0; + + /** + * + * + *
+   * The number of days to retain the final backup after the instance deletion.
+   * The final backup will be purged at (time_of_instance_deletion +
+   * retention_days).
+   * 
+ * + * optional int32 retention_days = 3; + * + * @return Whether the retentionDays field is set. + */ + @java.lang.Override + public boolean hasRetentionDays() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The number of days to retain the final backup after the instance deletion.
+   * The final backup will be purged at (time_of_instance_deletion +
+   * retention_days).
+   * 
+ * + * optional int32 retention_days = 3; + * + * @return The retentionDays. + */ + @java.lang.Override + public int getRetentionDays() { + return retentionDays_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, enabled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(3, retentionDays_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enabled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, retentionDays_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.FinalBackupConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.FinalBackupConfig other = + (com.google.cloud.sql.v1.FinalBackupConfig) obj; + + if (hasEnabled() != other.hasEnabled()) return false; + if (hasEnabled()) { + if (getEnabled() != other.getEnabled()) return false; + } + if (hasRetentionDays() != other.hasRetentionDays()) return false; + if (hasRetentionDays()) { + if (getRetentionDays() != other.getRetentionDays()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); + } + if (hasRetentionDays()) { + hash = (37 * hash) + RETENTION_DAYS_FIELD_NUMBER; + hash = (53 * hash) + getRetentionDays(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.FinalBackupConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.FinalBackupConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FinalBackupConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.FinalBackupConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FinalBackupConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.FinalBackupConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FinalBackupConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.FinalBackupConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FinalBackupConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.FinalBackupConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FinalBackupConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.FinalBackupConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.FinalBackupConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Config used to determine the final backup settings for the instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.FinalBackupConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.FinalBackupConfig) + com.google.cloud.sql.v1.FinalBackupConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_FinalBackupConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_FinalBackupConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.FinalBackupConfig.class, + com.google.cloud.sql.v1.FinalBackupConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.FinalBackupConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enabled_ = false; + retentionDays_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_FinalBackupConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.FinalBackupConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.FinalBackupConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.FinalBackupConfig build() { + com.google.cloud.sql.v1.FinalBackupConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.FinalBackupConfig buildPartial() { + com.google.cloud.sql.v1.FinalBackupConfig result = + new com.google.cloud.sql.v1.FinalBackupConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.FinalBackupConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enabled_ = enabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.retentionDays_ = retentionDays_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.FinalBackupConfig) { + return mergeFrom((com.google.cloud.sql.v1.FinalBackupConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.FinalBackupConfig other) { + if (other == com.google.cloud.sql.v1.FinalBackupConfig.getDefaultInstance()) return this; + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); + } + if (other.hasRetentionDays()) { + setRetentionDays(other.getRetentionDays()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 24: + { + retentionDays_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean enabled_; + + /** + * + * + *
+     * Whether the final backup is enabled for the instance.
+     * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Whether the final backup is enabled for the instance.
+     * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + /** + * + * + *
+     * Whether the final backup is enabled for the instance.
+     * 
+ * + * optional bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether the final backup is enabled for the instance.
+     * 
+ * + * optional bool enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + enabled_ = false; + onChanged(); + return this; + } + + private int retentionDays_; + + /** + * + * + *
+     * The number of days to retain the final backup after the instance deletion.
+     * The final backup will be purged at (time_of_instance_deletion +
+     * retention_days).
+     * 
+ * + * optional int32 retention_days = 3; + * + * @return Whether the retentionDays field is set. + */ + @java.lang.Override + public boolean hasRetentionDays() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The number of days to retain the final backup after the instance deletion.
+     * The final backup will be purged at (time_of_instance_deletion +
+     * retention_days).
+     * 
+ * + * optional int32 retention_days = 3; + * + * @return The retentionDays. + */ + @java.lang.Override + public int getRetentionDays() { + return retentionDays_; + } + + /** + * + * + *
+     * The number of days to retain the final backup after the instance deletion.
+     * The final backup will be purged at (time_of_instance_deletion +
+     * retention_days).
+     * 
+ * + * optional int32 retention_days = 3; + * + * @param value The retentionDays to set. + * @return This builder for chaining. + */ + public Builder setRetentionDays(int value) { + + retentionDays_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of days to retain the final backup after the instance deletion.
+     * The final backup will be purged at (time_of_instance_deletion +
+     * retention_days).
+     * 
+ * + * optional int32 retention_days = 3; + * + * @return This builder for chaining. + */ + public Builder clearRetentionDays() { + bitField0_ = (bitField0_ & ~0x00000002); + retentionDays_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.FinalBackupConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.FinalBackupConfig) + private static final com.google.cloud.sql.v1.FinalBackupConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.FinalBackupConfig(); + } + + public static com.google.cloud.sql.v1.FinalBackupConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FinalBackupConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.FinalBackupConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FinalBackupConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FinalBackupConfigOrBuilder.java new file mode 100644 index 000000000000..bd9bcae4a0cb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FinalBackupConfigOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface FinalBackupConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.FinalBackupConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether the final backup is enabled for the instance.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + + /** + * + * + *
+   * Whether the final backup is enabled for the instance.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + boolean getEnabled(); + + /** + * + * + *
+   * The number of days to retain the final backup after the instance deletion.
+   * The final backup will be purged at (time_of_instance_deletion +
+   * retention_days).
+   * 
+ * + * optional int32 retention_days = 3; + * + * @return Whether the retentionDays field is set. + */ + boolean hasRetentionDays(); + + /** + * + * + *
+   * The number of days to retain the final backup after the instance deletion.
+   * The final backup will be purged at (time_of_instance_deletion +
+   * retention_days).
+   * 
+ * + * optional int32 retention_days = 3; + * + * @return The retentionDays. + */ + int getRetentionDays(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Flag.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Flag.java new file mode 100644 index 000000000000..84344e1d43f9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Flag.java @@ -0,0 +1,3966 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_flags.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * A flag resource.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Flag} + */ +@com.google.protobuf.Generated +public final class Flag extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.Flag) + FlagOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Flag"); + } + + // Use Flag.newBuilder() to construct. + private Flag(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Flag() { + name_ = ""; + type_ = 0; + appliesTo_ = emptyIntList(); + allowedStringValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + kind_ = ""; + allowedIntValues_ = emptyLongList(); + flagScope_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_Flag_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_Flag_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Flag.class, com.google.cloud.sql.v1.Flag.Builder.class); + } + + private int bitField0_; + private int recommendedValueCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object recommendedValue_; + + public enum RecommendedValueCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + RECOMMENDED_STRING_VALUE(16), + RECOMMENDED_INT_VALUE(17), + RECOMMENDEDVALUE_NOT_SET(0); + private final int value; + + private RecommendedValueCase(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 RecommendedValueCase valueOf(int value) { + return forNumber(value); + } + + public static RecommendedValueCase forNumber(int value) { + switch (value) { + case 16: + return RECOMMENDED_STRING_VALUE; + case 17: + return RECOMMENDED_INT_VALUE; + case 0: + return RECOMMENDEDVALUE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RecommendedValueCase getRecommendedValueCase() { + return RecommendedValueCase.forNumber(recommendedValueCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * This is the name of the flag. Flag names always use underscores, not
+   * hyphens, for example: `max_allowed_packet`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * This is the name of the flag. Flag names always use underscores, not
+   * hyphens, for example: `max_allowed_packet`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private int type_ = 0; + + /** + * + * + *
+   * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+   * `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
+   * value, such as `skip_grant_tables`.
+   * 
+ * + * .google.cloud.sql.v1.SqlFlagType type = 2; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+   * `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
+   * value, such as `skip_grant_tables`.
+   * 
+ * + * .google.cloud.sql.v1.SqlFlagType type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlFlagType getType() { + com.google.cloud.sql.v1.SqlFlagType result = + com.google.cloud.sql.v1.SqlFlagType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1.SqlFlagType.UNRECOGNIZED : result; + } + + public static final int APPLIES_TO_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList appliesTo_ = emptyIntList(); + + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.cloud.sql.v1.SqlDatabaseVersion> + appliesTo_converter_ = + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.cloud.sql.v1.SqlDatabaseVersion>() { + public com.google.cloud.sql.v1.SqlDatabaseVersion convert(int from) { + com.google.cloud.sql.v1.SqlDatabaseVersion result = + com.google.cloud.sql.v1.SqlDatabaseVersion.forNumber(from); + return result == null + ? com.google.cloud.sql.v1.SqlDatabaseVersion.UNRECOGNIZED + : result; + } + }; + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @return A list containing the appliesTo. + */ + @java.lang.Override + public java.util.List getAppliesToList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.cloud.sql.v1.SqlDatabaseVersion>(appliesTo_, appliesTo_converter_); + } + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @return The count of appliesTo. + */ + @java.lang.Override + public int getAppliesToCount() { + return appliesTo_.size(); + } + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @param index The index of the element to return. + * @return The appliesTo at the given index. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabaseVersion getAppliesTo(int index) { + return appliesTo_converter_.convert(appliesTo_.getInt(index)); + } + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @return A list containing the enum numeric values on the wire for appliesTo. + */ + @java.lang.Override + public java.util.List getAppliesToValueList() { + return appliesTo_; + } + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of appliesTo at the given index. + */ + @java.lang.Override + public int getAppliesToValue(int index) { + return appliesTo_.getInt(index); + } + + private int appliesToMemoizedSerializedSize; + + public static final int ALLOWED_STRING_VALUES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList allowedStringValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @return A list containing the allowedStringValues. + */ + public com.google.protobuf.ProtocolStringList getAllowedStringValuesList() { + return allowedStringValues_; + } + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @return The count of allowedStringValues. + */ + public int getAllowedStringValuesCount() { + return allowedStringValues_.size(); + } + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @param index The index of the element to return. + * @return The allowedStringValues at the given index. + */ + public java.lang.String getAllowedStringValues(int index) { + return allowedStringValues_.get(index); + } + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @param index The index of the value to return. + * @return The bytes of the allowedStringValues at the given index. + */ + public com.google.protobuf.ByteString getAllowedStringValuesBytes(int index) { + return allowedStringValues_.getByteString(index); + } + + public static final int MIN_VALUE_FIELD_NUMBER = 5; + private com.google.protobuf.Int64Value minValue_; + + /** + * + * + *
+   * For `INTEGER` flags, the minimum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value min_value = 5; + * + * @return Whether the minValue field is set. + */ + @java.lang.Override + public boolean hasMinValue() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * For `INTEGER` flags, the minimum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value min_value = 5; + * + * @return The minValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getMinValue() { + return minValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : minValue_; + } + + /** + * + * + *
+   * For `INTEGER` flags, the minimum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder() { + return minValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : minValue_; + } + + public static final int MAX_VALUE_FIELD_NUMBER = 6; + private com.google.protobuf.Int64Value maxValue_; + + /** + * + * + *
+   * For `INTEGER` flags, the maximum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value max_value = 6; + * + * @return Whether the maxValue field is set. + */ + @java.lang.Override + public boolean hasMaxValue() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * For `INTEGER` flags, the maximum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value max_value = 6; + * + * @return The maxValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getMaxValue() { + return maxValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : maxValue_; + } + + /** + * + * + *
+   * For `INTEGER` flags, the maximum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder() { + return maxValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : maxValue_; + } + + public static final int REQUIRES_RESTART_FIELD_NUMBER = 7; + private com.google.protobuf.BoolValue requiresRestart_; + + /** + * + * + *
+   * Indicates whether changing this flag will trigger a database restart. Only
+   * applicable to Second Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + * + * @return Whether the requiresRestart field is set. + */ + @java.lang.Override + public boolean hasRequiresRestart() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Indicates whether changing this flag will trigger a database restart. Only
+   * applicable to Second Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + * + * @return The requiresRestart. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getRequiresRestart() { + return requiresRestart_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : requiresRestart_; + } + + /** + * + * + *
+   * Indicates whether changing this flag will trigger a database restart. Only
+   * applicable to Second Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getRequiresRestartOrBuilder() { + return requiresRestart_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : requiresRestart_; + } + + public static final int KIND_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#flag`.
+   * 
+ * + * string kind = 8; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#flag`.
+   * 
+ * + * string kind = 8; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IN_BETA_FIELD_NUMBER = 9; + private com.google.protobuf.BoolValue inBeta_; + + /** + * + * + *
+   * Whether or not the flag is considered in beta.
+   * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + * + * @return Whether the inBeta field is set. + */ + @java.lang.Override + public boolean hasInBeta() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Whether or not the flag is considered in beta.
+   * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + * + * @return The inBeta. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getInBeta() { + return inBeta_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : inBeta_; + } + + /** + * + * + *
+   * Whether or not the flag is considered in beta.
+   * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getInBetaOrBuilder() { + return inBeta_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : inBeta_; + } + + public static final int ALLOWED_INT_VALUES_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList allowedIntValues_ = emptyLongList(); + + /** + * + * + *
+   * Use this field if only certain integers are accepted. Can be combined
+   * with min_value and max_value to add additional values.
+   * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @return A list containing the allowedIntValues. + */ + @java.lang.Override + public java.util.List getAllowedIntValuesList() { + return allowedIntValues_; + } + + /** + * + * + *
+   * Use this field if only certain integers are accepted. Can be combined
+   * with min_value and max_value to add additional values.
+   * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @return The count of allowedIntValues. + */ + public int getAllowedIntValuesCount() { + return allowedIntValues_.size(); + } + + /** + * + * + *
+   * Use this field if only certain integers are accepted. Can be combined
+   * with min_value and max_value to add additional values.
+   * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @param index The index of the element to return. + * @return The allowedIntValues at the given index. + */ + public long getAllowedIntValues(int index) { + return allowedIntValues_.getLong(index); + } + + private int allowedIntValuesMemoizedSerializedSize = -1; + + public static final int FLAG_SCOPE_FIELD_NUMBER = 15; + private int flagScope_ = 0; + + /** + * + * + *
+   * Scope of flag.
+   * 
+ * + * .google.cloud.sql.v1.SqlFlagScope flag_scope = 15; + * + * @return The enum numeric value on the wire for flagScope. + */ + @java.lang.Override + public int getFlagScopeValue() { + return flagScope_; + } + + /** + * + * + *
+   * Scope of flag.
+   * 
+ * + * .google.cloud.sql.v1.SqlFlagScope flag_scope = 15; + * + * @return The flagScope. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlFlagScope getFlagScope() { + com.google.cloud.sql.v1.SqlFlagScope result = + com.google.cloud.sql.v1.SqlFlagScope.forNumber(flagScope_); + return result == null ? com.google.cloud.sql.v1.SqlFlagScope.UNRECOGNIZED : result; + } + + public static final int RECOMMENDED_STRING_VALUE_FIELD_NUMBER = 16; + + /** + * + * + *
+   * Recommended string value in string format for UI display.
+   * 
+ * + * string recommended_string_value = 16; + * + * @return Whether the recommendedStringValue field is set. + */ + public boolean hasRecommendedStringValue() { + return recommendedValueCase_ == 16; + } + + /** + * + * + *
+   * Recommended string value in string format for UI display.
+   * 
+ * + * string recommended_string_value = 16; + * + * @return The recommendedStringValue. + */ + public java.lang.String getRecommendedStringValue() { + java.lang.Object ref = ""; + if (recommendedValueCase_ == 16) { + ref = recommendedValue_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (recommendedValueCase_ == 16) { + recommendedValue_ = s; + } + return s; + } + } + + /** + * + * + *
+   * Recommended string value in string format for UI display.
+   * 
+ * + * string recommended_string_value = 16; + * + * @return The bytes for recommendedStringValue. + */ + public com.google.protobuf.ByteString getRecommendedStringValueBytes() { + java.lang.Object ref = ""; + if (recommendedValueCase_ == 16) { + ref = recommendedValue_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (recommendedValueCase_ == 16) { + recommendedValue_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECOMMENDED_INT_VALUE_FIELD_NUMBER = 17; + + /** + * + * + *
+   * Recommended int value in integer format for UI display.
+   * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + * + * @return Whether the recommendedIntValue field is set. + */ + @java.lang.Override + public boolean hasRecommendedIntValue() { + return recommendedValueCase_ == 17; + } + + /** + * + * + *
+   * Recommended int value in integer format for UI display.
+   * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + * + * @return The recommendedIntValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getRecommendedIntValue() { + if (recommendedValueCase_ == 17) { + return (com.google.protobuf.Int64Value) recommendedValue_; + } + return com.google.protobuf.Int64Value.getDefaultInstance(); + } + + /** + * + * + *
+   * Recommended int value in integer format for UI display.
+   * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getRecommendedIntValueOrBuilder() { + if (recommendedValueCase_ == 17) { + return (com.google.protobuf.Int64Value) recommendedValue_; + } + return com.google.protobuf.Int64Value.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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (type_ != com.google.cloud.sql.v1.SqlFlagType.SQL_FLAG_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, type_); + } + if (getAppliesToList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(appliesToMemoizedSerializedSize); + } + for (int i = 0; i < appliesTo_.size(); i++) { + output.writeEnumNoTag(appliesTo_.getInt(i)); + } + for (int i = 0; i < allowedStringValues_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, allowedStringValues_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getMinValue()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getMaxValue()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(7, getRequiresRestart()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, kind_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(9, getInBeta()); + } + if (getAllowedIntValuesList().size() > 0) { + output.writeUInt32NoTag(82); + output.writeUInt32NoTag(allowedIntValuesMemoizedSerializedSize); + } + for (int i = 0; i < allowedIntValues_.size(); i++) { + output.writeInt64NoTag(allowedIntValues_.getLong(i)); + } + if (flagScope_ != com.google.cloud.sql.v1.SqlFlagScope.SQL_FLAG_SCOPE_UNSPECIFIED.getNumber()) { + output.writeEnum(15, flagScope_); + } + if (recommendedValueCase_ == 16) { + com.google.protobuf.GeneratedMessage.writeString(output, 16, recommendedValue_); + } + if (recommendedValueCase_ == 17) { + output.writeMessage(17, (com.google.protobuf.Int64Value) recommendedValue_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (type_ != com.google.cloud.sql.v1.SqlFlagType.SQL_FLAG_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_); + } + { + int dataSize = 0; + for (int i = 0; i < appliesTo_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(appliesTo_.getInt(i)); + } + size += dataSize; + if (!getAppliesToList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + appliesToMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < allowedStringValues_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedStringValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedStringValuesList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getMinValue()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getMaxValue()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getRequiresRestart()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, kind_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getInBeta()); + } + { + int dataSize = 0; + for (int i = 0; i < allowedIntValues_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag( + allowedIntValues_.getLong(i)); + } + size += dataSize; + if (!getAllowedIntValuesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + allowedIntValuesMemoizedSerializedSize = dataSize; + } + if (flagScope_ != com.google.cloud.sql.v1.SqlFlagScope.SQL_FLAG_SCOPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(15, flagScope_); + } + if (recommendedValueCase_ == 16) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(16, recommendedValue_); + } + if (recommendedValueCase_ == 17) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 17, (com.google.protobuf.Int64Value) recommendedValue_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.Flag)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.Flag other = (com.google.cloud.sql.v1.Flag) obj; + + if (!getName().equals(other.getName())) return false; + if (type_ != other.type_) return false; + if (!appliesTo_.equals(other.appliesTo_)) return false; + if (!getAllowedStringValuesList().equals(other.getAllowedStringValuesList())) return false; + if (hasMinValue() != other.hasMinValue()) return false; + if (hasMinValue()) { + if (!getMinValue().equals(other.getMinValue())) return false; + } + if (hasMaxValue() != other.hasMaxValue()) return false; + if (hasMaxValue()) { + if (!getMaxValue().equals(other.getMaxValue())) return false; + } + if (hasRequiresRestart() != other.hasRequiresRestart()) return false; + if (hasRequiresRestart()) { + if (!getRequiresRestart().equals(other.getRequiresRestart())) return false; + } + if (!getKind().equals(other.getKind())) return false; + if (hasInBeta() != other.hasInBeta()) return false; + if (hasInBeta()) { + if (!getInBeta().equals(other.getInBeta())) return false; + } + if (!getAllowedIntValuesList().equals(other.getAllowedIntValuesList())) return false; + if (flagScope_ != other.flagScope_) return false; + if (!getRecommendedValueCase().equals(other.getRecommendedValueCase())) return false; + switch (recommendedValueCase_) { + case 16: + if (!getRecommendedStringValue().equals(other.getRecommendedStringValue())) return false; + break; + case 17: + if (!getRecommendedIntValue().equals(other.getRecommendedIntValue())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + if (getAppliesToCount() > 0) { + hash = (37 * hash) + APPLIES_TO_FIELD_NUMBER; + hash = (53 * hash) + appliesTo_.hashCode(); + } + if (getAllowedStringValuesCount() > 0) { + hash = (37 * hash) + ALLOWED_STRING_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedStringValuesList().hashCode(); + } + if (hasMinValue()) { + hash = (37 * hash) + MIN_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getMinValue().hashCode(); + } + if (hasMaxValue()) { + hash = (37 * hash) + MAX_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getMaxValue().hashCode(); + } + if (hasRequiresRestart()) { + hash = (37 * hash) + REQUIRES_RESTART_FIELD_NUMBER; + hash = (53 * hash) + getRequiresRestart().hashCode(); + } + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasInBeta()) { + hash = (37 * hash) + IN_BETA_FIELD_NUMBER; + hash = (53 * hash) + getInBeta().hashCode(); + } + if (getAllowedIntValuesCount() > 0) { + hash = (37 * hash) + ALLOWED_INT_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedIntValuesList().hashCode(); + } + hash = (37 * hash) + FLAG_SCOPE_FIELD_NUMBER; + hash = (53 * hash) + flagScope_; + switch (recommendedValueCase_) { + case 16: + hash = (37 * hash) + RECOMMENDED_STRING_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getRecommendedStringValue().hashCode(); + break; + case 17: + hash = (37 * hash) + RECOMMENDED_INT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getRecommendedIntValue().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.Flag parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Flag parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Flag parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Flag parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Flag parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Flag parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Flag parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Flag parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Flag parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Flag parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Flag parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Flag parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.Flag prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A flag resource.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Flag} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.Flag) + com.google.cloud.sql.v1.FlagOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_Flag_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_Flag_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Flag.class, com.google.cloud.sql.v1.Flag.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.Flag.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMinValueFieldBuilder(); + internalGetMaxValueFieldBuilder(); + internalGetRequiresRestartFieldBuilder(); + internalGetInBetaFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + type_ = 0; + appliesTo_ = emptyIntList(); + allowedStringValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + minValue_ = null; + if (minValueBuilder_ != null) { + minValueBuilder_.dispose(); + minValueBuilder_ = null; + } + maxValue_ = null; + if (maxValueBuilder_ != null) { + maxValueBuilder_.dispose(); + maxValueBuilder_ = null; + } + requiresRestart_ = null; + if (requiresRestartBuilder_ != null) { + requiresRestartBuilder_.dispose(); + requiresRestartBuilder_ = null; + } + kind_ = ""; + inBeta_ = null; + if (inBetaBuilder_ != null) { + inBetaBuilder_.dispose(); + inBetaBuilder_ = null; + } + allowedIntValues_ = emptyLongList(); + flagScope_ = 0; + if (recommendedIntValueBuilder_ != null) { + recommendedIntValueBuilder_.clear(); + } + recommendedValueCase_ = 0; + recommendedValue_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_Flag_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Flag getDefaultInstanceForType() { + return com.google.cloud.sql.v1.Flag.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.Flag build() { + com.google.cloud.sql.v1.Flag result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Flag buildPartial() { + com.google.cloud.sql.v1.Flag result = new com.google.cloud.sql.v1.Flag(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.Flag result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + appliesTo_.makeImmutable(); + result.appliesTo_ = appliesTo_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + allowedStringValues_.makeImmutable(); + result.allowedStringValues_ = allowedStringValues_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.minValue_ = minValueBuilder_ == null ? minValue_ : minValueBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.maxValue_ = maxValueBuilder_ == null ? maxValue_ : maxValueBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.requiresRestart_ = + requiresRestartBuilder_ == null ? requiresRestart_ : requiresRestartBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.inBeta_ = inBetaBuilder_ == null ? inBeta_ : inBetaBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + allowedIntValues_.makeImmutable(); + result.allowedIntValues_ = allowedIntValues_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.flagScope_ = flagScope_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.sql.v1.Flag result) { + result.recommendedValueCase_ = recommendedValueCase_; + result.recommendedValue_ = this.recommendedValue_; + if (recommendedValueCase_ == 17 && recommendedIntValueBuilder_ != null) { + result.recommendedValue_ = recommendedIntValueBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.Flag) { + return mergeFrom((com.google.cloud.sql.v1.Flag) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.Flag other) { + if (other == com.google.cloud.sql.v1.Flag.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.appliesTo_.isEmpty()) { + if (appliesTo_.isEmpty()) { + appliesTo_ = other.appliesTo_; + appliesTo_.makeImmutable(); + bitField0_ |= 0x00000004; + } else { + ensureAppliesToIsMutable(); + appliesTo_.addAll(other.appliesTo_); + } + onChanged(); + } + if (!other.allowedStringValues_.isEmpty()) { + if (allowedStringValues_.isEmpty()) { + allowedStringValues_ = other.allowedStringValues_; + bitField0_ |= 0x00000008; + } else { + ensureAllowedStringValuesIsMutable(); + allowedStringValues_.addAll(other.allowedStringValues_); + } + onChanged(); + } + if (other.hasMinValue()) { + mergeMinValue(other.getMinValue()); + } + if (other.hasMaxValue()) { + mergeMaxValue(other.getMaxValue()); + } + if (other.hasRequiresRestart()) { + mergeRequiresRestart(other.getRequiresRestart()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.hasInBeta()) { + mergeInBeta(other.getInBeta()); + } + if (!other.allowedIntValues_.isEmpty()) { + if (allowedIntValues_.isEmpty()) { + allowedIntValues_ = other.allowedIntValues_; + allowedIntValues_.makeImmutable(); + bitField0_ |= 0x00000200; + } else { + ensureAllowedIntValuesIsMutable(); + allowedIntValues_.addAll(other.allowedIntValues_); + } + onChanged(); + } + if (other.flagScope_ != 0) { + setFlagScopeValue(other.getFlagScopeValue()); + } + switch (other.getRecommendedValueCase()) { + case RECOMMENDED_STRING_VALUE: + { + recommendedValueCase_ = 16; + recommendedValue_ = other.recommendedValue_; + onChanged(); + break; + } + case RECOMMENDED_INT_VALUE: + { + mergeRecommendedIntValue(other.getRecommendedIntValue()); + break; + } + case RECOMMENDEDVALUE_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_ |= 0x00000001; + break; + } // case 10 + case 16: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + int tmpRaw = input.readEnum(); + ensureAppliesToIsMutable(); + appliesTo_.addInt(tmpRaw); + break; + } // case 24 + case 26: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureAppliesToIsMutable(); + while (input.getBytesUntilLimit() > 0) { + appliesTo_.addInt(input.readEnum()); + } + input.popLimit(limit); + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAllowedStringValuesIsMutable(); + allowedStringValues_.add(s); + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetMinValueFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetMaxValueFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetRequiresRestartFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + input.readMessage(internalGetInBetaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 80: + { + long v = input.readInt64(); + ensureAllowedIntValuesIsMutable(); + allowedIntValues_.addLong(v); + break; + } // case 80 + case 82: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureAllowedIntValuesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + allowedIntValues_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 82 + case 120: + { + flagScope_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 120 + case 130: + { + java.lang.String s = input.readStringRequireUtf8(); + recommendedValueCase_ = 16; + recommendedValue_ = s; + break; + } // case 130 + case 138: + { + input.readMessage( + internalGetRecommendedIntValueFieldBuilder().getBuilder(), extensionRegistry); + recommendedValueCase_ = 17; + break; + } // case 138 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int recommendedValueCase_ = 0; + private java.lang.Object recommendedValue_; + + public RecommendedValueCase getRecommendedValueCase() { + return RecommendedValueCase.forNumber(recommendedValueCase_); + } + + public Builder clearRecommendedValue() { + recommendedValueCase_ = 0; + recommendedValue_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * This is the name of the flag. Flag names always use underscores, not
+     * hyphens, for example: `max_allowed_packet`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is the name of the flag. Flag names always use underscores, not
+     * hyphens, for example: `max_allowed_packet`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is the name of the flag. Flag names always use underscores, not
+     * hyphens, for example: `max_allowed_packet`
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is the name of the flag. Flag names always use underscores, not
+     * hyphens, for example: `max_allowed_packet`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is the name of the flag. Flag names always use underscores, not
+     * hyphens, for example: `max_allowed_packet`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int type_ = 0; + + /** + * + * + *
+     * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+     * `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
+     * value, such as `skip_grant_tables`.
+     * 
+ * + * .google.cloud.sql.v1.SqlFlagType type = 2; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+     * `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
+     * value, such as `skip_grant_tables`.
+     * 
+ * + * .google.cloud.sql.v1.SqlFlagType type = 2; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+     * `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
+     * value, such as `skip_grant_tables`.
+     * 
+ * + * .google.cloud.sql.v1.SqlFlagType type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlFlagType getType() { + com.google.cloud.sql.v1.SqlFlagType result = + com.google.cloud.sql.v1.SqlFlagType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1.SqlFlagType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+     * `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
+     * value, such as `skip_grant_tables`.
+     * 
+ * + * .google.cloud.sql.v1.SqlFlagType type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.sql.v1.SqlFlagType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+     * `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
+     * value, such as `skip_grant_tables`.
+     * 
+ * + * .google.cloud.sql.v1.SqlFlagType type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000002); + type_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList appliesTo_ = emptyIntList(); + + private void ensureAppliesToIsMutable() { + if (!appliesTo_.isModifiable()) { + appliesTo_ = makeMutableCopy(appliesTo_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @return A list containing the appliesTo. + */ + public java.util.List getAppliesToList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.cloud.sql.v1.SqlDatabaseVersion>(appliesTo_, appliesTo_converter_); + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @return The count of appliesTo. + */ + public int getAppliesToCount() { + return appliesTo_.size(); + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @param index The index of the element to return. + * @return The appliesTo at the given index. + */ + public com.google.cloud.sql.v1.SqlDatabaseVersion getAppliesTo(int index) { + return appliesTo_converter_.convert(appliesTo_.getInt(index)); + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @param index The index to set the value at. + * @param value The appliesTo to set. + * @return This builder for chaining. + */ + public Builder setAppliesTo(int index, com.google.cloud.sql.v1.SqlDatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppliesToIsMutable(); + appliesTo_.setInt(index, value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @param value The appliesTo to add. + * @return This builder for chaining. + */ + public Builder addAppliesTo(com.google.cloud.sql.v1.SqlDatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppliesToIsMutable(); + appliesTo_.addInt(value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @param values The appliesTo to add. + * @return This builder for chaining. + */ + public Builder addAllAppliesTo( + java.lang.Iterable values) { + ensureAppliesToIsMutable(); + for (com.google.cloud.sql.v1.SqlDatabaseVersion value : values) { + appliesTo_.addInt(value.getNumber()); + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @return This builder for chaining. + */ + public Builder clearAppliesTo() { + appliesTo_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @return A list containing the enum numeric values on the wire for appliesTo. + */ + public java.util.List getAppliesToValueList() { + appliesTo_.makeImmutable(); + return appliesTo_; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of appliesTo at the given index. + */ + public int getAppliesToValue(int index) { + return appliesTo_.getInt(index); + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for appliesTo to set. + * @return This builder for chaining. + */ + public Builder setAppliesToValue(int index, int value) { + ensureAppliesToIsMutable(); + appliesTo_.setInt(index, value); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @param value The enum numeric value on the wire for appliesTo to add. + * @return This builder for chaining. + */ + public Builder addAppliesToValue(int value) { + ensureAppliesToIsMutable(); + appliesTo_.addInt(value); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @param values The enum numeric values on the wire for appliesTo to add. + * @return This builder for chaining. + */ + public Builder addAllAppliesToValue(java.lang.Iterable values) { + ensureAppliesToIsMutable(); + for (int value : values) { + appliesTo_.addInt(value); + } + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList allowedStringValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAllowedStringValuesIsMutable() { + if (!allowedStringValues_.isModifiable()) { + allowedStringValues_ = new com.google.protobuf.LazyStringArrayList(allowedStringValues_); + } + bitField0_ |= 0x00000008; + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @return A list containing the allowedStringValues. + */ + public com.google.protobuf.ProtocolStringList getAllowedStringValuesList() { + allowedStringValues_.makeImmutable(); + return allowedStringValues_; + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @return The count of allowedStringValues. + */ + public int getAllowedStringValuesCount() { + return allowedStringValues_.size(); + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @param index The index of the element to return. + * @return The allowedStringValues at the given index. + */ + public java.lang.String getAllowedStringValues(int index) { + return allowedStringValues_.get(index); + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @param index The index of the value to return. + * @return The bytes of the allowedStringValues at the given index. + */ + public com.google.protobuf.ByteString getAllowedStringValuesBytes(int index) { + return allowedStringValues_.getByteString(index); + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @param index The index to set the value at. + * @param value The allowedStringValues to set. + * @return This builder for chaining. + */ + public Builder setAllowedStringValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedStringValuesIsMutable(); + allowedStringValues_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @param value The allowedStringValues to add. + * @return This builder for chaining. + */ + public Builder addAllowedStringValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedStringValuesIsMutable(); + allowedStringValues_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @param values The allowedStringValues to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedStringValues(java.lang.Iterable values) { + ensureAllowedStringValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedStringValues_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @return This builder for chaining. + */ + public Builder clearAllowedStringValues() { + allowedStringValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @param value The bytes of the allowedStringValues to add. + * @return This builder for chaining. + */ + public Builder addAllowedStringValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedStringValuesIsMutable(); + allowedStringValues_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.Int64Value minValue_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + minValueBuilder_; + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + * + * @return Whether the minValue field is set. + */ + public boolean hasMinValue() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + * + * @return The minValue. + */ + public com.google.protobuf.Int64Value getMinValue() { + if (minValueBuilder_ == null) { + return minValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : minValue_; + } else { + return minValueBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + public Builder setMinValue(com.google.protobuf.Int64Value value) { + if (minValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minValue_ = value; + } else { + minValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + public Builder setMinValue(com.google.protobuf.Int64Value.Builder builderForValue) { + if (minValueBuilder_ == null) { + minValue_ = builderForValue.build(); + } else { + minValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + public Builder mergeMinValue(com.google.protobuf.Int64Value value) { + if (minValueBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && minValue_ != null + && minValue_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getMinValueBuilder().mergeFrom(value); + } else { + minValue_ = value; + } + } else { + minValueBuilder_.mergeFrom(value); + } + if (minValue_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + public Builder clearMinValue() { + bitField0_ = (bitField0_ & ~0x00000010); + minValue_ = null; + if (minValueBuilder_ != null) { + minValueBuilder_.dispose(); + minValueBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + public com.google.protobuf.Int64Value.Builder getMinValueBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetMinValueFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + public com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder() { + if (minValueBuilder_ != null) { + return minValueBuilder_.getMessageOrBuilder(); + } else { + return minValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : minValue_; + } + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetMinValueFieldBuilder() { + if (minValueBuilder_ == null) { + minValueBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getMinValue(), getParentForChildren(), isClean()); + minValue_ = null; + } + return minValueBuilder_; + } + + private com.google.protobuf.Int64Value maxValue_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + maxValueBuilder_; + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + * + * @return Whether the maxValue field is set. + */ + public boolean hasMaxValue() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + * + * @return The maxValue. + */ + public com.google.protobuf.Int64Value getMaxValue() { + if (maxValueBuilder_ == null) { + return maxValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : maxValue_; + } else { + return maxValueBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + public Builder setMaxValue(com.google.protobuf.Int64Value value) { + if (maxValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxValue_ = value; + } else { + maxValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + public Builder setMaxValue(com.google.protobuf.Int64Value.Builder builderForValue) { + if (maxValueBuilder_ == null) { + maxValue_ = builderForValue.build(); + } else { + maxValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + public Builder mergeMaxValue(com.google.protobuf.Int64Value value) { + if (maxValueBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && maxValue_ != null + && maxValue_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getMaxValueBuilder().mergeFrom(value); + } else { + maxValue_ = value; + } + } else { + maxValueBuilder_.mergeFrom(value); + } + if (maxValue_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + public Builder clearMaxValue() { + bitField0_ = (bitField0_ & ~0x00000020); + maxValue_ = null; + if (maxValueBuilder_ != null) { + maxValueBuilder_.dispose(); + maxValueBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + public com.google.protobuf.Int64Value.Builder getMaxValueBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetMaxValueFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + public com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder() { + if (maxValueBuilder_ != null) { + return maxValueBuilder_.getMessageOrBuilder(); + } else { + return maxValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : maxValue_; + } + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetMaxValueFieldBuilder() { + if (maxValueBuilder_ == null) { + maxValueBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getMaxValue(), getParentForChildren(), isClean()); + maxValue_ = null; + } + return maxValueBuilder_; + } + + private com.google.protobuf.BoolValue requiresRestart_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + requiresRestartBuilder_; + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + * + * @return Whether the requiresRestart field is set. + */ + public boolean hasRequiresRestart() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + * + * @return The requiresRestart. + */ + public com.google.protobuf.BoolValue getRequiresRestart() { + if (requiresRestartBuilder_ == null) { + return requiresRestart_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : requiresRestart_; + } else { + return requiresRestartBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + public Builder setRequiresRestart(com.google.protobuf.BoolValue value) { + if (requiresRestartBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requiresRestart_ = value; + } else { + requiresRestartBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + public Builder setRequiresRestart(com.google.protobuf.BoolValue.Builder builderForValue) { + if (requiresRestartBuilder_ == null) { + requiresRestart_ = builderForValue.build(); + } else { + requiresRestartBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + public Builder mergeRequiresRestart(com.google.protobuf.BoolValue value) { + if (requiresRestartBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && requiresRestart_ != null + && requiresRestart_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getRequiresRestartBuilder().mergeFrom(value); + } else { + requiresRestart_ = value; + } + } else { + requiresRestartBuilder_.mergeFrom(value); + } + if (requiresRestart_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + public Builder clearRequiresRestart() { + bitField0_ = (bitField0_ & ~0x00000040); + requiresRestart_ = null; + if (requiresRestartBuilder_ != null) { + requiresRestartBuilder_.dispose(); + requiresRestartBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + public com.google.protobuf.BoolValue.Builder getRequiresRestartBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetRequiresRestartFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + public com.google.protobuf.BoolValueOrBuilder getRequiresRestartOrBuilder() { + if (requiresRestartBuilder_ != null) { + return requiresRestartBuilder_.getMessageOrBuilder(); + } else { + return requiresRestart_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : requiresRestart_; + } + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetRequiresRestartFieldBuilder() { + if (requiresRestartBuilder_ == null) { + requiresRestartBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getRequiresRestart(), getParentForChildren(), isClean()); + requiresRestart_ = null; + } + return requiresRestartBuilder_; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#flag`.
+     * 
+ * + * string kind = 8; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#flag`.
+     * 
+ * + * string kind = 8; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#flag`.
+     * 
+ * + * string kind = 8; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#flag`.
+     * 
+ * + * string kind = 8; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#flag`.
+     * 
+ * + * string kind = 8; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue inBeta_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + inBetaBuilder_; + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + * + * @return Whether the inBeta field is set. + */ + public boolean hasInBeta() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + * + * @return The inBeta. + */ + public com.google.protobuf.BoolValue getInBeta() { + if (inBetaBuilder_ == null) { + return inBeta_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : inBeta_; + } else { + return inBetaBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + public Builder setInBeta(com.google.protobuf.BoolValue value) { + if (inBetaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inBeta_ = value; + } else { + inBetaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + public Builder setInBeta(com.google.protobuf.BoolValue.Builder builderForValue) { + if (inBetaBuilder_ == null) { + inBeta_ = builderForValue.build(); + } else { + inBetaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + public Builder mergeInBeta(com.google.protobuf.BoolValue value) { + if (inBetaBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && inBeta_ != null + && inBeta_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getInBetaBuilder().mergeFrom(value); + } else { + inBeta_ = value; + } + } else { + inBetaBuilder_.mergeFrom(value); + } + if (inBeta_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + public Builder clearInBeta() { + bitField0_ = (bitField0_ & ~0x00000100); + inBeta_ = null; + if (inBetaBuilder_ != null) { + inBetaBuilder_.dispose(); + inBetaBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + public com.google.protobuf.BoolValue.Builder getInBetaBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetInBetaFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + public com.google.protobuf.BoolValueOrBuilder getInBetaOrBuilder() { + if (inBetaBuilder_ != null) { + return inBetaBuilder_.getMessageOrBuilder(); + } else { + return inBeta_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : inBeta_; + } + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetInBetaFieldBuilder() { + if (inBetaBuilder_ == null) { + inBetaBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getInBeta(), getParentForChildren(), isClean()); + inBeta_ = null; + } + return inBetaBuilder_; + } + + private com.google.protobuf.Internal.LongList allowedIntValues_ = emptyLongList(); + + private void ensureAllowedIntValuesIsMutable() { + if (!allowedIntValues_.isModifiable()) { + allowedIntValues_ = makeMutableCopy(allowedIntValues_); + } + bitField0_ |= 0x00000200; + } + + /** + * + * + *
+     * Use this field if only certain integers are accepted. Can be combined
+     * with min_value and max_value to add additional values.
+     * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @return A list containing the allowedIntValues. + */ + public java.util.List getAllowedIntValuesList() { + allowedIntValues_.makeImmutable(); + return allowedIntValues_; + } + + /** + * + * + *
+     * Use this field if only certain integers are accepted. Can be combined
+     * with min_value and max_value to add additional values.
+     * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @return The count of allowedIntValues. + */ + public int getAllowedIntValuesCount() { + return allowedIntValues_.size(); + } + + /** + * + * + *
+     * Use this field if only certain integers are accepted. Can be combined
+     * with min_value and max_value to add additional values.
+     * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @param index The index of the element to return. + * @return The allowedIntValues at the given index. + */ + public long getAllowedIntValues(int index) { + return allowedIntValues_.getLong(index); + } + + /** + * + * + *
+     * Use this field if only certain integers are accepted. Can be combined
+     * with min_value and max_value to add additional values.
+     * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @param index The index to set the value at. + * @param value The allowedIntValues to set. + * @return This builder for chaining. + */ + public Builder setAllowedIntValues(int index, long value) { + + ensureAllowedIntValuesIsMutable(); + allowedIntValues_.setLong(index, value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Use this field if only certain integers are accepted. Can be combined
+     * with min_value and max_value to add additional values.
+     * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @param value The allowedIntValues to add. + * @return This builder for chaining. + */ + public Builder addAllowedIntValues(long value) { + + ensureAllowedIntValuesIsMutable(); + allowedIntValues_.addLong(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Use this field if only certain integers are accepted. Can be combined
+     * with min_value and max_value to add additional values.
+     * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @param values The allowedIntValues to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedIntValues(java.lang.Iterable values) { + ensureAllowedIntValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedIntValues_); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Use this field if only certain integers are accepted. Can be combined
+     * with min_value and max_value to add additional values.
+     * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @return This builder for chaining. + */ + public Builder clearAllowedIntValues() { + allowedIntValues_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + + private int flagScope_ = 0; + + /** + * + * + *
+     * Scope of flag.
+     * 
+ * + * .google.cloud.sql.v1.SqlFlagScope flag_scope = 15; + * + * @return The enum numeric value on the wire for flagScope. + */ + @java.lang.Override + public int getFlagScopeValue() { + return flagScope_; + } + + /** + * + * + *
+     * Scope of flag.
+     * 
+ * + * .google.cloud.sql.v1.SqlFlagScope flag_scope = 15; + * + * @param value The enum numeric value on the wire for flagScope to set. + * @return This builder for chaining. + */ + public Builder setFlagScopeValue(int value) { + flagScope_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Scope of flag.
+     * 
+ * + * .google.cloud.sql.v1.SqlFlagScope flag_scope = 15; + * + * @return The flagScope. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlFlagScope getFlagScope() { + com.google.cloud.sql.v1.SqlFlagScope result = + com.google.cloud.sql.v1.SqlFlagScope.forNumber(flagScope_); + return result == null ? com.google.cloud.sql.v1.SqlFlagScope.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Scope of flag.
+     * 
+ * + * .google.cloud.sql.v1.SqlFlagScope flag_scope = 15; + * + * @param value The flagScope to set. + * @return This builder for chaining. + */ + public Builder setFlagScope(com.google.cloud.sql.v1.SqlFlagScope value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + flagScope_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Scope of flag.
+     * 
+ * + * .google.cloud.sql.v1.SqlFlagScope flag_scope = 15; + * + * @return This builder for chaining. + */ + public Builder clearFlagScope() { + bitField0_ = (bitField0_ & ~0x00000400); + flagScope_ = 0; + onChanged(); + return this; + } + + /** + * + * + *
+     * Recommended string value in string format for UI display.
+     * 
+ * + * string recommended_string_value = 16; + * + * @return Whether the recommendedStringValue field is set. + */ + @java.lang.Override + public boolean hasRecommendedStringValue() { + return recommendedValueCase_ == 16; + } + + /** + * + * + *
+     * Recommended string value in string format for UI display.
+     * 
+ * + * string recommended_string_value = 16; + * + * @return The recommendedStringValue. + */ + @java.lang.Override + public java.lang.String getRecommendedStringValue() { + java.lang.Object ref = ""; + if (recommendedValueCase_ == 16) { + ref = recommendedValue_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (recommendedValueCase_ == 16) { + recommendedValue_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Recommended string value in string format for UI display.
+     * 
+ * + * string recommended_string_value = 16; + * + * @return The bytes for recommendedStringValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecommendedStringValueBytes() { + java.lang.Object ref = ""; + if (recommendedValueCase_ == 16) { + ref = recommendedValue_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (recommendedValueCase_ == 16) { + recommendedValue_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Recommended string value in string format for UI display.
+     * 
+ * + * string recommended_string_value = 16; + * + * @param value The recommendedStringValue to set. + * @return This builder for chaining. + */ + public Builder setRecommendedStringValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + recommendedValueCase_ = 16; + recommendedValue_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Recommended string value in string format for UI display.
+     * 
+ * + * string recommended_string_value = 16; + * + * @return This builder for chaining. + */ + public Builder clearRecommendedStringValue() { + if (recommendedValueCase_ == 16) { + recommendedValueCase_ = 0; + recommendedValue_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Recommended string value in string format for UI display.
+     * 
+ * + * string recommended_string_value = 16; + * + * @param value The bytes for recommendedStringValue to set. + * @return This builder for chaining. + */ + public Builder setRecommendedStringValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + recommendedValueCase_ = 16; + recommendedValue_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + recommendedIntValueBuilder_; + + /** + * + * + *
+     * Recommended int value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + * + * @return Whether the recommendedIntValue field is set. + */ + @java.lang.Override + public boolean hasRecommendedIntValue() { + return recommendedValueCase_ == 17; + } + + /** + * + * + *
+     * Recommended int value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + * + * @return The recommendedIntValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getRecommendedIntValue() { + if (recommendedIntValueBuilder_ == null) { + if (recommendedValueCase_ == 17) { + return (com.google.protobuf.Int64Value) recommendedValue_; + } + return com.google.protobuf.Int64Value.getDefaultInstance(); + } else { + if (recommendedValueCase_ == 17) { + return recommendedIntValueBuilder_.getMessage(); + } + return com.google.protobuf.Int64Value.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Recommended int value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + public Builder setRecommendedIntValue(com.google.protobuf.Int64Value value) { + if (recommendedIntValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + recommendedValue_ = value; + onChanged(); + } else { + recommendedIntValueBuilder_.setMessage(value); + } + recommendedValueCase_ = 17; + return this; + } + + /** + * + * + *
+     * Recommended int value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + public Builder setRecommendedIntValue(com.google.protobuf.Int64Value.Builder builderForValue) { + if (recommendedIntValueBuilder_ == null) { + recommendedValue_ = builderForValue.build(); + onChanged(); + } else { + recommendedIntValueBuilder_.setMessage(builderForValue.build()); + } + recommendedValueCase_ = 17; + return this; + } + + /** + * + * + *
+     * Recommended int value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + public Builder mergeRecommendedIntValue(com.google.protobuf.Int64Value value) { + if (recommendedIntValueBuilder_ == null) { + if (recommendedValueCase_ == 17 + && recommendedValue_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + recommendedValue_ = + com.google.protobuf.Int64Value.newBuilder( + (com.google.protobuf.Int64Value) recommendedValue_) + .mergeFrom(value) + .buildPartial(); + } else { + recommendedValue_ = value; + } + onChanged(); + } else { + if (recommendedValueCase_ == 17) { + recommendedIntValueBuilder_.mergeFrom(value); + } else { + recommendedIntValueBuilder_.setMessage(value); + } + } + recommendedValueCase_ = 17; + return this; + } + + /** + * + * + *
+     * Recommended int value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + public Builder clearRecommendedIntValue() { + if (recommendedIntValueBuilder_ == null) { + if (recommendedValueCase_ == 17) { + recommendedValueCase_ = 0; + recommendedValue_ = null; + onChanged(); + } + } else { + if (recommendedValueCase_ == 17) { + recommendedValueCase_ = 0; + recommendedValue_ = null; + } + recommendedIntValueBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Recommended int value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + public com.google.protobuf.Int64Value.Builder getRecommendedIntValueBuilder() { + return internalGetRecommendedIntValueFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Recommended int value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getRecommendedIntValueOrBuilder() { + if ((recommendedValueCase_ == 17) && (recommendedIntValueBuilder_ != null)) { + return recommendedIntValueBuilder_.getMessageOrBuilder(); + } else { + if (recommendedValueCase_ == 17) { + return (com.google.protobuf.Int64Value) recommendedValue_; + } + return com.google.protobuf.Int64Value.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Recommended int value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetRecommendedIntValueFieldBuilder() { + if (recommendedIntValueBuilder_ == null) { + if (!(recommendedValueCase_ == 17)) { + recommendedValue_ = com.google.protobuf.Int64Value.getDefaultInstance(); + } + recommendedIntValueBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + (com.google.protobuf.Int64Value) recommendedValue_, + getParentForChildren(), + isClean()); + recommendedValue_ = null; + } + recommendedValueCase_ = 17; + onChanged(); + return recommendedIntValueBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.Flag) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.Flag) + private static final com.google.cloud.sql.v1.Flag DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.Flag(); + } + + public static com.google.cloud.sql.v1.Flag getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Flag parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Flag getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FlagOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FlagOrBuilder.java new file mode 100644 index 000000000000..6944f9e7fa60 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FlagOrBuilder.java @@ -0,0 +1,576 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_flags.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface FlagOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.Flag) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is the name of the flag. Flag names always use underscores, not
+   * hyphens, for example: `max_allowed_packet`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * This is the name of the flag. Flag names always use underscores, not
+   * hyphens, for example: `max_allowed_packet`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+   * `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
+   * value, such as `skip_grant_tables`.
+   * 
+ * + * .google.cloud.sql.v1.SqlFlagType type = 2; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+   * `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
+   * value, such as `skip_grant_tables`.
+   * 
+ * + * .google.cloud.sql.v1.SqlFlagType type = 2; + * + * @return The type. + */ + com.google.cloud.sql.v1.SqlFlagType getType(); + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @return A list containing the appliesTo. + */ + java.util.List getAppliesToList(); + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @return The count of appliesTo. + */ + int getAppliesToCount(); + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @param index The index of the element to return. + * @return The appliesTo at the given index. + */ + com.google.cloud.sql.v1.SqlDatabaseVersion getAppliesTo(int index); + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @return A list containing the enum numeric values on the wire for appliesTo. + */ + java.util.List getAppliesToValueList(); + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlDatabaseVersion applies_to = 3; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of appliesTo at the given index. + */ + int getAppliesToValue(int index); + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @return A list containing the allowedStringValues. + */ + java.util.List getAllowedStringValuesList(); + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @return The count of allowedStringValues. + */ + int getAllowedStringValuesCount(); + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @param index The index of the element to return. + * @return The allowedStringValues at the given index. + */ + java.lang.String getAllowedStringValues(int index); + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @param index The index of the value to return. + * @return The bytes of the allowedStringValues at the given index. + */ + com.google.protobuf.ByteString getAllowedStringValuesBytes(int index); + + /** + * + * + *
+   * For `INTEGER` flags, the minimum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value min_value = 5; + * + * @return Whether the minValue field is set. + */ + boolean hasMinValue(); + + /** + * + * + *
+   * For `INTEGER` flags, the minimum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value min_value = 5; + * + * @return The minValue. + */ + com.google.protobuf.Int64Value getMinValue(); + + /** + * + * + *
+   * For `INTEGER` flags, the minimum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder(); + + /** + * + * + *
+   * For `INTEGER` flags, the maximum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value max_value = 6; + * + * @return Whether the maxValue field is set. + */ + boolean hasMaxValue(); + + /** + * + * + *
+   * For `INTEGER` flags, the maximum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value max_value = 6; + * + * @return The maxValue. + */ + com.google.protobuf.Int64Value getMaxValue(); + + /** + * + * + *
+   * For `INTEGER` flags, the maximum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder(); + + /** + * + * + *
+   * Indicates whether changing this flag will trigger a database restart. Only
+   * applicable to Second Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + * + * @return Whether the requiresRestart field is set. + */ + boolean hasRequiresRestart(); + + /** + * + * + *
+   * Indicates whether changing this flag will trigger a database restart. Only
+   * applicable to Second Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + * + * @return The requiresRestart. + */ + com.google.protobuf.BoolValue getRequiresRestart(); + + /** + * + * + *
+   * Indicates whether changing this flag will trigger a database restart. Only
+   * applicable to Second Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + com.google.protobuf.BoolValueOrBuilder getRequiresRestartOrBuilder(); + + /** + * + * + *
+   * This is always `sql#flag`.
+   * 
+ * + * string kind = 8; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#flag`.
+   * 
+ * + * string kind = 8; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Whether or not the flag is considered in beta.
+   * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + * + * @return Whether the inBeta field is set. + */ + boolean hasInBeta(); + + /** + * + * + *
+   * Whether or not the flag is considered in beta.
+   * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + * + * @return The inBeta. + */ + com.google.protobuf.BoolValue getInBeta(); + + /** + * + * + *
+   * Whether or not the flag is considered in beta.
+   * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + com.google.protobuf.BoolValueOrBuilder getInBetaOrBuilder(); + + /** + * + * + *
+   * Use this field if only certain integers are accepted. Can be combined
+   * with min_value and max_value to add additional values.
+   * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @return A list containing the allowedIntValues. + */ + java.util.List getAllowedIntValuesList(); + + /** + * + * + *
+   * Use this field if only certain integers are accepted. Can be combined
+   * with min_value and max_value to add additional values.
+   * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @return The count of allowedIntValues. + */ + int getAllowedIntValuesCount(); + + /** + * + * + *
+   * Use this field if only certain integers are accepted. Can be combined
+   * with min_value and max_value to add additional values.
+   * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @param index The index of the element to return. + * @return The allowedIntValues at the given index. + */ + long getAllowedIntValues(int index); + + /** + * + * + *
+   * Scope of flag.
+   * 
+ * + * .google.cloud.sql.v1.SqlFlagScope flag_scope = 15; + * + * @return The enum numeric value on the wire for flagScope. + */ + int getFlagScopeValue(); + + /** + * + * + *
+   * Scope of flag.
+   * 
+ * + * .google.cloud.sql.v1.SqlFlagScope flag_scope = 15; + * + * @return The flagScope. + */ + com.google.cloud.sql.v1.SqlFlagScope getFlagScope(); + + /** + * + * + *
+   * Recommended string value in string format for UI display.
+   * 
+ * + * string recommended_string_value = 16; + * + * @return Whether the recommendedStringValue field is set. + */ + boolean hasRecommendedStringValue(); + + /** + * + * + *
+   * Recommended string value in string format for UI display.
+   * 
+ * + * string recommended_string_value = 16; + * + * @return The recommendedStringValue. + */ + java.lang.String getRecommendedStringValue(); + + /** + * + * + *
+   * Recommended string value in string format for UI display.
+   * 
+ * + * string recommended_string_value = 16; + * + * @return The bytes for recommendedStringValue. + */ + com.google.protobuf.ByteString getRecommendedStringValueBytes(); + + /** + * + * + *
+   * Recommended int value in integer format for UI display.
+   * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + * + * @return Whether the recommendedIntValue field is set. + */ + boolean hasRecommendedIntValue(); + + /** + * + * + *
+   * Recommended int value in integer format for UI display.
+   * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + * + * @return The recommendedIntValue. + */ + com.google.protobuf.Int64Value getRecommendedIntValue(); + + /** + * + * + *
+   * Recommended int value in integer format for UI display.
+   * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + com.google.protobuf.Int64ValueOrBuilder getRecommendedIntValueOrBuilder(); + + com.google.cloud.sql.v1.Flag.RecommendedValueCase getRecommendedValueCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FlagsListResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FlagsListResponse.java new file mode 100644 index 000000000000..b51b2db5927f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FlagsListResponse.java @@ -0,0 +1,1101 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_flags.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Flags list response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.FlagsListResponse} + */ +@com.google.protobuf.Generated +public final class FlagsListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.FlagsListResponse) + FlagsListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FlagsListResponse"); + } + + // Use FlagsListResponse.newBuilder() to construct. + private FlagsListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FlagsListResponse() { + kind_ = ""; + items_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_FlagsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_FlagsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.FlagsListResponse.class, + com.google.cloud.sql.v1.FlagsListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#flagsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#flagsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + @java.lang.Override + public java.util.List getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.Flag getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.FlagOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.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.sql.v1.FlagsListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.FlagsListResponse other = + (com.google.cloud.sql.v1.FlagsListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.FlagsListResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.FlagsListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FlagsListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.FlagsListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FlagsListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.FlagsListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FlagsListResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.FlagsListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FlagsListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.FlagsListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.FlagsListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.FlagsListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.FlagsListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Flags list response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.FlagsListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.FlagsListResponse) + com.google.cloud.sql.v1.FlagsListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_FlagsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_FlagsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.FlagsListResponse.class, + com.google.cloud.sql.v1.FlagsListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.FlagsListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_FlagsListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.FlagsListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1.FlagsListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.FlagsListResponse build() { + com.google.cloud.sql.v1.FlagsListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.FlagsListResponse buildPartial() { + com.google.cloud.sql.v1.FlagsListResponse result = + new com.google.cloud.sql.v1.FlagsListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.FlagsListResponse result) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.FlagsListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.FlagsListResponse) { + return mergeFrom((com.google.cloud.sql.v1.FlagsListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.FlagsListResponse other) { + if (other == com.google.cloud.sql.v1.FlagsListResponse.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1.Flag m = + input.readMessage(com.google.cloud.sql.v1.Flag.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#flagsList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#flagsList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#flagsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#flagsList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#flagsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List items_ = java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Flag, + com.google.cloud.sql.v1.Flag.Builder, + com.google.cloud.sql.v1.FlagOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public com.google.cloud.sql.v1.Flag getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.Flag value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.Flag.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1.Flag value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.Flag value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1.Flag.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.Flag.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public Builder addAllItems(java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public com.google.cloud.sql.v1.Flag.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public com.google.cloud.sql.v1.FlagOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public java.util.List getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public com.google.cloud.sql.v1.Flag.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.Flag.getDefaultInstance()); + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public com.google.cloud.sql.v1.Flag.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.Flag.getDefaultInstance()); + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Flag, + com.google.cloud.sql.v1.Flag.Builder, + com.google.cloud.sql.v1.FlagOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Flag, + com.google.cloud.sql.v1.Flag.Builder, + com.google.cloud.sql.v1.FlagOrBuilder>( + items_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.FlagsListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.FlagsListResponse) + private static final com.google.cloud.sql.v1.FlagsListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.FlagsListResponse(); + } + + public static com.google.cloud.sql.v1.FlagsListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FlagsListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.FlagsListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FlagsListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FlagsListResponseOrBuilder.java new file mode 100644 index 000000000000..837988c6cb09 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/FlagsListResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_flags.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface FlagsListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.FlagsListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#flagsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#flagsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + com.google.cloud.sql.v1.Flag getItems(int index); + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + int getItemsCount(); + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + java.util.List getItemsOrBuilderList(); + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1.Flag items = 2; + */ + com.google.cloud.sql.v1.FlagOrBuilder getItemsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GeminiInstanceConfig.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GeminiInstanceConfig.java new file mode 100644 index 000000000000..d523c5d6a9de --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GeminiInstanceConfig.java @@ -0,0 +1,1264 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Gemini instance configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.GeminiInstanceConfig} + */ +@com.google.protobuf.Generated +public final class GeminiInstanceConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.GeminiInstanceConfig) + GeminiInstanceConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GeminiInstanceConfig"); + } + + // Use GeminiInstanceConfig.newBuilder() to construct. + private GeminiInstanceConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GeminiInstanceConfig() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_GeminiInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_GeminiInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.GeminiInstanceConfig.class, + com.google.cloud.sql.v1.GeminiInstanceConfig.Builder.class); + } + + private int bitField0_; + public static final int ENTITLED_FIELD_NUMBER = 1; + private boolean entitled_ = false; + + /** + * + * + *
+   * Output only. Whether Gemini is enabled.
+   * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the entitled field is set. + */ + @java.lang.Override + public boolean hasEntitled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. Whether Gemini is enabled.
+   * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The entitled. + */ + @java.lang.Override + public boolean getEntitled() { + return entitled_; + } + + public static final int GOOGLE_VACUUM_MGMT_ENABLED_FIELD_NUMBER = 2; + private boolean googleVacuumMgmtEnabled_ = false; + + /** + * + * + *
+   * Output only. Whether the vacuum management is enabled.
+   * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the googleVacuumMgmtEnabled field is set. + */ + @java.lang.Override + public boolean hasGoogleVacuumMgmtEnabled() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. Whether the vacuum management is enabled.
+   * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The googleVacuumMgmtEnabled. + */ + @java.lang.Override + public boolean getGoogleVacuumMgmtEnabled() { + return googleVacuumMgmtEnabled_; + } + + public static final int OOM_SESSION_CANCEL_ENABLED_FIELD_NUMBER = 3; + private boolean oomSessionCancelEnabled_ = false; + + /** + * + * + *
+   * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+   * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the oomSessionCancelEnabled field is set. + */ + @java.lang.Override + public boolean hasOomSessionCancelEnabled() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+   * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The oomSessionCancelEnabled. + */ + @java.lang.Override + public boolean getOomSessionCancelEnabled() { + return oomSessionCancelEnabled_; + } + + public static final int ACTIVE_QUERY_ENABLED_FIELD_NUMBER = 4; + private boolean activeQueryEnabled_ = false; + + /** + * + * + *
+   * Output only. Whether the active query is enabled.
+   * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the activeQueryEnabled field is set. + */ + @java.lang.Override + public boolean hasActiveQueryEnabled() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Output only. Whether the active query is enabled.
+   * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The activeQueryEnabled. + */ + @java.lang.Override + public boolean getActiveQueryEnabled() { + return activeQueryEnabled_; + } + + public static final int INDEX_ADVISOR_ENABLED_FIELD_NUMBER = 5; + private boolean indexAdvisorEnabled_ = false; + + /** + * + * + *
+   * Output only. Whether the index advisor is enabled.
+   * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the indexAdvisorEnabled field is set. + */ + @java.lang.Override + public boolean hasIndexAdvisorEnabled() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Output only. Whether the index advisor is enabled.
+   * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The indexAdvisorEnabled. + */ + @java.lang.Override + public boolean getIndexAdvisorEnabled() { + return indexAdvisorEnabled_; + } + + public static final int FLAG_RECOMMENDER_ENABLED_FIELD_NUMBER = 6; + private boolean flagRecommenderEnabled_ = false; + + /** + * + * + *
+   * Output only. Whether the flag recommender is enabled.
+   * 
+ * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the flagRecommenderEnabled field is set. + */ + @java.lang.Override + public boolean hasFlagRecommenderEnabled() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Output only. Whether the flag recommender is enabled.
+   * 
+ * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The flagRecommenderEnabled. + */ + @java.lang.Override + public boolean getFlagRecommenderEnabled() { + return flagRecommenderEnabled_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, entitled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(2, googleVacuumMgmtEnabled_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeBool(3, oomSessionCancelEnabled_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeBool(4, activeQueryEnabled_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeBool(5, indexAdvisorEnabled_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeBool(6, flagRecommenderEnabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, entitled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, googleVacuumMgmtEnabled_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, oomSessionCancelEnabled_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, activeQueryEnabled_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, indexAdvisorEnabled_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, flagRecommenderEnabled_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.GeminiInstanceConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.GeminiInstanceConfig other = + (com.google.cloud.sql.v1.GeminiInstanceConfig) obj; + + if (hasEntitled() != other.hasEntitled()) return false; + if (hasEntitled()) { + if (getEntitled() != other.getEntitled()) return false; + } + if (hasGoogleVacuumMgmtEnabled() != other.hasGoogleVacuumMgmtEnabled()) return false; + if (hasGoogleVacuumMgmtEnabled()) { + if (getGoogleVacuumMgmtEnabled() != other.getGoogleVacuumMgmtEnabled()) return false; + } + if (hasOomSessionCancelEnabled() != other.hasOomSessionCancelEnabled()) return false; + if (hasOomSessionCancelEnabled()) { + if (getOomSessionCancelEnabled() != other.getOomSessionCancelEnabled()) return false; + } + if (hasActiveQueryEnabled() != other.hasActiveQueryEnabled()) return false; + if (hasActiveQueryEnabled()) { + if (getActiveQueryEnabled() != other.getActiveQueryEnabled()) return false; + } + if (hasIndexAdvisorEnabled() != other.hasIndexAdvisorEnabled()) return false; + if (hasIndexAdvisorEnabled()) { + if (getIndexAdvisorEnabled() != other.getIndexAdvisorEnabled()) return false; + } + if (hasFlagRecommenderEnabled() != other.hasFlagRecommenderEnabled()) return false; + if (hasFlagRecommenderEnabled()) { + if (getFlagRecommenderEnabled() != other.getFlagRecommenderEnabled()) return false; + } + if (!getUnknownFields().equals(other.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 (hasEntitled()) { + hash = (37 * hash) + ENTITLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEntitled()); + } + if (hasGoogleVacuumMgmtEnabled()) { + hash = (37 * hash) + GOOGLE_VACUUM_MGMT_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getGoogleVacuumMgmtEnabled()); + } + if (hasOomSessionCancelEnabled()) { + hash = (37 * hash) + OOM_SESSION_CANCEL_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getOomSessionCancelEnabled()); + } + if (hasActiveQueryEnabled()) { + hash = (37 * hash) + ACTIVE_QUERY_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getActiveQueryEnabled()); + } + if (hasIndexAdvisorEnabled()) { + hash = (37 * hash) + INDEX_ADVISOR_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIndexAdvisorEnabled()); + } + if (hasFlagRecommenderEnabled()) { + hash = (37 * hash) + FLAG_RECOMMENDER_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFlagRecommenderEnabled()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.GeminiInstanceConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GeminiInstanceConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GeminiInstanceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GeminiInstanceConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GeminiInstanceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GeminiInstanceConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GeminiInstanceConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GeminiInstanceConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GeminiInstanceConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GeminiInstanceConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GeminiInstanceConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GeminiInstanceConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.GeminiInstanceConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Gemini instance configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.GeminiInstanceConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.GeminiInstanceConfig) + com.google.cloud.sql.v1.GeminiInstanceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_GeminiInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_GeminiInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.GeminiInstanceConfig.class, + com.google.cloud.sql.v1.GeminiInstanceConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.GeminiInstanceConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + entitled_ = false; + googleVacuumMgmtEnabled_ = false; + oomSessionCancelEnabled_ = false; + activeQueryEnabled_ = false; + indexAdvisorEnabled_ = false; + flagRecommenderEnabled_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_GeminiInstanceConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GeminiInstanceConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.GeminiInstanceConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.GeminiInstanceConfig build() { + com.google.cloud.sql.v1.GeminiInstanceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GeminiInstanceConfig buildPartial() { + com.google.cloud.sql.v1.GeminiInstanceConfig result = + new com.google.cloud.sql.v1.GeminiInstanceConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.GeminiInstanceConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.entitled_ = entitled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.googleVacuumMgmtEnabled_ = googleVacuumMgmtEnabled_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.oomSessionCancelEnabled_ = oomSessionCancelEnabled_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.activeQueryEnabled_ = activeQueryEnabled_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.indexAdvisorEnabled_ = indexAdvisorEnabled_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.flagRecommenderEnabled_ = flagRecommenderEnabled_; + to_bitField0_ |= 0x00000020; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.GeminiInstanceConfig) { + return mergeFrom((com.google.cloud.sql.v1.GeminiInstanceConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.GeminiInstanceConfig other) { + if (other == com.google.cloud.sql.v1.GeminiInstanceConfig.getDefaultInstance()) return this; + if (other.hasEntitled()) { + setEntitled(other.getEntitled()); + } + if (other.hasGoogleVacuumMgmtEnabled()) { + setGoogleVacuumMgmtEnabled(other.getGoogleVacuumMgmtEnabled()); + } + if (other.hasOomSessionCancelEnabled()) { + setOomSessionCancelEnabled(other.getOomSessionCancelEnabled()); + } + if (other.hasActiveQueryEnabled()) { + setActiveQueryEnabled(other.getActiveQueryEnabled()); + } + if (other.hasIndexAdvisorEnabled()) { + setIndexAdvisorEnabled(other.getIndexAdvisorEnabled()); + } + if (other.hasFlagRecommenderEnabled()) { + setFlagRecommenderEnabled(other.getFlagRecommenderEnabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + entitled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + googleVacuumMgmtEnabled_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + oomSessionCancelEnabled_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + activeQueryEnabled_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + indexAdvisorEnabled_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + flagRecommenderEnabled_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean entitled_; + + /** + * + * + *
+     * Output only. Whether Gemini is enabled.
+     * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the entitled field is set. + */ + @java.lang.Override + public boolean hasEntitled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Output only. Whether Gemini is enabled.
+     * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The entitled. + */ + @java.lang.Override + public boolean getEntitled() { + return entitled_; + } + + /** + * + * + *
+     * Output only. Whether Gemini is enabled.
+     * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The entitled to set. + * @return This builder for chaining. + */ + public Builder setEntitled(boolean value) { + + entitled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Whether Gemini is enabled.
+     * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearEntitled() { + bitField0_ = (bitField0_ & ~0x00000001); + entitled_ = false; + onChanged(); + return this; + } + + private boolean googleVacuumMgmtEnabled_; + + /** + * + * + *
+     * Output only. Whether the vacuum management is enabled.
+     * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the googleVacuumMgmtEnabled field is set. + */ + @java.lang.Override + public boolean hasGoogleVacuumMgmtEnabled() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. Whether the vacuum management is enabled.
+     * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The googleVacuumMgmtEnabled. + */ + @java.lang.Override + public boolean getGoogleVacuumMgmtEnabled() { + return googleVacuumMgmtEnabled_; + } + + /** + * + * + *
+     * Output only. Whether the vacuum management is enabled.
+     * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The googleVacuumMgmtEnabled to set. + * @return This builder for chaining. + */ + public Builder setGoogleVacuumMgmtEnabled(boolean value) { + + googleVacuumMgmtEnabled_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Whether the vacuum management is enabled.
+     * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearGoogleVacuumMgmtEnabled() { + bitField0_ = (bitField0_ & ~0x00000002); + googleVacuumMgmtEnabled_ = false; + onChanged(); + return this; + } + + private boolean oomSessionCancelEnabled_; + + /** + * + * + *
+     * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+     * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the oomSessionCancelEnabled field is set. + */ + @java.lang.Override + public boolean hasOomSessionCancelEnabled() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+     * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The oomSessionCancelEnabled. + */ + @java.lang.Override + public boolean getOomSessionCancelEnabled() { + return oomSessionCancelEnabled_; + } + + /** + * + * + *
+     * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+     * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The oomSessionCancelEnabled to set. + * @return This builder for chaining. + */ + public Builder setOomSessionCancelEnabled(boolean value) { + + oomSessionCancelEnabled_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+     * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearOomSessionCancelEnabled() { + bitField0_ = (bitField0_ & ~0x00000004); + oomSessionCancelEnabled_ = false; + onChanged(); + return this; + } + + private boolean activeQueryEnabled_; + + /** + * + * + *
+     * Output only. Whether the active query is enabled.
+     * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the activeQueryEnabled field is set. + */ + @java.lang.Override + public boolean hasActiveQueryEnabled() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Output only. Whether the active query is enabled.
+     * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The activeQueryEnabled. + */ + @java.lang.Override + public boolean getActiveQueryEnabled() { + return activeQueryEnabled_; + } + + /** + * + * + *
+     * Output only. Whether the active query is enabled.
+     * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The activeQueryEnabled to set. + * @return This builder for chaining. + */ + public Builder setActiveQueryEnabled(boolean value) { + + activeQueryEnabled_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Whether the active query is enabled.
+     * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearActiveQueryEnabled() { + bitField0_ = (bitField0_ & ~0x00000008); + activeQueryEnabled_ = false; + onChanged(); + return this; + } + + private boolean indexAdvisorEnabled_; + + /** + * + * + *
+     * Output only. Whether the index advisor is enabled.
+     * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the indexAdvisorEnabled field is set. + */ + @java.lang.Override + public boolean hasIndexAdvisorEnabled() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Output only. Whether the index advisor is enabled.
+     * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The indexAdvisorEnabled. + */ + @java.lang.Override + public boolean getIndexAdvisorEnabled() { + return indexAdvisorEnabled_; + } + + /** + * + * + *
+     * Output only. Whether the index advisor is enabled.
+     * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The indexAdvisorEnabled to set. + * @return This builder for chaining. + */ + public Builder setIndexAdvisorEnabled(boolean value) { + + indexAdvisorEnabled_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Whether the index advisor is enabled.
+     * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearIndexAdvisorEnabled() { + bitField0_ = (bitField0_ & ~0x00000010); + indexAdvisorEnabled_ = false; + onChanged(); + return this; + } + + private boolean flagRecommenderEnabled_; + + /** + * + * + *
+     * Output only. Whether the flag recommender is enabled.
+     * 
+ * + * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the flagRecommenderEnabled field is set. + */ + @java.lang.Override + public boolean hasFlagRecommenderEnabled() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Output only. Whether the flag recommender is enabled.
+     * 
+ * + * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The flagRecommenderEnabled. + */ + @java.lang.Override + public boolean getFlagRecommenderEnabled() { + return flagRecommenderEnabled_; + } + + /** + * + * + *
+     * Output only. Whether the flag recommender is enabled.
+     * 
+ * + * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The flagRecommenderEnabled to set. + * @return This builder for chaining. + */ + public Builder setFlagRecommenderEnabled(boolean value) { + + flagRecommenderEnabled_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Whether the flag recommender is enabled.
+     * 
+ * + * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearFlagRecommenderEnabled() { + bitField0_ = (bitField0_ & ~0x00000020); + flagRecommenderEnabled_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.GeminiInstanceConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.GeminiInstanceConfig) + private static final com.google.cloud.sql.v1.GeminiInstanceConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.GeminiInstanceConfig(); + } + + public static com.google.cloud.sql.v1.GeminiInstanceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GeminiInstanceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GeminiInstanceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GeminiInstanceConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GeminiInstanceConfigOrBuilder.java new file mode 100644 index 000000000000..bfedb1e8da14 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GeminiInstanceConfigOrBuilder.java @@ -0,0 +1,198 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface GeminiInstanceConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.GeminiInstanceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Whether Gemini is enabled.
+   * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the entitled field is set. + */ + boolean hasEntitled(); + + /** + * + * + *
+   * Output only. Whether Gemini is enabled.
+   * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The entitled. + */ + boolean getEntitled(); + + /** + * + * + *
+   * Output only. Whether the vacuum management is enabled.
+   * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the googleVacuumMgmtEnabled field is set. + */ + boolean hasGoogleVacuumMgmtEnabled(); + + /** + * + * + *
+   * Output only. Whether the vacuum management is enabled.
+   * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The googleVacuumMgmtEnabled. + */ + boolean getGoogleVacuumMgmtEnabled(); + + /** + * + * + *
+   * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+   * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the oomSessionCancelEnabled field is set. + */ + boolean hasOomSessionCancelEnabled(); + + /** + * + * + *
+   * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+   * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The oomSessionCancelEnabled. + */ + boolean getOomSessionCancelEnabled(); + + /** + * + * + *
+   * Output only. Whether the active query is enabled.
+   * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the activeQueryEnabled field is set. + */ + boolean hasActiveQueryEnabled(); + + /** + * + * + *
+   * Output only. Whether the active query is enabled.
+   * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The activeQueryEnabled. + */ + boolean getActiveQueryEnabled(); + + /** + * + * + *
+   * Output only. Whether the index advisor is enabled.
+   * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the indexAdvisorEnabled field is set. + */ + boolean hasIndexAdvisorEnabled(); + + /** + * + * + *
+   * Output only. Whether the index advisor is enabled.
+   * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The indexAdvisorEnabled. + */ + boolean getIndexAdvisorEnabled(); + + /** + * + * + *
+   * Output only. Whether the flag recommender is enabled.
+   * 
+ * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the flagRecommenderEnabled field is set. + */ + boolean hasFlagRecommenderEnabled(); + + /** + * + * + *
+   * Output only. Whether the flag recommender is enabled.
+   * 
+ * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The flagRecommenderEnabled. + */ + boolean getFlagRecommenderEnabled(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GenerateEphemeralCertRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GenerateEphemeralCertRequest.java new file mode 100644 index 000000000000..20cb720ff523 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GenerateEphemeralCertRequest.java @@ -0,0 +1,1788 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Ephemeral certificate creation request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.GenerateEphemeralCertRequest} + */ +@com.google.protobuf.Generated +public final class GenerateEphemeralCertRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.GenerateEphemeralCertRequest) + GenerateEphemeralCertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GenerateEphemeralCertRequest"); + } + + // Use GenerateEphemeralCertRequest.newBuilder() to construct. + private GenerateEphemeralCertRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GenerateEphemeralCertRequest() { + instance_ = ""; + project_ = ""; + publicKey_ = ""; + accessToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GenerateEphemeralCertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GenerateEphemeralCertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.GenerateEphemeralCertRequest.class, + com.google.cloud.sql.v1.GenerateEphemeralCertRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PUBLIC_KEY_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object publicKey_ = ""; + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @return The publicKey. + */ + @java.lang.Override + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @return The bytes for publicKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACCESS_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object accessToken_ = ""; + + /** + * + * + *
+   * Optional. Access token to include in the signed certificate.
+   * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The accessToken. + */ + @java.lang.Override + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Access token to include in the signed certificate.
+   * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for accessToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp readTime_; + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readTime field is set. + */ + @java.lang.Override + public boolean hasReadTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + + public static final int VALID_DURATION_FIELD_NUMBER = 12; + private com.google.protobuf.Duration validDuration_; + + /** + * + * + *
+   * Optional. If set, it will contain the cert valid duration.
+   * 
+ * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the validDuration field is set. + */ + @java.lang.Override + public boolean hasValidDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. If set, it will contain the cert valid duration.
+   * 
+ * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The validDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getValidDuration() { + return validDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validDuration_; + } + + /** + * + * + *
+   * Optional. If set, it will contain the cert valid duration.
+   * 
+ * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getValidDurationOrBuilder() { + return validDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validDuration_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(publicKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, publicKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(accessToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, accessToken_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(7, getReadTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(12, getValidDuration()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(publicKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, publicKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(accessToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, accessToken_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getReadTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getValidDuration()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.GenerateEphemeralCertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.GenerateEphemeralCertRequest other = + (com.google.cloud.sql.v1.GenerateEphemeralCertRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getPublicKey().equals(other.getPublicKey())) return false; + if (!getAccessToken().equals(other.getAccessToken())) return false; + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (hasValidDuration() != other.hasValidDuration()) return false; + if (hasValidDuration()) { + if (!getValidDuration().equals(other.getValidDuration())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getPublicKey().hashCode(); + hash = (37 * hash) + ACCESS_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAccessToken().hashCode(); + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + if (hasValidDuration()) { + hash = (37 * hash) + VALID_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getValidDuration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.GenerateEphemeralCertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Ephemeral certificate creation request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.GenerateEphemeralCertRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.GenerateEphemeralCertRequest) + com.google.cloud.sql.v1.GenerateEphemeralCertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GenerateEphemeralCertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GenerateEphemeralCertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.GenerateEphemeralCertRequest.class, + com.google.cloud.sql.v1.GenerateEphemeralCertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.GenerateEphemeralCertRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetReadTimeFieldBuilder(); + internalGetValidDurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + publicKey_ = ""; + accessToken_ = ""; + readTime_ = null; + if (readTimeBuilder_ != null) { + readTimeBuilder_.dispose(); + readTimeBuilder_ = null; + } + validDuration_ = null; + if (validDurationBuilder_ != null) { + validDurationBuilder_.dispose(); + validDurationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GenerateEphemeralCertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GenerateEphemeralCertRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.GenerateEphemeralCertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.GenerateEphemeralCertRequest build() { + com.google.cloud.sql.v1.GenerateEphemeralCertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GenerateEphemeralCertRequest buildPartial() { + com.google.cloud.sql.v1.GenerateEphemeralCertRequest result = + new com.google.cloud.sql.v1.GenerateEphemeralCertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.GenerateEphemeralCertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.publicKey_ = publicKey_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.accessToken_ = accessToken_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.readTime_ = readTimeBuilder_ == null ? readTime_ : readTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.validDuration_ = + validDurationBuilder_ == null ? validDuration_ : validDurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.GenerateEphemeralCertRequest) { + return mergeFrom((com.google.cloud.sql.v1.GenerateEphemeralCertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.GenerateEphemeralCertRequest other) { + if (other == com.google.cloud.sql.v1.GenerateEphemeralCertRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPublicKey().isEmpty()) { + publicKey_ = other.publicKey_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getAccessToken().isEmpty()) { + accessToken_ = other.accessToken_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (other.hasValidDuration()) { + mergeValidDuration(other.getValidDuration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + publicKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + accessToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 58: + { + input.readMessage( + internalGetReadTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 58 + case 98: + { + input.readMessage( + internalGetValidDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 98 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object publicKey_ = ""; + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @return The publicKey. + */ + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @return The bytes for publicKey. + */ + public com.google.protobuf.ByteString getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @param value The publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + publicKey_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @return This builder for chaining. + */ + public Builder clearPublicKey() { + publicKey_ = getDefaultInstance().getPublicKey(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @param value The bytes for publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + publicKey_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object accessToken_ = ""; + + /** + * + * + *
+     * Optional. Access token to include in the signed certificate.
+     * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The accessToken. + */ + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Access token to include in the signed certificate.
+     * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for accessToken. + */ + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Access token to include in the signed certificate.
+     * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The accessToken to set. + * @return This builder for chaining. + */ + public Builder setAccessToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + accessToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Access token to include in the signed certificate.
+     * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearAccessToken() { + accessToken_ = getDefaultInstance().getAccessToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Access token to include in the signed certificate.
+     * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for accessToken to set. + * @return This builder for chaining. + */ + public Builder setAccessTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + accessToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + } else { + readTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && readTime_ != null + && readTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getReadTimeBuilder().mergeFrom(value); + } else { + readTime_ = value; + } + } else { + readTimeBuilder_.mergeFrom(value); + } + if (readTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearReadTime() { + bitField0_ = (bitField0_ & ~0x00000010); + readTime_ = null; + if (readTimeBuilder_ != null) { + readTimeBuilder_.dispose(); + readTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetReadTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private com.google.protobuf.Duration validDuration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + validDurationBuilder_; + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the validDuration field is set. + */ + public boolean hasValidDuration() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The validDuration. + */ + public com.google.protobuf.Duration getValidDuration() { + if (validDurationBuilder_ == null) { + return validDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validDuration_; + } else { + return validDurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setValidDuration(com.google.protobuf.Duration value) { + if (validDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + validDuration_ = value; + } else { + validDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setValidDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (validDurationBuilder_ == null) { + validDuration_ = builderForValue.build(); + } else { + validDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeValidDuration(com.google.protobuf.Duration value) { + if (validDurationBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && validDuration_ != null + && validDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getValidDurationBuilder().mergeFrom(value); + } else { + validDuration_ = value; + } + } else { + validDurationBuilder_.mergeFrom(value); + } + if (validDuration_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearValidDuration() { + bitField0_ = (bitField0_ & ~0x00000020); + validDuration_ = null; + if (validDurationBuilder_ != null) { + validDurationBuilder_.dispose(); + validDurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Duration.Builder getValidDurationBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetValidDurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.DurationOrBuilder getValidDurationOrBuilder() { + if (validDurationBuilder_ != null) { + return validDurationBuilder_.getMessageOrBuilder(); + } else { + return validDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validDuration_; + } + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetValidDurationFieldBuilder() { + if (validDurationBuilder_ == null) { + validDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getValidDuration(), getParentForChildren(), isClean()); + validDuration_ = null; + } + return validDurationBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.GenerateEphemeralCertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.GenerateEphemeralCertRequest) + private static final com.google.cloud.sql.v1.GenerateEphemeralCertRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.GenerateEphemeralCertRequest(); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateEphemeralCertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GenerateEphemeralCertRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GenerateEphemeralCertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GenerateEphemeralCertRequestOrBuilder.java new file mode 100644 index 000000000000..62de35060e50 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GenerateEphemeralCertRequestOrBuilder.java @@ -0,0 +1,219 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface GenerateEphemeralCertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.GenerateEphemeralCertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @return The publicKey. + */ + java.lang.String getPublicKey(); + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @return The bytes for publicKey. + */ + com.google.protobuf.ByteString getPublicKeyBytes(); + + /** + * + * + *
+   * Optional. Access token to include in the signed certificate.
+   * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The accessToken. + */ + java.lang.String getAccessToken(); + + /** + * + * + *
+   * Optional. Access token to include in the signed certificate.
+   * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for accessToken. + */ + com.google.protobuf.ByteString getAccessTokenBytes(); + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Optional. If set, it will contain the cert valid duration.
+   * 
+ * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the validDuration field is set. + */ + boolean hasValidDuration(); + + /** + * + * + *
+   * Optional. If set, it will contain the cert valid duration.
+   * 
+ * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The validDuration. + */ + com.google.protobuf.Duration getValidDuration(); + + /** + * + * + *
+   * Optional. If set, it will contain the cert valid duration.
+   * 
+ * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.DurationOrBuilder getValidDurationOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GenerateEphemeralCertResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GenerateEphemeralCertResponse.java new file mode 100644 index 000000000000..486cc04d97cd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GenerateEphemeralCertResponse.java @@ -0,0 +1,700 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Ephemeral certificate creation request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.GenerateEphemeralCertResponse} + */ +@com.google.protobuf.Generated +public final class GenerateEphemeralCertResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.GenerateEphemeralCertResponse) + GenerateEphemeralCertResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GenerateEphemeralCertResponse"); + } + + // Use GenerateEphemeralCertResponse.newBuilder() to construct. + private GenerateEphemeralCertResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GenerateEphemeralCertResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GenerateEphemeralCertResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GenerateEphemeralCertResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.GenerateEphemeralCertResponse.class, + com.google.cloud.sql.v1.GenerateEphemeralCertResponse.Builder.class); + } + + private int bitField0_; + public static final int EPHEMERAL_CERT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.SslCert ephemeralCert_; + + /** + * + * + *
+   * Generated cert
+   * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + * + * @return Whether the ephemeralCert field is set. + */ + @java.lang.Override + public boolean hasEphemeralCert() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Generated cert
+   * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + * + * @return The ephemeralCert. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCert getEphemeralCert() { + return ephemeralCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : ephemeralCert_; + } + + /** + * + * + *
+   * Generated cert
+   * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertOrBuilder getEphemeralCertOrBuilder() { + return ephemeralCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : ephemeralCert_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getEphemeralCert()); + } + 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, getEphemeralCert()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.GenerateEphemeralCertResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.GenerateEphemeralCertResponse other = + (com.google.cloud.sql.v1.GenerateEphemeralCertResponse) obj; + + if (hasEphemeralCert() != other.hasEphemeralCert()) return false; + if (hasEphemeralCert()) { + if (!getEphemeralCert().equals(other.getEphemeralCert())) return false; + } + if (!getUnknownFields().equals(other.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 (hasEphemeralCert()) { + hash = (37 * hash) + EPHEMERAL_CERT_FIELD_NUMBER; + hash = (53 * hash) + getEphemeralCert().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.GenerateEphemeralCertResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Ephemeral certificate creation request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.GenerateEphemeralCertResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.GenerateEphemeralCertResponse) + com.google.cloud.sql.v1.GenerateEphemeralCertResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GenerateEphemeralCertResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GenerateEphemeralCertResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.GenerateEphemeralCertResponse.class, + com.google.cloud.sql.v1.GenerateEphemeralCertResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.GenerateEphemeralCertResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEphemeralCertFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + ephemeralCert_ = null; + if (ephemeralCertBuilder_ != null) { + ephemeralCertBuilder_.dispose(); + ephemeralCertBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GenerateEphemeralCertResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GenerateEphemeralCertResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1.GenerateEphemeralCertResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.GenerateEphemeralCertResponse build() { + com.google.cloud.sql.v1.GenerateEphemeralCertResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GenerateEphemeralCertResponse buildPartial() { + com.google.cloud.sql.v1.GenerateEphemeralCertResponse result = + new com.google.cloud.sql.v1.GenerateEphemeralCertResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.GenerateEphemeralCertResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ephemeralCert_ = + ephemeralCertBuilder_ == null ? ephemeralCert_ : ephemeralCertBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.GenerateEphemeralCertResponse) { + return mergeFrom((com.google.cloud.sql.v1.GenerateEphemeralCertResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.GenerateEphemeralCertResponse other) { + if (other == com.google.cloud.sql.v1.GenerateEphemeralCertResponse.getDefaultInstance()) + return this; + if (other.hasEphemeralCert()) { + mergeEphemeralCert(other.getEphemeralCert()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetEphemeralCertFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.SslCert ephemeralCert_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + ephemeralCertBuilder_; + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + * + * @return Whether the ephemeralCert field is set. + */ + public boolean hasEphemeralCert() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + * + * @return The ephemeralCert. + */ + public com.google.cloud.sql.v1.SslCert getEphemeralCert() { + if (ephemeralCertBuilder_ == null) { + return ephemeralCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : ephemeralCert_; + } else { + return ephemeralCertBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + */ + public Builder setEphemeralCert(com.google.cloud.sql.v1.SslCert value) { + if (ephemeralCertBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ephemeralCert_ = value; + } else { + ephemeralCertBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + */ + public Builder setEphemeralCert(com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (ephemeralCertBuilder_ == null) { + ephemeralCert_ = builderForValue.build(); + } else { + ephemeralCertBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + */ + public Builder mergeEphemeralCert(com.google.cloud.sql.v1.SslCert value) { + if (ephemeralCertBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && ephemeralCert_ != null + && ephemeralCert_ != com.google.cloud.sql.v1.SslCert.getDefaultInstance()) { + getEphemeralCertBuilder().mergeFrom(value); + } else { + ephemeralCert_ = value; + } + } else { + ephemeralCertBuilder_.mergeFrom(value); + } + if (ephemeralCert_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + */ + public Builder clearEphemeralCert() { + bitField0_ = (bitField0_ & ~0x00000001); + ephemeralCert_ = null; + if (ephemeralCertBuilder_ != null) { + ephemeralCertBuilder_.dispose(); + ephemeralCertBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + */ + public com.google.cloud.sql.v1.SslCert.Builder getEphemeralCertBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetEphemeralCertFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + */ + public com.google.cloud.sql.v1.SslCertOrBuilder getEphemeralCertOrBuilder() { + if (ephemeralCertBuilder_ != null) { + return ephemeralCertBuilder_.getMessageOrBuilder(); + } else { + return ephemeralCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : ephemeralCert_; + } + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + internalGetEphemeralCertFieldBuilder() { + if (ephemeralCertBuilder_ == null) { + ephemeralCertBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder>( + getEphemeralCert(), getParentForChildren(), isClean()); + ephemeralCert_ = null; + } + return ephemeralCertBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.GenerateEphemeralCertResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.GenerateEphemeralCertResponse) + private static final com.google.cloud.sql.v1.GenerateEphemeralCertResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.GenerateEphemeralCertResponse(); + } + + public static com.google.cloud.sql.v1.GenerateEphemeralCertResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateEphemeralCertResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GenerateEphemeralCertResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GenerateEphemeralCertResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GenerateEphemeralCertResponseOrBuilder.java new file mode 100644 index 000000000000..901cccf671c3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GenerateEphemeralCertResponseOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface GenerateEphemeralCertResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.GenerateEphemeralCertResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Generated cert
+   * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + * + * @return Whether the ephemeralCert field is set. + */ + boolean hasEphemeralCert(); + + /** + * + * + *
+   * Generated cert
+   * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + * + * @return The ephemeralCert. + */ + com.google.cloud.sql.v1.SslCert getEphemeralCert(); + + /** + * + * + *
+   * Generated cert
+   * 
+ * + * .google.cloud.sql.v1.SslCert ephemeral_cert = 1; + */ + com.google.cloud.sql.v1.SslCertOrBuilder getEphemeralCertOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GetBackupRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GetBackupRequest.java new file mode 100644 index 000000000000..fc99bad2ffd1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GetBackupRequest.java @@ -0,0 +1,615 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The request payload to get the backup.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.GetBackupRequest} + */ +@com.google.protobuf.Generated +public final class GetBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.GetBackupRequest) + GetBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetBackupRequest"); + } + + // Use GetBackupRequest.newBuilder() to construct. + private GetBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetBackupRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.GetBackupRequest.class, + com.google.cloud.sql.v1.GetBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The name of the backup to retrieve.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * 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 backup to retrieve.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.sql.v1.GetBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.GetBackupRequest other = (com.google.cloud.sql.v1.GetBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.GetBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GetBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GetBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GetBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GetBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GetBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GetBackupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GetBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GetBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GetBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GetBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GetBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.GetBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request payload to get the backup.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.GetBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.GetBackupRequest) + com.google.cloud.sql.v1.GetBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.GetBackupRequest.class, + com.google.cloud.sql.v1.GetBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.GetBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GetBackupRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.GetBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.GetBackupRequest build() { + com.google.cloud.sql.v1.GetBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GetBackupRequest buildPartial() { + com.google.cloud.sql.v1.GetBackupRequest result = + new com.google.cloud.sql.v1.GetBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.GetBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.GetBackupRequest) { + return mergeFrom((com.google.cloud.sql.v1.GetBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.GetBackupRequest other) { + if (other == com.google.cloud.sql.v1.GetBackupRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The name of the backup to retrieve.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to retrieve.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to retrieve.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to retrieve.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to retrieve.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.GetBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.GetBackupRequest) + private static final com.google.cloud.sql.v1.GetBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.GetBackupRequest(); + } + + public static com.google.cloud.sql.v1.GetBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GetBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GetBackupRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GetBackupRequestOrBuilder.java new file mode 100644 index 000000000000..f9fc70ba0344 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GetBackupRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface GetBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.GetBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the backup to retrieve.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The name of the backup to retrieve.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * 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-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GetConnectSettingsRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GetConnectSettingsRequest.java new file mode 100644 index 000000000000..2fae886cca8d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GetConnectSettingsRequest.java @@ -0,0 +1,1093 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Connect settings retrieval request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.GetConnectSettingsRequest} + */ +@com.google.protobuf.Generated +public final class GetConnectSettingsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.GetConnectSettingsRequest) + GetConnectSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetConnectSettingsRequest"); + } + + // Use GetConnectSettingsRequest.newBuilder() to construct. + private GetConnectSettingsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetConnectSettingsRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GetConnectSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GetConnectSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.GetConnectSettingsRequest.class, + com.google.cloud.sql.v1.GetConnectSettingsRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp readTime_; + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readTime field is set. + */ + @java.lang.Override + public boolean hasReadTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(7, getReadTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getReadTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.GetConnectSettingsRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.GetConnectSettingsRequest other = + (com.google.cloud.sql.v1.GetConnectSettingsRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.GetConnectSettingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GetConnectSettingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GetConnectSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GetConnectSettingsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GetConnectSettingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.GetConnectSettingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GetConnectSettingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GetConnectSettingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GetConnectSettingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GetConnectSettingsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.GetConnectSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.GetConnectSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.GetConnectSettingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Connect settings retrieval request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.GetConnectSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.GetConnectSettingsRequest) + com.google.cloud.sql.v1.GetConnectSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GetConnectSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GetConnectSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.GetConnectSettingsRequest.class, + com.google.cloud.sql.v1.GetConnectSettingsRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.GetConnectSettingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetReadTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + readTime_ = null; + if (readTimeBuilder_ != null) { + readTimeBuilder_.dispose(); + readTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_GetConnectSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GetConnectSettingsRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.GetConnectSettingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.GetConnectSettingsRequest build() { + com.google.cloud.sql.v1.GetConnectSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GetConnectSettingsRequest buildPartial() { + com.google.cloud.sql.v1.GetConnectSettingsRequest result = + new com.google.cloud.sql.v1.GetConnectSettingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.GetConnectSettingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.readTime_ = readTimeBuilder_ == null ? readTime_ : readTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.GetConnectSettingsRequest) { + return mergeFrom((com.google.cloud.sql.v1.GetConnectSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.GetConnectSettingsRequest other) { + if (other == com.google.cloud.sql.v1.GetConnectSettingsRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 58: + { + input.readMessage( + internalGetReadTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + } else { + readTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && readTime_ != null + && readTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getReadTimeBuilder().mergeFrom(value); + } else { + readTime_ = value; + } + } else { + readTimeBuilder_.mergeFrom(value); + } + if (readTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearReadTime() { + bitField0_ = (bitField0_ & ~0x00000004); + readTime_ = null; + if (readTimeBuilder_ != null) { + readTimeBuilder_.dispose(); + readTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetReadTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.GetConnectSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.GetConnectSettingsRequest) + private static final com.google.cloud.sql.v1.GetConnectSettingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.GetConnectSettingsRequest(); + } + + public static com.google.cloud.sql.v1.GetConnectSettingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetConnectSettingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.GetConnectSettingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GetConnectSettingsRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GetConnectSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..cc5272c78cb8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/GetConnectSettingsRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface GetConnectSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.GetConnectSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ImportContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ImportContext.java new file mode 100644 index 000000000000..62687d3d6687 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ImportContext.java @@ -0,0 +1,12196 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance import context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ImportContext} + */ +@com.google.protobuf.Generated +public final class ImportContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ImportContext) + ImportContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ImportContext"); + } + + // Use ImportContext.newBuilder() to construct. + private ImportContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ImportContext() { + uri_ = ""; + database_ = ""; + kind_ = ""; + fileType_ = 0; + importUser_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ImportContext.class, + com.google.cloud.sql.v1.ImportContext.Builder.class); + } + + public interface SqlImportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ImportContext.SqlImportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. The number of threads to use for parallel import.
+     * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the threads field is set. + */ + boolean hasThreads(); + + /** + * + * + *
+     * Optional. The number of threads to use for parallel import.
+     * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The threads. + */ + com.google.protobuf.Int32Value getThreads(); + + /** + * + * + *
+     * Optional. The number of threads to use for parallel import.
+     * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.Int32ValueOrBuilder getThreadsOrBuilder(); + + /** + * + * + *
+     * Optional. Whether or not the import should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parallel field is set. + */ + boolean hasParallel(); + + /** + * + * + *
+     * Optional. Whether or not the import should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parallel. + */ + com.google.protobuf.BoolValue getParallel(); + + /** + * + * + *
+     * Optional. Whether or not the import should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getParallelOrBuilder(); + + /** + * + * + *
+     * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the postgresImportOptions field is set. + */ + boolean hasPostgresImportOptions(); + + /** + * + * + *
+     * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The postgresImportOptions. + */ + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + getPostgresImportOptions(); + + /** + * + * + *
+     * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptionsOrBuilder + getPostgresImportOptionsOrBuilder(); + } + + /** Protobuf type {@code google.cloud.sql.v1.ImportContext.SqlImportOptions} */ + public static final class SqlImportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ImportContext.SqlImportOptions) + SqlImportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlImportOptions"); + } + + // Use SqlImportOptions.newBuilder() to construct. + private SqlImportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlImportOptions() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.class, + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.Builder.class); + } + + public interface PostgresImportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Optional. The --clean flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clean field is set. + */ + boolean hasClean(); + + /** + * + * + *
+       * Optional. The --clean flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clean. + */ + com.google.protobuf.BoolValue getClean(); + + /** + * + * + *
+       * Optional. The --clean flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getCleanOrBuilder(); + + /** + * + * + *
+       * Optional. The --if-exists flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the ifExists field is set. + */ + boolean hasIfExists(); + + /** + * + * + *
+       * Optional. The --if-exists flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The ifExists. + */ + com.google.protobuf.BoolValue getIfExists(); + + /** + * + * + *
+       * Optional. The --if-exists flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getIfExistsOrBuilder(); + } + + /** + * Protobuf type {@code + * google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions} + */ + public static final class PostgresImportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions) + PostgresImportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PostgresImportOptions"); + } + + // Use PostgresImportOptions.newBuilder() to construct. + private PostgresImportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PostgresImportOptions() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_PostgresImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_PostgresImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.class, + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.Builder + .class); + } + + private int bitField0_; + public static final int CLEAN_FIELD_NUMBER = 1; + private com.google.protobuf.BoolValue clean_; + + /** + * + * + *
+       * Optional. The --clean flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clean field is set. + */ + @java.lang.Override + public boolean hasClean() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Optional. The --clean flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clean. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getClean() { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } + + /** + * + * + *
+       * Optional. The --clean flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getCleanOrBuilder() { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } + + public static final int IF_EXISTS_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue ifExists_; + + /** + * + * + *
+       * Optional. The --if-exists flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the ifExists field is set. + */ + @java.lang.Override + public boolean hasIfExists() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Optional. The --if-exists flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The ifExists. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getIfExists() { + return ifExists_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : ifExists_; + } + + /** + * + * + *
+       * Optional. The --if-exists flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getIfExistsOrBuilder() { + return ifExists_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : ifExists_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getClean()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getIfExists()); + } + 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, getClean()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getIfExists()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions other = + (com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions) obj; + + if (hasClean() != other.hasClean()) return false; + if (hasClean()) { + if (!getClean().equals(other.getClean())) return false; + } + if (hasIfExists() != other.hasIfExists()) return false; + if (hasIfExists()) { + if (!getIfExists().equals(other.getIfExists())) return false; + } + if (!getUnknownFields().equals(other.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 (hasClean()) { + hash = (37 * hash) + CLEAN_FIELD_NUMBER; + hash = (53 * hash) + getClean().hashCode(); + } + if (hasIfExists()) { + hash = (37 * hash) + IF_EXISTS_FIELD_NUMBER; + hash = (53 * hash) + getIfExists().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code + * google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions) + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_PostgresImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_PostgresImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + .class, + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + .Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCleanFieldBuilder(); + internalGetIfExistsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + clean_ = null; + if (cleanBuilder_ != null) { + cleanBuilder_.dispose(); + cleanBuilder_ = null; + } + ifExists_ = null; + if (ifExistsBuilder_ != null) { + ifExistsBuilder_.dispose(); + ifExistsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_PostgresImportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + build() { + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + buildPartial() { + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions result = + new com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.clean_ = cleanBuilder_ == null ? clean_ : cleanBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ifExists_ = ifExistsBuilder_ == null ? ifExists_ : ifExistsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions) { + return mergeFrom( + (com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions other) { + if (other + == com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + .getDefaultInstance()) return this; + if (other.hasClean()) { + mergeClean(other.getClean()); + } + if (other.hasIfExists()) { + mergeIfExists(other.getIfExists()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetCleanFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetIfExistsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.BoolValue clean_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + cleanBuilder_; + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clean field is set. + */ + public boolean hasClean() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clean. + */ + public com.google.protobuf.BoolValue getClean() { + if (cleanBuilder_ == null) { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } else { + return cleanBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setClean(com.google.protobuf.BoolValue value) { + if (cleanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clean_ = value; + } else { + cleanBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setClean(com.google.protobuf.BoolValue.Builder builderForValue) { + if (cleanBuilder_ == null) { + clean_ = builderForValue.build(); + } else { + cleanBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeClean(com.google.protobuf.BoolValue value) { + if (cleanBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && clean_ != null + && clean_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getCleanBuilder().mergeFrom(value); + } else { + clean_ = value; + } + } else { + cleanBuilder_.mergeFrom(value); + } + if (clean_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearClean() { + bitField0_ = (bitField0_ & ~0x00000001); + clean_ = null; + if (cleanBuilder_ != null) { + cleanBuilder_.dispose(); + cleanBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getCleanBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetCleanFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getCleanOrBuilder() { + if (cleanBuilder_ != null) { + return cleanBuilder_.getMessageOrBuilder(); + } else { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetCleanFieldBuilder() { + if (cleanBuilder_ == null) { + cleanBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getClean(), getParentForChildren(), isClean()); + clean_ = null; + } + return cleanBuilder_; + } + + private com.google.protobuf.BoolValue ifExists_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + ifExistsBuilder_; + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the ifExists field is set. + */ + public boolean hasIfExists() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The ifExists. + */ + public com.google.protobuf.BoolValue getIfExists() { + if (ifExistsBuilder_ == null) { + return ifExists_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : ifExists_; + } else { + return ifExistsBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setIfExists(com.google.protobuf.BoolValue value) { + if (ifExistsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ifExists_ = value; + } else { + ifExistsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setIfExists(com.google.protobuf.BoolValue.Builder builderForValue) { + if (ifExistsBuilder_ == null) { + ifExists_ = builderForValue.build(); + } else { + ifExistsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeIfExists(com.google.protobuf.BoolValue value) { + if (ifExistsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && ifExists_ != null + && ifExists_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getIfExistsBuilder().mergeFrom(value); + } else { + ifExists_ = value; + } + } else { + ifExistsBuilder_.mergeFrom(value); + } + if (ifExists_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearIfExists() { + bitField0_ = (bitField0_ & ~0x00000002); + ifExists_ = null; + if (ifExistsBuilder_ != null) { + ifExistsBuilder_.dispose(); + ifExistsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getIfExistsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetIfExistsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getIfExistsOrBuilder() { + if (ifExistsBuilder_ != null) { + return ifExistsBuilder_.getMessageOrBuilder(); + } else { + return ifExists_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : ifExists_; + } + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetIfExistsFieldBuilder() { + if (ifExistsBuilder_ == null) { + ifExistsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getIfExists(), getParentForChildren(), isClean()); + ifExists_ = null; + } + return ifExistsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions) + private static final com.google.cloud.sql.v1.ImportContext.SqlImportOptions + .PostgresImportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions(); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PostgresImportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int THREADS_FIELD_NUMBER = 1; + private com.google.protobuf.Int32Value threads_; + + /** + * + * + *
+     * Optional. The number of threads to use for parallel import.
+     * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the threads field is set. + */ + @java.lang.Override + public boolean hasThreads() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. The number of threads to use for parallel import.
+     * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The threads. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getThreads() { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } + + /** + * + * + *
+     * Optional. The number of threads to use for parallel import.
+     * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getThreadsOrBuilder() { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } + + public static final int PARALLEL_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue parallel_; + + /** + * + * + *
+     * Optional. Whether or not the import should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parallel field is set. + */ + @java.lang.Override + public boolean hasParallel() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. Whether or not the import should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parallel. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getParallel() { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } + + /** + * + * + *
+     * Optional. Whether or not the import should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getParallelOrBuilder() { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } + + public static final int POSTGRES_IMPORT_OPTIONS_FIELD_NUMBER = 3; + private com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + postgresImportOptions_; + + /** + * + * + *
+     * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the postgresImportOptions field is set. + */ + @java.lang.Override + public boolean hasPostgresImportOptions() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The postgresImportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + getPostgresImportOptions() { + return postgresImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + .getDefaultInstance() + : postgresImportOptions_; + } + + /** + * + * + *
+     * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptionsOrBuilder + getPostgresImportOptionsOrBuilder() { + return postgresImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + .getDefaultInstance() + : postgresImportOptions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getThreads()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getParallel()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getPostgresImportOptions()); + } + 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, getThreads()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getParallel()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPostgresImportOptions()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ImportContext.SqlImportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ImportContext.SqlImportOptions other = + (com.google.cloud.sql.v1.ImportContext.SqlImportOptions) obj; + + if (hasThreads() != other.hasThreads()) return false; + if (hasThreads()) { + if (!getThreads().equals(other.getThreads())) return false; + } + if (hasParallel() != other.hasParallel()) return false; + if (hasParallel()) { + if (!getParallel().equals(other.getParallel())) return false; + } + if (hasPostgresImportOptions() != other.hasPostgresImportOptions()) return false; + if (hasPostgresImportOptions()) { + if (!getPostgresImportOptions().equals(other.getPostgresImportOptions())) return false; + } + if (!getUnknownFields().equals(other.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 (hasThreads()) { + hash = (37 * hash) + THREADS_FIELD_NUMBER; + hash = (53 * hash) + getThreads().hashCode(); + } + if (hasParallel()) { + hash = (37 * hash) + PARALLEL_FIELD_NUMBER; + hash = (53 * hash) + getParallel().hashCode(); + } + if (hasPostgresImportOptions()) { + hash = (37 * hash) + POSTGRES_IMPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPostgresImportOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ImportContext.SqlImportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.ImportContext.SqlImportOptions} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ImportContext.SqlImportOptions) + com.google.cloud.sql.v1.ImportContext.SqlImportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.class, + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ImportContext.SqlImportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetThreadsFieldBuilder(); + internalGetParallelFieldBuilder(); + internalGetPostgresImportOptionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + threads_ = null; + if (threadsBuilder_ != null) { + threadsBuilder_.dispose(); + threadsBuilder_ = null; + } + parallel_ = null; + if (parallelBuilder_ != null) { + parallelBuilder_.dispose(); + parallelBuilder_ = null; + } + postgresImportOptions_ = null; + if (postgresImportOptionsBuilder_ != null) { + postgresImportOptionsBuilder_.dispose(); + postgresImportOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlImportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ImportContext.SqlImportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions build() { + com.google.cloud.sql.v1.ImportContext.SqlImportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions buildPartial() { + com.google.cloud.sql.v1.ImportContext.SqlImportOptions result = + new com.google.cloud.sql.v1.ImportContext.SqlImportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ImportContext.SqlImportOptions result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.threads_ = threadsBuilder_ == null ? threads_ : threadsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.parallel_ = parallelBuilder_ == null ? parallel_ : parallelBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.postgresImportOptions_ = + postgresImportOptionsBuilder_ == null + ? postgresImportOptions_ + : postgresImportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ImportContext.SqlImportOptions) { + return mergeFrom((com.google.cloud.sql.v1.ImportContext.SqlImportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ImportContext.SqlImportOptions other) { + if (other == com.google.cloud.sql.v1.ImportContext.SqlImportOptions.getDefaultInstance()) + return this; + if (other.hasThreads()) { + mergeThreads(other.getThreads()); + } + if (other.hasParallel()) { + mergeParallel(other.getParallel()); + } + if (other.hasPostgresImportOptions()) { + mergePostgresImportOptions(other.getPostgresImportOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetThreadsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetParallelFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetPostgresImportOptionsFieldBuilder().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 com.google.protobuf.Int32Value threads_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + threadsBuilder_; + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the threads field is set. + */ + public boolean hasThreads() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The threads. + */ + public com.google.protobuf.Int32Value getThreads() { + if (threadsBuilder_ == null) { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } else { + return threadsBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setThreads(com.google.protobuf.Int32Value value) { + if (threadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + threads_ = value; + } else { + threadsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setThreads(com.google.protobuf.Int32Value.Builder builderForValue) { + if (threadsBuilder_ == null) { + threads_ = builderForValue.build(); + } else { + threadsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeThreads(com.google.protobuf.Int32Value value) { + if (threadsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && threads_ != null + && threads_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getThreadsBuilder().mergeFrom(value); + } else { + threads_ = value; + } + } else { + threadsBuilder_.mergeFrom(value); + } + if (threads_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearThreads() { + bitField0_ = (bitField0_ & ~0x00000001); + threads_ = null; + if (threadsBuilder_ != null) { + threadsBuilder_.dispose(); + threadsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Int32Value.Builder getThreadsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetThreadsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Int32ValueOrBuilder getThreadsOrBuilder() { + if (threadsBuilder_ != null) { + return threadsBuilder_.getMessageOrBuilder(); + } else { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetThreadsFieldBuilder() { + if (threadsBuilder_ == null) { + threadsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getThreads(), getParentForChildren(), isClean()); + threads_ = null; + } + return threadsBuilder_; + } + + private com.google.protobuf.BoolValue parallel_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + parallelBuilder_; + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parallel field is set. + */ + public boolean hasParallel() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parallel. + */ + public com.google.protobuf.BoolValue getParallel() { + if (parallelBuilder_ == null) { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } else { + return parallelBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setParallel(com.google.protobuf.BoolValue value) { + if (parallelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parallel_ = value; + } else { + parallelBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setParallel(com.google.protobuf.BoolValue.Builder builderForValue) { + if (parallelBuilder_ == null) { + parallel_ = builderForValue.build(); + } else { + parallelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeParallel(com.google.protobuf.BoolValue value) { + if (parallelBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && parallel_ != null + && parallel_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getParallelBuilder().mergeFrom(value); + } else { + parallel_ = value; + } + } else { + parallelBuilder_.mergeFrom(value); + } + if (parallel_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearParallel() { + bitField0_ = (bitField0_ & ~0x00000002); + parallel_ = null; + if (parallelBuilder_ != null) { + parallelBuilder_.dispose(); + parallelBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getParallelBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetParallelFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getParallelOrBuilder() { + if (parallelBuilder_ != null) { + return parallelBuilder_.getMessageOrBuilder(); + } else { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetParallelFieldBuilder() { + if (parallelBuilder_ == null) { + parallelBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getParallel(), getParentForChildren(), isClean()); + parallel_ = null; + } + return parallelBuilder_; + } + + private com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + postgresImportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptionsOrBuilder> + postgresImportOptionsBuilder_; + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the postgresImportOptions field is set. + */ + public boolean hasPostgresImportOptions() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The postgresImportOptions. + */ + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + getPostgresImportOptions() { + if (postgresImportOptionsBuilder_ == null) { + return postgresImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + .getDefaultInstance() + : postgresImportOptions_; + } else { + return postgresImportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPostgresImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions value) { + if (postgresImportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + postgresImportOptions_ = value; + } else { + postgresImportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPostgresImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.Builder + builderForValue) { + if (postgresImportOptionsBuilder_ == null) { + postgresImportOptions_ = builderForValue.build(); + } else { + postgresImportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergePostgresImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions value) { + if (postgresImportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && postgresImportOptions_ != null + && postgresImportOptions_ + != com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + .getDefaultInstance()) { + getPostgresImportOptionsBuilder().mergeFrom(value); + } else { + postgresImportOptions_ = value; + } + } else { + postgresImportOptionsBuilder_.mergeFrom(value); + } + if (postgresImportOptions_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPostgresImportOptions() { + bitField0_ = (bitField0_ & ~0x00000004); + postgresImportOptions_ = null; + if (postgresImportOptionsBuilder_ != null) { + postgresImportOptionsBuilder_.dispose(); + postgresImportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.Builder + getPostgresImportOptionsBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetPostgresImportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptionsOrBuilder + getPostgresImportOptionsOrBuilder() { + if (postgresImportOptionsBuilder_ != null) { + return postgresImportOptionsBuilder_.getMessageOrBuilder(); + } else { + return postgresImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + .getDefaultInstance() + : postgresImportOptions_; + } + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptionsOrBuilder> + internalGetPostgresImportOptionsFieldBuilder() { + if (postgresImportOptionsBuilder_ == null) { + postgresImportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions + .Builder, + com.google.cloud.sql.v1.ImportContext.SqlImportOptions + .PostgresImportOptionsOrBuilder>( + getPostgresImportOptions(), getParentForChildren(), isClean()); + postgresImportOptions_ = null; + } + return postgresImportOptionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ImportContext.SqlImportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ImportContext.SqlImportOptions) + private static final com.google.cloud.sql.v1.ImportContext.SqlImportOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ImportContext.SqlImportOptions(); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlImportOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlImportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlCsvImportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ImportContext.SqlCsvImportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The table to which CSV data is imported.
+     * 
+ * + * string table = 1; + * + * @return The table. + */ + java.lang.String getTable(); + + /** + * + * + *
+     * The table to which CSV data is imported.
+     * 
+ * + * string table = 1; + * + * @return The bytes for table. + */ + com.google.protobuf.ByteString getTableBytes(); + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @return A list containing the columns. + */ + java.util.List getColumnsList(); + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @return The count of columns. + */ + int getColumnsCount(); + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @param index The index of the element to return. + * @return The columns at the given index. + */ + java.lang.String getColumns(int index); + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @param index The index of the value to return. + * @return The bytes of the columns at the given index. + */ + com.google.protobuf.ByteString getColumnsBytes(int index); + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 4; + * + * @return The escapeCharacter. + */ + java.lang.String getEscapeCharacter(); + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 4; + * + * @return The bytes for escapeCharacter. + */ + com.google.protobuf.ByteString getEscapeCharacterBytes(); + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 5; + * + * @return The quoteCharacter. + */ + java.lang.String getQuoteCharacter(); + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 5; + * + * @return The bytes for quoteCharacter. + */ + com.google.protobuf.ByteString getQuoteCharacterBytes(); + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 6; + * + * @return The fieldsTerminatedBy. + */ + java.lang.String getFieldsTerminatedBy(); + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 6; + * + * @return The bytes for fieldsTerminatedBy. + */ + com.google.protobuf.ByteString getFieldsTerminatedByBytes(); + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 8; + * + * @return The linesTerminatedBy. + */ + java.lang.String getLinesTerminatedBy(); + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 8; + * + * @return The bytes for linesTerminatedBy. + */ + com.google.protobuf.ByteString getLinesTerminatedByBytes(); + } + + /** Protobuf type {@code google.cloud.sql.v1.ImportContext.SqlCsvImportOptions} */ + public static final class SqlCsvImportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ImportContext.SqlCsvImportOptions) + SqlCsvImportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlCsvImportOptions"); + } + + // Use SqlCsvImportOptions.newBuilder() to construct. + private SqlCsvImportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlCsvImportOptions() { + table_ = ""; + columns_ = com.google.protobuf.LazyStringArrayList.emptyList(); + escapeCharacter_ = ""; + quoteCharacter_ = ""; + fieldsTerminatedBy_ = ""; + linesTerminatedBy_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlCsvImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlCsvImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.class, + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.Builder.class); + } + + public static final int TABLE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object table_ = ""; + + /** + * + * + *
+     * The table to which CSV data is imported.
+     * 
+ * + * string table = 1; + * + * @return The table. + */ + @java.lang.Override + public java.lang.String getTable() { + java.lang.Object ref = table_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + table_ = s; + return s; + } + } + + /** + * + * + *
+     * The table to which CSV data is imported.
+     * 
+ * + * string table = 1; + * + * @return The bytes for table. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableBytes() { + java.lang.Object ref = table_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + table_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLUMNS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList columns_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @return A list containing the columns. + */ + public com.google.protobuf.ProtocolStringList getColumnsList() { + return columns_; + } + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @return The count of columns. + */ + public int getColumnsCount() { + return columns_.size(); + } + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @param index The index of the element to return. + * @return The columns at the given index. + */ + public java.lang.String getColumns(int index) { + return columns_.get(index); + } + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @param index The index of the value to return. + * @return The bytes of the columns at the given index. + */ + public com.google.protobuf.ByteString getColumnsBytes(int index) { + return columns_.getByteString(index); + } + + public static final int ESCAPE_CHARACTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object escapeCharacter_ = ""; + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 4; + * + * @return The escapeCharacter. + */ + @java.lang.Override + public java.lang.String getEscapeCharacter() { + java.lang.Object ref = escapeCharacter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + escapeCharacter_ = s; + return s; + } + } + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 4; + * + * @return The bytes for escapeCharacter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEscapeCharacterBytes() { + java.lang.Object ref = escapeCharacter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + escapeCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTE_CHARACTER_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object quoteCharacter_ = ""; + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 5; + * + * @return The quoteCharacter. + */ + @java.lang.Override + public java.lang.String getQuoteCharacter() { + java.lang.Object ref = quoteCharacter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quoteCharacter_ = s; + return s; + } + } + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 5; + * + * @return The bytes for quoteCharacter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQuoteCharacterBytes() { + java.lang.Object ref = quoteCharacter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quoteCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIELDS_TERMINATED_BY_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object fieldsTerminatedBy_ = ""; + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 6; + * + * @return The fieldsTerminatedBy. + */ + @java.lang.Override + public java.lang.String getFieldsTerminatedBy() { + java.lang.Object ref = fieldsTerminatedBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldsTerminatedBy_ = s; + return s; + } + } + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 6; + * + * @return The bytes for fieldsTerminatedBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFieldsTerminatedByBytes() { + java.lang.Object ref = fieldsTerminatedBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldsTerminatedBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINES_TERMINATED_BY_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object linesTerminatedBy_ = ""; + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 8; + * + * @return The linesTerminatedBy. + */ + @java.lang.Override + public java.lang.String getLinesTerminatedBy() { + java.lang.Object ref = linesTerminatedBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + linesTerminatedBy_ = s; + return s; + } + } + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 8; + * + * @return The bytes for linesTerminatedBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLinesTerminatedByBytes() { + java.lang.Object ref = linesTerminatedBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + linesTerminatedBy_ = 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.GeneratedMessage.isStringEmpty(table_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, table_); + } + for (int i = 0; i < columns_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, columns_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(escapeCharacter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, escapeCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(quoteCharacter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, quoteCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fieldsTerminatedBy_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, fieldsTerminatedBy_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(linesTerminatedBy_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, linesTerminatedBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(table_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, table_); + } + { + int dataSize = 0; + for (int i = 0; i < columns_.size(); i++) { + dataSize += computeStringSizeNoTag(columns_.getRaw(i)); + } + size += dataSize; + size += 1 * getColumnsList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(escapeCharacter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, escapeCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(quoteCharacter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, quoteCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fieldsTerminatedBy_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, fieldsTerminatedBy_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(linesTerminatedBy_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, linesTerminatedBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions other = + (com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions) obj; + + if (!getTable().equals(other.getTable())) return false; + if (!getColumnsList().equals(other.getColumnsList())) return false; + if (!getEscapeCharacter().equals(other.getEscapeCharacter())) return false; + if (!getQuoteCharacter().equals(other.getQuoteCharacter())) return false; + if (!getFieldsTerminatedBy().equals(other.getFieldsTerminatedBy())) return false; + if (!getLinesTerminatedBy().equals(other.getLinesTerminatedBy())) return false; + if (!getUnknownFields().equals(other.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) + TABLE_FIELD_NUMBER; + hash = (53 * hash) + getTable().hashCode(); + if (getColumnsCount() > 0) { + hash = (37 * hash) + COLUMNS_FIELD_NUMBER; + hash = (53 * hash) + getColumnsList().hashCode(); + } + hash = (37 * hash) + ESCAPE_CHARACTER_FIELD_NUMBER; + hash = (53 * hash) + getEscapeCharacter().hashCode(); + hash = (37 * hash) + QUOTE_CHARACTER_FIELD_NUMBER; + hash = (53 * hash) + getQuoteCharacter().hashCode(); + hash = (37 * hash) + FIELDS_TERMINATED_BY_FIELD_NUMBER; + hash = (53 * hash) + getFieldsTerminatedBy().hashCode(); + hash = (37 * hash) + LINES_TERMINATED_BY_FIELD_NUMBER; + hash = (53 * hash) + getLinesTerminatedBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.ImportContext.SqlCsvImportOptions} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ImportContext.SqlCsvImportOptions) + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlCsvImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlCsvImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.class, + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + table_ = ""; + columns_ = com.google.protobuf.LazyStringArrayList.emptyList(); + escapeCharacter_ = ""; + quoteCharacter_ = ""; + fieldsTerminatedBy_ = ""; + linesTerminatedBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlCsvImportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions build() { + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions buildPartial() { + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions result = + new com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.table_ = table_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + columns_.makeImmutable(); + result.columns_ = columns_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.escapeCharacter_ = escapeCharacter_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.quoteCharacter_ = quoteCharacter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.fieldsTerminatedBy_ = fieldsTerminatedBy_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.linesTerminatedBy_ = linesTerminatedBy_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions) { + return mergeFrom((com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions other) { + if (other == com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.getDefaultInstance()) + return this; + if (!other.getTable().isEmpty()) { + table_ = other.table_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.columns_.isEmpty()) { + if (columns_.isEmpty()) { + columns_ = other.columns_; + bitField0_ |= 0x00000002; + } else { + ensureColumnsIsMutable(); + columns_.addAll(other.columns_); + } + onChanged(); + } + if (!other.getEscapeCharacter().isEmpty()) { + escapeCharacter_ = other.escapeCharacter_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getQuoteCharacter().isEmpty()) { + quoteCharacter_ = other.quoteCharacter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getFieldsTerminatedBy().isEmpty()) { + fieldsTerminatedBy_ = other.fieldsTerminatedBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getLinesTerminatedBy().isEmpty()) { + linesTerminatedBy_ = other.linesTerminatedBy_; + bitField0_ |= 0x00000020; + 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: + { + table_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureColumnsIsMutable(); + columns_.add(s); + break; + } // case 18 + case 34: + { + escapeCharacter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + quoteCharacter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 50: + { + fieldsTerminatedBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 66: + { + linesTerminatedBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object table_ = ""; + + /** + * + * + *
+       * The table to which CSV data is imported.
+       * 
+ * + * string table = 1; + * + * @return The table. + */ + public java.lang.String getTable() { + java.lang.Object ref = table_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + table_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The table to which CSV data is imported.
+       * 
+ * + * string table = 1; + * + * @return The bytes for table. + */ + public com.google.protobuf.ByteString getTableBytes() { + java.lang.Object ref = table_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + table_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The table to which CSV data is imported.
+       * 
+ * + * string table = 1; + * + * @param value The table to set. + * @return This builder for chaining. + */ + public Builder setTable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + table_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The table to which CSV data is imported.
+       * 
+ * + * string table = 1; + * + * @return This builder for chaining. + */ + public Builder clearTable() { + table_ = getDefaultInstance().getTable(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The table to which CSV data is imported.
+       * 
+ * + * string table = 1; + * + * @param value The bytes for table to set. + * @return This builder for chaining. + */ + public Builder setTableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + table_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList columns_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureColumnsIsMutable() { + if (!columns_.isModifiable()) { + columns_ = new com.google.protobuf.LazyStringArrayList(columns_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @return A list containing the columns. + */ + public com.google.protobuf.ProtocolStringList getColumnsList() { + columns_.makeImmutable(); + return columns_; + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @return The count of columns. + */ + public int getColumnsCount() { + return columns_.size(); + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @param index The index of the element to return. + * @return The columns at the given index. + */ + public java.lang.String getColumns(int index) { + return columns_.get(index); + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @param index The index of the value to return. + * @return The bytes of the columns at the given index. + */ + public com.google.protobuf.ByteString getColumnsBytes(int index) { + return columns_.getByteString(index); + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @param index The index to set the value at. + * @param value The columns to set. + * @return This builder for chaining. + */ + public Builder setColumns(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @param value The columns to add. + * @return This builder for chaining. + */ + public Builder addColumns(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @param values The columns to add. + * @return This builder for chaining. + */ + public Builder addAllColumns(java.lang.Iterable values) { + ensureColumnsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, columns_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @return This builder for chaining. + */ + public Builder clearColumns() { + columns_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @param value The bytes of the columns to add. + * @return This builder for chaining. + */ + public Builder addColumnsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureColumnsIsMutable(); + columns_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object escapeCharacter_ = ""; + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 4; + * + * @return The escapeCharacter. + */ + public java.lang.String getEscapeCharacter() { + java.lang.Object ref = escapeCharacter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + escapeCharacter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 4; + * + * @return The bytes for escapeCharacter. + */ + public com.google.protobuf.ByteString getEscapeCharacterBytes() { + java.lang.Object ref = escapeCharacter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + escapeCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 4; + * + * @param value The escapeCharacter to set. + * @return This builder for chaining. + */ + public Builder setEscapeCharacter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + escapeCharacter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 4; + * + * @return This builder for chaining. + */ + public Builder clearEscapeCharacter() { + escapeCharacter_ = getDefaultInstance().getEscapeCharacter(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 4; + * + * @param value The bytes for escapeCharacter to set. + * @return This builder for chaining. + */ + public Builder setEscapeCharacterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + escapeCharacter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object quoteCharacter_ = ""; + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 5; + * + * @return The quoteCharacter. + */ + public java.lang.String getQuoteCharacter() { + java.lang.Object ref = quoteCharacter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quoteCharacter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 5; + * + * @return The bytes for quoteCharacter. + */ + public com.google.protobuf.ByteString getQuoteCharacterBytes() { + java.lang.Object ref = quoteCharacter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quoteCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 5; + * + * @param value The quoteCharacter to set. + * @return This builder for chaining. + */ + public Builder setQuoteCharacter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quoteCharacter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 5; + * + * @return This builder for chaining. + */ + public Builder clearQuoteCharacter() { + quoteCharacter_ = getDefaultInstance().getQuoteCharacter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 5; + * + * @param value The bytes for quoteCharacter to set. + * @return This builder for chaining. + */ + public Builder setQuoteCharacterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quoteCharacter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object fieldsTerminatedBy_ = ""; + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 6; + * + * @return The fieldsTerminatedBy. + */ + public java.lang.String getFieldsTerminatedBy() { + java.lang.Object ref = fieldsTerminatedBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldsTerminatedBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 6; + * + * @return The bytes for fieldsTerminatedBy. + */ + public com.google.protobuf.ByteString getFieldsTerminatedByBytes() { + java.lang.Object ref = fieldsTerminatedBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldsTerminatedBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 6; + * + * @param value The fieldsTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setFieldsTerminatedBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fieldsTerminatedBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 6; + * + * @return This builder for chaining. + */ + public Builder clearFieldsTerminatedBy() { + fieldsTerminatedBy_ = getDefaultInstance().getFieldsTerminatedBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 6; + * + * @param value The bytes for fieldsTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setFieldsTerminatedByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fieldsTerminatedBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object linesTerminatedBy_ = ""; + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 8; + * + * @return The linesTerminatedBy. + */ + public java.lang.String getLinesTerminatedBy() { + java.lang.Object ref = linesTerminatedBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + linesTerminatedBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 8; + * + * @return The bytes for linesTerminatedBy. + */ + public com.google.protobuf.ByteString getLinesTerminatedByBytes() { + java.lang.Object ref = linesTerminatedBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + linesTerminatedBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 8; + * + * @param value The linesTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setLinesTerminatedBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + linesTerminatedBy_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 8; + * + * @return This builder for chaining. + */ + public Builder clearLinesTerminatedBy() { + linesTerminatedBy_ = getDefaultInstance().getLinesTerminatedBy(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 8; + * + * @param value The bytes for linesTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setLinesTerminatedByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + linesTerminatedBy_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ImportContext.SqlCsvImportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ImportContext.SqlCsvImportOptions) + private static final com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions(); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlCsvImportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlBakImportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ImportContext.SqlBakImportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + * + * @return Whether the encryptionOptions field is set. + */ + boolean hasEncryptionOptions(); + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + * + * @return The encryptionOptions. + */ + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + getEncryptionOptions(); + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptionsOrBuilder + getEncryptionOptionsOrBuilder(); + + /** + * + * + *
+     * Whether or not the backup set being restored is striped.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue striped = 2; + * + * @return Whether the striped field is set. + */ + boolean hasStriped(); + + /** + * + * + *
+     * Whether or not the backup set being restored is striped.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue striped = 2; + * + * @return The striped. + */ + com.google.protobuf.BoolValue getStriped(); + + /** + * + * + *
+     * Whether or not the backup set being restored is striped.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + com.google.protobuf.BoolValueOrBuilder getStripedOrBuilder(); + + /** + * + * + *
+     * Whether or not the backup importing will restore database
+     * with NORECOVERY option.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + * + * @return Whether the noRecovery field is set. + */ + boolean hasNoRecovery(); + + /** + * + * + *
+     * Whether or not the backup importing will restore database
+     * with NORECOVERY option.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + * + * @return The noRecovery. + */ + com.google.protobuf.BoolValue getNoRecovery(); + + /** + * + * + *
+     * Whether or not the backup importing will restore database
+     * with NORECOVERY option.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + com.google.protobuf.BoolValueOrBuilder getNoRecoveryOrBuilder(); + + /** + * + * + *
+     * Whether or not the backup importing request will just bring database
+     * online without downloading Bak content only one of "no_recovery" and
+     * "recovery_only" can be true otherwise error will return. Applies only to
+     * Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + * + * @return Whether the recoveryOnly field is set. + */ + boolean hasRecoveryOnly(); + + /** + * + * + *
+     * Whether or not the backup importing request will just bring database
+     * online without downloading Bak content only one of "no_recovery" and
+     * "recovery_only" can be true otherwise error will return. Applies only to
+     * Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + * + * @return The recoveryOnly. + */ + com.google.protobuf.BoolValue getRecoveryOnly(); + + /** + * + * + *
+     * Whether or not the backup importing request will just bring database
+     * online without downloading Bak content only one of "no_recovery" and
+     * "recovery_only" can be true otherwise error will return. Applies only to
+     * Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + com.google.protobuf.BoolValueOrBuilder getRecoveryOnlyOrBuilder(); + + /** + * + * + *
+     * Type of the bak content, FULL or DIFF
+     * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 6; + * + * @return The enum numeric value on the wire for bakType. + */ + int getBakTypeValue(); + + /** + * + * + *
+     * Type of the bak content, FULL or DIFF
+     * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 6; + * + * @return The bakType. + */ + com.google.cloud.sql.v1.BakType getBakType(); + + /** + * + * + *
+     * Optional. The timestamp when the import should stop. This timestamp is in
+     * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+     * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+     * keyword and applies to Cloud SQL for SQL Server only.
+     * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the stopAt field is set. + */ + boolean hasStopAt(); + + /** + * + * + *
+     * Optional. The timestamp when the import should stop. This timestamp is in
+     * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+     * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+     * keyword and applies to Cloud SQL for SQL Server only.
+     * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The stopAt. + */ + com.google.protobuf.Timestamp getStopAt(); + + /** + * + * + *
+     * Optional. The timestamp when the import should stop. This timestamp is in
+     * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+     * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+     * keyword and applies to Cloud SQL for SQL Server only.
+     * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getStopAtOrBuilder(); + + /** + * + * + *
+     * Optional. The marked transaction where the import should stop. This field
+     * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+     * Server only.
+     * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The stopAtMark. + */ + java.lang.String getStopAtMark(); + + /** + * + * + *
+     * Optional. The marked transaction where the import should stop. This field
+     * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+     * Server only.
+     * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for stopAtMark. + */ + com.google.protobuf.ByteString getStopAtMarkBytes(); + } + + /** Protobuf type {@code google.cloud.sql.v1.ImportContext.SqlBakImportOptions} */ + public static final class SqlBakImportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ImportContext.SqlBakImportOptions) + SqlBakImportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBakImportOptions"); + } + + // Use SqlBakImportOptions.newBuilder() to construct. + private SqlBakImportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlBakImportOptions() { + bakType_ = 0; + stopAtMark_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.class, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.Builder.class); + } + + public interface EncryptionOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Path to the Certificate (.cer) in Cloud Storage, in the form
+       * `gs://bucketName/fileName`. The instance must have
+       * write permissions to the bucket and read access to the file.
+       * 
+ * + * string cert_path = 1; + * + * @return The certPath. + */ + java.lang.String getCertPath(); + + /** + * + * + *
+       * Path to the Certificate (.cer) in Cloud Storage, in the form
+       * `gs://bucketName/fileName`. The instance must have
+       * write permissions to the bucket and read access to the file.
+       * 
+ * + * string cert_path = 1; + * + * @return The bytes for certPath. + */ + com.google.protobuf.ByteString getCertPathBytes(); + + /** + * + * + *
+       * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+       * form `gs://bucketName/fileName`. The instance must have
+       * write permissions to the bucket and read access to the file.
+       * 
+ * + * string pvk_path = 2; + * + * @return The pvkPath. + */ + java.lang.String getPvkPath(); + + /** + * + * + *
+       * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+       * form `gs://bucketName/fileName`. The instance must have
+       * write permissions to the bucket and read access to the file.
+       * 
+ * + * string pvk_path = 2; + * + * @return The bytes for pvkPath. + */ + com.google.protobuf.ByteString getPvkPathBytes(); + + /** + * + * + *
+       * Password that encrypts the private key
+       * 
+ * + * string pvk_password = 3; + * + * @return The pvkPassword. + */ + java.lang.String getPvkPassword(); + + /** + * + * + *
+       * Password that encrypts the private key
+       * 
+ * + * string pvk_password = 3; + * + * @return The bytes for pvkPassword. + */ + com.google.protobuf.ByteString getPvkPasswordBytes(); + + /** + * + * + *
+       * Optional. Whether the imported file remains encrypted.
+       * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the keepEncrypted field is set. + */ + boolean hasKeepEncrypted(); + + /** + * + * + *
+       * Optional. Whether the imported file remains encrypted.
+       * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The keepEncrypted. + */ + com.google.protobuf.BoolValue getKeepEncrypted(); + + /** + * + * + *
+       * Optional. Whether the imported file remains encrypted.
+       * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getKeepEncryptedOrBuilder(); + } + + /** + * Protobuf type {@code google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions} + */ + public static final class EncryptionOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions) + EncryptionOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EncryptionOptions"); + } + + // Use EncryptionOptions.newBuilder() to construct. + private EncryptionOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private EncryptionOptions() { + certPath_ = ""; + pvkPath_ = ""; + pvkPassword_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_EncryptionOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_EncryptionOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.class, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.Builder + .class); + } + + private int bitField0_; + public static final int CERT_PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object certPath_ = ""; + + /** + * + * + *
+       * Path to the Certificate (.cer) in Cloud Storage, in the form
+       * `gs://bucketName/fileName`. The instance must have
+       * write permissions to the bucket and read access to the file.
+       * 
+ * + * string cert_path = 1; + * + * @return The certPath. + */ + @java.lang.Override + public java.lang.String getCertPath() { + java.lang.Object ref = certPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certPath_ = s; + return s; + } + } + + /** + * + * + *
+       * Path to the Certificate (.cer) in Cloud Storage, in the form
+       * `gs://bucketName/fileName`. The instance must have
+       * write permissions to the bucket and read access to the file.
+       * 
+ * + * string cert_path = 1; + * + * @return The bytes for certPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCertPathBytes() { + java.lang.Object ref = certPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PVK_PATH_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pvkPath_ = ""; + + /** + * + * + *
+       * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+       * form `gs://bucketName/fileName`. The instance must have
+       * write permissions to the bucket and read access to the file.
+       * 
+ * + * string pvk_path = 2; + * + * @return The pvkPath. + */ + @java.lang.Override + public java.lang.String getPvkPath() { + java.lang.Object ref = pvkPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pvkPath_ = s; + return s; + } + } + + /** + * + * + *
+       * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+       * form `gs://bucketName/fileName`. The instance must have
+       * write permissions to the bucket and read access to the file.
+       * 
+ * + * string pvk_path = 2; + * + * @return The bytes for pvkPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPvkPathBytes() { + java.lang.Object ref = pvkPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pvkPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PVK_PASSWORD_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pvkPassword_ = ""; + + /** + * + * + *
+       * Password that encrypts the private key
+       * 
+ * + * string pvk_password = 3; + * + * @return The pvkPassword. + */ + @java.lang.Override + public java.lang.String getPvkPassword() { + java.lang.Object ref = pvkPassword_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pvkPassword_ = s; + return s; + } + } + + /** + * + * + *
+       * Password that encrypts the private key
+       * 
+ * + * string pvk_password = 3; + * + * @return The bytes for pvkPassword. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPvkPasswordBytes() { + java.lang.Object ref = pvkPassword_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pvkPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEEP_ENCRYPTED_FIELD_NUMBER = 5; + private com.google.protobuf.BoolValue keepEncrypted_; + + /** + * + * + *
+       * Optional. Whether the imported file remains encrypted.
+       * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the keepEncrypted field is set. + */ + @java.lang.Override + public boolean hasKeepEncrypted() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Optional. Whether the imported file remains encrypted.
+       * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The keepEncrypted. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getKeepEncrypted() { + return keepEncrypted_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : keepEncrypted_; + } + + /** + * + * + *
+       * Optional. Whether the imported file remains encrypted.
+       * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getKeepEncryptedOrBuilder() { + return keepEncrypted_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : keepEncrypted_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(certPath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, certPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pvkPath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, pvkPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pvkPassword_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pvkPassword_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getKeepEncrypted()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(certPath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, certPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pvkPath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, pvkPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pvkPassword_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pvkPassword_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getKeepEncrypted()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions other = + (com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions) obj; + + if (!getCertPath().equals(other.getCertPath())) return false; + if (!getPvkPath().equals(other.getPvkPath())) return false; + if (!getPvkPassword().equals(other.getPvkPassword())) return false; + if (hasKeepEncrypted() != other.hasKeepEncrypted()) return false; + if (hasKeepEncrypted()) { + if (!getKeepEncrypted().equals(other.getKeepEncrypted())) return false; + } + if (!getUnknownFields().equals(other.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) + CERT_PATH_FIELD_NUMBER; + hash = (53 * hash) + getCertPath().hashCode(); + hash = (37 * hash) + PVK_PATH_FIELD_NUMBER; + hash = (53 * hash) + getPvkPath().hashCode(); + hash = (37 * hash) + PVK_PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPvkPassword().hashCode(); + if (hasKeepEncrypted()) { + hash = (37 * hash) + KEEP_ENCRYPTED_FIELD_NUMBER; + hash = (53 * hash) + getKeepEncrypted().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code + * google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions) + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_EncryptionOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_EncryptionOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.class, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + .Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetKeepEncryptedFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + certPath_ = ""; + pvkPath_ = ""; + pvkPassword_ = ""; + keepEncrypted_ = null; + if (keepEncryptedBuilder_ != null) { + keepEncryptedBuilder_.dispose(); + keepEncryptedBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_EncryptionOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions build() { + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + buildPartial() { + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions result = + new com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.certPath_ = certPath_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pvkPath_ = pvkPath_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pvkPassword_ = pvkPassword_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.keepEncrypted_ = + keepEncryptedBuilder_ == null ? keepEncrypted_ : keepEncryptedBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions) { + return mergeFrom( + (com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions other) { + if (other + == com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + .getDefaultInstance()) return this; + if (!other.getCertPath().isEmpty()) { + certPath_ = other.certPath_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPvkPath().isEmpty()) { + pvkPath_ = other.pvkPath_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPvkPassword().isEmpty()) { + pvkPassword_ = other.pvkPassword_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasKeepEncrypted()) { + mergeKeepEncrypted(other.getKeepEncrypted()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + certPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + pvkPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + pvkPassword_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + input.readMessage( + internalGetKeepEncryptedFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + 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 certPath_ = ""; + + /** + * + * + *
+         * Path to the Certificate (.cer) in Cloud Storage, in the form
+         * `gs://bucketName/fileName`. The instance must have
+         * write permissions to the bucket and read access to the file.
+         * 
+ * + * string cert_path = 1; + * + * @return The certPath. + */ + public java.lang.String getCertPath() { + java.lang.Object ref = certPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+         * Path to the Certificate (.cer) in Cloud Storage, in the form
+         * `gs://bucketName/fileName`. The instance must have
+         * write permissions to the bucket and read access to the file.
+         * 
+ * + * string cert_path = 1; + * + * @return The bytes for certPath. + */ + public com.google.protobuf.ByteString getCertPathBytes() { + java.lang.Object ref = certPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+         * Path to the Certificate (.cer) in Cloud Storage, in the form
+         * `gs://bucketName/fileName`. The instance must have
+         * write permissions to the bucket and read access to the file.
+         * 
+ * + * string cert_path = 1; + * + * @param value The certPath to set. + * @return This builder for chaining. + */ + public Builder setCertPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + certPath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Path to the Certificate (.cer) in Cloud Storage, in the form
+         * `gs://bucketName/fileName`. The instance must have
+         * write permissions to the bucket and read access to the file.
+         * 
+ * + * string cert_path = 1; + * + * @return This builder for chaining. + */ + public Builder clearCertPath() { + certPath_ = getDefaultInstance().getCertPath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+         * Path to the Certificate (.cer) in Cloud Storage, in the form
+         * `gs://bucketName/fileName`. The instance must have
+         * write permissions to the bucket and read access to the file.
+         * 
+ * + * string cert_path = 1; + * + * @param value The bytes for certPath to set. + * @return This builder for chaining. + */ + public Builder setCertPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + certPath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object pvkPath_ = ""; + + /** + * + * + *
+         * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+         * form `gs://bucketName/fileName`. The instance must have
+         * write permissions to the bucket and read access to the file.
+         * 
+ * + * string pvk_path = 2; + * + * @return The pvkPath. + */ + public java.lang.String getPvkPath() { + java.lang.Object ref = pvkPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pvkPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+         * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+         * form `gs://bucketName/fileName`. The instance must have
+         * write permissions to the bucket and read access to the file.
+         * 
+ * + * string pvk_path = 2; + * + * @return The bytes for pvkPath. + */ + public com.google.protobuf.ByteString getPvkPathBytes() { + java.lang.Object ref = pvkPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pvkPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+         * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+         * form `gs://bucketName/fileName`. The instance must have
+         * write permissions to the bucket and read access to the file.
+         * 
+ * + * string pvk_path = 2; + * + * @param value The pvkPath to set. + * @return This builder for chaining. + */ + public Builder setPvkPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pvkPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+         * form `gs://bucketName/fileName`. The instance must have
+         * write permissions to the bucket and read access to the file.
+         * 
+ * + * string pvk_path = 2; + * + * @return This builder for chaining. + */ + public Builder clearPvkPath() { + pvkPath_ = getDefaultInstance().getPvkPath(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+         * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+         * form `gs://bucketName/fileName`. The instance must have
+         * write permissions to the bucket and read access to the file.
+         * 
+ * + * string pvk_path = 2; + * + * @param value The bytes for pvkPath to set. + * @return This builder for chaining. + */ + public Builder setPvkPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pvkPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object pvkPassword_ = ""; + + /** + * + * + *
+         * Password that encrypts the private key
+         * 
+ * + * string pvk_password = 3; + * + * @return The pvkPassword. + */ + public java.lang.String getPvkPassword() { + java.lang.Object ref = pvkPassword_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pvkPassword_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+         * Password that encrypts the private key
+         * 
+ * + * string pvk_password = 3; + * + * @return The bytes for pvkPassword. + */ + public com.google.protobuf.ByteString getPvkPasswordBytes() { + java.lang.Object ref = pvkPassword_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pvkPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+         * Password that encrypts the private key
+         * 
+ * + * string pvk_password = 3; + * + * @param value The pvkPassword to set. + * @return This builder for chaining. + */ + public Builder setPvkPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pvkPassword_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+         * Password that encrypts the private key
+         * 
+ * + * string pvk_password = 3; + * + * @return This builder for chaining. + */ + public Builder clearPvkPassword() { + pvkPassword_ = getDefaultInstance().getPvkPassword(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+         * Password that encrypts the private key
+         * 
+ * + * string pvk_password = 3; + * + * @param value The bytes for pvkPassword to set. + * @return This builder for chaining. + */ + public Builder setPvkPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pvkPassword_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue keepEncrypted_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + keepEncryptedBuilder_; + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the keepEncrypted field is set. + */ + public boolean hasKeepEncrypted() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The keepEncrypted. + */ + public com.google.protobuf.BoolValue getKeepEncrypted() { + if (keepEncryptedBuilder_ == null) { + return keepEncrypted_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : keepEncrypted_; + } else { + return keepEncryptedBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setKeepEncrypted(com.google.protobuf.BoolValue value) { + if (keepEncryptedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + keepEncrypted_ = value; + } else { + keepEncryptedBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setKeepEncrypted(com.google.protobuf.BoolValue.Builder builderForValue) { + if (keepEncryptedBuilder_ == null) { + keepEncrypted_ = builderForValue.build(); + } else { + keepEncryptedBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeKeepEncrypted(com.google.protobuf.BoolValue value) { + if (keepEncryptedBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && keepEncrypted_ != null + && keepEncrypted_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getKeepEncryptedBuilder().mergeFrom(value); + } else { + keepEncrypted_ = value; + } + } else { + keepEncryptedBuilder_.mergeFrom(value); + } + if (keepEncrypted_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearKeepEncrypted() { + bitField0_ = (bitField0_ & ~0x00000008); + keepEncrypted_ = null; + if (keepEncryptedBuilder_ != null) { + keepEncryptedBuilder_.dispose(); + keepEncryptedBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getKeepEncryptedBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetKeepEncryptedFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getKeepEncryptedOrBuilder() { + if (keepEncryptedBuilder_ != null) { + return keepEncryptedBuilder_.getMessageOrBuilder(); + } else { + return keepEncrypted_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : keepEncrypted_; + } + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetKeepEncryptedFieldBuilder() { + if (keepEncryptedBuilder_ == null) { + keepEncryptedBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getKeepEncrypted(), getParentForChildren(), isClean()); + keepEncrypted_ = null; + } + return keepEncryptedBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions) + private static final com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions + .EncryptionOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions(); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EncryptionOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ENCRYPTION_OPTIONS_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + encryptionOptions_; + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + * + * @return Whether the encryptionOptions field is set. + */ + @java.lang.Override + public boolean hasEncryptionOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + * + * @return The encryptionOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + getEncryptionOptions() { + return encryptionOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + .getDefaultInstance() + : encryptionOptions_; + } + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptionsOrBuilder + getEncryptionOptionsOrBuilder() { + return encryptionOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + .getDefaultInstance() + : encryptionOptions_; + } + + public static final int STRIPED_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue striped_; + + /** + * + * + *
+     * Whether or not the backup set being restored is striped.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue striped = 2; + * + * @return Whether the striped field is set. + */ + @java.lang.Override + public boolean hasStriped() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Whether or not the backup set being restored is striped.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue striped = 2; + * + * @return The striped. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getStriped() { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } + + /** + * + * + *
+     * Whether or not the backup set being restored is striped.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getStripedOrBuilder() { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } + + public static final int NO_RECOVERY_FIELD_NUMBER = 4; + private com.google.protobuf.BoolValue noRecovery_; + + /** + * + * + *
+     * Whether or not the backup importing will restore database
+     * with NORECOVERY option.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + * + * @return Whether the noRecovery field is set. + */ + @java.lang.Override + public boolean hasNoRecovery() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Whether or not the backup importing will restore database
+     * with NORECOVERY option.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + * + * @return The noRecovery. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getNoRecovery() { + return noRecovery_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : noRecovery_; + } + + /** + * + * + *
+     * Whether or not the backup importing will restore database
+     * with NORECOVERY option.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getNoRecoveryOrBuilder() { + return noRecovery_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : noRecovery_; + } + + public static final int RECOVERY_ONLY_FIELD_NUMBER = 5; + private com.google.protobuf.BoolValue recoveryOnly_; + + /** + * + * + *
+     * Whether or not the backup importing request will just bring database
+     * online without downloading Bak content only one of "no_recovery" and
+     * "recovery_only" can be true otherwise error will return. Applies only to
+     * Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + * + * @return Whether the recoveryOnly field is set. + */ + @java.lang.Override + public boolean hasRecoveryOnly() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Whether or not the backup importing request will just bring database
+     * online without downloading Bak content only one of "no_recovery" and
+     * "recovery_only" can be true otherwise error will return. Applies only to
+     * Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + * + * @return The recoveryOnly. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getRecoveryOnly() { + return recoveryOnly_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : recoveryOnly_; + } + + /** + * + * + *
+     * Whether or not the backup importing request will just bring database
+     * online without downloading Bak content only one of "no_recovery" and
+     * "recovery_only" can be true otherwise error will return. Applies only to
+     * Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getRecoveryOnlyOrBuilder() { + return recoveryOnly_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : recoveryOnly_; + } + + public static final int BAK_TYPE_FIELD_NUMBER = 6; + private int bakType_ = 0; + + /** + * + * + *
+     * Type of the bak content, FULL or DIFF
+     * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 6; + * + * @return The enum numeric value on the wire for bakType. + */ + @java.lang.Override + public int getBakTypeValue() { + return bakType_; + } + + /** + * + * + *
+     * Type of the bak content, FULL or DIFF
+     * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 6; + * + * @return The bakType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BakType getBakType() { + com.google.cloud.sql.v1.BakType result = com.google.cloud.sql.v1.BakType.forNumber(bakType_); + return result == null ? com.google.cloud.sql.v1.BakType.UNRECOGNIZED : result; + } + + public static final int STOP_AT_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp stopAt_; + + /** + * + * + *
+     * Optional. The timestamp when the import should stop. This timestamp is in
+     * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+     * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+     * keyword and applies to Cloud SQL for SQL Server only.
+     * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the stopAt field is set. + */ + @java.lang.Override + public boolean hasStopAt() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. The timestamp when the import should stop. This timestamp is in
+     * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+     * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+     * keyword and applies to Cloud SQL for SQL Server only.
+     * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The stopAt. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStopAt() { + return stopAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : stopAt_; + } + + /** + * + * + *
+     * Optional. The timestamp when the import should stop. This timestamp is in
+     * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+     * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+     * keyword and applies to Cloud SQL for SQL Server only.
+     * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStopAtOrBuilder() { + return stopAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : stopAt_; + } + + public static final int STOP_AT_MARK_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object stopAtMark_ = ""; + + /** + * + * + *
+     * Optional. The marked transaction where the import should stop. This field
+     * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+     * Server only.
+     * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The stopAtMark. + */ + @java.lang.Override + public java.lang.String getStopAtMark() { + java.lang.Object ref = stopAtMark_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stopAtMark_ = s; + return s; + } + } + + /** + * + * + *
+     * Optional. The marked transaction where the import should stop. This field
+     * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+     * Server only.
+     * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for stopAtMark. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStopAtMarkBytes() { + java.lang.Object ref = stopAtMark_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stopAtMark_ = 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, getEncryptionOptions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getStriped()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getNoRecovery()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(5, getRecoveryOnly()); + } + if (bakType_ != com.google.cloud.sql.v1.BakType.BAK_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, bakType_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(7, getStopAt()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(stopAtMark_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, stopAtMark_); + } + 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, getEncryptionOptions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStriped()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getNoRecovery()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getRecoveryOnly()); + } + if (bakType_ != com.google.cloud.sql.v1.BakType.BAK_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, bakType_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getStopAt()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(stopAtMark_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, stopAtMark_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions other = + (com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions) obj; + + if (hasEncryptionOptions() != other.hasEncryptionOptions()) return false; + if (hasEncryptionOptions()) { + if (!getEncryptionOptions().equals(other.getEncryptionOptions())) return false; + } + if (hasStriped() != other.hasStriped()) return false; + if (hasStriped()) { + if (!getStriped().equals(other.getStriped())) return false; + } + if (hasNoRecovery() != other.hasNoRecovery()) return false; + if (hasNoRecovery()) { + if (!getNoRecovery().equals(other.getNoRecovery())) return false; + } + if (hasRecoveryOnly() != other.hasRecoveryOnly()) return false; + if (hasRecoveryOnly()) { + if (!getRecoveryOnly().equals(other.getRecoveryOnly())) return false; + } + if (bakType_ != other.bakType_) return false; + if (hasStopAt() != other.hasStopAt()) return false; + if (hasStopAt()) { + if (!getStopAt().equals(other.getStopAt())) return false; + } + if (!getStopAtMark().equals(other.getStopAtMark())) return false; + if (!getUnknownFields().equals(other.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 (hasEncryptionOptions()) { + hash = (37 * hash) + ENCRYPTION_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionOptions().hashCode(); + } + if (hasStriped()) { + hash = (37 * hash) + STRIPED_FIELD_NUMBER; + hash = (53 * hash) + getStriped().hashCode(); + } + if (hasNoRecovery()) { + hash = (37 * hash) + NO_RECOVERY_FIELD_NUMBER; + hash = (53 * hash) + getNoRecovery().hashCode(); + } + if (hasRecoveryOnly()) { + hash = (37 * hash) + RECOVERY_ONLY_FIELD_NUMBER; + hash = (53 * hash) + getRecoveryOnly().hashCode(); + } + hash = (37 * hash) + BAK_TYPE_FIELD_NUMBER; + hash = (53 * hash) + bakType_; + if (hasStopAt()) { + hash = (37 * hash) + STOP_AT_FIELD_NUMBER; + hash = (53 * hash) + getStopAt().hashCode(); + } + hash = (37 * hash) + STOP_AT_MARK_FIELD_NUMBER; + hash = (53 * hash) + getStopAtMark().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.ImportContext.SqlBakImportOptions} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ImportContext.SqlBakImportOptions) + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.class, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEncryptionOptionsFieldBuilder(); + internalGetStripedFieldBuilder(); + internalGetNoRecoveryFieldBuilder(); + internalGetRecoveryOnlyFieldBuilder(); + internalGetStopAtFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encryptionOptions_ = null; + if (encryptionOptionsBuilder_ != null) { + encryptionOptionsBuilder_.dispose(); + encryptionOptionsBuilder_ = null; + } + striped_ = null; + if (stripedBuilder_ != null) { + stripedBuilder_.dispose(); + stripedBuilder_ = null; + } + noRecovery_ = null; + if (noRecoveryBuilder_ != null) { + noRecoveryBuilder_.dispose(); + noRecoveryBuilder_ = null; + } + recoveryOnly_ = null; + if (recoveryOnlyBuilder_ != null) { + recoveryOnlyBuilder_.dispose(); + recoveryOnlyBuilder_ = null; + } + bakType_ = 0; + stopAt_ = null; + if (stopAtBuilder_ != null) { + stopAtBuilder_.dispose(); + stopAtBuilder_ = null; + } + stopAtMark_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlBakImportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions build() { + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions buildPartial() { + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions result = + new com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encryptionOptions_ = + encryptionOptionsBuilder_ == null + ? encryptionOptions_ + : encryptionOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.striped_ = stripedBuilder_ == null ? striped_ : stripedBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.noRecovery_ = + noRecoveryBuilder_ == null ? noRecovery_ : noRecoveryBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.recoveryOnly_ = + recoveryOnlyBuilder_ == null ? recoveryOnly_ : recoveryOnlyBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.bakType_ = bakType_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.stopAt_ = stopAtBuilder_ == null ? stopAt_ : stopAtBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.stopAtMark_ = stopAtMark_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions) { + return mergeFrom((com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions other) { + if (other == com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.getDefaultInstance()) + return this; + if (other.hasEncryptionOptions()) { + mergeEncryptionOptions(other.getEncryptionOptions()); + } + if (other.hasStriped()) { + mergeStriped(other.getStriped()); + } + if (other.hasNoRecovery()) { + mergeNoRecovery(other.getNoRecovery()); + } + if (other.hasRecoveryOnly()) { + mergeRecoveryOnly(other.getRecoveryOnly()); + } + if (other.bakType_ != 0) { + setBakTypeValue(other.getBakTypeValue()); + } + if (other.hasStopAt()) { + mergeStopAt(other.getStopAt()); + } + if (!other.getStopAtMark().isEmpty()) { + stopAtMark_ = other.stopAtMark_; + 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( + internalGetEncryptionOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStripedFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + input.readMessage( + internalGetNoRecoveryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetRecoveryOnlyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 48: + { + bakType_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 48 + case 58: + { + input.readMessage( + internalGetStopAtFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 66: + { + stopAtMark_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + encryptionOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptionsOrBuilder> + encryptionOptionsBuilder_; + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + * + * @return Whether the encryptionOptions field is set. + */ + public boolean hasEncryptionOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + * + * @return The encryptionOptions. + */ + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + getEncryptionOptions() { + if (encryptionOptionsBuilder_ == null) { + return encryptionOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + .getDefaultInstance() + : encryptionOptions_; + } else { + return encryptionOptionsBuilder_.getMessage(); + } + } + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + public Builder setEncryptionOptions( + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions value) { + if (encryptionOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionOptions_ = value; + } else { + encryptionOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + public Builder setEncryptionOptions( + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.Builder + builderForValue) { + if (encryptionOptionsBuilder_ == null) { + encryptionOptions_ = builderForValue.build(); + } else { + encryptionOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + public Builder mergeEncryptionOptions( + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions value) { + if (encryptionOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && encryptionOptions_ != null + && encryptionOptions_ + != com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + .getDefaultInstance()) { + getEncryptionOptionsBuilder().mergeFrom(value); + } else { + encryptionOptions_ = value; + } + } else { + encryptionOptionsBuilder_.mergeFrom(value); + } + if (encryptionOptions_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + public Builder clearEncryptionOptions() { + bitField0_ = (bitField0_ & ~0x00000001); + encryptionOptions_ = null; + if (encryptionOptionsBuilder_ != null) { + encryptionOptionsBuilder_.dispose(); + encryptionOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.Builder + getEncryptionOptionsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetEncryptionOptionsFieldBuilder().getBuilder(); + } + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptionsOrBuilder + getEncryptionOptionsOrBuilder() { + if (encryptionOptionsBuilder_ != null) { + return encryptionOptionsBuilder_.getMessageOrBuilder(); + } else { + return encryptionOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + .getDefaultInstance() + : encryptionOptions_; + } + } + + /** + * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptionsOrBuilder> + internalGetEncryptionOptionsFieldBuilder() { + if (encryptionOptionsBuilder_ == null) { + encryptionOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions + .Builder, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions + .EncryptionOptionsOrBuilder>( + getEncryptionOptions(), getParentForChildren(), isClean()); + encryptionOptions_ = null; + } + return encryptionOptionsBuilder_; + } + + private com.google.protobuf.BoolValue striped_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + stripedBuilder_; + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + * + * @return Whether the striped field is set. + */ + public boolean hasStriped() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + * + * @return The striped. + */ + public com.google.protobuf.BoolValue getStriped() { + if (stripedBuilder_ == null) { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } else { + return stripedBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + public Builder setStriped(com.google.protobuf.BoolValue value) { + if (stripedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + striped_ = value; + } else { + stripedBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + public Builder setStriped(com.google.protobuf.BoolValue.Builder builderForValue) { + if (stripedBuilder_ == null) { + striped_ = builderForValue.build(); + } else { + stripedBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + public Builder mergeStriped(com.google.protobuf.BoolValue value) { + if (stripedBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && striped_ != null + && striped_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getStripedBuilder().mergeFrom(value); + } else { + striped_ = value; + } + } else { + stripedBuilder_.mergeFrom(value); + } + if (striped_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + public Builder clearStriped() { + bitField0_ = (bitField0_ & ~0x00000002); + striped_ = null; + if (stripedBuilder_ != null) { + stripedBuilder_.dispose(); + stripedBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + public com.google.protobuf.BoolValue.Builder getStripedBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStripedFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + public com.google.protobuf.BoolValueOrBuilder getStripedOrBuilder() { + if (stripedBuilder_ != null) { + return stripedBuilder_.getMessageOrBuilder(); + } else { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetStripedFieldBuilder() { + if (stripedBuilder_ == null) { + stripedBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getStriped(), getParentForChildren(), isClean()); + striped_ = null; + } + return stripedBuilder_; + } + + private com.google.protobuf.BoolValue noRecovery_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + noRecoveryBuilder_; + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + * + * @return Whether the noRecovery field is set. + */ + public boolean hasNoRecovery() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + * + * @return The noRecovery. + */ + public com.google.protobuf.BoolValue getNoRecovery() { + if (noRecoveryBuilder_ == null) { + return noRecovery_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : noRecovery_; + } else { + return noRecoveryBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + public Builder setNoRecovery(com.google.protobuf.BoolValue value) { + if (noRecoveryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + noRecovery_ = value; + } else { + noRecoveryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + public Builder setNoRecovery(com.google.protobuf.BoolValue.Builder builderForValue) { + if (noRecoveryBuilder_ == null) { + noRecovery_ = builderForValue.build(); + } else { + noRecoveryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + public Builder mergeNoRecovery(com.google.protobuf.BoolValue value) { + if (noRecoveryBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && noRecovery_ != null + && noRecovery_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getNoRecoveryBuilder().mergeFrom(value); + } else { + noRecovery_ = value; + } + } else { + noRecoveryBuilder_.mergeFrom(value); + } + if (noRecovery_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + public Builder clearNoRecovery() { + bitField0_ = (bitField0_ & ~0x00000004); + noRecovery_ = null; + if (noRecoveryBuilder_ != null) { + noRecoveryBuilder_.dispose(); + noRecoveryBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + public com.google.protobuf.BoolValue.Builder getNoRecoveryBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetNoRecoveryFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + public com.google.protobuf.BoolValueOrBuilder getNoRecoveryOrBuilder() { + if (noRecoveryBuilder_ != null) { + return noRecoveryBuilder_.getMessageOrBuilder(); + } else { + return noRecovery_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : noRecovery_; + } + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetNoRecoveryFieldBuilder() { + if (noRecoveryBuilder_ == null) { + noRecoveryBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getNoRecovery(), getParentForChildren(), isClean()); + noRecovery_ = null; + } + return noRecoveryBuilder_; + } + + private com.google.protobuf.BoolValue recoveryOnly_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + recoveryOnlyBuilder_; + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + * + * @return Whether the recoveryOnly field is set. + */ + public boolean hasRecoveryOnly() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + * + * @return The recoveryOnly. + */ + public com.google.protobuf.BoolValue getRecoveryOnly() { + if (recoveryOnlyBuilder_ == null) { + return recoveryOnly_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : recoveryOnly_; + } else { + return recoveryOnlyBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + public Builder setRecoveryOnly(com.google.protobuf.BoolValue value) { + if (recoveryOnlyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + recoveryOnly_ = value; + } else { + recoveryOnlyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + public Builder setRecoveryOnly(com.google.protobuf.BoolValue.Builder builderForValue) { + if (recoveryOnlyBuilder_ == null) { + recoveryOnly_ = builderForValue.build(); + } else { + recoveryOnlyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + public Builder mergeRecoveryOnly(com.google.protobuf.BoolValue value) { + if (recoveryOnlyBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && recoveryOnly_ != null + && recoveryOnly_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getRecoveryOnlyBuilder().mergeFrom(value); + } else { + recoveryOnly_ = value; + } + } else { + recoveryOnlyBuilder_.mergeFrom(value); + } + if (recoveryOnly_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + public Builder clearRecoveryOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + recoveryOnly_ = null; + if (recoveryOnlyBuilder_ != null) { + recoveryOnlyBuilder_.dispose(); + recoveryOnlyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + public com.google.protobuf.BoolValue.Builder getRecoveryOnlyBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetRecoveryOnlyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + public com.google.protobuf.BoolValueOrBuilder getRecoveryOnlyOrBuilder() { + if (recoveryOnlyBuilder_ != null) { + return recoveryOnlyBuilder_.getMessageOrBuilder(); + } else { + return recoveryOnly_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : recoveryOnly_; + } + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetRecoveryOnlyFieldBuilder() { + if (recoveryOnlyBuilder_ == null) { + recoveryOnlyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getRecoveryOnly(), getParentForChildren(), isClean()); + recoveryOnly_ = null; + } + return recoveryOnlyBuilder_; + } + + private int bakType_ = 0; + + /** + * + * + *
+       * Type of the bak content, FULL or DIFF
+       * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 6; + * + * @return The enum numeric value on the wire for bakType. + */ + @java.lang.Override + public int getBakTypeValue() { + return bakType_; + } + + /** + * + * + *
+       * Type of the bak content, FULL or DIFF
+       * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 6; + * + * @param value The enum numeric value on the wire for bakType to set. + * @return This builder for chaining. + */ + public Builder setBakTypeValue(int value) { + bakType_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Type of the bak content, FULL or DIFF
+       * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 6; + * + * @return The bakType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BakType getBakType() { + com.google.cloud.sql.v1.BakType result = + com.google.cloud.sql.v1.BakType.forNumber(bakType_); + return result == null ? com.google.cloud.sql.v1.BakType.UNRECOGNIZED : result; + } + + /** + * + * + *
+       * Type of the bak content, FULL or DIFF
+       * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 6; + * + * @param value The bakType to set. + * @return This builder for chaining. + */ + public Builder setBakType(com.google.cloud.sql.v1.BakType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + bakType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Type of the bak content, FULL or DIFF
+       * 
+ * + * .google.cloud.sql.v1.BakType bak_type = 6; + * + * @return This builder for chaining. + */ + public Builder clearBakType() { + bitField0_ = (bitField0_ & ~0x00000010); + bakType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp stopAt_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + stopAtBuilder_; + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the stopAt field is set. + */ + public boolean hasStopAt() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The stopAt. + */ + public com.google.protobuf.Timestamp getStopAt() { + if (stopAtBuilder_ == null) { + return stopAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : stopAt_; + } else { + return stopAtBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setStopAt(com.google.protobuf.Timestamp value) { + if (stopAtBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stopAt_ = value; + } else { + stopAtBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setStopAt(com.google.protobuf.Timestamp.Builder builderForValue) { + if (stopAtBuilder_ == null) { + stopAt_ = builderForValue.build(); + } else { + stopAtBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeStopAt(com.google.protobuf.Timestamp value) { + if (stopAtBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && stopAt_ != null + && stopAt_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStopAtBuilder().mergeFrom(value); + } else { + stopAt_ = value; + } + } else { + stopAtBuilder_.mergeFrom(value); + } + if (stopAt_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearStopAt() { + bitField0_ = (bitField0_ & ~0x00000020); + stopAt_ = null; + if (stopAtBuilder_ != null) { + stopAtBuilder_.dispose(); + stopAtBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getStopAtBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetStopAtFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getStopAtOrBuilder() { + if (stopAtBuilder_ != null) { + return stopAtBuilder_.getMessageOrBuilder(); + } else { + return stopAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : stopAt_; + } + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStopAtFieldBuilder() { + if (stopAtBuilder_ == null) { + stopAtBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStopAt(), getParentForChildren(), isClean()); + stopAt_ = null; + } + return stopAtBuilder_; + } + + private java.lang.Object stopAtMark_ = ""; + + /** + * + * + *
+       * Optional. The marked transaction where the import should stop. This field
+       * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+       * Server only.
+       * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The stopAtMark. + */ + public java.lang.String getStopAtMark() { + java.lang.Object ref = stopAtMark_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stopAtMark_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Optional. The marked transaction where the import should stop. This field
+       * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+       * Server only.
+       * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for stopAtMark. + */ + public com.google.protobuf.ByteString getStopAtMarkBytes() { + java.lang.Object ref = stopAtMark_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stopAtMark_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Optional. The marked transaction where the import should stop. This field
+       * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+       * Server only.
+       * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The stopAtMark to set. + * @return This builder for chaining. + */ + public Builder setStopAtMark(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + stopAtMark_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The marked transaction where the import should stop. This field
+       * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+       * Server only.
+       * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearStopAtMark() { + stopAtMark_ = getDefaultInstance().getStopAtMark(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The marked transaction where the import should stop. This field
+       * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+       * Server only.
+       * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for stopAtMark to set. + * @return This builder for chaining. + */ + public Builder setStopAtMarkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + stopAtMark_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ImportContext.SqlBakImportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ImportContext.SqlBakImportOptions) + private static final com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions(); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlBakImportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlTdeImportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ImportContext.SqlTdeImportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The certificatePath. + */ + java.lang.String getCertificatePath(); + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for certificatePath. + */ + com.google.protobuf.ByteString getCertificatePathBytes(); + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPath. + */ + java.lang.String getPrivateKeyPath(); + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPath. + */ + com.google.protobuf.ByteString getPrivateKeyPathBytes(); + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPassword. + */ + java.lang.String getPrivateKeyPassword(); + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPassword. + */ + com.google.protobuf.ByteString getPrivateKeyPasswordBytes(); + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + } + + /** Protobuf type {@code google.cloud.sql.v1.ImportContext.SqlTdeImportOptions} */ + public static final class SqlTdeImportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ImportContext.SqlTdeImportOptions) + SqlTdeImportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlTdeImportOptions"); + } + + // Use SqlTdeImportOptions.newBuilder() to construct. + private SqlTdeImportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlTdeImportOptions() { + certificatePath_ = ""; + privateKeyPath_ = ""; + privateKeyPassword_ = ""; + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlTdeImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlTdeImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.class, + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.Builder.class); + } + + public static final int CERTIFICATE_PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object certificatePath_ = ""; + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The certificatePath. + */ + @java.lang.Override + public java.lang.String getCertificatePath() { + java.lang.Object ref = certificatePath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certificatePath_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for certificatePath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCertificatePathBytes() { + java.lang.Object ref = certificatePath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certificatePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIVATE_KEY_PATH_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object privateKeyPath_ = ""; + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPath. + */ + @java.lang.Override + public java.lang.String getPrivateKeyPath() { + java.lang.Object ref = privateKeyPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPath_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrivateKeyPathBytes() { + java.lang.Object ref = privateKeyPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIVATE_KEY_PASSWORD_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object privateKeyPassword_ = ""; + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPassword. + */ + @java.lang.Override + public java.lang.String getPrivateKeyPassword() { + java.lang.Object ref = privateKeyPassword_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPassword_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPassword. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrivateKeyPasswordBytes() { + java.lang.Object ref = privateKeyPassword_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(certificatePath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, certificatePath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, privateKeyPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPassword_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, privateKeyPassword_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(certificatePath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, certificatePath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, privateKeyPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPassword_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, privateKeyPassword_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, 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.sql.v1.ImportContext.SqlTdeImportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions other = + (com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions) obj; + + if (!getCertificatePath().equals(other.getCertificatePath())) return false; + if (!getPrivateKeyPath().equals(other.getPrivateKeyPath())) return false; + if (!getPrivateKeyPassword().equals(other.getPrivateKeyPassword())) return false; + 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) + CERTIFICATE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getCertificatePath().hashCode(); + hash = (37 * hash) + PRIVATE_KEY_PATH_FIELD_NUMBER; + hash = (53 * hash) + getPrivateKeyPath().hashCode(); + hash = (37 * hash) + PRIVATE_KEY_PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPrivateKeyPassword().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.sql.v1.ImportContext.SqlTdeImportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.ImportContext.SqlTdeImportOptions} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ImportContext.SqlTdeImportOptions) + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlTdeImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlTdeImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.class, + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + certificatePath_ = ""; + privateKeyPath_ = ""; + privateKeyPassword_ = ""; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_SqlTdeImportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions build() { + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions buildPartial() { + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions result = + new com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.certificatePath_ = certificatePath_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.privateKeyPath_ = privateKeyPath_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.privateKeyPassword_ = privateKeyPassword_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions) { + return mergeFrom((com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions other) { + if (other == com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.getDefaultInstance()) + return this; + if (!other.getCertificatePath().isEmpty()) { + certificatePath_ = other.certificatePath_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPrivateKeyPath().isEmpty()) { + privateKeyPath_ = other.privateKeyPath_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPrivateKeyPassword().isEmpty()) { + privateKeyPassword_ = other.privateKeyPassword_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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: + { + certificatePath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + privateKeyPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + privateKeyPassword_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 certificatePath_ = ""; + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The certificatePath. + */ + public java.lang.String getCertificatePath() { + java.lang.Object ref = certificatePath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certificatePath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for certificatePath. + */ + public com.google.protobuf.ByteString getCertificatePathBytes() { + java.lang.Object ref = certificatePath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certificatePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The certificatePath to set. + * @return This builder for chaining. + */ + public Builder setCertificatePath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + certificatePath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCertificatePath() { + certificatePath_ = getDefaultInstance().getCertificatePath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for certificatePath to set. + * @return This builder for chaining. + */ + public Builder setCertificatePathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + certificatePath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object privateKeyPath_ = ""; + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPath. + */ + public java.lang.String getPrivateKeyPath() { + java.lang.Object ref = privateKeyPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPath. + */ + public com.google.protobuf.ByteString getPrivateKeyPathBytes() { + java.lang.Object ref = privateKeyPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The privateKeyPath to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + privateKeyPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPrivateKeyPath() { + privateKeyPath_ = getDefaultInstance().getPrivateKeyPath(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for privateKeyPath to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + privateKeyPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object privateKeyPassword_ = ""; + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPassword. + */ + public java.lang.String getPrivateKeyPassword() { + java.lang.Object ref = privateKeyPassword_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPassword_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPassword. + */ + public com.google.protobuf.ByteString getPrivateKeyPasswordBytes() { + java.lang.Object ref = privateKeyPassword_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The privateKeyPassword to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + privateKeyPassword_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPrivateKeyPassword() { + privateKeyPassword_ = getDefaultInstance().getPrivateKeyPassword(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for privateKeyPassword to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + privateKeyPassword_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ImportContext.SqlTdeImportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ImportContext.SqlTdeImportOptions) + private static final com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions(); + } + + public static com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlTdeImportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object uri_ = ""; + + /** + * + * + *
+   * Path to the import file in Cloud Storage, in the form
+   * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+   * when `fileType` is `SQL`. The instance must have
+   * write permissions to the bucket and read access to the file.
+   * 
+ * + * string uri = 1; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + + /** + * + * + *
+   * Path to the import file in Cloud Storage, in the form
+   * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+   * when `fileType` is `SQL`. The instance must have
+   * write permissions to the bucket and read access to the file.
+   * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * The target database for the import. If `fileType` is `SQL`, this field
+   * is required only if the import file does not specify a database, and is
+   * overridden by any database specification in the import file. For entire
+   * instance parallel import operations, the database is overridden by the
+   * database name stored in subdirectory name. If
+   * `fileType` is `CSV`, one database must be specified.
+   * 
+ * + * string database = 2; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + + /** + * + * + *
+   * The target database for the import. If `fileType` is `SQL`, this field
+   * is required only if the import file does not specify a database, and is
+   * overridden by any database specification in the import file. For entire
+   * instance parallel import operations, the database is overridden by the
+   * database name stored in subdirectory name. If
+   * `fileType` is `CSV`, one database must be specified.
+   * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#importContext`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#importContext`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILE_TYPE_FIELD_NUMBER = 4; + private int fileType_ = 0; + + /** + * + * + *
+   * The file type for the specified uri.\`SQL`: The file
+   * contains SQL statements. \`CSV`: The file contains CSV data.
+   * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 4; + * + * @return The enum numeric value on the wire for fileType. + */ + @java.lang.Override + public int getFileTypeValue() { + return fileType_; + } + + /** + * + * + *
+   * The file type for the specified uri.\`SQL`: The file
+   * contains SQL statements. \`CSV`: The file contains CSV data.
+   * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 4; + * + * @return The fileType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlFileType getFileType() { + com.google.cloud.sql.v1.SqlFileType result = + com.google.cloud.sql.v1.SqlFileType.forNumber(fileType_); + return result == null ? com.google.cloud.sql.v1.SqlFileType.UNRECOGNIZED : result; + } + + public static final int CSV_IMPORT_OPTIONS_FIELD_NUMBER = 5; + private com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csvImportOptions_; + + /** + * + * + *
+   * Options for importing data as CSV.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + * @return Whether the csvImportOptions field is set. + */ + @java.lang.Override + public boolean hasCsvImportOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Options for importing data as CSV.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + * @return The csvImportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions getCsvImportOptions() { + return csvImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.getDefaultInstance() + : csvImportOptions_; + } + + /** + * + * + *
+   * Options for importing data as CSV.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptionsOrBuilder + getCsvImportOptionsOrBuilder() { + return csvImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.getDefaultInstance() + : csvImportOptions_; + } + + public static final int IMPORT_USER_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object importUser_ = ""; + + /** + * + * + *
+   * The PostgreSQL user for this import operation. PostgreSQL instances only.
+   * 
+ * + * string import_user = 6; + * + * @return The importUser. + */ + @java.lang.Override + public java.lang.String getImportUser() { + java.lang.Object ref = importUser_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + importUser_ = s; + return s; + } + } + + /** + * + * + *
+   * The PostgreSQL user for this import operation. PostgreSQL instances only.
+   * 
+ * + * string import_user = 6; + * + * @return The bytes for importUser. + */ + @java.lang.Override + public com.google.protobuf.ByteString getImportUserBytes() { + java.lang.Object ref = importUser_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + importUser_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BAK_IMPORT_OPTIONS_FIELD_NUMBER = 7; + private com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions bakImportOptions_; + + /** + * + * + *
+   * Import parameters specific to SQL Server .BAK files
+   * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + * @return Whether the bakImportOptions field is set. + */ + @java.lang.Override + public boolean hasBakImportOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Import parameters specific to SQL Server .BAK files
+   * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + * @return The bakImportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions getBakImportOptions() { + return bakImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.getDefaultInstance() + : bakImportOptions_; + } + + /** + * + * + *
+   * Import parameters specific to SQL Server .BAK files
+   * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptionsOrBuilder + getBakImportOptionsOrBuilder() { + return bakImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.getDefaultInstance() + : bakImportOptions_; + } + + public static final int SQL_IMPORT_OPTIONS_FIELD_NUMBER = 8; + private com.google.cloud.sql.v1.ImportContext.SqlImportOptions sqlImportOptions_; + + /** + * + * + *
+   * Optional. Options for importing data from SQL statements.
+   * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the sqlImportOptions field is set. + */ + @java.lang.Override + public boolean hasSqlImportOptions() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Options for importing data from SQL statements.
+   * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sqlImportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions getSqlImportOptions() { + return sqlImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlImportOptions.getDefaultInstance() + : sqlImportOptions_; + } + + /** + * + * + *
+   * Optional. Options for importing data from SQL statements.
+   * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlImportOptionsOrBuilder + getSqlImportOptionsOrBuilder() { + return sqlImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlImportOptions.getDefaultInstance() + : sqlImportOptions_; + } + + public static final int TDE_IMPORT_OPTIONS_FIELD_NUMBER = 9; + private com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tdeImportOptions_; + + /** + * + * + *
+   * Optional. Import parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tdeImportOptions field is set. + */ + @java.lang.Override + public boolean hasTdeImportOptions() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. Import parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tdeImportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions getTdeImportOptions() { + return tdeImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.getDefaultInstance() + : tdeImportOptions_; + } + + /** + * + * + *
+   * Optional. Import parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptionsOrBuilder + getTdeImportOptionsOrBuilder() { + return tdeImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.getDefaultInstance() + : tdeImportOptions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, uri_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + if (fileType_ != com.google.cloud.sql.v1.SqlFileType.SQL_FILE_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, fileType_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getCsvImportOptions()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(importUser_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, importUser_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(7, getBakImportOptions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(8, getSqlImportOptions()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(9, getTdeImportOptions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, uri_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + if (fileType_ != com.google.cloud.sql.v1.SqlFileType.SQL_FILE_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, fileType_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCsvImportOptions()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(importUser_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, importUser_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getBakImportOptions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSqlImportOptions()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getTdeImportOptions()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ImportContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ImportContext other = (com.google.cloud.sql.v1.ImportContext) obj; + + if (!getUri().equals(other.getUri())) return false; + if (!getDatabase().equals(other.getDatabase())) return false; + if (!getKind().equals(other.getKind())) return false; + if (fileType_ != other.fileType_) return false; + if (hasCsvImportOptions() != other.hasCsvImportOptions()) return false; + if (hasCsvImportOptions()) { + if (!getCsvImportOptions().equals(other.getCsvImportOptions())) return false; + } + if (!getImportUser().equals(other.getImportUser())) return false; + if (hasBakImportOptions() != other.hasBakImportOptions()) return false; + if (hasBakImportOptions()) { + if (!getBakImportOptions().equals(other.getBakImportOptions())) return false; + } + if (hasSqlImportOptions() != other.hasSqlImportOptions()) return false; + if (hasSqlImportOptions()) { + if (!getSqlImportOptions().equals(other.getSqlImportOptions())) return false; + } + if (hasTdeImportOptions() != other.hasTdeImportOptions()) return false; + if (hasTdeImportOptions()) { + if (!getTdeImportOptions().equals(other.getTdeImportOptions())) return false; + } + if (!getUnknownFields().equals(other.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) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + FILE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + fileType_; + if (hasCsvImportOptions()) { + hash = (37 * hash) + CSV_IMPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getCsvImportOptions().hashCode(); + } + hash = (37 * hash) + IMPORT_USER_FIELD_NUMBER; + hash = (53 * hash) + getImportUser().hashCode(); + if (hasBakImportOptions()) { + hash = (37 * hash) + BAK_IMPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getBakImportOptions().hashCode(); + } + if (hasSqlImportOptions()) { + hash = (37 * hash) + SQL_IMPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getSqlImportOptions().hashCode(); + } + if (hasTdeImportOptions()) { + hash = (37 * hash) + TDE_IMPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getTdeImportOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ImportContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ImportContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ImportContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ImportContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.ImportContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance import context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ImportContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ImportContext) + com.google.cloud.sql.v1.ImportContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ImportContext.class, + com.google.cloud.sql.v1.ImportContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ImportContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCsvImportOptionsFieldBuilder(); + internalGetBakImportOptionsFieldBuilder(); + internalGetSqlImportOptionsFieldBuilder(); + internalGetTdeImportOptionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + uri_ = ""; + database_ = ""; + kind_ = ""; + fileType_ = 0; + csvImportOptions_ = null; + if (csvImportOptionsBuilder_ != null) { + csvImportOptionsBuilder_.dispose(); + csvImportOptionsBuilder_ = null; + } + importUser_ = ""; + bakImportOptions_ = null; + if (bakImportOptionsBuilder_ != null) { + bakImportOptionsBuilder_.dispose(); + bakImportOptionsBuilder_ = null; + } + sqlImportOptions_ = null; + if (sqlImportOptionsBuilder_ != null) { + sqlImportOptionsBuilder_.dispose(); + sqlImportOptionsBuilder_ = null; + } + tdeImportOptions_ = null; + if (tdeImportOptionsBuilder_ != null) { + tdeImportOptionsBuilder_.dispose(); + tdeImportOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ImportContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ImportContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext build() { + com.google.cloud.sql.v1.ImportContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext buildPartial() { + com.google.cloud.sql.v1.ImportContext result = + new com.google.cloud.sql.v1.ImportContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ImportContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.uri_ = uri_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.database_ = database_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.fileType_ = fileType_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.csvImportOptions_ = + csvImportOptionsBuilder_ == null ? csvImportOptions_ : csvImportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.importUser_ = importUser_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.bakImportOptions_ = + bakImportOptionsBuilder_ == null ? bakImportOptions_ : bakImportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.sqlImportOptions_ = + sqlImportOptionsBuilder_ == null ? sqlImportOptions_ : sqlImportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.tdeImportOptions_ = + tdeImportOptionsBuilder_ == null ? tdeImportOptions_ : tdeImportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ImportContext) { + return mergeFrom((com.google.cloud.sql.v1.ImportContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ImportContext other) { + if (other == com.google.cloud.sql.v1.ImportContext.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.fileType_ != 0) { + setFileTypeValue(other.getFileTypeValue()); + } + if (other.hasCsvImportOptions()) { + mergeCsvImportOptions(other.getCsvImportOptions()); + } + if (!other.getImportUser().isEmpty()) { + importUser_ = other.importUser_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasBakImportOptions()) { + mergeBakImportOptions(other.getBakImportOptions()); + } + if (other.hasSqlImportOptions()) { + mergeSqlImportOptions(other.getSqlImportOptions()); + } + if (other.hasTdeImportOptions()) { + mergeTdeImportOptions(other.getTdeImportOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + database_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + fileType_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + input.readMessage( + internalGetCsvImportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + importUser_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetBakImportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage( + internalGetSqlImportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + input.readMessage( + internalGetTdeImportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object uri_ = ""; + + /** + * + * + *
+     * Path to the import file in Cloud Storage, in the form
+     * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+     * when `fileType` is `SQL`. The instance must have
+     * write permissions to the bucket and read access to the file.
+     * 
+ * + * string uri = 1; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Path to the import file in Cloud Storage, in the form
+     * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+     * when `fileType` is `SQL`. The instance must have
+     * write permissions to the bucket and read access to the file.
+     * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Path to the import file in Cloud Storage, in the form
+     * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+     * when `fileType` is `SQL`. The instance must have
+     * write permissions to the bucket and read access to the file.
+     * 
+ * + * string uri = 1; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Path to the import file in Cloud Storage, in the form
+     * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+     * when `fileType` is `SQL`. The instance must have
+     * write permissions to the bucket and read access to the file.
+     * 
+ * + * string uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Path to the import file in Cloud Storage, in the form
+     * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+     * when `fileType` is `SQL`. The instance must have
+     * write permissions to the bucket and read access to the file.
+     * 
+ * + * string uri = 1; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object database_ = ""; + + /** + * + * + *
+     * The target database for the import. If `fileType` is `SQL`, this field
+     * is required only if the import file does not specify a database, and is
+     * overridden by any database specification in the import file. For entire
+     * instance parallel import operations, the database is overridden by the
+     * database name stored in subdirectory name. If
+     * `fileType` is `CSV`, one database must be specified.
+     * 
+ * + * string database = 2; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The target database for the import. If `fileType` is `SQL`, this field
+     * is required only if the import file does not specify a database, and is
+     * overridden by any database specification in the import file. For entire
+     * instance parallel import operations, the database is overridden by the
+     * database name stored in subdirectory name. If
+     * `fileType` is `CSV`, one database must be specified.
+     * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The target database for the import. If `fileType` is `SQL`, this field
+     * is required only if the import file does not specify a database, and is
+     * overridden by any database specification in the import file. For entire
+     * instance parallel import operations, the database is overridden by the
+     * database name stored in subdirectory name. If
+     * `fileType` is `CSV`, one database must be specified.
+     * 
+ * + * string database = 2; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + database_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The target database for the import. If `fileType` is `SQL`, this field
+     * is required only if the import file does not specify a database, and is
+     * overridden by any database specification in the import file. For entire
+     * instance parallel import operations, the database is overridden by the
+     * database name stored in subdirectory name. If
+     * `fileType` is `CSV`, one database must be specified.
+     * 
+ * + * string database = 2; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The target database for the import. If `fileType` is `SQL`, this field
+     * is required only if the import file does not specify a database, and is
+     * overridden by any database specification in the import file. For entire
+     * instance parallel import operations, the database is overridden by the
+     * database name stored in subdirectory name. If
+     * `fileType` is `CSV`, one database must be specified.
+     * 
+ * + * string database = 2; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + database_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#importContext`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#importContext`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#importContext`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#importContext`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#importContext`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int fileType_ = 0; + + /** + * + * + *
+     * The file type for the specified uri.\`SQL`: The file
+     * contains SQL statements. \`CSV`: The file contains CSV data.
+     * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 4; + * + * @return The enum numeric value on the wire for fileType. + */ + @java.lang.Override + public int getFileTypeValue() { + return fileType_; + } + + /** + * + * + *
+     * The file type for the specified uri.\`SQL`: The file
+     * contains SQL statements. \`CSV`: The file contains CSV data.
+     * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 4; + * + * @param value The enum numeric value on the wire for fileType to set. + * @return This builder for chaining. + */ + public Builder setFileTypeValue(int value) { + fileType_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The file type for the specified uri.\`SQL`: The file
+     * contains SQL statements. \`CSV`: The file contains CSV data.
+     * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 4; + * + * @return The fileType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlFileType getFileType() { + com.google.cloud.sql.v1.SqlFileType result = + com.google.cloud.sql.v1.SqlFileType.forNumber(fileType_); + return result == null ? com.google.cloud.sql.v1.SqlFileType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The file type for the specified uri.\`SQL`: The file
+     * contains SQL statements. \`CSV`: The file contains CSV data.
+     * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 4; + * + * @param value The fileType to set. + * @return This builder for chaining. + */ + public Builder setFileType(com.google.cloud.sql.v1.SqlFileType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + fileType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The file type for the specified uri.\`SQL`: The file
+     * contains SQL statements. \`CSV`: The file contains CSV data.
+     * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 4; + * + * @return This builder for chaining. + */ + public Builder clearFileType() { + bitField0_ = (bitField0_ & ~0x00000008); + fileType_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csvImportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptionsOrBuilder> + csvImportOptionsBuilder_; + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + * @return Whether the csvImportOptions field is set. + */ + public boolean hasCsvImportOptions() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + * @return The csvImportOptions. + */ + public com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions getCsvImportOptions() { + if (csvImportOptionsBuilder_ == null) { + return csvImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.getDefaultInstance() + : csvImportOptions_; + } else { + return csvImportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + */ + public Builder setCsvImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions value) { + if (csvImportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + csvImportOptions_ = value; + } else { + csvImportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + */ + public Builder setCsvImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.Builder builderForValue) { + if (csvImportOptionsBuilder_ == null) { + csvImportOptions_ = builderForValue.build(); + } else { + csvImportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + */ + public Builder mergeCsvImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions value) { + if (csvImportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && csvImportOptions_ != null + && csvImportOptions_ + != com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.getDefaultInstance()) { + getCsvImportOptionsBuilder().mergeFrom(value); + } else { + csvImportOptions_ = value; + } + } else { + csvImportOptionsBuilder_.mergeFrom(value); + } + if (csvImportOptions_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + */ + public Builder clearCsvImportOptions() { + bitField0_ = (bitField0_ & ~0x00000010); + csvImportOptions_ = null; + if (csvImportOptionsBuilder_ != null) { + csvImportOptionsBuilder_.dispose(); + csvImportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + */ + public com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.Builder + getCsvImportOptionsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetCsvImportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + */ + public com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptionsOrBuilder + getCsvImportOptionsOrBuilder() { + if (csvImportOptionsBuilder_ != null) { + return csvImportOptionsBuilder_.getMessageOrBuilder(); + } else { + return csvImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.getDefaultInstance() + : csvImportOptions_; + } + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptionsOrBuilder> + internalGetCsvImportOptionsFieldBuilder() { + if (csvImportOptionsBuilder_ == null) { + csvImportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptionsOrBuilder>( + getCsvImportOptions(), getParentForChildren(), isClean()); + csvImportOptions_ = null; + } + return csvImportOptionsBuilder_; + } + + private java.lang.Object importUser_ = ""; + + /** + * + * + *
+     * The PostgreSQL user for this import operation. PostgreSQL instances only.
+     * 
+ * + * string import_user = 6; + * + * @return The importUser. + */ + public java.lang.String getImportUser() { + java.lang.Object ref = importUser_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + importUser_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The PostgreSQL user for this import operation. PostgreSQL instances only.
+     * 
+ * + * string import_user = 6; + * + * @return The bytes for importUser. + */ + public com.google.protobuf.ByteString getImportUserBytes() { + java.lang.Object ref = importUser_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + importUser_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The PostgreSQL user for this import operation. PostgreSQL instances only.
+     * 
+ * + * string import_user = 6; + * + * @param value The importUser to set. + * @return This builder for chaining. + */ + public Builder setImportUser(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + importUser_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The PostgreSQL user for this import operation. PostgreSQL instances only.
+     * 
+ * + * string import_user = 6; + * + * @return This builder for chaining. + */ + public Builder clearImportUser() { + importUser_ = getDefaultInstance().getImportUser(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * The PostgreSQL user for this import operation. PostgreSQL instances only.
+     * 
+ * + * string import_user = 6; + * + * @param value The bytes for importUser to set. + * @return This builder for chaining. + */ + public Builder setImportUserBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + importUser_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions bakImportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptionsOrBuilder> + bakImportOptionsBuilder_; + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + * @return Whether the bakImportOptions field is set. + */ + public boolean hasBakImportOptions() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + * @return The bakImportOptions. + */ + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions getBakImportOptions() { + if (bakImportOptionsBuilder_ == null) { + return bakImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.getDefaultInstance() + : bakImportOptions_; + } else { + return bakImportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + */ + public Builder setBakImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions value) { + if (bakImportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bakImportOptions_ = value; + } else { + bakImportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + */ + public Builder setBakImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.Builder builderForValue) { + if (bakImportOptionsBuilder_ == null) { + bakImportOptions_ = builderForValue.build(); + } else { + bakImportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + */ + public Builder mergeBakImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions value) { + if (bakImportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && bakImportOptions_ != null + && bakImportOptions_ + != com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.getDefaultInstance()) { + getBakImportOptionsBuilder().mergeFrom(value); + } else { + bakImportOptions_ = value; + } + } else { + bakImportOptionsBuilder_.mergeFrom(value); + } + if (bakImportOptions_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + */ + public Builder clearBakImportOptions() { + bitField0_ = (bitField0_ & ~0x00000040); + bakImportOptions_ = null; + if (bakImportOptionsBuilder_ != null) { + bakImportOptionsBuilder_.dispose(); + bakImportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + */ + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.Builder + getBakImportOptionsBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetBakImportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + */ + public com.google.cloud.sql.v1.ImportContext.SqlBakImportOptionsOrBuilder + getBakImportOptionsOrBuilder() { + if (bakImportOptionsBuilder_ != null) { + return bakImportOptionsBuilder_.getMessageOrBuilder(); + } else { + return bakImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.getDefaultInstance() + : bakImportOptions_; + } + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptionsOrBuilder> + internalGetBakImportOptionsFieldBuilder() { + if (bakImportOptionsBuilder_ == null) { + bakImportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptionsOrBuilder>( + getBakImportOptions(), getParentForChildren(), isClean()); + bakImportOptions_ = null; + } + return bakImportOptionsBuilder_; + } + + private com.google.cloud.sql.v1.ImportContext.SqlImportOptions sqlImportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlImportOptionsOrBuilder> + sqlImportOptionsBuilder_; + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the sqlImportOptions field is set. + */ + public boolean hasSqlImportOptions() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sqlImportOptions. + */ + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions getSqlImportOptions() { + if (sqlImportOptionsBuilder_ == null) { + return sqlImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlImportOptions.getDefaultInstance() + : sqlImportOptions_; + } else { + return sqlImportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSqlImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlImportOptions value) { + if (sqlImportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sqlImportOptions_ = value; + } else { + sqlImportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSqlImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.Builder builderForValue) { + if (sqlImportOptionsBuilder_ == null) { + sqlImportOptions_ = builderForValue.build(); + } else { + sqlImportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeSqlImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlImportOptions value) { + if (sqlImportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && sqlImportOptions_ != null + && sqlImportOptions_ + != com.google.cloud.sql.v1.ImportContext.SqlImportOptions.getDefaultInstance()) { + getSqlImportOptionsBuilder().mergeFrom(value); + } else { + sqlImportOptions_ = value; + } + } else { + sqlImportOptionsBuilder_.mergeFrom(value); + } + if (sqlImportOptions_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSqlImportOptions() { + bitField0_ = (bitField0_ & ~0x00000080); + sqlImportOptions_ = null; + if (sqlImportOptionsBuilder_ != null) { + sqlImportOptionsBuilder_.dispose(); + sqlImportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ImportContext.SqlImportOptions.Builder + getSqlImportOptionsBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetSqlImportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ImportContext.SqlImportOptionsOrBuilder + getSqlImportOptionsOrBuilder() { + if (sqlImportOptionsBuilder_ != null) { + return sqlImportOptionsBuilder_.getMessageOrBuilder(); + } else { + return sqlImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlImportOptions.getDefaultInstance() + : sqlImportOptions_; + } + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlImportOptionsOrBuilder> + internalGetSqlImportOptionsFieldBuilder() { + if (sqlImportOptionsBuilder_ == null) { + sqlImportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlImportOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlImportOptionsOrBuilder>( + getSqlImportOptions(), getParentForChildren(), isClean()); + sqlImportOptions_ = null; + } + return sqlImportOptionsBuilder_; + } + + private com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tdeImportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptionsOrBuilder> + tdeImportOptionsBuilder_; + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tdeImportOptions field is set. + */ + public boolean hasTdeImportOptions() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tdeImportOptions. + */ + public com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions getTdeImportOptions() { + if (tdeImportOptionsBuilder_ == null) { + return tdeImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.getDefaultInstance() + : tdeImportOptions_; + } else { + return tdeImportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTdeImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions value) { + if (tdeImportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tdeImportOptions_ = value; + } else { + tdeImportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTdeImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.Builder builderForValue) { + if (tdeImportOptionsBuilder_ == null) { + tdeImportOptions_ = builderForValue.build(); + } else { + tdeImportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeTdeImportOptions( + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions value) { + if (tdeImportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && tdeImportOptions_ != null + && tdeImportOptions_ + != com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.getDefaultInstance()) { + getTdeImportOptionsBuilder().mergeFrom(value); + } else { + tdeImportOptions_ = value; + } + } else { + tdeImportOptionsBuilder_.mergeFrom(value); + } + if (tdeImportOptions_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTdeImportOptions() { + bitField0_ = (bitField0_ & ~0x00000100); + tdeImportOptions_ = null; + if (tdeImportOptionsBuilder_ != null) { + tdeImportOptionsBuilder_.dispose(); + tdeImportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.Builder + getTdeImportOptionsBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetTdeImportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptionsOrBuilder + getTdeImportOptionsOrBuilder() { + if (tdeImportOptionsBuilder_ != null) { + return tdeImportOptionsBuilder_.getMessageOrBuilder(); + } else { + return tdeImportOptions_ == null + ? com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.getDefaultInstance() + : tdeImportOptions_; + } + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptionsOrBuilder> + internalGetTdeImportOptionsFieldBuilder() { + if (tdeImportOptionsBuilder_ == null) { + tdeImportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions, + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.Builder, + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptionsOrBuilder>( + getTdeImportOptions(), getParentForChildren(), isClean()); + tdeImportOptions_ = null; + } + return tdeImportOptionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ImportContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ImportContext) + private static final com.google.cloud.sql.v1.ImportContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ImportContext(); + } + + public static com.google.cloud.sql.v1.ImportContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ImportContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ImportContextOrBuilder.java new file mode 100644 index 000000000000..75429d312ba3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ImportContextOrBuilder.java @@ -0,0 +1,336 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ImportContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ImportContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Path to the import file in Cloud Storage, in the form
+   * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+   * when `fileType` is `SQL`. The instance must have
+   * write permissions to the bucket and read access to the file.
+   * 
+ * + * string uri = 1; + * + * @return The uri. + */ + java.lang.String getUri(); + + /** + * + * + *
+   * Path to the import file in Cloud Storage, in the form
+   * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+   * when `fileType` is `SQL`. The instance must have
+   * write permissions to the bucket and read access to the file.
+   * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * The target database for the import. If `fileType` is `SQL`, this field
+   * is required only if the import file does not specify a database, and is
+   * overridden by any database specification in the import file. For entire
+   * instance parallel import operations, the database is overridden by the
+   * database name stored in subdirectory name. If
+   * `fileType` is `CSV`, one database must be specified.
+   * 
+ * + * string database = 2; + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * The target database for the import. If `fileType` is `SQL`, this field
+   * is required only if the import file does not specify a database, and is
+   * overridden by any database specification in the import file. For entire
+   * instance parallel import operations, the database is overridden by the
+   * database name stored in subdirectory name. If
+   * `fileType` is `CSV`, one database must be specified.
+   * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * This is always `sql#importContext`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#importContext`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The file type for the specified uri.\`SQL`: The file
+   * contains SQL statements. \`CSV`: The file contains CSV data.
+   * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 4; + * + * @return The enum numeric value on the wire for fileType. + */ + int getFileTypeValue(); + + /** + * + * + *
+   * The file type for the specified uri.\`SQL`: The file
+   * contains SQL statements. \`CSV`: The file contains CSV data.
+   * 
+ * + * .google.cloud.sql.v1.SqlFileType file_type = 4; + * + * @return The fileType. + */ + com.google.cloud.sql.v1.SqlFileType getFileType(); + + /** + * + * + *
+   * Options for importing data as CSV.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + * @return Whether the csvImportOptions field is set. + */ + boolean hasCsvImportOptions(); + + /** + * + * + *
+   * Options for importing data as CSV.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + * @return The csvImportOptions. + */ + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions getCsvImportOptions(); + + /** + * + * + *
+   * Options for importing data as CSV.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlCsvImportOptions csv_import_options = 5; + */ + com.google.cloud.sql.v1.ImportContext.SqlCsvImportOptionsOrBuilder getCsvImportOptionsOrBuilder(); + + /** + * + * + *
+   * The PostgreSQL user for this import operation. PostgreSQL instances only.
+   * 
+ * + * string import_user = 6; + * + * @return The importUser. + */ + java.lang.String getImportUser(); + + /** + * + * + *
+   * The PostgreSQL user for this import operation. PostgreSQL instances only.
+   * 
+ * + * string import_user = 6; + * + * @return The bytes for importUser. + */ + com.google.protobuf.ByteString getImportUserBytes(); + + /** + * + * + *
+   * Import parameters specific to SQL Server .BAK files
+   * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + * @return Whether the bakImportOptions field is set. + */ + boolean hasBakImportOptions(); + + /** + * + * + *
+   * Import parameters specific to SQL Server .BAK files
+   * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + * @return The bakImportOptions. + */ + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptions getBakImportOptions(); + + /** + * + * + *
+   * Import parameters specific to SQL Server .BAK files
+   * 
+ * + * .google.cloud.sql.v1.ImportContext.SqlBakImportOptions bak_import_options = 7; + */ + com.google.cloud.sql.v1.ImportContext.SqlBakImportOptionsOrBuilder getBakImportOptionsOrBuilder(); + + /** + * + * + *
+   * Optional. Options for importing data from SQL statements.
+   * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the sqlImportOptions field is set. + */ + boolean hasSqlImportOptions(); + + /** + * + * + *
+   * Optional. Options for importing data from SQL statements.
+   * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sqlImportOptions. + */ + com.google.cloud.sql.v1.ImportContext.SqlImportOptions getSqlImportOptions(); + + /** + * + * + *
+   * Optional. Options for importing data from SQL statements.
+   * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.ImportContext.SqlImportOptionsOrBuilder getSqlImportOptionsOrBuilder(); + + /** + * + * + *
+   * Optional. Import parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tdeImportOptions field is set. + */ + boolean hasTdeImportOptions(); + + /** + * + * + *
+   * Optional. Import parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tdeImportOptions. + */ + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions getTdeImportOptions(); + + /** + * + * + *
+   * Optional. Import parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.ImportContext.SqlTdeImportOptionsOrBuilder getTdeImportOptionsOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InsightsConfig.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InsightsConfig.java new file mode 100644 index 000000000000..7ba1b9c69932 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InsightsConfig.java @@ -0,0 +1,1642 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Insights configuration. This specifies when Cloud SQL Insights feature is
+ * enabled and optional configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InsightsConfig} + */ +@com.google.protobuf.Generated +public final class InsightsConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InsightsConfig) + InsightsConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InsightsConfig"); + } + + // Use InsightsConfig.newBuilder() to construct. + private InsightsConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InsightsConfig() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_InsightsConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_InsightsConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InsightsConfig.class, + com.google.cloud.sql.v1.InsightsConfig.Builder.class); + } + + private int bitField0_; + public static final int QUERY_INSIGHTS_ENABLED_FIELD_NUMBER = 1; + private boolean queryInsightsEnabled_ = false; + + /** + * + * + *
+   * Whether Query Insights feature is enabled.
+   * 
+ * + * bool query_insights_enabled = 1; + * + * @return The queryInsightsEnabled. + */ + @java.lang.Override + public boolean getQueryInsightsEnabled() { + return queryInsightsEnabled_; + } + + public static final int RECORD_CLIENT_ADDRESS_FIELD_NUMBER = 2; + private boolean recordClientAddress_ = false; + + /** + * + * + *
+   * Whether Query Insights will record client address when enabled.
+   * 
+ * + * bool record_client_address = 2; + * + * @return The recordClientAddress. + */ + @java.lang.Override + public boolean getRecordClientAddress() { + return recordClientAddress_; + } + + public static final int RECORD_APPLICATION_TAGS_FIELD_NUMBER = 3; + private boolean recordApplicationTags_ = false; + + /** + * + * + *
+   * Whether Query Insights will record application tags from query when
+   * enabled.
+   * 
+ * + * bool record_application_tags = 3; + * + * @return The recordApplicationTags. + */ + @java.lang.Override + public boolean getRecordApplicationTags() { + return recordApplicationTags_; + } + + public static final int QUERY_STRING_LENGTH_FIELD_NUMBER = 4; + private com.google.protobuf.Int32Value queryStringLength_; + + /** + * + * + *
+   * Maximum query length stored in bytes. Default value: 1024 bytes.
+   * Range: 256-4500 bytes. Query lengths greater than this field value will be
+   * truncated to this value. When unset, query length will be the default
+   * value. Changing query length will restart the database.
+   * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + * + * @return Whether the queryStringLength field is set. + */ + @java.lang.Override + public boolean hasQueryStringLength() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Maximum query length stored in bytes. Default value: 1024 bytes.
+   * Range: 256-4500 bytes. Query lengths greater than this field value will be
+   * truncated to this value. When unset, query length will be the default
+   * value. Changing query length will restart the database.
+   * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + * + * @return The queryStringLength. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getQueryStringLength() { + return queryStringLength_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryStringLength_; + } + + /** + * + * + *
+   * Maximum query length stored in bytes. Default value: 1024 bytes.
+   * Range: 256-4500 bytes. Query lengths greater than this field value will be
+   * truncated to this value. When unset, query length will be the default
+   * value. Changing query length will restart the database.
+   * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getQueryStringLengthOrBuilder() { + return queryStringLength_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryStringLength_; + } + + public static final int QUERY_PLANS_PER_MINUTE_FIELD_NUMBER = 5; + private com.google.protobuf.Int32Value queryPlansPerMinute_; + + /** + * + * + *
+   * Number of query execution plans captured by Insights per minute
+   * for all queries combined. Default is 5.
+   * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + @java.lang.Override + public boolean hasQueryPlansPerMinute() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Number of query execution plans captured by Insights per minute
+   * for all queries combined. Default is 5.
+   * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getQueryPlansPerMinute() { + return queryPlansPerMinute_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryPlansPerMinute_; + } + + /** + * + * + *
+   * Number of query execution plans captured by Insights per minute
+   * for all queries combined. Default is 5.
+   * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getQueryPlansPerMinuteOrBuilder() { + return queryPlansPerMinute_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryPlansPerMinute_; + } + + public static final int ENHANCED_QUERY_INSIGHTS_ENABLED_FIELD_NUMBER = 8; + private com.google.protobuf.BoolValue enhancedQueryInsightsEnabled_; + + /** + * + * + *
+   * Optional. Whether enhanced query insights feature is enabled.
+   * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enhancedQueryInsightsEnabled field is set. + */ + @java.lang.Override + public boolean hasEnhancedQueryInsightsEnabled() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Whether enhanced query insights feature is enabled.
+   * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enhancedQueryInsightsEnabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnhancedQueryInsightsEnabled() { + return enhancedQueryInsightsEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enhancedQueryInsightsEnabled_; + } + + /** + * + * + *
+   * Optional. Whether enhanced query insights feature is enabled.
+   * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getEnhancedQueryInsightsEnabledOrBuilder() { + return enhancedQueryInsightsEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enhancedQueryInsightsEnabled_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (queryInsightsEnabled_ != false) { + output.writeBool(1, queryInsightsEnabled_); + } + if (recordClientAddress_ != false) { + output.writeBool(2, recordClientAddress_); + } + if (recordApplicationTags_ != false) { + output.writeBool(3, recordApplicationTags_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getQueryStringLength()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getQueryPlansPerMinute()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(8, getEnhancedQueryInsightsEnabled()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (queryInsightsEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, queryInsightsEnabled_); + } + if (recordClientAddress_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, recordClientAddress_); + } + if (recordApplicationTags_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, recordApplicationTags_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getQueryStringLength()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getQueryPlansPerMinute()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, getEnhancedQueryInsightsEnabled()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InsightsConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InsightsConfig other = (com.google.cloud.sql.v1.InsightsConfig) obj; + + if (getQueryInsightsEnabled() != other.getQueryInsightsEnabled()) return false; + if (getRecordClientAddress() != other.getRecordClientAddress()) return false; + if (getRecordApplicationTags() != other.getRecordApplicationTags()) return false; + if (hasQueryStringLength() != other.hasQueryStringLength()) return false; + if (hasQueryStringLength()) { + if (!getQueryStringLength().equals(other.getQueryStringLength())) return false; + } + if (hasQueryPlansPerMinute() != other.hasQueryPlansPerMinute()) return false; + if (hasQueryPlansPerMinute()) { + if (!getQueryPlansPerMinute().equals(other.getQueryPlansPerMinute())) return false; + } + if (hasEnhancedQueryInsightsEnabled() != other.hasEnhancedQueryInsightsEnabled()) return false; + if (hasEnhancedQueryInsightsEnabled()) { + if (!getEnhancedQueryInsightsEnabled().equals(other.getEnhancedQueryInsightsEnabled())) + return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + QUERY_INSIGHTS_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getQueryInsightsEnabled()); + hash = (37 * hash) + RECORD_CLIENT_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRecordClientAddress()); + hash = (37 * hash) + RECORD_APPLICATION_TAGS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRecordApplicationTags()); + if (hasQueryStringLength()) { + hash = (37 * hash) + QUERY_STRING_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getQueryStringLength().hashCode(); + } + if (hasQueryPlansPerMinute()) { + hash = (37 * hash) + QUERY_PLANS_PER_MINUTE_FIELD_NUMBER; + hash = (53 * hash) + getQueryPlansPerMinute().hashCode(); + } + if (hasEnhancedQueryInsightsEnabled()) { + hash = (37 * hash) + ENHANCED_QUERY_INSIGHTS_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getEnhancedQueryInsightsEnabled().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InsightsConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InsightsConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InsightsConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InsightsConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InsightsConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InsightsConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InsightsConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InsightsConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InsightsConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InsightsConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InsightsConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InsightsConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.InsightsConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Insights configuration. This specifies when Cloud SQL Insights feature is
+   * enabled and optional configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InsightsConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InsightsConfig) + com.google.cloud.sql.v1.InsightsConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_InsightsConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_InsightsConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InsightsConfig.class, + com.google.cloud.sql.v1.InsightsConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InsightsConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetQueryStringLengthFieldBuilder(); + internalGetQueryPlansPerMinuteFieldBuilder(); + internalGetEnhancedQueryInsightsEnabledFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + queryInsightsEnabled_ = false; + recordClientAddress_ = false; + recordApplicationTags_ = false; + queryStringLength_ = null; + if (queryStringLengthBuilder_ != null) { + queryStringLengthBuilder_.dispose(); + queryStringLengthBuilder_ = null; + } + queryPlansPerMinute_ = null; + if (queryPlansPerMinuteBuilder_ != null) { + queryPlansPerMinuteBuilder_.dispose(); + queryPlansPerMinuteBuilder_ = null; + } + enhancedQueryInsightsEnabled_ = null; + if (enhancedQueryInsightsEnabledBuilder_ != null) { + enhancedQueryInsightsEnabledBuilder_.dispose(); + enhancedQueryInsightsEnabledBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_InsightsConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InsightsConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InsightsConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InsightsConfig build() { + com.google.cloud.sql.v1.InsightsConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InsightsConfig buildPartial() { + com.google.cloud.sql.v1.InsightsConfig result = + new com.google.cloud.sql.v1.InsightsConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.InsightsConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.queryInsightsEnabled_ = queryInsightsEnabled_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recordClientAddress_ = recordClientAddress_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.recordApplicationTags_ = recordApplicationTags_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.queryStringLength_ = + queryStringLengthBuilder_ == null + ? queryStringLength_ + : queryStringLengthBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.queryPlansPerMinute_ = + queryPlansPerMinuteBuilder_ == null + ? queryPlansPerMinute_ + : queryPlansPerMinuteBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.enhancedQueryInsightsEnabled_ = + enhancedQueryInsightsEnabledBuilder_ == null + ? enhancedQueryInsightsEnabled_ + : enhancedQueryInsightsEnabledBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InsightsConfig) { + return mergeFrom((com.google.cloud.sql.v1.InsightsConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InsightsConfig other) { + if (other == com.google.cloud.sql.v1.InsightsConfig.getDefaultInstance()) return this; + if (other.getQueryInsightsEnabled() != false) { + setQueryInsightsEnabled(other.getQueryInsightsEnabled()); + } + if (other.getRecordClientAddress() != false) { + setRecordClientAddress(other.getRecordClientAddress()); + } + if (other.getRecordApplicationTags() != false) { + setRecordApplicationTags(other.getRecordApplicationTags()); + } + if (other.hasQueryStringLength()) { + mergeQueryStringLength(other.getQueryStringLength()); + } + if (other.hasQueryPlansPerMinute()) { + mergeQueryPlansPerMinute(other.getQueryPlansPerMinute()); + } + if (other.hasEnhancedQueryInsightsEnabled()) { + mergeEnhancedQueryInsightsEnabled(other.getEnhancedQueryInsightsEnabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + queryInsightsEnabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + recordClientAddress_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + recordApplicationTags_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage( + internalGetQueryStringLengthFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetQueryPlansPerMinuteFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 66: + { + input.readMessage( + internalGetEnhancedQueryInsightsEnabledFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean queryInsightsEnabled_; + + /** + * + * + *
+     * Whether Query Insights feature is enabled.
+     * 
+ * + * bool query_insights_enabled = 1; + * + * @return The queryInsightsEnabled. + */ + @java.lang.Override + public boolean getQueryInsightsEnabled() { + return queryInsightsEnabled_; + } + + /** + * + * + *
+     * Whether Query Insights feature is enabled.
+     * 
+ * + * bool query_insights_enabled = 1; + * + * @param value The queryInsightsEnabled to set. + * @return This builder for chaining. + */ + public Builder setQueryInsightsEnabled(boolean value) { + + queryInsightsEnabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether Query Insights feature is enabled.
+     * 
+ * + * bool query_insights_enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearQueryInsightsEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + queryInsightsEnabled_ = false; + onChanged(); + return this; + } + + private boolean recordClientAddress_; + + /** + * + * + *
+     * Whether Query Insights will record client address when enabled.
+     * 
+ * + * bool record_client_address = 2; + * + * @return The recordClientAddress. + */ + @java.lang.Override + public boolean getRecordClientAddress() { + return recordClientAddress_; + } + + /** + * + * + *
+     * Whether Query Insights will record client address when enabled.
+     * 
+ * + * bool record_client_address = 2; + * + * @param value The recordClientAddress to set. + * @return This builder for chaining. + */ + public Builder setRecordClientAddress(boolean value) { + + recordClientAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether Query Insights will record client address when enabled.
+     * 
+ * + * bool record_client_address = 2; + * + * @return This builder for chaining. + */ + public Builder clearRecordClientAddress() { + bitField0_ = (bitField0_ & ~0x00000002); + recordClientAddress_ = false; + onChanged(); + return this; + } + + private boolean recordApplicationTags_; + + /** + * + * + *
+     * Whether Query Insights will record application tags from query when
+     * enabled.
+     * 
+ * + * bool record_application_tags = 3; + * + * @return The recordApplicationTags. + */ + @java.lang.Override + public boolean getRecordApplicationTags() { + return recordApplicationTags_; + } + + /** + * + * + *
+     * Whether Query Insights will record application tags from query when
+     * enabled.
+     * 
+ * + * bool record_application_tags = 3; + * + * @param value The recordApplicationTags to set. + * @return This builder for chaining. + */ + public Builder setRecordApplicationTags(boolean value) { + + recordApplicationTags_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether Query Insights will record application tags from query when
+     * enabled.
+     * 
+ * + * bool record_application_tags = 3; + * + * @return This builder for chaining. + */ + public Builder clearRecordApplicationTags() { + bitField0_ = (bitField0_ & ~0x00000004); + recordApplicationTags_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Int32Value queryStringLength_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + queryStringLengthBuilder_; + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + * + * @return Whether the queryStringLength field is set. + */ + public boolean hasQueryStringLength() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + * + * @return The queryStringLength. + */ + public com.google.protobuf.Int32Value getQueryStringLength() { + if (queryStringLengthBuilder_ == null) { + return queryStringLength_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryStringLength_; + } else { + return queryStringLengthBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + public Builder setQueryStringLength(com.google.protobuf.Int32Value value) { + if (queryStringLengthBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryStringLength_ = value; + } else { + queryStringLengthBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + public Builder setQueryStringLength(com.google.protobuf.Int32Value.Builder builderForValue) { + if (queryStringLengthBuilder_ == null) { + queryStringLength_ = builderForValue.build(); + } else { + queryStringLengthBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + public Builder mergeQueryStringLength(com.google.protobuf.Int32Value value) { + if (queryStringLengthBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && queryStringLength_ != null + && queryStringLength_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getQueryStringLengthBuilder().mergeFrom(value); + } else { + queryStringLength_ = value; + } + } else { + queryStringLengthBuilder_.mergeFrom(value); + } + if (queryStringLength_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + public Builder clearQueryStringLength() { + bitField0_ = (bitField0_ & ~0x00000008); + queryStringLength_ = null; + if (queryStringLengthBuilder_ != null) { + queryStringLengthBuilder_.dispose(); + queryStringLengthBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + public com.google.protobuf.Int32Value.Builder getQueryStringLengthBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetQueryStringLengthFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + public com.google.protobuf.Int32ValueOrBuilder getQueryStringLengthOrBuilder() { + if (queryStringLengthBuilder_ != null) { + return queryStringLengthBuilder_.getMessageOrBuilder(); + } else { + return queryStringLength_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryStringLength_; + } + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetQueryStringLengthFieldBuilder() { + if (queryStringLengthBuilder_ == null) { + queryStringLengthBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getQueryStringLength(), getParentForChildren(), isClean()); + queryStringLength_ = null; + } + return queryStringLengthBuilder_; + } + + private com.google.protobuf.Int32Value queryPlansPerMinute_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + queryPlansPerMinuteBuilder_; + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + public boolean hasQueryPlansPerMinute() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + public com.google.protobuf.Int32Value getQueryPlansPerMinute() { + if (queryPlansPerMinuteBuilder_ == null) { + return queryPlansPerMinute_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryPlansPerMinute_; + } else { + return queryPlansPerMinuteBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + public Builder setQueryPlansPerMinute(com.google.protobuf.Int32Value value) { + if (queryPlansPerMinuteBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryPlansPerMinute_ = value; + } else { + queryPlansPerMinuteBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + public Builder setQueryPlansPerMinute(com.google.protobuf.Int32Value.Builder builderForValue) { + if (queryPlansPerMinuteBuilder_ == null) { + queryPlansPerMinute_ = builderForValue.build(); + } else { + queryPlansPerMinuteBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + public Builder mergeQueryPlansPerMinute(com.google.protobuf.Int32Value value) { + if (queryPlansPerMinuteBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && queryPlansPerMinute_ != null + && queryPlansPerMinute_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getQueryPlansPerMinuteBuilder().mergeFrom(value); + } else { + queryPlansPerMinute_ = value; + } + } else { + queryPlansPerMinuteBuilder_.mergeFrom(value); + } + if (queryPlansPerMinute_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + public Builder clearQueryPlansPerMinute() { + bitField0_ = (bitField0_ & ~0x00000010); + queryPlansPerMinute_ = null; + if (queryPlansPerMinuteBuilder_ != null) { + queryPlansPerMinuteBuilder_.dispose(); + queryPlansPerMinuteBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + public com.google.protobuf.Int32Value.Builder getQueryPlansPerMinuteBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetQueryPlansPerMinuteFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + public com.google.protobuf.Int32ValueOrBuilder getQueryPlansPerMinuteOrBuilder() { + if (queryPlansPerMinuteBuilder_ != null) { + return queryPlansPerMinuteBuilder_.getMessageOrBuilder(); + } else { + return queryPlansPerMinute_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryPlansPerMinute_; + } + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetQueryPlansPerMinuteFieldBuilder() { + if (queryPlansPerMinuteBuilder_ == null) { + queryPlansPerMinuteBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getQueryPlansPerMinute(), getParentForChildren(), isClean()); + queryPlansPerMinute_ = null; + } + return queryPlansPerMinuteBuilder_; + } + + private com.google.protobuf.BoolValue enhancedQueryInsightsEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + enhancedQueryInsightsEnabledBuilder_; + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enhancedQueryInsightsEnabled field is set. + */ + public boolean hasEnhancedQueryInsightsEnabled() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enhancedQueryInsightsEnabled. + */ + public com.google.protobuf.BoolValue getEnhancedQueryInsightsEnabled() { + if (enhancedQueryInsightsEnabledBuilder_ == null) { + return enhancedQueryInsightsEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enhancedQueryInsightsEnabled_; + } else { + return enhancedQueryInsightsEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEnhancedQueryInsightsEnabled(com.google.protobuf.BoolValue value) { + if (enhancedQueryInsightsEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enhancedQueryInsightsEnabled_ = value; + } else { + enhancedQueryInsightsEnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEnhancedQueryInsightsEnabled( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (enhancedQueryInsightsEnabledBuilder_ == null) { + enhancedQueryInsightsEnabled_ = builderForValue.build(); + } else { + enhancedQueryInsightsEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEnhancedQueryInsightsEnabled(com.google.protobuf.BoolValue value) { + if (enhancedQueryInsightsEnabledBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && enhancedQueryInsightsEnabled_ != null + && enhancedQueryInsightsEnabled_ + != com.google.protobuf.BoolValue.getDefaultInstance()) { + getEnhancedQueryInsightsEnabledBuilder().mergeFrom(value); + } else { + enhancedQueryInsightsEnabled_ = value; + } + } else { + enhancedQueryInsightsEnabledBuilder_.mergeFrom(value); + } + if (enhancedQueryInsightsEnabled_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEnhancedQueryInsightsEnabled() { + bitField0_ = (bitField0_ & ~0x00000020); + enhancedQueryInsightsEnabled_ = null; + if (enhancedQueryInsightsEnabledBuilder_ != null) { + enhancedQueryInsightsEnabledBuilder_.dispose(); + enhancedQueryInsightsEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getEnhancedQueryInsightsEnabledBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetEnhancedQueryInsightsEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getEnhancedQueryInsightsEnabledOrBuilder() { + if (enhancedQueryInsightsEnabledBuilder_ != null) { + return enhancedQueryInsightsEnabledBuilder_.getMessageOrBuilder(); + } else { + return enhancedQueryInsightsEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enhancedQueryInsightsEnabled_; + } + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetEnhancedQueryInsightsEnabledFieldBuilder() { + if (enhancedQueryInsightsEnabledBuilder_ == null) { + enhancedQueryInsightsEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getEnhancedQueryInsightsEnabled(), getParentForChildren(), isClean()); + enhancedQueryInsightsEnabled_ = null; + } + return enhancedQueryInsightsEnabledBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InsightsConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InsightsConfig) + private static final com.google.cloud.sql.v1.InsightsConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InsightsConfig(); + } + + public static com.google.cloud.sql.v1.InsightsConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InsightsConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InsightsConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InsightsConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InsightsConfigOrBuilder.java new file mode 100644 index 000000000000..b9e1113133ba --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InsightsConfigOrBuilder.java @@ -0,0 +1,197 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InsightsConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InsightsConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether Query Insights feature is enabled.
+   * 
+ * + * bool query_insights_enabled = 1; + * + * @return The queryInsightsEnabled. + */ + boolean getQueryInsightsEnabled(); + + /** + * + * + *
+   * Whether Query Insights will record client address when enabled.
+   * 
+ * + * bool record_client_address = 2; + * + * @return The recordClientAddress. + */ + boolean getRecordClientAddress(); + + /** + * + * + *
+   * Whether Query Insights will record application tags from query when
+   * enabled.
+   * 
+ * + * bool record_application_tags = 3; + * + * @return The recordApplicationTags. + */ + boolean getRecordApplicationTags(); + + /** + * + * + *
+   * Maximum query length stored in bytes. Default value: 1024 bytes.
+   * Range: 256-4500 bytes. Query lengths greater than this field value will be
+   * truncated to this value. When unset, query length will be the default
+   * value. Changing query length will restart the database.
+   * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + * + * @return Whether the queryStringLength field is set. + */ + boolean hasQueryStringLength(); + + /** + * + * + *
+   * Maximum query length stored in bytes. Default value: 1024 bytes.
+   * Range: 256-4500 bytes. Query lengths greater than this field value will be
+   * truncated to this value. When unset, query length will be the default
+   * value. Changing query length will restart the database.
+   * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + * + * @return The queryStringLength. + */ + com.google.protobuf.Int32Value getQueryStringLength(); + + /** + * + * + *
+   * Maximum query length stored in bytes. Default value: 1024 bytes.
+   * Range: 256-4500 bytes. Query lengths greater than this field value will be
+   * truncated to this value. When unset, query length will be the default
+   * value. Changing query length will restart the database.
+   * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + com.google.protobuf.Int32ValueOrBuilder getQueryStringLengthOrBuilder(); + + /** + * + * + *
+   * Number of query execution plans captured by Insights per minute
+   * for all queries combined. Default is 5.
+   * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + boolean hasQueryPlansPerMinute(); + + /** + * + * + *
+   * Number of query execution plans captured by Insights per minute
+   * for all queries combined. Default is 5.
+   * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + com.google.protobuf.Int32Value getQueryPlansPerMinute(); + + /** + * + * + *
+   * Number of query execution plans captured by Insights per minute
+   * for all queries combined. Default is 5.
+   * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + com.google.protobuf.Int32ValueOrBuilder getQueryPlansPerMinuteOrBuilder(); + + /** + * + * + *
+   * Optional. Whether enhanced query insights feature is enabled.
+   * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enhancedQueryInsightsEnabled field is set. + */ + boolean hasEnhancedQueryInsightsEnabled(); + + /** + * + * + *
+   * Optional. Whether enhanced query insights feature is enabled.
+   * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enhancedQueryInsightsEnabled. + */ + com.google.protobuf.BoolValue getEnhancedQueryInsightsEnabled(); + + /** + * + * + *
+   * Optional. Whether enhanced query insights feature is enabled.
+   * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getEnhancedQueryInsightsEnabledOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstanceReference.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstanceReference.java new file mode 100644 index 000000000000..1105d2944fad --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstanceReference.java @@ -0,0 +1,987 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Reference to another Cloud SQL instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstanceReference} + */ +@com.google.protobuf.Generated +public final class InstanceReference extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstanceReference) + InstanceReferenceOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstanceReference"); + } + + // Use InstanceReference.newBuilder() to construct. + private InstanceReference(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstanceReference() { + name_ = ""; + region_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_InstanceReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_InstanceReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstanceReference.class, + com.google.cloud.sql.v1.InstanceReference.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the Cloud SQL instance being referenced.
+   * This does not include the project ID.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the Cloud SQL instance being referenced.
+   * This does not include the project ID.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REGION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object region_ = ""; + + /** + * + * + *
+   * The region of the Cloud SQL instance being referenced.
+   * 
+ * + * string region = 2; + * + * @return The region. + */ + @java.lang.Override + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } + } + + /** + * + * + *
+   * The region of the Cloud SQL instance being referenced.
+   * 
+ * + * string region = 2; + * + * @return The bytes for region. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * The project ID of the Cloud SQL instance being referenced.
+   * The default is the same project ID as the instance references it.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * The project ID of the Cloud SQL instance being referenced.
+   * The default is the same project ID as the instance references it.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, region_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, region_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstanceReference)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstanceReference other = + (com.google.cloud.sql.v1.InstanceReference) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRegion().equals(other.getRegion())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegion().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstanceReference parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstanceReference parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstanceReference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstanceReference parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstanceReference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstanceReference parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstanceReference parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstanceReference parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstanceReference parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstanceReference parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstanceReference parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstanceReference parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.InstanceReference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Reference to another Cloud SQL instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstanceReference} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstanceReference) + com.google.cloud.sql.v1.InstanceReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_InstanceReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_InstanceReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstanceReference.class, + com.google.cloud.sql.v1.InstanceReference.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstanceReference.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + region_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_InstanceReference_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstanceReference getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstanceReference.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstanceReference build() { + com.google.cloud.sql.v1.InstanceReference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstanceReference buildPartial() { + com.google.cloud.sql.v1.InstanceReference result = + new com.google.cloud.sql.v1.InstanceReference(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.InstanceReference result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.region_ = region_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstanceReference) { + return mergeFrom((com.google.cloud.sql.v1.InstanceReference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InstanceReference other) { + if (other == com.google.cloud.sql.v1.InstanceReference.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRegion().isEmpty()) { + region_ = other.region_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + region_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the Cloud SQL instance being referenced.
+     * This does not include the project ID.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the Cloud SQL instance being referenced.
+     * This does not include the project ID.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the Cloud SQL instance being referenced.
+     * This does not include the project ID.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the Cloud SQL instance being referenced.
+     * This does not include the project ID.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the Cloud SQL instance being referenced.
+     * This does not include the project ID.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object region_ = ""; + + /** + * + * + *
+     * The region of the Cloud SQL instance being referenced.
+     * 
+ * + * string region = 2; + * + * @return The region. + */ + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The region of the Cloud SQL instance being referenced.
+     * 
+ * + * string region = 2; + * + * @return The bytes for region. + */ + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The region of the Cloud SQL instance being referenced.
+     * 
+ * + * string region = 2; + * + * @param value The region to set. + * @return This builder for chaining. + */ + public Builder setRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + region_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The region of the Cloud SQL instance being referenced.
+     * 
+ * + * string region = 2; + * + * @return This builder for chaining. + */ + public Builder clearRegion() { + region_ = getDefaultInstance().getRegion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The region of the Cloud SQL instance being referenced.
+     * 
+ * + * string region = 2; + * + * @param value The bytes for region to set. + * @return This builder for chaining. + */ + public Builder setRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + region_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * The project ID of the Cloud SQL instance being referenced.
+     * The default is the same project ID as the instance references it.
+     * 
+ * + * string project = 3; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The project ID of the Cloud SQL instance being referenced.
+     * The default is the same project ID as the instance references it.
+     * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The project ID of the Cloud SQL instance being referenced.
+     * The default is the same project ID as the instance references it.
+     * 
+ * + * string project = 3; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the Cloud SQL instance being referenced.
+     * The default is the same project ID as the instance references it.
+     * 
+ * + * string project = 3; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the Cloud SQL instance being referenced.
+     * The default is the same project ID as the instance references it.
+     * 
+ * + * string project = 3; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstanceReference) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstanceReference) + private static final com.google.cloud.sql.v1.InstanceReference DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstanceReference(); + } + + public static com.google.cloud.sql.v1.InstanceReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstanceReference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstanceReference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstanceReferenceOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstanceReferenceOrBuilder.java new file mode 100644 index 000000000000..0d425c722d6d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstanceReferenceOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstanceReferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstanceReference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the Cloud SQL instance being referenced.
+   * This does not include the project ID.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the Cloud SQL instance being referenced.
+   * This does not include the project ID.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The region of the Cloud SQL instance being referenced.
+   * 
+ * + * string region = 2; + * + * @return The region. + */ + java.lang.String getRegion(); + + /** + * + * + *
+   * The region of the Cloud SQL instance being referenced.
+   * 
+ * + * string region = 2; + * + * @return The bytes for region. + */ + com.google.protobuf.ByteString getRegionBytes(); + + /** + * + * + *
+   * The project ID of the Cloud SQL instance being referenced.
+   * The default is the same project ID as the instance references it.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * The project ID of the Cloud SQL instance being referenced.
+   * The default is the same project ID as the instance references it.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesAcquireSsrsLeaseRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesAcquireSsrsLeaseRequest.java new file mode 100644 index 000000000000..a4222b3131eb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesAcquireSsrsLeaseRequest.java @@ -0,0 +1,712 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Request to acquire a lease for SSRS.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest} + */ +@com.google.protobuf.Generated +public final class InstancesAcquireSsrsLeaseRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest) + InstancesAcquireSsrsLeaseRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesAcquireSsrsLeaseRequest"); + } + + // Use InstancesAcquireSsrsLeaseRequest.newBuilder() to construct. + private InstancesAcquireSsrsLeaseRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesAcquireSsrsLeaseRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesAcquireSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesAcquireSsrsLeaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.class, + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.Builder.class); + } + + private int bitField0_; + public static final int ACQUIRE_SSRS_LEASE_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.AcquireSsrsLeaseContext acquireSsrsLeaseContext_; + + /** + * + * + *
+   * Contains details about the acquire SSRS lease operation.
+   * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + * @return Whether the acquireSsrsLeaseContext field is set. + */ + @java.lang.Override + public boolean hasAcquireSsrsLeaseContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Contains details about the acquire SSRS lease operation.
+   * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + * @return The acquireSsrsLeaseContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.AcquireSsrsLeaseContext getAcquireSsrsLeaseContext() { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } + + /** + * + * + *
+   * Contains details about the acquire SSRS lease operation.
+   * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.AcquireSsrsLeaseContextOrBuilder + getAcquireSsrsLeaseContextOrBuilder() { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getAcquireSsrsLeaseContext()); + } + 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, getAcquireSsrsLeaseContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest other = + (com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest) obj; + + if (hasAcquireSsrsLeaseContext() != other.hasAcquireSsrsLeaseContext()) return false; + if (hasAcquireSsrsLeaseContext()) { + if (!getAcquireSsrsLeaseContext().equals(other.getAcquireSsrsLeaseContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasAcquireSsrsLeaseContext()) { + hash = (37 * hash) + ACQUIRE_SSRS_LEASE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getAcquireSsrsLeaseContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request to acquire a lease for SSRS.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest) + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesAcquireSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesAcquireSsrsLeaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.class, + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAcquireSsrsLeaseContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + acquireSsrsLeaseContext_ = null; + if (acquireSsrsLeaseContextBuilder_ != null) { + acquireSsrsLeaseContextBuilder_.dispose(); + acquireSsrsLeaseContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesAcquireSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest build() { + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest buildPartial() { + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest result = + new com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.acquireSsrsLeaseContext_ = + acquireSsrsLeaseContextBuilder_ == null + ? acquireSsrsLeaseContext_ + : acquireSsrsLeaseContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest) { + return mergeFrom((com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest other) { + if (other == com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.getDefaultInstance()) + return this; + if (other.hasAcquireSsrsLeaseContext()) { + mergeAcquireSsrsLeaseContext(other.getAcquireSsrsLeaseContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetAcquireSsrsLeaseContextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.AcquireSsrsLeaseContext acquireSsrsLeaseContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.AcquireSsrsLeaseContext, + com.google.cloud.sql.v1.AcquireSsrsLeaseContext.Builder, + com.google.cloud.sql.v1.AcquireSsrsLeaseContextOrBuilder> + acquireSsrsLeaseContextBuilder_; + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + * @return Whether the acquireSsrsLeaseContext field is set. + */ + public boolean hasAcquireSsrsLeaseContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + * @return The acquireSsrsLeaseContext. + */ + public com.google.cloud.sql.v1.AcquireSsrsLeaseContext getAcquireSsrsLeaseContext() { + if (acquireSsrsLeaseContextBuilder_ == null) { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } else { + return acquireSsrsLeaseContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + */ + public Builder setAcquireSsrsLeaseContext( + com.google.cloud.sql.v1.AcquireSsrsLeaseContext value) { + if (acquireSsrsLeaseContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + acquireSsrsLeaseContext_ = value; + } else { + acquireSsrsLeaseContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + */ + public Builder setAcquireSsrsLeaseContext( + com.google.cloud.sql.v1.AcquireSsrsLeaseContext.Builder builderForValue) { + if (acquireSsrsLeaseContextBuilder_ == null) { + acquireSsrsLeaseContext_ = builderForValue.build(); + } else { + acquireSsrsLeaseContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + */ + public Builder mergeAcquireSsrsLeaseContext( + com.google.cloud.sql.v1.AcquireSsrsLeaseContext value) { + if (acquireSsrsLeaseContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && acquireSsrsLeaseContext_ != null + && acquireSsrsLeaseContext_ + != com.google.cloud.sql.v1.AcquireSsrsLeaseContext.getDefaultInstance()) { + getAcquireSsrsLeaseContextBuilder().mergeFrom(value); + } else { + acquireSsrsLeaseContext_ = value; + } + } else { + acquireSsrsLeaseContextBuilder_.mergeFrom(value); + } + if (acquireSsrsLeaseContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + */ + public Builder clearAcquireSsrsLeaseContext() { + bitField0_ = (bitField0_ & ~0x00000001); + acquireSsrsLeaseContext_ = null; + if (acquireSsrsLeaseContextBuilder_ != null) { + acquireSsrsLeaseContextBuilder_.dispose(); + acquireSsrsLeaseContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + */ + public com.google.cloud.sql.v1.AcquireSsrsLeaseContext.Builder + getAcquireSsrsLeaseContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetAcquireSsrsLeaseContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + */ + public com.google.cloud.sql.v1.AcquireSsrsLeaseContextOrBuilder + getAcquireSsrsLeaseContextOrBuilder() { + if (acquireSsrsLeaseContextBuilder_ != null) { + return acquireSsrsLeaseContextBuilder_.getMessageOrBuilder(); + } else { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.AcquireSsrsLeaseContext, + com.google.cloud.sql.v1.AcquireSsrsLeaseContext.Builder, + com.google.cloud.sql.v1.AcquireSsrsLeaseContextOrBuilder> + internalGetAcquireSsrsLeaseContextFieldBuilder() { + if (acquireSsrsLeaseContextBuilder_ == null) { + acquireSsrsLeaseContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.AcquireSsrsLeaseContext, + com.google.cloud.sql.v1.AcquireSsrsLeaseContext.Builder, + com.google.cloud.sql.v1.AcquireSsrsLeaseContextOrBuilder>( + getAcquireSsrsLeaseContext(), getParentForChildren(), isClean()); + acquireSsrsLeaseContext_ = null; + } + return acquireSsrsLeaseContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest) + private static final com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest(); + } + + public static com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesAcquireSsrsLeaseRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesAcquireSsrsLeaseRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesAcquireSsrsLeaseRequestOrBuilder.java new file mode 100644 index 000000000000..2ad0433d1b61 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesAcquireSsrsLeaseRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesAcquireSsrsLeaseRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Contains details about the acquire SSRS lease operation.
+   * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + * @return Whether the acquireSsrsLeaseContext field is set. + */ + boolean hasAcquireSsrsLeaseContext(); + + /** + * + * + *
+   * Contains details about the acquire SSRS lease operation.
+   * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + * @return The acquireSsrsLeaseContext. + */ + com.google.cloud.sql.v1.AcquireSsrsLeaseContext getAcquireSsrsLeaseContext(); + + /** + * + * + *
+   * Contains details about the acquire SSRS lease operation.
+   * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + */ + com.google.cloud.sql.v1.AcquireSsrsLeaseContextOrBuilder getAcquireSsrsLeaseContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesCloneRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesCloneRequest.java new file mode 100644 index 000000000000..efbff41eb6ad --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesCloneRequest.java @@ -0,0 +1,722 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance clone request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesCloneRequest} + */ +@com.google.protobuf.Generated +public final class InstancesCloneRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesCloneRequest) + InstancesCloneRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesCloneRequest"); + } + + // Use InstancesCloneRequest.newBuilder() to construct. + private InstancesCloneRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesCloneRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesCloneRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesCloneRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesCloneRequest.class, + com.google.cloud.sql.v1.InstancesCloneRequest.Builder.class); + } + + private int bitField0_; + public static final int CLONE_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.CloneContext cloneContext_; + + /** + * + * + *
+   * Required. Contains details about the clone operation.
+   * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cloneContext field is set. + */ + @java.lang.Override + public boolean hasCloneContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. Contains details about the clone operation.
+   * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cloneContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.CloneContext getCloneContext() { + return cloneContext_ == null + ? com.google.cloud.sql.v1.CloneContext.getDefaultInstance() + : cloneContext_; + } + + /** + * + * + *
+   * Required. Contains details about the clone operation.
+   * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.CloneContextOrBuilder getCloneContextOrBuilder() { + return cloneContext_ == null + ? com.google.cloud.sql.v1.CloneContext.getDefaultInstance() + : cloneContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getCloneContext()); + } + 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, getCloneContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesCloneRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesCloneRequest other = + (com.google.cloud.sql.v1.InstancesCloneRequest) obj; + + if (hasCloneContext() != other.hasCloneContext()) return false; + if (hasCloneContext()) { + if (!getCloneContext().equals(other.getCloneContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasCloneContext()) { + hash = (37 * hash) + CLONE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getCloneContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesCloneRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesCloneRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesCloneRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesCloneRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesCloneRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesCloneRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesCloneRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesCloneRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesCloneRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesCloneRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesCloneRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesCloneRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.InstancesCloneRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance clone request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesCloneRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesCloneRequest) + com.google.cloud.sql.v1.InstancesCloneRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesCloneRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesCloneRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesCloneRequest.class, + com.google.cloud.sql.v1.InstancesCloneRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesCloneRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCloneContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cloneContext_ = null; + if (cloneContextBuilder_ != null) { + cloneContextBuilder_.dispose(); + cloneContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesCloneRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesCloneRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesCloneRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesCloneRequest build() { + com.google.cloud.sql.v1.InstancesCloneRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesCloneRequest buildPartial() { + com.google.cloud.sql.v1.InstancesCloneRequest result = + new com.google.cloud.sql.v1.InstancesCloneRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.InstancesCloneRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cloneContext_ = + cloneContextBuilder_ == null ? cloneContext_ : cloneContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesCloneRequest) { + return mergeFrom((com.google.cloud.sql.v1.InstancesCloneRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InstancesCloneRequest other) { + if (other == com.google.cloud.sql.v1.InstancesCloneRequest.getDefaultInstance()) return this; + if (other.hasCloneContext()) { + mergeCloneContext(other.getCloneContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetCloneContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.CloneContext cloneContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.CloneContext, + com.google.cloud.sql.v1.CloneContext.Builder, + com.google.cloud.sql.v1.CloneContextOrBuilder> + cloneContextBuilder_; + + /** + * + * + *
+     * Required. Contains details about the clone operation.
+     * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cloneContext field is set. + */ + public boolean hasCloneContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. Contains details about the clone operation.
+     * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cloneContext. + */ + public com.google.cloud.sql.v1.CloneContext getCloneContext() { + if (cloneContextBuilder_ == null) { + return cloneContext_ == null + ? com.google.cloud.sql.v1.CloneContext.getDefaultInstance() + : cloneContext_; + } else { + return cloneContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. Contains details about the clone operation.
+     * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCloneContext(com.google.cloud.sql.v1.CloneContext value) { + if (cloneContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cloneContext_ = value; + } else { + cloneContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Contains details about the clone operation.
+     * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCloneContext(com.google.cloud.sql.v1.CloneContext.Builder builderForValue) { + if (cloneContextBuilder_ == null) { + cloneContext_ = builderForValue.build(); + } else { + cloneContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Contains details about the clone operation.
+     * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCloneContext(com.google.cloud.sql.v1.CloneContext value) { + if (cloneContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && cloneContext_ != null + && cloneContext_ != com.google.cloud.sql.v1.CloneContext.getDefaultInstance()) { + getCloneContextBuilder().mergeFrom(value); + } else { + cloneContext_ = value; + } + } else { + cloneContextBuilder_.mergeFrom(value); + } + if (cloneContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. Contains details about the clone operation.
+     * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCloneContext() { + bitField0_ = (bitField0_ & ~0x00000001); + cloneContext_ = null; + if (cloneContextBuilder_ != null) { + cloneContextBuilder_.dispose(); + cloneContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Contains details about the clone operation.
+     * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.CloneContext.Builder getCloneContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetCloneContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. Contains details about the clone operation.
+     * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.CloneContextOrBuilder getCloneContextOrBuilder() { + if (cloneContextBuilder_ != null) { + return cloneContextBuilder_.getMessageOrBuilder(); + } else { + return cloneContext_ == null + ? com.google.cloud.sql.v1.CloneContext.getDefaultInstance() + : cloneContext_; + } + } + + /** + * + * + *
+     * Required. Contains details about the clone operation.
+     * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.CloneContext, + com.google.cloud.sql.v1.CloneContext.Builder, + com.google.cloud.sql.v1.CloneContextOrBuilder> + internalGetCloneContextFieldBuilder() { + if (cloneContextBuilder_ == null) { + cloneContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.CloneContext, + com.google.cloud.sql.v1.CloneContext.Builder, + com.google.cloud.sql.v1.CloneContextOrBuilder>( + getCloneContext(), getParentForChildren(), isClean()); + cloneContext_ = null; + } + return cloneContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesCloneRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesCloneRequest) + private static final com.google.cloud.sql.v1.InstancesCloneRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesCloneRequest(); + } + + public static com.google.cloud.sql.v1.InstancesCloneRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesCloneRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesCloneRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesCloneRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesCloneRequestOrBuilder.java new file mode 100644 index 000000000000..6bf7b3647c8c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesCloneRequestOrBuilder.java @@ -0,0 +1,71 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesCloneRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesCloneRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Contains details about the clone operation.
+   * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cloneContext field is set. + */ + boolean hasCloneContext(); + + /** + * + * + *
+   * Required. Contains details about the clone operation.
+   * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cloneContext. + */ + com.google.cloud.sql.v1.CloneContext getCloneContext(); + + /** + * + * + *
+   * Required. Contains details about the clone operation.
+   * 
+ * + * + * .google.cloud.sql.v1.CloneContext clone_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1.CloneContextOrBuilder getCloneContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesDemoteMasterRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesDemoteMasterRequest.java new file mode 100644 index 000000000000..7e15ae4eefc1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesDemoteMasterRequest.java @@ -0,0 +1,703 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database demote primary instance request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesDemoteMasterRequest} + */ +@com.google.protobuf.Generated +public final class InstancesDemoteMasterRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesDemoteMasterRequest) + InstancesDemoteMasterRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesDemoteMasterRequest"); + } + + // Use InstancesDemoteMasterRequest.newBuilder() to construct. + private InstancesDemoteMasterRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesDemoteMasterRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesDemoteMasterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesDemoteMasterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesDemoteMasterRequest.class, + com.google.cloud.sql.v1.InstancesDemoteMasterRequest.Builder.class); + } + + private int bitField0_; + public static final int DEMOTE_MASTER_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.DemoteMasterContext demoteMasterContext_; + + /** + * + * + *
+   * Contains details about the demoteMaster operation.
+   * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + * + * @return Whether the demoteMasterContext field is set. + */ + @java.lang.Override + public boolean hasDemoteMasterContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Contains details about the demoteMaster operation.
+   * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + * + * @return The demoteMasterContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterContext getDemoteMasterContext() { + return demoteMasterContext_ == null + ? com.google.cloud.sql.v1.DemoteMasterContext.getDefaultInstance() + : demoteMasterContext_; + } + + /** + * + * + *
+   * Contains details about the demoteMaster operation.
+   * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.DemoteMasterContextOrBuilder getDemoteMasterContextOrBuilder() { + return demoteMasterContext_ == null + ? com.google.cloud.sql.v1.DemoteMasterContext.getDefaultInstance() + : demoteMasterContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getDemoteMasterContext()); + } + 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, getDemoteMasterContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesDemoteMasterRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesDemoteMasterRequest other = + (com.google.cloud.sql.v1.InstancesDemoteMasterRequest) obj; + + if (hasDemoteMasterContext() != other.hasDemoteMasterContext()) return false; + if (hasDemoteMasterContext()) { + if (!getDemoteMasterContext().equals(other.getDemoteMasterContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasDemoteMasterContext()) { + hash = (37 * hash) + DEMOTE_MASTER_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getDemoteMasterContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesDemoteMasterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesDemoteMasterRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesDemoteMasterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesDemoteMasterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesDemoteMasterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesDemoteMasterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesDemoteMasterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesDemoteMasterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesDemoteMasterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesDemoteMasterRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesDemoteMasterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesDemoteMasterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.InstancesDemoteMasterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database demote primary instance request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesDemoteMasterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesDemoteMasterRequest) + com.google.cloud.sql.v1.InstancesDemoteMasterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesDemoteMasterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesDemoteMasterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesDemoteMasterRequest.class, + com.google.cloud.sql.v1.InstancesDemoteMasterRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesDemoteMasterRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetDemoteMasterContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + demoteMasterContext_ = null; + if (demoteMasterContextBuilder_ != null) { + demoteMasterContextBuilder_.dispose(); + demoteMasterContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesDemoteMasterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesDemoteMasterRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesDemoteMasterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesDemoteMasterRequest build() { + com.google.cloud.sql.v1.InstancesDemoteMasterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesDemoteMasterRequest buildPartial() { + com.google.cloud.sql.v1.InstancesDemoteMasterRequest result = + new com.google.cloud.sql.v1.InstancesDemoteMasterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.InstancesDemoteMasterRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.demoteMasterContext_ = + demoteMasterContextBuilder_ == null + ? demoteMasterContext_ + : demoteMasterContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesDemoteMasterRequest) { + return mergeFrom((com.google.cloud.sql.v1.InstancesDemoteMasterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InstancesDemoteMasterRequest other) { + if (other == com.google.cloud.sql.v1.InstancesDemoteMasterRequest.getDefaultInstance()) + return this; + if (other.hasDemoteMasterContext()) { + mergeDemoteMasterContext(other.getDemoteMasterContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetDemoteMasterContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.DemoteMasterContext demoteMasterContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DemoteMasterContext, + com.google.cloud.sql.v1.DemoteMasterContext.Builder, + com.google.cloud.sql.v1.DemoteMasterContextOrBuilder> + demoteMasterContextBuilder_; + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + * + * @return Whether the demoteMasterContext field is set. + */ + public boolean hasDemoteMasterContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + * + * @return The demoteMasterContext. + */ + public com.google.cloud.sql.v1.DemoteMasterContext getDemoteMasterContext() { + if (demoteMasterContextBuilder_ == null) { + return demoteMasterContext_ == null + ? com.google.cloud.sql.v1.DemoteMasterContext.getDefaultInstance() + : demoteMasterContext_; + } else { + return demoteMasterContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + */ + public Builder setDemoteMasterContext(com.google.cloud.sql.v1.DemoteMasterContext value) { + if (demoteMasterContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + demoteMasterContext_ = value; + } else { + demoteMasterContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + */ + public Builder setDemoteMasterContext( + com.google.cloud.sql.v1.DemoteMasterContext.Builder builderForValue) { + if (demoteMasterContextBuilder_ == null) { + demoteMasterContext_ = builderForValue.build(); + } else { + demoteMasterContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + */ + public Builder mergeDemoteMasterContext(com.google.cloud.sql.v1.DemoteMasterContext value) { + if (demoteMasterContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && demoteMasterContext_ != null + && demoteMasterContext_ + != com.google.cloud.sql.v1.DemoteMasterContext.getDefaultInstance()) { + getDemoteMasterContextBuilder().mergeFrom(value); + } else { + demoteMasterContext_ = value; + } + } else { + demoteMasterContextBuilder_.mergeFrom(value); + } + if (demoteMasterContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + */ + public Builder clearDemoteMasterContext() { + bitField0_ = (bitField0_ & ~0x00000001); + demoteMasterContext_ = null; + if (demoteMasterContextBuilder_ != null) { + demoteMasterContextBuilder_.dispose(); + demoteMasterContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + */ + public com.google.cloud.sql.v1.DemoteMasterContext.Builder getDemoteMasterContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetDemoteMasterContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + */ + public com.google.cloud.sql.v1.DemoteMasterContextOrBuilder getDemoteMasterContextOrBuilder() { + if (demoteMasterContextBuilder_ != null) { + return demoteMasterContextBuilder_.getMessageOrBuilder(); + } else { + return demoteMasterContext_ == null + ? com.google.cloud.sql.v1.DemoteMasterContext.getDefaultInstance() + : demoteMasterContext_; + } + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DemoteMasterContext, + com.google.cloud.sql.v1.DemoteMasterContext.Builder, + com.google.cloud.sql.v1.DemoteMasterContextOrBuilder> + internalGetDemoteMasterContextFieldBuilder() { + if (demoteMasterContextBuilder_ == null) { + demoteMasterContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DemoteMasterContext, + com.google.cloud.sql.v1.DemoteMasterContext.Builder, + com.google.cloud.sql.v1.DemoteMasterContextOrBuilder>( + getDemoteMasterContext(), getParentForChildren(), isClean()); + demoteMasterContext_ = null; + } + return demoteMasterContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesDemoteMasterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesDemoteMasterRequest) + private static final com.google.cloud.sql.v1.InstancesDemoteMasterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesDemoteMasterRequest(); + } + + public static com.google.cloud.sql.v1.InstancesDemoteMasterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesDemoteMasterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesDemoteMasterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesDemoteMasterRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesDemoteMasterRequestOrBuilder.java new file mode 100644 index 000000000000..56d6f64335b5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesDemoteMasterRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesDemoteMasterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesDemoteMasterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Contains details about the demoteMaster operation.
+   * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + * + * @return Whether the demoteMasterContext field is set. + */ + boolean hasDemoteMasterContext(); + + /** + * + * + *
+   * Contains details about the demoteMaster operation.
+   * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + * + * @return The demoteMasterContext. + */ + com.google.cloud.sql.v1.DemoteMasterContext getDemoteMasterContext(); + + /** + * + * + *
+   * Contains details about the demoteMaster operation.
+   * 
+ * + * .google.cloud.sql.v1.DemoteMasterContext demote_master_context = 1; + */ + com.google.cloud.sql.v1.DemoteMasterContextOrBuilder getDemoteMasterContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesDemoteRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesDemoteRequest.java new file mode 100644 index 000000000000..b4f992518a9e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesDemoteRequest.java @@ -0,0 +1,724 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * This request is used to demote an existing standalone instance to be a
+ * Cloud SQL read replica for an external database server.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesDemoteRequest} + */ +@com.google.protobuf.Generated +public final class InstancesDemoteRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesDemoteRequest) + InstancesDemoteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesDemoteRequest"); + } + + // Use InstancesDemoteRequest.newBuilder() to construct. + private InstancesDemoteRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesDemoteRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesDemoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesDemoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesDemoteRequest.class, + com.google.cloud.sql.v1.InstancesDemoteRequest.Builder.class); + } + + private int bitField0_; + public static final int DEMOTE_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.DemoteContext demoteContext_; + + /** + * + * + *
+   * Required. Contains details about the demote operation.
+   * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the demoteContext field is set. + */ + @java.lang.Override + public boolean hasDemoteContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. Contains details about the demote operation.
+   * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The demoteContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DemoteContext getDemoteContext() { + return demoteContext_ == null + ? com.google.cloud.sql.v1.DemoteContext.getDefaultInstance() + : demoteContext_; + } + + /** + * + * + *
+   * Required. Contains details about the demote operation.
+   * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DemoteContextOrBuilder getDemoteContextOrBuilder() { + return demoteContext_ == null + ? com.google.cloud.sql.v1.DemoteContext.getDefaultInstance() + : demoteContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getDemoteContext()); + } + 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, getDemoteContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesDemoteRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesDemoteRequest other = + (com.google.cloud.sql.v1.InstancesDemoteRequest) obj; + + if (hasDemoteContext() != other.hasDemoteContext()) return false; + if (hasDemoteContext()) { + if (!getDemoteContext().equals(other.getDemoteContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasDemoteContext()) { + hash = (37 * hash) + DEMOTE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getDemoteContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesDemoteRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesDemoteRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesDemoteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesDemoteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesDemoteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesDemoteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesDemoteRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesDemoteRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesDemoteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesDemoteRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesDemoteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesDemoteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.InstancesDemoteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * This request is used to demote an existing standalone instance to be a
+   * Cloud SQL read replica for an external database server.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesDemoteRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesDemoteRequest) + com.google.cloud.sql.v1.InstancesDemoteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesDemoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesDemoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesDemoteRequest.class, + com.google.cloud.sql.v1.InstancesDemoteRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesDemoteRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetDemoteContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + demoteContext_ = null; + if (demoteContextBuilder_ != null) { + demoteContextBuilder_.dispose(); + demoteContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesDemoteRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesDemoteRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesDemoteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesDemoteRequest build() { + com.google.cloud.sql.v1.InstancesDemoteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesDemoteRequest buildPartial() { + com.google.cloud.sql.v1.InstancesDemoteRequest result = + new com.google.cloud.sql.v1.InstancesDemoteRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.InstancesDemoteRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.demoteContext_ = + demoteContextBuilder_ == null ? demoteContext_ : demoteContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesDemoteRequest) { + return mergeFrom((com.google.cloud.sql.v1.InstancesDemoteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InstancesDemoteRequest other) { + if (other == com.google.cloud.sql.v1.InstancesDemoteRequest.getDefaultInstance()) return this; + if (other.hasDemoteContext()) { + mergeDemoteContext(other.getDemoteContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetDemoteContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.DemoteContext demoteContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DemoteContext, + com.google.cloud.sql.v1.DemoteContext.Builder, + com.google.cloud.sql.v1.DemoteContextOrBuilder> + demoteContextBuilder_; + + /** + * + * + *
+     * Required. Contains details about the demote operation.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the demoteContext field is set. + */ + public boolean hasDemoteContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. Contains details about the demote operation.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The demoteContext. + */ + public com.google.cloud.sql.v1.DemoteContext getDemoteContext() { + if (demoteContextBuilder_ == null) { + return demoteContext_ == null + ? com.google.cloud.sql.v1.DemoteContext.getDefaultInstance() + : demoteContext_; + } else { + return demoteContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. Contains details about the demote operation.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDemoteContext(com.google.cloud.sql.v1.DemoteContext value) { + if (demoteContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + demoteContext_ = value; + } else { + demoteContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Contains details about the demote operation.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDemoteContext(com.google.cloud.sql.v1.DemoteContext.Builder builderForValue) { + if (demoteContextBuilder_ == null) { + demoteContext_ = builderForValue.build(); + } else { + demoteContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Contains details about the demote operation.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDemoteContext(com.google.cloud.sql.v1.DemoteContext value) { + if (demoteContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && demoteContext_ != null + && demoteContext_ != com.google.cloud.sql.v1.DemoteContext.getDefaultInstance()) { + getDemoteContextBuilder().mergeFrom(value); + } else { + demoteContext_ = value; + } + } else { + demoteContextBuilder_.mergeFrom(value); + } + if (demoteContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. Contains details about the demote operation.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDemoteContext() { + bitField0_ = (bitField0_ & ~0x00000001); + demoteContext_ = null; + if (demoteContextBuilder_ != null) { + demoteContextBuilder_.dispose(); + demoteContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Contains details about the demote operation.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.DemoteContext.Builder getDemoteContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetDemoteContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. Contains details about the demote operation.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.DemoteContextOrBuilder getDemoteContextOrBuilder() { + if (demoteContextBuilder_ != null) { + return demoteContextBuilder_.getMessageOrBuilder(); + } else { + return demoteContext_ == null + ? com.google.cloud.sql.v1.DemoteContext.getDefaultInstance() + : demoteContext_; + } + } + + /** + * + * + *
+     * Required. Contains details about the demote operation.
+     * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DemoteContext, + com.google.cloud.sql.v1.DemoteContext.Builder, + com.google.cloud.sql.v1.DemoteContextOrBuilder> + internalGetDemoteContextFieldBuilder() { + if (demoteContextBuilder_ == null) { + demoteContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DemoteContext, + com.google.cloud.sql.v1.DemoteContext.Builder, + com.google.cloud.sql.v1.DemoteContextOrBuilder>( + getDemoteContext(), getParentForChildren(), isClean()); + demoteContext_ = null; + } + return demoteContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesDemoteRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesDemoteRequest) + private static final com.google.cloud.sql.v1.InstancesDemoteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesDemoteRequest(); + } + + public static com.google.cloud.sql.v1.InstancesDemoteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesDemoteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesDemoteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesDemoteRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesDemoteRequestOrBuilder.java new file mode 100644 index 000000000000..26131c753738 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesDemoteRequestOrBuilder.java @@ -0,0 +1,71 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesDemoteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesDemoteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Contains details about the demote operation.
+   * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the demoteContext field is set. + */ + boolean hasDemoteContext(); + + /** + * + * + *
+   * Required. Contains details about the demote operation.
+   * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The demoteContext. + */ + com.google.cloud.sql.v1.DemoteContext getDemoteContext(); + + /** + * + * + *
+   * Required. Contains details about the demote operation.
+   * 
+ * + * + * .google.cloud.sql.v1.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1.DemoteContextOrBuilder getDemoteContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesExportRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesExportRequest.java new file mode 100644 index 000000000000..62a4be0cbb89 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesExportRequest.java @@ -0,0 +1,698 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance export request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesExportRequest} + */ +@com.google.protobuf.Generated +public final class InstancesExportRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesExportRequest) + InstancesExportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesExportRequest"); + } + + // Use InstancesExportRequest.newBuilder() to construct. + private InstancesExportRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesExportRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesExportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesExportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesExportRequest.class, + com.google.cloud.sql.v1.InstancesExportRequest.Builder.class); + } + + private int bitField0_; + public static final int EXPORT_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.ExportContext exportContext_; + + /** + * + * + *
+   * Contains details about the export operation.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + * + * @return Whether the exportContext field is set. + */ + @java.lang.Override + public boolean hasExportContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Contains details about the export operation.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + * + * @return The exportContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext getExportContext() { + return exportContext_ == null + ? com.google.cloud.sql.v1.ExportContext.getDefaultInstance() + : exportContext_; + } + + /** + * + * + *
+   * Contains details about the export operation.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContextOrBuilder getExportContextOrBuilder() { + return exportContext_ == null + ? com.google.cloud.sql.v1.ExportContext.getDefaultInstance() + : exportContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getExportContext()); + } + 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, getExportContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesExportRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesExportRequest other = + (com.google.cloud.sql.v1.InstancesExportRequest) obj; + + if (hasExportContext() != other.hasExportContext()) return false; + if (hasExportContext()) { + if (!getExportContext().equals(other.getExportContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasExportContext()) { + hash = (37 * hash) + EXPORT_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getExportContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesExportRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesExportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesExportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesExportRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesExportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesExportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesExportRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesExportRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesExportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesExportRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesExportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesExportRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.InstancesExportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance export request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesExportRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesExportRequest) + com.google.cloud.sql.v1.InstancesExportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesExportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesExportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesExportRequest.class, + com.google.cloud.sql.v1.InstancesExportRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesExportRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetExportContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + exportContext_ = null; + if (exportContextBuilder_ != null) { + exportContextBuilder_.dispose(); + exportContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesExportRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesExportRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesExportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesExportRequest build() { + com.google.cloud.sql.v1.InstancesExportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesExportRequest buildPartial() { + com.google.cloud.sql.v1.InstancesExportRequest result = + new com.google.cloud.sql.v1.InstancesExportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.InstancesExportRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.exportContext_ = + exportContextBuilder_ == null ? exportContext_ : exportContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesExportRequest) { + return mergeFrom((com.google.cloud.sql.v1.InstancesExportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InstancesExportRequest other) { + if (other == com.google.cloud.sql.v1.InstancesExportRequest.getDefaultInstance()) return this; + if (other.hasExportContext()) { + mergeExportContext(other.getExportContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetExportContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.ExportContext exportContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext, + com.google.cloud.sql.v1.ExportContext.Builder, + com.google.cloud.sql.v1.ExportContextOrBuilder> + exportContextBuilder_; + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + * + * @return Whether the exportContext field is set. + */ + public boolean hasExportContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + * + * @return The exportContext. + */ + public com.google.cloud.sql.v1.ExportContext getExportContext() { + if (exportContextBuilder_ == null) { + return exportContext_ == null + ? com.google.cloud.sql.v1.ExportContext.getDefaultInstance() + : exportContext_; + } else { + return exportContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + */ + public Builder setExportContext(com.google.cloud.sql.v1.ExportContext value) { + if (exportContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + exportContext_ = value; + } else { + exportContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + */ + public Builder setExportContext(com.google.cloud.sql.v1.ExportContext.Builder builderForValue) { + if (exportContextBuilder_ == null) { + exportContext_ = builderForValue.build(); + } else { + exportContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + */ + public Builder mergeExportContext(com.google.cloud.sql.v1.ExportContext value) { + if (exportContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && exportContext_ != null + && exportContext_ != com.google.cloud.sql.v1.ExportContext.getDefaultInstance()) { + getExportContextBuilder().mergeFrom(value); + } else { + exportContext_ = value; + } + } else { + exportContextBuilder_.mergeFrom(value); + } + if (exportContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + */ + public Builder clearExportContext() { + bitField0_ = (bitField0_ & ~0x00000001); + exportContext_ = null; + if (exportContextBuilder_ != null) { + exportContextBuilder_.dispose(); + exportContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + */ + public com.google.cloud.sql.v1.ExportContext.Builder getExportContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetExportContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + */ + public com.google.cloud.sql.v1.ExportContextOrBuilder getExportContextOrBuilder() { + if (exportContextBuilder_ != null) { + return exportContextBuilder_.getMessageOrBuilder(); + } else { + return exportContext_ == null + ? com.google.cloud.sql.v1.ExportContext.getDefaultInstance() + : exportContext_; + } + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext, + com.google.cloud.sql.v1.ExportContext.Builder, + com.google.cloud.sql.v1.ExportContextOrBuilder> + internalGetExportContextFieldBuilder() { + if (exportContextBuilder_ == null) { + exportContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext, + com.google.cloud.sql.v1.ExportContext.Builder, + com.google.cloud.sql.v1.ExportContextOrBuilder>( + getExportContext(), getParentForChildren(), isClean()); + exportContext_ = null; + } + return exportContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesExportRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesExportRequest) + private static final com.google.cloud.sql.v1.InstancesExportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesExportRequest(); + } + + public static com.google.cloud.sql.v1.InstancesExportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesExportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesExportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesExportRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesExportRequestOrBuilder.java new file mode 100644 index 000000000000..c782e307f8d6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesExportRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesExportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesExportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Contains details about the export operation.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + * + * @return Whether the exportContext field is set. + */ + boolean hasExportContext(); + + /** + * + * + *
+   * Contains details about the export operation.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + * + * @return The exportContext. + */ + com.google.cloud.sql.v1.ExportContext getExportContext(); + + /** + * + * + *
+   * Contains details about the export operation.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 1; + */ + com.google.cloud.sql.v1.ExportContextOrBuilder getExportContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesFailoverRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesFailoverRequest.java new file mode 100644 index 000000000000..2eced054db86 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesFailoverRequest.java @@ -0,0 +1,700 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance failover request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesFailoverRequest} + */ +@com.google.protobuf.Generated +public final class InstancesFailoverRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesFailoverRequest) + InstancesFailoverRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesFailoverRequest"); + } + + // Use InstancesFailoverRequest.newBuilder() to construct. + private InstancesFailoverRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesFailoverRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesFailoverRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesFailoverRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesFailoverRequest.class, + com.google.cloud.sql.v1.InstancesFailoverRequest.Builder.class); + } + + private int bitField0_; + public static final int FAILOVER_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.FailoverContext failoverContext_; + + /** + * + * + *
+   * Failover Context.
+   * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + * + * @return Whether the failoverContext field is set. + */ + @java.lang.Override + public boolean hasFailoverContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Failover Context.
+   * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + * + * @return The failoverContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.FailoverContext getFailoverContext() { + return failoverContext_ == null + ? com.google.cloud.sql.v1.FailoverContext.getDefaultInstance() + : failoverContext_; + } + + /** + * + * + *
+   * Failover Context.
+   * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.FailoverContextOrBuilder getFailoverContextOrBuilder() { + return failoverContext_ == null + ? com.google.cloud.sql.v1.FailoverContext.getDefaultInstance() + : failoverContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getFailoverContext()); + } + 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, getFailoverContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesFailoverRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesFailoverRequest other = + (com.google.cloud.sql.v1.InstancesFailoverRequest) obj; + + if (hasFailoverContext() != other.hasFailoverContext()) return false; + if (hasFailoverContext()) { + if (!getFailoverContext().equals(other.getFailoverContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasFailoverContext()) { + hash = (37 * hash) + FAILOVER_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getFailoverContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesFailoverRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesFailoverRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesFailoverRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesFailoverRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesFailoverRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesFailoverRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesFailoverRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesFailoverRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesFailoverRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesFailoverRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesFailoverRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesFailoverRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.InstancesFailoverRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance failover request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesFailoverRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesFailoverRequest) + com.google.cloud.sql.v1.InstancesFailoverRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesFailoverRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesFailoverRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesFailoverRequest.class, + com.google.cloud.sql.v1.InstancesFailoverRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesFailoverRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetFailoverContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + failoverContext_ = null; + if (failoverContextBuilder_ != null) { + failoverContextBuilder_.dispose(); + failoverContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesFailoverRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesFailoverRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesFailoverRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesFailoverRequest build() { + com.google.cloud.sql.v1.InstancesFailoverRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesFailoverRequest buildPartial() { + com.google.cloud.sql.v1.InstancesFailoverRequest result = + new com.google.cloud.sql.v1.InstancesFailoverRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.InstancesFailoverRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.failoverContext_ = + failoverContextBuilder_ == null ? failoverContext_ : failoverContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesFailoverRequest) { + return mergeFrom((com.google.cloud.sql.v1.InstancesFailoverRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InstancesFailoverRequest other) { + if (other == com.google.cloud.sql.v1.InstancesFailoverRequest.getDefaultInstance()) + return this; + if (other.hasFailoverContext()) { + mergeFailoverContext(other.getFailoverContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetFailoverContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.FailoverContext failoverContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.FailoverContext, + com.google.cloud.sql.v1.FailoverContext.Builder, + com.google.cloud.sql.v1.FailoverContextOrBuilder> + failoverContextBuilder_; + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + * + * @return Whether the failoverContext field is set. + */ + public boolean hasFailoverContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + * + * @return The failoverContext. + */ + public com.google.cloud.sql.v1.FailoverContext getFailoverContext() { + if (failoverContextBuilder_ == null) { + return failoverContext_ == null + ? com.google.cloud.sql.v1.FailoverContext.getDefaultInstance() + : failoverContext_; + } else { + return failoverContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + */ + public Builder setFailoverContext(com.google.cloud.sql.v1.FailoverContext value) { + if (failoverContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + failoverContext_ = value; + } else { + failoverContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + */ + public Builder setFailoverContext( + com.google.cloud.sql.v1.FailoverContext.Builder builderForValue) { + if (failoverContextBuilder_ == null) { + failoverContext_ = builderForValue.build(); + } else { + failoverContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + */ + public Builder mergeFailoverContext(com.google.cloud.sql.v1.FailoverContext value) { + if (failoverContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && failoverContext_ != null + && failoverContext_ != com.google.cloud.sql.v1.FailoverContext.getDefaultInstance()) { + getFailoverContextBuilder().mergeFrom(value); + } else { + failoverContext_ = value; + } + } else { + failoverContextBuilder_.mergeFrom(value); + } + if (failoverContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + */ + public Builder clearFailoverContext() { + bitField0_ = (bitField0_ & ~0x00000001); + failoverContext_ = null; + if (failoverContextBuilder_ != null) { + failoverContextBuilder_.dispose(); + failoverContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + */ + public com.google.cloud.sql.v1.FailoverContext.Builder getFailoverContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetFailoverContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + */ + public com.google.cloud.sql.v1.FailoverContextOrBuilder getFailoverContextOrBuilder() { + if (failoverContextBuilder_ != null) { + return failoverContextBuilder_.getMessageOrBuilder(); + } else { + return failoverContext_ == null + ? com.google.cloud.sql.v1.FailoverContext.getDefaultInstance() + : failoverContext_; + } + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.FailoverContext, + com.google.cloud.sql.v1.FailoverContext.Builder, + com.google.cloud.sql.v1.FailoverContextOrBuilder> + internalGetFailoverContextFieldBuilder() { + if (failoverContextBuilder_ == null) { + failoverContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.FailoverContext, + com.google.cloud.sql.v1.FailoverContext.Builder, + com.google.cloud.sql.v1.FailoverContextOrBuilder>( + getFailoverContext(), getParentForChildren(), isClean()); + failoverContext_ = null; + } + return failoverContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesFailoverRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesFailoverRequest) + private static final com.google.cloud.sql.v1.InstancesFailoverRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesFailoverRequest(); + } + + public static com.google.cloud.sql.v1.InstancesFailoverRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesFailoverRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesFailoverRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesFailoverRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesFailoverRequestOrBuilder.java new file mode 100644 index 000000000000..5708dab60731 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesFailoverRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesFailoverRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesFailoverRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Failover Context.
+   * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + * + * @return Whether the failoverContext field is set. + */ + boolean hasFailoverContext(); + + /** + * + * + *
+   * Failover Context.
+   * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + * + * @return The failoverContext. + */ + com.google.cloud.sql.v1.FailoverContext getFailoverContext(); + + /** + * + * + *
+   * Failover Context.
+   * 
+ * + * .google.cloud.sql.v1.FailoverContext failover_context = 1; + */ + com.google.cloud.sql.v1.FailoverContextOrBuilder getFailoverContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesImportRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesImportRequest.java new file mode 100644 index 000000000000..0df044bbacf4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesImportRequest.java @@ -0,0 +1,698 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance import request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesImportRequest} + */ +@com.google.protobuf.Generated +public final class InstancesImportRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesImportRequest) + InstancesImportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesImportRequest"); + } + + // Use InstancesImportRequest.newBuilder() to construct. + private InstancesImportRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesImportRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesImportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesImportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesImportRequest.class, + com.google.cloud.sql.v1.InstancesImportRequest.Builder.class); + } + + private int bitField0_; + public static final int IMPORT_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.ImportContext importContext_; + + /** + * + * + *
+   * Contains details about the import operation.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + * + * @return Whether the importContext field is set. + */ + @java.lang.Override + public boolean hasImportContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Contains details about the import operation.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + * + * @return The importContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext getImportContext() { + return importContext_ == null + ? com.google.cloud.sql.v1.ImportContext.getDefaultInstance() + : importContext_; + } + + /** + * + * + *
+   * Contains details about the import operation.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContextOrBuilder getImportContextOrBuilder() { + return importContext_ == null + ? com.google.cloud.sql.v1.ImportContext.getDefaultInstance() + : importContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getImportContext()); + } + 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, getImportContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesImportRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesImportRequest other = + (com.google.cloud.sql.v1.InstancesImportRequest) obj; + + if (hasImportContext() != other.hasImportContext()) return false; + if (hasImportContext()) { + if (!getImportContext().equals(other.getImportContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasImportContext()) { + hash = (37 * hash) + IMPORT_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getImportContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesImportRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesImportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesImportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesImportRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesImportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesImportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesImportRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesImportRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesImportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesImportRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesImportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesImportRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.InstancesImportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance import request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesImportRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesImportRequest) + com.google.cloud.sql.v1.InstancesImportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesImportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesImportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesImportRequest.class, + com.google.cloud.sql.v1.InstancesImportRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesImportRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetImportContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + importContext_ = null; + if (importContextBuilder_ != null) { + importContextBuilder_.dispose(); + importContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesImportRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesImportRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesImportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesImportRequest build() { + com.google.cloud.sql.v1.InstancesImportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesImportRequest buildPartial() { + com.google.cloud.sql.v1.InstancesImportRequest result = + new com.google.cloud.sql.v1.InstancesImportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.InstancesImportRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.importContext_ = + importContextBuilder_ == null ? importContext_ : importContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesImportRequest) { + return mergeFrom((com.google.cloud.sql.v1.InstancesImportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InstancesImportRequest other) { + if (other == com.google.cloud.sql.v1.InstancesImportRequest.getDefaultInstance()) return this; + if (other.hasImportContext()) { + mergeImportContext(other.getImportContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetImportContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.ImportContext importContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext, + com.google.cloud.sql.v1.ImportContext.Builder, + com.google.cloud.sql.v1.ImportContextOrBuilder> + importContextBuilder_; + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + * + * @return Whether the importContext field is set. + */ + public boolean hasImportContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + * + * @return The importContext. + */ + public com.google.cloud.sql.v1.ImportContext getImportContext() { + if (importContextBuilder_ == null) { + return importContext_ == null + ? com.google.cloud.sql.v1.ImportContext.getDefaultInstance() + : importContext_; + } else { + return importContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + */ + public Builder setImportContext(com.google.cloud.sql.v1.ImportContext value) { + if (importContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + importContext_ = value; + } else { + importContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + */ + public Builder setImportContext(com.google.cloud.sql.v1.ImportContext.Builder builderForValue) { + if (importContextBuilder_ == null) { + importContext_ = builderForValue.build(); + } else { + importContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + */ + public Builder mergeImportContext(com.google.cloud.sql.v1.ImportContext value) { + if (importContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && importContext_ != null + && importContext_ != com.google.cloud.sql.v1.ImportContext.getDefaultInstance()) { + getImportContextBuilder().mergeFrom(value); + } else { + importContext_ = value; + } + } else { + importContextBuilder_.mergeFrom(value); + } + if (importContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + */ + public Builder clearImportContext() { + bitField0_ = (bitField0_ & ~0x00000001); + importContext_ = null; + if (importContextBuilder_ != null) { + importContextBuilder_.dispose(); + importContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + */ + public com.google.cloud.sql.v1.ImportContext.Builder getImportContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetImportContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + */ + public com.google.cloud.sql.v1.ImportContextOrBuilder getImportContextOrBuilder() { + if (importContextBuilder_ != null) { + return importContextBuilder_.getMessageOrBuilder(); + } else { + return importContext_ == null + ? com.google.cloud.sql.v1.ImportContext.getDefaultInstance() + : importContext_; + } + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext, + com.google.cloud.sql.v1.ImportContext.Builder, + com.google.cloud.sql.v1.ImportContextOrBuilder> + internalGetImportContextFieldBuilder() { + if (importContextBuilder_ == null) { + importContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext, + com.google.cloud.sql.v1.ImportContext.Builder, + com.google.cloud.sql.v1.ImportContextOrBuilder>( + getImportContext(), getParentForChildren(), isClean()); + importContext_ = null; + } + return importContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesImportRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesImportRequest) + private static final com.google.cloud.sql.v1.InstancesImportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesImportRequest(); + } + + public static com.google.cloud.sql.v1.InstancesImportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesImportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesImportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesImportRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesImportRequestOrBuilder.java new file mode 100644 index 000000000000..d1e9d510ae59 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesImportRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesImportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesImportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Contains details about the import operation.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + * + * @return Whether the importContext field is set. + */ + boolean hasImportContext(); + + /** + * + * + *
+   * Contains details about the import operation.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + * + * @return The importContext. + */ + com.google.cloud.sql.v1.ImportContext getImportContext(); + + /** + * + * + *
+   * Contains details about the import operation.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 1; + */ + com.google.cloud.sql.v1.ImportContextOrBuilder getImportContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListEntraIdCertificatesResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListEntraIdCertificatesResponse.java new file mode 100644 index 000000000000..0d34c945adf2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListEntraIdCertificatesResponse.java @@ -0,0 +1,1306 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instances ListEntraIdCertificates response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse} + */ +@com.google.protobuf.Generated +public final class InstancesListEntraIdCertificatesResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse) + InstancesListEntraIdCertificatesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesListEntraIdCertificatesResponse"); + } + + // Use InstancesListEntraIdCertificatesResponse.newBuilder() to construct. + private InstancesListEntraIdCertificatesResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesListEntraIdCertificatesResponse() { + certs_ = java.util.Collections.emptyList(); + activeVersion_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListEntraIdCertificatesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListEntraIdCertificatesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse.class, + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse.Builder.class); + } + + public static final int CERTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List certs_; + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + @java.lang.Override + public java.util.List getCertsList() { + return certs_; + } + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + @java.lang.Override + public java.util.List + getCertsOrBuilderList() { + return certs_; + } + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + @java.lang.Override + public int getCertsCount() { + return certs_.size(); + } + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCert getCerts(int index) { + return certs_.get(index); + } + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertOrBuilder getCertsOrBuilder(int index) { + return certs_.get(index); + } + + public static final int ACTIVE_VERSION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object activeVersion_ = ""; + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `certs`.
+   * 
+ * + * string active_version = 2; + * + * @return The activeVersion. + */ + @java.lang.Override + public java.lang.String getActiveVersion() { + java.lang.Object ref = activeVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `certs`.
+   * 
+ * + * string active_version = 2; + * + * @return The bytes for activeVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getActiveVersionBytes() { + java.lang.Object ref = activeVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#instancesListEntraIdCertificates`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#instancesListEntraIdCertificates`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < certs_.size(); i++) { + output.writeMessage(1, certs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(activeVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, activeVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < certs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, certs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(activeVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, activeVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse other = + (com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse) obj; + + if (!getCertsList().equals(other.getCertsList())) return false; + if (!getActiveVersion().equals(other.getActiveVersion())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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 (getCertsCount() > 0) { + hash = (37 * hash) + CERTS_FIELD_NUMBER; + hash = (53 * hash) + getCertsList().hashCode(); + } + hash = (37 * hash) + ACTIVE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getActiveVersion().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instances ListEntraIdCertificates response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse) + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListEntraIdCertificatesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListEntraIdCertificatesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse.class, + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (certsBuilder_ == null) { + certs_ = java.util.Collections.emptyList(); + } else { + certs_ = null; + certsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + activeVersion_ = ""; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListEntraIdCertificatesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse build() { + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse buildPartial() { + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse result = + new com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse result) { + if (certsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + certs_ = java.util.Collections.unmodifiableList(certs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.certs_ = certs_; + } else { + result.certs_ = certsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.activeVersion_ = activeVersion_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse) { + return mergeFrom((com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse other) { + if (other + == com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse.getDefaultInstance()) + return this; + if (certsBuilder_ == null) { + if (!other.certs_.isEmpty()) { + if (certs_.isEmpty()) { + certs_ = other.certs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCertsIsMutable(); + certs_.addAll(other.certs_); + } + onChanged(); + } + } else { + if (!other.certs_.isEmpty()) { + if (certsBuilder_.isEmpty()) { + certsBuilder_.dispose(); + certsBuilder_ = null; + certs_ = other.certs_; + bitField0_ = (bitField0_ & ~0x00000001); + certsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetCertsFieldBuilder() + : null; + } else { + certsBuilder_.addAllMessages(other.certs_); + } + } + } + if (!other.getActiveVersion().isEmpty()) { + activeVersion_ = other.activeVersion_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + com.google.cloud.sql.v1.SslCert m = + input.readMessage(com.google.cloud.sql.v1.SslCert.parser(), extensionRegistry); + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.add(m); + } else { + certsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + activeVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List certs_ = + java.util.Collections.emptyList(); + + private void ensureCertsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + certs_ = new java.util.ArrayList(certs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + certsBuilder_; + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public java.util.List getCertsList() { + if (certsBuilder_ == null) { + return java.util.Collections.unmodifiableList(certs_); + } else { + return certsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public int getCertsCount() { + if (certsBuilder_ == null) { + return certs_.size(); + } else { + return certsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public com.google.cloud.sql.v1.SslCert getCerts(int index) { + if (certsBuilder_ == null) { + return certs_.get(index); + } else { + return certsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder setCerts(int index, com.google.cloud.sql.v1.SslCert value) { + if (certsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertsIsMutable(); + certs_.set(index, value); + onChanged(); + } else { + certsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder setCerts(int index, com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.set(index, builderForValue.build()); + onChanged(); + } else { + certsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder addCerts(com.google.cloud.sql.v1.SslCert value) { + if (certsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertsIsMutable(); + certs_.add(value); + onChanged(); + } else { + certsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder addCerts(int index, com.google.cloud.sql.v1.SslCert value) { + if (certsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertsIsMutable(); + certs_.add(index, value); + onChanged(); + } else { + certsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder addCerts(com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.add(builderForValue.build()); + onChanged(); + } else { + certsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder addCerts(int index, com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.add(index, builderForValue.build()); + onChanged(); + } else { + certsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder addAllCerts( + java.lang.Iterable values) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, certs_); + onChanged(); + } else { + certsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder clearCerts() { + if (certsBuilder_ == null) { + certs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + certsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder removeCerts(int index) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.remove(index); + onChanged(); + } else { + certsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public com.google.cloud.sql.v1.SslCert.Builder getCertsBuilder(int index) { + return internalGetCertsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public com.google.cloud.sql.v1.SslCertOrBuilder getCertsOrBuilder(int index) { + if (certsBuilder_ == null) { + return certs_.get(index); + } else { + return certsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public java.util.List + getCertsOrBuilderList() { + if (certsBuilder_ != null) { + return certsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(certs_); + } + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public com.google.cloud.sql.v1.SslCert.Builder addCertsBuilder() { + return internalGetCertsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public com.google.cloud.sql.v1.SslCert.Builder addCertsBuilder(int index) { + return internalGetCertsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public java.util.List getCertsBuilderList() { + return internalGetCertsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + internalGetCertsFieldBuilder() { + if (certsBuilder_ == null) { + certsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder>( + certs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + certs_ = null; + } + return certsBuilder_; + } + + private java.lang.Object activeVersion_ = ""; + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `certs`.
+     * 
+ * + * string active_version = 2; + * + * @return The activeVersion. + */ + public java.lang.String getActiveVersion() { + java.lang.Object ref = activeVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `certs`.
+     * 
+ * + * string active_version = 2; + * + * @return The bytes for activeVersion. + */ + public com.google.protobuf.ByteString getActiveVersionBytes() { + java.lang.Object ref = activeVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `certs`.
+     * 
+ * + * string active_version = 2; + * + * @param value The activeVersion to set. + * @return This builder for chaining. + */ + public Builder setActiveVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + activeVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `certs`.
+     * 
+ * + * string active_version = 2; + * + * @return This builder for chaining. + */ + public Builder clearActiveVersion() { + activeVersion_ = getDefaultInstance().getActiveVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `certs`.
+     * 
+ * + * string active_version = 2; + * + * @param value The bytes for activeVersion to set. + * @return This builder for chaining. + */ + public Builder setActiveVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + activeVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#instancesListEntraIdCertificates`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesListEntraIdCertificates`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesListEntraIdCertificates`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesListEntraIdCertificates`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesListEntraIdCertificates`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse) + private static final com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse(); + } + + public static com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesListEntraIdCertificatesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListEntraIdCertificatesResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListEntraIdCertificatesResponseOrBuilder.java new file mode 100644 index 000000000000..25204a64eb60 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListEntraIdCertificatesResponseOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesListEntraIdCertificatesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + java.util.List getCertsList(); + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + com.google.cloud.sql.v1.SslCert getCerts(int index); + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + int getCertsCount(); + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + java.util.List getCertsOrBuilderList(); + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + com.google.cloud.sql.v1.SslCertOrBuilder getCertsOrBuilder(int index); + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `certs`.
+   * 
+ * + * string active_version = 2; + * + * @return The activeVersion. + */ + java.lang.String getActiveVersion(); + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `certs`.
+   * 
+ * + * string active_version = 2; + * + * @return The bytes for activeVersion. + */ + com.google.protobuf.ByteString getActiveVersionBytes(); + + /** + * + * + *
+   * This is always `sql#instancesListEntraIdCertificates`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#instancesListEntraIdCertificates`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListResponse.java new file mode 100644 index 000000000000..60bb0cf53d4d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListResponse.java @@ -0,0 +1,1813 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instances list response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesListResponse} + */ +@com.google.protobuf.Generated +public final class InstancesListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesListResponse) + InstancesListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesListResponse"); + } + + // Use InstancesListResponse.newBuilder() to construct. + private InstancesListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesListResponse() { + kind_ = ""; + warnings_ = java.util.Collections.emptyList(); + items_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesListResponse.class, + com.google.cloud.sql.v1.InstancesListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#instancesList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#instancesList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WARNINGS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List warnings_; + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + @java.lang.Override + public java.util.List getWarningsList() { + return warnings_; + } + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + @java.lang.Override + public java.util.List + getWarningsOrBuilderList() { + return warnings_; + } + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + @java.lang.Override + public int getWarningsCount() { + return warnings_.size(); + } + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ApiWarning getWarnings(int index) { + return warnings_.get(index); + } + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ApiWarningOrBuilder getWarningsOrBuilder(int index) { + return warnings_.get(index); + } + + public static final int ITEMS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 4; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 4; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < warnings_.size(); i++) { + output.writeMessage(2, warnings_.get(i)); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(3, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < warnings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, warnings_.get(i)); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesListResponse other = + (com.google.cloud.sql.v1.InstancesListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getWarningsList().equals(other.getWarningsList())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getWarningsCount() > 0) { + hash = (37 * hash) + WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + getWarningsList().hashCode(); + } + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesListResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.InstancesListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instances list response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesListResponse) + com.google.cloud.sql.v1.InstancesListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesListResponse.class, + com.google.cloud.sql.v1.InstancesListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (warningsBuilder_ == null) { + warnings_ = java.util.Collections.emptyList(); + } else { + warnings_ = null; + warningsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListResponse build() { + com.google.cloud.sql.v1.InstancesListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListResponse buildPartial() { + com.google.cloud.sql.v1.InstancesListResponse result = + new com.google.cloud.sql.v1.InstancesListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.InstancesListResponse result) { + if (warningsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + warnings_ = java.util.Collections.unmodifiableList(warnings_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.warnings_ = warnings_; + } else { + result.warnings_ = warningsBuilder_.build(); + } + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.InstancesListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesListResponse) { + return mergeFrom((com.google.cloud.sql.v1.InstancesListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InstancesListResponse other) { + if (other == com.google.cloud.sql.v1.InstancesListResponse.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (warningsBuilder_ == null) { + if (!other.warnings_.isEmpty()) { + if (warnings_.isEmpty()) { + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureWarningsIsMutable(); + warnings_.addAll(other.warnings_); + } + onChanged(); + } + } else { + if (!other.warnings_.isEmpty()) { + if (warningsBuilder_.isEmpty()) { + warningsBuilder_.dispose(); + warningsBuilder_ = null; + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000002); + warningsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetWarningsFieldBuilder() + : null; + } else { + warningsBuilder_.addAllMessages(other.warnings_); + } + } + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000004); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1.ApiWarning m = + input.readMessage( + com.google.cloud.sql.v1.ApiWarning.parser(), extensionRegistry); + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(m); + } else { + warningsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + com.google.cloud.sql.v1.DatabaseInstance m = + input.readMessage( + com.google.cloud.sql.v1.DatabaseInstance.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + nextPageToken_ = 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#instancesList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List warnings_ = + java.util.Collections.emptyList(); + + private void ensureWarningsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + warnings_ = new java.util.ArrayList(warnings_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ApiWarning, + com.google.cloud.sql.v1.ApiWarning.Builder, + com.google.cloud.sql.v1.ApiWarningOrBuilder> + warningsBuilder_; + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public java.util.List getWarningsList() { + if (warningsBuilder_ == null) { + return java.util.Collections.unmodifiableList(warnings_); + } else { + return warningsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public int getWarningsCount() { + if (warningsBuilder_ == null) { + return warnings_.size(); + } else { + return warningsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public com.google.cloud.sql.v1.ApiWarning getWarnings(int index) { + if (warningsBuilder_ == null) { + return warnings_.get(index); + } else { + return warningsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public Builder setWarnings(int index, com.google.cloud.sql.v1.ApiWarning value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.set(index, value); + onChanged(); + } else { + warningsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public Builder setWarnings( + int index, com.google.cloud.sql.v1.ApiWarning.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.set(index, builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public Builder addWarnings(com.google.cloud.sql.v1.ApiWarning value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(value); + onChanged(); + } else { + warningsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public Builder addWarnings(int index, com.google.cloud.sql.v1.ApiWarning value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(index, value); + onChanged(); + } else { + warningsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public Builder addWarnings(com.google.cloud.sql.v1.ApiWarning.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public Builder addWarnings( + int index, com.google.cloud.sql.v1.ApiWarning.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(index, builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public Builder addAllWarnings( + java.lang.Iterable values) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, warnings_); + onChanged(); + } else { + warningsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public Builder clearWarnings() { + if (warningsBuilder_ == null) { + warnings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + warningsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public Builder removeWarnings(int index) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.remove(index); + onChanged(); + } else { + warningsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public com.google.cloud.sql.v1.ApiWarning.Builder getWarningsBuilder(int index) { + return internalGetWarningsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public com.google.cloud.sql.v1.ApiWarningOrBuilder getWarningsOrBuilder(int index) { + if (warningsBuilder_ == null) { + return warnings_.get(index); + } else { + return warningsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public java.util.List + getWarningsOrBuilderList() { + if (warningsBuilder_ != null) { + return warningsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(warnings_); + } + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public com.google.cloud.sql.v1.ApiWarning.Builder addWarningsBuilder() { + return internalGetWarningsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.ApiWarning.getDefaultInstance()); + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public com.google.cloud.sql.v1.ApiWarning.Builder addWarningsBuilder(int index) { + return internalGetWarningsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.ApiWarning.getDefaultInstance()); + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + public java.util.List getWarningsBuilderList() { + return internalGetWarningsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ApiWarning, + com.google.cloud.sql.v1.ApiWarning.Builder, + com.google.cloud.sql.v1.ApiWarningOrBuilder> + internalGetWarningsFieldBuilder() { + if (warningsBuilder_ == null) { + warningsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ApiWarning, + com.google.cloud.sql.v1.ApiWarning.Builder, + com.google.cloud.sql.v1.ApiWarningOrBuilder>( + warnings_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + warnings_ = null; + } + return warningsBuilder_; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public com.google.cloud.sql.v1.DatabaseInstance getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.DatabaseInstance value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public Builder setItems( + int index, com.google.cloud.sql.v1.DatabaseInstance.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public Builder addItems(com.google.cloud.sql.v1.DatabaseInstance value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.DatabaseInstance value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public Builder addItems(com.google.cloud.sql.v1.DatabaseInstance.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public Builder addItems( + int index, com.google.cloud.sql.v1.DatabaseInstance.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public com.google.cloud.sql.v1.DatabaseInstance.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public com.google.cloud.sql.v1.DatabaseInstance.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance()); + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public com.google.cloud.sql.v1.DatabaseInstance.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance()); + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder>( + items_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 4; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 4; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 4; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 4; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesListResponse) + private static final com.google.cloud.sql.v1.InstancesListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesListResponse(); + } + + public static com.google.cloud.sql.v1.InstancesListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListResponseOrBuilder.java new file mode 100644 index 000000000000..6134fb9041d7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListResponseOrBuilder.java @@ -0,0 +1,193 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#instancesList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#instancesList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + java.util.List getWarningsList(); + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + com.google.cloud.sql.v1.ApiWarning getWarnings(int index); + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + int getWarningsCount(); + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + java.util.List getWarningsOrBuilderList(); + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 2; + */ + com.google.cloud.sql.v1.ApiWarningOrBuilder getWarningsOrBuilder(int index); + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + com.google.cloud.sql.v1.DatabaseInstance getItems(int index); + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + int getItemsCount(); + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + java.util.List + getItemsOrBuilderList(); + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseInstance items = 3; + */ + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getItemsOrBuilder(int index); + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 4; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 4; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListServerCasResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListServerCasResponse.java new file mode 100644 index 000000000000..b7efe873cbe6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListServerCasResponse.java @@ -0,0 +1,1255 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instances ListServerCas response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesListServerCasResponse} + */ +@com.google.protobuf.Generated +public final class InstancesListServerCasResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesListServerCasResponse) + InstancesListServerCasResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesListServerCasResponse"); + } + + // Use InstancesListServerCasResponse.newBuilder() to construct. + private InstancesListServerCasResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesListServerCasResponse() { + certs_ = java.util.Collections.emptyList(); + activeVersion_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListServerCasResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListServerCasResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesListServerCasResponse.class, + com.google.cloud.sql.v1.InstancesListServerCasResponse.Builder.class); + } + + public static final int CERTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List certs_; + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + @java.lang.Override + public java.util.List getCertsList() { + return certs_; + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + @java.lang.Override + public java.util.List + getCertsOrBuilderList() { + return certs_; + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + @java.lang.Override + public int getCertsCount() { + return certs_.size(); + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCert getCerts(int index) { + return certs_.get(index); + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertOrBuilder getCertsOrBuilder(int index) { + return certs_.get(index); + } + + public static final int ACTIVE_VERSION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object activeVersion_ = ""; + + /** + * string active_version = 2; + * + * @return The activeVersion. + */ + @java.lang.Override + public java.lang.String getActiveVersion() { + java.lang.Object ref = activeVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeVersion_ = s; + return s; + } + } + + /** + * string active_version = 2; + * + * @return The bytes for activeVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getActiveVersionBytes() { + java.lang.Object ref = activeVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#instancesListServerCas`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#instancesListServerCas`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < certs_.size(); i++) { + output.writeMessage(1, certs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(activeVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, activeVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < certs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, certs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(activeVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, activeVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesListServerCasResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesListServerCasResponse other = + (com.google.cloud.sql.v1.InstancesListServerCasResponse) obj; + + if (!getCertsList().equals(other.getCertsList())) return false; + if (!getActiveVersion().equals(other.getActiveVersion())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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 (getCertsCount() > 0) { + hash = (37 * hash) + CERTS_FIELD_NUMBER; + hash = (53 * hash) + getCertsList().hashCode(); + } + hash = (37 * hash) + ACTIVE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getActiveVersion().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesListServerCasResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesListServerCasResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListServerCasResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesListServerCasResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListServerCasResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesListServerCasResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListServerCasResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesListServerCasResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListServerCasResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesListServerCasResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListServerCasResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesListServerCasResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.InstancesListServerCasResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instances ListServerCas response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesListServerCasResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesListServerCasResponse) + com.google.cloud.sql.v1.InstancesListServerCasResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListServerCasResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListServerCasResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesListServerCasResponse.class, + com.google.cloud.sql.v1.InstancesListServerCasResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesListServerCasResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (certsBuilder_ == null) { + certs_ = java.util.Collections.emptyList(); + } else { + certs_ = null; + certsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + activeVersion_ = ""; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListServerCasResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListServerCasResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesListServerCasResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListServerCasResponse build() { + com.google.cloud.sql.v1.InstancesListServerCasResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListServerCasResponse buildPartial() { + com.google.cloud.sql.v1.InstancesListServerCasResponse result = + new com.google.cloud.sql.v1.InstancesListServerCasResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1.InstancesListServerCasResponse result) { + if (certsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + certs_ = java.util.Collections.unmodifiableList(certs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.certs_ = certs_; + } else { + result.certs_ = certsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.InstancesListServerCasResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.activeVersion_ = activeVersion_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesListServerCasResponse) { + return mergeFrom((com.google.cloud.sql.v1.InstancesListServerCasResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InstancesListServerCasResponse other) { + if (other == com.google.cloud.sql.v1.InstancesListServerCasResponse.getDefaultInstance()) + return this; + if (certsBuilder_ == null) { + if (!other.certs_.isEmpty()) { + if (certs_.isEmpty()) { + certs_ = other.certs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCertsIsMutable(); + certs_.addAll(other.certs_); + } + onChanged(); + } + } else { + if (!other.certs_.isEmpty()) { + if (certsBuilder_.isEmpty()) { + certsBuilder_.dispose(); + certsBuilder_ = null; + certs_ = other.certs_; + bitField0_ = (bitField0_ & ~0x00000001); + certsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetCertsFieldBuilder() + : null; + } else { + certsBuilder_.addAllMessages(other.certs_); + } + } + } + if (!other.getActiveVersion().isEmpty()) { + activeVersion_ = other.activeVersion_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + com.google.cloud.sql.v1.SslCert m = + input.readMessage(com.google.cloud.sql.v1.SslCert.parser(), extensionRegistry); + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.add(m); + } else { + certsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + activeVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List certs_ = + java.util.Collections.emptyList(); + + private void ensureCertsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + certs_ = new java.util.ArrayList(certs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + certsBuilder_; + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public java.util.List getCertsList() { + if (certsBuilder_ == null) { + return java.util.Collections.unmodifiableList(certs_); + } else { + return certsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public int getCertsCount() { + if (certsBuilder_ == null) { + return certs_.size(); + } else { + return certsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public com.google.cloud.sql.v1.SslCert getCerts(int index) { + if (certsBuilder_ == null) { + return certs_.get(index); + } else { + return certsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder setCerts(int index, com.google.cloud.sql.v1.SslCert value) { + if (certsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertsIsMutable(); + certs_.set(index, value); + onChanged(); + } else { + certsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder setCerts(int index, com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.set(index, builderForValue.build()); + onChanged(); + } else { + certsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder addCerts(com.google.cloud.sql.v1.SslCert value) { + if (certsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertsIsMutable(); + certs_.add(value); + onChanged(); + } else { + certsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder addCerts(int index, com.google.cloud.sql.v1.SslCert value) { + if (certsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertsIsMutable(); + certs_.add(index, value); + onChanged(); + } else { + certsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder addCerts(com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.add(builderForValue.build()); + onChanged(); + } else { + certsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder addCerts(int index, com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.add(index, builderForValue.build()); + onChanged(); + } else { + certsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder addAllCerts( + java.lang.Iterable values) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, certs_); + onChanged(); + } else { + certsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder clearCerts() { + if (certsBuilder_ == null) { + certs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + certsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public Builder removeCerts(int index) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.remove(index); + onChanged(); + } else { + certsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public com.google.cloud.sql.v1.SslCert.Builder getCertsBuilder(int index) { + return internalGetCertsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public com.google.cloud.sql.v1.SslCertOrBuilder getCertsOrBuilder(int index) { + if (certsBuilder_ == null) { + return certs_.get(index); + } else { + return certsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public java.util.List + getCertsOrBuilderList() { + if (certsBuilder_ != null) { + return certsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(certs_); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public com.google.cloud.sql.v1.SslCert.Builder addCertsBuilder() { + return internalGetCertsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public com.google.cloud.sql.v1.SslCert.Builder addCertsBuilder(int index) { + return internalGetCertsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + public java.util.List getCertsBuilderList() { + return internalGetCertsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + internalGetCertsFieldBuilder() { + if (certsBuilder_ == null) { + certsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder>( + certs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + certs_ = null; + } + return certsBuilder_; + } + + private java.lang.Object activeVersion_ = ""; + + /** + * string active_version = 2; + * + * @return The activeVersion. + */ + public java.lang.String getActiveVersion() { + java.lang.Object ref = activeVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string active_version = 2; + * + * @return The bytes for activeVersion. + */ + public com.google.protobuf.ByteString getActiveVersionBytes() { + java.lang.Object ref = activeVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string active_version = 2; + * + * @param value The activeVersion to set. + * @return This builder for chaining. + */ + public Builder setActiveVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + activeVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string active_version = 2; + * + * @return This builder for chaining. + */ + public Builder clearActiveVersion() { + activeVersion_ = getDefaultInstance().getActiveVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string active_version = 2; + * + * @param value The bytes for activeVersion to set. + * @return This builder for chaining. + */ + public Builder setActiveVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + activeVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#instancesListServerCas`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCas`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCas`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCas`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCas`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesListServerCasResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesListServerCasResponse) + private static final com.google.cloud.sql.v1.InstancesListServerCasResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesListServerCasResponse(); + } + + public static com.google.cloud.sql.v1.InstancesListServerCasResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesListServerCasResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListServerCasResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListServerCasResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListServerCasResponseOrBuilder.java new file mode 100644 index 000000000000..af5ff728ece4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListServerCasResponseOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesListServerCasResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesListServerCasResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + java.util.List getCertsList(); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + com.google.cloud.sql.v1.SslCert getCerts(int index); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + int getCertsCount(); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + java.util.List getCertsOrBuilderList(); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert certs = 1; + */ + com.google.cloud.sql.v1.SslCertOrBuilder getCertsOrBuilder(int index); + + /** + * string active_version = 2; + * + * @return The activeVersion. + */ + java.lang.String getActiveVersion(); + + /** + * string active_version = 2; + * + * @return The bytes for activeVersion. + */ + com.google.protobuf.ByteString getActiveVersionBytes(); + + /** + * + * + *
+   * This is always `sql#instancesListServerCas`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#instancesListServerCas`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListServerCertificatesResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListServerCertificatesResponse.java new file mode 100644 index 000000000000..6c1d83910273 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListServerCertificatesResponse.java @@ -0,0 +1,1837 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instances ListServerCertificates response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesListServerCertificatesResponse} + */ +@com.google.protobuf.Generated +public final class InstancesListServerCertificatesResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesListServerCertificatesResponse) + InstancesListServerCertificatesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesListServerCertificatesResponse"); + } + + // Use InstancesListServerCertificatesResponse.newBuilder() to construct. + private InstancesListServerCertificatesResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesListServerCertificatesResponse() { + caCerts_ = java.util.Collections.emptyList(); + serverCerts_ = java.util.Collections.emptyList(); + activeVersion_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListServerCertificatesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListServerCertificatesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse.class, + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse.Builder.class); + } + + public static final int CA_CERTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List caCerts_; + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + @java.lang.Override + public java.util.List getCaCertsList() { + return caCerts_; + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + @java.lang.Override + public java.util.List + getCaCertsOrBuilderList() { + return caCerts_; + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + @java.lang.Override + public int getCaCertsCount() { + return caCerts_.size(); + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCert getCaCerts(int index) { + return caCerts_.get(index); + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertOrBuilder getCaCertsOrBuilder(int index) { + return caCerts_.get(index); + } + + public static final int SERVER_CERTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List serverCerts_; + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + @java.lang.Override + public java.util.List getServerCertsList() { + return serverCerts_; + } + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + @java.lang.Override + public java.util.List + getServerCertsOrBuilderList() { + return serverCerts_; + } + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + @java.lang.Override + public int getServerCertsCount() { + return serverCerts_.size(); + } + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCert getServerCerts(int index) { + return serverCerts_.get(index); + } + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertOrBuilder getServerCertsOrBuilder(int index) { + return serverCerts_.get(index); + } + + public static final int ACTIVE_VERSION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object activeVersion_ = ""; + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `server_certs`.
+   * 
+ * + * string active_version = 3; + * + * @return The activeVersion. + */ + @java.lang.Override + public java.lang.String getActiveVersion() { + java.lang.Object ref = activeVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `server_certs`.
+   * 
+ * + * string active_version = 3; + * + * @return The bytes for activeVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getActiveVersionBytes() { + java.lang.Object ref = activeVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#instancesListServerCertificates`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#instancesListServerCertificates`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < caCerts_.size(); i++) { + output.writeMessage(1, caCerts_.get(i)); + } + for (int i = 0; i < serverCerts_.size(); i++) { + output.writeMessage(2, serverCerts_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(activeVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, activeVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, kind_); + } + 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)); + } + for (int i = 0; i < serverCerts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, serverCerts_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(activeVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, activeVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesListServerCertificatesResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse other = + (com.google.cloud.sql.v1.InstancesListServerCertificatesResponse) obj; + + if (!getCaCertsList().equals(other.getCaCertsList())) return false; + if (!getServerCertsList().equals(other.getServerCertsList())) return false; + if (!getActiveVersion().equals(other.getActiveVersion())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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(); + } + if (getServerCertsCount() > 0) { + hash = (37 * hash) + SERVER_CERTS_FIELD_NUMBER; + hash = (53 * hash) + getServerCertsList().hashCode(); + } + hash = (37 * hash) + ACTIVE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getActiveVersion().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesListServerCertificatesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesListServerCertificatesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListServerCertificatesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesListServerCertificatesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListServerCertificatesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesListServerCertificatesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListServerCertificatesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesListServerCertificatesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListServerCertificatesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesListServerCertificatesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesListServerCertificatesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesListServerCertificatesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instances ListServerCertificates response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesListServerCertificatesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesListServerCertificatesResponse) + com.google.cloud.sql.v1.InstancesListServerCertificatesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListServerCertificatesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListServerCertificatesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse.class, + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesListServerCertificatesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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); + if (serverCertsBuilder_ == null) { + serverCerts_ = java.util.Collections.emptyList(); + } else { + serverCerts_ = null; + serverCertsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + activeVersion_ = ""; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesListServerCertificatesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListServerCertificatesResponse + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesListServerCertificatesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListServerCertificatesResponse build() { + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListServerCertificatesResponse buildPartial() { + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse result = + new com.google.cloud.sql.v1.InstancesListServerCertificatesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse 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(); + } + if (serverCertsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + serverCerts_ = java.util.Collections.unmodifiableList(serverCerts_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.serverCerts_ = serverCerts_; + } else { + result.serverCerts_ = serverCertsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.activeVersion_ = activeVersion_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesListServerCertificatesResponse) { + return mergeFrom((com.google.cloud.sql.v1.InstancesListServerCertificatesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.InstancesListServerCertificatesResponse other) { + if (other + == com.google.cloud.sql.v1.InstancesListServerCertificatesResponse.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.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetCaCertsFieldBuilder() + : null; + } else { + caCertsBuilder_.addAllMessages(other.caCerts_); + } + } + } + if (serverCertsBuilder_ == null) { + if (!other.serverCerts_.isEmpty()) { + if (serverCerts_.isEmpty()) { + serverCerts_ = other.serverCerts_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureServerCertsIsMutable(); + serverCerts_.addAll(other.serverCerts_); + } + onChanged(); + } + } else { + if (!other.serverCerts_.isEmpty()) { + if (serverCertsBuilder_.isEmpty()) { + serverCertsBuilder_.dispose(); + serverCertsBuilder_ = null; + serverCerts_ = other.serverCerts_; + bitField0_ = (bitField0_ & ~0x00000002); + serverCertsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetServerCertsFieldBuilder() + : null; + } else { + serverCertsBuilder_.addAllMessages(other.serverCerts_); + } + } + } + if (!other.getActiveVersion().isEmpty()) { + activeVersion_ = other.activeVersion_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + com.google.cloud.sql.v1.SslCert m = + input.readMessage(com.google.cloud.sql.v1.SslCert.parser(), extensionRegistry); + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.add(m); + } else { + caCertsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1.SslCert m = + input.readMessage(com.google.cloud.sql.v1.SslCert.parser(), extensionRegistry); + if (serverCertsBuilder_ == null) { + ensureServerCertsIsMutable(); + serverCerts_.add(m); + } else { + serverCertsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + activeVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + kind_ = 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.util.List caCerts_ = + java.util.Collections.emptyList(); + + private void ensureCaCertsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + caCerts_ = new java.util.ArrayList(caCerts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + caCertsBuilder_; + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public java.util.List getCaCertsList() { + if (caCertsBuilder_ == null) { + return java.util.Collections.unmodifiableList(caCerts_); + } else { + return caCertsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public int getCaCertsCount() { + if (caCertsBuilder_ == null) { + return caCerts_.size(); + } else { + return caCertsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public com.google.cloud.sql.v1.SslCert getCaCerts(int index) { + if (caCertsBuilder_ == null) { + return caCerts_.get(index); + } else { + return caCertsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public Builder setCaCerts(int index, com.google.cloud.sql.v1.SslCert value) { + if (caCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaCertsIsMutable(); + caCerts_.set(index, value); + onChanged(); + } else { + caCertsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public Builder setCaCerts(int index, com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.set(index, builderForValue.build()); + onChanged(); + } else { + caCertsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public Builder addCaCerts(com.google.cloud.sql.v1.SslCert value) { + if (caCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaCertsIsMutable(); + caCerts_.add(value); + onChanged(); + } else { + caCertsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public Builder addCaCerts(int index, com.google.cloud.sql.v1.SslCert value) { + if (caCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaCertsIsMutable(); + caCerts_.add(index, value); + onChanged(); + } else { + caCertsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public Builder addCaCerts(com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.add(builderForValue.build()); + onChanged(); + } else { + caCertsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public Builder addCaCerts(int index, com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.add(index, builderForValue.build()); + onChanged(); + } else { + caCertsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public Builder addAllCaCerts( + java.lang.Iterable values) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, caCerts_); + onChanged(); + } else { + caCertsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public Builder clearCaCerts() { + if (caCertsBuilder_ == null) { + caCerts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + caCertsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public Builder removeCaCerts(int index) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.remove(index); + onChanged(); + } else { + caCertsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public com.google.cloud.sql.v1.SslCert.Builder getCaCertsBuilder(int index) { + return internalGetCaCertsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public com.google.cloud.sql.v1.SslCertOrBuilder getCaCertsOrBuilder(int index) { + if (caCertsBuilder_ == null) { + return caCerts_.get(index); + } else { + return caCertsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public java.util.List + getCaCertsOrBuilderList() { + if (caCertsBuilder_ != null) { + return caCertsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(caCerts_); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public com.google.cloud.sql.v1.SslCert.Builder addCaCertsBuilder() { + return internalGetCaCertsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public com.google.cloud.sql.v1.SslCert.Builder addCaCertsBuilder(int index) { + return internalGetCaCertsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + public java.util.List getCaCertsBuilderList() { + return internalGetCaCertsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + internalGetCaCertsFieldBuilder() { + if (caCertsBuilder_ == null) { + caCertsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder>( + caCerts_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + caCerts_ = null; + } + return caCertsBuilder_; + } + + private java.util.List serverCerts_ = + java.util.Collections.emptyList(); + + private void ensureServerCertsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + serverCerts_ = new java.util.ArrayList(serverCerts_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + serverCertsBuilder_; + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public java.util.List getServerCertsList() { + if (serverCertsBuilder_ == null) { + return java.util.Collections.unmodifiableList(serverCerts_); + } else { + return serverCertsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public int getServerCertsCount() { + if (serverCertsBuilder_ == null) { + return serverCerts_.size(); + } else { + return serverCertsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public com.google.cloud.sql.v1.SslCert getServerCerts(int index) { + if (serverCertsBuilder_ == null) { + return serverCerts_.get(index); + } else { + return serverCertsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public Builder setServerCerts(int index, com.google.cloud.sql.v1.SslCert value) { + if (serverCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerCertsIsMutable(); + serverCerts_.set(index, value); + onChanged(); + } else { + serverCertsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public Builder setServerCerts( + int index, com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (serverCertsBuilder_ == null) { + ensureServerCertsIsMutable(); + serverCerts_.set(index, builderForValue.build()); + onChanged(); + } else { + serverCertsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public Builder addServerCerts(com.google.cloud.sql.v1.SslCert value) { + if (serverCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerCertsIsMutable(); + serverCerts_.add(value); + onChanged(); + } else { + serverCertsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public Builder addServerCerts(int index, com.google.cloud.sql.v1.SslCert value) { + if (serverCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerCertsIsMutable(); + serverCerts_.add(index, value); + onChanged(); + } else { + serverCertsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public Builder addServerCerts(com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (serverCertsBuilder_ == null) { + ensureServerCertsIsMutable(); + serverCerts_.add(builderForValue.build()); + onChanged(); + } else { + serverCertsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public Builder addServerCerts( + int index, com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (serverCertsBuilder_ == null) { + ensureServerCertsIsMutable(); + serverCerts_.add(index, builderForValue.build()); + onChanged(); + } else { + serverCertsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public Builder addAllServerCerts( + java.lang.Iterable values) { + if (serverCertsBuilder_ == null) { + ensureServerCertsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, serverCerts_); + onChanged(); + } else { + serverCertsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public Builder clearServerCerts() { + if (serverCertsBuilder_ == null) { + serverCerts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + serverCertsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public Builder removeServerCerts(int index) { + if (serverCertsBuilder_ == null) { + ensureServerCertsIsMutable(); + serverCerts_.remove(index); + onChanged(); + } else { + serverCertsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public com.google.cloud.sql.v1.SslCert.Builder getServerCertsBuilder(int index) { + return internalGetServerCertsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public com.google.cloud.sql.v1.SslCertOrBuilder getServerCertsOrBuilder(int index) { + if (serverCertsBuilder_ == null) { + return serverCerts_.get(index); + } else { + return serverCertsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public java.util.List + getServerCertsOrBuilderList() { + if (serverCertsBuilder_ != null) { + return serverCertsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serverCerts_); + } + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public com.google.cloud.sql.v1.SslCert.Builder addServerCertsBuilder() { + return internalGetServerCertsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public com.google.cloud.sql.v1.SslCert.Builder addServerCertsBuilder(int index) { + return internalGetServerCertsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + public java.util.List getServerCertsBuilderList() { + return internalGetServerCertsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + internalGetServerCertsFieldBuilder() { + if (serverCertsBuilder_ == null) { + serverCertsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder>( + serverCerts_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + serverCerts_ = null; + } + return serverCertsBuilder_; + } + + private java.lang.Object activeVersion_ = ""; + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `server_certs`.
+     * 
+ * + * string active_version = 3; + * + * @return The activeVersion. + */ + public java.lang.String getActiveVersion() { + java.lang.Object ref = activeVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `server_certs`.
+     * 
+ * + * string active_version = 3; + * + * @return The bytes for activeVersion. + */ + public com.google.protobuf.ByteString getActiveVersionBytes() { + java.lang.Object ref = activeVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `server_certs`.
+     * 
+ * + * string active_version = 3; + * + * @param value The activeVersion to set. + * @return This builder for chaining. + */ + public Builder setActiveVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + activeVersion_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `server_certs`.
+     * 
+ * + * string active_version = 3; + * + * @return This builder for chaining. + */ + public Builder clearActiveVersion() { + activeVersion_ = getDefaultInstance().getActiveVersion(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `server_certs`.
+     * 
+ * + * string active_version = 3; + * + * @param value The bytes for activeVersion to set. + * @return This builder for chaining. + */ + public Builder setActiveVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + activeVersion_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#instancesListServerCertificates`.
+     * 
+ * + * string kind = 4; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCertificates`.
+     * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCertificates`.
+     * 
+ * + * string kind = 4; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCertificates`.
+     * 
+ * + * string kind = 4; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCertificates`.
+     * 
+ * + * string kind = 4; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesListServerCertificatesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesListServerCertificatesResponse) + private static final com.google.cloud.sql.v1.InstancesListServerCertificatesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesListServerCertificatesResponse(); + } + + public static com.google.cloud.sql.v1.InstancesListServerCertificatesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesListServerCertificatesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesListServerCertificatesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListServerCertificatesResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListServerCertificatesResponseOrBuilder.java new file mode 100644 index 000000000000..cc862edbd99a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesListServerCertificatesResponseOrBuilder.java @@ -0,0 +1,195 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesListServerCertificatesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesListServerCertificatesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + java.util.List getCaCertsList(); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + com.google.cloud.sql.v1.SslCert getCaCerts(int index); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + int getCaCertsCount(); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + java.util.List getCaCertsOrBuilderList(); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert ca_certs = 1; + */ + com.google.cloud.sql.v1.SslCertOrBuilder getCaCertsOrBuilder(int index); + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + java.util.List getServerCertsList(); + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + com.google.cloud.sql.v1.SslCert getServerCerts(int index); + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + int getServerCertsCount(); + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + java.util.List getServerCertsOrBuilderList(); + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert server_certs = 2; + */ + com.google.cloud.sql.v1.SslCertOrBuilder getServerCertsOrBuilder(int index); + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `server_certs`.
+   * 
+ * + * string active_version = 3; + * + * @return The activeVersion. + */ + java.lang.String getActiveVersion(); + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `server_certs`.
+   * 
+ * + * string active_version = 3; + * + * @return The bytes for activeVersion. + */ + com.google.protobuf.ByteString getActiveVersionBytes(); + + /** + * + * + *
+   * This is always `sql#instancesListServerCertificates`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#instancesListServerCertificates`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesPreCheckMajorVersionUpgradeRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesPreCheckMajorVersionUpgradeRequest.java new file mode 100644 index 000000000000..5ed8bdce122c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesPreCheckMajorVersionUpgradeRequest.java @@ -0,0 +1,771 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Request for Pre-checks for MVU
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest} + */ +@com.google.protobuf.Generated +public final class InstancesPreCheckMajorVersionUpgradeRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest) + InstancesPreCheckMajorVersionUpgradeRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesPreCheckMajorVersionUpgradeRequest"); + } + + // Use InstancesPreCheckMajorVersionUpgradeRequest.newBuilder() to construct. + private InstancesPreCheckMajorVersionUpgradeRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesPreCheckMajorVersionUpgradeRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesPreCheckMajorVersionUpgradeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesPreCheckMajorVersionUpgradeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.class, + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.Builder.class); + } + + private int bitField0_; + public static final int PRE_CHECK_MAJOR_VERSION_UPGRADE_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext + preCheckMajorVersionUpgradeContext_; + + /** + * + * + *
+   * Required. Contains details about the pre-check major version upgrade
+   * operation.
+   * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the preCheckMajorVersionUpgradeContext field is set. + */ + @java.lang.Override + public boolean hasPreCheckMajorVersionUpgradeContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. Contains details about the pre-check major version upgrade
+   * operation.
+   * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The preCheckMajorVersionUpgradeContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext + getPreCheckMajorVersionUpgradeContext() { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } + + /** + * + * + *
+   * Required. Contains details about the pre-check major version upgrade
+   * operation.
+   * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContextOrBuilder + getPreCheckMajorVersionUpgradeContextOrBuilder() { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getPreCheckMajorVersionUpgradeContext()); + } + 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, getPreCheckMajorVersionUpgradeContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest other = + (com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest) obj; + + if (hasPreCheckMajorVersionUpgradeContext() != other.hasPreCheckMajorVersionUpgradeContext()) + return false; + if (hasPreCheckMajorVersionUpgradeContext()) { + if (!getPreCheckMajorVersionUpgradeContext() + .equals(other.getPreCheckMajorVersionUpgradeContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasPreCheckMajorVersionUpgradeContext()) { + hash = (37 * hash) + PRE_CHECK_MAJOR_VERSION_UPGRADE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getPreCheckMajorVersionUpgradeContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request for Pre-checks for MVU
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest) + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesPreCheckMajorVersionUpgradeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesPreCheckMajorVersionUpgradeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.class, + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPreCheckMajorVersionUpgradeContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + preCheckMajorVersionUpgradeContext_ = null; + if (preCheckMajorVersionUpgradeContextBuilder_ != null) { + preCheckMajorVersionUpgradeContextBuilder_.dispose(); + preCheckMajorVersionUpgradeContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesPreCheckMajorVersionUpgradeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest build() { + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest buildPartial() { + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest result = + new com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.preCheckMajorVersionUpgradeContext_ = + preCheckMajorVersionUpgradeContextBuilder_ == null + ? preCheckMajorVersionUpgradeContext_ + : preCheckMajorVersionUpgradeContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest) { + return mergeFrom( + (com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest other) { + if (other + == com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance()) return this; + if (other.hasPreCheckMajorVersionUpgradeContext()) { + mergePreCheckMajorVersionUpgradeContext(other.getPreCheckMajorVersionUpgradeContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetPreCheckMajorVersionUpgradeContextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext + preCheckMajorVersionUpgradeContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext, + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.Builder, + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContextOrBuilder> + preCheckMajorVersionUpgradeContextBuilder_; + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the preCheckMajorVersionUpgradeContext field is set. + */ + public boolean hasPreCheckMajorVersionUpgradeContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The preCheckMajorVersionUpgradeContext. + */ + public com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext + getPreCheckMajorVersionUpgradeContext() { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } else { + return preCheckMajorVersionUpgradeContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPreCheckMajorVersionUpgradeContext( + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext value) { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + preCheckMajorVersionUpgradeContext_ = value; + } else { + preCheckMajorVersionUpgradeContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPreCheckMajorVersionUpgradeContext( + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.Builder builderForValue) { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + preCheckMajorVersionUpgradeContext_ = builderForValue.build(); + } else { + preCheckMajorVersionUpgradeContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePreCheckMajorVersionUpgradeContext( + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext value) { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && preCheckMajorVersionUpgradeContext_ != null + && preCheckMajorVersionUpgradeContext_ + != com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext + .getDefaultInstance()) { + getPreCheckMajorVersionUpgradeContextBuilder().mergeFrom(value); + } else { + preCheckMajorVersionUpgradeContext_ = value; + } + } else { + preCheckMajorVersionUpgradeContextBuilder_.mergeFrom(value); + } + if (preCheckMajorVersionUpgradeContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPreCheckMajorVersionUpgradeContext() { + bitField0_ = (bitField0_ & ~0x00000001); + preCheckMajorVersionUpgradeContext_ = null; + if (preCheckMajorVersionUpgradeContextBuilder_ != null) { + preCheckMajorVersionUpgradeContextBuilder_.dispose(); + preCheckMajorVersionUpgradeContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.Builder + getPreCheckMajorVersionUpgradeContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetPreCheckMajorVersionUpgradeContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContextOrBuilder + getPreCheckMajorVersionUpgradeContextOrBuilder() { + if (preCheckMajorVersionUpgradeContextBuilder_ != null) { + return preCheckMajorVersionUpgradeContextBuilder_.getMessageOrBuilder(); + } else { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext, + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.Builder, + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContextOrBuilder> + internalGetPreCheckMajorVersionUpgradeContextFieldBuilder() { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + preCheckMajorVersionUpgradeContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext, + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.Builder, + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContextOrBuilder>( + getPreCheckMajorVersionUpgradeContext(), getParentForChildren(), isClean()); + preCheckMajorVersionUpgradeContext_ = null; + } + return preCheckMajorVersionUpgradeContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest) + private static final com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest(); + } + + public static com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesPreCheckMajorVersionUpgradeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser + getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesPreCheckMajorVersionUpgradeRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesPreCheckMajorVersionUpgradeRequestOrBuilder.java new file mode 100644 index 000000000000..6506506979e3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesPreCheckMajorVersionUpgradeRequestOrBuilder.java @@ -0,0 +1,76 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesPreCheckMajorVersionUpgradeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Contains details about the pre-check major version upgrade
+   * operation.
+   * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the preCheckMajorVersionUpgradeContext field is set. + */ + boolean hasPreCheckMajorVersionUpgradeContext(); + + /** + * + * + *
+   * Required. Contains details about the pre-check major version upgrade
+   * operation.
+   * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The preCheckMajorVersionUpgradeContext. + */ + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext + getPreCheckMajorVersionUpgradeContext(); + + /** + * + * + *
+   * Required. Contains details about the pre-check major version upgrade
+   * operation.
+   * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContextOrBuilder + getPreCheckMajorVersionUpgradeContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesReencryptRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesReencryptRequest.java new file mode 100644 index 000000000000..38df3fe6a8d4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesReencryptRequest.java @@ -0,0 +1,723 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database Instance reencrypt request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesReencryptRequest} + */ +@com.google.protobuf.Generated +public final class InstancesReencryptRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesReencryptRequest) + InstancesReencryptRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesReencryptRequest"); + } + + // Use InstancesReencryptRequest.newBuilder() to construct. + private InstancesReencryptRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesReencryptRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesReencryptRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesReencryptRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesReencryptRequest.class, + com.google.cloud.sql.v1.InstancesReencryptRequest.Builder.class); + } + + private int bitField0_; + public static final int BACKUP_REENCRYPTION_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.BackupReencryptionConfig backupReencryptionConfig_; + + /** + * + * + *
+   * Configuration specific to backup re-encryption
+   * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + * + * @return Whether the backupReencryptionConfig field is set. + */ + @java.lang.Override + public boolean hasBackupReencryptionConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Configuration specific to backup re-encryption
+   * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + * + * @return The backupReencryptionConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupReencryptionConfig getBackupReencryptionConfig() { + return backupReencryptionConfig_ == null + ? com.google.cloud.sql.v1.BackupReencryptionConfig.getDefaultInstance() + : backupReencryptionConfig_; + } + + /** + * + * + *
+   * Configuration specific to backup re-encryption
+   * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupReencryptionConfigOrBuilder + getBackupReencryptionConfigOrBuilder() { + return backupReencryptionConfig_ == null + ? com.google.cloud.sql.v1.BackupReencryptionConfig.getDefaultInstance() + : backupReencryptionConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getBackupReencryptionConfig()); + } + 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, getBackupReencryptionConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesReencryptRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesReencryptRequest other = + (com.google.cloud.sql.v1.InstancesReencryptRequest) obj; + + if (hasBackupReencryptionConfig() != other.hasBackupReencryptionConfig()) return false; + if (hasBackupReencryptionConfig()) { + if (!getBackupReencryptionConfig().equals(other.getBackupReencryptionConfig())) return false; + } + if (!getUnknownFields().equals(other.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 (hasBackupReencryptionConfig()) { + hash = (37 * hash) + BACKUP_REENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getBackupReencryptionConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesReencryptRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesReencryptRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesReencryptRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesReencryptRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesReencryptRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesReencryptRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesReencryptRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesReencryptRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesReencryptRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesReencryptRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesReencryptRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesReencryptRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.InstancesReencryptRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database Instance reencrypt request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesReencryptRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesReencryptRequest) + com.google.cloud.sql.v1.InstancesReencryptRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesReencryptRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesReencryptRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesReencryptRequest.class, + com.google.cloud.sql.v1.InstancesReencryptRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesReencryptRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackupReencryptionConfigFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backupReencryptionConfig_ = null; + if (backupReencryptionConfigBuilder_ != null) { + backupReencryptionConfigBuilder_.dispose(); + backupReencryptionConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesReencryptRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesReencryptRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesReencryptRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesReencryptRequest build() { + com.google.cloud.sql.v1.InstancesReencryptRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesReencryptRequest buildPartial() { + com.google.cloud.sql.v1.InstancesReencryptRequest result = + new com.google.cloud.sql.v1.InstancesReencryptRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.InstancesReencryptRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backupReencryptionConfig_ = + backupReencryptionConfigBuilder_ == null + ? backupReencryptionConfig_ + : backupReencryptionConfigBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesReencryptRequest) { + return mergeFrom((com.google.cloud.sql.v1.InstancesReencryptRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InstancesReencryptRequest other) { + if (other == com.google.cloud.sql.v1.InstancesReencryptRequest.getDefaultInstance()) + return this; + if (other.hasBackupReencryptionConfig()) { + mergeBackupReencryptionConfig(other.getBackupReencryptionConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetBackupReencryptionConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.BackupReencryptionConfig backupReencryptionConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupReencryptionConfig, + com.google.cloud.sql.v1.BackupReencryptionConfig.Builder, + com.google.cloud.sql.v1.BackupReencryptionConfigOrBuilder> + backupReencryptionConfigBuilder_; + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + * + * @return Whether the backupReencryptionConfig field is set. + */ + public boolean hasBackupReencryptionConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + * + * @return The backupReencryptionConfig. + */ + public com.google.cloud.sql.v1.BackupReencryptionConfig getBackupReencryptionConfig() { + if (backupReencryptionConfigBuilder_ == null) { + return backupReencryptionConfig_ == null + ? com.google.cloud.sql.v1.BackupReencryptionConfig.getDefaultInstance() + : backupReencryptionConfig_; + } else { + return backupReencryptionConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + public Builder setBackupReencryptionConfig( + com.google.cloud.sql.v1.BackupReencryptionConfig value) { + if (backupReencryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupReencryptionConfig_ = value; + } else { + backupReencryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + public Builder setBackupReencryptionConfig( + com.google.cloud.sql.v1.BackupReencryptionConfig.Builder builderForValue) { + if (backupReencryptionConfigBuilder_ == null) { + backupReencryptionConfig_ = builderForValue.build(); + } else { + backupReencryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + public Builder mergeBackupReencryptionConfig( + com.google.cloud.sql.v1.BackupReencryptionConfig value) { + if (backupReencryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && backupReencryptionConfig_ != null + && backupReencryptionConfig_ + != com.google.cloud.sql.v1.BackupReencryptionConfig.getDefaultInstance()) { + getBackupReencryptionConfigBuilder().mergeFrom(value); + } else { + backupReencryptionConfig_ = value; + } + } else { + backupReencryptionConfigBuilder_.mergeFrom(value); + } + if (backupReencryptionConfig_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + public Builder clearBackupReencryptionConfig() { + bitField0_ = (bitField0_ & ~0x00000001); + backupReencryptionConfig_ = null; + if (backupReencryptionConfigBuilder_ != null) { + backupReencryptionConfigBuilder_.dispose(); + backupReencryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + public com.google.cloud.sql.v1.BackupReencryptionConfig.Builder + getBackupReencryptionConfigBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetBackupReencryptionConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + public com.google.cloud.sql.v1.BackupReencryptionConfigOrBuilder + getBackupReencryptionConfigOrBuilder() { + if (backupReencryptionConfigBuilder_ != null) { + return backupReencryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return backupReencryptionConfig_ == null + ? com.google.cloud.sql.v1.BackupReencryptionConfig.getDefaultInstance() + : backupReencryptionConfig_; + } + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupReencryptionConfig, + com.google.cloud.sql.v1.BackupReencryptionConfig.Builder, + com.google.cloud.sql.v1.BackupReencryptionConfigOrBuilder> + internalGetBackupReencryptionConfigFieldBuilder() { + if (backupReencryptionConfigBuilder_ == null) { + backupReencryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupReencryptionConfig, + com.google.cloud.sql.v1.BackupReencryptionConfig.Builder, + com.google.cloud.sql.v1.BackupReencryptionConfigOrBuilder>( + getBackupReencryptionConfig(), getParentForChildren(), isClean()); + backupReencryptionConfig_ = null; + } + return backupReencryptionConfigBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesReencryptRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesReencryptRequest) + private static final com.google.cloud.sql.v1.InstancesReencryptRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesReencryptRequest(); + } + + public static com.google.cloud.sql.v1.InstancesReencryptRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesReencryptRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesReencryptRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesReencryptRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesReencryptRequestOrBuilder.java new file mode 100644 index 000000000000..adf523bcd3f3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesReencryptRequestOrBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesReencryptRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesReencryptRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Configuration specific to backup re-encryption
+   * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + * + * @return Whether the backupReencryptionConfig field is set. + */ + boolean hasBackupReencryptionConfig(); + + /** + * + * + *
+   * Configuration specific to backup re-encryption
+   * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + * + * @return The backupReencryptionConfig. + */ + com.google.cloud.sql.v1.BackupReencryptionConfig getBackupReencryptionConfig(); + + /** + * + * + *
+   * Configuration specific to backup re-encryption
+   * 
+ * + * optional .google.cloud.sql.v1.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + com.google.cloud.sql.v1.BackupReencryptionConfigOrBuilder getBackupReencryptionConfigOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRestoreBackupRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRestoreBackupRequest.java new file mode 100644 index 000000000000..361ad309b40e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRestoreBackupRequest.java @@ -0,0 +1,1839 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance restore backup request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesRestoreBackupRequest} + */ +@com.google.protobuf.Generated +public final class InstancesRestoreBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesRestoreBackupRequest) + InstancesRestoreBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesRestoreBackupRequest"); + } + + // Use InstancesRestoreBackupRequest.newBuilder() to construct. + private InstancesRestoreBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesRestoreBackupRequest() { + backup_ = ""; + backupdrBackup_ = ""; + restoreInstanceClearOverridesFieldNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRestoreBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRestoreBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesRestoreBackupRequest.class, + com.google.cloud.sql.v1.InstancesRestoreBackupRequest.Builder.class); + } + + private int bitField0_; + public static final int RESTORE_BACKUP_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.RestoreBackupContext restoreBackupContext_; + + /** + * + * + *
+   * Parameters required to perform the restore backup operation.
+   * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + * + * @return Whether the restoreBackupContext field is set. + */ + @java.lang.Override + public boolean hasRestoreBackupContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Parameters required to perform the restore backup operation.
+   * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + * + * @return The restoreBackupContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.RestoreBackupContext getRestoreBackupContext() { + return restoreBackupContext_ == null + ? com.google.cloud.sql.v1.RestoreBackupContext.getDefaultInstance() + : restoreBackupContext_; + } + + /** + * + * + *
+   * Parameters required to perform the restore backup operation.
+   * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.RestoreBackupContextOrBuilder getRestoreBackupContextOrBuilder() { + return restoreBackupContext_ == null + ? com.google.cloud.sql.v1.RestoreBackupContext.getDefaultInstance() + : restoreBackupContext_; + } + + public static final int BACKUP_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object backup_ = ""; + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+   * restore_backup_context, backup, backupdr_backup can be passed to the input.
+   * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @return The backup. + */ + @java.lang.Override + public java.lang.String getBackup() { + java.lang.Object ref = backup_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backup_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+   * restore_backup_context, backup, backupdr_backup can be passed to the input.
+   * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backup. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupBytes() { + java.lang.Object ref = backup_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUPDR_BACKUP_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupdrBackup_ = ""; + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:
+   * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+   * Only one of restore_backup_context, backup, backupdr_backup can be
+   * passed to the input.
+   * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The backupdrBackup. + */ + @java.lang.Override + public java.lang.String getBackupdrBackup() { + java.lang.Object ref = backupdrBackup_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupdrBackup_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:
+   * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+   * Only one of restore_backup_context, backup, backupdr_backup can be
+   * passed to the input.
+   * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backupdrBackup. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupdrBackupBytes() { + java.lang.Object ref = backupdrBackup_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupdrBackup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESTORE_INSTANCE_SETTINGS_FIELD_NUMBER = 3; + private com.google.cloud.sql.v1.DatabaseInstance restoreInstanceSettings_; + + /** + * + * + *
+   * Optional. By using this parameter, Cloud SQL overrides any instance
+   * settings stored in the backup you are restoring from. You can't change the
+   * instance's major database version and you can only increase the disk size.
+   * You can use this field to restore new instances only. This field is not
+   * applicable for restore to existing instances.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the restoreInstanceSettings field is set. + */ + @java.lang.Override + public boolean hasRestoreInstanceSettings() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. By using this parameter, Cloud SQL overrides any instance
+   * settings stored in the backup you are restoring from. You can't change the
+   * instance's major database version and you can only increase the disk size.
+   * You can use this field to restore new instances only. This field is not
+   * applicable for restore to existing instances.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The restoreInstanceSettings. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance getRestoreInstanceSettings() { + return restoreInstanceSettings_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : restoreInstanceSettings_; + } + + /** + * + * + *
+   * Optional. By using this parameter, Cloud SQL overrides any instance
+   * settings stored in the backup you are restoring from. You can't change the
+   * instance's major database version and you can only increase the disk size.
+   * You can use this field to restore new instances only. This field is not
+   * applicable for restore to existing instances.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getRestoreInstanceSettingsOrBuilder() { + return restoreInstanceSettings_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : restoreInstanceSettings_; + } + + public static final int RESTORE_INSTANCE_CLEAR_OVERRIDES_FIELD_NAMES_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList restoreInstanceClearOverridesFieldNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the restoreInstanceClearOverridesFieldNames. + */ + public com.google.protobuf.ProtocolStringList getRestoreInstanceClearOverridesFieldNamesList() { + return restoreInstanceClearOverridesFieldNames_; + } + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of restoreInstanceClearOverridesFieldNames. + */ + public int getRestoreInstanceClearOverridesFieldNamesCount() { + return restoreInstanceClearOverridesFieldNames_.size(); + } + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The restoreInstanceClearOverridesFieldNames at the given index. + */ + public java.lang.String getRestoreInstanceClearOverridesFieldNames(int index) { + return restoreInstanceClearOverridesFieldNames_.get(index); + } + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the restoreInstanceClearOverridesFieldNames at the given index. + */ + public com.google.protobuf.ByteString getRestoreInstanceClearOverridesFieldNamesBytes(int index) { + return restoreInstanceClearOverridesFieldNames_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRestoreBackupContext()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backup_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, backup_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getRestoreInstanceSettings()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backupdrBackup_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, backupdrBackup_); + } + for (int i = 0; i < restoreInstanceClearOverridesFieldNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 5, restoreInstanceClearOverridesFieldNames_.getRaw(i)); + } + 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, getRestoreBackupContext()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backup_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, backup_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRestoreInstanceSettings()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backupdrBackup_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, backupdrBackup_); + } + { + int dataSize = 0; + for (int i = 0; i < restoreInstanceClearOverridesFieldNames_.size(); i++) { + dataSize += computeStringSizeNoTag(restoreInstanceClearOverridesFieldNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getRestoreInstanceClearOverridesFieldNamesList().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.sql.v1.InstancesRestoreBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesRestoreBackupRequest other = + (com.google.cloud.sql.v1.InstancesRestoreBackupRequest) obj; + + if (hasRestoreBackupContext() != other.hasRestoreBackupContext()) return false; + if (hasRestoreBackupContext()) { + if (!getRestoreBackupContext().equals(other.getRestoreBackupContext())) return false; + } + if (!getBackup().equals(other.getBackup())) return false; + if (!getBackupdrBackup().equals(other.getBackupdrBackup())) return false; + if (hasRestoreInstanceSettings() != other.hasRestoreInstanceSettings()) return false; + if (hasRestoreInstanceSettings()) { + if (!getRestoreInstanceSettings().equals(other.getRestoreInstanceSettings())) return false; + } + if (!getRestoreInstanceClearOverridesFieldNamesList() + .equals(other.getRestoreInstanceClearOverridesFieldNamesList())) return false; + if (!getUnknownFields().equals(other.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 (hasRestoreBackupContext()) { + hash = (37 * hash) + RESTORE_BACKUP_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getRestoreBackupContext().hashCode(); + } + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + hash = (37 * hash) + BACKUPDR_BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackupdrBackup().hashCode(); + if (hasRestoreInstanceSettings()) { + hash = (37 * hash) + RESTORE_INSTANCE_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getRestoreInstanceSettings().hashCode(); + } + if (getRestoreInstanceClearOverridesFieldNamesCount() > 0) { + hash = (37 * hash) + RESTORE_INSTANCE_CLEAR_OVERRIDES_FIELD_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getRestoreInstanceClearOverridesFieldNamesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesRestoreBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesRestoreBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRestoreBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesRestoreBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRestoreBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesRestoreBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRestoreBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesRestoreBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRestoreBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesRestoreBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRestoreBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesRestoreBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.InstancesRestoreBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance restore backup request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesRestoreBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesRestoreBackupRequest) + com.google.cloud.sql.v1.InstancesRestoreBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRestoreBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRestoreBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesRestoreBackupRequest.class, + com.google.cloud.sql.v1.InstancesRestoreBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesRestoreBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRestoreBackupContextFieldBuilder(); + internalGetRestoreInstanceSettingsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + restoreBackupContext_ = null; + if (restoreBackupContextBuilder_ != null) { + restoreBackupContextBuilder_.dispose(); + restoreBackupContextBuilder_ = null; + } + backup_ = ""; + backupdrBackup_ = ""; + restoreInstanceSettings_ = null; + if (restoreInstanceSettingsBuilder_ != null) { + restoreInstanceSettingsBuilder_.dispose(); + restoreInstanceSettingsBuilder_ = null; + } + restoreInstanceClearOverridesFieldNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRestoreBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRestoreBackupRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesRestoreBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRestoreBackupRequest build() { + com.google.cloud.sql.v1.InstancesRestoreBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRestoreBackupRequest buildPartial() { + com.google.cloud.sql.v1.InstancesRestoreBackupRequest result = + new com.google.cloud.sql.v1.InstancesRestoreBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.InstancesRestoreBackupRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.restoreBackupContext_ = + restoreBackupContextBuilder_ == null + ? restoreBackupContext_ + : restoreBackupContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backup_ = backup_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.backupdrBackup_ = backupdrBackup_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.restoreInstanceSettings_ = + restoreInstanceSettingsBuilder_ == null + ? restoreInstanceSettings_ + : restoreInstanceSettingsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + restoreInstanceClearOverridesFieldNames_.makeImmutable(); + result.restoreInstanceClearOverridesFieldNames_ = restoreInstanceClearOverridesFieldNames_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesRestoreBackupRequest) { + return mergeFrom((com.google.cloud.sql.v1.InstancesRestoreBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InstancesRestoreBackupRequest other) { + if (other == com.google.cloud.sql.v1.InstancesRestoreBackupRequest.getDefaultInstance()) + return this; + if (other.hasRestoreBackupContext()) { + mergeRestoreBackupContext(other.getRestoreBackupContext()); + } + if (!other.getBackup().isEmpty()) { + backup_ = other.backup_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getBackupdrBackup().isEmpty()) { + backupdrBackup_ = other.backupdrBackup_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasRestoreInstanceSettings()) { + mergeRestoreInstanceSettings(other.getRestoreInstanceSettings()); + } + if (!other.restoreInstanceClearOverridesFieldNames_.isEmpty()) { + if (restoreInstanceClearOverridesFieldNames_.isEmpty()) { + restoreInstanceClearOverridesFieldNames_ = other.restoreInstanceClearOverridesFieldNames_; + bitField0_ |= 0x00000010; + } else { + ensureRestoreInstanceClearOverridesFieldNamesIsMutable(); + restoreInstanceClearOverridesFieldNames_.addAll( + other.restoreInstanceClearOverridesFieldNames_); + } + 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( + internalGetRestoreBackupContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + backup_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetRestoreInstanceSettingsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + backupdrBackup_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRestoreInstanceClearOverridesFieldNamesIsMutable(); + restoreInstanceClearOverridesFieldNames_.add(s); + 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 com.google.cloud.sql.v1.RestoreBackupContext restoreBackupContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.RestoreBackupContext, + com.google.cloud.sql.v1.RestoreBackupContext.Builder, + com.google.cloud.sql.v1.RestoreBackupContextOrBuilder> + restoreBackupContextBuilder_; + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + * + * @return Whether the restoreBackupContext field is set. + */ + public boolean hasRestoreBackupContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + * + * @return The restoreBackupContext. + */ + public com.google.cloud.sql.v1.RestoreBackupContext getRestoreBackupContext() { + if (restoreBackupContextBuilder_ == null) { + return restoreBackupContext_ == null + ? com.google.cloud.sql.v1.RestoreBackupContext.getDefaultInstance() + : restoreBackupContext_; + } else { + return restoreBackupContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + */ + public Builder setRestoreBackupContext(com.google.cloud.sql.v1.RestoreBackupContext value) { + if (restoreBackupContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + restoreBackupContext_ = value; + } else { + restoreBackupContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + */ + public Builder setRestoreBackupContext( + com.google.cloud.sql.v1.RestoreBackupContext.Builder builderForValue) { + if (restoreBackupContextBuilder_ == null) { + restoreBackupContext_ = builderForValue.build(); + } else { + restoreBackupContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + */ + public Builder mergeRestoreBackupContext(com.google.cloud.sql.v1.RestoreBackupContext value) { + if (restoreBackupContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && restoreBackupContext_ != null + && restoreBackupContext_ + != com.google.cloud.sql.v1.RestoreBackupContext.getDefaultInstance()) { + getRestoreBackupContextBuilder().mergeFrom(value); + } else { + restoreBackupContext_ = value; + } + } else { + restoreBackupContextBuilder_.mergeFrom(value); + } + if (restoreBackupContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + */ + public Builder clearRestoreBackupContext() { + bitField0_ = (bitField0_ & ~0x00000001); + restoreBackupContext_ = null; + if (restoreBackupContextBuilder_ != null) { + restoreBackupContextBuilder_.dispose(); + restoreBackupContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + */ + public com.google.cloud.sql.v1.RestoreBackupContext.Builder getRestoreBackupContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRestoreBackupContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + */ + public com.google.cloud.sql.v1.RestoreBackupContextOrBuilder + getRestoreBackupContextOrBuilder() { + if (restoreBackupContextBuilder_ != null) { + return restoreBackupContextBuilder_.getMessageOrBuilder(); + } else { + return restoreBackupContext_ == null + ? com.google.cloud.sql.v1.RestoreBackupContext.getDefaultInstance() + : restoreBackupContext_; + } + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.RestoreBackupContext, + com.google.cloud.sql.v1.RestoreBackupContext.Builder, + com.google.cloud.sql.v1.RestoreBackupContextOrBuilder> + internalGetRestoreBackupContextFieldBuilder() { + if (restoreBackupContextBuilder_ == null) { + restoreBackupContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.RestoreBackupContext, + com.google.cloud.sql.v1.RestoreBackupContext.Builder, + com.google.cloud.sql.v1.RestoreBackupContextOrBuilder>( + getRestoreBackupContext(), getParentForChildren(), isClean()); + restoreBackupContext_ = null; + } + return restoreBackupContextBuilder_; + } + + private java.lang.Object backup_ = ""; + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+     * restore_backup_context, backup, backupdr_backup can be passed to the input.
+     * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @return The backup. + */ + public java.lang.String getBackup() { + java.lang.Object ref = backup_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backup_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+     * restore_backup_context, backup, backupdr_backup can be passed to the input.
+     * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backup. + */ + public com.google.protobuf.ByteString getBackupBytes() { + java.lang.Object ref = backup_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+     * restore_backup_context, backup, backupdr_backup can be passed to the input.
+     * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The backup to set. + * @return This builder for chaining. + */ + public Builder setBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+     * restore_backup_context, backup, backupdr_backup can be passed to the input.
+     * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBackup() { + backup_ = getDefaultInstance().getBackup(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+     * restore_backup_context, backup, backupdr_backup can be passed to the input.
+     * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for backup to set. + * @return This builder for chaining. + */ + public Builder setBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backup_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object backupdrBackup_ = ""; + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:
+     * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+     * Only one of restore_backup_context, backup, backupdr_backup can be
+     * passed to the input.
+     * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The backupdrBackup. + */ + public java.lang.String getBackupdrBackup() { + java.lang.Object ref = backupdrBackup_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupdrBackup_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:
+     * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+     * Only one of restore_backup_context, backup, backupdr_backup can be
+     * passed to the input.
+     * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backupdrBackup. + */ + public com.google.protobuf.ByteString getBackupdrBackupBytes() { + java.lang.Object ref = backupdrBackup_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupdrBackup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:
+     * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+     * Only one of restore_backup_context, backup, backupdr_backup can be
+     * passed to the input.
+     * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @param value The backupdrBackup to set. + * @return This builder for chaining. + */ + public Builder setBackupdrBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupdrBackup_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:
+     * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+     * Only one of restore_backup_context, backup, backupdr_backup can be
+     * passed to the input.
+     * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBackupdrBackup() { + backupdrBackup_ = getDefaultInstance().getBackupdrBackup(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:
+     * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+     * Only one of restore_backup_context, backup, backupdr_backup can be
+     * passed to the input.
+     * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for backupdrBackup to set. + * @return This builder for chaining. + */ + public Builder setBackupdrBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupdrBackup_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.DatabaseInstance restoreInstanceSettings_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder> + restoreInstanceSettingsBuilder_; + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the restoreInstanceSettings field is set. + */ + public boolean hasRestoreInstanceSettings() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The restoreInstanceSettings. + */ + public com.google.cloud.sql.v1.DatabaseInstance getRestoreInstanceSettings() { + if (restoreInstanceSettingsBuilder_ == null) { + return restoreInstanceSettings_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : restoreInstanceSettings_; + } else { + return restoreInstanceSettingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRestoreInstanceSettings(com.google.cloud.sql.v1.DatabaseInstance value) { + if (restoreInstanceSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + restoreInstanceSettings_ = value; + } else { + restoreInstanceSettingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRestoreInstanceSettings( + com.google.cloud.sql.v1.DatabaseInstance.Builder builderForValue) { + if (restoreInstanceSettingsBuilder_ == null) { + restoreInstanceSettings_ = builderForValue.build(); + } else { + restoreInstanceSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRestoreInstanceSettings(com.google.cloud.sql.v1.DatabaseInstance value) { + if (restoreInstanceSettingsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && restoreInstanceSettings_ != null + && restoreInstanceSettings_ + != com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance()) { + getRestoreInstanceSettingsBuilder().mergeFrom(value); + } else { + restoreInstanceSettings_ = value; + } + } else { + restoreInstanceSettingsBuilder_.mergeFrom(value); + } + if (restoreInstanceSettings_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRestoreInstanceSettings() { + bitField0_ = (bitField0_ & ~0x00000008); + restoreInstanceSettings_ = null; + if (restoreInstanceSettingsBuilder_ != null) { + restoreInstanceSettingsBuilder_.dispose(); + restoreInstanceSettingsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.DatabaseInstance.Builder getRestoreInstanceSettingsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetRestoreInstanceSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getRestoreInstanceSettingsOrBuilder() { + if (restoreInstanceSettingsBuilder_ != null) { + return restoreInstanceSettingsBuilder_.getMessageOrBuilder(); + } else { + return restoreInstanceSettings_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : restoreInstanceSettings_; + } + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder> + internalGetRestoreInstanceSettingsFieldBuilder() { + if (restoreInstanceSettingsBuilder_ == null) { + restoreInstanceSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder>( + getRestoreInstanceSettings(), getParentForChildren(), isClean()); + restoreInstanceSettings_ = null; + } + return restoreInstanceSettingsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList restoreInstanceClearOverridesFieldNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureRestoreInstanceClearOverridesFieldNamesIsMutable() { + if (!restoreInstanceClearOverridesFieldNames_.isModifiable()) { + restoreInstanceClearOverridesFieldNames_ = + new com.google.protobuf.LazyStringArrayList(restoreInstanceClearOverridesFieldNames_); + } + bitField0_ |= 0x00000010; + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the restoreInstanceClearOverridesFieldNames. + */ + public com.google.protobuf.ProtocolStringList getRestoreInstanceClearOverridesFieldNamesList() { + restoreInstanceClearOverridesFieldNames_.makeImmutable(); + return restoreInstanceClearOverridesFieldNames_; + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of restoreInstanceClearOverridesFieldNames. + */ + public int getRestoreInstanceClearOverridesFieldNamesCount() { + return restoreInstanceClearOverridesFieldNames_.size(); + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The restoreInstanceClearOverridesFieldNames at the given index. + */ + public java.lang.String getRestoreInstanceClearOverridesFieldNames(int index) { + return restoreInstanceClearOverridesFieldNames_.get(index); + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the restoreInstanceClearOverridesFieldNames at the given index. + */ + public com.google.protobuf.ByteString getRestoreInstanceClearOverridesFieldNamesBytes( + int index) { + return restoreInstanceClearOverridesFieldNames_.getByteString(index); + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The restoreInstanceClearOverridesFieldNames to set. + * @return This builder for chaining. + */ + public Builder setRestoreInstanceClearOverridesFieldNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestoreInstanceClearOverridesFieldNamesIsMutable(); + restoreInstanceClearOverridesFieldNames_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The restoreInstanceClearOverridesFieldNames to add. + * @return This builder for chaining. + */ + public Builder addRestoreInstanceClearOverridesFieldNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestoreInstanceClearOverridesFieldNamesIsMutable(); + restoreInstanceClearOverridesFieldNames_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The restoreInstanceClearOverridesFieldNames to add. + * @return This builder for chaining. + */ + public Builder addAllRestoreInstanceClearOverridesFieldNames( + java.lang.Iterable values) { + ensureRestoreInstanceClearOverridesFieldNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, restoreInstanceClearOverridesFieldNames_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRestoreInstanceClearOverridesFieldNames() { + restoreInstanceClearOverridesFieldNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes of the restoreInstanceClearOverridesFieldNames to add. + * @return This builder for chaining. + */ + public Builder addRestoreInstanceClearOverridesFieldNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRestoreInstanceClearOverridesFieldNamesIsMutable(); + restoreInstanceClearOverridesFieldNames_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesRestoreBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesRestoreBackupRequest) + private static final com.google.cloud.sql.v1.InstancesRestoreBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesRestoreBackupRequest(); + } + + public static com.google.cloud.sql.v1.InstancesRestoreBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesRestoreBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRestoreBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRestoreBackupRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRestoreBackupRequestOrBuilder.java new file mode 100644 index 000000000000..1eed7967d085 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRestoreBackupRequestOrBuilder.java @@ -0,0 +1,254 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesRestoreBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesRestoreBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Parameters required to perform the restore backup operation.
+   * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + * + * @return Whether the restoreBackupContext field is set. + */ + boolean hasRestoreBackupContext(); + + /** + * + * + *
+   * Parameters required to perform the restore backup operation.
+   * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + * + * @return The restoreBackupContext. + */ + com.google.cloud.sql.v1.RestoreBackupContext getRestoreBackupContext(); + + /** + * + * + *
+   * Parameters required to perform the restore backup operation.
+   * 
+ * + * .google.cloud.sql.v1.RestoreBackupContext restore_backup_context = 1; + */ + com.google.cloud.sql.v1.RestoreBackupContextOrBuilder getRestoreBackupContextOrBuilder(); + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+   * restore_backup_context, backup, backupdr_backup can be passed to the input.
+   * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @return The backup. + */ + java.lang.String getBackup(); + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+   * restore_backup_context, backup, backupdr_backup can be passed to the input.
+   * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backup. + */ + com.google.protobuf.ByteString getBackupBytes(); + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:
+   * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+   * Only one of restore_backup_context, backup, backupdr_backup can be
+   * passed to the input.
+   * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The backupdrBackup. + */ + java.lang.String getBackupdrBackup(); + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:
+   * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+   * Only one of restore_backup_context, backup, backupdr_backup can be
+   * passed to the input.
+   * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backupdrBackup. + */ + com.google.protobuf.ByteString getBackupdrBackupBytes(); + + /** + * + * + *
+   * Optional. By using this parameter, Cloud SQL overrides any instance
+   * settings stored in the backup you are restoring from. You can't change the
+   * instance's major database version and you can only increase the disk size.
+   * You can use this field to restore new instances only. This field is not
+   * applicable for restore to existing instances.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the restoreInstanceSettings field is set. + */ + boolean hasRestoreInstanceSettings(); + + /** + * + * + *
+   * Optional. By using this parameter, Cloud SQL overrides any instance
+   * settings stored in the backup you are restoring from. You can't change the
+   * instance's major database version and you can only increase the disk size.
+   * You can use this field to restore new instances only. This field is not
+   * applicable for restore to existing instances.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The restoreInstanceSettings. + */ + com.google.cloud.sql.v1.DatabaseInstance getRestoreInstanceSettings(); + + /** + * + * + *
+   * Optional. By using this parameter, Cloud SQL overrides any instance
+   * settings stored in the backup you are restoring from. You can't change the
+   * instance's major database version and you can only increase the disk size.
+   * You can use this field to restore new instances only. This field is not
+   * applicable for restore to existing instances.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getRestoreInstanceSettingsOrBuilder(); + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the restoreInstanceClearOverridesFieldNames. + */ + java.util.List getRestoreInstanceClearOverridesFieldNamesList(); + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of restoreInstanceClearOverridesFieldNames. + */ + int getRestoreInstanceClearOverridesFieldNamesCount(); + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The restoreInstanceClearOverridesFieldNames at the given index. + */ + java.lang.String getRestoreInstanceClearOverridesFieldNames(int index); + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the restoreInstanceClearOverridesFieldNames at the given index. + */ + com.google.protobuf.ByteString getRestoreInstanceClearOverridesFieldNamesBytes(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateEntraIdCertificateRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateEntraIdCertificateRequest.java new file mode 100644 index 000000000000..7f0350292939 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateEntraIdCertificateRequest.java @@ -0,0 +1,750 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Rotate Entra ID certificate request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest} + */ +@com.google.protobuf.Generated +public final class InstancesRotateEntraIdCertificateRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest) + InstancesRotateEntraIdCertificateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesRotateEntraIdCertificateRequest"); + } + + // Use InstancesRotateEntraIdCertificateRequest.newBuilder() to construct. + private InstancesRotateEntraIdCertificateRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesRotateEntraIdCertificateRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateEntraIdCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.class, + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.Builder.class); + } + + private int bitField0_; + public static final int ROTATE_ENTRA_ID_CERTIFICATE_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.RotateEntraIdCertificateContext rotateEntraIdCertificateContext_; + + /** + * + * + *
+   * Optional. Contains details about the rotate server certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rotateEntraIdCertificateContext field is set. + */ + @java.lang.Override + public boolean hasRotateEntraIdCertificateContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Contains details about the rotate server certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rotateEntraIdCertificateContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.RotateEntraIdCertificateContext + getRotateEntraIdCertificateContext() { + return rotateEntraIdCertificateContext_ == null + ? com.google.cloud.sql.v1.RotateEntraIdCertificateContext.getDefaultInstance() + : rotateEntraIdCertificateContext_; + } + + /** + * + * + *
+   * Optional. Contains details about the rotate server certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.RotateEntraIdCertificateContextOrBuilder + getRotateEntraIdCertificateContextOrBuilder() { + return rotateEntraIdCertificateContext_ == null + ? com.google.cloud.sql.v1.RotateEntraIdCertificateContext.getDefaultInstance() + : rotateEntraIdCertificateContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getRotateEntraIdCertificateContext()); + } + 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, getRotateEntraIdCertificateContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest other = + (com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest) obj; + + if (hasRotateEntraIdCertificateContext() != other.hasRotateEntraIdCertificateContext()) + return false; + if (hasRotateEntraIdCertificateContext()) { + if (!getRotateEntraIdCertificateContext().equals(other.getRotateEntraIdCertificateContext())) + return false; + } + if (!getUnknownFields().equals(other.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 (hasRotateEntraIdCertificateContext()) { + hash = (37 * hash) + ROTATE_ENTRA_ID_CERTIFICATE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getRotateEntraIdCertificateContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Rotate Entra ID certificate request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest) + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateEntraIdCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.class, + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRotateEntraIdCertificateContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rotateEntraIdCertificateContext_ = null; + if (rotateEntraIdCertificateContextBuilder_ != null) { + rotateEntraIdCertificateContextBuilder_.dispose(); + rotateEntraIdCertificateContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest build() { + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest buildPartial() { + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest result = + new com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rotateEntraIdCertificateContext_ = + rotateEntraIdCertificateContextBuilder_ == null + ? rotateEntraIdCertificateContext_ + : rotateEntraIdCertificateContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest) { + return mergeFrom((com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest other) { + if (other + == com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.getDefaultInstance()) + return this; + if (other.hasRotateEntraIdCertificateContext()) { + mergeRotateEntraIdCertificateContext(other.getRotateEntraIdCertificateContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetRotateEntraIdCertificateContextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.RotateEntraIdCertificateContext + rotateEntraIdCertificateContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.RotateEntraIdCertificateContext, + com.google.cloud.sql.v1.RotateEntraIdCertificateContext.Builder, + com.google.cloud.sql.v1.RotateEntraIdCertificateContextOrBuilder> + rotateEntraIdCertificateContextBuilder_; + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rotateEntraIdCertificateContext field is set. + */ + public boolean hasRotateEntraIdCertificateContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rotateEntraIdCertificateContext. + */ + public com.google.cloud.sql.v1.RotateEntraIdCertificateContext + getRotateEntraIdCertificateContext() { + if (rotateEntraIdCertificateContextBuilder_ == null) { + return rotateEntraIdCertificateContext_ == null + ? com.google.cloud.sql.v1.RotateEntraIdCertificateContext.getDefaultInstance() + : rotateEntraIdCertificateContext_; + } else { + return rotateEntraIdCertificateContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRotateEntraIdCertificateContext( + com.google.cloud.sql.v1.RotateEntraIdCertificateContext value) { + if (rotateEntraIdCertificateContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rotateEntraIdCertificateContext_ = value; + } else { + rotateEntraIdCertificateContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRotateEntraIdCertificateContext( + com.google.cloud.sql.v1.RotateEntraIdCertificateContext.Builder builderForValue) { + if (rotateEntraIdCertificateContextBuilder_ == null) { + rotateEntraIdCertificateContext_ = builderForValue.build(); + } else { + rotateEntraIdCertificateContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRotateEntraIdCertificateContext( + com.google.cloud.sql.v1.RotateEntraIdCertificateContext value) { + if (rotateEntraIdCertificateContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && rotateEntraIdCertificateContext_ != null + && rotateEntraIdCertificateContext_ + != com.google.cloud.sql.v1.RotateEntraIdCertificateContext.getDefaultInstance()) { + getRotateEntraIdCertificateContextBuilder().mergeFrom(value); + } else { + rotateEntraIdCertificateContext_ = value; + } + } else { + rotateEntraIdCertificateContextBuilder_.mergeFrom(value); + } + if (rotateEntraIdCertificateContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRotateEntraIdCertificateContext() { + bitField0_ = (bitField0_ & ~0x00000001); + rotateEntraIdCertificateContext_ = null; + if (rotateEntraIdCertificateContextBuilder_ != null) { + rotateEntraIdCertificateContextBuilder_.dispose(); + rotateEntraIdCertificateContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.RotateEntraIdCertificateContext.Builder + getRotateEntraIdCertificateContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRotateEntraIdCertificateContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.RotateEntraIdCertificateContextOrBuilder + getRotateEntraIdCertificateContextOrBuilder() { + if (rotateEntraIdCertificateContextBuilder_ != null) { + return rotateEntraIdCertificateContextBuilder_.getMessageOrBuilder(); + } else { + return rotateEntraIdCertificateContext_ == null + ? com.google.cloud.sql.v1.RotateEntraIdCertificateContext.getDefaultInstance() + : rotateEntraIdCertificateContext_; + } + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.RotateEntraIdCertificateContext, + com.google.cloud.sql.v1.RotateEntraIdCertificateContext.Builder, + com.google.cloud.sql.v1.RotateEntraIdCertificateContextOrBuilder> + internalGetRotateEntraIdCertificateContextFieldBuilder() { + if (rotateEntraIdCertificateContextBuilder_ == null) { + rotateEntraIdCertificateContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.RotateEntraIdCertificateContext, + com.google.cloud.sql.v1.RotateEntraIdCertificateContext.Builder, + com.google.cloud.sql.v1.RotateEntraIdCertificateContextOrBuilder>( + getRotateEntraIdCertificateContext(), getParentForChildren(), isClean()); + rotateEntraIdCertificateContext_ = null; + } + return rotateEntraIdCertificateContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest) + private static final com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest(); + } + + public static com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesRotateEntraIdCertificateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateEntraIdCertificateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateEntraIdCertificateRequestOrBuilder.java new file mode 100644 index 000000000000..d9c8afa69e41 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateEntraIdCertificateRequestOrBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesRotateEntraIdCertificateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Contains details about the rotate server certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rotateEntraIdCertificateContext field is set. + */ + boolean hasRotateEntraIdCertificateContext(); + + /** + * + * + *
+   * Optional. Contains details about the rotate server certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rotateEntraIdCertificateContext. + */ + com.google.cloud.sql.v1.RotateEntraIdCertificateContext getRotateEntraIdCertificateContext(); + + /** + * + * + *
+   * Optional. Contains details about the rotate server certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.RotateEntraIdCertificateContextOrBuilder + getRotateEntraIdCertificateContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateServerCaRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateServerCaRequest.java new file mode 100644 index 000000000000..bc75143d6c29 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateServerCaRequest.java @@ -0,0 +1,707 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Rotate server CA request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesRotateServerCaRequest} + */ +@com.google.protobuf.Generated +public final class InstancesRotateServerCaRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesRotateServerCaRequest) + InstancesRotateServerCaRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesRotateServerCaRequest"); + } + + // Use InstancesRotateServerCaRequest.newBuilder() to construct. + private InstancesRotateServerCaRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesRotateServerCaRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateServerCaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateServerCaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesRotateServerCaRequest.class, + com.google.cloud.sql.v1.InstancesRotateServerCaRequest.Builder.class); + } + + private int bitField0_; + public static final int ROTATE_SERVER_CA_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.RotateServerCaContext rotateServerCaContext_; + + /** + * + * + *
+   * Contains details about the rotate server CA operation.
+   * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + * + * @return Whether the rotateServerCaContext field is set. + */ + @java.lang.Override + public boolean hasRotateServerCaContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Contains details about the rotate server CA operation.
+   * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + * + * @return The rotateServerCaContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.RotateServerCaContext getRotateServerCaContext() { + return rotateServerCaContext_ == null + ? com.google.cloud.sql.v1.RotateServerCaContext.getDefaultInstance() + : rotateServerCaContext_; + } + + /** + * + * + *
+   * Contains details about the rotate server CA operation.
+   * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.RotateServerCaContextOrBuilder + getRotateServerCaContextOrBuilder() { + return rotateServerCaContext_ == null + ? com.google.cloud.sql.v1.RotateServerCaContext.getDefaultInstance() + : rotateServerCaContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getRotateServerCaContext()); + } + 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, getRotateServerCaContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesRotateServerCaRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesRotateServerCaRequest other = + (com.google.cloud.sql.v1.InstancesRotateServerCaRequest) obj; + + if (hasRotateServerCaContext() != other.hasRotateServerCaContext()) return false; + if (hasRotateServerCaContext()) { + if (!getRotateServerCaContext().equals(other.getRotateServerCaContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasRotateServerCaContext()) { + hash = (37 * hash) + ROTATE_SERVER_CA_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getRotateServerCaContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.InstancesRotateServerCaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Rotate server CA request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesRotateServerCaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesRotateServerCaRequest) + com.google.cloud.sql.v1.InstancesRotateServerCaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateServerCaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateServerCaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesRotateServerCaRequest.class, + com.google.cloud.sql.v1.InstancesRotateServerCaRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesRotateServerCaRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRotateServerCaContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rotateServerCaContext_ = null; + if (rotateServerCaContextBuilder_ != null) { + rotateServerCaContextBuilder_.dispose(); + rotateServerCaContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateServerCaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateServerCaRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesRotateServerCaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateServerCaRequest build() { + com.google.cloud.sql.v1.InstancesRotateServerCaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateServerCaRequest buildPartial() { + com.google.cloud.sql.v1.InstancesRotateServerCaRequest result = + new com.google.cloud.sql.v1.InstancesRotateServerCaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.InstancesRotateServerCaRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rotateServerCaContext_ = + rotateServerCaContextBuilder_ == null + ? rotateServerCaContext_ + : rotateServerCaContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesRotateServerCaRequest) { + return mergeFrom((com.google.cloud.sql.v1.InstancesRotateServerCaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InstancesRotateServerCaRequest other) { + if (other == com.google.cloud.sql.v1.InstancesRotateServerCaRequest.getDefaultInstance()) + return this; + if (other.hasRotateServerCaContext()) { + mergeRotateServerCaContext(other.getRotateServerCaContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetRotateServerCaContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.RotateServerCaContext rotateServerCaContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.RotateServerCaContext, + com.google.cloud.sql.v1.RotateServerCaContext.Builder, + com.google.cloud.sql.v1.RotateServerCaContextOrBuilder> + rotateServerCaContextBuilder_; + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + * + * @return Whether the rotateServerCaContext field is set. + */ + public boolean hasRotateServerCaContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + * + * @return The rotateServerCaContext. + */ + public com.google.cloud.sql.v1.RotateServerCaContext getRotateServerCaContext() { + if (rotateServerCaContextBuilder_ == null) { + return rotateServerCaContext_ == null + ? com.google.cloud.sql.v1.RotateServerCaContext.getDefaultInstance() + : rotateServerCaContext_; + } else { + return rotateServerCaContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + */ + public Builder setRotateServerCaContext(com.google.cloud.sql.v1.RotateServerCaContext value) { + if (rotateServerCaContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rotateServerCaContext_ = value; + } else { + rotateServerCaContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + */ + public Builder setRotateServerCaContext( + com.google.cloud.sql.v1.RotateServerCaContext.Builder builderForValue) { + if (rotateServerCaContextBuilder_ == null) { + rotateServerCaContext_ = builderForValue.build(); + } else { + rotateServerCaContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + */ + public Builder mergeRotateServerCaContext(com.google.cloud.sql.v1.RotateServerCaContext value) { + if (rotateServerCaContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && rotateServerCaContext_ != null + && rotateServerCaContext_ + != com.google.cloud.sql.v1.RotateServerCaContext.getDefaultInstance()) { + getRotateServerCaContextBuilder().mergeFrom(value); + } else { + rotateServerCaContext_ = value; + } + } else { + rotateServerCaContextBuilder_.mergeFrom(value); + } + if (rotateServerCaContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + */ + public Builder clearRotateServerCaContext() { + bitField0_ = (bitField0_ & ~0x00000001); + rotateServerCaContext_ = null; + if (rotateServerCaContextBuilder_ != null) { + rotateServerCaContextBuilder_.dispose(); + rotateServerCaContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + */ + public com.google.cloud.sql.v1.RotateServerCaContext.Builder getRotateServerCaContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRotateServerCaContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + */ + public com.google.cloud.sql.v1.RotateServerCaContextOrBuilder + getRotateServerCaContextOrBuilder() { + if (rotateServerCaContextBuilder_ != null) { + return rotateServerCaContextBuilder_.getMessageOrBuilder(); + } else { + return rotateServerCaContext_ == null + ? com.google.cloud.sql.v1.RotateServerCaContext.getDefaultInstance() + : rotateServerCaContext_; + } + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.RotateServerCaContext, + com.google.cloud.sql.v1.RotateServerCaContext.Builder, + com.google.cloud.sql.v1.RotateServerCaContextOrBuilder> + internalGetRotateServerCaContextFieldBuilder() { + if (rotateServerCaContextBuilder_ == null) { + rotateServerCaContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.RotateServerCaContext, + com.google.cloud.sql.v1.RotateServerCaContext.Builder, + com.google.cloud.sql.v1.RotateServerCaContextOrBuilder>( + getRotateServerCaContext(), getParentForChildren(), isClean()); + rotateServerCaContext_ = null; + } + return rotateServerCaContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesRotateServerCaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesRotateServerCaRequest) + private static final com.google.cloud.sql.v1.InstancesRotateServerCaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesRotateServerCaRequest(); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesRotateServerCaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateServerCaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateServerCaRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateServerCaRequestOrBuilder.java new file mode 100644 index 000000000000..25daebc8f3a4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateServerCaRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesRotateServerCaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesRotateServerCaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Contains details about the rotate server CA operation.
+   * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + * + * @return Whether the rotateServerCaContext field is set. + */ + boolean hasRotateServerCaContext(); + + /** + * + * + *
+   * Contains details about the rotate server CA operation.
+   * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + * + * @return The rotateServerCaContext. + */ + com.google.cloud.sql.v1.RotateServerCaContext getRotateServerCaContext(); + + /** + * + * + *
+   * Contains details about the rotate server CA operation.
+   * 
+ * + * .google.cloud.sql.v1.RotateServerCaContext rotate_server_ca_context = 1; + */ + com.google.cloud.sql.v1.RotateServerCaContextOrBuilder getRotateServerCaContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateServerCertificateRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateServerCertificateRequest.java new file mode 100644 index 000000000000..28d9f768b06a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateServerCertificateRequest.java @@ -0,0 +1,749 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Rotate server certificate request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesRotateServerCertificateRequest} + */ +@com.google.protobuf.Generated +public final class InstancesRotateServerCertificateRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesRotateServerCertificateRequest) + InstancesRotateServerCertificateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesRotateServerCertificateRequest"); + } + + // Use InstancesRotateServerCertificateRequest.newBuilder() to construct. + private InstancesRotateServerCertificateRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesRotateServerCertificateRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateServerCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateServerCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.class, + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.Builder.class); + } + + private int bitField0_; + public static final int ROTATE_SERVER_CERTIFICATE_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.RotateServerCertificateContext rotateServerCertificateContext_; + + /** + * + * + *
+   * Optional. Contains details about the rotate server certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rotateServerCertificateContext field is set. + */ + @java.lang.Override + public boolean hasRotateServerCertificateContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Contains details about the rotate server certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rotateServerCertificateContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.RotateServerCertificateContext + getRotateServerCertificateContext() { + return rotateServerCertificateContext_ == null + ? com.google.cloud.sql.v1.RotateServerCertificateContext.getDefaultInstance() + : rotateServerCertificateContext_; + } + + /** + * + * + *
+   * Optional. Contains details about the rotate server certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.RotateServerCertificateContextOrBuilder + getRotateServerCertificateContextOrBuilder() { + return rotateServerCertificateContext_ == null + ? com.google.cloud.sql.v1.RotateServerCertificateContext.getDefaultInstance() + : rotateServerCertificateContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getRotateServerCertificateContext()); + } + 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, getRotateServerCertificateContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest other = + (com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest) obj; + + if (hasRotateServerCertificateContext() != other.hasRotateServerCertificateContext()) + return false; + if (hasRotateServerCertificateContext()) { + if (!getRotateServerCertificateContext().equals(other.getRotateServerCertificateContext())) + return false; + } + if (!getUnknownFields().equals(other.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 (hasRotateServerCertificateContext()) { + hash = (37 * hash) + ROTATE_SERVER_CERTIFICATE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getRotateServerCertificateContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Rotate server certificate request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesRotateServerCertificateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesRotateServerCertificateRequest) + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateServerCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateServerCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.class, + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRotateServerCertificateContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rotateServerCertificateContext_ = null; + if (rotateServerCertificateContextBuilder_ != null) { + rotateServerCertificateContextBuilder_.dispose(); + rotateServerCertificateContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesRotateServerCertificateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest build() { + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest buildPartial() { + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest result = + new com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rotateServerCertificateContext_ = + rotateServerCertificateContextBuilder_ == null + ? rotateServerCertificateContext_ + : rotateServerCertificateContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest) { + return mergeFrom((com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest other) { + if (other + == com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.getDefaultInstance()) + return this; + if (other.hasRotateServerCertificateContext()) { + mergeRotateServerCertificateContext(other.getRotateServerCertificateContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetRotateServerCertificateContextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.RotateServerCertificateContext rotateServerCertificateContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.RotateServerCertificateContext, + com.google.cloud.sql.v1.RotateServerCertificateContext.Builder, + com.google.cloud.sql.v1.RotateServerCertificateContextOrBuilder> + rotateServerCertificateContextBuilder_; + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rotateServerCertificateContext field is set. + */ + public boolean hasRotateServerCertificateContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rotateServerCertificateContext. + */ + public com.google.cloud.sql.v1.RotateServerCertificateContext + getRotateServerCertificateContext() { + if (rotateServerCertificateContextBuilder_ == null) { + return rotateServerCertificateContext_ == null + ? com.google.cloud.sql.v1.RotateServerCertificateContext.getDefaultInstance() + : rotateServerCertificateContext_; + } else { + return rotateServerCertificateContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRotateServerCertificateContext( + com.google.cloud.sql.v1.RotateServerCertificateContext value) { + if (rotateServerCertificateContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rotateServerCertificateContext_ = value; + } else { + rotateServerCertificateContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRotateServerCertificateContext( + com.google.cloud.sql.v1.RotateServerCertificateContext.Builder builderForValue) { + if (rotateServerCertificateContextBuilder_ == null) { + rotateServerCertificateContext_ = builderForValue.build(); + } else { + rotateServerCertificateContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRotateServerCertificateContext( + com.google.cloud.sql.v1.RotateServerCertificateContext value) { + if (rotateServerCertificateContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && rotateServerCertificateContext_ != null + && rotateServerCertificateContext_ + != com.google.cloud.sql.v1.RotateServerCertificateContext.getDefaultInstance()) { + getRotateServerCertificateContextBuilder().mergeFrom(value); + } else { + rotateServerCertificateContext_ = value; + } + } else { + rotateServerCertificateContextBuilder_.mergeFrom(value); + } + if (rotateServerCertificateContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRotateServerCertificateContext() { + bitField0_ = (bitField0_ & ~0x00000001); + rotateServerCertificateContext_ = null; + if (rotateServerCertificateContextBuilder_ != null) { + rotateServerCertificateContextBuilder_.dispose(); + rotateServerCertificateContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.RotateServerCertificateContext.Builder + getRotateServerCertificateContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRotateServerCertificateContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.RotateServerCertificateContextOrBuilder + getRotateServerCertificateContextOrBuilder() { + if (rotateServerCertificateContextBuilder_ != null) { + return rotateServerCertificateContextBuilder_.getMessageOrBuilder(); + } else { + return rotateServerCertificateContext_ == null + ? com.google.cloud.sql.v1.RotateServerCertificateContext.getDefaultInstance() + : rotateServerCertificateContext_; + } + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.RotateServerCertificateContext, + com.google.cloud.sql.v1.RotateServerCertificateContext.Builder, + com.google.cloud.sql.v1.RotateServerCertificateContextOrBuilder> + internalGetRotateServerCertificateContextFieldBuilder() { + if (rotateServerCertificateContextBuilder_ == null) { + rotateServerCertificateContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.RotateServerCertificateContext, + com.google.cloud.sql.v1.RotateServerCertificateContext.Builder, + com.google.cloud.sql.v1.RotateServerCertificateContextOrBuilder>( + getRotateServerCertificateContext(), getParentForChildren(), isClean()); + rotateServerCertificateContext_ = null; + } + return rotateServerCertificateContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesRotateServerCertificateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesRotateServerCertificateRequest) + private static final com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest(); + } + + public static com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesRotateServerCertificateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateServerCertificateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateServerCertificateRequestOrBuilder.java new file mode 100644 index 000000000000..93a4627272d7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesRotateServerCertificateRequestOrBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesRotateServerCertificateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesRotateServerCertificateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Contains details about the rotate server certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rotateServerCertificateContext field is set. + */ + boolean hasRotateServerCertificateContext(); + + /** + * + * + *
+   * Optional. Contains details about the rotate server certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rotateServerCertificateContext. + */ + com.google.cloud.sql.v1.RotateServerCertificateContext getRotateServerCertificateContext(); + + /** + * + * + *
+   * Optional. Contains details about the rotate server certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.RotateServerCertificateContextOrBuilder + getRotateServerCertificateContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesTruncateLogRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesTruncateLogRequest.java new file mode 100644 index 000000000000..6c42342f1280 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesTruncateLogRequest.java @@ -0,0 +1,703 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance truncate log request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesTruncateLogRequest} + */ +@com.google.protobuf.Generated +public final class InstancesTruncateLogRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.InstancesTruncateLogRequest) + InstancesTruncateLogRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesTruncateLogRequest"); + } + + // Use InstancesTruncateLogRequest.newBuilder() to construct. + private InstancesTruncateLogRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesTruncateLogRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesTruncateLogRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesTruncateLogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesTruncateLogRequest.class, + com.google.cloud.sql.v1.InstancesTruncateLogRequest.Builder.class); + } + + private int bitField0_; + public static final int TRUNCATE_LOG_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.TruncateLogContext truncateLogContext_; + + /** + * + * + *
+   * Contains details about the truncate log operation.
+   * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + * + * @return Whether the truncateLogContext field is set. + */ + @java.lang.Override + public boolean hasTruncateLogContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Contains details about the truncate log operation.
+   * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + * + * @return The truncateLogContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.TruncateLogContext getTruncateLogContext() { + return truncateLogContext_ == null + ? com.google.cloud.sql.v1.TruncateLogContext.getDefaultInstance() + : truncateLogContext_; + } + + /** + * + * + *
+   * Contains details about the truncate log operation.
+   * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.TruncateLogContextOrBuilder getTruncateLogContextOrBuilder() { + return truncateLogContext_ == null + ? com.google.cloud.sql.v1.TruncateLogContext.getDefaultInstance() + : truncateLogContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getTruncateLogContext()); + } + 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, getTruncateLogContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.InstancesTruncateLogRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.InstancesTruncateLogRequest other = + (com.google.cloud.sql.v1.InstancesTruncateLogRequest) obj; + + if (hasTruncateLogContext() != other.hasTruncateLogContext()) return false; + if (hasTruncateLogContext()) { + if (!getTruncateLogContext().equals(other.getTruncateLogContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasTruncateLogContext()) { + hash = (37 * hash) + TRUNCATE_LOG_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getTruncateLogContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.InstancesTruncateLogRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesTruncateLogRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesTruncateLogRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesTruncateLogRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesTruncateLogRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.InstancesTruncateLogRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesTruncateLogRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesTruncateLogRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesTruncateLogRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesTruncateLogRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.InstancesTruncateLogRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.InstancesTruncateLogRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.InstancesTruncateLogRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance truncate log request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.InstancesTruncateLogRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.InstancesTruncateLogRequest) + com.google.cloud.sql.v1.InstancesTruncateLogRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesTruncateLogRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesTruncateLogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.InstancesTruncateLogRequest.class, + com.google.cloud.sql.v1.InstancesTruncateLogRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.InstancesTruncateLogRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTruncateLogContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + truncateLogContext_ = null; + if (truncateLogContextBuilder_ != null) { + truncateLogContextBuilder_.dispose(); + truncateLogContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_InstancesTruncateLogRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesTruncateLogRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.InstancesTruncateLogRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesTruncateLogRequest build() { + com.google.cloud.sql.v1.InstancesTruncateLogRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesTruncateLogRequest buildPartial() { + com.google.cloud.sql.v1.InstancesTruncateLogRequest result = + new com.google.cloud.sql.v1.InstancesTruncateLogRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.InstancesTruncateLogRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.truncateLogContext_ = + truncateLogContextBuilder_ == null + ? truncateLogContext_ + : truncateLogContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.InstancesTruncateLogRequest) { + return mergeFrom((com.google.cloud.sql.v1.InstancesTruncateLogRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.InstancesTruncateLogRequest other) { + if (other == com.google.cloud.sql.v1.InstancesTruncateLogRequest.getDefaultInstance()) + return this; + if (other.hasTruncateLogContext()) { + mergeTruncateLogContext(other.getTruncateLogContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetTruncateLogContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.TruncateLogContext truncateLogContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.TruncateLogContext, + com.google.cloud.sql.v1.TruncateLogContext.Builder, + com.google.cloud.sql.v1.TruncateLogContextOrBuilder> + truncateLogContextBuilder_; + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + * + * @return Whether the truncateLogContext field is set. + */ + public boolean hasTruncateLogContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + * + * @return The truncateLogContext. + */ + public com.google.cloud.sql.v1.TruncateLogContext getTruncateLogContext() { + if (truncateLogContextBuilder_ == null) { + return truncateLogContext_ == null + ? com.google.cloud.sql.v1.TruncateLogContext.getDefaultInstance() + : truncateLogContext_; + } else { + return truncateLogContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + */ + public Builder setTruncateLogContext(com.google.cloud.sql.v1.TruncateLogContext value) { + if (truncateLogContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + truncateLogContext_ = value; + } else { + truncateLogContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + */ + public Builder setTruncateLogContext( + com.google.cloud.sql.v1.TruncateLogContext.Builder builderForValue) { + if (truncateLogContextBuilder_ == null) { + truncateLogContext_ = builderForValue.build(); + } else { + truncateLogContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + */ + public Builder mergeTruncateLogContext(com.google.cloud.sql.v1.TruncateLogContext value) { + if (truncateLogContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && truncateLogContext_ != null + && truncateLogContext_ + != com.google.cloud.sql.v1.TruncateLogContext.getDefaultInstance()) { + getTruncateLogContextBuilder().mergeFrom(value); + } else { + truncateLogContext_ = value; + } + } else { + truncateLogContextBuilder_.mergeFrom(value); + } + if (truncateLogContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + */ + public Builder clearTruncateLogContext() { + bitField0_ = (bitField0_ & ~0x00000001); + truncateLogContext_ = null; + if (truncateLogContextBuilder_ != null) { + truncateLogContextBuilder_.dispose(); + truncateLogContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + */ + public com.google.cloud.sql.v1.TruncateLogContext.Builder getTruncateLogContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetTruncateLogContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + */ + public com.google.cloud.sql.v1.TruncateLogContextOrBuilder getTruncateLogContextOrBuilder() { + if (truncateLogContextBuilder_ != null) { + return truncateLogContextBuilder_.getMessageOrBuilder(); + } else { + return truncateLogContext_ == null + ? com.google.cloud.sql.v1.TruncateLogContext.getDefaultInstance() + : truncateLogContext_; + } + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.TruncateLogContext, + com.google.cloud.sql.v1.TruncateLogContext.Builder, + com.google.cloud.sql.v1.TruncateLogContextOrBuilder> + internalGetTruncateLogContextFieldBuilder() { + if (truncateLogContextBuilder_ == null) { + truncateLogContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.TruncateLogContext, + com.google.cloud.sql.v1.TruncateLogContext.Builder, + com.google.cloud.sql.v1.TruncateLogContextOrBuilder>( + getTruncateLogContext(), getParentForChildren(), isClean()); + truncateLogContext_ = null; + } + return truncateLogContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.InstancesTruncateLogRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.InstancesTruncateLogRequest) + private static final com.google.cloud.sql.v1.InstancesTruncateLogRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.InstancesTruncateLogRequest(); + } + + public static com.google.cloud.sql.v1.InstancesTruncateLogRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesTruncateLogRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.InstancesTruncateLogRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesTruncateLogRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesTruncateLogRequestOrBuilder.java new file mode 100644 index 000000000000..b84fae7c3267 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/InstancesTruncateLogRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface InstancesTruncateLogRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.InstancesTruncateLogRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Contains details about the truncate log operation.
+   * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + * + * @return Whether the truncateLogContext field is set. + */ + boolean hasTruncateLogContext(); + + /** + * + * + *
+   * Contains details about the truncate log operation.
+   * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + * + * @return The truncateLogContext. + */ + com.google.cloud.sql.v1.TruncateLogContext getTruncateLogContext(); + + /** + * + * + *
+   * Contains details about the truncate log operation.
+   * 
+ * + * .google.cloud.sql.v1.TruncateLogContext truncate_log_context = 1; + */ + com.google.cloud.sql.v1.TruncateLogContextOrBuilder getTruncateLogContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/IpConfiguration.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/IpConfiguration.java new file mode 100644 index 000000000000..ccb8ab3551dd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/IpConfiguration.java @@ -0,0 +1,4600 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * IP Management configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.IpConfiguration} + */ +@com.google.protobuf.Generated +public final class IpConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.IpConfiguration) + IpConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "IpConfiguration"); + } + + // Use IpConfiguration.newBuilder() to construct. + private IpConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private IpConfiguration() { + privateNetwork_ = ""; + authorizedNetworks_ = java.util.Collections.emptyList(); + allocatedIpRange_ = ""; + sslMode_ = 0; + serverCaMode_ = 0; + customSubjectAlternativeNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + serverCaPool_ = ""; + serverCertificateRotationMode_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_IpConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_IpConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.IpConfiguration.class, + com.google.cloud.sql.v1.IpConfiguration.Builder.class); + } + + /** + * + * + *
+   * The SSL options for database connections.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.IpConfiguration.SslMode} + */ + public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The SSL mode is unknown.
+     * 
+ * + * SSL_MODE_UNSPECIFIED = 0; + */ + SSL_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Allow non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL connections to MySQL and PostgreSQL, the client certificate
+     * isn't verified.
+     *
+     * When this value is used, the legacy `require_ssl` flag must be false or
+     * cleared to avoid a conflict between the values of the two flags.
+     * 
+ * + * ALLOW_UNENCRYPTED_AND_ENCRYPTED = 1; + */ + ALLOW_UNENCRYPTED_AND_ENCRYPTED(1), + /** + * + * + *
+     * Only allow connections encrypted with SSL/TLS.
+     * For SSL connections to MySQL and PostgreSQL, the client certificate
+     * isn't verified.
+     *
+     * When this value is used, the legacy `require_ssl` flag must be false or
+     * cleared to avoid a conflict between the values of the two flags.
+     * 
+ * + * ENCRYPTED_ONLY = 2; + */ + ENCRYPTED_ONLY(2), + /** + * + * + *
+     * Only allow connections encrypted with SSL/TLS and with valid
+     * client certificates.
+     *
+     * When this value is used, the legacy `require_ssl` flag must be true or
+     * cleared to avoid the conflict between values of two flags.
+     * PostgreSQL clients or users that connect using IAM database
+     * authentication must use either the
+     * [Cloud SQL Auth
+     * Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
+     * [Cloud SQL
+     * Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
+     * to enforce client identity verification.
+     *
+     * Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
+     * 
+ * + * TRUSTED_CLIENT_CERTIFICATE_REQUIRED = 3; + */ + TRUSTED_CLIENT_CERTIFICATE_REQUIRED(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslMode"); + } + + /** + * + * + *
+     * The SSL mode is unknown.
+     * 
+ * + * SSL_MODE_UNSPECIFIED = 0; + */ + public static final int SSL_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Allow non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL connections to MySQL and PostgreSQL, the client certificate
+     * isn't verified.
+     *
+     * When this value is used, the legacy `require_ssl` flag must be false or
+     * cleared to avoid a conflict between the values of the two flags.
+     * 
+ * + * ALLOW_UNENCRYPTED_AND_ENCRYPTED = 1; + */ + public static final int ALLOW_UNENCRYPTED_AND_ENCRYPTED_VALUE = 1; + + /** + * + * + *
+     * Only allow connections encrypted with SSL/TLS.
+     * For SSL connections to MySQL and PostgreSQL, the client certificate
+     * isn't verified.
+     *
+     * When this value is used, the legacy `require_ssl` flag must be false or
+     * cleared to avoid a conflict between the values of the two flags.
+     * 
+ * + * ENCRYPTED_ONLY = 2; + */ + public static final int ENCRYPTED_ONLY_VALUE = 2; + + /** + * + * + *
+     * Only allow connections encrypted with SSL/TLS and with valid
+     * client certificates.
+     *
+     * When this value is used, the legacy `require_ssl` flag must be true or
+     * cleared to avoid the conflict between values of two flags.
+     * PostgreSQL clients or users that connect using IAM database
+     * authentication must use either the
+     * [Cloud SQL Auth
+     * Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
+     * [Cloud SQL
+     * Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
+     * to enforce client identity verification.
+     *
+     * Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
+     * 
+ * + * TRUSTED_CLIENT_CERTIFICATE_REQUIRED = 3; + */ + public static final int TRUSTED_CLIENT_CERTIFICATE_REQUIRED_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SslMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SslMode forNumber(int value) { + switch (value) { + case 0: + return SSL_MODE_UNSPECIFIED; + case 1: + return ALLOW_UNENCRYPTED_AND_ENCRYPTED; + case 2: + return ENCRYPTED_ONLY; + case 3: + return TRUSTED_CLIENT_CERTIFICATE_REQUIRED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SslMode findValueByNumber(int number) { + return SslMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.IpConfiguration.getDescriptor().getEnumTypes().get(0); + } + + private static final SslMode[] VALUES = values(); + + public static SslMode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SslMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.IpConfiguration.SslMode) + } + + /** + * + * + *
+   * Various Certificate Authority (CA) modes for certificate signing.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.IpConfiguration.CaMode} + */ + public enum CaMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * CA mode is unspecified. It is effectively the same as
+     * `GOOGLE_MANAGED_INTERNAL_CA`.
+     * 
+ * + * CA_MODE_UNSPECIFIED = 0; + */ + CA_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Google-managed self-signed internal CA.
+     * 
+ * + * GOOGLE_MANAGED_INTERNAL_CA = 1; + */ + GOOGLE_MANAGED_INTERNAL_CA(1), + /** + * + * + *
+     * Google-managed regional CA part of root CA hierarchy hosted on Google
+     * Cloud's Certificate Authority Service (CAS).
+     * 
+ * + * GOOGLE_MANAGED_CAS_CA = 2; + */ + GOOGLE_MANAGED_CAS_CA(2), + /** + * + * + *
+     * Customer-managed CA hosted on Google Cloud's Certificate Authority
+     * Service (CAS).
+     * 
+ * + * CUSTOMER_MANAGED_CAS_CA = 3; + */ + CUSTOMER_MANAGED_CAS_CA(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CaMode"); + } + + /** + * + * + *
+     * CA mode is unspecified. It is effectively the same as
+     * `GOOGLE_MANAGED_INTERNAL_CA`.
+     * 
+ * + * CA_MODE_UNSPECIFIED = 0; + */ + public static final int CA_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Google-managed self-signed internal CA.
+     * 
+ * + * GOOGLE_MANAGED_INTERNAL_CA = 1; + */ + public static final int GOOGLE_MANAGED_INTERNAL_CA_VALUE = 1; + + /** + * + * + *
+     * Google-managed regional CA part of root CA hierarchy hosted on Google
+     * Cloud's Certificate Authority Service (CAS).
+     * 
+ * + * GOOGLE_MANAGED_CAS_CA = 2; + */ + public static final int GOOGLE_MANAGED_CAS_CA_VALUE = 2; + + /** + * + * + *
+     * Customer-managed CA hosted on Google Cloud's Certificate Authority
+     * Service (CAS).
+     * 
+ * + * CUSTOMER_MANAGED_CAS_CA = 3; + */ + public static final int CUSTOMER_MANAGED_CAS_CA_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CaMode 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 CaMode forNumber(int value) { + switch (value) { + case 0: + return CA_MODE_UNSPECIFIED; + case 1: + return GOOGLE_MANAGED_INTERNAL_CA; + case 2: + return GOOGLE_MANAGED_CAS_CA; + case 3: + return CUSTOMER_MANAGED_CAS_CA; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CaMode findValueByNumber(int number) { + return CaMode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.IpConfiguration.getDescriptor().getEnumTypes().get(1); + } + + private static final CaMode[] VALUES = values(); + + public static CaMode 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 CaMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.IpConfiguration.CaMode) + } + + /** + * + * + *
+   * Settings for automatic server certificate rotation.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode} + */ + public enum ServerCertificateRotationMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified: no automatic server certificate rotation.
+     * 
+ * + * SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED = 0; + */ + SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * No automatic server certificate rotation. The user must [manage server
+     * certificate
+     * rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas)
+     * on their side.
+     * 
+ * + * NO_AUTOMATIC_ROTATION = 1; + */ + NO_AUTOMATIC_ROTATION(1), + /** + * + * + *
+     * Automatic server certificate rotation during Cloud SQL scheduled
+     * maintenance or self-service maintenance updates. Requires
+     * `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or
+     * `CUSTOMER_MANAGED_CAS_CA`.
+     * 
+ * + * AUTOMATIC_ROTATION_DURING_MAINTENANCE = 2; + */ + AUTOMATIC_ROTATION_DURING_MAINTENANCE(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ServerCertificateRotationMode"); + } + + /** + * + * + *
+     * Unspecified: no automatic server certificate rotation.
+     * 
+ * + * SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED = 0; + */ + public static final int SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * No automatic server certificate rotation. The user must [manage server
+     * certificate
+     * rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas)
+     * on their side.
+     * 
+ * + * NO_AUTOMATIC_ROTATION = 1; + */ + public static final int NO_AUTOMATIC_ROTATION_VALUE = 1; + + /** + * + * + *
+     * Automatic server certificate rotation during Cloud SQL scheduled
+     * maintenance or self-service maintenance updates. Requires
+     * `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or
+     * `CUSTOMER_MANAGED_CAS_CA`.
+     * 
+ * + * AUTOMATIC_ROTATION_DURING_MAINTENANCE = 2; + */ + public static final int AUTOMATIC_ROTATION_DURING_MAINTENANCE_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 ServerCertificateRotationMode 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 ServerCertificateRotationMode forNumber(int value) { + switch (value) { + case 0: + return SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED; + case 1: + return NO_AUTOMATIC_ROTATION; + case 2: + return AUTOMATIC_ROTATION_DURING_MAINTENANCE; + 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 ServerCertificateRotationMode findValueByNumber(int number) { + return ServerCertificateRotationMode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.IpConfiguration.getDescriptor().getEnumTypes().get(2); + } + + private static final ServerCertificateRotationMode[] VALUES = values(); + + public static ServerCertificateRotationMode 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 ServerCertificateRotationMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode) + } + + private int bitField0_; + public static final int IPV4_ENABLED_FIELD_NUMBER = 1; + private com.google.protobuf.BoolValue ipv4Enabled_; + + /** + * + * + *
+   * Whether the instance is assigned a public IP address or not.
+   * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + * + * @return Whether the ipv4Enabled field is set. + */ + @java.lang.Override + public boolean hasIpv4Enabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Whether the instance is assigned a public IP address or not.
+   * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + * + * @return The ipv4Enabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getIpv4Enabled() { + return ipv4Enabled_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : ipv4Enabled_; + } + + /** + * + * + *
+   * Whether the instance is assigned a public IP address or not.
+   * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getIpv4EnabledOrBuilder() { + return ipv4Enabled_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : ipv4Enabled_; + } + + public static final int PRIVATE_NETWORK_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object privateNetwork_ = ""; + + /** + * + * + *
+   * The resource link for the VPC network from which the Cloud SQL instance is
+   * accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`. This setting can
+   * be updated, but it cannot be removed after it is set.
+   * 
+ * + * string private_network = 2; + * + * @return The privateNetwork. + */ + @java.lang.Override + public java.lang.String getPrivateNetwork() { + java.lang.Object ref = privateNetwork_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateNetwork_ = s; + return s; + } + } + + /** + * + * + *
+   * The resource link for the VPC network from which the Cloud SQL instance is
+   * accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`. This setting can
+   * be updated, but it cannot be removed after it is set.
+   * 
+ * + * string private_network = 2; + * + * @return The bytes for privateNetwork. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrivateNetworkBytes() { + java.lang.Object ref = privateNetwork_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUIRE_SSL_FIELD_NUMBER = 3; + private com.google.protobuf.BoolValue requireSsl_; + + /** + * + * + *
+   * Use `ssl_mode` instead.
+   *
+   * Whether SSL/TLS connections over IP are enforced.
+   * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+   * For SSL/TLS connections, the client certificate won't be verified. If
+   * set to true, then only allow connections encrypted with SSL/TLS and with
+   * valid client certificates. If you want to enforce SSL/TLS without enforcing
+   * the requirement for valid client certificates, then use the `ssl_mode` flag
+   * instead of the `require_ssl` flag.
+   * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + * + * @return Whether the requireSsl field is set. + */ + @java.lang.Override + public boolean hasRequireSsl() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Use `ssl_mode` instead.
+   *
+   * Whether SSL/TLS connections over IP are enforced.
+   * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+   * For SSL/TLS connections, the client certificate won't be verified. If
+   * set to true, then only allow connections encrypted with SSL/TLS and with
+   * valid client certificates. If you want to enforce SSL/TLS without enforcing
+   * the requirement for valid client certificates, then use the `ssl_mode` flag
+   * instead of the `require_ssl` flag.
+   * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + * + * @return The requireSsl. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getRequireSsl() { + return requireSsl_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : requireSsl_; + } + + /** + * + * + *
+   * Use `ssl_mode` instead.
+   *
+   * Whether SSL/TLS connections over IP are enforced.
+   * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+   * For SSL/TLS connections, the client certificate won't be verified. If
+   * set to true, then only allow connections encrypted with SSL/TLS and with
+   * valid client certificates. If you want to enforce SSL/TLS without enforcing
+   * the requirement for valid client certificates, then use the `ssl_mode` flag
+   * instead of the `require_ssl` flag.
+   * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getRequireSslOrBuilder() { + return requireSsl_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : requireSsl_; + } + + public static final int AUTHORIZED_NETWORKS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List authorizedNetworks_; + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + @java.lang.Override + public java.util.List getAuthorizedNetworksList() { + return authorizedNetworks_; + } + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + @java.lang.Override + public java.util.List + getAuthorizedNetworksOrBuilderList() { + return authorizedNetworks_; + } + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + @java.lang.Override + public int getAuthorizedNetworksCount() { + return authorizedNetworks_.size(); + } + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1.AclEntry getAuthorizedNetworks(int index) { + return authorizedNetworks_.get(index); + } + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1.AclEntryOrBuilder getAuthorizedNetworksOrBuilder(int index) { + return authorizedNetworks_.get(index); + } + + public static final int ALLOCATED_IP_RANGE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object allocatedIpRange_ = ""; + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the instance ip
+   * will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The allocatedIpRange. + */ + @java.lang.Override + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the instance ip
+   * will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The bytes for allocatedIpRange. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLE_PRIVATE_PATH_FOR_GOOGLE_CLOUD_SERVICES_FIELD_NUMBER = 7; + private com.google.protobuf.BoolValue enablePrivatePathForGoogleCloudServices_; + + /** + * + * + *
+   * Controls connectivity to private IP instances from Google services,
+   * such as BigQuery.
+   * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + * + * @return Whether the enablePrivatePathForGoogleCloudServices field is set. + */ + @java.lang.Override + public boolean hasEnablePrivatePathForGoogleCloudServices() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Controls connectivity to private IP instances from Google services,
+   * such as BigQuery.
+   * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + * + * @return The enablePrivatePathForGoogleCloudServices. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnablePrivatePathForGoogleCloudServices() { + return enablePrivatePathForGoogleCloudServices_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePrivatePathForGoogleCloudServices_; + } + + /** + * + * + *
+   * Controls connectivity to private IP instances from Google services,
+   * such as BigQuery.
+   * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder + getEnablePrivatePathForGoogleCloudServicesOrBuilder() { + return enablePrivatePathForGoogleCloudServices_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePrivatePathForGoogleCloudServices_; + } + + public static final int SSL_MODE_FIELD_NUMBER = 8; + private int sslMode_ = 0; + + /** + * + * + *
+   * Specify how SSL/TLS is enforced in database connections. If you must use
+   * the `require_ssl` flag for backward compatibility, then only the following
+   * value pairs are valid:
+   *
+   * For PostgreSQL and MySQL:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+   * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+   *
+   * For SQL Server:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+   *
+   * The value of `ssl_mode` has priority over the value of `require_ssl`.
+   *
+   * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+   * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+   * connections, while `require_ssl=false` means accept both non-SSL
+   * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+   * `ssl_mode` and accepts only SSL connections.
+   * 
+ * + * .google.cloud.sql.v1.IpConfiguration.SslMode ssl_mode = 8; + * + * @return The enum numeric value on the wire for sslMode. + */ + @java.lang.Override + public int getSslModeValue() { + return sslMode_; + } + + /** + * + * + *
+   * Specify how SSL/TLS is enforced in database connections. If you must use
+   * the `require_ssl` flag for backward compatibility, then only the following
+   * value pairs are valid:
+   *
+   * For PostgreSQL and MySQL:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+   * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+   *
+   * For SQL Server:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+   *
+   * The value of `ssl_mode` has priority over the value of `require_ssl`.
+   *
+   * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+   * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+   * connections, while `require_ssl=false` means accept both non-SSL
+   * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+   * `ssl_mode` and accepts only SSL connections.
+   * 
+ * + * .google.cloud.sql.v1.IpConfiguration.SslMode ssl_mode = 8; + * + * @return The sslMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpConfiguration.SslMode getSslMode() { + com.google.cloud.sql.v1.IpConfiguration.SslMode result = + com.google.cloud.sql.v1.IpConfiguration.SslMode.forNumber(sslMode_); + return result == null ? com.google.cloud.sql.v1.IpConfiguration.SslMode.UNRECOGNIZED : result; + } + + public static final int PSC_CONFIG_FIELD_NUMBER = 9; + private com.google.cloud.sql.v1.PscConfig pscConfig_; + + /** + * + * + *
+   * PSC settings for this instance.
+   * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + * + * @return Whether the pscConfig field is set. + */ + @java.lang.Override + public boolean hasPscConfig() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * PSC settings for this instance.
+   * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + * + * @return The pscConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.PscConfig getPscConfig() { + return pscConfig_ == null ? com.google.cloud.sql.v1.PscConfig.getDefaultInstance() : pscConfig_; + } + + /** + * + * + *
+   * PSC settings for this instance.
+   * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + */ + @java.lang.Override + public com.google.cloud.sql.v1.PscConfigOrBuilder getPscConfigOrBuilder() { + return pscConfig_ == null ? com.google.cloud.sql.v1.PscConfig.getDefaultInstance() : pscConfig_; + } + + public static final int SERVER_CA_MODE_FIELD_NUMBER = 10; + private int serverCaMode_ = 0; + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * optional .google.cloud.sql.v1.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return Whether the serverCaMode field is set. + */ + @java.lang.Override + public boolean hasServerCaMode() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * optional .google.cloud.sql.v1.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return The enum numeric value on the wire for serverCaMode. + */ + @java.lang.Override + public int getServerCaModeValue() { + return serverCaMode_; + } + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * optional .google.cloud.sql.v1.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return The serverCaMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpConfiguration.CaMode getServerCaMode() { + com.google.cloud.sql.v1.IpConfiguration.CaMode result = + com.google.cloud.sql.v1.IpConfiguration.CaMode.forNumber(serverCaMode_); + return result == null ? com.google.cloud.sql.v1.IpConfiguration.CaMode.UNRECOGNIZED : result; + } + + public static final int CUSTOM_SUBJECT_ALTERNATIVE_NAMES_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList customSubjectAlternativeNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the customSubjectAlternativeNames. + */ + public com.google.protobuf.ProtocolStringList getCustomSubjectAlternativeNamesList() { + return customSubjectAlternativeNames_; + } + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of customSubjectAlternativeNames. + */ + public int getCustomSubjectAlternativeNamesCount() { + return customSubjectAlternativeNames_.size(); + } + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The customSubjectAlternativeNames at the given index. + */ + public java.lang.String getCustomSubjectAlternativeNames(int index) { + return customSubjectAlternativeNames_.get(index); + } + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the customSubjectAlternativeNames at the given index. + */ + public com.google.protobuf.ByteString getCustomSubjectAlternativeNamesBytes(int index) { + return customSubjectAlternativeNames_.getByteString(index); + } + + public static final int SERVER_CA_POOL_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object serverCaPool_ = ""; + + /** + * + * + *
+   * Optional. The resource name of the server CA pool for an instance with
+   * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+   * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+   * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the serverCaPool field is set. + */ + @java.lang.Override + public boolean hasServerCaPool() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Optional. The resource name of the server CA pool for an instance with
+   * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+   * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+   * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The serverCaPool. + */ + @java.lang.Override + public java.lang.String getServerCaPool() { + java.lang.Object ref = serverCaPool_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serverCaPool_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The resource name of the server CA pool for an instance with
+   * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+   * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+   * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for serverCaPool. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServerCaPoolBytes() { + java.lang.Object ref = serverCaPool_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverCaPool_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVER_CERTIFICATE_ROTATION_MODE_FIELD_NUMBER = 16; + private int serverCertificateRotationMode_ = 0; + + /** + * + * + *
+   * Optional. Controls the automatic server certificate rotation feature. This
+   * feature is disabled by default. When enabled, the server certificate will
+   * be automatically rotated during Cloud SQL scheduled maintenance or
+   * self-service maintenance updates up to six months before it expires. This
+   * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+   * or CUSTOMER_MANAGED_CAS_CA.
+   * 
+ * + * + * optional .google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the serverCertificateRotationMode field is set. + */ + @java.lang.Override + public boolean hasServerCertificateRotationMode() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Optional. Controls the automatic server certificate rotation feature. This
+   * feature is disabled by default. When enabled, the server certificate will
+   * be automatically rotated during Cloud SQL scheduled maintenance or
+   * self-service maintenance updates up to six months before it expires. This
+   * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+   * or CUSTOMER_MANAGED_CAS_CA.
+   * 
+ * + * + * optional .google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for serverCertificateRotationMode. + */ + @java.lang.Override + public int getServerCertificateRotationModeValue() { + return serverCertificateRotationMode_; + } + + /** + * + * + *
+   * Optional. Controls the automatic server certificate rotation feature. This
+   * feature is disabled by default. When enabled, the server certificate will
+   * be automatically rotated during Cloud SQL scheduled maintenance or
+   * self-service maintenance updates up to six months before it expires. This
+   * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+   * or CUSTOMER_MANAGED_CAS_CA.
+   * 
+ * + * + * optional .google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The serverCertificateRotationMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode + getServerCertificateRotationMode() { + com.google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode result = + com.google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode.forNumber( + serverCertificateRotationMode_); + return result == null + ? com.google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getIpv4Enabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateNetwork_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, privateNetwork_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getRequireSsl()); + } + for (int i = 0; i < authorizedNetworks_.size(); i++) { + output.writeMessage(4, authorizedNetworks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatedIpRange_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, allocatedIpRange_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(7, getEnablePrivatePathForGoogleCloudServices()); + } + if (sslMode_ + != com.google.cloud.sql.v1.IpConfiguration.SslMode.SSL_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, sslMode_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(9, getPscConfig()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeEnum(10, serverCaMode_); + } + for (int i = 0; i < customSubjectAlternativeNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 11, customSubjectAlternativeNames_.getRaw(i)); + } + if (((bitField0_ & 0x00000020) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, serverCaPool_); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeEnum(16, serverCertificateRotationMode_); + } + 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, getIpv4Enabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateNetwork_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, privateNetwork_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequireSsl()); + } + for (int i = 0; i < authorizedNetworks_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, authorizedNetworks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatedIpRange_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, allocatedIpRange_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, getEnablePrivatePathForGoogleCloudServices()); + } + if (sslMode_ + != com.google.cloud.sql.v1.IpConfiguration.SslMode.SSL_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, sslMode_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getPscConfig()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, serverCaMode_); + } + { + int dataSize = 0; + for (int i = 0; i < customSubjectAlternativeNames_.size(); i++) { + dataSize += computeStringSizeNoTag(customSubjectAlternativeNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getCustomSubjectAlternativeNamesList().size(); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, serverCaPool_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize(16, serverCertificateRotationMode_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.IpConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.IpConfiguration other = (com.google.cloud.sql.v1.IpConfiguration) obj; + + if (hasIpv4Enabled() != other.hasIpv4Enabled()) return false; + if (hasIpv4Enabled()) { + if (!getIpv4Enabled().equals(other.getIpv4Enabled())) return false; + } + if (!getPrivateNetwork().equals(other.getPrivateNetwork())) return false; + if (hasRequireSsl() != other.hasRequireSsl()) return false; + if (hasRequireSsl()) { + if (!getRequireSsl().equals(other.getRequireSsl())) return false; + } + if (!getAuthorizedNetworksList().equals(other.getAuthorizedNetworksList())) return false; + if (!getAllocatedIpRange().equals(other.getAllocatedIpRange())) return false; + if (hasEnablePrivatePathForGoogleCloudServices() + != other.hasEnablePrivatePathForGoogleCloudServices()) return false; + if (hasEnablePrivatePathForGoogleCloudServices()) { + if (!getEnablePrivatePathForGoogleCloudServices() + .equals(other.getEnablePrivatePathForGoogleCloudServices())) return false; + } + if (sslMode_ != other.sslMode_) return false; + if (hasPscConfig() != other.hasPscConfig()) return false; + if (hasPscConfig()) { + if (!getPscConfig().equals(other.getPscConfig())) return false; + } + if (hasServerCaMode() != other.hasServerCaMode()) return false; + if (hasServerCaMode()) { + if (serverCaMode_ != other.serverCaMode_) return false; + } + if (!getCustomSubjectAlternativeNamesList() + .equals(other.getCustomSubjectAlternativeNamesList())) return false; + if (hasServerCaPool() != other.hasServerCaPool()) return false; + if (hasServerCaPool()) { + if (!getServerCaPool().equals(other.getServerCaPool())) return false; + } + if (hasServerCertificateRotationMode() != other.hasServerCertificateRotationMode()) + return false; + if (hasServerCertificateRotationMode()) { + if (serverCertificateRotationMode_ != other.serverCertificateRotationMode_) return false; + } + if (!getUnknownFields().equals(other.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 (hasIpv4Enabled()) { + hash = (37 * hash) + IPV4_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getIpv4Enabled().hashCode(); + } + hash = (37 * hash) + PRIVATE_NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getPrivateNetwork().hashCode(); + if (hasRequireSsl()) { + hash = (37 * hash) + REQUIRE_SSL_FIELD_NUMBER; + hash = (53 * hash) + getRequireSsl().hashCode(); + } + if (getAuthorizedNetworksCount() > 0) { + hash = (37 * hash) + AUTHORIZED_NETWORKS_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedNetworksList().hashCode(); + } + hash = (37 * hash) + ALLOCATED_IP_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getAllocatedIpRange().hashCode(); + if (hasEnablePrivatePathForGoogleCloudServices()) { + hash = (37 * hash) + ENABLE_PRIVATE_PATH_FOR_GOOGLE_CLOUD_SERVICES_FIELD_NUMBER; + hash = (53 * hash) + getEnablePrivatePathForGoogleCloudServices().hashCode(); + } + hash = (37 * hash) + SSL_MODE_FIELD_NUMBER; + hash = (53 * hash) + sslMode_; + if (hasPscConfig()) { + hash = (37 * hash) + PSC_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPscConfig().hashCode(); + } + if (hasServerCaMode()) { + hash = (37 * hash) + SERVER_CA_MODE_FIELD_NUMBER; + hash = (53 * hash) + serverCaMode_; + } + if (getCustomSubjectAlternativeNamesCount() > 0) { + hash = (37 * hash) + CUSTOM_SUBJECT_ALTERNATIVE_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getCustomSubjectAlternativeNamesList().hashCode(); + } + if (hasServerCaPool()) { + hash = (37 * hash) + SERVER_CA_POOL_FIELD_NUMBER; + hash = (53 * hash) + getServerCaPool().hashCode(); + } + if (hasServerCertificateRotationMode()) { + hash = (37 * hash) + SERVER_CERTIFICATE_ROTATION_MODE_FIELD_NUMBER; + hash = (53 * hash) + serverCertificateRotationMode_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.IpConfiguration parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.IpConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.IpConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.IpConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.IpConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.IpConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.IpConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.IpConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.IpConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.IpConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.IpConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.IpConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.IpConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * IP Management configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.IpConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.IpConfiguration) + com.google.cloud.sql.v1.IpConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_IpConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_IpConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.IpConfiguration.class, + com.google.cloud.sql.v1.IpConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.IpConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetIpv4EnabledFieldBuilder(); + internalGetRequireSslFieldBuilder(); + internalGetAuthorizedNetworksFieldBuilder(); + internalGetEnablePrivatePathForGoogleCloudServicesFieldBuilder(); + internalGetPscConfigFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + ipv4Enabled_ = null; + if (ipv4EnabledBuilder_ != null) { + ipv4EnabledBuilder_.dispose(); + ipv4EnabledBuilder_ = null; + } + privateNetwork_ = ""; + requireSsl_ = null; + if (requireSslBuilder_ != null) { + requireSslBuilder_.dispose(); + requireSslBuilder_ = null; + } + if (authorizedNetworksBuilder_ == null) { + authorizedNetworks_ = java.util.Collections.emptyList(); + } else { + authorizedNetworks_ = null; + authorizedNetworksBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + allocatedIpRange_ = ""; + enablePrivatePathForGoogleCloudServices_ = null; + if (enablePrivatePathForGoogleCloudServicesBuilder_ != null) { + enablePrivatePathForGoogleCloudServicesBuilder_.dispose(); + enablePrivatePathForGoogleCloudServicesBuilder_ = null; + } + sslMode_ = 0; + pscConfig_ = null; + if (pscConfigBuilder_ != null) { + pscConfigBuilder_.dispose(); + pscConfigBuilder_ = null; + } + serverCaMode_ = 0; + customSubjectAlternativeNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + serverCaPool_ = ""; + serverCertificateRotationMode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_IpConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.IpConfiguration getDefaultInstanceForType() { + return com.google.cloud.sql.v1.IpConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.IpConfiguration build() { + com.google.cloud.sql.v1.IpConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.IpConfiguration buildPartial() { + com.google.cloud.sql.v1.IpConfiguration result = + new com.google.cloud.sql.v1.IpConfiguration(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.IpConfiguration result) { + if (authorizedNetworksBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + authorizedNetworks_ = java.util.Collections.unmodifiableList(authorizedNetworks_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.authorizedNetworks_ = authorizedNetworks_; + } else { + result.authorizedNetworks_ = authorizedNetworksBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.IpConfiguration result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ipv4Enabled_ = + ipv4EnabledBuilder_ == null ? ipv4Enabled_ : ipv4EnabledBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.privateNetwork_ = privateNetwork_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requireSsl_ = requireSslBuilder_ == null ? requireSsl_ : requireSslBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allocatedIpRange_ = allocatedIpRange_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.enablePrivatePathForGoogleCloudServices_ = + enablePrivatePathForGoogleCloudServicesBuilder_ == null + ? enablePrivatePathForGoogleCloudServices_ + : enablePrivatePathForGoogleCloudServicesBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.sslMode_ = sslMode_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.pscConfig_ = pscConfigBuilder_ == null ? pscConfig_ : pscConfigBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.serverCaMode_ = serverCaMode_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + customSubjectAlternativeNames_.makeImmutable(); + result.customSubjectAlternativeNames_ = customSubjectAlternativeNames_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.serverCaPool_ = serverCaPool_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.serverCertificateRotationMode_ = serverCertificateRotationMode_; + to_bitField0_ |= 0x00000040; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.IpConfiguration) { + return mergeFrom((com.google.cloud.sql.v1.IpConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.IpConfiguration other) { + if (other == com.google.cloud.sql.v1.IpConfiguration.getDefaultInstance()) return this; + if (other.hasIpv4Enabled()) { + mergeIpv4Enabled(other.getIpv4Enabled()); + } + if (!other.getPrivateNetwork().isEmpty()) { + privateNetwork_ = other.privateNetwork_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasRequireSsl()) { + mergeRequireSsl(other.getRequireSsl()); + } + if (authorizedNetworksBuilder_ == null) { + if (!other.authorizedNetworks_.isEmpty()) { + if (authorizedNetworks_.isEmpty()) { + authorizedNetworks_ = other.authorizedNetworks_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.addAll(other.authorizedNetworks_); + } + onChanged(); + } + } else { + if (!other.authorizedNetworks_.isEmpty()) { + if (authorizedNetworksBuilder_.isEmpty()) { + authorizedNetworksBuilder_.dispose(); + authorizedNetworksBuilder_ = null; + authorizedNetworks_ = other.authorizedNetworks_; + bitField0_ = (bitField0_ & ~0x00000008); + authorizedNetworksBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetAuthorizedNetworksFieldBuilder() + : null; + } else { + authorizedNetworksBuilder_.addAllMessages(other.authorizedNetworks_); + } + } + } + if (!other.getAllocatedIpRange().isEmpty()) { + allocatedIpRange_ = other.allocatedIpRange_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasEnablePrivatePathForGoogleCloudServices()) { + mergeEnablePrivatePathForGoogleCloudServices( + other.getEnablePrivatePathForGoogleCloudServices()); + } + if (other.sslMode_ != 0) { + setSslModeValue(other.getSslModeValue()); + } + if (other.hasPscConfig()) { + mergePscConfig(other.getPscConfig()); + } + if (other.hasServerCaMode()) { + setServerCaModeValue(other.getServerCaModeValue()); + } + if (!other.customSubjectAlternativeNames_.isEmpty()) { + if (customSubjectAlternativeNames_.isEmpty()) { + customSubjectAlternativeNames_ = other.customSubjectAlternativeNames_; + bitField0_ |= 0x00000200; + } else { + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.addAll(other.customSubjectAlternativeNames_); + } + onChanged(); + } + if (other.hasServerCaPool()) { + serverCaPool_ = other.serverCaPool_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (other.hasServerCertificateRotationMode()) { + setServerCertificateRotationModeValue(other.getServerCertificateRotationModeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetIpv4EnabledFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + privateNetwork_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetRequireSslFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.cloud.sql.v1.AclEntry m = + input.readMessage(com.google.cloud.sql.v1.AclEntry.parser(), extensionRegistry); + if (authorizedNetworksBuilder_ == null) { + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.add(m); + } else { + authorizedNetworksBuilder_.addMessage(m); + } + break; + } // case 34 + case 50: + { + allocatedIpRange_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetEnablePrivatePathForGoogleCloudServicesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 64: + { + sslMode_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 64 + case 74: + { + input.readMessage( + internalGetPscConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 74 + case 80: + { + serverCaMode_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 80 + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.add(s); + break; + } // case 90 + case 98: + { + serverCaPool_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 98 + case 128: + { + serverCertificateRotationMode_ = input.readEnum(); + bitField0_ |= 0x00000800; + break; + } // case 128 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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.BoolValue ipv4Enabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + ipv4EnabledBuilder_; + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + * + * @return Whether the ipv4Enabled field is set. + */ + public boolean hasIpv4Enabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + * + * @return The ipv4Enabled. + */ + public com.google.protobuf.BoolValue getIpv4Enabled() { + if (ipv4EnabledBuilder_ == null) { + return ipv4Enabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : ipv4Enabled_; + } else { + return ipv4EnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + public Builder setIpv4Enabled(com.google.protobuf.BoolValue value) { + if (ipv4EnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ipv4Enabled_ = value; + } else { + ipv4EnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + public Builder setIpv4Enabled(com.google.protobuf.BoolValue.Builder builderForValue) { + if (ipv4EnabledBuilder_ == null) { + ipv4Enabled_ = builderForValue.build(); + } else { + ipv4EnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + public Builder mergeIpv4Enabled(com.google.protobuf.BoolValue value) { + if (ipv4EnabledBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && ipv4Enabled_ != null + && ipv4Enabled_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getIpv4EnabledBuilder().mergeFrom(value); + } else { + ipv4Enabled_ = value; + } + } else { + ipv4EnabledBuilder_.mergeFrom(value); + } + if (ipv4Enabled_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + public Builder clearIpv4Enabled() { + bitField0_ = (bitField0_ & ~0x00000001); + ipv4Enabled_ = null; + if (ipv4EnabledBuilder_ != null) { + ipv4EnabledBuilder_.dispose(); + ipv4EnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + public com.google.protobuf.BoolValue.Builder getIpv4EnabledBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetIpv4EnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + public com.google.protobuf.BoolValueOrBuilder getIpv4EnabledOrBuilder() { + if (ipv4EnabledBuilder_ != null) { + return ipv4EnabledBuilder_.getMessageOrBuilder(); + } else { + return ipv4Enabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : ipv4Enabled_; + } + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetIpv4EnabledFieldBuilder() { + if (ipv4EnabledBuilder_ == null) { + ipv4EnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getIpv4Enabled(), getParentForChildren(), isClean()); + ipv4Enabled_ = null; + } + return ipv4EnabledBuilder_; + } + + private java.lang.Object privateNetwork_ = ""; + + /** + * + * + *
+     * The resource link for the VPC network from which the Cloud SQL instance is
+     * accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`. This setting can
+     * be updated, but it cannot be removed after it is set.
+     * 
+ * + * string private_network = 2; + * + * @return The privateNetwork. + */ + public java.lang.String getPrivateNetwork() { + java.lang.Object ref = privateNetwork_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateNetwork_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The resource link for the VPC network from which the Cloud SQL instance is
+     * accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`. This setting can
+     * be updated, but it cannot be removed after it is set.
+     * 
+ * + * string private_network = 2; + * + * @return The bytes for privateNetwork. + */ + public com.google.protobuf.ByteString getPrivateNetworkBytes() { + java.lang.Object ref = privateNetwork_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The resource link for the VPC network from which the Cloud SQL instance is
+     * accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`. This setting can
+     * be updated, but it cannot be removed after it is set.
+     * 
+ * + * string private_network = 2; + * + * @param value The privateNetwork to set. + * @return This builder for chaining. + */ + public Builder setPrivateNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + privateNetwork_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource link for the VPC network from which the Cloud SQL instance is
+     * accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`. This setting can
+     * be updated, but it cannot be removed after it is set.
+     * 
+ * + * string private_network = 2; + * + * @return This builder for chaining. + */ + public Builder clearPrivateNetwork() { + privateNetwork_ = getDefaultInstance().getPrivateNetwork(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource link for the VPC network from which the Cloud SQL instance is
+     * accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`. This setting can
+     * be updated, but it cannot be removed after it is set.
+     * 
+ * + * string private_network = 2; + * + * @param value The bytes for privateNetwork to set. + * @return This builder for chaining. + */ + public Builder setPrivateNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + privateNetwork_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue requireSsl_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + requireSslBuilder_; + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + * + * @return Whether the requireSsl field is set. + */ + public boolean hasRequireSsl() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + * + * @return The requireSsl. + */ + public com.google.protobuf.BoolValue getRequireSsl() { + if (requireSslBuilder_ == null) { + return requireSsl_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : requireSsl_; + } else { + return requireSslBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + public Builder setRequireSsl(com.google.protobuf.BoolValue value) { + if (requireSslBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requireSsl_ = value; + } else { + requireSslBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + public Builder setRequireSsl(com.google.protobuf.BoolValue.Builder builderForValue) { + if (requireSslBuilder_ == null) { + requireSsl_ = builderForValue.build(); + } else { + requireSslBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + public Builder mergeRequireSsl(com.google.protobuf.BoolValue value) { + if (requireSslBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && requireSsl_ != null + && requireSsl_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getRequireSslBuilder().mergeFrom(value); + } else { + requireSsl_ = value; + } + } else { + requireSslBuilder_.mergeFrom(value); + } + if (requireSsl_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + public Builder clearRequireSsl() { + bitField0_ = (bitField0_ & ~0x00000004); + requireSsl_ = null; + if (requireSslBuilder_ != null) { + requireSslBuilder_.dispose(); + requireSslBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + public com.google.protobuf.BoolValue.Builder getRequireSslBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetRequireSslFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + public com.google.protobuf.BoolValueOrBuilder getRequireSslOrBuilder() { + if (requireSslBuilder_ != null) { + return requireSslBuilder_.getMessageOrBuilder(); + } else { + return requireSsl_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : requireSsl_; + } + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetRequireSslFieldBuilder() { + if (requireSslBuilder_ == null) { + requireSslBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getRequireSsl(), getParentForChildren(), isClean()); + requireSsl_ = null; + } + return requireSslBuilder_; + } + + private java.util.List authorizedNetworks_ = + java.util.Collections.emptyList(); + + private void ensureAuthorizedNetworksIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + authorizedNetworks_ = + new java.util.ArrayList(authorizedNetworks_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.AclEntry, + com.google.cloud.sql.v1.AclEntry.Builder, + com.google.cloud.sql.v1.AclEntryOrBuilder> + authorizedNetworksBuilder_; + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public java.util.List getAuthorizedNetworksList() { + if (authorizedNetworksBuilder_ == null) { + return java.util.Collections.unmodifiableList(authorizedNetworks_); + } else { + return authorizedNetworksBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public int getAuthorizedNetworksCount() { + if (authorizedNetworksBuilder_ == null) { + return authorizedNetworks_.size(); + } else { + return authorizedNetworksBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public com.google.cloud.sql.v1.AclEntry getAuthorizedNetworks(int index) { + if (authorizedNetworksBuilder_ == null) { + return authorizedNetworks_.get(index); + } else { + return authorizedNetworksBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public Builder setAuthorizedNetworks(int index, com.google.cloud.sql.v1.AclEntry value) { + if (authorizedNetworksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.set(index, value); + onChanged(); + } else { + authorizedNetworksBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public Builder setAuthorizedNetworks( + int index, com.google.cloud.sql.v1.AclEntry.Builder builderForValue) { + if (authorizedNetworksBuilder_ == null) { + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.set(index, builderForValue.build()); + onChanged(); + } else { + authorizedNetworksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public Builder addAuthorizedNetworks(com.google.cloud.sql.v1.AclEntry value) { + if (authorizedNetworksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.add(value); + onChanged(); + } else { + authorizedNetworksBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public Builder addAuthorizedNetworks(int index, com.google.cloud.sql.v1.AclEntry value) { + if (authorizedNetworksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.add(index, value); + onChanged(); + } else { + authorizedNetworksBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public Builder addAuthorizedNetworks(com.google.cloud.sql.v1.AclEntry.Builder builderForValue) { + if (authorizedNetworksBuilder_ == null) { + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.add(builderForValue.build()); + onChanged(); + } else { + authorizedNetworksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public Builder addAuthorizedNetworks( + int index, com.google.cloud.sql.v1.AclEntry.Builder builderForValue) { + if (authorizedNetworksBuilder_ == null) { + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.add(index, builderForValue.build()); + onChanged(); + } else { + authorizedNetworksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public Builder addAllAuthorizedNetworks( + java.lang.Iterable values) { + if (authorizedNetworksBuilder_ == null) { + ensureAuthorizedNetworksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, authorizedNetworks_); + onChanged(); + } else { + authorizedNetworksBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public Builder clearAuthorizedNetworks() { + if (authorizedNetworksBuilder_ == null) { + authorizedNetworks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + authorizedNetworksBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public Builder removeAuthorizedNetworks(int index) { + if (authorizedNetworksBuilder_ == null) { + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.remove(index); + onChanged(); + } else { + authorizedNetworksBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public com.google.cloud.sql.v1.AclEntry.Builder getAuthorizedNetworksBuilder(int index) { + return internalGetAuthorizedNetworksFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public com.google.cloud.sql.v1.AclEntryOrBuilder getAuthorizedNetworksOrBuilder(int index) { + if (authorizedNetworksBuilder_ == null) { + return authorizedNetworks_.get(index); + } else { + return authorizedNetworksBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public java.util.List + getAuthorizedNetworksOrBuilderList() { + if (authorizedNetworksBuilder_ != null) { + return authorizedNetworksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(authorizedNetworks_); + } + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public com.google.cloud.sql.v1.AclEntry.Builder addAuthorizedNetworksBuilder() { + return internalGetAuthorizedNetworksFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.AclEntry.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public com.google.cloud.sql.v1.AclEntry.Builder addAuthorizedNetworksBuilder(int index) { + return internalGetAuthorizedNetworksFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.AclEntry.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + public java.util.List + getAuthorizedNetworksBuilderList() { + return internalGetAuthorizedNetworksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.AclEntry, + com.google.cloud.sql.v1.AclEntry.Builder, + com.google.cloud.sql.v1.AclEntryOrBuilder> + internalGetAuthorizedNetworksFieldBuilder() { + if (authorizedNetworksBuilder_ == null) { + authorizedNetworksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.AclEntry, + com.google.cloud.sql.v1.AclEntry.Builder, + com.google.cloud.sql.v1.AclEntryOrBuilder>( + authorizedNetworks_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + authorizedNetworks_ = null; + } + return authorizedNetworksBuilder_; + } + + private java.lang.Object allocatedIpRange_ = ""; + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the instance ip
+     * will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+     * 
+ * + * string allocated_ip_range = 6; + * + * @return The allocatedIpRange. + */ + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the instance ip
+     * will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+     * 
+ * + * string allocated_ip_range = 6; + * + * @return The bytes for allocatedIpRange. + */ + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the instance ip
+     * will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+     * 
+ * + * string allocated_ip_range = 6; + * + * @param value The allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRange(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + allocatedIpRange_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the instance ip
+     * will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+     * 
+ * + * string allocated_ip_range = 6; + * + * @return This builder for chaining. + */ + public Builder clearAllocatedIpRange() { + allocatedIpRange_ = getDefaultInstance().getAllocatedIpRange(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the instance ip
+     * will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+     * 
+ * + * string allocated_ip_range = 6; + * + * @param value The bytes for allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRangeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + allocatedIpRange_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue enablePrivatePathForGoogleCloudServices_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + enablePrivatePathForGoogleCloudServicesBuilder_; + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + * + * @return Whether the enablePrivatePathForGoogleCloudServices field is set. + */ + public boolean hasEnablePrivatePathForGoogleCloudServices() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + * + * @return The enablePrivatePathForGoogleCloudServices. + */ + public com.google.protobuf.BoolValue getEnablePrivatePathForGoogleCloudServices() { + if (enablePrivatePathForGoogleCloudServicesBuilder_ == null) { + return enablePrivatePathForGoogleCloudServices_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePrivatePathForGoogleCloudServices_; + } else { + return enablePrivatePathForGoogleCloudServicesBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + public Builder setEnablePrivatePathForGoogleCloudServices(com.google.protobuf.BoolValue value) { + if (enablePrivatePathForGoogleCloudServicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enablePrivatePathForGoogleCloudServices_ = value; + } else { + enablePrivatePathForGoogleCloudServicesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + public Builder setEnablePrivatePathForGoogleCloudServices( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (enablePrivatePathForGoogleCloudServicesBuilder_ == null) { + enablePrivatePathForGoogleCloudServices_ = builderForValue.build(); + } else { + enablePrivatePathForGoogleCloudServicesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + public Builder mergeEnablePrivatePathForGoogleCloudServices( + com.google.protobuf.BoolValue value) { + if (enablePrivatePathForGoogleCloudServicesBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && enablePrivatePathForGoogleCloudServices_ != null + && enablePrivatePathForGoogleCloudServices_ + != com.google.protobuf.BoolValue.getDefaultInstance()) { + getEnablePrivatePathForGoogleCloudServicesBuilder().mergeFrom(value); + } else { + enablePrivatePathForGoogleCloudServices_ = value; + } + } else { + enablePrivatePathForGoogleCloudServicesBuilder_.mergeFrom(value); + } + if (enablePrivatePathForGoogleCloudServices_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + public Builder clearEnablePrivatePathForGoogleCloudServices() { + bitField0_ = (bitField0_ & ~0x00000020); + enablePrivatePathForGoogleCloudServices_ = null; + if (enablePrivatePathForGoogleCloudServicesBuilder_ != null) { + enablePrivatePathForGoogleCloudServicesBuilder_.dispose(); + enablePrivatePathForGoogleCloudServicesBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + public com.google.protobuf.BoolValue.Builder + getEnablePrivatePathForGoogleCloudServicesBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetEnablePrivatePathForGoogleCloudServicesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + public com.google.protobuf.BoolValueOrBuilder + getEnablePrivatePathForGoogleCloudServicesOrBuilder() { + if (enablePrivatePathForGoogleCloudServicesBuilder_ != null) { + return enablePrivatePathForGoogleCloudServicesBuilder_.getMessageOrBuilder(); + } else { + return enablePrivatePathForGoogleCloudServices_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePrivatePathForGoogleCloudServices_; + } + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetEnablePrivatePathForGoogleCloudServicesFieldBuilder() { + if (enablePrivatePathForGoogleCloudServicesBuilder_ == null) { + enablePrivatePathForGoogleCloudServicesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getEnablePrivatePathForGoogleCloudServices(), getParentForChildren(), isClean()); + enablePrivatePathForGoogleCloudServices_ = null; + } + return enablePrivatePathForGoogleCloudServicesBuilder_; + } + + private int sslMode_ = 0; + + /** + * + * + *
+     * Specify how SSL/TLS is enforced in database connections. If you must use
+     * the `require_ssl` flag for backward compatibility, then only the following
+     * value pairs are valid:
+     *
+     * For PostgreSQL and MySQL:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+     * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+     *
+     * For SQL Server:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+     *
+     * The value of `ssl_mode` has priority over the value of `require_ssl`.
+     *
+     * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+     * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+     * connections, while `require_ssl=false` means accept both non-SSL
+     * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+     * `ssl_mode` and accepts only SSL connections.
+     * 
+ * + * .google.cloud.sql.v1.IpConfiguration.SslMode ssl_mode = 8; + * + * @return The enum numeric value on the wire for sslMode. + */ + @java.lang.Override + public int getSslModeValue() { + return sslMode_; + } + + /** + * + * + *
+     * Specify how SSL/TLS is enforced in database connections. If you must use
+     * the `require_ssl` flag for backward compatibility, then only the following
+     * value pairs are valid:
+     *
+     * For PostgreSQL and MySQL:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+     * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+     *
+     * For SQL Server:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+     *
+     * The value of `ssl_mode` has priority over the value of `require_ssl`.
+     *
+     * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+     * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+     * connections, while `require_ssl=false` means accept both non-SSL
+     * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+     * `ssl_mode` and accepts only SSL connections.
+     * 
+ * + * .google.cloud.sql.v1.IpConfiguration.SslMode ssl_mode = 8; + * + * @param value The enum numeric value on the wire for sslMode to set. + * @return This builder for chaining. + */ + public Builder setSslModeValue(int value) { + sslMode_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specify how SSL/TLS is enforced in database connections. If you must use
+     * the `require_ssl` flag for backward compatibility, then only the following
+     * value pairs are valid:
+     *
+     * For PostgreSQL and MySQL:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+     * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+     *
+     * For SQL Server:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+     *
+     * The value of `ssl_mode` has priority over the value of `require_ssl`.
+     *
+     * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+     * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+     * connections, while `require_ssl=false` means accept both non-SSL
+     * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+     * `ssl_mode` and accepts only SSL connections.
+     * 
+ * + * .google.cloud.sql.v1.IpConfiguration.SslMode ssl_mode = 8; + * + * @return The sslMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpConfiguration.SslMode getSslMode() { + com.google.cloud.sql.v1.IpConfiguration.SslMode result = + com.google.cloud.sql.v1.IpConfiguration.SslMode.forNumber(sslMode_); + return result == null ? com.google.cloud.sql.v1.IpConfiguration.SslMode.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Specify how SSL/TLS is enforced in database connections. If you must use
+     * the `require_ssl` flag for backward compatibility, then only the following
+     * value pairs are valid:
+     *
+     * For PostgreSQL and MySQL:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+     * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+     *
+     * For SQL Server:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+     *
+     * The value of `ssl_mode` has priority over the value of `require_ssl`.
+     *
+     * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+     * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+     * connections, while `require_ssl=false` means accept both non-SSL
+     * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+     * `ssl_mode` and accepts only SSL connections.
+     * 
+ * + * .google.cloud.sql.v1.IpConfiguration.SslMode ssl_mode = 8; + * + * @param value The sslMode to set. + * @return This builder for chaining. + */ + public Builder setSslMode(com.google.cloud.sql.v1.IpConfiguration.SslMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + sslMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Specify how SSL/TLS is enforced in database connections. If you must use
+     * the `require_ssl` flag for backward compatibility, then only the following
+     * value pairs are valid:
+     *
+     * For PostgreSQL and MySQL:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+     * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+     *
+     * For SQL Server:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+     *
+     * The value of `ssl_mode` has priority over the value of `require_ssl`.
+     *
+     * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+     * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+     * connections, while `require_ssl=false` means accept both non-SSL
+     * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+     * `ssl_mode` and accepts only SSL connections.
+     * 
+ * + * .google.cloud.sql.v1.IpConfiguration.SslMode ssl_mode = 8; + * + * @return This builder for chaining. + */ + public Builder clearSslMode() { + bitField0_ = (bitField0_ & ~0x00000040); + sslMode_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.PscConfig pscConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PscConfig, + com.google.cloud.sql.v1.PscConfig.Builder, + com.google.cloud.sql.v1.PscConfigOrBuilder> + pscConfigBuilder_; + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + * + * @return Whether the pscConfig field is set. + */ + public boolean hasPscConfig() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + * + * @return The pscConfig. + */ + public com.google.cloud.sql.v1.PscConfig getPscConfig() { + if (pscConfigBuilder_ == null) { + return pscConfig_ == null + ? com.google.cloud.sql.v1.PscConfig.getDefaultInstance() + : pscConfig_; + } else { + return pscConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + */ + public Builder setPscConfig(com.google.cloud.sql.v1.PscConfig value) { + if (pscConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pscConfig_ = value; + } else { + pscConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + */ + public Builder setPscConfig(com.google.cloud.sql.v1.PscConfig.Builder builderForValue) { + if (pscConfigBuilder_ == null) { + pscConfig_ = builderForValue.build(); + } else { + pscConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + */ + public Builder mergePscConfig(com.google.cloud.sql.v1.PscConfig value) { + if (pscConfigBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && pscConfig_ != null + && pscConfig_ != com.google.cloud.sql.v1.PscConfig.getDefaultInstance()) { + getPscConfigBuilder().mergeFrom(value); + } else { + pscConfig_ = value; + } + } else { + pscConfigBuilder_.mergeFrom(value); + } + if (pscConfig_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + */ + public Builder clearPscConfig() { + bitField0_ = (bitField0_ & ~0x00000080); + pscConfig_ = null; + if (pscConfigBuilder_ != null) { + pscConfigBuilder_.dispose(); + pscConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + */ + public com.google.cloud.sql.v1.PscConfig.Builder getPscConfigBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetPscConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + */ + public com.google.cloud.sql.v1.PscConfigOrBuilder getPscConfigOrBuilder() { + if (pscConfigBuilder_ != null) { + return pscConfigBuilder_.getMessageOrBuilder(); + } else { + return pscConfig_ == null + ? com.google.cloud.sql.v1.PscConfig.getDefaultInstance() + : pscConfig_; + } + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PscConfig, + com.google.cloud.sql.v1.PscConfig.Builder, + com.google.cloud.sql.v1.PscConfigOrBuilder> + internalGetPscConfigFieldBuilder() { + if (pscConfigBuilder_ == null) { + pscConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PscConfig, + com.google.cloud.sql.v1.PscConfig.Builder, + com.google.cloud.sql.v1.PscConfigOrBuilder>( + getPscConfig(), getParentForChildren(), isClean()); + pscConfig_ = null; + } + return pscConfigBuilder_; + } + + private int serverCaMode_ = 0; + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * optional .google.cloud.sql.v1.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return Whether the serverCaMode field is set. + */ + @java.lang.Override + public boolean hasServerCaMode() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * optional .google.cloud.sql.v1.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return The enum numeric value on the wire for serverCaMode. + */ + @java.lang.Override + public int getServerCaModeValue() { + return serverCaMode_; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * optional .google.cloud.sql.v1.IpConfiguration.CaMode server_ca_mode = 10; + * + * @param value The enum numeric value on the wire for serverCaMode to set. + * @return This builder for chaining. + */ + public Builder setServerCaModeValue(int value) { + serverCaMode_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * optional .google.cloud.sql.v1.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return The serverCaMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpConfiguration.CaMode getServerCaMode() { + com.google.cloud.sql.v1.IpConfiguration.CaMode result = + com.google.cloud.sql.v1.IpConfiguration.CaMode.forNumber(serverCaMode_); + return result == null ? com.google.cloud.sql.v1.IpConfiguration.CaMode.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * optional .google.cloud.sql.v1.IpConfiguration.CaMode server_ca_mode = 10; + * + * @param value The serverCaMode to set. + * @return This builder for chaining. + */ + public Builder setServerCaMode(com.google.cloud.sql.v1.IpConfiguration.CaMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + serverCaMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * optional .google.cloud.sql.v1.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return This builder for chaining. + */ + public Builder clearServerCaMode() { + bitField0_ = (bitField0_ & ~0x00000100); + serverCaMode_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList customSubjectAlternativeNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureCustomSubjectAlternativeNamesIsMutable() { + if (!customSubjectAlternativeNames_.isModifiable()) { + customSubjectAlternativeNames_ = + new com.google.protobuf.LazyStringArrayList(customSubjectAlternativeNames_); + } + bitField0_ |= 0x00000200; + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the customSubjectAlternativeNames. + */ + public com.google.protobuf.ProtocolStringList getCustomSubjectAlternativeNamesList() { + customSubjectAlternativeNames_.makeImmutable(); + return customSubjectAlternativeNames_; + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of customSubjectAlternativeNames. + */ + public int getCustomSubjectAlternativeNamesCount() { + return customSubjectAlternativeNames_.size(); + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The customSubjectAlternativeNames at the given index. + */ + public java.lang.String getCustomSubjectAlternativeNames(int index) { + return customSubjectAlternativeNames_.get(index); + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the customSubjectAlternativeNames at the given index. + */ + public com.google.protobuf.ByteString getCustomSubjectAlternativeNamesBytes(int index) { + return customSubjectAlternativeNames_.getByteString(index); + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The customSubjectAlternativeNames to set. + * @return This builder for chaining. + */ + public Builder setCustomSubjectAlternativeNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.set(index, value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The customSubjectAlternativeNames to add. + * @return This builder for chaining. + */ + public Builder addCustomSubjectAlternativeNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.add(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The customSubjectAlternativeNames to add. + * @return This builder for chaining. + */ + public Builder addAllCustomSubjectAlternativeNames( + java.lang.Iterable values) { + ensureCustomSubjectAlternativeNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, customSubjectAlternativeNames_); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearCustomSubjectAlternativeNames() { + customSubjectAlternativeNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes of the customSubjectAlternativeNames to add. + * @return This builder for chaining. + */ + public Builder addCustomSubjectAlternativeNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.add(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object serverCaPool_ = ""; + + /** + * + * + *
+     * Optional. The resource name of the server CA pool for an instance with
+     * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+     * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+     * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the serverCaPool field is set. + */ + public boolean hasServerCaPool() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Optional. The resource name of the server CA pool for an instance with
+     * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+     * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+     * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The serverCaPool. + */ + public java.lang.String getServerCaPool() { + java.lang.Object ref = serverCaPool_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serverCaPool_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The resource name of the server CA pool for an instance with
+     * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+     * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+     * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for serverCaPool. + */ + public com.google.protobuf.ByteString getServerCaPoolBytes() { + java.lang.Object ref = serverCaPool_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverCaPool_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The resource name of the server CA pool for an instance with
+     * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+     * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+     * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The serverCaPool to set. + * @return This builder for chaining. + */ + public Builder setServerCaPool(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serverCaPool_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource name of the server CA pool for an instance with
+     * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+     * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+     * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearServerCaPool() { + serverCaPool_ = getDefaultInstance().getServerCaPool(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource name of the server CA pool for an instance with
+     * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+     * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+     * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for serverCaPool to set. + * @return This builder for chaining. + */ + public Builder setServerCaPoolBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serverCaPool_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private int serverCertificateRotationMode_ = 0; + + /** + * + * + *
+     * Optional. Controls the automatic server certificate rotation feature. This
+     * feature is disabled by default. When enabled, the server certificate will
+     * be automatically rotated during Cloud SQL scheduled maintenance or
+     * self-service maintenance updates up to six months before it expires. This
+     * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+     * or CUSTOMER_MANAGED_CAS_CA.
+     * 
+ * + * + * optional .google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the serverCertificateRotationMode field is set. + */ + @java.lang.Override + public boolean hasServerCertificateRotationMode() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Optional. Controls the automatic server certificate rotation feature. This
+     * feature is disabled by default. When enabled, the server certificate will
+     * be automatically rotated during Cloud SQL scheduled maintenance or
+     * self-service maintenance updates up to six months before it expires. This
+     * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+     * or CUSTOMER_MANAGED_CAS_CA.
+     * 
+ * + * + * optional .google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for serverCertificateRotationMode. + */ + @java.lang.Override + public int getServerCertificateRotationModeValue() { + return serverCertificateRotationMode_; + } + + /** + * + * + *
+     * Optional. Controls the automatic server certificate rotation feature. This
+     * feature is disabled by default. When enabled, the server certificate will
+     * be automatically rotated during Cloud SQL scheduled maintenance or
+     * self-service maintenance updates up to six months before it expires. This
+     * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+     * or CUSTOMER_MANAGED_CAS_CA.
+     * 
+ * + * + * optional .google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for serverCertificateRotationMode to set. + * @return This builder for chaining. + */ + public Builder setServerCertificateRotationModeValue(int value) { + serverCertificateRotationMode_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Controls the automatic server certificate rotation feature. This
+     * feature is disabled by default. When enabled, the server certificate will
+     * be automatically rotated during Cloud SQL scheduled maintenance or
+     * self-service maintenance updates up to six months before it expires. This
+     * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+     * or CUSTOMER_MANAGED_CAS_CA.
+     * 
+ * + * + * optional .google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The serverCertificateRotationMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode + getServerCertificateRotationMode() { + com.google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode result = + com.google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode.forNumber( + serverCertificateRotationMode_); + return result == null + ? com.google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. Controls the automatic server certificate rotation feature. This
+     * feature is disabled by default. When enabled, the server certificate will
+     * be automatically rotated during Cloud SQL scheduled maintenance or
+     * self-service maintenance updates up to six months before it expires. This
+     * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+     * or CUSTOMER_MANAGED_CAS_CA.
+     * 
+ * + * + * optional .google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The serverCertificateRotationMode to set. + * @return This builder for chaining. + */ + public Builder setServerCertificateRotationMode( + com.google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000800; + serverCertificateRotationMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Controls the automatic server certificate rotation feature. This
+     * feature is disabled by default. When enabled, the server certificate will
+     * be automatically rotated during Cloud SQL scheduled maintenance or
+     * self-service maintenance updates up to six months before it expires. This
+     * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+     * or CUSTOMER_MANAGED_CAS_CA.
+     * 
+ * + * + * optional .google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearServerCertificateRotationMode() { + bitField0_ = (bitField0_ & ~0x00000800); + serverCertificateRotationMode_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.IpConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.IpConfiguration) + private static final com.google.cloud.sql.v1.IpConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.IpConfiguration(); + } + + public static com.google.cloud.sql.v1.IpConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IpConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.IpConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/IpConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/IpConfigurationOrBuilder.java new file mode 100644 index 000000000000..6dba099ca5a4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/IpConfigurationOrBuilder.java @@ -0,0 +1,612 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface IpConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.IpConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether the instance is assigned a public IP address or not.
+   * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + * + * @return Whether the ipv4Enabled field is set. + */ + boolean hasIpv4Enabled(); + + /** + * + * + *
+   * Whether the instance is assigned a public IP address or not.
+   * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + * + * @return The ipv4Enabled. + */ + com.google.protobuf.BoolValue getIpv4Enabled(); + + /** + * + * + *
+   * Whether the instance is assigned a public IP address or not.
+   * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + com.google.protobuf.BoolValueOrBuilder getIpv4EnabledOrBuilder(); + + /** + * + * + *
+   * The resource link for the VPC network from which the Cloud SQL instance is
+   * accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`. This setting can
+   * be updated, but it cannot be removed after it is set.
+   * 
+ * + * string private_network = 2; + * + * @return The privateNetwork. + */ + java.lang.String getPrivateNetwork(); + + /** + * + * + *
+   * The resource link for the VPC network from which the Cloud SQL instance is
+   * accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`. This setting can
+   * be updated, but it cannot be removed after it is set.
+   * 
+ * + * string private_network = 2; + * + * @return The bytes for privateNetwork. + */ + com.google.protobuf.ByteString getPrivateNetworkBytes(); + + /** + * + * + *
+   * Use `ssl_mode` instead.
+   *
+   * Whether SSL/TLS connections over IP are enforced.
+   * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+   * For SSL/TLS connections, the client certificate won't be verified. If
+   * set to true, then only allow connections encrypted with SSL/TLS and with
+   * valid client certificates. If you want to enforce SSL/TLS without enforcing
+   * the requirement for valid client certificates, then use the `ssl_mode` flag
+   * instead of the `require_ssl` flag.
+   * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + * + * @return Whether the requireSsl field is set. + */ + boolean hasRequireSsl(); + + /** + * + * + *
+   * Use `ssl_mode` instead.
+   *
+   * Whether SSL/TLS connections over IP are enforced.
+   * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+   * For SSL/TLS connections, the client certificate won't be verified. If
+   * set to true, then only allow connections encrypted with SSL/TLS and with
+   * valid client certificates. If you want to enforce SSL/TLS without enforcing
+   * the requirement for valid client certificates, then use the `ssl_mode` flag
+   * instead of the `require_ssl` flag.
+   * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + * + * @return The requireSsl. + */ + com.google.protobuf.BoolValue getRequireSsl(); + + /** + * + * + *
+   * Use `ssl_mode` instead.
+   *
+   * Whether SSL/TLS connections over IP are enforced.
+   * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+   * For SSL/TLS connections, the client certificate won't be verified. If
+   * set to true, then only allow connections encrypted with SSL/TLS and with
+   * valid client certificates. If you want to enforce SSL/TLS without enforcing
+   * the requirement for valid client certificates, then use the `ssl_mode` flag
+   * instead of the `require_ssl` flag.
+   * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + com.google.protobuf.BoolValueOrBuilder getRequireSslOrBuilder(); + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + java.util.List getAuthorizedNetworksList(); + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + com.google.cloud.sql.v1.AclEntry getAuthorizedNetworks(int index); + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + int getAuthorizedNetworksCount(); + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + java.util.List + getAuthorizedNetworksOrBuilderList(); + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1.AclEntry authorized_networks = 4; + */ + com.google.cloud.sql.v1.AclEntryOrBuilder getAuthorizedNetworksOrBuilder(int index); + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the instance ip
+   * will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The allocatedIpRange. + */ + java.lang.String getAllocatedIpRange(); + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the instance ip
+   * will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The bytes for allocatedIpRange. + */ + com.google.protobuf.ByteString getAllocatedIpRangeBytes(); + + /** + * + * + *
+   * Controls connectivity to private IP instances from Google services,
+   * such as BigQuery.
+   * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + * + * @return Whether the enablePrivatePathForGoogleCloudServices field is set. + */ + boolean hasEnablePrivatePathForGoogleCloudServices(); + + /** + * + * + *
+   * Controls connectivity to private IP instances from Google services,
+   * such as BigQuery.
+   * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + * + * @return The enablePrivatePathForGoogleCloudServices. + */ + com.google.protobuf.BoolValue getEnablePrivatePathForGoogleCloudServices(); + + /** + * + * + *
+   * Controls connectivity to private IP instances from Google services,
+   * such as BigQuery.
+   * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + com.google.protobuf.BoolValueOrBuilder getEnablePrivatePathForGoogleCloudServicesOrBuilder(); + + /** + * + * + *
+   * Specify how SSL/TLS is enforced in database connections. If you must use
+   * the `require_ssl` flag for backward compatibility, then only the following
+   * value pairs are valid:
+   *
+   * For PostgreSQL and MySQL:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+   * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+   *
+   * For SQL Server:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+   *
+   * The value of `ssl_mode` has priority over the value of `require_ssl`.
+   *
+   * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+   * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+   * connections, while `require_ssl=false` means accept both non-SSL
+   * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+   * `ssl_mode` and accepts only SSL connections.
+   * 
+ * + * .google.cloud.sql.v1.IpConfiguration.SslMode ssl_mode = 8; + * + * @return The enum numeric value on the wire for sslMode. + */ + int getSslModeValue(); + + /** + * + * + *
+   * Specify how SSL/TLS is enforced in database connections. If you must use
+   * the `require_ssl` flag for backward compatibility, then only the following
+   * value pairs are valid:
+   *
+   * For PostgreSQL and MySQL:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+   * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+   *
+   * For SQL Server:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+   *
+   * The value of `ssl_mode` has priority over the value of `require_ssl`.
+   *
+   * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+   * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+   * connections, while `require_ssl=false` means accept both non-SSL
+   * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+   * `ssl_mode` and accepts only SSL connections.
+   * 
+ * + * .google.cloud.sql.v1.IpConfiguration.SslMode ssl_mode = 8; + * + * @return The sslMode. + */ + com.google.cloud.sql.v1.IpConfiguration.SslMode getSslMode(); + + /** + * + * + *
+   * PSC settings for this instance.
+   * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + * + * @return Whether the pscConfig field is set. + */ + boolean hasPscConfig(); + + /** + * + * + *
+   * PSC settings for this instance.
+   * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + * + * @return The pscConfig. + */ + com.google.cloud.sql.v1.PscConfig getPscConfig(); + + /** + * + * + *
+   * PSC settings for this instance.
+   * 
+ * + * optional .google.cloud.sql.v1.PscConfig psc_config = 9; + */ + com.google.cloud.sql.v1.PscConfigOrBuilder getPscConfigOrBuilder(); + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * optional .google.cloud.sql.v1.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return Whether the serverCaMode field is set. + */ + boolean hasServerCaMode(); + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * optional .google.cloud.sql.v1.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return The enum numeric value on the wire for serverCaMode. + */ + int getServerCaModeValue(); + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * optional .google.cloud.sql.v1.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return The serverCaMode. + */ + com.google.cloud.sql.v1.IpConfiguration.CaMode getServerCaMode(); + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the customSubjectAlternativeNames. + */ + java.util.List getCustomSubjectAlternativeNamesList(); + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of customSubjectAlternativeNames. + */ + int getCustomSubjectAlternativeNamesCount(); + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The customSubjectAlternativeNames at the given index. + */ + java.lang.String getCustomSubjectAlternativeNames(int index); + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the customSubjectAlternativeNames at the given index. + */ + com.google.protobuf.ByteString getCustomSubjectAlternativeNamesBytes(int index); + + /** + * + * + *
+   * Optional. The resource name of the server CA pool for an instance with
+   * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+   * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+   * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the serverCaPool field is set. + */ + boolean hasServerCaPool(); + + /** + * + * + *
+   * Optional. The resource name of the server CA pool for an instance with
+   * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+   * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+   * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The serverCaPool. + */ + java.lang.String getServerCaPool(); + + /** + * + * + *
+   * Optional. The resource name of the server CA pool for an instance with
+   * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+   * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+   * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for serverCaPool. + */ + com.google.protobuf.ByteString getServerCaPoolBytes(); + + /** + * + * + *
+   * Optional. Controls the automatic server certificate rotation feature. This
+   * feature is disabled by default. When enabled, the server certificate will
+   * be automatically rotated during Cloud SQL scheduled maintenance or
+   * self-service maintenance updates up to six months before it expires. This
+   * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+   * or CUSTOMER_MANAGED_CAS_CA.
+   * 
+ * + * + * optional .google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the serverCertificateRotationMode field is set. + */ + boolean hasServerCertificateRotationMode(); + + /** + * + * + *
+   * Optional. Controls the automatic server certificate rotation feature. This
+   * feature is disabled by default. When enabled, the server certificate will
+   * be automatically rotated during Cloud SQL scheduled maintenance or
+   * self-service maintenance updates up to six months before it expires. This
+   * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+   * or CUSTOMER_MANAGED_CAS_CA.
+   * 
+ * + * + * optional .google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for serverCertificateRotationMode. + */ + int getServerCertificateRotationModeValue(); + + /** + * + * + *
+   * Optional. Controls the automatic server certificate rotation feature. This
+   * feature is disabled by default. When enabled, the server certificate will
+   * be automatically rotated during Cloud SQL scheduled maintenance or
+   * self-service maintenance updates up to six months before it expires. This
+   * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+   * or CUSTOMER_MANAGED_CAS_CA.
+   * 
+ * + * + * optional .google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The serverCertificateRotationMode. + */ + com.google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode + getServerCertificateRotationMode(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/IpMapping.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/IpMapping.java new file mode 100644 index 000000000000..2f15ebdf7dd0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/IpMapping.java @@ -0,0 +1,1099 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance IP mapping
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.IpMapping} + */ +@com.google.protobuf.Generated +public final class IpMapping extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.IpMapping) + IpMappingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "IpMapping"); + } + + // Use IpMapping.newBuilder() to construct. + private IpMapping(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private IpMapping() { + type_ = 0; + ipAddress_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_IpMapping_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_IpMapping_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.IpMapping.class, + com.google.cloud.sql.v1.IpMapping.Builder.class); + } + + private int bitField0_; + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + + /** + * + * + *
+   * The type of this IP address. A `PRIMARY` address is a public address that
+   * can accept incoming connections. A `PRIVATE` address is a private address
+   * that can accept incoming connections. An `OUTGOING` address is the source
+   * address of connections originating from the instance, if supported.
+   * 
+ * + * .google.cloud.sql.v1.SqlIpAddressType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * The type of this IP address. A `PRIMARY` address is a public address that
+   * can accept incoming connections. A `PRIVATE` address is a private address
+   * that can accept incoming connections. An `OUTGOING` address is the source
+   * address of connections originating from the instance, if supported.
+   * 
+ * + * .google.cloud.sql.v1.SqlIpAddressType type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlIpAddressType getType() { + com.google.cloud.sql.v1.SqlIpAddressType result = + com.google.cloud.sql.v1.SqlIpAddressType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1.SqlIpAddressType.UNRECOGNIZED : result; + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipAddress_ = ""; + + /** + * + * + *
+   * The IP address assigned.
+   * 
+ * + * string ip_address = 2; + * + * @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; + } + } + + /** + * + * + *
+   * The IP address assigned.
+   * 
+ * + * string ip_address = 2; + * + * @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 TIME_TO_RETIRE_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp timeToRetire_; + + /** + * + * + *
+   * The due time for this IP to be retired in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`. This field is only available when
+   * the IP is scheduled to be retired.
+   * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + * + * @return Whether the timeToRetire field is set. + */ + @java.lang.Override + public boolean hasTimeToRetire() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The due time for this IP to be retired in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`. This field is only available when
+   * the IP is scheduled to be retired.
+   * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + * + * @return The timeToRetire. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimeToRetire() { + return timeToRetire_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : timeToRetire_; + } + + /** + * + * + *
+   * The due time for this IP to be retired in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`. This field is only available when
+   * the IP is scheduled to be retired.
+   * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getTimeToRetireOrBuilder() { + return timeToRetire_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : timeToRetire_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (type_ + != com.google.cloud.sql.v1.SqlIpAddressType.SQL_IP_ADDRESS_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(ipAddress_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, ipAddress_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getTimeToRetire()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.cloud.sql.v1.SqlIpAddressType.SQL_IP_ADDRESS_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(ipAddress_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, ipAddress_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTimeToRetire()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.IpMapping)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.IpMapping other = (com.google.cloud.sql.v1.IpMapping) obj; + + if (type_ != other.type_) return false; + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (hasTimeToRetire() != other.hasTimeToRetire()) return false; + if (hasTimeToRetire()) { + if (!getTimeToRetire().equals(other.getTimeToRetire())) return false; + } + if (!getUnknownFields().equals(other.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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + if (hasTimeToRetire()) { + hash = (37 * hash) + TIME_TO_RETIRE_FIELD_NUMBER; + hash = (53 * hash) + getTimeToRetire().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.IpMapping parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.IpMapping parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.IpMapping parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.IpMapping parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.IpMapping parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.IpMapping parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.IpMapping parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.IpMapping parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.IpMapping parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.IpMapping parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.IpMapping parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.IpMapping parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.IpMapping prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance IP mapping
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.IpMapping} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.IpMapping) + com.google.cloud.sql.v1.IpMappingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_IpMapping_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_IpMapping_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.IpMapping.class, + com.google.cloud.sql.v1.IpMapping.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.IpMapping.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTimeToRetireFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + ipAddress_ = ""; + timeToRetire_ = null; + if (timeToRetireBuilder_ != null) { + timeToRetireBuilder_.dispose(); + timeToRetireBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_IpMapping_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.IpMapping getDefaultInstanceForType() { + return com.google.cloud.sql.v1.IpMapping.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.IpMapping build() { + com.google.cloud.sql.v1.IpMapping result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.IpMapping buildPartial() { + com.google.cloud.sql.v1.IpMapping result = new com.google.cloud.sql.v1.IpMapping(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.IpMapping result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ipAddress_ = ipAddress_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.timeToRetire_ = + timeToRetireBuilder_ == null ? timeToRetire_ : timeToRetireBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.IpMapping) { + return mergeFrom((com.google.cloud.sql.v1.IpMapping) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.IpMapping other) { + if (other == com.google.cloud.sql.v1.IpMapping.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasTimeToRetire()) { + mergeTimeToRetire(other.getTimeToRetire()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + ipAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetTimeToRetireFieldBuilder().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 type_ = 0; + + /** + * + * + *
+     * The type of this IP address. A `PRIMARY` address is a public address that
+     * can accept incoming connections. A `PRIVATE` address is a private address
+     * that can accept incoming connections. An `OUTGOING` address is the source
+     * address of connections originating from the instance, if supported.
+     * 
+ * + * .google.cloud.sql.v1.SqlIpAddressType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * The type of this IP address. A `PRIMARY` address is a public address that
+     * can accept incoming connections. A `PRIVATE` address is a private address
+     * that can accept incoming connections. An `OUTGOING` address is the source
+     * address of connections originating from the instance, if supported.
+     * 
+ * + * .google.cloud.sql.v1.SqlIpAddressType type = 1; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of this IP address. A `PRIMARY` address is a public address that
+     * can accept incoming connections. A `PRIVATE` address is a private address
+     * that can accept incoming connections. An `OUTGOING` address is the source
+     * address of connections originating from the instance, if supported.
+     * 
+ * + * .google.cloud.sql.v1.SqlIpAddressType type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlIpAddressType getType() { + com.google.cloud.sql.v1.SqlIpAddressType result = + com.google.cloud.sql.v1.SqlIpAddressType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1.SqlIpAddressType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The type of this IP address. A `PRIMARY` address is a public address that
+     * can accept incoming connections. A `PRIVATE` address is a private address
+     * that can accept incoming connections. An `OUTGOING` address is the source
+     * address of connections originating from the instance, if supported.
+     * 
+ * + * .google.cloud.sql.v1.SqlIpAddressType type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.sql.v1.SqlIpAddressType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of this IP address. A `PRIMARY` address is a public address that
+     * can accept incoming connections. A `PRIVATE` address is a private address
+     * that can accept incoming connections. An `OUTGOING` address is the source
+     * address of connections originating from the instance, if supported.
+     * 
+ * + * .google.cloud.sql.v1.SqlIpAddressType type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + + /** + * + * + *
+     * The IP address assigned.
+     * 
+ * + * string ip_address = 2; + * + * @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; + } + } + + /** + * + * + *
+     * The IP address assigned.
+     * 
+ * + * string ip_address = 2; + * + * @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; + } + } + + /** + * + * + *
+     * The IP address assigned.
+     * 
+ * + * string ip_address = 2; + * + * @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; + } + + /** + * + * + *
+     * The IP address assigned.
+     * 
+ * + * string ip_address = 2; + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + ipAddress_ = getDefaultInstance().getIpAddress(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The IP address assigned.
+     * 
+ * + * string ip_address = 2; + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ipAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp timeToRetire_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + timeToRetireBuilder_; + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + * + * @return Whether the timeToRetire field is set. + */ + public boolean hasTimeToRetire() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + * + * @return The timeToRetire. + */ + public com.google.protobuf.Timestamp getTimeToRetire() { + if (timeToRetireBuilder_ == null) { + return timeToRetire_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : timeToRetire_; + } else { + return timeToRetireBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + public Builder setTimeToRetire(com.google.protobuf.Timestamp value) { + if (timeToRetireBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeToRetire_ = value; + } else { + timeToRetireBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + public Builder setTimeToRetire(com.google.protobuf.Timestamp.Builder builderForValue) { + if (timeToRetireBuilder_ == null) { + timeToRetire_ = builderForValue.build(); + } else { + timeToRetireBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + public Builder mergeTimeToRetire(com.google.protobuf.Timestamp value) { + if (timeToRetireBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && timeToRetire_ != null + && timeToRetire_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getTimeToRetireBuilder().mergeFrom(value); + } else { + timeToRetire_ = value; + } + } else { + timeToRetireBuilder_.mergeFrom(value); + } + if (timeToRetire_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + public Builder clearTimeToRetire() { + bitField0_ = (bitField0_ & ~0x00000004); + timeToRetire_ = null; + if (timeToRetireBuilder_ != null) { + timeToRetireBuilder_.dispose(); + timeToRetireBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + public com.google.protobuf.Timestamp.Builder getTimeToRetireBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetTimeToRetireFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + public com.google.protobuf.TimestampOrBuilder getTimeToRetireOrBuilder() { + if (timeToRetireBuilder_ != null) { + return timeToRetireBuilder_.getMessageOrBuilder(); + } else { + return timeToRetire_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : timeToRetire_; + } + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetTimeToRetireFieldBuilder() { + if (timeToRetireBuilder_ == null) { + timeToRetireBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getTimeToRetire(), getParentForChildren(), isClean()); + timeToRetire_ = null; + } + return timeToRetireBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.IpMapping) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.IpMapping) + private static final com.google.cloud.sql.v1.IpMapping DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.IpMapping(); + } + + public static com.google.cloud.sql.v1.IpMapping getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IpMapping parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.IpMapping getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/IpMappingOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/IpMappingOrBuilder.java new file mode 100644 index 000000000000..1134754ced5f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/IpMappingOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface IpMappingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.IpMapping) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The type of this IP address. A `PRIMARY` address is a public address that
+   * can accept incoming connections. A `PRIVATE` address is a private address
+   * that can accept incoming connections. An `OUTGOING` address is the source
+   * address of connections originating from the instance, if supported.
+   * 
+ * + * .google.cloud.sql.v1.SqlIpAddressType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * The type of this IP address. A `PRIMARY` address is a public address that
+   * can accept incoming connections. A `PRIVATE` address is a private address
+   * that can accept incoming connections. An `OUTGOING` address is the source
+   * address of connections originating from the instance, if supported.
+   * 
+ * + * .google.cloud.sql.v1.SqlIpAddressType type = 1; + * + * @return The type. + */ + com.google.cloud.sql.v1.SqlIpAddressType getType(); + + /** + * + * + *
+   * The IP address assigned.
+   * 
+ * + * string ip_address = 2; + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + + /** + * + * + *
+   * The IP address assigned.
+   * 
+ * + * string ip_address = 2; + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * The due time for this IP to be retired in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`. This field is only available when
+   * the IP is scheduled to be retired.
+   * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + * + * @return Whether the timeToRetire field is set. + */ + boolean hasTimeToRetire(); + + /** + * + * + *
+   * The due time for this IP to be retired in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`. This field is only available when
+   * the IP is scheduled to be retired.
+   * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + * + * @return The timeToRetire. + */ + com.google.protobuf.Timestamp getTimeToRetire(); + + /** + * + * + *
+   * The due time for this IP to be retired in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`. This field is only available when
+   * the IP is scheduled to be retired.
+   * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + com.google.protobuf.TimestampOrBuilder getTimeToRetireOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ListBackupsRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ListBackupsRequest.java new file mode 100644 index 000000000000..6d467ef7002c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ListBackupsRequest.java @@ -0,0 +1,1156 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The request payload to list the backups.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ListBackupsRequest} + */ +@com.google.protobuf.Generated +public final class ListBackupsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ListBackupsRequest) + ListBackupsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListBackupsRequest"); + } + + // Use ListBackupsRequest.newBuilder() to construct. + private ListBackupsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListBackupsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ListBackupsRequest.class, + com.google.cloud.sql.v1.ListBackupsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The parent that owns this collection of backups.
+   * Format: projects/{project}
+   * 
+ * + * + * 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 that owns this collection of backups.
+   * Format: projects/{project}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
+   * The maximum number of backups to return per response. The service might
+   * return fewer backups than this value. If a value for this parameter isn't
+   * specified, then, at most, 500 backups are returned. The maximum value is
+   * 2,000. Any values that you set, which are greater than 2,000, are changed
+   * to 2,000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * A page token, received from a previous `ListBackups` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListBackups` must match
+   * the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A page token, received from a previous `ListBackups` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListBackups` must match
+   * the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Multiple filter queries are separated by spaces. For example,
+   * 'instance:abc AND type:FINAL, 'location:us',
+   * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+   * type, instance, backupInterval.startTime (creation time), or location.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Multiple filter queries are separated by spaces. For example,
+   * 'instance:abc AND type:FINAL, 'location:us',
+   * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+   * type, instance, backupInterval.startTime (creation time), or location.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, filter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, filter_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ListBackupsRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ListBackupsRequest other = + (com.google.cloud.sql.v1.ListBackupsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getUnknownFields().equals(other.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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ListBackupsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ListBackupsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ListBackupsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ListBackupsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ListBackupsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ListBackupsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ListBackupsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ListBackupsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ListBackupsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ListBackupsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ListBackupsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ListBackupsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.ListBackupsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request payload to list the backups.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ListBackupsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ListBackupsRequest) + com.google.cloud.sql.v1.ListBackupsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ListBackupsRequest.class, + com.google.cloud.sql.v1.ListBackupsRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ListBackupsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ListBackupsRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ListBackupsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ListBackupsRequest build() { + com.google.cloud.sql.v1.ListBackupsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ListBackupsRequest buildPartial() { + com.google.cloud.sql.v1.ListBackupsRequest result = + new com.google.cloud.sql.v1.ListBackupsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ListBackupsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ListBackupsRequest) { + return mergeFrom((com.google.cloud.sql.v1.ListBackupsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ListBackupsRequest other) { + if (other == com.google.cloud.sql.v1.ListBackupsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 that owns this collection of backups.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 that owns this collection of backups.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 that owns this collection of backups.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 that owns this collection of backups.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 that owns this collection of backups.
+     * Format: projects/{project}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * The maximum number of backups to return per response. The service might
+     * return fewer backups than this value. If a value for this parameter isn't
+     * specified, then, at most, 500 backups are returned. The maximum value is
+     * 2,000. Any values that you set, which are greater than 2,000, are changed
+     * to 2,000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * The maximum number of backups to return per response. The service might
+     * return fewer backups than this value. If a value for this parameter isn't
+     * specified, then, at most, 500 backups are returned. The maximum value is
+     * 2,000. Any values that you set, which are greater than 2,000, are changed
+     * to 2,000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum number of backups to return per response. The service might
+     * return fewer backups than this value. If a value for this parameter isn't
+     * specified, then, at most, 500 backups are returned. The maximum value is
+     * 2,000. Any values that you set, which are greater than 2,000, are changed
+     * to 2,000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * A page token, received from a previous `ListBackups` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListBackups` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A page token, received from a previous `ListBackups` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListBackups` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A page token, received from a previous `ListBackups` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListBackups` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * A page token, received from a previous `ListBackups` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListBackups` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * A page token, received from a previous `ListBackups` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListBackups` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Multiple filter queries are separated by spaces. For example,
+     * 'instance:abc AND type:FINAL, 'location:us',
+     * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+     * type, instance, backupInterval.startTime (creation time), or location.
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Multiple filter queries are separated by spaces. For example,
+     * 'instance:abc AND type:FINAL, 'location:us',
+     * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+     * type, instance, backupInterval.startTime (creation time), or location.
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Multiple filter queries are separated by spaces. For example,
+     * 'instance:abc AND type:FINAL, 'location:us',
+     * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+     * type, instance, backupInterval.startTime (creation time), or location.
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Multiple filter queries are separated by spaces. For example,
+     * 'instance:abc AND type:FINAL, 'location:us',
+     * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+     * type, instance, backupInterval.startTime (creation time), or location.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Multiple filter queries are separated by spaces. For example,
+     * 'instance:abc AND type:FINAL, 'location:us',
+     * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+     * type, instance, backupInterval.startTime (creation time), or location.
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ListBackupsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ListBackupsRequest) + private static final com.google.cloud.sql.v1.ListBackupsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ListBackupsRequest(); + } + + public static com.google.cloud.sql.v1.ListBackupsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ListBackupsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ListBackupsRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ListBackupsRequestOrBuilder.java new file mode 100644 index 000000000000..929633bdfbf3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ListBackupsRequestOrBuilder.java @@ -0,0 +1,143 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ListBackupsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ListBackupsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent that owns this collection of backups.
+   * Format: projects/{project}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent that owns this collection of backups.
+   * Format: projects/{project}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of backups to return per response. The service might
+   * return fewer backups than this value. If a value for this parameter isn't
+   * specified, then, at most, 500 backups are returned. The maximum value is
+   * 2,000. Any values that you set, which are greater than 2,000, are changed
+   * to 2,000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListBackups` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListBackups` must match
+   * the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * A page token, received from a previous `ListBackups` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListBackups` must match
+   * the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Multiple filter queries are separated by spaces. For example,
+   * 'instance:abc AND type:FINAL, 'location:us',
+   * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+   * type, instance, backupInterval.startTime (creation time), or location.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Multiple filter queries are separated by spaces. For example,
+   * 'instance:abc AND type:FINAL, 'location:us',
+   * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+   * type, instance, backupInterval.startTime (creation time), or location.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ListBackupsResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ListBackupsResponse.java new file mode 100644 index 000000000000..680dd7d3a33a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ListBackupsResponse.java @@ -0,0 +1,1644 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The response payload containing a list of the backups.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ListBackupsResponse} + */ +@com.google.protobuf.Generated +public final class ListBackupsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ListBackupsResponse) + ListBackupsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListBackupsResponse"); + } + + // Use ListBackupsResponse.newBuilder() to construct. + private ListBackupsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListBackupsResponse() { + backups_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + warnings_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ListBackupsResponse.class, + com.google.cloud.sql.v1.ListBackupsResponse.Builder.class); + } + + public static final int BACKUPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List backups_; + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + @java.lang.Override + public java.util.List getBackupsList() { + return backups_; + } + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + @java.lang.Override + public java.util.List + getBackupsOrBuilderList() { + return backups_; + } + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + @java.lang.Override + public int getBackupsCount() { + return backups_.size(); + } + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.Backup getBackups(int index) { + return backups_.get(index); + } + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupOrBuilder getBackupsOrBuilder(int index) { + return backups_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, then there aren't 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, then there aren't 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 WARNINGS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List warnings_; + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + @java.lang.Override + public java.util.List getWarningsList() { + return warnings_; + } + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + @java.lang.Override + public java.util.List + getWarningsOrBuilderList() { + return warnings_; + } + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + @java.lang.Override + public int getWarningsCount() { + return warnings_.size(); + } + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ApiWarning getWarnings(int index) { + return warnings_.get(index); + } + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ApiWarningOrBuilder getWarningsOrBuilder(int index) { + return warnings_.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 < backups_.size(); i++) { + output.writeMessage(1, backups_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < warnings_.size(); i++) { + output.writeMessage(3, warnings_.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 < backups_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, backups_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + for (int i = 0; i < warnings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, warnings_.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.sql.v1.ListBackupsResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ListBackupsResponse other = + (com.google.cloud.sql.v1.ListBackupsResponse) obj; + + if (!getBackupsList().equals(other.getBackupsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getWarningsList().equals(other.getWarningsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBackupsCount() > 0) { + hash = (37 * hash) + BACKUPS_FIELD_NUMBER; + hash = (53 * hash) + getBackupsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getWarningsCount() > 0) { + hash = (37 * hash) + WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + getWarningsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ListBackupsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ListBackupsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ListBackupsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ListBackupsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ListBackupsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ListBackupsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ListBackupsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ListBackupsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ListBackupsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ListBackupsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ListBackupsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ListBackupsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.ListBackupsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The response payload containing a list of the backups.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ListBackupsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ListBackupsResponse) + com.google.cloud.sql.v1.ListBackupsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ListBackupsResponse.class, + com.google.cloud.sql.v1.ListBackupsResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ListBackupsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + } else { + backups_ = null; + backupsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + if (warningsBuilder_ == null) { + warnings_ = java.util.Collections.emptyList(); + } else { + warnings_ = null; + warningsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ListBackupsResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ListBackupsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ListBackupsResponse build() { + com.google.cloud.sql.v1.ListBackupsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ListBackupsResponse buildPartial() { + com.google.cloud.sql.v1.ListBackupsResponse result = + new com.google.cloud.sql.v1.ListBackupsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.ListBackupsResponse result) { + if (backupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + backups_ = java.util.Collections.unmodifiableList(backups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.backups_ = backups_; + } else { + result.backups_ = backupsBuilder_.build(); + } + if (warningsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + warnings_ = java.util.Collections.unmodifiableList(warnings_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.warnings_ = warnings_; + } else { + result.warnings_ = warningsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.ListBackupsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ListBackupsResponse) { + return mergeFrom((com.google.cloud.sql.v1.ListBackupsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ListBackupsResponse other) { + if (other == com.google.cloud.sql.v1.ListBackupsResponse.getDefaultInstance()) return this; + if (backupsBuilder_ == null) { + if (!other.backups_.isEmpty()) { + if (backups_.isEmpty()) { + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBackupsIsMutable(); + backups_.addAll(other.backups_); + } + onChanged(); + } + } else { + if (!other.backups_.isEmpty()) { + if (backupsBuilder_.isEmpty()) { + backupsBuilder_.dispose(); + backupsBuilder_ = null; + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + backupsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetBackupsFieldBuilder() + : null; + } else { + backupsBuilder_.addAllMessages(other.backups_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (warningsBuilder_ == null) { + if (!other.warnings_.isEmpty()) { + if (warnings_.isEmpty()) { + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureWarningsIsMutable(); + warnings_.addAll(other.warnings_); + } + onChanged(); + } + } else { + if (!other.warnings_.isEmpty()) { + if (warningsBuilder_.isEmpty()) { + warningsBuilder_.dispose(); + warningsBuilder_ = null; + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000004); + warningsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetWarningsFieldBuilder() + : null; + } else { + warningsBuilder_.addAllMessages(other.warnings_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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.sql.v1.Backup m = + input.readMessage(com.google.cloud.sql.v1.Backup.parser(), extensionRegistry); + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(m); + } else { + backupsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.cloud.sql.v1.ApiWarning m = + input.readMessage( + com.google.cloud.sql.v1.ApiWarning.parser(), extensionRegistry); + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(m); + } else { + warningsBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List backups_ = + java.util.Collections.emptyList(); + + private void ensureBackupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + backups_ = new java.util.ArrayList(backups_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Backup, + com.google.cloud.sql.v1.Backup.Builder, + com.google.cloud.sql.v1.BackupOrBuilder> + backupsBuilder_; + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public java.util.List getBackupsList() { + if (backupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(backups_); + } else { + return backupsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public int getBackupsCount() { + if (backupsBuilder_ == null) { + return backups_.size(); + } else { + return backupsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public com.google.cloud.sql.v1.Backup getBackups(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public Builder setBackups(int index, com.google.cloud.sql.v1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.set(index, value); + onChanged(); + } else { + backupsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public Builder setBackups(int index, com.google.cloud.sql.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.set(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public Builder addBackups(com.google.cloud.sql.v1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(value); + onChanged(); + } else { + backupsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public Builder addBackups(int index, com.google.cloud.sql.v1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(index, value); + onChanged(); + } else { + backupsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public Builder addBackups(com.google.cloud.sql.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public Builder addBackups(int index, com.google.cloud.sql.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public Builder addAllBackups( + java.lang.Iterable values) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, backups_); + onChanged(); + } else { + backupsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public Builder clearBackups() { + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + backupsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public Builder removeBackups(int index) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.remove(index); + onChanged(); + } else { + backupsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public com.google.cloud.sql.v1.Backup.Builder getBackupsBuilder(int index) { + return internalGetBackupsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public com.google.cloud.sql.v1.BackupOrBuilder getBackupsOrBuilder(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public java.util.List + getBackupsOrBuilderList() { + if (backupsBuilder_ != null) { + return backupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(backups_); + } + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public com.google.cloud.sql.v1.Backup.Builder addBackupsBuilder() { + return internalGetBackupsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.Backup.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public com.google.cloud.sql.v1.Backup.Builder addBackupsBuilder(int index) { + return internalGetBackupsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.Backup.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + public java.util.List getBackupsBuilderList() { + return internalGetBackupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Backup, + com.google.cloud.sql.v1.Backup.Builder, + com.google.cloud.sql.v1.BackupOrBuilder> + internalGetBackupsFieldBuilder() { + if (backupsBuilder_ == null) { + backupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Backup, + com.google.cloud.sql.v1.Backup.Builder, + com.google.cloud.sql.v1.BackupOrBuilder>( + backups_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + backups_ = null; + } + return backupsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, then there aren't 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, then there aren't 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, then there aren't 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, then there aren't 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, then there aren't 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 java.util.List warnings_ = + java.util.Collections.emptyList(); + + private void ensureWarningsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + warnings_ = new java.util.ArrayList(warnings_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ApiWarning, + com.google.cloud.sql.v1.ApiWarning.Builder, + com.google.cloud.sql.v1.ApiWarningOrBuilder> + warningsBuilder_; + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public java.util.List getWarningsList() { + if (warningsBuilder_ == null) { + return java.util.Collections.unmodifiableList(warnings_); + } else { + return warningsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public int getWarningsCount() { + if (warningsBuilder_ == null) { + return warnings_.size(); + } else { + return warningsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public com.google.cloud.sql.v1.ApiWarning getWarnings(int index) { + if (warningsBuilder_ == null) { + return warnings_.get(index); + } else { + return warningsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public Builder setWarnings(int index, com.google.cloud.sql.v1.ApiWarning value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.set(index, value); + onChanged(); + } else { + warningsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public Builder setWarnings( + int index, com.google.cloud.sql.v1.ApiWarning.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.set(index, builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public Builder addWarnings(com.google.cloud.sql.v1.ApiWarning value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(value); + onChanged(); + } else { + warningsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public Builder addWarnings(int index, com.google.cloud.sql.v1.ApiWarning value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(index, value); + onChanged(); + } else { + warningsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public Builder addWarnings(com.google.cloud.sql.v1.ApiWarning.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public Builder addWarnings( + int index, com.google.cloud.sql.v1.ApiWarning.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(index, builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public Builder addAllWarnings( + java.lang.Iterable values) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, warnings_); + onChanged(); + } else { + warningsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public Builder clearWarnings() { + if (warningsBuilder_ == null) { + warnings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + warningsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public Builder removeWarnings(int index) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.remove(index); + onChanged(); + } else { + warningsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public com.google.cloud.sql.v1.ApiWarning.Builder getWarningsBuilder(int index) { + return internalGetWarningsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public com.google.cloud.sql.v1.ApiWarningOrBuilder getWarningsOrBuilder(int index) { + if (warningsBuilder_ == null) { + return warnings_.get(index); + } else { + return warningsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public java.util.List + getWarningsOrBuilderList() { + if (warningsBuilder_ != null) { + return warningsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(warnings_); + } + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public com.google.cloud.sql.v1.ApiWarning.Builder addWarningsBuilder() { + return internalGetWarningsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.ApiWarning.getDefaultInstance()); + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public com.google.cloud.sql.v1.ApiWarning.Builder addWarningsBuilder(int index) { + return internalGetWarningsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.ApiWarning.getDefaultInstance()); + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + public java.util.List getWarningsBuilderList() { + return internalGetWarningsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ApiWarning, + com.google.cloud.sql.v1.ApiWarning.Builder, + com.google.cloud.sql.v1.ApiWarningOrBuilder> + internalGetWarningsFieldBuilder() { + if (warningsBuilder_ == null) { + warningsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ApiWarning, + com.google.cloud.sql.v1.ApiWarning.Builder, + com.google.cloud.sql.v1.ApiWarningOrBuilder>( + warnings_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + warnings_ = null; + } + return warningsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ListBackupsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ListBackupsResponse) + private static final com.google.cloud.sql.v1.ListBackupsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ListBackupsResponse(); + } + + public static com.google.cloud.sql.v1.ListBackupsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ListBackupsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ListBackupsResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ListBackupsResponseOrBuilder.java new file mode 100644 index 000000000000..7331026c4f3a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ListBackupsResponseOrBuilder.java @@ -0,0 +1,171 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ListBackupsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ListBackupsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + java.util.List getBackupsList(); + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + com.google.cloud.sql.v1.Backup getBackups(int index); + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + int getBackupsCount(); + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + java.util.List getBackupsOrBuilderList(); + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1.Backup backups = 1; + */ + com.google.cloud.sql.v1.BackupOrBuilder getBackupsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, then there aren't 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, then there aren't subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + java.util.List getWarningsList(); + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + com.google.cloud.sql.v1.ApiWarning getWarnings(int index); + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + int getWarningsCount(); + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + java.util.List getWarningsOrBuilderList(); + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1.ApiWarning warnings = 3; + */ + com.google.cloud.sql.v1.ApiWarningOrBuilder getWarningsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/LocationPreference.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/LocationPreference.java new file mode 100644 index 000000000000..a125b759dcb9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/LocationPreference.java @@ -0,0 +1,1217 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Preferred location. This specifies where a Cloud SQL instance is located.
+ * Note that if the preferred location is not available, the instance will be
+ * located as close as possible within the region. Only one location may be
+ * specified.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.LocationPreference} + */ +@com.google.protobuf.Generated +public final class LocationPreference extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.LocationPreference) + LocationPreferenceOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LocationPreference"); + } + + // Use LocationPreference.newBuilder() to construct. + private LocationPreference(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private LocationPreference() { + followGaeApplication_ = ""; + zone_ = ""; + secondaryZone_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_LocationPreference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_LocationPreference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.LocationPreference.class, + com.google.cloud.sql.v1.LocationPreference.Builder.class); + } + + public static final int FOLLOW_GAE_APPLICATION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object followGaeApplication_ = ""; + + /** + * + * + *
+   * The App Engine application to follow, it must be in the same region as the
+   * Cloud SQL instance. WARNING: Changing this might restart the instance.
+   * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.LocationPreference.follow_gae_application is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1030 + * @return The followGaeApplication. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getFollowGaeApplication() { + java.lang.Object ref = followGaeApplication_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + followGaeApplication_ = s; + return s; + } + } + + /** + * + * + *
+   * The App Engine application to follow, it must be in the same region as the
+   * Cloud SQL instance. WARNING: Changing this might restart the instance.
+   * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.LocationPreference.follow_gae_application is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1030 + * @return The bytes for followGaeApplication. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getFollowGaeApplicationBytes() { + java.lang.Object ref = followGaeApplication_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + followGaeApplication_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ZONE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object zone_ = ""; + + /** + * + * + *
+   * The preferred Compute Engine zone (for example: us-central1-a,
+   * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+   * 
+ * + * string zone = 2; + * + * @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; + } + } + + /** + * + * + *
+   * The preferred Compute Engine zone (for example: us-central1-a,
+   * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+   * 
+ * + * string zone = 2; + * + * @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 SECONDARY_ZONE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object secondaryZone_ = ""; + + /** + * + * + *
+   * The preferred Compute Engine zone for the secondary/failover
+   * (for example: us-central1-a, us-central1-b, etc.).
+   * To disable this field, set it to 'no_secondary_zone'.
+   * 
+ * + * string secondary_zone = 4; + * + * @return The secondaryZone. + */ + @java.lang.Override + public java.lang.String getSecondaryZone() { + java.lang.Object ref = secondaryZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secondaryZone_ = s; + return s; + } + } + + /** + * + * + *
+   * The preferred Compute Engine zone for the secondary/failover
+   * (for example: us-central1-a, us-central1-b, etc.).
+   * To disable this field, set it to 'no_secondary_zone'.
+   * 
+ * + * string secondary_zone = 4; + * + * @return The bytes for secondaryZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSecondaryZoneBytes() { + java.lang.Object ref = secondaryZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secondaryZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#locationPreference`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#locationPreference`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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.GeneratedMessage.isStringEmpty(followGaeApplication_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, followGaeApplication_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(zone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, zone_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(secondaryZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, secondaryZone_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(followGaeApplication_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, followGaeApplication_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(zone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, zone_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(secondaryZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, secondaryZone_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.LocationPreference)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.LocationPreference other = + (com.google.cloud.sql.v1.LocationPreference) obj; + + if (!getFollowGaeApplication().equals(other.getFollowGaeApplication())) return false; + if (!getZone().equals(other.getZone())) return false; + if (!getSecondaryZone().equals(other.getSecondaryZone())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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) + FOLLOW_GAE_APPLICATION_FIELD_NUMBER; + hash = (53 * hash) + getFollowGaeApplication().hashCode(); + hash = (37 * hash) + ZONE_FIELD_NUMBER; + hash = (53 * hash) + getZone().hashCode(); + hash = (37 * hash) + SECONDARY_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getSecondaryZone().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.LocationPreference parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.LocationPreference parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.LocationPreference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.LocationPreference parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.LocationPreference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.LocationPreference parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.LocationPreference parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.LocationPreference parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.LocationPreference parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.LocationPreference parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.LocationPreference parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.LocationPreference parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.LocationPreference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Preferred location. This specifies where a Cloud SQL instance is located.
+   * Note that if the preferred location is not available, the instance will be
+   * located as close as possible within the region. Only one location may be
+   * specified.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.LocationPreference} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.LocationPreference) + com.google.cloud.sql.v1.LocationPreferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_LocationPreference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_LocationPreference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.LocationPreference.class, + com.google.cloud.sql.v1.LocationPreference.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.LocationPreference.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + followGaeApplication_ = ""; + zone_ = ""; + secondaryZone_ = ""; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_LocationPreference_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.LocationPreference getDefaultInstanceForType() { + return com.google.cloud.sql.v1.LocationPreference.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.LocationPreference build() { + com.google.cloud.sql.v1.LocationPreference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.LocationPreference buildPartial() { + com.google.cloud.sql.v1.LocationPreference result = + new com.google.cloud.sql.v1.LocationPreference(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.LocationPreference result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.followGaeApplication_ = followGaeApplication_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.zone_ = zone_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.secondaryZone_ = secondaryZone_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.LocationPreference) { + return mergeFrom((com.google.cloud.sql.v1.LocationPreference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.LocationPreference other) { + if (other == com.google.cloud.sql.v1.LocationPreference.getDefaultInstance()) return this; + if (!other.getFollowGaeApplication().isEmpty()) { + followGaeApplication_ = other.followGaeApplication_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getZone().isEmpty()) { + zone_ = other.zone_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSecondaryZone().isEmpty()) { + secondaryZone_ = other.secondaryZone_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + followGaeApplication_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + zone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + secondaryZone_ = 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 followGaeApplication_ = ""; + + /** + * + * + *
+     * The App Engine application to follow, it must be in the same region as the
+     * Cloud SQL instance. WARNING: Changing this might restart the instance.
+     * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.LocationPreference.follow_gae_application is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1030 + * @return The followGaeApplication. + */ + @java.lang.Deprecated + public java.lang.String getFollowGaeApplication() { + java.lang.Object ref = followGaeApplication_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + followGaeApplication_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The App Engine application to follow, it must be in the same region as the
+     * Cloud SQL instance. WARNING: Changing this might restart the instance.
+     * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.LocationPreference.follow_gae_application is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1030 + * @return The bytes for followGaeApplication. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getFollowGaeApplicationBytes() { + java.lang.Object ref = followGaeApplication_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + followGaeApplication_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The App Engine application to follow, it must be in the same region as the
+     * Cloud SQL instance. WARNING: Changing this might restart the instance.
+     * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.LocationPreference.follow_gae_application is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1030 + * @param value The followGaeApplication to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setFollowGaeApplication(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + followGaeApplication_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The App Engine application to follow, it must be in the same region as the
+     * Cloud SQL instance. WARNING: Changing this might restart the instance.
+     * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.LocationPreference.follow_gae_application is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1030 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearFollowGaeApplication() { + followGaeApplication_ = getDefaultInstance().getFollowGaeApplication(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The App Engine application to follow, it must be in the same region as the
+     * Cloud SQL instance. WARNING: Changing this might restart the instance.
+     * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.LocationPreference.follow_gae_application is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1030 + * @param value The bytes for followGaeApplication to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setFollowGaeApplicationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + followGaeApplication_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object zone_ = ""; + + /** + * + * + *
+     * The preferred Compute Engine zone (for example: us-central1-a,
+     * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+     * 
+ * + * string zone = 2; + * + * @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; + } + } + + /** + * + * + *
+     * The preferred Compute Engine zone (for example: us-central1-a,
+     * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+     * 
+ * + * string zone = 2; + * + * @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; + } + } + + /** + * + * + *
+     * The preferred Compute Engine zone (for example: us-central1-a,
+     * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+     * 
+ * + * string zone = 2; + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The preferred Compute Engine zone (for example: us-central1-a,
+     * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+     * 
+ * + * string zone = 2; + * + * @return This builder for chaining. + */ + public Builder clearZone() { + zone_ = getDefaultInstance().getZone(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The preferred Compute Engine zone (for example: us-central1-a,
+     * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+     * 
+ * + * string zone = 2; + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object secondaryZone_ = ""; + + /** + * + * + *
+     * The preferred Compute Engine zone for the secondary/failover
+     * (for example: us-central1-a, us-central1-b, etc.).
+     * To disable this field, set it to 'no_secondary_zone'.
+     * 
+ * + * string secondary_zone = 4; + * + * @return The secondaryZone. + */ + public java.lang.String getSecondaryZone() { + java.lang.Object ref = secondaryZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secondaryZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The preferred Compute Engine zone for the secondary/failover
+     * (for example: us-central1-a, us-central1-b, etc.).
+     * To disable this field, set it to 'no_secondary_zone'.
+     * 
+ * + * string secondary_zone = 4; + * + * @return The bytes for secondaryZone. + */ + public com.google.protobuf.ByteString getSecondaryZoneBytes() { + java.lang.Object ref = secondaryZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secondaryZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The preferred Compute Engine zone for the secondary/failover
+     * (for example: us-central1-a, us-central1-b, etc.).
+     * To disable this field, set it to 'no_secondary_zone'.
+     * 
+ * + * string secondary_zone = 4; + * + * @param value The secondaryZone to set. + * @return This builder for chaining. + */ + public Builder setSecondaryZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + secondaryZone_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The preferred Compute Engine zone for the secondary/failover
+     * (for example: us-central1-a, us-central1-b, etc.).
+     * To disable this field, set it to 'no_secondary_zone'.
+     * 
+ * + * string secondary_zone = 4; + * + * @return This builder for chaining. + */ + public Builder clearSecondaryZone() { + secondaryZone_ = getDefaultInstance().getSecondaryZone(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The preferred Compute Engine zone for the secondary/failover
+     * (for example: us-central1-a, us-central1-b, etc.).
+     * To disable this field, set it to 'no_secondary_zone'.
+     * 
+ * + * string secondary_zone = 4; + * + * @param value The bytes for secondaryZone to set. + * @return This builder for chaining. + */ + public Builder setSecondaryZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + secondaryZone_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#locationPreference`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#locationPreference`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#locationPreference`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#locationPreference`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#locationPreference`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.LocationPreference) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.LocationPreference) + private static final com.google.cloud.sql.v1.LocationPreference DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.LocationPreference(); + } + + public static com.google.cloud.sql.v1.LocationPreference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocationPreference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.LocationPreference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/LocationPreferenceOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/LocationPreferenceOrBuilder.java new file mode 100644 index 000000000000..3af0906dd3de --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/LocationPreferenceOrBuilder.java @@ -0,0 +1,146 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface LocationPreferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.LocationPreference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The App Engine application to follow, it must be in the same region as the
+   * Cloud SQL instance. WARNING: Changing this might restart the instance.
+   * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.LocationPreference.follow_gae_application is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1030 + * @return The followGaeApplication. + */ + @java.lang.Deprecated + java.lang.String getFollowGaeApplication(); + + /** + * + * + *
+   * The App Engine application to follow, it must be in the same region as the
+   * Cloud SQL instance. WARNING: Changing this might restart the instance.
+   * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.LocationPreference.follow_gae_application is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1030 + * @return The bytes for followGaeApplication. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getFollowGaeApplicationBytes(); + + /** + * + * + *
+   * The preferred Compute Engine zone (for example: us-central1-a,
+   * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+   * 
+ * + * string zone = 2; + * + * @return The zone. + */ + java.lang.String getZone(); + + /** + * + * + *
+   * The preferred Compute Engine zone (for example: us-central1-a,
+   * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+   * 
+ * + * string zone = 2; + * + * @return The bytes for zone. + */ + com.google.protobuf.ByteString getZoneBytes(); + + /** + * + * + *
+   * The preferred Compute Engine zone for the secondary/failover
+   * (for example: us-central1-a, us-central1-b, etc.).
+   * To disable this field, set it to 'no_secondary_zone'.
+   * 
+ * + * string secondary_zone = 4; + * + * @return The secondaryZone. + */ + java.lang.String getSecondaryZone(); + + /** + * + * + *
+   * The preferred Compute Engine zone for the secondary/failover
+   * (for example: us-central1-a, us-central1-b, etc.).
+   * To disable this field, set it to 'no_secondary_zone'.
+   * 
+ * + * string secondary_zone = 4; + * + * @return The bytes for secondaryZone. + */ + com.google.protobuf.ByteString getSecondaryZoneBytes(); + + /** + * + * + *
+   * This is always `sql#locationPreference`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#locationPreference`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MaintenanceWindow.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MaintenanceWindow.java new file mode 100644 index 000000000000..87609815bcab --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MaintenanceWindow.java @@ -0,0 +1,1347 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Maintenance window. This specifies when a Cloud SQL instance is
+ * restarted for system maintenance purposes.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.MaintenanceWindow} + */ +@com.google.protobuf.Generated +public final class MaintenanceWindow extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.MaintenanceWindow) + MaintenanceWindowOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MaintenanceWindow"); + } + + // Use MaintenanceWindow.newBuilder() to construct. + private MaintenanceWindow(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MaintenanceWindow() { + updateTrack_ = 0; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MaintenanceWindow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MaintenanceWindow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.MaintenanceWindow.class, + com.google.cloud.sql.v1.MaintenanceWindow.Builder.class); + } + + private int bitField0_; + public static final int HOUR_FIELD_NUMBER = 1; + private com.google.protobuf.Int32Value hour_; + + /** + * + * + *
+   * Hour of day - 0 to 23. Specify in the UTC time zone.
+   * 
+ * + * .google.protobuf.Int32Value hour = 1; + * + * @return Whether the hour field is set. + */ + @java.lang.Override + public boolean hasHour() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Hour of day - 0 to 23. Specify in the UTC time zone.
+   * 
+ * + * .google.protobuf.Int32Value hour = 1; + * + * @return The hour. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getHour() { + return hour_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : hour_; + } + + /** + * + * + *
+   * Hour of day - 0 to 23. Specify in the UTC time zone.
+   * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getHourOrBuilder() { + return hour_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : hour_; + } + + public static final int DAY_FIELD_NUMBER = 2; + private com.google.protobuf.Int32Value day_; + + /** + * + * + *
+   * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+   * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+   * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+   * 
+ * + * .google.protobuf.Int32Value day = 2; + * + * @return Whether the day field is set. + */ + @java.lang.Override + public boolean hasDay() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+   * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+   * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+   * 
+ * + * .google.protobuf.Int32Value day = 2; + * + * @return The day. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getDay() { + return day_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : day_; + } + + /** + * + * + *
+   * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+   * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+   * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+   * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getDayOrBuilder() { + return day_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : day_; + } + + public static final int UPDATE_TRACK_FIELD_NUMBER = 3; + private int updateTrack_ = 0; + + /** + * + * + *
+   * Maintenance timing settings: `canary`, `stable`, or `week5`.
+   * For more information, see [About maintenance on Cloud SQL
+   * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+   * 
+ * + * .google.cloud.sql.v1.SqlUpdateTrack update_track = 3; + * + * @return The enum numeric value on the wire for updateTrack. + */ + @java.lang.Override + public int getUpdateTrackValue() { + return updateTrack_; + } + + /** + * + * + *
+   * Maintenance timing settings: `canary`, `stable`, or `week5`.
+   * For more information, see [About maintenance on Cloud SQL
+   * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+   * 
+ * + * .google.cloud.sql.v1.SqlUpdateTrack update_track = 3; + * + * @return The updateTrack. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlUpdateTrack getUpdateTrack() { + com.google.cloud.sql.v1.SqlUpdateTrack result = + com.google.cloud.sql.v1.SqlUpdateTrack.forNumber(updateTrack_); + return result == null ? com.google.cloud.sql.v1.SqlUpdateTrack.UNRECOGNIZED : result; + } + + public static final int KIND_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#maintenanceWindow`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#maintenanceWindow`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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, getHour()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getDay()); + } + if (updateTrack_ + != com.google.cloud.sql.v1.SqlUpdateTrack.SQL_UPDATE_TRACK_UNSPECIFIED.getNumber()) { + output.writeEnum(3, updateTrack_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, kind_); + } + 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, getHour()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDay()); + } + if (updateTrack_ + != com.google.cloud.sql.v1.SqlUpdateTrack.SQL_UPDATE_TRACK_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, updateTrack_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.MaintenanceWindow)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.MaintenanceWindow other = + (com.google.cloud.sql.v1.MaintenanceWindow) obj; + + if (hasHour() != other.hasHour()) return false; + if (hasHour()) { + if (!getHour().equals(other.getHour())) return false; + } + if (hasDay() != other.hasDay()) return false; + if (hasDay()) { + if (!getDay().equals(other.getDay())) return false; + } + if (updateTrack_ != other.updateTrack_) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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 (hasHour()) { + hash = (37 * hash) + HOUR_FIELD_NUMBER; + hash = (53 * hash) + getHour().hashCode(); + } + if (hasDay()) { + hash = (37 * hash) + DAY_FIELD_NUMBER; + hash = (53 * hash) + getDay().hashCode(); + } + hash = (37 * hash) + UPDATE_TRACK_FIELD_NUMBER; + hash = (53 * hash) + updateTrack_; + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.MaintenanceWindow parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.MaintenanceWindow parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MaintenanceWindow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.MaintenanceWindow parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MaintenanceWindow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.MaintenanceWindow parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MaintenanceWindow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.MaintenanceWindow parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MaintenanceWindow parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.MaintenanceWindow parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MaintenanceWindow parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.MaintenanceWindow parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.MaintenanceWindow prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Maintenance window. This specifies when a Cloud SQL instance is
+   * restarted for system maintenance purposes.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.MaintenanceWindow} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.MaintenanceWindow) + com.google.cloud.sql.v1.MaintenanceWindowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MaintenanceWindow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MaintenanceWindow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.MaintenanceWindow.class, + com.google.cloud.sql.v1.MaintenanceWindow.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.MaintenanceWindow.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetHourFieldBuilder(); + internalGetDayFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + hour_ = null; + if (hourBuilder_ != null) { + hourBuilder_.dispose(); + hourBuilder_ = null; + } + day_ = null; + if (dayBuilder_ != null) { + dayBuilder_.dispose(); + dayBuilder_ = null; + } + updateTrack_ = 0; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MaintenanceWindow_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.MaintenanceWindow getDefaultInstanceForType() { + return com.google.cloud.sql.v1.MaintenanceWindow.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.MaintenanceWindow build() { + com.google.cloud.sql.v1.MaintenanceWindow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.MaintenanceWindow buildPartial() { + com.google.cloud.sql.v1.MaintenanceWindow result = + new com.google.cloud.sql.v1.MaintenanceWindow(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.MaintenanceWindow result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.hour_ = hourBuilder_ == null ? hour_ : hourBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.day_ = dayBuilder_ == null ? day_ : dayBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateTrack_ = updateTrack_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.kind_ = kind_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.MaintenanceWindow) { + return mergeFrom((com.google.cloud.sql.v1.MaintenanceWindow) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.MaintenanceWindow other) { + if (other == com.google.cloud.sql.v1.MaintenanceWindow.getDefaultInstance()) return this; + if (other.hasHour()) { + mergeHour(other.getHour()); + } + if (other.hasDay()) { + mergeDay(other.getDay()); + } + if (other.updateTrack_ != 0) { + setUpdateTrackValue(other.getUpdateTrackValue()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + input.readMessage(internalGetHourFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetDayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + updateTrack_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + kind_ = 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 com.google.protobuf.Int32Value hour_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + hourBuilder_; + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + * + * @return Whether the hour field is set. + */ + public boolean hasHour() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + * + * @return The hour. + */ + public com.google.protobuf.Int32Value getHour() { + if (hourBuilder_ == null) { + return hour_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : hour_; + } else { + return hourBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + public Builder setHour(com.google.protobuf.Int32Value value) { + if (hourBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hour_ = value; + } else { + hourBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + public Builder setHour(com.google.protobuf.Int32Value.Builder builderForValue) { + if (hourBuilder_ == null) { + hour_ = builderForValue.build(); + } else { + hourBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + public Builder mergeHour(com.google.protobuf.Int32Value value) { + if (hourBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && hour_ != null + && hour_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getHourBuilder().mergeFrom(value); + } else { + hour_ = value; + } + } else { + hourBuilder_.mergeFrom(value); + } + if (hour_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + public Builder clearHour() { + bitField0_ = (bitField0_ & ~0x00000001); + hour_ = null; + if (hourBuilder_ != null) { + hourBuilder_.dispose(); + hourBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + public com.google.protobuf.Int32Value.Builder getHourBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetHourFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + public com.google.protobuf.Int32ValueOrBuilder getHourOrBuilder() { + if (hourBuilder_ != null) { + return hourBuilder_.getMessageOrBuilder(); + } else { + return hour_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : hour_; + } + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetHourFieldBuilder() { + if (hourBuilder_ == null) { + hourBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getHour(), getParentForChildren(), isClean()); + hour_ = null; + } + return hourBuilder_; + } + + private com.google.protobuf.Int32Value day_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + dayBuilder_; + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + * + * @return Whether the day field is set. + */ + public boolean hasDay() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + * + * @return The day. + */ + public com.google.protobuf.Int32Value getDay() { + if (dayBuilder_ == null) { + return day_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : day_; + } else { + return dayBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + public Builder setDay(com.google.protobuf.Int32Value value) { + if (dayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + day_ = value; + } else { + dayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + public Builder setDay(com.google.protobuf.Int32Value.Builder builderForValue) { + if (dayBuilder_ == null) { + day_ = builderForValue.build(); + } else { + dayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + public Builder mergeDay(com.google.protobuf.Int32Value value) { + if (dayBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && day_ != null + && day_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getDayBuilder().mergeFrom(value); + } else { + day_ = value; + } + } else { + dayBuilder_.mergeFrom(value); + } + if (day_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + public Builder clearDay() { + bitField0_ = (bitField0_ & ~0x00000002); + day_ = null; + if (dayBuilder_ != null) { + dayBuilder_.dispose(); + dayBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + public com.google.protobuf.Int32Value.Builder getDayBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetDayFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + public com.google.protobuf.Int32ValueOrBuilder getDayOrBuilder() { + if (dayBuilder_ != null) { + return dayBuilder_.getMessageOrBuilder(); + } else { + return day_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : day_; + } + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetDayFieldBuilder() { + if (dayBuilder_ == null) { + dayBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getDay(), getParentForChildren(), isClean()); + day_ = null; + } + return dayBuilder_; + } + + private int updateTrack_ = 0; + + /** + * + * + *
+     * Maintenance timing settings: `canary`, `stable`, or `week5`.
+     * For more information, see [About maintenance on Cloud SQL
+     * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+     * 
+ * + * .google.cloud.sql.v1.SqlUpdateTrack update_track = 3; + * + * @return The enum numeric value on the wire for updateTrack. + */ + @java.lang.Override + public int getUpdateTrackValue() { + return updateTrack_; + } + + /** + * + * + *
+     * Maintenance timing settings: `canary`, `stable`, or `week5`.
+     * For more information, see [About maintenance on Cloud SQL
+     * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+     * 
+ * + * .google.cloud.sql.v1.SqlUpdateTrack update_track = 3; + * + * @param value The enum numeric value on the wire for updateTrack to set. + * @return This builder for chaining. + */ + public Builder setUpdateTrackValue(int value) { + updateTrack_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maintenance timing settings: `canary`, `stable`, or `week5`.
+     * For more information, see [About maintenance on Cloud SQL
+     * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+     * 
+ * + * .google.cloud.sql.v1.SqlUpdateTrack update_track = 3; + * + * @return The updateTrack. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlUpdateTrack getUpdateTrack() { + com.google.cloud.sql.v1.SqlUpdateTrack result = + com.google.cloud.sql.v1.SqlUpdateTrack.forNumber(updateTrack_); + return result == null ? com.google.cloud.sql.v1.SqlUpdateTrack.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Maintenance timing settings: `canary`, `stable`, or `week5`.
+     * For more information, see [About maintenance on Cloud SQL
+     * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+     * 
+ * + * .google.cloud.sql.v1.SqlUpdateTrack update_track = 3; + * + * @param value The updateTrack to set. + * @return This builder for chaining. + */ + public Builder setUpdateTrack(com.google.cloud.sql.v1.SqlUpdateTrack value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + updateTrack_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Maintenance timing settings: `canary`, `stable`, or `week5`.
+     * For more information, see [About maintenance on Cloud SQL
+     * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+     * 
+ * + * .google.cloud.sql.v1.SqlUpdateTrack update_track = 3; + * + * @return This builder for chaining. + */ + public Builder clearUpdateTrack() { + bitField0_ = (bitField0_ & ~0x00000004); + updateTrack_ = 0; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#maintenanceWindow`.
+     * 
+ * + * string kind = 4; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#maintenanceWindow`.
+     * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#maintenanceWindow`.
+     * 
+ * + * string kind = 4; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#maintenanceWindow`.
+     * 
+ * + * string kind = 4; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#maintenanceWindow`.
+     * 
+ * + * string kind = 4; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.MaintenanceWindow) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.MaintenanceWindow) + private static final com.google.cloud.sql.v1.MaintenanceWindow DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.MaintenanceWindow(); + } + + public static com.google.cloud.sql.v1.MaintenanceWindow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MaintenanceWindow parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.MaintenanceWindow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MaintenanceWindowOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MaintenanceWindowOrBuilder.java new file mode 100644 index 000000000000..5b4fa2797b93 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MaintenanceWindowOrBuilder.java @@ -0,0 +1,164 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface MaintenanceWindowOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.MaintenanceWindow) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Hour of day - 0 to 23. Specify in the UTC time zone.
+   * 
+ * + * .google.protobuf.Int32Value hour = 1; + * + * @return Whether the hour field is set. + */ + boolean hasHour(); + + /** + * + * + *
+   * Hour of day - 0 to 23. Specify in the UTC time zone.
+   * 
+ * + * .google.protobuf.Int32Value hour = 1; + * + * @return The hour. + */ + com.google.protobuf.Int32Value getHour(); + + /** + * + * + *
+   * Hour of day - 0 to 23. Specify in the UTC time zone.
+   * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + com.google.protobuf.Int32ValueOrBuilder getHourOrBuilder(); + + /** + * + * + *
+   * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+   * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+   * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+   * 
+ * + * .google.protobuf.Int32Value day = 2; + * + * @return Whether the day field is set. + */ + boolean hasDay(); + + /** + * + * + *
+   * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+   * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+   * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+   * 
+ * + * .google.protobuf.Int32Value day = 2; + * + * @return The day. + */ + com.google.protobuf.Int32Value getDay(); + + /** + * + * + *
+   * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+   * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+   * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+   * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + com.google.protobuf.Int32ValueOrBuilder getDayOrBuilder(); + + /** + * + * + *
+   * Maintenance timing settings: `canary`, `stable`, or `week5`.
+   * For more information, see [About maintenance on Cloud SQL
+   * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+   * 
+ * + * .google.cloud.sql.v1.SqlUpdateTrack update_track = 3; + * + * @return The enum numeric value on the wire for updateTrack. + */ + int getUpdateTrackValue(); + + /** + * + * + *
+   * Maintenance timing settings: `canary`, `stable`, or `week5`.
+   * For more information, see [About maintenance on Cloud SQL
+   * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+   * 
+ * + * .google.cloud.sql.v1.SqlUpdateTrack update_track = 3; + * + * @return The updateTrack. + */ + com.google.cloud.sql.v1.SqlUpdateTrack getUpdateTrack(); + + /** + * + * + *
+   * This is always `sql#maintenanceWindow`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#maintenanceWindow`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Metadata.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Metadata.java new file mode 100644 index 000000000000..b7cdced06ddf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Metadata.java @@ -0,0 +1,703 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The additional metadata information regarding the execution of the SQL
+ * statements.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Metadata} + */ +@com.google.protobuf.Generated +public final class Metadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.Metadata) + MetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Metadata"); + } + + // Use Metadata.newBuilder() to construct. + private Metadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Metadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Metadata.class, com.google.cloud.sql.v1.Metadata.Builder.class); + } + + private int bitField0_; + public static final int SQL_STATEMENT_EXECUTION_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Duration sqlStatementExecutionTime_; + + /** + * + * + *
+   * The time taken to execute the SQL statements.
+   * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + * + * @return Whether the sqlStatementExecutionTime field is set. + */ + @java.lang.Override + public boolean hasSqlStatementExecutionTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time taken to execute the SQL statements.
+   * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + * + * @return The sqlStatementExecutionTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getSqlStatementExecutionTime() { + return sqlStatementExecutionTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : sqlStatementExecutionTime_; + } + + /** + * + * + *
+   * The time taken to execute the SQL statements.
+   * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getSqlStatementExecutionTimeOrBuilder() { + return sqlStatementExecutionTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : sqlStatementExecutionTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getSqlStatementExecutionTime()); + } + 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, getSqlStatementExecutionTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.Metadata)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.Metadata other = (com.google.cloud.sql.v1.Metadata) obj; + + if (hasSqlStatementExecutionTime() != other.hasSqlStatementExecutionTime()) return false; + if (hasSqlStatementExecutionTime()) { + if (!getSqlStatementExecutionTime().equals(other.getSqlStatementExecutionTime())) + return false; + } + if (!getUnknownFields().equals(other.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 (hasSqlStatementExecutionTime()) { + hash = (37 * hash) + SQL_STATEMENT_EXECUTION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSqlStatementExecutionTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.Metadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Metadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Metadata parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Metadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Metadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Metadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Metadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Metadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Metadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Metadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Metadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Metadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.Metadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The additional metadata information regarding the execution of the SQL
+   * statements.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Metadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.Metadata) + com.google.cloud.sql.v1.MetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Metadata.class, + com.google.cloud.sql.v1.Metadata.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.Metadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSqlStatementExecutionTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sqlStatementExecutionTime_ = null; + if (sqlStatementExecutionTimeBuilder_ != null) { + sqlStatementExecutionTimeBuilder_.dispose(); + sqlStatementExecutionTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Metadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Metadata getDefaultInstanceForType() { + return com.google.cloud.sql.v1.Metadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.Metadata build() { + com.google.cloud.sql.v1.Metadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Metadata buildPartial() { + com.google.cloud.sql.v1.Metadata result = new com.google.cloud.sql.v1.Metadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.Metadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sqlStatementExecutionTime_ = + sqlStatementExecutionTimeBuilder_ == null + ? sqlStatementExecutionTime_ + : sqlStatementExecutionTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.Metadata) { + return mergeFrom((com.google.cloud.sql.v1.Metadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.Metadata other) { + if (other == com.google.cloud.sql.v1.Metadata.getDefaultInstance()) return this; + if (other.hasSqlStatementExecutionTime()) { + mergeSqlStatementExecutionTime(other.getSqlStatementExecutionTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetSqlStatementExecutionTimeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration sqlStatementExecutionTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + sqlStatementExecutionTimeBuilder_; + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + * + * @return Whether the sqlStatementExecutionTime field is set. + */ + public boolean hasSqlStatementExecutionTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + * + * @return The sqlStatementExecutionTime. + */ + public com.google.protobuf.Duration getSqlStatementExecutionTime() { + if (sqlStatementExecutionTimeBuilder_ == null) { + return sqlStatementExecutionTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : sqlStatementExecutionTime_; + } else { + return sqlStatementExecutionTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + public Builder setSqlStatementExecutionTime(com.google.protobuf.Duration value) { + if (sqlStatementExecutionTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sqlStatementExecutionTime_ = value; + } else { + sqlStatementExecutionTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + public Builder setSqlStatementExecutionTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (sqlStatementExecutionTimeBuilder_ == null) { + sqlStatementExecutionTime_ = builderForValue.build(); + } else { + sqlStatementExecutionTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + public Builder mergeSqlStatementExecutionTime(com.google.protobuf.Duration value) { + if (sqlStatementExecutionTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && sqlStatementExecutionTime_ != null + && sqlStatementExecutionTime_ != com.google.protobuf.Duration.getDefaultInstance()) { + getSqlStatementExecutionTimeBuilder().mergeFrom(value); + } else { + sqlStatementExecutionTime_ = value; + } + } else { + sqlStatementExecutionTimeBuilder_.mergeFrom(value); + } + if (sqlStatementExecutionTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + public Builder clearSqlStatementExecutionTime() { + bitField0_ = (bitField0_ & ~0x00000001); + sqlStatementExecutionTime_ = null; + if (sqlStatementExecutionTimeBuilder_ != null) { + sqlStatementExecutionTimeBuilder_.dispose(); + sqlStatementExecutionTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + public com.google.protobuf.Duration.Builder getSqlStatementExecutionTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetSqlStatementExecutionTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + public com.google.protobuf.DurationOrBuilder getSqlStatementExecutionTimeOrBuilder() { + if (sqlStatementExecutionTimeBuilder_ != null) { + return sqlStatementExecutionTimeBuilder_.getMessageOrBuilder(); + } else { + return sqlStatementExecutionTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : sqlStatementExecutionTime_; + } + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetSqlStatementExecutionTimeFieldBuilder() { + if (sqlStatementExecutionTimeBuilder_ == null) { + sqlStatementExecutionTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getSqlStatementExecutionTime(), getParentForChildren(), isClean()); + sqlStatementExecutionTime_ = null; + } + return sqlStatementExecutionTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.Metadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.Metadata) + private static final com.google.cloud.sql.v1.Metadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.Metadata(); + } + + public static com.google.cloud.sql.v1.Metadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Metadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MetadataOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MetadataOrBuilder.java new file mode 100644 index 000000000000..96b0c3d1cae9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MetadataOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface MetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.Metadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time taken to execute the SQL statements.
+   * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + * + * @return Whether the sqlStatementExecutionTime field is set. + */ + boolean hasSqlStatementExecutionTime(); + + /** + * + * + *
+   * The time taken to execute the SQL statements.
+   * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + * + * @return The sqlStatementExecutionTime. + */ + com.google.protobuf.Duration getSqlStatementExecutionTime(); + + /** + * + * + *
+   * The time taken to execute the SQL statements.
+   * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + com.google.protobuf.DurationOrBuilder getSqlStatementExecutionTimeOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MySqlReplicaConfiguration.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MySqlReplicaConfiguration.java new file mode 100644 index 000000000000..8adfa5dbf39c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MySqlReplicaConfiguration.java @@ -0,0 +1,2843 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Read-replica configuration specific to MySQL databases.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.MySqlReplicaConfiguration} + */ +@com.google.protobuf.Generated +public final class MySqlReplicaConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.MySqlReplicaConfiguration) + MySqlReplicaConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MySqlReplicaConfiguration"); + } + + // Use MySqlReplicaConfiguration.newBuilder() to construct. + private MySqlReplicaConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MySqlReplicaConfiguration() { + dumpFilePath_ = ""; + username_ = ""; + password_ = ""; + caCertificate_ = ""; + clientCertificate_ = ""; + clientKey_ = ""; + sslCipher_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MySqlReplicaConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MySqlReplicaConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.MySqlReplicaConfiguration.class, + com.google.cloud.sql.v1.MySqlReplicaConfiguration.Builder.class); + } + + private int bitField0_; + public static final int DUMP_FILE_PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object dumpFilePath_ = ""; + + /** + * + * + *
+   * Path to a SQL dump file in Google Cloud Storage from which the replica
+   * instance is to be created. The URI is in the form gs://bucketName/fileName.
+   * Compressed gzip files (.gz) are also supported.
+   * Dumps have the binlog co-ordinates from which replication
+   * begins. This can be accomplished by setting --master-data to 1 when using
+   * mysqldump.
+   * 
+ * + * string dump_file_path = 1; + * + * @return The dumpFilePath. + */ + @java.lang.Override + public java.lang.String getDumpFilePath() { + java.lang.Object ref = dumpFilePath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dumpFilePath_ = s; + return s; + } + } + + /** + * + * + *
+   * Path to a SQL dump file in Google Cloud Storage from which the replica
+   * instance is to be created. The URI is in the form gs://bucketName/fileName.
+   * Compressed gzip files (.gz) are also supported.
+   * Dumps have the binlog co-ordinates from which replication
+   * begins. This can be accomplished by setting --master-data to 1 when using
+   * mysqldump.
+   * 
+ * + * string dump_file_path = 1; + * + * @return The bytes for dumpFilePath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDumpFilePathBytes() { + java.lang.Object ref = dumpFilePath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dumpFilePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERNAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object username_ = ""; + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } + } + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONNECT_RETRY_INTERVAL_FIELD_NUMBER = 4; + private com.google.protobuf.Int32Value connectRetryInterval_; + + /** + * + * + *
+   * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+   * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + * + * @return Whether the connectRetryInterval field is set. + */ + @java.lang.Override + public boolean hasConnectRetryInterval() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+   * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + * + * @return The connectRetryInterval. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getConnectRetryInterval() { + return connectRetryInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : connectRetryInterval_; + } + + /** + * + * + *
+   * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+   * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getConnectRetryIntervalOrBuilder() { + return connectRetryInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : connectRetryInterval_; + } + + public static final int MASTER_HEARTBEAT_PERIOD_FIELD_NUMBER = 5; + private com.google.protobuf.Int64Value masterHeartbeatPeriod_; + + /** + * + * + *
+   * Interval in milliseconds between replication heartbeats.
+   * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + * + * @return Whether the masterHeartbeatPeriod field is set. + */ + @java.lang.Override + public boolean hasMasterHeartbeatPeriod() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Interval in milliseconds between replication heartbeats.
+   * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + * + * @return The masterHeartbeatPeriod. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getMasterHeartbeatPeriod() { + return masterHeartbeatPeriod_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : masterHeartbeatPeriod_; + } + + /** + * + * + *
+   * Interval in milliseconds between replication heartbeats.
+   * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getMasterHeartbeatPeriodOrBuilder() { + return masterHeartbeatPeriod_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : masterHeartbeatPeriod_; + } + + public static final int CA_CERTIFICATE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object caCertificate_ = ""; + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The caCertificate. + */ + @java.lang.Override + public java.lang.String getCaCertificate() { + java.lang.Object ref = caCertificate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCertificate_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The bytes for caCertificate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCaCertificateBytes() { + java.lang.Object ref = caCertificate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_CERTIFICATE_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object clientCertificate_ = ""; + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 7; + * + * @return The clientCertificate. + */ + @java.lang.Override + public java.lang.String getClientCertificate() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientCertificate_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 7; + * + * @return The bytes for clientCertificate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientCertificateBytes() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_KEY_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object clientKey_ = ""; + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 8; + * + * @return The clientKey. + */ + @java.lang.Override + public java.lang.String getClientKey() { + java.lang.Object ref = clientKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientKey_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 8; + * + * @return The bytes for clientKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientKeyBytes() { + java.lang.Object ref = clientKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SSL_CIPHER_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object sslCipher_ = ""; + + /** + * + * + *
+   * A list of permissible ciphers to use for SSL encryption.
+   * 
+ * + * string ssl_cipher = 9; + * + * @return The sslCipher. + */ + @java.lang.Override + public java.lang.String getSslCipher() { + java.lang.Object ref = sslCipher_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sslCipher_ = s; + return s; + } + } + + /** + * + * + *
+   * A list of permissible ciphers to use for SSL encryption.
+   * 
+ * + * string ssl_cipher = 9; + * + * @return The bytes for sslCipher. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSslCipherBytes() { + java.lang.Object ref = sslCipher_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sslCipher_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERIFY_SERVER_CERTIFICATE_FIELD_NUMBER = 10; + private com.google.protobuf.BoolValue verifyServerCertificate_; + + /** + * + * + *
+   * Whether or not to check the primary instance's Common Name value in the
+   * certificate that it sends during the SSL handshake.
+   * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + * + * @return Whether the verifyServerCertificate field is set. + */ + @java.lang.Override + public boolean hasVerifyServerCertificate() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Whether or not to check the primary instance's Common Name value in the
+   * certificate that it sends during the SSL handshake.
+   * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + * + * @return The verifyServerCertificate. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getVerifyServerCertificate() { + return verifyServerCertificate_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyServerCertificate_; + } + + /** + * + * + *
+   * Whether or not to check the primary instance's Common Name value in the
+   * certificate that it sends during the SSL handshake.
+   * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getVerifyServerCertificateOrBuilder() { + return verifyServerCertificate_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyServerCertificate_; + } + + public static final int KIND_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#mysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 11; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#mysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 11; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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.GeneratedMessage.isStringEmpty(dumpFilePath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, dumpFilePath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(username_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, username_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, password_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getConnectRetryInterval()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getMasterHeartbeatPeriod()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(caCertificate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, caCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientCertificate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, clientCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, clientKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sslCipher_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, sslCipher_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(10, getVerifyServerCertificate()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dumpFilePath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, dumpFilePath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(username_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, username_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, password_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, getConnectRetryInterval()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getMasterHeartbeatPeriod()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(caCertificate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, caCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientCertificate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, clientCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, clientKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sslCipher_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, sslCipher_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, getVerifyServerCertificate()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.MySqlReplicaConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.MySqlReplicaConfiguration other = + (com.google.cloud.sql.v1.MySqlReplicaConfiguration) obj; + + if (!getDumpFilePath().equals(other.getDumpFilePath())) return false; + if (!getUsername().equals(other.getUsername())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (hasConnectRetryInterval() != other.hasConnectRetryInterval()) return false; + if (hasConnectRetryInterval()) { + if (!getConnectRetryInterval().equals(other.getConnectRetryInterval())) return false; + } + if (hasMasterHeartbeatPeriod() != other.hasMasterHeartbeatPeriod()) return false; + if (hasMasterHeartbeatPeriod()) { + if (!getMasterHeartbeatPeriod().equals(other.getMasterHeartbeatPeriod())) return false; + } + if (!getCaCertificate().equals(other.getCaCertificate())) return false; + if (!getClientCertificate().equals(other.getClientCertificate())) return false; + if (!getClientKey().equals(other.getClientKey())) return false; + if (!getSslCipher().equals(other.getSslCipher())) return false; + if (hasVerifyServerCertificate() != other.hasVerifyServerCertificate()) return false; + if (hasVerifyServerCertificate()) { + if (!getVerifyServerCertificate().equals(other.getVerifyServerCertificate())) return false; + } + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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) + DUMP_FILE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getDumpFilePath().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + if (hasConnectRetryInterval()) { + hash = (37 * hash) + CONNECT_RETRY_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getConnectRetryInterval().hashCode(); + } + if (hasMasterHeartbeatPeriod()) { + hash = (37 * hash) + MASTER_HEARTBEAT_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getMasterHeartbeatPeriod().hashCode(); + } + hash = (37 * hash) + CA_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getCaCertificate().hashCode(); + hash = (37 * hash) + CLIENT_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getClientCertificate().hashCode(); + hash = (37 * hash) + CLIENT_KEY_FIELD_NUMBER; + hash = (53 * hash) + getClientKey().hashCode(); + hash = (37 * hash) + SSL_CIPHER_FIELD_NUMBER; + hash = (53 * hash) + getSslCipher().hashCode(); + if (hasVerifyServerCertificate()) { + hash = (37 * hash) + VERIFY_SERVER_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getVerifyServerCertificate().hashCode(); + } + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.MySqlReplicaConfiguration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.MySqlReplicaConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MySqlReplicaConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.MySqlReplicaConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MySqlReplicaConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.MySqlReplicaConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MySqlReplicaConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.MySqlReplicaConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MySqlReplicaConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.MySqlReplicaConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MySqlReplicaConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.MySqlReplicaConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.MySqlReplicaConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Read-replica configuration specific to MySQL databases.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.MySqlReplicaConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.MySqlReplicaConfiguration) + com.google.cloud.sql.v1.MySqlReplicaConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MySqlReplicaConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MySqlReplicaConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.MySqlReplicaConfiguration.class, + com.google.cloud.sql.v1.MySqlReplicaConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.MySqlReplicaConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetConnectRetryIntervalFieldBuilder(); + internalGetMasterHeartbeatPeriodFieldBuilder(); + internalGetVerifyServerCertificateFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dumpFilePath_ = ""; + username_ = ""; + password_ = ""; + connectRetryInterval_ = null; + if (connectRetryIntervalBuilder_ != null) { + connectRetryIntervalBuilder_.dispose(); + connectRetryIntervalBuilder_ = null; + } + masterHeartbeatPeriod_ = null; + if (masterHeartbeatPeriodBuilder_ != null) { + masterHeartbeatPeriodBuilder_.dispose(); + masterHeartbeatPeriodBuilder_ = null; + } + caCertificate_ = ""; + clientCertificate_ = ""; + clientKey_ = ""; + sslCipher_ = ""; + verifyServerCertificate_ = null; + if (verifyServerCertificateBuilder_ != null) { + verifyServerCertificateBuilder_.dispose(); + verifyServerCertificateBuilder_ = null; + } + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MySqlReplicaConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.MySqlReplicaConfiguration getDefaultInstanceForType() { + return com.google.cloud.sql.v1.MySqlReplicaConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.MySqlReplicaConfiguration build() { + com.google.cloud.sql.v1.MySqlReplicaConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.MySqlReplicaConfiguration buildPartial() { + com.google.cloud.sql.v1.MySqlReplicaConfiguration result = + new com.google.cloud.sql.v1.MySqlReplicaConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.MySqlReplicaConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dumpFilePath_ = dumpFilePath_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.username_ = username_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.password_ = password_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.connectRetryInterval_ = + connectRetryIntervalBuilder_ == null + ? connectRetryInterval_ + : connectRetryIntervalBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.masterHeartbeatPeriod_ = + masterHeartbeatPeriodBuilder_ == null + ? masterHeartbeatPeriod_ + : masterHeartbeatPeriodBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.caCertificate_ = caCertificate_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.clientCertificate_ = clientCertificate_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.clientKey_ = clientKey_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.sslCipher_ = sslCipher_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.verifyServerCertificate_ = + verifyServerCertificateBuilder_ == null + ? verifyServerCertificate_ + : verifyServerCertificateBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.kind_ = kind_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.MySqlReplicaConfiguration) { + return mergeFrom((com.google.cloud.sql.v1.MySqlReplicaConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.MySqlReplicaConfiguration other) { + if (other == com.google.cloud.sql.v1.MySqlReplicaConfiguration.getDefaultInstance()) + return this; + if (!other.getDumpFilePath().isEmpty()) { + dumpFilePath_ = other.dumpFilePath_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasConnectRetryInterval()) { + mergeConnectRetryInterval(other.getConnectRetryInterval()); + } + if (other.hasMasterHeartbeatPeriod()) { + mergeMasterHeartbeatPeriod(other.getMasterHeartbeatPeriod()); + } + if (!other.getCaCertificate().isEmpty()) { + caCertificate_ = other.caCertificate_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getClientCertificate().isEmpty()) { + clientCertificate_ = other.clientCertificate_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getClientKey().isEmpty()) { + clientKey_ = other.clientKey_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (!other.getSslCipher().isEmpty()) { + sslCipher_ = other.sslCipher_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.hasVerifyServerCertificate()) { + mergeVerifyServerCertificate(other.getVerifyServerCertificate()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000400; + 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: + { + dumpFilePath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + username_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetConnectRetryIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetMasterHeartbeatPeriodFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + caCertificate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + clientCertificate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + clientKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + sslCipher_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + input.readMessage( + internalGetVerifyServerCertificateFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 dumpFilePath_ = ""; + + /** + * + * + *
+     * Path to a SQL dump file in Google Cloud Storage from which the replica
+     * instance is to be created. The URI is in the form gs://bucketName/fileName.
+     * Compressed gzip files (.gz) are also supported.
+     * Dumps have the binlog co-ordinates from which replication
+     * begins. This can be accomplished by setting --master-data to 1 when using
+     * mysqldump.
+     * 
+ * + * string dump_file_path = 1; + * + * @return The dumpFilePath. + */ + public java.lang.String getDumpFilePath() { + java.lang.Object ref = dumpFilePath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dumpFilePath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Path to a SQL dump file in Google Cloud Storage from which the replica
+     * instance is to be created. The URI is in the form gs://bucketName/fileName.
+     * Compressed gzip files (.gz) are also supported.
+     * Dumps have the binlog co-ordinates from which replication
+     * begins. This can be accomplished by setting --master-data to 1 when using
+     * mysqldump.
+     * 
+ * + * string dump_file_path = 1; + * + * @return The bytes for dumpFilePath. + */ + public com.google.protobuf.ByteString getDumpFilePathBytes() { + java.lang.Object ref = dumpFilePath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dumpFilePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Path to a SQL dump file in Google Cloud Storage from which the replica
+     * instance is to be created. The URI is in the form gs://bucketName/fileName.
+     * Compressed gzip files (.gz) are also supported.
+     * Dumps have the binlog co-ordinates from which replication
+     * begins. This can be accomplished by setting --master-data to 1 when using
+     * mysqldump.
+     * 
+ * + * string dump_file_path = 1; + * + * @param value The dumpFilePath to set. + * @return This builder for chaining. + */ + public Builder setDumpFilePath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dumpFilePath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Path to a SQL dump file in Google Cloud Storage from which the replica
+     * instance is to be created. The URI is in the form gs://bucketName/fileName.
+     * Compressed gzip files (.gz) are also supported.
+     * Dumps have the binlog co-ordinates from which replication
+     * begins. This can be accomplished by setting --master-data to 1 when using
+     * mysqldump.
+     * 
+ * + * string dump_file_path = 1; + * + * @return This builder for chaining. + */ + public Builder clearDumpFilePath() { + dumpFilePath_ = getDefaultInstance().getDumpFilePath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Path to a SQL dump file in Google Cloud Storage from which the replica
+     * instance is to be created. The URI is in the form gs://bucketName/fileName.
+     * Compressed gzip files (.gz) are also supported.
+     * Dumps have the binlog co-ordinates from which replication
+     * begins. This can be accomplished by setting --master-data to 1 when using
+     * mysqldump.
+     * 
+ * + * string dump_file_path = 1; + * + * @param value The bytes for dumpFilePath to set. + * @return This builder for chaining. + */ + public Builder setDumpFilePathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dumpFilePath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object username_ = ""; + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + username_ = getDefaultInstance().getUsername(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Int32Value connectRetryInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + connectRetryIntervalBuilder_; + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + * + * @return Whether the connectRetryInterval field is set. + */ + public boolean hasConnectRetryInterval() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + * + * @return The connectRetryInterval. + */ + public com.google.protobuf.Int32Value getConnectRetryInterval() { + if (connectRetryIntervalBuilder_ == null) { + return connectRetryInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : connectRetryInterval_; + } else { + return connectRetryIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + public Builder setConnectRetryInterval(com.google.protobuf.Int32Value value) { + if (connectRetryIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connectRetryInterval_ = value; + } else { + connectRetryIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + public Builder setConnectRetryInterval(com.google.protobuf.Int32Value.Builder builderForValue) { + if (connectRetryIntervalBuilder_ == null) { + connectRetryInterval_ = builderForValue.build(); + } else { + connectRetryIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + public Builder mergeConnectRetryInterval(com.google.protobuf.Int32Value value) { + if (connectRetryIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && connectRetryInterval_ != null + && connectRetryInterval_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getConnectRetryIntervalBuilder().mergeFrom(value); + } else { + connectRetryInterval_ = value; + } + } else { + connectRetryIntervalBuilder_.mergeFrom(value); + } + if (connectRetryInterval_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + public Builder clearConnectRetryInterval() { + bitField0_ = (bitField0_ & ~0x00000008); + connectRetryInterval_ = null; + if (connectRetryIntervalBuilder_ != null) { + connectRetryIntervalBuilder_.dispose(); + connectRetryIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + public com.google.protobuf.Int32Value.Builder getConnectRetryIntervalBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetConnectRetryIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + public com.google.protobuf.Int32ValueOrBuilder getConnectRetryIntervalOrBuilder() { + if (connectRetryIntervalBuilder_ != null) { + return connectRetryIntervalBuilder_.getMessageOrBuilder(); + } else { + return connectRetryInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : connectRetryInterval_; + } + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetConnectRetryIntervalFieldBuilder() { + if (connectRetryIntervalBuilder_ == null) { + connectRetryIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getConnectRetryInterval(), getParentForChildren(), isClean()); + connectRetryInterval_ = null; + } + return connectRetryIntervalBuilder_; + } + + private com.google.protobuf.Int64Value masterHeartbeatPeriod_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + masterHeartbeatPeriodBuilder_; + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + * + * @return Whether the masterHeartbeatPeriod field is set. + */ + public boolean hasMasterHeartbeatPeriod() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + * + * @return The masterHeartbeatPeriod. + */ + public com.google.protobuf.Int64Value getMasterHeartbeatPeriod() { + if (masterHeartbeatPeriodBuilder_ == null) { + return masterHeartbeatPeriod_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : masterHeartbeatPeriod_; + } else { + return masterHeartbeatPeriodBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + public Builder setMasterHeartbeatPeriod(com.google.protobuf.Int64Value value) { + if (masterHeartbeatPeriodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + masterHeartbeatPeriod_ = value; + } else { + masterHeartbeatPeriodBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + public Builder setMasterHeartbeatPeriod( + com.google.protobuf.Int64Value.Builder builderForValue) { + if (masterHeartbeatPeriodBuilder_ == null) { + masterHeartbeatPeriod_ = builderForValue.build(); + } else { + masterHeartbeatPeriodBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + public Builder mergeMasterHeartbeatPeriod(com.google.protobuf.Int64Value value) { + if (masterHeartbeatPeriodBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && masterHeartbeatPeriod_ != null + && masterHeartbeatPeriod_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getMasterHeartbeatPeriodBuilder().mergeFrom(value); + } else { + masterHeartbeatPeriod_ = value; + } + } else { + masterHeartbeatPeriodBuilder_.mergeFrom(value); + } + if (masterHeartbeatPeriod_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + public Builder clearMasterHeartbeatPeriod() { + bitField0_ = (bitField0_ & ~0x00000010); + masterHeartbeatPeriod_ = null; + if (masterHeartbeatPeriodBuilder_ != null) { + masterHeartbeatPeriodBuilder_.dispose(); + masterHeartbeatPeriodBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + public com.google.protobuf.Int64Value.Builder getMasterHeartbeatPeriodBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetMasterHeartbeatPeriodFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + public com.google.protobuf.Int64ValueOrBuilder getMasterHeartbeatPeriodOrBuilder() { + if (masterHeartbeatPeriodBuilder_ != null) { + return masterHeartbeatPeriodBuilder_.getMessageOrBuilder(); + } else { + return masterHeartbeatPeriod_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : masterHeartbeatPeriod_; + } + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetMasterHeartbeatPeriodFieldBuilder() { + if (masterHeartbeatPeriodBuilder_ == null) { + masterHeartbeatPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getMasterHeartbeatPeriod(), getParentForChildren(), isClean()); + masterHeartbeatPeriod_ = null; + } + return masterHeartbeatPeriodBuilder_; + } + + private java.lang.Object caCertificate_ = ""; + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @return The caCertificate. + */ + public java.lang.String getCaCertificate() { + java.lang.Object ref = caCertificate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCertificate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @return The bytes for caCertificate. + */ + public com.google.protobuf.ByteString getCaCertificateBytes() { + java.lang.Object ref = caCertificate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @param value The caCertificate to set. + * @return This builder for chaining. + */ + public Builder setCaCertificate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + caCertificate_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @return This builder for chaining. + */ + public Builder clearCaCertificate() { + caCertificate_ = getDefaultInstance().getCaCertificate(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @param value The bytes for caCertificate to set. + * @return This builder for chaining. + */ + public Builder setCaCertificateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + caCertificate_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object clientCertificate_ = ""; + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 7; + * + * @return The clientCertificate. + */ + public java.lang.String getClientCertificate() { + java.lang.Object ref = clientCertificate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientCertificate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 7; + * + * @return The bytes for clientCertificate. + */ + public com.google.protobuf.ByteString getClientCertificateBytes() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 7; + * + * @param value The clientCertificate to set. + * @return This builder for chaining. + */ + public Builder setClientCertificate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clientCertificate_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 7; + * + * @return This builder for chaining. + */ + public Builder clearClientCertificate() { + clientCertificate_ = getDefaultInstance().getClientCertificate(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 7; + * + * @param value The bytes for clientCertificate to set. + * @return This builder for chaining. + */ + public Builder setClientCertificateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clientCertificate_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object clientKey_ = ""; + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 8; + * + * @return The clientKey. + */ + public java.lang.String getClientKey() { + java.lang.Object ref = clientKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 8; + * + * @return The bytes for clientKey. + */ + public com.google.protobuf.ByteString getClientKeyBytes() { + java.lang.Object ref = clientKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 8; + * + * @param value The clientKey to set. + * @return This builder for chaining. + */ + public Builder setClientKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clientKey_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 8; + * + * @return This builder for chaining. + */ + public Builder clearClientKey() { + clientKey_ = getDefaultInstance().getClientKey(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 8; + * + * @param value The bytes for clientKey to set. + * @return This builder for chaining. + */ + public Builder setClientKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clientKey_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object sslCipher_ = ""; + + /** + * + * + *
+     * A list of permissible ciphers to use for SSL encryption.
+     * 
+ * + * string ssl_cipher = 9; + * + * @return The sslCipher. + */ + public java.lang.String getSslCipher() { + java.lang.Object ref = sslCipher_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sslCipher_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A list of permissible ciphers to use for SSL encryption.
+     * 
+ * + * string ssl_cipher = 9; + * + * @return The bytes for sslCipher. + */ + public com.google.protobuf.ByteString getSslCipherBytes() { + java.lang.Object ref = sslCipher_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sslCipher_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A list of permissible ciphers to use for SSL encryption.
+     * 
+ * + * string ssl_cipher = 9; + * + * @param value The sslCipher to set. + * @return This builder for chaining. + */ + public Builder setSslCipher(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sslCipher_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * A list of permissible ciphers to use for SSL encryption.
+     * 
+ * + * string ssl_cipher = 9; + * + * @return This builder for chaining. + */ + public Builder clearSslCipher() { + sslCipher_ = getDefaultInstance().getSslCipher(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
+     * A list of permissible ciphers to use for SSL encryption.
+     * 
+ * + * string ssl_cipher = 9; + * + * @param value The bytes for sslCipher to set. + * @return This builder for chaining. + */ + public Builder setSslCipherBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sslCipher_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue verifyServerCertificate_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + verifyServerCertificateBuilder_; + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + * + * @return Whether the verifyServerCertificate field is set. + */ + public boolean hasVerifyServerCertificate() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + * + * @return The verifyServerCertificate. + */ + public com.google.protobuf.BoolValue getVerifyServerCertificate() { + if (verifyServerCertificateBuilder_ == null) { + return verifyServerCertificate_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyServerCertificate_; + } else { + return verifyServerCertificateBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + public Builder setVerifyServerCertificate(com.google.protobuf.BoolValue value) { + if (verifyServerCertificateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + verifyServerCertificate_ = value; + } else { + verifyServerCertificateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + public Builder setVerifyServerCertificate( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (verifyServerCertificateBuilder_ == null) { + verifyServerCertificate_ = builderForValue.build(); + } else { + verifyServerCertificateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + public Builder mergeVerifyServerCertificate(com.google.protobuf.BoolValue value) { + if (verifyServerCertificateBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && verifyServerCertificate_ != null + && verifyServerCertificate_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getVerifyServerCertificateBuilder().mergeFrom(value); + } else { + verifyServerCertificate_ = value; + } + } else { + verifyServerCertificateBuilder_.mergeFrom(value); + } + if (verifyServerCertificate_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + public Builder clearVerifyServerCertificate() { + bitField0_ = (bitField0_ & ~0x00000200); + verifyServerCertificate_ = null; + if (verifyServerCertificateBuilder_ != null) { + verifyServerCertificateBuilder_.dispose(); + verifyServerCertificateBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + public com.google.protobuf.BoolValue.Builder getVerifyServerCertificateBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetVerifyServerCertificateFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + public com.google.protobuf.BoolValueOrBuilder getVerifyServerCertificateOrBuilder() { + if (verifyServerCertificateBuilder_ != null) { + return verifyServerCertificateBuilder_.getMessageOrBuilder(); + } else { + return verifyServerCertificate_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyServerCertificate_; + } + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetVerifyServerCertificateFieldBuilder() { + if (verifyServerCertificateBuilder_ == null) { + verifyServerCertificateBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getVerifyServerCertificate(), getParentForChildren(), isClean()); + verifyServerCertificate_ = null; + } + return verifyServerCertificateBuilder_; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#mysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 11; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#mysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 11; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#mysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 11; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#mysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 11; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#mysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 11; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.MySqlReplicaConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.MySqlReplicaConfiguration) + private static final com.google.cloud.sql.v1.MySqlReplicaConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.MySqlReplicaConfiguration(); + } + + public static com.google.cloud.sql.v1.MySqlReplicaConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MySqlReplicaConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.MySqlReplicaConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MySqlReplicaConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MySqlReplicaConfigurationOrBuilder.java new file mode 100644 index 000000000000..23791843dc40 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MySqlReplicaConfigurationOrBuilder.java @@ -0,0 +1,362 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface MySqlReplicaConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.MySqlReplicaConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Path to a SQL dump file in Google Cloud Storage from which the replica
+   * instance is to be created. The URI is in the form gs://bucketName/fileName.
+   * Compressed gzip files (.gz) are also supported.
+   * Dumps have the binlog co-ordinates from which replication
+   * begins. This can be accomplished by setting --master-data to 1 when using
+   * mysqldump.
+   * 
+ * + * string dump_file_path = 1; + * + * @return The dumpFilePath. + */ + java.lang.String getDumpFilePath(); + + /** + * + * + *
+   * Path to a SQL dump file in Google Cloud Storage from which the replica
+   * instance is to be created. The URI is in the form gs://bucketName/fileName.
+   * Compressed gzip files (.gz) are also supported.
+   * Dumps have the binlog co-ordinates from which replication
+   * begins. This can be accomplished by setting --master-data to 1 when using
+   * mysqldump.
+   * 
+ * + * string dump_file_path = 1; + * + * @return The bytes for dumpFilePath. + */ + com.google.protobuf.ByteString getDumpFilePathBytes(); + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The username. + */ + java.lang.String getUsername(); + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The password. + */ + java.lang.String getPassword(); + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * + * + *
+   * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+   * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + * + * @return Whether the connectRetryInterval field is set. + */ + boolean hasConnectRetryInterval(); + + /** + * + * + *
+   * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+   * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + * + * @return The connectRetryInterval. + */ + com.google.protobuf.Int32Value getConnectRetryInterval(); + + /** + * + * + *
+   * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+   * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + com.google.protobuf.Int32ValueOrBuilder getConnectRetryIntervalOrBuilder(); + + /** + * + * + *
+   * Interval in milliseconds between replication heartbeats.
+   * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + * + * @return Whether the masterHeartbeatPeriod field is set. + */ + boolean hasMasterHeartbeatPeriod(); + + /** + * + * + *
+   * Interval in milliseconds between replication heartbeats.
+   * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + * + * @return The masterHeartbeatPeriod. + */ + com.google.protobuf.Int64Value getMasterHeartbeatPeriod(); + + /** + * + * + *
+   * Interval in milliseconds between replication heartbeats.
+   * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + com.google.protobuf.Int64ValueOrBuilder getMasterHeartbeatPeriodOrBuilder(); + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The caCertificate. + */ + java.lang.String getCaCertificate(); + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The bytes for caCertificate. + */ + com.google.protobuf.ByteString getCaCertificateBytes(); + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 7; + * + * @return The clientCertificate. + */ + java.lang.String getClientCertificate(); + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 7; + * + * @return The bytes for clientCertificate. + */ + com.google.protobuf.ByteString getClientCertificateBytes(); + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 8; + * + * @return The clientKey. + */ + java.lang.String getClientKey(); + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 8; + * + * @return The bytes for clientKey. + */ + com.google.protobuf.ByteString getClientKeyBytes(); + + /** + * + * + *
+   * A list of permissible ciphers to use for SSL encryption.
+   * 
+ * + * string ssl_cipher = 9; + * + * @return The sslCipher. + */ + java.lang.String getSslCipher(); + + /** + * + * + *
+   * A list of permissible ciphers to use for SSL encryption.
+   * 
+ * + * string ssl_cipher = 9; + * + * @return The bytes for sslCipher. + */ + com.google.protobuf.ByteString getSslCipherBytes(); + + /** + * + * + *
+   * Whether or not to check the primary instance's Common Name value in the
+   * certificate that it sends during the SSL handshake.
+   * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + * + * @return Whether the verifyServerCertificate field is set. + */ + boolean hasVerifyServerCertificate(); + + /** + * + * + *
+   * Whether or not to check the primary instance's Common Name value in the
+   * certificate that it sends during the SSL handshake.
+   * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + * + * @return The verifyServerCertificate. + */ + com.google.protobuf.BoolValue getVerifyServerCertificate(); + + /** + * + * + *
+   * Whether or not to check the primary instance's Common Name value in the
+   * certificate that it sends during the SSL handshake.
+   * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + com.google.protobuf.BoolValueOrBuilder getVerifyServerCertificateOrBuilder(); + + /** + * + * + *
+   * This is always `sql#mysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 11; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#mysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 11; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MySqlSyncConfig.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MySqlSyncConfig.java new file mode 100644 index 000000000000..46aab276c89c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MySqlSyncConfig.java @@ -0,0 +1,923 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * MySQL-specific external server sync settings.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.MySqlSyncConfig} + */ +@com.google.protobuf.Generated +public final class MySqlSyncConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.MySqlSyncConfig) + MySqlSyncConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MySqlSyncConfig"); + } + + // Use MySqlSyncConfig.newBuilder() to construct. + private MySqlSyncConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MySqlSyncConfig() { + initialSyncFlags_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MySqlSyncConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MySqlSyncConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.MySqlSyncConfig.class, + com.google.cloud.sql.v1.MySqlSyncConfig.Builder.class); + } + + public static final int INITIAL_SYNC_FLAGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List initialSyncFlags_; + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + @java.lang.Override + public java.util.List getInitialSyncFlagsList() { + return initialSyncFlags_; + } + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + @java.lang.Override + public java.util.List + getInitialSyncFlagsOrBuilderList() { + return initialSyncFlags_; + } + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + @java.lang.Override + public int getInitialSyncFlagsCount() { + return initialSyncFlags_.size(); + } + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SyncFlags getInitialSyncFlags(int index) { + return initialSyncFlags_.get(index); + } + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SyncFlagsOrBuilder getInitialSyncFlagsOrBuilder(int index) { + return initialSyncFlags_.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 < initialSyncFlags_.size(); i++) { + output.writeMessage(1, initialSyncFlags_.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 < initialSyncFlags_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, initialSyncFlags_.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.sql.v1.MySqlSyncConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.MySqlSyncConfig other = (com.google.cloud.sql.v1.MySqlSyncConfig) obj; + + if (!getInitialSyncFlagsList().equals(other.getInitialSyncFlagsList())) return false; + if (!getUnknownFields().equals(other.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 (getInitialSyncFlagsCount() > 0) { + hash = (37 * hash) + INITIAL_SYNC_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getInitialSyncFlagsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.MySqlSyncConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.MySqlSyncConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MySqlSyncConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.MySqlSyncConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MySqlSyncConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.MySqlSyncConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MySqlSyncConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.MySqlSyncConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MySqlSyncConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.MySqlSyncConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.MySqlSyncConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.MySqlSyncConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.MySqlSyncConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * MySQL-specific external server sync settings.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.MySqlSyncConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.MySqlSyncConfig) + com.google.cloud.sql.v1.MySqlSyncConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MySqlSyncConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MySqlSyncConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.MySqlSyncConfig.class, + com.google.cloud.sql.v1.MySqlSyncConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.MySqlSyncConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (initialSyncFlagsBuilder_ == null) { + initialSyncFlags_ = java.util.Collections.emptyList(); + } else { + initialSyncFlags_ = null; + initialSyncFlagsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_MySqlSyncConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.MySqlSyncConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.MySqlSyncConfig build() { + com.google.cloud.sql.v1.MySqlSyncConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.MySqlSyncConfig buildPartial() { + com.google.cloud.sql.v1.MySqlSyncConfig result = + new com.google.cloud.sql.v1.MySqlSyncConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.MySqlSyncConfig result) { + if (initialSyncFlagsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + initialSyncFlags_ = java.util.Collections.unmodifiableList(initialSyncFlags_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.initialSyncFlags_ = initialSyncFlags_; + } else { + result.initialSyncFlags_ = initialSyncFlagsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.MySqlSyncConfig result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.MySqlSyncConfig) { + return mergeFrom((com.google.cloud.sql.v1.MySqlSyncConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.MySqlSyncConfig other) { + if (other == com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance()) return this; + if (initialSyncFlagsBuilder_ == null) { + if (!other.initialSyncFlags_.isEmpty()) { + if (initialSyncFlags_.isEmpty()) { + initialSyncFlags_ = other.initialSyncFlags_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.addAll(other.initialSyncFlags_); + } + onChanged(); + } + } else { + if (!other.initialSyncFlags_.isEmpty()) { + if (initialSyncFlagsBuilder_.isEmpty()) { + initialSyncFlagsBuilder_.dispose(); + initialSyncFlagsBuilder_ = null; + initialSyncFlags_ = other.initialSyncFlags_; + bitField0_ = (bitField0_ & ~0x00000001); + initialSyncFlagsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetInitialSyncFlagsFieldBuilder() + : null; + } else { + initialSyncFlagsBuilder_.addAllMessages(other.initialSyncFlags_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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.sql.v1.SyncFlags m = + input.readMessage( + com.google.cloud.sql.v1.SyncFlags.parser(), extensionRegistry); + if (initialSyncFlagsBuilder_ == null) { + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.add(m); + } else { + initialSyncFlagsBuilder_.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 initialSyncFlags_ = + java.util.Collections.emptyList(); + + private void ensureInitialSyncFlagsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + initialSyncFlags_ = + new java.util.ArrayList(initialSyncFlags_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SyncFlags, + com.google.cloud.sql.v1.SyncFlags.Builder, + com.google.cloud.sql.v1.SyncFlagsOrBuilder> + initialSyncFlagsBuilder_; + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public java.util.List getInitialSyncFlagsList() { + if (initialSyncFlagsBuilder_ == null) { + return java.util.Collections.unmodifiableList(initialSyncFlags_); + } else { + return initialSyncFlagsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public int getInitialSyncFlagsCount() { + if (initialSyncFlagsBuilder_ == null) { + return initialSyncFlags_.size(); + } else { + return initialSyncFlagsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public com.google.cloud.sql.v1.SyncFlags getInitialSyncFlags(int index) { + if (initialSyncFlagsBuilder_ == null) { + return initialSyncFlags_.get(index); + } else { + return initialSyncFlagsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public Builder setInitialSyncFlags(int index, com.google.cloud.sql.v1.SyncFlags value) { + if (initialSyncFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.set(index, value); + onChanged(); + } else { + initialSyncFlagsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public Builder setInitialSyncFlags( + int index, com.google.cloud.sql.v1.SyncFlags.Builder builderForValue) { + if (initialSyncFlagsBuilder_ == null) { + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.set(index, builderForValue.build()); + onChanged(); + } else { + initialSyncFlagsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public Builder addInitialSyncFlags(com.google.cloud.sql.v1.SyncFlags value) { + if (initialSyncFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.add(value); + onChanged(); + } else { + initialSyncFlagsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public Builder addInitialSyncFlags(int index, com.google.cloud.sql.v1.SyncFlags value) { + if (initialSyncFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.add(index, value); + onChanged(); + } else { + initialSyncFlagsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public Builder addInitialSyncFlags(com.google.cloud.sql.v1.SyncFlags.Builder builderForValue) { + if (initialSyncFlagsBuilder_ == null) { + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.add(builderForValue.build()); + onChanged(); + } else { + initialSyncFlagsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public Builder addInitialSyncFlags( + int index, com.google.cloud.sql.v1.SyncFlags.Builder builderForValue) { + if (initialSyncFlagsBuilder_ == null) { + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.add(index, builderForValue.build()); + onChanged(); + } else { + initialSyncFlagsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public Builder addAllInitialSyncFlags( + java.lang.Iterable values) { + if (initialSyncFlagsBuilder_ == null) { + ensureInitialSyncFlagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, initialSyncFlags_); + onChanged(); + } else { + initialSyncFlagsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public Builder clearInitialSyncFlags() { + if (initialSyncFlagsBuilder_ == null) { + initialSyncFlags_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + initialSyncFlagsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public Builder removeInitialSyncFlags(int index) { + if (initialSyncFlagsBuilder_ == null) { + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.remove(index); + onChanged(); + } else { + initialSyncFlagsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public com.google.cloud.sql.v1.SyncFlags.Builder getInitialSyncFlagsBuilder(int index) { + return internalGetInitialSyncFlagsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public com.google.cloud.sql.v1.SyncFlagsOrBuilder getInitialSyncFlagsOrBuilder(int index) { + if (initialSyncFlagsBuilder_ == null) { + return initialSyncFlags_.get(index); + } else { + return initialSyncFlagsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public java.util.List + getInitialSyncFlagsOrBuilderList() { + if (initialSyncFlagsBuilder_ != null) { + return initialSyncFlagsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(initialSyncFlags_); + } + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public com.google.cloud.sql.v1.SyncFlags.Builder addInitialSyncFlagsBuilder() { + return internalGetInitialSyncFlagsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.SyncFlags.getDefaultInstance()); + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public com.google.cloud.sql.v1.SyncFlags.Builder addInitialSyncFlagsBuilder(int index) { + return internalGetInitialSyncFlagsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.SyncFlags.getDefaultInstance()); + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + public java.util.List + getInitialSyncFlagsBuilderList() { + return internalGetInitialSyncFlagsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SyncFlags, + com.google.cloud.sql.v1.SyncFlags.Builder, + com.google.cloud.sql.v1.SyncFlagsOrBuilder> + internalGetInitialSyncFlagsFieldBuilder() { + if (initialSyncFlagsBuilder_ == null) { + initialSyncFlagsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SyncFlags, + com.google.cloud.sql.v1.SyncFlags.Builder, + com.google.cloud.sql.v1.SyncFlagsOrBuilder>( + initialSyncFlags_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + initialSyncFlags_ = null; + } + return initialSyncFlagsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.MySqlSyncConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.MySqlSyncConfig) + private static final com.google.cloud.sql.v1.MySqlSyncConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.MySqlSyncConfig(); + } + + public static com.google.cloud.sql.v1.MySqlSyncConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MySqlSyncConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.MySqlSyncConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MySqlSyncConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MySqlSyncConfigOrBuilder.java new file mode 100644 index 000000000000..8c7857fdd317 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/MySqlSyncConfigOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface MySqlSyncConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.MySqlSyncConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + java.util.List getInitialSyncFlagsList(); + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + com.google.cloud.sql.v1.SyncFlags getInitialSyncFlags(int index); + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + int getInitialSyncFlagsCount(); + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + java.util.List + getInitialSyncFlagsOrBuilderList(); + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1.SyncFlags initial_sync_flags = 1; + */ + com.google.cloud.sql.v1.SyncFlagsOrBuilder getInitialSyncFlagsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OnPremisesConfiguration.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OnPremisesConfiguration.java new file mode 100644 index 000000000000..c56d52731eac --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OnPremisesConfiguration.java @@ -0,0 +1,3180 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * On-premises instance configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.OnPremisesConfiguration} + */ +@com.google.protobuf.Generated +public final class OnPremisesConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.OnPremisesConfiguration) + OnPremisesConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OnPremisesConfiguration"); + } + + // Use OnPremisesConfiguration.newBuilder() to construct. + private OnPremisesConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OnPremisesConfiguration() { + hostPort_ = ""; + kind_ = ""; + username_ = ""; + password_ = ""; + caCertificate_ = ""; + clientCertificate_ = ""; + clientKey_ = ""; + dumpFilePath_ = ""; + selectedObjects_ = java.util.Collections.emptyList(); + sslOption_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_OnPremisesConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_OnPremisesConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.OnPremisesConfiguration.class, + com.google.cloud.sql.v1.OnPremisesConfiguration.Builder.class); + } + + /** + * + * + *
+   * SslOption defines the SSL mode to be used for replica connection to the
+   * on-premises source.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.OnPremisesConfiguration.SslOption} + */ + public enum SslOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown SSL option i.e. SSL option not specified by user.
+     * 
+ * + * SSL_OPTION_UNSPECIFIED = 0; + */ + SSL_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * SSL is not used for replica connection to the on-premises source.
+     * 
+ * + * DISABLE = 1; + */ + DISABLE(1), + /** + * + * + *
+     * SSL is required for replica connection to the on-premises source.
+     * 
+ * + * REQUIRE = 2; + */ + REQUIRE(2), + /** + * + * + *
+     * Verify CA is required for replica connection to the on-premises source.
+     * 
+ * + * VERIFY_CA = 3; + */ + VERIFY_CA(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslOption"); + } + + /** + * + * + *
+     * Unknown SSL option i.e. SSL option not specified by user.
+     * 
+ * + * SSL_OPTION_UNSPECIFIED = 0; + */ + public static final int SSL_OPTION_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * SSL is not used for replica connection to the on-premises source.
+     * 
+ * + * DISABLE = 1; + */ + public static final int DISABLE_VALUE = 1; + + /** + * + * + *
+     * SSL is required for replica connection to the on-premises source.
+     * 
+ * + * REQUIRE = 2; + */ + public static final int REQUIRE_VALUE = 2; + + /** + * + * + *
+     * Verify CA is required for replica connection to the on-premises source.
+     * 
+ * + * VERIFY_CA = 3; + */ + public static final int VERIFY_CA_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SslOption 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 SslOption forNumber(int value) { + switch (value) { + case 0: + return SSL_OPTION_UNSPECIFIED; + case 1: + return DISABLE; + case 2: + return REQUIRE; + case 3: + return VERIFY_CA; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SslOption findValueByNumber(int number) { + return SslOption.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.OnPremisesConfiguration.getDescriptor().getEnumTypes().get(0); + } + + private static final SslOption[] VALUES = values(); + + public static SslOption 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 SslOption(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.OnPremisesConfiguration.SslOption) + } + + private int bitField0_; + public static final int HOST_PORT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object hostPort_ = ""; + + /** + * + * + *
+   * The host and port of the on-premises instance in host:port format
+   * 
+ * + * string host_port = 1; + * + * @return The hostPort. + */ + @java.lang.Override + public java.lang.String getHostPort() { + java.lang.Object ref = hostPort_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostPort_ = s; + return s; + } + } + + /** + * + * + *
+   * The host and port of the on-premises instance in host:port format
+   * 
+ * + * string host_port = 1; + * + * @return The bytes for hostPort. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostPortBytes() { + java.lang.Object ref = hostPort_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostPort_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#onPremisesConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#onPremisesConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERNAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object username_ = ""; + + /** + * + * + *
+   * The username for connecting to on-premises instance.
+   * 
+ * + * string username = 3; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } + } + + /** + * + * + *
+   * The username for connecting to on-premises instance.
+   * 
+ * + * string username = 3; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + + /** + * + * + *
+   * The password for connecting to on-premises instance.
+   * 
+ * + * string password = 4; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + + /** + * + * + *
+   * The password for connecting to on-premises instance.
+   * 
+ * + * string password = 4; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CA_CERTIFICATE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object caCertificate_ = ""; + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 5; + * + * @return The caCertificate. + */ + @java.lang.Override + public java.lang.String getCaCertificate() { + java.lang.Object ref = caCertificate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCertificate_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 5; + * + * @return The bytes for caCertificate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCaCertificateBytes() { + java.lang.Object ref = caCertificate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_CERTIFICATE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object clientCertificate_ = ""; + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 6; + * + * @return The clientCertificate. + */ + @java.lang.Override + public java.lang.String getClientCertificate() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientCertificate_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 6; + * + * @return The bytes for clientCertificate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientCertificateBytes() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_KEY_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object clientKey_ = ""; + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 7; + * + * @return The clientKey. + */ + @java.lang.Override + public java.lang.String getClientKey() { + java.lang.Object ref = clientKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientKey_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 7; + * + * @return The bytes for clientKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientKeyBytes() { + java.lang.Object ref = clientKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DUMP_FILE_PATH_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object dumpFilePath_ = ""; + + /** + * + * + *
+   * The dump file to create the Cloud SQL replica.
+   * 
+ * + * string dump_file_path = 8; + * + * @return The dumpFilePath. + */ + @java.lang.Override + public java.lang.String getDumpFilePath() { + java.lang.Object ref = dumpFilePath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dumpFilePath_ = s; + return s; + } + } + + /** + * + * + *
+   * The dump file to create the Cloud SQL replica.
+   * 
+ * + * string dump_file_path = 8; + * + * @return The bytes for dumpFilePath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDumpFilePathBytes() { + java.lang.Object ref = dumpFilePath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dumpFilePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_INSTANCE_FIELD_NUMBER = 15; + private com.google.cloud.sql.v1.InstanceReference sourceInstance_; + + /** + * + * + *
+   * The reference to Cloud SQL instance if the source is Cloud SQL.
+   * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + * + * @return Whether the sourceInstance field is set. + */ + @java.lang.Override + public boolean hasSourceInstance() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The reference to Cloud SQL instance if the source is Cloud SQL.
+   * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + * + * @return The sourceInstance. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstanceReference getSourceInstance() { + return sourceInstance_ == null + ? com.google.cloud.sql.v1.InstanceReference.getDefaultInstance() + : sourceInstance_; + } + + /** + * + * + *
+   * The reference to Cloud SQL instance if the source is Cloud SQL.
+   * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstanceReferenceOrBuilder getSourceInstanceOrBuilder() { + return sourceInstance_ == null + ? com.google.cloud.sql.v1.InstanceReference.getDefaultInstance() + : sourceInstance_; + } + + public static final int SELECTED_OBJECTS_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private java.util.List selectedObjects_; + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getSelectedObjectsList() { + return selectedObjects_; + } + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getSelectedObjectsOrBuilderList() { + return selectedObjects_; + } + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getSelectedObjectsCount() { + return selectedObjects_.size(); + } + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.SelectedObjects getSelectedObjects(int index) { + return selectedObjects_.get(index); + } + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.SelectedObjectsOrBuilder getSelectedObjectsOrBuilder(int index) { + return selectedObjects_.get(index); + } + + public static final int SSL_OPTION_FIELD_NUMBER = 18; + private int sslOption_ = 0; + + /** + * + * + *
+   * Optional. SSL option for replica connection to the on-premises source.
+   * 
+ * + * + * .google.cloud.sql.v1.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslOption. + */ + @java.lang.Override + public int getSslOptionValue() { + return sslOption_; + } + + /** + * + * + *
+   * Optional. SSL option for replica connection to the on-premises source.
+   * 
+ * + * + * .google.cloud.sql.v1.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslOption. + */ + @java.lang.Override + public com.google.cloud.sql.v1.OnPremisesConfiguration.SslOption getSslOption() { + com.google.cloud.sql.v1.OnPremisesConfiguration.SslOption result = + com.google.cloud.sql.v1.OnPremisesConfiguration.SslOption.forNumber(sslOption_); + return result == null + ? com.google.cloud.sql.v1.OnPremisesConfiguration.SslOption.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.GeneratedMessage.isStringEmpty(hostPort_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, hostPort_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(username_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, username_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, password_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(caCertificate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, caCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientCertificate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, clientCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, clientKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dumpFilePath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, dumpFilePath_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(15, getSourceInstance()); + } + for (int i = 0; i < selectedObjects_.size(); i++) { + output.writeMessage(16, selectedObjects_.get(i)); + } + if (sslOption_ + != com.google.cloud.sql.v1.OnPremisesConfiguration.SslOption.SSL_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(18, sslOption_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(hostPort_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, hostPort_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(username_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, username_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, password_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(caCertificate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, caCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientCertificate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, clientCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, clientKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dumpFilePath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, dumpFilePath_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getSourceInstance()); + } + for (int i = 0; i < selectedObjects_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, selectedObjects_.get(i)); + } + if (sslOption_ + != com.google.cloud.sql.v1.OnPremisesConfiguration.SslOption.SSL_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(18, sslOption_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.OnPremisesConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.OnPremisesConfiguration other = + (com.google.cloud.sql.v1.OnPremisesConfiguration) obj; + + if (!getHostPort().equals(other.getHostPort())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUsername().equals(other.getUsername())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (!getCaCertificate().equals(other.getCaCertificate())) return false; + if (!getClientCertificate().equals(other.getClientCertificate())) return false; + if (!getClientKey().equals(other.getClientKey())) return false; + if (!getDumpFilePath().equals(other.getDumpFilePath())) return false; + if (hasSourceInstance() != other.hasSourceInstance()) return false; + if (hasSourceInstance()) { + if (!getSourceInstance().equals(other.getSourceInstance())) return false; + } + if (!getSelectedObjectsList().equals(other.getSelectedObjectsList())) return false; + if (sslOption_ != other.sslOption_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HOST_PORT_FIELD_NUMBER; + hash = (53 * hash) + getHostPort().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (37 * hash) + CA_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getCaCertificate().hashCode(); + hash = (37 * hash) + CLIENT_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getClientCertificate().hashCode(); + hash = (37 * hash) + CLIENT_KEY_FIELD_NUMBER; + hash = (53 * hash) + getClientKey().hashCode(); + hash = (37 * hash) + DUMP_FILE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getDumpFilePath().hashCode(); + if (hasSourceInstance()) { + hash = (37 * hash) + SOURCE_INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getSourceInstance().hashCode(); + } + if (getSelectedObjectsCount() > 0) { + hash = (37 * hash) + SELECTED_OBJECTS_FIELD_NUMBER; + hash = (53 * hash) + getSelectedObjectsList().hashCode(); + } + hash = (37 * hash) + SSL_OPTION_FIELD_NUMBER; + hash = (53 * hash) + sslOption_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.OnPremisesConfiguration parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.OnPremisesConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OnPremisesConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.OnPremisesConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OnPremisesConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.OnPremisesConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OnPremisesConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.OnPremisesConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OnPremisesConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.OnPremisesConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OnPremisesConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.OnPremisesConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.OnPremisesConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * On-premises instance configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.OnPremisesConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.OnPremisesConfiguration) + com.google.cloud.sql.v1.OnPremisesConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_OnPremisesConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_OnPremisesConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.OnPremisesConfiguration.class, + com.google.cloud.sql.v1.OnPremisesConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.OnPremisesConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSourceInstanceFieldBuilder(); + internalGetSelectedObjectsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + hostPort_ = ""; + kind_ = ""; + username_ = ""; + password_ = ""; + caCertificate_ = ""; + clientCertificate_ = ""; + clientKey_ = ""; + dumpFilePath_ = ""; + sourceInstance_ = null; + if (sourceInstanceBuilder_ != null) { + sourceInstanceBuilder_.dispose(); + sourceInstanceBuilder_ = null; + } + if (selectedObjectsBuilder_ == null) { + selectedObjects_ = java.util.Collections.emptyList(); + } else { + selectedObjects_ = null; + selectedObjectsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + sslOption_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_OnPremisesConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.OnPremisesConfiguration getDefaultInstanceForType() { + return com.google.cloud.sql.v1.OnPremisesConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.OnPremisesConfiguration build() { + com.google.cloud.sql.v1.OnPremisesConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.OnPremisesConfiguration buildPartial() { + com.google.cloud.sql.v1.OnPremisesConfiguration result = + new com.google.cloud.sql.v1.OnPremisesConfiguration(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1.OnPremisesConfiguration result) { + if (selectedObjectsBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0)) { + selectedObjects_ = java.util.Collections.unmodifiableList(selectedObjects_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.selectedObjects_ = selectedObjects_; + } else { + result.selectedObjects_ = selectedObjectsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.OnPremisesConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.hostPort_ = hostPort_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.username_ = username_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.password_ = password_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.caCertificate_ = caCertificate_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.clientCertificate_ = clientCertificate_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.clientKey_ = clientKey_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.dumpFilePath_ = dumpFilePath_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000100) != 0)) { + result.sourceInstance_ = + sourceInstanceBuilder_ == null ? sourceInstance_ : sourceInstanceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.sslOption_ = sslOption_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.OnPremisesConfiguration) { + return mergeFrom((com.google.cloud.sql.v1.OnPremisesConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.OnPremisesConfiguration other) { + if (other == com.google.cloud.sql.v1.OnPremisesConfiguration.getDefaultInstance()) + return this; + if (!other.getHostPort().isEmpty()) { + hostPort_ = other.hostPort_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getCaCertificate().isEmpty()) { + caCertificate_ = other.caCertificate_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getClientCertificate().isEmpty()) { + clientCertificate_ = other.clientCertificate_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getClientKey().isEmpty()) { + clientKey_ = other.clientKey_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getDumpFilePath().isEmpty()) { + dumpFilePath_ = other.dumpFilePath_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.hasSourceInstance()) { + mergeSourceInstance(other.getSourceInstance()); + } + if (selectedObjectsBuilder_ == null) { + if (!other.selectedObjects_.isEmpty()) { + if (selectedObjects_.isEmpty()) { + selectedObjects_ = other.selectedObjects_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureSelectedObjectsIsMutable(); + selectedObjects_.addAll(other.selectedObjects_); + } + onChanged(); + } + } else { + if (!other.selectedObjects_.isEmpty()) { + if (selectedObjectsBuilder_.isEmpty()) { + selectedObjectsBuilder_.dispose(); + selectedObjectsBuilder_ = null; + selectedObjects_ = other.selectedObjects_; + bitField0_ = (bitField0_ & ~0x00000200); + selectedObjectsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetSelectedObjectsFieldBuilder() + : null; + } else { + selectedObjectsBuilder_.addAllMessages(other.selectedObjects_); + } + } + } + if (other.sslOption_ != 0) { + setSslOptionValue(other.getSslOptionValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + hostPort_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + username_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + caCertificate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + clientCertificate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + clientKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + dumpFilePath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 122: + { + input.readMessage( + internalGetSourceInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 122 + case 130: + { + com.google.cloud.sql.v1.SelectedObjects m = + input.readMessage( + com.google.cloud.sql.v1.SelectedObjects.parser(), extensionRegistry); + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(m); + } else { + selectedObjectsBuilder_.addMessage(m); + } + break; + } // case 130 + case 144: + { + sslOption_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 144 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object hostPort_ = ""; + + /** + * + * + *
+     * The host and port of the on-premises instance in host:port format
+     * 
+ * + * string host_port = 1; + * + * @return The hostPort. + */ + public java.lang.String getHostPort() { + java.lang.Object ref = hostPort_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostPort_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The host and port of the on-premises instance in host:port format
+     * 
+ * + * string host_port = 1; + * + * @return The bytes for hostPort. + */ + public com.google.protobuf.ByteString getHostPortBytes() { + java.lang.Object ref = hostPort_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostPort_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The host and port of the on-premises instance in host:port format
+     * 
+ * + * string host_port = 1; + * + * @param value The hostPort to set. + * @return This builder for chaining. + */ + public Builder setHostPort(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + hostPort_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The host and port of the on-premises instance in host:port format
+     * 
+ * + * string host_port = 1; + * + * @return This builder for chaining. + */ + public Builder clearHostPort() { + hostPort_ = getDefaultInstance().getHostPort(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The host and port of the on-premises instance in host:port format
+     * 
+ * + * string host_port = 1; + * + * @param value The bytes for hostPort to set. + * @return This builder for chaining. + */ + public Builder setHostPortBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + hostPort_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#onPremisesConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#onPremisesConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#onPremisesConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#onPremisesConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#onPremisesConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object username_ = ""; + + /** + * + * + *
+     * The username for connecting to on-premises instance.
+     * 
+ * + * string username = 3; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The username for connecting to on-premises instance.
+     * 
+ * + * string username = 3; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The username for connecting to on-premises instance.
+     * 
+ * + * string username = 3; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + username_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The username for connecting to on-premises instance.
+     * 
+ * + * string username = 3; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + username_ = getDefaultInstance().getUsername(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The username for connecting to on-premises instance.
+     * 
+ * + * string username = 3; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + username_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + + /** + * + * + *
+     * The password for connecting to on-premises instance.
+     * 
+ * + * string password = 4; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The password for connecting to on-premises instance.
+     * 
+ * + * string password = 4; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The password for connecting to on-premises instance.
+     * 
+ * + * string password = 4; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for connecting to on-premises instance.
+     * 
+ * + * string password = 4; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for connecting to on-premises instance.
+     * 
+ * + * string password = 4; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object caCertificate_ = ""; + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 5; + * + * @return The caCertificate. + */ + public java.lang.String getCaCertificate() { + java.lang.Object ref = caCertificate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCertificate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 5; + * + * @return The bytes for caCertificate. + */ + public com.google.protobuf.ByteString getCaCertificateBytes() { + java.lang.Object ref = caCertificate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 5; + * + * @param value The caCertificate to set. + * @return This builder for chaining. + */ + public Builder setCaCertificate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + caCertificate_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 5; + * + * @return This builder for chaining. + */ + public Builder clearCaCertificate() { + caCertificate_ = getDefaultInstance().getCaCertificate(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 5; + * + * @param value The bytes for caCertificate to set. + * @return This builder for chaining. + */ + public Builder setCaCertificateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + caCertificate_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object clientCertificate_ = ""; + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 6; + * + * @return The clientCertificate. + */ + public java.lang.String getClientCertificate() { + java.lang.Object ref = clientCertificate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientCertificate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 6; + * + * @return The bytes for clientCertificate. + */ + public com.google.protobuf.ByteString getClientCertificateBytes() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 6; + * + * @param value The clientCertificate to set. + * @return This builder for chaining. + */ + public Builder setClientCertificate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clientCertificate_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 6; + * + * @return This builder for chaining. + */ + public Builder clearClientCertificate() { + clientCertificate_ = getDefaultInstance().getClientCertificate(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 6; + * + * @param value The bytes for clientCertificate to set. + * @return This builder for chaining. + */ + public Builder setClientCertificateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clientCertificate_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object clientKey_ = ""; + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 7; + * + * @return The clientKey. + */ + public java.lang.String getClientKey() { + java.lang.Object ref = clientKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 7; + * + * @return The bytes for clientKey. + */ + public com.google.protobuf.ByteString getClientKeyBytes() { + java.lang.Object ref = clientKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 7; + * + * @param value The clientKey to set. + * @return This builder for chaining. + */ + public Builder setClientKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clientKey_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 7; + * + * @return This builder for chaining. + */ + public Builder clearClientKey() { + clientKey_ = getDefaultInstance().getClientKey(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 7; + * + * @param value The bytes for clientKey to set. + * @return This builder for chaining. + */ + public Builder setClientKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clientKey_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object dumpFilePath_ = ""; + + /** + * + * + *
+     * The dump file to create the Cloud SQL replica.
+     * 
+ * + * string dump_file_path = 8; + * + * @return The dumpFilePath. + */ + public java.lang.String getDumpFilePath() { + java.lang.Object ref = dumpFilePath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dumpFilePath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The dump file to create the Cloud SQL replica.
+     * 
+ * + * string dump_file_path = 8; + * + * @return The bytes for dumpFilePath. + */ + public com.google.protobuf.ByteString getDumpFilePathBytes() { + java.lang.Object ref = dumpFilePath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dumpFilePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The dump file to create the Cloud SQL replica.
+     * 
+ * + * string dump_file_path = 8; + * + * @param value The dumpFilePath to set. + * @return This builder for chaining. + */ + public Builder setDumpFilePath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dumpFilePath_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The dump file to create the Cloud SQL replica.
+     * 
+ * + * string dump_file_path = 8; + * + * @return This builder for chaining. + */ + public Builder clearDumpFilePath() { + dumpFilePath_ = getDefaultInstance().getDumpFilePath(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * The dump file to create the Cloud SQL replica.
+     * 
+ * + * string dump_file_path = 8; + * + * @param value The bytes for dumpFilePath to set. + * @return This builder for chaining. + */ + public Builder setDumpFilePathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dumpFilePath_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstanceReference sourceInstance_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstanceReference, + com.google.cloud.sql.v1.InstanceReference.Builder, + com.google.cloud.sql.v1.InstanceReferenceOrBuilder> + sourceInstanceBuilder_; + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + * + * @return Whether the sourceInstance field is set. + */ + public boolean hasSourceInstance() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + * + * @return The sourceInstance. + */ + public com.google.cloud.sql.v1.InstanceReference getSourceInstance() { + if (sourceInstanceBuilder_ == null) { + return sourceInstance_ == null + ? com.google.cloud.sql.v1.InstanceReference.getDefaultInstance() + : sourceInstance_; + } else { + return sourceInstanceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + */ + public Builder setSourceInstance(com.google.cloud.sql.v1.InstanceReference value) { + if (sourceInstanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceInstance_ = value; + } else { + sourceInstanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + */ + public Builder setSourceInstance( + com.google.cloud.sql.v1.InstanceReference.Builder builderForValue) { + if (sourceInstanceBuilder_ == null) { + sourceInstance_ = builderForValue.build(); + } else { + sourceInstanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + */ + public Builder mergeSourceInstance(com.google.cloud.sql.v1.InstanceReference value) { + if (sourceInstanceBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && sourceInstance_ != null + && sourceInstance_ != com.google.cloud.sql.v1.InstanceReference.getDefaultInstance()) { + getSourceInstanceBuilder().mergeFrom(value); + } else { + sourceInstance_ = value; + } + } else { + sourceInstanceBuilder_.mergeFrom(value); + } + if (sourceInstance_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + */ + public Builder clearSourceInstance() { + bitField0_ = (bitField0_ & ~0x00000100); + sourceInstance_ = null; + if (sourceInstanceBuilder_ != null) { + sourceInstanceBuilder_.dispose(); + sourceInstanceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + */ + public com.google.cloud.sql.v1.InstanceReference.Builder getSourceInstanceBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetSourceInstanceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + */ + public com.google.cloud.sql.v1.InstanceReferenceOrBuilder getSourceInstanceOrBuilder() { + if (sourceInstanceBuilder_ != null) { + return sourceInstanceBuilder_.getMessageOrBuilder(); + } else { + return sourceInstance_ == null + ? com.google.cloud.sql.v1.InstanceReference.getDefaultInstance() + : sourceInstance_; + } + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstanceReference, + com.google.cloud.sql.v1.InstanceReference.Builder, + com.google.cloud.sql.v1.InstanceReferenceOrBuilder> + internalGetSourceInstanceFieldBuilder() { + if (sourceInstanceBuilder_ == null) { + sourceInstanceBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstanceReference, + com.google.cloud.sql.v1.InstanceReference.Builder, + com.google.cloud.sql.v1.InstanceReferenceOrBuilder>( + getSourceInstance(), getParentForChildren(), isClean()); + sourceInstance_ = null; + } + return sourceInstanceBuilder_; + } + + private java.util.List selectedObjects_ = + java.util.Collections.emptyList(); + + private void ensureSelectedObjectsIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + selectedObjects_ = + new java.util.ArrayList(selectedObjects_); + bitField0_ |= 0x00000200; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SelectedObjects, + com.google.cloud.sql.v1.SelectedObjects.Builder, + com.google.cloud.sql.v1.SelectedObjectsOrBuilder> + selectedObjectsBuilder_; + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getSelectedObjectsList() { + if (selectedObjectsBuilder_ == null) { + return java.util.Collections.unmodifiableList(selectedObjects_); + } else { + return selectedObjectsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getSelectedObjectsCount() { + if (selectedObjectsBuilder_ == null) { + return selectedObjects_.size(); + } else { + return selectedObjectsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.SelectedObjects getSelectedObjects(int index) { + if (selectedObjectsBuilder_ == null) { + return selectedObjects_.get(index); + } else { + return selectedObjectsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSelectedObjects(int index, com.google.cloud.sql.v1.SelectedObjects value) { + if (selectedObjectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSelectedObjectsIsMutable(); + selectedObjects_.set(index, value); + onChanged(); + } else { + selectedObjectsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSelectedObjects( + int index, com.google.cloud.sql.v1.SelectedObjects.Builder builderForValue) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.set(index, builderForValue.build()); + onChanged(); + } else { + selectedObjectsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects(com.google.cloud.sql.v1.SelectedObjects value) { + if (selectedObjectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(value); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects(int index, com.google.cloud.sql.v1.SelectedObjects value) { + if (selectedObjectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(index, value); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects( + com.google.cloud.sql.v1.SelectedObjects.Builder builderForValue) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(builderForValue.build()); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects( + int index, com.google.cloud.sql.v1.SelectedObjects.Builder builderForValue) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(index, builderForValue.build()); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllSelectedObjects( + java.lang.Iterable values) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, selectedObjects_); + onChanged(); + } else { + selectedObjectsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSelectedObjects() { + if (selectedObjectsBuilder_ == null) { + selectedObjects_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + } else { + selectedObjectsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeSelectedObjects(int index) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.remove(index); + onChanged(); + } else { + selectedObjectsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.SelectedObjects.Builder getSelectedObjectsBuilder(int index) { + return internalGetSelectedObjectsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.SelectedObjectsOrBuilder getSelectedObjectsOrBuilder(int index) { + if (selectedObjectsBuilder_ == null) { + return selectedObjects_.get(index); + } else { + return selectedObjectsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSelectedObjectsOrBuilderList() { + if (selectedObjectsBuilder_ != null) { + return selectedObjectsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(selectedObjects_); + } + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.SelectedObjects.Builder addSelectedObjectsBuilder() { + return internalGetSelectedObjectsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.SelectedObjects.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.SelectedObjects.Builder addSelectedObjectsBuilder(int index) { + return internalGetSelectedObjectsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.SelectedObjects.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSelectedObjectsBuilderList() { + return internalGetSelectedObjectsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SelectedObjects, + com.google.cloud.sql.v1.SelectedObjects.Builder, + com.google.cloud.sql.v1.SelectedObjectsOrBuilder> + internalGetSelectedObjectsFieldBuilder() { + if (selectedObjectsBuilder_ == null) { + selectedObjectsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SelectedObjects, + com.google.cloud.sql.v1.SelectedObjects.Builder, + com.google.cloud.sql.v1.SelectedObjectsOrBuilder>( + selectedObjects_, + ((bitField0_ & 0x00000200) != 0), + getParentForChildren(), + isClean()); + selectedObjects_ = null; + } + return selectedObjectsBuilder_; + } + + private int sslOption_ = 0; + + /** + * + * + *
+     * Optional. SSL option for replica connection to the on-premises source.
+     * 
+ * + * + * .google.cloud.sql.v1.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslOption. + */ + @java.lang.Override + public int getSslOptionValue() { + return sslOption_; + } + + /** + * + * + *
+     * Optional. SSL option for replica connection to the on-premises source.
+     * 
+ * + * + * .google.cloud.sql.v1.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for sslOption to set. + * @return This builder for chaining. + */ + public Builder setSslOptionValue(int value) { + sslOption_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. SSL option for replica connection to the on-premises source.
+     * 
+ * + * + * .google.cloud.sql.v1.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslOption. + */ + @java.lang.Override + public com.google.cloud.sql.v1.OnPremisesConfiguration.SslOption getSslOption() { + com.google.cloud.sql.v1.OnPremisesConfiguration.SslOption result = + com.google.cloud.sql.v1.OnPremisesConfiguration.SslOption.forNumber(sslOption_); + return result == null + ? com.google.cloud.sql.v1.OnPremisesConfiguration.SslOption.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. SSL option for replica connection to the on-premises source.
+     * 
+ * + * + * .google.cloud.sql.v1.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The sslOption to set. + * @return This builder for chaining. + */ + public Builder setSslOption(com.google.cloud.sql.v1.OnPremisesConfiguration.SslOption value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + sslOption_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. SSL option for replica connection to the on-premises source.
+     * 
+ * + * + * .google.cloud.sql.v1.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSslOption() { + bitField0_ = (bitField0_ & ~0x00000400); + sslOption_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.OnPremisesConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.OnPremisesConfiguration) + private static final com.google.cloud.sql.v1.OnPremisesConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.OnPremisesConfiguration(); + } + + public static com.google.cloud.sql.v1.OnPremisesConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OnPremisesConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.OnPremisesConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OnPremisesConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OnPremisesConfigurationOrBuilder.java new file mode 100644 index 000000000000..30c7dfa22296 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OnPremisesConfigurationOrBuilder.java @@ -0,0 +1,376 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface OnPremisesConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.OnPremisesConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The host and port of the on-premises instance in host:port format
+   * 
+ * + * string host_port = 1; + * + * @return The hostPort. + */ + java.lang.String getHostPort(); + + /** + * + * + *
+   * The host and port of the on-premises instance in host:port format
+   * 
+ * + * string host_port = 1; + * + * @return The bytes for hostPort. + */ + com.google.protobuf.ByteString getHostPortBytes(); + + /** + * + * + *
+   * This is always `sql#onPremisesConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#onPremisesConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The username for connecting to on-premises instance.
+   * 
+ * + * string username = 3; + * + * @return The username. + */ + java.lang.String getUsername(); + + /** + * + * + *
+   * The username for connecting to on-premises instance.
+   * 
+ * + * string username = 3; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * + * + *
+   * The password for connecting to on-premises instance.
+   * 
+ * + * string password = 4; + * + * @return The password. + */ + java.lang.String getPassword(); + + /** + * + * + *
+   * The password for connecting to on-premises instance.
+   * 
+ * + * string password = 4; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 5; + * + * @return The caCertificate. + */ + java.lang.String getCaCertificate(); + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 5; + * + * @return The bytes for caCertificate. + */ + com.google.protobuf.ByteString getCaCertificateBytes(); + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 6; + * + * @return The clientCertificate. + */ + java.lang.String getClientCertificate(); + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 6; + * + * @return The bytes for clientCertificate. + */ + com.google.protobuf.ByteString getClientCertificateBytes(); + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 7; + * + * @return The clientKey. + */ + java.lang.String getClientKey(); + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 7; + * + * @return The bytes for clientKey. + */ + com.google.protobuf.ByteString getClientKeyBytes(); + + /** + * + * + *
+   * The dump file to create the Cloud SQL replica.
+   * 
+ * + * string dump_file_path = 8; + * + * @return The dumpFilePath. + */ + java.lang.String getDumpFilePath(); + + /** + * + * + *
+   * The dump file to create the Cloud SQL replica.
+   * 
+ * + * string dump_file_path = 8; + * + * @return The bytes for dumpFilePath. + */ + com.google.protobuf.ByteString getDumpFilePathBytes(); + + /** + * + * + *
+   * The reference to Cloud SQL instance if the source is Cloud SQL.
+   * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + * + * @return Whether the sourceInstance field is set. + */ + boolean hasSourceInstance(); + + /** + * + * + *
+   * The reference to Cloud SQL instance if the source is Cloud SQL.
+   * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + * + * @return The sourceInstance. + */ + com.google.cloud.sql.v1.InstanceReference getSourceInstance(); + + /** + * + * + *
+   * The reference to Cloud SQL instance if the source is Cloud SQL.
+   * 
+ * + * .google.cloud.sql.v1.InstanceReference source_instance = 15; + */ + com.google.cloud.sql.v1.InstanceReferenceOrBuilder getSourceInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getSelectedObjectsList(); + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.SelectedObjects getSelectedObjects(int index); + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getSelectedObjectsCount(); + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getSelectedObjectsOrBuilderList(); + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.SelectedObjectsOrBuilder getSelectedObjectsOrBuilder(int index); + + /** + * + * + *
+   * Optional. SSL option for replica connection to the on-premises source.
+   * 
+ * + * + * .google.cloud.sql.v1.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslOption. + */ + int getSslOptionValue(); + + /** + * + * + *
+   * Optional. SSL option for replica connection to the on-premises source.
+   * 
+ * + * + * .google.cloud.sql.v1.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslOption. + */ + com.google.cloud.sql.v1.OnPremisesConfiguration.SslOption getSslOption(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Operation.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Operation.java new file mode 100644 index 000000000000..a5ac1f838c9f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Operation.java @@ -0,0 +1,6932 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * An Operation resource.&nbsp;For successful operations that return an
+ * Operation resource, only the fields relevant to the operation are populated
+ * in the resource.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Operation} + */ +@com.google.protobuf.Generated +public final class Operation extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.Operation) + OperationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Operation"); + } + + // Use Operation.newBuilder() to construct. + private Operation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Operation() { + kind_ = ""; + targetLink_ = ""; + status_ = 0; + user_ = ""; + operationType_ = 0; + name_ = ""; + targetId_ = ""; + selfLink_ = ""; + targetProject_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Operation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Operation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Operation.class, + com.google.cloud.sql.v1.Operation.Builder.class); + } + + /** + * + * + *
+   * The type of Cloud SQL operation.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.Operation.SqlOperationType} + */ + public enum SqlOperationType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown operation type.
+     * 
+ * + * SQL_OPERATION_TYPE_UNSPECIFIED = 0; + */ + SQL_OPERATION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Imports data into a Cloud SQL instance.
+     * 
+ * + * IMPORT = 1; + */ + IMPORT(1), + /** + * + * + *
+     * Exports data from a Cloud SQL instance to a Cloud Storage
+     * bucket.
+     * 
+ * + * EXPORT = 2; + */ + EXPORT(2), + /** + * + * + *
+     * Creates a new Cloud SQL instance.
+     * 
+ * + * CREATE = 3; + */ + CREATE(3), + /** + * + * + *
+     * Updates the settings of a Cloud SQL instance.
+     * 
+ * + * UPDATE = 4; + */ + UPDATE(4), + /** + * + * + *
+     * Deletes a Cloud SQL instance.
+     * 
+ * + * DELETE = 5; + */ + DELETE(5), + /** + * + * + *
+     * Restarts the Cloud SQL instance.
+     * 
+ * + * RESTART = 6; + */ + RESTART(6), + /** BACKUP = 7 [deprecated = true]; */ + @java.lang.Deprecated + BACKUP(7), + /** SNAPSHOT = 8 [deprecated = true]; */ + @java.lang.Deprecated + SNAPSHOT(8), + /** + * + * + *
+     * Performs instance backup.
+     * 
+ * + * BACKUP_VOLUME = 9; + */ + BACKUP_VOLUME(9), + /** + * + * + *
+     * Deletes an instance backup.
+     * 
+ * + * DELETE_VOLUME = 10; + */ + DELETE_VOLUME(10), + /** + * + * + *
+     * Restores an instance backup.
+     * 
+ * + * RESTORE_VOLUME = 11; + */ + RESTORE_VOLUME(11), + /** + * + * + *
+     * Injects a privileged user in mysql for MOB instances.
+     * 
+ * + * INJECT_USER = 12; + */ + INJECT_USER(12), + /** + * + * + *
+     * Clones a Cloud SQL instance.
+     * 
+ * + * CLONE = 14; + */ + CLONE(14), + /** + * + * + *
+     * Stops replication on a Cloud SQL read replica instance.
+     * 
+ * + * STOP_REPLICA = 15; + */ + STOP_REPLICA(15), + /** + * + * + *
+     * Starts replication on a Cloud SQL read replica instance.
+     * 
+ * + * START_REPLICA = 16; + */ + START_REPLICA(16), + /** + * + * + *
+     * Promotes a Cloud SQL replica instance.
+     * 
+ * + * PROMOTE_REPLICA = 17; + */ + PROMOTE_REPLICA(17), + /** + * + * + *
+     * Creates a Cloud SQL replica instance.
+     * 
+ * + * CREATE_REPLICA = 18; + */ + CREATE_REPLICA(18), + /** + * + * + *
+     * Creates a new user in a Cloud SQL instance.
+     * 
+ * + * CREATE_USER = 19; + */ + CREATE_USER(19), + /** + * + * + *
+     * Deletes a user from a Cloud SQL instance.
+     * 
+ * + * DELETE_USER = 20; + */ + DELETE_USER(20), + /** + * + * + *
+     * Updates an existing user in a Cloud SQL instance. If a user with the
+     * specified username doesn't exist, a new user is created.
+     * 
+ * + * UPDATE_USER = 21; + */ + UPDATE_USER(21), + /** + * + * + *
+     * Creates a database in the Cloud SQL instance.
+     * 
+ * + * CREATE_DATABASE = 22; + */ + CREATE_DATABASE(22), + /** + * + * + *
+     * Deletes a database in the Cloud SQL instance.
+     * 
+ * + * DELETE_DATABASE = 23; + */ + DELETE_DATABASE(23), + /** + * + * + *
+     * Updates a database in the Cloud SQL instance.
+     * 
+ * + * UPDATE_DATABASE = 24; + */ + UPDATE_DATABASE(24), + /** + * + * + *
+     * Performs failover of an HA-enabled Cloud SQL
+     * failover replica.
+     * 
+ * + * FAILOVER = 25; + */ + FAILOVER(25), + /** + * + * + *
+     * Deletes the backup taken by a backup run.
+     * 
+ * + * DELETE_BACKUP = 26; + */ + DELETE_BACKUP(26), + /** RECREATE_REPLICA = 27; */ + RECREATE_REPLICA(27), + /** + * + * + *
+     * Truncates a general or slow log table in MySQL.
+     * 
+ * + * TRUNCATE_LOG = 28; + */ + TRUNCATE_LOG(28), + /** + * + * + *
+     * Demotes the stand-alone instance to be a Cloud SQL
+     * read replica for an external database server.
+     * 
+ * + * DEMOTE_MASTER = 29; + */ + DEMOTE_MASTER(29), + /** + * + * + *
+     * Indicates that the instance is currently in maintenance. Maintenance
+     * typically causes the instance to be unavailable for 1-3 minutes.
+     * 
+ * + * MAINTENANCE = 30; + */ + MAINTENANCE(30), + /** + * + * + *
+     * This field is deprecated, and will be removed in future version of API.
+     * 
+ * + * ENABLE_PRIVATE_IP = 31 [deprecated = true]; + */ + @java.lang.Deprecated + ENABLE_PRIVATE_IP(31), + /** DEFER_MAINTENANCE = 32 [deprecated = true]; */ + @java.lang.Deprecated + DEFER_MAINTENANCE(32), + /** + * + * + *
+     * Creates clone instance.
+     * 
+ * + * CREATE_CLONE = 33 [deprecated = true]; + */ + @java.lang.Deprecated + CREATE_CLONE(33), + /** + * + * + *
+     * Reschedule maintenance to another time.
+     * 
+ * + * RESCHEDULE_MAINTENANCE = 34; + */ + RESCHEDULE_MAINTENANCE(34), + /** + * + * + *
+     * Starts external sync of a Cloud SQL EM replica to an external primary
+     * instance.
+     * 
+ * + * START_EXTERNAL_SYNC = 35; + */ + START_EXTERNAL_SYNC(35), + /** + * + * + *
+     * Recovers logs from an instance's old data disk.
+     * 
+ * + * LOG_CLEANUP = 36; + */ + LOG_CLEANUP(36), + /** + * + * + *
+     * Performs auto-restart of an HA-enabled Cloud SQL database for auto
+     * recovery.
+     * 
+ * + * AUTO_RESTART = 37; + */ + AUTO_RESTART(37), + /** + * + * + *
+     * Re-encrypts CMEK instances with latest key version.
+     * 
+ * + * REENCRYPT = 38; + */ + REENCRYPT(38), + /** + * + * + *
+     * Switches the roles of the primary and replica pair. The target instance
+     * should be the replica.
+     * 
+ * + * SWITCHOVER = 39; + */ + SWITCHOVER(39), + /** + * + * + *
+     * Update a backup.
+     * 
+ * + * UPDATE_BACKUP = 40; + */ + UPDATE_BACKUP(40), + /** + * + * + *
+     * Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ * + * ACQUIRE_SSRS_LEASE = 42; + */ + ACQUIRE_SSRS_LEASE(42), + /** + * + * + *
+     * Release a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ * + * RELEASE_SSRS_LEASE = 43; + */ + RELEASE_SSRS_LEASE(43), + /** + * + * + *
+     * Reconfigures old primary after a promote replica operation. Effect of a
+     * promote operation to the old primary is executed in this operation,
+     * asynchronously from the promote replica operation executed to the
+     * replica.
+     * 
+ * + * RECONFIGURE_OLD_PRIMARY = 44; + */ + RECONFIGURE_OLD_PRIMARY(44), + /** + * + * + *
+     * Indicates that the instance, its read replicas, and its cascading
+     * replicas are in maintenance. Maintenance typically gets initiated on
+     * groups of replicas first, followed by the primary instance. For each
+     * instance, maintenance typically causes the instance to be unavailable for
+     * 1-3 minutes.
+     * 
+ * + * CLUSTER_MAINTENANCE = 45 [deprecated = true]; + */ + @java.lang.Deprecated + CLUSTER_MAINTENANCE(45), + /** + * + * + *
+     * Indicates that the instance (and any of its replicas) are currently in
+     * maintenance. This is initiated as a self-service request by using SSM.
+     * Maintenance typically causes the instance to be unavailable for 1-3
+     * minutes.
+     * 
+ * + * SELF_SERVICE_MAINTENANCE = 46 [deprecated = true]; + */ + @java.lang.Deprecated + SELF_SERVICE_MAINTENANCE(46), + /** + * + * + *
+     * Switches a primary instance to a replica. This operation runs as part of
+     * a switchover operation to the original primary instance.
+     * 
+ * + * SWITCHOVER_TO_REPLICA = 47; + */ + SWITCHOVER_TO_REPLICA(47), + /** + * + * + *
+     * Updates the major version of a Cloud SQL instance.
+     * 
+ * + * MAJOR_VERSION_UPGRADE = 48; + */ + MAJOR_VERSION_UPGRADE(48), + /** + * + * + *
+     * Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead.
+     * 
+ * + * ADVANCED_BACKUP = 49 [deprecated = true]; + */ + @java.lang.Deprecated + ADVANCED_BACKUP(49), + /** + * + * + *
+     * Changes the BackupTier of a Cloud SQL instance.
+     * 
+ * + * MANAGE_BACKUP = 50; + */ + MANAGE_BACKUP(50), + /** + * + * + *
+     * Creates a backup for an Enhanced BackupTier Cloud SQL instance.
+     * 
+ * + * ENHANCED_BACKUP = 51; + */ + ENHANCED_BACKUP(51), + /** + * + * + *
+     * Repairs entire read pool or specified read pool nodes in the read pool.
+     * 
+ * + * REPAIR_READ_POOL = 52; + */ + REPAIR_READ_POOL(52), + /** + * + * + *
+     * Creates a Cloud SQL read pool instance.
+     * 
+ * + * CREATE_READ_POOL = 53; + */ + CREATE_READ_POOL(53), + /** + * + * + *
+     * Pre-checks the major version upgrade operation.
+     * 
+ * + * PRE_CHECK_MAJOR_VERSION_UPGRADE = 54; + */ + PRE_CHECK_MAJOR_VERSION_UPGRADE(54), + /** + * + * + *
+     * This operation type represents individual steps in a multi-step setup
+     * migration workflow: including configuration, replication,
+     * switchover/back, and data reseeding, as defined by operation's intent.
+     * 
+ * + * SETUP_MIGRATION = 55; + */ + SETUP_MIGRATION(55), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlOperationType"); + } + + /** + * + * + *
+     * Unknown operation type.
+     * 
+ * + * SQL_OPERATION_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_OPERATION_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Imports data into a Cloud SQL instance.
+     * 
+ * + * IMPORT = 1; + */ + public static final int IMPORT_VALUE = 1; + + /** + * + * + *
+     * Exports data from a Cloud SQL instance to a Cloud Storage
+     * bucket.
+     * 
+ * + * EXPORT = 2; + */ + public static final int EXPORT_VALUE = 2; + + /** + * + * + *
+     * Creates a new Cloud SQL instance.
+     * 
+ * + * CREATE = 3; + */ + public static final int CREATE_VALUE = 3; + + /** + * + * + *
+     * Updates the settings of a Cloud SQL instance.
+     * 
+ * + * UPDATE = 4; + */ + public static final int UPDATE_VALUE = 4; + + /** + * + * + *
+     * Deletes a Cloud SQL instance.
+     * 
+ * + * DELETE = 5; + */ + public static final int DELETE_VALUE = 5; + + /** + * + * + *
+     * Restarts the Cloud SQL instance.
+     * 
+ * + * RESTART = 6; + */ + public static final int RESTART_VALUE = 6; + + /** BACKUP = 7 [deprecated = true]; */ + @java.lang.Deprecated public static final int BACKUP_VALUE = 7; + + /** SNAPSHOT = 8 [deprecated = true]; */ + @java.lang.Deprecated public static final int SNAPSHOT_VALUE = 8; + + /** + * + * + *
+     * Performs instance backup.
+     * 
+ * + * BACKUP_VOLUME = 9; + */ + public static final int BACKUP_VOLUME_VALUE = 9; + + /** + * + * + *
+     * Deletes an instance backup.
+     * 
+ * + * DELETE_VOLUME = 10; + */ + public static final int DELETE_VOLUME_VALUE = 10; + + /** + * + * + *
+     * Restores an instance backup.
+     * 
+ * + * RESTORE_VOLUME = 11; + */ + public static final int RESTORE_VOLUME_VALUE = 11; + + /** + * + * + *
+     * Injects a privileged user in mysql for MOB instances.
+     * 
+ * + * INJECT_USER = 12; + */ + public static final int INJECT_USER_VALUE = 12; + + /** + * + * + *
+     * Clones a Cloud SQL instance.
+     * 
+ * + * CLONE = 14; + */ + public static final int CLONE_VALUE = 14; + + /** + * + * + *
+     * Stops replication on a Cloud SQL read replica instance.
+     * 
+ * + * STOP_REPLICA = 15; + */ + public static final int STOP_REPLICA_VALUE = 15; + + /** + * + * + *
+     * Starts replication on a Cloud SQL read replica instance.
+     * 
+ * + * START_REPLICA = 16; + */ + public static final int START_REPLICA_VALUE = 16; + + /** + * + * + *
+     * Promotes a Cloud SQL replica instance.
+     * 
+ * + * PROMOTE_REPLICA = 17; + */ + public static final int PROMOTE_REPLICA_VALUE = 17; + + /** + * + * + *
+     * Creates a Cloud SQL replica instance.
+     * 
+ * + * CREATE_REPLICA = 18; + */ + public static final int CREATE_REPLICA_VALUE = 18; + + /** + * + * + *
+     * Creates a new user in a Cloud SQL instance.
+     * 
+ * + * CREATE_USER = 19; + */ + public static final int CREATE_USER_VALUE = 19; + + /** + * + * + *
+     * Deletes a user from a Cloud SQL instance.
+     * 
+ * + * DELETE_USER = 20; + */ + public static final int DELETE_USER_VALUE = 20; + + /** + * + * + *
+     * Updates an existing user in a Cloud SQL instance. If a user with the
+     * specified username doesn't exist, a new user is created.
+     * 
+ * + * UPDATE_USER = 21; + */ + public static final int UPDATE_USER_VALUE = 21; + + /** + * + * + *
+     * Creates a database in the Cloud SQL instance.
+     * 
+ * + * CREATE_DATABASE = 22; + */ + public static final int CREATE_DATABASE_VALUE = 22; + + /** + * + * + *
+     * Deletes a database in the Cloud SQL instance.
+     * 
+ * + * DELETE_DATABASE = 23; + */ + public static final int DELETE_DATABASE_VALUE = 23; + + /** + * + * + *
+     * Updates a database in the Cloud SQL instance.
+     * 
+ * + * UPDATE_DATABASE = 24; + */ + public static final int UPDATE_DATABASE_VALUE = 24; + + /** + * + * + *
+     * Performs failover of an HA-enabled Cloud SQL
+     * failover replica.
+     * 
+ * + * FAILOVER = 25; + */ + public static final int FAILOVER_VALUE = 25; + + /** + * + * + *
+     * Deletes the backup taken by a backup run.
+     * 
+ * + * DELETE_BACKUP = 26; + */ + public static final int DELETE_BACKUP_VALUE = 26; + + /** RECREATE_REPLICA = 27; */ + public static final int RECREATE_REPLICA_VALUE = 27; + + /** + * + * + *
+     * Truncates a general or slow log table in MySQL.
+     * 
+ * + * TRUNCATE_LOG = 28; + */ + public static final int TRUNCATE_LOG_VALUE = 28; + + /** + * + * + *
+     * Demotes the stand-alone instance to be a Cloud SQL
+     * read replica for an external database server.
+     * 
+ * + * DEMOTE_MASTER = 29; + */ + public static final int DEMOTE_MASTER_VALUE = 29; + + /** + * + * + *
+     * Indicates that the instance is currently in maintenance. Maintenance
+     * typically causes the instance to be unavailable for 1-3 minutes.
+     * 
+ * + * MAINTENANCE = 30; + */ + public static final int MAINTENANCE_VALUE = 30; + + /** + * + * + *
+     * This field is deprecated, and will be removed in future version of API.
+     * 
+ * + * ENABLE_PRIVATE_IP = 31 [deprecated = true]; + */ + @java.lang.Deprecated public static final int ENABLE_PRIVATE_IP_VALUE = 31; + + /** DEFER_MAINTENANCE = 32 [deprecated = true]; */ + @java.lang.Deprecated public static final int DEFER_MAINTENANCE_VALUE = 32; + + /** + * + * + *
+     * Creates clone instance.
+     * 
+ * + * CREATE_CLONE = 33 [deprecated = true]; + */ + @java.lang.Deprecated public static final int CREATE_CLONE_VALUE = 33; + + /** + * + * + *
+     * Reschedule maintenance to another time.
+     * 
+ * + * RESCHEDULE_MAINTENANCE = 34; + */ + public static final int RESCHEDULE_MAINTENANCE_VALUE = 34; + + /** + * + * + *
+     * Starts external sync of a Cloud SQL EM replica to an external primary
+     * instance.
+     * 
+ * + * START_EXTERNAL_SYNC = 35; + */ + public static final int START_EXTERNAL_SYNC_VALUE = 35; + + /** + * + * + *
+     * Recovers logs from an instance's old data disk.
+     * 
+ * + * LOG_CLEANUP = 36; + */ + public static final int LOG_CLEANUP_VALUE = 36; + + /** + * + * + *
+     * Performs auto-restart of an HA-enabled Cloud SQL database for auto
+     * recovery.
+     * 
+ * + * AUTO_RESTART = 37; + */ + public static final int AUTO_RESTART_VALUE = 37; + + /** + * + * + *
+     * Re-encrypts CMEK instances with latest key version.
+     * 
+ * + * REENCRYPT = 38; + */ + public static final int REENCRYPT_VALUE = 38; + + /** + * + * + *
+     * Switches the roles of the primary and replica pair. The target instance
+     * should be the replica.
+     * 
+ * + * SWITCHOVER = 39; + */ + public static final int SWITCHOVER_VALUE = 39; + + /** + * + * + *
+     * Update a backup.
+     * 
+ * + * UPDATE_BACKUP = 40; + */ + public static final int UPDATE_BACKUP_VALUE = 40; + + /** + * + * + *
+     * Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ * + * ACQUIRE_SSRS_LEASE = 42; + */ + public static final int ACQUIRE_SSRS_LEASE_VALUE = 42; + + /** + * + * + *
+     * Release a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ * + * RELEASE_SSRS_LEASE = 43; + */ + public static final int RELEASE_SSRS_LEASE_VALUE = 43; + + /** + * + * + *
+     * Reconfigures old primary after a promote replica operation. Effect of a
+     * promote operation to the old primary is executed in this operation,
+     * asynchronously from the promote replica operation executed to the
+     * replica.
+     * 
+ * + * RECONFIGURE_OLD_PRIMARY = 44; + */ + public static final int RECONFIGURE_OLD_PRIMARY_VALUE = 44; + + /** + * + * + *
+     * Indicates that the instance, its read replicas, and its cascading
+     * replicas are in maintenance. Maintenance typically gets initiated on
+     * groups of replicas first, followed by the primary instance. For each
+     * instance, maintenance typically causes the instance to be unavailable for
+     * 1-3 minutes.
+     * 
+ * + * CLUSTER_MAINTENANCE = 45 [deprecated = true]; + */ + @java.lang.Deprecated public static final int CLUSTER_MAINTENANCE_VALUE = 45; + + /** + * + * + *
+     * Indicates that the instance (and any of its replicas) are currently in
+     * maintenance. This is initiated as a self-service request by using SSM.
+     * Maintenance typically causes the instance to be unavailable for 1-3
+     * minutes.
+     * 
+ * + * SELF_SERVICE_MAINTENANCE = 46 [deprecated = true]; + */ + @java.lang.Deprecated public static final int SELF_SERVICE_MAINTENANCE_VALUE = 46; + + /** + * + * + *
+     * Switches a primary instance to a replica. This operation runs as part of
+     * a switchover operation to the original primary instance.
+     * 
+ * + * SWITCHOVER_TO_REPLICA = 47; + */ + public static final int SWITCHOVER_TO_REPLICA_VALUE = 47; + + /** + * + * + *
+     * Updates the major version of a Cloud SQL instance.
+     * 
+ * + * MAJOR_VERSION_UPGRADE = 48; + */ + public static final int MAJOR_VERSION_UPGRADE_VALUE = 48; + + /** + * + * + *
+     * Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead.
+     * 
+ * + * ADVANCED_BACKUP = 49 [deprecated = true]; + */ + @java.lang.Deprecated public static final int ADVANCED_BACKUP_VALUE = 49; + + /** + * + * + *
+     * Changes the BackupTier of a Cloud SQL instance.
+     * 
+ * + * MANAGE_BACKUP = 50; + */ + public static final int MANAGE_BACKUP_VALUE = 50; + + /** + * + * + *
+     * Creates a backup for an Enhanced BackupTier Cloud SQL instance.
+     * 
+ * + * ENHANCED_BACKUP = 51; + */ + public static final int ENHANCED_BACKUP_VALUE = 51; + + /** + * + * + *
+     * Repairs entire read pool or specified read pool nodes in the read pool.
+     * 
+ * + * REPAIR_READ_POOL = 52; + */ + public static final int REPAIR_READ_POOL_VALUE = 52; + + /** + * + * + *
+     * Creates a Cloud SQL read pool instance.
+     * 
+ * + * CREATE_READ_POOL = 53; + */ + public static final int CREATE_READ_POOL_VALUE = 53; + + /** + * + * + *
+     * Pre-checks the major version upgrade operation.
+     * 
+ * + * PRE_CHECK_MAJOR_VERSION_UPGRADE = 54; + */ + public static final int PRE_CHECK_MAJOR_VERSION_UPGRADE_VALUE = 54; + + /** + * + * + *
+     * This operation type represents individual steps in a multi-step setup
+     * migration workflow: including configuration, replication,
+     * switchover/back, and data reseeding, as defined by operation's intent.
+     * 
+ * + * SETUP_MIGRATION = 55; + */ + public static final int SETUP_MIGRATION_VALUE = 55; + + 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 SqlOperationType 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 SqlOperationType forNumber(int value) { + switch (value) { + case 0: + return SQL_OPERATION_TYPE_UNSPECIFIED; + case 1: + return IMPORT; + case 2: + return EXPORT; + case 3: + return CREATE; + case 4: + return UPDATE; + case 5: + return DELETE; + case 6: + return RESTART; + case 7: + return BACKUP; + case 8: + return SNAPSHOT; + case 9: + return BACKUP_VOLUME; + case 10: + return DELETE_VOLUME; + case 11: + return RESTORE_VOLUME; + case 12: + return INJECT_USER; + case 14: + return CLONE; + case 15: + return STOP_REPLICA; + case 16: + return START_REPLICA; + case 17: + return PROMOTE_REPLICA; + case 18: + return CREATE_REPLICA; + case 19: + return CREATE_USER; + case 20: + return DELETE_USER; + case 21: + return UPDATE_USER; + case 22: + return CREATE_DATABASE; + case 23: + return DELETE_DATABASE; + case 24: + return UPDATE_DATABASE; + case 25: + return FAILOVER; + case 26: + return DELETE_BACKUP; + case 27: + return RECREATE_REPLICA; + case 28: + return TRUNCATE_LOG; + case 29: + return DEMOTE_MASTER; + case 30: + return MAINTENANCE; + case 31: + return ENABLE_PRIVATE_IP; + case 32: + return DEFER_MAINTENANCE; + case 33: + return CREATE_CLONE; + case 34: + return RESCHEDULE_MAINTENANCE; + case 35: + return START_EXTERNAL_SYNC; + case 36: + return LOG_CLEANUP; + case 37: + return AUTO_RESTART; + case 38: + return REENCRYPT; + case 39: + return SWITCHOVER; + case 40: + return UPDATE_BACKUP; + case 42: + return ACQUIRE_SSRS_LEASE; + case 43: + return RELEASE_SSRS_LEASE; + case 44: + return RECONFIGURE_OLD_PRIMARY; + case 45: + return CLUSTER_MAINTENANCE; + case 46: + return SELF_SERVICE_MAINTENANCE; + case 47: + return SWITCHOVER_TO_REPLICA; + case 48: + return MAJOR_VERSION_UPGRADE; + case 49: + return ADVANCED_BACKUP; + case 50: + return MANAGE_BACKUP; + case 51: + return ENHANCED_BACKUP; + case 52: + return REPAIR_READ_POOL; + case 53: + return CREATE_READ_POOL; + case 54: + return PRE_CHECK_MAJOR_VERSION_UPGRADE; + case 55: + return SETUP_MIGRATION; + 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 SqlOperationType findValueByNumber(int number) { + return SqlOperationType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.Operation.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlOperationType[] VALUES = values(); + + public static SqlOperationType 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 SqlOperationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.Operation.SqlOperationType) + } + + /** + * + * + *
+   * The status of an operation.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.Operation.SqlOperationStatus} + */ + public enum SqlOperationStatus implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the operation is unknown.
+     * 
+ * + * SQL_OPERATION_STATUS_UNSPECIFIED = 0; + */ + SQL_OPERATION_STATUS_UNSPECIFIED(0), + /** + * + * + *
+     * The operation has been queued, but has not started yet.
+     * 
+ * + * PENDING = 1; + */ + PENDING(1), + /** + * + * + *
+     * The operation is running.
+     * 
+ * + * RUNNING = 2; + */ + RUNNING(2), + /** + * + * + *
+     * The operation completed.
+     * 
+ * + * DONE = 3; + */ + DONE(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlOperationStatus"); + } + + /** + * + * + *
+     * The state of the operation is unknown.
+     * 
+ * + * SQL_OPERATION_STATUS_UNSPECIFIED = 0; + */ + public static final int SQL_OPERATION_STATUS_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The operation has been queued, but has not started yet.
+     * 
+ * + * PENDING = 1; + */ + public static final int PENDING_VALUE = 1; + + /** + * + * + *
+     * The operation is running.
+     * 
+ * + * RUNNING = 2; + */ + public static final int RUNNING_VALUE = 2; + + /** + * + * + *
+     * The operation completed.
+     * 
+ * + * DONE = 3; + */ + public static final int DONE_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 SqlOperationStatus 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 SqlOperationStatus forNumber(int value) { + switch (value) { + case 0: + return SQL_OPERATION_STATUS_UNSPECIFIED; + case 1: + return PENDING; + case 2: + return RUNNING; + case 3: + return DONE; + 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 SqlOperationStatus findValueByNumber(int number) { + return SqlOperationStatus.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.Operation.getDescriptor().getEnumTypes().get(1); + } + + private static final SqlOperationStatus[] VALUES = values(); + + public static SqlOperationStatus 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 SqlOperationStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.Operation.SqlOperationStatus) + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#operation`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#operation`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_LINK_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object targetLink_ = ""; + + /** + * string target_link = 2; + * + * @return The targetLink. + */ + @java.lang.Override + public java.lang.String getTargetLink() { + java.lang.Object ref = targetLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetLink_ = s; + return s; + } + } + + /** + * string target_link = 2; + * + * @return The bytes for targetLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetLinkBytes() { + java.lang.Object ref = targetLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 3; + private int status_ = 0; + + /** + * + * + *
+   * The status of an operation.
+   * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationStatus status = 3; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
+   * The status of an operation.
+   * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationStatus status = 3; + * + * @return The status. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Operation.SqlOperationStatus getStatus() { + com.google.cloud.sql.v1.Operation.SqlOperationStatus result = + com.google.cloud.sql.v1.Operation.SqlOperationStatus.forNumber(status_); + return result == null + ? com.google.cloud.sql.v1.Operation.SqlOperationStatus.UNRECOGNIZED + : result; + } + + public static final int USER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object user_ = ""; + + /** + * + * + *
+   * The email address of the user who initiated this operation.
+   * 
+ * + * string user = 4; + * + * @return The user. + */ + @java.lang.Override + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } + } + + /** + * + * + *
+   * The email address of the user who initiated this operation.
+   * 
+ * + * string user = 4; + * + * @return The bytes for user. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSERT_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp insertTime_; + + /** + * + * + *
+   * The time this operation was enqueued in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + * + * @return Whether the insertTime field is set. + */ + @java.lang.Override + public boolean hasInsertTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time this operation was enqueued in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + * + * @return The insertTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getInsertTime() { + return insertTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : insertTime_; + } + + /** + * + * + *
+   * The time this operation was enqueued in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getInsertTimeOrBuilder() { + return insertTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : insertTime_; + } + + public static final int START_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The time this operation actually started in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time this operation actually started in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The time this operation actually started in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * The time this operation finished in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The time this operation finished in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * The time this operation finished in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int ERROR_FIELD_NUMBER = 8; + private com.google.cloud.sql.v1.OperationErrors error_; + + /** + * + * + *
+   * If errors occurred during processing of this operation, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * If errors occurred during processing of this operation, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + * + * @return The error. + */ + @java.lang.Override + public com.google.cloud.sql.v1.OperationErrors getError() { + return error_ == null ? com.google.cloud.sql.v1.OperationErrors.getDefaultInstance() : error_; + } + + /** + * + * + *
+   * If errors occurred during processing of this operation, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + */ + @java.lang.Override + public com.google.cloud.sql.v1.OperationErrorsOrBuilder getErrorOrBuilder() { + return error_ == null ? com.google.cloud.sql.v1.OperationErrors.getDefaultInstance() : error_; + } + + public static final int API_WARNING_FIELD_NUMBER = 19; + private com.google.cloud.sql.v1.ApiWarning apiWarning_; + + /** + * + * + *
+   * An Admin API warning message.
+   * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + * + * @return Whether the apiWarning field is set. + */ + @java.lang.Override + public boolean hasApiWarning() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * An Admin API warning message.
+   * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + * + * @return The apiWarning. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ApiWarning getApiWarning() { + return apiWarning_ == null + ? com.google.cloud.sql.v1.ApiWarning.getDefaultInstance() + : apiWarning_; + } + + /** + * + * + *
+   * An Admin API warning message.
+   * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ApiWarningOrBuilder getApiWarningOrBuilder() { + return apiWarning_ == null + ? com.google.cloud.sql.v1.ApiWarning.getDefaultInstance() + : apiWarning_; + } + + public static final int OPERATION_TYPE_FIELD_NUMBER = 9; + private int operationType_ = 0; + + /** + * + * + *
+   * The type of the operation. Valid values are:
+   * *  `CREATE`
+   * *  `DELETE`
+   * *  `UPDATE`
+   * *  `RESTART`
+   * *  `IMPORT`
+   * *  `EXPORT`
+   * *  `BACKUP_VOLUME`
+   * *  `RESTORE_VOLUME`
+   * *  `CREATE_USER`
+   * *  `DELETE_USER`
+   * *  `CREATE_DATABASE`
+   * *  `DELETE_DATABASE`
+   * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationType operation_type = 9; + * + * @return The enum numeric value on the wire for operationType. + */ + @java.lang.Override + public int getOperationTypeValue() { + return operationType_; + } + + /** + * + * + *
+   * The type of the operation. Valid values are:
+   * *  `CREATE`
+   * *  `DELETE`
+   * *  `UPDATE`
+   * *  `RESTART`
+   * *  `IMPORT`
+   * *  `EXPORT`
+   * *  `BACKUP_VOLUME`
+   * *  `RESTORE_VOLUME`
+   * *  `CREATE_USER`
+   * *  `DELETE_USER`
+   * *  `CREATE_DATABASE`
+   * *  `DELETE_DATABASE`
+   * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationType operation_type = 9; + * + * @return The operationType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Operation.SqlOperationType getOperationType() { + com.google.cloud.sql.v1.Operation.SqlOperationType result = + com.google.cloud.sql.v1.Operation.SqlOperationType.forNumber(operationType_); + return result == null + ? com.google.cloud.sql.v1.Operation.SqlOperationType.UNRECOGNIZED + : result; + } + + public static final int IMPORT_CONTEXT_FIELD_NUMBER = 10; + private com.google.cloud.sql.v1.ImportContext importContext_; + + /** + * + * + *
+   * The context for import operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + * + * @return Whether the importContext field is set. + */ + @java.lang.Override + public boolean hasImportContext() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * The context for import operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + * + * @return The importContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContext getImportContext() { + return importContext_ == null + ? com.google.cloud.sql.v1.ImportContext.getDefaultInstance() + : importContext_; + } + + /** + * + * + *
+   * The context for import operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ImportContextOrBuilder getImportContextOrBuilder() { + return importContext_ == null + ? com.google.cloud.sql.v1.ImportContext.getDefaultInstance() + : importContext_; + } + + public static final int EXPORT_CONTEXT_FIELD_NUMBER = 11; + private com.google.cloud.sql.v1.ExportContext exportContext_; + + /** + * + * + *
+   * The context for export operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + * + * @return Whether the exportContext field is set. + */ + @java.lang.Override + public boolean hasExportContext() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * The context for export operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + * + * @return The exportContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContext getExportContext() { + return exportContext_ == null + ? com.google.cloud.sql.v1.ExportContext.getDefaultInstance() + : exportContext_; + } + + /** + * + * + *
+   * The context for export operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExportContextOrBuilder getExportContextOrBuilder() { + return exportContext_ == null + ? com.google.cloud.sql.v1.ExportContext.getDefaultInstance() + : exportContext_; + } + + public static final int BACKUP_CONTEXT_FIELD_NUMBER = 17; + private com.google.cloud.sql.v1.BackupContext backupContext_; + + /** + * + * + *
+   * The context for backup operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + * + * @return Whether the backupContext field is set. + */ + @java.lang.Override + public boolean hasBackupContext() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * The context for backup operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + * + * @return The backupContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupContext getBackupContext() { + return backupContext_ == null + ? com.google.cloud.sql.v1.BackupContext.getDefaultInstance() + : backupContext_; + } + + /** + * + * + *
+   * The context for backup operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupContextOrBuilder getBackupContextOrBuilder() { + return backupContext_ == null + ? com.google.cloud.sql.v1.BackupContext.getDefaultInstance() + : backupContext_; + } + + public static final int PRE_CHECK_MAJOR_VERSION_UPGRADE_CONTEXT_FIELD_NUMBER = 50; + private com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext + preCheckMajorVersionUpgradeContext_; + + /** + * + * + *
+   * This field is only populated when the operation_type is
+   * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+   * The PreCheckMajorVersionUpgradeContext message itself contains the details
+   * for that pre-check, such as the target database version for the upgrade
+   * and the results of the check (including any warnings or errors found).
+   * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + * + * @return Whether the preCheckMajorVersionUpgradeContext field is set. + */ + @java.lang.Override + public boolean hasPreCheckMajorVersionUpgradeContext() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+   * This field is only populated when the operation_type is
+   * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+   * The PreCheckMajorVersionUpgradeContext message itself contains the details
+   * for that pre-check, such as the target database version for the upgrade
+   * and the results of the check (including any warnings or errors found).
+   * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + * + * @return The preCheckMajorVersionUpgradeContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext + getPreCheckMajorVersionUpgradeContext() { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } + + /** + * + * + *
+   * This field is only populated when the operation_type is
+   * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+   * The PreCheckMajorVersionUpgradeContext message itself contains the details
+   * for that pre-check, such as the target database version for the upgrade
+   * and the results of the check (including any warnings or errors found).
+   * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContextOrBuilder + getPreCheckMajorVersionUpgradeContextOrBuilder() { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } + + public static final int NAME_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * An identifier that uniquely identifies the operation. You can use this
+   * identifier to retrieve the Operations resource that has information about
+   * the operation.
+   * 
+ * + * string name = 12; + * + * @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; + } + } + + /** + * + * + *
+   * An identifier that uniquely identifies the operation. You can use this
+   * identifier to retrieve the Operations resource that has information about
+   * the operation.
+   * 
+ * + * string name = 12; + * + * @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 TARGET_ID_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private volatile java.lang.Object targetId_ = ""; + + /** + * + * + *
+   * Name of the resource on which this operation runs.
+   * 
+ * + * string target_id = 13; + * + * @return The targetId. + */ + @java.lang.Override + public java.lang.String getTargetId() { + java.lang.Object ref = targetId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetId_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the resource on which this operation runs.
+   * 
+ * + * string target_id = 13; + * + * @return The bytes for targetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetIdBytes() { + java.lang.Object ref = targetId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELF_LINK_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object selfLink_ = ""; + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 14; + * + * @return The selfLink. + */ + @java.lang.Override + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } + } + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 14; + * + * @return The bytes for selfLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_PROJECT_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object targetProject_ = ""; + + /** + * + * + *
+   * The project ID of the target instance related to this operation.
+   * 
+ * + * string target_project = 15; + * + * @return The targetProject. + */ + @java.lang.Override + public java.lang.String getTargetProject() { + java.lang.Object ref = targetProject_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetProject_ = s; + return s; + } + } + + /** + * + * + *
+   * The project ID of the target instance related to this operation.
+   * 
+ * + * string target_project = 15; + * + * @return The bytes for targetProject. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetProjectBytes() { + java.lang.Object ref = targetProject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACQUIRE_SSRS_LEASE_CONTEXT_FIELD_NUMBER = 20; + private com.google.cloud.sql.v1.AcquireSsrsLeaseContext acquireSsrsLeaseContext_; + + /** + * + * + *
+   * The context for acquire SSRS lease operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + * @return Whether the acquireSsrsLeaseContext field is set. + */ + @java.lang.Override + public boolean hasAcquireSsrsLeaseContext() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+   * The context for acquire SSRS lease operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + * @return The acquireSsrsLeaseContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1.AcquireSsrsLeaseContext getAcquireSsrsLeaseContext() { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } + + /** + * + * + *
+   * The context for acquire SSRS lease operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + */ + @java.lang.Override + public com.google.cloud.sql.v1.AcquireSsrsLeaseContextOrBuilder + getAcquireSsrsLeaseContextOrBuilder() { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } + + public static final int SUB_OPERATION_TYPE_FIELD_NUMBER = 48; + private com.google.cloud.sql.v1.SqlSubOperationType subOperationType_; + + /** + * + * + *
+   * Optional. The sub operation based on the operation type.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the subOperationType field is set. + */ + @java.lang.Override + public boolean hasSubOperationType() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+   * Optional. The sub operation based on the operation type.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The subOperationType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlSubOperationType getSubOperationType() { + return subOperationType_ == null + ? com.google.cloud.sql.v1.SqlSubOperationType.getDefaultInstance() + : subOperationType_; + } + + /** + * + * + *
+   * Optional. The sub operation based on the operation type.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlSubOperationTypeOrBuilder getSubOperationTypeOrBuilder() { + return subOperationType_ == null + ? com.google.cloud.sql.v1.SqlSubOperationType.getDefaultInstance() + : subOperationType_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(targetLink_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, targetLink_); + } + if (status_ + != com.google.cloud.sql.v1.Operation.SqlOperationStatus.SQL_OPERATION_STATUS_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, status_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(user_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, user_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getInsertTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(7, getEndTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(8, getError()); + } + if (operationType_ + != com.google.cloud.sql.v1.Operation.SqlOperationType.SQL_OPERATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, operationType_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(10, getImportContext()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(11, getExportContext()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(targetId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 13, targetId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 14, selfLink_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(targetProject_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 15, targetProject_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(17, getBackupContext()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(19, getApiWarning()); + } + if (((bitField0_ & 0x00000200) != 0)) { + output.writeMessage(20, getAcquireSsrsLeaseContext()); + } + if (((bitField0_ & 0x00000400) != 0)) { + output.writeMessage(48, getSubOperationType()); + } + if (((bitField0_ & 0x00000100) != 0)) { + output.writeMessage(50, getPreCheckMajorVersionUpgradeContext()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(targetLink_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, targetLink_); + } + if (status_ + != com.google.cloud.sql.v1.Operation.SqlOperationStatus.SQL_OPERATION_STATUS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, status_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(user_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, user_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getInsertTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getEndTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getError()); + } + if (operationType_ + != com.google.cloud.sql.v1.Operation.SqlOperationType.SQL_OPERATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, operationType_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getImportContext()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getExportContext()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(targetId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(13, targetId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(14, selfLink_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(targetProject_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(15, targetProject_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getBackupContext()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getApiWarning()); + } + if (((bitField0_ & 0x00000200) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 20, getAcquireSsrsLeaseContext()); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(48, getSubOperationType()); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 50, getPreCheckMajorVersionUpgradeContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.Operation)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.Operation other = (com.google.cloud.sql.v1.Operation) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getTargetLink().equals(other.getTargetLink())) return false; + if (status_ != other.status_) return false; + if (!getUser().equals(other.getUser())) return false; + if (hasInsertTime() != other.hasInsertTime()) return false; + if (hasInsertTime()) { + if (!getInsertTime().equals(other.getInsertTime())) return false; + } + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (hasApiWarning() != other.hasApiWarning()) return false; + if (hasApiWarning()) { + if (!getApiWarning().equals(other.getApiWarning())) return false; + } + if (operationType_ != other.operationType_) return false; + if (hasImportContext() != other.hasImportContext()) return false; + if (hasImportContext()) { + if (!getImportContext().equals(other.getImportContext())) return false; + } + if (hasExportContext() != other.hasExportContext()) return false; + if (hasExportContext()) { + if (!getExportContext().equals(other.getExportContext())) return false; + } + if (hasBackupContext() != other.hasBackupContext()) return false; + if (hasBackupContext()) { + if (!getBackupContext().equals(other.getBackupContext())) return false; + } + if (hasPreCheckMajorVersionUpgradeContext() != other.hasPreCheckMajorVersionUpgradeContext()) + return false; + if (hasPreCheckMajorVersionUpgradeContext()) { + if (!getPreCheckMajorVersionUpgradeContext() + .equals(other.getPreCheckMajorVersionUpgradeContext())) return false; + } + if (!getName().equals(other.getName())) return false; + if (!getTargetId().equals(other.getTargetId())) return false; + if (!getSelfLink().equals(other.getSelfLink())) return false; + if (!getTargetProject().equals(other.getTargetProject())) return false; + if (hasAcquireSsrsLeaseContext() != other.hasAcquireSsrsLeaseContext()) return false; + if (hasAcquireSsrsLeaseContext()) { + if (!getAcquireSsrsLeaseContext().equals(other.getAcquireSsrsLeaseContext())) return false; + } + if (hasSubOperationType() != other.hasSubOperationType()) return false; + if (hasSubOperationType()) { + if (!getSubOperationType().equals(other.getSubOperationType())) return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + TARGET_LINK_FIELD_NUMBER; + hash = (53 * hash) + getTargetLink().hashCode(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + if (hasInsertTime()) { + hash = (37 * hash) + INSERT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getInsertTime().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + if (hasApiWarning()) { + hash = (37 * hash) + API_WARNING_FIELD_NUMBER; + hash = (53 * hash) + getApiWarning().hashCode(); + } + hash = (37 * hash) + OPERATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + operationType_; + if (hasImportContext()) { + hash = (37 * hash) + IMPORT_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getImportContext().hashCode(); + } + if (hasExportContext()) { + hash = (37 * hash) + EXPORT_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getExportContext().hashCode(); + } + if (hasBackupContext()) { + hash = (37 * hash) + BACKUP_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getBackupContext().hashCode(); + } + if (hasPreCheckMajorVersionUpgradeContext()) { + hash = (37 * hash) + PRE_CHECK_MAJOR_VERSION_UPGRADE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getPreCheckMajorVersionUpgradeContext().hashCode(); + } + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TARGET_ID_FIELD_NUMBER; + hash = (53 * hash) + getTargetId().hashCode(); + hash = (37 * hash) + SELF_LINK_FIELD_NUMBER; + hash = (53 * hash) + getSelfLink().hashCode(); + hash = (37 * hash) + TARGET_PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getTargetProject().hashCode(); + if (hasAcquireSsrsLeaseContext()) { + hash = (37 * hash) + ACQUIRE_SSRS_LEASE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getAcquireSsrsLeaseContext().hashCode(); + } + if (hasSubOperationType()) { + hash = (37 * hash) + SUB_OPERATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getSubOperationType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.Operation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Operation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Operation parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Operation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Operation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Operation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Operation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Operation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Operation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Operation parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Operation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Operation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.Operation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * An Operation resource.&nbsp;For successful operations that return an
+   * Operation resource, only the fields relevant to the operation are populated
+   * in the resource.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Operation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.Operation) + com.google.cloud.sql.v1.OperationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Operation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Operation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Operation.class, + com.google.cloud.sql.v1.Operation.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.Operation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetInsertTimeFieldBuilder(); + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + internalGetErrorFieldBuilder(); + internalGetApiWarningFieldBuilder(); + internalGetImportContextFieldBuilder(); + internalGetExportContextFieldBuilder(); + internalGetBackupContextFieldBuilder(); + internalGetPreCheckMajorVersionUpgradeContextFieldBuilder(); + internalGetAcquireSsrsLeaseContextFieldBuilder(); + internalGetSubOperationTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + targetLink_ = ""; + status_ = 0; + user_ = ""; + insertTime_ = null; + if (insertTimeBuilder_ != null) { + insertTimeBuilder_.dispose(); + insertTimeBuilder_ = null; + } + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + apiWarning_ = null; + if (apiWarningBuilder_ != null) { + apiWarningBuilder_.dispose(); + apiWarningBuilder_ = null; + } + operationType_ = 0; + importContext_ = null; + if (importContextBuilder_ != null) { + importContextBuilder_.dispose(); + importContextBuilder_ = null; + } + exportContext_ = null; + if (exportContextBuilder_ != null) { + exportContextBuilder_.dispose(); + exportContextBuilder_ = null; + } + backupContext_ = null; + if (backupContextBuilder_ != null) { + backupContextBuilder_.dispose(); + backupContextBuilder_ = null; + } + preCheckMajorVersionUpgradeContext_ = null; + if (preCheckMajorVersionUpgradeContextBuilder_ != null) { + preCheckMajorVersionUpgradeContextBuilder_.dispose(); + preCheckMajorVersionUpgradeContextBuilder_ = null; + } + name_ = ""; + targetId_ = ""; + selfLink_ = ""; + targetProject_ = ""; + acquireSsrsLeaseContext_ = null; + if (acquireSsrsLeaseContextBuilder_ != null) { + acquireSsrsLeaseContextBuilder_.dispose(); + acquireSsrsLeaseContextBuilder_ = null; + } + subOperationType_ = null; + if (subOperationTypeBuilder_ != null) { + subOperationTypeBuilder_.dispose(); + subOperationTypeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Operation_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Operation getDefaultInstanceForType() { + return com.google.cloud.sql.v1.Operation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.Operation build() { + com.google.cloud.sql.v1.Operation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Operation buildPartial() { + com.google.cloud.sql.v1.Operation result = new com.google.cloud.sql.v1.Operation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.Operation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.targetLink_ = targetLink_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.status_ = status_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.user_ = user_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.insertTime_ = insertTimeBuilder_ == null ? insertTime_ : insertTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.apiWarning_ = apiWarningBuilder_ == null ? apiWarning_ : apiWarningBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.operationType_ = operationType_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.importContext_ = + importContextBuilder_ == null ? importContext_ : importContextBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.exportContext_ = + exportContextBuilder_ == null ? exportContext_ : exportContextBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.backupContext_ = + backupContextBuilder_ == null ? backupContext_ : backupContextBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.preCheckMajorVersionUpgradeContext_ = + preCheckMajorVersionUpgradeContextBuilder_ == null + ? preCheckMajorVersionUpgradeContext_ + : preCheckMajorVersionUpgradeContextBuilder_.build(); + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.targetId_ = targetId_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.selfLink_ = selfLink_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.targetProject_ = targetProject_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.acquireSsrsLeaseContext_ = + acquireSsrsLeaseContextBuilder_ == null + ? acquireSsrsLeaseContext_ + : acquireSsrsLeaseContextBuilder_.build(); + to_bitField0_ |= 0x00000200; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.subOperationType_ = + subOperationTypeBuilder_ == null ? subOperationType_ : subOperationTypeBuilder_.build(); + to_bitField0_ |= 0x00000400; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.Operation) { + return mergeFrom((com.google.cloud.sql.v1.Operation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.Operation other) { + if (other == com.google.cloud.sql.v1.Operation.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTargetLink().isEmpty()) { + targetLink_ = other.targetLink_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + if (!other.getUser().isEmpty()) { + user_ = other.user_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasInsertTime()) { + mergeInsertTime(other.getInsertTime()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (other.hasApiWarning()) { + mergeApiWarning(other.getApiWarning()); + } + if (other.operationType_ != 0) { + setOperationTypeValue(other.getOperationTypeValue()); + } + if (other.hasImportContext()) { + mergeImportContext(other.getImportContext()); + } + if (other.hasExportContext()) { + mergeExportContext(other.getExportContext()); + } + if (other.hasBackupContext()) { + mergeBackupContext(other.getBackupContext()); + } + if (other.hasPreCheckMajorVersionUpgradeContext()) { + mergePreCheckMajorVersionUpgradeContext(other.getPreCheckMajorVersionUpgradeContext()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00004000; + onChanged(); + } + if (!other.getTargetId().isEmpty()) { + targetId_ = other.targetId_; + bitField0_ |= 0x00008000; + onChanged(); + } + if (!other.getSelfLink().isEmpty()) { + selfLink_ = other.selfLink_; + bitField0_ |= 0x00010000; + onChanged(); + } + if (!other.getTargetProject().isEmpty()) { + targetProject_ = other.targetProject_; + bitField0_ |= 0x00020000; + onChanged(); + } + if (other.hasAcquireSsrsLeaseContext()) { + mergeAcquireSsrsLeaseContext(other.getAcquireSsrsLeaseContext()); + } + if (other.hasSubOperationType()) { + mergeSubOperationType(other.getSubOperationType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + targetLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + status_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + user_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetInsertTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: + { + operationType_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 72 + case 82: + { + input.readMessage( + internalGetImportContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 82 + case 90: + { + input.readMessage( + internalGetExportContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 90 + case 98: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 98 + case 106: + { + targetId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 106 + case 114: + { + selfLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00010000; + break; + } // case 114 + case 122: + { + targetProject_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00020000; + break; + } // case 122 + case 138: + { + input.readMessage( + internalGetBackupContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 138 + case 154: + { + input.readMessage( + internalGetApiWarningFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 154 + case 162: + { + input.readMessage( + internalGetAcquireSsrsLeaseContextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 162 + case 386: + { + input.readMessage( + internalGetSubOperationTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 386 + case 402: + { + input.readMessage( + internalGetPreCheckMajorVersionUpgradeContextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 402 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#operation`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operation`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operation`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operation`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operation`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object targetLink_ = ""; + + /** + * string target_link = 2; + * + * @return The targetLink. + */ + public java.lang.String getTargetLink() { + java.lang.Object ref = targetLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string target_link = 2; + * + * @return The bytes for targetLink. + */ + public com.google.protobuf.ByteString getTargetLinkBytes() { + java.lang.Object ref = targetLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string target_link = 2; + * + * @param value The targetLink to set. + * @return This builder for chaining. + */ + public Builder setTargetLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetLink_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string target_link = 2; + * + * @return This builder for chaining. + */ + public Builder clearTargetLink() { + targetLink_ = getDefaultInstance().getTargetLink(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string target_link = 2; + * + * @param value The bytes for targetLink to set. + * @return This builder for chaining. + */ + public Builder setTargetLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetLink_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int status_ = 0; + + /** + * + * + *
+     * The status of an operation.
+     * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationStatus status = 3; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
+     * The status of an operation.
+     * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationStatus status = 3; + * + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + status_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The status of an operation.
+     * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationStatus status = 3; + * + * @return The status. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Operation.SqlOperationStatus getStatus() { + com.google.cloud.sql.v1.Operation.SqlOperationStatus result = + com.google.cloud.sql.v1.Operation.SqlOperationStatus.forNumber(status_); + return result == null + ? com.google.cloud.sql.v1.Operation.SqlOperationStatus.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The status of an operation.
+     * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationStatus status = 3; + * + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(com.google.cloud.sql.v1.Operation.SqlOperationStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + status_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The status of an operation.
+     * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationStatus status = 3; + * + * @return This builder for chaining. + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + status_ = 0; + onChanged(); + return this; + } + + private java.lang.Object user_ = ""; + + /** + * + * + *
+     * The email address of the user who initiated this operation.
+     * 
+ * + * string user = 4; + * + * @return The user. + */ + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The email address of the user who initiated this operation.
+     * 
+ * + * string user = 4; + * + * @return The bytes for user. + */ + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The email address of the user who initiated this operation.
+     * 
+ * + * string user = 4; + * + * @param value The user to set. + * @return This builder for chaining. + */ + public Builder setUser(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The email address of the user who initiated this operation.
+     * 
+ * + * string user = 4; + * + * @return This builder for chaining. + */ + public Builder clearUser() { + user_ = getDefaultInstance().getUser(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The email address of the user who initiated this operation.
+     * 
+ * + * string user = 4; + * + * @param value The bytes for user to set. + * @return This builder for chaining. + */ + public Builder setUserBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + user_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp insertTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + insertTimeBuilder_; + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + * + * @return Whether the insertTime field is set. + */ + public boolean hasInsertTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + * + * @return The insertTime. + */ + public com.google.protobuf.Timestamp getInsertTime() { + if (insertTimeBuilder_ == null) { + return insertTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : insertTime_; + } else { + return insertTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + public Builder setInsertTime(com.google.protobuf.Timestamp value) { + if (insertTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + insertTime_ = value; + } else { + insertTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + public Builder setInsertTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (insertTimeBuilder_ == null) { + insertTime_ = builderForValue.build(); + } else { + insertTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + public Builder mergeInsertTime(com.google.protobuf.Timestamp value) { + if (insertTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && insertTime_ != null + && insertTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getInsertTimeBuilder().mergeFrom(value); + } else { + insertTime_ = value; + } + } else { + insertTimeBuilder_.mergeFrom(value); + } + if (insertTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + public Builder clearInsertTime() { + bitField0_ = (bitField0_ & ~0x00000010); + insertTime_ = null; + if (insertTimeBuilder_ != null) { + insertTimeBuilder_.dispose(); + insertTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getInsertTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetInsertTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getInsertTimeOrBuilder() { + if (insertTimeBuilder_ != null) { + return insertTimeBuilder_.getMessageOrBuilder(); + } else { + return insertTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : insertTime_; + } + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetInsertTimeFieldBuilder() { + if (insertTimeBuilder_ == null) { + insertTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getInsertTime(), getParentForChildren(), isClean()); + insertTime_ = null; + } + return insertTimeBuilder_; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000020); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * The time this operation finished in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + * + * @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(); + } + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000040); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private com.google.cloud.sql.v1.OperationErrors error_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.OperationErrors, + com.google.cloud.sql.v1.OperationErrors.Builder, + com.google.cloud.sql.v1.OperationErrorsOrBuilder> + errorBuilder_; + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + * + * @return The error. + */ + public com.google.cloud.sql.v1.OperationErrors getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.cloud.sql.v1.OperationErrors.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + */ + public Builder setError(com.google.cloud.sql.v1.OperationErrors value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + */ + public Builder setError(com.google.cloud.sql.v1.OperationErrors.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + */ + public Builder mergeError(com.google.cloud.sql.v1.OperationErrors value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && error_ != null + && error_ != com.google.cloud.sql.v1.OperationErrors.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000080); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + */ + public com.google.cloud.sql.v1.OperationErrors.Builder getErrorBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + */ + public com.google.cloud.sql.v1.OperationErrorsOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.cloud.sql.v1.OperationErrors.getDefaultInstance() + : error_; + } + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.OperationErrors, + com.google.cloud.sql.v1.OperationErrors.Builder, + com.google.cloud.sql.v1.OperationErrorsOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.OperationErrors, + com.google.cloud.sql.v1.OperationErrors.Builder, + com.google.cloud.sql.v1.OperationErrorsOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + private com.google.cloud.sql.v1.ApiWarning apiWarning_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ApiWarning, + com.google.cloud.sql.v1.ApiWarning.Builder, + com.google.cloud.sql.v1.ApiWarningOrBuilder> + apiWarningBuilder_; + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + * + * @return Whether the apiWarning field is set. + */ + public boolean hasApiWarning() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + * + * @return The apiWarning. + */ + public com.google.cloud.sql.v1.ApiWarning getApiWarning() { + if (apiWarningBuilder_ == null) { + return apiWarning_ == null + ? com.google.cloud.sql.v1.ApiWarning.getDefaultInstance() + : apiWarning_; + } else { + return apiWarningBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + */ + public Builder setApiWarning(com.google.cloud.sql.v1.ApiWarning value) { + if (apiWarningBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + apiWarning_ = value; + } else { + apiWarningBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + */ + public Builder setApiWarning(com.google.cloud.sql.v1.ApiWarning.Builder builderForValue) { + if (apiWarningBuilder_ == null) { + apiWarning_ = builderForValue.build(); + } else { + apiWarningBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + */ + public Builder mergeApiWarning(com.google.cloud.sql.v1.ApiWarning value) { + if (apiWarningBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && apiWarning_ != null + && apiWarning_ != com.google.cloud.sql.v1.ApiWarning.getDefaultInstance()) { + getApiWarningBuilder().mergeFrom(value); + } else { + apiWarning_ = value; + } + } else { + apiWarningBuilder_.mergeFrom(value); + } + if (apiWarning_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + */ + public Builder clearApiWarning() { + bitField0_ = (bitField0_ & ~0x00000100); + apiWarning_ = null; + if (apiWarningBuilder_ != null) { + apiWarningBuilder_.dispose(); + apiWarningBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + */ + public com.google.cloud.sql.v1.ApiWarning.Builder getApiWarningBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetApiWarningFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + */ + public com.google.cloud.sql.v1.ApiWarningOrBuilder getApiWarningOrBuilder() { + if (apiWarningBuilder_ != null) { + return apiWarningBuilder_.getMessageOrBuilder(); + } else { + return apiWarning_ == null + ? com.google.cloud.sql.v1.ApiWarning.getDefaultInstance() + : apiWarning_; + } + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ApiWarning, + com.google.cloud.sql.v1.ApiWarning.Builder, + com.google.cloud.sql.v1.ApiWarningOrBuilder> + internalGetApiWarningFieldBuilder() { + if (apiWarningBuilder_ == null) { + apiWarningBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ApiWarning, + com.google.cloud.sql.v1.ApiWarning.Builder, + com.google.cloud.sql.v1.ApiWarningOrBuilder>( + getApiWarning(), getParentForChildren(), isClean()); + apiWarning_ = null; + } + return apiWarningBuilder_; + } + + private int operationType_ = 0; + + /** + * + * + *
+     * The type of the operation. Valid values are:
+     * *  `CREATE`
+     * *  `DELETE`
+     * *  `UPDATE`
+     * *  `RESTART`
+     * *  `IMPORT`
+     * *  `EXPORT`
+     * *  `BACKUP_VOLUME`
+     * *  `RESTORE_VOLUME`
+     * *  `CREATE_USER`
+     * *  `DELETE_USER`
+     * *  `CREATE_DATABASE`
+     * *  `DELETE_DATABASE`
+     * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationType operation_type = 9; + * + * @return The enum numeric value on the wire for operationType. + */ + @java.lang.Override + public int getOperationTypeValue() { + return operationType_; + } + + /** + * + * + *
+     * The type of the operation. Valid values are:
+     * *  `CREATE`
+     * *  `DELETE`
+     * *  `UPDATE`
+     * *  `RESTART`
+     * *  `IMPORT`
+     * *  `EXPORT`
+     * *  `BACKUP_VOLUME`
+     * *  `RESTORE_VOLUME`
+     * *  `CREATE_USER`
+     * *  `DELETE_USER`
+     * *  `CREATE_DATABASE`
+     * *  `DELETE_DATABASE`
+     * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationType operation_type = 9; + * + * @param value The enum numeric value on the wire for operationType to set. + * @return This builder for chaining. + */ + public Builder setOperationTypeValue(int value) { + operationType_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the operation. Valid values are:
+     * *  `CREATE`
+     * *  `DELETE`
+     * *  `UPDATE`
+     * *  `RESTART`
+     * *  `IMPORT`
+     * *  `EXPORT`
+     * *  `BACKUP_VOLUME`
+     * *  `RESTORE_VOLUME`
+     * *  `CREATE_USER`
+     * *  `DELETE_USER`
+     * *  `CREATE_DATABASE`
+     * *  `DELETE_DATABASE`
+     * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationType operation_type = 9; + * + * @return The operationType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Operation.SqlOperationType getOperationType() { + com.google.cloud.sql.v1.Operation.SqlOperationType result = + com.google.cloud.sql.v1.Operation.SqlOperationType.forNumber(operationType_); + return result == null + ? com.google.cloud.sql.v1.Operation.SqlOperationType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The type of the operation. Valid values are:
+     * *  `CREATE`
+     * *  `DELETE`
+     * *  `UPDATE`
+     * *  `RESTART`
+     * *  `IMPORT`
+     * *  `EXPORT`
+     * *  `BACKUP_VOLUME`
+     * *  `RESTORE_VOLUME`
+     * *  `CREATE_USER`
+     * *  `DELETE_USER`
+     * *  `CREATE_DATABASE`
+     * *  `DELETE_DATABASE`
+     * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationType operation_type = 9; + * + * @param value The operationType to set. + * @return This builder for chaining. + */ + public Builder setOperationType(com.google.cloud.sql.v1.Operation.SqlOperationType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + operationType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the operation. Valid values are:
+     * *  `CREATE`
+     * *  `DELETE`
+     * *  `UPDATE`
+     * *  `RESTART`
+     * *  `IMPORT`
+     * *  `EXPORT`
+     * *  `BACKUP_VOLUME`
+     * *  `RESTORE_VOLUME`
+     * *  `CREATE_USER`
+     * *  `DELETE_USER`
+     * *  `CREATE_DATABASE`
+     * *  `DELETE_DATABASE`
+     * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationType operation_type = 9; + * + * @return This builder for chaining. + */ + public Builder clearOperationType() { + bitField0_ = (bitField0_ & ~0x00000200); + operationType_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.ImportContext importContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext, + com.google.cloud.sql.v1.ImportContext.Builder, + com.google.cloud.sql.v1.ImportContextOrBuilder> + importContextBuilder_; + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + * + * @return Whether the importContext field is set. + */ + public boolean hasImportContext() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + * + * @return The importContext. + */ + public com.google.cloud.sql.v1.ImportContext getImportContext() { + if (importContextBuilder_ == null) { + return importContext_ == null + ? com.google.cloud.sql.v1.ImportContext.getDefaultInstance() + : importContext_; + } else { + return importContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + */ + public Builder setImportContext(com.google.cloud.sql.v1.ImportContext value) { + if (importContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + importContext_ = value; + } else { + importContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + */ + public Builder setImportContext(com.google.cloud.sql.v1.ImportContext.Builder builderForValue) { + if (importContextBuilder_ == null) { + importContext_ = builderForValue.build(); + } else { + importContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + */ + public Builder mergeImportContext(com.google.cloud.sql.v1.ImportContext value) { + if (importContextBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && importContext_ != null + && importContext_ != com.google.cloud.sql.v1.ImportContext.getDefaultInstance()) { + getImportContextBuilder().mergeFrom(value); + } else { + importContext_ = value; + } + } else { + importContextBuilder_.mergeFrom(value); + } + if (importContext_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + */ + public Builder clearImportContext() { + bitField0_ = (bitField0_ & ~0x00000400); + importContext_ = null; + if (importContextBuilder_ != null) { + importContextBuilder_.dispose(); + importContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + */ + public com.google.cloud.sql.v1.ImportContext.Builder getImportContextBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return internalGetImportContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + */ + public com.google.cloud.sql.v1.ImportContextOrBuilder getImportContextOrBuilder() { + if (importContextBuilder_ != null) { + return importContextBuilder_.getMessageOrBuilder(); + } else { + return importContext_ == null + ? com.google.cloud.sql.v1.ImportContext.getDefaultInstance() + : importContext_; + } + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext, + com.google.cloud.sql.v1.ImportContext.Builder, + com.google.cloud.sql.v1.ImportContextOrBuilder> + internalGetImportContextFieldBuilder() { + if (importContextBuilder_ == null) { + importContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ImportContext, + com.google.cloud.sql.v1.ImportContext.Builder, + com.google.cloud.sql.v1.ImportContextOrBuilder>( + getImportContext(), getParentForChildren(), isClean()); + importContext_ = null; + } + return importContextBuilder_; + } + + private com.google.cloud.sql.v1.ExportContext exportContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext, + com.google.cloud.sql.v1.ExportContext.Builder, + com.google.cloud.sql.v1.ExportContextOrBuilder> + exportContextBuilder_; + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + * + * @return Whether the exportContext field is set. + */ + public boolean hasExportContext() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + * + * @return The exportContext. + */ + public com.google.cloud.sql.v1.ExportContext getExportContext() { + if (exportContextBuilder_ == null) { + return exportContext_ == null + ? com.google.cloud.sql.v1.ExportContext.getDefaultInstance() + : exportContext_; + } else { + return exportContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + */ + public Builder setExportContext(com.google.cloud.sql.v1.ExportContext value) { + if (exportContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + exportContext_ = value; + } else { + exportContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + */ + public Builder setExportContext(com.google.cloud.sql.v1.ExportContext.Builder builderForValue) { + if (exportContextBuilder_ == null) { + exportContext_ = builderForValue.build(); + } else { + exportContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + */ + public Builder mergeExportContext(com.google.cloud.sql.v1.ExportContext value) { + if (exportContextBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && exportContext_ != null + && exportContext_ != com.google.cloud.sql.v1.ExportContext.getDefaultInstance()) { + getExportContextBuilder().mergeFrom(value); + } else { + exportContext_ = value; + } + } else { + exportContextBuilder_.mergeFrom(value); + } + if (exportContext_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + */ + public Builder clearExportContext() { + bitField0_ = (bitField0_ & ~0x00000800); + exportContext_ = null; + if (exportContextBuilder_ != null) { + exportContextBuilder_.dispose(); + exportContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + */ + public com.google.cloud.sql.v1.ExportContext.Builder getExportContextBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return internalGetExportContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + */ + public com.google.cloud.sql.v1.ExportContextOrBuilder getExportContextOrBuilder() { + if (exportContextBuilder_ != null) { + return exportContextBuilder_.getMessageOrBuilder(); + } else { + return exportContext_ == null + ? com.google.cloud.sql.v1.ExportContext.getDefaultInstance() + : exportContext_; + } + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext, + com.google.cloud.sql.v1.ExportContext.Builder, + com.google.cloud.sql.v1.ExportContextOrBuilder> + internalGetExportContextFieldBuilder() { + if (exportContextBuilder_ == null) { + exportContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExportContext, + com.google.cloud.sql.v1.ExportContext.Builder, + com.google.cloud.sql.v1.ExportContextOrBuilder>( + getExportContext(), getParentForChildren(), isClean()); + exportContext_ = null; + } + return exportContextBuilder_; + } + + private com.google.cloud.sql.v1.BackupContext backupContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupContext, + com.google.cloud.sql.v1.BackupContext.Builder, + com.google.cloud.sql.v1.BackupContextOrBuilder> + backupContextBuilder_; + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + * + * @return Whether the backupContext field is set. + */ + public boolean hasBackupContext() { + return ((bitField0_ & 0x00001000) != 0); + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + * + * @return The backupContext. + */ + public com.google.cloud.sql.v1.BackupContext getBackupContext() { + if (backupContextBuilder_ == null) { + return backupContext_ == null + ? com.google.cloud.sql.v1.BackupContext.getDefaultInstance() + : backupContext_; + } else { + return backupContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + */ + public Builder setBackupContext(com.google.cloud.sql.v1.BackupContext value) { + if (backupContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupContext_ = value; + } else { + backupContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + */ + public Builder setBackupContext(com.google.cloud.sql.v1.BackupContext.Builder builderForValue) { + if (backupContextBuilder_ == null) { + backupContext_ = builderForValue.build(); + } else { + backupContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + */ + public Builder mergeBackupContext(com.google.cloud.sql.v1.BackupContext value) { + if (backupContextBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && backupContext_ != null + && backupContext_ != com.google.cloud.sql.v1.BackupContext.getDefaultInstance()) { + getBackupContextBuilder().mergeFrom(value); + } else { + backupContext_ = value; + } + } else { + backupContextBuilder_.mergeFrom(value); + } + if (backupContext_ != null) { + bitField0_ |= 0x00001000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + */ + public Builder clearBackupContext() { + bitField0_ = (bitField0_ & ~0x00001000); + backupContext_ = null; + if (backupContextBuilder_ != null) { + backupContextBuilder_.dispose(); + backupContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + */ + public com.google.cloud.sql.v1.BackupContext.Builder getBackupContextBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return internalGetBackupContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + */ + public com.google.cloud.sql.v1.BackupContextOrBuilder getBackupContextOrBuilder() { + if (backupContextBuilder_ != null) { + return backupContextBuilder_.getMessageOrBuilder(); + } else { + return backupContext_ == null + ? com.google.cloud.sql.v1.BackupContext.getDefaultInstance() + : backupContext_; + } + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupContext, + com.google.cloud.sql.v1.BackupContext.Builder, + com.google.cloud.sql.v1.BackupContextOrBuilder> + internalGetBackupContextFieldBuilder() { + if (backupContextBuilder_ == null) { + backupContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupContext, + com.google.cloud.sql.v1.BackupContext.Builder, + com.google.cloud.sql.v1.BackupContextOrBuilder>( + getBackupContext(), getParentForChildren(), isClean()); + backupContext_ = null; + } + return backupContextBuilder_; + } + + private com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext + preCheckMajorVersionUpgradeContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext, + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.Builder, + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContextOrBuilder> + preCheckMajorVersionUpgradeContextBuilder_; + + /** + * + * + *
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + * + * @return Whether the preCheckMajorVersionUpgradeContext field is set. + */ + public boolean hasPreCheckMajorVersionUpgradeContext() { + return ((bitField0_ & 0x00002000) != 0); + } + + /** + * + * + *
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + * + * @return The preCheckMajorVersionUpgradeContext. + */ + public com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext + getPreCheckMajorVersionUpgradeContext() { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } else { + return preCheckMajorVersionUpgradeContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + public Builder setPreCheckMajorVersionUpgradeContext( + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext value) { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + preCheckMajorVersionUpgradeContext_ = value; + } else { + preCheckMajorVersionUpgradeContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + public Builder setPreCheckMajorVersionUpgradeContext( + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.Builder builderForValue) { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + preCheckMajorVersionUpgradeContext_ = builderForValue.build(); + } else { + preCheckMajorVersionUpgradeContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + public Builder mergePreCheckMajorVersionUpgradeContext( + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext value) { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && preCheckMajorVersionUpgradeContext_ != null + && preCheckMajorVersionUpgradeContext_ + != com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext + .getDefaultInstance()) { + getPreCheckMajorVersionUpgradeContextBuilder().mergeFrom(value); + } else { + preCheckMajorVersionUpgradeContext_ = value; + } + } else { + preCheckMajorVersionUpgradeContextBuilder_.mergeFrom(value); + } + if (preCheckMajorVersionUpgradeContext_ != null) { + bitField0_ |= 0x00002000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + public Builder clearPreCheckMajorVersionUpgradeContext() { + bitField0_ = (bitField0_ & ~0x00002000); + preCheckMajorVersionUpgradeContext_ = null; + if (preCheckMajorVersionUpgradeContextBuilder_ != null) { + preCheckMajorVersionUpgradeContextBuilder_.dispose(); + preCheckMajorVersionUpgradeContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + public com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.Builder + getPreCheckMajorVersionUpgradeContextBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return internalGetPreCheckMajorVersionUpgradeContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + public com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContextOrBuilder + getPreCheckMajorVersionUpgradeContextOrBuilder() { + if (preCheckMajorVersionUpgradeContextBuilder_ != null) { + return preCheckMajorVersionUpgradeContextBuilder_.getMessageOrBuilder(); + } else { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } + } + + /** + * + * + *
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext, + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.Builder, + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContextOrBuilder> + internalGetPreCheckMajorVersionUpgradeContextFieldBuilder() { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + preCheckMajorVersionUpgradeContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext, + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.Builder, + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContextOrBuilder>( + getPreCheckMajorVersionUpgradeContext(), getParentForChildren(), isClean()); + preCheckMajorVersionUpgradeContext_ = null; + } + return preCheckMajorVersionUpgradeContextBuilder_; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * An identifier that uniquely identifies the operation. You can use this
+     * identifier to retrieve the Operations resource that has information about
+     * the operation.
+     * 
+ * + * string name = 12; + * + * @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; + } + } + + /** + * + * + *
+     * An identifier that uniquely identifies the operation. You can use this
+     * identifier to retrieve the Operations resource that has information about
+     * the operation.
+     * 
+ * + * string name = 12; + * + * @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; + } + } + + /** + * + * + *
+     * An identifier that uniquely identifies the operation. You can use this
+     * identifier to retrieve the Operations resource that has information about
+     * the operation.
+     * 
+ * + * string name = 12; + * + * @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_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * An identifier that uniquely identifies the operation. You can use this
+     * identifier to retrieve the Operations resource that has information about
+     * the operation.
+     * 
+ * + * string name = 12; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + + /** + * + * + *
+     * An identifier that uniquely identifies the operation. You can use this
+     * identifier to retrieve the Operations resource that has information about
+     * the operation.
+     * 
+ * + * string name = 12; + * + * @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_ |= 0x00004000; + onChanged(); + return this; + } + + private java.lang.Object targetId_ = ""; + + /** + * + * + *
+     * Name of the resource on which this operation runs.
+     * 
+ * + * string target_id = 13; + * + * @return The targetId. + */ + public java.lang.String getTargetId() { + java.lang.Object ref = targetId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the resource on which this operation runs.
+     * 
+ * + * string target_id = 13; + * + * @return The bytes for targetId. + */ + public com.google.protobuf.ByteString getTargetIdBytes() { + java.lang.Object ref = targetId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the resource on which this operation runs.
+     * 
+ * + * string target_id = 13; + * + * @param value The targetId to set. + * @return This builder for chaining. + */ + public Builder setTargetId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetId_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the resource on which this operation runs.
+     * 
+ * + * string target_id = 13; + * + * @return This builder for chaining. + */ + public Builder clearTargetId() { + targetId_ = getDefaultInstance().getTargetId(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the resource on which this operation runs.
+     * 
+ * + * string target_id = 13; + * + * @param value The bytes for targetId to set. + * @return This builder for chaining. + */ + public Builder setTargetIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetId_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private java.lang.Object selfLink_ = ""; + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 14; + * + * @return The selfLink. + */ + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 14; + * + * @return The bytes for selfLink. + */ + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 14; + * + * @param value The selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selfLink_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 14; + * + * @return This builder for chaining. + */ + public Builder clearSelfLink() { + selfLink_ = getDefaultInstance().getSelfLink(); + bitField0_ = (bitField0_ & ~0x00010000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 14; + * + * @param value The bytes for selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selfLink_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + private java.lang.Object targetProject_ = ""; + + /** + * + * + *
+     * The project ID of the target instance related to this operation.
+     * 
+ * + * string target_project = 15; + * + * @return The targetProject. + */ + public java.lang.String getTargetProject() { + java.lang.Object ref = targetProject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetProject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The project ID of the target instance related to this operation.
+     * 
+ * + * string target_project = 15; + * + * @return The bytes for targetProject. + */ + public com.google.protobuf.ByteString getTargetProjectBytes() { + java.lang.Object ref = targetProject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The project ID of the target instance related to this operation.
+     * 
+ * + * string target_project = 15; + * + * @param value The targetProject to set. + * @return This builder for chaining. + */ + public Builder setTargetProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetProject_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the target instance related to this operation.
+     * 
+ * + * string target_project = 15; + * + * @return This builder for chaining. + */ + public Builder clearTargetProject() { + targetProject_ = getDefaultInstance().getTargetProject(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the target instance related to this operation.
+     * 
+ * + * string target_project = 15; + * + * @param value The bytes for targetProject to set. + * @return This builder for chaining. + */ + public Builder setTargetProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetProject_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.AcquireSsrsLeaseContext acquireSsrsLeaseContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.AcquireSsrsLeaseContext, + com.google.cloud.sql.v1.AcquireSsrsLeaseContext.Builder, + com.google.cloud.sql.v1.AcquireSsrsLeaseContextOrBuilder> + acquireSsrsLeaseContextBuilder_; + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + * @return Whether the acquireSsrsLeaseContext field is set. + */ + public boolean hasAcquireSsrsLeaseContext() { + return ((bitField0_ & 0x00040000) != 0); + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + * @return The acquireSsrsLeaseContext. + */ + public com.google.cloud.sql.v1.AcquireSsrsLeaseContext getAcquireSsrsLeaseContext() { + if (acquireSsrsLeaseContextBuilder_ == null) { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } else { + return acquireSsrsLeaseContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + */ + public Builder setAcquireSsrsLeaseContext( + com.google.cloud.sql.v1.AcquireSsrsLeaseContext value) { + if (acquireSsrsLeaseContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + acquireSsrsLeaseContext_ = value; + } else { + acquireSsrsLeaseContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + */ + public Builder setAcquireSsrsLeaseContext( + com.google.cloud.sql.v1.AcquireSsrsLeaseContext.Builder builderForValue) { + if (acquireSsrsLeaseContextBuilder_ == null) { + acquireSsrsLeaseContext_ = builderForValue.build(); + } else { + acquireSsrsLeaseContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + */ + public Builder mergeAcquireSsrsLeaseContext( + com.google.cloud.sql.v1.AcquireSsrsLeaseContext value) { + if (acquireSsrsLeaseContextBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) + && acquireSsrsLeaseContext_ != null + && acquireSsrsLeaseContext_ + != com.google.cloud.sql.v1.AcquireSsrsLeaseContext.getDefaultInstance()) { + getAcquireSsrsLeaseContextBuilder().mergeFrom(value); + } else { + acquireSsrsLeaseContext_ = value; + } + } else { + acquireSsrsLeaseContextBuilder_.mergeFrom(value); + } + if (acquireSsrsLeaseContext_ != null) { + bitField0_ |= 0x00040000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + */ + public Builder clearAcquireSsrsLeaseContext() { + bitField0_ = (bitField0_ & ~0x00040000); + acquireSsrsLeaseContext_ = null; + if (acquireSsrsLeaseContextBuilder_ != null) { + acquireSsrsLeaseContextBuilder_.dispose(); + acquireSsrsLeaseContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + */ + public com.google.cloud.sql.v1.AcquireSsrsLeaseContext.Builder + getAcquireSsrsLeaseContextBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return internalGetAcquireSsrsLeaseContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + */ + public com.google.cloud.sql.v1.AcquireSsrsLeaseContextOrBuilder + getAcquireSsrsLeaseContextOrBuilder() { + if (acquireSsrsLeaseContextBuilder_ != null) { + return acquireSsrsLeaseContextBuilder_.getMessageOrBuilder(); + } else { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.AcquireSsrsLeaseContext, + com.google.cloud.sql.v1.AcquireSsrsLeaseContext.Builder, + com.google.cloud.sql.v1.AcquireSsrsLeaseContextOrBuilder> + internalGetAcquireSsrsLeaseContextFieldBuilder() { + if (acquireSsrsLeaseContextBuilder_ == null) { + acquireSsrsLeaseContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.AcquireSsrsLeaseContext, + com.google.cloud.sql.v1.AcquireSsrsLeaseContext.Builder, + com.google.cloud.sql.v1.AcquireSsrsLeaseContextOrBuilder>( + getAcquireSsrsLeaseContext(), getParentForChildren(), isClean()); + acquireSsrsLeaseContext_ = null; + } + return acquireSsrsLeaseContextBuilder_; + } + + private com.google.cloud.sql.v1.SqlSubOperationType subOperationType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlSubOperationType, + com.google.cloud.sql.v1.SqlSubOperationType.Builder, + com.google.cloud.sql.v1.SqlSubOperationTypeOrBuilder> + subOperationTypeBuilder_; + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the subOperationType field is set. + */ + public boolean hasSubOperationType() { + return ((bitField0_ & 0x00080000) != 0); + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The subOperationType. + */ + public com.google.cloud.sql.v1.SqlSubOperationType getSubOperationType() { + if (subOperationTypeBuilder_ == null) { + return subOperationType_ == null + ? com.google.cloud.sql.v1.SqlSubOperationType.getDefaultInstance() + : subOperationType_; + } else { + return subOperationTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSubOperationType(com.google.cloud.sql.v1.SqlSubOperationType value) { + if (subOperationTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + subOperationType_ = value; + } else { + subOperationTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSubOperationType( + com.google.cloud.sql.v1.SqlSubOperationType.Builder builderForValue) { + if (subOperationTypeBuilder_ == null) { + subOperationType_ = builderForValue.build(); + } else { + subOperationTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeSubOperationType(com.google.cloud.sql.v1.SqlSubOperationType value) { + if (subOperationTypeBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0) + && subOperationType_ != null + && subOperationType_ + != com.google.cloud.sql.v1.SqlSubOperationType.getDefaultInstance()) { + getSubOperationTypeBuilder().mergeFrom(value); + } else { + subOperationType_ = value; + } + } else { + subOperationTypeBuilder_.mergeFrom(value); + } + if (subOperationType_ != null) { + bitField0_ |= 0x00080000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSubOperationType() { + bitField0_ = (bitField0_ & ~0x00080000); + subOperationType_ = null; + if (subOperationTypeBuilder_ != null) { + subOperationTypeBuilder_.dispose(); + subOperationTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.SqlSubOperationType.Builder getSubOperationTypeBuilder() { + bitField0_ |= 0x00080000; + onChanged(); + return internalGetSubOperationTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.SqlSubOperationTypeOrBuilder getSubOperationTypeOrBuilder() { + if (subOperationTypeBuilder_ != null) { + return subOperationTypeBuilder_.getMessageOrBuilder(); + } else { + return subOperationType_ == null + ? com.google.cloud.sql.v1.SqlSubOperationType.getDefaultInstance() + : subOperationType_; + } + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlSubOperationType, + com.google.cloud.sql.v1.SqlSubOperationType.Builder, + com.google.cloud.sql.v1.SqlSubOperationTypeOrBuilder> + internalGetSubOperationTypeFieldBuilder() { + if (subOperationTypeBuilder_ == null) { + subOperationTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlSubOperationType, + com.google.cloud.sql.v1.SqlSubOperationType.Builder, + com.google.cloud.sql.v1.SqlSubOperationTypeOrBuilder>( + getSubOperationType(), getParentForChildren(), isClean()); + subOperationType_ = null; + } + return subOperationTypeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.Operation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.Operation) + private static final com.google.cloud.sql.v1.Operation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.Operation(); + } + + public static com.google.cloud.sql.v1.Operation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Operation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Operation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationError.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationError.java new file mode 100644 index 000000000000..3f51269c2fce --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationError.java @@ -0,0 +1,972 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance operation error.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.OperationError} + */ +@com.google.protobuf.Generated +public final class OperationError extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.OperationError) + OperationErrorOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperationError"); + } + + // Use OperationError.newBuilder() to construct. + private OperationError(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OperationError() { + kind_ = ""; + code_ = ""; + message_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_OperationError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_OperationError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.OperationError.class, + com.google.cloud.sql.v1.OperationError.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#operationError`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#operationError`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CODE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object code_ = ""; + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * string code = 2; + * + * @return The code. + */ + @java.lang.Override + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } + } + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * string code = 2; + * + * @return The bytes for code. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(code_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, code_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, message_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(code_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, code_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, message_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.OperationError)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.OperationError other = (com.google.cloud.sql.v1.OperationError) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getCode().equals(other.getCode())) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.OperationError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.OperationError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.OperationError parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.OperationError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.OperationError parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationError parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.OperationError parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.OperationError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.OperationError prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance operation error.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.OperationError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.OperationError) + com.google.cloud.sql.v1.OperationErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_OperationError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_OperationError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.OperationError.class, + com.google.cloud.sql.v1.OperationError.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.OperationError.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + code_ = ""; + message_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_OperationError_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.OperationError getDefaultInstanceForType() { + return com.google.cloud.sql.v1.OperationError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.OperationError build() { + com.google.cloud.sql.v1.OperationError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.OperationError buildPartial() { + com.google.cloud.sql.v1.OperationError result = + new com.google.cloud.sql.v1.OperationError(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.OperationError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.message_ = message_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.OperationError) { + return mergeFrom((com.google.cloud.sql.v1.OperationError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.OperationError other) { + if (other == com.google.cloud.sql.v1.OperationError.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getCode().isEmpty()) { + code_ = other.code_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + code_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#operationError`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operationError`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operationError`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operationError`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operationError`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object code_ = ""; + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * string code = 2; + * + * @return The code. + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * string code = 2; + * + * @return The bytes for code. + */ + public com.google.protobuf.ByteString getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * string code = 2; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + code_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * string code = 2; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + code_ = getDefaultInstance().getCode(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * string code = 2; + * + * @param value The bytes for code to set. + * @return This builder for chaining. + */ + public Builder setCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + code_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string message = 3; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string message = 3; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string message = 3; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string message = 3; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.OperationError) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.OperationError) + private static final com.google.cloud.sql.v1.OperationError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.OperationError(); + } + + public static com.google.cloud.sql.v1.OperationError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.OperationError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationErrorOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationErrorOrBuilder.java new file mode 100644 index 000000000000..3ee03dbf3db9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationErrorOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface OperationErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.OperationError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#operationError`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#operationError`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * string code = 2; + * + * @return The code. + */ + java.lang.String getCode(); + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * string code = 2; + * + * @return The bytes for code. + */ + com.google.protobuf.ByteString getCodeBytes(); + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationErrors.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationErrors.java new file mode 100644 index 000000000000..3470d76efe71 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationErrors.java @@ -0,0 +1,1107 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance operation errors list wrapper.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.OperationErrors} + */ +@com.google.protobuf.Generated +public final class OperationErrors extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.OperationErrors) + OperationErrorsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperationErrors"); + } + + // Use OperationErrors.newBuilder() to construct. + private OperationErrors(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OperationErrors() { + kind_ = ""; + errors_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_OperationErrors_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_OperationErrors_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.OperationErrors.class, + com.google.cloud.sql.v1.OperationErrors.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#operationErrors`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#operationErrors`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERRORS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List errors_; + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + @java.lang.Override + public java.util.List getErrorsList() { + return errors_; + } + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + @java.lang.Override + public java.util.List + getErrorsOrBuilderList() { + return errors_; + } + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + @java.lang.Override + public int getErrorsCount() { + return errors_.size(); + } + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.OperationError getErrors(int index) { + return errors_.get(index); + } + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.OperationErrorOrBuilder getErrorsOrBuilder(int index) { + return errors_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < errors_.size(); i++) { + output.writeMessage(2, errors_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < errors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, errors_.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.sql.v1.OperationErrors)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.OperationErrors other = (com.google.cloud.sql.v1.OperationErrors) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getErrorsList().equals(other.getErrorsList())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getErrorsCount() > 0) { + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrorsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.OperationErrors parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.OperationErrors parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationErrors parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.OperationErrors parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationErrors parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.OperationErrors parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationErrors parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.OperationErrors parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationErrors parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.OperationErrors parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationErrors parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.OperationErrors parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.OperationErrors prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance operation errors list wrapper.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.OperationErrors} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.OperationErrors) + com.google.cloud.sql.v1.OperationErrorsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_OperationErrors_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_OperationErrors_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.OperationErrors.class, + com.google.cloud.sql.v1.OperationErrors.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.OperationErrors.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (errorsBuilder_ == null) { + errors_ = java.util.Collections.emptyList(); + } else { + errors_ = null; + errorsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_OperationErrors_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.OperationErrors getDefaultInstanceForType() { + return com.google.cloud.sql.v1.OperationErrors.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.OperationErrors build() { + com.google.cloud.sql.v1.OperationErrors result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.OperationErrors buildPartial() { + com.google.cloud.sql.v1.OperationErrors result = + new com.google.cloud.sql.v1.OperationErrors(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.OperationErrors result) { + if (errorsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + errors_ = java.util.Collections.unmodifiableList(errors_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.errors_ = errors_; + } else { + result.errors_ = errorsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.OperationErrors result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.OperationErrors) { + return mergeFrom((com.google.cloud.sql.v1.OperationErrors) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.OperationErrors other) { + if (other == com.google.cloud.sql.v1.OperationErrors.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (errorsBuilder_ == null) { + if (!other.errors_.isEmpty()) { + if (errors_.isEmpty()) { + errors_ = other.errors_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureErrorsIsMutable(); + errors_.addAll(other.errors_); + } + onChanged(); + } + } else { + if (!other.errors_.isEmpty()) { + if (errorsBuilder_.isEmpty()) { + errorsBuilder_.dispose(); + errorsBuilder_ = null; + errors_ = other.errors_; + bitField0_ = (bitField0_ & ~0x00000002); + errorsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetErrorsFieldBuilder() + : null; + } else { + errorsBuilder_.addAllMessages(other.errors_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1.OperationError m = + input.readMessage( + com.google.cloud.sql.v1.OperationError.parser(), extensionRegistry); + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(m); + } else { + errorsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#operationErrors`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operationErrors`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operationErrors`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operationErrors`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operationErrors`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List errors_ = + java.util.Collections.emptyList(); + + private void ensureErrorsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + errors_ = new java.util.ArrayList(errors_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.OperationError, + com.google.cloud.sql.v1.OperationError.Builder, + com.google.cloud.sql.v1.OperationErrorOrBuilder> + errorsBuilder_; + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public java.util.List getErrorsList() { + if (errorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(errors_); + } else { + return errorsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public int getErrorsCount() { + if (errorsBuilder_ == null) { + return errors_.size(); + } else { + return errorsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public com.google.cloud.sql.v1.OperationError getErrors(int index) { + if (errorsBuilder_ == null) { + return errors_.get(index); + } else { + return errorsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public Builder setErrors(int index, com.google.cloud.sql.v1.OperationError value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.set(index, value); + onChanged(); + } else { + errorsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public Builder setErrors( + int index, com.google.cloud.sql.v1.OperationError.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.set(index, builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public Builder addErrors(com.google.cloud.sql.v1.OperationError value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.add(value); + onChanged(); + } else { + errorsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public Builder addErrors(int index, com.google.cloud.sql.v1.OperationError value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.add(index, value); + onChanged(); + } else { + errorsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public Builder addErrors(com.google.cloud.sql.v1.OperationError.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public Builder addErrors( + int index, com.google.cloud.sql.v1.OperationError.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(index, builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public Builder addAllErrors( + java.lang.Iterable values) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errors_); + onChanged(); + } else { + errorsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public Builder clearErrors() { + if (errorsBuilder_ == null) { + errors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + errorsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public Builder removeErrors(int index) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.remove(index); + onChanged(); + } else { + errorsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public com.google.cloud.sql.v1.OperationError.Builder getErrorsBuilder(int index) { + return internalGetErrorsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public com.google.cloud.sql.v1.OperationErrorOrBuilder getErrorsOrBuilder(int index) { + if (errorsBuilder_ == null) { + return errors_.get(index); + } else { + return errorsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public java.util.List + getErrorsOrBuilderList() { + if (errorsBuilder_ != null) { + return errorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errors_); + } + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public com.google.cloud.sql.v1.OperationError.Builder addErrorsBuilder() { + return internalGetErrorsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.OperationError.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public com.google.cloud.sql.v1.OperationError.Builder addErrorsBuilder(int index) { + return internalGetErrorsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.OperationError.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + public java.util.List getErrorsBuilderList() { + return internalGetErrorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.OperationError, + com.google.cloud.sql.v1.OperationError.Builder, + com.google.cloud.sql.v1.OperationErrorOrBuilder> + internalGetErrorsFieldBuilder() { + if (errorsBuilder_ == null) { + errorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.OperationError, + com.google.cloud.sql.v1.OperationError.Builder, + com.google.cloud.sql.v1.OperationErrorOrBuilder>( + errors_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + errors_ = null; + } + return errorsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.OperationErrors) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.OperationErrors) + private static final com.google.cloud.sql.v1.OperationErrors DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.OperationErrors(); + } + + public static com.google.cloud.sql.v1.OperationErrors getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationErrors parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.OperationErrors getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationErrorsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationErrorsOrBuilder.java new file mode 100644 index 000000000000..32888b250877 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationErrorsOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface OperationErrorsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.OperationErrors) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#operationErrors`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#operationErrors`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + java.util.List getErrorsList(); + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + com.google.cloud.sql.v1.OperationError getErrors(int index); + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + int getErrorsCount(); + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + java.util.List + getErrorsOrBuilderList(); + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1.OperationError errors = 2; + */ + com.google.cloud.sql.v1.OperationErrorOrBuilder getErrorsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationOrBuilder.java new file mode 100644 index 000000000000..f94764a79c3c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationOrBuilder.java @@ -0,0 +1,732 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface OperationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.Operation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#operation`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#operation`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * string target_link = 2; + * + * @return The targetLink. + */ + java.lang.String getTargetLink(); + + /** + * string target_link = 2; + * + * @return The bytes for targetLink. + */ + com.google.protobuf.ByteString getTargetLinkBytes(); + + /** + * + * + *
+   * The status of an operation.
+   * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationStatus status = 3; + * + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + + /** + * + * + *
+   * The status of an operation.
+   * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationStatus status = 3; + * + * @return The status. + */ + com.google.cloud.sql.v1.Operation.SqlOperationStatus getStatus(); + + /** + * + * + *
+   * The email address of the user who initiated this operation.
+   * 
+ * + * string user = 4; + * + * @return The user. + */ + java.lang.String getUser(); + + /** + * + * + *
+   * The email address of the user who initiated this operation.
+   * 
+ * + * string user = 4; + * + * @return The bytes for user. + */ + com.google.protobuf.ByteString getUserBytes(); + + /** + * + * + *
+   * The time this operation was enqueued in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + * + * @return Whether the insertTime field is set. + */ + boolean hasInsertTime(); + + /** + * + * + *
+   * The time this operation was enqueued in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + * + * @return The insertTime. + */ + com.google.protobuf.Timestamp getInsertTime(); + + /** + * + * + *
+   * The time this operation was enqueued in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getInsertTimeOrBuilder(); + + /** + * + * + *
+   * The time this operation actually started in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The time this operation actually started in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The time this operation actually started in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The time this operation finished in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * The time this operation finished in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * The time this operation finished in UTC timezone in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * If errors occurred during processing of this operation, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
+   * If errors occurred during processing of this operation, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + * + * @return The error. + */ + com.google.cloud.sql.v1.OperationErrors getError(); + + /** + * + * + *
+   * If errors occurred during processing of this operation, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.sql.v1.OperationErrors error = 8; + */ + com.google.cloud.sql.v1.OperationErrorsOrBuilder getErrorOrBuilder(); + + /** + * + * + *
+   * An Admin API warning message.
+   * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + * + * @return Whether the apiWarning field is set. + */ + boolean hasApiWarning(); + + /** + * + * + *
+   * An Admin API warning message.
+   * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + * + * @return The apiWarning. + */ + com.google.cloud.sql.v1.ApiWarning getApiWarning(); + + /** + * + * + *
+   * An Admin API warning message.
+   * 
+ * + * .google.cloud.sql.v1.ApiWarning api_warning = 19; + */ + com.google.cloud.sql.v1.ApiWarningOrBuilder getApiWarningOrBuilder(); + + /** + * + * + *
+   * The type of the operation. Valid values are:
+   * *  `CREATE`
+   * *  `DELETE`
+   * *  `UPDATE`
+   * *  `RESTART`
+   * *  `IMPORT`
+   * *  `EXPORT`
+   * *  `BACKUP_VOLUME`
+   * *  `RESTORE_VOLUME`
+   * *  `CREATE_USER`
+   * *  `DELETE_USER`
+   * *  `CREATE_DATABASE`
+   * *  `DELETE_DATABASE`
+   * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationType operation_type = 9; + * + * @return The enum numeric value on the wire for operationType. + */ + int getOperationTypeValue(); + + /** + * + * + *
+   * The type of the operation. Valid values are:
+   * *  `CREATE`
+   * *  `DELETE`
+   * *  `UPDATE`
+   * *  `RESTART`
+   * *  `IMPORT`
+   * *  `EXPORT`
+   * *  `BACKUP_VOLUME`
+   * *  `RESTORE_VOLUME`
+   * *  `CREATE_USER`
+   * *  `DELETE_USER`
+   * *  `CREATE_DATABASE`
+   * *  `DELETE_DATABASE`
+   * 
+ * + * .google.cloud.sql.v1.Operation.SqlOperationType operation_type = 9; + * + * @return The operationType. + */ + com.google.cloud.sql.v1.Operation.SqlOperationType getOperationType(); + + /** + * + * + *
+   * The context for import operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + * + * @return Whether the importContext field is set. + */ + boolean hasImportContext(); + + /** + * + * + *
+   * The context for import operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + * + * @return The importContext. + */ + com.google.cloud.sql.v1.ImportContext getImportContext(); + + /** + * + * + *
+   * The context for import operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.ImportContext import_context = 10; + */ + com.google.cloud.sql.v1.ImportContextOrBuilder getImportContextOrBuilder(); + + /** + * + * + *
+   * The context for export operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + * + * @return Whether the exportContext field is set. + */ + boolean hasExportContext(); + + /** + * + * + *
+   * The context for export operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + * + * @return The exportContext. + */ + com.google.cloud.sql.v1.ExportContext getExportContext(); + + /** + * + * + *
+   * The context for export operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.ExportContext export_context = 11; + */ + com.google.cloud.sql.v1.ExportContextOrBuilder getExportContextOrBuilder(); + + /** + * + * + *
+   * The context for backup operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + * + * @return Whether the backupContext field is set. + */ + boolean hasBackupContext(); + + /** + * + * + *
+   * The context for backup operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + * + * @return The backupContext. + */ + com.google.cloud.sql.v1.BackupContext getBackupContext(); + + /** + * + * + *
+   * The context for backup operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.BackupContext backup_context = 17; + */ + com.google.cloud.sql.v1.BackupContextOrBuilder getBackupContextOrBuilder(); + + /** + * + * + *
+   * This field is only populated when the operation_type is
+   * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+   * The PreCheckMajorVersionUpgradeContext message itself contains the details
+   * for that pre-check, such as the target database version for the upgrade
+   * and the results of the check (including any warnings or errors found).
+   * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + * + * @return Whether the preCheckMajorVersionUpgradeContext field is set. + */ + boolean hasPreCheckMajorVersionUpgradeContext(); + + /** + * + * + *
+   * This field is only populated when the operation_type is
+   * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+   * The PreCheckMajorVersionUpgradeContext message itself contains the details
+   * for that pre-check, such as the target database version for the upgrade
+   * and the results of the check (including any warnings or errors found).
+   * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + * + * @return The preCheckMajorVersionUpgradeContext. + */ + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext + getPreCheckMajorVersionUpgradeContext(); + + /** + * + * + *
+   * This field is only populated when the operation_type is
+   * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+   * The PreCheckMajorVersionUpgradeContext message itself contains the details
+   * for that pre-check, such as the target database version for the upgrade
+   * and the results of the check (including any warnings or errors found).
+   * 
+ * + * + * .google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContextOrBuilder + getPreCheckMajorVersionUpgradeContextOrBuilder(); + + /** + * + * + *
+   * An identifier that uniquely identifies the operation. You can use this
+   * identifier to retrieve the Operations resource that has information about
+   * the operation.
+   * 
+ * + * string name = 12; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * An identifier that uniquely identifies the operation. You can use this
+   * identifier to retrieve the Operations resource that has information about
+   * the operation.
+   * 
+ * + * string name = 12; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Name of the resource on which this operation runs.
+   * 
+ * + * string target_id = 13; + * + * @return The targetId. + */ + java.lang.String getTargetId(); + + /** + * + * + *
+   * Name of the resource on which this operation runs.
+   * 
+ * + * string target_id = 13; + * + * @return The bytes for targetId. + */ + com.google.protobuf.ByteString getTargetIdBytes(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 14; + * + * @return The selfLink. + */ + java.lang.String getSelfLink(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 14; + * + * @return The bytes for selfLink. + */ + com.google.protobuf.ByteString getSelfLinkBytes(); + + /** + * + * + *
+   * The project ID of the target instance related to this operation.
+   * 
+ * + * string target_project = 15; + * + * @return The targetProject. + */ + java.lang.String getTargetProject(); + + /** + * + * + *
+   * The project ID of the target instance related to this operation.
+   * 
+ * + * string target_project = 15; + * + * @return The bytes for targetProject. + */ + com.google.protobuf.ByteString getTargetProjectBytes(); + + /** + * + * + *
+   * The context for acquire SSRS lease operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + * @return Whether the acquireSsrsLeaseContext field is set. + */ + boolean hasAcquireSsrsLeaseContext(); + + /** + * + * + *
+   * The context for acquire SSRS lease operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + * @return The acquireSsrsLeaseContext. + */ + com.google.cloud.sql.v1.AcquireSsrsLeaseContext getAcquireSsrsLeaseContext(); + + /** + * + * + *
+   * The context for acquire SSRS lease operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + */ + com.google.cloud.sql.v1.AcquireSsrsLeaseContextOrBuilder getAcquireSsrsLeaseContextOrBuilder(); + + /** + * + * + *
+   * Optional. The sub operation based on the operation type.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the subOperationType field is set. + */ + boolean hasSubOperationType(); + + /** + * + * + *
+   * Optional. The sub operation based on the operation type.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The subOperationType. + */ + com.google.cloud.sql.v1.SqlSubOperationType getSubOperationType(); + + /** + * + * + *
+   * Optional. The sub operation based on the operation type.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.SqlSubOperationTypeOrBuilder getSubOperationTypeOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationsListResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationsListResponse.java new file mode 100644 index 000000000000..f4041820d846 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationsListResponse.java @@ -0,0 +1,1302 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_operations.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Operations list response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.OperationsListResponse} + */ +@com.google.protobuf.Generated +public final class OperationsListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.OperationsListResponse) + OperationsListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperationsListResponse"); + } + + // Use OperationsListResponse.newBuilder() to construct. + private OperationsListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OperationsListResponse() { + kind_ = ""; + items_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_OperationsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_OperationsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.OperationsListResponse.class, + com.google.cloud.sql.v1.OperationsListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#operationsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#operationsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.Operation getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.OperationOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.OperationsListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.OperationsListResponse other = + (com.google.cloud.sql.v1.OperationsListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.OperationsListResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.OperationsListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationsListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.OperationsListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationsListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.OperationsListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationsListResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.OperationsListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationsListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.OperationsListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.OperationsListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.OperationsListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.OperationsListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Operations list response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.OperationsListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.OperationsListResponse) + com.google.cloud.sql.v1.OperationsListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_OperationsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_OperationsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.OperationsListResponse.class, + com.google.cloud.sql.v1.OperationsListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.OperationsListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_OperationsListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.OperationsListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1.OperationsListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.OperationsListResponse build() { + com.google.cloud.sql.v1.OperationsListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.OperationsListResponse buildPartial() { + com.google.cloud.sql.v1.OperationsListResponse result = + new com.google.cloud.sql.v1.OperationsListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.OperationsListResponse result) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.OperationsListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.OperationsListResponse) { + return mergeFrom((com.google.cloud.sql.v1.OperationsListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.OperationsListResponse other) { + if (other == com.google.cloud.sql.v1.OperationsListResponse.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1.Operation m = + input.readMessage( + com.google.cloud.sql.v1.Operation.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#operationsList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operationsList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operationsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operationsList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operationsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Operation, + com.google.cloud.sql.v1.Operation.Builder, + com.google.cloud.sql.v1.OperationOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public com.google.cloud.sql.v1.Operation getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.Operation value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.Operation.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1.Operation value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.Operation value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1.Operation.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.Operation.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public com.google.cloud.sql.v1.Operation.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public com.google.cloud.sql.v1.OperationOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public com.google.cloud.sql.v1.Operation.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.Operation.getDefaultInstance()); + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public com.google.cloud.sql.v1.Operation.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.Operation.getDefaultInstance()); + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Operation, + com.google.cloud.sql.v1.Operation.Builder, + com.google.cloud.sql.v1.OperationOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Operation, + com.google.cloud.sql.v1.Operation.Builder, + com.google.cloud.sql.v1.OperationOrBuilder>( + items_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.OperationsListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.OperationsListResponse) + private static final com.google.cloud.sql.v1.OperationsListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.OperationsListResponse(); + } + + public static com.google.cloud.sql.v1.OperationsListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationsListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.OperationsListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationsListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationsListResponseOrBuilder.java new file mode 100644 index 000000000000..849f48f5fd85 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/OperationsListResponseOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_operations.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface OperationsListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.OperationsListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#operationsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#operationsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + com.google.cloud.sql.v1.Operation getItems(int index); + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + int getItemsCount(); + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + java.util.List getItemsOrBuilderList(); + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1.Operation items = 2; + */ + com.google.cloud.sql.v1.OperationOrBuilder getItemsOrBuilder(int index); + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PasswordStatus.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PasswordStatus.java new file mode 100644 index 000000000000..925629696b4a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PasswordStatus.java @@ -0,0 +1,799 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Read-only password status.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PasswordStatus} + */ +@com.google.protobuf.Generated +public final class PasswordStatus extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.PasswordStatus) + PasswordStatusOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PasswordStatus"); + } + + // Use PasswordStatus.newBuilder() to construct. + private PasswordStatus(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PasswordStatus() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_PasswordStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_PasswordStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PasswordStatus.class, + com.google.cloud.sql.v1.PasswordStatus.Builder.class); + } + + private int bitField0_; + public static final int LOCKED_FIELD_NUMBER = 1; + private boolean locked_ = false; + + /** + * + * + *
+   * If true, user does not have login privileges.
+   * 
+ * + * bool locked = 1; + * + * @return The locked. + */ + @java.lang.Override + public boolean getLocked() { + return locked_; + } + + public static final int PASSWORD_EXPIRATION_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp passwordExpirationTime_; + + /** + * + * + *
+   * The expiration time of the current password.
+   * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + * + * @return Whether the passwordExpirationTime field is set. + */ + @java.lang.Override + public boolean hasPasswordExpirationTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The expiration time of the current password.
+   * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + * + * @return The passwordExpirationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPasswordExpirationTime() { + return passwordExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : passwordExpirationTime_; + } + + /** + * + * + *
+   * The expiration time of the current password.
+   * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPasswordExpirationTimeOrBuilder() { + return passwordExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : passwordExpirationTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (locked_ != false) { + output.writeBool(1, locked_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getPasswordExpirationTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (locked_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, locked_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPasswordExpirationTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.PasswordStatus)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.PasswordStatus other = (com.google.cloud.sql.v1.PasswordStatus) obj; + + if (getLocked() != other.getLocked()) return false; + if (hasPasswordExpirationTime() != other.hasPasswordExpirationTime()) return false; + if (hasPasswordExpirationTime()) { + if (!getPasswordExpirationTime().equals(other.getPasswordExpirationTime())) return false; + } + if (!getUnknownFields().equals(other.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) + LOCKED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getLocked()); + if (hasPasswordExpirationTime()) { + hash = (37 * hash) + PASSWORD_EXPIRATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPasswordExpirationTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.PasswordStatus parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PasswordStatus parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PasswordStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PasswordStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PasswordStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PasswordStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PasswordStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PasswordStatus parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PasswordStatus parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PasswordStatus parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PasswordStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PasswordStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.PasswordStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Read-only password status.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PasswordStatus} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.PasswordStatus) + com.google.cloud.sql.v1.PasswordStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_PasswordStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_PasswordStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PasswordStatus.class, + com.google.cloud.sql.v1.PasswordStatus.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.PasswordStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPasswordExpirationTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + locked_ = false; + passwordExpirationTime_ = null; + if (passwordExpirationTimeBuilder_ != null) { + passwordExpirationTimeBuilder_.dispose(); + passwordExpirationTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_PasswordStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PasswordStatus getDefaultInstanceForType() { + return com.google.cloud.sql.v1.PasswordStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.PasswordStatus build() { + com.google.cloud.sql.v1.PasswordStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PasswordStatus buildPartial() { + com.google.cloud.sql.v1.PasswordStatus result = + new com.google.cloud.sql.v1.PasswordStatus(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.PasswordStatus result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.locked_ = locked_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.passwordExpirationTime_ = + passwordExpirationTimeBuilder_ == null + ? passwordExpirationTime_ + : passwordExpirationTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.PasswordStatus) { + return mergeFrom((com.google.cloud.sql.v1.PasswordStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.PasswordStatus other) { + if (other == com.google.cloud.sql.v1.PasswordStatus.getDefaultInstance()) return this; + if (other.getLocked() != false) { + setLocked(other.getLocked()); + } + if (other.hasPasswordExpirationTime()) { + mergePasswordExpirationTime(other.getPasswordExpirationTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + locked_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetPasswordExpirationTimeFieldBuilder().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 boolean locked_; + + /** + * + * + *
+     * If true, user does not have login privileges.
+     * 
+ * + * bool locked = 1; + * + * @return The locked. + */ + @java.lang.Override + public boolean getLocked() { + return locked_; + } + + /** + * + * + *
+     * If true, user does not have login privileges.
+     * 
+ * + * bool locked = 1; + * + * @param value The locked to set. + * @return This builder for chaining. + */ + public Builder setLocked(boolean value) { + + locked_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * If true, user does not have login privileges.
+     * 
+ * + * bool locked = 1; + * + * @return This builder for chaining. + */ + public Builder clearLocked() { + bitField0_ = (bitField0_ & ~0x00000001); + locked_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp passwordExpirationTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + passwordExpirationTimeBuilder_; + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + * + * @return Whether the passwordExpirationTime field is set. + */ + public boolean hasPasswordExpirationTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + * + * @return The passwordExpirationTime. + */ + public com.google.protobuf.Timestamp getPasswordExpirationTime() { + if (passwordExpirationTimeBuilder_ == null) { + return passwordExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : passwordExpirationTime_; + } else { + return passwordExpirationTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + public Builder setPasswordExpirationTime(com.google.protobuf.Timestamp value) { + if (passwordExpirationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + passwordExpirationTime_ = value; + } else { + passwordExpirationTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + public Builder setPasswordExpirationTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (passwordExpirationTimeBuilder_ == null) { + passwordExpirationTime_ = builderForValue.build(); + } else { + passwordExpirationTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + public Builder mergePasswordExpirationTime(com.google.protobuf.Timestamp value) { + if (passwordExpirationTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && passwordExpirationTime_ != null + && passwordExpirationTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getPasswordExpirationTimeBuilder().mergeFrom(value); + } else { + passwordExpirationTime_ = value; + } + } else { + passwordExpirationTimeBuilder_.mergeFrom(value); + } + if (passwordExpirationTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + public Builder clearPasswordExpirationTime() { + bitField0_ = (bitField0_ & ~0x00000002); + passwordExpirationTime_ = null; + if (passwordExpirationTimeBuilder_ != null) { + passwordExpirationTimeBuilder_.dispose(); + passwordExpirationTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getPasswordExpirationTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetPasswordExpirationTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getPasswordExpirationTimeOrBuilder() { + if (passwordExpirationTimeBuilder_ != null) { + return passwordExpirationTimeBuilder_.getMessageOrBuilder(); + } else { + return passwordExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : passwordExpirationTime_; + } + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetPasswordExpirationTimeFieldBuilder() { + if (passwordExpirationTimeBuilder_ == null) { + passwordExpirationTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPasswordExpirationTime(), getParentForChildren(), isClean()); + passwordExpirationTime_ = null; + } + return passwordExpirationTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.PasswordStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.PasswordStatus) + private static final com.google.cloud.sql.v1.PasswordStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.PasswordStatus(); + } + + public static com.google.cloud.sql.v1.PasswordStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PasswordStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PasswordStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PasswordStatusOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PasswordStatusOrBuilder.java new file mode 100644 index 000000000000..245fec256c1d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PasswordStatusOrBuilder.java @@ -0,0 +1,78 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface PasswordStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.PasswordStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If true, user does not have login privileges.
+   * 
+ * + * bool locked = 1; + * + * @return The locked. + */ + boolean getLocked(); + + /** + * + * + *
+   * The expiration time of the current password.
+   * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + * + * @return Whether the passwordExpirationTime field is set. + */ + boolean hasPasswordExpirationTime(); + + /** + * + * + *
+   * The expiration time of the current password.
+   * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + * + * @return The passwordExpirationTime. + */ + com.google.protobuf.Timestamp getPasswordExpirationTime(); + + /** + * + * + *
+   * The expiration time of the current password.
+   * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getPasswordExpirationTimeOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PasswordValidationPolicy.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PasswordValidationPolicy.java new file mode 100644 index 000000000000..561c167dd42f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PasswordValidationPolicy.java @@ -0,0 +1,2525 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance local user password validation policy.
+ * This message defines the password policy for local database users.
+ * When enabled, it enforces constraints on password complexity, length,
+ * and reuse. Keep this policy enabled to help prevent unauthorized access.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PasswordValidationPolicy} + */ +@com.google.protobuf.Generated +public final class PasswordValidationPolicy extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.PasswordValidationPolicy) + PasswordValidationPolicyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PasswordValidationPolicy"); + } + + // Use PasswordValidationPolicy.newBuilder() to construct. + private PasswordValidationPolicy(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PasswordValidationPolicy() { + complexity_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PasswordValidationPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PasswordValidationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PasswordValidationPolicy.class, + com.google.cloud.sql.v1.PasswordValidationPolicy.Builder.class); + } + + /** + * + * + *
+   * The complexity choices of the password.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.PasswordValidationPolicy.Complexity} + */ + public enum Complexity implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Complexity check is not specified.
+     * 
+ * + * COMPLEXITY_UNSPECIFIED = 0; + */ + COMPLEXITY_UNSPECIFIED(0), + /** + * + * + *
+     * A combination of lowercase, uppercase, numeric, and non-alphanumeric
+     * characters.
+     * 
+ * + * COMPLEXITY_DEFAULT = 1; + */ + COMPLEXITY_DEFAULT(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Complexity"); + } + + /** + * + * + *
+     * Complexity check is not specified.
+     * 
+ * + * COMPLEXITY_UNSPECIFIED = 0; + */ + public static final int COMPLEXITY_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * A combination of lowercase, uppercase, numeric, and non-alphanumeric
+     * characters.
+     * 
+ * + * COMPLEXITY_DEFAULT = 1; + */ + public static final int COMPLEXITY_DEFAULT_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Complexity 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 Complexity forNumber(int value) { + switch (value) { + case 0: + return COMPLEXITY_UNSPECIFIED; + case 1: + return COMPLEXITY_DEFAULT; + 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 Complexity findValueByNumber(int number) { + return Complexity.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.PasswordValidationPolicy.getDescriptor().getEnumTypes().get(0); + } + + private static final Complexity[] VALUES = values(); + + public static Complexity 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 Complexity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.PasswordValidationPolicy.Complexity) + } + + private int bitField0_; + public static final int MIN_LENGTH_FIELD_NUMBER = 1; + private com.google.protobuf.Int32Value minLength_; + + /** + * + * + *
+   * Minimum number of characters allowed.
+   * 
+ * + * .google.protobuf.Int32Value min_length = 1; + * + * @return Whether the minLength field is set. + */ + @java.lang.Override + public boolean hasMinLength() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Minimum number of characters allowed.
+   * 
+ * + * .google.protobuf.Int32Value min_length = 1; + * + * @return The minLength. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getMinLength() { + return minLength_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : minLength_; + } + + /** + * + * + *
+   * Minimum number of characters allowed.
+   * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getMinLengthOrBuilder() { + return minLength_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : minLength_; + } + + public static final int COMPLEXITY_FIELD_NUMBER = 2; + private int complexity_ = 0; + + /** + * + * + *
+   * The complexity of the password.
+   * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy.Complexity complexity = 2; + * + * @return The enum numeric value on the wire for complexity. + */ + @java.lang.Override + public int getComplexityValue() { + return complexity_; + } + + /** + * + * + *
+   * The complexity of the password.
+   * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy.Complexity complexity = 2; + * + * @return The complexity. + */ + @java.lang.Override + public com.google.cloud.sql.v1.PasswordValidationPolicy.Complexity getComplexity() { + com.google.cloud.sql.v1.PasswordValidationPolicy.Complexity result = + com.google.cloud.sql.v1.PasswordValidationPolicy.Complexity.forNumber(complexity_); + return result == null + ? com.google.cloud.sql.v1.PasswordValidationPolicy.Complexity.UNRECOGNIZED + : result; + } + + public static final int REUSE_INTERVAL_FIELD_NUMBER = 3; + private com.google.protobuf.Int32Value reuseInterval_; + + /** + * + * + *
+   * Number of previous passwords that cannot be reused.
+   * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + * + * @return Whether the reuseInterval field is set. + */ + @java.lang.Override + public boolean hasReuseInterval() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Number of previous passwords that cannot be reused.
+   * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + * + * @return The reuseInterval. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getReuseInterval() { + return reuseInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : reuseInterval_; + } + + /** + * + * + *
+   * Number of previous passwords that cannot be reused.
+   * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getReuseIntervalOrBuilder() { + return reuseInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : reuseInterval_; + } + + public static final int DISALLOW_USERNAME_SUBSTRING_FIELD_NUMBER = 4; + private com.google.protobuf.BoolValue disallowUsernameSubstring_; + + /** + * + * + *
+   * Disallow username as a part of the password.
+   * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + * + * @return Whether the disallowUsernameSubstring field is set. + */ + @java.lang.Override + public boolean hasDisallowUsernameSubstring() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Disallow username as a part of the password.
+   * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + * + * @return The disallowUsernameSubstring. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getDisallowUsernameSubstring() { + return disallowUsernameSubstring_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowUsernameSubstring_; + } + + /** + * + * + *
+   * Disallow username as a part of the password.
+   * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getDisallowUsernameSubstringOrBuilder() { + return disallowUsernameSubstring_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowUsernameSubstring_; + } + + public static final int PASSWORD_CHANGE_INTERVAL_FIELD_NUMBER = 5; + private com.google.protobuf.Duration passwordChangeInterval_; + + /** + * + * + *
+   * Minimum interval after which the password can be changed. This flag is only
+   * supported for PostgreSQL.
+   * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + * + * @return Whether the passwordChangeInterval field is set. + */ + @java.lang.Override + public boolean hasPasswordChangeInterval() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Minimum interval after which the password can be changed. This flag is only
+   * supported for PostgreSQL.
+   * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + * + * @return The passwordChangeInterval. + */ + @java.lang.Override + public com.google.protobuf.Duration getPasswordChangeInterval() { + return passwordChangeInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordChangeInterval_; + } + + /** + * + * + *
+   * Minimum interval after which the password can be changed. This flag is only
+   * supported for PostgreSQL.
+   * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getPasswordChangeIntervalOrBuilder() { + return passwordChangeInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordChangeInterval_; + } + + public static final int ENABLE_PASSWORD_POLICY_FIELD_NUMBER = 6; + private com.google.protobuf.BoolValue enablePasswordPolicy_; + + /** + * + * + *
+   * Whether to enable the password policy or not. When enabled, passwords must
+   * meet complexity requirements. Keep this policy enabled to help prevent
+   * unauthorized access. Disabling this policy allows weak passwords.
+   * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + * + * @return Whether the enablePasswordPolicy field is set. + */ + @java.lang.Override + public boolean hasEnablePasswordPolicy() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Whether to enable the password policy or not. When enabled, passwords must
+   * meet complexity requirements. Keep this policy enabled to help prevent
+   * unauthorized access. Disabling this policy allows weak passwords.
+   * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + * + * @return The enablePasswordPolicy. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnablePasswordPolicy() { + return enablePasswordPolicy_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePasswordPolicy_; + } + + /** + * + * + *
+   * Whether to enable the password policy or not. When enabled, passwords must
+   * meet complexity requirements. Keep this policy enabled to help prevent
+   * unauthorized access. Disabling this policy allows weak passwords.
+   * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getEnablePasswordPolicyOrBuilder() { + return enablePasswordPolicy_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePasswordPolicy_; + } + + public static final int DISALLOW_COMPROMISED_CREDENTIALS_FIELD_NUMBER = 7; + private com.google.protobuf.BoolValue disallowCompromisedCredentials_; + + /** + * + * + *
+   * This field is deprecated and will be removed in a future version of the
+   * API.
+   * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.PasswordValidationPolicy.disallow_compromised_credentials is + * deprecated. See google/cloud/sql/v1/cloud_sql_resources.proto;l=1573 + * @return Whether the disallowCompromisedCredentials field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasDisallowCompromisedCredentials() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * This field is deprecated and will be removed in a future version of the
+   * API.
+   * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.PasswordValidationPolicy.disallow_compromised_credentials is + * deprecated. See google/cloud/sql/v1/cloud_sql_resources.proto;l=1573 + * @return The disallowCompromisedCredentials. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.BoolValue getDisallowCompromisedCredentials() { + return disallowCompromisedCredentials_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowCompromisedCredentials_; + } + + /** + * + * + *
+   * This field is deprecated and will be removed in a future version of the
+   * API.
+   * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.BoolValueOrBuilder getDisallowCompromisedCredentialsOrBuilder() { + return disallowCompromisedCredentials_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowCompromisedCredentials_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getMinLength()); + } + if (complexity_ + != com.google.cloud.sql.v1.PasswordValidationPolicy.Complexity.COMPLEXITY_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, complexity_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getReuseInterval()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getDisallowUsernameSubstring()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(5, getPasswordChangeInterval()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(6, getEnablePasswordPolicy()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(7, getDisallowCompromisedCredentials()); + } + 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, getMinLength()); + } + if (complexity_ + != com.google.cloud.sql.v1.PasswordValidationPolicy.Complexity.COMPLEXITY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, complexity_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getReuseInterval()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, getDisallowUsernameSubstring()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getPasswordChangeInterval()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(6, getEnablePasswordPolicy()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, getDisallowCompromisedCredentials()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.PasswordValidationPolicy)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.PasswordValidationPolicy other = + (com.google.cloud.sql.v1.PasswordValidationPolicy) obj; + + if (hasMinLength() != other.hasMinLength()) return false; + if (hasMinLength()) { + if (!getMinLength().equals(other.getMinLength())) return false; + } + if (complexity_ != other.complexity_) return false; + if (hasReuseInterval() != other.hasReuseInterval()) return false; + if (hasReuseInterval()) { + if (!getReuseInterval().equals(other.getReuseInterval())) return false; + } + if (hasDisallowUsernameSubstring() != other.hasDisallowUsernameSubstring()) return false; + if (hasDisallowUsernameSubstring()) { + if (!getDisallowUsernameSubstring().equals(other.getDisallowUsernameSubstring())) + return false; + } + if (hasPasswordChangeInterval() != other.hasPasswordChangeInterval()) return false; + if (hasPasswordChangeInterval()) { + if (!getPasswordChangeInterval().equals(other.getPasswordChangeInterval())) return false; + } + if (hasEnablePasswordPolicy() != other.hasEnablePasswordPolicy()) return false; + if (hasEnablePasswordPolicy()) { + if (!getEnablePasswordPolicy().equals(other.getEnablePasswordPolicy())) return false; + } + if (hasDisallowCompromisedCredentials() != other.hasDisallowCompromisedCredentials()) + return false; + if (hasDisallowCompromisedCredentials()) { + if (!getDisallowCompromisedCredentials().equals(other.getDisallowCompromisedCredentials())) + return false; + } + if (!getUnknownFields().equals(other.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 (hasMinLength()) { + hash = (37 * hash) + MIN_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getMinLength().hashCode(); + } + hash = (37 * hash) + COMPLEXITY_FIELD_NUMBER; + hash = (53 * hash) + complexity_; + if (hasReuseInterval()) { + hash = (37 * hash) + REUSE_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getReuseInterval().hashCode(); + } + if (hasDisallowUsernameSubstring()) { + hash = (37 * hash) + DISALLOW_USERNAME_SUBSTRING_FIELD_NUMBER; + hash = (53 * hash) + getDisallowUsernameSubstring().hashCode(); + } + if (hasPasswordChangeInterval()) { + hash = (37 * hash) + PASSWORD_CHANGE_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getPasswordChangeInterval().hashCode(); + } + if (hasEnablePasswordPolicy()) { + hash = (37 * hash) + ENABLE_PASSWORD_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getEnablePasswordPolicy().hashCode(); + } + if (hasDisallowCompromisedCredentials()) { + hash = (37 * hash) + DISALLOW_COMPROMISED_CREDENTIALS_FIELD_NUMBER; + hash = (53 * hash) + getDisallowCompromisedCredentials().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.PasswordValidationPolicy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PasswordValidationPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PasswordValidationPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PasswordValidationPolicy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PasswordValidationPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PasswordValidationPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PasswordValidationPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PasswordValidationPolicy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PasswordValidationPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PasswordValidationPolicy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PasswordValidationPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PasswordValidationPolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.PasswordValidationPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance local user password validation policy.
+   * This message defines the password policy for local database users.
+   * When enabled, it enforces constraints on password complexity, length,
+   * and reuse. Keep this policy enabled to help prevent unauthorized access.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PasswordValidationPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.PasswordValidationPolicy) + com.google.cloud.sql.v1.PasswordValidationPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PasswordValidationPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PasswordValidationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PasswordValidationPolicy.class, + com.google.cloud.sql.v1.PasswordValidationPolicy.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.PasswordValidationPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMinLengthFieldBuilder(); + internalGetReuseIntervalFieldBuilder(); + internalGetDisallowUsernameSubstringFieldBuilder(); + internalGetPasswordChangeIntervalFieldBuilder(); + internalGetEnablePasswordPolicyFieldBuilder(); + internalGetDisallowCompromisedCredentialsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minLength_ = null; + if (minLengthBuilder_ != null) { + minLengthBuilder_.dispose(); + minLengthBuilder_ = null; + } + complexity_ = 0; + reuseInterval_ = null; + if (reuseIntervalBuilder_ != null) { + reuseIntervalBuilder_.dispose(); + reuseIntervalBuilder_ = null; + } + disallowUsernameSubstring_ = null; + if (disallowUsernameSubstringBuilder_ != null) { + disallowUsernameSubstringBuilder_.dispose(); + disallowUsernameSubstringBuilder_ = null; + } + passwordChangeInterval_ = null; + if (passwordChangeIntervalBuilder_ != null) { + passwordChangeIntervalBuilder_.dispose(); + passwordChangeIntervalBuilder_ = null; + } + enablePasswordPolicy_ = null; + if (enablePasswordPolicyBuilder_ != null) { + enablePasswordPolicyBuilder_.dispose(); + enablePasswordPolicyBuilder_ = null; + } + disallowCompromisedCredentials_ = null; + if (disallowCompromisedCredentialsBuilder_ != null) { + disallowCompromisedCredentialsBuilder_.dispose(); + disallowCompromisedCredentialsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PasswordValidationPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PasswordValidationPolicy getDefaultInstanceForType() { + return com.google.cloud.sql.v1.PasswordValidationPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.PasswordValidationPolicy build() { + com.google.cloud.sql.v1.PasswordValidationPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PasswordValidationPolicy buildPartial() { + com.google.cloud.sql.v1.PasswordValidationPolicy result = + new com.google.cloud.sql.v1.PasswordValidationPolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.PasswordValidationPolicy result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.minLength_ = minLengthBuilder_ == null ? minLength_ : minLengthBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.complexity_ = complexity_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.reuseInterval_ = + reuseIntervalBuilder_ == null ? reuseInterval_ : reuseIntervalBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.disallowUsernameSubstring_ = + disallowUsernameSubstringBuilder_ == null + ? disallowUsernameSubstring_ + : disallowUsernameSubstringBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.passwordChangeInterval_ = + passwordChangeIntervalBuilder_ == null + ? passwordChangeInterval_ + : passwordChangeIntervalBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.enablePasswordPolicy_ = + enablePasswordPolicyBuilder_ == null + ? enablePasswordPolicy_ + : enablePasswordPolicyBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.disallowCompromisedCredentials_ = + disallowCompromisedCredentialsBuilder_ == null + ? disallowCompromisedCredentials_ + : disallowCompromisedCredentialsBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.PasswordValidationPolicy) { + return mergeFrom((com.google.cloud.sql.v1.PasswordValidationPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.PasswordValidationPolicy other) { + if (other == com.google.cloud.sql.v1.PasswordValidationPolicy.getDefaultInstance()) + return this; + if (other.hasMinLength()) { + mergeMinLength(other.getMinLength()); + } + if (other.complexity_ != 0) { + setComplexityValue(other.getComplexityValue()); + } + if (other.hasReuseInterval()) { + mergeReuseInterval(other.getReuseInterval()); + } + if (other.hasDisallowUsernameSubstring()) { + mergeDisallowUsernameSubstring(other.getDisallowUsernameSubstring()); + } + if (other.hasPasswordChangeInterval()) { + mergePasswordChangeInterval(other.getPasswordChangeInterval()); + } + if (other.hasEnablePasswordPolicy()) { + mergeEnablePasswordPolicy(other.getEnablePasswordPolicy()); + } + if (other.hasDisallowCompromisedCredentials()) { + mergeDisallowCompromisedCredentials(other.getDisallowCompromisedCredentials()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetMinLengthFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + complexity_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage( + internalGetReuseIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetDisallowUsernameSubstringFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetPasswordChangeIntervalFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetEnablePasswordPolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetDisallowCompromisedCredentialsFieldBuilder().getBuilder(), + extensionRegistry); + 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.Int32Value minLength_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + minLengthBuilder_; + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + * + * @return Whether the minLength field is set. + */ + public boolean hasMinLength() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + * + * @return The minLength. + */ + public com.google.protobuf.Int32Value getMinLength() { + if (minLengthBuilder_ == null) { + return minLength_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : minLength_; + } else { + return minLengthBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + public Builder setMinLength(com.google.protobuf.Int32Value value) { + if (minLengthBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minLength_ = value; + } else { + minLengthBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + public Builder setMinLength(com.google.protobuf.Int32Value.Builder builderForValue) { + if (minLengthBuilder_ == null) { + minLength_ = builderForValue.build(); + } else { + minLengthBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + public Builder mergeMinLength(com.google.protobuf.Int32Value value) { + if (minLengthBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && minLength_ != null + && minLength_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getMinLengthBuilder().mergeFrom(value); + } else { + minLength_ = value; + } + } else { + minLengthBuilder_.mergeFrom(value); + } + if (minLength_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + public Builder clearMinLength() { + bitField0_ = (bitField0_ & ~0x00000001); + minLength_ = null; + if (minLengthBuilder_ != null) { + minLengthBuilder_.dispose(); + minLengthBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + public com.google.protobuf.Int32Value.Builder getMinLengthBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetMinLengthFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + public com.google.protobuf.Int32ValueOrBuilder getMinLengthOrBuilder() { + if (minLengthBuilder_ != null) { + return minLengthBuilder_.getMessageOrBuilder(); + } else { + return minLength_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : minLength_; + } + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetMinLengthFieldBuilder() { + if (minLengthBuilder_ == null) { + minLengthBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getMinLength(), getParentForChildren(), isClean()); + minLength_ = null; + } + return minLengthBuilder_; + } + + private int complexity_ = 0; + + /** + * + * + *
+     * The complexity of the password.
+     * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy.Complexity complexity = 2; + * + * @return The enum numeric value on the wire for complexity. + */ + @java.lang.Override + public int getComplexityValue() { + return complexity_; + } + + /** + * + * + *
+     * The complexity of the password.
+     * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy.Complexity complexity = 2; + * + * @param value The enum numeric value on the wire for complexity to set. + * @return This builder for chaining. + */ + public Builder setComplexityValue(int value) { + complexity_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The complexity of the password.
+     * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy.Complexity complexity = 2; + * + * @return The complexity. + */ + @java.lang.Override + public com.google.cloud.sql.v1.PasswordValidationPolicy.Complexity getComplexity() { + com.google.cloud.sql.v1.PasswordValidationPolicy.Complexity result = + com.google.cloud.sql.v1.PasswordValidationPolicy.Complexity.forNumber(complexity_); + return result == null + ? com.google.cloud.sql.v1.PasswordValidationPolicy.Complexity.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The complexity of the password.
+     * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy.Complexity complexity = 2; + * + * @param value The complexity to set. + * @return This builder for chaining. + */ + public Builder setComplexity( + com.google.cloud.sql.v1.PasswordValidationPolicy.Complexity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + complexity_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The complexity of the password.
+     * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy.Complexity complexity = 2; + * + * @return This builder for chaining. + */ + public Builder clearComplexity() { + bitField0_ = (bitField0_ & ~0x00000002); + complexity_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Int32Value reuseInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + reuseIntervalBuilder_; + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + * + * @return Whether the reuseInterval field is set. + */ + public boolean hasReuseInterval() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + * + * @return The reuseInterval. + */ + public com.google.protobuf.Int32Value getReuseInterval() { + if (reuseIntervalBuilder_ == null) { + return reuseInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : reuseInterval_; + } else { + return reuseIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + public Builder setReuseInterval(com.google.protobuf.Int32Value value) { + if (reuseIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reuseInterval_ = value; + } else { + reuseIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + public Builder setReuseInterval(com.google.protobuf.Int32Value.Builder builderForValue) { + if (reuseIntervalBuilder_ == null) { + reuseInterval_ = builderForValue.build(); + } else { + reuseIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + public Builder mergeReuseInterval(com.google.protobuf.Int32Value value) { + if (reuseIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && reuseInterval_ != null + && reuseInterval_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getReuseIntervalBuilder().mergeFrom(value); + } else { + reuseInterval_ = value; + } + } else { + reuseIntervalBuilder_.mergeFrom(value); + } + if (reuseInterval_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + public Builder clearReuseInterval() { + bitField0_ = (bitField0_ & ~0x00000004); + reuseInterval_ = null; + if (reuseIntervalBuilder_ != null) { + reuseIntervalBuilder_.dispose(); + reuseIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + public com.google.protobuf.Int32Value.Builder getReuseIntervalBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetReuseIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + public com.google.protobuf.Int32ValueOrBuilder getReuseIntervalOrBuilder() { + if (reuseIntervalBuilder_ != null) { + return reuseIntervalBuilder_.getMessageOrBuilder(); + } else { + return reuseInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : reuseInterval_; + } + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetReuseIntervalFieldBuilder() { + if (reuseIntervalBuilder_ == null) { + reuseIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getReuseInterval(), getParentForChildren(), isClean()); + reuseInterval_ = null; + } + return reuseIntervalBuilder_; + } + + private com.google.protobuf.BoolValue disallowUsernameSubstring_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + disallowUsernameSubstringBuilder_; + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + * + * @return Whether the disallowUsernameSubstring field is set. + */ + public boolean hasDisallowUsernameSubstring() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + * + * @return The disallowUsernameSubstring. + */ + public com.google.protobuf.BoolValue getDisallowUsernameSubstring() { + if (disallowUsernameSubstringBuilder_ == null) { + return disallowUsernameSubstring_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowUsernameSubstring_; + } else { + return disallowUsernameSubstringBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + public Builder setDisallowUsernameSubstring(com.google.protobuf.BoolValue value) { + if (disallowUsernameSubstringBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + disallowUsernameSubstring_ = value; + } else { + disallowUsernameSubstringBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + public Builder setDisallowUsernameSubstring( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (disallowUsernameSubstringBuilder_ == null) { + disallowUsernameSubstring_ = builderForValue.build(); + } else { + disallowUsernameSubstringBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + public Builder mergeDisallowUsernameSubstring(com.google.protobuf.BoolValue value) { + if (disallowUsernameSubstringBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && disallowUsernameSubstring_ != null + && disallowUsernameSubstring_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getDisallowUsernameSubstringBuilder().mergeFrom(value); + } else { + disallowUsernameSubstring_ = value; + } + } else { + disallowUsernameSubstringBuilder_.mergeFrom(value); + } + if (disallowUsernameSubstring_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + public Builder clearDisallowUsernameSubstring() { + bitField0_ = (bitField0_ & ~0x00000008); + disallowUsernameSubstring_ = null; + if (disallowUsernameSubstringBuilder_ != null) { + disallowUsernameSubstringBuilder_.dispose(); + disallowUsernameSubstringBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + public com.google.protobuf.BoolValue.Builder getDisallowUsernameSubstringBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetDisallowUsernameSubstringFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + public com.google.protobuf.BoolValueOrBuilder getDisallowUsernameSubstringOrBuilder() { + if (disallowUsernameSubstringBuilder_ != null) { + return disallowUsernameSubstringBuilder_.getMessageOrBuilder(); + } else { + return disallowUsernameSubstring_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowUsernameSubstring_; + } + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetDisallowUsernameSubstringFieldBuilder() { + if (disallowUsernameSubstringBuilder_ == null) { + disallowUsernameSubstringBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getDisallowUsernameSubstring(), getParentForChildren(), isClean()); + disallowUsernameSubstring_ = null; + } + return disallowUsernameSubstringBuilder_; + } + + private com.google.protobuf.Duration passwordChangeInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + passwordChangeIntervalBuilder_; + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + * + * @return Whether the passwordChangeInterval field is set. + */ + public boolean hasPasswordChangeInterval() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + * + * @return The passwordChangeInterval. + */ + public com.google.protobuf.Duration getPasswordChangeInterval() { + if (passwordChangeIntervalBuilder_ == null) { + return passwordChangeInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordChangeInterval_; + } else { + return passwordChangeIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + public Builder setPasswordChangeInterval(com.google.protobuf.Duration value) { + if (passwordChangeIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + passwordChangeInterval_ = value; + } else { + passwordChangeIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + public Builder setPasswordChangeInterval(com.google.protobuf.Duration.Builder builderForValue) { + if (passwordChangeIntervalBuilder_ == null) { + passwordChangeInterval_ = builderForValue.build(); + } else { + passwordChangeIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + public Builder mergePasswordChangeInterval(com.google.protobuf.Duration value) { + if (passwordChangeIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && passwordChangeInterval_ != null + && passwordChangeInterval_ != com.google.protobuf.Duration.getDefaultInstance()) { + getPasswordChangeIntervalBuilder().mergeFrom(value); + } else { + passwordChangeInterval_ = value; + } + } else { + passwordChangeIntervalBuilder_.mergeFrom(value); + } + if (passwordChangeInterval_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + public Builder clearPasswordChangeInterval() { + bitField0_ = (bitField0_ & ~0x00000010); + passwordChangeInterval_ = null; + if (passwordChangeIntervalBuilder_ != null) { + passwordChangeIntervalBuilder_.dispose(); + passwordChangeIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + public com.google.protobuf.Duration.Builder getPasswordChangeIntervalBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetPasswordChangeIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + public com.google.protobuf.DurationOrBuilder getPasswordChangeIntervalOrBuilder() { + if (passwordChangeIntervalBuilder_ != null) { + return passwordChangeIntervalBuilder_.getMessageOrBuilder(); + } else { + return passwordChangeInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordChangeInterval_; + } + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetPasswordChangeIntervalFieldBuilder() { + if (passwordChangeIntervalBuilder_ == null) { + passwordChangeIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getPasswordChangeInterval(), getParentForChildren(), isClean()); + passwordChangeInterval_ = null; + } + return passwordChangeIntervalBuilder_; + } + + private com.google.protobuf.BoolValue enablePasswordPolicy_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + enablePasswordPolicyBuilder_; + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + * + * @return Whether the enablePasswordPolicy field is set. + */ + public boolean hasEnablePasswordPolicy() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + * + * @return The enablePasswordPolicy. + */ + public com.google.protobuf.BoolValue getEnablePasswordPolicy() { + if (enablePasswordPolicyBuilder_ == null) { + return enablePasswordPolicy_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePasswordPolicy_; + } else { + return enablePasswordPolicyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + public Builder setEnablePasswordPolicy(com.google.protobuf.BoolValue value) { + if (enablePasswordPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enablePasswordPolicy_ = value; + } else { + enablePasswordPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + public Builder setEnablePasswordPolicy(com.google.protobuf.BoolValue.Builder builderForValue) { + if (enablePasswordPolicyBuilder_ == null) { + enablePasswordPolicy_ = builderForValue.build(); + } else { + enablePasswordPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + public Builder mergeEnablePasswordPolicy(com.google.protobuf.BoolValue value) { + if (enablePasswordPolicyBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && enablePasswordPolicy_ != null + && enablePasswordPolicy_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getEnablePasswordPolicyBuilder().mergeFrom(value); + } else { + enablePasswordPolicy_ = value; + } + } else { + enablePasswordPolicyBuilder_.mergeFrom(value); + } + if (enablePasswordPolicy_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + public Builder clearEnablePasswordPolicy() { + bitField0_ = (bitField0_ & ~0x00000020); + enablePasswordPolicy_ = null; + if (enablePasswordPolicyBuilder_ != null) { + enablePasswordPolicyBuilder_.dispose(); + enablePasswordPolicyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + public com.google.protobuf.BoolValue.Builder getEnablePasswordPolicyBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetEnablePasswordPolicyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + public com.google.protobuf.BoolValueOrBuilder getEnablePasswordPolicyOrBuilder() { + if (enablePasswordPolicyBuilder_ != null) { + return enablePasswordPolicyBuilder_.getMessageOrBuilder(); + } else { + return enablePasswordPolicy_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePasswordPolicy_; + } + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetEnablePasswordPolicyFieldBuilder() { + if (enablePasswordPolicyBuilder_ == null) { + enablePasswordPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getEnablePasswordPolicy(), getParentForChildren(), isClean()); + enablePasswordPolicy_ = null; + } + return enablePasswordPolicyBuilder_; + } + + private com.google.protobuf.BoolValue disallowCompromisedCredentials_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + disallowCompromisedCredentialsBuilder_; + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.PasswordValidationPolicy.disallow_compromised_credentials is + * deprecated. See google/cloud/sql/v1/cloud_sql_resources.proto;l=1573 + * @return Whether the disallowCompromisedCredentials field is set. + */ + @java.lang.Deprecated + public boolean hasDisallowCompromisedCredentials() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.PasswordValidationPolicy.disallow_compromised_credentials is + * deprecated. See google/cloud/sql/v1/cloud_sql_resources.proto;l=1573 + * @return The disallowCompromisedCredentials. + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValue getDisallowCompromisedCredentials() { + if (disallowCompromisedCredentialsBuilder_ == null) { + return disallowCompromisedCredentials_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowCompromisedCredentials_; + } else { + return disallowCompromisedCredentialsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setDisallowCompromisedCredentials(com.google.protobuf.BoolValue value) { + if (disallowCompromisedCredentialsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + disallowCompromisedCredentials_ = value; + } else { + disallowCompromisedCredentialsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setDisallowCompromisedCredentials( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (disallowCompromisedCredentialsBuilder_ == null) { + disallowCompromisedCredentials_ = builderForValue.build(); + } else { + disallowCompromisedCredentialsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder mergeDisallowCompromisedCredentials(com.google.protobuf.BoolValue value) { + if (disallowCompromisedCredentialsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && disallowCompromisedCredentials_ != null + && disallowCompromisedCredentials_ + != com.google.protobuf.BoolValue.getDefaultInstance()) { + getDisallowCompromisedCredentialsBuilder().mergeFrom(value); + } else { + disallowCompromisedCredentials_ = value; + } + } else { + disallowCompromisedCredentialsBuilder_.mergeFrom(value); + } + if (disallowCompromisedCredentials_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder clearDisallowCompromisedCredentials() { + bitField0_ = (bitField0_ & ~0x00000040); + disallowCompromisedCredentials_ = null; + if (disallowCompromisedCredentialsBuilder_ != null) { + disallowCompromisedCredentialsBuilder_.dispose(); + disallowCompromisedCredentialsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValue.Builder getDisallowCompromisedCredentialsBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetDisallowCompromisedCredentialsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValueOrBuilder getDisallowCompromisedCredentialsOrBuilder() { + if (disallowCompromisedCredentialsBuilder_ != null) { + return disallowCompromisedCredentialsBuilder_.getMessageOrBuilder(); + } else { + return disallowCompromisedCredentials_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowCompromisedCredentials_; + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetDisallowCompromisedCredentialsFieldBuilder() { + if (disallowCompromisedCredentialsBuilder_ == null) { + disallowCompromisedCredentialsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getDisallowCompromisedCredentials(), getParentForChildren(), isClean()); + disallowCompromisedCredentials_ = null; + } + return disallowCompromisedCredentialsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.PasswordValidationPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.PasswordValidationPolicy) + private static final com.google.cloud.sql.v1.PasswordValidationPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.PasswordValidationPolicy(); + } + + public static com.google.cloud.sql.v1.PasswordValidationPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PasswordValidationPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PasswordValidationPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PasswordValidationPolicyOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PasswordValidationPolicyOrBuilder.java new file mode 100644 index 000000000000..38f45ef6dc54 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PasswordValidationPolicyOrBuilder.java @@ -0,0 +1,298 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface PasswordValidationPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.PasswordValidationPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Minimum number of characters allowed.
+   * 
+ * + * .google.protobuf.Int32Value min_length = 1; + * + * @return Whether the minLength field is set. + */ + boolean hasMinLength(); + + /** + * + * + *
+   * Minimum number of characters allowed.
+   * 
+ * + * .google.protobuf.Int32Value min_length = 1; + * + * @return The minLength. + */ + com.google.protobuf.Int32Value getMinLength(); + + /** + * + * + *
+   * Minimum number of characters allowed.
+   * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + com.google.protobuf.Int32ValueOrBuilder getMinLengthOrBuilder(); + + /** + * + * + *
+   * The complexity of the password.
+   * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy.Complexity complexity = 2; + * + * @return The enum numeric value on the wire for complexity. + */ + int getComplexityValue(); + + /** + * + * + *
+   * The complexity of the password.
+   * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy.Complexity complexity = 2; + * + * @return The complexity. + */ + com.google.cloud.sql.v1.PasswordValidationPolicy.Complexity getComplexity(); + + /** + * + * + *
+   * Number of previous passwords that cannot be reused.
+   * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + * + * @return Whether the reuseInterval field is set. + */ + boolean hasReuseInterval(); + + /** + * + * + *
+   * Number of previous passwords that cannot be reused.
+   * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + * + * @return The reuseInterval. + */ + com.google.protobuf.Int32Value getReuseInterval(); + + /** + * + * + *
+   * Number of previous passwords that cannot be reused.
+   * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + com.google.protobuf.Int32ValueOrBuilder getReuseIntervalOrBuilder(); + + /** + * + * + *
+   * Disallow username as a part of the password.
+   * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + * + * @return Whether the disallowUsernameSubstring field is set. + */ + boolean hasDisallowUsernameSubstring(); + + /** + * + * + *
+   * Disallow username as a part of the password.
+   * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + * + * @return The disallowUsernameSubstring. + */ + com.google.protobuf.BoolValue getDisallowUsernameSubstring(); + + /** + * + * + *
+   * Disallow username as a part of the password.
+   * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + com.google.protobuf.BoolValueOrBuilder getDisallowUsernameSubstringOrBuilder(); + + /** + * + * + *
+   * Minimum interval after which the password can be changed. This flag is only
+   * supported for PostgreSQL.
+   * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + * + * @return Whether the passwordChangeInterval field is set. + */ + boolean hasPasswordChangeInterval(); + + /** + * + * + *
+   * Minimum interval after which the password can be changed. This flag is only
+   * supported for PostgreSQL.
+   * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + * + * @return The passwordChangeInterval. + */ + com.google.protobuf.Duration getPasswordChangeInterval(); + + /** + * + * + *
+   * Minimum interval after which the password can be changed. This flag is only
+   * supported for PostgreSQL.
+   * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + com.google.protobuf.DurationOrBuilder getPasswordChangeIntervalOrBuilder(); + + /** + * + * + *
+   * Whether to enable the password policy or not. When enabled, passwords must
+   * meet complexity requirements. Keep this policy enabled to help prevent
+   * unauthorized access. Disabling this policy allows weak passwords.
+   * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + * + * @return Whether the enablePasswordPolicy field is set. + */ + boolean hasEnablePasswordPolicy(); + + /** + * + * + *
+   * Whether to enable the password policy or not. When enabled, passwords must
+   * meet complexity requirements. Keep this policy enabled to help prevent
+   * unauthorized access. Disabling this policy allows weak passwords.
+   * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + * + * @return The enablePasswordPolicy. + */ + com.google.protobuf.BoolValue getEnablePasswordPolicy(); + + /** + * + * + *
+   * Whether to enable the password policy or not. When enabled, passwords must
+   * meet complexity requirements. Keep this policy enabled to help prevent
+   * unauthorized access. Disabling this policy allows weak passwords.
+   * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + com.google.protobuf.BoolValueOrBuilder getEnablePasswordPolicyOrBuilder(); + + /** + * + * + *
+   * This field is deprecated and will be removed in a future version of the
+   * API.
+   * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.PasswordValidationPolicy.disallow_compromised_credentials is + * deprecated. See google/cloud/sql/v1/cloud_sql_resources.proto;l=1573 + * @return Whether the disallowCompromisedCredentials field is set. + */ + @java.lang.Deprecated + boolean hasDisallowCompromisedCredentials(); + + /** + * + * + *
+   * This field is deprecated and will be removed in a future version of the
+   * API.
+   * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.PasswordValidationPolicy.disallow_compromised_credentials is + * deprecated. See google/cloud/sql/v1/cloud_sql_resources.proto;l=1573 + * @return The disallowCompromisedCredentials. + */ + @java.lang.Deprecated + com.google.protobuf.BoolValue getDisallowCompromisedCredentials(); + + /** + * + * + *
+   * This field is deprecated and will be removed in a future version of the
+   * API.
+   * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Deprecated + com.google.protobuf.BoolValueOrBuilder getDisallowCompromisedCredentialsOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PerformDiskShrinkContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PerformDiskShrinkContext.java new file mode 100644 index 000000000000..8da55466e17b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PerformDiskShrinkContext.java @@ -0,0 +1,503 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Perform disk shrink context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PerformDiskShrinkContext} + */ +@com.google.protobuf.Generated +public final class PerformDiskShrinkContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.PerformDiskShrinkContext) + PerformDiskShrinkContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PerformDiskShrinkContext"); + } + + // Use PerformDiskShrinkContext.newBuilder() to construct. + private PerformDiskShrinkContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PerformDiskShrinkContext() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PerformDiskShrinkContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PerformDiskShrinkContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PerformDiskShrinkContext.class, + com.google.cloud.sql.v1.PerformDiskShrinkContext.Builder.class); + } + + public static final int TARGET_SIZE_GB_FIELD_NUMBER = 1; + private long targetSizeGb_ = 0L; + + /** + * + * + *
+   * The target disk shrink size in GigaBytes.
+   * 
+ * + * int64 target_size_gb = 1; + * + * @return The targetSizeGb. + */ + @java.lang.Override + public long getTargetSizeGb() { + return targetSizeGb_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (targetSizeGb_ != 0L) { + output.writeInt64(1, targetSizeGb_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (targetSizeGb_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, targetSizeGb_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.PerformDiskShrinkContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.PerformDiskShrinkContext other = + (com.google.cloud.sql.v1.PerformDiskShrinkContext) obj; + + if (getTargetSizeGb() != other.getTargetSizeGb()) return false; + if (!getUnknownFields().equals(other.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) + TARGET_SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTargetSizeGb()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.PerformDiskShrinkContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PerformDiskShrinkContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PerformDiskShrinkContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PerformDiskShrinkContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PerformDiskShrinkContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PerformDiskShrinkContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PerformDiskShrinkContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PerformDiskShrinkContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PerformDiskShrinkContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PerformDiskShrinkContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PerformDiskShrinkContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PerformDiskShrinkContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.PerformDiskShrinkContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Perform disk shrink context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PerformDiskShrinkContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.PerformDiskShrinkContext) + com.google.cloud.sql.v1.PerformDiskShrinkContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PerformDiskShrinkContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PerformDiskShrinkContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PerformDiskShrinkContext.class, + com.google.cloud.sql.v1.PerformDiskShrinkContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.PerformDiskShrinkContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + targetSizeGb_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PerformDiskShrinkContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PerformDiskShrinkContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.PerformDiskShrinkContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.PerformDiskShrinkContext build() { + com.google.cloud.sql.v1.PerformDiskShrinkContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PerformDiskShrinkContext buildPartial() { + com.google.cloud.sql.v1.PerformDiskShrinkContext result = + new com.google.cloud.sql.v1.PerformDiskShrinkContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.PerformDiskShrinkContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.targetSizeGb_ = targetSizeGb_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.PerformDiskShrinkContext) { + return mergeFrom((com.google.cloud.sql.v1.PerformDiskShrinkContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.PerformDiskShrinkContext other) { + if (other == com.google.cloud.sql.v1.PerformDiskShrinkContext.getDefaultInstance()) + return this; + if (other.getTargetSizeGb() != 0L) { + setTargetSizeGb(other.getTargetSizeGb()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + targetSizeGb_ = input.readInt64(); + 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 long targetSizeGb_; + + /** + * + * + *
+     * The target disk shrink size in GigaBytes.
+     * 
+ * + * int64 target_size_gb = 1; + * + * @return The targetSizeGb. + */ + @java.lang.Override + public long getTargetSizeGb() { + return targetSizeGb_; + } + + /** + * + * + *
+     * The target disk shrink size in GigaBytes.
+     * 
+ * + * int64 target_size_gb = 1; + * + * @param value The targetSizeGb to set. + * @return This builder for chaining. + */ + public Builder setTargetSizeGb(long value) { + + targetSizeGb_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The target disk shrink size in GigaBytes.
+     * 
+ * + * int64 target_size_gb = 1; + * + * @return This builder for chaining. + */ + public Builder clearTargetSizeGb() { + bitField0_ = (bitField0_ & ~0x00000001); + targetSizeGb_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.PerformDiskShrinkContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.PerformDiskShrinkContext) + private static final com.google.cloud.sql.v1.PerformDiskShrinkContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.PerformDiskShrinkContext(); + } + + public static com.google.cloud.sql.v1.PerformDiskShrinkContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PerformDiskShrinkContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PerformDiskShrinkContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PerformDiskShrinkContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PerformDiskShrinkContextOrBuilder.java new file mode 100644 index 000000000000..3a6bd68e890e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PerformDiskShrinkContextOrBuilder.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface PerformDiskShrinkContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.PerformDiskShrinkContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The target disk shrink size in GigaBytes.
+   * 
+ * + * int64 target_size_gb = 1; + * + * @return The targetSizeGb. + */ + long getTargetSizeGb(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PerformanceCaptureConfig.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PerformanceCaptureConfig.java new file mode 100644 index 000000000000..0af4eebf18a7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PerformanceCaptureConfig.java @@ -0,0 +1,3081 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Performance capture configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PerformanceCaptureConfig} + */ +@com.google.protobuf.Generated +public final class PerformanceCaptureConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.PerformanceCaptureConfig) + PerformanceCaptureConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PerformanceCaptureConfig"); + } + + // Use PerformanceCaptureConfig.newBuilder() to construct. + private PerformanceCaptureConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PerformanceCaptureConfig() { + transactionKillExcludedUserHosts_ = com.google.protobuf.LazyStringArrayList.emptyList(); + transactionKillType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PerformanceCaptureConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PerformanceCaptureConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PerformanceCaptureConfig.class, + com.google.cloud.sql.v1.PerformanceCaptureConfig.Builder.class); + } + + /** + * + * + *
+   * Defines the categories of long-running transactions eligible for automatic
+   * termination by the Performance Capture.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType} + */ + public enum TransactionKillType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * TRANSACTION_KILL_TYPE_UNSPECIFIED = 0; + */ + TRANSACTION_KILL_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Only read-only transactions are eligible for termination.
+     * 
+ * + * READ_ONLY_TRANSACTIONS = 1; + */ + READ_ONLY_TRANSACTIONS(1), + /** + * + * + *
+     * All transactions are eligible for termination, including those with write
+     * operations (such as INSERT, UPDATE, DELETE, or DDL).
+     * 
+ * + * ALL_TRANSACTIONS = 2; + */ + ALL_TRANSACTIONS(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TransactionKillType"); + } + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * TRANSACTION_KILL_TYPE_UNSPECIFIED = 0; + */ + public static final int TRANSACTION_KILL_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Only read-only transactions are eligible for termination.
+     * 
+ * + * READ_ONLY_TRANSACTIONS = 1; + */ + public static final int READ_ONLY_TRANSACTIONS_VALUE = 1; + + /** + * + * + *
+     * All transactions are eligible for termination, including those with write
+     * operations (such as INSERT, UPDATE, DELETE, or DDL).
+     * 
+ * + * ALL_TRANSACTIONS = 2; + */ + public static final int ALL_TRANSACTIONS_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 TransactionKillType 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 TransactionKillType forNumber(int value) { + switch (value) { + case 0: + return TRANSACTION_KILL_TYPE_UNSPECIFIED; + case 1: + return READ_ONLY_TRANSACTIONS; + case 2: + return ALL_TRANSACTIONS; + 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 TransactionKillType findValueByNumber(int number) { + return TransactionKillType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.PerformanceCaptureConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final TransactionKillType[] VALUES = values(); + + public static TransactionKillType 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 TransactionKillType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType) + } + + private int bitField0_; + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + + /** + * + * + *
+   * Optional. Enables or disables the performance capture feature.
+   * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Enables or disables the performance capture feature.
+   * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + public static final int PROBING_INTERVAL_SECONDS_FIELD_NUMBER = 2; + private int probingIntervalSeconds_ = 0; + + /** + * + * + *
+   * Optional. Specifies the interval in seconds between consecutive probes that
+   * check if any trigger condition thresholds have been reached.
+   * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the probingIntervalSeconds field is set. + */ + @java.lang.Override + public boolean hasProbingIntervalSeconds() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the interval in seconds between consecutive probes that
+   * check if any trigger condition thresholds have been reached.
+   * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The probingIntervalSeconds. + */ + @java.lang.Override + public int getProbingIntervalSeconds() { + return probingIntervalSeconds_; + } + + public static final int PROBE_THRESHOLD_FIELD_NUMBER = 3; + private int probeThreshold_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum number of consecutive probe threshold that
+   * triggers performance capture.
+   * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the probeThreshold field is set. + */ + @java.lang.Override + public boolean hasProbeThreshold() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum number of consecutive probe threshold that
+   * triggers performance capture.
+   * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The probeThreshold. + */ + @java.lang.Override + public int getProbeThreshold() { + return probeThreshold_; + } + + public static final int RUNNING_THREADS_THRESHOLD_FIELD_NUMBER = 4; + private int runningThreadsThreshold_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum number of MySQL `Threads_running` to
+   * trigger the performance capture on the primary instance.
+   * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the runningThreadsThreshold field is set. + */ + @java.lang.Override + public boolean hasRunningThreadsThreshold() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum number of MySQL `Threads_running` to
+   * trigger the performance capture on the primary instance.
+   * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The runningThreadsThreshold. + */ + @java.lang.Override + public int getRunningThreadsThreshold() { + return runningThreadsThreshold_; + } + + public static final int SECONDS_BEHIND_SOURCE_THRESHOLD_FIELD_NUMBER = 5; + private int secondsBehindSourceThreshold_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum number of seconds replica must be lagging
+   * behind primary instance to trigger the performance capture on replica.
+   * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the secondsBehindSourceThreshold field is set. + */ + @java.lang.Override + public boolean hasSecondsBehindSourceThreshold() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum number of seconds replica must be lagging
+   * behind primary instance to trigger the performance capture on replica.
+   * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The secondsBehindSourceThreshold. + */ + @java.lang.Override + public int getSecondsBehindSourceThreshold() { + return secondsBehindSourceThreshold_; + } + + public static final int TRANSACTION_DURATION_THRESHOLD_FIELD_NUMBER = 8; + private int transactionDurationThreshold_ = 0; + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts recording it.
+   * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionDurationThreshold field is set. + */ + @java.lang.Override + public boolean hasTransactionDurationThreshold() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts recording it.
+   * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionDurationThreshold. + */ + @java.lang.Override + public int getTransactionDurationThreshold() { + return transactionDurationThreshold_; + } + + public static final int CPU_UTILIZATION_THRESHOLD_PERCENT_FIELD_NUMBER = 9; + private int cpuUtilizationThresholdPercent_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of CPU utilization to trigger
+   * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+   * to disable the check.
+   * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cpuUtilizationThresholdPercent field is set. + */ + @java.lang.Override + public boolean hasCpuUtilizationThresholdPercent() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of CPU utilization to trigger
+   * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+   * to disable the check.
+   * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cpuUtilizationThresholdPercent. + */ + @java.lang.Override + public int getCpuUtilizationThresholdPercent() { + return cpuUtilizationThresholdPercent_; + } + + public static final int MEMORY_USAGE_THRESHOLD_PERCENT_FIELD_NUMBER = 10; + private int memoryUsageThresholdPercent_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of memory usage to trigger the
+   * performance capture.
+   * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the memoryUsageThresholdPercent field is set. + */ + @java.lang.Override + public boolean hasMemoryUsageThresholdPercent() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of memory usage to trigger the
+   * performance capture.
+   * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The memoryUsageThresholdPercent. + */ + @java.lang.Override + public int getMemoryUsageThresholdPercent() { + return memoryUsageThresholdPercent_; + } + + public static final int TRANSACTION_LOCK_WAIT_THRESHOLD_COUNT_FIELD_NUMBER = 11; + private int transactionLockWaitThresholdCount_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of transactions in lock wait
+   * state to trigger the performance capture. Valid integers range from `10` to
+   * `10000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionLockWaitThresholdCount field is set. + */ + @java.lang.Override + public boolean hasTransactionLockWaitThresholdCount() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of transactions in lock wait
+   * state to trigger the performance capture. Valid integers range from `10` to
+   * `10000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionLockWaitThresholdCount. + */ + @java.lang.Override + public int getTransactionLockWaitThresholdCount() { + return transactionLockWaitThresholdCount_; + } + + public static final int SEMAPHORE_WAIT_THRESHOLD_COUNT_FIELD_NUMBER = 12; + private int semaphoreWaitThresholdCount_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of semaphore waits to
+   * trigger the performance capture. Valid integers range from `10` to `10000`.
+   * Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the semaphoreWaitThresholdCount field is set. + */ + @java.lang.Override + public boolean hasSemaphoreWaitThresholdCount() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of semaphore waits to
+   * trigger the performance capture. Valid integers range from `10` to `10000`.
+   * Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The semaphoreWaitThresholdCount. + */ + @java.lang.Override + public int getSemaphoreWaitThresholdCount() { + return semaphoreWaitThresholdCount_; + } + + public static final int HISTORY_LIST_LENGTH_THRESHOLD_COUNT_FIELD_NUMBER = 13; + private int historyListLengthThresholdCount_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum number of undo log entries in the history
+   * list length to trigger the performance capture. Valid integers range from
+   * `10000` to `10000000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the historyListLengthThresholdCount field is set. + */ + @java.lang.Override + public boolean hasHistoryListLengthThresholdCount() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum number of undo log entries in the history
+   * list length to trigger the performance capture. Valid integers range from
+   * `10000` to `10000000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The historyListLengthThresholdCount. + */ + @java.lang.Override + public int getHistoryListLengthThresholdCount() { + return historyListLengthThresholdCount_; + } + + public static final int TRANSACTION_KILL_THRESHOLD_SECONDS_FIELD_NUMBER = 14; + private int transactionKillThresholdSeconds_ = 0; + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts terminating it. Valid integers
+   * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+   * (i.e., > 0), this value must be greater than or equal to
+   * `transaction_duration_threshold`. Configurations where
+   * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+   * will be rejected.
+   * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionKillThresholdSeconds field is set. + */ + @java.lang.Override + public boolean hasTransactionKillThresholdSeconds() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts terminating it. Valid integers
+   * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+   * (i.e., > 0), this value must be greater than or equal to
+   * `transaction_duration_threshold`. Configurations where
+   * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+   * will be rejected.
+   * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionKillThresholdSeconds. + */ + @java.lang.Override + public int getTransactionKillThresholdSeconds() { + return transactionKillThresholdSeconds_; + } + + public static final int TRANSACTION_KILL_EXCLUDED_USER_HOSTS_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList transactionKillExcludedUserHosts_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the transactionKillExcludedUserHosts. + */ + public com.google.protobuf.ProtocolStringList getTransactionKillExcludedUserHostsList() { + return transactionKillExcludedUserHosts_; + } + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of transactionKillExcludedUserHosts. + */ + public int getTransactionKillExcludedUserHostsCount() { + return transactionKillExcludedUserHosts_.size(); + } + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The transactionKillExcludedUserHosts at the given index. + */ + public java.lang.String getTransactionKillExcludedUserHosts(int index) { + return transactionKillExcludedUserHosts_.get(index); + } + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the transactionKillExcludedUserHosts at the given index. + */ + public com.google.protobuf.ByteString getTransactionKillExcludedUserHostsBytes(int index) { + return transactionKillExcludedUserHosts_.getByteString(index); + } + + public static final int TRANSACTION_KILL_TYPE_FIELD_NUMBER = 17; + private int transactionKillType_ = 0; + + /** + * + * + *
+   * Optional. Determines which transactions are allowed to be terminated when
+   * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+   * write-heavy transactions from auto-termination if desired. Defaults to
+   * `READ_ONLY_TRANSACTIONS` if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionKillType field is set. + */ + @java.lang.Override + public boolean hasTransactionKillType() { + return ((bitField0_ & 0x00001000) != 0); + } + + /** + * + * + *
+   * Optional. Determines which transactions are allowed to be terminated when
+   * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+   * write-heavy transactions from auto-termination if desired. Defaults to
+   * `READ_ONLY_TRANSACTIONS` if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for transactionKillType. + */ + @java.lang.Override + public int getTransactionKillTypeValue() { + return transactionKillType_; + } + + /** + * + * + *
+   * Optional. Determines which transactions are allowed to be terminated when
+   * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+   * write-heavy transactions from auto-termination if desired. Defaults to
+   * `READ_ONLY_TRANSACTIONS` if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionKillType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType + getTransactionKillType() { + com.google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType result = + com.google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType.forNumber( + transactionKillType_); + return result == null + ? com.google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, enabled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(2, probingIntervalSeconds_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(3, probeThreshold_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeInt32(4, runningThreadsThreshold_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeInt32(5, secondsBehindSourceThreshold_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeInt32(8, transactionDurationThreshold_); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeInt32(9, cpuUtilizationThresholdPercent_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeInt32(10, memoryUsageThresholdPercent_); + } + if (((bitField0_ & 0x00000100) != 0)) { + output.writeInt32(11, transactionLockWaitThresholdCount_); + } + if (((bitField0_ & 0x00000200) != 0)) { + output.writeInt32(12, semaphoreWaitThresholdCount_); + } + if (((bitField0_ & 0x00000400) != 0)) { + output.writeInt32(13, historyListLengthThresholdCount_); + } + if (((bitField0_ & 0x00000800) != 0)) { + output.writeInt32(14, transactionKillThresholdSeconds_); + } + for (int i = 0; i < transactionKillExcludedUserHosts_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 16, transactionKillExcludedUserHosts_.getRaw(i)); + } + if (((bitField0_ & 0x00001000) != 0)) { + output.writeEnum(17, transactionKillType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enabled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, probingIntervalSeconds_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, probeThreshold_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, runningThreadsThreshold_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(5, secondsBehindSourceThreshold_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(8, transactionDurationThreshold_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 9, cpuUtilizationThresholdPercent_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(10, memoryUsageThresholdPercent_); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 11, transactionLockWaitThresholdCount_); + } + if (((bitField0_ & 0x00000200) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(12, semaphoreWaitThresholdCount_); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 13, historyListLengthThresholdCount_); + } + if (((bitField0_ & 0x00000800) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 14, transactionKillThresholdSeconds_); + } + { + int dataSize = 0; + for (int i = 0; i < transactionKillExcludedUserHosts_.size(); i++) { + dataSize += computeStringSizeNoTag(transactionKillExcludedUserHosts_.getRaw(i)); + } + size += dataSize; + size += 2 * getTransactionKillExcludedUserHostsList().size(); + } + if (((bitField0_ & 0x00001000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(17, transactionKillType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.PerformanceCaptureConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.PerformanceCaptureConfig other = + (com.google.cloud.sql.v1.PerformanceCaptureConfig) obj; + + if (hasEnabled() != other.hasEnabled()) return false; + if (hasEnabled()) { + if (getEnabled() != other.getEnabled()) return false; + } + if (hasProbingIntervalSeconds() != other.hasProbingIntervalSeconds()) return false; + if (hasProbingIntervalSeconds()) { + if (getProbingIntervalSeconds() != other.getProbingIntervalSeconds()) return false; + } + if (hasProbeThreshold() != other.hasProbeThreshold()) return false; + if (hasProbeThreshold()) { + if (getProbeThreshold() != other.getProbeThreshold()) return false; + } + if (hasRunningThreadsThreshold() != other.hasRunningThreadsThreshold()) return false; + if (hasRunningThreadsThreshold()) { + if (getRunningThreadsThreshold() != other.getRunningThreadsThreshold()) return false; + } + if (hasSecondsBehindSourceThreshold() != other.hasSecondsBehindSourceThreshold()) return false; + if (hasSecondsBehindSourceThreshold()) { + if (getSecondsBehindSourceThreshold() != other.getSecondsBehindSourceThreshold()) + return false; + } + if (hasTransactionDurationThreshold() != other.hasTransactionDurationThreshold()) return false; + if (hasTransactionDurationThreshold()) { + if (getTransactionDurationThreshold() != other.getTransactionDurationThreshold()) + return false; + } + if (hasCpuUtilizationThresholdPercent() != other.hasCpuUtilizationThresholdPercent()) + return false; + if (hasCpuUtilizationThresholdPercent()) { + if (getCpuUtilizationThresholdPercent() != other.getCpuUtilizationThresholdPercent()) + return false; + } + if (hasMemoryUsageThresholdPercent() != other.hasMemoryUsageThresholdPercent()) return false; + if (hasMemoryUsageThresholdPercent()) { + if (getMemoryUsageThresholdPercent() != other.getMemoryUsageThresholdPercent()) return false; + } + if (hasTransactionLockWaitThresholdCount() != other.hasTransactionLockWaitThresholdCount()) + return false; + if (hasTransactionLockWaitThresholdCount()) { + if (getTransactionLockWaitThresholdCount() != other.getTransactionLockWaitThresholdCount()) + return false; + } + if (hasSemaphoreWaitThresholdCount() != other.hasSemaphoreWaitThresholdCount()) return false; + if (hasSemaphoreWaitThresholdCount()) { + if (getSemaphoreWaitThresholdCount() != other.getSemaphoreWaitThresholdCount()) return false; + } + if (hasHistoryListLengthThresholdCount() != other.hasHistoryListLengthThresholdCount()) + return false; + if (hasHistoryListLengthThresholdCount()) { + if (getHistoryListLengthThresholdCount() != other.getHistoryListLengthThresholdCount()) + return false; + } + if (hasTransactionKillThresholdSeconds() != other.hasTransactionKillThresholdSeconds()) + return false; + if (hasTransactionKillThresholdSeconds()) { + if (getTransactionKillThresholdSeconds() != other.getTransactionKillThresholdSeconds()) + return false; + } + if (!getTransactionKillExcludedUserHostsList() + .equals(other.getTransactionKillExcludedUserHostsList())) return false; + if (hasTransactionKillType() != other.hasTransactionKillType()) return false; + if (hasTransactionKillType()) { + if (transactionKillType_ != other.transactionKillType_) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); + } + if (hasProbingIntervalSeconds()) { + hash = (37 * hash) + PROBING_INTERVAL_SECONDS_FIELD_NUMBER; + hash = (53 * hash) + getProbingIntervalSeconds(); + } + if (hasProbeThreshold()) { + hash = (37 * hash) + PROBE_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getProbeThreshold(); + } + if (hasRunningThreadsThreshold()) { + hash = (37 * hash) + RUNNING_THREADS_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getRunningThreadsThreshold(); + } + if (hasSecondsBehindSourceThreshold()) { + hash = (37 * hash) + SECONDS_BEHIND_SOURCE_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getSecondsBehindSourceThreshold(); + } + if (hasTransactionDurationThreshold()) { + hash = (37 * hash) + TRANSACTION_DURATION_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getTransactionDurationThreshold(); + } + if (hasCpuUtilizationThresholdPercent()) { + hash = (37 * hash) + CPU_UTILIZATION_THRESHOLD_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getCpuUtilizationThresholdPercent(); + } + if (hasMemoryUsageThresholdPercent()) { + hash = (37 * hash) + MEMORY_USAGE_THRESHOLD_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getMemoryUsageThresholdPercent(); + } + if (hasTransactionLockWaitThresholdCount()) { + hash = (37 * hash) + TRANSACTION_LOCK_WAIT_THRESHOLD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getTransactionLockWaitThresholdCount(); + } + if (hasSemaphoreWaitThresholdCount()) { + hash = (37 * hash) + SEMAPHORE_WAIT_THRESHOLD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getSemaphoreWaitThresholdCount(); + } + if (hasHistoryListLengthThresholdCount()) { + hash = (37 * hash) + HISTORY_LIST_LENGTH_THRESHOLD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getHistoryListLengthThresholdCount(); + } + if (hasTransactionKillThresholdSeconds()) { + hash = (37 * hash) + TRANSACTION_KILL_THRESHOLD_SECONDS_FIELD_NUMBER; + hash = (53 * hash) + getTransactionKillThresholdSeconds(); + } + if (getTransactionKillExcludedUserHostsCount() > 0) { + hash = (37 * hash) + TRANSACTION_KILL_EXCLUDED_USER_HOSTS_FIELD_NUMBER; + hash = (53 * hash) + getTransactionKillExcludedUserHostsList().hashCode(); + } + if (hasTransactionKillType()) { + hash = (37 * hash) + TRANSACTION_KILL_TYPE_FIELD_NUMBER; + hash = (53 * hash) + transactionKillType_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.PerformanceCaptureConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PerformanceCaptureConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PerformanceCaptureConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PerformanceCaptureConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PerformanceCaptureConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PerformanceCaptureConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PerformanceCaptureConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PerformanceCaptureConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PerformanceCaptureConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PerformanceCaptureConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PerformanceCaptureConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PerformanceCaptureConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.PerformanceCaptureConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Performance capture configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PerformanceCaptureConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.PerformanceCaptureConfig) + com.google.cloud.sql.v1.PerformanceCaptureConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PerformanceCaptureConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PerformanceCaptureConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PerformanceCaptureConfig.class, + com.google.cloud.sql.v1.PerformanceCaptureConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.PerformanceCaptureConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enabled_ = false; + probingIntervalSeconds_ = 0; + probeThreshold_ = 0; + runningThreadsThreshold_ = 0; + secondsBehindSourceThreshold_ = 0; + transactionDurationThreshold_ = 0; + cpuUtilizationThresholdPercent_ = 0; + memoryUsageThresholdPercent_ = 0; + transactionLockWaitThresholdCount_ = 0; + semaphoreWaitThresholdCount_ = 0; + historyListLengthThresholdCount_ = 0; + transactionKillThresholdSeconds_ = 0; + transactionKillExcludedUserHosts_ = com.google.protobuf.LazyStringArrayList.emptyList(); + transactionKillType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PerformanceCaptureConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PerformanceCaptureConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.PerformanceCaptureConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.PerformanceCaptureConfig build() { + com.google.cloud.sql.v1.PerformanceCaptureConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PerformanceCaptureConfig buildPartial() { + com.google.cloud.sql.v1.PerformanceCaptureConfig result = + new com.google.cloud.sql.v1.PerformanceCaptureConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.PerformanceCaptureConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enabled_ = enabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.probingIntervalSeconds_ = probingIntervalSeconds_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.probeThreshold_ = probeThreshold_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.runningThreadsThreshold_ = runningThreadsThreshold_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.secondsBehindSourceThreshold_ = secondsBehindSourceThreshold_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.transactionDurationThreshold_ = transactionDurationThreshold_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.cpuUtilizationThresholdPercent_ = cpuUtilizationThresholdPercent_; + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.memoryUsageThresholdPercent_ = memoryUsageThresholdPercent_; + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.transactionLockWaitThresholdCount_ = transactionLockWaitThresholdCount_; + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.semaphoreWaitThresholdCount_ = semaphoreWaitThresholdCount_; + to_bitField0_ |= 0x00000200; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.historyListLengthThresholdCount_ = historyListLengthThresholdCount_; + to_bitField0_ |= 0x00000400; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.transactionKillThresholdSeconds_ = transactionKillThresholdSeconds_; + to_bitField0_ |= 0x00000800; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + transactionKillExcludedUserHosts_.makeImmutable(); + result.transactionKillExcludedUserHosts_ = transactionKillExcludedUserHosts_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.transactionKillType_ = transactionKillType_; + to_bitField0_ |= 0x00001000; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.PerformanceCaptureConfig) { + return mergeFrom((com.google.cloud.sql.v1.PerformanceCaptureConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.PerformanceCaptureConfig other) { + if (other == com.google.cloud.sql.v1.PerformanceCaptureConfig.getDefaultInstance()) + return this; + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); + } + if (other.hasProbingIntervalSeconds()) { + setProbingIntervalSeconds(other.getProbingIntervalSeconds()); + } + if (other.hasProbeThreshold()) { + setProbeThreshold(other.getProbeThreshold()); + } + if (other.hasRunningThreadsThreshold()) { + setRunningThreadsThreshold(other.getRunningThreadsThreshold()); + } + if (other.hasSecondsBehindSourceThreshold()) { + setSecondsBehindSourceThreshold(other.getSecondsBehindSourceThreshold()); + } + if (other.hasTransactionDurationThreshold()) { + setTransactionDurationThreshold(other.getTransactionDurationThreshold()); + } + if (other.hasCpuUtilizationThresholdPercent()) { + setCpuUtilizationThresholdPercent(other.getCpuUtilizationThresholdPercent()); + } + if (other.hasMemoryUsageThresholdPercent()) { + setMemoryUsageThresholdPercent(other.getMemoryUsageThresholdPercent()); + } + if (other.hasTransactionLockWaitThresholdCount()) { + setTransactionLockWaitThresholdCount(other.getTransactionLockWaitThresholdCount()); + } + if (other.hasSemaphoreWaitThresholdCount()) { + setSemaphoreWaitThresholdCount(other.getSemaphoreWaitThresholdCount()); + } + if (other.hasHistoryListLengthThresholdCount()) { + setHistoryListLengthThresholdCount(other.getHistoryListLengthThresholdCount()); + } + if (other.hasTransactionKillThresholdSeconds()) { + setTransactionKillThresholdSeconds(other.getTransactionKillThresholdSeconds()); + } + if (!other.transactionKillExcludedUserHosts_.isEmpty()) { + if (transactionKillExcludedUserHosts_.isEmpty()) { + transactionKillExcludedUserHosts_ = other.transactionKillExcludedUserHosts_; + bitField0_ |= 0x00001000; + } else { + ensureTransactionKillExcludedUserHostsIsMutable(); + transactionKillExcludedUserHosts_.addAll(other.transactionKillExcludedUserHosts_); + } + onChanged(); + } + if (other.hasTransactionKillType()) { + setTransactionKillTypeValue(other.getTransactionKillTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + probingIntervalSeconds_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + probeThreshold_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + runningThreadsThreshold_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + secondsBehindSourceThreshold_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 64: + { + transactionDurationThreshold_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 64 + case 72: + { + cpuUtilizationThresholdPercent_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 72 + case 80: + { + memoryUsageThresholdPercent_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 80 + case 88: + { + transactionLockWaitThresholdCount_ = input.readInt32(); + bitField0_ |= 0x00000100; + break; + } // case 88 + case 96: + { + semaphoreWaitThresholdCount_ = input.readInt32(); + bitField0_ |= 0x00000200; + break; + } // case 96 + case 104: + { + historyListLengthThresholdCount_ = input.readInt32(); + bitField0_ |= 0x00000400; + break; + } // case 104 + case 112: + { + transactionKillThresholdSeconds_ = input.readInt32(); + bitField0_ |= 0x00000800; + break; + } // case 112 + case 130: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureTransactionKillExcludedUserHostsIsMutable(); + transactionKillExcludedUserHosts_.add(s); + break; + } // case 130 + case 136: + { + transactionKillType_ = input.readEnum(); + bitField0_ |= 0x00002000; + break; + } // case 136 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean enabled_; + + /** + * + * + *
+     * Optional. Enables or disables the performance capture feature.
+     * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. Enables or disables the performance capture feature.
+     * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + /** + * + * + *
+     * Optional. Enables or disables the performance capture feature.
+     * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Enables or disables the performance capture feature.
+     * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + enabled_ = false; + onChanged(); + return this; + } + + private int probingIntervalSeconds_; + + /** + * + * + *
+     * Optional. Specifies the interval in seconds between consecutive probes that
+     * check if any trigger condition thresholds have been reached.
+     * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the probingIntervalSeconds field is set. + */ + @java.lang.Override + public boolean hasProbingIntervalSeconds() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the interval in seconds between consecutive probes that
+     * check if any trigger condition thresholds have been reached.
+     * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The probingIntervalSeconds. + */ + @java.lang.Override + public int getProbingIntervalSeconds() { + return probingIntervalSeconds_; + } + + /** + * + * + *
+     * Optional. Specifies the interval in seconds between consecutive probes that
+     * check if any trigger condition thresholds have been reached.
+     * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The probingIntervalSeconds to set. + * @return This builder for chaining. + */ + public Builder setProbingIntervalSeconds(int value) { + + probingIntervalSeconds_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the interval in seconds between consecutive probes that
+     * check if any trigger condition thresholds have been reached.
+     * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearProbingIntervalSeconds() { + bitField0_ = (bitField0_ & ~0x00000002); + probingIntervalSeconds_ = 0; + onChanged(); + return this; + } + + private int probeThreshold_; + + /** + * + * + *
+     * Optional. Specifies the minimum number of consecutive probe threshold that
+     * triggers performance capture.
+     * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the probeThreshold field is set. + */ + @java.lang.Override + public boolean hasProbeThreshold() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of consecutive probe threshold that
+     * triggers performance capture.
+     * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The probeThreshold. + */ + @java.lang.Override + public int getProbeThreshold() { + return probeThreshold_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of consecutive probe threshold that
+     * triggers performance capture.
+     * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The probeThreshold to set. + * @return This builder for chaining. + */ + public Builder setProbeThreshold(int value) { + + probeThreshold_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of consecutive probe threshold that
+     * triggers performance capture.
+     * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearProbeThreshold() { + bitField0_ = (bitField0_ & ~0x00000004); + probeThreshold_ = 0; + onChanged(); + return this; + } + + private int runningThreadsThreshold_; + + /** + * + * + *
+     * Optional. Specifies the minimum number of MySQL `Threads_running` to
+     * trigger the performance capture on the primary instance.
+     * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the runningThreadsThreshold field is set. + */ + @java.lang.Override + public boolean hasRunningThreadsThreshold() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of MySQL `Threads_running` to
+     * trigger the performance capture on the primary instance.
+     * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The runningThreadsThreshold. + */ + @java.lang.Override + public int getRunningThreadsThreshold() { + return runningThreadsThreshold_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of MySQL `Threads_running` to
+     * trigger the performance capture on the primary instance.
+     * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The runningThreadsThreshold to set. + * @return This builder for chaining. + */ + public Builder setRunningThreadsThreshold(int value) { + + runningThreadsThreshold_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of MySQL `Threads_running` to
+     * trigger the performance capture on the primary instance.
+     * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRunningThreadsThreshold() { + bitField0_ = (bitField0_ & ~0x00000008); + runningThreadsThreshold_ = 0; + onChanged(); + return this; + } + + private int secondsBehindSourceThreshold_; + + /** + * + * + *
+     * Optional. Specifies the minimum number of seconds replica must be lagging
+     * behind primary instance to trigger the performance capture on replica.
+     * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the secondsBehindSourceThreshold field is set. + */ + @java.lang.Override + public boolean hasSecondsBehindSourceThreshold() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of seconds replica must be lagging
+     * behind primary instance to trigger the performance capture on replica.
+     * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The secondsBehindSourceThreshold. + */ + @java.lang.Override + public int getSecondsBehindSourceThreshold() { + return secondsBehindSourceThreshold_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of seconds replica must be lagging
+     * behind primary instance to trigger the performance capture on replica.
+     * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The secondsBehindSourceThreshold to set. + * @return This builder for chaining. + */ + public Builder setSecondsBehindSourceThreshold(int value) { + + secondsBehindSourceThreshold_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of seconds replica must be lagging
+     * behind primary instance to trigger the performance capture on replica.
+     * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSecondsBehindSourceThreshold() { + bitField0_ = (bitField0_ & ~0x00000010); + secondsBehindSourceThreshold_ = 0; + onChanged(); + return this; + } + + private int transactionDurationThreshold_; + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts recording it.
+     * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionDurationThreshold field is set. + */ + @java.lang.Override + public boolean hasTransactionDurationThreshold() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts recording it.
+     * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionDurationThreshold. + */ + @java.lang.Override + public int getTransactionDurationThreshold() { + return transactionDurationThreshold_; + } + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts recording it.
+     * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The transactionDurationThreshold to set. + * @return This builder for chaining. + */ + public Builder setTransactionDurationThreshold(int value) { + + transactionDurationThreshold_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts recording it.
+     * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransactionDurationThreshold() { + bitField0_ = (bitField0_ & ~0x00000020); + transactionDurationThreshold_ = 0; + onChanged(); + return this; + } + + private int cpuUtilizationThresholdPercent_; + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of CPU utilization to trigger
+     * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+     * to disable the check.
+     * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cpuUtilizationThresholdPercent field is set. + */ + @java.lang.Override + public boolean hasCpuUtilizationThresholdPercent() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of CPU utilization to trigger
+     * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+     * to disable the check.
+     * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cpuUtilizationThresholdPercent. + */ + @java.lang.Override + public int getCpuUtilizationThresholdPercent() { + return cpuUtilizationThresholdPercent_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of CPU utilization to trigger
+     * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+     * to disable the check.
+     * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The cpuUtilizationThresholdPercent to set. + * @return This builder for chaining. + */ + public Builder setCpuUtilizationThresholdPercent(int value) { + + cpuUtilizationThresholdPercent_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of CPU utilization to trigger
+     * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+     * to disable the check.
+     * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearCpuUtilizationThresholdPercent() { + bitField0_ = (bitField0_ & ~0x00000040); + cpuUtilizationThresholdPercent_ = 0; + onChanged(); + return this; + } + + private int memoryUsageThresholdPercent_; + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of memory usage to trigger the
+     * performance capture.
+     * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the memoryUsageThresholdPercent field is set. + */ + @java.lang.Override + public boolean hasMemoryUsageThresholdPercent() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of memory usage to trigger the
+     * performance capture.
+     * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The memoryUsageThresholdPercent. + */ + @java.lang.Override + public int getMemoryUsageThresholdPercent() { + return memoryUsageThresholdPercent_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of memory usage to trigger the
+     * performance capture.
+     * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The memoryUsageThresholdPercent to set. + * @return This builder for chaining. + */ + public Builder setMemoryUsageThresholdPercent(int value) { + + memoryUsageThresholdPercent_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of memory usage to trigger the
+     * performance capture.
+     * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMemoryUsageThresholdPercent() { + bitField0_ = (bitField0_ & ~0x00000080); + memoryUsageThresholdPercent_ = 0; + onChanged(); + return this; + } + + private int transactionLockWaitThresholdCount_; + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of transactions in lock wait
+     * state to trigger the performance capture. Valid integers range from `10` to
+     * `10000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionLockWaitThresholdCount field is set. + */ + @java.lang.Override + public boolean hasTransactionLockWaitThresholdCount() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of transactions in lock wait
+     * state to trigger the performance capture. Valid integers range from `10` to
+     * `10000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionLockWaitThresholdCount. + */ + @java.lang.Override + public int getTransactionLockWaitThresholdCount() { + return transactionLockWaitThresholdCount_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of transactions in lock wait
+     * state to trigger the performance capture. Valid integers range from `10` to
+     * `10000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The transactionLockWaitThresholdCount to set. + * @return This builder for chaining. + */ + public Builder setTransactionLockWaitThresholdCount(int value) { + + transactionLockWaitThresholdCount_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of transactions in lock wait
+     * state to trigger the performance capture. Valid integers range from `10` to
+     * `10000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransactionLockWaitThresholdCount() { + bitField0_ = (bitField0_ & ~0x00000100); + transactionLockWaitThresholdCount_ = 0; + onChanged(); + return this; + } + + private int semaphoreWaitThresholdCount_; + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of semaphore waits to
+     * trigger the performance capture. Valid integers range from `10` to `10000`.
+     * Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the semaphoreWaitThresholdCount field is set. + */ + @java.lang.Override + public boolean hasSemaphoreWaitThresholdCount() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of semaphore waits to
+     * trigger the performance capture. Valid integers range from `10` to `10000`.
+     * Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The semaphoreWaitThresholdCount. + */ + @java.lang.Override + public int getSemaphoreWaitThresholdCount() { + return semaphoreWaitThresholdCount_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of semaphore waits to
+     * trigger the performance capture. Valid integers range from `10` to `10000`.
+     * Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The semaphoreWaitThresholdCount to set. + * @return This builder for chaining. + */ + public Builder setSemaphoreWaitThresholdCount(int value) { + + semaphoreWaitThresholdCount_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of semaphore waits to
+     * trigger the performance capture. Valid integers range from `10` to `10000`.
+     * Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSemaphoreWaitThresholdCount() { + bitField0_ = (bitField0_ & ~0x00000200); + semaphoreWaitThresholdCount_ = 0; + onChanged(); + return this; + } + + private int historyListLengthThresholdCount_; + + /** + * + * + *
+     * Optional. Specifies the minimum number of undo log entries in the history
+     * list length to trigger the performance capture. Valid integers range from
+     * `10000` to `10000000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the historyListLengthThresholdCount field is set. + */ + @java.lang.Override + public boolean hasHistoryListLengthThresholdCount() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of undo log entries in the history
+     * list length to trigger the performance capture. Valid integers range from
+     * `10000` to `10000000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The historyListLengthThresholdCount. + */ + @java.lang.Override + public int getHistoryListLengthThresholdCount() { + return historyListLengthThresholdCount_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of undo log entries in the history
+     * list length to trigger the performance capture. Valid integers range from
+     * `10000` to `10000000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The historyListLengthThresholdCount to set. + * @return This builder for chaining. + */ + public Builder setHistoryListLengthThresholdCount(int value) { + + historyListLengthThresholdCount_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of undo log entries in the history
+     * list length to trigger the performance capture. Valid integers range from
+     * `10000` to `10000000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearHistoryListLengthThresholdCount() { + bitField0_ = (bitField0_ & ~0x00000400); + historyListLengthThresholdCount_ = 0; + onChanged(); + return this; + } + + private int transactionKillThresholdSeconds_; + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts terminating it. Valid integers
+     * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+     * (i.e., > 0), this value must be greater than or equal to
+     * `transaction_duration_threshold`. Configurations where
+     * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+     * will be rejected.
+     * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionKillThresholdSeconds field is set. + */ + @java.lang.Override + public boolean hasTransactionKillThresholdSeconds() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts terminating it. Valid integers
+     * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+     * (i.e., > 0), this value must be greater than or equal to
+     * `transaction_duration_threshold`. Configurations where
+     * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+     * will be rejected.
+     * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionKillThresholdSeconds. + */ + @java.lang.Override + public int getTransactionKillThresholdSeconds() { + return transactionKillThresholdSeconds_; + } + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts terminating it. Valid integers
+     * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+     * (i.e., > 0), this value must be greater than or equal to
+     * `transaction_duration_threshold`. Configurations where
+     * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+     * will be rejected.
+     * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The transactionKillThresholdSeconds to set. + * @return This builder for chaining. + */ + public Builder setTransactionKillThresholdSeconds(int value) { + + transactionKillThresholdSeconds_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts terminating it. Valid integers
+     * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+     * (i.e., > 0), this value must be greater than or equal to
+     * `transaction_duration_threshold`. Configurations where
+     * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+     * will be rejected.
+     * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransactionKillThresholdSeconds() { + bitField0_ = (bitField0_ & ~0x00000800); + transactionKillThresholdSeconds_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList transactionKillExcludedUserHosts_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureTransactionKillExcludedUserHostsIsMutable() { + if (!transactionKillExcludedUserHosts_.isModifiable()) { + transactionKillExcludedUserHosts_ = + new com.google.protobuf.LazyStringArrayList(transactionKillExcludedUserHosts_); + } + bitField0_ |= 0x00001000; + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the transactionKillExcludedUserHosts. + */ + public com.google.protobuf.ProtocolStringList getTransactionKillExcludedUserHostsList() { + transactionKillExcludedUserHosts_.makeImmutable(); + return transactionKillExcludedUserHosts_; + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of transactionKillExcludedUserHosts. + */ + public int getTransactionKillExcludedUserHostsCount() { + return transactionKillExcludedUserHosts_.size(); + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The transactionKillExcludedUserHosts at the given index. + */ + public java.lang.String getTransactionKillExcludedUserHosts(int index) { + return transactionKillExcludedUserHosts_.get(index); + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the transactionKillExcludedUserHosts at the given index. + */ + public com.google.protobuf.ByteString getTransactionKillExcludedUserHostsBytes(int index) { + return transactionKillExcludedUserHosts_.getByteString(index); + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The transactionKillExcludedUserHosts to set. + * @return This builder for chaining. + */ + public Builder setTransactionKillExcludedUserHosts(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionKillExcludedUserHostsIsMutable(); + transactionKillExcludedUserHosts_.set(index, value); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The transactionKillExcludedUserHosts to add. + * @return This builder for chaining. + */ + public Builder addTransactionKillExcludedUserHosts(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionKillExcludedUserHostsIsMutable(); + transactionKillExcludedUserHosts_.add(value); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The transactionKillExcludedUserHosts to add. + * @return This builder for chaining. + */ + public Builder addAllTransactionKillExcludedUserHosts( + java.lang.Iterable values) { + ensureTransactionKillExcludedUserHostsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, transactionKillExcludedUserHosts_); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransactionKillExcludedUserHosts() { + transactionKillExcludedUserHosts_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes of the transactionKillExcludedUserHosts to add. + * @return This builder for chaining. + */ + public Builder addTransactionKillExcludedUserHostsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTransactionKillExcludedUserHostsIsMutable(); + transactionKillExcludedUserHosts_.add(value); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private int transactionKillType_ = 0; + + /** + * + * + *
+     * Optional. Determines which transactions are allowed to be terminated when
+     * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+     * write-heavy transactions from auto-termination if desired. Defaults to
+     * `READ_ONLY_TRANSACTIONS` if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionKillType field is set. + */ + @java.lang.Override + public boolean hasTransactionKillType() { + return ((bitField0_ & 0x00002000) != 0); + } + + /** + * + * + *
+     * Optional. Determines which transactions are allowed to be terminated when
+     * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+     * write-heavy transactions from auto-termination if desired. Defaults to
+     * `READ_ONLY_TRANSACTIONS` if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for transactionKillType. + */ + @java.lang.Override + public int getTransactionKillTypeValue() { + return transactionKillType_; + } + + /** + * + * + *
+     * Optional. Determines which transactions are allowed to be terminated when
+     * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+     * write-heavy transactions from auto-termination if desired. Defaults to
+     * `READ_ONLY_TRANSACTIONS` if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for transactionKillType to set. + * @return This builder for chaining. + */ + public Builder setTransactionKillTypeValue(int value) { + transactionKillType_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Determines which transactions are allowed to be terminated when
+     * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+     * write-heavy transactions from auto-termination if desired. Defaults to
+     * `READ_ONLY_TRANSACTIONS` if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionKillType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType + getTransactionKillType() { + com.google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType result = + com.google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType.forNumber( + transactionKillType_); + return result == null + ? com.google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. Determines which transactions are allowed to be terminated when
+     * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+     * write-heavy transactions from auto-termination if desired. Defaults to
+     * `READ_ONLY_TRANSACTIONS` if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The transactionKillType to set. + * @return This builder for chaining. + */ + public Builder setTransactionKillType( + com.google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00002000; + transactionKillType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Determines which transactions are allowed to be terminated when
+     * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+     * write-heavy transactions from auto-termination if desired. Defaults to
+     * `READ_ONLY_TRANSACTIONS` if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransactionKillType() { + bitField0_ = (bitField0_ & ~0x00002000); + transactionKillType_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.PerformanceCaptureConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.PerformanceCaptureConfig) + private static final com.google.cloud.sql.v1.PerformanceCaptureConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.PerformanceCaptureConfig(); + } + + public static com.google.cloud.sql.v1.PerformanceCaptureConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PerformanceCaptureConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PerformanceCaptureConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PerformanceCaptureConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PerformanceCaptureConfigOrBuilder.java new file mode 100644 index 000000000000..fbe917bc9a35 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PerformanceCaptureConfigOrBuilder.java @@ -0,0 +1,550 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface PerformanceCaptureConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.PerformanceCaptureConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Enables or disables the performance capture feature.
+   * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + + /** + * + * + *
+   * Optional. Enables or disables the performance capture feature.
+   * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enabled. + */ + boolean getEnabled(); + + /** + * + * + *
+   * Optional. Specifies the interval in seconds between consecutive probes that
+   * check if any trigger condition thresholds have been reached.
+   * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the probingIntervalSeconds field is set. + */ + boolean hasProbingIntervalSeconds(); + + /** + * + * + *
+   * Optional. Specifies the interval in seconds between consecutive probes that
+   * check if any trigger condition thresholds have been reached.
+   * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The probingIntervalSeconds. + */ + int getProbingIntervalSeconds(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of consecutive probe threshold that
+   * triggers performance capture.
+   * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the probeThreshold field is set. + */ + boolean hasProbeThreshold(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of consecutive probe threshold that
+   * triggers performance capture.
+   * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The probeThreshold. + */ + int getProbeThreshold(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of MySQL `Threads_running` to
+   * trigger the performance capture on the primary instance.
+   * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the runningThreadsThreshold field is set. + */ + boolean hasRunningThreadsThreshold(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of MySQL `Threads_running` to
+   * trigger the performance capture on the primary instance.
+   * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The runningThreadsThreshold. + */ + int getRunningThreadsThreshold(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of seconds replica must be lagging
+   * behind primary instance to trigger the performance capture on replica.
+   * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the secondsBehindSourceThreshold field is set. + */ + boolean hasSecondsBehindSourceThreshold(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of seconds replica must be lagging
+   * behind primary instance to trigger the performance capture on replica.
+   * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The secondsBehindSourceThreshold. + */ + int getSecondsBehindSourceThreshold(); + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts recording it.
+   * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionDurationThreshold field is set. + */ + boolean hasTransactionDurationThreshold(); + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts recording it.
+   * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionDurationThreshold. + */ + int getTransactionDurationThreshold(); + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of CPU utilization to trigger
+   * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+   * to disable the check.
+   * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cpuUtilizationThresholdPercent field is set. + */ + boolean hasCpuUtilizationThresholdPercent(); + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of CPU utilization to trigger
+   * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+   * to disable the check.
+   * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cpuUtilizationThresholdPercent. + */ + int getCpuUtilizationThresholdPercent(); + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of memory usage to trigger the
+   * performance capture.
+   * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the memoryUsageThresholdPercent field is set. + */ + boolean hasMemoryUsageThresholdPercent(); + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of memory usage to trigger the
+   * performance capture.
+   * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The memoryUsageThresholdPercent. + */ + int getMemoryUsageThresholdPercent(); + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of transactions in lock wait
+   * state to trigger the performance capture. Valid integers range from `10` to
+   * `10000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionLockWaitThresholdCount field is set. + */ + boolean hasTransactionLockWaitThresholdCount(); + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of transactions in lock wait
+   * state to trigger the performance capture. Valid integers range from `10` to
+   * `10000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionLockWaitThresholdCount. + */ + int getTransactionLockWaitThresholdCount(); + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of semaphore waits to
+   * trigger the performance capture. Valid integers range from `10` to `10000`.
+   * Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the semaphoreWaitThresholdCount field is set. + */ + boolean hasSemaphoreWaitThresholdCount(); + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of semaphore waits to
+   * trigger the performance capture. Valid integers range from `10` to `10000`.
+   * Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The semaphoreWaitThresholdCount. + */ + int getSemaphoreWaitThresholdCount(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of undo log entries in the history
+   * list length to trigger the performance capture. Valid integers range from
+   * `10000` to `10000000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the historyListLengthThresholdCount field is set. + */ + boolean hasHistoryListLengthThresholdCount(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of undo log entries in the history
+   * list length to trigger the performance capture. Valid integers range from
+   * `10000` to `10000000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The historyListLengthThresholdCount. + */ + int getHistoryListLengthThresholdCount(); + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts terminating it. Valid integers
+   * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+   * (i.e., > 0), this value must be greater than or equal to
+   * `transaction_duration_threshold`. Configurations where
+   * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+   * will be rejected.
+   * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionKillThresholdSeconds field is set. + */ + boolean hasTransactionKillThresholdSeconds(); + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts terminating it. Valid integers
+   * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+   * (i.e., > 0), this value must be greater than or equal to
+   * `transaction_duration_threshold`. Configurations where
+   * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+   * will be rejected.
+   * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionKillThresholdSeconds. + */ + int getTransactionKillThresholdSeconds(); + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the transactionKillExcludedUserHosts. + */ + java.util.List getTransactionKillExcludedUserHostsList(); + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of transactionKillExcludedUserHosts. + */ + int getTransactionKillExcludedUserHostsCount(); + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The transactionKillExcludedUserHosts at the given index. + */ + java.lang.String getTransactionKillExcludedUserHosts(int index); + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the transactionKillExcludedUserHosts at the given index. + */ + com.google.protobuf.ByteString getTransactionKillExcludedUserHostsBytes(int index); + + /** + * + * + *
+   * Optional. Determines which transactions are allowed to be terminated when
+   * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+   * write-heavy transactions from auto-termination if desired. Defaults to
+   * `READ_ONLY_TRANSACTIONS` if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionKillType field is set. + */ + boolean hasTransactionKillType(); + + /** + * + * + *
+   * Optional. Determines which transactions are allowed to be terminated when
+   * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+   * write-heavy transactions from auto-termination if desired. Defaults to
+   * `READ_ONLY_TRANSACTIONS` if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for transactionKillType. + */ + int getTransactionKillTypeValue(); + + /** + * + * + *
+   * Optional. Determines which transactions are allowed to be terminated when
+   * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+   * write-heavy transactions from auto-termination if desired. Defaults to
+   * `READ_ONLY_TRANSACTIONS` if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionKillType. + */ + com.google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType getTransactionKillType(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PointInTimeRestoreContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PointInTimeRestoreContext.java new file mode 100644 index 000000000000..0622f95ba2ce --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PointInTimeRestoreContext.java @@ -0,0 +1,3102 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The context to perform a point-in-time recovery of an instance managed by
+ * Backup and Disaster Recovery (DR) Service.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PointInTimeRestoreContext} + */ +@com.google.protobuf.Generated +public final class PointInTimeRestoreContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.PointInTimeRestoreContext) + PointInTimeRestoreContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PointInTimeRestoreContext"); + } + + // Use PointInTimeRestoreContext.newBuilder() to construct. + private PointInTimeRestoreContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PointInTimeRestoreContext() { + datasource_ = ""; + targetInstance_ = ""; + privateNetwork_ = ""; + allocatedIpRange_ = ""; + preferredZone_ = ""; + preferredSecondaryZone_ = ""; + targetInstanceClearSettingsFieldNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + region_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_PointInTimeRestoreContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_PointInTimeRestoreContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PointInTimeRestoreContext.class, + com.google.cloud.sql.v1.PointInTimeRestoreContext.Builder.class); + } + + private int bitField0_; + public static final int DATASOURCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object datasource_ = ""; + + /** + * + * + *
+   * The Backup and Disaster Recovery (DR) Service Datasource URI.
+   * Format:
+   * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+   * 
+ * + * optional string datasource = 1; + * + * @return Whether the datasource field is set. + */ + @java.lang.Override + public boolean hasDatasource() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The Backup and Disaster Recovery (DR) Service Datasource URI.
+   * Format:
+   * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+   * 
+ * + * optional string datasource = 1; + * + * @return The datasource. + */ + @java.lang.Override + public java.lang.String getDatasource() { + java.lang.Object ref = datasource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasource_ = s; + return s; + } + } + + /** + * + * + *
+   * The Backup and Disaster Recovery (DR) Service Datasource URI.
+   * Format:
+   * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+   * 
+ * + * optional string datasource = 1; + * + * @return The bytes for datasource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatasourceBytes() { + java.lang.Object ref = datasource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POINT_IN_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp pointInTime_; + + /** + * + * + *
+   * Required. The date and time to which you want to restore the instance.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + @java.lang.Override + public boolean hasPointInTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Required. The date and time to which you want to restore the instance.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPointInTime() { + return pointInTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : pointInTime_; + } + + /** + * + * + *
+   * Required. The date and time to which you want to restore the instance.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder() { + return pointInTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : pointInTime_; + } + + public static final int TARGET_INSTANCE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object targetInstance_ = ""; + + /** + * + * + *
+   * Target instance name.
+   * 
+ * + * optional string target_instance = 3; + * + * @return Whether the targetInstance field is set. + */ + @java.lang.Override + public boolean hasTargetInstance() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Target instance name.
+   * 
+ * + * optional string target_instance = 3; + * + * @return The targetInstance. + */ + @java.lang.Override + public java.lang.String getTargetInstance() { + java.lang.Object ref = targetInstance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetInstance_ = s; + return s; + } + } + + /** + * + * + *
+   * Target instance name.
+   * 
+ * + * optional string target_instance = 3; + * + * @return The bytes for targetInstance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetInstanceBytes() { + java.lang.Object ref = targetInstance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetInstance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIVATE_NETWORK_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object privateNetwork_ = ""; + + /** + * + * + *
+   * Optional. The resource link for the VPC network from which the Cloud SQL
+   * instance is accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`.
+   * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the privateNetwork field is set. + */ + @java.lang.Override + public boolean hasPrivateNetwork() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. The resource link for the VPC network from which the Cloud SQL
+   * instance is accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`.
+   * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The privateNetwork. + */ + @java.lang.Override + public java.lang.String getPrivateNetwork() { + java.lang.Object ref = privateNetwork_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateNetwork_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The resource link for the VPC network from which the Cloud SQL
+   * instance is accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`.
+   * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for privateNetwork. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrivateNetworkBytes() { + java.lang.Object ref = privateNetwork_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOCATED_IP_RANGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object allocatedIpRange_ = ""; + + /** + * + * + *
+   * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+   * instance. For example: "google-managed-services-default". If you set this,
+   * then Cloud SQL creates the IP address for the cloned instance in the
+   * allocated range. This range must comply with [RFC
+   * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+   * name must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+   * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the allocatedIpRange field is set. + */ + @java.lang.Override + public boolean hasAllocatedIpRange() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+   * instance. For example: "google-managed-services-default". If you set this,
+   * then Cloud SQL creates the IP address for the cloned instance in the
+   * allocated range. This range must comply with [RFC
+   * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+   * name must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+   * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allocatedIpRange. + */ + @java.lang.Override + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+   * instance. For example: "google-managed-services-default". If you set this,
+   * then Cloud SQL creates the IP address for the cloned instance in the
+   * allocated range. This range must comply with [RFC
+   * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+   * name must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+   * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for allocatedIpRange. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PREFERRED_ZONE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object preferredZone_ = ""; + + /** + * + * + *
+   * Optional. Point-in-time recovery of an instance to the specified zone. If
+   * no zone is specified, then clone to the same primary zone as the source
+   * instance.
+   * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the preferredZone field is set. + */ + @java.lang.Override + public boolean hasPreferredZone() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Optional. Point-in-time recovery of an instance to the specified zone. If
+   * no zone is specified, then clone to the same primary zone as the source
+   * instance.
+   * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The preferredZone. + */ + @java.lang.Override + public java.lang.String getPreferredZone() { + java.lang.Object ref = preferredZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredZone_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Point-in-time recovery of an instance to the specified zone. If
+   * no zone is specified, then clone to the same primary zone as the source
+   * instance.
+   * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for preferredZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPreferredZoneBytes() { + java.lang.Object ref = preferredZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PREFERRED_SECONDARY_ZONE_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object preferredSecondaryZone_ = ""; + + /** + * + * + *
+   * Optional. Point-in-time recovery of a regional instance in the specified
+   * zones. If not specified, clone to the same secondary zone as the source
+   * instance. This value cannot be the same as the preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the preferredSecondaryZone field is set. + */ + @java.lang.Override + public boolean hasPreferredSecondaryZone() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Optional. Point-in-time recovery of a regional instance in the specified
+   * zones. If not specified, clone to the same secondary zone as the source
+   * instance. This value cannot be the same as the preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The preferredSecondaryZone. + */ + @java.lang.Override + public java.lang.String getPreferredSecondaryZone() { + java.lang.Object ref = preferredSecondaryZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredSecondaryZone_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Point-in-time recovery of a regional instance in the specified
+   * zones. If not specified, clone to the same secondary zone as the source
+   * instance. This value cannot be the same as the preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for preferredSecondaryZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPreferredSecondaryZoneBytes() { + java.lang.Object ref = preferredSecondaryZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredSecondaryZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_INSTANCE_SETTINGS_FIELD_NUMBER = 11; + private com.google.cloud.sql.v1.DatabaseInstance targetInstanceSettings_; + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be overridden from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the targetInstanceSettings field is set. + */ + @java.lang.Override + public boolean hasTargetInstanceSettings() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be overridden from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The targetInstanceSettings. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance getTargetInstanceSettings() { + return targetInstanceSettings_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : targetInstanceSettings_; + } + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be overridden from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getTargetInstanceSettingsOrBuilder() { + return targetInstanceSettings_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : targetInstanceSettings_; + } + + public static final int TARGET_INSTANCE_CLEAR_SETTINGS_FIELD_NAMES_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList targetInstanceClearSettingsFieldNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the targetInstanceClearSettingsFieldNames. + */ + public com.google.protobuf.ProtocolStringList getTargetInstanceClearSettingsFieldNamesList() { + return targetInstanceClearSettingsFieldNames_; + } + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of targetInstanceClearSettingsFieldNames. + */ + public int getTargetInstanceClearSettingsFieldNamesCount() { + return targetInstanceClearSettingsFieldNames_.size(); + } + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The targetInstanceClearSettingsFieldNames at the given index. + */ + public java.lang.String getTargetInstanceClearSettingsFieldNames(int index) { + return targetInstanceClearSettingsFieldNames_.get(index); + } + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the targetInstanceClearSettingsFieldNames at the given index. + */ + public com.google.protobuf.ByteString getTargetInstanceClearSettingsFieldNamesBytes(int index) { + return targetInstanceClearSettingsFieldNames_.getByteString(index); + } + + public static final int REGION_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private volatile java.lang.Object region_ = ""; + + /** + * + * + *
+   * Optional. The region of the target instance where the datasource will be
+   * restored. For example: "us-central1".
+   * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the region field is set. + */ + @java.lang.Override + public boolean hasRegion() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+   * Optional. The region of the target instance where the datasource will be
+   * restored. For example: "us-central1".
+   * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The region. + */ + @java.lang.Override + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The region of the target instance where the datasource will be
+   * restored. For example: "us-central1".
+   * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for region. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = 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)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, datasource_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getPointInTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, targetInstance_); + } + if (((bitField0_ & 0x00000008) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, privateNetwork_); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, allocatedIpRange_); + } + if (((bitField0_ & 0x00000020) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, preferredZone_); + } + if (((bitField0_ & 0x00000040) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, preferredSecondaryZone_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(11, getTargetInstanceSettings()); + } + for (int i = 0; i < targetInstanceClearSettingsFieldNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 12, targetInstanceClearSettingsFieldNames_.getRaw(i)); + } + if (((bitField0_ & 0x00000100) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 13, region_); + } + 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.GeneratedMessage.computeStringSize(1, datasource_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPointInTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, targetInstance_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, privateNetwork_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, allocatedIpRange_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, preferredZone_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, preferredSecondaryZone_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(11, getTargetInstanceSettings()); + } + { + int dataSize = 0; + for (int i = 0; i < targetInstanceClearSettingsFieldNames_.size(); i++) { + dataSize += computeStringSizeNoTag(targetInstanceClearSettingsFieldNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getTargetInstanceClearSettingsFieldNamesList().size(); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(13, region_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.PointInTimeRestoreContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.PointInTimeRestoreContext other = + (com.google.cloud.sql.v1.PointInTimeRestoreContext) obj; + + if (hasDatasource() != other.hasDatasource()) return false; + if (hasDatasource()) { + if (!getDatasource().equals(other.getDatasource())) return false; + } + if (hasPointInTime() != other.hasPointInTime()) return false; + if (hasPointInTime()) { + if (!getPointInTime().equals(other.getPointInTime())) return false; + } + if (hasTargetInstance() != other.hasTargetInstance()) return false; + if (hasTargetInstance()) { + if (!getTargetInstance().equals(other.getTargetInstance())) return false; + } + if (hasPrivateNetwork() != other.hasPrivateNetwork()) return false; + if (hasPrivateNetwork()) { + if (!getPrivateNetwork().equals(other.getPrivateNetwork())) return false; + } + if (hasAllocatedIpRange() != other.hasAllocatedIpRange()) return false; + if (hasAllocatedIpRange()) { + if (!getAllocatedIpRange().equals(other.getAllocatedIpRange())) return false; + } + if (hasPreferredZone() != other.hasPreferredZone()) return false; + if (hasPreferredZone()) { + if (!getPreferredZone().equals(other.getPreferredZone())) return false; + } + if (hasPreferredSecondaryZone() != other.hasPreferredSecondaryZone()) return false; + if (hasPreferredSecondaryZone()) { + if (!getPreferredSecondaryZone().equals(other.getPreferredSecondaryZone())) return false; + } + if (hasTargetInstanceSettings() != other.hasTargetInstanceSettings()) return false; + if (hasTargetInstanceSettings()) { + if (!getTargetInstanceSettings().equals(other.getTargetInstanceSettings())) return false; + } + if (!getTargetInstanceClearSettingsFieldNamesList() + .equals(other.getTargetInstanceClearSettingsFieldNamesList())) return false; + if (hasRegion() != other.hasRegion()) return false; + if (hasRegion()) { + if (!getRegion().equals(other.getRegion())) return false; + } + if (!getUnknownFields().equals(other.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 (hasDatasource()) { + hash = (37 * hash) + DATASOURCE_FIELD_NUMBER; + hash = (53 * hash) + getDatasource().hashCode(); + } + if (hasPointInTime()) { + hash = (37 * hash) + POINT_IN_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPointInTime().hashCode(); + } + if (hasTargetInstance()) { + hash = (37 * hash) + TARGET_INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getTargetInstance().hashCode(); + } + if (hasPrivateNetwork()) { + hash = (37 * hash) + PRIVATE_NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getPrivateNetwork().hashCode(); + } + if (hasAllocatedIpRange()) { + hash = (37 * hash) + ALLOCATED_IP_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getAllocatedIpRange().hashCode(); + } + if (hasPreferredZone()) { + hash = (37 * hash) + PREFERRED_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getPreferredZone().hashCode(); + } + if (hasPreferredSecondaryZone()) { + hash = (37 * hash) + PREFERRED_SECONDARY_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getPreferredSecondaryZone().hashCode(); + } + if (hasTargetInstanceSettings()) { + hash = (37 * hash) + TARGET_INSTANCE_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getTargetInstanceSettings().hashCode(); + } + if (getTargetInstanceClearSettingsFieldNamesCount() > 0) { + hash = (37 * hash) + TARGET_INSTANCE_CLEAR_SETTINGS_FIELD_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getTargetInstanceClearSettingsFieldNamesList().hashCode(); + } + if (hasRegion()) { + hash = (37 * hash) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegion().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.PointInTimeRestoreContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PointInTimeRestoreContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PointInTimeRestoreContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PointInTimeRestoreContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PointInTimeRestoreContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PointInTimeRestoreContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PointInTimeRestoreContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PointInTimeRestoreContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PointInTimeRestoreContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PointInTimeRestoreContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PointInTimeRestoreContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PointInTimeRestoreContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.PointInTimeRestoreContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The context to perform a point-in-time recovery of an instance managed by
+   * Backup and Disaster Recovery (DR) Service.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PointInTimeRestoreContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.PointInTimeRestoreContext) + com.google.cloud.sql.v1.PointInTimeRestoreContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_PointInTimeRestoreContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_PointInTimeRestoreContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PointInTimeRestoreContext.class, + com.google.cloud.sql.v1.PointInTimeRestoreContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.PointInTimeRestoreContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPointInTimeFieldBuilder(); + internalGetTargetInstanceSettingsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + datasource_ = ""; + pointInTime_ = null; + if (pointInTimeBuilder_ != null) { + pointInTimeBuilder_.dispose(); + pointInTimeBuilder_ = null; + } + targetInstance_ = ""; + privateNetwork_ = ""; + allocatedIpRange_ = ""; + preferredZone_ = ""; + preferredSecondaryZone_ = ""; + targetInstanceSettings_ = null; + if (targetInstanceSettingsBuilder_ != null) { + targetInstanceSettingsBuilder_.dispose(); + targetInstanceSettingsBuilder_ = null; + } + targetInstanceClearSettingsFieldNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + region_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_PointInTimeRestoreContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PointInTimeRestoreContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.PointInTimeRestoreContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.PointInTimeRestoreContext build() { + com.google.cloud.sql.v1.PointInTimeRestoreContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PointInTimeRestoreContext buildPartial() { + com.google.cloud.sql.v1.PointInTimeRestoreContext result = + new com.google.cloud.sql.v1.PointInTimeRestoreContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.PointInTimeRestoreContext result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.datasource_ = datasource_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pointInTime_ = + pointInTimeBuilder_ == null ? pointInTime_ : pointInTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.targetInstance_ = targetInstance_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.privateNetwork_ = privateNetwork_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allocatedIpRange_ = allocatedIpRange_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.preferredZone_ = preferredZone_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.preferredSecondaryZone_ = preferredSecondaryZone_; + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.targetInstanceSettings_ = + targetInstanceSettingsBuilder_ == null + ? targetInstanceSettings_ + : targetInstanceSettingsBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + targetInstanceClearSettingsFieldNames_.makeImmutable(); + result.targetInstanceClearSettingsFieldNames_ = targetInstanceClearSettingsFieldNames_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.region_ = region_; + to_bitField0_ |= 0x00000100; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.PointInTimeRestoreContext) { + return mergeFrom((com.google.cloud.sql.v1.PointInTimeRestoreContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.PointInTimeRestoreContext other) { + if (other == com.google.cloud.sql.v1.PointInTimeRestoreContext.getDefaultInstance()) + return this; + if (other.hasDatasource()) { + datasource_ = other.datasource_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasPointInTime()) { + mergePointInTime(other.getPointInTime()); + } + if (other.hasTargetInstance()) { + targetInstance_ = other.targetInstance_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasPrivateNetwork()) { + privateNetwork_ = other.privateNetwork_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasAllocatedIpRange()) { + allocatedIpRange_ = other.allocatedIpRange_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasPreferredZone()) { + preferredZone_ = other.preferredZone_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasPreferredSecondaryZone()) { + preferredSecondaryZone_ = other.preferredSecondaryZone_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasTargetInstanceSettings()) { + mergeTargetInstanceSettings(other.getTargetInstanceSettings()); + } + if (!other.targetInstanceClearSettingsFieldNames_.isEmpty()) { + if (targetInstanceClearSettingsFieldNames_.isEmpty()) { + targetInstanceClearSettingsFieldNames_ = other.targetInstanceClearSettingsFieldNames_; + bitField0_ |= 0x00000100; + } else { + ensureTargetInstanceClearSettingsFieldNamesIsMutable(); + targetInstanceClearSettingsFieldNames_.addAll( + other.targetInstanceClearSettingsFieldNames_); + } + onChanged(); + } + if (other.hasRegion()) { + region_ = other.region_; + bitField0_ |= 0x00000200; + 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: + { + datasource_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetPointInTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + targetInstance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + privateNetwork_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + allocatedIpRange_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + preferredZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 74: + { + preferredSecondaryZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 74 + case 90: + { + input.readMessage( + internalGetTargetInstanceSettingsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 90 + case 98: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureTargetInstanceClearSettingsFieldNamesIsMutable(); + targetInstanceClearSettingsFieldNames_.add(s); + break; + } // case 98 + case 106: + { + region_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 106 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 datasource_ = ""; + + /** + * + * + *
+     * The Backup and Disaster Recovery (DR) Service Datasource URI.
+     * Format:
+     * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+     * 
+ * + * optional string datasource = 1; + * + * @return Whether the datasource field is set. + */ + public boolean hasDatasource() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The Backup and Disaster Recovery (DR) Service Datasource URI.
+     * Format:
+     * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+     * 
+ * + * optional string datasource = 1; + * + * @return The datasource. + */ + public java.lang.String getDatasource() { + java.lang.Object ref = datasource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Backup and Disaster Recovery (DR) Service Datasource URI.
+     * Format:
+     * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+     * 
+ * + * optional string datasource = 1; + * + * @return The bytes for datasource. + */ + public com.google.protobuf.ByteString getDatasourceBytes() { + java.lang.Object ref = datasource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Backup and Disaster Recovery (DR) Service Datasource URI.
+     * Format:
+     * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+     * 
+ * + * optional string datasource = 1; + * + * @param value The datasource to set. + * @return This builder for chaining. + */ + public Builder setDatasource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + datasource_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Backup and Disaster Recovery (DR) Service Datasource URI.
+     * Format:
+     * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+     * 
+ * + * optional string datasource = 1; + * + * @return This builder for chaining. + */ + public Builder clearDatasource() { + datasource_ = getDefaultInstance().getDatasource(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Backup and Disaster Recovery (DR) Service Datasource URI.
+     * Format:
+     * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+     * 
+ * + * optional string datasource = 1; + * + * @param value The bytes for datasource to set. + * @return This builder for chaining. + */ + public Builder setDatasourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + datasource_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp pointInTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + pointInTimeBuilder_; + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + public boolean hasPointInTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + public com.google.protobuf.Timestamp getPointInTime() { + if (pointInTimeBuilder_ == null) { + return pointInTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : pointInTime_; + } else { + return pointInTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPointInTime(com.google.protobuf.Timestamp value) { + if (pointInTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pointInTime_ = value; + } else { + pointInTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPointInTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (pointInTimeBuilder_ == null) { + pointInTime_ = builderForValue.build(); + } else { + pointInTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePointInTime(com.google.protobuf.Timestamp value) { + if (pointInTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && pointInTime_ != null + && pointInTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getPointInTimeBuilder().mergeFrom(value); + } else { + pointInTime_ = value; + } + } else { + pointInTimeBuilder_.mergeFrom(value); + } + if (pointInTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPointInTime() { + bitField0_ = (bitField0_ & ~0x00000002); + pointInTime_ = null; + if (pointInTimeBuilder_ != null) { + pointInTimeBuilder_.dispose(); + pointInTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getPointInTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetPointInTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder() { + if (pointInTimeBuilder_ != null) { + return pointInTimeBuilder_.getMessageOrBuilder(); + } else { + return pointInTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : pointInTime_; + } + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetPointInTimeFieldBuilder() { + if (pointInTimeBuilder_ == null) { + pointInTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPointInTime(), getParentForChildren(), isClean()); + pointInTime_ = null; + } + return pointInTimeBuilder_; + } + + private java.lang.Object targetInstance_ = ""; + + /** + * + * + *
+     * Target instance name.
+     * 
+ * + * optional string target_instance = 3; + * + * @return Whether the targetInstance field is set. + */ + public boolean hasTargetInstance() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Target instance name.
+     * 
+ * + * optional string target_instance = 3; + * + * @return The targetInstance. + */ + public java.lang.String getTargetInstance() { + java.lang.Object ref = targetInstance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetInstance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Target instance name.
+     * 
+ * + * optional string target_instance = 3; + * + * @return The bytes for targetInstance. + */ + public com.google.protobuf.ByteString getTargetInstanceBytes() { + java.lang.Object ref = targetInstance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetInstance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Target instance name.
+     * 
+ * + * optional string target_instance = 3; + * + * @param value The targetInstance to set. + * @return This builder for chaining. + */ + public Builder setTargetInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetInstance_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Target instance name.
+     * 
+ * + * optional string target_instance = 3; + * + * @return This builder for chaining. + */ + public Builder clearTargetInstance() { + targetInstance_ = getDefaultInstance().getTargetInstance(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Target instance name.
+     * 
+ * + * optional string target_instance = 3; + * + * @param value The bytes for targetInstance to set. + * @return This builder for chaining. + */ + public Builder setTargetInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetInstance_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object privateNetwork_ = ""; + + /** + * + * + *
+     * Optional. The resource link for the VPC network from which the Cloud SQL
+     * instance is accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`.
+     * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the privateNetwork field is set. + */ + public boolean hasPrivateNetwork() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. The resource link for the VPC network from which the Cloud SQL
+     * instance is accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`.
+     * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The privateNetwork. + */ + public java.lang.String getPrivateNetwork() { + java.lang.Object ref = privateNetwork_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateNetwork_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The resource link for the VPC network from which the Cloud SQL
+     * instance is accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`.
+     * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for privateNetwork. + */ + public com.google.protobuf.ByteString getPrivateNetworkBytes() { + java.lang.Object ref = privateNetwork_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The resource link for the VPC network from which the Cloud SQL
+     * instance is accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`.
+     * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The privateNetwork to set. + * @return This builder for chaining. + */ + public Builder setPrivateNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + privateNetwork_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource link for the VPC network from which the Cloud SQL
+     * instance is accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`.
+     * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPrivateNetwork() { + privateNetwork_ = getDefaultInstance().getPrivateNetwork(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource link for the VPC network from which the Cloud SQL
+     * instance is accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`.
+     * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for privateNetwork to set. + * @return This builder for chaining. + */ + public Builder setPrivateNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + privateNetwork_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object allocatedIpRange_ = ""; + + /** + * + * + *
+     * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+     * instance. For example: "google-managed-services-default". If you set this,
+     * then Cloud SQL creates the IP address for the cloned instance in the
+     * allocated range. This range must comply with [RFC
+     * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+     * name must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+     * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the allocatedIpRange field is set. + */ + public boolean hasAllocatedIpRange() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+     * instance. For example: "google-managed-services-default". If you set this,
+     * then Cloud SQL creates the IP address for the cloned instance in the
+     * allocated range. This range must comply with [RFC
+     * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+     * name must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+     * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The allocatedIpRange. + */ + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+     * instance. For example: "google-managed-services-default". If you set this,
+     * then Cloud SQL creates the IP address for the cloned instance in the
+     * allocated range. This range must comply with [RFC
+     * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+     * name must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+     * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for allocatedIpRange. + */ + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+     * instance. For example: "google-managed-services-default". If you set this,
+     * then Cloud SQL creates the IP address for the cloned instance in the
+     * allocated range. This range must comply with [RFC
+     * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+     * name must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+     * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRange(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + allocatedIpRange_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+     * instance. For example: "google-managed-services-default". If you set this,
+     * then Cloud SQL creates the IP address for the cloned instance in the
+     * allocated range. This range must comply with [RFC
+     * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+     * name must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+     * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearAllocatedIpRange() { + allocatedIpRange_ = getDefaultInstance().getAllocatedIpRange(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+     * instance. For example: "google-managed-services-default". If you set this,
+     * then Cloud SQL creates the IP address for the cloned instance in the
+     * allocated range. This range must comply with [RFC
+     * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+     * name must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+     * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRangeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + allocatedIpRange_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object preferredZone_ = ""; + + /** + * + * + *
+     * Optional. Point-in-time recovery of an instance to the specified zone. If
+     * no zone is specified, then clone to the same primary zone as the source
+     * instance.
+     * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the preferredZone field is set. + */ + public boolean hasPreferredZone() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of an instance to the specified zone. If
+     * no zone is specified, then clone to the same primary zone as the source
+     * instance.
+     * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The preferredZone. + */ + public java.lang.String getPreferredZone() { + java.lang.Object ref = preferredZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of an instance to the specified zone. If
+     * no zone is specified, then clone to the same primary zone as the source
+     * instance.
+     * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for preferredZone. + */ + public com.google.protobuf.ByteString getPreferredZoneBytes() { + java.lang.Object ref = preferredZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of an instance to the specified zone. If
+     * no zone is specified, then clone to the same primary zone as the source
+     * instance.
+     * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The preferredZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + preferredZone_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of an instance to the specified zone. If
+     * no zone is specified, then clone to the same primary zone as the source
+     * instance.
+     * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPreferredZone() { + preferredZone_ = getDefaultInstance().getPreferredZone(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of an instance to the specified zone. If
+     * no zone is specified, then clone to the same primary zone as the source
+     * instance.
+     * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for preferredZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + preferredZone_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object preferredSecondaryZone_ = ""; + + /** + * + * + *
+     * Optional. Point-in-time recovery of a regional instance in the specified
+     * zones. If not specified, clone to the same secondary zone as the source
+     * instance. This value cannot be the same as the preferred_zone field.
+     * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the preferredSecondaryZone field is set. + */ + public boolean hasPreferredSecondaryZone() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of a regional instance in the specified
+     * zones. If not specified, clone to the same secondary zone as the source
+     * instance. This value cannot be the same as the preferred_zone field.
+     * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The preferredSecondaryZone. + */ + public java.lang.String getPreferredSecondaryZone() { + java.lang.Object ref = preferredSecondaryZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredSecondaryZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of a regional instance in the specified
+     * zones. If not specified, clone to the same secondary zone as the source
+     * instance. This value cannot be the same as the preferred_zone field.
+     * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for preferredSecondaryZone. + */ + public com.google.protobuf.ByteString getPreferredSecondaryZoneBytes() { + java.lang.Object ref = preferredSecondaryZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredSecondaryZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of a regional instance in the specified
+     * zones. If not specified, clone to the same secondary zone as the source
+     * instance. This value cannot be the same as the preferred_zone field.
+     * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The preferredSecondaryZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredSecondaryZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + preferredSecondaryZone_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of a regional instance in the specified
+     * zones. If not specified, clone to the same secondary zone as the source
+     * instance. This value cannot be the same as the preferred_zone field.
+     * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPreferredSecondaryZone() { + preferredSecondaryZone_ = getDefaultInstance().getPreferredSecondaryZone(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of a regional instance in the specified
+     * zones. If not specified, clone to the same secondary zone as the source
+     * instance. This value cannot be the same as the preferred_zone field.
+     * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for preferredSecondaryZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredSecondaryZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + preferredSecondaryZone_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.DatabaseInstance targetInstanceSettings_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder> + targetInstanceSettingsBuilder_; + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the targetInstanceSettings field is set. + */ + public boolean hasTargetInstanceSettings() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The targetInstanceSettings. + */ + public com.google.cloud.sql.v1.DatabaseInstance getTargetInstanceSettings() { + if (targetInstanceSettingsBuilder_ == null) { + return targetInstanceSettings_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : targetInstanceSettings_; + } else { + return targetInstanceSettingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTargetInstanceSettings(com.google.cloud.sql.v1.DatabaseInstance value) { + if (targetInstanceSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + targetInstanceSettings_ = value; + } else { + targetInstanceSettingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTargetInstanceSettings( + com.google.cloud.sql.v1.DatabaseInstance.Builder builderForValue) { + if (targetInstanceSettingsBuilder_ == null) { + targetInstanceSettings_ = builderForValue.build(); + } else { + targetInstanceSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeTargetInstanceSettings(com.google.cloud.sql.v1.DatabaseInstance value) { + if (targetInstanceSettingsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && targetInstanceSettings_ != null + && targetInstanceSettings_ + != com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance()) { + getTargetInstanceSettingsBuilder().mergeFrom(value); + } else { + targetInstanceSettings_ = value; + } + } else { + targetInstanceSettingsBuilder_.mergeFrom(value); + } + if (targetInstanceSettings_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTargetInstanceSettings() { + bitField0_ = (bitField0_ & ~0x00000080); + targetInstanceSettings_ = null; + if (targetInstanceSettingsBuilder_ != null) { + targetInstanceSettingsBuilder_.dispose(); + targetInstanceSettingsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.DatabaseInstance.Builder getTargetInstanceSettingsBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetTargetInstanceSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getTargetInstanceSettingsOrBuilder() { + if (targetInstanceSettingsBuilder_ != null) { + return targetInstanceSettingsBuilder_.getMessageOrBuilder(); + } else { + return targetInstanceSettings_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : targetInstanceSettings_; + } + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder> + internalGetTargetInstanceSettingsFieldBuilder() { + if (targetInstanceSettingsBuilder_ == null) { + targetInstanceSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder>( + getTargetInstanceSettings(), getParentForChildren(), isClean()); + targetInstanceSettings_ = null; + } + return targetInstanceSettingsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList targetInstanceClearSettingsFieldNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureTargetInstanceClearSettingsFieldNamesIsMutable() { + if (!targetInstanceClearSettingsFieldNames_.isModifiable()) { + targetInstanceClearSettingsFieldNames_ = + new com.google.protobuf.LazyStringArrayList(targetInstanceClearSettingsFieldNames_); + } + bitField0_ |= 0x00000100; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the targetInstanceClearSettingsFieldNames. + */ + public com.google.protobuf.ProtocolStringList getTargetInstanceClearSettingsFieldNamesList() { + targetInstanceClearSettingsFieldNames_.makeImmutable(); + return targetInstanceClearSettingsFieldNames_; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of targetInstanceClearSettingsFieldNames. + */ + public int getTargetInstanceClearSettingsFieldNamesCount() { + return targetInstanceClearSettingsFieldNames_.size(); + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The targetInstanceClearSettingsFieldNames at the given index. + */ + public java.lang.String getTargetInstanceClearSettingsFieldNames(int index) { + return targetInstanceClearSettingsFieldNames_.get(index); + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the targetInstanceClearSettingsFieldNames at the given index. + */ + public com.google.protobuf.ByteString getTargetInstanceClearSettingsFieldNamesBytes(int index) { + return targetInstanceClearSettingsFieldNames_.getByteString(index); + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The targetInstanceClearSettingsFieldNames to set. + * @return This builder for chaining. + */ + public Builder setTargetInstanceClearSettingsFieldNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetInstanceClearSettingsFieldNamesIsMutable(); + targetInstanceClearSettingsFieldNames_.set(index, value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The targetInstanceClearSettingsFieldNames to add. + * @return This builder for chaining. + */ + public Builder addTargetInstanceClearSettingsFieldNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetInstanceClearSettingsFieldNamesIsMutable(); + targetInstanceClearSettingsFieldNames_.add(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The targetInstanceClearSettingsFieldNames to add. + * @return This builder for chaining. + */ + public Builder addAllTargetInstanceClearSettingsFieldNames( + java.lang.Iterable values) { + ensureTargetInstanceClearSettingsFieldNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, targetInstanceClearSettingsFieldNames_); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTargetInstanceClearSettingsFieldNames() { + targetInstanceClearSettingsFieldNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes of the targetInstanceClearSettingsFieldNames to add. + * @return This builder for chaining. + */ + public Builder addTargetInstanceClearSettingsFieldNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTargetInstanceClearSettingsFieldNamesIsMutable(); + targetInstanceClearSettingsFieldNames_.add(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private java.lang.Object region_ = ""; + + /** + * + * + *
+     * Optional. The region of the target instance where the datasource will be
+     * restored. For example: "us-central1".
+     * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the region field is set. + */ + public boolean hasRegion() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Optional. The region of the target instance where the datasource will be
+     * restored. For example: "us-central1".
+     * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The region. + */ + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The region of the target instance where the datasource will be
+     * restored. For example: "us-central1".
+     * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for region. + */ + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The region of the target instance where the datasource will be
+     * restored. For example: "us-central1".
+     * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The region to set. + * @return This builder for chaining. + */ + public Builder setRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + region_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The region of the target instance where the datasource will be
+     * restored. For example: "us-central1".
+     * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRegion() { + region_ = getDefaultInstance().getRegion(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The region of the target instance where the datasource will be
+     * restored. For example: "us-central1".
+     * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for region to set. + * @return This builder for chaining. + */ + public Builder setRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + region_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.PointInTimeRestoreContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.PointInTimeRestoreContext) + private static final com.google.cloud.sql.v1.PointInTimeRestoreContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.PointInTimeRestoreContext(); + } + + public static com.google.cloud.sql.v1.PointInTimeRestoreContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PointInTimeRestoreContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PointInTimeRestoreContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PointInTimeRestoreContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PointInTimeRestoreContextOrBuilder.java new file mode 100644 index 000000000000..c4adff6d5f7e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PointInTimeRestoreContextOrBuilder.java @@ -0,0 +1,501 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface PointInTimeRestoreContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.PointInTimeRestoreContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Backup and Disaster Recovery (DR) Service Datasource URI.
+   * Format:
+   * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+   * 
+ * + * optional string datasource = 1; + * + * @return Whether the datasource field is set. + */ + boolean hasDatasource(); + + /** + * + * + *
+   * The Backup and Disaster Recovery (DR) Service Datasource URI.
+   * Format:
+   * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+   * 
+ * + * optional string datasource = 1; + * + * @return The datasource. + */ + java.lang.String getDatasource(); + + /** + * + * + *
+   * The Backup and Disaster Recovery (DR) Service Datasource URI.
+   * Format:
+   * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+   * 
+ * + * optional string datasource = 1; + * + * @return The bytes for datasource. + */ + com.google.protobuf.ByteString getDatasourceBytes(); + + /** + * + * + *
+   * Required. The date and time to which you want to restore the instance.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + boolean hasPointInTime(); + + /** + * + * + *
+   * Required. The date and time to which you want to restore the instance.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + com.google.protobuf.Timestamp getPointInTime(); + + /** + * + * + *
+   * Required. The date and time to which you want to restore the instance.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder(); + + /** + * + * + *
+   * Target instance name.
+   * 
+ * + * optional string target_instance = 3; + * + * @return Whether the targetInstance field is set. + */ + boolean hasTargetInstance(); + + /** + * + * + *
+   * Target instance name.
+   * 
+ * + * optional string target_instance = 3; + * + * @return The targetInstance. + */ + java.lang.String getTargetInstance(); + + /** + * + * + *
+   * Target instance name.
+   * 
+ * + * optional string target_instance = 3; + * + * @return The bytes for targetInstance. + */ + com.google.protobuf.ByteString getTargetInstanceBytes(); + + /** + * + * + *
+   * Optional. The resource link for the VPC network from which the Cloud SQL
+   * instance is accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`.
+   * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the privateNetwork field is set. + */ + boolean hasPrivateNetwork(); + + /** + * + * + *
+   * Optional. The resource link for the VPC network from which the Cloud SQL
+   * instance is accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`.
+   * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The privateNetwork. + */ + java.lang.String getPrivateNetwork(); + + /** + * + * + *
+   * Optional. The resource link for the VPC network from which the Cloud SQL
+   * instance is accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`.
+   * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for privateNetwork. + */ + com.google.protobuf.ByteString getPrivateNetworkBytes(); + + /** + * + * + *
+   * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+   * instance. For example: "google-managed-services-default". If you set this,
+   * then Cloud SQL creates the IP address for the cloned instance in the
+   * allocated range. This range must comply with [RFC
+   * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+   * name must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+   * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the allocatedIpRange field is set. + */ + boolean hasAllocatedIpRange(); + + /** + * + * + *
+   * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+   * instance. For example: "google-managed-services-default". If you set this,
+   * then Cloud SQL creates the IP address for the cloned instance in the
+   * allocated range. This range must comply with [RFC
+   * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+   * name must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+   * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allocatedIpRange. + */ + java.lang.String getAllocatedIpRange(); + + /** + * + * + *
+   * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+   * instance. For example: "google-managed-services-default". If you set this,
+   * then Cloud SQL creates the IP address for the cloned instance in the
+   * allocated range. This range must comply with [RFC
+   * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+   * name must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+   * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for allocatedIpRange. + */ + com.google.protobuf.ByteString getAllocatedIpRangeBytes(); + + /** + * + * + *
+   * Optional. Point-in-time recovery of an instance to the specified zone. If
+   * no zone is specified, then clone to the same primary zone as the source
+   * instance.
+   * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the preferredZone field is set. + */ + boolean hasPreferredZone(); + + /** + * + * + *
+   * Optional. Point-in-time recovery of an instance to the specified zone. If
+   * no zone is specified, then clone to the same primary zone as the source
+   * instance.
+   * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The preferredZone. + */ + java.lang.String getPreferredZone(); + + /** + * + * + *
+   * Optional. Point-in-time recovery of an instance to the specified zone. If
+   * no zone is specified, then clone to the same primary zone as the source
+   * instance.
+   * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for preferredZone. + */ + com.google.protobuf.ByteString getPreferredZoneBytes(); + + /** + * + * + *
+   * Optional. Point-in-time recovery of a regional instance in the specified
+   * zones. If not specified, clone to the same secondary zone as the source
+   * instance. This value cannot be the same as the preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the preferredSecondaryZone field is set. + */ + boolean hasPreferredSecondaryZone(); + + /** + * + * + *
+   * Optional. Point-in-time recovery of a regional instance in the specified
+   * zones. If not specified, clone to the same secondary zone as the source
+   * instance. This value cannot be the same as the preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The preferredSecondaryZone. + */ + java.lang.String getPreferredSecondaryZone(); + + /** + * + * + *
+   * Optional. Point-in-time recovery of a regional instance in the specified
+   * zones. If not specified, clone to the same secondary zone as the source
+   * instance. This value cannot be the same as the preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for preferredSecondaryZone. + */ + com.google.protobuf.ByteString getPreferredSecondaryZoneBytes(); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be overridden from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the targetInstanceSettings field is set. + */ + boolean hasTargetInstanceSettings(); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be overridden from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The targetInstanceSettings. + */ + com.google.cloud.sql.v1.DatabaseInstance getTargetInstanceSettings(); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be overridden from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * .google.cloud.sql.v1.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getTargetInstanceSettingsOrBuilder(); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the targetInstanceClearSettingsFieldNames. + */ + java.util.List getTargetInstanceClearSettingsFieldNamesList(); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of targetInstanceClearSettingsFieldNames. + */ + int getTargetInstanceClearSettingsFieldNamesCount(); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The targetInstanceClearSettingsFieldNames at the given index. + */ + java.lang.String getTargetInstanceClearSettingsFieldNames(int index); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the targetInstanceClearSettingsFieldNames at the given index. + */ + com.google.protobuf.ByteString getTargetInstanceClearSettingsFieldNamesBytes(int index); + + /** + * + * + *
+   * Optional. The region of the target instance where the datasource will be
+   * restored. For example: "us-central1".
+   * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the region field is set. + */ + boolean hasRegion(); + + /** + * + * + *
+   * Optional. The region of the target instance where the datasource will be
+   * restored. For example: "us-central1".
+   * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The region. + */ + java.lang.String getRegion(); + + /** + * + * + *
+   * Optional. The region of the target instance where the datasource will be
+   * restored. For example: "us-central1".
+   * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for region. + */ + com.google.protobuf.ByteString getRegionBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PreCheckMajorVersionUpgradeContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PreCheckMajorVersionUpgradeContext.java new file mode 100644 index 000000000000..113111284cd3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PreCheckMajorVersionUpgradeContext.java @@ -0,0 +1,1338 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Pre-check major version upgrade context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext} + */ +@com.google.protobuf.Generated +public final class PreCheckMajorVersionUpgradeContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext) + PreCheckMajorVersionUpgradeContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PreCheckMajorVersionUpgradeContext"); + } + + // Use PreCheckMajorVersionUpgradeContext.newBuilder() to construct. + private PreCheckMajorVersionUpgradeContext( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PreCheckMajorVersionUpgradeContext() { + targetDatabaseVersion_ = 0; + preCheckResponse_ = java.util.Collections.emptyList(); + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PreCheckMajorVersionUpgradeContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PreCheckMajorVersionUpgradeContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.class, + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.Builder.class); + } + + public static final int TARGET_DATABASE_VERSION_FIELD_NUMBER = 1; + private int targetDatabaseVersion_ = 0; + + /** + * + * + *
+   * Required. The target database version to upgrade to.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for targetDatabaseVersion. + */ + @java.lang.Override + public int getTargetDatabaseVersionValue() { + return targetDatabaseVersion_; + } + + /** + * + * + *
+   * Required. The target database version to upgrade to.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The targetDatabaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabaseVersion getTargetDatabaseVersion() { + com.google.cloud.sql.v1.SqlDatabaseVersion result = + com.google.cloud.sql.v1.SqlDatabaseVersion.forNumber(targetDatabaseVersion_); + return result == null ? com.google.cloud.sql.v1.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + public static final int PRE_CHECK_RESPONSE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List preCheckResponse_; + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getPreCheckResponseList() { + return preCheckResponse_; + } + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getPreCheckResponseOrBuilderList() { + return preCheckResponse_; + } + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getPreCheckResponseCount() { + return preCheckResponse_.size(); + } + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckResponse getPreCheckResponse(int index) { + return preCheckResponse_.get(index); + } + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckResponseOrBuilder getPreCheckResponseOrBuilder(int index) { + return preCheckResponse_.get(index); + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+   * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+   * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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 (targetDatabaseVersion_ + != com.google.cloud.sql.v1.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, targetDatabaseVersion_); + } + for (int i = 0; i < preCheckResponse_.size(); i++) { + output.writeMessage(2, preCheckResponse_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (targetDatabaseVersion_ + != com.google.cloud.sql.v1.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, targetDatabaseVersion_); + } + for (int i = 0; i < preCheckResponse_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, preCheckResponse_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext other = + (com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext) obj; + + if (targetDatabaseVersion_ != other.targetDatabaseVersion_) return false; + if (!getPreCheckResponseList().equals(other.getPreCheckResponseList())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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) + TARGET_DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + targetDatabaseVersion_; + if (getPreCheckResponseCount() > 0) { + hash = (37 * hash) + PRE_CHECK_RESPONSE_FIELD_NUMBER; + hash = (53 * hash) + getPreCheckResponseList().hashCode(); + } + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Pre-check major version upgrade context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext) + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PreCheckMajorVersionUpgradeContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PreCheckMajorVersionUpgradeContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.class, + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + targetDatabaseVersion_ = 0; + if (preCheckResponseBuilder_ == null) { + preCheckResponse_ = java.util.Collections.emptyList(); + } else { + preCheckResponse_ = null; + preCheckResponseBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PreCheckMajorVersionUpgradeContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext build() { + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext buildPartial() { + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext result = + new com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext result) { + if (preCheckResponseBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + preCheckResponse_ = java.util.Collections.unmodifiableList(preCheckResponse_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.preCheckResponse_ = preCheckResponse_; + } else { + result.preCheckResponse_ = preCheckResponseBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.targetDatabaseVersion_ = targetDatabaseVersion_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext) { + return mergeFrom((com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext other) { + if (other == com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.getDefaultInstance()) + return this; + if (other.targetDatabaseVersion_ != 0) { + setTargetDatabaseVersionValue(other.getTargetDatabaseVersionValue()); + } + if (preCheckResponseBuilder_ == null) { + if (!other.preCheckResponse_.isEmpty()) { + if (preCheckResponse_.isEmpty()) { + preCheckResponse_ = other.preCheckResponse_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePreCheckResponseIsMutable(); + preCheckResponse_.addAll(other.preCheckResponse_); + } + onChanged(); + } + } else { + if (!other.preCheckResponse_.isEmpty()) { + if (preCheckResponseBuilder_.isEmpty()) { + preCheckResponseBuilder_.dispose(); + preCheckResponseBuilder_ = null; + preCheckResponse_ = other.preCheckResponse_; + bitField0_ = (bitField0_ & ~0x00000002); + preCheckResponseBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPreCheckResponseFieldBuilder() + : null; + } else { + preCheckResponseBuilder_.addAllMessages(other.preCheckResponse_); + } + } + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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 8: + { + targetDatabaseVersion_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + com.google.cloud.sql.v1.PreCheckResponse m = + input.readMessage( + com.google.cloud.sql.v1.PreCheckResponse.parser(), extensionRegistry); + if (preCheckResponseBuilder_ == null) { + ensurePreCheckResponseIsMutable(); + preCheckResponse_.add(m); + } else { + preCheckResponseBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + kind_ = 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 int targetDatabaseVersion_ = 0; + + /** + * + * + *
+     * Required. The target database version to upgrade to.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for targetDatabaseVersion. + */ + @java.lang.Override + public int getTargetDatabaseVersionValue() { + return targetDatabaseVersion_; + } + + /** + * + * + *
+     * Required. The target database version to upgrade to.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for targetDatabaseVersion to set. + * @return This builder for chaining. + */ + public Builder setTargetDatabaseVersionValue(int value) { + targetDatabaseVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The target database version to upgrade to.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The targetDatabaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabaseVersion getTargetDatabaseVersion() { + com.google.cloud.sql.v1.SqlDatabaseVersion result = + com.google.cloud.sql.v1.SqlDatabaseVersion.forNumber(targetDatabaseVersion_); + return result == null ? com.google.cloud.sql.v1.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Required. The target database version to upgrade to.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The targetDatabaseVersion to set. + * @return This builder for chaining. + */ + public Builder setTargetDatabaseVersion(com.google.cloud.sql.v1.SqlDatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + targetDatabaseVersion_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The target database version to upgrade to.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearTargetDatabaseVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + targetDatabaseVersion_ = 0; + onChanged(); + return this; + } + + private java.util.List preCheckResponse_ = + java.util.Collections.emptyList(); + + private void ensurePreCheckResponseIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + preCheckResponse_ = + new java.util.ArrayList(preCheckResponse_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.PreCheckResponse, + com.google.cloud.sql.v1.PreCheckResponse.Builder, + com.google.cloud.sql.v1.PreCheckResponseOrBuilder> + preCheckResponseBuilder_; + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getPreCheckResponseList() { + if (preCheckResponseBuilder_ == null) { + return java.util.Collections.unmodifiableList(preCheckResponse_); + } else { + return preCheckResponseBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getPreCheckResponseCount() { + if (preCheckResponseBuilder_ == null) { + return preCheckResponse_.size(); + } else { + return preCheckResponseBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.PreCheckResponse getPreCheckResponse(int index) { + if (preCheckResponseBuilder_ == null) { + return preCheckResponse_.get(index); + } else { + return preCheckResponseBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPreCheckResponse(int index, com.google.cloud.sql.v1.PreCheckResponse value) { + if (preCheckResponseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePreCheckResponseIsMutable(); + preCheckResponse_.set(index, value); + onChanged(); + } else { + preCheckResponseBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPreCheckResponse( + int index, com.google.cloud.sql.v1.PreCheckResponse.Builder builderForValue) { + if (preCheckResponseBuilder_ == null) { + ensurePreCheckResponseIsMutable(); + preCheckResponse_.set(index, builderForValue.build()); + onChanged(); + } else { + preCheckResponseBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPreCheckResponse(com.google.cloud.sql.v1.PreCheckResponse value) { + if (preCheckResponseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePreCheckResponseIsMutable(); + preCheckResponse_.add(value); + onChanged(); + } else { + preCheckResponseBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPreCheckResponse(int index, com.google.cloud.sql.v1.PreCheckResponse value) { + if (preCheckResponseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePreCheckResponseIsMutable(); + preCheckResponse_.add(index, value); + onChanged(); + } else { + preCheckResponseBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPreCheckResponse( + com.google.cloud.sql.v1.PreCheckResponse.Builder builderForValue) { + if (preCheckResponseBuilder_ == null) { + ensurePreCheckResponseIsMutable(); + preCheckResponse_.add(builderForValue.build()); + onChanged(); + } else { + preCheckResponseBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPreCheckResponse( + int index, com.google.cloud.sql.v1.PreCheckResponse.Builder builderForValue) { + if (preCheckResponseBuilder_ == null) { + ensurePreCheckResponseIsMutable(); + preCheckResponse_.add(index, builderForValue.build()); + onChanged(); + } else { + preCheckResponseBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllPreCheckResponse( + java.lang.Iterable values) { + if (preCheckResponseBuilder_ == null) { + ensurePreCheckResponseIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, preCheckResponse_); + onChanged(); + } else { + preCheckResponseBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPreCheckResponse() { + if (preCheckResponseBuilder_ == null) { + preCheckResponse_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + preCheckResponseBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removePreCheckResponse(int index) { + if (preCheckResponseBuilder_ == null) { + ensurePreCheckResponseIsMutable(); + preCheckResponse_.remove(index); + onChanged(); + } else { + preCheckResponseBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.PreCheckResponse.Builder getPreCheckResponseBuilder(int index) { + return internalGetPreCheckResponseFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.PreCheckResponseOrBuilder getPreCheckResponseOrBuilder( + int index) { + if (preCheckResponseBuilder_ == null) { + return preCheckResponse_.get(index); + } else { + return preCheckResponseBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPreCheckResponseOrBuilderList() { + if (preCheckResponseBuilder_ != null) { + return preCheckResponseBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(preCheckResponse_); + } + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.PreCheckResponse.Builder addPreCheckResponseBuilder() { + return internalGetPreCheckResponseFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.PreCheckResponse.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.PreCheckResponse.Builder addPreCheckResponseBuilder(int index) { + return internalGetPreCheckResponseFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.PreCheckResponse.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPreCheckResponseBuilderList() { + return internalGetPreCheckResponseFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.PreCheckResponse, + com.google.cloud.sql.v1.PreCheckResponse.Builder, + com.google.cloud.sql.v1.PreCheckResponseOrBuilder> + internalGetPreCheckResponseFieldBuilder() { + if (preCheckResponseBuilder_ == null) { + preCheckResponseBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.PreCheckResponse, + com.google.cloud.sql.v1.PreCheckResponse.Builder, + com.google.cloud.sql.v1.PreCheckResponseOrBuilder>( + preCheckResponse_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + preCheckResponse_ = null; + } + return preCheckResponseBuilder_; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext) + private static final com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext(); + } + + public static com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PreCheckMajorVersionUpgradeContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PreCheckMajorVersionUpgradeContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PreCheckMajorVersionUpgradeContextOrBuilder.java new file mode 100644 index 000000000000..6d735266d1b9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PreCheckMajorVersionUpgradeContextOrBuilder.java @@ -0,0 +1,150 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface PreCheckMajorVersionUpgradeContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The target database version to upgrade to.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for targetDatabaseVersion. + */ + int getTargetDatabaseVersionValue(); + + /** + * + * + *
+   * Required. The target database version to upgrade to.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The targetDatabaseVersion. + */ + com.google.cloud.sql.v1.SqlDatabaseVersion getTargetDatabaseVersion(); + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getPreCheckResponseList(); + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.PreCheckResponse getPreCheckResponse(int index); + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getPreCheckResponseCount(); + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getPreCheckResponseOrBuilderList(); + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.PreCheckResponseOrBuilder getPreCheckResponseOrBuilder(int index); + + /** + * + * + *
+   * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+   * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+   * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PreCheckResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PreCheckResponse.java new file mode 100644 index 000000000000..189402d781e2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PreCheckResponse.java @@ -0,0 +1,1329 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Structured PreCheckResponse containing message, type, and required
+ * actions.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PreCheckResponse} + */ +@com.google.protobuf.Generated +public final class PreCheckResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.PreCheckResponse) + PreCheckResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PreCheckResponse"); + } + + // Use PreCheckResponse.newBuilder() to construct. + private PreCheckResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PreCheckResponse() { + message_ = ""; + messageType_ = 0; + actionsRequired_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PreCheckResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PreCheckResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PreCheckResponse.class, + com.google.cloud.sql.v1.PreCheckResponse.Builder.class); + } + + /** + * + * + *
+   * The type of message which can be an info, a warning, or an error that
+   * requires user intervention.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.PreCheckResponse.MessageType} + */ + public enum MessageType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default unspecified value to prevent unintended behavior changes.
+     * 
+ * + * MESSAGE_TYPE_UNSPECIFIED = 0; + */ + MESSAGE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * General informational messages that don't require action.
+     * 
+ * + * INFO = 1; + */ + INFO(1), + /** + * + * + *
+     * Warnings that might impact the upgrade but don't block it.
+     * 
+ * + * WARNING = 2; + */ + WARNING(2), + /** + * + * + *
+     * Errors that a user must resolve before proceeding with the upgrade.
+     * 
+ * + * ERROR = 3; + */ + ERROR(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MessageType"); + } + + /** + * + * + *
+     * Default unspecified value to prevent unintended behavior changes.
+     * 
+ * + * MESSAGE_TYPE_UNSPECIFIED = 0; + */ + public static final int MESSAGE_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * General informational messages that don't require action.
+     * 
+ * + * INFO = 1; + */ + public static final int INFO_VALUE = 1; + + /** + * + * + *
+     * Warnings that might impact the upgrade but don't block it.
+     * 
+ * + * WARNING = 2; + */ + public static final int WARNING_VALUE = 2; + + /** + * + * + *
+     * Errors that a user must resolve before proceeding with the upgrade.
+     * 
+ * + * ERROR = 3; + */ + public static final int ERROR_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 MessageType 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 MessageType forNumber(int value) { + switch (value) { + case 0: + return MESSAGE_TYPE_UNSPECIFIED; + case 1: + return INFO; + case 2: + return WARNING; + case 3: + return ERROR; + 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 MessageType findValueByNumber(int number) { + return MessageType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.PreCheckResponse.getDescriptor().getEnumTypes().get(0); + } + + private static final MessageType[] VALUES = values(); + + public static MessageType 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 MessageType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.PreCheckResponse.MessageType) + } + + private int bitField0_; + public static final int MESSAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
+   * The message to be displayed to the user.
+   * 
+ * + * optional string message = 2; + * + * @return Whether the message field is set. + */ + @java.lang.Override + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The message to be displayed to the user.
+   * 
+ * + * optional string message = 2; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + + /** + * + * + *
+   * The message to be displayed to the user.
+   * 
+ * + * optional string message = 2; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_TYPE_FIELD_NUMBER = 3; + private int messageType_ = 0; + + /** + * + * + *
+   * The type of message whether it is an info, warning, or error.
+   * 
+ * + * optional .google.cloud.sql.v1.PreCheckResponse.MessageType message_type = 3; + * + * @return Whether the messageType field is set. + */ + @java.lang.Override + public boolean hasMessageType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The type of message whether it is an info, warning, or error.
+   * 
+ * + * optional .google.cloud.sql.v1.PreCheckResponse.MessageType message_type = 3; + * + * @return The enum numeric value on the wire for messageType. + */ + @java.lang.Override + public int getMessageTypeValue() { + return messageType_; + } + + /** + * + * + *
+   * The type of message whether it is an info, warning, or error.
+   * 
+ * + * optional .google.cloud.sql.v1.PreCheckResponse.MessageType message_type = 3; + * + * @return The messageType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckResponse.MessageType getMessageType() { + com.google.cloud.sql.v1.PreCheckResponse.MessageType result = + com.google.cloud.sql.v1.PreCheckResponse.MessageType.forNumber(messageType_); + return result == null + ? com.google.cloud.sql.v1.PreCheckResponse.MessageType.UNRECOGNIZED + : result; + } + + public static final int ACTIONS_REQUIRED_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList actionsRequired_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @return A list containing the actionsRequired. + */ + public com.google.protobuf.ProtocolStringList getActionsRequiredList() { + return actionsRequired_; + } + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @return The count of actionsRequired. + */ + public int getActionsRequiredCount() { + return actionsRequired_.size(); + } + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @param index The index of the element to return. + * @return The actionsRequired at the given index. + */ + public java.lang.String getActionsRequired(int index) { + return actionsRequired_.get(index); + } + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @param index The index of the value to return. + * @return The bytes of the actionsRequired at the given index. + */ + public com.google.protobuf.ByteString getActionsRequiredBytes(int index) { + return actionsRequired_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, message_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeEnum(3, messageType_); + } + for (int i = 0; i < actionsRequired_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, actionsRequired_.getRaw(i)); + } + 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.GeneratedMessage.computeStringSize(2, message_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, messageType_); + } + { + int dataSize = 0; + for (int i = 0; i < actionsRequired_.size(); i++) { + dataSize += computeStringSizeNoTag(actionsRequired_.getRaw(i)); + } + size += dataSize; + size += 1 * getActionsRequiredList().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.sql.v1.PreCheckResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.PreCheckResponse other = (com.google.cloud.sql.v1.PreCheckResponse) obj; + + if (hasMessage() != other.hasMessage()) return false; + if (hasMessage()) { + if (!getMessage().equals(other.getMessage())) return false; + } + if (hasMessageType() != other.hasMessageType()) return false; + if (hasMessageType()) { + if (messageType_ != other.messageType_) return false; + } + if (!getActionsRequiredList().equals(other.getActionsRequiredList())) return false; + if (!getUnknownFields().equals(other.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 (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + if (hasMessageType()) { + hash = (37 * hash) + MESSAGE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + messageType_; + } + if (getActionsRequiredCount() > 0) { + hash = (37 * hash) + ACTIONS_REQUIRED_FIELD_NUMBER; + hash = (53 * hash) + getActionsRequiredList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.PreCheckResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PreCheckResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PreCheckResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PreCheckResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PreCheckResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PreCheckResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PreCheckResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PreCheckResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PreCheckResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PreCheckResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PreCheckResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PreCheckResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.PreCheckResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Structured PreCheckResponse containing message, type, and required
+   * actions.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PreCheckResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.PreCheckResponse) + com.google.cloud.sql.v1.PreCheckResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PreCheckResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PreCheckResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PreCheckResponse.class, + com.google.cloud.sql.v1.PreCheckResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.PreCheckResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + message_ = ""; + messageType_ = 0; + actionsRequired_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PreCheckResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1.PreCheckResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckResponse build() { + com.google.cloud.sql.v1.PreCheckResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckResponse buildPartial() { + com.google.cloud.sql.v1.PreCheckResponse result = + new com.google.cloud.sql.v1.PreCheckResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.PreCheckResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.message_ = message_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.messageType_ = messageType_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + actionsRequired_.makeImmutable(); + result.actionsRequired_ = actionsRequired_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.PreCheckResponse) { + return mergeFrom((com.google.cloud.sql.v1.PreCheckResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.PreCheckResponse other) { + if (other == com.google.cloud.sql.v1.PreCheckResponse.getDefaultInstance()) return this; + if (other.hasMessage()) { + message_ = other.message_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasMessageType()) { + setMessageTypeValue(other.getMessageTypeValue()); + } + if (!other.actionsRequired_.isEmpty()) { + if (actionsRequired_.isEmpty()) { + actionsRequired_ = other.actionsRequired_; + bitField0_ |= 0x00000004; + } else { + ensureActionsRequiredIsMutable(); + actionsRequired_.addAll(other.actionsRequired_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 18 + case 24: + { + messageType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 24 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureActionsRequiredIsMutable(); + actionsRequired_.add(s); + 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 message_ = ""; + + /** + * + * + *
+     * The message to be displayed to the user.
+     * 
+ * + * optional string message = 2; + * + * @return Whether the message field is set. + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The message to be displayed to the user.
+     * 
+ * + * optional string message = 2; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The message to be displayed to the user.
+     * 
+ * + * optional string message = 2; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The message to be displayed to the user.
+     * 
+ * + * optional string message = 2; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The message to be displayed to the user.
+     * 
+ * + * optional string message = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The message to be displayed to the user.
+     * 
+ * + * optional string message = 2; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int messageType_ = 0; + + /** + * + * + *
+     * The type of message whether it is an info, warning, or error.
+     * 
+ * + * optional .google.cloud.sql.v1.PreCheckResponse.MessageType message_type = 3; + * + * @return Whether the messageType field is set. + */ + @java.lang.Override + public boolean hasMessageType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The type of message whether it is an info, warning, or error.
+     * 
+ * + * optional .google.cloud.sql.v1.PreCheckResponse.MessageType message_type = 3; + * + * @return The enum numeric value on the wire for messageType. + */ + @java.lang.Override + public int getMessageTypeValue() { + return messageType_; + } + + /** + * + * + *
+     * The type of message whether it is an info, warning, or error.
+     * 
+ * + * optional .google.cloud.sql.v1.PreCheckResponse.MessageType message_type = 3; + * + * @param value The enum numeric value on the wire for messageType to set. + * @return This builder for chaining. + */ + public Builder setMessageTypeValue(int value) { + messageType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of message whether it is an info, warning, or error.
+     * 
+ * + * optional .google.cloud.sql.v1.PreCheckResponse.MessageType message_type = 3; + * + * @return The messageType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckResponse.MessageType getMessageType() { + com.google.cloud.sql.v1.PreCheckResponse.MessageType result = + com.google.cloud.sql.v1.PreCheckResponse.MessageType.forNumber(messageType_); + return result == null + ? com.google.cloud.sql.v1.PreCheckResponse.MessageType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The type of message whether it is an info, warning, or error.
+     * 
+ * + * optional .google.cloud.sql.v1.PreCheckResponse.MessageType message_type = 3; + * + * @param value The messageType to set. + * @return This builder for chaining. + */ + public Builder setMessageType(com.google.cloud.sql.v1.PreCheckResponse.MessageType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + messageType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of message whether it is an info, warning, or error.
+     * 
+ * + * optional .google.cloud.sql.v1.PreCheckResponse.MessageType message_type = 3; + * + * @return This builder for chaining. + */ + public Builder clearMessageType() { + bitField0_ = (bitField0_ & ~0x00000002); + messageType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList actionsRequired_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureActionsRequiredIsMutable() { + if (!actionsRequired_.isModifiable()) { + actionsRequired_ = new com.google.protobuf.LazyStringArrayList(actionsRequired_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @return A list containing the actionsRequired. + */ + public com.google.protobuf.ProtocolStringList getActionsRequiredList() { + actionsRequired_.makeImmutable(); + return actionsRequired_; + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @return The count of actionsRequired. + */ + public int getActionsRequiredCount() { + return actionsRequired_.size(); + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @param index The index of the element to return. + * @return The actionsRequired at the given index. + */ + public java.lang.String getActionsRequired(int index) { + return actionsRequired_.get(index); + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @param index The index of the value to return. + * @return The bytes of the actionsRequired at the given index. + */ + public com.google.protobuf.ByteString getActionsRequiredBytes(int index) { + return actionsRequired_.getByteString(index); + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @param index The index to set the value at. + * @param value The actionsRequired to set. + * @return This builder for chaining. + */ + public Builder setActionsRequired(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionsRequiredIsMutable(); + actionsRequired_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @param value The actionsRequired to add. + * @return This builder for chaining. + */ + public Builder addActionsRequired(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionsRequiredIsMutable(); + actionsRequired_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @param values The actionsRequired to add. + * @return This builder for chaining. + */ + public Builder addAllActionsRequired(java.lang.Iterable values) { + ensureActionsRequiredIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, actionsRequired_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @return This builder for chaining. + */ + public Builder clearActionsRequired() { + actionsRequired_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @param value The bytes of the actionsRequired to add. + * @return This builder for chaining. + */ + public Builder addActionsRequiredBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureActionsRequiredIsMutable(); + actionsRequired_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.PreCheckResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.PreCheckResponse) + private static final com.google.cloud.sql.v1.PreCheckResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.PreCheckResponse(); + } + + public static com.google.cloud.sql.v1.PreCheckResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PreCheckResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PreCheckResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PreCheckResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PreCheckResponseOrBuilder.java new file mode 100644 index 000000000000..dfc484312d17 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PreCheckResponseOrBuilder.java @@ -0,0 +1,164 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface PreCheckResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.PreCheckResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The message to be displayed to the user.
+   * 
+ * + * optional string message = 2; + * + * @return Whether the message field is set. + */ + boolean hasMessage(); + + /** + * + * + *
+   * The message to be displayed to the user.
+   * 
+ * + * optional string message = 2; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
+   * The message to be displayed to the user.
+   * 
+ * + * optional string message = 2; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
+   * The type of message whether it is an info, warning, or error.
+   * 
+ * + * optional .google.cloud.sql.v1.PreCheckResponse.MessageType message_type = 3; + * + * @return Whether the messageType field is set. + */ + boolean hasMessageType(); + + /** + * + * + *
+   * The type of message whether it is an info, warning, or error.
+   * 
+ * + * optional .google.cloud.sql.v1.PreCheckResponse.MessageType message_type = 3; + * + * @return The enum numeric value on the wire for messageType. + */ + int getMessageTypeValue(); + + /** + * + * + *
+   * The type of message whether it is an info, warning, or error.
+   * 
+ * + * optional .google.cloud.sql.v1.PreCheckResponse.MessageType message_type = 3; + * + * @return The messageType. + */ + com.google.cloud.sql.v1.PreCheckResponse.MessageType getMessageType(); + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @return A list containing the actionsRequired. + */ + java.util.List getActionsRequiredList(); + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @return The count of actionsRequired. + */ + int getActionsRequiredCount(); + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @param index The index of the element to return. + * @return The actionsRequired at the given index. + */ + java.lang.String getActionsRequired(int index); + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @param index The index of the value to return. + * @return The bytes of the actionsRequired at the given index. + */ + com.google.protobuf.ByteString getActionsRequiredBytes(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ProjectName.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ProjectName.java new file mode 100644 index 000000000000..f007be5a5900 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ProjectName.java @@ -0,0 +1,171 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.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; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@NullMarked +@Generated("by gapic-generator-java") +public class ProjectName implements ResourceName { + private static final PathTemplate PROJECT = + PathTemplate.createWithoutUrlEncoding("projects/{project}"); + private volatile Map fieldValuesMap; + private final String project; + + @Deprecated + protected ProjectName() { + project = null; + } + + private ProjectName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + } + + public String getProject() { + return project; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProjectName of(String project) { + return newBuilder().setProject(project).build(); + } + + public static String format(String project) { + return newBuilder().setProject(project).build().toString(); + } + + public static @Nullable ProjectName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT.validatedMatch( + formattedString, "ProjectName.parse: formattedString not in valid format"); + return of(matchMap.get("project")); + } + + 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<@Nullable ProjectName> values) { + List list = new ArrayList<>(values.size()); + for (ProjectName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT.instantiate("project", project); + } + + @Override + public boolean equals(@Nullable Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ProjectName that = ((ProjectName) o); + return Objects.equals(this.project, that.project); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + return h; + } + + /** Builder for projects/{project}. */ + public static class Builder { + private String project; + + protected Builder() {} + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder(ProjectName projectName) { + this.project = projectName.project; + } + + public ProjectName build() { + return new ProjectName(this); + } + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PscAutoConnectionConfig.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PscAutoConnectionConfig.java new file mode 100644 index 000000000000..9cd263714eb2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PscAutoConnectionConfig.java @@ -0,0 +1,2500 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Settings for an automatically-setup Private Service Connect consumer endpoint
+ * that is used to connect to a Cloud SQL instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PscAutoConnectionConfig} + */ +@com.google.protobuf.Generated +public final class PscAutoConnectionConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.PscAutoConnectionConfig) + PscAutoConnectionConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PscAutoConnectionConfig"); + } + + // Use PscAutoConnectionConfig.newBuilder() to construct. + private PscAutoConnectionConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PscAutoConnectionConfig() { + consumerProject_ = ""; + consumerNetwork_ = ""; + ipAddress_ = ""; + status_ = ""; + consumerNetworkStatus_ = ""; + serviceConnectionPolicy_ = ""; + serviceConnectionPolicyCreationResult_ = ""; + instanceAutoDnsStatus_ = 0; + writeEndpointAutoDnsStatus_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PscAutoConnectionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PscAutoConnectionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PscAutoConnectionConfig.class, + com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder.class); + } + + private int bitField0_; + public static final int CONSUMER_PROJECT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object consumerProject_ = ""; + + /** + * + * + *
+   * Optional. This is the project ID of consumer service project of this
+   * consumer endpoint.
+   *
+   * This is only applicable if `consumer_network` is a shared VPC
+   * network.
+   * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The consumerProject. + */ + @java.lang.Override + public java.lang.String getConsumerProject() { + java.lang.Object ref = consumerProject_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerProject_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. This is the project ID of consumer service project of this
+   * consumer endpoint.
+   *
+   * This is only applicable if `consumer_network` is a shared VPC
+   * network.
+   * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for consumerProject. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConsumerProjectBytes() { + java.lang.Object ref = consumerProject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONSUMER_NETWORK_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object consumerNetwork_ = ""; + + /** + * + * + *
+   * Optional. The consumer network of this consumer endpoint. This must be a
+   * resource path that includes both the host project and the network name.
+   *
+   * For example, `projects/project1/global/networks/network1`.
+   *
+   * The consumer host project of this network might be different from the
+   * consumer service project.
+   * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The consumerNetwork. + */ + @java.lang.Override + public java.lang.String getConsumerNetwork() { + java.lang.Object ref = consumerNetwork_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerNetwork_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The consumer network of this consumer endpoint. This must be a
+   * resource path that includes both the host project and the network name.
+   *
+   * For example, `projects/project1/global/networks/network1`.
+   *
+   * The consumer host project of this network might be different from the
+   * consumer service project.
+   * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for consumerNetwork. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConsumerNetworkBytes() { + java.lang.Object ref = consumerNetwork_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipAddress_ = ""; + + /** + * + * + *
+   * The IP address of the consumer endpoint.
+   * 
+ * + * optional string ip_address = 3 [(.google.api.field_info) = { ... } + * + * @return Whether the ipAddress field is set. + */ + @java.lang.Override + public boolean hasIpAddress() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The IP address of the consumer endpoint.
+   * 
+ * + * optional string ip_address = 3 [(.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; + } + } + + /** + * + * + *
+   * The IP address of the consumer endpoint.
+   * 
+ * + * optional string ip_address = 3 [(.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 STATUS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object status_ = ""; + + /** + * + * + *
+   * The connection status of the consumer endpoint.
+   * 
+ * + * optional string status = 4; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The connection status of the consumer endpoint.
+   * 
+ * + * optional string status = 4; + * + * @return The status. + */ + @java.lang.Override + public java.lang.String getStatus() { + java.lang.Object ref = status_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + status_ = s; + return s; + } + } + + /** + * + * + *
+   * The connection status of the consumer endpoint.
+   * 
+ * + * optional string status = 4; + * + * @return The bytes for status. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusBytes() { + java.lang.Object ref = status_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + status_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONSUMER_NETWORK_STATUS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object consumerNetworkStatus_ = ""; + + /** + * + * + *
+   * The connection policy status of the consumer network.
+   * 
+ * + * optional string consumer_network_status = 5; + * + * @return Whether the consumerNetworkStatus field is set. + */ + @java.lang.Override + public boolean hasConsumerNetworkStatus() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The connection policy status of the consumer network.
+   * 
+ * + * optional string consumer_network_status = 5; + * + * @return The consumerNetworkStatus. + */ + @java.lang.Override + public java.lang.String getConsumerNetworkStatus() { + java.lang.Object ref = consumerNetworkStatus_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerNetworkStatus_ = s; + return s; + } + } + + /** + * + * + *
+   * The connection policy status of the consumer network.
+   * 
+ * + * optional string consumer_network_status = 5; + * + * @return The bytes for consumerNetworkStatus. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConsumerNetworkStatusBytes() { + java.lang.Object ref = consumerNetworkStatus_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerNetworkStatus_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_CONNECTION_POLICY_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceConnectionPolicy_ = ""; + + /** + * + * + *
+   * Output only. The service connection policy created automatically for the
+   * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+   * in the format of:
+   * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+   * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+   * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the serviceConnectionPolicy field is set. + */ + @java.lang.Override + public boolean hasServiceConnectionPolicy() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Output only. The service connection policy created automatically for the
+   * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+   * in the format of:
+   * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+   * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+   * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceConnectionPolicy. + */ + @java.lang.Override + public java.lang.String getServiceConnectionPolicy() { + java.lang.Object ref = serviceConnectionPolicy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceConnectionPolicy_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The service connection policy created automatically for the
+   * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+   * in the format of:
+   * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+   * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+   * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceConnectionPolicy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceConnectionPolicyBytes() { + java.lang.Object ref = serviceConnectionPolicy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConnectionPolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_CONNECTION_POLICY_CREATION_RESULT_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceConnectionPolicyCreationResult_ = ""; + + /** + * + * + *
+   * Output only. The status of service connection policy creation.
+   * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the serviceConnectionPolicyCreationResult field is set. + */ + @java.lang.Override + public boolean hasServiceConnectionPolicyCreationResult() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Output only. The status of service connection policy creation.
+   * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The serviceConnectionPolicyCreationResult. + */ + @java.lang.Override + public java.lang.String getServiceConnectionPolicyCreationResult() { + java.lang.Object ref = serviceConnectionPolicyCreationResult_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceConnectionPolicyCreationResult_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The status of service connection policy creation.
+   * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for serviceConnectionPolicyCreationResult. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceConnectionPolicyCreationResultBytes() { + java.lang.Object ref = serviceConnectionPolicyCreationResult_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConnectionPolicyCreationResult_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_AUTO_DNS_STATUS_FIELD_NUMBER = 8; + private int instanceAutoDnsStatus_ = 0; + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning.
+   * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceAutoDnsStatus field is set. + */ + @java.lang.Override + public boolean hasInstanceAutoDnsStatus() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning.
+   * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for instanceAutoDnsStatus. + */ + @java.lang.Override + public int getInstanceAutoDnsStatusValue() { + return instanceAutoDnsStatus_; + } + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning.
+   * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceAutoDnsStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1.AutoDnsStatus getInstanceAutoDnsStatus() { + com.google.cloud.sql.v1.AutoDnsStatus result = + com.google.cloud.sql.v1.AutoDnsStatus.forNumber(instanceAutoDnsStatus_); + return result == null ? com.google.cloud.sql.v1.AutoDnsStatus.UNRECOGNIZED : result; + } + + public static final int WRITE_ENDPOINT_AUTO_DNS_STATUS_FIELD_NUMBER = 9; + private int writeEndpointAutoDnsStatus_ = 0; + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning for the write
+   * endpoint.
+   * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writeEndpointAutoDnsStatus field is set. + */ + @java.lang.Override + public boolean hasWriteEndpointAutoDnsStatus() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning for the write
+   * endpoint.
+   * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for writeEndpointAutoDnsStatus. + */ + @java.lang.Override + public int getWriteEndpointAutoDnsStatusValue() { + return writeEndpointAutoDnsStatus_; + } + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning for the write
+   * endpoint.
+   * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writeEndpointAutoDnsStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1.AutoDnsStatus getWriteEndpointAutoDnsStatus() { + com.google.cloud.sql.v1.AutoDnsStatus result = + com.google.cloud.sql.v1.AutoDnsStatus.forNumber(writeEndpointAutoDnsStatus_); + return result == null ? com.google.cloud.sql.v1.AutoDnsStatus.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.GeneratedMessage.isStringEmpty(consumerProject_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, consumerProject_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(consumerNetwork_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, consumerNetwork_); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, ipAddress_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, status_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, consumerNetworkStatus_); + } + if (((bitField0_ & 0x00000008) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, serviceConnectionPolicy_); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessage.writeString( + output, 7, serviceConnectionPolicyCreationResult_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeEnum(8, instanceAutoDnsStatus_); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeEnum(9, writeEndpointAutoDnsStatus_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(consumerProject_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, consumerProject_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(consumerNetwork_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, consumerNetwork_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, ipAddress_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, status_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, consumerNetworkStatus_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, serviceConnectionPolicy_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.GeneratedMessage.computeStringSize( + 7, serviceConnectionPolicyCreationResult_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, instanceAutoDnsStatus_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, writeEndpointAutoDnsStatus_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.PscAutoConnectionConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.PscAutoConnectionConfig other = + (com.google.cloud.sql.v1.PscAutoConnectionConfig) obj; + + if (!getConsumerProject().equals(other.getConsumerProject())) return false; + if (!getConsumerNetwork().equals(other.getConsumerNetwork())) return false; + if (hasIpAddress() != other.hasIpAddress()) return false; + if (hasIpAddress()) { + if (!getIpAddress().equals(other.getIpAddress())) return false; + } + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (hasConsumerNetworkStatus() != other.hasConsumerNetworkStatus()) return false; + if (hasConsumerNetworkStatus()) { + if (!getConsumerNetworkStatus().equals(other.getConsumerNetworkStatus())) return false; + } + if (hasServiceConnectionPolicy() != other.hasServiceConnectionPolicy()) return false; + if (hasServiceConnectionPolicy()) { + if (!getServiceConnectionPolicy().equals(other.getServiceConnectionPolicy())) return false; + } + if (hasServiceConnectionPolicyCreationResult() + != other.hasServiceConnectionPolicyCreationResult()) return false; + if (hasServiceConnectionPolicyCreationResult()) { + if (!getServiceConnectionPolicyCreationResult() + .equals(other.getServiceConnectionPolicyCreationResult())) return false; + } + if (hasInstanceAutoDnsStatus() != other.hasInstanceAutoDnsStatus()) return false; + if (hasInstanceAutoDnsStatus()) { + if (instanceAutoDnsStatus_ != other.instanceAutoDnsStatus_) return false; + } + if (hasWriteEndpointAutoDnsStatus() != other.hasWriteEndpointAutoDnsStatus()) return false; + if (hasWriteEndpointAutoDnsStatus()) { + if (writeEndpointAutoDnsStatus_ != other.writeEndpointAutoDnsStatus_) return false; + } + if (!getUnknownFields().equals(other.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) + CONSUMER_PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getConsumerProject().hashCode(); + hash = (37 * hash) + CONSUMER_NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getConsumerNetwork().hashCode(); + if (hasIpAddress()) { + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (hasConsumerNetworkStatus()) { + hash = (37 * hash) + CONSUMER_NETWORK_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getConsumerNetworkStatus().hashCode(); + } + if (hasServiceConnectionPolicy()) { + hash = (37 * hash) + SERVICE_CONNECTION_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getServiceConnectionPolicy().hashCode(); + } + if (hasServiceConnectionPolicyCreationResult()) { + hash = (37 * hash) + SERVICE_CONNECTION_POLICY_CREATION_RESULT_FIELD_NUMBER; + hash = (53 * hash) + getServiceConnectionPolicyCreationResult().hashCode(); + } + if (hasInstanceAutoDnsStatus()) { + hash = (37 * hash) + INSTANCE_AUTO_DNS_STATUS_FIELD_NUMBER; + hash = (53 * hash) + instanceAutoDnsStatus_; + } + if (hasWriteEndpointAutoDnsStatus()) { + hash = (37 * hash) + WRITE_ENDPOINT_AUTO_DNS_STATUS_FIELD_NUMBER; + hash = (53 * hash) + writeEndpointAutoDnsStatus_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.PscAutoConnectionConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PscAutoConnectionConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PscAutoConnectionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PscAutoConnectionConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PscAutoConnectionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PscAutoConnectionConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PscAutoConnectionConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PscAutoConnectionConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PscAutoConnectionConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PscAutoConnectionConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PscAutoConnectionConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PscAutoConnectionConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.PscAutoConnectionConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Settings for an automatically-setup Private Service Connect consumer endpoint
+   * that is used to connect to a Cloud SQL instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PscAutoConnectionConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.PscAutoConnectionConfig) + com.google.cloud.sql.v1.PscAutoConnectionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PscAutoConnectionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PscAutoConnectionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PscAutoConnectionConfig.class, + com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.PscAutoConnectionConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + consumerProject_ = ""; + consumerNetwork_ = ""; + ipAddress_ = ""; + status_ = ""; + consumerNetworkStatus_ = ""; + serviceConnectionPolicy_ = ""; + serviceConnectionPolicyCreationResult_ = ""; + instanceAutoDnsStatus_ = 0; + writeEndpointAutoDnsStatus_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PscAutoConnectionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PscAutoConnectionConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.PscAutoConnectionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.PscAutoConnectionConfig build() { + com.google.cloud.sql.v1.PscAutoConnectionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PscAutoConnectionConfig buildPartial() { + com.google.cloud.sql.v1.PscAutoConnectionConfig result = + new com.google.cloud.sql.v1.PscAutoConnectionConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.PscAutoConnectionConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.consumerProject_ = consumerProject_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.consumerNetwork_ = consumerNetwork_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ipAddress_ = ipAddress_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.status_ = status_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.consumerNetworkStatus_ = consumerNetworkStatus_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.serviceConnectionPolicy_ = serviceConnectionPolicy_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.serviceConnectionPolicyCreationResult_ = serviceConnectionPolicyCreationResult_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.instanceAutoDnsStatus_ = instanceAutoDnsStatus_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.writeEndpointAutoDnsStatus_ = writeEndpointAutoDnsStatus_; + to_bitField0_ |= 0x00000040; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.PscAutoConnectionConfig) { + return mergeFrom((com.google.cloud.sql.v1.PscAutoConnectionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.PscAutoConnectionConfig other) { + if (other == com.google.cloud.sql.v1.PscAutoConnectionConfig.getDefaultInstance()) + return this; + if (!other.getConsumerProject().isEmpty()) { + consumerProject_ = other.consumerProject_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getConsumerNetwork().isEmpty()) { + consumerNetwork_ = other.consumerNetwork_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasIpAddress()) { + ipAddress_ = other.ipAddress_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasStatus()) { + status_ = other.status_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasConsumerNetworkStatus()) { + consumerNetworkStatus_ = other.consumerNetworkStatus_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasServiceConnectionPolicy()) { + serviceConnectionPolicy_ = other.serviceConnectionPolicy_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasServiceConnectionPolicyCreationResult()) { + serviceConnectionPolicyCreationResult_ = other.serviceConnectionPolicyCreationResult_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasInstanceAutoDnsStatus()) { + setInstanceAutoDnsStatusValue(other.getInstanceAutoDnsStatusValue()); + } + if (other.hasWriteEndpointAutoDnsStatus()) { + setWriteEndpointAutoDnsStatusValue(other.getWriteEndpointAutoDnsStatusValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + consumerProject_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + consumerNetwork_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + ipAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + status_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + consumerNetworkStatus_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + serviceConnectionPolicy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + serviceConnectionPolicyCreationResult_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: + { + instanceAutoDnsStatus_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: + { + writeEndpointAutoDnsStatus_ = input.readEnum(); + bitField0_ |= 0x00000100; + 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 bitField0_; + + private java.lang.Object consumerProject_ = ""; + + /** + * + * + *
+     * Optional. This is the project ID of consumer service project of this
+     * consumer endpoint.
+     *
+     * This is only applicable if `consumer_network` is a shared VPC
+     * network.
+     * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The consumerProject. + */ + public java.lang.String getConsumerProject() { + java.lang.Object ref = consumerProject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerProject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. This is the project ID of consumer service project of this
+     * consumer endpoint.
+     *
+     * This is only applicable if `consumer_network` is a shared VPC
+     * network.
+     * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for consumerProject. + */ + public com.google.protobuf.ByteString getConsumerProjectBytes() { + java.lang.Object ref = consumerProject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. This is the project ID of consumer service project of this
+     * consumer endpoint.
+     *
+     * This is only applicable if `consumer_network` is a shared VPC
+     * network.
+     * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The consumerProject to set. + * @return This builder for chaining. + */ + public Builder setConsumerProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + consumerProject_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is the project ID of consumer service project of this
+     * consumer endpoint.
+     *
+     * This is only applicable if `consumer_network` is a shared VPC
+     * network.
+     * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearConsumerProject() { + consumerProject_ = getDefaultInstance().getConsumerProject(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is the project ID of consumer service project of this
+     * consumer endpoint.
+     *
+     * This is only applicable if `consumer_network` is a shared VPC
+     * network.
+     * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for consumerProject to set. + * @return This builder for chaining. + */ + public Builder setConsumerProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + consumerProject_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object consumerNetwork_ = ""; + + /** + * + * + *
+     * Optional. The consumer network of this consumer endpoint. This must be a
+     * resource path that includes both the host project and the network name.
+     *
+     * For example, `projects/project1/global/networks/network1`.
+     *
+     * The consumer host project of this network might be different from the
+     * consumer service project.
+     * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The consumerNetwork. + */ + public java.lang.String getConsumerNetwork() { + java.lang.Object ref = consumerNetwork_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerNetwork_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The consumer network of this consumer endpoint. This must be a
+     * resource path that includes both the host project and the network name.
+     *
+     * For example, `projects/project1/global/networks/network1`.
+     *
+     * The consumer host project of this network might be different from the
+     * consumer service project.
+     * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for consumerNetwork. + */ + public com.google.protobuf.ByteString getConsumerNetworkBytes() { + java.lang.Object ref = consumerNetwork_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The consumer network of this consumer endpoint. This must be a
+     * resource path that includes both the host project and the network name.
+     *
+     * For example, `projects/project1/global/networks/network1`.
+     *
+     * The consumer host project of this network might be different from the
+     * consumer service project.
+     * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The consumerNetwork to set. + * @return This builder for chaining. + */ + public Builder setConsumerNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + consumerNetwork_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The consumer network of this consumer endpoint. This must be a
+     * resource path that includes both the host project and the network name.
+     *
+     * For example, `projects/project1/global/networks/network1`.
+     *
+     * The consumer host project of this network might be different from the
+     * consumer service project.
+     * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearConsumerNetwork() { + consumerNetwork_ = getDefaultInstance().getConsumerNetwork(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The consumer network of this consumer endpoint. This must be a
+     * resource path that includes both the host project and the network name.
+     *
+     * For example, `projects/project1/global/networks/network1`.
+     *
+     * The consumer host project of this network might be different from the
+     * consumer service project.
+     * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for consumerNetwork to set. + * @return This builder for chaining. + */ + public Builder setConsumerNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + consumerNetwork_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + + /** + * + * + *
+     * The IP address of the consumer endpoint.
+     * 
+ * + * optional string ip_address = 3 [(.google.api.field_info) = { ... } + * + * @return Whether the ipAddress field is set. + */ + public boolean hasIpAddress() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The IP address of the consumer endpoint.
+     * 
+ * + * optional string ip_address = 3 [(.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; + } + } + + /** + * + * + *
+     * The IP address of the consumer endpoint.
+     * 
+ * + * optional string ip_address = 3 [(.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; + } + } + + /** + * + * + *
+     * The IP address of the consumer endpoint.
+     * 
+ * + * optional string ip_address = 3 [(.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; + } + + /** + * + * + *
+     * The IP address of the consumer endpoint.
+     * 
+ * + * optional string ip_address = 3 [(.google.api.field_info) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + ipAddress_ = getDefaultInstance().getIpAddress(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The IP address of the consumer endpoint.
+     * 
+ * + * optional string ip_address = 3 [(.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 status_ = ""; + + /** + * + * + *
+     * The connection status of the consumer endpoint.
+     * 
+ * + * optional string status = 4; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * The connection status of the consumer endpoint.
+     * 
+ * + * optional string status = 4; + * + * @return The status. + */ + public java.lang.String getStatus() { + java.lang.Object ref = status_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + status_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The connection status of the consumer endpoint.
+     * 
+ * + * optional string status = 4; + * + * @return The bytes for status. + */ + public com.google.protobuf.ByteString getStatusBytes() { + java.lang.Object ref = status_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + status_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The connection status of the consumer endpoint.
+     * 
+ * + * optional string status = 4; + * + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The connection status of the consumer endpoint.
+     * 
+ * + * optional string status = 4; + * + * @return This builder for chaining. + */ + public Builder clearStatus() { + status_ = getDefaultInstance().getStatus(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The connection status of the consumer endpoint.
+     * 
+ * + * optional string status = 4; + * + * @param value The bytes for status to set. + * @return This builder for chaining. + */ + public Builder setStatusBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + status_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object consumerNetworkStatus_ = ""; + + /** + * + * + *
+     * The connection policy status of the consumer network.
+     * 
+ * + * optional string consumer_network_status = 5; + * + * @return Whether the consumerNetworkStatus field is set. + */ + public boolean hasConsumerNetworkStatus() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The connection policy status of the consumer network.
+     * 
+ * + * optional string consumer_network_status = 5; + * + * @return The consumerNetworkStatus. + */ + public java.lang.String getConsumerNetworkStatus() { + java.lang.Object ref = consumerNetworkStatus_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerNetworkStatus_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The connection policy status of the consumer network.
+     * 
+ * + * optional string consumer_network_status = 5; + * + * @return The bytes for consumerNetworkStatus. + */ + public com.google.protobuf.ByteString getConsumerNetworkStatusBytes() { + java.lang.Object ref = consumerNetworkStatus_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerNetworkStatus_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The connection policy status of the consumer network.
+     * 
+ * + * optional string consumer_network_status = 5; + * + * @param value The consumerNetworkStatus to set. + * @return This builder for chaining. + */ + public Builder setConsumerNetworkStatus(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + consumerNetworkStatus_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The connection policy status of the consumer network.
+     * 
+ * + * optional string consumer_network_status = 5; + * + * @return This builder for chaining. + */ + public Builder clearConsumerNetworkStatus() { + consumerNetworkStatus_ = getDefaultInstance().getConsumerNetworkStatus(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * The connection policy status of the consumer network.
+     * 
+ * + * optional string consumer_network_status = 5; + * + * @param value The bytes for consumerNetworkStatus to set. + * @return This builder for chaining. + */ + public Builder setConsumerNetworkStatusBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + consumerNetworkStatus_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object serviceConnectionPolicy_ = ""; + + /** + * + * + *
+     * Output only. The service connection policy created automatically for the
+     * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+     * in the format of:
+     * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+     * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+     * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the serviceConnectionPolicy field is set. + */ + public boolean hasServiceConnectionPolicy() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Output only. The service connection policy created automatically for the
+     * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+     * in the format of:
+     * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+     * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+     * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceConnectionPolicy. + */ + public java.lang.String getServiceConnectionPolicy() { + java.lang.Object ref = serviceConnectionPolicy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceConnectionPolicy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The service connection policy created automatically for the
+     * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+     * in the format of:
+     * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+     * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+     * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceConnectionPolicy. + */ + public com.google.protobuf.ByteString getServiceConnectionPolicyBytes() { + java.lang.Object ref = serviceConnectionPolicy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConnectionPolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The service connection policy created automatically for the
+     * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+     * in the format of:
+     * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+     * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+     * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The serviceConnectionPolicy to set. + * @return This builder for chaining. + */ + public Builder setServiceConnectionPolicy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceConnectionPolicy_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The service connection policy created automatically for the
+     * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+     * in the format of:
+     * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+     * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+     * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearServiceConnectionPolicy() { + serviceConnectionPolicy_ = getDefaultInstance().getServiceConnectionPolicy(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The service connection policy created automatically for the
+     * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+     * in the format of:
+     * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+     * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+     * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for serviceConnectionPolicy to set. + * @return This builder for chaining. + */ + public Builder setServiceConnectionPolicyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceConnectionPolicy_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object serviceConnectionPolicyCreationResult_ = ""; + + /** + * + * + *
+     * Output only. The status of service connection policy creation.
+     * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the serviceConnectionPolicyCreationResult field is set. + */ + public boolean hasServiceConnectionPolicyCreationResult() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Output only. The status of service connection policy creation.
+     * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The serviceConnectionPolicyCreationResult. + */ + public java.lang.String getServiceConnectionPolicyCreationResult() { + java.lang.Object ref = serviceConnectionPolicyCreationResult_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceConnectionPolicyCreationResult_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The status of service connection policy creation.
+     * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for serviceConnectionPolicyCreationResult. + */ + public com.google.protobuf.ByteString getServiceConnectionPolicyCreationResultBytes() { + java.lang.Object ref = serviceConnectionPolicyCreationResult_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConnectionPolicyCreationResult_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The status of service connection policy creation.
+     * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The serviceConnectionPolicyCreationResult to set. + * @return This builder for chaining. + */ + public Builder setServiceConnectionPolicyCreationResult(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceConnectionPolicyCreationResult_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of service connection policy creation.
+     * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearServiceConnectionPolicyCreationResult() { + serviceConnectionPolicyCreationResult_ = + getDefaultInstance().getServiceConnectionPolicyCreationResult(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of service connection policy creation.
+     * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for serviceConnectionPolicyCreationResult to set. + * @return This builder for chaining. + */ + public Builder setServiceConnectionPolicyCreationResultBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceConnectionPolicyCreationResult_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private int instanceAutoDnsStatus_ = 0; + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning.
+     * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceAutoDnsStatus field is set. + */ + @java.lang.Override + public boolean hasInstanceAutoDnsStatus() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning.
+     * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for instanceAutoDnsStatus. + */ + @java.lang.Override + public int getInstanceAutoDnsStatusValue() { + return instanceAutoDnsStatus_; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning.
+     * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for instanceAutoDnsStatus to set. + * @return This builder for chaining. + */ + public Builder setInstanceAutoDnsStatusValue(int value) { + instanceAutoDnsStatus_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning.
+     * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceAutoDnsStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1.AutoDnsStatus getInstanceAutoDnsStatus() { + com.google.cloud.sql.v1.AutoDnsStatus result = + com.google.cloud.sql.v1.AutoDnsStatus.forNumber(instanceAutoDnsStatus_); + return result == null ? com.google.cloud.sql.v1.AutoDnsStatus.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning.
+     * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The instanceAutoDnsStatus to set. + * @return This builder for chaining. + */ + public Builder setInstanceAutoDnsStatus(com.google.cloud.sql.v1.AutoDnsStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + instanceAutoDnsStatus_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning.
+     * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearInstanceAutoDnsStatus() { + bitField0_ = (bitField0_ & ~0x00000080); + instanceAutoDnsStatus_ = 0; + onChanged(); + return this; + } + + private int writeEndpointAutoDnsStatus_ = 0; + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning for the write
+     * endpoint.
+     * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writeEndpointAutoDnsStatus field is set. + */ + @java.lang.Override + public boolean hasWriteEndpointAutoDnsStatus() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning for the write
+     * endpoint.
+     * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for writeEndpointAutoDnsStatus. + */ + @java.lang.Override + public int getWriteEndpointAutoDnsStatusValue() { + return writeEndpointAutoDnsStatus_; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning for the write
+     * endpoint.
+     * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for writeEndpointAutoDnsStatus to set. + * @return This builder for chaining. + */ + public Builder setWriteEndpointAutoDnsStatusValue(int value) { + writeEndpointAutoDnsStatus_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning for the write
+     * endpoint.
+     * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writeEndpointAutoDnsStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1.AutoDnsStatus getWriteEndpointAutoDnsStatus() { + com.google.cloud.sql.v1.AutoDnsStatus result = + com.google.cloud.sql.v1.AutoDnsStatus.forNumber(writeEndpointAutoDnsStatus_); + return result == null ? com.google.cloud.sql.v1.AutoDnsStatus.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning for the write
+     * endpoint.
+     * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The writeEndpointAutoDnsStatus to set. + * @return This builder for chaining. + */ + public Builder setWriteEndpointAutoDnsStatus(com.google.cloud.sql.v1.AutoDnsStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + writeEndpointAutoDnsStatus_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning for the write
+     * endpoint.
+     * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearWriteEndpointAutoDnsStatus() { + bitField0_ = (bitField0_ & ~0x00000100); + writeEndpointAutoDnsStatus_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.PscAutoConnectionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.PscAutoConnectionConfig) + private static final com.google.cloud.sql.v1.PscAutoConnectionConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.PscAutoConnectionConfig(); + } + + public static com.google.cloud.sql.v1.PscAutoConnectionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PscAutoConnectionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PscAutoConnectionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PscAutoConnectionConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PscAutoConnectionConfigOrBuilder.java new file mode 100644 index 000000000000..41f12209f91b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PscAutoConnectionConfigOrBuilder.java @@ -0,0 +1,412 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface PscAutoConnectionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.PscAutoConnectionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. This is the project ID of consumer service project of this
+   * consumer endpoint.
+   *
+   * This is only applicable if `consumer_network` is a shared VPC
+   * network.
+   * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The consumerProject. + */ + java.lang.String getConsumerProject(); + + /** + * + * + *
+   * Optional. This is the project ID of consumer service project of this
+   * consumer endpoint.
+   *
+   * This is only applicable if `consumer_network` is a shared VPC
+   * network.
+   * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for consumerProject. + */ + com.google.protobuf.ByteString getConsumerProjectBytes(); + + /** + * + * + *
+   * Optional. The consumer network of this consumer endpoint. This must be a
+   * resource path that includes both the host project and the network name.
+   *
+   * For example, `projects/project1/global/networks/network1`.
+   *
+   * The consumer host project of this network might be different from the
+   * consumer service project.
+   * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The consumerNetwork. + */ + java.lang.String getConsumerNetwork(); + + /** + * + * + *
+   * Optional. The consumer network of this consumer endpoint. This must be a
+   * resource path that includes both the host project and the network name.
+   *
+   * For example, `projects/project1/global/networks/network1`.
+   *
+   * The consumer host project of this network might be different from the
+   * consumer service project.
+   * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for consumerNetwork. + */ + com.google.protobuf.ByteString getConsumerNetworkBytes(); + + /** + * + * + *
+   * The IP address of the consumer endpoint.
+   * 
+ * + * optional string ip_address = 3 [(.google.api.field_info) = { ... } + * + * @return Whether the ipAddress field is set. + */ + boolean hasIpAddress(); + + /** + * + * + *
+   * The IP address of the consumer endpoint.
+   * 
+ * + * optional string ip_address = 3 [(.google.api.field_info) = { ... } + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + + /** + * + * + *
+   * The IP address of the consumer endpoint.
+   * 
+ * + * optional string ip_address = 3 [(.google.api.field_info) = { ... } + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * The connection status of the consumer endpoint.
+   * 
+ * + * optional string status = 4; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+   * The connection status of the consumer endpoint.
+   * 
+ * + * optional string status = 4; + * + * @return The status. + */ + java.lang.String getStatus(); + + /** + * + * + *
+   * The connection status of the consumer endpoint.
+   * 
+ * + * optional string status = 4; + * + * @return The bytes for status. + */ + com.google.protobuf.ByteString getStatusBytes(); + + /** + * + * + *
+   * The connection policy status of the consumer network.
+   * 
+ * + * optional string consumer_network_status = 5; + * + * @return Whether the consumerNetworkStatus field is set. + */ + boolean hasConsumerNetworkStatus(); + + /** + * + * + *
+   * The connection policy status of the consumer network.
+   * 
+ * + * optional string consumer_network_status = 5; + * + * @return The consumerNetworkStatus. + */ + java.lang.String getConsumerNetworkStatus(); + + /** + * + * + *
+   * The connection policy status of the consumer network.
+   * 
+ * + * optional string consumer_network_status = 5; + * + * @return The bytes for consumerNetworkStatus. + */ + com.google.protobuf.ByteString getConsumerNetworkStatusBytes(); + + /** + * + * + *
+   * Output only. The service connection policy created automatically for the
+   * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+   * in the format of:
+   * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+   * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+   * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the serviceConnectionPolicy field is set. + */ + boolean hasServiceConnectionPolicy(); + + /** + * + * + *
+   * Output only. The service connection policy created automatically for the
+   * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+   * in the format of:
+   * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+   * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+   * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceConnectionPolicy. + */ + java.lang.String getServiceConnectionPolicy(); + + /** + * + * + *
+   * Output only. The service connection policy created automatically for the
+   * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+   * in the format of:
+   * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+   * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+   * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceConnectionPolicy. + */ + com.google.protobuf.ByteString getServiceConnectionPolicyBytes(); + + /** + * + * + *
+   * Output only. The status of service connection policy creation.
+   * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the serviceConnectionPolicyCreationResult field is set. + */ + boolean hasServiceConnectionPolicyCreationResult(); + + /** + * + * + *
+   * Output only. The status of service connection policy creation.
+   * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The serviceConnectionPolicyCreationResult. + */ + java.lang.String getServiceConnectionPolicyCreationResult(); + + /** + * + * + *
+   * Output only. The status of service connection policy creation.
+   * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for serviceConnectionPolicyCreationResult. + */ + com.google.protobuf.ByteString getServiceConnectionPolicyCreationResultBytes(); + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning.
+   * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceAutoDnsStatus field is set. + */ + boolean hasInstanceAutoDnsStatus(); + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning.
+   * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for instanceAutoDnsStatus. + */ + int getInstanceAutoDnsStatusValue(); + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning.
+   * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceAutoDnsStatus. + */ + com.google.cloud.sql.v1.AutoDnsStatus getInstanceAutoDnsStatus(); + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning for the write
+   * endpoint.
+   * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writeEndpointAutoDnsStatus field is set. + */ + boolean hasWriteEndpointAutoDnsStatus(); + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning for the write
+   * endpoint.
+   * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for writeEndpointAutoDnsStatus. + */ + int getWriteEndpointAutoDnsStatusValue(); + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning for the write
+   * endpoint.
+   * 
+ * + * + * optional .google.cloud.sql.v1.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writeEndpointAutoDnsStatus. + */ + com.google.cloud.sql.v1.AutoDnsStatus getWriteEndpointAutoDnsStatus(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PscConfig.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PscConfig.java new file mode 100644 index 000000000000..d365b9c5c1d5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PscConfig.java @@ -0,0 +1,2235 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * PSC settings for a Cloud SQL instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PscConfig} + */ +@com.google.protobuf.Generated +public final class PscConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.PscConfig) + PscConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PscConfig"); + } + + // Use PscConfig.newBuilder() to construct. + private PscConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PscConfig() { + allowedConsumerProjects_ = com.google.protobuf.LazyStringArrayList.emptyList(); + pscAutoConnections_ = java.util.Collections.emptyList(); + networkAttachmentUri_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PscConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PscConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PscConfig.class, + com.google.cloud.sql.v1.PscConfig.Builder.class); + } + + private int bitField0_; + public static final int PSC_ENABLED_FIELD_NUMBER = 1; + private boolean pscEnabled_ = false; + + /** + * + * + *
+   * Whether PSC connectivity is enabled for this instance.
+   * 
+ * + * optional bool psc_enabled = 1; + * + * @return Whether the pscEnabled field is set. + */ + @java.lang.Override + public boolean hasPscEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Whether PSC connectivity is enabled for this instance.
+   * 
+ * + * optional bool psc_enabled = 1; + * + * @return The pscEnabled. + */ + @java.lang.Override + public boolean getPscEnabled() { + return pscEnabled_; + } + + public static final int ALLOWED_CONSUMER_PROJECTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList allowedConsumerProjects_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the allowedConsumerProjects. + */ + public com.google.protobuf.ProtocolStringList getAllowedConsumerProjectsList() { + return allowedConsumerProjects_; + } + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of allowedConsumerProjects. + */ + public int getAllowedConsumerProjectsCount() { + return allowedConsumerProjects_.size(); + } + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The allowedConsumerProjects at the given index. + */ + public java.lang.String getAllowedConsumerProjects(int index) { + return allowedConsumerProjects_.get(index); + } + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the allowedConsumerProjects at the given index. + */ + public com.google.protobuf.ByteString getAllowedConsumerProjectsBytes(int index) { + return allowedConsumerProjects_.getByteString(index); + } + + public static final int PSC_AUTO_CONNECTIONS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List pscAutoConnections_; + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getPscAutoConnectionsList() { + return pscAutoConnections_; + } + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getPscAutoConnectionsOrBuilderList() { + return pscAutoConnections_; + } + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getPscAutoConnectionsCount() { + return pscAutoConnections_.size(); + } + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.PscAutoConnectionConfig getPscAutoConnections(int index) { + return pscAutoConnections_.get(index); + } + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.PscAutoConnectionConfigOrBuilder getPscAutoConnectionsOrBuilder( + int index) { + return pscAutoConnections_.get(index); + } + + public static final int NETWORK_ATTACHMENT_URI_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object networkAttachmentUri_ = ""; + + /** + * + * + *
+   * Optional. The network attachment of the consumer network that the
+   * Private Service Connect enabled Cloud SQL instance is
+   * authorized to connect via PSC interface.
+   * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+   * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The networkAttachmentUri. + */ + @java.lang.Override + public java.lang.String getNetworkAttachmentUri() { + java.lang.Object ref = networkAttachmentUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + networkAttachmentUri_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The network attachment of the consumer network that the
+   * Private Service Connect enabled Cloud SQL instance is
+   * authorized to connect via PSC interface.
+   * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+   * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for networkAttachmentUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkAttachmentUriBytes() { + java.lang.Object ref = networkAttachmentUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + networkAttachmentUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PSC_AUTO_DNS_ENABLED_FIELD_NUMBER = 5; + private boolean pscAutoDnsEnabled_ = false; + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect DNS automation is
+   * enabled for this instance. When enabled, Cloud SQL provisions a universal
+   * DNS record across all networks configured with Private Service Connect
+   * auto-connections. This will default to true for new instances when
+   * Private Service Connect is enabled.
+   * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the pscAutoDnsEnabled field is set. + */ + @java.lang.Override + public boolean hasPscAutoDnsEnabled() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect DNS automation is
+   * enabled for this instance. When enabled, Cloud SQL provisions a universal
+   * DNS record across all networks configured with Private Service Connect
+   * auto-connections. This will default to true for new instances when
+   * Private Service Connect is enabled.
+   * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pscAutoDnsEnabled. + */ + @java.lang.Override + public boolean getPscAutoDnsEnabled() { + return pscAutoDnsEnabled_; + } + + public static final int PSC_WRITE_ENDPOINT_DNS_ENABLED_FIELD_NUMBER = 6; + private boolean pscWriteEndpointDnsEnabled_ = false; + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect write endpoint DNS
+   * automation is enabled for this instance. When enabled, Cloud SQL provisions
+   * a universal global DNS record across all networks configured with Private
+   * Service Connect auto-connections that points to the cluster primary
+   * instance. This feature is only supported for Enterprise Plus edition. This
+   * will default to true for new Enterprise Plus instances when
+   * `psc_auto_dns_enabled` is enabled.
+   * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pscWriteEndpointDnsEnabled field is set. + */ + @java.lang.Override + public boolean hasPscWriteEndpointDnsEnabled() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect write endpoint DNS
+   * automation is enabled for this instance. When enabled, Cloud SQL provisions
+   * a universal global DNS record across all networks configured with Private
+   * Service Connect auto-connections that points to the cluster primary
+   * instance. This feature is only supported for Enterprise Plus edition. This
+   * will default to true for new Enterprise Plus instances when
+   * `psc_auto_dns_enabled` is enabled.
+   * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pscWriteEndpointDnsEnabled. + */ + @java.lang.Override + public boolean getPscWriteEndpointDnsEnabled() { + return pscWriteEndpointDnsEnabled_; + } + + public static final int PSC_AUTO_CONNECTION_POLICY_ENABLED_FIELD_NUMBER = 7; + private boolean pscAutoConnectionPolicyEnabled_ = false; + + /** + * + * + *
+   * Optional. Whether to set up the PSC service connection policy
+   * automatically.
+   * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pscAutoConnectionPolicyEnabled field is set. + */ + @java.lang.Override + public boolean hasPscAutoConnectionPolicyEnabled() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. Whether to set up the PSC service connection policy
+   * automatically.
+   * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pscAutoConnectionPolicyEnabled. + */ + @java.lang.Override + public boolean getPscAutoConnectionPolicyEnabled() { + return pscAutoConnectionPolicyEnabled_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, pscEnabled_); + } + for (int i = 0; i < allowedConsumerProjects_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 2, allowedConsumerProjects_.getRaw(i)); + } + for (int i = 0; i < pscAutoConnections_.size(); i++) { + output.writeMessage(3, pscAutoConnections_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(networkAttachmentUri_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, networkAttachmentUri_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(5, pscAutoDnsEnabled_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeBool(6, pscWriteEndpointDnsEnabled_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeBool(7, pscAutoConnectionPolicyEnabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, pscEnabled_); + } + { + int dataSize = 0; + for (int i = 0; i < allowedConsumerProjects_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedConsumerProjects_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedConsumerProjectsList().size(); + } + for (int i = 0; i < pscAutoConnections_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, pscAutoConnections_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(networkAttachmentUri_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, networkAttachmentUri_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, pscAutoDnsEnabled_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, pscWriteEndpointDnsEnabled_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(7, pscAutoConnectionPolicyEnabled_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.PscConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.PscConfig other = (com.google.cloud.sql.v1.PscConfig) obj; + + if (hasPscEnabled() != other.hasPscEnabled()) return false; + if (hasPscEnabled()) { + if (getPscEnabled() != other.getPscEnabled()) return false; + } + if (!getAllowedConsumerProjectsList().equals(other.getAllowedConsumerProjectsList())) + return false; + if (!getPscAutoConnectionsList().equals(other.getPscAutoConnectionsList())) return false; + if (!getNetworkAttachmentUri().equals(other.getNetworkAttachmentUri())) return false; + if (hasPscAutoDnsEnabled() != other.hasPscAutoDnsEnabled()) return false; + if (hasPscAutoDnsEnabled()) { + if (getPscAutoDnsEnabled() != other.getPscAutoDnsEnabled()) return false; + } + if (hasPscWriteEndpointDnsEnabled() != other.hasPscWriteEndpointDnsEnabled()) return false; + if (hasPscWriteEndpointDnsEnabled()) { + if (getPscWriteEndpointDnsEnabled() != other.getPscWriteEndpointDnsEnabled()) return false; + } + if (hasPscAutoConnectionPolicyEnabled() != other.hasPscAutoConnectionPolicyEnabled()) + return false; + if (hasPscAutoConnectionPolicyEnabled()) { + if (getPscAutoConnectionPolicyEnabled() != other.getPscAutoConnectionPolicyEnabled()) + return false; + } + if (!getUnknownFields().equals(other.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 (hasPscEnabled()) { + hash = (37 * hash) + PSC_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPscEnabled()); + } + if (getAllowedConsumerProjectsCount() > 0) { + hash = (37 * hash) + ALLOWED_CONSUMER_PROJECTS_FIELD_NUMBER; + hash = (53 * hash) + getAllowedConsumerProjectsList().hashCode(); + } + if (getPscAutoConnectionsCount() > 0) { + hash = (37 * hash) + PSC_AUTO_CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPscAutoConnectionsList().hashCode(); + } + hash = (37 * hash) + NETWORK_ATTACHMENT_URI_FIELD_NUMBER; + hash = (53 * hash) + getNetworkAttachmentUri().hashCode(); + if (hasPscAutoDnsEnabled()) { + hash = (37 * hash) + PSC_AUTO_DNS_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPscAutoDnsEnabled()); + } + if (hasPscWriteEndpointDnsEnabled()) { + hash = (37 * hash) + PSC_WRITE_ENDPOINT_DNS_ENABLED_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPscWriteEndpointDnsEnabled()); + } + if (hasPscAutoConnectionPolicyEnabled()) { + hash = (37 * hash) + PSC_AUTO_CONNECTION_POLICY_ENABLED_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getPscAutoConnectionPolicyEnabled()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.PscConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PscConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PscConfig parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PscConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PscConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.PscConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PscConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PscConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PscConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PscConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.PscConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.PscConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.PscConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * PSC settings for a Cloud SQL instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.PscConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.PscConfig) + com.google.cloud.sql.v1.PscConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PscConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PscConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.PscConfig.class, + com.google.cloud.sql.v1.PscConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.PscConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pscEnabled_ = false; + allowedConsumerProjects_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnections_ = java.util.Collections.emptyList(); + } else { + pscAutoConnections_ = null; + pscAutoConnectionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + networkAttachmentUri_ = ""; + pscAutoDnsEnabled_ = false; + pscWriteEndpointDnsEnabled_ = false; + pscAutoConnectionPolicyEnabled_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_PscConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PscConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.PscConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.PscConfig build() { + com.google.cloud.sql.v1.PscConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PscConfig buildPartial() { + com.google.cloud.sql.v1.PscConfig result = new com.google.cloud.sql.v1.PscConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.PscConfig result) { + if (pscAutoConnectionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + pscAutoConnections_ = java.util.Collections.unmodifiableList(pscAutoConnections_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.pscAutoConnections_ = pscAutoConnections_; + } else { + result.pscAutoConnections_ = pscAutoConnectionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.PscConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pscEnabled_ = pscEnabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + allowedConsumerProjects_.makeImmutable(); + result.allowedConsumerProjects_ = allowedConsumerProjects_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.networkAttachmentUri_ = networkAttachmentUri_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pscAutoDnsEnabled_ = pscAutoDnsEnabled_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.pscWriteEndpointDnsEnabled_ = pscWriteEndpointDnsEnabled_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pscAutoConnectionPolicyEnabled_ = pscAutoConnectionPolicyEnabled_; + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.PscConfig) { + return mergeFrom((com.google.cloud.sql.v1.PscConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.PscConfig other) { + if (other == com.google.cloud.sql.v1.PscConfig.getDefaultInstance()) return this; + if (other.hasPscEnabled()) { + setPscEnabled(other.getPscEnabled()); + } + if (!other.allowedConsumerProjects_.isEmpty()) { + if (allowedConsumerProjects_.isEmpty()) { + allowedConsumerProjects_ = other.allowedConsumerProjects_; + bitField0_ |= 0x00000002; + } else { + ensureAllowedConsumerProjectsIsMutable(); + allowedConsumerProjects_.addAll(other.allowedConsumerProjects_); + } + onChanged(); + } + if (pscAutoConnectionsBuilder_ == null) { + if (!other.pscAutoConnections_.isEmpty()) { + if (pscAutoConnections_.isEmpty()) { + pscAutoConnections_ = other.pscAutoConnections_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.addAll(other.pscAutoConnections_); + } + onChanged(); + } + } else { + if (!other.pscAutoConnections_.isEmpty()) { + if (pscAutoConnectionsBuilder_.isEmpty()) { + pscAutoConnectionsBuilder_.dispose(); + pscAutoConnectionsBuilder_ = null; + pscAutoConnections_ = other.pscAutoConnections_; + bitField0_ = (bitField0_ & ~0x00000004); + pscAutoConnectionsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPscAutoConnectionsFieldBuilder() + : null; + } else { + pscAutoConnectionsBuilder_.addAllMessages(other.pscAutoConnections_); + } + } + } + if (!other.getNetworkAttachmentUri().isEmpty()) { + networkAttachmentUri_ = other.networkAttachmentUri_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasPscAutoDnsEnabled()) { + setPscAutoDnsEnabled(other.getPscAutoDnsEnabled()); + } + if (other.hasPscWriteEndpointDnsEnabled()) { + setPscWriteEndpointDnsEnabled(other.getPscWriteEndpointDnsEnabled()); + } + if (other.hasPscAutoConnectionPolicyEnabled()) { + setPscAutoConnectionPolicyEnabled(other.getPscAutoConnectionPolicyEnabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + pscEnabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAllowedConsumerProjectsIsMutable(); + allowedConsumerProjects_.add(s); + break; + } // case 18 + case 26: + { + com.google.cloud.sql.v1.PscAutoConnectionConfig m = + input.readMessage( + com.google.cloud.sql.v1.PscAutoConnectionConfig.parser(), + extensionRegistry); + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(m); + } else { + pscAutoConnectionsBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + networkAttachmentUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + pscAutoDnsEnabled_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + pscWriteEndpointDnsEnabled_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: + { + pscAutoConnectionPolicyEnabled_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 56 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean pscEnabled_; + + /** + * + * + *
+     * Whether PSC connectivity is enabled for this instance.
+     * 
+ * + * optional bool psc_enabled = 1; + * + * @return Whether the pscEnabled field is set. + */ + @java.lang.Override + public boolean hasPscEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Whether PSC connectivity is enabled for this instance.
+     * 
+ * + * optional bool psc_enabled = 1; + * + * @return The pscEnabled. + */ + @java.lang.Override + public boolean getPscEnabled() { + return pscEnabled_; + } + + /** + * + * + *
+     * Whether PSC connectivity is enabled for this instance.
+     * 
+ * + * optional bool psc_enabled = 1; + * + * @param value The pscEnabled to set. + * @return This builder for chaining. + */ + public Builder setPscEnabled(boolean value) { + + pscEnabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether PSC connectivity is enabled for this instance.
+     * 
+ * + * optional bool psc_enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearPscEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + pscEnabled_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList allowedConsumerProjects_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAllowedConsumerProjectsIsMutable() { + if (!allowedConsumerProjects_.isModifiable()) { + allowedConsumerProjects_ = + new com.google.protobuf.LazyStringArrayList(allowedConsumerProjects_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the allowedConsumerProjects. + */ + public com.google.protobuf.ProtocolStringList getAllowedConsumerProjectsList() { + allowedConsumerProjects_.makeImmutable(); + return allowedConsumerProjects_; + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of allowedConsumerProjects. + */ + public int getAllowedConsumerProjectsCount() { + return allowedConsumerProjects_.size(); + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The allowedConsumerProjects at the given index. + */ + public java.lang.String getAllowedConsumerProjects(int index) { + return allowedConsumerProjects_.get(index); + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the allowedConsumerProjects at the given index. + */ + public com.google.protobuf.ByteString getAllowedConsumerProjectsBytes(int index) { + return allowedConsumerProjects_.getByteString(index); + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The allowedConsumerProjects to set. + * @return This builder for chaining. + */ + public Builder setAllowedConsumerProjects(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedConsumerProjectsIsMutable(); + allowedConsumerProjects_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The allowedConsumerProjects to add. + * @return This builder for chaining. + */ + public Builder addAllowedConsumerProjects(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedConsumerProjectsIsMutable(); + allowedConsumerProjects_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The allowedConsumerProjects to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedConsumerProjects(java.lang.Iterable values) { + ensureAllowedConsumerProjectsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedConsumerProjects_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearAllowedConsumerProjects() { + allowedConsumerProjects_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes of the allowedConsumerProjects to add. + * @return This builder for chaining. + */ + public Builder addAllowedConsumerProjectsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedConsumerProjectsIsMutable(); + allowedConsumerProjects_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List pscAutoConnections_ = + java.util.Collections.emptyList(); + + private void ensurePscAutoConnectionsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + pscAutoConnections_ = + new java.util.ArrayList( + pscAutoConnections_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.PscAutoConnectionConfig, + com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder, + com.google.cloud.sql.v1.PscAutoConnectionConfigOrBuilder> + pscAutoConnectionsBuilder_; + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getPscAutoConnectionsList() { + if (pscAutoConnectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pscAutoConnections_); + } else { + return pscAutoConnectionsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getPscAutoConnectionsCount() { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.size(); + } else { + return pscAutoConnectionsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.PscAutoConnectionConfig getPscAutoConnections(int index) { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.get(index); + } else { + return pscAutoConnectionsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPscAutoConnections( + int index, com.google.cloud.sql.v1.PscAutoConnectionConfig value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.set(index, value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPscAutoConnections( + int index, com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.set(index, builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addPscAutoConnections(com.google.cloud.sql.v1.PscAutoConnectionConfig value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addPscAutoConnections( + int index, com.google.cloud.sql.v1.PscAutoConnectionConfig value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(index, value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addPscAutoConnections( + com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addPscAutoConnections( + int index, com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(index, builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPscAutoConnections() { + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + pscAutoConnectionsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removePscAutoConnections(int index) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.remove(index); + onChanged(); + } else { + pscAutoConnectionsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder getPscAutoConnectionsBuilder( + int index) { + return internalGetPscAutoConnectionsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.PscAutoConnectionConfigOrBuilder getPscAutoConnectionsOrBuilder( + int index) { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.get(index); + } else { + return pscAutoConnectionsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getPscAutoConnectionsOrBuilderList() { + if (pscAutoConnectionsBuilder_ != null) { + return pscAutoConnectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pscAutoConnections_); + } + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder addPscAutoConnectionsBuilder() { + return internalGetPscAutoConnectionsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.PscAutoConnectionConfig.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder addPscAutoConnectionsBuilder( + int index) { + return internalGetPscAutoConnectionsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.PscAutoConnectionConfig.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getPscAutoConnectionsBuilderList() { + return internalGetPscAutoConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.PscAutoConnectionConfig, + com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder, + com.google.cloud.sql.v1.PscAutoConnectionConfigOrBuilder> + internalGetPscAutoConnectionsFieldBuilder() { + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.PscAutoConnectionConfig, + com.google.cloud.sql.v1.PscAutoConnectionConfig.Builder, + com.google.cloud.sql.v1.PscAutoConnectionConfigOrBuilder>( + pscAutoConnections_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + pscAutoConnections_ = null; + } + return pscAutoConnectionsBuilder_; + } + + private java.lang.Object networkAttachmentUri_ = ""; + + /** + * + * + *
+     * Optional. The network attachment of the consumer network that the
+     * Private Service Connect enabled Cloud SQL instance is
+     * authorized to connect via PSC interface.
+     * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+     * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The networkAttachmentUri. + */ + public java.lang.String getNetworkAttachmentUri() { + java.lang.Object ref = networkAttachmentUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + networkAttachmentUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The network attachment of the consumer network that the
+     * Private Service Connect enabled Cloud SQL instance is
+     * authorized to connect via PSC interface.
+     * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+     * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for networkAttachmentUri. + */ + public com.google.protobuf.ByteString getNetworkAttachmentUriBytes() { + java.lang.Object ref = networkAttachmentUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + networkAttachmentUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The network attachment of the consumer network that the
+     * Private Service Connect enabled Cloud SQL instance is
+     * authorized to connect via PSC interface.
+     * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+     * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The networkAttachmentUri to set. + * @return This builder for chaining. + */ + public Builder setNetworkAttachmentUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + networkAttachmentUri_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The network attachment of the consumer network that the
+     * Private Service Connect enabled Cloud SQL instance is
+     * authorized to connect via PSC interface.
+     * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+     * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNetworkAttachmentUri() { + networkAttachmentUri_ = getDefaultInstance().getNetworkAttachmentUri(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The network attachment of the consumer network that the
+     * Private Service Connect enabled Cloud SQL instance is
+     * authorized to connect via PSC interface.
+     * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+     * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for networkAttachmentUri to set. + * @return This builder for chaining. + */ + public Builder setNetworkAttachmentUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + networkAttachmentUri_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean pscAutoDnsEnabled_; + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect DNS automation is
+     * enabled for this instance. When enabled, Cloud SQL provisions a universal
+     * DNS record across all networks configured with Private Service Connect
+     * auto-connections. This will default to true for new instances when
+     * Private Service Connect is enabled.
+     * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pscAutoDnsEnabled field is set. + */ + @java.lang.Override + public boolean hasPscAutoDnsEnabled() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect DNS automation is
+     * enabled for this instance. When enabled, Cloud SQL provisions a universal
+     * DNS record across all networks configured with Private Service Connect
+     * auto-connections. This will default to true for new instances when
+     * Private Service Connect is enabled.
+     * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pscAutoDnsEnabled. + */ + @java.lang.Override + public boolean getPscAutoDnsEnabled() { + return pscAutoDnsEnabled_; + } + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect DNS automation is
+     * enabled for this instance. When enabled, Cloud SQL provisions a universal
+     * DNS record across all networks configured with Private Service Connect
+     * auto-connections. This will default to true for new instances when
+     * Private Service Connect is enabled.
+     * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The pscAutoDnsEnabled to set. + * @return This builder for chaining. + */ + public Builder setPscAutoDnsEnabled(boolean value) { + + pscAutoDnsEnabled_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect DNS automation is
+     * enabled for this instance. When enabled, Cloud SQL provisions a universal
+     * DNS record across all networks configured with Private Service Connect
+     * auto-connections. This will default to true for new instances when
+     * Private Service Connect is enabled.
+     * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPscAutoDnsEnabled() { + bitField0_ = (bitField0_ & ~0x00000010); + pscAutoDnsEnabled_ = false; + onChanged(); + return this; + } + + private boolean pscWriteEndpointDnsEnabled_; + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect write endpoint DNS
+     * automation is enabled for this instance. When enabled, Cloud SQL provisions
+     * a universal global DNS record across all networks configured with Private
+     * Service Connect auto-connections that points to the cluster primary
+     * instance. This feature is only supported for Enterprise Plus edition. This
+     * will default to true for new Enterprise Plus instances when
+     * `psc_auto_dns_enabled` is enabled.
+     * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pscWriteEndpointDnsEnabled field is set. + */ + @java.lang.Override + public boolean hasPscWriteEndpointDnsEnabled() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect write endpoint DNS
+     * automation is enabled for this instance. When enabled, Cloud SQL provisions
+     * a universal global DNS record across all networks configured with Private
+     * Service Connect auto-connections that points to the cluster primary
+     * instance. This feature is only supported for Enterprise Plus edition. This
+     * will default to true for new Enterprise Plus instances when
+     * `psc_auto_dns_enabled` is enabled.
+     * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pscWriteEndpointDnsEnabled. + */ + @java.lang.Override + public boolean getPscWriteEndpointDnsEnabled() { + return pscWriteEndpointDnsEnabled_; + } + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect write endpoint DNS
+     * automation is enabled for this instance. When enabled, Cloud SQL provisions
+     * a universal global DNS record across all networks configured with Private
+     * Service Connect auto-connections that points to the cluster primary
+     * instance. This feature is only supported for Enterprise Plus edition. This
+     * will default to true for new Enterprise Plus instances when
+     * `psc_auto_dns_enabled` is enabled.
+     * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The pscWriteEndpointDnsEnabled to set. + * @return This builder for chaining. + */ + public Builder setPscWriteEndpointDnsEnabled(boolean value) { + + pscWriteEndpointDnsEnabled_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect write endpoint DNS
+     * automation is enabled for this instance. When enabled, Cloud SQL provisions
+     * a universal global DNS record across all networks configured with Private
+     * Service Connect auto-connections that points to the cluster primary
+     * instance. This feature is only supported for Enterprise Plus edition. This
+     * will default to true for new Enterprise Plus instances when
+     * `psc_auto_dns_enabled` is enabled.
+     * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPscWriteEndpointDnsEnabled() { + bitField0_ = (bitField0_ & ~0x00000020); + pscWriteEndpointDnsEnabled_ = false; + onChanged(); + return this; + } + + private boolean pscAutoConnectionPolicyEnabled_; + + /** + * + * + *
+     * Optional. Whether to set up the PSC service connection policy
+     * automatically.
+     * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pscAutoConnectionPolicyEnabled field is set. + */ + @java.lang.Override + public boolean hasPscAutoConnectionPolicyEnabled() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Optional. Whether to set up the PSC service connection policy
+     * automatically.
+     * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pscAutoConnectionPolicyEnabled. + */ + @java.lang.Override + public boolean getPscAutoConnectionPolicyEnabled() { + return pscAutoConnectionPolicyEnabled_; + } + + /** + * + * + *
+     * Optional. Whether to set up the PSC service connection policy
+     * automatically.
+     * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The pscAutoConnectionPolicyEnabled to set. + * @return This builder for chaining. + */ + public Builder setPscAutoConnectionPolicyEnabled(boolean value) { + + pscAutoConnectionPolicyEnabled_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Whether to set up the PSC service connection policy
+     * automatically.
+     * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPscAutoConnectionPolicyEnabled() { + bitField0_ = (bitField0_ & ~0x00000040); + pscAutoConnectionPolicyEnabled_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.PscConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.PscConfig) + private static final com.google.cloud.sql.v1.PscConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.PscConfig(); + } + + public static com.google.cloud.sql.v1.PscConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PscConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.PscConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PscConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PscConfigOrBuilder.java new file mode 100644 index 000000000000..3a64a6b421be --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/PscConfigOrBuilder.java @@ -0,0 +1,344 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface PscConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.PscConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether PSC connectivity is enabled for this instance.
+   * 
+ * + * optional bool psc_enabled = 1; + * + * @return Whether the pscEnabled field is set. + */ + boolean hasPscEnabled(); + + /** + * + * + *
+   * Whether PSC connectivity is enabled for this instance.
+   * 
+ * + * optional bool psc_enabled = 1; + * + * @return The pscEnabled. + */ + boolean getPscEnabled(); + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the allowedConsumerProjects. + */ + java.util.List getAllowedConsumerProjectsList(); + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of allowedConsumerProjects. + */ + int getAllowedConsumerProjectsCount(); + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The allowedConsumerProjects at the given index. + */ + java.lang.String getAllowedConsumerProjects(int index); + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the allowedConsumerProjects at the given index. + */ + com.google.protobuf.ByteString getAllowedConsumerProjectsBytes(int index); + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getPscAutoConnectionsList(); + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.PscAutoConnectionConfig getPscAutoConnections(int index); + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getPscAutoConnectionsCount(); + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getPscAutoConnectionsOrBuilderList(); + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.PscAutoConnectionConfigOrBuilder getPscAutoConnectionsOrBuilder( + int index); + + /** + * + * + *
+   * Optional. The network attachment of the consumer network that the
+   * Private Service Connect enabled Cloud SQL instance is
+   * authorized to connect via PSC interface.
+   * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+   * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The networkAttachmentUri. + */ + java.lang.String getNetworkAttachmentUri(); + + /** + * + * + *
+   * Optional. The network attachment of the consumer network that the
+   * Private Service Connect enabled Cloud SQL instance is
+   * authorized to connect via PSC interface.
+   * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+   * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for networkAttachmentUri. + */ + com.google.protobuf.ByteString getNetworkAttachmentUriBytes(); + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect DNS automation is
+   * enabled for this instance. When enabled, Cloud SQL provisions a universal
+   * DNS record across all networks configured with Private Service Connect
+   * auto-connections. This will default to true for new instances when
+   * Private Service Connect is enabled.
+   * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the pscAutoDnsEnabled field is set. + */ + boolean hasPscAutoDnsEnabled(); + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect DNS automation is
+   * enabled for this instance. When enabled, Cloud SQL provisions a universal
+   * DNS record across all networks configured with Private Service Connect
+   * auto-connections. This will default to true for new instances when
+   * Private Service Connect is enabled.
+   * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pscAutoDnsEnabled. + */ + boolean getPscAutoDnsEnabled(); + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect write endpoint DNS
+   * automation is enabled for this instance. When enabled, Cloud SQL provisions
+   * a universal global DNS record across all networks configured with Private
+   * Service Connect auto-connections that points to the cluster primary
+   * instance. This feature is only supported for Enterprise Plus edition. This
+   * will default to true for new Enterprise Plus instances when
+   * `psc_auto_dns_enabled` is enabled.
+   * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pscWriteEndpointDnsEnabled field is set. + */ + boolean hasPscWriteEndpointDnsEnabled(); + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect write endpoint DNS
+   * automation is enabled for this instance. When enabled, Cloud SQL provisions
+   * a universal global DNS record across all networks configured with Private
+   * Service Connect auto-connections that points to the cluster primary
+   * instance. This feature is only supported for Enterprise Plus edition. This
+   * will default to true for new Enterprise Plus instances when
+   * `psc_auto_dns_enabled` is enabled.
+   * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pscWriteEndpointDnsEnabled. + */ + boolean getPscWriteEndpointDnsEnabled(); + + /** + * + * + *
+   * Optional. Whether to set up the PSC service connection policy
+   * automatically.
+   * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pscAutoConnectionPolicyEnabled field is set. + */ + boolean hasPscAutoConnectionPolicyEnabled(); + + /** + * + * + *
+   * Optional. Whether to set up the PSC service connection policy
+   * automatically.
+   * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pscAutoConnectionPolicyEnabled. + */ + boolean getPscAutoConnectionPolicyEnabled(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/QueryResult.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/QueryResult.java new file mode 100644 index 000000000000..69e9ae5e8c76 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/QueryResult.java @@ -0,0 +1,2008 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * QueryResult contains the result of executing a single SQL statement.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.QueryResult} + */ +@com.google.protobuf.Generated +public final class QueryResult extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.QueryResult) + QueryResultOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "QueryResult"); + } + + // Use QueryResult.newBuilder() to construct. + private QueryResult(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private QueryResult() { + columns_ = java.util.Collections.emptyList(); + rows_ = java.util.Collections.emptyList(); + message_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_QueryResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_QueryResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.QueryResult.class, + com.google.cloud.sql.v1.QueryResult.Builder.class); + } + + private int bitField0_; + public static final int COLUMNS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List columns_; + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + @java.lang.Override + public java.util.List getColumnsList() { + return columns_; + } + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + @java.lang.Override + public java.util.List + getColumnsOrBuilderList() { + return columns_; + } + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + @java.lang.Override + public int getColumnsCount() { + return columns_.size(); + } + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.Column getColumns(int index) { + return columns_.get(index); + } + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ColumnOrBuilder getColumnsOrBuilder(int index) { + return columns_.get(index); + } + + public static final int ROWS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List rows_; + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + @java.lang.Override + public java.util.List getRowsList() { + return rows_; + } + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + @java.lang.Override + public java.util.List getRowsOrBuilderList() { + return rows_; + } + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + @java.lang.Override + public int getRowsCount() { + return rows_.size(); + } + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.Row getRows(int index) { + return rows_.get(index); + } + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.RowOrBuilder getRowsOrBuilder(int index) { + return rows_.get(index); + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
+   * Message related to the SQL execution result.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + + /** + * + * + *
+   * Message related to the SQL execution result.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARTIAL_RESULT_FIELD_NUMBER = 4; + private boolean partialResult_ = false; + + /** + * + * + *
+   * Set to true if the SQL execution's result is truncated due to size limits
+   * or an error retrieving results.
+   * 
+ * + * bool partial_result = 4; + * + * @return The partialResult. + */ + @java.lang.Override + public boolean getPartialResult() { + return partialResult_; + } + + public static final int STATUS_FIELD_NUMBER = 8; + private com.google.rpc.Status status_; + + /** + * + * + *
+   * If results were truncated due to an error, details of that error.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * If results were truncated due to an error, details of that error.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
+   * If results were truncated due to an error, details of that error.
+   * 
+ * + * .google.rpc.Status status = 8; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 < columns_.size(); i++) { + output.writeMessage(1, columns_.get(i)); + } + for (int i = 0; i < rows_.size(); i++) { + output.writeMessage(2, rows_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, message_); + } + if (partialResult_ != false) { + output.writeBool(4, partialResult_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(8, getStatus()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < columns_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, columns_.get(i)); + } + for (int i = 0; i < rows_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, rows_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, message_); + } + if (partialResult_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, partialResult_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getStatus()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.QueryResult)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.QueryResult other = (com.google.cloud.sql.v1.QueryResult) obj; + + if (!getColumnsList().equals(other.getColumnsList())) return false; + if (!getRowsList().equals(other.getRowsList())) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (getPartialResult() != other.getPartialResult()) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (!getUnknownFields().equals(other.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 (getColumnsCount() > 0) { + hash = (37 * hash) + COLUMNS_FIELD_NUMBER; + hash = (53 * hash) + getColumnsList().hashCode(); + } + if (getRowsCount() > 0) { + hash = (37 * hash) + ROWS_FIELD_NUMBER; + hash = (53 * hash) + getRowsList().hashCode(); + } + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + PARTIAL_RESULT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPartialResult()); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.QueryResult parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.QueryResult parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.QueryResult parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.QueryResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.QueryResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.QueryResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.QueryResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.QueryResult parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.QueryResult parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.QueryResult parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.QueryResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.QueryResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.QueryResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * QueryResult contains the result of executing a single SQL statement.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.QueryResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.QueryResult) + com.google.cloud.sql.v1.QueryResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_QueryResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_QueryResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.QueryResult.class, + com.google.cloud.sql.v1.QueryResult.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.QueryResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetColumnsFieldBuilder(); + internalGetRowsFieldBuilder(); + internalGetStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (columnsBuilder_ == null) { + columns_ = java.util.Collections.emptyList(); + } else { + columns_ = null; + columnsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (rowsBuilder_ == null) { + rows_ = java.util.Collections.emptyList(); + } else { + rows_ = null; + rowsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + message_ = ""; + partialResult_ = false; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_QueryResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.QueryResult getDefaultInstanceForType() { + return com.google.cloud.sql.v1.QueryResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.QueryResult build() { + com.google.cloud.sql.v1.QueryResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.QueryResult buildPartial() { + com.google.cloud.sql.v1.QueryResult result = new com.google.cloud.sql.v1.QueryResult(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.QueryResult result) { + if (columnsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + columns_ = java.util.Collections.unmodifiableList(columns_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.columns_ = columns_; + } else { + result.columns_ = columnsBuilder_.build(); + } + if (rowsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + rows_ = java.util.Collections.unmodifiableList(rows_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.rows_ = rows_; + } else { + result.rows_ = rowsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.QueryResult result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.message_ = message_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.partialResult_ = partialResult_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.QueryResult) { + return mergeFrom((com.google.cloud.sql.v1.QueryResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.QueryResult other) { + if (other == com.google.cloud.sql.v1.QueryResult.getDefaultInstance()) return this; + if (columnsBuilder_ == null) { + if (!other.columns_.isEmpty()) { + if (columns_.isEmpty()) { + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureColumnsIsMutable(); + columns_.addAll(other.columns_); + } + onChanged(); + } + } else { + if (!other.columns_.isEmpty()) { + if (columnsBuilder_.isEmpty()) { + columnsBuilder_.dispose(); + columnsBuilder_ = null; + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000001); + columnsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetColumnsFieldBuilder() + : null; + } else { + columnsBuilder_.addAllMessages(other.columns_); + } + } + } + if (rowsBuilder_ == null) { + if (!other.rows_.isEmpty()) { + if (rows_.isEmpty()) { + rows_ = other.rows_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRowsIsMutable(); + rows_.addAll(other.rows_); + } + onChanged(); + } + } else { + if (!other.rows_.isEmpty()) { + if (rowsBuilder_.isEmpty()) { + rowsBuilder_.dispose(); + rowsBuilder_ = null; + rows_ = other.rows_; + bitField0_ = (bitField0_ & ~0x00000002); + rowsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRowsFieldBuilder() + : null; + } else { + rowsBuilder_.addAllMessages(other.rows_); + } + } + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getPartialResult() != false) { + setPartialResult(other.getPartialResult()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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.sql.v1.Column m = + input.readMessage(com.google.cloud.sql.v1.Column.parser(), extensionRegistry); + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(m); + } else { + columnsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1.Row m = + input.readMessage(com.google.cloud.sql.v1.Row.parser(), extensionRegistry); + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.add(m); + } else { + rowsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + partialResult_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 66: + { + input.readMessage(internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List columns_ = + java.util.Collections.emptyList(); + + private void ensureColumnsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + columns_ = new java.util.ArrayList(columns_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Column, + com.google.cloud.sql.v1.Column.Builder, + com.google.cloud.sql.v1.ColumnOrBuilder> + columnsBuilder_; + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public java.util.List getColumnsList() { + if (columnsBuilder_ == null) { + return java.util.Collections.unmodifiableList(columns_); + } else { + return columnsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public int getColumnsCount() { + if (columnsBuilder_ == null) { + return columns_.size(); + } else { + return columnsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public com.google.cloud.sql.v1.Column getColumns(int index) { + if (columnsBuilder_ == null) { + return columns_.get(index); + } else { + return columnsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public Builder setColumns(int index, com.google.cloud.sql.v1.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.set(index, value); + onChanged(); + } else { + columnsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public Builder setColumns(int index, com.google.cloud.sql.v1.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.set(index, builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public Builder addColumns(com.google.cloud.sql.v1.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(value); + onChanged(); + } else { + columnsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public Builder addColumns(int index, com.google.cloud.sql.v1.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(index, value); + onChanged(); + } else { + columnsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public Builder addColumns(com.google.cloud.sql.v1.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public Builder addColumns(int index, com.google.cloud.sql.v1.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(index, builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public Builder addAllColumns( + java.lang.Iterable values) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, columns_); + onChanged(); + } else { + columnsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public Builder clearColumns() { + if (columnsBuilder_ == null) { + columns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + columnsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public Builder removeColumns(int index) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.remove(index); + onChanged(); + } else { + columnsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public com.google.cloud.sql.v1.Column.Builder getColumnsBuilder(int index) { + return internalGetColumnsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public com.google.cloud.sql.v1.ColumnOrBuilder getColumnsOrBuilder(int index) { + if (columnsBuilder_ == null) { + return columns_.get(index); + } else { + return columnsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public java.util.List + getColumnsOrBuilderList() { + if (columnsBuilder_ != null) { + return columnsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(columns_); + } + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public com.google.cloud.sql.v1.Column.Builder addColumnsBuilder() { + return internalGetColumnsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.Column.getDefaultInstance()); + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public com.google.cloud.sql.v1.Column.Builder addColumnsBuilder(int index) { + return internalGetColumnsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.Column.getDefaultInstance()); + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + public java.util.List getColumnsBuilderList() { + return internalGetColumnsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Column, + com.google.cloud.sql.v1.Column.Builder, + com.google.cloud.sql.v1.ColumnOrBuilder> + internalGetColumnsFieldBuilder() { + if (columnsBuilder_ == null) { + columnsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Column, + com.google.cloud.sql.v1.Column.Builder, + com.google.cloud.sql.v1.ColumnOrBuilder>( + columns_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + columns_ = null; + } + return columnsBuilder_; + } + + private java.util.List rows_ = java.util.Collections.emptyList(); + + private void ensureRowsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + rows_ = new java.util.ArrayList(rows_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Row, + com.google.cloud.sql.v1.Row.Builder, + com.google.cloud.sql.v1.RowOrBuilder> + rowsBuilder_; + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public java.util.List getRowsList() { + if (rowsBuilder_ == null) { + return java.util.Collections.unmodifiableList(rows_); + } else { + return rowsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public int getRowsCount() { + if (rowsBuilder_ == null) { + return rows_.size(); + } else { + return rowsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public com.google.cloud.sql.v1.Row getRows(int index) { + if (rowsBuilder_ == null) { + return rows_.get(index); + } else { + return rowsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public Builder setRows(int index, com.google.cloud.sql.v1.Row value) { + if (rowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowsIsMutable(); + rows_.set(index, value); + onChanged(); + } else { + rowsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public Builder setRows(int index, com.google.cloud.sql.v1.Row.Builder builderForValue) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.set(index, builderForValue.build()); + onChanged(); + } else { + rowsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public Builder addRows(com.google.cloud.sql.v1.Row value) { + if (rowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowsIsMutable(); + rows_.add(value); + onChanged(); + } else { + rowsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public Builder addRows(int index, com.google.cloud.sql.v1.Row value) { + if (rowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowsIsMutable(); + rows_.add(index, value); + onChanged(); + } else { + rowsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public Builder addRows(com.google.cloud.sql.v1.Row.Builder builderForValue) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.add(builderForValue.build()); + onChanged(); + } else { + rowsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public Builder addRows(int index, com.google.cloud.sql.v1.Row.Builder builderForValue) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.add(index, builderForValue.build()); + onChanged(); + } else { + rowsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public Builder addAllRows(java.lang.Iterable values) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rows_); + onChanged(); + } else { + rowsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public Builder clearRows() { + if (rowsBuilder_ == null) { + rows_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + rowsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public Builder removeRows(int index) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.remove(index); + onChanged(); + } else { + rowsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public com.google.cloud.sql.v1.Row.Builder getRowsBuilder(int index) { + return internalGetRowsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public com.google.cloud.sql.v1.RowOrBuilder getRowsOrBuilder(int index) { + if (rowsBuilder_ == null) { + return rows_.get(index); + } else { + return rowsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public java.util.List getRowsOrBuilderList() { + if (rowsBuilder_ != null) { + return rowsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rows_); + } + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public com.google.cloud.sql.v1.Row.Builder addRowsBuilder() { + return internalGetRowsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.Row.getDefaultInstance()); + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public com.google.cloud.sql.v1.Row.Builder addRowsBuilder(int index) { + return internalGetRowsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.Row.getDefaultInstance()); + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + public java.util.List getRowsBuilderList() { + return internalGetRowsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Row, + com.google.cloud.sql.v1.Row.Builder, + com.google.cloud.sql.v1.RowOrBuilder> + internalGetRowsFieldBuilder() { + if (rowsBuilder_ == null) { + rowsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Row, + com.google.cloud.sql.v1.Row.Builder, + com.google.cloud.sql.v1.RowOrBuilder>( + rows_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + rows_ = null; + } + return rowsBuilder_; + } + + private java.lang.Object message_ = ""; + + /** + * + * + *
+     * Message related to the SQL execution result.
+     * 
+ * + * string message = 3; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Message related to the SQL execution result.
+     * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Message related to the SQL execution result.
+     * 
+ * + * string message = 3; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Message related to the SQL execution result.
+     * 
+ * + * string message = 3; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Message related to the SQL execution result.
+     * 
+ * + * string message = 3; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean partialResult_; + + /** + * + * + *
+     * Set to true if the SQL execution's result is truncated due to size limits
+     * or an error retrieving results.
+     * 
+ * + * bool partial_result = 4; + * + * @return The partialResult. + */ + @java.lang.Override + public boolean getPartialResult() { + return partialResult_; + } + + /** + * + * + *
+     * Set to true if the SQL execution's result is truncated due to size limits
+     * or an error retrieving results.
+     * 
+ * + * bool partial_result = 4; + * + * @param value The partialResult to set. + * @return This builder for chaining. + */ + public Builder setPartialResult(boolean value) { + + partialResult_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Set to true if the SQL execution's result is truncated due to size limits
+     * or an error retrieving results.
+     * 
+ * + * bool partial_result = 4; + * + * @return This builder for chaining. + */ + public Builder clearPartialResult() { + bitField0_ = (bitField0_ & ~0x00000008); + partialResult_ = false; + onChanged(); + return this; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000010); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.QueryResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.QueryResult) + private static final com.google.cloud.sql.v1.QueryResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.QueryResult(); + } + + public static com.google.cloud.sql.v1.QueryResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.QueryResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/QueryResultOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/QueryResultOrBuilder.java new file mode 100644 index 000000000000..1a73d276ac5b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/QueryResultOrBuilder.java @@ -0,0 +1,220 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface QueryResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.QueryResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + java.util.List getColumnsList(); + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + com.google.cloud.sql.v1.Column getColumns(int index); + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + int getColumnsCount(); + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + java.util.List getColumnsOrBuilderList(); + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1.Column columns = 1; + */ + com.google.cloud.sql.v1.ColumnOrBuilder getColumnsOrBuilder(int index); + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + java.util.List getRowsList(); + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + com.google.cloud.sql.v1.Row getRows(int index); + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + int getRowsCount(); + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + java.util.List getRowsOrBuilderList(); + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.Row rows = 2; + */ + com.google.cloud.sql.v1.RowOrBuilder getRowsOrBuilder(int index); + + /** + * + * + *
+   * Message related to the SQL execution result.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
+   * Message related to the SQL execution result.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
+   * Set to true if the SQL execution's result is truncated due to size limits
+   * or an error retrieving results.
+   * 
+ * + * bool partial_result = 4; + * + * @return The partialResult. + */ + boolean getPartialResult(); + + /** + * + * + *
+   * If results were truncated due to an error, details of that error.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+   * If results were truncated due to an error, details of that error.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
+   * If results were truncated due to an error, details of that error.
+   * 
+ * + * .google.rpc.Status status = 8; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReadPoolAutoScaleConfig.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReadPoolAutoScaleConfig.java new file mode 100644 index 000000000000..ac87399c164c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReadPoolAutoScaleConfig.java @@ -0,0 +1,2643 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The read pool auto-scale configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ReadPoolAutoScaleConfig} + */ +@com.google.protobuf.Generated +public final class ReadPoolAutoScaleConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ReadPoolAutoScaleConfig) + ReadPoolAutoScaleConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReadPoolAutoScaleConfig"); + } + + // Use ReadPoolAutoScaleConfig.newBuilder() to construct. + private ReadPoolAutoScaleConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReadPoolAutoScaleConfig() { + targetMetrics_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.class, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.Builder.class); + } + + public interface TargetMetricOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The metric name to be used for auto scaling.
+     * 
+ * + * optional string metric = 1; + * + * @return Whether the metric field is set. + */ + boolean hasMetric(); + + /** + * + * + *
+     * The metric name to be used for auto scaling.
+     * 
+ * + * optional string metric = 1; + * + * @return The metric. + */ + java.lang.String getMetric(); + + /** + * + * + *
+     * The metric name to be used for auto scaling.
+     * 
+ * + * optional string metric = 1; + * + * @return The bytes for metric. + */ + com.google.protobuf.ByteString getMetricBytes(); + + /** + * + * + *
+     * The target value for the metric.
+     * 
+ * + * optional float target_value = 2; + * + * @return Whether the targetValue field is set. + */ + boolean hasTargetValue(); + + /** + * + * + *
+     * The target value for the metric.
+     * 
+ * + * optional float target_value = 2; + * + * @return The targetValue. + */ + float getTargetValue(); + } + + /** + * + * + *
+   * Target metric for read pool auto scaling.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric} + */ + public static final class TargetMetric extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric) + TargetMetricOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TargetMetric"); + } + + // Use TargetMetric.newBuilder() to construct. + private TargetMetric(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TargetMetric() { + metric_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_TargetMetric_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_TargetMetric_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.class, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.Builder.class); + } + + private int bitField0_; + public static final int METRIC_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object metric_ = ""; + + /** + * + * + *
+     * The metric name to be used for auto scaling.
+     * 
+ * + * optional string metric = 1; + * + * @return Whether the metric field is set. + */ + @java.lang.Override + public boolean hasMetric() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The metric name to be used for auto scaling.
+     * 
+ * + * optional string metric = 1; + * + * @return The metric. + */ + @java.lang.Override + public java.lang.String getMetric() { + java.lang.Object ref = metric_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metric_ = s; + return s; + } + } + + /** + * + * + *
+     * The metric name to be used for auto scaling.
+     * 
+ * + * optional string metric = 1; + * + * @return The bytes for metric. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetricBytes() { + java.lang.Object ref = metric_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metric_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_VALUE_FIELD_NUMBER = 2; + private float targetValue_ = 0F; + + /** + * + * + *
+     * The target value for the metric.
+     * 
+ * + * optional float target_value = 2; + * + * @return Whether the targetValue field is set. + */ + @java.lang.Override + public boolean hasTargetValue() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The target value for the metric.
+     * 
+ * + * optional float target_value = 2; + * + * @return The targetValue. + */ + @java.lang.Override + public float getTargetValue() { + return targetValue_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, metric_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeFloat(2, targetValue_); + } + 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.GeneratedMessage.computeStringSize(1, metric_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, targetValue_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric other = + (com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric) obj; + + if (hasMetric() != other.hasMetric()) return false; + if (hasMetric()) { + if (!getMetric().equals(other.getMetric())) return false; + } + if (hasTargetValue() != other.hasTargetValue()) return false; + if (hasTargetValue()) { + if (java.lang.Float.floatToIntBits(getTargetValue()) + != java.lang.Float.floatToIntBits(other.getTargetValue())) return false; + } + if (!getUnknownFields().equals(other.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 (hasMetric()) { + hash = (37 * hash) + METRIC_FIELD_NUMBER; + hash = (53 * hash) + getMetric().hashCode(); + } + if (hasTargetValue()) { + hash = (37 * hash) + TARGET_VALUE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getTargetValue()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Target metric for read pool auto scaling.
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric) + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetricOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_TargetMetric_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_TargetMetric_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.class, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + metric_ = ""; + targetValue_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_TargetMetric_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric build() { + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric buildPartial() { + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric result = + new com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.metric_ = metric_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.targetValue_ = targetValue_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric) { + return mergeFrom((com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric other) { + if (other + == com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.getDefaultInstance()) + return this; + if (other.hasMetric()) { + metric_ = other.metric_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasTargetValue()) { + setTargetValue(other.getTargetValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + metric_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: + { + targetValue_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object metric_ = ""; + + /** + * + * + *
+       * The metric name to be used for auto scaling.
+       * 
+ * + * optional string metric = 1; + * + * @return Whether the metric field is set. + */ + public boolean hasMetric() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The metric name to be used for auto scaling.
+       * 
+ * + * optional string metric = 1; + * + * @return The metric. + */ + public java.lang.String getMetric() { + java.lang.Object ref = metric_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metric_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The metric name to be used for auto scaling.
+       * 
+ * + * optional string metric = 1; + * + * @return The bytes for metric. + */ + public com.google.protobuf.ByteString getMetricBytes() { + java.lang.Object ref = metric_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metric_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The metric name to be used for auto scaling.
+       * 
+ * + * optional string metric = 1; + * + * @param value The metric to set. + * @return This builder for chaining. + */ + public Builder setMetric(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + metric_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The metric name to be used for auto scaling.
+       * 
+ * + * optional string metric = 1; + * + * @return This builder for chaining. + */ + public Builder clearMetric() { + metric_ = getDefaultInstance().getMetric(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The metric name to be used for auto scaling.
+       * 
+ * + * optional string metric = 1; + * + * @param value The bytes for metric to set. + * @return This builder for chaining. + */ + public Builder setMetricBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + metric_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private float targetValue_; + + /** + * + * + *
+       * The target value for the metric.
+       * 
+ * + * optional float target_value = 2; + * + * @return Whether the targetValue field is set. + */ + @java.lang.Override + public boolean hasTargetValue() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The target value for the metric.
+       * 
+ * + * optional float target_value = 2; + * + * @return The targetValue. + */ + @java.lang.Override + public float getTargetValue() { + return targetValue_; + } + + /** + * + * + *
+       * The target value for the metric.
+       * 
+ * + * optional float target_value = 2; + * + * @param value The targetValue to set. + * @return This builder for chaining. + */ + public Builder setTargetValue(float value) { + + targetValue_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The target value for the metric.
+       * 
+ * + * optional float target_value = 2; + * + * @return This builder for chaining. + */ + public Builder clearTargetValue() { + bitField0_ = (bitField0_ & ~0x00000002); + targetValue_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric) + private static final com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric(); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TargetMetric parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + + /** + * + * + *
+   * Indicates whether read pool auto scaling is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Indicates whether read pool auto scaling is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + public static final int MIN_NODE_COUNT_FIELD_NUMBER = 2; + private int minNodeCount_ = 0; + + /** + * + * + *
+   * Minimum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 min_node_count = 2; + * + * @return Whether the minNodeCount field is set. + */ + @java.lang.Override + public boolean hasMinNodeCount() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Minimum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 min_node_count = 2; + * + * @return The minNodeCount. + */ + @java.lang.Override + public int getMinNodeCount() { + return minNodeCount_; + } + + public static final int MAX_NODE_COUNT_FIELD_NUMBER = 3; + private int maxNodeCount_ = 0; + + /** + * + * + *
+   * Maximum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 max_node_count = 3; + * + * @return Whether the maxNodeCount field is set. + */ + @java.lang.Override + public boolean hasMaxNodeCount() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Maximum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 max_node_count = 3; + * + * @return The maxNodeCount. + */ + @java.lang.Override + public int getMaxNodeCount() { + return maxNodeCount_; + } + + public static final int TARGET_METRICS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List + targetMetrics_; + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getTargetMetricsList() { + return targetMetrics_; + } + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetricOrBuilder> + getTargetMetricsOrBuilderList() { + return targetMetrics_; + } + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getTargetMetricsCount() { + return targetMetrics_.size(); + } + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric getTargetMetrics(int index) { + return targetMetrics_.get(index); + } + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetricOrBuilder + getTargetMetricsOrBuilder(int index) { + return targetMetrics_.get(index); + } + + public static final int DISABLE_SCALE_IN_FIELD_NUMBER = 5; + private boolean disableScaleIn_ = false; + + /** + * + * + *
+   * Indicates whether read pool auto scaling supports scale in operations
+   * (removing nodes).
+   * 
+ * + * optional bool disable_scale_in = 5; + * + * @return Whether the disableScaleIn field is set. + */ + @java.lang.Override + public boolean hasDisableScaleIn() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Indicates whether read pool auto scaling supports scale in operations
+   * (removing nodes).
+   * 
+ * + * optional bool disable_scale_in = 5; + * + * @return The disableScaleIn. + */ + @java.lang.Override + public boolean getDisableScaleIn() { + return disableScaleIn_; + } + + public static final int SCALE_IN_COOLDOWN_SECONDS_FIELD_NUMBER = 6; + private int scaleInCooldownSeconds_ = 0; + + /** + * + * + *
+   * The cooldown period for scale-in operations.
+   * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @return Whether the scaleInCooldownSeconds field is set. + */ + @java.lang.Override + public boolean hasScaleInCooldownSeconds() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * The cooldown period for scale-in operations.
+   * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @return The scaleInCooldownSeconds. + */ + @java.lang.Override + public int getScaleInCooldownSeconds() { + return scaleInCooldownSeconds_; + } + + public static final int SCALE_OUT_COOLDOWN_SECONDS_FIELD_NUMBER = 7; + private int scaleOutCooldownSeconds_ = 0; + + /** + * + * + *
+   * The cooldown period for scale-out operations.
+   * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @return Whether the scaleOutCooldownSeconds field is set. + */ + @java.lang.Override + public boolean hasScaleOutCooldownSeconds() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * The cooldown period for scale-out operations.
+   * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @return The scaleOutCooldownSeconds. + */ + @java.lang.Override + public int getScaleOutCooldownSeconds() { + return scaleOutCooldownSeconds_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, enabled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(2, minNodeCount_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(3, maxNodeCount_); + } + for (int i = 0; i < targetMetrics_.size(); i++) { + output.writeMessage(4, targetMetrics_.get(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeBool(5, disableScaleIn_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeInt32(6, scaleInCooldownSeconds_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeInt32(7, scaleOutCooldownSeconds_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enabled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, minNodeCount_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxNodeCount_); + } + for (int i = 0; i < targetMetrics_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, targetMetrics_.get(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, disableScaleIn_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, scaleInCooldownSeconds_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, scaleOutCooldownSeconds_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ReadPoolAutoScaleConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig other = + (com.google.cloud.sql.v1.ReadPoolAutoScaleConfig) obj; + + if (hasEnabled() != other.hasEnabled()) return false; + if (hasEnabled()) { + if (getEnabled() != other.getEnabled()) return false; + } + if (hasMinNodeCount() != other.hasMinNodeCount()) return false; + if (hasMinNodeCount()) { + if (getMinNodeCount() != other.getMinNodeCount()) return false; + } + if (hasMaxNodeCount() != other.hasMaxNodeCount()) return false; + if (hasMaxNodeCount()) { + if (getMaxNodeCount() != other.getMaxNodeCount()) return false; + } + if (!getTargetMetricsList().equals(other.getTargetMetricsList())) return false; + if (hasDisableScaleIn() != other.hasDisableScaleIn()) return false; + if (hasDisableScaleIn()) { + if (getDisableScaleIn() != other.getDisableScaleIn()) return false; + } + if (hasScaleInCooldownSeconds() != other.hasScaleInCooldownSeconds()) return false; + if (hasScaleInCooldownSeconds()) { + if (getScaleInCooldownSeconds() != other.getScaleInCooldownSeconds()) return false; + } + if (hasScaleOutCooldownSeconds() != other.hasScaleOutCooldownSeconds()) return false; + if (hasScaleOutCooldownSeconds()) { + if (getScaleOutCooldownSeconds() != other.getScaleOutCooldownSeconds()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); + } + if (hasMinNodeCount()) { + hash = (37 * hash) + MIN_NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMinNodeCount(); + } + if (hasMaxNodeCount()) { + hash = (37 * hash) + MAX_NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxNodeCount(); + } + if (getTargetMetricsCount() > 0) { + hash = (37 * hash) + TARGET_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getTargetMetricsList().hashCode(); + } + if (hasDisableScaleIn()) { + hash = (37 * hash) + DISABLE_SCALE_IN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisableScaleIn()); + } + if (hasScaleInCooldownSeconds()) { + hash = (37 * hash) + SCALE_IN_COOLDOWN_SECONDS_FIELD_NUMBER; + hash = (53 * hash) + getScaleInCooldownSeconds(); + } + if (hasScaleOutCooldownSeconds()) { + hash = (37 * hash) + SCALE_OUT_COOLDOWN_SECONDS_FIELD_NUMBER; + hash = (53 * hash) + getScaleOutCooldownSeconds(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.ReadPoolAutoScaleConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The read pool auto-scale configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ReadPoolAutoScaleConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ReadPoolAutoScaleConfig) + com.google.cloud.sql.v1.ReadPoolAutoScaleConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.class, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enabled_ = false; + minNodeCount_ = 0; + maxNodeCount_ = 0; + if (targetMetricsBuilder_ == null) { + targetMetrics_ = java.util.Collections.emptyList(); + } else { + targetMetrics_ = null; + targetMetricsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + disableScaleIn_ = false; + scaleInCooldownSeconds_ = 0; + scaleOutCooldownSeconds_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_ReadPoolAutoScaleConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig build() { + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig buildPartial() { + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig result = + new com.google.cloud.sql.v1.ReadPoolAutoScaleConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig result) { + if (targetMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + targetMetrics_ = java.util.Collections.unmodifiableList(targetMetrics_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.targetMetrics_ = targetMetrics_; + } else { + result.targetMetrics_ = targetMetricsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.ReadPoolAutoScaleConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enabled_ = enabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.minNodeCount_ = minNodeCount_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.maxNodeCount_ = maxNodeCount_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.disableScaleIn_ = disableScaleIn_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.scaleInCooldownSeconds_ = scaleInCooldownSeconds_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.scaleOutCooldownSeconds_ = scaleOutCooldownSeconds_; + to_bitField0_ |= 0x00000020; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ReadPoolAutoScaleConfig) { + return mergeFrom((com.google.cloud.sql.v1.ReadPoolAutoScaleConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ReadPoolAutoScaleConfig other) { + if (other == com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.getDefaultInstance()) + return this; + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); + } + if (other.hasMinNodeCount()) { + setMinNodeCount(other.getMinNodeCount()); + } + if (other.hasMaxNodeCount()) { + setMaxNodeCount(other.getMaxNodeCount()); + } + if (targetMetricsBuilder_ == null) { + if (!other.targetMetrics_.isEmpty()) { + if (targetMetrics_.isEmpty()) { + targetMetrics_ = other.targetMetrics_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureTargetMetricsIsMutable(); + targetMetrics_.addAll(other.targetMetrics_); + } + onChanged(); + } + } else { + if (!other.targetMetrics_.isEmpty()) { + if (targetMetricsBuilder_.isEmpty()) { + targetMetricsBuilder_.dispose(); + targetMetricsBuilder_ = null; + targetMetrics_ = other.targetMetrics_; + bitField0_ = (bitField0_ & ~0x00000008); + targetMetricsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetTargetMetricsFieldBuilder() + : null; + } else { + targetMetricsBuilder_.addAllMessages(other.targetMetrics_); + } + } + } + if (other.hasDisableScaleIn()) { + setDisableScaleIn(other.getDisableScaleIn()); + } + if (other.hasScaleInCooldownSeconds()) { + setScaleInCooldownSeconds(other.getScaleInCooldownSeconds()); + } + if (other.hasScaleOutCooldownSeconds()) { + setScaleOutCooldownSeconds(other.getScaleOutCooldownSeconds()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + minNodeCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + maxNodeCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric m = + input.readMessage( + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.parser(), + extensionRegistry); + if (targetMetricsBuilder_ == null) { + ensureTargetMetricsIsMutable(); + targetMetrics_.add(m); + } else { + targetMetricsBuilder_.addMessage(m); + } + break; + } // case 34 + case 40: + { + disableScaleIn_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + scaleInCooldownSeconds_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: + { + scaleOutCooldownSeconds_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean enabled_; + + /** + * + * + *
+     * Indicates whether read pool auto scaling is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Indicates whether read pool auto scaling is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + /** + * + * + *
+     * Indicates whether read pool auto scaling is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates whether read pool auto scaling is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + enabled_ = false; + onChanged(); + return this; + } + + private int minNodeCount_; + + /** + * + * + *
+     * Minimum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 min_node_count = 2; + * + * @return Whether the minNodeCount field is set. + */ + @java.lang.Override + public boolean hasMinNodeCount() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Minimum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 min_node_count = 2; + * + * @return The minNodeCount. + */ + @java.lang.Override + public int getMinNodeCount() { + return minNodeCount_; + } + + /** + * + * + *
+     * Minimum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 min_node_count = 2; + * + * @param value The minNodeCount to set. + * @return This builder for chaining. + */ + public Builder setMinNodeCount(int value) { + + minNodeCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Minimum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 min_node_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearMinNodeCount() { + bitField0_ = (bitField0_ & ~0x00000002); + minNodeCount_ = 0; + onChanged(); + return this; + } + + private int maxNodeCount_; + + /** + * + * + *
+     * Maximum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 max_node_count = 3; + * + * @return Whether the maxNodeCount field is set. + */ + @java.lang.Override + public boolean hasMaxNodeCount() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Maximum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 max_node_count = 3; + * + * @return The maxNodeCount. + */ + @java.lang.Override + public int getMaxNodeCount() { + return maxNodeCount_; + } + + /** + * + * + *
+     * Maximum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 max_node_count = 3; + * + * @param value The maxNodeCount to set. + * @return This builder for chaining. + */ + public Builder setMaxNodeCount(int value) { + + maxNodeCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 max_node_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearMaxNodeCount() { + bitField0_ = (bitField0_ & ~0x00000004); + maxNodeCount_ = 0; + onChanged(); + return this; + } + + private java.util.List + targetMetrics_ = java.util.Collections.emptyList(); + + private void ensureTargetMetricsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + targetMetrics_ = + new java.util.ArrayList( + targetMetrics_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.Builder, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetricOrBuilder> + targetMetricsBuilder_; + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getTargetMetricsList() { + if (targetMetricsBuilder_ == null) { + return java.util.Collections.unmodifiableList(targetMetrics_); + } else { + return targetMetricsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getTargetMetricsCount() { + if (targetMetricsBuilder_ == null) { + return targetMetrics_.size(); + } else { + return targetMetricsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric getTargetMetrics( + int index) { + if (targetMetricsBuilder_ == null) { + return targetMetrics_.get(index); + } else { + return targetMetricsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTargetMetrics( + int index, com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric value) { + if (targetMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetMetricsIsMutable(); + targetMetrics_.set(index, value); + onChanged(); + } else { + targetMetricsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTargetMetrics( + int index, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.Builder builderForValue) { + if (targetMetricsBuilder_ == null) { + ensureTargetMetricsIsMutable(); + targetMetrics_.set(index, builderForValue.build()); + onChanged(); + } else { + targetMetricsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTargetMetrics( + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric value) { + if (targetMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetMetricsIsMutable(); + targetMetrics_.add(value); + onChanged(); + } else { + targetMetricsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTargetMetrics( + int index, com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric value) { + if (targetMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetMetricsIsMutable(); + targetMetrics_.add(index, value); + onChanged(); + } else { + targetMetricsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTargetMetrics( + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.Builder builderForValue) { + if (targetMetricsBuilder_ == null) { + ensureTargetMetricsIsMutable(); + targetMetrics_.add(builderForValue.build()); + onChanged(); + } else { + targetMetricsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTargetMetrics( + int index, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.Builder builderForValue) { + if (targetMetricsBuilder_ == null) { + ensureTargetMetricsIsMutable(); + targetMetrics_.add(index, builderForValue.build()); + onChanged(); + } else { + targetMetricsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllTargetMetrics( + java.lang.Iterable + values) { + if (targetMetricsBuilder_ == null) { + ensureTargetMetricsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, targetMetrics_); + onChanged(); + } else { + targetMetricsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTargetMetrics() { + if (targetMetricsBuilder_ == null) { + targetMetrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + targetMetricsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeTargetMetrics(int index) { + if (targetMetricsBuilder_ == null) { + ensureTargetMetricsIsMutable(); + targetMetrics_.remove(index); + onChanged(); + } else { + targetMetricsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.Builder + getTargetMetricsBuilder(int index) { + return internalGetTargetMetricsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetricOrBuilder + getTargetMetricsOrBuilder(int index) { + if (targetMetricsBuilder_ == null) { + return targetMetrics_.get(index); + } else { + return targetMetricsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetricOrBuilder> + getTargetMetricsOrBuilderList() { + if (targetMetricsBuilder_ != null) { + return targetMetricsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(targetMetrics_); + } + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.Builder + addTargetMetricsBuilder() { + return internalGetTargetMetricsFieldBuilder() + .addBuilder( + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.Builder + addTargetMetricsBuilder(int index) { + return internalGetTargetMetricsFieldBuilder() + .addBuilder( + index, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getTargetMetricsBuilderList() { + return internalGetTargetMetricsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.Builder, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetricOrBuilder> + internalGetTargetMetricsFieldBuilder() { + if (targetMetricsBuilder_ == null) { + targetMetricsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.Builder, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetricOrBuilder>( + targetMetrics_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + targetMetrics_ = null; + } + return targetMetricsBuilder_; + } + + private boolean disableScaleIn_; + + /** + * + * + *
+     * Indicates whether read pool auto scaling supports scale in operations
+     * (removing nodes).
+     * 
+ * + * optional bool disable_scale_in = 5; + * + * @return Whether the disableScaleIn field is set. + */ + @java.lang.Override + public boolean hasDisableScaleIn() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Indicates whether read pool auto scaling supports scale in operations
+     * (removing nodes).
+     * 
+ * + * optional bool disable_scale_in = 5; + * + * @return The disableScaleIn. + */ + @java.lang.Override + public boolean getDisableScaleIn() { + return disableScaleIn_; + } + + /** + * + * + *
+     * Indicates whether read pool auto scaling supports scale in operations
+     * (removing nodes).
+     * 
+ * + * optional bool disable_scale_in = 5; + * + * @param value The disableScaleIn to set. + * @return This builder for chaining. + */ + public Builder setDisableScaleIn(boolean value) { + + disableScaleIn_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates whether read pool auto scaling supports scale in operations
+     * (removing nodes).
+     * 
+ * + * optional bool disable_scale_in = 5; + * + * @return This builder for chaining. + */ + public Builder clearDisableScaleIn() { + bitField0_ = (bitField0_ & ~0x00000010); + disableScaleIn_ = false; + onChanged(); + return this; + } + + private int scaleInCooldownSeconds_; + + /** + * + * + *
+     * The cooldown period for scale-in operations.
+     * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @return Whether the scaleInCooldownSeconds field is set. + */ + @java.lang.Override + public boolean hasScaleInCooldownSeconds() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * The cooldown period for scale-in operations.
+     * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @return The scaleInCooldownSeconds. + */ + @java.lang.Override + public int getScaleInCooldownSeconds() { + return scaleInCooldownSeconds_; + } + + /** + * + * + *
+     * The cooldown period for scale-in operations.
+     * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @param value The scaleInCooldownSeconds to set. + * @return This builder for chaining. + */ + public Builder setScaleInCooldownSeconds(int value) { + + scaleInCooldownSeconds_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The cooldown period for scale-in operations.
+     * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @return This builder for chaining. + */ + public Builder clearScaleInCooldownSeconds() { + bitField0_ = (bitField0_ & ~0x00000020); + scaleInCooldownSeconds_ = 0; + onChanged(); + return this; + } + + private int scaleOutCooldownSeconds_; + + /** + * + * + *
+     * The cooldown period for scale-out operations.
+     * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @return Whether the scaleOutCooldownSeconds field is set. + */ + @java.lang.Override + public boolean hasScaleOutCooldownSeconds() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * The cooldown period for scale-out operations.
+     * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @return The scaleOutCooldownSeconds. + */ + @java.lang.Override + public int getScaleOutCooldownSeconds() { + return scaleOutCooldownSeconds_; + } + + /** + * + * + *
+     * The cooldown period for scale-out operations.
+     * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @param value The scaleOutCooldownSeconds to set. + * @return This builder for chaining. + */ + public Builder setScaleOutCooldownSeconds(int value) { + + scaleOutCooldownSeconds_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The cooldown period for scale-out operations.
+     * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @return This builder for chaining. + */ + public Builder clearScaleOutCooldownSeconds() { + bitField0_ = (bitField0_ & ~0x00000040); + scaleOutCooldownSeconds_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ReadPoolAutoScaleConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ReadPoolAutoScaleConfig) + private static final com.google.cloud.sql.v1.ReadPoolAutoScaleConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ReadPoolAutoScaleConfig(); + } + + public static com.google.cloud.sql.v1.ReadPoolAutoScaleConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadPoolAutoScaleConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReadPoolAutoScaleConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReadPoolAutoScaleConfigOrBuilder.java new file mode 100644 index 000000000000..7d6ec4bb3a9f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReadPoolAutoScaleConfigOrBuilder.java @@ -0,0 +1,254 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ReadPoolAutoScaleConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ReadPoolAutoScaleConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Indicates whether read pool auto scaling is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + + /** + * + * + *
+   * Indicates whether read pool auto scaling is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + boolean getEnabled(); + + /** + * + * + *
+   * Minimum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 min_node_count = 2; + * + * @return Whether the minNodeCount field is set. + */ + boolean hasMinNodeCount(); + + /** + * + * + *
+   * Minimum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 min_node_count = 2; + * + * @return The minNodeCount. + */ + int getMinNodeCount(); + + /** + * + * + *
+   * Maximum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 max_node_count = 3; + * + * @return Whether the maxNodeCount field is set. + */ + boolean hasMaxNodeCount(); + + /** + * + * + *
+   * Maximum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 max_node_count = 3; + * + * @return The maxNodeCount. + */ + int getMaxNodeCount(); + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getTargetMetricsList(); + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric getTargetMetrics(int index); + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getTargetMetricsCount(); + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getTargetMetricsOrBuilderList(); + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetricOrBuilder getTargetMetricsOrBuilder( + int index); + + /** + * + * + *
+   * Indicates whether read pool auto scaling supports scale in operations
+   * (removing nodes).
+   * 
+ * + * optional bool disable_scale_in = 5; + * + * @return Whether the disableScaleIn field is set. + */ + boolean hasDisableScaleIn(); + + /** + * + * + *
+   * Indicates whether read pool auto scaling supports scale in operations
+   * (removing nodes).
+   * 
+ * + * optional bool disable_scale_in = 5; + * + * @return The disableScaleIn. + */ + boolean getDisableScaleIn(); + + /** + * + * + *
+   * The cooldown period for scale-in operations.
+   * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @return Whether the scaleInCooldownSeconds field is set. + */ + boolean hasScaleInCooldownSeconds(); + + /** + * + * + *
+   * The cooldown period for scale-in operations.
+   * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @return The scaleInCooldownSeconds. + */ + int getScaleInCooldownSeconds(); + + /** + * + * + *
+   * The cooldown period for scale-out operations.
+   * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @return Whether the scaleOutCooldownSeconds field is set. + */ + boolean hasScaleOutCooldownSeconds(); + + /** + * + * + *
+   * The cooldown period for scale-out operations.
+   * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @return The scaleOutCooldownSeconds. + */ + int getScaleOutCooldownSeconds(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReplicaConfiguration.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReplicaConfiguration.java new file mode 100644 index 000000000000..7d2c13fab174 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReplicaConfiguration.java @@ -0,0 +1,1623 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Read-replica configuration for connecting to the primary instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ReplicaConfiguration} + */ +@com.google.protobuf.Generated +public final class ReplicaConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ReplicaConfiguration) + ReplicaConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReplicaConfiguration"); + } + + // Use ReplicaConfiguration.newBuilder() to construct. + private ReplicaConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReplicaConfiguration() { + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ReplicaConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ReplicaConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ReplicaConfiguration.class, + com.google.cloud.sql.v1.ReplicaConfiguration.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#replicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#replicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MYSQL_REPLICA_CONFIGURATION_FIELD_NUMBER = 2; + private com.google.cloud.sql.v1.MySqlReplicaConfiguration mysqlReplicaConfiguration_; + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * @return Whether the mysqlReplicaConfiguration field is set. + */ + @java.lang.Override + public boolean hasMysqlReplicaConfiguration() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * @return The mysqlReplicaConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1.MySqlReplicaConfiguration getMysqlReplicaConfiguration() { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1.MySqlReplicaConfiguration.getDefaultInstance() + : mysqlReplicaConfiguration_; + } + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.MySqlReplicaConfigurationOrBuilder + getMysqlReplicaConfigurationOrBuilder() { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1.MySqlReplicaConfiguration.getDefaultInstance() + : mysqlReplicaConfiguration_; + } + + public static final int FAILOVER_TARGET_FIELD_NUMBER = 3; + private com.google.protobuf.BoolValue failoverTarget_; + + /** + * + * + *
+   * Specifies if the replica is the failover target. If the field is set to
+   * `true`, the replica will be designated as a failover replica. In case the
+   * primary instance fails, the replica instance will be promoted as the new
+   * primary instance. Only one replica can be specified as failover target, and
+   * the replica has to be in different zone with the primary instance.
+   * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + * + * @return Whether the failoverTarget field is set. + */ + @java.lang.Override + public boolean hasFailoverTarget() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Specifies if the replica is the failover target. If the field is set to
+   * `true`, the replica will be designated as a failover replica. In case the
+   * primary instance fails, the replica instance will be promoted as the new
+   * primary instance. Only one replica can be specified as failover target, and
+   * the replica has to be in different zone with the primary instance.
+   * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + * + * @return The failoverTarget. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getFailoverTarget() { + return failoverTarget_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : failoverTarget_; + } + + /** + * + * + *
+   * Specifies if the replica is the failover target. If the field is set to
+   * `true`, the replica will be designated as a failover replica. In case the
+   * primary instance fails, the replica instance will be promoted as the new
+   * primary instance. Only one replica can be specified as failover target, and
+   * the replica has to be in different zone with the primary instance.
+   * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getFailoverTargetOrBuilder() { + return failoverTarget_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : failoverTarget_; + } + + public static final int CASCADABLE_REPLICA_FIELD_NUMBER = 5; + private com.google.protobuf.BoolValue cascadableReplica_; + + /** + * + * + *
+   * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+   * cascadable replica is a SQL Server cross region replica that supports
+   * replica(s) under it.
+   * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cascadableReplica field is set. + */ + @java.lang.Override + public boolean hasCascadableReplica() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+   * cascadable replica is a SQL Server cross region replica that supports
+   * replica(s) under it.
+   * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cascadableReplica. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getCascadableReplica() { + return cascadableReplica_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : cascadableReplica_; + } + + /** + * + * + *
+   * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+   * cascadable replica is a SQL Server cross region replica that supports
+   * replica(s) under it.
+   * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getCascadableReplicaOrBuilder() { + return cascadableReplica_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : cascadableReplica_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getMysqlReplicaConfiguration()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getFailoverTarget()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getCascadableReplica()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getMysqlReplicaConfiguration()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFailoverTarget()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCascadableReplica()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ReplicaConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ReplicaConfiguration other = + (com.google.cloud.sql.v1.ReplicaConfiguration) obj; + + if (!getKind().equals(other.getKind())) return false; + if (hasMysqlReplicaConfiguration() != other.hasMysqlReplicaConfiguration()) return false; + if (hasMysqlReplicaConfiguration()) { + if (!getMysqlReplicaConfiguration().equals(other.getMysqlReplicaConfiguration())) + return false; + } + if (hasFailoverTarget() != other.hasFailoverTarget()) return false; + if (hasFailoverTarget()) { + if (!getFailoverTarget().equals(other.getFailoverTarget())) return false; + } + if (hasCascadableReplica() != other.hasCascadableReplica()) return false; + if (hasCascadableReplica()) { + if (!getCascadableReplica().equals(other.getCascadableReplica())) return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasMysqlReplicaConfiguration()) { + hash = (37 * hash) + MYSQL_REPLICA_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getMysqlReplicaConfiguration().hashCode(); + } + if (hasFailoverTarget()) { + hash = (37 * hash) + FAILOVER_TARGET_FIELD_NUMBER; + hash = (53 * hash) + getFailoverTarget().hashCode(); + } + if (hasCascadableReplica()) { + hash = (37 * hash) + CASCADABLE_REPLICA_FIELD_NUMBER; + hash = (53 * hash) + getCascadableReplica().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ReplicaConfiguration parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ReplicaConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReplicaConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ReplicaConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReplicaConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ReplicaConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReplicaConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ReplicaConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReplicaConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ReplicaConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReplicaConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ReplicaConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.ReplicaConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Read-replica configuration for connecting to the primary instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ReplicaConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ReplicaConfiguration) + com.google.cloud.sql.v1.ReplicaConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ReplicaConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ReplicaConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ReplicaConfiguration.class, + com.google.cloud.sql.v1.ReplicaConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ReplicaConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMysqlReplicaConfigurationFieldBuilder(); + internalGetFailoverTargetFieldBuilder(); + internalGetCascadableReplicaFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + mysqlReplicaConfiguration_ = null; + if (mysqlReplicaConfigurationBuilder_ != null) { + mysqlReplicaConfigurationBuilder_.dispose(); + mysqlReplicaConfigurationBuilder_ = null; + } + failoverTarget_ = null; + if (failoverTargetBuilder_ != null) { + failoverTargetBuilder_.dispose(); + failoverTargetBuilder_ = null; + } + cascadableReplica_ = null; + if (cascadableReplicaBuilder_ != null) { + cascadableReplicaBuilder_.dispose(); + cascadableReplicaBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ReplicaConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReplicaConfiguration getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ReplicaConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReplicaConfiguration build() { + com.google.cloud.sql.v1.ReplicaConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReplicaConfiguration buildPartial() { + com.google.cloud.sql.v1.ReplicaConfiguration result = + new com.google.cloud.sql.v1.ReplicaConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ReplicaConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mysqlReplicaConfiguration_ = + mysqlReplicaConfigurationBuilder_ == null + ? mysqlReplicaConfiguration_ + : mysqlReplicaConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.failoverTarget_ = + failoverTargetBuilder_ == null ? failoverTarget_ : failoverTargetBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.cascadableReplica_ = + cascadableReplicaBuilder_ == null + ? cascadableReplica_ + : cascadableReplicaBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ReplicaConfiguration) { + return mergeFrom((com.google.cloud.sql.v1.ReplicaConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ReplicaConfiguration other) { + if (other == com.google.cloud.sql.v1.ReplicaConfiguration.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasMysqlReplicaConfiguration()) { + mergeMysqlReplicaConfiguration(other.getMysqlReplicaConfiguration()); + } + if (other.hasFailoverTarget()) { + mergeFailoverTarget(other.getFailoverTarget()); + } + if (other.hasCascadableReplica()) { + mergeCascadableReplica(other.getCascadableReplica()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetMysqlReplicaConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetFailoverTargetFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + input.readMessage( + internalGetCascadableReplicaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#replicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#replicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#replicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#replicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#replicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.MySqlReplicaConfiguration mysqlReplicaConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.MySqlReplicaConfiguration, + com.google.cloud.sql.v1.MySqlReplicaConfiguration.Builder, + com.google.cloud.sql.v1.MySqlReplicaConfigurationOrBuilder> + mysqlReplicaConfigurationBuilder_; + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * @return Whether the mysqlReplicaConfiguration field is set. + */ + public boolean hasMysqlReplicaConfiguration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * @return The mysqlReplicaConfiguration. + */ + public com.google.cloud.sql.v1.MySqlReplicaConfiguration getMysqlReplicaConfiguration() { + if (mysqlReplicaConfigurationBuilder_ == null) { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1.MySqlReplicaConfiguration.getDefaultInstance() + : mysqlReplicaConfiguration_; + } else { + return mysqlReplicaConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + */ + public Builder setMysqlReplicaConfiguration( + com.google.cloud.sql.v1.MySqlReplicaConfiguration value) { + if (mysqlReplicaConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mysqlReplicaConfiguration_ = value; + } else { + mysqlReplicaConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + */ + public Builder setMysqlReplicaConfiguration( + com.google.cloud.sql.v1.MySqlReplicaConfiguration.Builder builderForValue) { + if (mysqlReplicaConfigurationBuilder_ == null) { + mysqlReplicaConfiguration_ = builderForValue.build(); + } else { + mysqlReplicaConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + */ + public Builder mergeMysqlReplicaConfiguration( + com.google.cloud.sql.v1.MySqlReplicaConfiguration value) { + if (mysqlReplicaConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && mysqlReplicaConfiguration_ != null + && mysqlReplicaConfiguration_ + != com.google.cloud.sql.v1.MySqlReplicaConfiguration.getDefaultInstance()) { + getMysqlReplicaConfigurationBuilder().mergeFrom(value); + } else { + mysqlReplicaConfiguration_ = value; + } + } else { + mysqlReplicaConfigurationBuilder_.mergeFrom(value); + } + if (mysqlReplicaConfiguration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + */ + public Builder clearMysqlReplicaConfiguration() { + bitField0_ = (bitField0_ & ~0x00000002); + mysqlReplicaConfiguration_ = null; + if (mysqlReplicaConfigurationBuilder_ != null) { + mysqlReplicaConfigurationBuilder_.dispose(); + mysqlReplicaConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + */ + public com.google.cloud.sql.v1.MySqlReplicaConfiguration.Builder + getMysqlReplicaConfigurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetMysqlReplicaConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + */ + public com.google.cloud.sql.v1.MySqlReplicaConfigurationOrBuilder + getMysqlReplicaConfigurationOrBuilder() { + if (mysqlReplicaConfigurationBuilder_ != null) { + return mysqlReplicaConfigurationBuilder_.getMessageOrBuilder(); + } else { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1.MySqlReplicaConfiguration.getDefaultInstance() + : mysqlReplicaConfiguration_; + } + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.MySqlReplicaConfiguration, + com.google.cloud.sql.v1.MySqlReplicaConfiguration.Builder, + com.google.cloud.sql.v1.MySqlReplicaConfigurationOrBuilder> + internalGetMysqlReplicaConfigurationFieldBuilder() { + if (mysqlReplicaConfigurationBuilder_ == null) { + mysqlReplicaConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.MySqlReplicaConfiguration, + com.google.cloud.sql.v1.MySqlReplicaConfiguration.Builder, + com.google.cloud.sql.v1.MySqlReplicaConfigurationOrBuilder>( + getMysqlReplicaConfiguration(), getParentForChildren(), isClean()); + mysqlReplicaConfiguration_ = null; + } + return mysqlReplicaConfigurationBuilder_; + } + + private com.google.protobuf.BoolValue failoverTarget_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + failoverTargetBuilder_; + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true`, the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + * + * @return Whether the failoverTarget field is set. + */ + public boolean hasFailoverTarget() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true`, the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + * + * @return The failoverTarget. + */ + public com.google.protobuf.BoolValue getFailoverTarget() { + if (failoverTargetBuilder_ == null) { + return failoverTarget_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : failoverTarget_; + } else { + return failoverTargetBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true`, the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + public Builder setFailoverTarget(com.google.protobuf.BoolValue value) { + if (failoverTargetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + failoverTarget_ = value; + } else { + failoverTargetBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true`, the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + public Builder setFailoverTarget(com.google.protobuf.BoolValue.Builder builderForValue) { + if (failoverTargetBuilder_ == null) { + failoverTarget_ = builderForValue.build(); + } else { + failoverTargetBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true`, the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + public Builder mergeFailoverTarget(com.google.protobuf.BoolValue value) { + if (failoverTargetBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && failoverTarget_ != null + && failoverTarget_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getFailoverTargetBuilder().mergeFrom(value); + } else { + failoverTarget_ = value; + } + } else { + failoverTargetBuilder_.mergeFrom(value); + } + if (failoverTarget_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true`, the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + public Builder clearFailoverTarget() { + bitField0_ = (bitField0_ & ~0x00000004); + failoverTarget_ = null; + if (failoverTargetBuilder_ != null) { + failoverTargetBuilder_.dispose(); + failoverTargetBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true`, the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + public com.google.protobuf.BoolValue.Builder getFailoverTargetBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetFailoverTargetFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true`, the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + public com.google.protobuf.BoolValueOrBuilder getFailoverTargetOrBuilder() { + if (failoverTargetBuilder_ != null) { + return failoverTargetBuilder_.getMessageOrBuilder(); + } else { + return failoverTarget_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : failoverTarget_; + } + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true`, the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetFailoverTargetFieldBuilder() { + if (failoverTargetBuilder_ == null) { + failoverTargetBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getFailoverTarget(), getParentForChildren(), isClean()); + failoverTarget_ = null; + } + return failoverTargetBuilder_; + } + + private com.google.protobuf.BoolValue cascadableReplica_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + cascadableReplicaBuilder_; + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cascadableReplica field is set. + */ + public boolean hasCascadableReplica() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cascadableReplica. + */ + public com.google.protobuf.BoolValue getCascadableReplica() { + if (cascadableReplicaBuilder_ == null) { + return cascadableReplica_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : cascadableReplica_; + } else { + return cascadableReplicaBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCascadableReplica(com.google.protobuf.BoolValue value) { + if (cascadableReplicaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cascadableReplica_ = value; + } else { + cascadableReplicaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCascadableReplica(com.google.protobuf.BoolValue.Builder builderForValue) { + if (cascadableReplicaBuilder_ == null) { + cascadableReplica_ = builderForValue.build(); + } else { + cascadableReplicaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeCascadableReplica(com.google.protobuf.BoolValue value) { + if (cascadableReplicaBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && cascadableReplica_ != null + && cascadableReplica_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getCascadableReplicaBuilder().mergeFrom(value); + } else { + cascadableReplica_ = value; + } + } else { + cascadableReplicaBuilder_.mergeFrom(value); + } + if (cascadableReplica_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearCascadableReplica() { + bitField0_ = (bitField0_ & ~0x00000008); + cascadableReplica_ = null; + if (cascadableReplicaBuilder_ != null) { + cascadableReplicaBuilder_.dispose(); + cascadableReplicaBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getCascadableReplicaBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetCascadableReplicaFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getCascadableReplicaOrBuilder() { + if (cascadableReplicaBuilder_ != null) { + return cascadableReplicaBuilder_.getMessageOrBuilder(); + } else { + return cascadableReplica_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : cascadableReplica_; + } + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetCascadableReplicaFieldBuilder() { + if (cascadableReplicaBuilder_ == null) { + cascadableReplicaBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getCascadableReplica(), getParentForChildren(), isClean()); + cascadableReplica_ = null; + } + return cascadableReplicaBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ReplicaConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ReplicaConfiguration) + private static final com.google.cloud.sql.v1.ReplicaConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ReplicaConfiguration(); + } + + public static com.google.cloud.sql.v1.ReplicaConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReplicaConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReplicaConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReplicaConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReplicaConfigurationOrBuilder.java new file mode 100644 index 000000000000..c2aca4eda6df --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReplicaConfigurationOrBuilder.java @@ -0,0 +1,205 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ReplicaConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ReplicaConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#replicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#replicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * @return Whether the mysqlReplicaConfiguration field is set. + */ + boolean hasMysqlReplicaConfiguration(); + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * @return The mysqlReplicaConfiguration. + */ + com.google.cloud.sql.v1.MySqlReplicaConfiguration getMysqlReplicaConfiguration(); + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * .google.cloud.sql.v1.MySqlReplicaConfiguration mysql_replica_configuration = 2; + */ + com.google.cloud.sql.v1.MySqlReplicaConfigurationOrBuilder + getMysqlReplicaConfigurationOrBuilder(); + + /** + * + * + *
+   * Specifies if the replica is the failover target. If the field is set to
+   * `true`, the replica will be designated as a failover replica. In case the
+   * primary instance fails, the replica instance will be promoted as the new
+   * primary instance. Only one replica can be specified as failover target, and
+   * the replica has to be in different zone with the primary instance.
+   * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + * + * @return Whether the failoverTarget field is set. + */ + boolean hasFailoverTarget(); + + /** + * + * + *
+   * Specifies if the replica is the failover target. If the field is set to
+   * `true`, the replica will be designated as a failover replica. In case the
+   * primary instance fails, the replica instance will be promoted as the new
+   * primary instance. Only one replica can be specified as failover target, and
+   * the replica has to be in different zone with the primary instance.
+   * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + * + * @return The failoverTarget. + */ + com.google.protobuf.BoolValue getFailoverTarget(); + + /** + * + * + *
+   * Specifies if the replica is the failover target. If the field is set to
+   * `true`, the replica will be designated as a failover replica. In case the
+   * primary instance fails, the replica instance will be promoted as the new
+   * primary instance. Only one replica can be specified as failover target, and
+   * the replica has to be in different zone with the primary instance.
+   * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + com.google.protobuf.BoolValueOrBuilder getFailoverTargetOrBuilder(); + + /** + * + * + *
+   * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+   * cascadable replica is a SQL Server cross region replica that supports
+   * replica(s) under it.
+   * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cascadableReplica field is set. + */ + boolean hasCascadableReplica(); + + /** + * + * + *
+   * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+   * cascadable replica is a SQL Server cross region replica that supports
+   * replica(s) under it.
+   * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cascadableReplica. + */ + com.google.protobuf.BoolValue getCascadableReplica(); + + /** + * + * + *
+   * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+   * cascadable replica is a SQL Server cross region replica that supports
+   * replica(s) under it.
+   * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getCascadableReplicaOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReplicationCluster.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReplicationCluster.java new file mode 100644 index 000000000000..1c2a20f3e8a3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReplicationCluster.java @@ -0,0 +1,975 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * A primary instance and disaster recovery (DR) replica pair.
+ * A DR replica is a cross-region replica that you designate for failover in
+ * the event that the primary instance experiences regional failure.
+ * Applicable to MySQL and PostgreSQL.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ReplicationCluster} + */ +@com.google.protobuf.Generated +public final class ReplicationCluster extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ReplicationCluster) + ReplicationClusterOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReplicationCluster"); + } + + // Use ReplicationCluster.newBuilder() to construct. + private ReplicationCluster(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReplicationCluster() { + psaWriteEndpoint_ = ""; + failoverDrReplicaName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ReplicationCluster_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ReplicationCluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ReplicationCluster.class, + com.google.cloud.sql.v1.ReplicationCluster.Builder.class); + } + + public static final int PSA_WRITE_ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object psaWriteEndpoint_ = ""; + + /** + * + * + *
+   * Output only. If set, this field indicates this instance has a private
+   * service access (PSA) DNS endpoint that is pointing to the primary instance
+   * of the cluster. If this instance is the primary, then the DNS endpoint
+   * points to this instance. After a switchover or replica failover operation,
+   * this DNS endpoint points to the promoted instance. This is a read-only
+   * field, returned to the user as information. This field can exist even if a
+   * standalone instance doesn't have a DR replica yet or the DR replica is
+   * deleted.
+   * 
+ * + * string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The psaWriteEndpoint. + */ + @java.lang.Override + public java.lang.String getPsaWriteEndpoint() { + java.lang.Object ref = psaWriteEndpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + psaWriteEndpoint_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. If set, this field indicates this instance has a private
+   * service access (PSA) DNS endpoint that is pointing to the primary instance
+   * of the cluster. If this instance is the primary, then the DNS endpoint
+   * points to this instance. After a switchover or replica failover operation,
+   * this DNS endpoint points to the promoted instance. This is a read-only
+   * field, returned to the user as information. This field can exist even if a
+   * standalone instance doesn't have a DR replica yet or the DR replica is
+   * deleted.
+   * 
+ * + * string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for psaWriteEndpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPsaWriteEndpointBytes() { + java.lang.Object ref = psaWriteEndpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + psaWriteEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FAILOVER_DR_REPLICA_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object failoverDrReplicaName_ = ""; + + /** + * + * + *
+   * Optional. If the instance is a primary instance, then this field identifies
+   * the disaster recovery (DR) replica. A DR replica is an optional
+   * configuration for Enterprise Plus edition instances. If the instance is a
+   * read replica, then the field is not set. Set this field to a replica name
+   * to designate a DR replica for a primary instance. Remove the replica name
+   * to remove the DR replica designation.
+   * 
+ * + * string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The failoverDrReplicaName. + */ + @java.lang.Override + public java.lang.String getFailoverDrReplicaName() { + java.lang.Object ref = failoverDrReplicaName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + failoverDrReplicaName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. If the instance is a primary instance, then this field identifies
+   * the disaster recovery (DR) replica. A DR replica is an optional
+   * configuration for Enterprise Plus edition instances. If the instance is a
+   * read replica, then the field is not set. Set this field to a replica name
+   * to designate a DR replica for a primary instance. Remove the replica name
+   * to remove the DR replica designation.
+   * 
+ * + * string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for failoverDrReplicaName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFailoverDrReplicaNameBytes() { + java.lang.Object ref = failoverDrReplicaName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + failoverDrReplicaName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DR_REPLICA_FIELD_NUMBER = 4; + private boolean drReplica_ = false; + + /** + * + * + *
+   * Output only. Read-only field that indicates whether the replica is a DR
+   * replica. This field is not set if the instance is a primary instance.
+   * 
+ * + * bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The drReplica. + */ + @java.lang.Override + public boolean getDrReplica() { + return drReplica_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(psaWriteEndpoint_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, psaWriteEndpoint_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(failoverDrReplicaName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, failoverDrReplicaName_); + } + if (drReplica_ != false) { + output.writeBool(4, drReplica_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(psaWriteEndpoint_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, psaWriteEndpoint_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(failoverDrReplicaName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, failoverDrReplicaName_); + } + if (drReplica_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, drReplica_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ReplicationCluster)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ReplicationCluster other = + (com.google.cloud.sql.v1.ReplicationCluster) obj; + + if (!getPsaWriteEndpoint().equals(other.getPsaWriteEndpoint())) return false; + if (!getFailoverDrReplicaName().equals(other.getFailoverDrReplicaName())) return false; + if (getDrReplica() != other.getDrReplica()) return false; + if (!getUnknownFields().equals(other.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) + PSA_WRITE_ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getPsaWriteEndpoint().hashCode(); + hash = (37 * hash) + FAILOVER_DR_REPLICA_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFailoverDrReplicaName().hashCode(); + hash = (37 * hash) + DR_REPLICA_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDrReplica()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ReplicationCluster parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ReplicationCluster parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReplicationCluster parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ReplicationCluster parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReplicationCluster parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ReplicationCluster parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReplicationCluster parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ReplicationCluster parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReplicationCluster parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ReplicationCluster parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ReplicationCluster parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ReplicationCluster parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.ReplicationCluster prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A primary instance and disaster recovery (DR) replica pair.
+   * A DR replica is a cross-region replica that you designate for failover in
+   * the event that the primary instance experiences regional failure.
+   * Applicable to MySQL and PostgreSQL.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ReplicationCluster} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ReplicationCluster) + com.google.cloud.sql.v1.ReplicationClusterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ReplicationCluster_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ReplicationCluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ReplicationCluster.class, + com.google.cloud.sql.v1.ReplicationCluster.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ReplicationCluster.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + psaWriteEndpoint_ = ""; + failoverDrReplicaName_ = ""; + drReplica_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_ReplicationCluster_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReplicationCluster getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ReplicationCluster.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReplicationCluster build() { + com.google.cloud.sql.v1.ReplicationCluster result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReplicationCluster buildPartial() { + com.google.cloud.sql.v1.ReplicationCluster result = + new com.google.cloud.sql.v1.ReplicationCluster(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ReplicationCluster result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.psaWriteEndpoint_ = psaWriteEndpoint_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.failoverDrReplicaName_ = failoverDrReplicaName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.drReplica_ = drReplica_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ReplicationCluster) { + return mergeFrom((com.google.cloud.sql.v1.ReplicationCluster) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ReplicationCluster other) { + if (other == com.google.cloud.sql.v1.ReplicationCluster.getDefaultInstance()) return this; + if (!other.getPsaWriteEndpoint().isEmpty()) { + psaWriteEndpoint_ = other.psaWriteEndpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFailoverDrReplicaName().isEmpty()) { + failoverDrReplicaName_ = other.failoverDrReplicaName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getDrReplica() != false) { + setDrReplica(other.getDrReplica()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + psaWriteEndpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + failoverDrReplicaName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 32: + { + drReplica_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object psaWriteEndpoint_ = ""; + + /** + * + * + *
+     * Output only. If set, this field indicates this instance has a private
+     * service access (PSA) DNS endpoint that is pointing to the primary instance
+     * of the cluster. If this instance is the primary, then the DNS endpoint
+     * points to this instance. After a switchover or replica failover operation,
+     * this DNS endpoint points to the promoted instance. This is a read-only
+     * field, returned to the user as information. This field can exist even if a
+     * standalone instance doesn't have a DR replica yet or the DR replica is
+     * deleted.
+     * 
+ * + * string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The psaWriteEndpoint. + */ + public java.lang.String getPsaWriteEndpoint() { + java.lang.Object ref = psaWriteEndpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + psaWriteEndpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. If set, this field indicates this instance has a private
+     * service access (PSA) DNS endpoint that is pointing to the primary instance
+     * of the cluster. If this instance is the primary, then the DNS endpoint
+     * points to this instance. After a switchover or replica failover operation,
+     * this DNS endpoint points to the promoted instance. This is a read-only
+     * field, returned to the user as information. This field can exist even if a
+     * standalone instance doesn't have a DR replica yet or the DR replica is
+     * deleted.
+     * 
+ * + * string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for psaWriteEndpoint. + */ + public com.google.protobuf.ByteString getPsaWriteEndpointBytes() { + java.lang.Object ref = psaWriteEndpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + psaWriteEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. If set, this field indicates this instance has a private
+     * service access (PSA) DNS endpoint that is pointing to the primary instance
+     * of the cluster. If this instance is the primary, then the DNS endpoint
+     * points to this instance. After a switchover or replica failover operation,
+     * this DNS endpoint points to the promoted instance. This is a read-only
+     * field, returned to the user as information. This field can exist even if a
+     * standalone instance doesn't have a DR replica yet or the DR replica is
+     * deleted.
+     * 
+ * + * string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The psaWriteEndpoint to set. + * @return This builder for chaining. + */ + public Builder setPsaWriteEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + psaWriteEndpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. If set, this field indicates this instance has a private
+     * service access (PSA) DNS endpoint that is pointing to the primary instance
+     * of the cluster. If this instance is the primary, then the DNS endpoint
+     * points to this instance. After a switchover or replica failover operation,
+     * this DNS endpoint points to the promoted instance. This is a read-only
+     * field, returned to the user as information. This field can exist even if a
+     * standalone instance doesn't have a DR replica yet or the DR replica is
+     * deleted.
+     * 
+ * + * string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPsaWriteEndpoint() { + psaWriteEndpoint_ = getDefaultInstance().getPsaWriteEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. If set, this field indicates this instance has a private
+     * service access (PSA) DNS endpoint that is pointing to the primary instance
+     * of the cluster. If this instance is the primary, then the DNS endpoint
+     * points to this instance. After a switchover or replica failover operation,
+     * this DNS endpoint points to the promoted instance. This is a read-only
+     * field, returned to the user as information. This field can exist even if a
+     * standalone instance doesn't have a DR replica yet or the DR replica is
+     * deleted.
+     * 
+ * + * string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for psaWriteEndpoint to set. + * @return This builder for chaining. + */ + public Builder setPsaWriteEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + psaWriteEndpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object failoverDrReplicaName_ = ""; + + /** + * + * + *
+     * Optional. If the instance is a primary instance, then this field identifies
+     * the disaster recovery (DR) replica. A DR replica is an optional
+     * configuration for Enterprise Plus edition instances. If the instance is a
+     * read replica, then the field is not set. Set this field to a replica name
+     * to designate a DR replica for a primary instance. Remove the replica name
+     * to remove the DR replica designation.
+     * 
+ * + * string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The failoverDrReplicaName. + */ + public java.lang.String getFailoverDrReplicaName() { + java.lang.Object ref = failoverDrReplicaName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + failoverDrReplicaName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. If the instance is a primary instance, then this field identifies
+     * the disaster recovery (DR) replica. A DR replica is an optional
+     * configuration for Enterprise Plus edition instances. If the instance is a
+     * read replica, then the field is not set. Set this field to a replica name
+     * to designate a DR replica for a primary instance. Remove the replica name
+     * to remove the DR replica designation.
+     * 
+ * + * string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for failoverDrReplicaName. + */ + public com.google.protobuf.ByteString getFailoverDrReplicaNameBytes() { + java.lang.Object ref = failoverDrReplicaName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + failoverDrReplicaName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. If the instance is a primary instance, then this field identifies
+     * the disaster recovery (DR) replica. A DR replica is an optional
+     * configuration for Enterprise Plus edition instances. If the instance is a
+     * read replica, then the field is not set. Set this field to a replica name
+     * to designate a DR replica for a primary instance. Remove the replica name
+     * to remove the DR replica designation.
+     * 
+ * + * string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The failoverDrReplicaName to set. + * @return This builder for chaining. + */ + public Builder setFailoverDrReplicaName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + failoverDrReplicaName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If the instance is a primary instance, then this field identifies
+     * the disaster recovery (DR) replica. A DR replica is an optional
+     * configuration for Enterprise Plus edition instances. If the instance is a
+     * read replica, then the field is not set. Set this field to a replica name
+     * to designate a DR replica for a primary instance. Remove the replica name
+     * to remove the DR replica designation.
+     * 
+ * + * string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFailoverDrReplicaName() { + failoverDrReplicaName_ = getDefaultInstance().getFailoverDrReplicaName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If the instance is a primary instance, then this field identifies
+     * the disaster recovery (DR) replica. A DR replica is an optional
+     * configuration for Enterprise Plus edition instances. If the instance is a
+     * read replica, then the field is not set. Set this field to a replica name
+     * to designate a DR replica for a primary instance. Remove the replica name
+     * to remove the DR replica designation.
+     * 
+ * + * string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for failoverDrReplicaName to set. + * @return This builder for chaining. + */ + public Builder setFailoverDrReplicaNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + failoverDrReplicaName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean drReplica_; + + /** + * + * + *
+     * Output only. Read-only field that indicates whether the replica is a DR
+     * replica. This field is not set if the instance is a primary instance.
+     * 
+ * + * bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The drReplica. + */ + @java.lang.Override + public boolean getDrReplica() { + return drReplica_; + } + + /** + * + * + *
+     * Output only. Read-only field that indicates whether the replica is a DR
+     * replica. This field is not set if the instance is a primary instance.
+     * 
+ * + * bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The drReplica to set. + * @return This builder for chaining. + */ + public Builder setDrReplica(boolean value) { + + drReplica_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Read-only field that indicates whether the replica is a DR
+     * replica. This field is not set if the instance is a primary instance.
+     * 
+ * + * bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDrReplica() { + bitField0_ = (bitField0_ & ~0x00000004); + drReplica_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ReplicationCluster) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ReplicationCluster) + private static final com.google.cloud.sql.v1.ReplicationCluster DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ReplicationCluster(); + } + + public static com.google.cloud.sql.v1.ReplicationCluster getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReplicationCluster parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ReplicationCluster getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReplicationClusterOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReplicationClusterOrBuilder.java new file mode 100644 index 000000000000..aa7d8dcca886 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ReplicationClusterOrBuilder.java @@ -0,0 +1,118 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ReplicationClusterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ReplicationCluster) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. If set, this field indicates this instance has a private
+   * service access (PSA) DNS endpoint that is pointing to the primary instance
+   * of the cluster. If this instance is the primary, then the DNS endpoint
+   * points to this instance. After a switchover or replica failover operation,
+   * this DNS endpoint points to the promoted instance. This is a read-only
+   * field, returned to the user as information. This field can exist even if a
+   * standalone instance doesn't have a DR replica yet or the DR replica is
+   * deleted.
+   * 
+ * + * string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The psaWriteEndpoint. + */ + java.lang.String getPsaWriteEndpoint(); + + /** + * + * + *
+   * Output only. If set, this field indicates this instance has a private
+   * service access (PSA) DNS endpoint that is pointing to the primary instance
+   * of the cluster. If this instance is the primary, then the DNS endpoint
+   * points to this instance. After a switchover or replica failover operation,
+   * this DNS endpoint points to the promoted instance. This is a read-only
+   * field, returned to the user as information. This field can exist even if a
+   * standalone instance doesn't have a DR replica yet or the DR replica is
+   * deleted.
+   * 
+ * + * string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for psaWriteEndpoint. + */ + com.google.protobuf.ByteString getPsaWriteEndpointBytes(); + + /** + * + * + *
+   * Optional. If the instance is a primary instance, then this field identifies
+   * the disaster recovery (DR) replica. A DR replica is an optional
+   * configuration for Enterprise Plus edition instances. If the instance is a
+   * read replica, then the field is not set. Set this field to a replica name
+   * to designate a DR replica for a primary instance. Remove the replica name
+   * to remove the DR replica designation.
+   * 
+ * + * string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The failoverDrReplicaName. + */ + java.lang.String getFailoverDrReplicaName(); + + /** + * + * + *
+   * Optional. If the instance is a primary instance, then this field identifies
+   * the disaster recovery (DR) replica. A DR replica is an optional
+   * configuration for Enterprise Plus edition instances. If the instance is a
+   * read replica, then the field is not set. Set this field to a replica name
+   * to designate a DR replica for a primary instance. Remove the replica name
+   * to remove the DR replica designation.
+   * 
+ * + * string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for failoverDrReplicaName. + */ + com.google.protobuf.ByteString getFailoverDrReplicaNameBytes(); + + /** + * + * + *
+   * Output only. Read-only field that indicates whether the replica is a DR
+   * replica. This field is not set if the instance is a primary instance.
+   * 
+ * + * bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The drReplica. + */ + boolean getDrReplica(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ResolveConnectSettingsRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ResolveConnectSettingsRequest.java new file mode 100644 index 000000000000..97ac55ef7289 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ResolveConnectSettingsRequest.java @@ -0,0 +1,786 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Connect settings retrieval request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ResolveConnectSettingsRequest} + */ +@com.google.protobuf.Generated +public final class ResolveConnectSettingsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.ResolveConnectSettingsRequest) + ResolveConnectSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResolveConnectSettingsRequest"); + } + + // Use ResolveConnectSettingsRequest.newBuilder() to construct. + private ResolveConnectSettingsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ResolveConnectSettingsRequest() { + dnsName_ = ""; + location_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ResolveConnectSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ResolveConnectSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ResolveConnectSettingsRequest.class, + com.google.cloud.sql.v1.ResolveConnectSettingsRequest.Builder.class); + } + + public static final int DNS_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object dnsName_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The dnsName. + */ + @java.lang.Override + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for dnsName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + + /** + * + * + *
+   * Required. The region of the instance.
+   * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The region of the instance.
+   * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(dnsName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, dnsName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, location_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dnsName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, dnsName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, location_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.ResolveConnectSettingsRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.ResolveConnectSettingsRequest other = + (com.google.cloud.sql.v1.ResolveConnectSettingsRequest) obj; + + if (!getDnsName().equals(other.getDnsName())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (!getUnknownFields().equals(other.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) + DNS_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDnsName().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.ResolveConnectSettingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ResolveConnectSettingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ResolveConnectSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ResolveConnectSettingsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ResolveConnectSettingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.ResolveConnectSettingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ResolveConnectSettingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ResolveConnectSettingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ResolveConnectSettingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ResolveConnectSettingsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.ResolveConnectSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.ResolveConnectSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.ResolveConnectSettingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Connect settings retrieval request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.ResolveConnectSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.ResolveConnectSettingsRequest) + com.google.cloud.sql.v1.ResolveConnectSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ResolveConnectSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ResolveConnectSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.ResolveConnectSettingsRequest.class, + com.google.cloud.sql.v1.ResolveConnectSettingsRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.ResolveConnectSettingsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dnsName_ = ""; + location_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1_ResolveConnectSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ResolveConnectSettingsRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.ResolveConnectSettingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.ResolveConnectSettingsRequest build() { + com.google.cloud.sql.v1.ResolveConnectSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ResolveConnectSettingsRequest buildPartial() { + com.google.cloud.sql.v1.ResolveConnectSettingsRequest result = + new com.google.cloud.sql.v1.ResolveConnectSettingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.ResolveConnectSettingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dnsName_ = dnsName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.location_ = location_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.ResolveConnectSettingsRequest) { + return mergeFrom((com.google.cloud.sql.v1.ResolveConnectSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.ResolveConnectSettingsRequest other) { + if (other == com.google.cloud.sql.v1.ResolveConnectSettingsRequest.getDefaultInstance()) + return this; + if (!other.getDnsName().isEmpty()) { + dnsName_ = other.dnsName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + 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: + { + dnsName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + location_ = 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 dnsName_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The dnsName. + */ + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for dnsName. + */ + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dnsName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDnsName() { + dnsName_ = getDefaultInstance().getDnsName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dnsName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object location_ = ""; + + /** + * + * + *
+     * Required. The region of the instance.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The region of the instance.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The region of the instance.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The region of the instance.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The region of the instance.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.ResolveConnectSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.ResolveConnectSettingsRequest) + private static final com.google.cloud.sql.v1.ResolveConnectSettingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.ResolveConnectSettingsRequest(); + } + + public static com.google.cloud.sql.v1.ResolveConnectSettingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResolveConnectSettingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.ResolveConnectSettingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ResolveConnectSettingsRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ResolveConnectSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..88abcbd85fb3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ResolveConnectSettingsRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ResolveConnectSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.ResolveConnectSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The dnsName. + */ + java.lang.String getDnsName(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for dnsName. + */ + com.google.protobuf.ByteString getDnsNameBytes(); + + /** + * + * + *
+   * Required. The region of the instance.
+   * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The location. + */ + java.lang.String getLocation(); + + /** + * + * + *
+   * Required. The region of the instance.
+   * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RestoreBackupContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RestoreBackupContext.java new file mode 100644 index 000000000000..72d3a9225bc6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RestoreBackupContext.java @@ -0,0 +1,1072 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance restore from backup context.
+ * Backup context contains source instance id and project id.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.RestoreBackupContext} + */ +@com.google.protobuf.Generated +public final class RestoreBackupContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.RestoreBackupContext) + RestoreBackupContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RestoreBackupContext"); + } + + // Use RestoreBackupContext.newBuilder() to construct. + private RestoreBackupContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RestoreBackupContext() { + kind_ = ""; + instanceId_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RestoreBackupContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RestoreBackupContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.RestoreBackupContext.class, + com.google.cloud.sql.v1.RestoreBackupContext.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#restoreBackupContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#restoreBackupContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_RUN_ID_FIELD_NUMBER = 2; + private long backupRunId_ = 0L; + + /** + * + * + *
+   * The ID of the backup run to restore from.
+   * 
+ * + * int64 backup_run_id = 2; + * + * @return The backupRunId. + */ + @java.lang.Override + public long getBackupRunId() { + return backupRunId_; + } + + public static final int INSTANCE_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceId_ = ""; + + /** + * + * + *
+   * The ID of the instance that the backup was taken from.
+   * 
+ * + * string instance_id = 3; + * + * @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; + } + } + + /** + * + * + *
+   * The ID of the instance that the backup was taken from.
+   * 
+ * + * string instance_id = 3; + * + * @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 PROJECT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * The full project ID of the source instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * The full project ID of the source instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (backupRunId_ != 0L) { + output.writeInt64(2, backupRunId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, instanceId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (backupRunId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, backupRunId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, instanceId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.RestoreBackupContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.RestoreBackupContext other = + (com.google.cloud.sql.v1.RestoreBackupContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (getBackupRunId() != other.getBackupRunId()) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + BACKUP_RUN_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getBackupRunId()); + hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.RestoreBackupContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.RestoreBackupContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RestoreBackupContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.RestoreBackupContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RestoreBackupContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.RestoreBackupContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RestoreBackupContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.RestoreBackupContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RestoreBackupContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.RestoreBackupContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RestoreBackupContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.RestoreBackupContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.RestoreBackupContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance restore from backup context.
+   * Backup context contains source instance id and project id.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.RestoreBackupContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.RestoreBackupContext) + com.google.cloud.sql.v1.RestoreBackupContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RestoreBackupContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RestoreBackupContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.RestoreBackupContext.class, + com.google.cloud.sql.v1.RestoreBackupContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.RestoreBackupContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + backupRunId_ = 0L; + instanceId_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RestoreBackupContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.RestoreBackupContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.RestoreBackupContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.RestoreBackupContext build() { + com.google.cloud.sql.v1.RestoreBackupContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.RestoreBackupContext buildPartial() { + com.google.cloud.sql.v1.RestoreBackupContext result = + new com.google.cloud.sql.v1.RestoreBackupContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.RestoreBackupContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupRunId_ = backupRunId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.instanceId_ = instanceId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.RestoreBackupContext) { + return mergeFrom((com.google.cloud.sql.v1.RestoreBackupContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.RestoreBackupContext other) { + if (other == com.google.cloud.sql.v1.RestoreBackupContext.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getBackupRunId() != 0L) { + setBackupRunId(other.getBackupRunId()); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + backupRunId_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + instanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + project_ = 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#restoreBackupContext`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#restoreBackupContext`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#restoreBackupContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#restoreBackupContext`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#restoreBackupContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long backupRunId_; + + /** + * + * + *
+     * The ID of the backup run to restore from.
+     * 
+ * + * int64 backup_run_id = 2; + * + * @return The backupRunId. + */ + @java.lang.Override + public long getBackupRunId() { + return backupRunId_; + } + + /** + * + * + *
+     * The ID of the backup run to restore from.
+     * 
+ * + * int64 backup_run_id = 2; + * + * @param value The backupRunId to set. + * @return This builder for chaining. + */ + public Builder setBackupRunId(long value) { + + backupRunId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The ID of the backup run to restore from.
+     * 
+ * + * int64 backup_run_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearBackupRunId() { + bitField0_ = (bitField0_ & ~0x00000002); + backupRunId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + + /** + * + * + *
+     * The ID of the instance that the backup was taken from.
+     * 
+ * + * string instance_id = 3; + * + * @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; + } + } + + /** + * + * + *
+     * The ID of the instance that the backup was taken from.
+     * 
+ * + * string instance_id = 3; + * + * @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; + } + } + + /** + * + * + *
+     * The ID of the instance that the backup was taken from.
+     * 
+ * + * string instance_id = 3; + * + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The ID of the instance that the backup was taken from.
+     * 
+ * + * string instance_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The ID of the instance that the backup was taken from.
+     * 
+ * + * string instance_id = 3; + * + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * The full project ID of the source instance.
+     * 
+ * + * string project = 4; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The full project ID of the source instance.
+     * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The full project ID of the source instance.
+     * 
+ * + * string project = 4; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The full project ID of the source instance.
+     * 
+ * + * string project = 4; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The full project ID of the source instance.
+     * 
+ * + * string project = 4; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.RestoreBackupContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.RestoreBackupContext) + private static final com.google.cloud.sql.v1.RestoreBackupContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.RestoreBackupContext(); + } + + public static com.google.cloud.sql.v1.RestoreBackupContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestoreBackupContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.RestoreBackupContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RestoreBackupContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RestoreBackupContextOrBuilder.java new file mode 100644 index 000000000000..f3acbd790cbe --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RestoreBackupContextOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface RestoreBackupContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.RestoreBackupContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#restoreBackupContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#restoreBackupContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The ID of the backup run to restore from.
+   * 
+ * + * int64 backup_run_id = 2; + * + * @return The backupRunId. + */ + long getBackupRunId(); + + /** + * + * + *
+   * The ID of the instance that the backup was taken from.
+   * 
+ * + * string instance_id = 3; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + + /** + * + * + *
+   * The ID of the instance that the backup was taken from.
+   * 
+ * + * string instance_id = 3; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * The full project ID of the source instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * The full project ID of the source instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateEntraIdCertificateContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateEntraIdCertificateContext.java new file mode 100644 index 000000000000..417db444ecbb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateEntraIdCertificateContext.java @@ -0,0 +1,800 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance rotate Entra ID certificate context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.RotateEntraIdCertificateContext} + */ +@com.google.protobuf.Generated +public final class RotateEntraIdCertificateContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.RotateEntraIdCertificateContext) + RotateEntraIdCertificateContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RotateEntraIdCertificateContext"); + } + + // Use RotateEntraIdCertificateContext.newBuilder() to construct. + private RotateEntraIdCertificateContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RotateEntraIdCertificateContext() { + kind_ = ""; + nextVersion_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateEntraIdCertificateContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateEntraIdCertificateContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.RotateEntraIdCertificateContext.class, + com.google.cloud.sql.v1.RotateEntraIdCertificateContext.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEXT_VERSION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextVersion_ = ""; + + /** + * + * + *
+   * Optional. The fingerprint of the next version to be rotated to. If left
+   * unspecified, will be rotated to the most recently added server certificate
+   * version.
+   * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextVersion. + */ + @java.lang.Override + public java.lang.String getNextVersion() { + java.lang.Object ref = nextVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The fingerprint of the next version to be rotated to. If left
+   * unspecified, will be rotated to the most recently added server certificate
+   * version.
+   * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextVersionBytes() { + java.lang.Object ref = nextVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextVersion_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextVersion_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.RotateEntraIdCertificateContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.RotateEntraIdCertificateContext other = + (com.google.cloud.sql.v1.RotateEntraIdCertificateContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getNextVersion().equals(other.getNextVersion())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + NEXT_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getNextVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.RotateEntraIdCertificateContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.RotateEntraIdCertificateContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateEntraIdCertificateContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.RotateEntraIdCertificateContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateEntraIdCertificateContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.RotateEntraIdCertificateContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateEntraIdCertificateContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.RotateEntraIdCertificateContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateEntraIdCertificateContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.RotateEntraIdCertificateContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateEntraIdCertificateContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.RotateEntraIdCertificateContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.RotateEntraIdCertificateContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance rotate Entra ID certificate context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.RotateEntraIdCertificateContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.RotateEntraIdCertificateContext) + com.google.cloud.sql.v1.RotateEntraIdCertificateContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateEntraIdCertificateContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateEntraIdCertificateContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.RotateEntraIdCertificateContext.class, + com.google.cloud.sql.v1.RotateEntraIdCertificateContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.RotateEntraIdCertificateContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + nextVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateEntraIdCertificateContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.RotateEntraIdCertificateContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.RotateEntraIdCertificateContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.RotateEntraIdCertificateContext build() { + com.google.cloud.sql.v1.RotateEntraIdCertificateContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.RotateEntraIdCertificateContext buildPartial() { + com.google.cloud.sql.v1.RotateEntraIdCertificateContext result = + new com.google.cloud.sql.v1.RotateEntraIdCertificateContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.RotateEntraIdCertificateContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextVersion_ = nextVersion_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.RotateEntraIdCertificateContext) { + return mergeFrom((com.google.cloud.sql.v1.RotateEntraIdCertificateContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.RotateEntraIdCertificateContext other) { + if (other == com.google.cloud.sql.v1.RotateEntraIdCertificateContext.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getNextVersion().isEmpty()) { + nextVersion_ = other.nextVersion_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + nextVersion_ = 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 kind_ = ""; + + /** + * + * + *
+     * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object nextVersion_ = ""; + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added server certificate
+     * version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextVersion. + */ + public java.lang.String getNextVersion() { + java.lang.Object ref = nextVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added server certificate
+     * version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextVersion. + */ + public com.google.protobuf.ByteString getNextVersionBytes() { + java.lang.Object ref = nextVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added server certificate
+     * version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The nextVersion to set. + * @return This builder for chaining. + */ + public Builder setNextVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added server certificate
+     * version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNextVersion() { + nextVersion_ = getDefaultInstance().getNextVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added server certificate
+     * version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for nextVersion to set. + * @return This builder for chaining. + */ + public Builder setNextVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.RotateEntraIdCertificateContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.RotateEntraIdCertificateContext) + private static final com.google.cloud.sql.v1.RotateEntraIdCertificateContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.RotateEntraIdCertificateContext(); + } + + public static com.google.cloud.sql.v1.RotateEntraIdCertificateContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RotateEntraIdCertificateContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.RotateEntraIdCertificateContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateEntraIdCertificateContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateEntraIdCertificateContextOrBuilder.java new file mode 100644 index 000000000000..d2049ab25a6a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateEntraIdCertificateContextOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface RotateEntraIdCertificateContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.RotateEntraIdCertificateContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Optional. The fingerprint of the next version to be rotated to. If left
+   * unspecified, will be rotated to the most recently added server certificate
+   * version.
+   * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextVersion. + */ + java.lang.String getNextVersion(); + + /** + * + * + *
+   * Optional. The fingerprint of the next version to be rotated to. If left
+   * unspecified, will be rotated to the most recently added server certificate
+   * version.
+   * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextVersion. + */ + com.google.protobuf.ByteString getNextVersionBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateServerCaContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateServerCaContext.java new file mode 100644 index 000000000000..95ef50ec6266 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateServerCaContext.java @@ -0,0 +1,791 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance rotate server CA context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.RotateServerCaContext} + */ +@com.google.protobuf.Generated +public final class RotateServerCaContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.RotateServerCaContext) + RotateServerCaContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RotateServerCaContext"); + } + + // Use RotateServerCaContext.newBuilder() to construct. + private RotateServerCaContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RotateServerCaContext() { + kind_ = ""; + nextVersion_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateServerCaContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateServerCaContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.RotateServerCaContext.class, + com.google.cloud.sql.v1.RotateServerCaContext.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#rotateServerCaContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#rotateServerCaContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEXT_VERSION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextVersion_ = ""; + + /** + * + * + *
+   * The fingerprint of the next version to be rotated to. If left unspecified,
+   * will be rotated to the most recently added server CA version.
+   * 
+ * + * string next_version = 2; + * + * @return The nextVersion. + */ + @java.lang.Override + public java.lang.String getNextVersion() { + java.lang.Object ref = nextVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * The fingerprint of the next version to be rotated to. If left unspecified,
+   * will be rotated to the most recently added server CA version.
+   * 
+ * + * string next_version = 2; + * + * @return The bytes for nextVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextVersionBytes() { + java.lang.Object ref = nextVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextVersion_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextVersion_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.RotateServerCaContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.RotateServerCaContext other = + (com.google.cloud.sql.v1.RotateServerCaContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getNextVersion().equals(other.getNextVersion())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + NEXT_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getNextVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.RotateServerCaContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.RotateServerCaContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateServerCaContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.RotateServerCaContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateServerCaContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.RotateServerCaContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateServerCaContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.RotateServerCaContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateServerCaContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.RotateServerCaContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateServerCaContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.RotateServerCaContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.RotateServerCaContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance rotate server CA context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.RotateServerCaContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.RotateServerCaContext) + com.google.cloud.sql.v1.RotateServerCaContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateServerCaContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateServerCaContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.RotateServerCaContext.class, + com.google.cloud.sql.v1.RotateServerCaContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.RotateServerCaContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + nextVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateServerCaContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.RotateServerCaContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.RotateServerCaContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.RotateServerCaContext build() { + com.google.cloud.sql.v1.RotateServerCaContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.RotateServerCaContext buildPartial() { + com.google.cloud.sql.v1.RotateServerCaContext result = + new com.google.cloud.sql.v1.RotateServerCaContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.RotateServerCaContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextVersion_ = nextVersion_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.RotateServerCaContext) { + return mergeFrom((com.google.cloud.sql.v1.RotateServerCaContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.RotateServerCaContext other) { + if (other == com.google.cloud.sql.v1.RotateServerCaContext.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getNextVersion().isEmpty()) { + nextVersion_ = other.nextVersion_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + nextVersion_ = 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#rotateServerCaContext`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#rotateServerCaContext`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#rotateServerCaContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#rotateServerCaContext`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#rotateServerCaContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object nextVersion_ = ""; + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server CA version.
+     * 
+ * + * string next_version = 2; + * + * @return The nextVersion. + */ + public java.lang.String getNextVersion() { + java.lang.Object ref = nextVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server CA version.
+     * 
+ * + * string next_version = 2; + * + * @return The bytes for nextVersion. + */ + public com.google.protobuf.ByteString getNextVersionBytes() { + java.lang.Object ref = nextVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server CA version.
+     * 
+ * + * string next_version = 2; + * + * @param value The nextVersion to set. + * @return This builder for chaining. + */ + public Builder setNextVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server CA version.
+     * 
+ * + * string next_version = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextVersion() { + nextVersion_ = getDefaultInstance().getNextVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server CA version.
+     * 
+ * + * string next_version = 2; + * + * @param value The bytes for nextVersion to set. + * @return This builder for chaining. + */ + public Builder setNextVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.RotateServerCaContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.RotateServerCaContext) + private static final com.google.cloud.sql.v1.RotateServerCaContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.RotateServerCaContext(); + } + + public static com.google.cloud.sql.v1.RotateServerCaContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RotateServerCaContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.RotateServerCaContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateServerCaContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateServerCaContextOrBuilder.java new file mode 100644 index 000000000000..ad11b8043e6d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateServerCaContextOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface RotateServerCaContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.RotateServerCaContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#rotateServerCaContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#rotateServerCaContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The fingerprint of the next version to be rotated to. If left unspecified,
+   * will be rotated to the most recently added server CA version.
+   * 
+ * + * string next_version = 2; + * + * @return The nextVersion. + */ + java.lang.String getNextVersion(); + + /** + * + * + *
+   * The fingerprint of the next version to be rotated to. If left unspecified,
+   * will be rotated to the most recently added server CA version.
+   * 
+ * + * string next_version = 2; + * + * @return The bytes for nextVersion. + */ + com.google.protobuf.ByteString getNextVersionBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateServerCertificateContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateServerCertificateContext.java new file mode 100644 index 000000000000..b9c4b328600e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateServerCertificateContext.java @@ -0,0 +1,793 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance rotate server certificate context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.RotateServerCertificateContext} + */ +@com.google.protobuf.Generated +public final class RotateServerCertificateContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.RotateServerCertificateContext) + RotateServerCertificateContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RotateServerCertificateContext"); + } + + // Use RotateServerCertificateContext.newBuilder() to construct. + private RotateServerCertificateContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RotateServerCertificateContext() { + kind_ = ""; + nextVersion_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateServerCertificateContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateServerCertificateContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.RotateServerCertificateContext.class, + com.google.cloud.sql.v1.RotateServerCertificateContext.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * Optional. This is always `sql#rotateServerCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. This is always `sql#rotateServerCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEXT_VERSION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextVersion_ = ""; + + /** + * + * + *
+   * The fingerprint of the next version to be rotated to. If left unspecified,
+   * will be rotated to the most recently added server certificate version.
+   * 
+ * + * string next_version = 2; + * + * @return The nextVersion. + */ + @java.lang.Override + public java.lang.String getNextVersion() { + java.lang.Object ref = nextVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * The fingerprint of the next version to be rotated to. If left unspecified,
+   * will be rotated to the most recently added server certificate version.
+   * 
+ * + * string next_version = 2; + * + * @return The bytes for nextVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextVersionBytes() { + java.lang.Object ref = nextVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextVersion_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextVersion_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.RotateServerCertificateContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.RotateServerCertificateContext other = + (com.google.cloud.sql.v1.RotateServerCertificateContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getNextVersion().equals(other.getNextVersion())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + NEXT_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getNextVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.RotateServerCertificateContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.RotateServerCertificateContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateServerCertificateContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.RotateServerCertificateContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateServerCertificateContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.RotateServerCertificateContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateServerCertificateContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.RotateServerCertificateContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateServerCertificateContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.RotateServerCertificateContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.RotateServerCertificateContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.RotateServerCertificateContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.RotateServerCertificateContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance rotate server certificate context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.RotateServerCertificateContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.RotateServerCertificateContext) + com.google.cloud.sql.v1.RotateServerCertificateContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateServerCertificateContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateServerCertificateContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.RotateServerCertificateContext.class, + com.google.cloud.sql.v1.RotateServerCertificateContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.RotateServerCertificateContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + nextVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_RotateServerCertificateContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.RotateServerCertificateContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.RotateServerCertificateContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.RotateServerCertificateContext build() { + com.google.cloud.sql.v1.RotateServerCertificateContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.RotateServerCertificateContext buildPartial() { + com.google.cloud.sql.v1.RotateServerCertificateContext result = + new com.google.cloud.sql.v1.RotateServerCertificateContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.RotateServerCertificateContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextVersion_ = nextVersion_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.RotateServerCertificateContext) { + return mergeFrom((com.google.cloud.sql.v1.RotateServerCertificateContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.RotateServerCertificateContext other) { + if (other == com.google.cloud.sql.v1.RotateServerCertificateContext.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getNextVersion().isEmpty()) { + nextVersion_ = other.nextVersion_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + nextVersion_ = 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 kind_ = ""; + + /** + * + * + *
+     * Optional. This is always `sql#rotateServerCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateServerCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateServerCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateServerCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateServerCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object nextVersion_ = ""; + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server certificate version.
+     * 
+ * + * string next_version = 2; + * + * @return The nextVersion. + */ + public java.lang.String getNextVersion() { + java.lang.Object ref = nextVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server certificate version.
+     * 
+ * + * string next_version = 2; + * + * @return The bytes for nextVersion. + */ + public com.google.protobuf.ByteString getNextVersionBytes() { + java.lang.Object ref = nextVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server certificate version.
+     * 
+ * + * string next_version = 2; + * + * @param value The nextVersion to set. + * @return This builder for chaining. + */ + public Builder setNextVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server certificate version.
+     * 
+ * + * string next_version = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextVersion() { + nextVersion_ = getDefaultInstance().getNextVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server certificate version.
+     * 
+ * + * string next_version = 2; + * + * @param value The bytes for nextVersion to set. + * @return This builder for chaining. + */ + public Builder setNextVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.RotateServerCertificateContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.RotateServerCertificateContext) + private static final com.google.cloud.sql.v1.RotateServerCertificateContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.RotateServerCertificateContext(); + } + + public static com.google.cloud.sql.v1.RotateServerCertificateContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RotateServerCertificateContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.RotateServerCertificateContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateServerCertificateContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateServerCertificateContextOrBuilder.java new file mode 100644 index 000000000000..6b9f1c2c72e4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RotateServerCertificateContextOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface RotateServerCertificateContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.RotateServerCertificateContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. This is always `sql#rotateServerCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * Optional. This is always `sql#rotateServerCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The fingerprint of the next version to be rotated to. If left unspecified,
+   * will be rotated to the most recently added server certificate version.
+   * 
+ * + * string next_version = 2; + * + * @return The nextVersion. + */ + java.lang.String getNextVersion(); + + /** + * + * + *
+   * The fingerprint of the next version to be rotated to. If left unspecified,
+   * will be rotated to the most recently added server certificate version.
+   * 
+ * + * string next_version = 2; + * + * @return The bytes for nextVersion. + */ + com.google.protobuf.ByteString getNextVersionBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Row.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Row.java new file mode 100644 index 000000000000..2d9fe2549ef6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Row.java @@ -0,0 +1,910 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Contains the values for a row.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Row} + */ +@com.google.protobuf.Generated +public final class Row extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.Row) + RowOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Row"); + } + + // Use Row.newBuilder() to construct. + private Row(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Row() { + values_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Row_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Row_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Row.class, com.google.cloud.sql.v1.Row.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List values_; + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + @java.lang.Override + public java.util.List getValuesOrBuilderList() { + return values_; + } + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.Value getValues(int index) { + return values_.get(index); + } + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ValueOrBuilder getValuesOrBuilder(int index) { + return values_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(1, values_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, values_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.Row)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.Row other = (com.google.cloud.sql.v1.Row) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.Row parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Row parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Row parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Row parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Row parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Row parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Row parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Row parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Row parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Row parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Row parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Row parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.Row prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Contains the values for a row.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Row} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.Row) + com.google.cloud.sql.v1.RowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Row_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Row_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Row.class, com.google.cloud.sql.v1.Row.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.Row.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + } else { + values_ = null; + valuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Row_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Row getDefaultInstanceForType() { + return com.google.cloud.sql.v1.Row.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.Row build() { + com.google.cloud.sql.v1.Row result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Row buildPartial() { + com.google.cloud.sql.v1.Row result = new com.google.cloud.sql.v1.Row(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.Row result) { + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.Row result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.Row) { + return mergeFrom((com.google.cloud.sql.v1.Row) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.Row other) { + if (other == com.google.cloud.sql.v1.Row.getDefaultInstance()) return this; + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + valuesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetValuesFieldBuilder() + : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.sql.v1.Value m = + input.readMessage(com.google.cloud.sql.v1.Value.parser(), extensionRegistry); + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(m); + } else { + valuesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List values_ = + java.util.Collections.emptyList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = new java.util.ArrayList(values_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Value, + com.google.cloud.sql.v1.Value.Builder, + com.google.cloud.sql.v1.ValueOrBuilder> + valuesBuilder_; + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public java.util.List getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public com.google.cloud.sql.v1.Value getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public Builder setValues(int index, com.google.cloud.sql.v1.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public Builder setValues(int index, com.google.cloud.sql.v1.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public Builder addValues(com.google.cloud.sql.v1.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public Builder addValues(int index, com.google.cloud.sql.v1.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public Builder addValues(com.google.cloud.sql.v1.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public Builder addValues(int index, com.google.cloud.sql.v1.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public Builder addAllValues( + java.lang.Iterable values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public com.google.cloud.sql.v1.Value.Builder getValuesBuilder(int index) { + return internalGetValuesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public com.google.cloud.sql.v1.ValueOrBuilder getValuesOrBuilder(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public java.util.List + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public com.google.cloud.sql.v1.Value.Builder addValuesBuilder() { + return internalGetValuesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.Value.getDefaultInstance()); + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public com.google.cloud.sql.v1.Value.Builder addValuesBuilder(int index) { + return internalGetValuesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.Value.getDefaultInstance()); + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + public java.util.List getValuesBuilderList() { + return internalGetValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Value, + com.google.cloud.sql.v1.Value.Builder, + com.google.cloud.sql.v1.ValueOrBuilder> + internalGetValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Value, + com.google.cloud.sql.v1.Value.Builder, + com.google.cloud.sql.v1.ValueOrBuilder>( + values_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + values_ = null; + } + return valuesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.Row) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.Row) + private static final com.google.cloud.sql.v1.Row DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.Row(); + } + + public static com.google.cloud.sql.v1.Row getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Row parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Row getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RowOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RowOrBuilder.java new file mode 100644 index 000000000000..edfc0f76484c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/RowOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface RowOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.Row) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + java.util.List getValuesList(); + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + com.google.cloud.sql.v1.Value getValues(int index); + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + int getValuesCount(); + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + java.util.List getValuesOrBuilderList(); + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1.Value values = 1; + */ + com.google.cloud.sql.v1.ValueOrBuilder getValuesOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SelectedObjects.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SelectedObjects.java new file mode 100644 index 000000000000..79d66cd4aac1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SelectedObjects.java @@ -0,0 +1,596 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * A list of objects that the user selects for replication from an external
+ * source instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SelectedObjects} + */ +@com.google.protobuf.Generated +public final class SelectedObjects extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SelectedObjects) + SelectedObjectsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SelectedObjects"); + } + + // Use SelectedObjects.newBuilder() to construct. + private SelectedObjects(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SelectedObjects() { + database_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SelectedObjects_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SelectedObjects_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SelectedObjects.class, + com.google.cloud.sql.v1.SelectedObjects.Builder.class); + } + + public static final int DATABASE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * Required. The name of the database to migrate.
+   * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name of the database to migrate.
+   * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = 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.GeneratedMessage.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, database_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, database_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SelectedObjects)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SelectedObjects other = (com.google.cloud.sql.v1.SelectedObjects) obj; + + if (!getDatabase().equals(other.getDatabase())) return false; + if (!getUnknownFields().equals(other.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) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SelectedObjects parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SelectedObjects parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SelectedObjects parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SelectedObjects parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SelectedObjects parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SelectedObjects parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SelectedObjects parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SelectedObjects parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SelectedObjects parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SelectedObjects parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SelectedObjects parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SelectedObjects parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SelectedObjects prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A list of objects that the user selects for replication from an external
+   * source instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SelectedObjects} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SelectedObjects) + com.google.cloud.sql.v1.SelectedObjectsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SelectedObjects_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SelectedObjects_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SelectedObjects.class, + com.google.cloud.sql.v1.SelectedObjects.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SelectedObjects.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + database_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SelectedObjects_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SelectedObjects getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SelectedObjects.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SelectedObjects build() { + com.google.cloud.sql.v1.SelectedObjects result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SelectedObjects buildPartial() { + com.google.cloud.sql.v1.SelectedObjects result = + new com.google.cloud.sql.v1.SelectedObjects(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SelectedObjects result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.database_ = database_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SelectedObjects) { + return mergeFrom((com.google.cloud.sql.v1.SelectedObjects) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SelectedObjects other) { + if (other == com.google.cloud.sql.v1.SelectedObjects.getDefaultInstance()) return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + 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: + { + database_ = 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 database_ = ""; + + /** + * + * + *
+     * Required. The name of the database to migrate.
+     * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name of the database to migrate.
+     * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name of the database to migrate.
+     * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the database to migrate.
+     * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the database to migrate.
+     * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SelectedObjects) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SelectedObjects) + private static final com.google.cloud.sql.v1.SelectedObjects DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SelectedObjects(); + } + + public static com.google.cloud.sql.v1.SelectedObjects getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SelectedObjects parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SelectedObjects getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SelectedObjectsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SelectedObjectsOrBuilder.java new file mode 100644 index 000000000000..76b0692f4e24 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SelectedObjectsOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SelectedObjectsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SelectedObjects) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the database to migrate.
+   * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * Required. The name of the database to migrate.
+   * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Settings.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Settings.java new file mode 100644 index 000000000000..e93484622320 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Settings.java @@ -0,0 +1,14046 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database instance settings.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Settings} + */ +@com.google.protobuf.Generated +public final class Settings extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.Settings) + SettingsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Settings"); + } + + // Use Settings.newBuilder() to construct. + private Settings(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Settings() { + authorizedGaeApplications_ = com.google.protobuf.LazyStringArrayList.emptyList(); + tier_ = ""; + kind_ = ""; + availabilityType_ = 0; + pricingPlan_ = 0; + replicationType_ = 0; + activationPolicy_ = 0; + databaseFlags_ = java.util.Collections.emptyList(); + dataDiskType_ = 0; + collation_ = ""; + denyMaintenancePeriods_ = java.util.Collections.emptyList(); + edition_ = 0; + connectorEnforcement_ = 0; + timeZone_ = ""; + dataApiAccess_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Settings_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Settings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Settings.class, com.google.cloud.sql.v1.Settings.Builder.class); + } + + /** + * + * + *
+   * Specifies when the instance is activated.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.Settings.SqlActivationPolicy} + */ + public enum SqlActivationPolicy implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown activation plan.
+     * 
+ * + * SQL_ACTIVATION_POLICY_UNSPECIFIED = 0; + */ + SQL_ACTIVATION_POLICY_UNSPECIFIED(0), + /** + * + * + *
+     * The instance is always up and running.
+     * 
+ * + * ALWAYS = 1; + */ + ALWAYS(1), + /** + * + * + *
+     * The instance never starts.
+     * 
+ * + * NEVER = 2; + */ + NEVER(2), + /** + * + * + *
+     * The instance starts upon receiving requests.
+     * 
+ * + * ON_DEMAND = 3 [deprecated = true]; + */ + @java.lang.Deprecated + ON_DEMAND(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlActivationPolicy"); + } + + /** + * + * + *
+     * Unknown activation plan.
+     * 
+ * + * SQL_ACTIVATION_POLICY_UNSPECIFIED = 0; + */ + public static final int SQL_ACTIVATION_POLICY_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The instance is always up and running.
+     * 
+ * + * ALWAYS = 1; + */ + public static final int ALWAYS_VALUE = 1; + + /** + * + * + *
+     * The instance never starts.
+     * 
+ * + * NEVER = 2; + */ + public static final int NEVER_VALUE = 2; + + /** + * + * + *
+     * The instance starts upon receiving requests.
+     * 
+ * + * ON_DEMAND = 3 [deprecated = true]; + */ + @java.lang.Deprecated public static final int ON_DEMAND_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 SqlActivationPolicy 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 SqlActivationPolicy forNumber(int value) { + switch (value) { + case 0: + return SQL_ACTIVATION_POLICY_UNSPECIFIED; + case 1: + return ALWAYS; + case 2: + return NEVER; + case 3: + return ON_DEMAND; + 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 SqlActivationPolicy findValueByNumber(int number) { + return SqlActivationPolicy.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.Settings.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlActivationPolicy[] VALUES = values(); + + public static SqlActivationPolicy 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 SqlActivationPolicy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.Settings.SqlActivationPolicy) + } + + /** + * + * + *
+   * The list of Cloud SQL editions available to users.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.Settings.Edition} + */ + public enum Edition implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The instance did not specify the edition.
+     * 
+ * + * EDITION_UNSPECIFIED = 0; + */ + EDITION_UNSPECIFIED(0), + /** + * + * + *
+     * The instance is an enterprise edition.
+     * 
+ * + * ENTERPRISE = 2; + */ + ENTERPRISE(2), + /** + * + * + *
+     * The instance is an Enterprise Plus edition.
+     * 
+ * + * ENTERPRISE_PLUS = 3; + */ + ENTERPRISE_PLUS(3), + /** + * + * + *
+     * This instance is a Cloud SQL developer edition instance.
+     * 
+ * + * DEVELOPER = 5; + */ + DEVELOPER(5), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Edition"); + } + + /** + * + * + *
+     * The instance did not specify the edition.
+     * 
+ * + * EDITION_UNSPECIFIED = 0; + */ + public static final int EDITION_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The instance is an enterprise edition.
+     * 
+ * + * ENTERPRISE = 2; + */ + public static final int ENTERPRISE_VALUE = 2; + + /** + * + * + *
+     * The instance is an Enterprise Plus edition.
+     * 
+ * + * ENTERPRISE_PLUS = 3; + */ + public static final int ENTERPRISE_PLUS_VALUE = 3; + + /** + * + * + *
+     * This instance is a Cloud SQL developer edition instance.
+     * 
+ * + * DEVELOPER = 5; + */ + public static final int DEVELOPER_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Edition 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 Edition forNumber(int value) { + switch (value) { + case 0: + return EDITION_UNSPECIFIED; + case 2: + return ENTERPRISE; + case 3: + return ENTERPRISE_PLUS; + case 5: + return DEVELOPER; + 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 Edition findValueByNumber(int number) { + return Edition.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.Settings.getDescriptor().getEnumTypes().get(1); + } + + private static final Edition[] VALUES = values(); + + public static Edition 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 Edition(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.Settings.Edition) + } + + /** + * + * + *
+   * The options for enforcing Cloud SQL connectors in the instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.Settings.ConnectorEnforcement} + */ + public enum ConnectorEnforcement implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The requirement for Cloud SQL connectors is unknown.
+     * 
+ * + * CONNECTOR_ENFORCEMENT_UNSPECIFIED = 0; + */ + CONNECTOR_ENFORCEMENT_UNSPECIFIED(0), + /** + * + * + *
+     * Do not require Cloud SQL connectors.
+     * 
+ * + * NOT_REQUIRED = 1; + */ + NOT_REQUIRED(1), + /** + * + * + *
+     * Require all connections to use Cloud SQL connectors, including the
+     * Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
+     * Note: This disables all existing authorized networks.
+     * 
+ * + * REQUIRED = 2; + */ + REQUIRED(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ConnectorEnforcement"); + } + + /** + * + * + *
+     * The requirement for Cloud SQL connectors is unknown.
+     * 
+ * + * CONNECTOR_ENFORCEMENT_UNSPECIFIED = 0; + */ + public static final int CONNECTOR_ENFORCEMENT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Do not require Cloud SQL connectors.
+     * 
+ * + * NOT_REQUIRED = 1; + */ + public static final int NOT_REQUIRED_VALUE = 1; + + /** + * + * + *
+     * Require all connections to use Cloud SQL connectors, including the
+     * Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
+     * Note: This disables all existing authorized networks.
+     * 
+ * + * REQUIRED = 2; + */ + public static final int REQUIRED_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 ConnectorEnforcement 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 ConnectorEnforcement forNumber(int value) { + switch (value) { + case 0: + return CONNECTOR_ENFORCEMENT_UNSPECIFIED; + case 1: + return NOT_REQUIRED; + case 2: + return REQUIRED; + 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 ConnectorEnforcement findValueByNumber(int number) { + return ConnectorEnforcement.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.Settings.getDescriptor().getEnumTypes().get(2); + } + + private static final ConnectorEnforcement[] VALUES = values(); + + public static ConnectorEnforcement 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 ConnectorEnforcement(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.Settings.ConnectorEnforcement) + } + + /** + * + * + *
+   * ExecuteSql API's access to the instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.Settings.DataApiAccess} + */ + public enum DataApiAccess implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified, effectively the same as `DISALLOW_DATA_API`.
+     * 
+ * + * DATA_API_ACCESS_UNSPECIFIED = 0; + */ + DATA_API_ACCESS_UNSPECIFIED(0), + /** + * + * + *
+     * Disallow using ExecuteSql API to connect to the instance.
+     * 
+ * + * DISALLOW_DATA_API = 1; + */ + DISALLOW_DATA_API(1), + /** + * + * + *
+     * Allow using ExecuteSql API to connect to the instance. For private IP
+     * instances, this allows authorized users to access the instance from
+     * the public internet using ExecuteSql API.
+     * 
+ * + * ALLOW_DATA_API = 2; + */ + ALLOW_DATA_API(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DataApiAccess"); + } + + /** + * + * + *
+     * Unspecified, effectively the same as `DISALLOW_DATA_API`.
+     * 
+ * + * DATA_API_ACCESS_UNSPECIFIED = 0; + */ + public static final int DATA_API_ACCESS_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Disallow using ExecuteSql API to connect to the instance.
+     * 
+ * + * DISALLOW_DATA_API = 1; + */ + public static final int DISALLOW_DATA_API_VALUE = 1; + + /** + * + * + *
+     * Allow using ExecuteSql API to connect to the instance. For private IP
+     * instances, this allows authorized users to access the instance from
+     * the public internet using ExecuteSql API.
+     * 
+ * + * ALLOW_DATA_API = 2; + */ + public static final int ALLOW_DATA_API_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 DataApiAccess 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 DataApiAccess forNumber(int value) { + switch (value) { + case 0: + return DATA_API_ACCESS_UNSPECIFIED; + case 1: + return DISALLOW_DATA_API; + case 2: + return ALLOW_DATA_API; + 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 DataApiAccess findValueByNumber(int number) { + return DataApiAccess.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.Settings.getDescriptor().getEnumTypes().get(3); + } + + private static final DataApiAccess[] VALUES = values(); + + public static DataApiAccess 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 DataApiAccess(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.Settings.DataApiAccess) + } + + private int bitField0_; + public static final int SETTINGS_VERSION_FIELD_NUMBER = 1; + private com.google.protobuf.Int64Value settingsVersion_; + + /** + * + * + *
+   * The version of instance settings. This is a required field for update
+   * method to make sure concurrent updates are handled properly. During update,
+   * use the most recent settingsVersion value for this instance and do not try
+   * to update this value.
+   * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + * + * @return Whether the settingsVersion field is set. + */ + @java.lang.Override + public boolean hasSettingsVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The version of instance settings. This is a required field for update
+   * method to make sure concurrent updates are handled properly. During update,
+   * use the most recent settingsVersion value for this instance and do not try
+   * to update this value.
+   * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + * + * @return The settingsVersion. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getSettingsVersion() { + return settingsVersion_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : settingsVersion_; + } + + /** + * + * + *
+   * The version of instance settings. This is a required field for update
+   * method to make sure concurrent updates are handled properly. During update,
+   * use the most recent settingsVersion value for this instance and do not try
+   * to update this value.
+   * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getSettingsVersionOrBuilder() { + return settingsVersion_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : settingsVersion_; + } + + public static final int AUTHORIZED_GAE_APPLICATIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList authorizedGaeApplications_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @return A list containing the authorizedGaeApplications. + */ + @java.lang.Deprecated + public com.google.protobuf.ProtocolStringList getAuthorizedGaeApplicationsList() { + return authorizedGaeApplications_; + } + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @return The count of authorizedGaeApplications. + */ + @java.lang.Deprecated + public int getAuthorizedGaeApplicationsCount() { + return authorizedGaeApplications_.size(); + } + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @param index The index of the element to return. + * @return The authorizedGaeApplications at the given index. + */ + @java.lang.Deprecated + public java.lang.String getAuthorizedGaeApplications(int index) { + return authorizedGaeApplications_.get(index); + } + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @param index The index of the value to return. + * @return The bytes of the authorizedGaeApplications at the given index. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getAuthorizedGaeApplicationsBytes(int index) { + return authorizedGaeApplications_.getByteString(index); + } + + public static final int TIER_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object tier_ = ""; + + /** + * + * + *
+   * The tier (or machine type) for this instance, for example
+   * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+   * 
+ * + * string tier = 3; + * + * @return The tier. + */ + @java.lang.Override + public java.lang.String getTier() { + java.lang.Object ref = tier_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tier_ = s; + return s; + } + } + + /** + * + * + *
+   * The tier (or machine type) for this instance, for example
+   * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+   * 
+ * + * string tier = 3; + * + * @return The bytes for tier. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTierBytes() { + java.lang.Object ref = tier_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#settings`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#settings`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_LABELS_FIELD_NUMBER = 5; + + private static final class UserLabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Settings_UserLabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField userLabels_; + + private com.google.protobuf.MapField internalGetUserLabels() { + if (userLabels_ == null) { + return com.google.protobuf.MapField.emptyMapField(UserLabelsDefaultEntryHolder.defaultEntry); + } + return userLabels_; + } + + public int getUserLabelsCount() { + return internalGetUserLabels().getMap().size(); + } + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); + } + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); + } + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int AVAILABILITY_TYPE_FIELD_NUMBER = 6; + private int availabilityType_ = 0; + + /** + * + * + *
+   * Availability type. Potential values:
+   * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+   * zone affect data accessibility.
+   * *  `REGIONAL`: The instance can serve data from more than one zone in a
+   * region (it is highly available)./
+   *
+   * For more information, see [Overview of the High Availability
+   * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+   * 
+ * + * .google.cloud.sql.v1.SqlAvailabilityType availability_type = 6; + * + * @return The enum numeric value on the wire for availabilityType. + */ + @java.lang.Override + public int getAvailabilityTypeValue() { + return availabilityType_; + } + + /** + * + * + *
+   * Availability type. Potential values:
+   * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+   * zone affect data accessibility.
+   * *  `REGIONAL`: The instance can serve data from more than one zone in a
+   * region (it is highly available)./
+   *
+   * For more information, see [Overview of the High Availability
+   * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+   * 
+ * + * .google.cloud.sql.v1.SqlAvailabilityType availability_type = 6; + * + * @return The availabilityType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlAvailabilityType getAvailabilityType() { + com.google.cloud.sql.v1.SqlAvailabilityType result = + com.google.cloud.sql.v1.SqlAvailabilityType.forNumber(availabilityType_); + return result == null ? com.google.cloud.sql.v1.SqlAvailabilityType.UNRECOGNIZED : result; + } + + public static final int PRICING_PLAN_FIELD_NUMBER = 7; + private int pricingPlan_ = 0; + + /** + * + * + *
+   * The pricing plan for this instance. This can be either `PER_USE` or
+   * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.SqlPricingPlan pricing_plan = 7; + * + * @return The enum numeric value on the wire for pricingPlan. + */ + @java.lang.Override + public int getPricingPlanValue() { + return pricingPlan_; + } + + /** + * + * + *
+   * The pricing plan for this instance. This can be either `PER_USE` or
+   * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.SqlPricingPlan pricing_plan = 7; + * + * @return The pricingPlan. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlPricingPlan getPricingPlan() { + com.google.cloud.sql.v1.SqlPricingPlan result = + com.google.cloud.sql.v1.SqlPricingPlan.forNumber(pricingPlan_); + return result == null ? com.google.cloud.sql.v1.SqlPricingPlan.UNRECOGNIZED : result; + } + + public static final int REPLICATION_TYPE_FIELD_NUMBER = 8; + private int replicationType_ = 0; + + /** + * + * + *
+   * The type of replication this instance uses. This can be either
+   * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+   * applicable to First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.replication_type is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1692 + * @return The enum numeric value on the wire for replicationType. + */ + @java.lang.Override + @java.lang.Deprecated + public int getReplicationTypeValue() { + return replicationType_; + } + + /** + * + * + *
+   * The type of replication this instance uses. This can be either
+   * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+   * applicable to First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.replication_type is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1692 + * @return The replicationType. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.sql.v1.SqlReplicationType getReplicationType() { + com.google.cloud.sql.v1.SqlReplicationType result = + com.google.cloud.sql.v1.SqlReplicationType.forNumber(replicationType_); + return result == null ? com.google.cloud.sql.v1.SqlReplicationType.UNRECOGNIZED : result; + } + + public static final int STORAGE_AUTO_RESIZE_LIMIT_FIELD_NUMBER = 9; + private com.google.protobuf.Int64Value storageAutoResizeLimit_; + + /** + * + * + *
+   * The maximum size to which storage capacity can be automatically increased.
+   * The default value is 0, which specifies that there is no limit.
+   * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + * + * @return Whether the storageAutoResizeLimit field is set. + */ + @java.lang.Override + public boolean hasStorageAutoResizeLimit() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The maximum size to which storage capacity can be automatically increased.
+   * The default value is 0, which specifies that there is no limit.
+   * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + * + * @return The storageAutoResizeLimit. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getStorageAutoResizeLimit() { + return storageAutoResizeLimit_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : storageAutoResizeLimit_; + } + + /** + * + * + *
+   * The maximum size to which storage capacity can be automatically increased.
+   * The default value is 0, which specifies that there is no limit.
+   * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getStorageAutoResizeLimitOrBuilder() { + return storageAutoResizeLimit_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : storageAutoResizeLimit_; + } + + public static final int ACTIVATION_POLICY_FIELD_NUMBER = 10; + private int activationPolicy_ = 0; + + /** + * + * + *
+   * The activation policy specifies when the instance is activated; it is
+   * applicable only when the instance state is RUNNABLE. Valid values:
+   * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+   * connection requests.
+   * *  `NEVER`: The instance is off; it is not activated, even if a
+   * connection request arrives.
+   * 
+ * + * .google.cloud.sql.v1.Settings.SqlActivationPolicy activation_policy = 10; + * + * @return The enum numeric value on the wire for activationPolicy. + */ + @java.lang.Override + public int getActivationPolicyValue() { + return activationPolicy_; + } + + /** + * + * + *
+   * The activation policy specifies when the instance is activated; it is
+   * applicable only when the instance state is RUNNABLE. Valid values:
+   * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+   * connection requests.
+   * *  `NEVER`: The instance is off; it is not activated, even if a
+   * connection request arrives.
+   * 
+ * + * .google.cloud.sql.v1.Settings.SqlActivationPolicy activation_policy = 10; + * + * @return The activationPolicy. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Settings.SqlActivationPolicy getActivationPolicy() { + com.google.cloud.sql.v1.Settings.SqlActivationPolicy result = + com.google.cloud.sql.v1.Settings.SqlActivationPolicy.forNumber(activationPolicy_); + return result == null + ? com.google.cloud.sql.v1.Settings.SqlActivationPolicy.UNRECOGNIZED + : result; + } + + public static final int IP_CONFIGURATION_FIELD_NUMBER = 11; + private com.google.cloud.sql.v1.IpConfiguration ipConfiguration_; + + /** + * + * + *
+   * The settings for IP Management. This allows to enable or disable the
+   * instance IP and manage which external networks can connect to the instance.
+   * The IPv4 address cannot be disabled for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + * + * @return Whether the ipConfiguration field is set. + */ + @java.lang.Override + public boolean hasIpConfiguration() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The settings for IP Management. This allows to enable or disable the
+   * instance IP and manage which external networks can connect to the instance.
+   * The IPv4 address cannot be disabled for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + * + * @return The ipConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpConfiguration getIpConfiguration() { + return ipConfiguration_ == null + ? com.google.cloud.sql.v1.IpConfiguration.getDefaultInstance() + : ipConfiguration_; + } + + /** + * + * + *
+   * The settings for IP Management. This allows to enable or disable the
+   * instance IP and manage which external networks can connect to the instance.
+   * The IPv4 address cannot be disabled for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + */ + @java.lang.Override + public com.google.cloud.sql.v1.IpConfigurationOrBuilder getIpConfigurationOrBuilder() { + return ipConfiguration_ == null + ? com.google.cloud.sql.v1.IpConfiguration.getDefaultInstance() + : ipConfiguration_; + } + + public static final int STORAGE_AUTO_RESIZE_FIELD_NUMBER = 12; + private com.google.protobuf.BoolValue storageAutoResize_; + + /** + * + * + *
+   * Configuration to increase storage size automatically. The default value is
+   * true.
+   * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + * + * @return Whether the storageAutoResize field is set. + */ + @java.lang.Override + public boolean hasStorageAutoResize() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Configuration to increase storage size automatically. The default value is
+   * true.
+   * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + * + * @return The storageAutoResize. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getStorageAutoResize() { + return storageAutoResize_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : storageAutoResize_; + } + + /** + * + * + *
+   * Configuration to increase storage size automatically. The default value is
+   * true.
+   * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getStorageAutoResizeOrBuilder() { + return storageAutoResize_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : storageAutoResize_; + } + + public static final int LOCATION_PREFERENCE_FIELD_NUMBER = 13; + private com.google.cloud.sql.v1.LocationPreference locationPreference_; + + /** + * + * + *
+   * The location preference settings. This allows the instance to be located as
+   * near as possible to either an App Engine app or Compute Engine zone for
+   * better performance. App Engine co-location was only applicable to First
+   * Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + * + * @return Whether the locationPreference field is set. + */ + @java.lang.Override + public boolean hasLocationPreference() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * The location preference settings. This allows the instance to be located as
+   * near as possible to either an App Engine app or Compute Engine zone for
+   * better performance. App Engine co-location was only applicable to First
+   * Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + * + * @return The locationPreference. + */ + @java.lang.Override + public com.google.cloud.sql.v1.LocationPreference getLocationPreference() { + return locationPreference_ == null + ? com.google.cloud.sql.v1.LocationPreference.getDefaultInstance() + : locationPreference_; + } + + /** + * + * + *
+   * The location preference settings. This allows the instance to be located as
+   * near as possible to either an App Engine app or Compute Engine zone for
+   * better performance. App Engine co-location was only applicable to First
+   * Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + */ + @java.lang.Override + public com.google.cloud.sql.v1.LocationPreferenceOrBuilder getLocationPreferenceOrBuilder() { + return locationPreference_ == null + ? com.google.cloud.sql.v1.LocationPreference.getDefaultInstance() + : locationPreference_; + } + + public static final int DATABASE_FLAGS_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private java.util.List databaseFlags_; + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + @java.lang.Override + public java.util.List getDatabaseFlagsList() { + return databaseFlags_; + } + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + @java.lang.Override + public java.util.List + getDatabaseFlagsOrBuilderList() { + return databaseFlags_; + } + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + @java.lang.Override + public int getDatabaseFlagsCount() { + return databaseFlags_.size(); + } + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseFlags getDatabaseFlags(int index) { + return databaseFlags_.get(index); + } + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseFlagsOrBuilder getDatabaseFlagsOrBuilder(int index) { + return databaseFlags_.get(index); + } + + public static final int DATA_DISK_TYPE_FIELD_NUMBER = 15; + private int dataDiskType_ = 0; + + /** + * + * + *
+   * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+   * First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.SqlDataDiskType data_disk_type = 15; + * + * @return The enum numeric value on the wire for dataDiskType. + */ + @java.lang.Override + public int getDataDiskTypeValue() { + return dataDiskType_; + } + + /** + * + * + *
+   * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+   * First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.SqlDataDiskType data_disk_type = 15; + * + * @return The dataDiskType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlDataDiskType getDataDiskType() { + com.google.cloud.sql.v1.SqlDataDiskType result = + com.google.cloud.sql.v1.SqlDataDiskType.forNumber(dataDiskType_); + return result == null ? com.google.cloud.sql.v1.SqlDataDiskType.UNRECOGNIZED : result; + } + + public static final int MAINTENANCE_WINDOW_FIELD_NUMBER = 16; + private com.google.cloud.sql.v1.MaintenanceWindow maintenanceWindow_; + + /** + * + * + *
+   * The maintenance window for this instance. This specifies when the instance
+   * can be restarted for maintenance purposes.
+   * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + * + * @return Whether the maintenanceWindow field is set. + */ + @java.lang.Override + public boolean hasMaintenanceWindow() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * The maintenance window for this instance. This specifies when the instance
+   * can be restarted for maintenance purposes.
+   * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + * + * @return The maintenanceWindow. + */ + @java.lang.Override + public com.google.cloud.sql.v1.MaintenanceWindow getMaintenanceWindow() { + return maintenanceWindow_ == null + ? com.google.cloud.sql.v1.MaintenanceWindow.getDefaultInstance() + : maintenanceWindow_; + } + + /** + * + * + *
+   * The maintenance window for this instance. This specifies when the instance
+   * can be restarted for maintenance purposes.
+   * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + */ + @java.lang.Override + public com.google.cloud.sql.v1.MaintenanceWindowOrBuilder getMaintenanceWindowOrBuilder() { + return maintenanceWindow_ == null + ? com.google.cloud.sql.v1.MaintenanceWindow.getDefaultInstance() + : maintenanceWindow_; + } + + public static final int BACKUP_CONFIGURATION_FIELD_NUMBER = 17; + private com.google.cloud.sql.v1.BackupConfiguration backupConfiguration_; + + /** + * + * + *
+   * The daily backup configuration for the instance.
+   * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + * + * @return Whether the backupConfiguration field is set. + */ + @java.lang.Override + public boolean hasBackupConfiguration() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * The daily backup configuration for the instance.
+   * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + * + * @return The backupConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupConfiguration getBackupConfiguration() { + return backupConfiguration_ == null + ? com.google.cloud.sql.v1.BackupConfiguration.getDefaultInstance() + : backupConfiguration_; + } + + /** + * + * + *
+   * The daily backup configuration for the instance.
+   * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupConfigurationOrBuilder getBackupConfigurationOrBuilder() { + return backupConfiguration_ == null + ? com.google.cloud.sql.v1.BackupConfiguration.getDefaultInstance() + : backupConfiguration_; + } + + public static final int DATABASE_REPLICATION_ENABLED_FIELD_NUMBER = 18; + private com.google.protobuf.BoolValue databaseReplicationEnabled_; + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * replication is enabled or not. WARNING: Changing this restarts the
+   * instance.
+   * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + * + * @return Whether the databaseReplicationEnabled field is set. + */ + @java.lang.Override + public boolean hasDatabaseReplicationEnabled() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * replication is enabled or not. WARNING: Changing this restarts the
+   * instance.
+   * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + * + * @return The databaseReplicationEnabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getDatabaseReplicationEnabled() { + return databaseReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : databaseReplicationEnabled_; + } + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * replication is enabled or not. WARNING: Changing this restarts the
+   * instance.
+   * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getDatabaseReplicationEnabledOrBuilder() { + return databaseReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : databaseReplicationEnabled_; + } + + public static final int CRASH_SAFE_REPLICATION_ENABLED_FIELD_NUMBER = 19; + private com.google.protobuf.BoolValue crashSafeReplicationEnabled_; + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * database flags for crash-safe replication are enabled. This property was
+   * only applicable to First Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.Settings.crash_safe_replication_enabled is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1743 + * @return Whether the crashSafeReplicationEnabled field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasCrashSafeReplicationEnabled() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * database flags for crash-safe replication are enabled. This property was
+   * only applicable to First Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.Settings.crash_safe_replication_enabled is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1743 + * @return The crashSafeReplicationEnabled. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.BoolValue getCrashSafeReplicationEnabled() { + return crashSafeReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : crashSafeReplicationEnabled_; + } + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * database flags for crash-safe replication are enabled. This property was
+   * only applicable to First Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.BoolValueOrBuilder getCrashSafeReplicationEnabledOrBuilder() { + return crashSafeReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : crashSafeReplicationEnabled_; + } + + public static final int DATA_DISK_SIZE_GB_FIELD_NUMBER = 20; + private com.google.protobuf.Int64Value dataDiskSizeGb_; + + /** + * + * + *
+   * The size of data disk, in GB. The data disk size minimum is 10GB.
+   * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + * + * @return Whether the dataDiskSizeGb field is set. + */ + @java.lang.Override + public boolean hasDataDiskSizeGb() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+   * The size of data disk, in GB. The data disk size minimum is 10GB.
+   * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + * + * @return The dataDiskSizeGb. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getDataDiskSizeGb() { + return dataDiskSizeGb_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : dataDiskSizeGb_; + } + + /** + * + * + *
+   * The size of data disk, in GB. The data disk size minimum is 10GB.
+   * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getDataDiskSizeGbOrBuilder() { + return dataDiskSizeGb_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : dataDiskSizeGb_; + } + + public static final int ACTIVE_DIRECTORY_CONFIG_FIELD_NUMBER = 22; + private com.google.cloud.sql.v1.SqlActiveDirectoryConfig activeDirectoryConfig_; + + /** + * + * + *
+   * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + * + * @return Whether the activeDirectoryConfig field is set. + */ + @java.lang.Override + public boolean hasActiveDirectoryConfig() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+   * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + * + * @return The activeDirectoryConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlActiveDirectoryConfig getActiveDirectoryConfig() { + return activeDirectoryConfig_ == null + ? com.google.cloud.sql.v1.SqlActiveDirectoryConfig.getDefaultInstance() + : activeDirectoryConfig_; + } + + /** + * + * + *
+   * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlActiveDirectoryConfigOrBuilder + getActiveDirectoryConfigOrBuilder() { + return activeDirectoryConfig_ == null + ? com.google.cloud.sql.v1.SqlActiveDirectoryConfig.getDefaultInstance() + : activeDirectoryConfig_; + } + + public static final int COLLATION_FIELD_NUMBER = 23; + + @SuppressWarnings("serial") + private volatile java.lang.Object collation_ = ""; + + /** + * + * + *
+   * The name of server Instance collation.
+   * 
+ * + * string collation = 23; + * + * @return The collation. + */ + @java.lang.Override + public java.lang.String getCollation() { + java.lang.Object ref = collation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collation_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of server Instance collation.
+   * 
+ * + * string collation = 23; + * + * @return The bytes for collation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCollationBytes() { + java.lang.Object ref = collation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DENY_MAINTENANCE_PERIODS_FIELD_NUMBER = 24; + + @SuppressWarnings("serial") + private java.util.List denyMaintenancePeriods_; + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + */ + @java.lang.Override + public java.util.List + getDenyMaintenancePeriodsList() { + return denyMaintenancePeriods_; + } + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + */ + @java.lang.Override + public java.util.List + getDenyMaintenancePeriodsOrBuilderList() { + return denyMaintenancePeriods_; + } + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + */ + @java.lang.Override + public int getDenyMaintenancePeriodsCount() { + return denyMaintenancePeriods_.size(); + } + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + */ + @java.lang.Override + public com.google.cloud.sql.v1.DenyMaintenancePeriod getDenyMaintenancePeriods(int index) { + return denyMaintenancePeriods_.get(index); + } + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + */ + @java.lang.Override + public com.google.cloud.sql.v1.DenyMaintenancePeriodOrBuilder getDenyMaintenancePeriodsOrBuilder( + int index) { + return denyMaintenancePeriods_.get(index); + } + + public static final int INSIGHTS_CONFIG_FIELD_NUMBER = 25; + private com.google.cloud.sql.v1.InsightsConfig insightsConfig_; + + /** + * + * + *
+   * Insights configuration, for now relevant only for Postgres.
+   * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + * + * @return Whether the insightsConfig field is set. + */ + @java.lang.Override + public boolean hasInsightsConfig() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+   * Insights configuration, for now relevant only for Postgres.
+   * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + * + * @return The insightsConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InsightsConfig getInsightsConfig() { + return insightsConfig_ == null + ? com.google.cloud.sql.v1.InsightsConfig.getDefaultInstance() + : insightsConfig_; + } + + /** + * + * + *
+   * Insights configuration, for now relevant only for Postgres.
+   * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + */ + @java.lang.Override + public com.google.cloud.sql.v1.InsightsConfigOrBuilder getInsightsConfigOrBuilder() { + return insightsConfig_ == null + ? com.google.cloud.sql.v1.InsightsConfig.getDefaultInstance() + : insightsConfig_; + } + + public static final int PASSWORD_VALIDATION_POLICY_FIELD_NUMBER = 27; + private com.google.cloud.sql.v1.PasswordValidationPolicy passwordValidationPolicy_; + + /** + * + * + *
+   * The local user password validation policy of the instance.
+   * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + * + * @return Whether the passwordValidationPolicy field is set. + */ + @java.lang.Override + public boolean hasPasswordValidationPolicy() { + return ((bitField0_ & 0x00001000) != 0); + } + + /** + * + * + *
+   * The local user password validation policy of the instance.
+   * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + * + * @return The passwordValidationPolicy. + */ + @java.lang.Override + public com.google.cloud.sql.v1.PasswordValidationPolicy getPasswordValidationPolicy() { + return passwordValidationPolicy_ == null + ? com.google.cloud.sql.v1.PasswordValidationPolicy.getDefaultInstance() + : passwordValidationPolicy_; + } + + /** + * + * + *
+   * The local user password validation policy of the instance.
+   * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + */ + @java.lang.Override + public com.google.cloud.sql.v1.PasswordValidationPolicyOrBuilder + getPasswordValidationPolicyOrBuilder() { + return passwordValidationPolicy_ == null + ? com.google.cloud.sql.v1.PasswordValidationPolicy.getDefaultInstance() + : passwordValidationPolicy_; + } + + public static final int SQL_SERVER_AUDIT_CONFIG_FIELD_NUMBER = 29; + private com.google.cloud.sql.v1.SqlServerAuditConfig sqlServerAuditConfig_; + + /** + * + * + *
+   * SQL Server specific audit configuration.
+   * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + * + * @return Whether the sqlServerAuditConfig field is set. + */ + @java.lang.Override + public boolean hasSqlServerAuditConfig() { + return ((bitField0_ & 0x00002000) != 0); + } + + /** + * + * + *
+   * SQL Server specific audit configuration.
+   * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + * + * @return The sqlServerAuditConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerAuditConfig getSqlServerAuditConfig() { + return sqlServerAuditConfig_ == null + ? com.google.cloud.sql.v1.SqlServerAuditConfig.getDefaultInstance() + : sqlServerAuditConfig_; + } + + /** + * + * + *
+   * SQL Server specific audit configuration.
+   * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerAuditConfigOrBuilder getSqlServerAuditConfigOrBuilder() { + return sqlServerAuditConfig_ == null + ? com.google.cloud.sql.v1.SqlServerAuditConfig.getDefaultInstance() + : sqlServerAuditConfig_; + } + + public static final int EDITION_FIELD_NUMBER = 38; + private int edition_ = 0; + + /** + * + * + *
+   * Optional. The edition type of the Cloud SQL instance.
+   * 
+ * + * + * .google.cloud.sql.v1.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for edition. + */ + @java.lang.Override + public int getEditionValue() { + return edition_; + } + + /** + * + * + *
+   * Optional. The edition type of the Cloud SQL instance.
+   * 
+ * + * + * .google.cloud.sql.v1.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The edition. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Settings.Edition getEdition() { + com.google.cloud.sql.v1.Settings.Edition result = + com.google.cloud.sql.v1.Settings.Edition.forNumber(edition_); + return result == null ? com.google.cloud.sql.v1.Settings.Edition.UNRECOGNIZED : result; + } + + public static final int CONNECTOR_ENFORCEMENT_FIELD_NUMBER = 32; + private int connectorEnforcement_ = 0; + + /** + * + * + *
+   * Specifies if connections must use Cloud SQL connectors.
+   * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+   * can be connected without Cloud SQL
+   * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+   * Connectors).
+   *
+   * Note that using REQUIRED disables all existing authorized networks. If
+   * this field is not specified when creating a new instance, NOT_REQUIRED is
+   * used. If this field is not specified when patching or updating an existing
+   * instance, it is left unchanged in the instance.
+   * 
+ * + * .google.cloud.sql.v1.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * @return The enum numeric value on the wire for connectorEnforcement. + */ + @java.lang.Override + public int getConnectorEnforcementValue() { + return connectorEnforcement_; + } + + /** + * + * + *
+   * Specifies if connections must use Cloud SQL connectors.
+   * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+   * can be connected without Cloud SQL
+   * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+   * Connectors).
+   *
+   * Note that using REQUIRED disables all existing authorized networks. If
+   * this field is not specified when creating a new instance, NOT_REQUIRED is
+   * used. If this field is not specified when patching or updating an existing
+   * instance, it is left unchanged in the instance.
+   * 
+ * + * .google.cloud.sql.v1.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * @return The connectorEnforcement. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Settings.ConnectorEnforcement getConnectorEnforcement() { + com.google.cloud.sql.v1.Settings.ConnectorEnforcement result = + com.google.cloud.sql.v1.Settings.ConnectorEnforcement.forNumber(connectorEnforcement_); + return result == null + ? com.google.cloud.sql.v1.Settings.ConnectorEnforcement.UNRECOGNIZED + : result; + } + + public static final int DELETION_PROTECTION_ENABLED_FIELD_NUMBER = 33; + private com.google.protobuf.BoolValue deletionProtectionEnabled_; + + /** + * + * + *
+   * Configuration to protect against accidental instance deletion.
+   * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + * + * @return Whether the deletionProtectionEnabled field is set. + */ + @java.lang.Override + public boolean hasDeletionProtectionEnabled() { + return ((bitField0_ & 0x00004000) != 0); + } + + /** + * + * + *
+   * Configuration to protect against accidental instance deletion.
+   * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + * + * @return The deletionProtectionEnabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getDeletionProtectionEnabled() { + return deletionProtectionEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : deletionProtectionEnabled_; + } + + /** + * + * + *
+   * Configuration to protect against accidental instance deletion.
+   * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getDeletionProtectionEnabledOrBuilder() { + return deletionProtectionEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : deletionProtectionEnabled_; + } + + public static final int TIME_ZONE_FIELD_NUMBER = 34; + + @SuppressWarnings("serial") + private volatile java.lang.Object timeZone_ = ""; + + /** + * + * + *
+   * Server timezone, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * string time_zone = 34; + * + * @return The timeZone. + */ + @java.lang.Override + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } + } + + /** + * + * + *
+   * Server timezone, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * string time_zone = 34; + * + * @return The bytes for timeZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ADVANCED_MACHINE_FEATURES_FIELD_NUMBER = 35; + private com.google.cloud.sql.v1.AdvancedMachineFeatures advancedMachineFeatures_; + + /** + * + * + *
+   * Specifies advanced machine configuration for the instances relevant only
+   * for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + * + * @return Whether the advancedMachineFeatures field is set. + */ + @java.lang.Override + public boolean hasAdvancedMachineFeatures() { + return ((bitField0_ & 0x00008000) != 0); + } + + /** + * + * + *
+   * Specifies advanced machine configuration for the instances relevant only
+   * for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + * + * @return The advancedMachineFeatures. + */ + @java.lang.Override + public com.google.cloud.sql.v1.AdvancedMachineFeatures getAdvancedMachineFeatures() { + return advancedMachineFeatures_ == null + ? com.google.cloud.sql.v1.AdvancedMachineFeatures.getDefaultInstance() + : advancedMachineFeatures_; + } + + /** + * + * + *
+   * Specifies advanced machine configuration for the instances relevant only
+   * for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + */ + @java.lang.Override + public com.google.cloud.sql.v1.AdvancedMachineFeaturesOrBuilder + getAdvancedMachineFeaturesOrBuilder() { + return advancedMachineFeatures_ == null + ? com.google.cloud.sql.v1.AdvancedMachineFeatures.getDefaultInstance() + : advancedMachineFeatures_; + } + + public static final int DATA_CACHE_CONFIG_FIELD_NUMBER = 37; + private com.google.cloud.sql.v1.DataCacheConfig dataCacheConfig_; + + /** + * + * + *
+   * Configuration for data cache.
+   * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + * + * @return Whether the dataCacheConfig field is set. + */ + @java.lang.Override + public boolean hasDataCacheConfig() { + return ((bitField0_ & 0x00010000) != 0); + } + + /** + * + * + *
+   * Configuration for data cache.
+   * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + * + * @return The dataCacheConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DataCacheConfig getDataCacheConfig() { + return dataCacheConfig_ == null + ? com.google.cloud.sql.v1.DataCacheConfig.getDefaultInstance() + : dataCacheConfig_; + } + + /** + * + * + *
+   * Configuration for data cache.
+   * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + */ + @java.lang.Override + public com.google.cloud.sql.v1.DataCacheConfigOrBuilder getDataCacheConfigOrBuilder() { + return dataCacheConfig_ == null + ? com.google.cloud.sql.v1.DataCacheConfig.getDefaultInstance() + : dataCacheConfig_; + } + + public static final int REPLICATION_LAG_MAX_SECONDS_FIELD_NUMBER = 39; + private com.google.protobuf.Int32Value replicationLagMaxSeconds_; + + /** + * + * + *
+   * Optional. Configuration value for recreation of replica after certain
+   * replication lag
+   * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the replicationLagMaxSeconds field is set. + */ + @java.lang.Override + public boolean hasReplicationLagMaxSeconds() { + return ((bitField0_ & 0x00020000) != 0); + } + + /** + * + * + *
+   * Optional. Configuration value for recreation of replica after certain
+   * replication lag
+   * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The replicationLagMaxSeconds. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getReplicationLagMaxSeconds() { + return replicationLagMaxSeconds_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : replicationLagMaxSeconds_; + } + + /** + * + * + *
+   * Optional. Configuration value for recreation of replica after certain
+   * replication lag
+   * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getReplicationLagMaxSecondsOrBuilder() { + return replicationLagMaxSeconds_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : replicationLagMaxSeconds_; + } + + public static final int ENABLE_GOOGLE_ML_INTEGRATION_FIELD_NUMBER = 40; + private com.google.protobuf.BoolValue enableGoogleMlIntegration_; + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL instances can
+   * connect to Vertex AI to pass requests for real-time predictions and
+   * insights to the AI. The default value is false. This applies only to Cloud
+   * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enableGoogleMlIntegration field is set. + */ + @java.lang.Override + public boolean hasEnableGoogleMlIntegration() { + return ((bitField0_ & 0x00040000) != 0); + } + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL instances can
+   * connect to Vertex AI to pass requests for real-time predictions and
+   * insights to the AI. The default value is false. This applies only to Cloud
+   * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enableGoogleMlIntegration. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnableGoogleMlIntegration() { + return enableGoogleMlIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableGoogleMlIntegration_; + } + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL instances can
+   * connect to Vertex AI to pass requests for real-time predictions and
+   * insights to the AI. The default value is false. This applies only to Cloud
+   * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getEnableGoogleMlIntegrationOrBuilder() { + return enableGoogleMlIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableGoogleMlIntegration_; + } + + public static final int ENABLE_DATAPLEX_INTEGRATION_FIELD_NUMBER = 41; + private com.google.protobuf.BoolValue enableDataplexIntegration_; + + /** + * + * + *
+   * Optional. By default, Cloud SQL instances have schema extraction disabled
+   * for Dataplex. When this parameter is set to true, schema extraction for
+   * Dataplex on Cloud SQL instances is activated.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enableDataplexIntegration field is set. + */ + @java.lang.Override + public boolean hasEnableDataplexIntegration() { + return ((bitField0_ & 0x00080000) != 0); + } + + /** + * + * + *
+   * Optional. By default, Cloud SQL instances have schema extraction disabled
+   * for Dataplex. When this parameter is set to true, schema extraction for
+   * Dataplex on Cloud SQL instances is activated.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enableDataplexIntegration. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnableDataplexIntegration() { + return enableDataplexIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableDataplexIntegration_; + } + + /** + * + * + *
+   * Optional. By default, Cloud SQL instances have schema extraction disabled
+   * for Dataplex. When this parameter is set to true, schema extraction for
+   * Dataplex on Cloud SQL instances is activated.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getEnableDataplexIntegrationOrBuilder() { + return enableDataplexIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableDataplexIntegration_; + } + + public static final int RETAIN_BACKUPS_ON_DELETE_FIELD_NUMBER = 42; + private com.google.protobuf.BoolValue retainBackupsOnDelete_; + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL retains backups of
+   * the instance even after the instance is deleted. The ON_DEMAND backup will
+   * be retained until customer deletes the backup or the project. The AUTOMATED
+   * backup will be retained based on the backups retention setting.
+   * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the retainBackupsOnDelete field is set. + */ + @java.lang.Override + public boolean hasRetainBackupsOnDelete() { + return ((bitField0_ & 0x00100000) != 0); + } + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL retains backups of
+   * the instance even after the instance is deleted. The ON_DEMAND backup will
+   * be retained until customer deletes the backup or the project. The AUTOMATED
+   * backup will be retained based on the backups retention setting.
+   * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retainBackupsOnDelete. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getRetainBackupsOnDelete() { + return retainBackupsOnDelete_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : retainBackupsOnDelete_; + } + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL retains backups of
+   * the instance even after the instance is deleted. The ON_DEMAND backup will
+   * be retained until customer deletes the backup or the project. The AUTOMATED
+   * backup will be retained based on the backups retention setting.
+   * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getRetainBackupsOnDeleteOrBuilder() { + return retainBackupsOnDelete_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : retainBackupsOnDelete_; + } + + public static final int DATA_DISK_PROVISIONED_IOPS_FIELD_NUMBER = 43; + private long dataDiskProvisionedIops_ = 0L; + + /** + * + * + *
+   * Optional. Provisioned number of I/O operations per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataDiskProvisionedIops field is set. + */ + @java.lang.Override + public boolean hasDataDiskProvisionedIops() { + return ((bitField0_ & 0x00200000) != 0); + } + + /** + * + * + *
+   * Optional. Provisioned number of I/O operations per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataDiskProvisionedIops. + */ + @java.lang.Override + public long getDataDiskProvisionedIops() { + return dataDiskProvisionedIops_; + } + + public static final int DATA_DISK_PROVISIONED_THROUGHPUT_FIELD_NUMBER = 44; + private long dataDiskProvisionedThroughput_ = 0L; + + /** + * + * + *
+   * Optional. Provisioned throughput measured in MiB per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataDiskProvisionedThroughput field is set. + */ + @java.lang.Override + public boolean hasDataDiskProvisionedThroughput() { + return ((bitField0_ & 0x00400000) != 0); + } + + /** + * + * + *
+   * Optional. Provisioned throughput measured in MiB per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataDiskProvisionedThroughput. + */ + @java.lang.Override + public long getDataDiskProvisionedThroughput() { + return dataDiskProvisionedThroughput_; + } + + public static final int CONNECTION_POOL_CONFIG_FIELD_NUMBER = 45; + private com.google.cloud.sql.v1.ConnectionPoolConfig connectionPoolConfig_; + + /** + * + * + *
+   * Optional. The managed connection pooling configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the connectionPoolConfig field is set. + */ + @java.lang.Override + public boolean hasConnectionPoolConfig() { + return ((bitField0_ & 0x00800000) != 0); + } + + /** + * + * + *
+   * Optional. The managed connection pooling configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The connectionPoolConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ConnectionPoolConfig getConnectionPoolConfig() { + return connectionPoolConfig_ == null + ? com.google.cloud.sql.v1.ConnectionPoolConfig.getDefaultInstance() + : connectionPoolConfig_; + } + + /** + * + * + *
+   * Optional. The managed connection pooling configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ConnectionPoolConfigOrBuilder getConnectionPoolConfigOrBuilder() { + return connectionPoolConfig_ == null + ? com.google.cloud.sql.v1.ConnectionPoolConfig.getDefaultInstance() + : connectionPoolConfig_; + } + + public static final int FINAL_BACKUP_CONFIG_FIELD_NUMBER = 47; + private com.google.cloud.sql.v1.FinalBackupConfig finalBackupConfig_; + + /** + * + * + *
+   * Optional. The final backup configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the finalBackupConfig field is set. + */ + @java.lang.Override + public boolean hasFinalBackupConfig() { + return ((bitField0_ & 0x01000000) != 0); + } + + /** + * + * + *
+   * Optional. The final backup configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The finalBackupConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.FinalBackupConfig getFinalBackupConfig() { + return finalBackupConfig_ == null + ? com.google.cloud.sql.v1.FinalBackupConfig.getDefaultInstance() + : finalBackupConfig_; + } + + /** + * + * + *
+   * Optional. The final backup configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.FinalBackupConfigOrBuilder getFinalBackupConfigOrBuilder() { + return finalBackupConfig_ == null + ? com.google.cloud.sql.v1.FinalBackupConfig.getDefaultInstance() + : finalBackupConfig_; + } + + public static final int READ_POOL_AUTO_SCALE_CONFIG_FIELD_NUMBER = 48; + private com.google.cloud.sql.v1.ReadPoolAutoScaleConfig readPoolAutoScaleConfig_; + + /** + * + * + *
+   * Optional. The read pool auto-scale configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readPoolAutoScaleConfig field is set. + */ + @java.lang.Override + public boolean hasReadPoolAutoScaleConfig() { + return ((bitField0_ & 0x02000000) != 0); + } + + /** + * + * + *
+   * Optional. The read pool auto-scale configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readPoolAutoScaleConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig getReadPoolAutoScaleConfig() { + return readPoolAutoScaleConfig_ == null + ? com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.getDefaultInstance() + : readPoolAutoScaleConfig_; + } + + /** + * + * + *
+   * Optional. The read pool auto-scale configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfigOrBuilder + getReadPoolAutoScaleConfigOrBuilder() { + return readPoolAutoScaleConfig_ == null + ? com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.getDefaultInstance() + : readPoolAutoScaleConfig_; + } + + public static final int ACCELERATED_REPLICA_MODE_FIELD_NUMBER = 49; + private com.google.protobuf.BoolValue acceleratedReplicaMode_; + + /** + * + * + *
+   * Optional. Whether the replica is in accelerated mode. This feature is in
+   * private preview and requires allowlisting to take effect.
+   * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the acceleratedReplicaMode field is set. + */ + @java.lang.Override + public boolean hasAcceleratedReplicaMode() { + return ((bitField0_ & 0x04000000) != 0); + } + + /** + * + * + *
+   * Optional. Whether the replica is in accelerated mode. This feature is in
+   * private preview and requires allowlisting to take effect.
+   * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The acceleratedReplicaMode. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getAcceleratedReplicaMode() { + return acceleratedReplicaMode_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : acceleratedReplicaMode_; + } + + /** + * + * + *
+   * Optional. Whether the replica is in accelerated mode. This feature is in
+   * private preview and requires allowlisting to take effect.
+   * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getAcceleratedReplicaModeOrBuilder() { + return acceleratedReplicaMode_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : acceleratedReplicaMode_; + } + + public static final int AUTO_UPGRADE_ENABLED_FIELD_NUMBER = 50; + private boolean autoUpgradeEnabled_ = false; + + /** + * + * + *
+   * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+   * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+   * versions. The MySQL version must be 8.0.35 or higher.
+   * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the autoUpgradeEnabled field is set. + */ + @java.lang.Override + public boolean hasAutoUpgradeEnabled() { + return ((bitField0_ & 0x08000000) != 0); + } + + /** + * + * + *
+   * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+   * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+   * versions. The MySQL version must be 8.0.35 or higher.
+   * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The autoUpgradeEnabled. + */ + @java.lang.Override + public boolean getAutoUpgradeEnabled() { + return autoUpgradeEnabled_; + } + + public static final int ENTRAID_CONFIG_FIELD_NUMBER = 52; + private com.google.cloud.sql.v1.SqlServerEntraIdConfig entraidConfig_; + + /** + * + * + *
+   * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the entraidConfig field is set. + */ + @java.lang.Override + public boolean hasEntraidConfig() { + return ((bitField0_ & 0x10000000) != 0); + } + + /** + * + * + *
+   * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The entraidConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerEntraIdConfig getEntraidConfig() { + return entraidConfig_ == null + ? com.google.cloud.sql.v1.SqlServerEntraIdConfig.getDefaultInstance() + : entraidConfig_; + } + + /** + * + * + *
+   * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerEntraIdConfigOrBuilder getEntraidConfigOrBuilder() { + return entraidConfig_ == null + ? com.google.cloud.sql.v1.SqlServerEntraIdConfig.getDefaultInstance() + : entraidConfig_; + } + + public static final int DATA_API_ACCESS_FIELD_NUMBER = 53; + private int dataApiAccess_ = 0; + + /** + * + * + *
+   * This parameter controls whether to allow using ExecuteSql API to connect to
+   * the instance. Not allowed by default.
+   * 
+ * + * optional .google.cloud.sql.v1.Settings.DataApiAccess data_api_access = 53; + * + * @return Whether the dataApiAccess field is set. + */ + @java.lang.Override + public boolean hasDataApiAccess() { + return ((bitField0_ & 0x20000000) != 0); + } + + /** + * + * + *
+   * This parameter controls whether to allow using ExecuteSql API to connect to
+   * the instance. Not allowed by default.
+   * 
+ * + * optional .google.cloud.sql.v1.Settings.DataApiAccess data_api_access = 53; + * + * @return The enum numeric value on the wire for dataApiAccess. + */ + @java.lang.Override + public int getDataApiAccessValue() { + return dataApiAccess_; + } + + /** + * + * + *
+   * This parameter controls whether to allow using ExecuteSql API to connect to
+   * the instance. Not allowed by default.
+   * 
+ * + * optional .google.cloud.sql.v1.Settings.DataApiAccess data_api_access = 53; + * + * @return The dataApiAccess. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Settings.DataApiAccess getDataApiAccess() { + com.google.cloud.sql.v1.Settings.DataApiAccess result = + com.google.cloud.sql.v1.Settings.DataApiAccess.forNumber(dataApiAccess_); + return result == null ? com.google.cloud.sql.v1.Settings.DataApiAccess.UNRECOGNIZED : result; + } + + public static final int PERFORMANCE_CAPTURE_CONFIG_FIELD_NUMBER = 54; + private com.google.cloud.sql.v1.PerformanceCaptureConfig performanceCaptureConfig_; + + /** + * + * + *
+   * Optional. Configuration for Performance Capture, provides diagnostic
+   * metrics during high load situations.
+   * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the performanceCaptureConfig field is set. + */ + @java.lang.Override + public boolean hasPerformanceCaptureConfig() { + return ((bitField0_ & 0x40000000) != 0); + } + + /** + * + * + *
+   * Optional. Configuration for Performance Capture, provides diagnostic
+   * metrics during high load situations.
+   * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The performanceCaptureConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.PerformanceCaptureConfig getPerformanceCaptureConfig() { + return performanceCaptureConfig_ == null + ? com.google.cloud.sql.v1.PerformanceCaptureConfig.getDefaultInstance() + : performanceCaptureConfig_; + } + + /** + * + * + *
+   * Optional. Configuration for Performance Capture, provides diagnostic
+   * metrics during high load situations.
+   * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.PerformanceCaptureConfigOrBuilder + getPerformanceCaptureConfigOrBuilder() { + return performanceCaptureConfig_ == null + ? com.google.cloud.sql.v1.PerformanceCaptureConfig.getDefaultInstance() + : performanceCaptureConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getSettingsVersion()); + } + for (int i = 0; i < authorizedGaeApplications_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 2, authorizedGaeApplications_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tier_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, tier_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, kind_); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetUserLabels(), UserLabelsDefaultEntryHolder.defaultEntry, 5); + if (availabilityType_ + != com.google.cloud.sql.v1.SqlAvailabilityType.SQL_AVAILABILITY_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, availabilityType_); + } + if (pricingPlan_ + != com.google.cloud.sql.v1.SqlPricingPlan.SQL_PRICING_PLAN_UNSPECIFIED.getNumber()) { + output.writeEnum(7, pricingPlan_); + } + if (replicationType_ + != com.google.cloud.sql.v1.SqlReplicationType.SQL_REPLICATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, replicationType_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(9, getStorageAutoResizeLimit()); + } + if (activationPolicy_ + != com.google.cloud.sql.v1.Settings.SqlActivationPolicy.SQL_ACTIVATION_POLICY_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, activationPolicy_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(11, getIpConfiguration()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(12, getStorageAutoResize()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(13, getLocationPreference()); + } + for (int i = 0; i < databaseFlags_.size(); i++) { + output.writeMessage(14, databaseFlags_.get(i)); + } + if (dataDiskType_ + != com.google.cloud.sql.v1.SqlDataDiskType.SQL_DATA_DISK_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(15, dataDiskType_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(16, getMaintenanceWindow()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(17, getBackupConfiguration()); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(18, getDatabaseReplicationEnabled()); + } + if (((bitField0_ & 0x00000100) != 0)) { + output.writeMessage(19, getCrashSafeReplicationEnabled()); + } + if (((bitField0_ & 0x00000200) != 0)) { + output.writeMessage(20, getDataDiskSizeGb()); + } + if (((bitField0_ & 0x00000400) != 0)) { + output.writeMessage(22, getActiveDirectoryConfig()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(collation_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 23, collation_); + } + for (int i = 0; i < denyMaintenancePeriods_.size(); i++) { + output.writeMessage(24, denyMaintenancePeriods_.get(i)); + } + if (((bitField0_ & 0x00000800) != 0)) { + output.writeMessage(25, getInsightsConfig()); + } + if (((bitField0_ & 0x00001000) != 0)) { + output.writeMessage(27, getPasswordValidationPolicy()); + } + if (((bitField0_ & 0x00002000) != 0)) { + output.writeMessage(29, getSqlServerAuditConfig()); + } + if (connectorEnforcement_ + != com.google.cloud.sql.v1.Settings.ConnectorEnforcement.CONNECTOR_ENFORCEMENT_UNSPECIFIED + .getNumber()) { + output.writeEnum(32, connectorEnforcement_); + } + if (((bitField0_ & 0x00004000) != 0)) { + output.writeMessage(33, getDeletionProtectionEnabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(timeZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 34, timeZone_); + } + if (((bitField0_ & 0x00008000) != 0)) { + output.writeMessage(35, getAdvancedMachineFeatures()); + } + if (((bitField0_ & 0x00010000) != 0)) { + output.writeMessage(37, getDataCacheConfig()); + } + if (edition_ != com.google.cloud.sql.v1.Settings.Edition.EDITION_UNSPECIFIED.getNumber()) { + output.writeEnum(38, edition_); + } + if (((bitField0_ & 0x00020000) != 0)) { + output.writeMessage(39, getReplicationLagMaxSeconds()); + } + if (((bitField0_ & 0x00040000) != 0)) { + output.writeMessage(40, getEnableGoogleMlIntegration()); + } + if (((bitField0_ & 0x00080000) != 0)) { + output.writeMessage(41, getEnableDataplexIntegration()); + } + if (((bitField0_ & 0x00100000) != 0)) { + output.writeMessage(42, getRetainBackupsOnDelete()); + } + if (((bitField0_ & 0x00200000) != 0)) { + output.writeInt64(43, dataDiskProvisionedIops_); + } + if (((bitField0_ & 0x00400000) != 0)) { + output.writeInt64(44, dataDiskProvisionedThroughput_); + } + if (((bitField0_ & 0x00800000) != 0)) { + output.writeMessage(45, getConnectionPoolConfig()); + } + if (((bitField0_ & 0x01000000) != 0)) { + output.writeMessage(47, getFinalBackupConfig()); + } + if (((bitField0_ & 0x02000000) != 0)) { + output.writeMessage(48, getReadPoolAutoScaleConfig()); + } + if (((bitField0_ & 0x04000000) != 0)) { + output.writeMessage(49, getAcceleratedReplicaMode()); + } + if (((bitField0_ & 0x08000000) != 0)) { + output.writeBool(50, autoUpgradeEnabled_); + } + if (((bitField0_ & 0x10000000) != 0)) { + output.writeMessage(52, getEntraidConfig()); + } + if (((bitField0_ & 0x20000000) != 0)) { + output.writeEnum(53, dataApiAccess_); + } + if (((bitField0_ & 0x40000000) != 0)) { + output.writeMessage(54, getPerformanceCaptureConfig()); + } + 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, getSettingsVersion()); + } + { + int dataSize = 0; + for (int i = 0; i < authorizedGaeApplications_.size(); i++) { + dataSize += computeStringSizeNoTag(authorizedGaeApplications_.getRaw(i)); + } + size += dataSize; + size += 1 * getAuthorizedGaeApplicationsList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tier_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, tier_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, kind_); + } + for (java.util.Map.Entry entry : + internalGetUserLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry userLabels__ = + UserLabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, userLabels__); + } + if (availabilityType_ + != com.google.cloud.sql.v1.SqlAvailabilityType.SQL_AVAILABILITY_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, availabilityType_); + } + if (pricingPlan_ + != com.google.cloud.sql.v1.SqlPricingPlan.SQL_PRICING_PLAN_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, pricingPlan_); + } + if (replicationType_ + != com.google.cloud.sql.v1.SqlReplicationType.SQL_REPLICATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, replicationType_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(9, getStorageAutoResizeLimit()); + } + if (activationPolicy_ + != com.google.cloud.sql.v1.Settings.SqlActivationPolicy.SQL_ACTIVATION_POLICY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, activationPolicy_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getIpConfiguration()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getStorageAutoResize()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getLocationPreference()); + } + for (int i = 0; i < databaseFlags_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, databaseFlags_.get(i)); + } + if (dataDiskType_ + != com.google.cloud.sql.v1.SqlDataDiskType.SQL_DATA_DISK_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(15, dataDiskType_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getMaintenanceWindow()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(17, getBackupConfiguration()); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 18, getDatabaseReplicationEnabled()); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 19, getCrashSafeReplicationEnabled()); + } + if (((bitField0_ & 0x00000200) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getDataDiskSizeGb()); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(22, getActiveDirectoryConfig()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(collation_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(23, collation_); + } + for (int i = 0; i < denyMaintenancePeriods_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 24, denyMaintenancePeriods_.get(i)); + } + if (((bitField0_ & 0x00000800) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, getInsightsConfig()); + } + if (((bitField0_ & 0x00001000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 27, getPasswordValidationPolicy()); + } + if (((bitField0_ & 0x00002000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(29, getSqlServerAuditConfig()); + } + if (connectorEnforcement_ + != com.google.cloud.sql.v1.Settings.ConnectorEnforcement.CONNECTOR_ENFORCEMENT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(32, connectorEnforcement_); + } + if (((bitField0_ & 0x00004000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 33, getDeletionProtectionEnabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(timeZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(34, timeZone_); + } + if (((bitField0_ & 0x00008000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 35, getAdvancedMachineFeatures()); + } + if (((bitField0_ & 0x00010000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(37, getDataCacheConfig()); + } + if (edition_ != com.google.cloud.sql.v1.Settings.Edition.EDITION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(38, edition_); + } + if (((bitField0_ & 0x00020000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 39, getReplicationLagMaxSeconds()); + } + if (((bitField0_ & 0x00040000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 40, getEnableGoogleMlIntegration()); + } + if (((bitField0_ & 0x00080000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 41, getEnableDataplexIntegration()); + } + if (((bitField0_ & 0x00100000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(42, getRetainBackupsOnDelete()); + } + if (((bitField0_ & 0x00200000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(43, dataDiskProvisionedIops_); + } + if (((bitField0_ & 0x00400000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 44, dataDiskProvisionedThroughput_); + } + if (((bitField0_ & 0x00800000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(45, getConnectionPoolConfig()); + } + if (((bitField0_ & 0x01000000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(47, getFinalBackupConfig()); + } + if (((bitField0_ & 0x02000000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 48, getReadPoolAutoScaleConfig()); + } + if (((bitField0_ & 0x04000000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(49, getAcceleratedReplicaMode()); + } + if (((bitField0_ & 0x08000000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(50, autoUpgradeEnabled_); + } + if (((bitField0_ & 0x10000000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(52, getEntraidConfig()); + } + if (((bitField0_ & 0x20000000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(53, dataApiAccess_); + } + if (((bitField0_ & 0x40000000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 54, getPerformanceCaptureConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.Settings)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.Settings other = (com.google.cloud.sql.v1.Settings) obj; + + if (hasSettingsVersion() != other.hasSettingsVersion()) return false; + if (hasSettingsVersion()) { + if (!getSettingsVersion().equals(other.getSettingsVersion())) return false; + } + if (!getAuthorizedGaeApplicationsList().equals(other.getAuthorizedGaeApplicationsList())) + return false; + if (!getTier().equals(other.getTier())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!internalGetUserLabels().equals(other.internalGetUserLabels())) return false; + if (availabilityType_ != other.availabilityType_) return false; + if (pricingPlan_ != other.pricingPlan_) return false; + if (replicationType_ != other.replicationType_) return false; + if (hasStorageAutoResizeLimit() != other.hasStorageAutoResizeLimit()) return false; + if (hasStorageAutoResizeLimit()) { + if (!getStorageAutoResizeLimit().equals(other.getStorageAutoResizeLimit())) return false; + } + if (activationPolicy_ != other.activationPolicy_) return false; + if (hasIpConfiguration() != other.hasIpConfiguration()) return false; + if (hasIpConfiguration()) { + if (!getIpConfiguration().equals(other.getIpConfiguration())) return false; + } + if (hasStorageAutoResize() != other.hasStorageAutoResize()) return false; + if (hasStorageAutoResize()) { + if (!getStorageAutoResize().equals(other.getStorageAutoResize())) return false; + } + if (hasLocationPreference() != other.hasLocationPreference()) return false; + if (hasLocationPreference()) { + if (!getLocationPreference().equals(other.getLocationPreference())) return false; + } + if (!getDatabaseFlagsList().equals(other.getDatabaseFlagsList())) return false; + if (dataDiskType_ != other.dataDiskType_) return false; + if (hasMaintenanceWindow() != other.hasMaintenanceWindow()) return false; + if (hasMaintenanceWindow()) { + if (!getMaintenanceWindow().equals(other.getMaintenanceWindow())) return false; + } + if (hasBackupConfiguration() != other.hasBackupConfiguration()) return false; + if (hasBackupConfiguration()) { + if (!getBackupConfiguration().equals(other.getBackupConfiguration())) return false; + } + if (hasDatabaseReplicationEnabled() != other.hasDatabaseReplicationEnabled()) return false; + if (hasDatabaseReplicationEnabled()) { + if (!getDatabaseReplicationEnabled().equals(other.getDatabaseReplicationEnabled())) + return false; + } + if (hasCrashSafeReplicationEnabled() != other.hasCrashSafeReplicationEnabled()) return false; + if (hasCrashSafeReplicationEnabled()) { + if (!getCrashSafeReplicationEnabled().equals(other.getCrashSafeReplicationEnabled())) + return false; + } + if (hasDataDiskSizeGb() != other.hasDataDiskSizeGb()) return false; + if (hasDataDiskSizeGb()) { + if (!getDataDiskSizeGb().equals(other.getDataDiskSizeGb())) return false; + } + if (hasActiveDirectoryConfig() != other.hasActiveDirectoryConfig()) return false; + if (hasActiveDirectoryConfig()) { + if (!getActiveDirectoryConfig().equals(other.getActiveDirectoryConfig())) return false; + } + if (!getCollation().equals(other.getCollation())) return false; + if (!getDenyMaintenancePeriodsList().equals(other.getDenyMaintenancePeriodsList())) + return false; + if (hasInsightsConfig() != other.hasInsightsConfig()) return false; + if (hasInsightsConfig()) { + if (!getInsightsConfig().equals(other.getInsightsConfig())) return false; + } + if (hasPasswordValidationPolicy() != other.hasPasswordValidationPolicy()) return false; + if (hasPasswordValidationPolicy()) { + if (!getPasswordValidationPolicy().equals(other.getPasswordValidationPolicy())) return false; + } + if (hasSqlServerAuditConfig() != other.hasSqlServerAuditConfig()) return false; + if (hasSqlServerAuditConfig()) { + if (!getSqlServerAuditConfig().equals(other.getSqlServerAuditConfig())) return false; + } + if (edition_ != other.edition_) return false; + if (connectorEnforcement_ != other.connectorEnforcement_) return false; + if (hasDeletionProtectionEnabled() != other.hasDeletionProtectionEnabled()) return false; + if (hasDeletionProtectionEnabled()) { + if (!getDeletionProtectionEnabled().equals(other.getDeletionProtectionEnabled())) + return false; + } + if (!getTimeZone().equals(other.getTimeZone())) return false; + if (hasAdvancedMachineFeatures() != other.hasAdvancedMachineFeatures()) return false; + if (hasAdvancedMachineFeatures()) { + if (!getAdvancedMachineFeatures().equals(other.getAdvancedMachineFeatures())) return false; + } + if (hasDataCacheConfig() != other.hasDataCacheConfig()) return false; + if (hasDataCacheConfig()) { + if (!getDataCacheConfig().equals(other.getDataCacheConfig())) return false; + } + if (hasReplicationLagMaxSeconds() != other.hasReplicationLagMaxSeconds()) return false; + if (hasReplicationLagMaxSeconds()) { + if (!getReplicationLagMaxSeconds().equals(other.getReplicationLagMaxSeconds())) return false; + } + if (hasEnableGoogleMlIntegration() != other.hasEnableGoogleMlIntegration()) return false; + if (hasEnableGoogleMlIntegration()) { + if (!getEnableGoogleMlIntegration().equals(other.getEnableGoogleMlIntegration())) + return false; + } + if (hasEnableDataplexIntegration() != other.hasEnableDataplexIntegration()) return false; + if (hasEnableDataplexIntegration()) { + if (!getEnableDataplexIntegration().equals(other.getEnableDataplexIntegration())) + return false; + } + if (hasRetainBackupsOnDelete() != other.hasRetainBackupsOnDelete()) return false; + if (hasRetainBackupsOnDelete()) { + if (!getRetainBackupsOnDelete().equals(other.getRetainBackupsOnDelete())) return false; + } + if (hasDataDiskProvisionedIops() != other.hasDataDiskProvisionedIops()) return false; + if (hasDataDiskProvisionedIops()) { + if (getDataDiskProvisionedIops() != other.getDataDiskProvisionedIops()) return false; + } + if (hasDataDiskProvisionedThroughput() != other.hasDataDiskProvisionedThroughput()) + return false; + if (hasDataDiskProvisionedThroughput()) { + if (getDataDiskProvisionedThroughput() != other.getDataDiskProvisionedThroughput()) + return false; + } + if (hasConnectionPoolConfig() != other.hasConnectionPoolConfig()) return false; + if (hasConnectionPoolConfig()) { + if (!getConnectionPoolConfig().equals(other.getConnectionPoolConfig())) return false; + } + if (hasFinalBackupConfig() != other.hasFinalBackupConfig()) return false; + if (hasFinalBackupConfig()) { + if (!getFinalBackupConfig().equals(other.getFinalBackupConfig())) return false; + } + if (hasReadPoolAutoScaleConfig() != other.hasReadPoolAutoScaleConfig()) return false; + if (hasReadPoolAutoScaleConfig()) { + if (!getReadPoolAutoScaleConfig().equals(other.getReadPoolAutoScaleConfig())) return false; + } + if (hasAcceleratedReplicaMode() != other.hasAcceleratedReplicaMode()) return false; + if (hasAcceleratedReplicaMode()) { + if (!getAcceleratedReplicaMode().equals(other.getAcceleratedReplicaMode())) return false; + } + if (hasAutoUpgradeEnabled() != other.hasAutoUpgradeEnabled()) return false; + if (hasAutoUpgradeEnabled()) { + if (getAutoUpgradeEnabled() != other.getAutoUpgradeEnabled()) return false; + } + if (hasEntraidConfig() != other.hasEntraidConfig()) return false; + if (hasEntraidConfig()) { + if (!getEntraidConfig().equals(other.getEntraidConfig())) return false; + } + if (hasDataApiAccess() != other.hasDataApiAccess()) return false; + if (hasDataApiAccess()) { + if (dataApiAccess_ != other.dataApiAccess_) return false; + } + if (hasPerformanceCaptureConfig() != other.hasPerformanceCaptureConfig()) return false; + if (hasPerformanceCaptureConfig()) { + if (!getPerformanceCaptureConfig().equals(other.getPerformanceCaptureConfig())) return false; + } + if (!getUnknownFields().equals(other.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 (hasSettingsVersion()) { + hash = (37 * hash) + SETTINGS_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getSettingsVersion().hashCode(); + } + if (getAuthorizedGaeApplicationsCount() > 0) { + hash = (37 * hash) + AUTHORIZED_GAE_APPLICATIONS_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedGaeApplicationsList().hashCode(); + } + hash = (37 * hash) + TIER_FIELD_NUMBER; + hash = (53 * hash) + getTier().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (!internalGetUserLabels().getMap().isEmpty()) { + hash = (37 * hash) + USER_LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetUserLabels().hashCode(); + } + hash = (37 * hash) + AVAILABILITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + availabilityType_; + hash = (37 * hash) + PRICING_PLAN_FIELD_NUMBER; + hash = (53 * hash) + pricingPlan_; + hash = (37 * hash) + REPLICATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + replicationType_; + if (hasStorageAutoResizeLimit()) { + hash = (37 * hash) + STORAGE_AUTO_RESIZE_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getStorageAutoResizeLimit().hashCode(); + } + hash = (37 * hash) + ACTIVATION_POLICY_FIELD_NUMBER; + hash = (53 * hash) + activationPolicy_; + if (hasIpConfiguration()) { + hash = (37 * hash) + IP_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getIpConfiguration().hashCode(); + } + if (hasStorageAutoResize()) { + hash = (37 * hash) + STORAGE_AUTO_RESIZE_FIELD_NUMBER; + hash = (53 * hash) + getStorageAutoResize().hashCode(); + } + if (hasLocationPreference()) { + hash = (37 * hash) + LOCATION_PREFERENCE_FIELD_NUMBER; + hash = (53 * hash) + getLocationPreference().hashCode(); + } + if (getDatabaseFlagsCount() > 0) { + hash = (37 * hash) + DATABASE_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseFlagsList().hashCode(); + } + hash = (37 * hash) + DATA_DISK_TYPE_FIELD_NUMBER; + hash = (53 * hash) + dataDiskType_; + if (hasMaintenanceWindow()) { + hash = (37 * hash) + MAINTENANCE_WINDOW_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceWindow().hashCode(); + } + if (hasBackupConfiguration()) { + hash = (37 * hash) + BACKUP_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getBackupConfiguration().hashCode(); + } + if (hasDatabaseReplicationEnabled()) { + hash = (37 * hash) + DATABASE_REPLICATION_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseReplicationEnabled().hashCode(); + } + if (hasCrashSafeReplicationEnabled()) { + hash = (37 * hash) + CRASH_SAFE_REPLICATION_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getCrashSafeReplicationEnabled().hashCode(); + } + if (hasDataDiskSizeGb()) { + hash = (37 * hash) + DATA_DISK_SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + getDataDiskSizeGb().hashCode(); + } + if (hasActiveDirectoryConfig()) { + hash = (37 * hash) + ACTIVE_DIRECTORY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getActiveDirectoryConfig().hashCode(); + } + hash = (37 * hash) + COLLATION_FIELD_NUMBER; + hash = (53 * hash) + getCollation().hashCode(); + if (getDenyMaintenancePeriodsCount() > 0) { + hash = (37 * hash) + DENY_MAINTENANCE_PERIODS_FIELD_NUMBER; + hash = (53 * hash) + getDenyMaintenancePeriodsList().hashCode(); + } + if (hasInsightsConfig()) { + hash = (37 * hash) + INSIGHTS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInsightsConfig().hashCode(); + } + if (hasPasswordValidationPolicy()) { + hash = (37 * hash) + PASSWORD_VALIDATION_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPasswordValidationPolicy().hashCode(); + } + if (hasSqlServerAuditConfig()) { + hash = (37 * hash) + SQL_SERVER_AUDIT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSqlServerAuditConfig().hashCode(); + } + hash = (37 * hash) + EDITION_FIELD_NUMBER; + hash = (53 * hash) + edition_; + hash = (37 * hash) + CONNECTOR_ENFORCEMENT_FIELD_NUMBER; + hash = (53 * hash) + connectorEnforcement_; + if (hasDeletionProtectionEnabled()) { + hash = (37 * hash) + DELETION_PROTECTION_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getDeletionProtectionEnabled().hashCode(); + } + hash = (37 * hash) + TIME_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getTimeZone().hashCode(); + if (hasAdvancedMachineFeatures()) { + hash = (37 * hash) + ADVANCED_MACHINE_FEATURES_FIELD_NUMBER; + hash = (53 * hash) + getAdvancedMachineFeatures().hashCode(); + } + if (hasDataCacheConfig()) { + hash = (37 * hash) + DATA_CACHE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getDataCacheConfig().hashCode(); + } + if (hasReplicationLagMaxSeconds()) { + hash = (37 * hash) + REPLICATION_LAG_MAX_SECONDS_FIELD_NUMBER; + hash = (53 * hash) + getReplicationLagMaxSeconds().hashCode(); + } + if (hasEnableGoogleMlIntegration()) { + hash = (37 * hash) + ENABLE_GOOGLE_ML_INTEGRATION_FIELD_NUMBER; + hash = (53 * hash) + getEnableGoogleMlIntegration().hashCode(); + } + if (hasEnableDataplexIntegration()) { + hash = (37 * hash) + ENABLE_DATAPLEX_INTEGRATION_FIELD_NUMBER; + hash = (53 * hash) + getEnableDataplexIntegration().hashCode(); + } + if (hasRetainBackupsOnDelete()) { + hash = (37 * hash) + RETAIN_BACKUPS_ON_DELETE_FIELD_NUMBER; + hash = (53 * hash) + getRetainBackupsOnDelete().hashCode(); + } + if (hasDataDiskProvisionedIops()) { + hash = (37 * hash) + DATA_DISK_PROVISIONED_IOPS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDataDiskProvisionedIops()); + } + if (hasDataDiskProvisionedThroughput()) { + hash = (37 * hash) + DATA_DISK_PROVISIONED_THROUGHPUT_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashLong(getDataDiskProvisionedThroughput()); + } + if (hasConnectionPoolConfig()) { + hash = (37 * hash) + CONNECTION_POOL_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConnectionPoolConfig().hashCode(); + } + if (hasFinalBackupConfig()) { + hash = (37 * hash) + FINAL_BACKUP_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getFinalBackupConfig().hashCode(); + } + if (hasReadPoolAutoScaleConfig()) { + hash = (37 * hash) + READ_POOL_AUTO_SCALE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getReadPoolAutoScaleConfig().hashCode(); + } + if (hasAcceleratedReplicaMode()) { + hash = (37 * hash) + ACCELERATED_REPLICA_MODE_FIELD_NUMBER; + hash = (53 * hash) + getAcceleratedReplicaMode().hashCode(); + } + if (hasAutoUpgradeEnabled()) { + hash = (37 * hash) + AUTO_UPGRADE_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAutoUpgradeEnabled()); + } + if (hasEntraidConfig()) { + hash = (37 * hash) + ENTRAID_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEntraidConfig().hashCode(); + } + if (hasDataApiAccess()) { + hash = (37 * hash) + DATA_API_ACCESS_FIELD_NUMBER; + hash = (53 * hash) + dataApiAccess_; + } + if (hasPerformanceCaptureConfig()) { + hash = (37 * hash) + PERFORMANCE_CAPTURE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPerformanceCaptureConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.Settings parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Settings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Settings parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Settings parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Settings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Settings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Settings parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Settings parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Settings parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Settings parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Settings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Settings parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.Settings prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance settings.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Settings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.Settings) + com.google.cloud.sql.v1.SettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Settings_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetMutableUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Settings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Settings.class, + com.google.cloud.sql.v1.Settings.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.Settings.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSettingsVersionFieldBuilder(); + internalGetStorageAutoResizeLimitFieldBuilder(); + internalGetIpConfigurationFieldBuilder(); + internalGetStorageAutoResizeFieldBuilder(); + internalGetLocationPreferenceFieldBuilder(); + internalGetDatabaseFlagsFieldBuilder(); + internalGetMaintenanceWindowFieldBuilder(); + internalGetBackupConfigurationFieldBuilder(); + internalGetDatabaseReplicationEnabledFieldBuilder(); + internalGetCrashSafeReplicationEnabledFieldBuilder(); + internalGetDataDiskSizeGbFieldBuilder(); + internalGetActiveDirectoryConfigFieldBuilder(); + internalGetDenyMaintenancePeriodsFieldBuilder(); + internalGetInsightsConfigFieldBuilder(); + internalGetPasswordValidationPolicyFieldBuilder(); + internalGetSqlServerAuditConfigFieldBuilder(); + internalGetDeletionProtectionEnabledFieldBuilder(); + internalGetAdvancedMachineFeaturesFieldBuilder(); + internalGetDataCacheConfigFieldBuilder(); + internalGetReplicationLagMaxSecondsFieldBuilder(); + internalGetEnableGoogleMlIntegrationFieldBuilder(); + internalGetEnableDataplexIntegrationFieldBuilder(); + internalGetRetainBackupsOnDeleteFieldBuilder(); + internalGetConnectionPoolConfigFieldBuilder(); + internalGetFinalBackupConfigFieldBuilder(); + internalGetReadPoolAutoScaleConfigFieldBuilder(); + internalGetAcceleratedReplicaModeFieldBuilder(); + internalGetEntraidConfigFieldBuilder(); + internalGetPerformanceCaptureConfigFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bitField1_ = 0; + settingsVersion_ = null; + if (settingsVersionBuilder_ != null) { + settingsVersionBuilder_.dispose(); + settingsVersionBuilder_ = null; + } + authorizedGaeApplications_ = com.google.protobuf.LazyStringArrayList.emptyList(); + tier_ = ""; + kind_ = ""; + internalGetMutableUserLabels().clear(); + availabilityType_ = 0; + pricingPlan_ = 0; + replicationType_ = 0; + storageAutoResizeLimit_ = null; + if (storageAutoResizeLimitBuilder_ != null) { + storageAutoResizeLimitBuilder_.dispose(); + storageAutoResizeLimitBuilder_ = null; + } + activationPolicy_ = 0; + ipConfiguration_ = null; + if (ipConfigurationBuilder_ != null) { + ipConfigurationBuilder_.dispose(); + ipConfigurationBuilder_ = null; + } + storageAutoResize_ = null; + if (storageAutoResizeBuilder_ != null) { + storageAutoResizeBuilder_.dispose(); + storageAutoResizeBuilder_ = null; + } + locationPreference_ = null; + if (locationPreferenceBuilder_ != null) { + locationPreferenceBuilder_.dispose(); + locationPreferenceBuilder_ = null; + } + if (databaseFlagsBuilder_ == null) { + databaseFlags_ = java.util.Collections.emptyList(); + } else { + databaseFlags_ = null; + databaseFlagsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00002000); + dataDiskType_ = 0; + maintenanceWindow_ = null; + if (maintenanceWindowBuilder_ != null) { + maintenanceWindowBuilder_.dispose(); + maintenanceWindowBuilder_ = null; + } + backupConfiguration_ = null; + if (backupConfigurationBuilder_ != null) { + backupConfigurationBuilder_.dispose(); + backupConfigurationBuilder_ = null; + } + databaseReplicationEnabled_ = null; + if (databaseReplicationEnabledBuilder_ != null) { + databaseReplicationEnabledBuilder_.dispose(); + databaseReplicationEnabledBuilder_ = null; + } + crashSafeReplicationEnabled_ = null; + if (crashSafeReplicationEnabledBuilder_ != null) { + crashSafeReplicationEnabledBuilder_.dispose(); + crashSafeReplicationEnabledBuilder_ = null; + } + dataDiskSizeGb_ = null; + if (dataDiskSizeGbBuilder_ != null) { + dataDiskSizeGbBuilder_.dispose(); + dataDiskSizeGbBuilder_ = null; + } + activeDirectoryConfig_ = null; + if (activeDirectoryConfigBuilder_ != null) { + activeDirectoryConfigBuilder_.dispose(); + activeDirectoryConfigBuilder_ = null; + } + collation_ = ""; + if (denyMaintenancePeriodsBuilder_ == null) { + denyMaintenancePeriods_ = java.util.Collections.emptyList(); + } else { + denyMaintenancePeriods_ = null; + denyMaintenancePeriodsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00400000); + insightsConfig_ = null; + if (insightsConfigBuilder_ != null) { + insightsConfigBuilder_.dispose(); + insightsConfigBuilder_ = null; + } + passwordValidationPolicy_ = null; + if (passwordValidationPolicyBuilder_ != null) { + passwordValidationPolicyBuilder_.dispose(); + passwordValidationPolicyBuilder_ = null; + } + sqlServerAuditConfig_ = null; + if (sqlServerAuditConfigBuilder_ != null) { + sqlServerAuditConfigBuilder_.dispose(); + sqlServerAuditConfigBuilder_ = null; + } + edition_ = 0; + connectorEnforcement_ = 0; + deletionProtectionEnabled_ = null; + if (deletionProtectionEnabledBuilder_ != null) { + deletionProtectionEnabledBuilder_.dispose(); + deletionProtectionEnabledBuilder_ = null; + } + timeZone_ = ""; + advancedMachineFeatures_ = null; + if (advancedMachineFeaturesBuilder_ != null) { + advancedMachineFeaturesBuilder_.dispose(); + advancedMachineFeaturesBuilder_ = null; + } + dataCacheConfig_ = null; + if (dataCacheConfigBuilder_ != null) { + dataCacheConfigBuilder_.dispose(); + dataCacheConfigBuilder_ = null; + } + replicationLagMaxSeconds_ = null; + if (replicationLagMaxSecondsBuilder_ != null) { + replicationLagMaxSecondsBuilder_.dispose(); + replicationLagMaxSecondsBuilder_ = null; + } + enableGoogleMlIntegration_ = null; + if (enableGoogleMlIntegrationBuilder_ != null) { + enableGoogleMlIntegrationBuilder_.dispose(); + enableGoogleMlIntegrationBuilder_ = null; + } + enableDataplexIntegration_ = null; + if (enableDataplexIntegrationBuilder_ != null) { + enableDataplexIntegrationBuilder_.dispose(); + enableDataplexIntegrationBuilder_ = null; + } + retainBackupsOnDelete_ = null; + if (retainBackupsOnDeleteBuilder_ != null) { + retainBackupsOnDeleteBuilder_.dispose(); + retainBackupsOnDeleteBuilder_ = null; + } + dataDiskProvisionedIops_ = 0L; + dataDiskProvisionedThroughput_ = 0L; + connectionPoolConfig_ = null; + if (connectionPoolConfigBuilder_ != null) { + connectionPoolConfigBuilder_.dispose(); + connectionPoolConfigBuilder_ = null; + } + finalBackupConfig_ = null; + if (finalBackupConfigBuilder_ != null) { + finalBackupConfigBuilder_.dispose(); + finalBackupConfigBuilder_ = null; + } + readPoolAutoScaleConfig_ = null; + if (readPoolAutoScaleConfigBuilder_ != null) { + readPoolAutoScaleConfigBuilder_.dispose(); + readPoolAutoScaleConfigBuilder_ = null; + } + acceleratedReplicaMode_ = null; + if (acceleratedReplicaModeBuilder_ != null) { + acceleratedReplicaModeBuilder_.dispose(); + acceleratedReplicaModeBuilder_ = null; + } + autoUpgradeEnabled_ = false; + entraidConfig_ = null; + if (entraidConfigBuilder_ != null) { + entraidConfigBuilder_.dispose(); + entraidConfigBuilder_ = null; + } + dataApiAccess_ = 0; + performanceCaptureConfig_ = null; + if (performanceCaptureConfigBuilder_ != null) { + performanceCaptureConfigBuilder_.dispose(); + performanceCaptureConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_Settings_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Settings getDefaultInstanceForType() { + return com.google.cloud.sql.v1.Settings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.Settings build() { + com.google.cloud.sql.v1.Settings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Settings buildPartial() { + com.google.cloud.sql.v1.Settings result = new com.google.cloud.sql.v1.Settings(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + if (bitField1_ != 0) { + buildPartial1(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.Settings result) { + if (databaseFlagsBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0)) { + databaseFlags_ = java.util.Collections.unmodifiableList(databaseFlags_); + bitField0_ = (bitField0_ & ~0x00002000); + } + result.databaseFlags_ = databaseFlags_; + } else { + result.databaseFlags_ = databaseFlagsBuilder_.build(); + } + if (denyMaintenancePeriodsBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0)) { + denyMaintenancePeriods_ = java.util.Collections.unmodifiableList(denyMaintenancePeriods_); + bitField0_ = (bitField0_ & ~0x00400000); + } + result.denyMaintenancePeriods_ = denyMaintenancePeriods_; + } else { + result.denyMaintenancePeriods_ = denyMaintenancePeriodsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.Settings result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.settingsVersion_ = + settingsVersionBuilder_ == null ? settingsVersion_ : settingsVersionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + authorizedGaeApplications_.makeImmutable(); + result.authorizedGaeApplications_ = authorizedGaeApplications_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.tier_ = tier_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.userLabels_ = internalGetUserLabels(); + result.userLabels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.availabilityType_ = availabilityType_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pricingPlan_ = pricingPlan_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.replicationType_ = replicationType_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.storageAutoResizeLimit_ = + storageAutoResizeLimitBuilder_ == null + ? storageAutoResizeLimit_ + : storageAutoResizeLimitBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.activationPolicy_ = activationPolicy_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.ipConfiguration_ = + ipConfigurationBuilder_ == null ? ipConfiguration_ : ipConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.storageAutoResize_ = + storageAutoResizeBuilder_ == null + ? storageAutoResize_ + : storageAutoResizeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.locationPreference_ = + locationPreferenceBuilder_ == null + ? locationPreference_ + : locationPreferenceBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.dataDiskType_ = dataDiskType_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.maintenanceWindow_ = + maintenanceWindowBuilder_ == null + ? maintenanceWindow_ + : maintenanceWindowBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.backupConfiguration_ = + backupConfigurationBuilder_ == null + ? backupConfiguration_ + : backupConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.databaseReplicationEnabled_ = + databaseReplicationEnabledBuilder_ == null + ? databaseReplicationEnabled_ + : databaseReplicationEnabledBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.crashSafeReplicationEnabled_ = + crashSafeReplicationEnabledBuilder_ == null + ? crashSafeReplicationEnabled_ + : crashSafeReplicationEnabledBuilder_.build(); + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.dataDiskSizeGb_ = + dataDiskSizeGbBuilder_ == null ? dataDiskSizeGb_ : dataDiskSizeGbBuilder_.build(); + to_bitField0_ |= 0x00000200; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.activeDirectoryConfig_ = + activeDirectoryConfigBuilder_ == null + ? activeDirectoryConfig_ + : activeDirectoryConfigBuilder_.build(); + to_bitField0_ |= 0x00000400; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.collation_ = collation_; + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.insightsConfig_ = + insightsConfigBuilder_ == null ? insightsConfig_ : insightsConfigBuilder_.build(); + to_bitField0_ |= 0x00000800; + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.passwordValidationPolicy_ = + passwordValidationPolicyBuilder_ == null + ? passwordValidationPolicy_ + : passwordValidationPolicyBuilder_.build(); + to_bitField0_ |= 0x00001000; + } + if (((from_bitField0_ & 0x02000000) != 0)) { + result.sqlServerAuditConfig_ = + sqlServerAuditConfigBuilder_ == null + ? sqlServerAuditConfig_ + : sqlServerAuditConfigBuilder_.build(); + to_bitField0_ |= 0x00002000; + } + if (((from_bitField0_ & 0x04000000) != 0)) { + result.edition_ = edition_; + } + if (((from_bitField0_ & 0x08000000) != 0)) { + result.connectorEnforcement_ = connectorEnforcement_; + } + if (((from_bitField0_ & 0x10000000) != 0)) { + result.deletionProtectionEnabled_ = + deletionProtectionEnabledBuilder_ == null + ? deletionProtectionEnabled_ + : deletionProtectionEnabledBuilder_.build(); + to_bitField0_ |= 0x00004000; + } + if (((from_bitField0_ & 0x20000000) != 0)) { + result.timeZone_ = timeZone_; + } + if (((from_bitField0_ & 0x40000000) != 0)) { + result.advancedMachineFeatures_ = + advancedMachineFeaturesBuilder_ == null + ? advancedMachineFeatures_ + : advancedMachineFeaturesBuilder_.build(); + to_bitField0_ |= 0x00008000; + } + if (((from_bitField0_ & 0x80000000) != 0)) { + result.dataCacheConfig_ = + dataCacheConfigBuilder_ == null ? dataCacheConfig_ : dataCacheConfigBuilder_.build(); + to_bitField0_ |= 0x00010000; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartial1(com.google.cloud.sql.v1.Settings result) { + int from_bitField1_ = bitField1_; + int to_bitField0_ = 0; + if (((from_bitField1_ & 0x00000001) != 0)) { + result.replicationLagMaxSeconds_ = + replicationLagMaxSecondsBuilder_ == null + ? replicationLagMaxSeconds_ + : replicationLagMaxSecondsBuilder_.build(); + to_bitField0_ |= 0x00020000; + } + if (((from_bitField1_ & 0x00000002) != 0)) { + result.enableGoogleMlIntegration_ = + enableGoogleMlIntegrationBuilder_ == null + ? enableGoogleMlIntegration_ + : enableGoogleMlIntegrationBuilder_.build(); + to_bitField0_ |= 0x00040000; + } + if (((from_bitField1_ & 0x00000004) != 0)) { + result.enableDataplexIntegration_ = + enableDataplexIntegrationBuilder_ == null + ? enableDataplexIntegration_ + : enableDataplexIntegrationBuilder_.build(); + to_bitField0_ |= 0x00080000; + } + if (((from_bitField1_ & 0x00000008) != 0)) { + result.retainBackupsOnDelete_ = + retainBackupsOnDeleteBuilder_ == null + ? retainBackupsOnDelete_ + : retainBackupsOnDeleteBuilder_.build(); + to_bitField0_ |= 0x00100000; + } + if (((from_bitField1_ & 0x00000010) != 0)) { + result.dataDiskProvisionedIops_ = dataDiskProvisionedIops_; + to_bitField0_ |= 0x00200000; + } + if (((from_bitField1_ & 0x00000020) != 0)) { + result.dataDiskProvisionedThroughput_ = dataDiskProvisionedThroughput_; + to_bitField0_ |= 0x00400000; + } + if (((from_bitField1_ & 0x00000040) != 0)) { + result.connectionPoolConfig_ = + connectionPoolConfigBuilder_ == null + ? connectionPoolConfig_ + : connectionPoolConfigBuilder_.build(); + to_bitField0_ |= 0x00800000; + } + if (((from_bitField1_ & 0x00000080) != 0)) { + result.finalBackupConfig_ = + finalBackupConfigBuilder_ == null + ? finalBackupConfig_ + : finalBackupConfigBuilder_.build(); + to_bitField0_ |= 0x01000000; + } + if (((from_bitField1_ & 0x00000100) != 0)) { + result.readPoolAutoScaleConfig_ = + readPoolAutoScaleConfigBuilder_ == null + ? readPoolAutoScaleConfig_ + : readPoolAutoScaleConfigBuilder_.build(); + to_bitField0_ |= 0x02000000; + } + if (((from_bitField1_ & 0x00000200) != 0)) { + result.acceleratedReplicaMode_ = + acceleratedReplicaModeBuilder_ == null + ? acceleratedReplicaMode_ + : acceleratedReplicaModeBuilder_.build(); + to_bitField0_ |= 0x04000000; + } + if (((from_bitField1_ & 0x00000400) != 0)) { + result.autoUpgradeEnabled_ = autoUpgradeEnabled_; + to_bitField0_ |= 0x08000000; + } + if (((from_bitField1_ & 0x00000800) != 0)) { + result.entraidConfig_ = + entraidConfigBuilder_ == null ? entraidConfig_ : entraidConfigBuilder_.build(); + to_bitField0_ |= 0x10000000; + } + if (((from_bitField1_ & 0x00001000) != 0)) { + result.dataApiAccess_ = dataApiAccess_; + to_bitField0_ |= 0x20000000; + } + if (((from_bitField1_ & 0x00002000) != 0)) { + result.performanceCaptureConfig_ = + performanceCaptureConfigBuilder_ == null + ? performanceCaptureConfig_ + : performanceCaptureConfigBuilder_.build(); + to_bitField0_ |= 0x40000000; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.Settings) { + return mergeFrom((com.google.cloud.sql.v1.Settings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.Settings other) { + if (other == com.google.cloud.sql.v1.Settings.getDefaultInstance()) return this; + if (other.hasSettingsVersion()) { + mergeSettingsVersion(other.getSettingsVersion()); + } + if (!other.authorizedGaeApplications_.isEmpty()) { + if (authorizedGaeApplications_.isEmpty()) { + authorizedGaeApplications_ = other.authorizedGaeApplications_; + bitField0_ |= 0x00000002; + } else { + ensureAuthorizedGaeApplicationsIsMutable(); + authorizedGaeApplications_.addAll(other.authorizedGaeApplications_); + } + onChanged(); + } + if (!other.getTier().isEmpty()) { + tier_ = other.tier_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000008; + onChanged(); + } + internalGetMutableUserLabels().mergeFrom(other.internalGetUserLabels()); + bitField0_ |= 0x00000010; + if (other.availabilityType_ != 0) { + setAvailabilityTypeValue(other.getAvailabilityTypeValue()); + } + if (other.pricingPlan_ != 0) { + setPricingPlanValue(other.getPricingPlanValue()); + } + if (other.replicationType_ != 0) { + setReplicationTypeValue(other.getReplicationTypeValue()); + } + if (other.hasStorageAutoResizeLimit()) { + mergeStorageAutoResizeLimit(other.getStorageAutoResizeLimit()); + } + if (other.activationPolicy_ != 0) { + setActivationPolicyValue(other.getActivationPolicyValue()); + } + if (other.hasIpConfiguration()) { + mergeIpConfiguration(other.getIpConfiguration()); + } + if (other.hasStorageAutoResize()) { + mergeStorageAutoResize(other.getStorageAutoResize()); + } + if (other.hasLocationPreference()) { + mergeLocationPreference(other.getLocationPreference()); + } + if (databaseFlagsBuilder_ == null) { + if (!other.databaseFlags_.isEmpty()) { + if (databaseFlags_.isEmpty()) { + databaseFlags_ = other.databaseFlags_; + bitField0_ = (bitField0_ & ~0x00002000); + } else { + ensureDatabaseFlagsIsMutable(); + databaseFlags_.addAll(other.databaseFlags_); + } + onChanged(); + } + } else { + if (!other.databaseFlags_.isEmpty()) { + if (databaseFlagsBuilder_.isEmpty()) { + databaseFlagsBuilder_.dispose(); + databaseFlagsBuilder_ = null; + databaseFlags_ = other.databaseFlags_; + bitField0_ = (bitField0_ & ~0x00002000); + databaseFlagsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDatabaseFlagsFieldBuilder() + : null; + } else { + databaseFlagsBuilder_.addAllMessages(other.databaseFlags_); + } + } + } + if (other.dataDiskType_ != 0) { + setDataDiskTypeValue(other.getDataDiskTypeValue()); + } + if (other.hasMaintenanceWindow()) { + mergeMaintenanceWindow(other.getMaintenanceWindow()); + } + if (other.hasBackupConfiguration()) { + mergeBackupConfiguration(other.getBackupConfiguration()); + } + if (other.hasDatabaseReplicationEnabled()) { + mergeDatabaseReplicationEnabled(other.getDatabaseReplicationEnabled()); + } + if (other.hasCrashSafeReplicationEnabled()) { + mergeCrashSafeReplicationEnabled(other.getCrashSafeReplicationEnabled()); + } + if (other.hasDataDiskSizeGb()) { + mergeDataDiskSizeGb(other.getDataDiskSizeGb()); + } + if (other.hasActiveDirectoryConfig()) { + mergeActiveDirectoryConfig(other.getActiveDirectoryConfig()); + } + if (!other.getCollation().isEmpty()) { + collation_ = other.collation_; + bitField0_ |= 0x00200000; + onChanged(); + } + if (denyMaintenancePeriodsBuilder_ == null) { + if (!other.denyMaintenancePeriods_.isEmpty()) { + if (denyMaintenancePeriods_.isEmpty()) { + denyMaintenancePeriods_ = other.denyMaintenancePeriods_; + bitField0_ = (bitField0_ & ~0x00400000); + } else { + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.addAll(other.denyMaintenancePeriods_); + } + onChanged(); + } + } else { + if (!other.denyMaintenancePeriods_.isEmpty()) { + if (denyMaintenancePeriodsBuilder_.isEmpty()) { + denyMaintenancePeriodsBuilder_.dispose(); + denyMaintenancePeriodsBuilder_ = null; + denyMaintenancePeriods_ = other.denyMaintenancePeriods_; + bitField0_ = (bitField0_ & ~0x00400000); + denyMaintenancePeriodsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDenyMaintenancePeriodsFieldBuilder() + : null; + } else { + denyMaintenancePeriodsBuilder_.addAllMessages(other.denyMaintenancePeriods_); + } + } + } + if (other.hasInsightsConfig()) { + mergeInsightsConfig(other.getInsightsConfig()); + } + if (other.hasPasswordValidationPolicy()) { + mergePasswordValidationPolicy(other.getPasswordValidationPolicy()); + } + if (other.hasSqlServerAuditConfig()) { + mergeSqlServerAuditConfig(other.getSqlServerAuditConfig()); + } + if (other.edition_ != 0) { + setEditionValue(other.getEditionValue()); + } + if (other.connectorEnforcement_ != 0) { + setConnectorEnforcementValue(other.getConnectorEnforcementValue()); + } + if (other.hasDeletionProtectionEnabled()) { + mergeDeletionProtectionEnabled(other.getDeletionProtectionEnabled()); + } + if (!other.getTimeZone().isEmpty()) { + timeZone_ = other.timeZone_; + bitField0_ |= 0x20000000; + onChanged(); + } + if (other.hasAdvancedMachineFeatures()) { + mergeAdvancedMachineFeatures(other.getAdvancedMachineFeatures()); + } + if (other.hasDataCacheConfig()) { + mergeDataCacheConfig(other.getDataCacheConfig()); + } + if (other.hasReplicationLagMaxSeconds()) { + mergeReplicationLagMaxSeconds(other.getReplicationLagMaxSeconds()); + } + if (other.hasEnableGoogleMlIntegration()) { + mergeEnableGoogleMlIntegration(other.getEnableGoogleMlIntegration()); + } + if (other.hasEnableDataplexIntegration()) { + mergeEnableDataplexIntegration(other.getEnableDataplexIntegration()); + } + if (other.hasRetainBackupsOnDelete()) { + mergeRetainBackupsOnDelete(other.getRetainBackupsOnDelete()); + } + if (other.hasDataDiskProvisionedIops()) { + setDataDiskProvisionedIops(other.getDataDiskProvisionedIops()); + } + if (other.hasDataDiskProvisionedThroughput()) { + setDataDiskProvisionedThroughput(other.getDataDiskProvisionedThroughput()); + } + if (other.hasConnectionPoolConfig()) { + mergeConnectionPoolConfig(other.getConnectionPoolConfig()); + } + if (other.hasFinalBackupConfig()) { + mergeFinalBackupConfig(other.getFinalBackupConfig()); + } + if (other.hasReadPoolAutoScaleConfig()) { + mergeReadPoolAutoScaleConfig(other.getReadPoolAutoScaleConfig()); + } + if (other.hasAcceleratedReplicaMode()) { + mergeAcceleratedReplicaMode(other.getAcceleratedReplicaMode()); + } + if (other.hasAutoUpgradeEnabled()) { + setAutoUpgradeEnabled(other.getAutoUpgradeEnabled()); + } + if (other.hasEntraidConfig()) { + mergeEntraidConfig(other.getEntraidConfig()); + } + if (other.hasDataApiAccess()) { + setDataApiAccessValue(other.getDataApiAccessValue()); + } + if (other.hasPerformanceCaptureConfig()) { + mergePerformanceCaptureConfig(other.getPerformanceCaptureConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetSettingsVersionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAuthorizedGaeApplicationsIsMutable(); + authorizedGaeApplications_.add(s); + break; + } // case 18 + case 26: + { + tier_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + com.google.protobuf.MapEntry userLabels__ = + input.readMessage( + UserLabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableUserLabels() + .getMutableMap() + .put(userLabels__.getKey(), userLabels__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + availabilityType_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: + { + pricingPlan_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: + { + replicationType_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 74: + { + input.readMessage( + internalGetStorageAutoResizeLimitFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 80: + { + activationPolicy_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 90: + { + input.readMessage( + internalGetIpConfigurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + input.readMessage( + internalGetStorageAutoResizeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 106: + { + input.readMessage( + internalGetLocationPreferenceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 114: + { + com.google.cloud.sql.v1.DatabaseFlags m = + input.readMessage( + com.google.cloud.sql.v1.DatabaseFlags.parser(), extensionRegistry); + if (databaseFlagsBuilder_ == null) { + ensureDatabaseFlagsIsMutable(); + databaseFlags_.add(m); + } else { + databaseFlagsBuilder_.addMessage(m); + } + break; + } // case 114 + case 120: + { + dataDiskType_ = input.readEnum(); + bitField0_ |= 0x00004000; + break; + } // case 120 + case 130: + { + input.readMessage( + internalGetMaintenanceWindowFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00008000; + break; + } // case 130 + case 138: + { + input.readMessage( + internalGetBackupConfigurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 138 + case 146: + { + input.readMessage( + internalGetDatabaseReplicationEnabledFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 146 + case 154: + { + input.readMessage( + internalGetCrashSafeReplicationEnabledFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 154 + case 162: + { + input.readMessage( + internalGetDataDiskSizeGbFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 162 + case 178: + { + input.readMessage( + internalGetActiveDirectoryConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00100000; + break; + } // case 178 + case 186: + { + collation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00200000; + break; + } // case 186 + case 194: + { + com.google.cloud.sql.v1.DenyMaintenancePeriod m = + input.readMessage( + com.google.cloud.sql.v1.DenyMaintenancePeriod.parser(), extensionRegistry); + if (denyMaintenancePeriodsBuilder_ == null) { + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.add(m); + } else { + denyMaintenancePeriodsBuilder_.addMessage(m); + } + break; + } // case 194 + case 202: + { + input.readMessage( + internalGetInsightsConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00800000; + break; + } // case 202 + case 218: + { + input.readMessage( + internalGetPasswordValidationPolicyFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x01000000; + break; + } // case 218 + case 234: + { + input.readMessage( + internalGetSqlServerAuditConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x02000000; + break; + } // case 234 + case 256: + { + connectorEnforcement_ = input.readEnum(); + bitField0_ |= 0x08000000; + break; + } // case 256 + case 266: + { + input.readMessage( + internalGetDeletionProtectionEnabledFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x10000000; + break; + } // case 266 + case 274: + { + timeZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x20000000; + break; + } // case 274 + case 282: + { + input.readMessage( + internalGetAdvancedMachineFeaturesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x40000000; + break; + } // case 282 + case 298: + { + input.readMessage( + internalGetDataCacheConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x80000000; + break; + } // case 298 + case 304: + { + edition_ = input.readEnum(); + bitField0_ |= 0x04000000; + break; + } // case 304 + case 314: + { + input.readMessage( + internalGetReplicationLagMaxSecondsFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000001; + break; + } // case 314 + case 322: + { + input.readMessage( + internalGetEnableGoogleMlIntegrationFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000002; + break; + } // case 322 + case 330: + { + input.readMessage( + internalGetEnableDataplexIntegrationFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000004; + break; + } // case 330 + case 338: + { + input.readMessage( + internalGetRetainBackupsOnDeleteFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000008; + break; + } // case 338 + case 344: + { + dataDiskProvisionedIops_ = input.readInt64(); + bitField1_ |= 0x00000010; + break; + } // case 344 + case 352: + { + dataDiskProvisionedThroughput_ = input.readInt64(); + bitField1_ |= 0x00000020; + break; + } // case 352 + case 362: + { + input.readMessage( + internalGetConnectionPoolConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000040; + break; + } // case 362 + case 378: + { + input.readMessage( + internalGetFinalBackupConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000080; + break; + } // case 378 + case 386: + { + input.readMessage( + internalGetReadPoolAutoScaleConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000100; + break; + } // case 386 + case 394: + { + input.readMessage( + internalGetAcceleratedReplicaModeFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000200; + break; + } // case 394 + case 400: + { + autoUpgradeEnabled_ = input.readBool(); + bitField1_ |= 0x00000400; + break; + } // case 400 + case 418: + { + input.readMessage( + internalGetEntraidConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000800; + break; + } // case 418 + case 424: + { + dataApiAccess_ = input.readEnum(); + bitField1_ |= 0x00001000; + break; + } // case 424 + case 434: + { + input.readMessage( + internalGetPerformanceCaptureConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00002000; + break; + } // case 434 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 bitField1_; + + private com.google.protobuf.Int64Value settingsVersion_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + settingsVersionBuilder_; + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + * + * @return Whether the settingsVersion field is set. + */ + public boolean hasSettingsVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + * + * @return The settingsVersion. + */ + public com.google.protobuf.Int64Value getSettingsVersion() { + if (settingsVersionBuilder_ == null) { + return settingsVersion_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : settingsVersion_; + } else { + return settingsVersionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + public Builder setSettingsVersion(com.google.protobuf.Int64Value value) { + if (settingsVersionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + settingsVersion_ = value; + } else { + settingsVersionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + public Builder setSettingsVersion(com.google.protobuf.Int64Value.Builder builderForValue) { + if (settingsVersionBuilder_ == null) { + settingsVersion_ = builderForValue.build(); + } else { + settingsVersionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + public Builder mergeSettingsVersion(com.google.protobuf.Int64Value value) { + if (settingsVersionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && settingsVersion_ != null + && settingsVersion_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getSettingsVersionBuilder().mergeFrom(value); + } else { + settingsVersion_ = value; + } + } else { + settingsVersionBuilder_.mergeFrom(value); + } + if (settingsVersion_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + public Builder clearSettingsVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + settingsVersion_ = null; + if (settingsVersionBuilder_ != null) { + settingsVersionBuilder_.dispose(); + settingsVersionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + public com.google.protobuf.Int64Value.Builder getSettingsVersionBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetSettingsVersionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + public com.google.protobuf.Int64ValueOrBuilder getSettingsVersionOrBuilder() { + if (settingsVersionBuilder_ != null) { + return settingsVersionBuilder_.getMessageOrBuilder(); + } else { + return settingsVersion_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : settingsVersion_; + } + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetSettingsVersionFieldBuilder() { + if (settingsVersionBuilder_ == null) { + settingsVersionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getSettingsVersion(), getParentForChildren(), isClean()); + settingsVersion_ = null; + } + return settingsVersionBuilder_; + } + + private com.google.protobuf.LazyStringArrayList authorizedGaeApplications_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAuthorizedGaeApplicationsIsMutable() { + if (!authorizedGaeApplications_.isModifiable()) { + authorizedGaeApplications_ = + new com.google.protobuf.LazyStringArrayList(authorizedGaeApplications_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @return A list containing the authorizedGaeApplications. + */ + @java.lang.Deprecated + public com.google.protobuf.ProtocolStringList getAuthorizedGaeApplicationsList() { + authorizedGaeApplications_.makeImmutable(); + return authorizedGaeApplications_; + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @return The count of authorizedGaeApplications. + */ + @java.lang.Deprecated + public int getAuthorizedGaeApplicationsCount() { + return authorizedGaeApplications_.size(); + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @param index The index of the element to return. + * @return The authorizedGaeApplications at the given index. + */ + @java.lang.Deprecated + public java.lang.String getAuthorizedGaeApplications(int index) { + return authorizedGaeApplications_.get(index); + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @param index The index of the value to return. + * @return The bytes of the authorizedGaeApplications at the given index. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getAuthorizedGaeApplicationsBytes(int index) { + return authorizedGaeApplications_.getByteString(index); + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @param index The index to set the value at. + * @param value The authorizedGaeApplications to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setAuthorizedGaeApplications(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizedGaeApplicationsIsMutable(); + authorizedGaeApplications_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @param value The authorizedGaeApplications to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addAuthorizedGaeApplications(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizedGaeApplicationsIsMutable(); + authorizedGaeApplications_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @param values The authorizedGaeApplications to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addAllAuthorizedGaeApplications(java.lang.Iterable values) { + ensureAuthorizedGaeApplicationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, authorizedGaeApplications_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearAuthorizedGaeApplications() { + authorizedGaeApplications_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @param value The bytes of the authorizedGaeApplications to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addAuthorizedGaeApplicationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAuthorizedGaeApplicationsIsMutable(); + authorizedGaeApplications_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object tier_ = ""; + + /** + * + * + *
+     * The tier (or machine type) for this instance, for example
+     * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+     * 
+ * + * string tier = 3; + * + * @return The tier. + */ + public java.lang.String getTier() { + java.lang.Object ref = tier_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tier_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The tier (or machine type) for this instance, for example
+     * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+     * 
+ * + * string tier = 3; + * + * @return The bytes for tier. + */ + public com.google.protobuf.ByteString getTierBytes() { + java.lang.Object ref = tier_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The tier (or machine type) for this instance, for example
+     * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+     * 
+ * + * string tier = 3; + * + * @param value The tier to set. + * @return This builder for chaining. + */ + public Builder setTier(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tier_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The tier (or machine type) for this instance, for example
+     * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+     * 
+ * + * string tier = 3; + * + * @return This builder for chaining. + */ + public Builder clearTier() { + tier_ = getDefaultInstance().getTier(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The tier (or machine type) for this instance, for example
+     * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+     * 
+ * + * string tier = 3; + * + * @param value The bytes for tier to set. + * @return This builder for chaining. + */ + public Builder setTierBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tier_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#settings`.
+     * 
+ * + * string kind = 4; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#settings`.
+     * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#settings`.
+     * 
+ * + * string kind = 4; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#settings`.
+     * 
+ * + * string kind = 4; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#settings`.
+     * 
+ * + * string kind = 4; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.MapField userLabels_; + + private com.google.protobuf.MapField + internalGetUserLabels() { + if (userLabels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + UserLabelsDefaultEntryHolder.defaultEntry); + } + return userLabels_; + } + + private com.google.protobuf.MapField + internalGetMutableUserLabels() { + if (userLabels_ == null) { + userLabels_ = + com.google.protobuf.MapField.newMapField(UserLabelsDefaultEntryHolder.defaultEntry); + } + if (!userLabels_.isMutable()) { + userLabels_ = userLabels_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return userLabels_; + } + + public int getUserLabelsCount() { + return internalGetUserLabels().getMap().size(); + } + + /** + * + * + *
+     * User-provided labels, represented as a dictionary where each label is a
+     * single key value pair.
+     * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); + } + + /** + * + * + *
+     * User-provided labels, represented as a dictionary where each label is a
+     * single key value pair.
+     * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); + } + + /** + * + * + *
+     * User-provided labels, represented as a dictionary where each label is a
+     * single key value pair.
+     * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * User-provided labels, represented as a dictionary where each label is a
+     * single key value pair.
+     * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearUserLabels() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableUserLabels().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * User-provided labels, represented as a dictionary where each label is a
+     * single key value pair.
+     * 
+ * + * map<string, string> user_labels = 5; + */ + public Builder removeUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableUserLabels().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableUserLabels() { + bitField0_ |= 0x00000010; + return internalGetMutableUserLabels().getMutableMap(); + } + + /** + * + * + *
+     * User-provided labels, represented as a dictionary where each label is a
+     * single key value pair.
+     * 
+ * + * map<string, string> user_labels = 5; + */ + public Builder putUserLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableUserLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + + /** + * + * + *
+     * User-provided labels, represented as a dictionary where each label is a
+     * single key value pair.
+     * 
+ * + * map<string, string> user_labels = 5; + */ + public Builder putAllUserLabels(java.util.Map values) { + internalGetMutableUserLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private int availabilityType_ = 0; + + /** + * + * + *
+     * Availability type. Potential values:
+     * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+     * zone affect data accessibility.
+     * *  `REGIONAL`: The instance can serve data from more than one zone in a
+     * region (it is highly available)./
+     *
+     * For more information, see [Overview of the High Availability
+     * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+     * 
+ * + * .google.cloud.sql.v1.SqlAvailabilityType availability_type = 6; + * + * @return The enum numeric value on the wire for availabilityType. + */ + @java.lang.Override + public int getAvailabilityTypeValue() { + return availabilityType_; + } + + /** + * + * + *
+     * Availability type. Potential values:
+     * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+     * zone affect data accessibility.
+     * *  `REGIONAL`: The instance can serve data from more than one zone in a
+     * region (it is highly available)./
+     *
+     * For more information, see [Overview of the High Availability
+     * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+     * 
+ * + * .google.cloud.sql.v1.SqlAvailabilityType availability_type = 6; + * + * @param value The enum numeric value on the wire for availabilityType to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityTypeValue(int value) { + availabilityType_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Availability type. Potential values:
+     * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+     * zone affect data accessibility.
+     * *  `REGIONAL`: The instance can serve data from more than one zone in a
+     * region (it is highly available)./
+     *
+     * For more information, see [Overview of the High Availability
+     * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+     * 
+ * + * .google.cloud.sql.v1.SqlAvailabilityType availability_type = 6; + * + * @return The availabilityType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlAvailabilityType getAvailabilityType() { + com.google.cloud.sql.v1.SqlAvailabilityType result = + com.google.cloud.sql.v1.SqlAvailabilityType.forNumber(availabilityType_); + return result == null ? com.google.cloud.sql.v1.SqlAvailabilityType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Availability type. Potential values:
+     * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+     * zone affect data accessibility.
+     * *  `REGIONAL`: The instance can serve data from more than one zone in a
+     * region (it is highly available)./
+     *
+     * For more information, see [Overview of the High Availability
+     * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+     * 
+ * + * .google.cloud.sql.v1.SqlAvailabilityType availability_type = 6; + * + * @param value The availabilityType to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityType(com.google.cloud.sql.v1.SqlAvailabilityType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + availabilityType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Availability type. Potential values:
+     * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+     * zone affect data accessibility.
+     * *  `REGIONAL`: The instance can serve data from more than one zone in a
+     * region (it is highly available)./
+     *
+     * For more information, see [Overview of the High Availability
+     * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+     * 
+ * + * .google.cloud.sql.v1.SqlAvailabilityType availability_type = 6; + * + * @return This builder for chaining. + */ + public Builder clearAvailabilityType() { + bitField0_ = (bitField0_ & ~0x00000020); + availabilityType_ = 0; + onChanged(); + return this; + } + + private int pricingPlan_ = 0; + + /** + * + * + *
+     * The pricing plan for this instance. This can be either `PER_USE` or
+     * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlPricingPlan pricing_plan = 7; + * + * @return The enum numeric value on the wire for pricingPlan. + */ + @java.lang.Override + public int getPricingPlanValue() { + return pricingPlan_; + } + + /** + * + * + *
+     * The pricing plan for this instance. This can be either `PER_USE` or
+     * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlPricingPlan pricing_plan = 7; + * + * @param value The enum numeric value on the wire for pricingPlan to set. + * @return This builder for chaining. + */ + public Builder setPricingPlanValue(int value) { + pricingPlan_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The pricing plan for this instance. This can be either `PER_USE` or
+     * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlPricingPlan pricing_plan = 7; + * + * @return The pricingPlan. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlPricingPlan getPricingPlan() { + com.google.cloud.sql.v1.SqlPricingPlan result = + com.google.cloud.sql.v1.SqlPricingPlan.forNumber(pricingPlan_); + return result == null ? com.google.cloud.sql.v1.SqlPricingPlan.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The pricing plan for this instance. This can be either `PER_USE` or
+     * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlPricingPlan pricing_plan = 7; + * + * @param value The pricingPlan to set. + * @return This builder for chaining. + */ + public Builder setPricingPlan(com.google.cloud.sql.v1.SqlPricingPlan value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + pricingPlan_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The pricing plan for this instance. This can be either `PER_USE` or
+     * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlPricingPlan pricing_plan = 7; + * + * @return This builder for chaining. + */ + public Builder clearPricingPlan() { + bitField0_ = (bitField0_ & ~0x00000040); + pricingPlan_ = 0; + onChanged(); + return this; + } + + private int replicationType_ = 0; + + /** + * + * + *
+     * The type of replication this instance uses. This can be either
+     * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+     * applicable to First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.Settings.replication_type is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1692 + * @return The enum numeric value on the wire for replicationType. + */ + @java.lang.Override + @java.lang.Deprecated + public int getReplicationTypeValue() { + return replicationType_; + } + + /** + * + * + *
+     * The type of replication this instance uses. This can be either
+     * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+     * applicable to First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.Settings.replication_type is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1692 + * @param value The enum numeric value on the wire for replicationType to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setReplicationTypeValue(int value) { + replicationType_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of replication this instance uses. This can be either
+     * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+     * applicable to First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.Settings.replication_type is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1692 + * @return The replicationType. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.sql.v1.SqlReplicationType getReplicationType() { + com.google.cloud.sql.v1.SqlReplicationType result = + com.google.cloud.sql.v1.SqlReplicationType.forNumber(replicationType_); + return result == null ? com.google.cloud.sql.v1.SqlReplicationType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The type of replication this instance uses. This can be either
+     * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+     * applicable to First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.Settings.replication_type is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1692 + * @param value The replicationType to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setReplicationType(com.google.cloud.sql.v1.SqlReplicationType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + replicationType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of replication this instance uses. This can be either
+     * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+     * applicable to First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.Settings.replication_type is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1692 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearReplicationType() { + bitField0_ = (bitField0_ & ~0x00000080); + replicationType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Int64Value storageAutoResizeLimit_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + storageAutoResizeLimitBuilder_; + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + * + * @return Whether the storageAutoResizeLimit field is set. + */ + public boolean hasStorageAutoResizeLimit() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + * + * @return The storageAutoResizeLimit. + */ + public com.google.protobuf.Int64Value getStorageAutoResizeLimit() { + if (storageAutoResizeLimitBuilder_ == null) { + return storageAutoResizeLimit_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : storageAutoResizeLimit_; + } else { + return storageAutoResizeLimitBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + public Builder setStorageAutoResizeLimit(com.google.protobuf.Int64Value value) { + if (storageAutoResizeLimitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + storageAutoResizeLimit_ = value; + } else { + storageAutoResizeLimitBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + public Builder setStorageAutoResizeLimit( + com.google.protobuf.Int64Value.Builder builderForValue) { + if (storageAutoResizeLimitBuilder_ == null) { + storageAutoResizeLimit_ = builderForValue.build(); + } else { + storageAutoResizeLimitBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + public Builder mergeStorageAutoResizeLimit(com.google.protobuf.Int64Value value) { + if (storageAutoResizeLimitBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && storageAutoResizeLimit_ != null + && storageAutoResizeLimit_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getStorageAutoResizeLimitBuilder().mergeFrom(value); + } else { + storageAutoResizeLimit_ = value; + } + } else { + storageAutoResizeLimitBuilder_.mergeFrom(value); + } + if (storageAutoResizeLimit_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + public Builder clearStorageAutoResizeLimit() { + bitField0_ = (bitField0_ & ~0x00000100); + storageAutoResizeLimit_ = null; + if (storageAutoResizeLimitBuilder_ != null) { + storageAutoResizeLimitBuilder_.dispose(); + storageAutoResizeLimitBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + public com.google.protobuf.Int64Value.Builder getStorageAutoResizeLimitBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetStorageAutoResizeLimitFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + public com.google.protobuf.Int64ValueOrBuilder getStorageAutoResizeLimitOrBuilder() { + if (storageAutoResizeLimitBuilder_ != null) { + return storageAutoResizeLimitBuilder_.getMessageOrBuilder(); + } else { + return storageAutoResizeLimit_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : storageAutoResizeLimit_; + } + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetStorageAutoResizeLimitFieldBuilder() { + if (storageAutoResizeLimitBuilder_ == null) { + storageAutoResizeLimitBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getStorageAutoResizeLimit(), getParentForChildren(), isClean()); + storageAutoResizeLimit_ = null; + } + return storageAutoResizeLimitBuilder_; + } + + private int activationPolicy_ = 0; + + /** + * + * + *
+     * The activation policy specifies when the instance is activated; it is
+     * applicable only when the instance state is RUNNABLE. Valid values:
+     * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+     * connection requests.
+     * *  `NEVER`: The instance is off; it is not activated, even if a
+     * connection request arrives.
+     * 
+ * + * .google.cloud.sql.v1.Settings.SqlActivationPolicy activation_policy = 10; + * + * @return The enum numeric value on the wire for activationPolicy. + */ + @java.lang.Override + public int getActivationPolicyValue() { + return activationPolicy_; + } + + /** + * + * + *
+     * The activation policy specifies when the instance is activated; it is
+     * applicable only when the instance state is RUNNABLE. Valid values:
+     * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+     * connection requests.
+     * *  `NEVER`: The instance is off; it is not activated, even if a
+     * connection request arrives.
+     * 
+ * + * .google.cloud.sql.v1.Settings.SqlActivationPolicy activation_policy = 10; + * + * @param value The enum numeric value on the wire for activationPolicy to set. + * @return This builder for chaining. + */ + public Builder setActivationPolicyValue(int value) { + activationPolicy_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The activation policy specifies when the instance is activated; it is
+     * applicable only when the instance state is RUNNABLE. Valid values:
+     * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+     * connection requests.
+     * *  `NEVER`: The instance is off; it is not activated, even if a
+     * connection request arrives.
+     * 
+ * + * .google.cloud.sql.v1.Settings.SqlActivationPolicy activation_policy = 10; + * + * @return The activationPolicy. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Settings.SqlActivationPolicy getActivationPolicy() { + com.google.cloud.sql.v1.Settings.SqlActivationPolicy result = + com.google.cloud.sql.v1.Settings.SqlActivationPolicy.forNumber(activationPolicy_); + return result == null + ? com.google.cloud.sql.v1.Settings.SqlActivationPolicy.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The activation policy specifies when the instance is activated; it is
+     * applicable only when the instance state is RUNNABLE. Valid values:
+     * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+     * connection requests.
+     * *  `NEVER`: The instance is off; it is not activated, even if a
+     * connection request arrives.
+     * 
+ * + * .google.cloud.sql.v1.Settings.SqlActivationPolicy activation_policy = 10; + * + * @param value The activationPolicy to set. + * @return This builder for chaining. + */ + public Builder setActivationPolicy(com.google.cloud.sql.v1.Settings.SqlActivationPolicy value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + activationPolicy_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The activation policy specifies when the instance is activated; it is
+     * applicable only when the instance state is RUNNABLE. Valid values:
+     * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+     * connection requests.
+     * *  `NEVER`: The instance is off; it is not activated, even if a
+     * connection request arrives.
+     * 
+ * + * .google.cloud.sql.v1.Settings.SqlActivationPolicy activation_policy = 10; + * + * @return This builder for chaining. + */ + public Builder clearActivationPolicy() { + bitField0_ = (bitField0_ & ~0x00000200); + activationPolicy_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.IpConfiguration ipConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.IpConfiguration, + com.google.cloud.sql.v1.IpConfiguration.Builder, + com.google.cloud.sql.v1.IpConfigurationOrBuilder> + ipConfigurationBuilder_; + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + * + * @return Whether the ipConfiguration field is set. + */ + public boolean hasIpConfiguration() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + * + * @return The ipConfiguration. + */ + public com.google.cloud.sql.v1.IpConfiguration getIpConfiguration() { + if (ipConfigurationBuilder_ == null) { + return ipConfiguration_ == null + ? com.google.cloud.sql.v1.IpConfiguration.getDefaultInstance() + : ipConfiguration_; + } else { + return ipConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + */ + public Builder setIpConfiguration(com.google.cloud.sql.v1.IpConfiguration value) { + if (ipConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ipConfiguration_ = value; + } else { + ipConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + */ + public Builder setIpConfiguration( + com.google.cloud.sql.v1.IpConfiguration.Builder builderForValue) { + if (ipConfigurationBuilder_ == null) { + ipConfiguration_ = builderForValue.build(); + } else { + ipConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + */ + public Builder mergeIpConfiguration(com.google.cloud.sql.v1.IpConfiguration value) { + if (ipConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && ipConfiguration_ != null + && ipConfiguration_ != com.google.cloud.sql.v1.IpConfiguration.getDefaultInstance()) { + getIpConfigurationBuilder().mergeFrom(value); + } else { + ipConfiguration_ = value; + } + } else { + ipConfigurationBuilder_.mergeFrom(value); + } + if (ipConfiguration_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + */ + public Builder clearIpConfiguration() { + bitField0_ = (bitField0_ & ~0x00000400); + ipConfiguration_ = null; + if (ipConfigurationBuilder_ != null) { + ipConfigurationBuilder_.dispose(); + ipConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + */ + public com.google.cloud.sql.v1.IpConfiguration.Builder getIpConfigurationBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return internalGetIpConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + */ + public com.google.cloud.sql.v1.IpConfigurationOrBuilder getIpConfigurationOrBuilder() { + if (ipConfigurationBuilder_ != null) { + return ipConfigurationBuilder_.getMessageOrBuilder(); + } else { + return ipConfiguration_ == null + ? com.google.cloud.sql.v1.IpConfiguration.getDefaultInstance() + : ipConfiguration_; + } + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.IpConfiguration, + com.google.cloud.sql.v1.IpConfiguration.Builder, + com.google.cloud.sql.v1.IpConfigurationOrBuilder> + internalGetIpConfigurationFieldBuilder() { + if (ipConfigurationBuilder_ == null) { + ipConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.IpConfiguration, + com.google.cloud.sql.v1.IpConfiguration.Builder, + com.google.cloud.sql.v1.IpConfigurationOrBuilder>( + getIpConfiguration(), getParentForChildren(), isClean()); + ipConfiguration_ = null; + } + return ipConfigurationBuilder_; + } + + private com.google.protobuf.BoolValue storageAutoResize_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + storageAutoResizeBuilder_; + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + * + * @return Whether the storageAutoResize field is set. + */ + public boolean hasStorageAutoResize() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + * + * @return The storageAutoResize. + */ + public com.google.protobuf.BoolValue getStorageAutoResize() { + if (storageAutoResizeBuilder_ == null) { + return storageAutoResize_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : storageAutoResize_; + } else { + return storageAutoResizeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + public Builder setStorageAutoResize(com.google.protobuf.BoolValue value) { + if (storageAutoResizeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + storageAutoResize_ = value; + } else { + storageAutoResizeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + public Builder setStorageAutoResize(com.google.protobuf.BoolValue.Builder builderForValue) { + if (storageAutoResizeBuilder_ == null) { + storageAutoResize_ = builderForValue.build(); + } else { + storageAutoResizeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + public Builder mergeStorageAutoResize(com.google.protobuf.BoolValue value) { + if (storageAutoResizeBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && storageAutoResize_ != null + && storageAutoResize_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getStorageAutoResizeBuilder().mergeFrom(value); + } else { + storageAutoResize_ = value; + } + } else { + storageAutoResizeBuilder_.mergeFrom(value); + } + if (storageAutoResize_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + public Builder clearStorageAutoResize() { + bitField0_ = (bitField0_ & ~0x00000800); + storageAutoResize_ = null; + if (storageAutoResizeBuilder_ != null) { + storageAutoResizeBuilder_.dispose(); + storageAutoResizeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + public com.google.protobuf.BoolValue.Builder getStorageAutoResizeBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return internalGetStorageAutoResizeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + public com.google.protobuf.BoolValueOrBuilder getStorageAutoResizeOrBuilder() { + if (storageAutoResizeBuilder_ != null) { + return storageAutoResizeBuilder_.getMessageOrBuilder(); + } else { + return storageAutoResize_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : storageAutoResize_; + } + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetStorageAutoResizeFieldBuilder() { + if (storageAutoResizeBuilder_ == null) { + storageAutoResizeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getStorageAutoResize(), getParentForChildren(), isClean()); + storageAutoResize_ = null; + } + return storageAutoResizeBuilder_; + } + + private com.google.cloud.sql.v1.LocationPreference locationPreference_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.LocationPreference, + com.google.cloud.sql.v1.LocationPreference.Builder, + com.google.cloud.sql.v1.LocationPreferenceOrBuilder> + locationPreferenceBuilder_; + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + * + * @return Whether the locationPreference field is set. + */ + public boolean hasLocationPreference() { + return ((bitField0_ & 0x00001000) != 0); + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + * + * @return The locationPreference. + */ + public com.google.cloud.sql.v1.LocationPreference getLocationPreference() { + if (locationPreferenceBuilder_ == null) { + return locationPreference_ == null + ? com.google.cloud.sql.v1.LocationPreference.getDefaultInstance() + : locationPreference_; + } else { + return locationPreferenceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + */ + public Builder setLocationPreference(com.google.cloud.sql.v1.LocationPreference value) { + if (locationPreferenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + locationPreference_ = value; + } else { + locationPreferenceBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + */ + public Builder setLocationPreference( + com.google.cloud.sql.v1.LocationPreference.Builder builderForValue) { + if (locationPreferenceBuilder_ == null) { + locationPreference_ = builderForValue.build(); + } else { + locationPreferenceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + */ + public Builder mergeLocationPreference(com.google.cloud.sql.v1.LocationPreference value) { + if (locationPreferenceBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && locationPreference_ != null + && locationPreference_ + != com.google.cloud.sql.v1.LocationPreference.getDefaultInstance()) { + getLocationPreferenceBuilder().mergeFrom(value); + } else { + locationPreference_ = value; + } + } else { + locationPreferenceBuilder_.mergeFrom(value); + } + if (locationPreference_ != null) { + bitField0_ |= 0x00001000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + */ + public Builder clearLocationPreference() { + bitField0_ = (bitField0_ & ~0x00001000); + locationPreference_ = null; + if (locationPreferenceBuilder_ != null) { + locationPreferenceBuilder_.dispose(); + locationPreferenceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + */ + public com.google.cloud.sql.v1.LocationPreference.Builder getLocationPreferenceBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return internalGetLocationPreferenceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + */ + public com.google.cloud.sql.v1.LocationPreferenceOrBuilder getLocationPreferenceOrBuilder() { + if (locationPreferenceBuilder_ != null) { + return locationPreferenceBuilder_.getMessageOrBuilder(); + } else { + return locationPreference_ == null + ? com.google.cloud.sql.v1.LocationPreference.getDefaultInstance() + : locationPreference_; + } + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.LocationPreference, + com.google.cloud.sql.v1.LocationPreference.Builder, + com.google.cloud.sql.v1.LocationPreferenceOrBuilder> + internalGetLocationPreferenceFieldBuilder() { + if (locationPreferenceBuilder_ == null) { + locationPreferenceBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.LocationPreference, + com.google.cloud.sql.v1.LocationPreference.Builder, + com.google.cloud.sql.v1.LocationPreferenceOrBuilder>( + getLocationPreference(), getParentForChildren(), isClean()); + locationPreference_ = null; + } + return locationPreferenceBuilder_; + } + + private java.util.List databaseFlags_ = + java.util.Collections.emptyList(); + + private void ensureDatabaseFlagsIsMutable() { + if (!((bitField0_ & 0x00002000) != 0)) { + databaseFlags_ = + new java.util.ArrayList(databaseFlags_); + bitField0_ |= 0x00002000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DatabaseFlags, + com.google.cloud.sql.v1.DatabaseFlags.Builder, + com.google.cloud.sql.v1.DatabaseFlagsOrBuilder> + databaseFlagsBuilder_; + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public java.util.List getDatabaseFlagsList() { + if (databaseFlagsBuilder_ == null) { + return java.util.Collections.unmodifiableList(databaseFlags_); + } else { + return databaseFlagsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public int getDatabaseFlagsCount() { + if (databaseFlagsBuilder_ == null) { + return databaseFlags_.size(); + } else { + return databaseFlagsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public com.google.cloud.sql.v1.DatabaseFlags getDatabaseFlags(int index) { + if (databaseFlagsBuilder_ == null) { + return databaseFlags_.get(index); + } else { + return databaseFlagsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public Builder setDatabaseFlags(int index, com.google.cloud.sql.v1.DatabaseFlags value) { + if (databaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseFlagsIsMutable(); + databaseFlags_.set(index, value); + onChanged(); + } else { + databaseFlagsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public Builder setDatabaseFlags( + int index, com.google.cloud.sql.v1.DatabaseFlags.Builder builderForValue) { + if (databaseFlagsBuilder_ == null) { + ensureDatabaseFlagsIsMutable(); + databaseFlags_.set(index, builderForValue.build()); + onChanged(); + } else { + databaseFlagsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public Builder addDatabaseFlags(com.google.cloud.sql.v1.DatabaseFlags value) { + if (databaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseFlagsIsMutable(); + databaseFlags_.add(value); + onChanged(); + } else { + databaseFlagsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public Builder addDatabaseFlags(int index, com.google.cloud.sql.v1.DatabaseFlags value) { + if (databaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseFlagsIsMutable(); + databaseFlags_.add(index, value); + onChanged(); + } else { + databaseFlagsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public Builder addDatabaseFlags(com.google.cloud.sql.v1.DatabaseFlags.Builder builderForValue) { + if (databaseFlagsBuilder_ == null) { + ensureDatabaseFlagsIsMutable(); + databaseFlags_.add(builderForValue.build()); + onChanged(); + } else { + databaseFlagsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public Builder addDatabaseFlags( + int index, com.google.cloud.sql.v1.DatabaseFlags.Builder builderForValue) { + if (databaseFlagsBuilder_ == null) { + ensureDatabaseFlagsIsMutable(); + databaseFlags_.add(index, builderForValue.build()); + onChanged(); + } else { + databaseFlagsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public Builder addAllDatabaseFlags( + java.lang.Iterable values) { + if (databaseFlagsBuilder_ == null) { + ensureDatabaseFlagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, databaseFlags_); + onChanged(); + } else { + databaseFlagsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public Builder clearDatabaseFlags() { + if (databaseFlagsBuilder_ == null) { + databaseFlags_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + } else { + databaseFlagsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public Builder removeDatabaseFlags(int index) { + if (databaseFlagsBuilder_ == null) { + ensureDatabaseFlagsIsMutable(); + databaseFlags_.remove(index); + onChanged(); + } else { + databaseFlagsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public com.google.cloud.sql.v1.DatabaseFlags.Builder getDatabaseFlagsBuilder(int index) { + return internalGetDatabaseFlagsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public com.google.cloud.sql.v1.DatabaseFlagsOrBuilder getDatabaseFlagsOrBuilder(int index) { + if (databaseFlagsBuilder_ == null) { + return databaseFlags_.get(index); + } else { + return databaseFlagsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public java.util.List + getDatabaseFlagsOrBuilderList() { + if (databaseFlagsBuilder_ != null) { + return databaseFlagsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(databaseFlags_); + } + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public com.google.cloud.sql.v1.DatabaseFlags.Builder addDatabaseFlagsBuilder() { + return internalGetDatabaseFlagsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.DatabaseFlags.getDefaultInstance()); + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public com.google.cloud.sql.v1.DatabaseFlags.Builder addDatabaseFlagsBuilder(int index) { + return internalGetDatabaseFlagsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.DatabaseFlags.getDefaultInstance()); + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + public java.util.List + getDatabaseFlagsBuilderList() { + return internalGetDatabaseFlagsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DatabaseFlags, + com.google.cloud.sql.v1.DatabaseFlags.Builder, + com.google.cloud.sql.v1.DatabaseFlagsOrBuilder> + internalGetDatabaseFlagsFieldBuilder() { + if (databaseFlagsBuilder_ == null) { + databaseFlagsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DatabaseFlags, + com.google.cloud.sql.v1.DatabaseFlags.Builder, + com.google.cloud.sql.v1.DatabaseFlagsOrBuilder>( + databaseFlags_, + ((bitField0_ & 0x00002000) != 0), + getParentForChildren(), + isClean()); + databaseFlags_ = null; + } + return databaseFlagsBuilder_; + } + + private int dataDiskType_ = 0; + + /** + * + * + *
+     * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+     * First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlDataDiskType data_disk_type = 15; + * + * @return The enum numeric value on the wire for dataDiskType. + */ + @java.lang.Override + public int getDataDiskTypeValue() { + return dataDiskType_; + } + + /** + * + * + *
+     * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+     * First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlDataDiskType data_disk_type = 15; + * + * @param value The enum numeric value on the wire for dataDiskType to set. + * @return This builder for chaining. + */ + public Builder setDataDiskTypeValue(int value) { + dataDiskType_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+     * First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlDataDiskType data_disk_type = 15; + * + * @return The dataDiskType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlDataDiskType getDataDiskType() { + com.google.cloud.sql.v1.SqlDataDiskType result = + com.google.cloud.sql.v1.SqlDataDiskType.forNumber(dataDiskType_); + return result == null ? com.google.cloud.sql.v1.SqlDataDiskType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+     * First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlDataDiskType data_disk_type = 15; + * + * @param value The dataDiskType to set. + * @return This builder for chaining. + */ + public Builder setDataDiskType(com.google.cloud.sql.v1.SqlDataDiskType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00004000; + dataDiskType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+     * First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1.SqlDataDiskType data_disk_type = 15; + * + * @return This builder for chaining. + */ + public Builder clearDataDiskType() { + bitField0_ = (bitField0_ & ~0x00004000); + dataDiskType_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.MaintenanceWindow maintenanceWindow_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.MaintenanceWindow, + com.google.cloud.sql.v1.MaintenanceWindow.Builder, + com.google.cloud.sql.v1.MaintenanceWindowOrBuilder> + maintenanceWindowBuilder_; + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + * + * @return Whether the maintenanceWindow field is set. + */ + public boolean hasMaintenanceWindow() { + return ((bitField0_ & 0x00008000) != 0); + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + * + * @return The maintenanceWindow. + */ + public com.google.cloud.sql.v1.MaintenanceWindow getMaintenanceWindow() { + if (maintenanceWindowBuilder_ == null) { + return maintenanceWindow_ == null + ? com.google.cloud.sql.v1.MaintenanceWindow.getDefaultInstance() + : maintenanceWindow_; + } else { + return maintenanceWindowBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + */ + public Builder setMaintenanceWindow(com.google.cloud.sql.v1.MaintenanceWindow value) { + if (maintenanceWindowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceWindow_ = value; + } else { + maintenanceWindowBuilder_.setMessage(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + */ + public Builder setMaintenanceWindow( + com.google.cloud.sql.v1.MaintenanceWindow.Builder builderForValue) { + if (maintenanceWindowBuilder_ == null) { + maintenanceWindow_ = builderForValue.build(); + } else { + maintenanceWindowBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + */ + public Builder mergeMaintenanceWindow(com.google.cloud.sql.v1.MaintenanceWindow value) { + if (maintenanceWindowBuilder_ == null) { + if (((bitField0_ & 0x00008000) != 0) + && maintenanceWindow_ != null + && maintenanceWindow_ + != com.google.cloud.sql.v1.MaintenanceWindow.getDefaultInstance()) { + getMaintenanceWindowBuilder().mergeFrom(value); + } else { + maintenanceWindow_ = value; + } + } else { + maintenanceWindowBuilder_.mergeFrom(value); + } + if (maintenanceWindow_ != null) { + bitField0_ |= 0x00008000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + */ + public Builder clearMaintenanceWindow() { + bitField0_ = (bitField0_ & ~0x00008000); + maintenanceWindow_ = null; + if (maintenanceWindowBuilder_ != null) { + maintenanceWindowBuilder_.dispose(); + maintenanceWindowBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + */ + public com.google.cloud.sql.v1.MaintenanceWindow.Builder getMaintenanceWindowBuilder() { + bitField0_ |= 0x00008000; + onChanged(); + return internalGetMaintenanceWindowFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + */ + public com.google.cloud.sql.v1.MaintenanceWindowOrBuilder getMaintenanceWindowOrBuilder() { + if (maintenanceWindowBuilder_ != null) { + return maintenanceWindowBuilder_.getMessageOrBuilder(); + } else { + return maintenanceWindow_ == null + ? com.google.cloud.sql.v1.MaintenanceWindow.getDefaultInstance() + : maintenanceWindow_; + } + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.MaintenanceWindow, + com.google.cloud.sql.v1.MaintenanceWindow.Builder, + com.google.cloud.sql.v1.MaintenanceWindowOrBuilder> + internalGetMaintenanceWindowFieldBuilder() { + if (maintenanceWindowBuilder_ == null) { + maintenanceWindowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.MaintenanceWindow, + com.google.cloud.sql.v1.MaintenanceWindow.Builder, + com.google.cloud.sql.v1.MaintenanceWindowOrBuilder>( + getMaintenanceWindow(), getParentForChildren(), isClean()); + maintenanceWindow_ = null; + } + return maintenanceWindowBuilder_; + } + + private com.google.cloud.sql.v1.BackupConfiguration backupConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupConfiguration, + com.google.cloud.sql.v1.BackupConfiguration.Builder, + com.google.cloud.sql.v1.BackupConfigurationOrBuilder> + backupConfigurationBuilder_; + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + * + * @return Whether the backupConfiguration field is set. + */ + public boolean hasBackupConfiguration() { + return ((bitField0_ & 0x00010000) != 0); + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + * + * @return The backupConfiguration. + */ + public com.google.cloud.sql.v1.BackupConfiguration getBackupConfiguration() { + if (backupConfigurationBuilder_ == null) { + return backupConfiguration_ == null + ? com.google.cloud.sql.v1.BackupConfiguration.getDefaultInstance() + : backupConfiguration_; + } else { + return backupConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + */ + public Builder setBackupConfiguration(com.google.cloud.sql.v1.BackupConfiguration value) { + if (backupConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupConfiguration_ = value; + } else { + backupConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + */ + public Builder setBackupConfiguration( + com.google.cloud.sql.v1.BackupConfiguration.Builder builderForValue) { + if (backupConfigurationBuilder_ == null) { + backupConfiguration_ = builderForValue.build(); + } else { + backupConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + */ + public Builder mergeBackupConfiguration(com.google.cloud.sql.v1.BackupConfiguration value) { + if (backupConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && backupConfiguration_ != null + && backupConfiguration_ + != com.google.cloud.sql.v1.BackupConfiguration.getDefaultInstance()) { + getBackupConfigurationBuilder().mergeFrom(value); + } else { + backupConfiguration_ = value; + } + } else { + backupConfigurationBuilder_.mergeFrom(value); + } + if (backupConfiguration_ != null) { + bitField0_ |= 0x00010000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + */ + public Builder clearBackupConfiguration() { + bitField0_ = (bitField0_ & ~0x00010000); + backupConfiguration_ = null; + if (backupConfigurationBuilder_ != null) { + backupConfigurationBuilder_.dispose(); + backupConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + */ + public com.google.cloud.sql.v1.BackupConfiguration.Builder getBackupConfigurationBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return internalGetBackupConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + */ + public com.google.cloud.sql.v1.BackupConfigurationOrBuilder getBackupConfigurationOrBuilder() { + if (backupConfigurationBuilder_ != null) { + return backupConfigurationBuilder_.getMessageOrBuilder(); + } else { + return backupConfiguration_ == null + ? com.google.cloud.sql.v1.BackupConfiguration.getDefaultInstance() + : backupConfiguration_; + } + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupConfiguration, + com.google.cloud.sql.v1.BackupConfiguration.Builder, + com.google.cloud.sql.v1.BackupConfigurationOrBuilder> + internalGetBackupConfigurationFieldBuilder() { + if (backupConfigurationBuilder_ == null) { + backupConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupConfiguration, + com.google.cloud.sql.v1.BackupConfiguration.Builder, + com.google.cloud.sql.v1.BackupConfigurationOrBuilder>( + getBackupConfiguration(), getParentForChildren(), isClean()); + backupConfiguration_ = null; + } + return backupConfigurationBuilder_; + } + + private com.google.protobuf.BoolValue databaseReplicationEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + databaseReplicationEnabledBuilder_; + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + * + * @return Whether the databaseReplicationEnabled field is set. + */ + public boolean hasDatabaseReplicationEnabled() { + return ((bitField0_ & 0x00020000) != 0); + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + * + * @return The databaseReplicationEnabled. + */ + public com.google.protobuf.BoolValue getDatabaseReplicationEnabled() { + if (databaseReplicationEnabledBuilder_ == null) { + return databaseReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : databaseReplicationEnabled_; + } else { + return databaseReplicationEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + public Builder setDatabaseReplicationEnabled(com.google.protobuf.BoolValue value) { + if (databaseReplicationEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + databaseReplicationEnabled_ = value; + } else { + databaseReplicationEnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + public Builder setDatabaseReplicationEnabled( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (databaseReplicationEnabledBuilder_ == null) { + databaseReplicationEnabled_ = builderForValue.build(); + } else { + databaseReplicationEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + public Builder mergeDatabaseReplicationEnabled(com.google.protobuf.BoolValue value) { + if (databaseReplicationEnabledBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) + && databaseReplicationEnabled_ != null + && databaseReplicationEnabled_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getDatabaseReplicationEnabledBuilder().mergeFrom(value); + } else { + databaseReplicationEnabled_ = value; + } + } else { + databaseReplicationEnabledBuilder_.mergeFrom(value); + } + if (databaseReplicationEnabled_ != null) { + bitField0_ |= 0x00020000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + public Builder clearDatabaseReplicationEnabled() { + bitField0_ = (bitField0_ & ~0x00020000); + databaseReplicationEnabled_ = null; + if (databaseReplicationEnabledBuilder_ != null) { + databaseReplicationEnabledBuilder_.dispose(); + databaseReplicationEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + public com.google.protobuf.BoolValue.Builder getDatabaseReplicationEnabledBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return internalGetDatabaseReplicationEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + public com.google.protobuf.BoolValueOrBuilder getDatabaseReplicationEnabledOrBuilder() { + if (databaseReplicationEnabledBuilder_ != null) { + return databaseReplicationEnabledBuilder_.getMessageOrBuilder(); + } else { + return databaseReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : databaseReplicationEnabled_; + } + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetDatabaseReplicationEnabledFieldBuilder() { + if (databaseReplicationEnabledBuilder_ == null) { + databaseReplicationEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getDatabaseReplicationEnabled(), getParentForChildren(), isClean()); + databaseReplicationEnabled_ = null; + } + return databaseReplicationEnabledBuilder_; + } + + private com.google.protobuf.BoolValue crashSafeReplicationEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + crashSafeReplicationEnabledBuilder_; + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.Settings.crash_safe_replication_enabled is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1743 + * @return Whether the crashSafeReplicationEnabled field is set. + */ + @java.lang.Deprecated + public boolean hasCrashSafeReplicationEnabled() { + return ((bitField0_ & 0x00040000) != 0); + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.Settings.crash_safe_replication_enabled is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1743 + * @return The crashSafeReplicationEnabled. + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValue getCrashSafeReplicationEnabled() { + if (crashSafeReplicationEnabledBuilder_ == null) { + return crashSafeReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : crashSafeReplicationEnabled_; + } else { + return crashSafeReplicationEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setCrashSafeReplicationEnabled(com.google.protobuf.BoolValue value) { + if (crashSafeReplicationEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + crashSafeReplicationEnabled_ = value; + } else { + crashSafeReplicationEnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setCrashSafeReplicationEnabled( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (crashSafeReplicationEnabledBuilder_ == null) { + crashSafeReplicationEnabled_ = builderForValue.build(); + } else { + crashSafeReplicationEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder mergeCrashSafeReplicationEnabled(com.google.protobuf.BoolValue value) { + if (crashSafeReplicationEnabledBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) + && crashSafeReplicationEnabled_ != null + && crashSafeReplicationEnabled_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getCrashSafeReplicationEnabledBuilder().mergeFrom(value); + } else { + crashSafeReplicationEnabled_ = value; + } + } else { + crashSafeReplicationEnabledBuilder_.mergeFrom(value); + } + if (crashSafeReplicationEnabled_ != null) { + bitField0_ |= 0x00040000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder clearCrashSafeReplicationEnabled() { + bitField0_ = (bitField0_ & ~0x00040000); + crashSafeReplicationEnabled_ = null; + if (crashSafeReplicationEnabledBuilder_ != null) { + crashSafeReplicationEnabledBuilder_.dispose(); + crashSafeReplicationEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValue.Builder getCrashSafeReplicationEnabledBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return internalGetCrashSafeReplicationEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValueOrBuilder getCrashSafeReplicationEnabledOrBuilder() { + if (crashSafeReplicationEnabledBuilder_ != null) { + return crashSafeReplicationEnabledBuilder_.getMessageOrBuilder(); + } else { + return crashSafeReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : crashSafeReplicationEnabled_; + } + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetCrashSafeReplicationEnabledFieldBuilder() { + if (crashSafeReplicationEnabledBuilder_ == null) { + crashSafeReplicationEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getCrashSafeReplicationEnabled(), getParentForChildren(), isClean()); + crashSafeReplicationEnabled_ = null; + } + return crashSafeReplicationEnabledBuilder_; + } + + private com.google.protobuf.Int64Value dataDiskSizeGb_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + dataDiskSizeGbBuilder_; + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + * + * @return Whether the dataDiskSizeGb field is set. + */ + public boolean hasDataDiskSizeGb() { + return ((bitField0_ & 0x00080000) != 0); + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + * + * @return The dataDiskSizeGb. + */ + public com.google.protobuf.Int64Value getDataDiskSizeGb() { + if (dataDiskSizeGbBuilder_ == null) { + return dataDiskSizeGb_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : dataDiskSizeGb_; + } else { + return dataDiskSizeGbBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + public Builder setDataDiskSizeGb(com.google.protobuf.Int64Value value) { + if (dataDiskSizeGbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataDiskSizeGb_ = value; + } else { + dataDiskSizeGbBuilder_.setMessage(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + public Builder setDataDiskSizeGb(com.google.protobuf.Int64Value.Builder builderForValue) { + if (dataDiskSizeGbBuilder_ == null) { + dataDiskSizeGb_ = builderForValue.build(); + } else { + dataDiskSizeGbBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + public Builder mergeDataDiskSizeGb(com.google.protobuf.Int64Value value) { + if (dataDiskSizeGbBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0) + && dataDiskSizeGb_ != null + && dataDiskSizeGb_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getDataDiskSizeGbBuilder().mergeFrom(value); + } else { + dataDiskSizeGb_ = value; + } + } else { + dataDiskSizeGbBuilder_.mergeFrom(value); + } + if (dataDiskSizeGb_ != null) { + bitField0_ |= 0x00080000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + public Builder clearDataDiskSizeGb() { + bitField0_ = (bitField0_ & ~0x00080000); + dataDiskSizeGb_ = null; + if (dataDiskSizeGbBuilder_ != null) { + dataDiskSizeGbBuilder_.dispose(); + dataDiskSizeGbBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + public com.google.protobuf.Int64Value.Builder getDataDiskSizeGbBuilder() { + bitField0_ |= 0x00080000; + onChanged(); + return internalGetDataDiskSizeGbFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + public com.google.protobuf.Int64ValueOrBuilder getDataDiskSizeGbOrBuilder() { + if (dataDiskSizeGbBuilder_ != null) { + return dataDiskSizeGbBuilder_.getMessageOrBuilder(); + } else { + return dataDiskSizeGb_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : dataDiskSizeGb_; + } + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetDataDiskSizeGbFieldBuilder() { + if (dataDiskSizeGbBuilder_ == null) { + dataDiskSizeGbBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getDataDiskSizeGb(), getParentForChildren(), isClean()); + dataDiskSizeGb_ = null; + } + return dataDiskSizeGbBuilder_; + } + + private com.google.cloud.sql.v1.SqlActiveDirectoryConfig activeDirectoryConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlActiveDirectoryConfig, + com.google.cloud.sql.v1.SqlActiveDirectoryConfig.Builder, + com.google.cloud.sql.v1.SqlActiveDirectoryConfigOrBuilder> + activeDirectoryConfigBuilder_; + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + * + * @return Whether the activeDirectoryConfig field is set. + */ + public boolean hasActiveDirectoryConfig() { + return ((bitField0_ & 0x00100000) != 0); + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + * + * @return The activeDirectoryConfig. + */ + public com.google.cloud.sql.v1.SqlActiveDirectoryConfig getActiveDirectoryConfig() { + if (activeDirectoryConfigBuilder_ == null) { + return activeDirectoryConfig_ == null + ? com.google.cloud.sql.v1.SqlActiveDirectoryConfig.getDefaultInstance() + : activeDirectoryConfig_; + } else { + return activeDirectoryConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + */ + public Builder setActiveDirectoryConfig( + com.google.cloud.sql.v1.SqlActiveDirectoryConfig value) { + if (activeDirectoryConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + activeDirectoryConfig_ = value; + } else { + activeDirectoryConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + */ + public Builder setActiveDirectoryConfig( + com.google.cloud.sql.v1.SqlActiveDirectoryConfig.Builder builderForValue) { + if (activeDirectoryConfigBuilder_ == null) { + activeDirectoryConfig_ = builderForValue.build(); + } else { + activeDirectoryConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + */ + public Builder mergeActiveDirectoryConfig( + com.google.cloud.sql.v1.SqlActiveDirectoryConfig value) { + if (activeDirectoryConfigBuilder_ == null) { + if (((bitField0_ & 0x00100000) != 0) + && activeDirectoryConfig_ != null + && activeDirectoryConfig_ + != com.google.cloud.sql.v1.SqlActiveDirectoryConfig.getDefaultInstance()) { + getActiveDirectoryConfigBuilder().mergeFrom(value); + } else { + activeDirectoryConfig_ = value; + } + } else { + activeDirectoryConfigBuilder_.mergeFrom(value); + } + if (activeDirectoryConfig_ != null) { + bitField0_ |= 0x00100000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + */ + public Builder clearActiveDirectoryConfig() { + bitField0_ = (bitField0_ & ~0x00100000); + activeDirectoryConfig_ = null; + if (activeDirectoryConfigBuilder_ != null) { + activeDirectoryConfigBuilder_.dispose(); + activeDirectoryConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + */ + public com.google.cloud.sql.v1.SqlActiveDirectoryConfig.Builder + getActiveDirectoryConfigBuilder() { + bitField0_ |= 0x00100000; + onChanged(); + return internalGetActiveDirectoryConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + */ + public com.google.cloud.sql.v1.SqlActiveDirectoryConfigOrBuilder + getActiveDirectoryConfigOrBuilder() { + if (activeDirectoryConfigBuilder_ != null) { + return activeDirectoryConfigBuilder_.getMessageOrBuilder(); + } else { + return activeDirectoryConfig_ == null + ? com.google.cloud.sql.v1.SqlActiveDirectoryConfig.getDefaultInstance() + : activeDirectoryConfig_; + } + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlActiveDirectoryConfig, + com.google.cloud.sql.v1.SqlActiveDirectoryConfig.Builder, + com.google.cloud.sql.v1.SqlActiveDirectoryConfigOrBuilder> + internalGetActiveDirectoryConfigFieldBuilder() { + if (activeDirectoryConfigBuilder_ == null) { + activeDirectoryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlActiveDirectoryConfig, + com.google.cloud.sql.v1.SqlActiveDirectoryConfig.Builder, + com.google.cloud.sql.v1.SqlActiveDirectoryConfigOrBuilder>( + getActiveDirectoryConfig(), getParentForChildren(), isClean()); + activeDirectoryConfig_ = null; + } + return activeDirectoryConfigBuilder_; + } + + private java.lang.Object collation_ = ""; + + /** + * + * + *
+     * The name of server Instance collation.
+     * 
+ * + * string collation = 23; + * + * @return The collation. + */ + public java.lang.String getCollation() { + java.lang.Object ref = collation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of server Instance collation.
+     * 
+ * + * string collation = 23; + * + * @return The bytes for collation. + */ + public com.google.protobuf.ByteString getCollationBytes() { + java.lang.Object ref = collation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of server Instance collation.
+     * 
+ * + * string collation = 23; + * + * @param value The collation to set. + * @return This builder for chaining. + */ + public Builder setCollation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + collation_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of server Instance collation.
+     * 
+ * + * string collation = 23; + * + * @return This builder for chaining. + */ + public Builder clearCollation() { + collation_ = getDefaultInstance().getCollation(); + bitField0_ = (bitField0_ & ~0x00200000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of server Instance collation.
+     * 
+ * + * string collation = 23; + * + * @param value The bytes for collation to set. + * @return This builder for chaining. + */ + public Builder setCollationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + collation_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + private java.util.List denyMaintenancePeriods_ = + java.util.Collections.emptyList(); + + private void ensureDenyMaintenancePeriodsIsMutable() { + if (!((bitField0_ & 0x00400000) != 0)) { + denyMaintenancePeriods_ = + new java.util.ArrayList( + denyMaintenancePeriods_); + bitField0_ |= 0x00400000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DenyMaintenancePeriod, + com.google.cloud.sql.v1.DenyMaintenancePeriod.Builder, + com.google.cloud.sql.v1.DenyMaintenancePeriodOrBuilder> + denyMaintenancePeriodsBuilder_; + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public java.util.List + getDenyMaintenancePeriodsList() { + if (denyMaintenancePeriodsBuilder_ == null) { + return java.util.Collections.unmodifiableList(denyMaintenancePeriods_); + } else { + return denyMaintenancePeriodsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public int getDenyMaintenancePeriodsCount() { + if (denyMaintenancePeriodsBuilder_ == null) { + return denyMaintenancePeriods_.size(); + } else { + return denyMaintenancePeriodsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public com.google.cloud.sql.v1.DenyMaintenancePeriod getDenyMaintenancePeriods(int index) { + if (denyMaintenancePeriodsBuilder_ == null) { + return denyMaintenancePeriods_.get(index); + } else { + return denyMaintenancePeriodsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder setDenyMaintenancePeriods( + int index, com.google.cloud.sql.v1.DenyMaintenancePeriod value) { + if (denyMaintenancePeriodsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.set(index, value); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder setDenyMaintenancePeriods( + int index, com.google.cloud.sql.v1.DenyMaintenancePeriod.Builder builderForValue) { + if (denyMaintenancePeriodsBuilder_ == null) { + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.set(index, builderForValue.build()); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder addDenyMaintenancePeriods(com.google.cloud.sql.v1.DenyMaintenancePeriod value) { + if (denyMaintenancePeriodsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.add(value); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder addDenyMaintenancePeriods( + int index, com.google.cloud.sql.v1.DenyMaintenancePeriod value) { + if (denyMaintenancePeriodsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.add(index, value); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder addDenyMaintenancePeriods( + com.google.cloud.sql.v1.DenyMaintenancePeriod.Builder builderForValue) { + if (denyMaintenancePeriodsBuilder_ == null) { + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.add(builderForValue.build()); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder addDenyMaintenancePeriods( + int index, com.google.cloud.sql.v1.DenyMaintenancePeriod.Builder builderForValue) { + if (denyMaintenancePeriodsBuilder_ == null) { + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.add(index, builderForValue.build()); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder addAllDenyMaintenancePeriods( + java.lang.Iterable values) { + if (denyMaintenancePeriodsBuilder_ == null) { + ensureDenyMaintenancePeriodsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, denyMaintenancePeriods_); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder clearDenyMaintenancePeriods() { + if (denyMaintenancePeriodsBuilder_ == null) { + denyMaintenancePeriods_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00400000); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder removeDenyMaintenancePeriods(int index) { + if (denyMaintenancePeriodsBuilder_ == null) { + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.remove(index); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public com.google.cloud.sql.v1.DenyMaintenancePeriod.Builder getDenyMaintenancePeriodsBuilder( + int index) { + return internalGetDenyMaintenancePeriodsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public com.google.cloud.sql.v1.DenyMaintenancePeriodOrBuilder + getDenyMaintenancePeriodsOrBuilder(int index) { + if (denyMaintenancePeriodsBuilder_ == null) { + return denyMaintenancePeriods_.get(index); + } else { + return denyMaintenancePeriodsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public java.util.List + getDenyMaintenancePeriodsOrBuilderList() { + if (denyMaintenancePeriodsBuilder_ != null) { + return denyMaintenancePeriodsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(denyMaintenancePeriods_); + } + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public com.google.cloud.sql.v1.DenyMaintenancePeriod.Builder + addDenyMaintenancePeriodsBuilder() { + return internalGetDenyMaintenancePeriodsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.DenyMaintenancePeriod.getDefaultInstance()); + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public com.google.cloud.sql.v1.DenyMaintenancePeriod.Builder addDenyMaintenancePeriodsBuilder( + int index) { + return internalGetDenyMaintenancePeriodsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.DenyMaintenancePeriod.getDefaultInstance()); + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public java.util.List + getDenyMaintenancePeriodsBuilderList() { + return internalGetDenyMaintenancePeriodsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DenyMaintenancePeriod, + com.google.cloud.sql.v1.DenyMaintenancePeriod.Builder, + com.google.cloud.sql.v1.DenyMaintenancePeriodOrBuilder> + internalGetDenyMaintenancePeriodsFieldBuilder() { + if (denyMaintenancePeriodsBuilder_ == null) { + denyMaintenancePeriodsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.DenyMaintenancePeriod, + com.google.cloud.sql.v1.DenyMaintenancePeriod.Builder, + com.google.cloud.sql.v1.DenyMaintenancePeriodOrBuilder>( + denyMaintenancePeriods_, + ((bitField0_ & 0x00400000) != 0), + getParentForChildren(), + isClean()); + denyMaintenancePeriods_ = null; + } + return denyMaintenancePeriodsBuilder_; + } + + private com.google.cloud.sql.v1.InsightsConfig insightsConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InsightsConfig, + com.google.cloud.sql.v1.InsightsConfig.Builder, + com.google.cloud.sql.v1.InsightsConfigOrBuilder> + insightsConfigBuilder_; + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + * + * @return Whether the insightsConfig field is set. + */ + public boolean hasInsightsConfig() { + return ((bitField0_ & 0x00800000) != 0); + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + * + * @return The insightsConfig. + */ + public com.google.cloud.sql.v1.InsightsConfig getInsightsConfig() { + if (insightsConfigBuilder_ == null) { + return insightsConfig_ == null + ? com.google.cloud.sql.v1.InsightsConfig.getDefaultInstance() + : insightsConfig_; + } else { + return insightsConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + */ + public Builder setInsightsConfig(com.google.cloud.sql.v1.InsightsConfig value) { + if (insightsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + insightsConfig_ = value; + } else { + insightsConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + */ + public Builder setInsightsConfig( + com.google.cloud.sql.v1.InsightsConfig.Builder builderForValue) { + if (insightsConfigBuilder_ == null) { + insightsConfig_ = builderForValue.build(); + } else { + insightsConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + */ + public Builder mergeInsightsConfig(com.google.cloud.sql.v1.InsightsConfig value) { + if (insightsConfigBuilder_ == null) { + if (((bitField0_ & 0x00800000) != 0) + && insightsConfig_ != null + && insightsConfig_ != com.google.cloud.sql.v1.InsightsConfig.getDefaultInstance()) { + getInsightsConfigBuilder().mergeFrom(value); + } else { + insightsConfig_ = value; + } + } else { + insightsConfigBuilder_.mergeFrom(value); + } + if (insightsConfig_ != null) { + bitField0_ |= 0x00800000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + */ + public Builder clearInsightsConfig() { + bitField0_ = (bitField0_ & ~0x00800000); + insightsConfig_ = null; + if (insightsConfigBuilder_ != null) { + insightsConfigBuilder_.dispose(); + insightsConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + */ + public com.google.cloud.sql.v1.InsightsConfig.Builder getInsightsConfigBuilder() { + bitField0_ |= 0x00800000; + onChanged(); + return internalGetInsightsConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + */ + public com.google.cloud.sql.v1.InsightsConfigOrBuilder getInsightsConfigOrBuilder() { + if (insightsConfigBuilder_ != null) { + return insightsConfigBuilder_.getMessageOrBuilder(); + } else { + return insightsConfig_ == null + ? com.google.cloud.sql.v1.InsightsConfig.getDefaultInstance() + : insightsConfig_; + } + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InsightsConfig, + com.google.cloud.sql.v1.InsightsConfig.Builder, + com.google.cloud.sql.v1.InsightsConfigOrBuilder> + internalGetInsightsConfigFieldBuilder() { + if (insightsConfigBuilder_ == null) { + insightsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InsightsConfig, + com.google.cloud.sql.v1.InsightsConfig.Builder, + com.google.cloud.sql.v1.InsightsConfigOrBuilder>( + getInsightsConfig(), getParentForChildren(), isClean()); + insightsConfig_ = null; + } + return insightsConfigBuilder_; + } + + private com.google.cloud.sql.v1.PasswordValidationPolicy passwordValidationPolicy_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PasswordValidationPolicy, + com.google.cloud.sql.v1.PasswordValidationPolicy.Builder, + com.google.cloud.sql.v1.PasswordValidationPolicyOrBuilder> + passwordValidationPolicyBuilder_; + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + * + * @return Whether the passwordValidationPolicy field is set. + */ + public boolean hasPasswordValidationPolicy() { + return ((bitField0_ & 0x01000000) != 0); + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + * + * @return The passwordValidationPolicy. + */ + public com.google.cloud.sql.v1.PasswordValidationPolicy getPasswordValidationPolicy() { + if (passwordValidationPolicyBuilder_ == null) { + return passwordValidationPolicy_ == null + ? com.google.cloud.sql.v1.PasswordValidationPolicy.getDefaultInstance() + : passwordValidationPolicy_; + } else { + return passwordValidationPolicyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + */ + public Builder setPasswordValidationPolicy( + com.google.cloud.sql.v1.PasswordValidationPolicy value) { + if (passwordValidationPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + passwordValidationPolicy_ = value; + } else { + passwordValidationPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + */ + public Builder setPasswordValidationPolicy( + com.google.cloud.sql.v1.PasswordValidationPolicy.Builder builderForValue) { + if (passwordValidationPolicyBuilder_ == null) { + passwordValidationPolicy_ = builderForValue.build(); + } else { + passwordValidationPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + */ + public Builder mergePasswordValidationPolicy( + com.google.cloud.sql.v1.PasswordValidationPolicy value) { + if (passwordValidationPolicyBuilder_ == null) { + if (((bitField0_ & 0x01000000) != 0) + && passwordValidationPolicy_ != null + && passwordValidationPolicy_ + != com.google.cloud.sql.v1.PasswordValidationPolicy.getDefaultInstance()) { + getPasswordValidationPolicyBuilder().mergeFrom(value); + } else { + passwordValidationPolicy_ = value; + } + } else { + passwordValidationPolicyBuilder_.mergeFrom(value); + } + if (passwordValidationPolicy_ != null) { + bitField0_ |= 0x01000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + */ + public Builder clearPasswordValidationPolicy() { + bitField0_ = (bitField0_ & ~0x01000000); + passwordValidationPolicy_ = null; + if (passwordValidationPolicyBuilder_ != null) { + passwordValidationPolicyBuilder_.dispose(); + passwordValidationPolicyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + */ + public com.google.cloud.sql.v1.PasswordValidationPolicy.Builder + getPasswordValidationPolicyBuilder() { + bitField0_ |= 0x01000000; + onChanged(); + return internalGetPasswordValidationPolicyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + */ + public com.google.cloud.sql.v1.PasswordValidationPolicyOrBuilder + getPasswordValidationPolicyOrBuilder() { + if (passwordValidationPolicyBuilder_ != null) { + return passwordValidationPolicyBuilder_.getMessageOrBuilder(); + } else { + return passwordValidationPolicy_ == null + ? com.google.cloud.sql.v1.PasswordValidationPolicy.getDefaultInstance() + : passwordValidationPolicy_; + } + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PasswordValidationPolicy, + com.google.cloud.sql.v1.PasswordValidationPolicy.Builder, + com.google.cloud.sql.v1.PasswordValidationPolicyOrBuilder> + internalGetPasswordValidationPolicyFieldBuilder() { + if (passwordValidationPolicyBuilder_ == null) { + passwordValidationPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PasswordValidationPolicy, + com.google.cloud.sql.v1.PasswordValidationPolicy.Builder, + com.google.cloud.sql.v1.PasswordValidationPolicyOrBuilder>( + getPasswordValidationPolicy(), getParentForChildren(), isClean()); + passwordValidationPolicy_ = null; + } + return passwordValidationPolicyBuilder_; + } + + private com.google.cloud.sql.v1.SqlServerAuditConfig sqlServerAuditConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlServerAuditConfig, + com.google.cloud.sql.v1.SqlServerAuditConfig.Builder, + com.google.cloud.sql.v1.SqlServerAuditConfigOrBuilder> + sqlServerAuditConfigBuilder_; + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + * + * @return Whether the sqlServerAuditConfig field is set. + */ + public boolean hasSqlServerAuditConfig() { + return ((bitField0_ & 0x02000000) != 0); + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + * + * @return The sqlServerAuditConfig. + */ + public com.google.cloud.sql.v1.SqlServerAuditConfig getSqlServerAuditConfig() { + if (sqlServerAuditConfigBuilder_ == null) { + return sqlServerAuditConfig_ == null + ? com.google.cloud.sql.v1.SqlServerAuditConfig.getDefaultInstance() + : sqlServerAuditConfig_; + } else { + return sqlServerAuditConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + */ + public Builder setSqlServerAuditConfig(com.google.cloud.sql.v1.SqlServerAuditConfig value) { + if (sqlServerAuditConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sqlServerAuditConfig_ = value; + } else { + sqlServerAuditConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + */ + public Builder setSqlServerAuditConfig( + com.google.cloud.sql.v1.SqlServerAuditConfig.Builder builderForValue) { + if (sqlServerAuditConfigBuilder_ == null) { + sqlServerAuditConfig_ = builderForValue.build(); + } else { + sqlServerAuditConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + */ + public Builder mergeSqlServerAuditConfig(com.google.cloud.sql.v1.SqlServerAuditConfig value) { + if (sqlServerAuditConfigBuilder_ == null) { + if (((bitField0_ & 0x02000000) != 0) + && sqlServerAuditConfig_ != null + && sqlServerAuditConfig_ + != com.google.cloud.sql.v1.SqlServerAuditConfig.getDefaultInstance()) { + getSqlServerAuditConfigBuilder().mergeFrom(value); + } else { + sqlServerAuditConfig_ = value; + } + } else { + sqlServerAuditConfigBuilder_.mergeFrom(value); + } + if (sqlServerAuditConfig_ != null) { + bitField0_ |= 0x02000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + */ + public Builder clearSqlServerAuditConfig() { + bitField0_ = (bitField0_ & ~0x02000000); + sqlServerAuditConfig_ = null; + if (sqlServerAuditConfigBuilder_ != null) { + sqlServerAuditConfigBuilder_.dispose(); + sqlServerAuditConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + */ + public com.google.cloud.sql.v1.SqlServerAuditConfig.Builder getSqlServerAuditConfigBuilder() { + bitField0_ |= 0x02000000; + onChanged(); + return internalGetSqlServerAuditConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + */ + public com.google.cloud.sql.v1.SqlServerAuditConfigOrBuilder + getSqlServerAuditConfigOrBuilder() { + if (sqlServerAuditConfigBuilder_ != null) { + return sqlServerAuditConfigBuilder_.getMessageOrBuilder(); + } else { + return sqlServerAuditConfig_ == null + ? com.google.cloud.sql.v1.SqlServerAuditConfig.getDefaultInstance() + : sqlServerAuditConfig_; + } + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlServerAuditConfig, + com.google.cloud.sql.v1.SqlServerAuditConfig.Builder, + com.google.cloud.sql.v1.SqlServerAuditConfigOrBuilder> + internalGetSqlServerAuditConfigFieldBuilder() { + if (sqlServerAuditConfigBuilder_ == null) { + sqlServerAuditConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlServerAuditConfig, + com.google.cloud.sql.v1.SqlServerAuditConfig.Builder, + com.google.cloud.sql.v1.SqlServerAuditConfigOrBuilder>( + getSqlServerAuditConfig(), getParentForChildren(), isClean()); + sqlServerAuditConfig_ = null; + } + return sqlServerAuditConfigBuilder_; + } + + private int edition_ = 0; + + /** + * + * + *
+     * Optional. The edition type of the Cloud SQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for edition. + */ + @java.lang.Override + public int getEditionValue() { + return edition_; + } + + /** + * + * + *
+     * Optional. The edition type of the Cloud SQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for edition to set. + * @return This builder for chaining. + */ + public Builder setEditionValue(int value) { + edition_ = value; + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The edition type of the Cloud SQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The edition. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Settings.Edition getEdition() { + com.google.cloud.sql.v1.Settings.Edition result = + com.google.cloud.sql.v1.Settings.Edition.forNumber(edition_); + return result == null ? com.google.cloud.sql.v1.Settings.Edition.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Optional. The edition type of the Cloud SQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The edition to set. + * @return This builder for chaining. + */ + public Builder setEdition(com.google.cloud.sql.v1.Settings.Edition value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x04000000; + edition_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The edition type of the Cloud SQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearEdition() { + bitField0_ = (bitField0_ & ~0x04000000); + edition_ = 0; + onChanged(); + return this; + } + + private int connectorEnforcement_ = 0; + + /** + * + * + *
+     * Specifies if connections must use Cloud SQL connectors.
+     * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+     * can be connected without Cloud SQL
+     * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+     * Connectors).
+     *
+     * Note that using REQUIRED disables all existing authorized networks. If
+     * this field is not specified when creating a new instance, NOT_REQUIRED is
+     * used. If this field is not specified when patching or updating an existing
+     * instance, it is left unchanged in the instance.
+     * 
+ * + * .google.cloud.sql.v1.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * @return The enum numeric value on the wire for connectorEnforcement. + */ + @java.lang.Override + public int getConnectorEnforcementValue() { + return connectorEnforcement_; + } + + /** + * + * + *
+     * Specifies if connections must use Cloud SQL connectors.
+     * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+     * can be connected without Cloud SQL
+     * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+     * Connectors).
+     *
+     * Note that using REQUIRED disables all existing authorized networks. If
+     * this field is not specified when creating a new instance, NOT_REQUIRED is
+     * used. If this field is not specified when patching or updating an existing
+     * instance, it is left unchanged in the instance.
+     * 
+ * + * .google.cloud.sql.v1.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * @param value The enum numeric value on the wire for connectorEnforcement to set. + * @return This builder for chaining. + */ + public Builder setConnectorEnforcementValue(int value) { + connectorEnforcement_ = value; + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies if connections must use Cloud SQL connectors.
+     * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+     * can be connected without Cloud SQL
+     * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+     * Connectors).
+     *
+     * Note that using REQUIRED disables all existing authorized networks. If
+     * this field is not specified when creating a new instance, NOT_REQUIRED is
+     * used. If this field is not specified when patching or updating an existing
+     * instance, it is left unchanged in the instance.
+     * 
+ * + * .google.cloud.sql.v1.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * @return The connectorEnforcement. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Settings.ConnectorEnforcement getConnectorEnforcement() { + com.google.cloud.sql.v1.Settings.ConnectorEnforcement result = + com.google.cloud.sql.v1.Settings.ConnectorEnforcement.forNumber(connectorEnforcement_); + return result == null + ? com.google.cloud.sql.v1.Settings.ConnectorEnforcement.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Specifies if connections must use Cloud SQL connectors.
+     * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+     * can be connected without Cloud SQL
+     * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+     * Connectors).
+     *
+     * Note that using REQUIRED disables all existing authorized networks. If
+     * this field is not specified when creating a new instance, NOT_REQUIRED is
+     * used. If this field is not specified when patching or updating an existing
+     * instance, it is left unchanged in the instance.
+     * 
+ * + * .google.cloud.sql.v1.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * @param value The connectorEnforcement to set. + * @return This builder for chaining. + */ + public Builder setConnectorEnforcement( + com.google.cloud.sql.v1.Settings.ConnectorEnforcement value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x08000000; + connectorEnforcement_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies if connections must use Cloud SQL connectors.
+     * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+     * can be connected without Cloud SQL
+     * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+     * Connectors).
+     *
+     * Note that using REQUIRED disables all existing authorized networks. If
+     * this field is not specified when creating a new instance, NOT_REQUIRED is
+     * used. If this field is not specified when patching or updating an existing
+     * instance, it is left unchanged in the instance.
+     * 
+ * + * .google.cloud.sql.v1.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * @return This builder for chaining. + */ + public Builder clearConnectorEnforcement() { + bitField0_ = (bitField0_ & ~0x08000000); + connectorEnforcement_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue deletionProtectionEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + deletionProtectionEnabledBuilder_; + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + * + * @return Whether the deletionProtectionEnabled field is set. + */ + public boolean hasDeletionProtectionEnabled() { + return ((bitField0_ & 0x10000000) != 0); + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + * + * @return The deletionProtectionEnabled. + */ + public com.google.protobuf.BoolValue getDeletionProtectionEnabled() { + if (deletionProtectionEnabledBuilder_ == null) { + return deletionProtectionEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : deletionProtectionEnabled_; + } else { + return deletionProtectionEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + public Builder setDeletionProtectionEnabled(com.google.protobuf.BoolValue value) { + if (deletionProtectionEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deletionProtectionEnabled_ = value; + } else { + deletionProtectionEnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + public Builder setDeletionProtectionEnabled( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (deletionProtectionEnabledBuilder_ == null) { + deletionProtectionEnabled_ = builderForValue.build(); + } else { + deletionProtectionEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + public Builder mergeDeletionProtectionEnabled(com.google.protobuf.BoolValue value) { + if (deletionProtectionEnabledBuilder_ == null) { + if (((bitField0_ & 0x10000000) != 0) + && deletionProtectionEnabled_ != null + && deletionProtectionEnabled_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getDeletionProtectionEnabledBuilder().mergeFrom(value); + } else { + deletionProtectionEnabled_ = value; + } + } else { + deletionProtectionEnabledBuilder_.mergeFrom(value); + } + if (deletionProtectionEnabled_ != null) { + bitField0_ |= 0x10000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + public Builder clearDeletionProtectionEnabled() { + bitField0_ = (bitField0_ & ~0x10000000); + deletionProtectionEnabled_ = null; + if (deletionProtectionEnabledBuilder_ != null) { + deletionProtectionEnabledBuilder_.dispose(); + deletionProtectionEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + public com.google.protobuf.BoolValue.Builder getDeletionProtectionEnabledBuilder() { + bitField0_ |= 0x10000000; + onChanged(); + return internalGetDeletionProtectionEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + public com.google.protobuf.BoolValueOrBuilder getDeletionProtectionEnabledOrBuilder() { + if (deletionProtectionEnabledBuilder_ != null) { + return deletionProtectionEnabledBuilder_.getMessageOrBuilder(); + } else { + return deletionProtectionEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : deletionProtectionEnabled_; + } + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetDeletionProtectionEnabledFieldBuilder() { + if (deletionProtectionEnabledBuilder_ == null) { + deletionProtectionEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getDeletionProtectionEnabled(), getParentForChildren(), isClean()); + deletionProtectionEnabled_ = null; + } + return deletionProtectionEnabledBuilder_; + } + + private java.lang.Object timeZone_ = ""; + + /** + * + * + *
+     * Server timezone, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * string time_zone = 34; + * + * @return The timeZone. + */ + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Server timezone, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * string time_zone = 34; + * + * @return The bytes for timeZone. + */ + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Server timezone, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * string time_zone = 34; + * + * @param value The timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + timeZone_ = value; + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Server timezone, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * string time_zone = 34; + * + * @return This builder for chaining. + */ + public Builder clearTimeZone() { + timeZone_ = getDefaultInstance().getTimeZone(); + bitField0_ = (bitField0_ & ~0x20000000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Server timezone, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * string time_zone = 34; + * + * @param value The bytes for timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + timeZone_ = value; + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.AdvancedMachineFeatures advancedMachineFeatures_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.AdvancedMachineFeatures, + com.google.cloud.sql.v1.AdvancedMachineFeatures.Builder, + com.google.cloud.sql.v1.AdvancedMachineFeaturesOrBuilder> + advancedMachineFeaturesBuilder_; + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + * + * @return Whether the advancedMachineFeatures field is set. + */ + public boolean hasAdvancedMachineFeatures() { + return ((bitField0_ & 0x40000000) != 0); + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + * + * @return The advancedMachineFeatures. + */ + public com.google.cloud.sql.v1.AdvancedMachineFeatures getAdvancedMachineFeatures() { + if (advancedMachineFeaturesBuilder_ == null) { + return advancedMachineFeatures_ == null + ? com.google.cloud.sql.v1.AdvancedMachineFeatures.getDefaultInstance() + : advancedMachineFeatures_; + } else { + return advancedMachineFeaturesBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + */ + public Builder setAdvancedMachineFeatures( + com.google.cloud.sql.v1.AdvancedMachineFeatures value) { + if (advancedMachineFeaturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + advancedMachineFeatures_ = value; + } else { + advancedMachineFeaturesBuilder_.setMessage(value); + } + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + */ + public Builder setAdvancedMachineFeatures( + com.google.cloud.sql.v1.AdvancedMachineFeatures.Builder builderForValue) { + if (advancedMachineFeaturesBuilder_ == null) { + advancedMachineFeatures_ = builderForValue.build(); + } else { + advancedMachineFeaturesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + */ + public Builder mergeAdvancedMachineFeatures( + com.google.cloud.sql.v1.AdvancedMachineFeatures value) { + if (advancedMachineFeaturesBuilder_ == null) { + if (((bitField0_ & 0x40000000) != 0) + && advancedMachineFeatures_ != null + && advancedMachineFeatures_ + != com.google.cloud.sql.v1.AdvancedMachineFeatures.getDefaultInstance()) { + getAdvancedMachineFeaturesBuilder().mergeFrom(value); + } else { + advancedMachineFeatures_ = value; + } + } else { + advancedMachineFeaturesBuilder_.mergeFrom(value); + } + if (advancedMachineFeatures_ != null) { + bitField0_ |= 0x40000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + */ + public Builder clearAdvancedMachineFeatures() { + bitField0_ = (bitField0_ & ~0x40000000); + advancedMachineFeatures_ = null; + if (advancedMachineFeaturesBuilder_ != null) { + advancedMachineFeaturesBuilder_.dispose(); + advancedMachineFeaturesBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + */ + public com.google.cloud.sql.v1.AdvancedMachineFeatures.Builder + getAdvancedMachineFeaturesBuilder() { + bitField0_ |= 0x40000000; + onChanged(); + return internalGetAdvancedMachineFeaturesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + */ + public com.google.cloud.sql.v1.AdvancedMachineFeaturesOrBuilder + getAdvancedMachineFeaturesOrBuilder() { + if (advancedMachineFeaturesBuilder_ != null) { + return advancedMachineFeaturesBuilder_.getMessageOrBuilder(); + } else { + return advancedMachineFeatures_ == null + ? com.google.cloud.sql.v1.AdvancedMachineFeatures.getDefaultInstance() + : advancedMachineFeatures_; + } + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.AdvancedMachineFeatures, + com.google.cloud.sql.v1.AdvancedMachineFeatures.Builder, + com.google.cloud.sql.v1.AdvancedMachineFeaturesOrBuilder> + internalGetAdvancedMachineFeaturesFieldBuilder() { + if (advancedMachineFeaturesBuilder_ == null) { + advancedMachineFeaturesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.AdvancedMachineFeatures, + com.google.cloud.sql.v1.AdvancedMachineFeatures.Builder, + com.google.cloud.sql.v1.AdvancedMachineFeaturesOrBuilder>( + getAdvancedMachineFeatures(), getParentForChildren(), isClean()); + advancedMachineFeatures_ = null; + } + return advancedMachineFeaturesBuilder_; + } + + private com.google.cloud.sql.v1.DataCacheConfig dataCacheConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DataCacheConfig, + com.google.cloud.sql.v1.DataCacheConfig.Builder, + com.google.cloud.sql.v1.DataCacheConfigOrBuilder> + dataCacheConfigBuilder_; + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + * + * @return Whether the dataCacheConfig field is set. + */ + public boolean hasDataCacheConfig() { + return ((bitField0_ & 0x80000000) != 0); + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + * + * @return The dataCacheConfig. + */ + public com.google.cloud.sql.v1.DataCacheConfig getDataCacheConfig() { + if (dataCacheConfigBuilder_ == null) { + return dataCacheConfig_ == null + ? com.google.cloud.sql.v1.DataCacheConfig.getDefaultInstance() + : dataCacheConfig_; + } else { + return dataCacheConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + */ + public Builder setDataCacheConfig(com.google.cloud.sql.v1.DataCacheConfig value) { + if (dataCacheConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataCacheConfig_ = value; + } else { + dataCacheConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + */ + public Builder setDataCacheConfig( + com.google.cloud.sql.v1.DataCacheConfig.Builder builderForValue) { + if (dataCacheConfigBuilder_ == null) { + dataCacheConfig_ = builderForValue.build(); + } else { + dataCacheConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + */ + public Builder mergeDataCacheConfig(com.google.cloud.sql.v1.DataCacheConfig value) { + if (dataCacheConfigBuilder_ == null) { + if (((bitField0_ & 0x80000000) != 0) + && dataCacheConfig_ != null + && dataCacheConfig_ != com.google.cloud.sql.v1.DataCacheConfig.getDefaultInstance()) { + getDataCacheConfigBuilder().mergeFrom(value); + } else { + dataCacheConfig_ = value; + } + } else { + dataCacheConfigBuilder_.mergeFrom(value); + } + if (dataCacheConfig_ != null) { + bitField0_ |= 0x80000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + */ + public Builder clearDataCacheConfig() { + bitField0_ = (bitField0_ & ~0x80000000); + dataCacheConfig_ = null; + if (dataCacheConfigBuilder_ != null) { + dataCacheConfigBuilder_.dispose(); + dataCacheConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + */ + public com.google.cloud.sql.v1.DataCacheConfig.Builder getDataCacheConfigBuilder() { + bitField0_ |= 0x80000000; + onChanged(); + return internalGetDataCacheConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + */ + public com.google.cloud.sql.v1.DataCacheConfigOrBuilder getDataCacheConfigOrBuilder() { + if (dataCacheConfigBuilder_ != null) { + return dataCacheConfigBuilder_.getMessageOrBuilder(); + } else { + return dataCacheConfig_ == null + ? com.google.cloud.sql.v1.DataCacheConfig.getDefaultInstance() + : dataCacheConfig_; + } + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DataCacheConfig, + com.google.cloud.sql.v1.DataCacheConfig.Builder, + com.google.cloud.sql.v1.DataCacheConfigOrBuilder> + internalGetDataCacheConfigFieldBuilder() { + if (dataCacheConfigBuilder_ == null) { + dataCacheConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DataCacheConfig, + com.google.cloud.sql.v1.DataCacheConfig.Builder, + com.google.cloud.sql.v1.DataCacheConfigOrBuilder>( + getDataCacheConfig(), getParentForChildren(), isClean()); + dataCacheConfig_ = null; + } + return dataCacheConfigBuilder_; + } + + private com.google.protobuf.Int32Value replicationLagMaxSeconds_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + replicationLagMaxSecondsBuilder_; + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the replicationLagMaxSeconds field is set. + */ + public boolean hasReplicationLagMaxSeconds() { + return ((bitField1_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The replicationLagMaxSeconds. + */ + public com.google.protobuf.Int32Value getReplicationLagMaxSeconds() { + if (replicationLagMaxSecondsBuilder_ == null) { + return replicationLagMaxSeconds_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : replicationLagMaxSeconds_; + } else { + return replicationLagMaxSecondsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReplicationLagMaxSeconds(com.google.protobuf.Int32Value value) { + if (replicationLagMaxSecondsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replicationLagMaxSeconds_ = value; + } else { + replicationLagMaxSecondsBuilder_.setMessage(value); + } + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReplicationLagMaxSeconds( + com.google.protobuf.Int32Value.Builder builderForValue) { + if (replicationLagMaxSecondsBuilder_ == null) { + replicationLagMaxSeconds_ = builderForValue.build(); + } else { + replicationLagMaxSecondsBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeReplicationLagMaxSeconds(com.google.protobuf.Int32Value value) { + if (replicationLagMaxSecondsBuilder_ == null) { + if (((bitField1_ & 0x00000001) != 0) + && replicationLagMaxSeconds_ != null + && replicationLagMaxSeconds_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getReplicationLagMaxSecondsBuilder().mergeFrom(value); + } else { + replicationLagMaxSeconds_ = value; + } + } else { + replicationLagMaxSecondsBuilder_.mergeFrom(value); + } + if (replicationLagMaxSeconds_ != null) { + bitField1_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearReplicationLagMaxSeconds() { + bitField1_ = (bitField1_ & ~0x00000001); + replicationLagMaxSeconds_ = null; + if (replicationLagMaxSecondsBuilder_ != null) { + replicationLagMaxSecondsBuilder_.dispose(); + replicationLagMaxSecondsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Int32Value.Builder getReplicationLagMaxSecondsBuilder() { + bitField1_ |= 0x00000001; + onChanged(); + return internalGetReplicationLagMaxSecondsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Int32ValueOrBuilder getReplicationLagMaxSecondsOrBuilder() { + if (replicationLagMaxSecondsBuilder_ != null) { + return replicationLagMaxSecondsBuilder_.getMessageOrBuilder(); + } else { + return replicationLagMaxSeconds_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : replicationLagMaxSeconds_; + } + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetReplicationLagMaxSecondsFieldBuilder() { + if (replicationLagMaxSecondsBuilder_ == null) { + replicationLagMaxSecondsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getReplicationLagMaxSeconds(), getParentForChildren(), isClean()); + replicationLagMaxSeconds_ = null; + } + return replicationLagMaxSecondsBuilder_; + } + + private com.google.protobuf.BoolValue enableGoogleMlIntegration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + enableGoogleMlIntegrationBuilder_; + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enableGoogleMlIntegration field is set. + */ + public boolean hasEnableGoogleMlIntegration() { + return ((bitField1_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enableGoogleMlIntegration. + */ + public com.google.protobuf.BoolValue getEnableGoogleMlIntegration() { + if (enableGoogleMlIntegrationBuilder_ == null) { + return enableGoogleMlIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableGoogleMlIntegration_; + } else { + return enableGoogleMlIntegrationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEnableGoogleMlIntegration(com.google.protobuf.BoolValue value) { + if (enableGoogleMlIntegrationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enableGoogleMlIntegration_ = value; + } else { + enableGoogleMlIntegrationBuilder_.setMessage(value); + } + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEnableGoogleMlIntegration( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (enableGoogleMlIntegrationBuilder_ == null) { + enableGoogleMlIntegration_ = builderForValue.build(); + } else { + enableGoogleMlIntegrationBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEnableGoogleMlIntegration(com.google.protobuf.BoolValue value) { + if (enableGoogleMlIntegrationBuilder_ == null) { + if (((bitField1_ & 0x00000002) != 0) + && enableGoogleMlIntegration_ != null + && enableGoogleMlIntegration_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getEnableGoogleMlIntegrationBuilder().mergeFrom(value); + } else { + enableGoogleMlIntegration_ = value; + } + } else { + enableGoogleMlIntegrationBuilder_.mergeFrom(value); + } + if (enableGoogleMlIntegration_ != null) { + bitField1_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEnableGoogleMlIntegration() { + bitField1_ = (bitField1_ & ~0x00000002); + enableGoogleMlIntegration_ = null; + if (enableGoogleMlIntegrationBuilder_ != null) { + enableGoogleMlIntegrationBuilder_.dispose(); + enableGoogleMlIntegrationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getEnableGoogleMlIntegrationBuilder() { + bitField1_ |= 0x00000002; + onChanged(); + return internalGetEnableGoogleMlIntegrationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getEnableGoogleMlIntegrationOrBuilder() { + if (enableGoogleMlIntegrationBuilder_ != null) { + return enableGoogleMlIntegrationBuilder_.getMessageOrBuilder(); + } else { + return enableGoogleMlIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableGoogleMlIntegration_; + } + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetEnableGoogleMlIntegrationFieldBuilder() { + if (enableGoogleMlIntegrationBuilder_ == null) { + enableGoogleMlIntegrationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getEnableGoogleMlIntegration(), getParentForChildren(), isClean()); + enableGoogleMlIntegration_ = null; + } + return enableGoogleMlIntegrationBuilder_; + } + + private com.google.protobuf.BoolValue enableDataplexIntegration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + enableDataplexIntegrationBuilder_; + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enableDataplexIntegration field is set. + */ + public boolean hasEnableDataplexIntegration() { + return ((bitField1_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enableDataplexIntegration. + */ + public com.google.protobuf.BoolValue getEnableDataplexIntegration() { + if (enableDataplexIntegrationBuilder_ == null) { + return enableDataplexIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableDataplexIntegration_; + } else { + return enableDataplexIntegrationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEnableDataplexIntegration(com.google.protobuf.BoolValue value) { + if (enableDataplexIntegrationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enableDataplexIntegration_ = value; + } else { + enableDataplexIntegrationBuilder_.setMessage(value); + } + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEnableDataplexIntegration( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (enableDataplexIntegrationBuilder_ == null) { + enableDataplexIntegration_ = builderForValue.build(); + } else { + enableDataplexIntegrationBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEnableDataplexIntegration(com.google.protobuf.BoolValue value) { + if (enableDataplexIntegrationBuilder_ == null) { + if (((bitField1_ & 0x00000004) != 0) + && enableDataplexIntegration_ != null + && enableDataplexIntegration_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getEnableDataplexIntegrationBuilder().mergeFrom(value); + } else { + enableDataplexIntegration_ = value; + } + } else { + enableDataplexIntegrationBuilder_.mergeFrom(value); + } + if (enableDataplexIntegration_ != null) { + bitField1_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEnableDataplexIntegration() { + bitField1_ = (bitField1_ & ~0x00000004); + enableDataplexIntegration_ = null; + if (enableDataplexIntegrationBuilder_ != null) { + enableDataplexIntegrationBuilder_.dispose(); + enableDataplexIntegrationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getEnableDataplexIntegrationBuilder() { + bitField1_ |= 0x00000004; + onChanged(); + return internalGetEnableDataplexIntegrationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getEnableDataplexIntegrationOrBuilder() { + if (enableDataplexIntegrationBuilder_ != null) { + return enableDataplexIntegrationBuilder_.getMessageOrBuilder(); + } else { + return enableDataplexIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableDataplexIntegration_; + } + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetEnableDataplexIntegrationFieldBuilder() { + if (enableDataplexIntegrationBuilder_ == null) { + enableDataplexIntegrationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getEnableDataplexIntegration(), getParentForChildren(), isClean()); + enableDataplexIntegration_ = null; + } + return enableDataplexIntegrationBuilder_; + } + + private com.google.protobuf.BoolValue retainBackupsOnDelete_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + retainBackupsOnDeleteBuilder_; + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the retainBackupsOnDelete field is set. + */ + public boolean hasRetainBackupsOnDelete() { + return ((bitField1_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retainBackupsOnDelete. + */ + public com.google.protobuf.BoolValue getRetainBackupsOnDelete() { + if (retainBackupsOnDeleteBuilder_ == null) { + return retainBackupsOnDelete_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : retainBackupsOnDelete_; + } else { + return retainBackupsOnDeleteBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRetainBackupsOnDelete(com.google.protobuf.BoolValue value) { + if (retainBackupsOnDeleteBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retainBackupsOnDelete_ = value; + } else { + retainBackupsOnDeleteBuilder_.setMessage(value); + } + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRetainBackupsOnDelete(com.google.protobuf.BoolValue.Builder builderForValue) { + if (retainBackupsOnDeleteBuilder_ == null) { + retainBackupsOnDelete_ = builderForValue.build(); + } else { + retainBackupsOnDeleteBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRetainBackupsOnDelete(com.google.protobuf.BoolValue value) { + if (retainBackupsOnDeleteBuilder_ == null) { + if (((bitField1_ & 0x00000008) != 0) + && retainBackupsOnDelete_ != null + && retainBackupsOnDelete_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getRetainBackupsOnDeleteBuilder().mergeFrom(value); + } else { + retainBackupsOnDelete_ = value; + } + } else { + retainBackupsOnDeleteBuilder_.mergeFrom(value); + } + if (retainBackupsOnDelete_ != null) { + bitField1_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRetainBackupsOnDelete() { + bitField1_ = (bitField1_ & ~0x00000008); + retainBackupsOnDelete_ = null; + if (retainBackupsOnDeleteBuilder_ != null) { + retainBackupsOnDeleteBuilder_.dispose(); + retainBackupsOnDeleteBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getRetainBackupsOnDeleteBuilder() { + bitField1_ |= 0x00000008; + onChanged(); + return internalGetRetainBackupsOnDeleteFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getRetainBackupsOnDeleteOrBuilder() { + if (retainBackupsOnDeleteBuilder_ != null) { + return retainBackupsOnDeleteBuilder_.getMessageOrBuilder(); + } else { + return retainBackupsOnDelete_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : retainBackupsOnDelete_; + } + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetRetainBackupsOnDeleteFieldBuilder() { + if (retainBackupsOnDeleteBuilder_ == null) { + retainBackupsOnDeleteBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getRetainBackupsOnDelete(), getParentForChildren(), isClean()); + retainBackupsOnDelete_ = null; + } + return retainBackupsOnDeleteBuilder_; + } + + private long dataDiskProvisionedIops_; + + /** + * + * + *
+     * Optional. Provisioned number of I/O operations per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataDiskProvisionedIops field is set. + */ + @java.lang.Override + public boolean hasDataDiskProvisionedIops() { + return ((bitField1_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. Provisioned number of I/O operations per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataDiskProvisionedIops. + */ + @java.lang.Override + public long getDataDiskProvisionedIops() { + return dataDiskProvisionedIops_; + } + + /** + * + * + *
+     * Optional. Provisioned number of I/O operations per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The dataDiskProvisionedIops to set. + * @return This builder for chaining. + */ + public Builder setDataDiskProvisionedIops(long value) { + + dataDiskProvisionedIops_ = value; + bitField1_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Provisioned number of I/O operations per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearDataDiskProvisionedIops() { + bitField1_ = (bitField1_ & ~0x00000010); + dataDiskProvisionedIops_ = 0L; + onChanged(); + return this; + } + + private long dataDiskProvisionedThroughput_; + + /** + * + * + *
+     * Optional. Provisioned throughput measured in MiB per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataDiskProvisionedThroughput field is set. + */ + @java.lang.Override + public boolean hasDataDiskProvisionedThroughput() { + return ((bitField1_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. Provisioned throughput measured in MiB per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataDiskProvisionedThroughput. + */ + @java.lang.Override + public long getDataDiskProvisionedThroughput() { + return dataDiskProvisionedThroughput_; + } + + /** + * + * + *
+     * Optional. Provisioned throughput measured in MiB per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The dataDiskProvisionedThroughput to set. + * @return This builder for chaining. + */ + public Builder setDataDiskProvisionedThroughput(long value) { + + dataDiskProvisionedThroughput_ = value; + bitField1_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Provisioned throughput measured in MiB per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearDataDiskProvisionedThroughput() { + bitField1_ = (bitField1_ & ~0x00000020); + dataDiskProvisionedThroughput_ = 0L; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.ConnectionPoolConfig connectionPoolConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ConnectionPoolConfig, + com.google.cloud.sql.v1.ConnectionPoolConfig.Builder, + com.google.cloud.sql.v1.ConnectionPoolConfigOrBuilder> + connectionPoolConfigBuilder_; + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the connectionPoolConfig field is set. + */ + public boolean hasConnectionPoolConfig() { + return ((bitField1_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The connectionPoolConfig. + */ + public com.google.cloud.sql.v1.ConnectionPoolConfig getConnectionPoolConfig() { + if (connectionPoolConfigBuilder_ == null) { + return connectionPoolConfig_ == null + ? com.google.cloud.sql.v1.ConnectionPoolConfig.getDefaultInstance() + : connectionPoolConfig_; + } else { + return connectionPoolConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setConnectionPoolConfig(com.google.cloud.sql.v1.ConnectionPoolConfig value) { + if (connectionPoolConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connectionPoolConfig_ = value; + } else { + connectionPoolConfigBuilder_.setMessage(value); + } + bitField1_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setConnectionPoolConfig( + com.google.cloud.sql.v1.ConnectionPoolConfig.Builder builderForValue) { + if (connectionPoolConfigBuilder_ == null) { + connectionPoolConfig_ = builderForValue.build(); + } else { + connectionPoolConfigBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeConnectionPoolConfig(com.google.cloud.sql.v1.ConnectionPoolConfig value) { + if (connectionPoolConfigBuilder_ == null) { + if (((bitField1_ & 0x00000040) != 0) + && connectionPoolConfig_ != null + && connectionPoolConfig_ + != com.google.cloud.sql.v1.ConnectionPoolConfig.getDefaultInstance()) { + getConnectionPoolConfigBuilder().mergeFrom(value); + } else { + connectionPoolConfig_ = value; + } + } else { + connectionPoolConfigBuilder_.mergeFrom(value); + } + if (connectionPoolConfig_ != null) { + bitField1_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearConnectionPoolConfig() { + bitField1_ = (bitField1_ & ~0x00000040); + connectionPoolConfig_ = null; + if (connectionPoolConfigBuilder_ != null) { + connectionPoolConfigBuilder_.dispose(); + connectionPoolConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ConnectionPoolConfig.Builder getConnectionPoolConfigBuilder() { + bitField1_ |= 0x00000040; + onChanged(); + return internalGetConnectionPoolConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ConnectionPoolConfigOrBuilder + getConnectionPoolConfigOrBuilder() { + if (connectionPoolConfigBuilder_ != null) { + return connectionPoolConfigBuilder_.getMessageOrBuilder(); + } else { + return connectionPoolConfig_ == null + ? com.google.cloud.sql.v1.ConnectionPoolConfig.getDefaultInstance() + : connectionPoolConfig_; + } + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ConnectionPoolConfig, + com.google.cloud.sql.v1.ConnectionPoolConfig.Builder, + com.google.cloud.sql.v1.ConnectionPoolConfigOrBuilder> + internalGetConnectionPoolConfigFieldBuilder() { + if (connectionPoolConfigBuilder_ == null) { + connectionPoolConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ConnectionPoolConfig, + com.google.cloud.sql.v1.ConnectionPoolConfig.Builder, + com.google.cloud.sql.v1.ConnectionPoolConfigOrBuilder>( + getConnectionPoolConfig(), getParentForChildren(), isClean()); + connectionPoolConfig_ = null; + } + return connectionPoolConfigBuilder_; + } + + private com.google.cloud.sql.v1.FinalBackupConfig finalBackupConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.FinalBackupConfig, + com.google.cloud.sql.v1.FinalBackupConfig.Builder, + com.google.cloud.sql.v1.FinalBackupConfigOrBuilder> + finalBackupConfigBuilder_; + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the finalBackupConfig field is set. + */ + public boolean hasFinalBackupConfig() { + return ((bitField1_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The finalBackupConfig. + */ + public com.google.cloud.sql.v1.FinalBackupConfig getFinalBackupConfig() { + if (finalBackupConfigBuilder_ == null) { + return finalBackupConfig_ == null + ? com.google.cloud.sql.v1.FinalBackupConfig.getDefaultInstance() + : finalBackupConfig_; + } else { + return finalBackupConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFinalBackupConfig(com.google.cloud.sql.v1.FinalBackupConfig value) { + if (finalBackupConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finalBackupConfig_ = value; + } else { + finalBackupConfigBuilder_.setMessage(value); + } + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFinalBackupConfig( + com.google.cloud.sql.v1.FinalBackupConfig.Builder builderForValue) { + if (finalBackupConfigBuilder_ == null) { + finalBackupConfig_ = builderForValue.build(); + } else { + finalBackupConfigBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFinalBackupConfig(com.google.cloud.sql.v1.FinalBackupConfig value) { + if (finalBackupConfigBuilder_ == null) { + if (((bitField1_ & 0x00000080) != 0) + && finalBackupConfig_ != null + && finalBackupConfig_ + != com.google.cloud.sql.v1.FinalBackupConfig.getDefaultInstance()) { + getFinalBackupConfigBuilder().mergeFrom(value); + } else { + finalBackupConfig_ = value; + } + } else { + finalBackupConfigBuilder_.mergeFrom(value); + } + if (finalBackupConfig_ != null) { + bitField1_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFinalBackupConfig() { + bitField1_ = (bitField1_ & ~0x00000080); + finalBackupConfig_ = null; + if (finalBackupConfigBuilder_ != null) { + finalBackupConfigBuilder_.dispose(); + finalBackupConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.FinalBackupConfig.Builder getFinalBackupConfigBuilder() { + bitField1_ |= 0x00000080; + onChanged(); + return internalGetFinalBackupConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.FinalBackupConfigOrBuilder getFinalBackupConfigOrBuilder() { + if (finalBackupConfigBuilder_ != null) { + return finalBackupConfigBuilder_.getMessageOrBuilder(); + } else { + return finalBackupConfig_ == null + ? com.google.cloud.sql.v1.FinalBackupConfig.getDefaultInstance() + : finalBackupConfig_; + } + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.FinalBackupConfig, + com.google.cloud.sql.v1.FinalBackupConfig.Builder, + com.google.cloud.sql.v1.FinalBackupConfigOrBuilder> + internalGetFinalBackupConfigFieldBuilder() { + if (finalBackupConfigBuilder_ == null) { + finalBackupConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.FinalBackupConfig, + com.google.cloud.sql.v1.FinalBackupConfig.Builder, + com.google.cloud.sql.v1.FinalBackupConfigOrBuilder>( + getFinalBackupConfig(), getParentForChildren(), isClean()); + finalBackupConfig_ = null; + } + return finalBackupConfigBuilder_; + } + + private com.google.cloud.sql.v1.ReadPoolAutoScaleConfig readPoolAutoScaleConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.Builder, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfigOrBuilder> + readPoolAutoScaleConfigBuilder_; + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readPoolAutoScaleConfig field is set. + */ + public boolean hasReadPoolAutoScaleConfig() { + return ((bitField1_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readPoolAutoScaleConfig. + */ + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig getReadPoolAutoScaleConfig() { + if (readPoolAutoScaleConfigBuilder_ == null) { + return readPoolAutoScaleConfig_ == null + ? com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.getDefaultInstance() + : readPoolAutoScaleConfig_; + } else { + return readPoolAutoScaleConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadPoolAutoScaleConfig( + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig value) { + if (readPoolAutoScaleConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readPoolAutoScaleConfig_ = value; + } else { + readPoolAutoScaleConfigBuilder_.setMessage(value); + } + bitField1_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadPoolAutoScaleConfig( + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.Builder builderForValue) { + if (readPoolAutoScaleConfigBuilder_ == null) { + readPoolAutoScaleConfig_ = builderForValue.build(); + } else { + readPoolAutoScaleConfigBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeReadPoolAutoScaleConfig( + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig value) { + if (readPoolAutoScaleConfigBuilder_ == null) { + if (((bitField1_ & 0x00000100) != 0) + && readPoolAutoScaleConfig_ != null + && readPoolAutoScaleConfig_ + != com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.getDefaultInstance()) { + getReadPoolAutoScaleConfigBuilder().mergeFrom(value); + } else { + readPoolAutoScaleConfig_ = value; + } + } else { + readPoolAutoScaleConfigBuilder_.mergeFrom(value); + } + if (readPoolAutoScaleConfig_ != null) { + bitField1_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearReadPoolAutoScaleConfig() { + bitField1_ = (bitField1_ & ~0x00000100); + readPoolAutoScaleConfig_ = null; + if (readPoolAutoScaleConfigBuilder_ != null) { + readPoolAutoScaleConfigBuilder_.dispose(); + readPoolAutoScaleConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.Builder + getReadPoolAutoScaleConfigBuilder() { + bitField1_ |= 0x00000100; + onChanged(); + return internalGetReadPoolAutoScaleConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ReadPoolAutoScaleConfigOrBuilder + getReadPoolAutoScaleConfigOrBuilder() { + if (readPoolAutoScaleConfigBuilder_ != null) { + return readPoolAutoScaleConfigBuilder_.getMessageOrBuilder(); + } else { + return readPoolAutoScaleConfig_ == null + ? com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.getDefaultInstance() + : readPoolAutoScaleConfig_; + } + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.Builder, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfigOrBuilder> + internalGetReadPoolAutoScaleConfigFieldBuilder() { + if (readPoolAutoScaleConfigBuilder_ == null) { + readPoolAutoScaleConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig.Builder, + com.google.cloud.sql.v1.ReadPoolAutoScaleConfigOrBuilder>( + getReadPoolAutoScaleConfig(), getParentForChildren(), isClean()); + readPoolAutoScaleConfig_ = null; + } + return readPoolAutoScaleConfigBuilder_; + } + + private com.google.protobuf.BoolValue acceleratedReplicaMode_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + acceleratedReplicaModeBuilder_; + + /** + * + * + *
+     * Optional. Whether the replica is in accelerated mode. This feature is in
+     * private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the acceleratedReplicaMode field is set. + */ + public boolean hasAcceleratedReplicaMode() { + return ((bitField1_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Optional. Whether the replica is in accelerated mode. This feature is in
+     * private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The acceleratedReplicaMode. + */ + public com.google.protobuf.BoolValue getAcceleratedReplicaMode() { + if (acceleratedReplicaModeBuilder_ == null) { + return acceleratedReplicaMode_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : acceleratedReplicaMode_; + } else { + return acceleratedReplicaModeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Whether the replica is in accelerated mode. This feature is in
+     * private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setAcceleratedReplicaMode(com.google.protobuf.BoolValue value) { + if (acceleratedReplicaModeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + acceleratedReplicaMode_ = value; + } else { + acceleratedReplicaModeBuilder_.setMessage(value); + } + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Whether the replica is in accelerated mode. This feature is in
+     * private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setAcceleratedReplicaMode( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (acceleratedReplicaModeBuilder_ == null) { + acceleratedReplicaMode_ = builderForValue.build(); + } else { + acceleratedReplicaModeBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Whether the replica is in accelerated mode. This feature is in
+     * private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeAcceleratedReplicaMode(com.google.protobuf.BoolValue value) { + if (acceleratedReplicaModeBuilder_ == null) { + if (((bitField1_ & 0x00000200) != 0) + && acceleratedReplicaMode_ != null + && acceleratedReplicaMode_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getAcceleratedReplicaModeBuilder().mergeFrom(value); + } else { + acceleratedReplicaMode_ = value; + } + } else { + acceleratedReplicaModeBuilder_.mergeFrom(value); + } + if (acceleratedReplicaMode_ != null) { + bitField1_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Whether the replica is in accelerated mode. This feature is in
+     * private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearAcceleratedReplicaMode() { + bitField1_ = (bitField1_ & ~0x00000200); + acceleratedReplicaMode_ = null; + if (acceleratedReplicaModeBuilder_ != null) { + acceleratedReplicaModeBuilder_.dispose(); + acceleratedReplicaModeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Whether the replica is in accelerated mode. This feature is in
+     * private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getAcceleratedReplicaModeBuilder() { + bitField1_ |= 0x00000200; + onChanged(); + return internalGetAcceleratedReplicaModeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Whether the replica is in accelerated mode. This feature is in
+     * private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getAcceleratedReplicaModeOrBuilder() { + if (acceleratedReplicaModeBuilder_ != null) { + return acceleratedReplicaModeBuilder_.getMessageOrBuilder(); + } else { + return acceleratedReplicaMode_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : acceleratedReplicaMode_; + } + } + + /** + * + * + *
+     * Optional. Whether the replica is in accelerated mode. This feature is in
+     * private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetAcceleratedReplicaModeFieldBuilder() { + if (acceleratedReplicaModeBuilder_ == null) { + acceleratedReplicaModeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getAcceleratedReplicaMode(), getParentForChildren(), isClean()); + acceleratedReplicaMode_ = null; + } + return acceleratedReplicaModeBuilder_; + } + + private boolean autoUpgradeEnabled_; + + /** + * + * + *
+     * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+     * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+     * versions. The MySQL version must be 8.0.35 or higher.
+     * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the autoUpgradeEnabled field is set. + */ + @java.lang.Override + public boolean hasAutoUpgradeEnabled() { + return ((bitField1_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+     * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+     * versions. The MySQL version must be 8.0.35 or higher.
+     * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The autoUpgradeEnabled. + */ + @java.lang.Override + public boolean getAutoUpgradeEnabled() { + return autoUpgradeEnabled_; + } + + /** + * + * + *
+     * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+     * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+     * versions. The MySQL version must be 8.0.35 or higher.
+     * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The autoUpgradeEnabled to set. + * @return This builder for chaining. + */ + public Builder setAutoUpgradeEnabled(boolean value) { + + autoUpgradeEnabled_ = value; + bitField1_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+     * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+     * versions. The MySQL version must be 8.0.35 or higher.
+     * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearAutoUpgradeEnabled() { + bitField1_ = (bitField1_ & ~0x00000400); + autoUpgradeEnabled_ = false; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.SqlServerEntraIdConfig entraidConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlServerEntraIdConfig, + com.google.cloud.sql.v1.SqlServerEntraIdConfig.Builder, + com.google.cloud.sql.v1.SqlServerEntraIdConfigOrBuilder> + entraidConfigBuilder_; + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the entraidConfig field is set. + */ + public boolean hasEntraidConfig() { + return ((bitField1_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The entraidConfig. + */ + public com.google.cloud.sql.v1.SqlServerEntraIdConfig getEntraidConfig() { + if (entraidConfigBuilder_ == null) { + return entraidConfig_ == null + ? com.google.cloud.sql.v1.SqlServerEntraIdConfig.getDefaultInstance() + : entraidConfig_; + } else { + return entraidConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEntraidConfig(com.google.cloud.sql.v1.SqlServerEntraIdConfig value) { + if (entraidConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + entraidConfig_ = value; + } else { + entraidConfigBuilder_.setMessage(value); + } + bitField1_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEntraidConfig( + com.google.cloud.sql.v1.SqlServerEntraIdConfig.Builder builderForValue) { + if (entraidConfigBuilder_ == null) { + entraidConfig_ = builderForValue.build(); + } else { + entraidConfigBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEntraidConfig(com.google.cloud.sql.v1.SqlServerEntraIdConfig value) { + if (entraidConfigBuilder_ == null) { + if (((bitField1_ & 0x00000800) != 0) + && entraidConfig_ != null + && entraidConfig_ + != com.google.cloud.sql.v1.SqlServerEntraIdConfig.getDefaultInstance()) { + getEntraidConfigBuilder().mergeFrom(value); + } else { + entraidConfig_ = value; + } + } else { + entraidConfigBuilder_.mergeFrom(value); + } + if (entraidConfig_ != null) { + bitField1_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEntraidConfig() { + bitField1_ = (bitField1_ & ~0x00000800); + entraidConfig_ = null; + if (entraidConfigBuilder_ != null) { + entraidConfigBuilder_.dispose(); + entraidConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.SqlServerEntraIdConfig.Builder getEntraidConfigBuilder() { + bitField1_ |= 0x00000800; + onChanged(); + return internalGetEntraidConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.SqlServerEntraIdConfigOrBuilder getEntraidConfigOrBuilder() { + if (entraidConfigBuilder_ != null) { + return entraidConfigBuilder_.getMessageOrBuilder(); + } else { + return entraidConfig_ == null + ? com.google.cloud.sql.v1.SqlServerEntraIdConfig.getDefaultInstance() + : entraidConfig_; + } + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlServerEntraIdConfig, + com.google.cloud.sql.v1.SqlServerEntraIdConfig.Builder, + com.google.cloud.sql.v1.SqlServerEntraIdConfigOrBuilder> + internalGetEntraidConfigFieldBuilder() { + if (entraidConfigBuilder_ == null) { + entraidConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlServerEntraIdConfig, + com.google.cloud.sql.v1.SqlServerEntraIdConfig.Builder, + com.google.cloud.sql.v1.SqlServerEntraIdConfigOrBuilder>( + getEntraidConfig(), getParentForChildren(), isClean()); + entraidConfig_ = null; + } + return entraidConfigBuilder_; + } + + private int dataApiAccess_ = 0; + + /** + * + * + *
+     * This parameter controls whether to allow using ExecuteSql API to connect to
+     * the instance. Not allowed by default.
+     * 
+ * + * optional .google.cloud.sql.v1.Settings.DataApiAccess data_api_access = 53; + * + * @return Whether the dataApiAccess field is set. + */ + @java.lang.Override + public boolean hasDataApiAccess() { + return ((bitField1_ & 0x00001000) != 0); + } + + /** + * + * + *
+     * This parameter controls whether to allow using ExecuteSql API to connect to
+     * the instance. Not allowed by default.
+     * 
+ * + * optional .google.cloud.sql.v1.Settings.DataApiAccess data_api_access = 53; + * + * @return The enum numeric value on the wire for dataApiAccess. + */ + @java.lang.Override + public int getDataApiAccessValue() { + return dataApiAccess_; + } + + /** + * + * + *
+     * This parameter controls whether to allow using ExecuteSql API to connect to
+     * the instance. Not allowed by default.
+     * 
+ * + * optional .google.cloud.sql.v1.Settings.DataApiAccess data_api_access = 53; + * + * @param value The enum numeric value on the wire for dataApiAccess to set. + * @return This builder for chaining. + */ + public Builder setDataApiAccessValue(int value) { + dataApiAccess_ = value; + bitField1_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * This parameter controls whether to allow using ExecuteSql API to connect to
+     * the instance. Not allowed by default.
+     * 
+ * + * optional .google.cloud.sql.v1.Settings.DataApiAccess data_api_access = 53; + * + * @return The dataApiAccess. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Settings.DataApiAccess getDataApiAccess() { + com.google.cloud.sql.v1.Settings.DataApiAccess result = + com.google.cloud.sql.v1.Settings.DataApiAccess.forNumber(dataApiAccess_); + return result == null ? com.google.cloud.sql.v1.Settings.DataApiAccess.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * This parameter controls whether to allow using ExecuteSql API to connect to
+     * the instance. Not allowed by default.
+     * 
+ * + * optional .google.cloud.sql.v1.Settings.DataApiAccess data_api_access = 53; + * + * @param value The dataApiAccess to set. + * @return This builder for chaining. + */ + public Builder setDataApiAccess(com.google.cloud.sql.v1.Settings.DataApiAccess value) { + if (value == null) { + throw new NullPointerException(); + } + bitField1_ |= 0x00001000; + dataApiAccess_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * This parameter controls whether to allow using ExecuteSql API to connect to
+     * the instance. Not allowed by default.
+     * 
+ * + * optional .google.cloud.sql.v1.Settings.DataApiAccess data_api_access = 53; + * + * @return This builder for chaining. + */ + public Builder clearDataApiAccess() { + bitField1_ = (bitField1_ & ~0x00001000); + dataApiAccess_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.PerformanceCaptureConfig performanceCaptureConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PerformanceCaptureConfig, + com.google.cloud.sql.v1.PerformanceCaptureConfig.Builder, + com.google.cloud.sql.v1.PerformanceCaptureConfigOrBuilder> + performanceCaptureConfigBuilder_; + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the performanceCaptureConfig field is set. + */ + public boolean hasPerformanceCaptureConfig() { + return ((bitField1_ & 0x00002000) != 0); + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The performanceCaptureConfig. + */ + public com.google.cloud.sql.v1.PerformanceCaptureConfig getPerformanceCaptureConfig() { + if (performanceCaptureConfigBuilder_ == null) { + return performanceCaptureConfig_ == null + ? com.google.cloud.sql.v1.PerformanceCaptureConfig.getDefaultInstance() + : performanceCaptureConfig_; + } else { + return performanceCaptureConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPerformanceCaptureConfig( + com.google.cloud.sql.v1.PerformanceCaptureConfig value) { + if (performanceCaptureConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + performanceCaptureConfig_ = value; + } else { + performanceCaptureConfigBuilder_.setMessage(value); + } + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPerformanceCaptureConfig( + com.google.cloud.sql.v1.PerformanceCaptureConfig.Builder builderForValue) { + if (performanceCaptureConfigBuilder_ == null) { + performanceCaptureConfig_ = builderForValue.build(); + } else { + performanceCaptureConfigBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergePerformanceCaptureConfig( + com.google.cloud.sql.v1.PerformanceCaptureConfig value) { + if (performanceCaptureConfigBuilder_ == null) { + if (((bitField1_ & 0x00002000) != 0) + && performanceCaptureConfig_ != null + && performanceCaptureConfig_ + != com.google.cloud.sql.v1.PerformanceCaptureConfig.getDefaultInstance()) { + getPerformanceCaptureConfigBuilder().mergeFrom(value); + } else { + performanceCaptureConfig_ = value; + } + } else { + performanceCaptureConfigBuilder_.mergeFrom(value); + } + if (performanceCaptureConfig_ != null) { + bitField1_ |= 0x00002000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPerformanceCaptureConfig() { + bitField1_ = (bitField1_ & ~0x00002000); + performanceCaptureConfig_ = null; + if (performanceCaptureConfigBuilder_ != null) { + performanceCaptureConfigBuilder_.dispose(); + performanceCaptureConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.PerformanceCaptureConfig.Builder + getPerformanceCaptureConfigBuilder() { + bitField1_ |= 0x00002000; + onChanged(); + return internalGetPerformanceCaptureConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.PerformanceCaptureConfigOrBuilder + getPerformanceCaptureConfigOrBuilder() { + if (performanceCaptureConfigBuilder_ != null) { + return performanceCaptureConfigBuilder_.getMessageOrBuilder(); + } else { + return performanceCaptureConfig_ == null + ? com.google.cloud.sql.v1.PerformanceCaptureConfig.getDefaultInstance() + : performanceCaptureConfig_; + } + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PerformanceCaptureConfig, + com.google.cloud.sql.v1.PerformanceCaptureConfig.Builder, + com.google.cloud.sql.v1.PerformanceCaptureConfigOrBuilder> + internalGetPerformanceCaptureConfigFieldBuilder() { + if (performanceCaptureConfigBuilder_ == null) { + performanceCaptureConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PerformanceCaptureConfig, + com.google.cloud.sql.v1.PerformanceCaptureConfig.Builder, + com.google.cloud.sql.v1.PerformanceCaptureConfigOrBuilder>( + getPerformanceCaptureConfig(), getParentForChildren(), isClean()); + performanceCaptureConfig_ = null; + } + return performanceCaptureConfigBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.Settings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.Settings) + private static final com.google.cloud.sql.v1.Settings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.Settings(); + } + + public static com.google.cloud.sql.v1.Settings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Settings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Settings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SettingsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SettingsOrBuilder.java new file mode 100644 index 000000000000..e25060f01b08 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SettingsOrBuilder.java @@ -0,0 +1,1911 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.Settings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The version of instance settings. This is a required field for update
+   * method to make sure concurrent updates are handled properly. During update,
+   * use the most recent settingsVersion value for this instance and do not try
+   * to update this value.
+   * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + * + * @return Whether the settingsVersion field is set. + */ + boolean hasSettingsVersion(); + + /** + * + * + *
+   * The version of instance settings. This is a required field for update
+   * method to make sure concurrent updates are handled properly. During update,
+   * use the most recent settingsVersion value for this instance and do not try
+   * to update this value.
+   * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + * + * @return The settingsVersion. + */ + com.google.protobuf.Int64Value getSettingsVersion(); + + /** + * + * + *
+   * The version of instance settings. This is a required field for update
+   * method to make sure concurrent updates are handled properly. During update,
+   * use the most recent settingsVersion value for this instance and do not try
+   * to update this value.
+   * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + com.google.protobuf.Int64ValueOrBuilder getSettingsVersionOrBuilder(); + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @return A list containing the authorizedGaeApplications. + */ + @java.lang.Deprecated + java.util.List getAuthorizedGaeApplicationsList(); + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @return The count of authorizedGaeApplications. + */ + @java.lang.Deprecated + int getAuthorizedGaeApplicationsCount(); + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @param index The index of the element to return. + * @return The authorizedGaeApplications at the given index. + */ + @java.lang.Deprecated + java.lang.String getAuthorizedGaeApplications(int index); + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1662 + * @param index The index of the value to return. + * @return The bytes of the authorizedGaeApplications at the given index. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getAuthorizedGaeApplicationsBytes(int index); + + /** + * + * + *
+   * The tier (or machine type) for this instance, for example
+   * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+   * 
+ * + * string tier = 3; + * + * @return The tier. + */ + java.lang.String getTier(); + + /** + * + * + *
+   * The tier (or machine type) for this instance, for example
+   * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+   * 
+ * + * string tier = 3; + * + * @return The bytes for tier. + */ + com.google.protobuf.ByteString getTierBytes(); + + /** + * + * + *
+   * This is always `sql#settings`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#settings`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + int getUserLabelsCount(); + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + boolean containsUserLabels(java.lang.String key); + + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getUserLabels(); + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + java.util.Map getUserLabelsMap(); + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + /* nullable */ + java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + java.lang.String getUserLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Availability type. Potential values:
+   * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+   * zone affect data accessibility.
+   * *  `REGIONAL`: The instance can serve data from more than one zone in a
+   * region (it is highly available)./
+   *
+   * For more information, see [Overview of the High Availability
+   * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+   * 
+ * + * .google.cloud.sql.v1.SqlAvailabilityType availability_type = 6; + * + * @return The enum numeric value on the wire for availabilityType. + */ + int getAvailabilityTypeValue(); + + /** + * + * + *
+   * Availability type. Potential values:
+   * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+   * zone affect data accessibility.
+   * *  `REGIONAL`: The instance can serve data from more than one zone in a
+   * region (it is highly available)./
+   *
+   * For more information, see [Overview of the High Availability
+   * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+   * 
+ * + * .google.cloud.sql.v1.SqlAvailabilityType availability_type = 6; + * + * @return The availabilityType. + */ + com.google.cloud.sql.v1.SqlAvailabilityType getAvailabilityType(); + + /** + * + * + *
+   * The pricing plan for this instance. This can be either `PER_USE` or
+   * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.SqlPricingPlan pricing_plan = 7; + * + * @return The enum numeric value on the wire for pricingPlan. + */ + int getPricingPlanValue(); + + /** + * + * + *
+   * The pricing plan for this instance. This can be either `PER_USE` or
+   * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.SqlPricingPlan pricing_plan = 7; + * + * @return The pricingPlan. + */ + com.google.cloud.sql.v1.SqlPricingPlan getPricingPlan(); + + /** + * + * + *
+   * The type of replication this instance uses. This can be either
+   * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+   * applicable to First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.replication_type is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1692 + * @return The enum numeric value on the wire for replicationType. + */ + @java.lang.Deprecated + int getReplicationTypeValue(); + + /** + * + * + *
+   * The type of replication this instance uses. This can be either
+   * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+   * applicable to First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.Settings.replication_type is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1692 + * @return The replicationType. + */ + @java.lang.Deprecated + com.google.cloud.sql.v1.SqlReplicationType getReplicationType(); + + /** + * + * + *
+   * The maximum size to which storage capacity can be automatically increased.
+   * The default value is 0, which specifies that there is no limit.
+   * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + * + * @return Whether the storageAutoResizeLimit field is set. + */ + boolean hasStorageAutoResizeLimit(); + + /** + * + * + *
+   * The maximum size to which storage capacity can be automatically increased.
+   * The default value is 0, which specifies that there is no limit.
+   * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + * + * @return The storageAutoResizeLimit. + */ + com.google.protobuf.Int64Value getStorageAutoResizeLimit(); + + /** + * + * + *
+   * The maximum size to which storage capacity can be automatically increased.
+   * The default value is 0, which specifies that there is no limit.
+   * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + com.google.protobuf.Int64ValueOrBuilder getStorageAutoResizeLimitOrBuilder(); + + /** + * + * + *
+   * The activation policy specifies when the instance is activated; it is
+   * applicable only when the instance state is RUNNABLE. Valid values:
+   * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+   * connection requests.
+   * *  `NEVER`: The instance is off; it is not activated, even if a
+   * connection request arrives.
+   * 
+ * + * .google.cloud.sql.v1.Settings.SqlActivationPolicy activation_policy = 10; + * + * @return The enum numeric value on the wire for activationPolicy. + */ + int getActivationPolicyValue(); + + /** + * + * + *
+   * The activation policy specifies when the instance is activated; it is
+   * applicable only when the instance state is RUNNABLE. Valid values:
+   * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+   * connection requests.
+   * *  `NEVER`: The instance is off; it is not activated, even if a
+   * connection request arrives.
+   * 
+ * + * .google.cloud.sql.v1.Settings.SqlActivationPolicy activation_policy = 10; + * + * @return The activationPolicy. + */ + com.google.cloud.sql.v1.Settings.SqlActivationPolicy getActivationPolicy(); + + /** + * + * + *
+   * The settings for IP Management. This allows to enable or disable the
+   * instance IP and manage which external networks can connect to the instance.
+   * The IPv4 address cannot be disabled for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + * + * @return Whether the ipConfiguration field is set. + */ + boolean hasIpConfiguration(); + + /** + * + * + *
+   * The settings for IP Management. This allows to enable or disable the
+   * instance IP and manage which external networks can connect to the instance.
+   * The IPv4 address cannot be disabled for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + * + * @return The ipConfiguration. + */ + com.google.cloud.sql.v1.IpConfiguration getIpConfiguration(); + + /** + * + * + *
+   * The settings for IP Management. This allows to enable or disable the
+   * instance IP and manage which external networks can connect to the instance.
+   * The IPv4 address cannot be disabled for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.IpConfiguration ip_configuration = 11; + */ + com.google.cloud.sql.v1.IpConfigurationOrBuilder getIpConfigurationOrBuilder(); + + /** + * + * + *
+   * Configuration to increase storage size automatically. The default value is
+   * true.
+   * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + * + * @return Whether the storageAutoResize field is set. + */ + boolean hasStorageAutoResize(); + + /** + * + * + *
+   * Configuration to increase storage size automatically. The default value is
+   * true.
+   * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + * + * @return The storageAutoResize. + */ + com.google.protobuf.BoolValue getStorageAutoResize(); + + /** + * + * + *
+   * Configuration to increase storage size automatically. The default value is
+   * true.
+   * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + com.google.protobuf.BoolValueOrBuilder getStorageAutoResizeOrBuilder(); + + /** + * + * + *
+   * The location preference settings. This allows the instance to be located as
+   * near as possible to either an App Engine app or Compute Engine zone for
+   * better performance. App Engine co-location was only applicable to First
+   * Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + * + * @return Whether the locationPreference field is set. + */ + boolean hasLocationPreference(); + + /** + * + * + *
+   * The location preference settings. This allows the instance to be located as
+   * near as possible to either an App Engine app or Compute Engine zone for
+   * better performance. App Engine co-location was only applicable to First
+   * Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + * + * @return The locationPreference. + */ + com.google.cloud.sql.v1.LocationPreference getLocationPreference(); + + /** + * + * + *
+   * The location preference settings. This allows the instance to be located as
+   * near as possible to either an App Engine app or Compute Engine zone for
+   * better performance. App Engine co-location was only applicable to First
+   * Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.LocationPreference location_preference = 13; + */ + com.google.cloud.sql.v1.LocationPreferenceOrBuilder getLocationPreferenceOrBuilder(); + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + java.util.List getDatabaseFlagsList(); + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + com.google.cloud.sql.v1.DatabaseFlags getDatabaseFlags(int index); + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + int getDatabaseFlagsCount(); + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + java.util.List + getDatabaseFlagsOrBuilderList(); + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1.DatabaseFlags database_flags = 14; + */ + com.google.cloud.sql.v1.DatabaseFlagsOrBuilder getDatabaseFlagsOrBuilder(int index); + + /** + * + * + *
+   * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+   * First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.SqlDataDiskType data_disk_type = 15; + * + * @return The enum numeric value on the wire for dataDiskType. + */ + int getDataDiskTypeValue(); + + /** + * + * + *
+   * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+   * First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1.SqlDataDiskType data_disk_type = 15; + * + * @return The dataDiskType. + */ + com.google.cloud.sql.v1.SqlDataDiskType getDataDiskType(); + + /** + * + * + *
+   * The maintenance window for this instance. This specifies when the instance
+   * can be restarted for maintenance purposes.
+   * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + * + * @return Whether the maintenanceWindow field is set. + */ + boolean hasMaintenanceWindow(); + + /** + * + * + *
+   * The maintenance window for this instance. This specifies when the instance
+   * can be restarted for maintenance purposes.
+   * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + * + * @return The maintenanceWindow. + */ + com.google.cloud.sql.v1.MaintenanceWindow getMaintenanceWindow(); + + /** + * + * + *
+   * The maintenance window for this instance. This specifies when the instance
+   * can be restarted for maintenance purposes.
+   * 
+ * + * .google.cloud.sql.v1.MaintenanceWindow maintenance_window = 16; + */ + com.google.cloud.sql.v1.MaintenanceWindowOrBuilder getMaintenanceWindowOrBuilder(); + + /** + * + * + *
+   * The daily backup configuration for the instance.
+   * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + * + * @return Whether the backupConfiguration field is set. + */ + boolean hasBackupConfiguration(); + + /** + * + * + *
+   * The daily backup configuration for the instance.
+   * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + * + * @return The backupConfiguration. + */ + com.google.cloud.sql.v1.BackupConfiguration getBackupConfiguration(); + + /** + * + * + *
+   * The daily backup configuration for the instance.
+   * 
+ * + * .google.cloud.sql.v1.BackupConfiguration backup_configuration = 17; + */ + com.google.cloud.sql.v1.BackupConfigurationOrBuilder getBackupConfigurationOrBuilder(); + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * replication is enabled or not. WARNING: Changing this restarts the
+   * instance.
+   * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + * + * @return Whether the databaseReplicationEnabled field is set. + */ + boolean hasDatabaseReplicationEnabled(); + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * replication is enabled or not. WARNING: Changing this restarts the
+   * instance.
+   * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + * + * @return The databaseReplicationEnabled. + */ + com.google.protobuf.BoolValue getDatabaseReplicationEnabled(); + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * replication is enabled or not. WARNING: Changing this restarts the
+   * instance.
+   * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + com.google.protobuf.BoolValueOrBuilder getDatabaseReplicationEnabledOrBuilder(); + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * database flags for crash-safe replication are enabled. This property was
+   * only applicable to First Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.Settings.crash_safe_replication_enabled is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1743 + * @return Whether the crashSafeReplicationEnabled field is set. + */ + @java.lang.Deprecated + boolean hasCrashSafeReplicationEnabled(); + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * database flags for crash-safe replication are enabled. This property was
+   * only applicable to First Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1.Settings.crash_safe_replication_enabled is deprecated. See + * google/cloud/sql/v1/cloud_sql_resources.proto;l=1743 + * @return The crashSafeReplicationEnabled. + */ + @java.lang.Deprecated + com.google.protobuf.BoolValue getCrashSafeReplicationEnabled(); + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * database flags for crash-safe replication are enabled. This property was
+   * only applicable to First Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Deprecated + com.google.protobuf.BoolValueOrBuilder getCrashSafeReplicationEnabledOrBuilder(); + + /** + * + * + *
+   * The size of data disk, in GB. The data disk size minimum is 10GB.
+   * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + * + * @return Whether the dataDiskSizeGb field is set. + */ + boolean hasDataDiskSizeGb(); + + /** + * + * + *
+   * The size of data disk, in GB. The data disk size minimum is 10GB.
+   * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + * + * @return The dataDiskSizeGb. + */ + com.google.protobuf.Int64Value getDataDiskSizeGb(); + + /** + * + * + *
+   * The size of data disk, in GB. The data disk size minimum is 10GB.
+   * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + com.google.protobuf.Int64ValueOrBuilder getDataDiskSizeGbOrBuilder(); + + /** + * + * + *
+   * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + * + * @return Whether the activeDirectoryConfig field is set. + */ + boolean hasActiveDirectoryConfig(); + + /** + * + * + *
+   * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + * + * @return The activeDirectoryConfig. + */ + com.google.cloud.sql.v1.SqlActiveDirectoryConfig getActiveDirectoryConfig(); + + /** + * + * + *
+   * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig active_directory_config = 22; + */ + com.google.cloud.sql.v1.SqlActiveDirectoryConfigOrBuilder getActiveDirectoryConfigOrBuilder(); + + /** + * + * + *
+   * The name of server Instance collation.
+   * 
+ * + * string collation = 23; + * + * @return The collation. + */ + java.lang.String getCollation(); + + /** + * + * + *
+   * The name of server Instance collation.
+   * 
+ * + * string collation = 23; + * + * @return The bytes for collation. + */ + com.google.protobuf.ByteString getCollationBytes(); + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + */ + java.util.List getDenyMaintenancePeriodsList(); + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + */ + com.google.cloud.sql.v1.DenyMaintenancePeriod getDenyMaintenancePeriods(int index); + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + */ + int getDenyMaintenancePeriodsCount(); + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + */ + java.util.List + getDenyMaintenancePeriodsOrBuilderList(); + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1.DenyMaintenancePeriod deny_maintenance_periods = 24; + */ + com.google.cloud.sql.v1.DenyMaintenancePeriodOrBuilder getDenyMaintenancePeriodsOrBuilder( + int index); + + /** + * + * + *
+   * Insights configuration, for now relevant only for Postgres.
+   * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + * + * @return Whether the insightsConfig field is set. + */ + boolean hasInsightsConfig(); + + /** + * + * + *
+   * Insights configuration, for now relevant only for Postgres.
+   * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + * + * @return The insightsConfig. + */ + com.google.cloud.sql.v1.InsightsConfig getInsightsConfig(); + + /** + * + * + *
+   * Insights configuration, for now relevant only for Postgres.
+   * 
+ * + * .google.cloud.sql.v1.InsightsConfig insights_config = 25; + */ + com.google.cloud.sql.v1.InsightsConfigOrBuilder getInsightsConfigOrBuilder(); + + /** + * + * + *
+   * The local user password validation policy of the instance.
+   * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + * + * @return Whether the passwordValidationPolicy field is set. + */ + boolean hasPasswordValidationPolicy(); + + /** + * + * + *
+   * The local user password validation policy of the instance.
+   * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + * + * @return The passwordValidationPolicy. + */ + com.google.cloud.sql.v1.PasswordValidationPolicy getPasswordValidationPolicy(); + + /** + * + * + *
+   * The local user password validation policy of the instance.
+   * 
+ * + * .google.cloud.sql.v1.PasswordValidationPolicy password_validation_policy = 27; + */ + com.google.cloud.sql.v1.PasswordValidationPolicyOrBuilder getPasswordValidationPolicyOrBuilder(); + + /** + * + * + *
+   * SQL Server specific audit configuration.
+   * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + * + * @return Whether the sqlServerAuditConfig field is set. + */ + boolean hasSqlServerAuditConfig(); + + /** + * + * + *
+   * SQL Server specific audit configuration.
+   * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + * + * @return The sqlServerAuditConfig. + */ + com.google.cloud.sql.v1.SqlServerAuditConfig getSqlServerAuditConfig(); + + /** + * + * + *
+   * SQL Server specific audit configuration.
+   * 
+ * + * .google.cloud.sql.v1.SqlServerAuditConfig sql_server_audit_config = 29; + */ + com.google.cloud.sql.v1.SqlServerAuditConfigOrBuilder getSqlServerAuditConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The edition type of the Cloud SQL instance.
+   * 
+ * + * + * .google.cloud.sql.v1.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for edition. + */ + int getEditionValue(); + + /** + * + * + *
+   * Optional. The edition type of the Cloud SQL instance.
+   * 
+ * + * + * .google.cloud.sql.v1.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The edition. + */ + com.google.cloud.sql.v1.Settings.Edition getEdition(); + + /** + * + * + *
+   * Specifies if connections must use Cloud SQL connectors.
+   * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+   * can be connected without Cloud SQL
+   * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+   * Connectors).
+   *
+   * Note that using REQUIRED disables all existing authorized networks. If
+   * this field is not specified when creating a new instance, NOT_REQUIRED is
+   * used. If this field is not specified when patching or updating an existing
+   * instance, it is left unchanged in the instance.
+   * 
+ * + * .google.cloud.sql.v1.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * @return The enum numeric value on the wire for connectorEnforcement. + */ + int getConnectorEnforcementValue(); + + /** + * + * + *
+   * Specifies if connections must use Cloud SQL connectors.
+   * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+   * can be connected without Cloud SQL
+   * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+   * Connectors).
+   *
+   * Note that using REQUIRED disables all existing authorized networks. If
+   * this field is not specified when creating a new instance, NOT_REQUIRED is
+   * used. If this field is not specified when patching or updating an existing
+   * instance, it is left unchanged in the instance.
+   * 
+ * + * .google.cloud.sql.v1.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * @return The connectorEnforcement. + */ + com.google.cloud.sql.v1.Settings.ConnectorEnforcement getConnectorEnforcement(); + + /** + * + * + *
+   * Configuration to protect against accidental instance deletion.
+   * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + * + * @return Whether the deletionProtectionEnabled field is set. + */ + boolean hasDeletionProtectionEnabled(); + + /** + * + * + *
+   * Configuration to protect against accidental instance deletion.
+   * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + * + * @return The deletionProtectionEnabled. + */ + com.google.protobuf.BoolValue getDeletionProtectionEnabled(); + + /** + * + * + *
+   * Configuration to protect against accidental instance deletion.
+   * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + com.google.protobuf.BoolValueOrBuilder getDeletionProtectionEnabledOrBuilder(); + + /** + * + * + *
+   * Server timezone, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * string time_zone = 34; + * + * @return The timeZone. + */ + java.lang.String getTimeZone(); + + /** + * + * + *
+   * Server timezone, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * string time_zone = 34; + * + * @return The bytes for timeZone. + */ + com.google.protobuf.ByteString getTimeZoneBytes(); + + /** + * + * + *
+   * Specifies advanced machine configuration for the instances relevant only
+   * for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + * + * @return Whether the advancedMachineFeatures field is set. + */ + boolean hasAdvancedMachineFeatures(); + + /** + * + * + *
+   * Specifies advanced machine configuration for the instances relevant only
+   * for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + * + * @return The advancedMachineFeatures. + */ + com.google.cloud.sql.v1.AdvancedMachineFeatures getAdvancedMachineFeatures(); + + /** + * + * + *
+   * Specifies advanced machine configuration for the instances relevant only
+   * for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1.AdvancedMachineFeatures advanced_machine_features = 35; + */ + com.google.cloud.sql.v1.AdvancedMachineFeaturesOrBuilder getAdvancedMachineFeaturesOrBuilder(); + + /** + * + * + *
+   * Configuration for data cache.
+   * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + * + * @return Whether the dataCacheConfig field is set. + */ + boolean hasDataCacheConfig(); + + /** + * + * + *
+   * Configuration for data cache.
+   * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + * + * @return The dataCacheConfig. + */ + com.google.cloud.sql.v1.DataCacheConfig getDataCacheConfig(); + + /** + * + * + *
+   * Configuration for data cache.
+   * 
+ * + * .google.cloud.sql.v1.DataCacheConfig data_cache_config = 37; + */ + com.google.cloud.sql.v1.DataCacheConfigOrBuilder getDataCacheConfigOrBuilder(); + + /** + * + * + *
+   * Optional. Configuration value for recreation of replica after certain
+   * replication lag
+   * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the replicationLagMaxSeconds field is set. + */ + boolean hasReplicationLagMaxSeconds(); + + /** + * + * + *
+   * Optional. Configuration value for recreation of replica after certain
+   * replication lag
+   * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The replicationLagMaxSeconds. + */ + com.google.protobuf.Int32Value getReplicationLagMaxSeconds(); + + /** + * + * + *
+   * Optional. Configuration value for recreation of replica after certain
+   * replication lag
+   * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.Int32ValueOrBuilder getReplicationLagMaxSecondsOrBuilder(); + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL instances can
+   * connect to Vertex AI to pass requests for real-time predictions and
+   * insights to the AI. The default value is false. This applies only to Cloud
+   * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enableGoogleMlIntegration field is set. + */ + boolean hasEnableGoogleMlIntegration(); + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL instances can
+   * connect to Vertex AI to pass requests for real-time predictions and
+   * insights to the AI. The default value is false. This applies only to Cloud
+   * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enableGoogleMlIntegration. + */ + com.google.protobuf.BoolValue getEnableGoogleMlIntegration(); + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL instances can
+   * connect to Vertex AI to pass requests for real-time predictions and
+   * insights to the AI. The default value is false. This applies only to Cloud
+   * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getEnableGoogleMlIntegrationOrBuilder(); + + /** + * + * + *
+   * Optional. By default, Cloud SQL instances have schema extraction disabled
+   * for Dataplex. When this parameter is set to true, schema extraction for
+   * Dataplex on Cloud SQL instances is activated.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enableDataplexIntegration field is set. + */ + boolean hasEnableDataplexIntegration(); + + /** + * + * + *
+   * Optional. By default, Cloud SQL instances have schema extraction disabled
+   * for Dataplex. When this parameter is set to true, schema extraction for
+   * Dataplex on Cloud SQL instances is activated.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enableDataplexIntegration. + */ + com.google.protobuf.BoolValue getEnableDataplexIntegration(); + + /** + * + * + *
+   * Optional. By default, Cloud SQL instances have schema extraction disabled
+   * for Dataplex. When this parameter is set to true, schema extraction for
+   * Dataplex on Cloud SQL instances is activated.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getEnableDataplexIntegrationOrBuilder(); + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL retains backups of
+   * the instance even after the instance is deleted. The ON_DEMAND backup will
+   * be retained until customer deletes the backup or the project. The AUTOMATED
+   * backup will be retained based on the backups retention setting.
+   * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the retainBackupsOnDelete field is set. + */ + boolean hasRetainBackupsOnDelete(); + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL retains backups of
+   * the instance even after the instance is deleted. The ON_DEMAND backup will
+   * be retained until customer deletes the backup or the project. The AUTOMATED
+   * backup will be retained based on the backups retention setting.
+   * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retainBackupsOnDelete. + */ + com.google.protobuf.BoolValue getRetainBackupsOnDelete(); + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL retains backups of
+   * the instance even after the instance is deleted. The ON_DEMAND backup will
+   * be retained until customer deletes the backup or the project. The AUTOMATED
+   * backup will be retained based on the backups retention setting.
+   * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getRetainBackupsOnDeleteOrBuilder(); + + /** + * + * + *
+   * Optional. Provisioned number of I/O operations per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataDiskProvisionedIops field is set. + */ + boolean hasDataDiskProvisionedIops(); + + /** + * + * + *
+   * Optional. Provisioned number of I/O operations per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataDiskProvisionedIops. + */ + long getDataDiskProvisionedIops(); + + /** + * + * + *
+   * Optional. Provisioned throughput measured in MiB per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataDiskProvisionedThroughput field is set. + */ + boolean hasDataDiskProvisionedThroughput(); + + /** + * + * + *
+   * Optional. Provisioned throughput measured in MiB per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataDiskProvisionedThroughput. + */ + long getDataDiskProvisionedThroughput(); + + /** + * + * + *
+   * Optional. The managed connection pooling configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the connectionPoolConfig field is set. + */ + boolean hasConnectionPoolConfig(); + + /** + * + * + *
+   * Optional. The managed connection pooling configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The connectionPoolConfig. + */ + com.google.cloud.sql.v1.ConnectionPoolConfig getConnectionPoolConfig(); + + /** + * + * + *
+   * Optional. The managed connection pooling configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.ConnectionPoolConfigOrBuilder getConnectionPoolConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The final backup configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the finalBackupConfig field is set. + */ + boolean hasFinalBackupConfig(); + + /** + * + * + *
+   * Optional. The final backup configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The finalBackupConfig. + */ + com.google.cloud.sql.v1.FinalBackupConfig getFinalBackupConfig(); + + /** + * + * + *
+   * Optional. The final backup configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.FinalBackupConfigOrBuilder getFinalBackupConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The read pool auto-scale configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readPoolAutoScaleConfig field is set. + */ + boolean hasReadPoolAutoScaleConfig(); + + /** + * + * + *
+   * Optional. The read pool auto-scale configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readPoolAutoScaleConfig. + */ + com.google.cloud.sql.v1.ReadPoolAutoScaleConfig getReadPoolAutoScaleConfig(); + + /** + * + * + *
+   * Optional. The read pool auto-scale configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.ReadPoolAutoScaleConfigOrBuilder getReadPoolAutoScaleConfigOrBuilder(); + + /** + * + * + *
+   * Optional. Whether the replica is in accelerated mode. This feature is in
+   * private preview and requires allowlisting to take effect.
+   * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the acceleratedReplicaMode field is set. + */ + boolean hasAcceleratedReplicaMode(); + + /** + * + * + *
+   * Optional. Whether the replica is in accelerated mode. This feature is in
+   * private preview and requires allowlisting to take effect.
+   * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The acceleratedReplicaMode. + */ + com.google.protobuf.BoolValue getAcceleratedReplicaMode(); + + /** + * + * + *
+   * Optional. Whether the replica is in accelerated mode. This feature is in
+   * private preview and requires allowlisting to take effect.
+   * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getAcceleratedReplicaModeOrBuilder(); + + /** + * + * + *
+   * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+   * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+   * versions. The MySQL version must be 8.0.35 or higher.
+   * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the autoUpgradeEnabled field is set. + */ + boolean hasAutoUpgradeEnabled(); + + /** + * + * + *
+   * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+   * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+   * versions. The MySQL version must be 8.0.35 or higher.
+   * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The autoUpgradeEnabled. + */ + boolean getAutoUpgradeEnabled(); + + /** + * + * + *
+   * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the entraidConfig field is set. + */ + boolean hasEntraidConfig(); + + /** + * + * + *
+   * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The entraidConfig. + */ + com.google.cloud.sql.v1.SqlServerEntraIdConfig getEntraidConfig(); + + /** + * + * + *
+   * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.SqlServerEntraIdConfigOrBuilder getEntraidConfigOrBuilder(); + + /** + * + * + *
+   * This parameter controls whether to allow using ExecuteSql API to connect to
+   * the instance. Not allowed by default.
+   * 
+ * + * optional .google.cloud.sql.v1.Settings.DataApiAccess data_api_access = 53; + * + * @return Whether the dataApiAccess field is set. + */ + boolean hasDataApiAccess(); + + /** + * + * + *
+   * This parameter controls whether to allow using ExecuteSql API to connect to
+   * the instance. Not allowed by default.
+   * 
+ * + * optional .google.cloud.sql.v1.Settings.DataApiAccess data_api_access = 53; + * + * @return The enum numeric value on the wire for dataApiAccess. + */ + int getDataApiAccessValue(); + + /** + * + * + *
+   * This parameter controls whether to allow using ExecuteSql API to connect to
+   * the instance. Not allowed by default.
+   * 
+ * + * optional .google.cloud.sql.v1.Settings.DataApiAccess data_api_access = 53; + * + * @return The dataApiAccess. + */ + com.google.cloud.sql.v1.Settings.DataApiAccess getDataApiAccess(); + + /** + * + * + *
+   * Optional. Configuration for Performance Capture, provides diagnostic
+   * metrics during high load situations.
+   * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the performanceCaptureConfig field is set. + */ + boolean hasPerformanceCaptureConfig(); + + /** + * + * + *
+   * Optional. Configuration for Performance Capture, provides diagnostic
+   * metrics during high load situations.
+   * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The performanceCaptureConfig. + */ + com.google.cloud.sql.v1.PerformanceCaptureConfig getPerformanceCaptureConfig(); + + /** + * + * + *
+   * Optional. Configuration for Performance Capture, provides diagnostic
+   * metrics during high load situations.
+   * 
+ * + * + * .google.cloud.sql.v1.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.PerformanceCaptureConfigOrBuilder getPerformanceCaptureConfigOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlActiveDirectoryConfig.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlActiveDirectoryConfig.java new file mode 100644 index 000000000000..35e29faea3ed --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlActiveDirectoryConfig.java @@ -0,0 +1,1889 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlActiveDirectoryConfig} + */ +@com.google.protobuf.Generated +public final class SqlActiveDirectoryConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlActiveDirectoryConfig) + SqlActiveDirectoryConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlActiveDirectoryConfig"); + } + + // Use SqlActiveDirectoryConfig.newBuilder() to construct. + private SqlActiveDirectoryConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlActiveDirectoryConfig() { + kind_ = ""; + domain_ = ""; + mode_ = 0; + dnsServers_ = com.google.protobuf.LazyStringArrayList.emptyList(); + adminCredentialSecretName_ = ""; + organizationalUnit_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlActiveDirectoryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlActiveDirectoryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlActiveDirectoryConfig.class, + com.google.cloud.sql.v1.SqlActiveDirectoryConfig.Builder.class); + } + + /** + * + * + *
+   * The modes of Active Directory configuration.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode} + */ + public enum ActiveDirectoryMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified mode. Will default to MANAGED_ACTIVE_DIRECTORY if the mode is
+     * not specified to maintain backward compatibility.
+     * 
+ * + * ACTIVE_DIRECTORY_MODE_UNSPECIFIED = 0; + */ + ACTIVE_DIRECTORY_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Managed Active Directory mode.
+     * 
+ * + * MANAGED_ACTIVE_DIRECTORY = 1; + */ + MANAGED_ACTIVE_DIRECTORY(1), + /** + * + * + *
+     * Deprecated: Use CUSTOMER_MANAGED_ACTIVE_DIRECTORY instead.
+     * 
+ * + * SELF_MANAGED_ACTIVE_DIRECTORY = 2 [deprecated = true]; + */ + @java.lang.Deprecated + SELF_MANAGED_ACTIVE_DIRECTORY(2), + /** + * + * + *
+     * Customer-managed Active Directory mode.
+     * 
+ * + * CUSTOMER_MANAGED_ACTIVE_DIRECTORY = 3; + */ + CUSTOMER_MANAGED_ACTIVE_DIRECTORY(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ActiveDirectoryMode"); + } + + /** + * + * + *
+     * Unspecified mode. Will default to MANAGED_ACTIVE_DIRECTORY if the mode is
+     * not specified to maintain backward compatibility.
+     * 
+ * + * ACTIVE_DIRECTORY_MODE_UNSPECIFIED = 0; + */ + public static final int ACTIVE_DIRECTORY_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Managed Active Directory mode.
+     * 
+ * + * MANAGED_ACTIVE_DIRECTORY = 1; + */ + public static final int MANAGED_ACTIVE_DIRECTORY_VALUE = 1; + + /** + * + * + *
+     * Deprecated: Use CUSTOMER_MANAGED_ACTIVE_DIRECTORY instead.
+     * 
+ * + * SELF_MANAGED_ACTIVE_DIRECTORY = 2 [deprecated = true]; + */ + @java.lang.Deprecated public static final int SELF_MANAGED_ACTIVE_DIRECTORY_VALUE = 2; + + /** + * + * + *
+     * Customer-managed Active Directory mode.
+     * 
+ * + * CUSTOMER_MANAGED_ACTIVE_DIRECTORY = 3; + */ + public static final int CUSTOMER_MANAGED_ACTIVE_DIRECTORY_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 ActiveDirectoryMode 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 ActiveDirectoryMode forNumber(int value) { + switch (value) { + case 0: + return ACTIVE_DIRECTORY_MODE_UNSPECIFIED; + case 1: + return MANAGED_ACTIVE_DIRECTORY; + case 2: + return SELF_MANAGED_ACTIVE_DIRECTORY; + case 3: + return CUSTOMER_MANAGED_ACTIVE_DIRECTORY; + 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 ActiveDirectoryMode findValueByNumber(int number) { + return ActiveDirectoryMode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.SqlActiveDirectoryConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final ActiveDirectoryMode[] VALUES = values(); + + public static ActiveDirectoryMode 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 ActiveDirectoryMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode) + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always sql#activeDirectoryConfig.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always sql#activeDirectoryConfig.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOMAIN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object domain_ = ""; + + /** + * + * + *
+   * The name of the domain (e.g., mydomain.com).
+   * 
+ * + * string domain = 2; + * + * @return The domain. + */ + @java.lang.Override + public java.lang.String getDomain() { + java.lang.Object ref = domain_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + domain_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the domain (e.g., mydomain.com).
+   * 
+ * + * string domain = 2; + * + * @return The bytes for domain. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDomainBytes() { + java.lang.Object ref = domain_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + domain_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODE_FIELD_NUMBER = 3; + private int mode_ = 0; + + /** + * + * + *
+   * Optional. The mode of the Active Directory configuration.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.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 of the Active Directory configuration.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode getMode() { + com.google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode result = + com.google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode.forNumber(mode_); + return result == null + ? com.google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode.UNRECOGNIZED + : result; + } + + public static final int DNS_SERVERS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList dnsServers_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return A list containing the dnsServers. + */ + public com.google.protobuf.ProtocolStringList getDnsServersList() { + return dnsServers_; + } + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The count of dnsServers. + */ + public int getDnsServersCount() { + return dnsServers_.size(); + } + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param index The index of the element to return. + * @return The dnsServers at the given index. + */ + public java.lang.String getDnsServers(int index) { + return dnsServers_.get(index); + } + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the dnsServers at the given index. + */ + public com.google.protobuf.ByteString getDnsServersBytes(int index) { + return dnsServers_.getByteString(index); + } + + public static final int ADMIN_CREDENTIAL_SECRET_NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object adminCredentialSecretName_ = ""; + + /** + * + * + *
+   * Optional. The secret manager key storing the administrator credential.
+   * (e.g., projects/{project}/secrets/{secret}).
+   * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The adminCredentialSecretName. + */ + @java.lang.Override + public java.lang.String getAdminCredentialSecretName() { + java.lang.Object ref = adminCredentialSecretName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + adminCredentialSecretName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The secret manager key storing the administrator credential.
+   * (e.g., projects/{project}/secrets/{secret}).
+   * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for adminCredentialSecretName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAdminCredentialSecretNameBytes() { + java.lang.Object ref = adminCredentialSecretName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + adminCredentialSecretName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORGANIZATIONAL_UNIT_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object organizationalUnit_ = ""; + + /** + * + * + *
+   * Optional. The organizational unit distinguished name. This is the full
+   * hierarchical path to the organizational unit.
+   * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The organizationalUnit. + */ + @java.lang.Override + public java.lang.String getOrganizationalUnit() { + java.lang.Object ref = organizationalUnit_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + organizationalUnit_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The organizational unit distinguished name. This is the full
+   * hierarchical path to the organizational unit.
+   * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for organizationalUnit. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrganizationalUnitBytes() { + java.lang.Object ref = organizationalUnit_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + organizationalUnit_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(domain_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, domain_); + } + if (mode_ + != com.google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode + .ACTIVE_DIRECTORY_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, mode_); + } + for (int i = 0; i < dnsServers_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, dnsServers_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(adminCredentialSecretName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, adminCredentialSecretName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(organizationalUnit_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, organizationalUnit_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(domain_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, domain_); + } + if (mode_ + != com.google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode + .ACTIVE_DIRECTORY_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, mode_); + } + { + int dataSize = 0; + for (int i = 0; i < dnsServers_.size(); i++) { + dataSize += computeStringSizeNoTag(dnsServers_.getRaw(i)); + } + size += dataSize; + size += 1 * getDnsServersList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(adminCredentialSecretName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, adminCredentialSecretName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(organizationalUnit_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, organizationalUnit_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlActiveDirectoryConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlActiveDirectoryConfig other = + (com.google.cloud.sql.v1.SqlActiveDirectoryConfig) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getDomain().equals(other.getDomain())) return false; + if (mode_ != other.mode_) return false; + if (!getDnsServersList().equals(other.getDnsServersList())) return false; + if (!getAdminCredentialSecretName().equals(other.getAdminCredentialSecretName())) return false; + if (!getOrganizationalUnit().equals(other.getOrganizationalUnit())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + DOMAIN_FIELD_NUMBER; + hash = (53 * hash) + getDomain().hashCode(); + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + if (getDnsServersCount() > 0) { + hash = (37 * hash) + DNS_SERVERS_FIELD_NUMBER; + hash = (53 * hash) + getDnsServersList().hashCode(); + } + hash = (37 * hash) + ADMIN_CREDENTIAL_SECRET_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAdminCredentialSecretName().hashCode(); + hash = (37 * hash) + ORGANIZATIONAL_UNIT_FIELD_NUMBER; + hash = (53 * hash) + getOrganizationalUnit().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlActiveDirectoryConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlActiveDirectoryConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlActiveDirectoryConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlActiveDirectoryConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlActiveDirectoryConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlActiveDirectoryConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlActiveDirectoryConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlActiveDirectoryConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlActiveDirectoryConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlActiveDirectoryConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlActiveDirectoryConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlActiveDirectoryConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlActiveDirectoryConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlActiveDirectoryConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlActiveDirectoryConfig) + com.google.cloud.sql.v1.SqlActiveDirectoryConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlActiveDirectoryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlActiveDirectoryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlActiveDirectoryConfig.class, + com.google.cloud.sql.v1.SqlActiveDirectoryConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlActiveDirectoryConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + domain_ = ""; + mode_ = 0; + dnsServers_ = com.google.protobuf.LazyStringArrayList.emptyList(); + adminCredentialSecretName_ = ""; + organizationalUnit_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlActiveDirectoryConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlActiveDirectoryConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlActiveDirectoryConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlActiveDirectoryConfig build() { + com.google.cloud.sql.v1.SqlActiveDirectoryConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlActiveDirectoryConfig buildPartial() { + com.google.cloud.sql.v1.SqlActiveDirectoryConfig result = + new com.google.cloud.sql.v1.SqlActiveDirectoryConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlActiveDirectoryConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.domain_ = domain_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.mode_ = mode_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + dnsServers_.makeImmutable(); + result.dnsServers_ = dnsServers_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.adminCredentialSecretName_ = adminCredentialSecretName_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.organizationalUnit_ = organizationalUnit_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlActiveDirectoryConfig) { + return mergeFrom((com.google.cloud.sql.v1.SqlActiveDirectoryConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlActiveDirectoryConfig other) { + if (other == com.google.cloud.sql.v1.SqlActiveDirectoryConfig.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDomain().isEmpty()) { + domain_ = other.domain_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + if (!other.dnsServers_.isEmpty()) { + if (dnsServers_.isEmpty()) { + dnsServers_ = other.dnsServers_; + bitField0_ |= 0x00000008; + } else { + ensureDnsServersIsMutable(); + dnsServers_.addAll(other.dnsServers_); + } + onChanged(); + } + if (!other.getAdminCredentialSecretName().isEmpty()) { + adminCredentialSecretName_ = other.adminCredentialSecretName_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getOrganizationalUnit().isEmpty()) { + organizationalUnit_ = other.organizationalUnit_; + bitField0_ |= 0x00000020; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + domain_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDnsServersIsMutable(); + dnsServers_.add(s); + break; + } // case 34 + case 42: + { + adminCredentialSecretName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + organizationalUnit_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always sql#activeDirectoryConfig.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always sql#activeDirectoryConfig.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always sql#activeDirectoryConfig.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always sql#activeDirectoryConfig.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always sql#activeDirectoryConfig.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object domain_ = ""; + + /** + * + * + *
+     * The name of the domain (e.g., mydomain.com).
+     * 
+ * + * string domain = 2; + * + * @return The domain. + */ + public java.lang.String getDomain() { + java.lang.Object ref = domain_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + domain_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the domain (e.g., mydomain.com).
+     * 
+ * + * string domain = 2; + * + * @return The bytes for domain. + */ + public com.google.protobuf.ByteString getDomainBytes() { + java.lang.Object ref = domain_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + domain_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the domain (e.g., mydomain.com).
+     * 
+ * + * string domain = 2; + * + * @param value The domain to set. + * @return This builder for chaining. + */ + public Builder setDomain(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + domain_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the domain (e.g., mydomain.com).
+     * 
+ * + * string domain = 2; + * + * @return This builder for chaining. + */ + public Builder clearDomain() { + domain_ = getDefaultInstance().getDomain(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the domain (e.g., mydomain.com).
+     * 
+ * + * string domain = 2; + * + * @param value The bytes for domain to set. + * @return This builder for chaining. + */ + public Builder setDomainBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + domain_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int mode_ = 0; + + /** + * + * + *
+     * Optional. The mode of the Active Directory configuration.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.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 of the Active Directory configuration.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The mode of the Active Directory configuration.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode getMode() { + com.google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode result = + com.google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode.forNumber(mode_); + return result == null + ? com.google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. The mode of the Active Directory configuration.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + com.google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + mode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The mode of the Active Directory configuration.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00000004); + mode_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList dnsServers_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDnsServersIsMutable() { + if (!dnsServers_.isModifiable()) { + dnsServers_ = new com.google.protobuf.LazyStringArrayList(dnsServers_); + } + bitField0_ |= 0x00000008; + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return A list containing the dnsServers. + */ + public com.google.protobuf.ProtocolStringList getDnsServersList() { + dnsServers_.makeImmutable(); + return dnsServers_; + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The count of dnsServers. + */ + public int getDnsServersCount() { + return dnsServers_.size(); + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param index The index of the element to return. + * @return The dnsServers at the given index. + */ + public java.lang.String getDnsServers(int index) { + return dnsServers_.get(index); + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the dnsServers at the given index. + */ + public com.google.protobuf.ByteString getDnsServersBytes(int index) { + return dnsServers_.getByteString(index); + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param index The index to set the value at. + * @param value The dnsServers to set. + * @return This builder for chaining. + */ + public Builder setDnsServers(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsServersIsMutable(); + dnsServers_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The dnsServers to add. + * @return This builder for chaining. + */ + public Builder addDnsServers(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsServersIsMutable(); + dnsServers_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param values The dnsServers to add. + * @return This builder for chaining. + */ + public Builder addAllDnsServers(java.lang.Iterable values) { + ensureDnsServersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dnsServers_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDnsServers() { + dnsServers_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The bytes of the dnsServers to add. + * @return This builder for chaining. + */ + public Builder addDnsServersBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDnsServersIsMutable(); + dnsServers_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object adminCredentialSecretName_ = ""; + + /** + * + * + *
+     * Optional. The secret manager key storing the administrator credential.
+     * (e.g., projects/{project}/secrets/{secret}).
+     * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The adminCredentialSecretName. + */ + public java.lang.String getAdminCredentialSecretName() { + java.lang.Object ref = adminCredentialSecretName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + adminCredentialSecretName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The secret manager key storing the administrator credential.
+     * (e.g., projects/{project}/secrets/{secret}).
+     * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for adminCredentialSecretName. + */ + public com.google.protobuf.ByteString getAdminCredentialSecretNameBytes() { + java.lang.Object ref = adminCredentialSecretName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + adminCredentialSecretName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The secret manager key storing the administrator credential.
+     * (e.g., projects/{project}/secrets/{secret}).
+     * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The adminCredentialSecretName to set. + * @return This builder for chaining. + */ + public Builder setAdminCredentialSecretName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + adminCredentialSecretName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The secret manager key storing the administrator credential.
+     * (e.g., projects/{project}/secrets/{secret}).
+     * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearAdminCredentialSecretName() { + adminCredentialSecretName_ = getDefaultInstance().getAdminCredentialSecretName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The secret manager key storing the administrator credential.
+     * (e.g., projects/{project}/secrets/{secret}).
+     * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for adminCredentialSecretName to set. + * @return This builder for chaining. + */ + public Builder setAdminCredentialSecretNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + adminCredentialSecretName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object organizationalUnit_ = ""; + + /** + * + * + *
+     * Optional. The organizational unit distinguished name. This is the full
+     * hierarchical path to the organizational unit.
+     * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The organizationalUnit. + */ + public java.lang.String getOrganizationalUnit() { + java.lang.Object ref = organizationalUnit_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + organizationalUnit_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The organizational unit distinguished name. This is the full
+     * hierarchical path to the organizational unit.
+     * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for organizationalUnit. + */ + public com.google.protobuf.ByteString getOrganizationalUnitBytes() { + java.lang.Object ref = organizationalUnit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + organizationalUnit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The organizational unit distinguished name. This is the full
+     * hierarchical path to the organizational unit.
+     * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The organizationalUnit to set. + * @return This builder for chaining. + */ + public Builder setOrganizationalUnit(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + organizationalUnit_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The organizational unit distinguished name. This is the full
+     * hierarchical path to the organizational unit.
+     * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrganizationalUnit() { + organizationalUnit_ = getDefaultInstance().getOrganizationalUnit(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The organizational unit distinguished name. This is the full
+     * hierarchical path to the organizational unit.
+     * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for organizationalUnit to set. + * @return This builder for chaining. + */ + public Builder setOrganizationalUnitBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + organizationalUnit_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlActiveDirectoryConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlActiveDirectoryConfig) + private static final com.google.cloud.sql.v1.SqlActiveDirectoryConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlActiveDirectoryConfig(); + } + + public static com.google.cloud.sql.v1.SqlActiveDirectoryConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlActiveDirectoryConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlActiveDirectoryConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlActiveDirectoryConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlActiveDirectoryConfigOrBuilder.java new file mode 100644 index 000000000000..03a336b25fc9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlActiveDirectoryConfigOrBuilder.java @@ -0,0 +1,232 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlActiveDirectoryConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlActiveDirectoryConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always sql#activeDirectoryConfig.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always sql#activeDirectoryConfig.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The name of the domain (e.g., mydomain.com).
+   * 
+ * + * string domain = 2; + * + * @return The domain. + */ + java.lang.String getDomain(); + + /** + * + * + *
+   * The name of the domain (e.g., mydomain.com).
+   * 
+ * + * string domain = 2; + * + * @return The bytes for domain. + */ + com.google.protobuf.ByteString getDomainBytes(); + + /** + * + * + *
+   * Optional. The mode of the Active Directory configuration.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + + /** + * + * + *
+   * Optional. The mode of the Active Directory configuration.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + com.google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode getMode(); + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return A list containing the dnsServers. + */ + java.util.List getDnsServersList(); + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The count of dnsServers. + */ + int getDnsServersCount(); + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param index The index of the element to return. + * @return The dnsServers at the given index. + */ + java.lang.String getDnsServers(int index); + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the dnsServers at the given index. + */ + com.google.protobuf.ByteString getDnsServersBytes(int index); + + /** + * + * + *
+   * Optional. The secret manager key storing the administrator credential.
+   * (e.g., projects/{project}/secrets/{secret}).
+   * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The adminCredentialSecretName. + */ + java.lang.String getAdminCredentialSecretName(); + + /** + * + * + *
+   * Optional. The secret manager key storing the administrator credential.
+   * (e.g., projects/{project}/secrets/{secret}).
+   * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for adminCredentialSecretName. + */ + com.google.protobuf.ByteString getAdminCredentialSecretNameBytes(); + + /** + * + * + *
+   * Optional. The organizational unit distinguished name. This is the full
+   * hierarchical path to the organizational unit.
+   * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The organizationalUnit. + */ + java.lang.String getOrganizationalUnit(); + + /** + * + * + *
+   * Optional. The organizational unit distinguished name. This is the full
+   * hierarchical path to the organizational unit.
+   * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for organizationalUnit. + */ + com.google.protobuf.ByteString getOrganizationalUnitBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlAvailabilityType.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlAvailabilityType.java new file mode 100644 index 000000000000..abe6407bfc06 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlAvailabilityType.java @@ -0,0 +1,194 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The availability type of the given Cloud SQL instance.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.SqlAvailabilityType} + */ +@com.google.protobuf.Generated +public enum SqlAvailabilityType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown Availability type.
+   * 
+ * + * SQL_AVAILABILITY_TYPE_UNSPECIFIED = 0; + */ + SQL_AVAILABILITY_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Zonal available instance.
+   * 
+ * + * ZONAL = 1; + */ + ZONAL(1), + /** + * + * + *
+   * Regional available instance.
+   * 
+ * + * REGIONAL = 2; + */ + REGIONAL(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlAvailabilityType"); + } + + /** + * + * + *
+   * This is an unknown Availability type.
+   * 
+ * + * SQL_AVAILABILITY_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_AVAILABILITY_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Zonal available instance.
+   * 
+ * + * ZONAL = 1; + */ + public static final int ZONAL_VALUE = 1; + + /** + * + * + *
+   * Regional available instance.
+   * 
+ * + * REGIONAL = 2; + */ + public static final int REGIONAL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SqlAvailabilityType 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 SqlAvailabilityType forNumber(int value) { + switch (value) { + case 0: + return SQL_AVAILABILITY_TYPE_UNSPECIFIED; + case 1: + return ZONAL; + case 2: + return REGIONAL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SqlAvailabilityType findValueByNumber(int number) { + return SqlAvailabilityType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor().getEnumTypes().get(9); + } + + private static final SqlAvailabilityType[] VALUES = values(); + + public static SqlAvailabilityType 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 SqlAvailabilityType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlAvailabilityType) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackendType.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackendType.java new file mode 100644 index 000000000000..63a32b12f1b9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackendType.java @@ -0,0 +1,207 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf enum {@code google.cloud.sql.v1.SqlBackendType} */ +@com.google.protobuf.Generated +public enum SqlBackendType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown backend type for instance.
+   * 
+ * + * SQL_BACKEND_TYPE_UNSPECIFIED = 0; + */ + SQL_BACKEND_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * V1 speckle instance.
+   * 
+ * + * FIRST_GEN = 1 [deprecated = true]; + */ + @java.lang.Deprecated + FIRST_GEN(1), + /** + * + * + *
+   * V2 speckle instance.
+   * 
+ * + * SECOND_GEN = 2; + */ + SECOND_GEN(2), + /** + * + * + *
+   * On premises instance.
+   * 
+ * + * EXTERNAL = 3; + */ + EXTERNAL(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackendType"); + } + + /** + * + * + *
+   * This is an unknown backend type for instance.
+   * 
+ * + * SQL_BACKEND_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_BACKEND_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * V1 speckle instance.
+   * 
+ * + * FIRST_GEN = 1 [deprecated = true]; + */ + @java.lang.Deprecated public static final int FIRST_GEN_VALUE = 1; + + /** + * + * + *
+   * V2 speckle instance.
+   * 
+ * + * SECOND_GEN = 2; + */ + public static final int SECOND_GEN_VALUE = 2; + + /** + * + * + *
+   * On premises instance.
+   * 
+ * + * EXTERNAL = 3; + */ + public static final int EXTERNAL_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 SqlBackendType 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 SqlBackendType forNumber(int value) { + switch (value) { + case 0: + return SQL_BACKEND_TYPE_UNSPECIFIED; + case 1: + return FIRST_GEN; + case 2: + return SECOND_GEN; + case 3: + return EXTERNAL; + 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 SqlBackendType findValueByNumber(int number) { + return SqlBackendType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor().getEnumTypes().get(3); + } + + private static final SqlBackendType[] VALUES = values(); + + public static SqlBackendType 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 SqlBackendType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlBackendType) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupKind.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupKind.java new file mode 100644 index 000000000000..67ad9402893d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupKind.java @@ -0,0 +1,191 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Defines the supported backup kinds.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.SqlBackupKind} + */ +@com.google.protobuf.Generated +public enum SqlBackupKind implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown BackupKind.
+   * 
+ * + * SQL_BACKUP_KIND_UNSPECIFIED = 0; + */ + SQL_BACKUP_KIND_UNSPECIFIED(0), + /** + * + * + *
+   * Snapshot-based backups.
+   * 
+ * + * SNAPSHOT = 1; + */ + SNAPSHOT(1), + /** + * + * + *
+   * Physical backups.
+   * 
+ * + * PHYSICAL = 2; + */ + PHYSICAL(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupKind"); + } + + /** + * + * + *
+   * This is an unknown BackupKind.
+   * 
+ * + * SQL_BACKUP_KIND_UNSPECIFIED = 0; + */ + public static final int SQL_BACKUP_KIND_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Snapshot-based backups.
+   * 
+ * + * SNAPSHOT = 1; + */ + public static final int SNAPSHOT_VALUE = 1; + + /** + * + * + *
+   * Physical backups.
+   * 
+ * + * PHYSICAL = 2; + */ + public static final int PHYSICAL_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 SqlBackupKind 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 SqlBackupKind forNumber(int value) { + switch (value) { + case 0: + return SQL_BACKUP_KIND_UNSPECIFIED; + case 1: + return SNAPSHOT; + case 2: + return PHYSICAL; + 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 SqlBackupKind findValueByNumber(int number) { + return SqlBackupKind.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto.getDescriptor().getEnumTypes().get(1); + } + + private static final SqlBackupKind[] VALUES = values(); + + public static SqlBackupKind 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 SqlBackupKind(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlBackupKind) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunStatus.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunStatus.java new file mode 100644 index 000000000000..ab870a83d84f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunStatus.java @@ -0,0 +1,360 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The status of a backup run.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.SqlBackupRunStatus} + */ +@com.google.protobuf.Generated +public enum SqlBackupRunStatus implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The status of the run is unknown.
+   * 
+ * + * SQL_BACKUP_RUN_STATUS_UNSPECIFIED = 0; + */ + SQL_BACKUP_RUN_STATUS_UNSPECIFIED(0), + /** + * + * + *
+   * The backup operation was enqueued.
+   * 
+ * + * ENQUEUED = 1; + */ + ENQUEUED(1), + /** + * + * + *
+   * The backup is overdue across a given backup window. Indicates a
+   * problem. Example: Long-running operation in progress during
+   * the whole window.
+   * 
+ * + * OVERDUE = 2; + */ + OVERDUE(2), + /** + * + * + *
+   * The backup is in progress.
+   * 
+ * + * RUNNING = 3; + */ + RUNNING(3), + /** + * + * + *
+   * The backup failed.
+   * 
+ * + * FAILED = 4; + */ + FAILED(4), + /** + * + * + *
+   * The backup was successful.
+   * 
+ * + * SUCCESSFUL = 5; + */ + SUCCESSFUL(5), + /** + * + * + *
+   * The backup was skipped (without problems) for a given backup
+   * window. Example: Instance was idle.
+   * 
+ * + * SKIPPED = 6; + */ + SKIPPED(6), + /** + * + * + *
+   * The backup is about to be deleted.
+   * 
+ * + * DELETION_PENDING = 7; + */ + DELETION_PENDING(7), + /** + * + * + *
+   * The backup deletion failed.
+   * 
+ * + * DELETION_FAILED = 8; + */ + DELETION_FAILED(8), + /** + * + * + *
+   * The backup has been deleted.
+   * 
+ * + * DELETED = 9; + */ + DELETED(9), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupRunStatus"); + } + + /** + * + * + *
+   * The status of the run is unknown.
+   * 
+ * + * SQL_BACKUP_RUN_STATUS_UNSPECIFIED = 0; + */ + public static final int SQL_BACKUP_RUN_STATUS_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The backup operation was enqueued.
+   * 
+ * + * ENQUEUED = 1; + */ + public static final int ENQUEUED_VALUE = 1; + + /** + * + * + *
+   * The backup is overdue across a given backup window. Indicates a
+   * problem. Example: Long-running operation in progress during
+   * the whole window.
+   * 
+ * + * OVERDUE = 2; + */ + public static final int OVERDUE_VALUE = 2; + + /** + * + * + *
+   * The backup is in progress.
+   * 
+ * + * RUNNING = 3; + */ + public static final int RUNNING_VALUE = 3; + + /** + * + * + *
+   * The backup failed.
+   * 
+ * + * FAILED = 4; + */ + public static final int FAILED_VALUE = 4; + + /** + * + * + *
+   * The backup was successful.
+   * 
+ * + * SUCCESSFUL = 5; + */ + public static final int SUCCESSFUL_VALUE = 5; + + /** + * + * + *
+   * The backup was skipped (without problems) for a given backup
+   * window. Example: Instance was idle.
+   * 
+ * + * SKIPPED = 6; + */ + public static final int SKIPPED_VALUE = 6; + + /** + * + * + *
+   * The backup is about to be deleted.
+   * 
+ * + * DELETION_PENDING = 7; + */ + public static final int DELETION_PENDING_VALUE = 7; + + /** + * + * + *
+   * The backup deletion failed.
+   * 
+ * + * DELETION_FAILED = 8; + */ + public static final int DELETION_FAILED_VALUE = 8; + + /** + * + * + *
+   * The backup has been deleted.
+   * 
+ * + * DELETED = 9; + */ + public static final int DELETED_VALUE = 9; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SqlBackupRunStatus 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 SqlBackupRunStatus forNumber(int value) { + switch (value) { + case 0: + return SQL_BACKUP_RUN_STATUS_UNSPECIFIED; + case 1: + return ENQUEUED; + case 2: + return OVERDUE; + case 3: + return RUNNING; + case 4: + return FAILED; + case 5: + return SUCCESSFUL; + case 6: + return SKIPPED; + case 7: + return DELETION_PENDING; + case 8: + return DELETION_FAILED; + case 9: + return DELETED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SqlBackupRunStatus findValueByNumber(int number) { + return SqlBackupRunStatus.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlBackupRunStatus[] VALUES = values(); + + public static SqlBackupRunStatus 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 SqlBackupRunStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlBackupRunStatus) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunType.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunType.java new file mode 100644 index 000000000000..cb6994e802d8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunType.java @@ -0,0 +1,191 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Type of backup (i.e. automated, on demand, etc).
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.SqlBackupRunType} + */ +@com.google.protobuf.Generated +public enum SqlBackupRunType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown BackupRun type.
+   * 
+ * + * SQL_BACKUP_RUN_TYPE_UNSPECIFIED = 0; + */ + SQL_BACKUP_RUN_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * The backup schedule automatically triggers a backup.
+   * 
+ * + * AUTOMATED = 1; + */ + AUTOMATED(1), + /** + * + * + *
+   * The user manually triggers a backup.
+   * 
+ * + * ON_DEMAND = 2; + */ + ON_DEMAND(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupRunType"); + } + + /** + * + * + *
+   * This is an unknown BackupRun type.
+   * 
+ * + * SQL_BACKUP_RUN_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_BACKUP_RUN_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The backup schedule automatically triggers a backup.
+   * 
+ * + * AUTOMATED = 1; + */ + public static final int AUTOMATED_VALUE = 1; + + /** + * + * + *
+   * The user manually triggers a backup.
+   * 
+ * + * ON_DEMAND = 2; + */ + public static final int ON_DEMAND_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 SqlBackupRunType 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 SqlBackupRunType forNumber(int value) { + switch (value) { + case 0: + return SQL_BACKUP_RUN_TYPE_UNSPECIFIED; + case 1: + return AUTOMATED; + case 2: + return ON_DEMAND; + 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 SqlBackupRunType findValueByNumber(int number) { + return SqlBackupRunType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto.getDescriptor().getEnumTypes().get(2); + } + + private static final SqlBackupRunType[] VALUES = values(); + + public static SqlBackupRunType 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 SqlBackupRunType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlBackupRunType) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsDeleteRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsDeleteRequest.java new file mode 100644 index 000000000000..48eac792c038 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsDeleteRequest.java @@ -0,0 +1,890 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Backup runs delete request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlBackupRunsDeleteRequest} + */ +@com.google.protobuf.Generated +public final class SqlBackupRunsDeleteRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlBackupRunsDeleteRequest) + SqlBackupRunsDeleteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupRunsDeleteRequest"); + } + + // Use SqlBackupRunsDeleteRequest.newBuilder() to construct. + private SqlBackupRunsDeleteRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlBackupRunsDeleteRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest.class, + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_ = 0L; + + /** + * + * + *
+   * The ID of the backup run to delete. To find a backup run ID, use the
+   * [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list)
+   * method.
+   * 
+ * + * int64 id = 1; + * + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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 (id_ != 0L) { + output.writeInt64(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest other = + (com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest) obj; + + if (getId() != other.getId()) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getId()); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Backup runs delete request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlBackupRunsDeleteRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlBackupRunsDeleteRequest) + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest.class, + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = 0L; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsDeleteRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest build() { + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest buildPartial() { + com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest result = + new com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest other) { + if (other == com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest.getDefaultInstance()) + return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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 8: + { + id_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + project_ = 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 long id_; + + /** + * + * + *
+     * The ID of the backup run to delete. To find a backup run ID, use the
+     * [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list)
+     * method.
+     * 
+ * + * int64 id = 1; + * + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + /** + * + * + *
+     * The ID of the backup run to delete. To find a backup run ID, use the
+     * [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list)
+     * method.
+     * 
+ * + * int64 id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The ID of the backup run to delete. To find a backup run ID, use the
+     * [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list)
+     * method.
+     * 
+ * + * int64 id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlBackupRunsDeleteRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlBackupRunsDeleteRequest) + private static final com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest(); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlBackupRunsDeleteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsDeleteRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsDeleteRequestOrBuilder.java new file mode 100644 index 000000000000..20226d3e56cc --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsDeleteRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlBackupRunsDeleteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlBackupRunsDeleteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The ID of the backup run to delete. To find a backup run ID, use the
+   * [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list)
+   * method.
+   * 
+ * + * int64 id = 1; + * + * @return The id. + */ + long getId(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsGetRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsGetRequest.java new file mode 100644 index 000000000000..ebee6db7859a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsGetRequest.java @@ -0,0 +1,882 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Backup runs get request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlBackupRunsGetRequest} + */ +@com.google.protobuf.Generated +public final class SqlBackupRunsGetRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlBackupRunsGetRequest) + SqlBackupRunsGetRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupRunsGetRequest"); + } + + // Use SqlBackupRunsGetRequest.newBuilder() to construct. + private SqlBackupRunsGetRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlBackupRunsGetRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlBackupRunsGetRequest.class, + com.google.cloud.sql.v1.SqlBackupRunsGetRequest.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_ = 0L; + + /** + * + * + *
+   * The ID of this backup run.
+   * 
+ * + * int64 id = 1; + * + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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 (id_ != 0L) { + output.writeInt64(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlBackupRunsGetRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlBackupRunsGetRequest other = + (com.google.cloud.sql.v1.SqlBackupRunsGetRequest) obj; + + if (getId() != other.getId()) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getId()); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlBackupRunsGetRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsGetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsGetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsGetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsGetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsGetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsGetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsGetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsGetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsGetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsGetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsGetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlBackupRunsGetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Backup runs get request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlBackupRunsGetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlBackupRunsGetRequest) + com.google.cloud.sql.v1.SqlBackupRunsGetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlBackupRunsGetRequest.class, + com.google.cloud.sql.v1.SqlBackupRunsGetRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlBackupRunsGetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = 0L; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsGetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsGetRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlBackupRunsGetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsGetRequest build() { + com.google.cloud.sql.v1.SqlBackupRunsGetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsGetRequest buildPartial() { + com.google.cloud.sql.v1.SqlBackupRunsGetRequest result = + new com.google.cloud.sql.v1.SqlBackupRunsGetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlBackupRunsGetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlBackupRunsGetRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlBackupRunsGetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlBackupRunsGetRequest other) { + if (other == com.google.cloud.sql.v1.SqlBackupRunsGetRequest.getDefaultInstance()) + return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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 8: + { + id_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + project_ = 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 long id_; + + /** + * + * + *
+     * The ID of this backup run.
+     * 
+ * + * int64 id = 1; + * + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + /** + * + * + *
+     * The ID of this backup run.
+     * 
+ * + * int64 id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The ID of this backup run.
+     * 
+ * + * int64 id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlBackupRunsGetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlBackupRunsGetRequest) + private static final com.google.cloud.sql.v1.SqlBackupRunsGetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlBackupRunsGetRequest(); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsGetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlBackupRunsGetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsGetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsGetRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsGetRequestOrBuilder.java new file mode 100644 index 000000000000..743b9e26dc20 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsGetRequestOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlBackupRunsGetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlBackupRunsGetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The ID of this backup run.
+   * 
+ * + * int64 id = 1; + * + * @return The id. + */ + long getId(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsInsertRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsInsertRequest.java new file mode 100644 index 000000000000..1cd6e3c4bb34 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsInsertRequest.java @@ -0,0 +1,980 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Backup runs insert request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlBackupRunsInsertRequest} + */ +@com.google.protobuf.Generated +public final class SqlBackupRunsInsertRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlBackupRunsInsertRequest) + SqlBackupRunsInsertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupRunsInsertRequest"); + } + + // Use SqlBackupRunsInsertRequest.newBuilder() to construct. + private SqlBackupRunsInsertRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlBackupRunsInsertRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest.class, + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.BackupRun body_; + + /** + * .google.cloud.sql.v1.BackupRun body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.BackupRun body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupRun getBody() { + return body_ == null ? com.google.cloud.sql.v1.BackupRun.getDefaultInstance() : body_; + } + + /** .google.cloud.sql.v1.BackupRun body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupRunOrBuilder getBodyOrBuilder() { + return body_ == null ? com.google.cloud.sql.v1.BackupRun.getDefaultInstance() : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlBackupRunsInsertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest other = + (com.google.cloud.sql.v1.SqlBackupRunsInsertRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlBackupRunsInsertRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsInsertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsInsertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsInsertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsInsertRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsInsertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsInsertRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsInsertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsInsertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsInsertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlBackupRunsInsertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Backup runs insert request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlBackupRunsInsertRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlBackupRunsInsertRequest) + com.google.cloud.sql.v1.SqlBackupRunsInsertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest.class, + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlBackupRunsInsertRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsInsertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsInsertRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlBackupRunsInsertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsInsertRequest build() { + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsInsertRequest buildPartial() { + com.google.cloud.sql.v1.SqlBackupRunsInsertRequest result = + new com.google.cloud.sql.v1.SqlBackupRunsInsertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlBackupRunsInsertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlBackupRunsInsertRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlBackupRunsInsertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlBackupRunsInsertRequest other) { + if (other == com.google.cloud.sql.v1.SqlBackupRunsInsertRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.BackupRun body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupRun, + com.google.cloud.sql.v1.BackupRun.Builder, + com.google.cloud.sql.v1.BackupRunOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.BackupRun body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.BackupRun body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.BackupRun getBody() { + if (bodyBuilder_ == null) { + return body_ == null ? com.google.cloud.sql.v1.BackupRun.getDefaultInstance() : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.BackupRun body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.BackupRun value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.BackupRun body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.BackupRun.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.BackupRun body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.BackupRun value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.BackupRun.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.BackupRun body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.BackupRun body = 100; */ + public com.google.cloud.sql.v1.BackupRun.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.BackupRun body = 100; */ + public com.google.cloud.sql.v1.BackupRunOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null ? com.google.cloud.sql.v1.BackupRun.getDefaultInstance() : body_; + } + } + + /** .google.cloud.sql.v1.BackupRun body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupRun, + com.google.cloud.sql.v1.BackupRun.Builder, + com.google.cloud.sql.v1.BackupRunOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.BackupRun, + com.google.cloud.sql.v1.BackupRun.Builder, + com.google.cloud.sql.v1.BackupRunOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlBackupRunsInsertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlBackupRunsInsertRequest) + private static final com.google.cloud.sql.v1.SqlBackupRunsInsertRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlBackupRunsInsertRequest(); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsInsertRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlBackupRunsInsertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsInsertRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsInsertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsInsertRequestOrBuilder.java new file mode 100644 index 000000000000..d9f508cb8284 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsInsertRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlBackupRunsInsertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlBackupRunsInsertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.BackupRun body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.BackupRun body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.BackupRun getBody(); + + /** .google.cloud.sql.v1.BackupRun body = 100; */ + com.google.cloud.sql.v1.BackupRunOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsListRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsListRequest.java new file mode 100644 index 000000000000..dc7fca41133f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsListRequest.java @@ -0,0 +1,1085 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Backup runs list request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlBackupRunsListRequest} + */ +@com.google.protobuf.Generated +public final class SqlBackupRunsListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlBackupRunsListRequest) + SqlBackupRunsListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupRunsListRequest"); + } + + // Use SqlBackupRunsListRequest.newBuilder() to construct. + private SqlBackupRunsListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlBackupRunsListRequest() { + instance_ = ""; + pageToken_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlBackupRunsListRequest.class, + com.google.cloud.sql.v1.SqlBackupRunsListRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID, or "-" for all instances. This does not include
+   * the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID, or "-" for all instances. This does not include
+   * the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_RESULTS_FIELD_NUMBER = 2; + private int maxResults_ = 0; + + /** + * + * + *
+   * Maximum number of backup runs per response.
+   * 
+ * + * int32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (maxResults_ != 0) { + output.writeInt32(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (maxResults_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlBackupRunsListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlBackupRunsListRequest other = + (com.google.cloud.sql.v1.SqlBackupRunsListRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (getMaxResults() != other.getMaxResults()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + MAX_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getMaxResults(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlBackupRunsListRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsListRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlBackupRunsListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Backup runs list request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlBackupRunsListRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlBackupRunsListRequest) + com.google.cloud.sql.v1.SqlBackupRunsListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlBackupRunsListRequest.class, + com.google.cloud.sql.v1.SqlBackupRunsListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlBackupRunsListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + maxResults_ = 0; + pageToken_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlBackupRunsProto + .internal_static_google_cloud_sql_v1_SqlBackupRunsListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlBackupRunsListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsListRequest build() { + com.google.cloud.sql.v1.SqlBackupRunsListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsListRequest buildPartial() { + com.google.cloud.sql.v1.SqlBackupRunsListRequest result = + new com.google.cloud.sql.v1.SqlBackupRunsListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlBackupRunsListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxResults_ = maxResults_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlBackupRunsListRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlBackupRunsListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlBackupRunsListRequest other) { + if (other == com.google.cloud.sql.v1.SqlBackupRunsListRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getMaxResults() != 0) { + setMaxResults(other.getMaxResults()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + maxResults_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID, or "-" for all instances. This does not include
+     * the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID, or "-" for all instances. This does not include
+     * the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID, or "-" for all instances. This does not include
+     * the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID, or "-" for all instances. This does not include
+     * the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID, or "-" for all instances. This does not include
+     * the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int maxResults_; + + /** + * + * + *
+     * Maximum number of backup runs per response.
+     * 
+ * + * int32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + /** + * + * + *
+     * Maximum number of backup runs per response.
+     * 
+ * + * int32 max_results = 2; + * + * @param value The maxResults to set. + * @return This builder for chaining. + */ + public Builder setMaxResults(int value) { + + maxResults_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum number of backup runs per response.
+     * 
+ * + * int32 max_results = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxResults() { + bitField0_ = (bitField0_ & ~0x00000002); + maxResults_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlBackupRunsListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlBackupRunsListRequest) + private static final com.google.cloud.sql.v1.SqlBackupRunsListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlBackupRunsListRequest(); + } + + public static com.google.cloud.sql.v1.SqlBackupRunsListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlBackupRunsListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlBackupRunsListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsListRequestOrBuilder.java new file mode 100644 index 000000000000..27be9cbcd55a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlBackupRunsListRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backup_runs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlBackupRunsListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlBackupRunsListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID, or "-" for all instances. This does not include
+   * the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID, or "-" for all instances. This does not include
+   * the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Maximum number of backup runs per response.
+   * 
+ * + * int32 max_results = 2; + * + * @return The maxResults. + */ + int getMaxResults(); + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDataDiskType.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDataDiskType.java new file mode 100644 index 000000000000..f05ea842a46b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDataDiskType.java @@ -0,0 +1,240 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The type of disk that is used for a v2 instance to use.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.SqlDataDiskType} + */ +@com.google.protobuf.Generated +public enum SqlDataDiskType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown data disk type.
+   * 
+ * + * SQL_DATA_DISK_TYPE_UNSPECIFIED = 0; + */ + SQL_DATA_DISK_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * An SSD data disk.
+   * 
+ * + * PD_SSD = 1; + */ + PD_SSD(1), + /** + * + * + *
+   * An HDD data disk.
+   * 
+ * + * PD_HDD = 2; + */ + PD_HDD(2), + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * OBSOLETE_LOCAL_SSD = 3 [deprecated = true]; + */ + @java.lang.Deprecated + OBSOLETE_LOCAL_SSD(3), + /** + * + * + *
+   * A Hyperdisk Balanced data disk.
+   * 
+ * + * HYPERDISK_BALANCED = 4; + */ + HYPERDISK_BALANCED(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDataDiskType"); + } + + /** + * + * + *
+   * This is an unknown data disk type.
+   * 
+ * + * SQL_DATA_DISK_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_DATA_DISK_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * An SSD data disk.
+   * 
+ * + * PD_SSD = 1; + */ + public static final int PD_SSD_VALUE = 1; + + /** + * + * + *
+   * An HDD data disk.
+   * 
+ * + * PD_HDD = 2; + */ + public static final int PD_HDD_VALUE = 2; + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * OBSOLETE_LOCAL_SSD = 3 [deprecated = true]; + */ + @java.lang.Deprecated public static final int OBSOLETE_LOCAL_SSD_VALUE = 3; + + /** + * + * + *
+   * A Hyperdisk Balanced data disk.
+   * 
+ * + * HYPERDISK_BALANCED = 4; + */ + public static final int HYPERDISK_BALANCED_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 SqlDataDiskType 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 SqlDataDiskType forNumber(int value) { + switch (value) { + case 0: + return SQL_DATA_DISK_TYPE_UNSPECIFIED; + case 1: + return PD_SSD; + case 2: + return PD_HDD; + case 3: + return OBSOLETE_LOCAL_SSD; + case 4: + return HYPERDISK_BALANCED; + 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 SqlDataDiskType findValueByNumber(int number) { + return SqlDataDiskType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor().getEnumTypes().get(8); + } + + private static final SqlDataDiskType[] VALUES = values(); + + public static SqlDataDiskType 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 SqlDataDiskType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlDataDiskType) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabaseVersion.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabaseVersion.java new file mode 100644 index 000000000000..df4a3b09bc09 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabaseVersion.java @@ -0,0 +1,1415 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The database engine type and version.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.SqlDatabaseVersion} + */ +@com.google.protobuf.Generated +public enum SqlDatabaseVersion implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown database version.
+   * 
+ * + * SQL_DATABASE_VERSION_UNSPECIFIED = 0; + */ + SQL_DATABASE_VERSION_UNSPECIFIED(0), + /** + * + * + *
+   * The database version is MySQL 5.1.
+   * 
+ * + * MYSQL_5_1 = 2 [deprecated = true]; + */ + @java.lang.Deprecated + MYSQL_5_1(2), + /** + * + * + *
+   * The database version is MySQL 5.5.
+   * 
+ * + * MYSQL_5_5 = 3 [deprecated = true]; + */ + @java.lang.Deprecated + MYSQL_5_5(3), + /** + * + * + *
+   * The database version is MySQL 5.6.
+   * 
+ * + * MYSQL_5_6 = 5; + */ + MYSQL_5_6(5), + /** + * + * + *
+   * The database version is MySQL 5.7.
+   * 
+ * + * MYSQL_5_7 = 6; + */ + MYSQL_5_7(6), + /** + * + * + *
+   * The database version is MySQL 8.
+   * 
+ * + * MYSQL_8_0 = 20; + */ + MYSQL_8_0(20), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 18.
+   * 
+ * + * MYSQL_8_0_18 = 41; + */ + MYSQL_8_0_18(41), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 26.
+   * 
+ * + * MYSQL_8_0_26 = 85; + */ + MYSQL_8_0_26(85), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 27.
+   * 
+ * + * MYSQL_8_0_27 = 111; + */ + MYSQL_8_0_27(111), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 28.
+   * 
+ * + * MYSQL_8_0_28 = 132; + */ + MYSQL_8_0_28(132), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 29.
+   * 
+ * + * MYSQL_8_0_29 = 148 [deprecated = true]; + */ + @java.lang.Deprecated + MYSQL_8_0_29(148), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 30.
+   * 
+ * + * MYSQL_8_0_30 = 174; + */ + MYSQL_8_0_30(174), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 31.
+   * 
+ * + * MYSQL_8_0_31 = 197; + */ + MYSQL_8_0_31(197), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 32.
+   * 
+ * + * MYSQL_8_0_32 = 213; + */ + MYSQL_8_0_32(213), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 33.
+   * 
+ * + * MYSQL_8_0_33 = 238; + */ + MYSQL_8_0_33(238), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 34.
+   * 
+ * + * MYSQL_8_0_34 = 239; + */ + MYSQL_8_0_34(239), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 35.
+   * 
+ * + * MYSQL_8_0_35 = 240; + */ + MYSQL_8_0_35(240), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 36.
+   * 
+ * + * MYSQL_8_0_36 = 241; + */ + MYSQL_8_0_36(241), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 37.
+   * 
+ * + * MYSQL_8_0_37 = 355; + */ + MYSQL_8_0_37(355), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 39.
+   * 
+ * + * MYSQL_8_0_39 = 357; + */ + MYSQL_8_0_39(357), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 40.
+   * 
+ * + * MYSQL_8_0_40 = 358; + */ + MYSQL_8_0_40(358), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 41.
+   * 
+ * + * MYSQL_8_0_41 = 488; + */ + MYSQL_8_0_41(488), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 42.
+   * 
+ * + * MYSQL_8_0_42 = 489; + */ + MYSQL_8_0_42(489), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 43.
+   * 
+ * + * MYSQL_8_0_43 = 553; + */ + MYSQL_8_0_43(553), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 44.
+   * 
+ * + * MYSQL_8_0_44 = 554; + */ + MYSQL_8_0_44(554), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 45.
+   * 
+ * + * MYSQL_8_0_45 = 555; + */ + MYSQL_8_0_45(555), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 46.
+   * 
+ * + * MYSQL_8_0_46 = 556; + */ + MYSQL_8_0_46(556), + /** + * + * + *
+   * The database version is MySQL 8.4.
+   * 
+ * + * MYSQL_8_4 = 398; + */ + MYSQL_8_4(398), + /** + * + * + *
+   * The database version is MySQL 9.7.
+   * 
+ * + * MYSQL_9_7 = 654; + */ + MYSQL_9_7(654), + /** + * + * + *
+   * The database version is SQL Server 2017 Standard.
+   * 
+ * + * SQLSERVER_2017_STANDARD = 11; + */ + SQLSERVER_2017_STANDARD(11), + /** + * + * + *
+   * The database version is SQL Server 2017 Enterprise.
+   * 
+ * + * SQLSERVER_2017_ENTERPRISE = 14; + */ + SQLSERVER_2017_ENTERPRISE(14), + /** + * + * + *
+   * The database version is SQL Server 2017 Express.
+   * 
+ * + * SQLSERVER_2017_EXPRESS = 15; + */ + SQLSERVER_2017_EXPRESS(15), + /** + * + * + *
+   * The database version is SQL Server 2017 Web.
+   * 
+ * + * SQLSERVER_2017_WEB = 16; + */ + SQLSERVER_2017_WEB(16), + /** + * + * + *
+   * The database version is PostgreSQL 9.6.
+   * 
+ * + * POSTGRES_9_6 = 9; + */ + POSTGRES_9_6(9), + /** + * + * + *
+   * The database version is PostgreSQL 10.
+   * 
+ * + * POSTGRES_10 = 18; + */ + POSTGRES_10(18), + /** + * + * + *
+   * The database version is PostgreSQL 11.
+   * 
+ * + * POSTGRES_11 = 10; + */ + POSTGRES_11(10), + /** + * + * + *
+   * The database version is PostgreSQL 12.
+   * 
+ * + * POSTGRES_12 = 19; + */ + POSTGRES_12(19), + /** + * + * + *
+   * The database version is PostgreSQL 13.
+   * 
+ * + * POSTGRES_13 = 23; + */ + POSTGRES_13(23), + /** + * + * + *
+   * The database version is PostgreSQL 14.
+   * 
+ * + * POSTGRES_14 = 110; + */ + POSTGRES_14(110), + /** + * + * + *
+   * The database version is PostgreSQL 15.
+   * 
+ * + * POSTGRES_15 = 172; + */ + POSTGRES_15(172), + /** + * + * + *
+   * The database version is PostgreSQL 16.
+   * 
+ * + * POSTGRES_16 = 272; + */ + POSTGRES_16(272), + /** + * + * + *
+   * The database version is PostgreSQL 17.
+   * 
+ * + * POSTGRES_17 = 408; + */ + POSTGRES_17(408), + /** + * + * + *
+   * The database version is PostgreSQL 18.
+   * 
+ * + * POSTGRES_18 = 557; + */ + POSTGRES_18(557), + /** + * + * + *
+   * The database version is PostgreSQL 19.
+   * 
+ * + * POSTGRES_19 = 684; + */ + POSTGRES_19(684), + /** + * + * + *
+   * The database version is PostgreSQL 20.
+   * 
+ * + * POSTGRES_20 = 781; + */ + POSTGRES_20(781), + /** + * + * + *
+   * The database version is SQL Server 2019 Standard.
+   * 
+ * + * SQLSERVER_2019_STANDARD = 26; + */ + SQLSERVER_2019_STANDARD(26), + /** + * + * + *
+   * The database version is SQL Server 2019 Enterprise.
+   * 
+ * + * SQLSERVER_2019_ENTERPRISE = 27; + */ + SQLSERVER_2019_ENTERPRISE(27), + /** + * + * + *
+   * The database version is SQL Server 2019 Express.
+   * 
+ * + * SQLSERVER_2019_EXPRESS = 28; + */ + SQLSERVER_2019_EXPRESS(28), + /** + * + * + *
+   * The database version is SQL Server 2019 Web.
+   * 
+ * + * SQLSERVER_2019_WEB = 29; + */ + SQLSERVER_2019_WEB(29), + /** + * + * + *
+   * The database version is SQL Server 2022 Standard.
+   * 
+ * + * SQLSERVER_2022_STANDARD = 199; + */ + SQLSERVER_2022_STANDARD(199), + /** + * + * + *
+   * The database version is SQL Server 2022 Enterprise.
+   * 
+ * + * SQLSERVER_2022_ENTERPRISE = 200; + */ + SQLSERVER_2022_ENTERPRISE(200), + /** + * + * + *
+   * The database version is SQL Server 2022 Express.
+   * 
+ * + * SQLSERVER_2022_EXPRESS = 201; + */ + SQLSERVER_2022_EXPRESS(201), + /** + * + * + *
+   * The database version is SQL Server 2022 Web.
+   * 
+ * + * SQLSERVER_2022_WEB = 202; + */ + SQLSERVER_2022_WEB(202), + /** + * + * + *
+   * The database version is SQL Server 2025 Standard.
+   * 
+ * + * SQLSERVER_2025_STANDARD = 549; + */ + SQLSERVER_2025_STANDARD(549), + /** + * + * + *
+   * The database version is SQL Server 2025 Enterprise.
+   * 
+ * + * SQLSERVER_2025_ENTERPRISE = 550; + */ + SQLSERVER_2025_ENTERPRISE(550), + /** + * + * + *
+   * The database version is SQL Server 2025 Express.
+   * 
+ * + * SQLSERVER_2025_EXPRESS = 551; + */ + SQLSERVER_2025_EXPRESS(551), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDatabaseVersion"); + } + + /** + * + * + *
+   * This is an unknown database version.
+   * 
+ * + * SQL_DATABASE_VERSION_UNSPECIFIED = 0; + */ + public static final int SQL_DATABASE_VERSION_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The database version is MySQL 5.1.
+   * 
+ * + * MYSQL_5_1 = 2 [deprecated = true]; + */ + @java.lang.Deprecated public static final int MYSQL_5_1_VALUE = 2; + + /** + * + * + *
+   * The database version is MySQL 5.5.
+   * 
+ * + * MYSQL_5_5 = 3 [deprecated = true]; + */ + @java.lang.Deprecated public static final int MYSQL_5_5_VALUE = 3; + + /** + * + * + *
+   * The database version is MySQL 5.6.
+   * 
+ * + * MYSQL_5_6 = 5; + */ + public static final int MYSQL_5_6_VALUE = 5; + + /** + * + * + *
+   * The database version is MySQL 5.7.
+   * 
+ * + * MYSQL_5_7 = 6; + */ + public static final int MYSQL_5_7_VALUE = 6; + + /** + * + * + *
+   * The database version is MySQL 8.
+   * 
+ * + * MYSQL_8_0 = 20; + */ + public static final int MYSQL_8_0_VALUE = 20; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 18.
+   * 
+ * + * MYSQL_8_0_18 = 41; + */ + public static final int MYSQL_8_0_18_VALUE = 41; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 26.
+   * 
+ * + * MYSQL_8_0_26 = 85; + */ + public static final int MYSQL_8_0_26_VALUE = 85; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 27.
+   * 
+ * + * MYSQL_8_0_27 = 111; + */ + public static final int MYSQL_8_0_27_VALUE = 111; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 28.
+   * 
+ * + * MYSQL_8_0_28 = 132; + */ + public static final int MYSQL_8_0_28_VALUE = 132; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 29.
+   * 
+ * + * MYSQL_8_0_29 = 148 [deprecated = true]; + */ + @java.lang.Deprecated public static final int MYSQL_8_0_29_VALUE = 148; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 30.
+   * 
+ * + * MYSQL_8_0_30 = 174; + */ + public static final int MYSQL_8_0_30_VALUE = 174; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 31.
+   * 
+ * + * MYSQL_8_0_31 = 197; + */ + public static final int MYSQL_8_0_31_VALUE = 197; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 32.
+   * 
+ * + * MYSQL_8_0_32 = 213; + */ + public static final int MYSQL_8_0_32_VALUE = 213; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 33.
+   * 
+ * + * MYSQL_8_0_33 = 238; + */ + public static final int MYSQL_8_0_33_VALUE = 238; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 34.
+   * 
+ * + * MYSQL_8_0_34 = 239; + */ + public static final int MYSQL_8_0_34_VALUE = 239; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 35.
+   * 
+ * + * MYSQL_8_0_35 = 240; + */ + public static final int MYSQL_8_0_35_VALUE = 240; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 36.
+   * 
+ * + * MYSQL_8_0_36 = 241; + */ + public static final int MYSQL_8_0_36_VALUE = 241; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 37.
+   * 
+ * + * MYSQL_8_0_37 = 355; + */ + public static final int MYSQL_8_0_37_VALUE = 355; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 39.
+   * 
+ * + * MYSQL_8_0_39 = 357; + */ + public static final int MYSQL_8_0_39_VALUE = 357; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 40.
+   * 
+ * + * MYSQL_8_0_40 = 358; + */ + public static final int MYSQL_8_0_40_VALUE = 358; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 41.
+   * 
+ * + * MYSQL_8_0_41 = 488; + */ + public static final int MYSQL_8_0_41_VALUE = 488; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 42.
+   * 
+ * + * MYSQL_8_0_42 = 489; + */ + public static final int MYSQL_8_0_42_VALUE = 489; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 43.
+   * 
+ * + * MYSQL_8_0_43 = 553; + */ + public static final int MYSQL_8_0_43_VALUE = 553; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 44.
+   * 
+ * + * MYSQL_8_0_44 = 554; + */ + public static final int MYSQL_8_0_44_VALUE = 554; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 45.
+   * 
+ * + * MYSQL_8_0_45 = 555; + */ + public static final int MYSQL_8_0_45_VALUE = 555; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 46.
+   * 
+ * + * MYSQL_8_0_46 = 556; + */ + public static final int MYSQL_8_0_46_VALUE = 556; + + /** + * + * + *
+   * The database version is MySQL 8.4.
+   * 
+ * + * MYSQL_8_4 = 398; + */ + public static final int MYSQL_8_4_VALUE = 398; + + /** + * + * + *
+   * The database version is MySQL 9.7.
+   * 
+ * + * MYSQL_9_7 = 654; + */ + public static final int MYSQL_9_7_VALUE = 654; + + /** + * + * + *
+   * The database version is SQL Server 2017 Standard.
+   * 
+ * + * SQLSERVER_2017_STANDARD = 11; + */ + public static final int SQLSERVER_2017_STANDARD_VALUE = 11; + + /** + * + * + *
+   * The database version is SQL Server 2017 Enterprise.
+   * 
+ * + * SQLSERVER_2017_ENTERPRISE = 14; + */ + public static final int SQLSERVER_2017_ENTERPRISE_VALUE = 14; + + /** + * + * + *
+   * The database version is SQL Server 2017 Express.
+   * 
+ * + * SQLSERVER_2017_EXPRESS = 15; + */ + public static final int SQLSERVER_2017_EXPRESS_VALUE = 15; + + /** + * + * + *
+   * The database version is SQL Server 2017 Web.
+   * 
+ * + * SQLSERVER_2017_WEB = 16; + */ + public static final int SQLSERVER_2017_WEB_VALUE = 16; + + /** + * + * + *
+   * The database version is PostgreSQL 9.6.
+   * 
+ * + * POSTGRES_9_6 = 9; + */ + public static final int POSTGRES_9_6_VALUE = 9; + + /** + * + * + *
+   * The database version is PostgreSQL 10.
+   * 
+ * + * POSTGRES_10 = 18; + */ + public static final int POSTGRES_10_VALUE = 18; + + /** + * + * + *
+   * The database version is PostgreSQL 11.
+   * 
+ * + * POSTGRES_11 = 10; + */ + public static final int POSTGRES_11_VALUE = 10; + + /** + * + * + *
+   * The database version is PostgreSQL 12.
+   * 
+ * + * POSTGRES_12 = 19; + */ + public static final int POSTGRES_12_VALUE = 19; + + /** + * + * + *
+   * The database version is PostgreSQL 13.
+   * 
+ * + * POSTGRES_13 = 23; + */ + public static final int POSTGRES_13_VALUE = 23; + + /** + * + * + *
+   * The database version is PostgreSQL 14.
+   * 
+ * + * POSTGRES_14 = 110; + */ + public static final int POSTGRES_14_VALUE = 110; + + /** + * + * + *
+   * The database version is PostgreSQL 15.
+   * 
+ * + * POSTGRES_15 = 172; + */ + public static final int POSTGRES_15_VALUE = 172; + + /** + * + * + *
+   * The database version is PostgreSQL 16.
+   * 
+ * + * POSTGRES_16 = 272; + */ + public static final int POSTGRES_16_VALUE = 272; + + /** + * + * + *
+   * The database version is PostgreSQL 17.
+   * 
+ * + * POSTGRES_17 = 408; + */ + public static final int POSTGRES_17_VALUE = 408; + + /** + * + * + *
+   * The database version is PostgreSQL 18.
+   * 
+ * + * POSTGRES_18 = 557; + */ + public static final int POSTGRES_18_VALUE = 557; + + /** + * + * + *
+   * The database version is PostgreSQL 19.
+   * 
+ * + * POSTGRES_19 = 684; + */ + public static final int POSTGRES_19_VALUE = 684; + + /** + * + * + *
+   * The database version is PostgreSQL 20.
+   * 
+ * + * POSTGRES_20 = 781; + */ + public static final int POSTGRES_20_VALUE = 781; + + /** + * + * + *
+   * The database version is SQL Server 2019 Standard.
+   * 
+ * + * SQLSERVER_2019_STANDARD = 26; + */ + public static final int SQLSERVER_2019_STANDARD_VALUE = 26; + + /** + * + * + *
+   * The database version is SQL Server 2019 Enterprise.
+   * 
+ * + * SQLSERVER_2019_ENTERPRISE = 27; + */ + public static final int SQLSERVER_2019_ENTERPRISE_VALUE = 27; + + /** + * + * + *
+   * The database version is SQL Server 2019 Express.
+   * 
+ * + * SQLSERVER_2019_EXPRESS = 28; + */ + public static final int SQLSERVER_2019_EXPRESS_VALUE = 28; + + /** + * + * + *
+   * The database version is SQL Server 2019 Web.
+   * 
+ * + * SQLSERVER_2019_WEB = 29; + */ + public static final int SQLSERVER_2019_WEB_VALUE = 29; + + /** + * + * + *
+   * The database version is SQL Server 2022 Standard.
+   * 
+ * + * SQLSERVER_2022_STANDARD = 199; + */ + public static final int SQLSERVER_2022_STANDARD_VALUE = 199; + + /** + * + * + *
+   * The database version is SQL Server 2022 Enterprise.
+   * 
+ * + * SQLSERVER_2022_ENTERPRISE = 200; + */ + public static final int SQLSERVER_2022_ENTERPRISE_VALUE = 200; + + /** + * + * + *
+   * The database version is SQL Server 2022 Express.
+   * 
+ * + * SQLSERVER_2022_EXPRESS = 201; + */ + public static final int SQLSERVER_2022_EXPRESS_VALUE = 201; + + /** + * + * + *
+   * The database version is SQL Server 2022 Web.
+   * 
+ * + * SQLSERVER_2022_WEB = 202; + */ + public static final int SQLSERVER_2022_WEB_VALUE = 202; + + /** + * + * + *
+   * The database version is SQL Server 2025 Standard.
+   * 
+ * + * SQLSERVER_2025_STANDARD = 549; + */ + public static final int SQLSERVER_2025_STANDARD_VALUE = 549; + + /** + * + * + *
+   * The database version is SQL Server 2025 Enterprise.
+   * 
+ * + * SQLSERVER_2025_ENTERPRISE = 550; + */ + public static final int SQLSERVER_2025_ENTERPRISE_VALUE = 550; + + /** + * + * + *
+   * The database version is SQL Server 2025 Express.
+   * 
+ * + * SQLSERVER_2025_EXPRESS = 551; + */ + public static final int SQLSERVER_2025_EXPRESS_VALUE = 551; + + 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 SqlDatabaseVersion 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 SqlDatabaseVersion forNumber(int value) { + switch (value) { + case 0: + return SQL_DATABASE_VERSION_UNSPECIFIED; + case 2: + return MYSQL_5_1; + case 3: + return MYSQL_5_5; + case 5: + return MYSQL_5_6; + case 6: + return MYSQL_5_7; + case 20: + return MYSQL_8_0; + case 41: + return MYSQL_8_0_18; + case 85: + return MYSQL_8_0_26; + case 111: + return MYSQL_8_0_27; + case 132: + return MYSQL_8_0_28; + case 148: + return MYSQL_8_0_29; + case 174: + return MYSQL_8_0_30; + case 197: + return MYSQL_8_0_31; + case 213: + return MYSQL_8_0_32; + case 238: + return MYSQL_8_0_33; + case 239: + return MYSQL_8_0_34; + case 240: + return MYSQL_8_0_35; + case 241: + return MYSQL_8_0_36; + case 355: + return MYSQL_8_0_37; + case 357: + return MYSQL_8_0_39; + case 358: + return MYSQL_8_0_40; + case 488: + return MYSQL_8_0_41; + case 489: + return MYSQL_8_0_42; + case 553: + return MYSQL_8_0_43; + case 554: + return MYSQL_8_0_44; + case 555: + return MYSQL_8_0_45; + case 556: + return MYSQL_8_0_46; + case 398: + return MYSQL_8_4; + case 654: + return MYSQL_9_7; + case 11: + return SQLSERVER_2017_STANDARD; + case 14: + return SQLSERVER_2017_ENTERPRISE; + case 15: + return SQLSERVER_2017_EXPRESS; + case 16: + return SQLSERVER_2017_WEB; + case 9: + return POSTGRES_9_6; + case 18: + return POSTGRES_10; + case 10: + return POSTGRES_11; + case 19: + return POSTGRES_12; + case 23: + return POSTGRES_13; + case 110: + return POSTGRES_14; + case 172: + return POSTGRES_15; + case 272: + return POSTGRES_16; + case 408: + return POSTGRES_17; + case 557: + return POSTGRES_18; + case 684: + return POSTGRES_19; + case 781: + return POSTGRES_20; + case 26: + return SQLSERVER_2019_STANDARD; + case 27: + return SQLSERVER_2019_ENTERPRISE; + case 28: + return SQLSERVER_2019_EXPRESS; + case 29: + return SQLSERVER_2019_WEB; + case 199: + return SQLSERVER_2022_STANDARD; + case 200: + return SQLSERVER_2022_ENTERPRISE; + case 201: + return SQLSERVER_2022_EXPRESS; + case 202: + return SQLSERVER_2022_WEB; + case 549: + return SQLSERVER_2025_STANDARD; + case 550: + return SQLSERVER_2025_ENTERPRISE; + case 551: + return SQLSERVER_2025_EXPRESS; + 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 SqlDatabaseVersion findValueByNumber(int number) { + return SqlDatabaseVersion.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor().getEnumTypes().get(5); + } + + private static final SqlDatabaseVersion[] VALUES = values(); + + public static SqlDatabaseVersion 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 SqlDatabaseVersion(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlDatabaseVersion) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesDeleteRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesDeleteRequest.java new file mode 100644 index 000000000000..737c844c90fd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesDeleteRequest.java @@ -0,0 +1,974 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_databases.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database delete request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlDatabasesDeleteRequest} + */ +@com.google.protobuf.Generated +public final class SqlDatabasesDeleteRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlDatabasesDeleteRequest) + SqlDatabasesDeleteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDatabasesDeleteRequest"); + } + + // Use SqlDatabasesDeleteRequest.newBuilder() to construct. + private SqlDatabasesDeleteRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlDatabasesDeleteRequest() { + database_ = ""; + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest.class, + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest.Builder.class); + } + + public static final int DATABASE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * Name of the database to be deleted in the instance.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the database to be deleted in the instance.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlDatabasesDeleteRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest other = + (com.google.cloud.sql.v1.SqlDatabasesDeleteRequest) obj; + + if (!getDatabase().equals(other.getDatabase())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlDatabasesDeleteRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesDeleteRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesDeleteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesDeleteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesDeleteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesDeleteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesDeleteRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesDeleteRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesDeleteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesDeleteRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlDatabasesDeleteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database delete request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlDatabasesDeleteRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlDatabasesDeleteRequest) + com.google.cloud.sql.v1.SqlDatabasesDeleteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest.class, + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlDatabasesDeleteRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + database_ = ""; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesDeleteRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesDeleteRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlDatabasesDeleteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesDeleteRequest build() { + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesDeleteRequest buildPartial() { + com.google.cloud.sql.v1.SqlDatabasesDeleteRequest result = + new com.google.cloud.sql.v1.SqlDatabasesDeleteRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlDatabasesDeleteRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.database_ = database_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlDatabasesDeleteRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlDatabasesDeleteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlDatabasesDeleteRequest other) { + if (other == com.google.cloud.sql.v1.SqlDatabasesDeleteRequest.getDefaultInstance()) + return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + database_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object database_ = ""; + + /** + * + * + *
+     * Name of the database to be deleted in the instance.
+     * 
+ * + * string database = 1; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the database to be deleted in the instance.
+     * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the database to be deleted in the instance.
+     * 
+ * + * string database = 1; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database to be deleted in the instance.
+     * 
+ * + * string database = 1; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database to be deleted in the instance.
+     * 
+ * + * string database = 1; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlDatabasesDeleteRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlDatabasesDeleteRequest) + private static final com.google.cloud.sql.v1.SqlDatabasesDeleteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlDatabasesDeleteRequest(); + } + + public static com.google.cloud.sql.v1.SqlDatabasesDeleteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlDatabasesDeleteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesDeleteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesDeleteRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesDeleteRequestOrBuilder.java new file mode 100644 index 000000000000..814ad6b16977 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesDeleteRequestOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_databases.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlDatabasesDeleteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlDatabasesDeleteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the database to be deleted in the instance.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * Name of the database to be deleted in the instance.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesGetRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesGetRequest.java new file mode 100644 index 000000000000..339f82961b9e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesGetRequest.java @@ -0,0 +1,973 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_databases.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database get request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlDatabasesGetRequest} + */ +@com.google.protobuf.Generated +public final class SqlDatabasesGetRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlDatabasesGetRequest) + SqlDatabasesGetRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDatabasesGetRequest"); + } + + // Use SqlDatabasesGetRequest.newBuilder() to construct. + private SqlDatabasesGetRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlDatabasesGetRequest() { + database_ = ""; + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlDatabasesGetRequest.class, + com.google.cloud.sql.v1.SqlDatabasesGetRequest.Builder.class); + } + + public static final int DATABASE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * Name of the database in the instance.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the database in the instance.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlDatabasesGetRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlDatabasesGetRequest other = + (com.google.cloud.sql.v1.SqlDatabasesGetRequest) obj; + + if (!getDatabase().equals(other.getDatabase())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlDatabasesGetRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesGetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesGetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesGetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesGetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesGetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesGetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesGetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesGetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesGetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesGetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesGetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlDatabasesGetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database get request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlDatabasesGetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlDatabasesGetRequest) + com.google.cloud.sql.v1.SqlDatabasesGetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlDatabasesGetRequest.class, + com.google.cloud.sql.v1.SqlDatabasesGetRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlDatabasesGetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + database_ = ""; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesGetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesGetRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlDatabasesGetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesGetRequest build() { + com.google.cloud.sql.v1.SqlDatabasesGetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesGetRequest buildPartial() { + com.google.cloud.sql.v1.SqlDatabasesGetRequest result = + new com.google.cloud.sql.v1.SqlDatabasesGetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlDatabasesGetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.database_ = database_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlDatabasesGetRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlDatabasesGetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlDatabasesGetRequest other) { + if (other == com.google.cloud.sql.v1.SqlDatabasesGetRequest.getDefaultInstance()) return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + database_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object database_ = ""; + + /** + * + * + *
+     * Name of the database in the instance.
+     * 
+ * + * string database = 1; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the database in the instance.
+     * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the database in the instance.
+     * 
+ * + * string database = 1; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database in the instance.
+     * 
+ * + * string database = 1; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database in the instance.
+     * 
+ * + * string database = 1; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlDatabasesGetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlDatabasesGetRequest) + private static final com.google.cloud.sql.v1.SqlDatabasesGetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlDatabasesGetRequest(); + } + + public static com.google.cloud.sql.v1.SqlDatabasesGetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlDatabasesGetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesGetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesGetRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesGetRequestOrBuilder.java new file mode 100644 index 000000000000..5282ea21b03f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesGetRequestOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_databases.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlDatabasesGetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlDatabasesGetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the database in the instance.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * Name of the database in the instance.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesInsertRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesInsertRequest.java new file mode 100644 index 000000000000..68f2a8139d50 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesInsertRequest.java @@ -0,0 +1,980 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_databases.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database insert request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlDatabasesInsertRequest} + */ +@com.google.protobuf.Generated +public final class SqlDatabasesInsertRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlDatabasesInsertRequest) + SqlDatabasesInsertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDatabasesInsertRequest"); + } + + // Use SqlDatabasesInsertRequest.newBuilder() to construct. + private SqlDatabasesInsertRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlDatabasesInsertRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlDatabasesInsertRequest.class, + com.google.cloud.sql.v1.SqlDatabasesInsertRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.Database body_; + + /** + * .google.cloud.sql.v1.Database body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.Database body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Database getBody() { + return body_ == null ? com.google.cloud.sql.v1.Database.getDefaultInstance() : body_; + } + + /** .google.cloud.sql.v1.Database body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseOrBuilder getBodyOrBuilder() { + return body_ == null ? com.google.cloud.sql.v1.Database.getDefaultInstance() : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlDatabasesInsertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlDatabasesInsertRequest other = + (com.google.cloud.sql.v1.SqlDatabasesInsertRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlDatabasesInsertRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesInsertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesInsertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesInsertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesInsertRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesInsertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesInsertRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesInsertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesInsertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesInsertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlDatabasesInsertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database insert request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlDatabasesInsertRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlDatabasesInsertRequest) + com.google.cloud.sql.v1.SqlDatabasesInsertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlDatabasesInsertRequest.class, + com.google.cloud.sql.v1.SqlDatabasesInsertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlDatabasesInsertRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesInsertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesInsertRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlDatabasesInsertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesInsertRequest build() { + com.google.cloud.sql.v1.SqlDatabasesInsertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesInsertRequest buildPartial() { + com.google.cloud.sql.v1.SqlDatabasesInsertRequest result = + new com.google.cloud.sql.v1.SqlDatabasesInsertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlDatabasesInsertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlDatabasesInsertRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlDatabasesInsertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlDatabasesInsertRequest other) { + if (other == com.google.cloud.sql.v1.SqlDatabasesInsertRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.Database body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Database, + com.google.cloud.sql.v1.Database.Builder, + com.google.cloud.sql.v1.DatabaseOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.Database body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.Database body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.Database getBody() { + if (bodyBuilder_ == null) { + return body_ == null ? com.google.cloud.sql.v1.Database.getDefaultInstance() : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.Database body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.Database value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.Database body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.Database.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.Database body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.Database value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.Database.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.Database body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.Database body = 100; */ + public com.google.cloud.sql.v1.Database.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.Database body = 100; */ + public com.google.cloud.sql.v1.DatabaseOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null ? com.google.cloud.sql.v1.Database.getDefaultInstance() : body_; + } + } + + /** .google.cloud.sql.v1.Database body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Database, + com.google.cloud.sql.v1.Database.Builder, + com.google.cloud.sql.v1.DatabaseOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Database, + com.google.cloud.sql.v1.Database.Builder, + com.google.cloud.sql.v1.DatabaseOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlDatabasesInsertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlDatabasesInsertRequest) + private static final com.google.cloud.sql.v1.SqlDatabasesInsertRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlDatabasesInsertRequest(); + } + + public static com.google.cloud.sql.v1.SqlDatabasesInsertRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlDatabasesInsertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesInsertRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesInsertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesInsertRequestOrBuilder.java new file mode 100644 index 000000000000..4570757146d7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesInsertRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_databases.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlDatabasesInsertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlDatabasesInsertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.Database body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.Database body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.Database getBody(); + + /** .google.cloud.sql.v1.Database body = 100; */ + com.google.cloud.sql.v1.DatabaseOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesListRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesListRequest.java new file mode 100644 index 000000000000..146e631b40f7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesListRequest.java @@ -0,0 +1,785 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_databases.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database list request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlDatabasesListRequest} + */ +@com.google.protobuf.Generated +public final class SqlDatabasesListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlDatabasesListRequest) + SqlDatabasesListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDatabasesListRequest"); + } + + // Use SqlDatabasesListRequest.newBuilder() to construct. + private SqlDatabasesListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlDatabasesListRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlDatabasesListRequest.class, + com.google.cloud.sql.v1.SqlDatabasesListRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlDatabasesListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlDatabasesListRequest other = + (com.google.cloud.sql.v1.SqlDatabasesListRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlDatabasesListRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesListRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlDatabasesListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database list request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlDatabasesListRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlDatabasesListRequest) + com.google.cloud.sql.v1.SqlDatabasesListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlDatabasesListRequest.class, + com.google.cloud.sql.v1.SqlDatabasesListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlDatabasesListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlDatabasesListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesListRequest build() { + com.google.cloud.sql.v1.SqlDatabasesListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesListRequest buildPartial() { + com.google.cloud.sql.v1.SqlDatabasesListRequest result = + new com.google.cloud.sql.v1.SqlDatabasesListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlDatabasesListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlDatabasesListRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlDatabasesListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlDatabasesListRequest other) { + if (other == com.google.cloud.sql.v1.SqlDatabasesListRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlDatabasesListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlDatabasesListRequest) + private static final com.google.cloud.sql.v1.SqlDatabasesListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlDatabasesListRequest(); + } + + public static com.google.cloud.sql.v1.SqlDatabasesListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlDatabasesListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesListRequestOrBuilder.java new file mode 100644 index 000000000000..66d9eb3f8a54 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesListRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_databases.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlDatabasesListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlDatabasesListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesUpdateRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesUpdateRequest.java new file mode 100644 index 000000000000..4ba519736ab3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesUpdateRequest.java @@ -0,0 +1,1169 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_databases.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database update request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlDatabasesUpdateRequest} + */ +@com.google.protobuf.Generated +public final class SqlDatabasesUpdateRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlDatabasesUpdateRequest) + SqlDatabasesUpdateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDatabasesUpdateRequest"); + } + + // Use SqlDatabasesUpdateRequest.newBuilder() to construct. + private SqlDatabasesUpdateRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlDatabasesUpdateRequest() { + database_ = ""; + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesUpdateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesUpdateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest.class, + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest.Builder.class); + } + + private int bitField0_; + public static final int DATABASE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * Name of the database to be updated in the instance.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the database to be updated in the instance.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.Database body_; + + /** + * .google.cloud.sql.v1.Database body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.Database body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Database getBody() { + return body_ == null ? com.google.cloud.sql.v1.Database.getDefaultInstance() : body_; + } + + /** .google.cloud.sql.v1.Database body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseOrBuilder getBodyOrBuilder() { + return body_ == null ? com.google.cloud.sql.v1.Database.getDefaultInstance() : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlDatabasesUpdateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest other = + (com.google.cloud.sql.v1.SqlDatabasesUpdateRequest) obj; + + if (!getDatabase().equals(other.getDatabase())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlDatabasesUpdateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesUpdateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesUpdateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesUpdateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesUpdateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlDatabasesUpdateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesUpdateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesUpdateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesUpdateRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesUpdateRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlDatabasesUpdateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlDatabasesUpdateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlDatabasesUpdateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database update request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlDatabasesUpdateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlDatabasesUpdateRequest) + com.google.cloud.sql.v1.SqlDatabasesUpdateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesUpdateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesUpdateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest.class, + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlDatabasesUpdateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + database_ = ""; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlDatabasesProto + .internal_static_google_cloud_sql_v1_SqlDatabasesUpdateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesUpdateRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlDatabasesUpdateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesUpdateRequest build() { + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesUpdateRequest buildPartial() { + com.google.cloud.sql.v1.SqlDatabasesUpdateRequest result = + new com.google.cloud.sql.v1.SqlDatabasesUpdateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlDatabasesUpdateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.database_ = database_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlDatabasesUpdateRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlDatabasesUpdateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlDatabasesUpdateRequest other) { + if (other == com.google.cloud.sql.v1.SqlDatabasesUpdateRequest.getDefaultInstance()) + return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + database_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 database_ = ""; + + /** + * + * + *
+     * Name of the database to be updated in the instance.
+     * 
+ * + * string database = 1; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the database to be updated in the instance.
+     * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the database to be updated in the instance.
+     * 
+ * + * string database = 1; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database to be updated in the instance.
+     * 
+ * + * string database = 1; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database to be updated in the instance.
+     * 
+ * + * string database = 1; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.Database body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Database, + com.google.cloud.sql.v1.Database.Builder, + com.google.cloud.sql.v1.DatabaseOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.Database body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * .google.cloud.sql.v1.Database body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.Database getBody() { + if (bodyBuilder_ == null) { + return body_ == null ? com.google.cloud.sql.v1.Database.getDefaultInstance() : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.Database body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.Database value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.Database body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.Database.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.Database body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.Database value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.Database.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.Database body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000008); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.Database body = 100; */ + public com.google.cloud.sql.v1.Database.Builder getBodyBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.Database body = 100; */ + public com.google.cloud.sql.v1.DatabaseOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null ? com.google.cloud.sql.v1.Database.getDefaultInstance() : body_; + } + } + + /** .google.cloud.sql.v1.Database body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Database, + com.google.cloud.sql.v1.Database.Builder, + com.google.cloud.sql.v1.DatabaseOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Database, + com.google.cloud.sql.v1.Database.Builder, + com.google.cloud.sql.v1.DatabaseOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlDatabasesUpdateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlDatabasesUpdateRequest) + private static final com.google.cloud.sql.v1.SqlDatabasesUpdateRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlDatabasesUpdateRequest(); + } + + public static com.google.cloud.sql.v1.SqlDatabasesUpdateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlDatabasesUpdateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlDatabasesUpdateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesUpdateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesUpdateRequestOrBuilder.java new file mode 100644 index 000000000000..59caf802001e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlDatabasesUpdateRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_databases.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlDatabasesUpdateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlDatabasesUpdateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the database to be updated in the instance.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * Name of the database to be updated in the instance.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.Database body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.Database body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.Database getBody(); + + /** .google.cloud.sql.v1.Database body = 100; */ + com.google.cloud.sql.v1.DatabaseOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlExternalSyncSettingError.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlExternalSyncSettingError.java new file mode 100644 index 000000000000..0c2c825457a8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlExternalSyncSettingError.java @@ -0,0 +1,2427 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * External primary instance migration setting error/warning.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlExternalSyncSettingError} + */ +@com.google.protobuf.Generated +public final class SqlExternalSyncSettingError extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlExternalSyncSettingError) + SqlExternalSyncSettingErrorOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlExternalSyncSettingError"); + } + + // Use SqlExternalSyncSettingError.newBuilder() to construct. + private SqlExternalSyncSettingError(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlExternalSyncSettingError() { + kind_ = ""; + type_ = 0; + detail_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlExternalSyncSettingError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlExternalSyncSettingError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlExternalSyncSettingError.class, + com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder.class); + } + + /** + * Protobuf enum {@code + * google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType} + */ + public enum SqlExternalSyncSettingErrorType implements com.google.protobuf.ProtocolMessageEnum { + /** SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED = 0; */ + SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED(0), + /** CONNECTION_FAILURE = 1; */ + CONNECTION_FAILURE(1), + /** BINLOG_NOT_ENABLED = 2; */ + BINLOG_NOT_ENABLED(2), + /** INCOMPATIBLE_DATABASE_VERSION = 3; */ + INCOMPATIBLE_DATABASE_VERSION(3), + /** REPLICA_ALREADY_SETUP = 4; */ + REPLICA_ALREADY_SETUP(4), + /** + * + * + *
+     * The replication user is missing privileges that are required.
+     * 
+ * + * INSUFFICIENT_PRIVILEGE = 5; + */ + INSUFFICIENT_PRIVILEGE(5), + /** + * + * + *
+     * Unsupported migration type.
+     * 
+ * + * UNSUPPORTED_MIGRATION_TYPE = 6; + */ + UNSUPPORTED_MIGRATION_TYPE(6), + /** + * + * + *
+     * No pglogical extension installed on databases, applicable for postgres.
+     * 
+ * + * NO_PGLOGICAL_INSTALLED = 7; + */ + NO_PGLOGICAL_INSTALLED(7), + /** + * + * + *
+     * pglogical node already exists on databases, applicable for postgres.
+     * 
+ * + * PGLOGICAL_NODE_ALREADY_EXISTS = 8; + */ + PGLOGICAL_NODE_ALREADY_EXISTS(8), + /** + * + * + *
+     * The value of parameter wal_level is not set to logical.
+     * 
+ * + * INVALID_WAL_LEVEL = 9; + */ + INVALID_WAL_LEVEL(9), + /** + * + * + *
+     * The value of parameter shared_preload_libraries does not include
+     * pglogical.
+     * 
+ * + * INVALID_SHARED_PRELOAD_LIBRARY = 10; + */ + INVALID_SHARED_PRELOAD_LIBRARY(10), + /** + * + * + *
+     * The value of parameter max_replication_slots is not sufficient.
+     * 
+ * + * INSUFFICIENT_MAX_REPLICATION_SLOTS = 11; + */ + INSUFFICIENT_MAX_REPLICATION_SLOTS(11), + /** + * + * + *
+     * The value of parameter max_wal_senders is not sufficient.
+     * 
+ * + * INSUFFICIENT_MAX_WAL_SENDERS = 12; + */ + INSUFFICIENT_MAX_WAL_SENDERS(12), + /** + * + * + *
+     * The value of parameter max_worker_processes is not sufficient.
+     * 
+ * + * INSUFFICIENT_MAX_WORKER_PROCESSES = 13; + */ + INSUFFICIENT_MAX_WORKER_PROCESSES(13), + /** + * + * + *
+     * Extensions installed are either not supported or having unsupported
+     * versions.
+     * 
+ * + * UNSUPPORTED_EXTENSIONS = 14; + */ + UNSUPPORTED_EXTENSIONS(14), + /** + * + * + *
+     * The value of parameter rds.logical_replication is not set to 1.
+     * 
+ * + * INVALID_RDS_LOGICAL_REPLICATION = 15; + */ + INVALID_RDS_LOGICAL_REPLICATION(15), + /** + * + * + *
+     * The primary instance logging setup doesn't allow EM sync.
+     * 
+ * + * INVALID_LOGGING_SETUP = 16; + */ + INVALID_LOGGING_SETUP(16), + /** + * + * + *
+     * The primary instance database parameter setup doesn't allow EM sync.
+     * 
+ * + * INVALID_DB_PARAM = 17; + */ + INVALID_DB_PARAM(17), + /** + * + * + *
+     * The gtid_mode is not supported, applicable for MySQL.
+     * 
+ * + * UNSUPPORTED_GTID_MODE = 18; + */ + UNSUPPORTED_GTID_MODE(18), + /** + * + * + *
+     * SQL Server Agent is not running.
+     * 
+ * + * SQLSERVER_AGENT_NOT_RUNNING = 19; + */ + SQLSERVER_AGENT_NOT_RUNNING(19), + /** + * + * + *
+     * The table definition is not support due to missing primary key or replica
+     * identity, applicable for postgres. Note that this is a warning and won't
+     * block the migration.
+     * 
+ * + * UNSUPPORTED_TABLE_DEFINITION = 20; + */ + UNSUPPORTED_TABLE_DEFINITION(20), + /** + * + * + *
+     * The customer has a definer that will break EM setup.
+     * 
+ * + * UNSUPPORTED_DEFINER = 21; + */ + UNSUPPORTED_DEFINER(21), + /** + * + * + *
+     * SQL Server @@SERVERNAME does not match actual host name.
+     * 
+ * + * SQLSERVER_SERVERNAME_MISMATCH = 22; + */ + SQLSERVER_SERVERNAME_MISMATCH(22), + /** + * + * + *
+     * The primary instance has been setup and will fail the setup.
+     * 
+ * + * PRIMARY_ALREADY_SETUP = 23; + */ + PRIMARY_ALREADY_SETUP(23), + /** + * + * + *
+     * The primary instance has unsupported binary log format.
+     * 
+ * + * UNSUPPORTED_BINLOG_FORMAT = 24; + */ + UNSUPPORTED_BINLOG_FORMAT(24), + /** + * + * + *
+     * The primary instance's binary log retention setting.
+     * 
+ * + * BINLOG_RETENTION_SETTING = 25; + */ + BINLOG_RETENTION_SETTING(25), + /** + * + * + *
+     * The primary instance has tables with unsupported storage engine.
+     * 
+ * + * UNSUPPORTED_STORAGE_ENGINE = 26; + */ + UNSUPPORTED_STORAGE_ENGINE(26), + /** + * + * + *
+     * Source has tables with limited support
+     * eg: PostgreSQL tables without primary keys.
+     * 
+ * + * LIMITED_SUPPORT_TABLES = 27; + */ + LIMITED_SUPPORT_TABLES(27), + /** + * + * + *
+     * The replica instance contains existing data.
+     * 
+ * + * EXISTING_DATA_IN_REPLICA = 28; + */ + EXISTING_DATA_IN_REPLICA(28), + /** + * + * + *
+     * The replication user is missing privileges that are optional.
+     * 
+ * + * MISSING_OPTIONAL_PRIVILEGES = 29; + */ + MISSING_OPTIONAL_PRIVILEGES(29), + /** + * + * + *
+     * Additional BACKUP_ADMIN privilege is granted to the replication user
+     * which may lock source MySQL 8 instance for DDLs during initial sync.
+     * 
+ * + * RISKY_BACKUP_ADMIN_PRIVILEGE = 30; + */ + RISKY_BACKUP_ADMIN_PRIVILEGE(30), + /** + * + * + *
+     * The Cloud Storage bucket is missing necessary permissions.
+     * 
+ * + * INSUFFICIENT_GCS_PERMISSIONS = 31; + */ + INSUFFICIENT_GCS_PERMISSIONS(31), + /** + * + * + *
+     * The Cloud Storage bucket has an error in the file or contains invalid
+     * file information.
+     * 
+ * + * INVALID_FILE_INFO = 32; + */ + INVALID_FILE_INFO(32), + /** + * + * + *
+     * The source instance has unsupported database settings for migration.
+     * 
+ * + * UNSUPPORTED_DATABASE_SETTINGS = 33; + */ + UNSUPPORTED_DATABASE_SETTINGS(33), + /** + * + * + *
+     * The replication user is missing parallel import specific privileges.
+     * (e.g. LOCK TABLES) for MySQL.
+     * 
+ * + * MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE = 34; + */ + MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE(34), + /** + * + * + *
+     * The global variable local_infile is off on external server replica.
+     * 
+ * + * LOCAL_INFILE_OFF = 35; + */ + LOCAL_INFILE_OFF(35), + /** + * + * + *
+     * This code instructs customers to turn on point-in-time recovery manually
+     * for the instance after promoting the Cloud SQL for PostgreSQL instance.
+     * 
+ * + * TURN_ON_PITR_AFTER_PROMOTE = 36; + */ + TURN_ON_PITR_AFTER_PROMOTE(36), + /** + * + * + *
+     * The minor version of replica database is incompatible with the source.
+     * 
+ * + * INCOMPATIBLE_DATABASE_MINOR_VERSION = 37; + */ + INCOMPATIBLE_DATABASE_MINOR_VERSION(37), + /** + * + * + *
+     * This warning message indicates that Cloud SQL uses the maximum number of
+     * subscriptions to migrate data from the source to the destination.
+     * 
+ * + * SOURCE_MAX_SUBSCRIPTIONS = 38; + */ + SOURCE_MAX_SUBSCRIPTIONS(38), + /** + * + * + *
+     * Unable to verify definers on the source for MySQL.
+     * 
+ * + * UNABLE_TO_VERIFY_DEFINERS = 39; + */ + UNABLE_TO_VERIFY_DEFINERS(39), + /** + * + * + *
+     * If a time out occurs while the subscription counts are calculated, then
+     * this value is set to 1. Otherwise, this value is set to 2.
+     * 
+ * + * SUBSCRIPTION_CALCULATION_STATUS = 40; + */ + SUBSCRIPTION_CALCULATION_STATUS(40), + /** + * + * + *
+     * Count of subscriptions needed to sync source data for PostgreSQL
+     * database.
+     * 
+ * + * PG_SUBSCRIPTION_COUNT = 41; + */ + PG_SUBSCRIPTION_COUNT(41), + /** + * + * + *
+     * Final parallel level that is used to do migration.
+     * 
+ * + * PG_SYNC_PARALLEL_LEVEL = 42; + */ + PG_SYNC_PARALLEL_LEVEL(42), + /** + * + * + *
+     * The disk size of the replica instance is smaller than the data size of
+     * the source instance.
+     * 
+ * + * INSUFFICIENT_DISK_SIZE = 43; + */ + INSUFFICIENT_DISK_SIZE(43), + /** + * + * + *
+     * The data size of the source instance is greater than 1 TB, the number of
+     * cores of the replica instance is less than 8, and the memory of the
+     * replica is less than 32 GB.
+     * 
+ * + * INSUFFICIENT_MACHINE_TIER = 44; + */ + INSUFFICIENT_MACHINE_TIER(44), + /** + * + * + *
+     * The warning message indicates the unsupported extensions will not be
+     * migrated to the destination.
+     * 
+ * + * UNSUPPORTED_EXTENSIONS_NOT_MIGRATED = 45; + */ + UNSUPPORTED_EXTENSIONS_NOT_MIGRATED(45), + /** + * + * + *
+     * The warning message indicates the pg_cron extension and settings will not
+     * be migrated to the destination.
+     * 
+ * + * EXTENSIONS_NOT_MIGRATED = 46; + */ + EXTENSIONS_NOT_MIGRATED(46), + /** + * + * + *
+     * The error message indicates that pg_cron flags are enabled on the
+     * destination which is not supported during the migration.
+     * 
+ * + * PG_CRON_FLAG_ENABLED_IN_REPLICA = 47; + */ + PG_CRON_FLAG_ENABLED_IN_REPLICA(47), + /** + * + * + *
+     * This error message indicates that the specified extensions are not
+     * enabled on destination instance. For example, before you can migrate
+     * data to the destination instance, you must enable the PGAudit extension
+     * on the instance.
+     * 
+ * + * EXTENSIONS_NOT_ENABLED_IN_REPLICA = 48; + */ + EXTENSIONS_NOT_ENABLED_IN_REPLICA(48), + /** + * + * + *
+     * The source database has generated columns that can't be migrated. Please
+     * change them to regular columns before migration.
+     * 
+ * + * UNSUPPORTED_COLUMNS = 49; + */ + UNSUPPORTED_COLUMNS(49), + /** + * + * + *
+     * The source database has users that aren't created in the replica.
+     * First, create all users, which are in the pg_user_mappings table
+     * of the source database, in the destination instance. Then, perform the
+     * migration.
+     * 
+ * + * USERS_NOT_CREATED_IN_REPLICA = 50; + */ + USERS_NOT_CREATED_IN_REPLICA(50), + /** + * + * + *
+     * The selected objects include system objects that aren't supported for
+     * migration.
+     * 
+ * + * UNSUPPORTED_SYSTEM_OBJECTS = 51; + */ + UNSUPPORTED_SYSTEM_OBJECTS(51), + /** + * + * + *
+     * The source database has tables with the FULL or NOTHING replica identity.
+     * Before starting your migration, either remove the identity or change it
+     * to DEFAULT. Note that this is an error and will block the migration.
+     * 
+ * + * UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY = 52; + */ + UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY(52), + /** + * + * + *
+     * The selected objects don't exist on the source instance.
+     * 
+ * + * SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE = 53; + */ + SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE(53), + /** + * + * + *
+     * PSC only destination instance does not have a network attachment URI.
+     * 
+ * + * PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI = 54; + */ + PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI(54), + /** + * + * + *
+     * Selected objects reference unselected objects. Based on their object type
+     * (foreign key constraint or view), selected objects will fail during
+     * migration.
+     * 
+ * + * SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS = 55; + */ + SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS(55), + /** + * + * + *
+     * The migration will delete existing data in the replica; set
+     * [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
+     * in the request to acknowledge this. This is an error. MySQL only.
+     * 
+ * + * PROMPT_DELETE_EXISTING = 56; + */ + PROMPT_DELETE_EXISTING(56), + /** + * + * + *
+     * The migration will delete existing data in the replica;
+     * [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
+     * was set in the request acknowledging this. This is a warning rather than
+     * an error. MySQL only.
+     * 
+ * + * WILL_DELETE_EXISTING = 57; + */ + WILL_DELETE_EXISTING(57), + /** + * + * + *
+     * The replication user is missing specific privileges to setup DDL
+     * replication. (e.g. CREATE EVENT TRIGGER, CREATE SCHEMA) for PostgreSQL.
+     * 
+ * + * PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE = 58; + */ + PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE(58), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlExternalSyncSettingErrorType"); + } + + /** SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED = 0; */ + public static final int SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED_VALUE = 0; + + /** CONNECTION_FAILURE = 1; */ + public static final int CONNECTION_FAILURE_VALUE = 1; + + /** BINLOG_NOT_ENABLED = 2; */ + public static final int BINLOG_NOT_ENABLED_VALUE = 2; + + /** INCOMPATIBLE_DATABASE_VERSION = 3; */ + public static final int INCOMPATIBLE_DATABASE_VERSION_VALUE = 3; + + /** REPLICA_ALREADY_SETUP = 4; */ + public static final int REPLICA_ALREADY_SETUP_VALUE = 4; + + /** + * + * + *
+     * The replication user is missing privileges that are required.
+     * 
+ * + * INSUFFICIENT_PRIVILEGE = 5; + */ + public static final int INSUFFICIENT_PRIVILEGE_VALUE = 5; + + /** + * + * + *
+     * Unsupported migration type.
+     * 
+ * + * UNSUPPORTED_MIGRATION_TYPE = 6; + */ + public static final int UNSUPPORTED_MIGRATION_TYPE_VALUE = 6; + + /** + * + * + *
+     * No pglogical extension installed on databases, applicable for postgres.
+     * 
+ * + * NO_PGLOGICAL_INSTALLED = 7; + */ + public static final int NO_PGLOGICAL_INSTALLED_VALUE = 7; + + /** + * + * + *
+     * pglogical node already exists on databases, applicable for postgres.
+     * 
+ * + * PGLOGICAL_NODE_ALREADY_EXISTS = 8; + */ + public static final int PGLOGICAL_NODE_ALREADY_EXISTS_VALUE = 8; + + /** + * + * + *
+     * The value of parameter wal_level is not set to logical.
+     * 
+ * + * INVALID_WAL_LEVEL = 9; + */ + public static final int INVALID_WAL_LEVEL_VALUE = 9; + + /** + * + * + *
+     * The value of parameter shared_preload_libraries does not include
+     * pglogical.
+     * 
+ * + * INVALID_SHARED_PRELOAD_LIBRARY = 10; + */ + public static final int INVALID_SHARED_PRELOAD_LIBRARY_VALUE = 10; + + /** + * + * + *
+     * The value of parameter max_replication_slots is not sufficient.
+     * 
+ * + * INSUFFICIENT_MAX_REPLICATION_SLOTS = 11; + */ + public static final int INSUFFICIENT_MAX_REPLICATION_SLOTS_VALUE = 11; + + /** + * + * + *
+     * The value of parameter max_wal_senders is not sufficient.
+     * 
+ * + * INSUFFICIENT_MAX_WAL_SENDERS = 12; + */ + public static final int INSUFFICIENT_MAX_WAL_SENDERS_VALUE = 12; + + /** + * + * + *
+     * The value of parameter max_worker_processes is not sufficient.
+     * 
+ * + * INSUFFICIENT_MAX_WORKER_PROCESSES = 13; + */ + public static final int INSUFFICIENT_MAX_WORKER_PROCESSES_VALUE = 13; + + /** + * + * + *
+     * Extensions installed are either not supported or having unsupported
+     * versions.
+     * 
+ * + * UNSUPPORTED_EXTENSIONS = 14; + */ + public static final int UNSUPPORTED_EXTENSIONS_VALUE = 14; + + /** + * + * + *
+     * The value of parameter rds.logical_replication is not set to 1.
+     * 
+ * + * INVALID_RDS_LOGICAL_REPLICATION = 15; + */ + public static final int INVALID_RDS_LOGICAL_REPLICATION_VALUE = 15; + + /** + * + * + *
+     * The primary instance logging setup doesn't allow EM sync.
+     * 
+ * + * INVALID_LOGGING_SETUP = 16; + */ + public static final int INVALID_LOGGING_SETUP_VALUE = 16; + + /** + * + * + *
+     * The primary instance database parameter setup doesn't allow EM sync.
+     * 
+ * + * INVALID_DB_PARAM = 17; + */ + public static final int INVALID_DB_PARAM_VALUE = 17; + + /** + * + * + *
+     * The gtid_mode is not supported, applicable for MySQL.
+     * 
+ * + * UNSUPPORTED_GTID_MODE = 18; + */ + public static final int UNSUPPORTED_GTID_MODE_VALUE = 18; + + /** + * + * + *
+     * SQL Server Agent is not running.
+     * 
+ * + * SQLSERVER_AGENT_NOT_RUNNING = 19; + */ + public static final int SQLSERVER_AGENT_NOT_RUNNING_VALUE = 19; + + /** + * + * + *
+     * The table definition is not support due to missing primary key or replica
+     * identity, applicable for postgres. Note that this is a warning and won't
+     * block the migration.
+     * 
+ * + * UNSUPPORTED_TABLE_DEFINITION = 20; + */ + public static final int UNSUPPORTED_TABLE_DEFINITION_VALUE = 20; + + /** + * + * + *
+     * The customer has a definer that will break EM setup.
+     * 
+ * + * UNSUPPORTED_DEFINER = 21; + */ + public static final int UNSUPPORTED_DEFINER_VALUE = 21; + + /** + * + * + *
+     * SQL Server @@SERVERNAME does not match actual host name.
+     * 
+ * + * SQLSERVER_SERVERNAME_MISMATCH = 22; + */ + public static final int SQLSERVER_SERVERNAME_MISMATCH_VALUE = 22; + + /** + * + * + *
+     * The primary instance has been setup and will fail the setup.
+     * 
+ * + * PRIMARY_ALREADY_SETUP = 23; + */ + public static final int PRIMARY_ALREADY_SETUP_VALUE = 23; + + /** + * + * + *
+     * The primary instance has unsupported binary log format.
+     * 
+ * + * UNSUPPORTED_BINLOG_FORMAT = 24; + */ + public static final int UNSUPPORTED_BINLOG_FORMAT_VALUE = 24; + + /** + * + * + *
+     * The primary instance's binary log retention setting.
+     * 
+ * + * BINLOG_RETENTION_SETTING = 25; + */ + public static final int BINLOG_RETENTION_SETTING_VALUE = 25; + + /** + * + * + *
+     * The primary instance has tables with unsupported storage engine.
+     * 
+ * + * UNSUPPORTED_STORAGE_ENGINE = 26; + */ + public static final int UNSUPPORTED_STORAGE_ENGINE_VALUE = 26; + + /** + * + * + *
+     * Source has tables with limited support
+     * eg: PostgreSQL tables without primary keys.
+     * 
+ * + * LIMITED_SUPPORT_TABLES = 27; + */ + public static final int LIMITED_SUPPORT_TABLES_VALUE = 27; + + /** + * + * + *
+     * The replica instance contains existing data.
+     * 
+ * + * EXISTING_DATA_IN_REPLICA = 28; + */ + public static final int EXISTING_DATA_IN_REPLICA_VALUE = 28; + + /** + * + * + *
+     * The replication user is missing privileges that are optional.
+     * 
+ * + * MISSING_OPTIONAL_PRIVILEGES = 29; + */ + public static final int MISSING_OPTIONAL_PRIVILEGES_VALUE = 29; + + /** + * + * + *
+     * Additional BACKUP_ADMIN privilege is granted to the replication user
+     * which may lock source MySQL 8 instance for DDLs during initial sync.
+     * 
+ * + * RISKY_BACKUP_ADMIN_PRIVILEGE = 30; + */ + public static final int RISKY_BACKUP_ADMIN_PRIVILEGE_VALUE = 30; + + /** + * + * + *
+     * The Cloud Storage bucket is missing necessary permissions.
+     * 
+ * + * INSUFFICIENT_GCS_PERMISSIONS = 31; + */ + public static final int INSUFFICIENT_GCS_PERMISSIONS_VALUE = 31; + + /** + * + * + *
+     * The Cloud Storage bucket has an error in the file or contains invalid
+     * file information.
+     * 
+ * + * INVALID_FILE_INFO = 32; + */ + public static final int INVALID_FILE_INFO_VALUE = 32; + + /** + * + * + *
+     * The source instance has unsupported database settings for migration.
+     * 
+ * + * UNSUPPORTED_DATABASE_SETTINGS = 33; + */ + public static final int UNSUPPORTED_DATABASE_SETTINGS_VALUE = 33; + + /** + * + * + *
+     * The replication user is missing parallel import specific privileges.
+     * (e.g. LOCK TABLES) for MySQL.
+     * 
+ * + * MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE = 34; + */ + public static final int MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE_VALUE = 34; + + /** + * + * + *
+     * The global variable local_infile is off on external server replica.
+     * 
+ * + * LOCAL_INFILE_OFF = 35; + */ + public static final int LOCAL_INFILE_OFF_VALUE = 35; + + /** + * + * + *
+     * This code instructs customers to turn on point-in-time recovery manually
+     * for the instance after promoting the Cloud SQL for PostgreSQL instance.
+     * 
+ * + * TURN_ON_PITR_AFTER_PROMOTE = 36; + */ + public static final int TURN_ON_PITR_AFTER_PROMOTE_VALUE = 36; + + /** + * + * + *
+     * The minor version of replica database is incompatible with the source.
+     * 
+ * + * INCOMPATIBLE_DATABASE_MINOR_VERSION = 37; + */ + public static final int INCOMPATIBLE_DATABASE_MINOR_VERSION_VALUE = 37; + + /** + * + * + *
+     * This warning message indicates that Cloud SQL uses the maximum number of
+     * subscriptions to migrate data from the source to the destination.
+     * 
+ * + * SOURCE_MAX_SUBSCRIPTIONS = 38; + */ + public static final int SOURCE_MAX_SUBSCRIPTIONS_VALUE = 38; + + /** + * + * + *
+     * Unable to verify definers on the source for MySQL.
+     * 
+ * + * UNABLE_TO_VERIFY_DEFINERS = 39; + */ + public static final int UNABLE_TO_VERIFY_DEFINERS_VALUE = 39; + + /** + * + * + *
+     * If a time out occurs while the subscription counts are calculated, then
+     * this value is set to 1. Otherwise, this value is set to 2.
+     * 
+ * + * SUBSCRIPTION_CALCULATION_STATUS = 40; + */ + public static final int SUBSCRIPTION_CALCULATION_STATUS_VALUE = 40; + + /** + * + * + *
+     * Count of subscriptions needed to sync source data for PostgreSQL
+     * database.
+     * 
+ * + * PG_SUBSCRIPTION_COUNT = 41; + */ + public static final int PG_SUBSCRIPTION_COUNT_VALUE = 41; + + /** + * + * + *
+     * Final parallel level that is used to do migration.
+     * 
+ * + * PG_SYNC_PARALLEL_LEVEL = 42; + */ + public static final int PG_SYNC_PARALLEL_LEVEL_VALUE = 42; + + /** + * + * + *
+     * The disk size of the replica instance is smaller than the data size of
+     * the source instance.
+     * 
+ * + * INSUFFICIENT_DISK_SIZE = 43; + */ + public static final int INSUFFICIENT_DISK_SIZE_VALUE = 43; + + /** + * + * + *
+     * The data size of the source instance is greater than 1 TB, the number of
+     * cores of the replica instance is less than 8, and the memory of the
+     * replica is less than 32 GB.
+     * 
+ * + * INSUFFICIENT_MACHINE_TIER = 44; + */ + public static final int INSUFFICIENT_MACHINE_TIER_VALUE = 44; + + /** + * + * + *
+     * The warning message indicates the unsupported extensions will not be
+     * migrated to the destination.
+     * 
+ * + * UNSUPPORTED_EXTENSIONS_NOT_MIGRATED = 45; + */ + public static final int UNSUPPORTED_EXTENSIONS_NOT_MIGRATED_VALUE = 45; + + /** + * + * + *
+     * The warning message indicates the pg_cron extension and settings will not
+     * be migrated to the destination.
+     * 
+ * + * EXTENSIONS_NOT_MIGRATED = 46; + */ + public static final int EXTENSIONS_NOT_MIGRATED_VALUE = 46; + + /** + * + * + *
+     * The error message indicates that pg_cron flags are enabled on the
+     * destination which is not supported during the migration.
+     * 
+ * + * PG_CRON_FLAG_ENABLED_IN_REPLICA = 47; + */ + public static final int PG_CRON_FLAG_ENABLED_IN_REPLICA_VALUE = 47; + + /** + * + * + *
+     * This error message indicates that the specified extensions are not
+     * enabled on destination instance. For example, before you can migrate
+     * data to the destination instance, you must enable the PGAudit extension
+     * on the instance.
+     * 
+ * + * EXTENSIONS_NOT_ENABLED_IN_REPLICA = 48; + */ + public static final int EXTENSIONS_NOT_ENABLED_IN_REPLICA_VALUE = 48; + + /** + * + * + *
+     * The source database has generated columns that can't be migrated. Please
+     * change them to regular columns before migration.
+     * 
+ * + * UNSUPPORTED_COLUMNS = 49; + */ + public static final int UNSUPPORTED_COLUMNS_VALUE = 49; + + /** + * + * + *
+     * The source database has users that aren't created in the replica.
+     * First, create all users, which are in the pg_user_mappings table
+     * of the source database, in the destination instance. Then, perform the
+     * migration.
+     * 
+ * + * USERS_NOT_CREATED_IN_REPLICA = 50; + */ + public static final int USERS_NOT_CREATED_IN_REPLICA_VALUE = 50; + + /** + * + * + *
+     * The selected objects include system objects that aren't supported for
+     * migration.
+     * 
+ * + * UNSUPPORTED_SYSTEM_OBJECTS = 51; + */ + public static final int UNSUPPORTED_SYSTEM_OBJECTS_VALUE = 51; + + /** + * + * + *
+     * The source database has tables with the FULL or NOTHING replica identity.
+     * Before starting your migration, either remove the identity or change it
+     * to DEFAULT. Note that this is an error and will block the migration.
+     * 
+ * + * UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY = 52; + */ + public static final int UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY_VALUE = 52; + + /** + * + * + *
+     * The selected objects don't exist on the source instance.
+     * 
+ * + * SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE = 53; + */ + public static final int SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE_VALUE = 53; + + /** + * + * + *
+     * PSC only destination instance does not have a network attachment URI.
+     * 
+ * + * PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI = 54; + */ + public static final int PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI_VALUE = 54; + + /** + * + * + *
+     * Selected objects reference unselected objects. Based on their object type
+     * (foreign key constraint or view), selected objects will fail during
+     * migration.
+     * 
+ * + * SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS = 55; + */ + public static final int SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS_VALUE = 55; + + /** + * + * + *
+     * The migration will delete existing data in the replica; set
+     * [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
+     * in the request to acknowledge this. This is an error. MySQL only.
+     * 
+ * + * PROMPT_DELETE_EXISTING = 56; + */ + public static final int PROMPT_DELETE_EXISTING_VALUE = 56; + + /** + * + * + *
+     * The migration will delete existing data in the replica;
+     * [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
+     * was set in the request acknowledging this. This is a warning rather than
+     * an error. MySQL only.
+     * 
+ * + * WILL_DELETE_EXISTING = 57; + */ + public static final int WILL_DELETE_EXISTING_VALUE = 57; + + /** + * + * + *
+     * The replication user is missing specific privileges to setup DDL
+     * replication. (e.g. CREATE EVENT TRIGGER, CREATE SCHEMA) for PostgreSQL.
+     * 
+ * + * PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE = 58; + */ + public static final int PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE_VALUE = 58; + + 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 SqlExternalSyncSettingErrorType 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 SqlExternalSyncSettingErrorType forNumber(int value) { + switch (value) { + case 0: + return SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED; + case 1: + return CONNECTION_FAILURE; + case 2: + return BINLOG_NOT_ENABLED; + case 3: + return INCOMPATIBLE_DATABASE_VERSION; + case 4: + return REPLICA_ALREADY_SETUP; + case 5: + return INSUFFICIENT_PRIVILEGE; + case 6: + return UNSUPPORTED_MIGRATION_TYPE; + case 7: + return NO_PGLOGICAL_INSTALLED; + case 8: + return PGLOGICAL_NODE_ALREADY_EXISTS; + case 9: + return INVALID_WAL_LEVEL; + case 10: + return INVALID_SHARED_PRELOAD_LIBRARY; + case 11: + return INSUFFICIENT_MAX_REPLICATION_SLOTS; + case 12: + return INSUFFICIENT_MAX_WAL_SENDERS; + case 13: + return INSUFFICIENT_MAX_WORKER_PROCESSES; + case 14: + return UNSUPPORTED_EXTENSIONS; + case 15: + return INVALID_RDS_LOGICAL_REPLICATION; + case 16: + return INVALID_LOGGING_SETUP; + case 17: + return INVALID_DB_PARAM; + case 18: + return UNSUPPORTED_GTID_MODE; + case 19: + return SQLSERVER_AGENT_NOT_RUNNING; + case 20: + return UNSUPPORTED_TABLE_DEFINITION; + case 21: + return UNSUPPORTED_DEFINER; + case 22: + return SQLSERVER_SERVERNAME_MISMATCH; + case 23: + return PRIMARY_ALREADY_SETUP; + case 24: + return UNSUPPORTED_BINLOG_FORMAT; + case 25: + return BINLOG_RETENTION_SETTING; + case 26: + return UNSUPPORTED_STORAGE_ENGINE; + case 27: + return LIMITED_SUPPORT_TABLES; + case 28: + return EXISTING_DATA_IN_REPLICA; + case 29: + return MISSING_OPTIONAL_PRIVILEGES; + case 30: + return RISKY_BACKUP_ADMIN_PRIVILEGE; + case 31: + return INSUFFICIENT_GCS_PERMISSIONS; + case 32: + return INVALID_FILE_INFO; + case 33: + return UNSUPPORTED_DATABASE_SETTINGS; + case 34: + return MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE; + case 35: + return LOCAL_INFILE_OFF; + case 36: + return TURN_ON_PITR_AFTER_PROMOTE; + case 37: + return INCOMPATIBLE_DATABASE_MINOR_VERSION; + case 38: + return SOURCE_MAX_SUBSCRIPTIONS; + case 39: + return UNABLE_TO_VERIFY_DEFINERS; + case 40: + return SUBSCRIPTION_CALCULATION_STATUS; + case 41: + return PG_SUBSCRIPTION_COUNT; + case 42: + return PG_SYNC_PARALLEL_LEVEL; + case 43: + return INSUFFICIENT_DISK_SIZE; + case 44: + return INSUFFICIENT_MACHINE_TIER; + case 45: + return UNSUPPORTED_EXTENSIONS_NOT_MIGRATED; + case 46: + return EXTENSIONS_NOT_MIGRATED; + case 47: + return PG_CRON_FLAG_ENABLED_IN_REPLICA; + case 48: + return EXTENSIONS_NOT_ENABLED_IN_REPLICA; + case 49: + return UNSUPPORTED_COLUMNS; + case 50: + return USERS_NOT_CREATED_IN_REPLICA; + case 51: + return UNSUPPORTED_SYSTEM_OBJECTS; + case 52: + return UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY; + case 53: + return SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE; + case 54: + return PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI; + case 55: + return SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS; + case 56: + return PROMPT_DELETE_EXISTING; + case 57: + return WILL_DELETE_EXISTING; + case 58: + return PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE; + 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 SqlExternalSyncSettingErrorType findValueByNumber(int number) { + return SqlExternalSyncSettingErrorType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.SqlExternalSyncSettingError.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final SqlExternalSyncSettingErrorType[] VALUES = values(); + + public static SqlExternalSyncSettingErrorType 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 SqlExternalSyncSettingErrorType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType) + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * Can be `sql#externalSyncSettingError` or
+   * `sql#externalSyncSettingWarning`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * Can be `sql#externalSyncSettingError` or
+   * `sql#externalSyncSettingWarning`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private int type_ = 0; + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + getType() { + com.google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType result = + com.google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + .forNumber(type_); + return result == null + ? com.google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + .UNRECOGNIZED + : result; + } + + public static final int DETAIL_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object detail_ = ""; + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string detail = 3; + * + * @return The detail. + */ + @java.lang.Override + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detail_ = s; + return s; + } + } + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string detail = 3; + * + * @return The bytes for detail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detail_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (type_ + != com.google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + .SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(detail_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, detail_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (type_ + != com.google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + .SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(detail_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, detail_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlExternalSyncSettingError)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlExternalSyncSettingError other = + (com.google.cloud.sql.v1.SqlExternalSyncSettingError) obj; + + if (!getKind().equals(other.getKind())) return false; + if (type_ != other.type_) return false; + if (!getDetail().equals(other.getDetail())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getDetail().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlExternalSyncSettingError parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlExternalSyncSettingError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlExternalSyncSettingError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlExternalSyncSettingError parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlExternalSyncSettingError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlExternalSyncSettingError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlExternalSyncSettingError parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlExternalSyncSettingError parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlExternalSyncSettingError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlExternalSyncSettingError parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlExternalSyncSettingError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlExternalSyncSettingError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlExternalSyncSettingError prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * External primary instance migration setting error/warning.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlExternalSyncSettingError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlExternalSyncSettingError) + com.google.cloud.sql.v1.SqlExternalSyncSettingErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlExternalSyncSettingError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlExternalSyncSettingError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlExternalSyncSettingError.class, + com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlExternalSyncSettingError.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + type_ = 0; + detail_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlExternalSyncSettingError_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlExternalSyncSettingError getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlExternalSyncSettingError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlExternalSyncSettingError build() { + com.google.cloud.sql.v1.SqlExternalSyncSettingError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlExternalSyncSettingError buildPartial() { + com.google.cloud.sql.v1.SqlExternalSyncSettingError result = + new com.google.cloud.sql.v1.SqlExternalSyncSettingError(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlExternalSyncSettingError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.detail_ = detail_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlExternalSyncSettingError) { + return mergeFrom((com.google.cloud.sql.v1.SqlExternalSyncSettingError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlExternalSyncSettingError other) { + if (other == com.google.cloud.sql.v1.SqlExternalSyncSettingError.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDetail().isEmpty()) { + detail_ = other.detail_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + detail_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * Can be `sql#externalSyncSettingError` or
+     * `sql#externalSyncSettingWarning`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Can be `sql#externalSyncSettingError` or
+     * `sql#externalSyncSettingWarning`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Can be `sql#externalSyncSettingError` or
+     * `sql#externalSyncSettingWarning`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Can be `sql#externalSyncSettingError` or
+     * `sql#externalSyncSettingWarning`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Can be `sql#externalSyncSettingError` or
+     * `sql#externalSyncSettingWarning`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int type_ = 0; + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + getType() { + com.google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType result = + com.google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + .forNumber(type_); + return result == null + ? com.google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + com.google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000002); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object detail_ = ""; + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string detail = 3; + * + * @return The detail. + */ + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string detail = 3; + * + * @return The bytes for detail. + */ + public com.google.protobuf.ByteString getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string detail = 3; + * + * @param value The detail to set. + * @return This builder for chaining. + */ + public Builder setDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + detail_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string detail = 3; + * + * @return This builder for chaining. + */ + public Builder clearDetail() { + detail_ = getDefaultInstance().getDetail(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string detail = 3; + * + * @param value The bytes for detail to set. + * @return This builder for chaining. + */ + public Builder setDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + detail_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlExternalSyncSettingError) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlExternalSyncSettingError) + private static final com.google.cloud.sql.v1.SqlExternalSyncSettingError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlExternalSyncSettingError(); + } + + public static com.google.cloud.sql.v1.SqlExternalSyncSettingError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlExternalSyncSettingError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlExternalSyncSettingError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlExternalSyncSettingErrorOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlExternalSyncSettingErrorOrBuilder.java new file mode 100644 index 000000000000..237302be8e61 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlExternalSyncSettingErrorOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlExternalSyncSettingErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlExternalSyncSettingError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Can be `sql#externalSyncSettingError` or
+   * `sql#externalSyncSettingWarning`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * Can be `sql#externalSyncSettingError` or
+   * `sql#externalSyncSettingWarning`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @return The type. + */ + com.google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType getType(); + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string detail = 3; + * + * @return The detail. + */ + java.lang.String getDetail(); + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string detail = 3; + * + * @return The bytes for detail. + */ + com.google.protobuf.ByteString getDetailBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFileType.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFileType.java new file mode 100644 index 000000000000..9ed00740ef44 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFileType.java @@ -0,0 +1,213 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf enum {@code google.cloud.sql.v1.SqlFileType} */ +@com.google.protobuf.Generated +public enum SqlFileType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unknown file type.
+   * 
+ * + * SQL_FILE_TYPE_UNSPECIFIED = 0; + */ + SQL_FILE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * File containing SQL statements.
+   * 
+ * + * SQL = 1; + */ + SQL(1), + /** + * + * + *
+   * File in CSV format.
+   * 
+ * + * CSV = 2; + */ + CSV(2), + /** BAK = 4; */ + BAK(4), + /** + * + * + *
+   * TDE certificate.
+   * 
+ * + * TDE = 8; + */ + TDE(8), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlFileType"); + } + + /** + * + * + *
+   * Unknown file type.
+   * 
+ * + * SQL_FILE_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_FILE_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * File containing SQL statements.
+   * 
+ * + * SQL = 1; + */ + public static final int SQL_VALUE = 1; + + /** + * + * + *
+   * File in CSV format.
+   * 
+ * + * CSV = 2; + */ + public static final int CSV_VALUE = 2; + + /** BAK = 4; */ + public static final int BAK_VALUE = 4; + + /** + * + * + *
+   * TDE certificate.
+   * 
+ * + * TDE = 8; + */ + public static final int TDE_VALUE = 8; + + 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 SqlFileType 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 SqlFileType forNumber(int value) { + switch (value) { + case 0: + return SQL_FILE_TYPE_UNSPECIFIED; + case 1: + return SQL; + case 2: + return CSV; + case 4: + return BAK; + case 8: + return TDE; + 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 SqlFileType findValueByNumber(int number) { + return SqlFileType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlFileType[] VALUES = values(); + + public static SqlFileType 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 SqlFileType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlFileType) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagScope.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagScope.java new file mode 100644 index 000000000000..d361dc2f82d1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagScope.java @@ -0,0 +1,191 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_flags.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Scopes of a flag describe where the flag is used.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.SqlFlagScope} + */ +@com.google.protobuf.Generated +public enum SqlFlagScope implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Assume database flags if unspecified
+   * 
+ * + * SQL_FLAG_SCOPE_UNSPECIFIED = 0; + */ + SQL_FLAG_SCOPE_UNSPECIFIED(0), + /** + * + * + *
+   * database flags
+   * 
+ * + * SQL_FLAG_SCOPE_DATABASE = 1; + */ + SQL_FLAG_SCOPE_DATABASE(1), + /** + * + * + *
+   * connection pool configuration flags
+   * 
+ * + * SQL_FLAG_SCOPE_CONNECTION_POOL = 2; + */ + SQL_FLAG_SCOPE_CONNECTION_POOL(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlFlagScope"); + } + + /** + * + * + *
+   * Assume database flags if unspecified
+   * 
+ * + * SQL_FLAG_SCOPE_UNSPECIFIED = 0; + */ + public static final int SQL_FLAG_SCOPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * database flags
+   * 
+ * + * SQL_FLAG_SCOPE_DATABASE = 1; + */ + public static final int SQL_FLAG_SCOPE_DATABASE_VALUE = 1; + + /** + * + * + *
+   * connection pool configuration flags
+   * 
+ * + * SQL_FLAG_SCOPE_CONNECTION_POOL = 2; + */ + public static final int SQL_FLAG_SCOPE_CONNECTION_POOL_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 SqlFlagScope 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 SqlFlagScope forNumber(int value) { + switch (value) { + case 0: + return SQL_FLAG_SCOPE_UNSPECIFIED; + case 1: + return SQL_FLAG_SCOPE_DATABASE; + case 2: + return SQL_FLAG_SCOPE_CONNECTION_POOL; + 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 SqlFlagScope findValueByNumber(int number) { + return SqlFlagScope.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto.getDescriptor().getEnumTypes().get(1); + } + + private static final SqlFlagScope[] VALUES = values(); + + public static SqlFlagScope 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 SqlFlagScope(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlFlagScope) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagType.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagType.java new file mode 100644 index 000000000000..5ce66e1ee4f9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagType.java @@ -0,0 +1,300 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_flags.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf enum {@code google.cloud.sql.v1.SqlFlagType} */ +@com.google.protobuf.Generated +public enum SqlFlagType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown flag type.
+   * 
+ * + * SQL_FLAG_TYPE_UNSPECIFIED = 0; + */ + SQL_FLAG_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Boolean type flag.
+   * 
+ * + * BOOLEAN = 1; + */ + BOOLEAN(1), + /** + * + * + *
+   * String type flag.
+   * 
+ * + * STRING = 2; + */ + STRING(2), + /** + * + * + *
+   * Integer type flag.
+   * 
+ * + * INTEGER = 3; + */ + INTEGER(3), + /** + * + * + *
+   * Flag type used for a server startup option.
+   * 
+ * + * NONE = 4; + */ + NONE(4), + /** + * + * + *
+   * Type introduced specially for MySQL TimeZone offset. Accept a string value
+   * with the format [-12:59, 13:00].
+   * 
+ * + * MYSQL_TIMEZONE_OFFSET = 5; + */ + MYSQL_TIMEZONE_OFFSET(5), + /** + * + * + *
+   * Float type flag.
+   * 
+ * + * FLOAT = 6; + */ + FLOAT(6), + /** + * + * + *
+   * Comma-separated list of the strings in a SqlFlagType enum.
+   * 
+ * + * REPEATED_STRING = 7; + */ + REPEATED_STRING(7), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlFlagType"); + } + + /** + * + * + *
+   * This is an unknown flag type.
+   * 
+ * + * SQL_FLAG_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_FLAG_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Boolean type flag.
+   * 
+ * + * BOOLEAN = 1; + */ + public static final int BOOLEAN_VALUE = 1; + + /** + * + * + *
+   * String type flag.
+   * 
+ * + * STRING = 2; + */ + public static final int STRING_VALUE = 2; + + /** + * + * + *
+   * Integer type flag.
+   * 
+ * + * INTEGER = 3; + */ + public static final int INTEGER_VALUE = 3; + + /** + * + * + *
+   * Flag type used for a server startup option.
+   * 
+ * + * NONE = 4; + */ + public static final int NONE_VALUE = 4; + + /** + * + * + *
+   * Type introduced specially for MySQL TimeZone offset. Accept a string value
+   * with the format [-12:59, 13:00].
+   * 
+ * + * MYSQL_TIMEZONE_OFFSET = 5; + */ + public static final int MYSQL_TIMEZONE_OFFSET_VALUE = 5; + + /** + * + * + *
+   * Float type flag.
+   * 
+ * + * FLOAT = 6; + */ + public static final int FLOAT_VALUE = 6; + + /** + * + * + *
+   * Comma-separated list of the strings in a SqlFlagType enum.
+   * 
+ * + * REPEATED_STRING = 7; + */ + public static final int REPEATED_STRING_VALUE = 7; + + 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 SqlFlagType 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 SqlFlagType forNumber(int value) { + switch (value) { + case 0: + return SQL_FLAG_TYPE_UNSPECIFIED; + case 1: + return BOOLEAN; + case 2: + return STRING; + case 3: + return INTEGER; + case 4: + return NONE; + case 5: + return MYSQL_TIMEZONE_OFFSET; + case 6: + return FLOAT; + case 7: + return REPEATED_STRING; + 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 SqlFlagType findValueByNumber(int number) { + return SqlFlagType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlFlagType[] VALUES = values(); + + public static SqlFlagType 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 SqlFlagType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlFlagType) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagsListRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagsListRequest.java new file mode 100644 index 000000000000..162a4b88a404 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagsListRequest.java @@ -0,0 +1,825 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_flags.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Flags list request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlFlagsListRequest} + */ +@com.google.protobuf.Generated +public final class SqlFlagsListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlFlagsListRequest) + SqlFlagsListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlFlagsListRequest"); + } + + // Use SqlFlagsListRequest.newBuilder() to construct. + private SqlFlagsListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlFlagsListRequest() { + databaseVersion_ = ""; + flagScope_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_SqlFlagsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_SqlFlagsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlFlagsListRequest.class, + com.google.cloud.sql.v1.SqlFlagsListRequest.Builder.class); + } + + private int bitField0_; + public static final int DATABASE_VERSION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object databaseVersion_ = ""; + + /** + * + * + *
+   * Database type and version you want to retrieve flags for. By default, this
+   * method returns flags for all database types and versions.
+   * 
+ * + * string database_version = 1; + * + * @return The databaseVersion. + */ + @java.lang.Override + public java.lang.String getDatabaseVersion() { + java.lang.Object ref = databaseVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + databaseVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * Database type and version you want to retrieve flags for. By default, this
+   * method returns flags for all database types and versions.
+   * 
+ * + * string database_version = 1; + * + * @return The bytes for databaseVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseVersionBytes() { + java.lang.Object ref = databaseVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + databaseVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FLAG_SCOPE_FIELD_NUMBER = 3; + private int flagScope_ = 0; + + /** + * + * + *
+   * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+   * Return list of database flags if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the flagScope field is set. + */ + @java.lang.Override + public boolean hasFlagScope() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+   * Return list of database flags if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for flagScope. + */ + @java.lang.Override + public int getFlagScopeValue() { + return flagScope_; + } + + /** + * + * + *
+   * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+   * Return list of database flags if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The flagScope. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlFlagScope getFlagScope() { + com.google.cloud.sql.v1.SqlFlagScope result = + com.google.cloud.sql.v1.SqlFlagScope.forNumber(flagScope_); + return result == null ? com.google.cloud.sql.v1.SqlFlagScope.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.GeneratedMessage.isStringEmpty(databaseVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, databaseVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeEnum(3, flagScope_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(databaseVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, databaseVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, flagScope_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlFlagsListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlFlagsListRequest other = + (com.google.cloud.sql.v1.SqlFlagsListRequest) obj; + + if (!getDatabaseVersion().equals(other.getDatabaseVersion())) return false; + if (hasFlagScope() != other.hasFlagScope()) return false; + if (hasFlagScope()) { + if (flagScope_ != other.flagScope_) return false; + } + if (!getUnknownFields().equals(other.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) + DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseVersion().hashCode(); + if (hasFlagScope()) { + hash = (37 * hash) + FLAG_SCOPE_FIELD_NUMBER; + hash = (53 * hash) + flagScope_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlFlagsListRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlFlagsListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlFlagsListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlFlagsListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlFlagsListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlFlagsListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlFlagsListRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlFlagsListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlFlagsListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlFlagsListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlFlagsListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlFlagsListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlFlagsListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Flags list request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlFlagsListRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlFlagsListRequest) + com.google.cloud.sql.v1.SqlFlagsListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_SqlFlagsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_SqlFlagsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlFlagsListRequest.class, + com.google.cloud.sql.v1.SqlFlagsListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlFlagsListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + databaseVersion_ = ""; + flagScope_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlFlagsProto + .internal_static_google_cloud_sql_v1_SqlFlagsListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlFlagsListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlFlagsListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlFlagsListRequest build() { + com.google.cloud.sql.v1.SqlFlagsListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlFlagsListRequest buildPartial() { + com.google.cloud.sql.v1.SqlFlagsListRequest result = + new com.google.cloud.sql.v1.SqlFlagsListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlFlagsListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.databaseVersion_ = databaseVersion_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.flagScope_ = flagScope_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlFlagsListRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlFlagsListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlFlagsListRequest other) { + if (other == com.google.cloud.sql.v1.SqlFlagsListRequest.getDefaultInstance()) return this; + if (!other.getDatabaseVersion().isEmpty()) { + databaseVersion_ = other.databaseVersion_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasFlagScope()) { + setFlagScopeValue(other.getFlagScopeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + databaseVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 24: + { + flagScope_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object databaseVersion_ = ""; + + /** + * + * + *
+     * Database type and version you want to retrieve flags for. By default, this
+     * method returns flags for all database types and versions.
+     * 
+ * + * string database_version = 1; + * + * @return The databaseVersion. + */ + public java.lang.String getDatabaseVersion() { + java.lang.Object ref = databaseVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + databaseVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database type and version you want to retrieve flags for. By default, this
+     * method returns flags for all database types and versions.
+     * 
+ * + * string database_version = 1; + * + * @return The bytes for databaseVersion. + */ + public com.google.protobuf.ByteString getDatabaseVersionBytes() { + java.lang.Object ref = databaseVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + databaseVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database type and version you want to retrieve flags for. By default, this
+     * method returns flags for all database types and versions.
+     * 
+ * + * string database_version = 1; + * + * @param value The databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + databaseVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database type and version you want to retrieve flags for. By default, this
+     * method returns flags for all database types and versions.
+     * 
+ * + * string database_version = 1; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseVersion() { + databaseVersion_ = getDefaultInstance().getDatabaseVersion(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database type and version you want to retrieve flags for. By default, this
+     * method returns flags for all database types and versions.
+     * 
+ * + * string database_version = 1; + * + * @param value The bytes for databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + databaseVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int flagScope_ = 0; + + /** + * + * + *
+     * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+     * Return list of database flags if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the flagScope field is set. + */ + @java.lang.Override + public boolean hasFlagScope() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+     * Return list of database flags if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for flagScope. + */ + @java.lang.Override + public int getFlagScopeValue() { + return flagScope_; + } + + /** + * + * + *
+     * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+     * Return list of database flags if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for flagScope to set. + * @return This builder for chaining. + */ + public Builder setFlagScopeValue(int value) { + flagScope_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+     * Return list of database flags if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The flagScope. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlFlagScope getFlagScope() { + com.google.cloud.sql.v1.SqlFlagScope result = + com.google.cloud.sql.v1.SqlFlagScope.forNumber(flagScope_); + return result == null ? com.google.cloud.sql.v1.SqlFlagScope.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+     * Return list of database flags if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The flagScope to set. + * @return This builder for chaining. + */ + public Builder setFlagScope(com.google.cloud.sql.v1.SqlFlagScope value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + flagScope_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+     * Return list of database flags if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearFlagScope() { + bitField0_ = (bitField0_ & ~0x00000002); + flagScope_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlFlagsListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlFlagsListRequest) + private static final com.google.cloud.sql.v1.SqlFlagsListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlFlagsListRequest(); + } + + public static com.google.cloud.sql.v1.SqlFlagsListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlFlagsListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlFlagsListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagsListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagsListRequestOrBuilder.java new file mode 100644 index 000000000000..08222697e98e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlFlagsListRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_flags.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlFlagsListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlFlagsListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Database type and version you want to retrieve flags for. By default, this
+   * method returns flags for all database types and versions.
+   * 
+ * + * string database_version = 1; + * + * @return The databaseVersion. + */ + java.lang.String getDatabaseVersion(); + + /** + * + * + *
+   * Database type and version you want to retrieve flags for. By default, this
+   * method returns flags for all database types and versions.
+   * 
+ * + * string database_version = 1; + * + * @return The bytes for databaseVersion. + */ + com.google.protobuf.ByteString getDatabaseVersionBytes(); + + /** + * + * + *
+   * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+   * Return list of database flags if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the flagScope field is set. + */ + boolean hasFlagScope(); + + /** + * + * + *
+   * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+   * Return list of database flags if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for flagScope. + */ + int getFlagScopeValue(); + + /** + * + * + *
+   * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+   * Return list of database flags if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The flagScope. + */ + com.google.cloud.sql.v1.SqlFlagScope getFlagScope(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstanceType.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstanceType.java new file mode 100644 index 000000000000..86ed3bf30af9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstanceType.java @@ -0,0 +1,233 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf enum {@code google.cloud.sql.v1.SqlInstanceType} */ +@com.google.protobuf.Generated +public enum SqlInstanceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown Cloud SQL instance type.
+   * 
+ * + * SQL_INSTANCE_TYPE_UNSPECIFIED = 0; + */ + SQL_INSTANCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * A regular Cloud SQL instance that is not replicating from a primary
+   * instance.
+   * 
+ * + * CLOUD_SQL_INSTANCE = 1; + */ + CLOUD_SQL_INSTANCE(1), + /** + * + * + *
+   * An instance running on the customer's premises that is not managed by
+   * Cloud SQL.
+   * 
+ * + * ON_PREMISES_INSTANCE = 2; + */ + ON_PREMISES_INSTANCE(2), + /** + * + * + *
+   * A Cloud SQL instance acting as a read-replica.
+   * 
+ * + * READ_REPLICA_INSTANCE = 3; + */ + READ_REPLICA_INSTANCE(3), + /** + * + * + *
+   * A Cloud SQL read pool.
+   * 
+ * + * READ_POOL_INSTANCE = 5; + */ + READ_POOL_INSTANCE(5), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstanceType"); + } + + /** + * + * + *
+   * This is an unknown Cloud SQL instance type.
+   * 
+ * + * SQL_INSTANCE_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_INSTANCE_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * A regular Cloud SQL instance that is not replicating from a primary
+   * instance.
+   * 
+ * + * CLOUD_SQL_INSTANCE = 1; + */ + public static final int CLOUD_SQL_INSTANCE_VALUE = 1; + + /** + * + * + *
+   * An instance running on the customer's premises that is not managed by
+   * Cloud SQL.
+   * 
+ * + * ON_PREMISES_INSTANCE = 2; + */ + public static final int ON_PREMISES_INSTANCE_VALUE = 2; + + /** + * + * + *
+   * A Cloud SQL instance acting as a read-replica.
+   * 
+ * + * READ_REPLICA_INSTANCE = 3; + */ + public static final int READ_REPLICA_INSTANCE_VALUE = 3; + + /** + * + * + *
+   * A Cloud SQL read pool.
+   * 
+ * + * READ_POOL_INSTANCE = 5; + */ + public static final int READ_POOL_INSTANCE_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SqlInstanceType 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 SqlInstanceType forNumber(int value) { + switch (value) { + case 0: + return SQL_INSTANCE_TYPE_UNSPECIFIED; + case 1: + return CLOUD_SQL_INSTANCE; + case 2: + return ON_PREMISES_INSTANCE; + case 3: + return READ_REPLICA_INSTANCE; + case 5: + return READ_POOL_INSTANCE; + 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 SqlInstanceType findValueByNumber(int number) { + return SqlInstanceType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto.getDescriptor().getEnumTypes().get(1); + } + + private static final SqlInstanceType[] VALUES = values(); + + public static SqlInstanceType 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 SqlInstanceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlInstanceType) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAcquireSsrsLeaseRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAcquireSsrsLeaseRequest.java new file mode 100644 index 000000000000..c7290d9f00c9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAcquireSsrsLeaseRequest.java @@ -0,0 +1,1132 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Request to acquire a lease for SSRS.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesAcquireSsrsLeaseRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest) + SqlInstancesAcquireSsrsLeaseRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesAcquireSsrsLeaseRequest"); + } + + // Use SqlInstancesAcquireSsrsLeaseRequest.newBuilder() to construct. + private SqlInstancesAcquireSsrsLeaseRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesAcquireSsrsLeaseRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAcquireSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAcquireSsrsLeaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest.class, + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+   * composed of lowercase letters, numbers, and hyphens, and it must start with
+   * a letter. The total length must be 98 characters or less (Example:
+   * instance-id).
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+   * composed of lowercase letters, numbers, and hyphens, and it must start with
+   * a letter. The total length must be 98 characters or less (Example:
+   * instance-id).
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance (Example:
+   * project-id).
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance (Example:
+   * project-id).
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body_; + + /** + * + * + *
+   * Required. The request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * Required. The request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest other = + (com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request to acquire a lease for SSRS.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest) + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAcquireSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAcquireSsrsLeaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest.class, + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAcquireSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest build() { + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest result = + new com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+     * composed of lowercase letters, numbers, and hyphens, and it must start with
+     * a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+     * composed of lowercase letters, numbers, and hyphens, and it must start with
+     * a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+     * composed of lowercase letters, numbers, and hyphens, and it must start with
+     * a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+     * composed of lowercase letters, numbers, and hyphens, and it must start with
+     * a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+     * composed of lowercase letters, numbers, and hyphens, and it must start with
+     * a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest, + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.Builder, + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequestOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + public com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBody(com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBody( + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBody(com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest, + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.Builder, + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest, + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.Builder, + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest) + private static final com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesAcquireSsrsLeaseRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAcquireSsrsLeaseRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAcquireSsrsLeaseRequestOrBuilder.java new file mode 100644 index 000000000000..392e5a77c278 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAcquireSsrsLeaseRequestOrBuilder.java @@ -0,0 +1,131 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesAcquireSsrsLeaseRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+   * composed of lowercase letters, numbers, and hyphens, and it must start with
+   * a letter. The total length must be 98 characters or less (Example:
+   * instance-id).
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+   * composed of lowercase letters, numbers, and hyphens, and it must start with
+   * a letter. The total length must be 98 characters or less (Example:
+   * instance-id).
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance (Example:
+   * project-id).
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance (Example:
+   * project-id).
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Required. The request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * Required. The request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest getBody(); + + /** + * + * + *
+   * Required. The request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAcquireSsrsLeaseResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAcquireSsrsLeaseResponse.java new file mode 100644 index 000000000000..d46a8aa53a52 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAcquireSsrsLeaseResponse.java @@ -0,0 +1,602 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Response for the acquire SSRS lease request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse} + */ +@com.google.protobuf.Generated +public final class SqlInstancesAcquireSsrsLeaseResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse) + SqlInstancesAcquireSsrsLeaseResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesAcquireSsrsLeaseResponse"); + } + + // Use SqlInstancesAcquireSsrsLeaseResponse.newBuilder() to construct. + private SqlInstancesAcquireSsrsLeaseResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesAcquireSsrsLeaseResponse() { + operationId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAcquireSsrsLeaseResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAcquireSsrsLeaseResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse.class, + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse.Builder.class); + } + + public static final int OPERATION_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object operationId_ = ""; + + /** + * + * + *
+   * The unique identifier for this operation.
+   * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + @java.lang.Override + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationId_ = s; + return s; + } + } + + /** + * + * + *
+   * The unique identifier for this operation.
+   * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = 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.GeneratedMessage.isStringEmpty(operationId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, operationId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operationId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, operationId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse other = + (com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse) obj; + + if (!getOperationId().equals(other.getOperationId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OPERATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getOperationId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response for the acquire SSRS lease request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse) + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAcquireSsrsLeaseResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAcquireSsrsLeaseResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse.class, + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + operationId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAcquireSsrsLeaseResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse build() { + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse buildPartial() { + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse result = + new com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.operationId_ = operationId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse.getDefaultInstance()) + return this; + if (!other.getOperationId().isEmpty()) { + operationId_ = other.operationId_; + 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: + { + operationId_ = 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 operationId_ = ""; + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * string operation_id = 1; + * + * @param value The operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + operationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * string operation_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperationId() { + operationId_ = getDefaultInstance().getOperationId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * string operation_id = 1; + * + * @param value The bytes for operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + operationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse) + private static final com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse(); + } + + public static com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesAcquireSsrsLeaseResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAcquireSsrsLeaseResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAcquireSsrsLeaseResponseOrBuilder.java new file mode 100644 index 000000000000..635984d62b31 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAcquireSsrsLeaseResponseOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesAcquireSsrsLeaseResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique identifier for this operation.
+   * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + java.lang.String getOperationId(); + + /** + * + * + *
+   * The unique identifier for this operation.
+   * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + com.google.protobuf.ByteString getOperationIdBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddEntraIdCertificateRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddEntraIdCertificateRequest.java new file mode 100644 index 000000000000..0948a82bda1c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddEntraIdCertificateRequest.java @@ -0,0 +1,795 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance add Entra ID certificate request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesAddEntraIdCertificateRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest) + SqlInstancesAddEntraIdCertificateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesAddEntraIdCertificateRequest"); + } + + // Use SqlInstancesAddEntraIdCertificateRequest.newBuilder() to construct. + private SqlInstancesAddEntraIdCertificateRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesAddEntraIdCertificateRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddEntraIdCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest.class, + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest other = + (com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance add Entra ID certificate request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest) + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddEntraIdCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest.class, + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest build() { + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest result = + new com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest) + private static final com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesAddEntraIdCertificateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddEntraIdCertificateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddEntraIdCertificateRequestOrBuilder.java new file mode 100644 index 000000000000..0f87dd9339e0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddEntraIdCertificateRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesAddEntraIdCertificateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddServerCaRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddServerCaRequest.java new file mode 100644 index 000000000000..27d919bfe604 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddServerCaRequest.java @@ -0,0 +1,786 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance add server CA request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesAddServerCaRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesAddServerCaRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesAddServerCaRequest) + SqlInstancesAddServerCaRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesAddServerCaRequest"); + } + + // Use SqlInstancesAddServerCaRequest.newBuilder() to construct. + private SqlInstancesAddServerCaRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesAddServerCaRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddServerCaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddServerCaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest.class, + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest other = + (com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance add server CA request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesAddServerCaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesAddServerCaRequest) + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddServerCaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddServerCaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest.class, + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddServerCaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest build() { + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest result = + new com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesAddServerCaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesAddServerCaRequest) + private static final com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesAddServerCaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddServerCaRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddServerCaRequestOrBuilder.java new file mode 100644 index 000000000000..43d9155f98bb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddServerCaRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesAddServerCaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesAddServerCaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddServerCertificateRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddServerCertificateRequest.java new file mode 100644 index 000000000000..14415f754369 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddServerCertificateRequest.java @@ -0,0 +1,795 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance add server certificate request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesAddServerCertificateRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest) + SqlInstancesAddServerCertificateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesAddServerCertificateRequest"); + } + + // Use SqlInstancesAddServerCertificateRequest.newBuilder() to construct. + private SqlInstancesAddServerCertificateRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesAddServerCertificateRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddServerCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddServerCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest.class, + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest other = + (com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance add server certificate request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest) + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddServerCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddServerCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest.class, + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesAddServerCertificateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest build() { + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest result = + new com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest) + private static final com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesAddServerCertificateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddServerCertificateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddServerCertificateRequestOrBuilder.java new file mode 100644 index 000000000000..29519d29e22c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesAddServerCertificateRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesAddServerCertificateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesCloneRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesCloneRequest.java new file mode 100644 index 000000000000..8de51e0b1241 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesCloneRequest.java @@ -0,0 +1,1035 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance clone request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesCloneRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesCloneRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesCloneRequest) + SqlInstancesCloneRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesCloneRequest"); + } + + // Use SqlInstancesCloneRequest.newBuilder() to construct. + private SqlInstancesCloneRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesCloneRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesCloneRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesCloneRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesCloneRequest.class, + com.google.cloud.sql.v1.SqlInstancesCloneRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. The ID of the Cloud SQL instance to be cloned (source). This does
+   * not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The ID of the Cloud SQL instance to be cloned (source). This does
+   * not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the source Cloud SQL instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the source Cloud SQL instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.InstancesCloneRequest body_; + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesCloneRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesCloneRequest.getDefaultInstance() + : body_; + } + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesCloneRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesCloneRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesCloneRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesCloneRequest other = + (com.google.cloud.sql.v1.SqlInstancesCloneRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesCloneRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesCloneRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesCloneRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesCloneRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesCloneRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesCloneRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesCloneRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesCloneRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesCloneRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesCloneRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesCloneRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesCloneRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlInstancesCloneRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance clone request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesCloneRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesCloneRequest) + com.google.cloud.sql.v1.SqlInstancesCloneRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesCloneRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesCloneRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesCloneRequest.class, + com.google.cloud.sql.v1.SqlInstancesCloneRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesCloneRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesCloneRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesCloneRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesCloneRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesCloneRequest build() { + com.google.cloud.sql.v1.SqlInstancesCloneRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesCloneRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesCloneRequest result = + new com.google.cloud.sql.v1.SqlInstancesCloneRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesCloneRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesCloneRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesCloneRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesCloneRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesCloneRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Required. The ID of the Cloud SQL instance to be cloned (source). This does
+     * not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The ID of the Cloud SQL instance to be cloned (source). This does
+     * not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The ID of the Cloud SQL instance to be cloned (source). This does
+     * not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID of the Cloud SQL instance to be cloned (source). This does
+     * not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID of the Cloud SQL instance to be cloned (source). This does
+     * not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the source Cloud SQL instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the source Cloud SQL instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the source Cloud SQL instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the source Cloud SQL instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the source Cloud SQL instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstancesCloneRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesCloneRequest, + com.google.cloud.sql.v1.InstancesCloneRequest.Builder, + com.google.cloud.sql.v1.InstancesCloneRequestOrBuilder> + bodyBuilder_; + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + public com.google.cloud.sql.v1.InstancesCloneRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.InstancesCloneRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBody(com.google.cloud.sql.v1.InstancesCloneRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBody(com.google.cloud.sql.v1.InstancesCloneRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBody(com.google.cloud.sql.v1.InstancesCloneRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.InstancesCloneRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.InstancesCloneRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.InstancesCloneRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.InstancesCloneRequest.getDefaultInstance() + : body_; + } + } + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesCloneRequest, + com.google.cloud.sql.v1.InstancesCloneRequest.Builder, + com.google.cloud.sql.v1.InstancesCloneRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesCloneRequest, + com.google.cloud.sql.v1.InstancesCloneRequest.Builder, + com.google.cloud.sql.v1.InstancesCloneRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesCloneRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesCloneRequest) + private static final com.google.cloud.sql.v1.SqlInstancesCloneRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesCloneRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesCloneRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesCloneRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesCloneRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesCloneRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesCloneRequestOrBuilder.java new file mode 100644 index 000000000000..74bd3353826d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesCloneRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesCloneRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesCloneRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The ID of the Cloud SQL instance to be cloned (source). This does
+   * not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. The ID of the Cloud SQL instance to be cloned (source). This does
+   * not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the source Cloud SQL instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the source Cloud SQL instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + com.google.cloud.sql.v1.InstancesCloneRequest getBody(); + + /** + * + * .google.cloud.sql.v1.InstancesCloneRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1.InstancesCloneRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesCreateEphemeralCertRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesCreateEphemeralCertRequest.java new file mode 100644 index 000000000000..289e7267345f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesCreateEphemeralCertRequest.java @@ -0,0 +1,999 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance create ephemeral certificate request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesCreateEphemeralCertRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest) + SqlInstancesCreateEphemeralCertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesCreateEphemeralCertRequest"); + } + + // Use SqlInstancesCreateEphemeralCertRequest.newBuilder() to construct. + private SqlInstancesCreateEphemeralCertRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesCreateEphemeralCertRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesCreateEphemeralCertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesCreateEphemeralCertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest.class, + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest body_; + + /** + * .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsCreateEphemeralRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest other = + (com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance create ephemeral certificate request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest) + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesCreateEphemeralCertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesCreateEphemeralCertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest.class, + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesCreateEphemeralCertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest build() { + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest result = + new com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest, + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.Builder, + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; */ + public com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; */ + public com.google.cloud.sql.v1.SslCertsCreateEphemeralRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest, + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.Builder, + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest, + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.Builder, + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest) + private static final com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesCreateEphemeralCertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesCreateEphemeralCertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesCreateEphemeralCertRequestOrBuilder.java new file mode 100644 index 000000000000..ec40edbe44cb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesCreateEphemeralCertRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesCreateEphemeralCertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest getBody(); + + /** .google.cloud.sql.v1.SslCertsCreateEphemeralRequest body = 100; */ + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDeleteRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDeleteRequest.java new file mode 100644 index 000000000000..0f57f57c43b3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDeleteRequest.java @@ -0,0 +1,1672 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance delete request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesDeleteRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesDeleteRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesDeleteRequest) + SqlInstancesDeleteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesDeleteRequest"); + } + + // Use SqlInstancesDeleteRequest.newBuilder() to construct. + private SqlInstancesDeleteRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesDeleteRequest() { + instance_ = ""; + project_ = ""; + finalBackupDescription_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesDeleteRequest.class, + com.google.cloud.sql.v1.SqlInstancesDeleteRequest.Builder.class); + } + + private int bitField0_; + private int expirationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object expiration_; + + public enum ExpirationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + FINAL_BACKUP_TTL_DAYS(4), + FINAL_BACKUP_EXPIRY_TIME(6), + EXPIRATION_NOT_SET(0); + private final int value; + + private ExpirationCase(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 ExpirationCase valueOf(int value) { + return forNumber(value); + } + + public static ExpirationCase forNumber(int value) { + switch (value) { + case 4: + return FINAL_BACKUP_TTL_DAYS; + case 6: + return FINAL_BACKUP_EXPIRY_TIME; + case 0: + return EXPIRATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance to be deleted.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance to be deleted.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLE_FINAL_BACKUP_FIELD_NUMBER = 7; + private boolean enableFinalBackup_ = false; + + /** + * + * + *
+   * Flag to opt-in for final backup. By default, it is turned off.
+   * 
+ * + * optional bool enable_final_backup = 7; + * + * @return Whether the enableFinalBackup field is set. + */ + @java.lang.Override + public boolean hasEnableFinalBackup() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Flag to opt-in for final backup. By default, it is turned off.
+   * 
+ * + * optional bool enable_final_backup = 7; + * + * @return The enableFinalBackup. + */ + @java.lang.Override + public boolean getEnableFinalBackup() { + return enableFinalBackup_; + } + + public static final int FINAL_BACKUP_TTL_DAYS_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Optional. Retention period of the final backup.
+   * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the finalBackupTtlDays field is set. + */ + @java.lang.Override + public boolean hasFinalBackupTtlDays() { + return expirationCase_ == 4; + } + + /** + * + * + *
+   * Optional. Retention period of the final backup.
+   * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finalBackupTtlDays. + */ + @java.lang.Override + public long getFinalBackupTtlDays() { + if (expirationCase_ == 4) { + return (java.lang.Long) expiration_; + } + return 0L; + } + + public static final int FINAL_BACKUP_EXPIRY_TIME_FIELD_NUMBER = 6; + + /** + * + * + *
+   * Optional. Final Backup expiration time.
+   * Timestamp in UTC of when this resource is considered expired.
+   * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the finalBackupExpiryTime field is set. + */ + @java.lang.Override + public boolean hasFinalBackupExpiryTime() { + return expirationCase_ == 6; + } + + /** + * + * + *
+   * Optional. Final Backup expiration time.
+   * Timestamp in UTC of when this resource is considered expired.
+   * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The finalBackupExpiryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getFinalBackupExpiryTime() { + if (expirationCase_ == 6) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + /** + * + * + *
+   * Optional. Final Backup expiration time.
+   * Timestamp in UTC of when this resource is considered expired.
+   * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getFinalBackupExpiryTimeOrBuilder() { + if (expirationCase_ == 6) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int FINAL_BACKUP_DESCRIPTION_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object finalBackupDescription_ = ""; + + /** + * + * + *
+   * Optional. The description of the final backup.
+   * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finalBackupDescription. + */ + @java.lang.Override + public java.lang.String getFinalBackupDescription() { + java.lang.Object ref = finalBackupDescription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + finalBackupDescription_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The description of the final backup.
+   * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for finalBackupDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFinalBackupDescriptionBytes() { + java.lang.Object ref = finalBackupDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + finalBackupDescription_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (expirationCase_ == 4) { + output.writeInt64(4, (long) ((java.lang.Long) expiration_)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(finalBackupDescription_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, finalBackupDescription_); + } + if (expirationCase_ == 6) { + output.writeMessage(6, (com.google.protobuf.Timestamp) expiration_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(7, enableFinalBackup_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (expirationCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 4, (long) ((java.lang.Long) expiration_)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(finalBackupDescription_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, finalBackupDescription_); + } + if (expirationCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.protobuf.Timestamp) expiration_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, enableFinalBackup_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesDeleteRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesDeleteRequest other = + (com.google.cloud.sql.v1.SqlInstancesDeleteRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasEnableFinalBackup() != other.hasEnableFinalBackup()) return false; + if (hasEnableFinalBackup()) { + if (getEnableFinalBackup() != other.getEnableFinalBackup()) return false; + } + if (!getFinalBackupDescription().equals(other.getFinalBackupDescription())) return false; + if (!getExpirationCase().equals(other.getExpirationCase())) return false; + switch (expirationCase_) { + case 4: + if (getFinalBackupTtlDays() != other.getFinalBackupTtlDays()) return false; + break; + case 6: + if (!getFinalBackupExpiryTime().equals(other.getFinalBackupExpiryTime())) 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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasEnableFinalBackup()) { + hash = (37 * hash) + ENABLE_FINAL_BACKUP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableFinalBackup()); + } + hash = (37 * hash) + FINAL_BACKUP_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getFinalBackupDescription().hashCode(); + switch (expirationCase_) { + case 4: + hash = (37 * hash) + FINAL_BACKUP_TTL_DAYS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFinalBackupTtlDays()); + break; + case 6: + hash = (37 * hash) + FINAL_BACKUP_EXPIRY_TIME_FIELD_NUMBER; + hash = (53 * hash) + getFinalBackupExpiryTime().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesDeleteRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesDeleteRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDeleteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesDeleteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDeleteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesDeleteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDeleteRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesDeleteRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDeleteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesDeleteRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlInstancesDeleteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance delete request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesDeleteRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesDeleteRequest) + com.google.cloud.sql.v1.SqlInstancesDeleteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesDeleteRequest.class, + com.google.cloud.sql.v1.SqlInstancesDeleteRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesDeleteRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + enableFinalBackup_ = false; + if (finalBackupExpiryTimeBuilder_ != null) { + finalBackupExpiryTimeBuilder_.clear(); + } + finalBackupDescription_ = ""; + expirationCase_ = 0; + expiration_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDeleteRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesDeleteRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesDeleteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesDeleteRequest build() { + com.google.cloud.sql.v1.SqlInstancesDeleteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesDeleteRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesDeleteRequest result = + new com.google.cloud.sql.v1.SqlInstancesDeleteRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesDeleteRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.enableFinalBackup_ = enableFinalBackup_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.finalBackupDescription_ = finalBackupDescription_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.sql.v1.SqlInstancesDeleteRequest result) { + result.expirationCase_ = expirationCase_; + result.expiration_ = this.expiration_; + if (expirationCase_ == 6 && finalBackupExpiryTimeBuilder_ != null) { + result.expiration_ = finalBackupExpiryTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesDeleteRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesDeleteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesDeleteRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesDeleteRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasEnableFinalBackup()) { + setEnableFinalBackup(other.getEnableFinalBackup()); + } + if (!other.getFinalBackupDescription().isEmpty()) { + finalBackupDescription_ = other.finalBackupDescription_; + bitField0_ |= 0x00000020; + onChanged(); + } + switch (other.getExpirationCase()) { + case FINAL_BACKUP_TTL_DAYS: + { + setFinalBackupTtlDays(other.getFinalBackupTtlDays()); + break; + } + case FINAL_BACKUP_EXPIRY_TIME: + { + mergeFinalBackupExpiryTime(other.getFinalBackupExpiryTime()); + break; + } + case EXPIRATION_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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 32: + { + expiration_ = input.readInt64(); + expirationCase_ = 4; + break; + } // case 32 + case 42: + { + finalBackupDescription_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetFinalBackupExpiryTimeFieldBuilder().getBuilder(), extensionRegistry); + expirationCase_ = 6; + break; + } // case 50 + case 56: + { + enableFinalBackup_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 56 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int expirationCase_ = 0; + private java.lang.Object expiration_; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public Builder clearExpiration() { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance to be deleted.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be deleted.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be deleted.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be deleted.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be deleted.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean enableFinalBackup_; + + /** + * + * + *
+     * Flag to opt-in for final backup. By default, it is turned off.
+     * 
+ * + * optional bool enable_final_backup = 7; + * + * @return Whether the enableFinalBackup field is set. + */ + @java.lang.Override + public boolean hasEnableFinalBackup() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Flag to opt-in for final backup. By default, it is turned off.
+     * 
+ * + * optional bool enable_final_backup = 7; + * + * @return The enableFinalBackup. + */ + @java.lang.Override + public boolean getEnableFinalBackup() { + return enableFinalBackup_; + } + + /** + * + * + *
+     * Flag to opt-in for final backup. By default, it is turned off.
+     * 
+ * + * optional bool enable_final_backup = 7; + * + * @param value The enableFinalBackup to set. + * @return This builder for chaining. + */ + public Builder setEnableFinalBackup(boolean value) { + + enableFinalBackup_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Flag to opt-in for final backup. By default, it is turned off.
+     * 
+ * + * optional bool enable_final_backup = 7; + * + * @return This builder for chaining. + */ + public Builder clearEnableFinalBackup() { + bitField0_ = (bitField0_ & ~0x00000004); + enableFinalBackup_ = false; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Retention period of the final backup.
+     * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the finalBackupTtlDays field is set. + */ + public boolean hasFinalBackupTtlDays() { + return expirationCase_ == 4; + } + + /** + * + * + *
+     * Optional. Retention period of the final backup.
+     * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finalBackupTtlDays. + */ + public long getFinalBackupTtlDays() { + if (expirationCase_ == 4) { + return (java.lang.Long) expiration_; + } + return 0L; + } + + /** + * + * + *
+     * Optional. Retention period of the final backup.
+     * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The finalBackupTtlDays to set. + * @return This builder for chaining. + */ + public Builder setFinalBackupTtlDays(long value) { + + expirationCase_ = 4; + expiration_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Retention period of the final backup.
+     * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFinalBackupTtlDays() { + if (expirationCase_ == 4) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + finalBackupExpiryTimeBuilder_; + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the finalBackupExpiryTime field is set. + */ + @java.lang.Override + public boolean hasFinalBackupExpiryTime() { + return expirationCase_ == 6; + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The finalBackupExpiryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getFinalBackupExpiryTime() { + if (finalBackupExpiryTimeBuilder_ == null) { + if (expirationCase_ == 6) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (expirationCase_ == 6) { + return finalBackupExpiryTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFinalBackupExpiryTime(com.google.protobuf.Timestamp value) { + if (finalBackupExpiryTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + finalBackupExpiryTimeBuilder_.setMessage(value); + } + expirationCase_ = 6; + return this; + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFinalBackupExpiryTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (finalBackupExpiryTimeBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + finalBackupExpiryTimeBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 6; + return this; + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFinalBackupExpiryTime(com.google.protobuf.Timestamp value) { + if (finalBackupExpiryTimeBuilder_ == null) { + if (expirationCase_ == 6 + && expiration_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 6) { + finalBackupExpiryTimeBuilder_.mergeFrom(value); + } else { + finalBackupExpiryTimeBuilder_.setMessage(value); + } + } + expirationCase_ = 6; + return this; + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFinalBackupExpiryTime() { + if (finalBackupExpiryTimeBuilder_ == null) { + if (expirationCase_ == 6) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 6) { + expirationCase_ = 0; + expiration_ = null; + } + finalBackupExpiryTimeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getFinalBackupExpiryTimeBuilder() { + return internalGetFinalBackupExpiryTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getFinalBackupExpiryTimeOrBuilder() { + if ((expirationCase_ == 6) && (finalBackupExpiryTimeBuilder_ != null)) { + return finalBackupExpiryTimeBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 6) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetFinalBackupExpiryTimeFieldBuilder() { + if (finalBackupExpiryTimeBuilder_ == null) { + if (!(expirationCase_ == 6)) { + expiration_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + finalBackupExpiryTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 6; + onChanged(); + return finalBackupExpiryTimeBuilder_; + } + + private java.lang.Object finalBackupDescription_ = ""; + + /** + * + * + *
+     * Optional. The description of the final backup.
+     * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finalBackupDescription. + */ + public java.lang.String getFinalBackupDescription() { + java.lang.Object ref = finalBackupDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + finalBackupDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The description of the final backup.
+     * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for finalBackupDescription. + */ + public com.google.protobuf.ByteString getFinalBackupDescriptionBytes() { + java.lang.Object ref = finalBackupDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + finalBackupDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The description of the final backup.
+     * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The finalBackupDescription to set. + * @return This builder for chaining. + */ + public Builder setFinalBackupDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + finalBackupDescription_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The description of the final backup.
+     * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFinalBackupDescription() { + finalBackupDescription_ = getDefaultInstance().getFinalBackupDescription(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The description of the final backup.
+     * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for finalBackupDescription to set. + * @return This builder for chaining. + */ + public Builder setFinalBackupDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + finalBackupDescription_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesDeleteRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesDeleteRequest) + private static final com.google.cloud.sql.v1.SqlInstancesDeleteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesDeleteRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesDeleteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesDeleteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesDeleteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDeleteRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDeleteRequestOrBuilder.java new file mode 100644 index 000000000000..a8afb8275e86 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDeleteRequestOrBuilder.java @@ -0,0 +1,206 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesDeleteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesDeleteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance to be deleted.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance to be deleted.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Flag to opt-in for final backup. By default, it is turned off.
+   * 
+ * + * optional bool enable_final_backup = 7; + * + * @return Whether the enableFinalBackup field is set. + */ + boolean hasEnableFinalBackup(); + + /** + * + * + *
+   * Flag to opt-in for final backup. By default, it is turned off.
+   * 
+ * + * optional bool enable_final_backup = 7; + * + * @return The enableFinalBackup. + */ + boolean getEnableFinalBackup(); + + /** + * + * + *
+   * Optional. Retention period of the final backup.
+   * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the finalBackupTtlDays field is set. + */ + boolean hasFinalBackupTtlDays(); + + /** + * + * + *
+   * Optional. Retention period of the final backup.
+   * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finalBackupTtlDays. + */ + long getFinalBackupTtlDays(); + + /** + * + * + *
+   * Optional. Final Backup expiration time.
+   * Timestamp in UTC of when this resource is considered expired.
+   * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the finalBackupExpiryTime field is set. + */ + boolean hasFinalBackupExpiryTime(); + + /** + * + * + *
+   * Optional. Final Backup expiration time.
+   * Timestamp in UTC of when this resource is considered expired.
+   * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The finalBackupExpiryTime. + */ + com.google.protobuf.Timestamp getFinalBackupExpiryTime(); + + /** + * + * + *
+   * Optional. Final Backup expiration time.
+   * Timestamp in UTC of when this resource is considered expired.
+   * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getFinalBackupExpiryTimeOrBuilder(); + + /** + * + * + *
+   * Optional. The description of the final backup.
+   * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finalBackupDescription. + */ + java.lang.String getFinalBackupDescription(); + + /** + * + * + *
+   * Optional. The description of the final backup.
+   * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for finalBackupDescription. + */ + com.google.protobuf.ByteString getFinalBackupDescriptionBytes(); + + com.google.cloud.sql.v1.SqlInstancesDeleteRequest.ExpirationCase getExpirationCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDemoteMasterRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDemoteMasterRequest.java new file mode 100644 index 000000000000..37cfc6a0e29c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDemoteMasterRequest.java @@ -0,0 +1,990 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance demote master request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesDemoteMasterRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesDemoteMasterRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesDemoteMasterRequest) + SqlInstancesDemoteMasterRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesDemoteMasterRequest"); + } + + // Use SqlInstancesDemoteMasterRequest.newBuilder() to construct. + private SqlInstancesDemoteMasterRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesDemoteMasterRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDemoteMasterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDemoteMasterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest.class, + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.InstancesDemoteMasterRequest body_; + + /** + * .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesDemoteMasterRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesDemoteMasterRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesDemoteMasterRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesDemoteMasterRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest other = + (com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance demote master request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesDemoteMasterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesDemoteMasterRequest) + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDemoteMasterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDemoteMasterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest.class, + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDemoteMasterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest build() { + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest result = + new com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance name.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance name.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance name.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstancesDemoteMasterRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesDemoteMasterRequest, + com.google.cloud.sql.v1.InstancesDemoteMasterRequest.Builder, + com.google.cloud.sql.v1.InstancesDemoteMasterRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.InstancesDemoteMasterRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.InstancesDemoteMasterRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.InstancesDemoteMasterRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1.InstancesDemoteMasterRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.InstancesDemoteMasterRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.InstancesDemoteMasterRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; */ + public com.google.cloud.sql.v1.InstancesDemoteMasterRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; */ + public com.google.cloud.sql.v1.InstancesDemoteMasterRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.InstancesDemoteMasterRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesDemoteMasterRequest, + com.google.cloud.sql.v1.InstancesDemoteMasterRequest.Builder, + com.google.cloud.sql.v1.InstancesDemoteMasterRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesDemoteMasterRequest, + com.google.cloud.sql.v1.InstancesDemoteMasterRequest.Builder, + com.google.cloud.sql.v1.InstancesDemoteMasterRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesDemoteMasterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesDemoteMasterRequest) + private static final com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesDemoteMasterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDemoteMasterRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDemoteMasterRequestOrBuilder.java new file mode 100644 index 000000000000..a4f4840792fc --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDemoteMasterRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesDemoteMasterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesDemoteMasterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.InstancesDemoteMasterRequest getBody(); + + /** .google.cloud.sql.v1.InstancesDemoteMasterRequest body = 100; */ + com.google.cloud.sql.v1.InstancesDemoteMasterRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDemoteRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDemoteRequest.java new file mode 100644 index 000000000000..81728e5a511b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDemoteRequest.java @@ -0,0 +1,1100 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance demote request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesDemoteRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesDemoteRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesDemoteRequest) + SqlInstancesDemoteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesDemoteRequest"); + } + + // Use SqlInstancesDemoteRequest.newBuilder() to construct. + private SqlInstancesDemoteRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesDemoteRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDemoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDemoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesDemoteRequest.class, + com.google.cloud.sql.v1.SqlInstancesDemoteRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance name.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance name.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.InstancesDemoteRequest body_; + + /** + * + * + *
+   * Required. The request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesDemoteRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesDemoteRequest.getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * Required. The request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesDemoteRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesDemoteRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesDemoteRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesDemoteRequest other = + (com.google.cloud.sql.v1.SqlInstancesDemoteRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlInstancesDemoteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance demote request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesDemoteRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesDemoteRequest) + com.google.cloud.sql.v1.SqlInstancesDemoteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDemoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDemoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesDemoteRequest.class, + com.google.cloud.sql.v1.SqlInstancesDemoteRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesDemoteRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesDemoteRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesDemoteRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesDemoteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesDemoteRequest build() { + com.google.cloud.sql.v1.SqlInstancesDemoteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesDemoteRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesDemoteRequest result = + new com.google.cloud.sql.v1.SqlInstancesDemoteRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesDemoteRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesDemoteRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesDemoteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesDemoteRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesDemoteRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance name.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance name.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance name.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance name.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance name.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstancesDemoteRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesDemoteRequest, + com.google.cloud.sql.v1.InstancesDemoteRequest.Builder, + com.google.cloud.sql.v1.InstancesDemoteRequestOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + public com.google.cloud.sql.v1.InstancesDemoteRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.InstancesDemoteRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBody(com.google.cloud.sql.v1.InstancesDemoteRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBody(com.google.cloud.sql.v1.InstancesDemoteRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBody(com.google.cloud.sql.v1.InstancesDemoteRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.InstancesDemoteRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.InstancesDemoteRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.InstancesDemoteRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.InstancesDemoteRequest.getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * Required. The request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesDemoteRequest, + com.google.cloud.sql.v1.InstancesDemoteRequest.Builder, + com.google.cloud.sql.v1.InstancesDemoteRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesDemoteRequest, + com.google.cloud.sql.v1.InstancesDemoteRequest.Builder, + com.google.cloud.sql.v1.InstancesDemoteRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesDemoteRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesDemoteRequest) + private static final com.google.cloud.sql.v1.SqlInstancesDemoteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesDemoteRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesDemoteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesDemoteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesDemoteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDemoteRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDemoteRequestOrBuilder.java new file mode 100644 index 000000000000..2b91b3f6ef9f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesDemoteRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesDemoteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesDemoteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance name.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance name.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Required. The request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * Required. The request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + com.google.cloud.sql.v1.InstancesDemoteRequest getBody(); + + /** + * + * + *
+   * Required. The request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesDemoteRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1.InstancesDemoteRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExecuteSqlRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExecuteSqlRequest.java new file mode 100644 index 000000000000..8c97bdc11baa --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExecuteSqlRequest.java @@ -0,0 +1,1073 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Execute SQL statements request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesExecuteSqlRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesExecuteSqlRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesExecuteSqlRequest) + SqlInstancesExecuteSqlRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesExecuteSqlRequest"); + } + + // Use SqlInstancesExecuteSqlRequest.newBuilder() to construct. + private SqlInstancesExecuteSqlRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesExecuteSqlRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest.class, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.ExecuteSqlPayload body_; + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExecuteSqlPayload getBody() { + return body_ == null ? com.google.cloud.sql.v1.ExecuteSqlPayload.getDefaultInstance() : body_; + } + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExecuteSqlPayloadOrBuilder getBodyOrBuilder() { + return body_ == null ? com.google.cloud.sql.v1.ExecuteSqlPayload.getDefaultInstance() : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest other = + (com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Execute SQL statements request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesExecuteSqlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesExecuteSqlRequest) + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest.class, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest build() { + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest result = + new com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.ExecuteSqlPayload body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExecuteSqlPayload, + com.google.cloud.sql.v1.ExecuteSqlPayload.Builder, + com.google.cloud.sql.v1.ExecuteSqlPayloadOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.ExecuteSqlPayload getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.ExecuteSqlPayload.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + */ + public Builder setBody(com.google.cloud.sql.v1.ExecuteSqlPayload value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + */ + public Builder setBody(com.google.cloud.sql.v1.ExecuteSqlPayload.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + */ + public Builder mergeBody(com.google.cloud.sql.v1.ExecuteSqlPayload value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.ExecuteSqlPayload.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + */ + public com.google.cloud.sql.v1.ExecuteSqlPayload.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + */ + public com.google.cloud.sql.v1.ExecuteSqlPayloadOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.ExecuteSqlPayload.getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExecuteSqlPayload, + com.google.cloud.sql.v1.ExecuteSqlPayload.Builder, + com.google.cloud.sql.v1.ExecuteSqlPayloadOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.ExecuteSqlPayload, + com.google.cloud.sql.v1.ExecuteSqlPayload.Builder, + com.google.cloud.sql.v1.ExecuteSqlPayloadOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesExecuteSqlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesExecuteSqlRequest) + private static final com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesExecuteSqlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExecuteSqlRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExecuteSqlRequestOrBuilder.java new file mode 100644 index 000000000000..832771f2a61f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExecuteSqlRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesExecuteSqlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesExecuteSqlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.ExecuteSqlPayload getBody(); + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1.ExecuteSqlPayload body = 100; + */ + com.google.cloud.sql.v1.ExecuteSqlPayloadOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExecuteSqlResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExecuteSqlResponse.java new file mode 100644 index 000000000000..6e0d6897b6dd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExecuteSqlResponse.java @@ -0,0 +1,3114 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Execute SQL statements response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesExecuteSqlResponse} + */ +@com.google.protobuf.Generated +public final class SqlInstancesExecuteSqlResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesExecuteSqlResponse) + SqlInstancesExecuteSqlResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesExecuteSqlResponse"); + } + + // Use SqlInstancesExecuteSqlResponse.newBuilder() to construct. + private SqlInstancesExecuteSqlResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesExecuteSqlResponse() { + messages_ = java.util.Collections.emptyList(); + results_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.class, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Builder.class); + } + + public interface MessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The full message string.
+     * For PostgreSQL, this is a formatted string that may include severity,
+     * code, and the notice/warning message.
+     * For MySQL, this contains the warning message.
+     * 
+ * + * optional string message = 1; + * + * @return Whether the message field is set. + */ + boolean hasMessage(); + + /** + * + * + *
+     * The full message string.
+     * For PostgreSQL, this is a formatted string that may include severity,
+     * code, and the notice/warning message.
+     * For MySQL, this contains the warning message.
+     * 
+ * + * optional string message = 1; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
+     * The full message string.
+     * For PostgreSQL, this is a formatted string that may include severity,
+     * code, and the notice/warning message.
+     * For MySQL, this contains the warning message.
+     * 
+ * + * optional string message = 1; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
+     * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+     * MySQL).
+     * 
+ * + * optional string severity = 2; + * + * @return Whether the severity field is set. + */ + boolean hasSeverity(); + + /** + * + * + *
+     * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+     * MySQL).
+     * 
+ * + * optional string severity = 2; + * + * @return The severity. + */ + java.lang.String getSeverity(); + + /** + * + * + *
+     * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+     * MySQL).
+     * 
+ * + * optional string severity = 2; + * + * @return The bytes for severity. + */ + com.google.protobuf.ByteString getSeverityBytes(); + } + + /** + * + * + *
+   * Represents a notice or warning message from the database.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message} + */ + public static final class Message extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message) + MessageOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Message"); + } + + // Use Message.newBuilder() to construct. + private Message(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Message() { + message_ = ""; + severity_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlResponse_Message_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlResponse_Message_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.class, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.Builder.class); + } + + private int bitField0_; + public static final int MESSAGE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
+     * The full message string.
+     * For PostgreSQL, this is a formatted string that may include severity,
+     * code, and the notice/warning message.
+     * For MySQL, this contains the warning message.
+     * 
+ * + * optional string message = 1; + * + * @return Whether the message field is set. + */ + @java.lang.Override + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The full message string.
+     * For PostgreSQL, this is a formatted string that may include severity,
+     * code, and the notice/warning message.
+     * For MySQL, this contains the warning message.
+     * 
+ * + * optional string message = 1; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + + /** + * + * + *
+     * The full message string.
+     * For PostgreSQL, this is a formatted string that may include severity,
+     * code, and the notice/warning message.
+     * For MySQL, this contains the warning message.
+     * 
+ * + * optional string message = 1; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object severity_ = ""; + + /** + * + * + *
+     * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+     * MySQL).
+     * 
+ * + * optional string severity = 2; + * + * @return Whether the severity field is set. + */ + @java.lang.Override + public boolean hasSeverity() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+     * MySQL).
+     * 
+ * + * optional string severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public java.lang.String getSeverity() { + java.lang.Object ref = severity_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + severity_ = s; + return s; + } + } + + /** + * + * + *
+     * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+     * MySQL).
+     * 
+ * + * optional string severity = 2; + * + * @return The bytes for severity. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSeverityBytes() { + java.lang.Object ref = severity_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + severity_ = 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)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, message_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, severity_); + } + 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.GeneratedMessage.computeStringSize(1, message_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, severity_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message other = + (com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message) obj; + + if (hasMessage() != other.hasMessage()) return false; + if (hasMessage()) { + if (!getMessage().equals(other.getMessage())) return false; + } + if (hasSeverity() != other.hasSeverity()) return false; + if (hasSeverity()) { + if (!getSeverity().equals(other.getSeverity())) return false; + } + if (!getUnknownFields().equals(other.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 (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + if (hasSeverity()) { + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + getSeverity().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Represents a notice or warning message from the database.
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message) + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.MessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlResponse_Message_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlResponse_Message_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.class, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + message_ = ""; + severity_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlResponse_Message_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message build() { + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message buildPartial() { + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message result = + new com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.message_ = message_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.severity_ = severity_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.getDefaultInstance()) + return this; + if (other.hasMessage()) { + message_ = other.message_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSeverity()) { + severity_ = other.severity_; + 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: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + severity_ = 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 message_ = ""; + + /** + * + * + *
+       * The full message string.
+       * For PostgreSQL, this is a formatted string that may include severity,
+       * code, and the notice/warning message.
+       * For MySQL, this contains the warning message.
+       * 
+ * + * optional string message = 1; + * + * @return Whether the message field is set. + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The full message string.
+       * For PostgreSQL, this is a formatted string that may include severity,
+       * code, and the notice/warning message.
+       * For MySQL, this contains the warning message.
+       * 
+ * + * optional string message = 1; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The full message string.
+       * For PostgreSQL, this is a formatted string that may include severity,
+       * code, and the notice/warning message.
+       * For MySQL, this contains the warning message.
+       * 
+ * + * optional string message = 1; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The full message string.
+       * For PostgreSQL, this is a formatted string that may include severity,
+       * code, and the notice/warning message.
+       * For MySQL, this contains the warning message.
+       * 
+ * + * optional string message = 1; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The full message string.
+       * For PostgreSQL, this is a formatted string that may include severity,
+       * code, and the notice/warning message.
+       * For MySQL, this contains the warning message.
+       * 
+ * + * optional string message = 1; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The full message string.
+       * For PostgreSQL, this is a formatted string that may include severity,
+       * code, and the notice/warning message.
+       * For MySQL, this contains the warning message.
+       * 
+ * + * optional string message = 1; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object severity_ = ""; + + /** + * + * + *
+       * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+       * MySQL).
+       * 
+ * + * optional string severity = 2; + * + * @return Whether the severity field is set. + */ + public boolean hasSeverity() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+       * MySQL).
+       * 
+ * + * optional string severity = 2; + * + * @return The severity. + */ + public java.lang.String getSeverity() { + java.lang.Object ref = severity_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + severity_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+       * MySQL).
+       * 
+ * + * optional string severity = 2; + * + * @return The bytes for severity. + */ + public com.google.protobuf.ByteString getSeverityBytes() { + java.lang.Object ref = severity_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + severity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+       * MySQL).
+       * 
+ * + * optional string severity = 2; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + severity_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+       * MySQL).
+       * 
+ * + * optional string severity = 2; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + severity_ = getDefaultInstance().getSeverity(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+       * MySQL).
+       * 
+ * + * optional string severity = 2; + * + * @param value The bytes for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + severity_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message) + private static final com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message(); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Message parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int MESSAGES_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private java.util.List messages_; + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + */ + @java.lang.Override + public java.util.List + getMessagesList() { + return messages_; + } + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.MessageOrBuilder> + getMessagesOrBuilderList() { + return messages_; + } + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + */ + @java.lang.Override + public int getMessagesCount() { + return messages_.size(); + } + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message getMessages(int index) { + return messages_.get(index); + } + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.MessageOrBuilder + getMessagesOrBuilder(int index) { + return messages_.get(index); + } + + public static final int METADATA_FIELD_NUMBER = 6; + private com.google.cloud.sql.v1.Metadata metadata_; + + /** + * + * + *
+   * The additional metadata information regarding the execution of the SQL
+   * statements.
+   * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The additional metadata information regarding the execution of the SQL
+   * statements.
+   * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Metadata getMetadata() { + return metadata_ == null ? com.google.cloud.sql.v1.Metadata.getDefaultInstance() : metadata_; + } + + /** + * + * + *
+   * The additional metadata information regarding the execution of the SQL
+   * statements.
+   * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + */ + @java.lang.Override + public com.google.cloud.sql.v1.MetadataOrBuilder getMetadataOrBuilder() { + return metadata_ == null ? com.google.cloud.sql.v1.Metadata.getDefaultInstance() : metadata_; + } + + public static final int RESULTS_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private java.util.List results_; + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + @java.lang.Override + public java.util.List getResultsList() { + return results_; + } + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + @java.lang.Override + public java.util.List + getResultsOrBuilderList() { + return results_; + } + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + @java.lang.Override + public com.google.cloud.sql.v1.QueryResult getResults(int index) { + return results_.get(index); + } + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + @java.lang.Override + public com.google.cloud.sql.v1.QueryResultOrBuilder getResultsOrBuilder(int index) { + return results_.get(index); + } + + public static final int STATUS_FIELD_NUMBER = 8; + private com.google.rpc.Status status_; + + /** + * + * + *
+   * Contains the error from the database if the SQL execution failed.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Contains the error from the database if the SQL execution failed.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
+   * Contains the error from the database if the SQL execution failed.
+   * 
+ * + * .google.rpc.Status status = 8; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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(6, getMetadata()); + } + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(7, results_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(8, getStatus()); + } + for (int i = 0; i < messages_.size(); i++) { + output.writeMessage(9, messages_.get(i)); + } + 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(6, getMetadata()); + } + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, results_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getStatus()); + } + for (int i = 0; i < messages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, messages_.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.sql.v1.SqlInstancesExecuteSqlResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse other = + (com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse) obj; + + if (!getMessagesList().equals(other.getMessagesList())) return false; + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getResultsList().equals(other.getResultsList())) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (!getUnknownFields().equals(other.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 (getMessagesCount() > 0) { + hash = (37 * hash) + MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getMessagesList().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Execute SQL statements response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesExecuteSqlResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesExecuteSqlResponse) + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.class, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMessagesFieldBuilder(); + internalGetMetadataFieldBuilder(); + internalGetResultsFieldBuilder(); + internalGetStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + } else { + messages_ = null; + messagesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + } else { + results_ = null; + resultsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExecuteSqlResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse build() { + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse buildPartial() { + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse result = + new com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse result) { + if (messagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.messages_ = messages_; + } else { + result.messages_ = messagesBuilder_.build(); + } + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse other) { + if (other == com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.getDefaultInstance()) + return this; + if (messagesBuilder_ == null) { + if (!other.messages_.isEmpty()) { + if (messages_.isEmpty()) { + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMessagesIsMutable(); + messages_.addAll(other.messages_); + } + onChanged(); + } + } else { + if (!other.messages_.isEmpty()) { + if (messagesBuilder_.isEmpty()) { + messagesBuilder_.dispose(); + messagesBuilder_ = null; + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000001); + messagesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMessagesFieldBuilder() + : null; + } else { + messagesBuilder_.addAllMessages(other.messages_); + } + } + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000004); + resultsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetResultsFieldBuilder() + : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 50: + { + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 50 + case 58: + { + com.google.cloud.sql.v1.QueryResult m = + input.readMessage( + com.google.cloud.sql.v1.QueryResult.parser(), extensionRegistry); + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(m); + } else { + resultsBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: + { + input.readMessage(internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 66 + case 74: + { + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message m = + input.readMessage( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.parser(), + extensionRegistry); + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(m); + } else { + messagesBuilder_.addMessage(m); + } + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + messages_ = java.util.Collections.emptyList(); + + private void ensureMessagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + messages_ = + new java.util.ArrayList( + messages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.Builder, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.MessageOrBuilder> + messagesBuilder_; + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public java.util.List + getMessagesList() { + if (messagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(messages_); + } else { + return messagesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public int getMessagesCount() { + if (messagesBuilder_ == null) { + return messages_.size(); + } else { + return messagesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message getMessages(int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder setMessages( + int index, com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.set(index, value); + onChanged(); + } else { + messagesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder setMessages( + int index, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.set(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder addMessages( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(value); + onChanged(); + } else { + messagesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder addMessages( + int index, com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(index, value); + onChanged(); + } else { + messagesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder addMessages( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder addMessages( + int index, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder addAllMessages( + java.lang.Iterable + values) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, messages_); + onChanged(); + } else { + messagesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder clearMessages() { + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + messagesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder removeMessages(int index) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.remove(index); + onChanged(); + } else { + messagesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.Builder + getMessagesBuilder(int index) { + return internalGetMessagesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.MessageOrBuilder + getMessagesOrBuilder(int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public java.util.List< + ? extends com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.MessageOrBuilder> + getMessagesOrBuilderList() { + if (messagesBuilder_ != null) { + return messagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(messages_); + } + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.Builder + addMessagesBuilder() { + return internalGetMessagesFieldBuilder() + .addBuilder( + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.Builder + addMessagesBuilder(int index) { + return internalGetMessagesFieldBuilder() + .addBuilder( + index, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public java.util.List + getMessagesBuilderList() { + return internalGetMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.Builder, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.MessageOrBuilder> + internalGetMessagesFieldBuilder() { + if (messagesBuilder_ == null) { + messagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.Builder, + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.MessageOrBuilder>( + messages_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + messages_ = null; + } + return messagesBuilder_; + } + + private com.google.cloud.sql.v1.Metadata metadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Metadata, + com.google.cloud.sql.v1.Metadata.Builder, + com.google.cloud.sql.v1.MetadataOrBuilder> + metadataBuilder_; + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + * + * @return The metadata. + */ + public com.google.cloud.sql.v1.Metadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? com.google.cloud.sql.v1.Metadata.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + */ + public Builder setMetadata(com.google.cloud.sql.v1.Metadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + */ + public Builder setMetadata(com.google.cloud.sql.v1.Metadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + */ + public Builder mergeMetadata(com.google.cloud.sql.v1.Metadata value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && metadata_ != null + && metadata_ != com.google.cloud.sql.v1.Metadata.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + if (metadata_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000002); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + */ + public com.google.cloud.sql.v1.Metadata.Builder getMetadataBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetMetadataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + */ + public com.google.cloud.sql.v1.MetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? com.google.cloud.sql.v1.Metadata.getDefaultInstance() + : metadata_; + } + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Metadata, + com.google.cloud.sql.v1.Metadata.Builder, + com.google.cloud.sql.v1.MetadataOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Metadata, + com.google.cloud.sql.v1.Metadata.Builder, + com.google.cloud.sql.v1.MetadataOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private java.util.List results_ = + java.util.Collections.emptyList(); + + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + results_ = new java.util.ArrayList(results_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.QueryResult, + com.google.cloud.sql.v1.QueryResult.Builder, + com.google.cloud.sql.v1.QueryResultOrBuilder> + resultsBuilder_; + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public java.util.List getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public com.google.cloud.sql.v1.QueryResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public Builder setResults(int index, com.google.cloud.sql.v1.QueryResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public Builder setResults( + int index, com.google.cloud.sql.v1.QueryResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public Builder addResults(com.google.cloud.sql.v1.QueryResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public Builder addResults(int index, com.google.cloud.sql.v1.QueryResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public Builder addResults(com.google.cloud.sql.v1.QueryResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public Builder addResults( + int index, com.google.cloud.sql.v1.QueryResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public Builder addAllResults( + java.lang.Iterable values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public com.google.cloud.sql.v1.QueryResult.Builder getResultsBuilder(int index) { + return internalGetResultsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public com.google.cloud.sql.v1.QueryResultOrBuilder getResultsOrBuilder(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public java.util.List + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public com.google.cloud.sql.v1.QueryResult.Builder addResultsBuilder() { + return internalGetResultsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.QueryResult.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public com.google.cloud.sql.v1.QueryResult.Builder addResultsBuilder(int index) { + return internalGetResultsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.QueryResult.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + public java.util.List getResultsBuilderList() { + return internalGetResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.QueryResult, + com.google.cloud.sql.v1.QueryResult.Builder, + com.google.cloud.sql.v1.QueryResultOrBuilder> + internalGetResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.QueryResult, + com.google.cloud.sql.v1.QueryResult.Builder, + com.google.cloud.sql.v1.QueryResultOrBuilder>( + results_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000008); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesExecuteSqlResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesExecuteSqlResponse) + private static final com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse(); + } + + public static com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesExecuteSqlResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExecuteSqlResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExecuteSqlResponseOrBuilder.java new file mode 100644 index 000000000000..b031e668dbe8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExecuteSqlResponseOrBuilder.java @@ -0,0 +1,237 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesExecuteSqlResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesExecuteSqlResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + */ + java.util.List getMessagesList(); + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + */ + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message getMessages(int index); + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + */ + int getMessagesCount(); + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + */ + java.util.List + getMessagesOrBuilderList(); + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message messages = 9; + */ + com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.MessageOrBuilder getMessagesOrBuilder( + int index); + + /** + * + * + *
+   * The additional metadata information regarding the execution of the SQL
+   * statements.
+   * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + + /** + * + * + *
+   * The additional metadata information regarding the execution of the SQL
+   * statements.
+   * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + * + * @return The metadata. + */ + com.google.cloud.sql.v1.Metadata getMetadata(); + + /** + * + * + *
+   * The additional metadata information regarding the execution of the SQL
+   * statements.
+   * 
+ * + * .google.cloud.sql.v1.Metadata metadata = 6; + */ + com.google.cloud.sql.v1.MetadataOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + java.util.List getResultsList(); + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + com.google.cloud.sql.v1.QueryResult getResults(int index); + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + int getResultsCount(); + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + java.util.List getResultsOrBuilderList(); + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1.QueryResult results = 7; + */ + com.google.cloud.sql.v1.QueryResultOrBuilder getResultsOrBuilder(int index); + + /** + * + * + *
+   * Contains the error from the database if the SQL execution failed.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+   * Contains the error from the database if the SQL execution failed.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
+   * Contains the error from the database if the SQL execution failed.
+   * 
+ * + * .google.rpc.Status status = 8; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExportRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExportRequest.java new file mode 100644 index 000000000000..92dc70200f61 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExportRequest.java @@ -0,0 +1,988 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance export request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesExportRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesExportRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesExportRequest) + SqlInstancesExportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesExportRequest"); + } + + // Use SqlInstancesExportRequest.newBuilder() to construct. + private SqlInstancesExportRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesExportRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesExportRequest.class, + com.google.cloud.sql.v1.SqlInstancesExportRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance to be exported.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance to be exported.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.InstancesExportRequest body_; + + /** + * .google.cloud.sql.v1.InstancesExportRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.InstancesExportRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesExportRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesExportRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1.InstancesExportRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesExportRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesExportRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesExportRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesExportRequest other = + (com.google.cloud.sql.v1.SqlInstancesExportRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesExportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesExportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesExportRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesExportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesExportRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesExportRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesExportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesExportRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlInstancesExportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance export request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesExportRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesExportRequest) + com.google.cloud.sql.v1.SqlInstancesExportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesExportRequest.class, + com.google.cloud.sql.v1.SqlInstancesExportRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesExportRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesExportRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExportRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesExportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExportRequest build() { + com.google.cloud.sql.v1.SqlInstancesExportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExportRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesExportRequest result = + new com.google.cloud.sql.v1.SqlInstancesExportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesExportRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesExportRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesExportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesExportRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesExportRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance to be exported.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be exported.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be exported.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be exported.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be exported.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstancesExportRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesExportRequest, + com.google.cloud.sql.v1.InstancesExportRequest.Builder, + com.google.cloud.sql.v1.InstancesExportRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.InstancesExportRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.InstancesExportRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.InstancesExportRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.InstancesExportRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.InstancesExportRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.InstancesExportRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesExportRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.InstancesExportRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesExportRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.InstancesExportRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.InstancesExportRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.InstancesExportRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesExportRequest body = 100; */ + public com.google.cloud.sql.v1.InstancesExportRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.InstancesExportRequest body = 100; */ + public com.google.cloud.sql.v1.InstancesExportRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.InstancesExportRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1.InstancesExportRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesExportRequest, + com.google.cloud.sql.v1.InstancesExportRequest.Builder, + com.google.cloud.sql.v1.InstancesExportRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesExportRequest, + com.google.cloud.sql.v1.InstancesExportRequest.Builder, + com.google.cloud.sql.v1.InstancesExportRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesExportRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesExportRequest) + private static final com.google.cloud.sql.v1.SqlInstancesExportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesExportRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesExportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesExportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesExportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExportRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExportRequestOrBuilder.java new file mode 100644 index 000000000000..6a6bd693d9c7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesExportRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesExportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesExportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance to be exported.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance to be exported.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.InstancesExportRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.InstancesExportRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.InstancesExportRequest getBody(); + + /** .google.cloud.sql.v1.InstancesExportRequest body = 100; */ + com.google.cloud.sql.v1.InstancesExportRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesFailoverRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesFailoverRequest.java new file mode 100644 index 000000000000..ff123c8125ff --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesFailoverRequest.java @@ -0,0 +1,989 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance failover request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesFailoverRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesFailoverRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesFailoverRequest) + SqlInstancesFailoverRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesFailoverRequest"); + } + + // Use SqlInstancesFailoverRequest.newBuilder() to construct. + private SqlInstancesFailoverRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesFailoverRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesFailoverRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesFailoverRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesFailoverRequest.class, + com.google.cloud.sql.v1.SqlInstancesFailoverRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.InstancesFailoverRequest body_; + + /** + * .google.cloud.sql.v1.InstancesFailoverRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.InstancesFailoverRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesFailoverRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesFailoverRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1.InstancesFailoverRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesFailoverRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesFailoverRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesFailoverRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesFailoverRequest other = + (com.google.cloud.sql.v1.SqlInstancesFailoverRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesFailoverRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesFailoverRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesFailoverRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesFailoverRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesFailoverRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesFailoverRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesFailoverRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesFailoverRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesFailoverRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesFailoverRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesFailoverRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesFailoverRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlInstancesFailoverRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance failover request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesFailoverRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesFailoverRequest) + com.google.cloud.sql.v1.SqlInstancesFailoverRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesFailoverRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesFailoverRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesFailoverRequest.class, + com.google.cloud.sql.v1.SqlInstancesFailoverRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesFailoverRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesFailoverRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesFailoverRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesFailoverRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesFailoverRequest build() { + com.google.cloud.sql.v1.SqlInstancesFailoverRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesFailoverRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesFailoverRequest result = + new com.google.cloud.sql.v1.SqlInstancesFailoverRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesFailoverRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesFailoverRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesFailoverRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesFailoverRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesFailoverRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstancesFailoverRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesFailoverRequest, + com.google.cloud.sql.v1.InstancesFailoverRequest.Builder, + com.google.cloud.sql.v1.InstancesFailoverRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.InstancesFailoverRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.InstancesFailoverRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.InstancesFailoverRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.InstancesFailoverRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.InstancesFailoverRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.InstancesFailoverRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesFailoverRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1.InstancesFailoverRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesFailoverRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.InstancesFailoverRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.InstancesFailoverRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.InstancesFailoverRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesFailoverRequest body = 100; */ + public com.google.cloud.sql.v1.InstancesFailoverRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.InstancesFailoverRequest body = 100; */ + public com.google.cloud.sql.v1.InstancesFailoverRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.InstancesFailoverRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1.InstancesFailoverRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesFailoverRequest, + com.google.cloud.sql.v1.InstancesFailoverRequest.Builder, + com.google.cloud.sql.v1.InstancesFailoverRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesFailoverRequest, + com.google.cloud.sql.v1.InstancesFailoverRequest.Builder, + com.google.cloud.sql.v1.InstancesFailoverRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesFailoverRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesFailoverRequest) + private static final com.google.cloud.sql.v1.SqlInstancesFailoverRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesFailoverRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesFailoverRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesFailoverRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesFailoverRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesFailoverRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesFailoverRequestOrBuilder.java new file mode 100644 index 000000000000..7bd30a5dbfa8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesFailoverRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesFailoverRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesFailoverRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.InstancesFailoverRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.InstancesFailoverRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.InstancesFailoverRequest getBody(); + + /** .google.cloud.sql.v1.InstancesFailoverRequest body = 100; */ + com.google.cloud.sql.v1.InstancesFailoverRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetDiskShrinkConfigRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetDiskShrinkConfigRequest.java new file mode 100644 index 000000000000..0f5b17cb05d7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetDiskShrinkConfigRequest.java @@ -0,0 +1,794 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance get disk shrink config request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesGetDiskShrinkConfigRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest) + SqlInstancesGetDiskShrinkConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesGetDiskShrinkConfigRequest"); + } + + // Use SqlInstancesGetDiskShrinkConfigRequest.newBuilder() to construct. + private SqlInstancesGetDiskShrinkConfigRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesGetDiskShrinkConfigRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetDiskShrinkConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetDiskShrinkConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest.class, + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest other = + (com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance get disk shrink config request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest) + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetDiskShrinkConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetDiskShrinkConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest.class, + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetDiskShrinkConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest build() { + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest result = + new com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest) + private static final com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesGetDiskShrinkConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetDiskShrinkConfigRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetDiskShrinkConfigRequestOrBuilder.java new file mode 100644 index 000000000000..8b81134b4f92 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetDiskShrinkConfigRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesGetDiskShrinkConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetDiskShrinkConfigResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetDiskShrinkConfigResponse.java new file mode 100644 index 000000000000..6fd7e63619b3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetDiskShrinkConfigResponse.java @@ -0,0 +1,892 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance get disk shrink config response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse} + */ +@com.google.protobuf.Generated +public final class SqlInstancesGetDiskShrinkConfigResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse) + SqlInstancesGetDiskShrinkConfigResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesGetDiskShrinkConfigResponse"); + } + + // Use SqlInstancesGetDiskShrinkConfigResponse.newBuilder() to construct. + private SqlInstancesGetDiskShrinkConfigResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesGetDiskShrinkConfigResponse() { + kind_ = ""; + message_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetDiskShrinkConfigResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetDiskShrinkConfigResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse.class, + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#getDiskShrinkConfig`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#getDiskShrinkConfig`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MINIMAL_TARGET_SIZE_GB_FIELD_NUMBER = 2; + private long minimalTargetSizeGb_ = 0L; + + /** + * + * + *
+   * The minimum size to which a disk can be shrunk in GigaBytes.
+   * 
+ * + * int64 minimal_target_size_gb = 2; + * + * @return The minimalTargetSizeGb. + */ + @java.lang.Override + public long getMinimalTargetSizeGb() { + return minimalTargetSizeGb_; + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
+   * Additional message to customers.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + + /** + * + * + *
+   * Additional message to customers.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (minimalTargetSizeGb_ != 0L) { + output.writeInt64(2, minimalTargetSizeGb_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, message_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (minimalTargetSizeGb_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, minimalTargetSizeGb_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, message_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse other = + (com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (getMinimalTargetSizeGb() != other.getMinimalTargetSizeGb()) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + MINIMAL_TARGET_SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMinimalTargetSizeGb()); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance get disk shrink config response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse) + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetDiskShrinkConfigResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetDiskShrinkConfigResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse.class, + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + minimalTargetSizeGb_ = 0L; + message_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetDiskShrinkConfigResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse build() { + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse buildPartial() { + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse result = + new com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.minimalTargetSizeGb_ = minimalTargetSizeGb_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.message_ = message_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getMinimalTargetSizeGb() != 0L) { + setMinimalTargetSizeGb(other.getMinimalTargetSizeGb()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + minimalTargetSizeGb_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#getDiskShrinkConfig`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#getDiskShrinkConfig`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#getDiskShrinkConfig`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#getDiskShrinkConfig`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#getDiskShrinkConfig`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long minimalTargetSizeGb_; + + /** + * + * + *
+     * The minimum size to which a disk can be shrunk in GigaBytes.
+     * 
+ * + * int64 minimal_target_size_gb = 2; + * + * @return The minimalTargetSizeGb. + */ + @java.lang.Override + public long getMinimalTargetSizeGb() { + return minimalTargetSizeGb_; + } + + /** + * + * + *
+     * The minimum size to which a disk can be shrunk in GigaBytes.
+     * 
+ * + * int64 minimal_target_size_gb = 2; + * + * @param value The minimalTargetSizeGb to set. + * @return This builder for chaining. + */ + public Builder setMinimalTargetSizeGb(long value) { + + minimalTargetSizeGb_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The minimum size to which a disk can be shrunk in GigaBytes.
+     * 
+ * + * int64 minimal_target_size_gb = 2; + * + * @return This builder for chaining. + */ + public Builder clearMinimalTargetSizeGb() { + bitField0_ = (bitField0_ & ~0x00000002); + minimalTargetSizeGb_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + + /** + * + * + *
+     * Additional message to customers.
+     * 
+ * + * string message = 3; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Additional message to customers.
+     * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Additional message to customers.
+     * 
+ * + * string message = 3; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Additional message to customers.
+     * 
+ * + * string message = 3; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Additional message to customers.
+     * 
+ * + * string message = 3; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse) + private static final com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse(); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesGetDiskShrinkConfigResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetDiskShrinkConfigResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetDiskShrinkConfigResponseOrBuilder.java new file mode 100644 index 000000000000..ef717d92a22b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetDiskShrinkConfigResponseOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesGetDiskShrinkConfigResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#getDiskShrinkConfig`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#getDiskShrinkConfig`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The minimum size to which a disk can be shrunk in GigaBytes.
+   * 
+ * + * int64 minimal_target_size_gb = 2; + * + * @return The minimalTargetSizeGb. + */ + long getMinimalTargetSizeGb(); + + /** + * + * + *
+   * Additional message to customers.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
+   * Additional message to customers.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetLatestRecoveryTimeRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetLatestRecoveryTimeRequest.java new file mode 100644 index 000000000000..6c7130cf5ea2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetLatestRecoveryTimeRequest.java @@ -0,0 +1,1107 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance get latest recovery time request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesGetLatestRecoveryTimeRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest) + SqlInstancesGetLatestRecoveryTimeRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesGetLatestRecoveryTimeRequest"); + } + + // Use SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() to construct. + private SqlInstancesGetLatestRecoveryTimeRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesGetLatestRecoveryTimeRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetLatestRecoveryTimeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetLatestRecoveryTimeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest.class, + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_INSTANCE_DELETION_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp sourceInstanceDeletionTime_; + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + * + * @return Whether the sourceInstanceDeletionTime field is set. + */ + @java.lang.Override + public boolean hasSourceInstanceDeletionTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + * + * @return The sourceInstanceDeletionTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSourceInstanceDeletionTime() { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSourceInstanceDeletionTimeOrBuilder() { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getSourceInstanceDeletionTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, getSourceInstanceDeletionTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest other = + (com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasSourceInstanceDeletionTime() != other.hasSourceInstanceDeletionTime()) return false; + if (hasSourceInstanceDeletionTime()) { + if (!getSourceInstanceDeletionTime().equals(other.getSourceInstanceDeletionTime())) + return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasSourceInstanceDeletionTime()) { + hash = (37 * hash) + SOURCE_INSTANCE_DELETION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSourceInstanceDeletionTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance get latest recovery time request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest) + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetLatestRecoveryTimeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetLatestRecoveryTimeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest.class, + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSourceInstanceDeletionTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + sourceInstanceDeletionTime_ = null; + if (sourceInstanceDeletionTimeBuilder_ != null) { + sourceInstanceDeletionTimeBuilder_.dispose(); + sourceInstanceDeletionTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetLatestRecoveryTimeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest build() { + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest result = + new com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sourceInstanceDeletionTime_ = + sourceInstanceDeletionTimeBuilder_ == null + ? sourceInstanceDeletionTime_ + : sourceInstanceDeletionTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasSourceInstanceDeletionTime()) { + mergeSourceInstanceDeletionTime(other.getSourceInstanceDeletionTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetSourceInstanceDeletionTimeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp sourceInstanceDeletionTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + sourceInstanceDeletionTimeBuilder_; + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + * + * @return Whether the sourceInstanceDeletionTime field is set. + */ + public boolean hasSourceInstanceDeletionTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + * + * @return The sourceInstanceDeletionTime. + */ + public com.google.protobuf.Timestamp getSourceInstanceDeletionTime() { + if (sourceInstanceDeletionTimeBuilder_ == null) { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } else { + return sourceInstanceDeletionTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + public Builder setSourceInstanceDeletionTime(com.google.protobuf.Timestamp value) { + if (sourceInstanceDeletionTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceInstanceDeletionTime_ = value; + } else { + sourceInstanceDeletionTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + public Builder setSourceInstanceDeletionTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (sourceInstanceDeletionTimeBuilder_ == null) { + sourceInstanceDeletionTime_ = builderForValue.build(); + } else { + sourceInstanceDeletionTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + public Builder mergeSourceInstanceDeletionTime(com.google.protobuf.Timestamp value) { + if (sourceInstanceDeletionTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && sourceInstanceDeletionTime_ != null + && sourceInstanceDeletionTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getSourceInstanceDeletionTimeBuilder().mergeFrom(value); + } else { + sourceInstanceDeletionTime_ = value; + } + } else { + sourceInstanceDeletionTimeBuilder_.mergeFrom(value); + } + if (sourceInstanceDeletionTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + public Builder clearSourceInstanceDeletionTime() { + bitField0_ = (bitField0_ & ~0x00000004); + sourceInstanceDeletionTime_ = null; + if (sourceInstanceDeletionTimeBuilder_ != null) { + sourceInstanceDeletionTimeBuilder_.dispose(); + sourceInstanceDeletionTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getSourceInstanceDeletionTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetSourceInstanceDeletionTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getSourceInstanceDeletionTimeOrBuilder() { + if (sourceInstanceDeletionTimeBuilder_ != null) { + return sourceInstanceDeletionTimeBuilder_.getMessageOrBuilder(); + } else { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetSourceInstanceDeletionTimeFieldBuilder() { + if (sourceInstanceDeletionTimeBuilder_ == null) { + sourceInstanceDeletionTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSourceInstanceDeletionTime(), getParentForChildren(), isClean()); + sourceInstanceDeletionTime_ = null; + } + return sourceInstanceDeletionTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest) + private static final com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesGetLatestRecoveryTimeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetLatestRecoveryTimeRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetLatestRecoveryTimeRequestOrBuilder.java new file mode 100644 index 000000000000..23a42973c455 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetLatestRecoveryTimeRequestOrBuilder.java @@ -0,0 +1,120 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesGetLatestRecoveryTimeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + * + * @return Whether the sourceInstanceDeletionTime field is set. + */ + boolean hasSourceInstanceDeletionTime(); + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + * + * @return The sourceInstanceDeletionTime. + */ + com.google.protobuf.Timestamp getSourceInstanceDeletionTime(); + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getSourceInstanceDeletionTimeOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetLatestRecoveryTimeResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetLatestRecoveryTimeResponse.java new file mode 100644 index 000000000000..581c8e384cd4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetLatestRecoveryTimeResponse.java @@ -0,0 +1,1190 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance get latest recovery time response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse} + */ +@com.google.protobuf.Generated +public final class SqlInstancesGetLatestRecoveryTimeResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse) + SqlInstancesGetLatestRecoveryTimeResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesGetLatestRecoveryTimeResponse"); + } + + // Use SqlInstancesGetLatestRecoveryTimeResponse.newBuilder() to construct. + private SqlInstancesGetLatestRecoveryTimeResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesGetLatestRecoveryTimeResponse() { + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetLatestRecoveryTimeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetLatestRecoveryTimeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse.class, + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#getLatestRecoveryTime`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#getLatestRecoveryTime`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LATEST_RECOVERY_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp latestRecoveryTime_; + + /** + * + * + *
+   * Timestamp, identifies the latest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + * + * @return Whether the latestRecoveryTime field is set. + */ + @java.lang.Override + public boolean hasLatestRecoveryTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Timestamp, identifies the latest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + * + * @return The latestRecoveryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getLatestRecoveryTime() { + return latestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestRecoveryTime_; + } + + /** + * + * + *
+   * Timestamp, identifies the latest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getLatestRecoveryTimeOrBuilder() { + return latestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestRecoveryTime_; + } + + public static final int EARLIEST_RECOVERY_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp earliestRecoveryTime_; + + /** + * + * + *
+   * Timestamp, identifies the earliest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + * + * @return Whether the earliestRecoveryTime field is set. + */ + @java.lang.Override + public boolean hasEarliestRecoveryTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Timestamp, identifies the earliest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + * + * @return The earliestRecoveryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEarliestRecoveryTime() { + return earliestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRecoveryTime_; + } + + /** + * + * + *
+   * Timestamp, identifies the earliest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEarliestRecoveryTimeOrBuilder() { + return earliestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRecoveryTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getLatestRecoveryTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getEarliestRecoveryTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getLatestRecoveryTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEarliestRecoveryTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse other = + (com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (hasLatestRecoveryTime() != other.hasLatestRecoveryTime()) return false; + if (hasLatestRecoveryTime()) { + if (!getLatestRecoveryTime().equals(other.getLatestRecoveryTime())) return false; + } + if (hasEarliestRecoveryTime() != other.hasEarliestRecoveryTime()) return false; + if (hasEarliestRecoveryTime()) { + if (!getEarliestRecoveryTime().equals(other.getEarliestRecoveryTime())) return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasLatestRecoveryTime()) { + hash = (37 * hash) + LATEST_RECOVERY_TIME_FIELD_NUMBER; + hash = (53 * hash) + getLatestRecoveryTime().hashCode(); + } + if (hasEarliestRecoveryTime()) { + hash = (37 * hash) + EARLIEST_RECOVERY_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEarliestRecoveryTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance get latest recovery time response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse) + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetLatestRecoveryTimeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetLatestRecoveryTimeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse.class, + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetLatestRecoveryTimeFieldBuilder(); + internalGetEarliestRecoveryTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + latestRecoveryTime_ = null; + if (latestRecoveryTimeBuilder_ != null) { + latestRecoveryTimeBuilder_.dispose(); + latestRecoveryTimeBuilder_ = null; + } + earliestRecoveryTime_ = null; + if (earliestRecoveryTimeBuilder_ != null) { + earliestRecoveryTimeBuilder_.dispose(); + earliestRecoveryTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetLatestRecoveryTimeResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse build() { + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse buildPartial() { + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse result = + new com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.latestRecoveryTime_ = + latestRecoveryTimeBuilder_ == null + ? latestRecoveryTime_ + : latestRecoveryTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.earliestRecoveryTime_ = + earliestRecoveryTimeBuilder_ == null + ? earliestRecoveryTime_ + : earliestRecoveryTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasLatestRecoveryTime()) { + mergeLatestRecoveryTime(other.getLatestRecoveryTime()); + } + if (other.hasEarliestRecoveryTime()) { + mergeEarliestRecoveryTime(other.getEarliestRecoveryTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetLatestRecoveryTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetEarliestRecoveryTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#getLatestRecoveryTime`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#getLatestRecoveryTime`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#getLatestRecoveryTime`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#getLatestRecoveryTime`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#getLatestRecoveryTime`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp latestRecoveryTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + latestRecoveryTimeBuilder_; + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + * + * @return Whether the latestRecoveryTime field is set. + */ + public boolean hasLatestRecoveryTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + * + * @return The latestRecoveryTime. + */ + public com.google.protobuf.Timestamp getLatestRecoveryTime() { + if (latestRecoveryTimeBuilder_ == null) { + return latestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestRecoveryTime_; + } else { + return latestRecoveryTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + public Builder setLatestRecoveryTime(com.google.protobuf.Timestamp value) { + if (latestRecoveryTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + latestRecoveryTime_ = value; + } else { + latestRecoveryTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + public Builder setLatestRecoveryTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (latestRecoveryTimeBuilder_ == null) { + latestRecoveryTime_ = builderForValue.build(); + } else { + latestRecoveryTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + public Builder mergeLatestRecoveryTime(com.google.protobuf.Timestamp value) { + if (latestRecoveryTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && latestRecoveryTime_ != null + && latestRecoveryTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getLatestRecoveryTimeBuilder().mergeFrom(value); + } else { + latestRecoveryTime_ = value; + } + } else { + latestRecoveryTimeBuilder_.mergeFrom(value); + } + if (latestRecoveryTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + public Builder clearLatestRecoveryTime() { + bitField0_ = (bitField0_ & ~0x00000002); + latestRecoveryTime_ = null; + if (latestRecoveryTimeBuilder_ != null) { + latestRecoveryTimeBuilder_.dispose(); + latestRecoveryTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getLatestRecoveryTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetLatestRecoveryTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getLatestRecoveryTimeOrBuilder() { + if (latestRecoveryTimeBuilder_ != null) { + return latestRecoveryTimeBuilder_.getMessageOrBuilder(); + } else { + return latestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestRecoveryTime_; + } + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetLatestRecoveryTimeFieldBuilder() { + if (latestRecoveryTimeBuilder_ == null) { + latestRecoveryTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getLatestRecoveryTime(), getParentForChildren(), isClean()); + latestRecoveryTime_ = null; + } + return latestRecoveryTimeBuilder_; + } + + private com.google.protobuf.Timestamp earliestRecoveryTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + earliestRecoveryTimeBuilder_; + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + * + * @return Whether the earliestRecoveryTime field is set. + */ + public boolean hasEarliestRecoveryTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + * + * @return The earliestRecoveryTime. + */ + public com.google.protobuf.Timestamp getEarliestRecoveryTime() { + if (earliestRecoveryTimeBuilder_ == null) { + return earliestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRecoveryTime_; + } else { + return earliestRecoveryTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + public Builder setEarliestRecoveryTime(com.google.protobuf.Timestamp value) { + if (earliestRecoveryTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + earliestRecoveryTime_ = value; + } else { + earliestRecoveryTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + public Builder setEarliestRecoveryTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (earliestRecoveryTimeBuilder_ == null) { + earliestRecoveryTime_ = builderForValue.build(); + } else { + earliestRecoveryTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + public Builder mergeEarliestRecoveryTime(com.google.protobuf.Timestamp value) { + if (earliestRecoveryTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && earliestRecoveryTime_ != null + && earliestRecoveryTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEarliestRecoveryTimeBuilder().mergeFrom(value); + } else { + earliestRecoveryTime_ = value; + } + } else { + earliestRecoveryTimeBuilder_.mergeFrom(value); + } + if (earliestRecoveryTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + public Builder clearEarliestRecoveryTime() { + bitField0_ = (bitField0_ & ~0x00000004); + earliestRecoveryTime_ = null; + if (earliestRecoveryTimeBuilder_ != null) { + earliestRecoveryTimeBuilder_.dispose(); + earliestRecoveryTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEarliestRecoveryTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEarliestRecoveryTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEarliestRecoveryTimeOrBuilder() { + if (earliestRecoveryTimeBuilder_ != null) { + return earliestRecoveryTimeBuilder_.getMessageOrBuilder(); + } else { + return earliestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRecoveryTime_; + } + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEarliestRecoveryTimeFieldBuilder() { + if (earliestRecoveryTimeBuilder_ == null) { + earliestRecoveryTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEarliestRecoveryTime(), getParentForChildren(), isClean()); + earliestRecoveryTime_ = null; + } + return earliestRecoveryTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse) + private static final com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse(); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesGetLatestRecoveryTimeResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetLatestRecoveryTimeResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetLatestRecoveryTimeResponseOrBuilder.java new file mode 100644 index 000000000000..eb49d063857b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetLatestRecoveryTimeResponseOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesGetLatestRecoveryTimeResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#getLatestRecoveryTime`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#getLatestRecoveryTime`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Timestamp, identifies the latest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + * + * @return Whether the latestRecoveryTime field is set. + */ + boolean hasLatestRecoveryTime(); + + /** + * + * + *
+   * Timestamp, identifies the latest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + * + * @return The latestRecoveryTime. + */ + com.google.protobuf.Timestamp getLatestRecoveryTime(); + + /** + * + * + *
+   * Timestamp, identifies the latest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getLatestRecoveryTimeOrBuilder(); + + /** + * + * + *
+   * Timestamp, identifies the earliest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + * + * @return Whether the earliestRecoveryTime field is set. + */ + boolean hasEarliestRecoveryTime(); + + /** + * + * + *
+   * Timestamp, identifies the earliest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + * + * @return The earliestRecoveryTime. + */ + com.google.protobuf.Timestamp getEarliestRecoveryTime(); + + /** + * + * + *
+   * Timestamp, identifies the earliest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEarliestRecoveryTimeOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetRequest.java new file mode 100644 index 000000000000..eb3e2412db1f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetRequest.java @@ -0,0 +1,784 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance get request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesGetRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesGetRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesGetRequest) + SqlInstancesGetRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesGetRequest"); + } + + // Use SqlInstancesGetRequest.newBuilder() to construct. + private SqlInstancesGetRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesGetRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesGetRequest.class, + com.google.cloud.sql.v1.SqlInstancesGetRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesGetRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesGetRequest other = + (com.google.cloud.sql.v1.SqlInstancesGetRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesGetRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlInstancesGetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance get request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesGetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesGetRequest) + com.google.cloud.sql.v1.SqlInstancesGetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesGetRequest.class, + com.google.cloud.sql.v1.SqlInstancesGetRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesGetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesGetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesGetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetRequest build() { + com.google.cloud.sql.v1.SqlInstancesGetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesGetRequest result = + new com.google.cloud.sql.v1.SqlInstancesGetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesGetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesGetRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesGetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesGetRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesGetRequest.getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesGetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesGetRequest) + private static final com.google.cloud.sql.v1.SqlInstancesGetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesGetRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesGetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesGetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesGetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetRequestOrBuilder.java new file mode 100644 index 000000000000..58f8363400d0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesGetRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesGetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesGetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesImportRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesImportRequest.java new file mode 100644 index 000000000000..9590cc0bc48f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesImportRequest.java @@ -0,0 +1,988 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance import request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesImportRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesImportRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesImportRequest) + SqlInstancesImportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesImportRequest"); + } + + // Use SqlInstancesImportRequest.newBuilder() to construct. + private SqlInstancesImportRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesImportRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesImportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesImportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesImportRequest.class, + com.google.cloud.sql.v1.SqlInstancesImportRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.InstancesImportRequest body_; + + /** + * .google.cloud.sql.v1.InstancesImportRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.InstancesImportRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesImportRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesImportRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1.InstancesImportRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesImportRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesImportRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesImportRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesImportRequest other = + (com.google.cloud.sql.v1.SqlInstancesImportRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesImportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesImportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesImportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesImportRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesImportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesImportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesImportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesImportRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesImportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesImportRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesImportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesImportRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlInstancesImportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance import request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesImportRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesImportRequest) + com.google.cloud.sql.v1.SqlInstancesImportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesImportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesImportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesImportRequest.class, + com.google.cloud.sql.v1.SqlInstancesImportRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesImportRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesImportRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesImportRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesImportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesImportRequest build() { + com.google.cloud.sql.v1.SqlInstancesImportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesImportRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesImportRequest result = + new com.google.cloud.sql.v1.SqlInstancesImportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesImportRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesImportRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesImportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesImportRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesImportRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstancesImportRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesImportRequest, + com.google.cloud.sql.v1.InstancesImportRequest.Builder, + com.google.cloud.sql.v1.InstancesImportRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.InstancesImportRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.InstancesImportRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.InstancesImportRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.InstancesImportRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.InstancesImportRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.InstancesImportRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesImportRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.InstancesImportRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesImportRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.InstancesImportRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.InstancesImportRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.InstancesImportRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesImportRequest body = 100; */ + public com.google.cloud.sql.v1.InstancesImportRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.InstancesImportRequest body = 100; */ + public com.google.cloud.sql.v1.InstancesImportRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.InstancesImportRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1.InstancesImportRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesImportRequest, + com.google.cloud.sql.v1.InstancesImportRequest.Builder, + com.google.cloud.sql.v1.InstancesImportRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesImportRequest, + com.google.cloud.sql.v1.InstancesImportRequest.Builder, + com.google.cloud.sql.v1.InstancesImportRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesImportRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesImportRequest) + private static final com.google.cloud.sql.v1.SqlInstancesImportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesImportRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesImportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesImportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesImportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesImportRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesImportRequestOrBuilder.java new file mode 100644 index 000000000000..04e8c46c9b54 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesImportRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesImportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesImportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.InstancesImportRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.InstancesImportRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.InstancesImportRequest getBody(); + + /** .google.cloud.sql.v1.InstancesImportRequest body = 100; */ + com.google.cloud.sql.v1.InstancesImportRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesInsertRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesInsertRequest.java new file mode 100644 index 000000000000..544c33348313 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesInsertRequest.java @@ -0,0 +1,802 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance insert request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesInsertRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesInsertRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesInsertRequest) + SqlInstancesInsertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesInsertRequest"); + } + + // Use SqlInstancesInsertRequest.newBuilder() to construct. + private SqlInstancesInsertRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesInsertRequest() { + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesInsertRequest.class, + com.google.cloud.sql.v1.SqlInstancesInsertRequest.Builder.class); + } + + private int bitField0_; + public static final int PROJECT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project to which the newly created Cloud SQL instances
+   * should belong.
+   * 
+ * + * string project = 1; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project to which the newly created Cloud SQL instances
+   * should belong.
+   * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.DatabaseInstance body_; + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance getBody() { + return body_ == null ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() : body_; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getBodyOrBuilder() { + return body_ == null ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesInsertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesInsertRequest other = + (com.google.cloud.sql.v1.SqlInstancesInsertRequest) obj; + + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesInsertRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesInsertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesInsertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesInsertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesInsertRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesInsertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesInsertRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesInsertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesInsertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesInsertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlInstancesInsertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance insert request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesInsertRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesInsertRequest) + com.google.cloud.sql.v1.SqlInstancesInsertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesInsertRequest.class, + com.google.cloud.sql.v1.SqlInstancesInsertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesInsertRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesInsertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesInsertRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesInsertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesInsertRequest build() { + com.google.cloud.sql.v1.SqlInstancesInsertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesInsertRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesInsertRequest result = + new com.google.cloud.sql.v1.SqlInstancesInsertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesInsertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesInsertRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesInsertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesInsertRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesInsertRequest.getDefaultInstance()) + return this; + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 project_ = ""; + + /** + * + * + *
+     * Project ID of the project to which the newly created Cloud SQL instances
+     * should belong.
+     * 
+ * + * string project = 1; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project to which the newly created Cloud SQL instances
+     * should belong.
+     * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project to which the newly created Cloud SQL instances
+     * should belong.
+     * 
+ * + * string project = 1; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project to which the newly created Cloud SQL instances
+     * should belong.
+     * 
+ * + * string project = 1; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project to which the newly created Cloud SQL instances
+     * should belong.
+     * 
+ * + * string project = 1; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.DatabaseInstance body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.DatabaseInstance getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.DatabaseInstance value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.DatabaseInstance.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.DatabaseInstance value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000002); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public com.google.cloud.sql.v1.DatabaseInstance.Builder getBodyBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesInsertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesInsertRequest) + private static final com.google.cloud.sql.v1.SqlInstancesInsertRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesInsertRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesInsertRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesInsertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesInsertRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesInsertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesInsertRequestOrBuilder.java new file mode 100644 index 000000000000..bd95d4a69945 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesInsertRequestOrBuilder.java @@ -0,0 +1,73 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesInsertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesInsertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Project ID of the project to which the newly created Cloud SQL instances
+   * should belong.
+   * 
+ * + * string project = 1; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project to which the newly created Cloud SQL instances
+   * should belong.
+   * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.DatabaseInstance getBody(); + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListEntraIdCertificatesRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListEntraIdCertificatesRequest.java new file mode 100644 index 000000000000..5a58f8bc534b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListEntraIdCertificatesRequest.java @@ -0,0 +1,801 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance list Entra ID certificates request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesListEntraIdCertificatesRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest) + SqlInstancesListEntraIdCertificatesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesListEntraIdCertificatesRequest"); + } + + // Use SqlInstancesListEntraIdCertificatesRequest.newBuilder() to construct. + private SqlInstancesListEntraIdCertificatesRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesListEntraIdCertificatesRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListEntraIdCertificatesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListEntraIdCertificatesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest.class, + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest other = + (com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance list Entra ID certificates request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest) + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListEntraIdCertificatesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListEntraIdCertificatesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest.class, + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListEntraIdCertificatesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest build() { + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest result = + new com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest) { + return mergeFrom( + (com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest) + private static final com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesListEntraIdCertificatesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListEntraIdCertificatesRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListEntraIdCertificatesRequestOrBuilder.java new file mode 100644 index 000000000000..fd6f719692d7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListEntraIdCertificatesRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesListEntraIdCertificatesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListRequest.java new file mode 100644 index 000000000000..288a26070953 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListRequest.java @@ -0,0 +1,1146 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance list request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesListRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesListRequest) + SqlInstancesListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesListRequest"); + } + + // Use SqlInstancesListRequest.newBuilder() to construct. + private SqlInstancesListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesListRequest() { + filter_ = ""; + pageToken_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesListRequest.class, + com.google.cloud.sql.v1.SqlInstancesListRequest.Builder.class); + } + + public static final int FILTER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * A filter expression that filters resources listed in the response.
+   * The expression is in the form of field:value. For example,
+   * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+   * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+   *
+   * Multiple filter queries are space-separated. For example.
+   * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+   * expression is an AND expression. However, you can include AND and OR
+   * expressions explicitly.
+   * 
+ * + * string filter = 1; + * + * @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; + } + } + + /** + * + * + *
+   * A filter expression that filters resources listed in the response.
+   * The expression is in the form of field:value. For example,
+   * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+   * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+   *
+   * Multiple filter queries are space-separated. For example.
+   * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+   * expression is an AND expression. However, you can include AND and OR
+   * expressions explicitly.
+   * 
+ * + * string filter = 1; + * + * @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 MAX_RESULTS_FIELD_NUMBER = 2; + private int maxResults_ = 0; + + /** + * + * + *
+   * The maximum number of instances to return. The service may return fewer
+   * than this value.
+   * If unspecified, at most 500 instances are returned.
+   * The maximum value is 1000; values above 1000 are coerced to 1000.
+   * 
+ * + * uint32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project for which to list Cloud SQL instances.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project for which to list Cloud SQL instances.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, filter_); + } + if (maxResults_ != 0) { + output.writeUInt32(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, filter_); + } + if (maxResults_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesListRequest other = + (com.google.cloud.sql.v1.SqlInstancesListRequest) obj; + + if (!getFilter().equals(other.getFilter())) return false; + if (getMaxResults() != other.getMaxResults()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + MAX_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getMaxResults(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesListRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlInstancesListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance list request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesListRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesListRequest) + com.google.cloud.sql.v1.SqlInstancesListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesListRequest.class, + com.google.cloud.sql.v1.SqlInstancesListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + filter_ = ""; + maxResults_ = 0; + pageToken_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListRequest build() { + com.google.cloud.sql.v1.SqlInstancesListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesListRequest result = + new com.google.cloud.sql.v1.SqlInstancesListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxResults_ = maxResults_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesListRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesListRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesListRequest.getDefaultInstance()) + return this; + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getMaxResults() != 0) { + setMaxResults(other.getMaxResults()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + maxResults_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + project_ = 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 filter_ = ""; + + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * The expression is in the form of field:value. For example,
+     * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+     * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+     *
+     * Multiple filter queries are space-separated. For example.
+     * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+     * expression is an AND expression. However, you can include AND and OR
+     * expressions explicitly.
+     * 
+ * + * string filter = 1; + * + * @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; + } + } + + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * The expression is in the form of field:value. For example,
+     * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+     * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+     *
+     * Multiple filter queries are space-separated. For example.
+     * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+     * expression is an AND expression. However, you can include AND and OR
+     * expressions explicitly.
+     * 
+ * + * string filter = 1; + * + * @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; + } + } + + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * The expression is in the form of field:value. For example,
+     * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+     * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+     *
+     * Multiple filter queries are space-separated. For example.
+     * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+     * expression is an AND expression. However, you can include AND and OR
+     * expressions explicitly.
+     * 
+ * + * string filter = 1; + * + * @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_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * The expression is in the form of field:value. For example,
+     * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+     * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+     *
+     * Multiple filter queries are space-separated. For example.
+     * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+     * expression is an AND expression. However, you can include AND and OR
+     * expressions explicitly.
+     * 
+ * + * string filter = 1; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * The expression is in the form of field:value. For example,
+     * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+     * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+     *
+     * Multiple filter queries are space-separated. For example.
+     * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+     * expression is an AND expression. However, you can include AND and OR
+     * expressions explicitly.
+     * 
+ * + * string filter = 1; + * + * @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_ |= 0x00000001; + onChanged(); + return this; + } + + private int maxResults_; + + /** + * + * + *
+     * The maximum number of instances to return. The service may return fewer
+     * than this value.
+     * If unspecified, at most 500 instances are returned.
+     * The maximum value is 1000; values above 1000 are coerced to 1000.
+     * 
+ * + * uint32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + /** + * + * + *
+     * The maximum number of instances to return. The service may return fewer
+     * than this value.
+     * If unspecified, at most 500 instances are returned.
+     * The maximum value is 1000; values above 1000 are coerced to 1000.
+     * 
+ * + * uint32 max_results = 2; + * + * @param value The maxResults to set. + * @return This builder for chaining. + */ + public Builder setMaxResults(int value) { + + maxResults_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum number of instances to return. The service may return fewer
+     * than this value.
+     * If unspecified, at most 500 instances are returned.
+     * The maximum value is 1000; values above 1000 are coerced to 1000.
+     * 
+ * + * uint32 max_results = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxResults() { + bitField0_ = (bitField0_ & ~0x00000002); + maxResults_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project for which to list Cloud SQL instances.
+     * 
+ * + * string project = 4; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project for which to list Cloud SQL instances.
+     * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project for which to list Cloud SQL instances.
+     * 
+ * + * string project = 4; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project for which to list Cloud SQL instances.
+     * 
+ * + * string project = 4; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project for which to list Cloud SQL instances.
+     * 
+ * + * string project = 4; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesListRequest) + private static final com.google.cloud.sql.v1.SqlInstancesListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesListRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListRequestOrBuilder.java new file mode 100644 index 000000000000..d9bee44e8cd0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListRequestOrBuilder.java @@ -0,0 +1,140 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A filter expression that filters resources listed in the response.
+   * The expression is in the form of field:value. For example,
+   * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+   * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+   *
+   * Multiple filter queries are space-separated. For example.
+   * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+   * expression is an AND expression. However, you can include AND and OR
+   * expressions explicitly.
+   * 
+ * + * string filter = 1; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * A filter expression that filters resources listed in the response.
+   * The expression is in the form of field:value. For example,
+   * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+   * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+   *
+   * Multiple filter queries are space-separated. For example.
+   * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+   * expression is an AND expression. However, you can include AND and OR
+   * expressions explicitly.
+   * 
+ * + * string filter = 1; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The maximum number of instances to return. The service may return fewer
+   * than this value.
+   * If unspecified, at most 500 instances are returned.
+   * The maximum value is 1000; values above 1000 are coerced to 1000.
+   * 
+ * + * uint32 max_results = 2; + * + * @return The maxResults. + */ + int getMaxResults(); + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Project ID of the project for which to list Cloud SQL instances.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project for which to list Cloud SQL instances.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListServerCasRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListServerCasRequest.java new file mode 100644 index 000000000000..8899dc938ebb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListServerCasRequest.java @@ -0,0 +1,787 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance list server CAs request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesListServerCasRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesListServerCasRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesListServerCasRequest) + SqlInstancesListServerCasRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesListServerCasRequest"); + } + + // Use SqlInstancesListServerCasRequest.newBuilder() to construct. + private SqlInstancesListServerCasRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesListServerCasRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListServerCasRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListServerCasRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest.class, + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesListServerCasRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest other = + (com.google.cloud.sql.v1.SqlInstancesListServerCasRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCasRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCasRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCasRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCasRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCasRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCasRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCasRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCasRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCasRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCasRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCasRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCasRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance list server CAs request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesListServerCasRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesListServerCasRequest) + com.google.cloud.sql.v1.SqlInstancesListServerCasRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListServerCasRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListServerCasRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest.class, + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesListServerCasRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListServerCasRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListServerCasRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesListServerCasRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListServerCasRequest build() { + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListServerCasRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesListServerCasRequest result = + new com.google.cloud.sql.v1.SqlInstancesListServerCasRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesListServerCasRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesListServerCasRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesListServerCasRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesListServerCasRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesListServerCasRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesListServerCasRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesListServerCasRequest) + private static final com.google.cloud.sql.v1.SqlInstancesListServerCasRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesListServerCasRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCasRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesListServerCasRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListServerCasRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListServerCasRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListServerCasRequestOrBuilder.java new file mode 100644 index 000000000000..cc281e6b41b8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListServerCasRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesListServerCasRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesListServerCasRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListServerCertificatesRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListServerCertificatesRequest.java new file mode 100644 index 000000000000..b75095d1f1b9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListServerCertificatesRequest.java @@ -0,0 +1,799 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance list server certificates request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesListServerCertificatesRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest) + SqlInstancesListServerCertificatesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesListServerCertificatesRequest"); + } + + // Use SqlInstancesListServerCertificatesRequest.newBuilder() to construct. + private SqlInstancesListServerCertificatesRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesListServerCertificatesRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListServerCertificatesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListServerCertificatesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest.class, + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest other = + (com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance list server certificates request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest) + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListServerCertificatesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListServerCertificatesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest.class, + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesListServerCertificatesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest build() { + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest result = + new com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest) + private static final com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesListServerCertificatesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListServerCertificatesRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListServerCertificatesRequestOrBuilder.java new file mode 100644 index 000000000000..19efaf5301db --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesListServerCertificatesRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesListServerCertificatesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPatchRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPatchRequest.java new file mode 100644 index 000000000000..77fda4dafb57 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPatchRequest.java @@ -0,0 +1,1286 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance patch request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesPatchRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesPatchRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesPatchRequest) + SqlInstancesPatchRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesPatchRequest"); + } + + // Use SqlInstancesPatchRequest.newBuilder() to construct. + private SqlInstancesPatchRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesPatchRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPatchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPatchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesPatchRequest.class, + com.google.cloud.sql.v1.SqlInstancesPatchRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECONCILE_PSC_NETWORKING_FIELD_NUMBER = 4; + private boolean reconcilePscNetworking_ = false; + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config to
+   * reconcile the PSC networking.
+   * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reconcilePscNetworking field is set. + */ + @java.lang.Override + public boolean hasReconcilePscNetworking() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config to
+   * reconcile the PSC networking.
+   * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reconcilePscNetworking. + */ + @java.lang.Override + public boolean getReconcilePscNetworking() { + return reconcilePscNetworking_; + } + + public static final int RECONCILE_PSC_NETWORKING_FORCE_FIELD_NUMBER = 5; + private boolean reconcilePscNetworkingForce_ = false; + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config and force
+   * reconcile the PSC networking.
+   * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reconcilePscNetworkingForce field is set. + */ + @java.lang.Override + public boolean hasReconcilePscNetworkingForce() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config and force
+   * reconcile the PSC networking.
+   * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reconcilePscNetworkingForce. + */ + @java.lang.Override + public boolean getReconcilePscNetworkingForce() { + return reconcilePscNetworkingForce_; + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.DatabaseInstance body_; + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance getBody() { + return body_ == null ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() : body_; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getBodyOrBuilder() { + return body_ == null ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(4, reconcilePscNetworking_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(5, reconcilePscNetworkingForce_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, reconcilePscNetworking_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(5, reconcilePscNetworkingForce_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesPatchRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesPatchRequest other = + (com.google.cloud.sql.v1.SqlInstancesPatchRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasReconcilePscNetworking() != other.hasReconcilePscNetworking()) return false; + if (hasReconcilePscNetworking()) { + if (getReconcilePscNetworking() != other.getReconcilePscNetworking()) return false; + } + if (hasReconcilePscNetworkingForce() != other.hasReconcilePscNetworkingForce()) return false; + if (hasReconcilePscNetworkingForce()) { + if (getReconcilePscNetworkingForce() != other.getReconcilePscNetworkingForce()) return false; + } + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasReconcilePscNetworking()) { + hash = (37 * hash) + RECONCILE_PSC_NETWORKING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconcilePscNetworking()); + } + if (hasReconcilePscNetworkingForce()) { + hash = (37 * hash) + RECONCILE_PSC_NETWORKING_FORCE_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconcilePscNetworkingForce()); + } + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesPatchRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPatchRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPatchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPatchRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPatchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPatchRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPatchRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPatchRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPatchRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPatchRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPatchRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPatchRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlInstancesPatchRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance patch request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesPatchRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesPatchRequest) + com.google.cloud.sql.v1.SqlInstancesPatchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPatchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPatchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesPatchRequest.class, + com.google.cloud.sql.v1.SqlInstancesPatchRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesPatchRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + reconcilePscNetworking_ = false; + reconcilePscNetworkingForce_ = false; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPatchRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPatchRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesPatchRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPatchRequest build() { + com.google.cloud.sql.v1.SqlInstancesPatchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPatchRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesPatchRequest result = + new com.google.cloud.sql.v1.SqlInstancesPatchRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesPatchRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.reconcilePscNetworking_ = reconcilePscNetworking_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.reconcilePscNetworkingForce_ = reconcilePscNetworkingForce_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesPatchRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesPatchRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesPatchRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesPatchRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasReconcilePscNetworking()) { + setReconcilePscNetworking(other.getReconcilePscNetworking()); + } + if (other.hasReconcilePscNetworkingForce()) { + setReconcilePscNetworkingForce(other.getReconcilePscNetworkingForce()); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 32: + { + reconcilePscNetworking_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 40: + { + reconcilePscNetworkingForce_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 40 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean reconcilePscNetworking_; + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config to
+     * reconcile the PSC networking.
+     * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reconcilePscNetworking field is set. + */ + @java.lang.Override + public boolean hasReconcilePscNetworking() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config to
+     * reconcile the PSC networking.
+     * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reconcilePscNetworking. + */ + @java.lang.Override + public boolean getReconcilePscNetworking() { + return reconcilePscNetworking_; + } + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config to
+     * reconcile the PSC networking.
+     * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The reconcilePscNetworking to set. + * @return This builder for chaining. + */ + public Builder setReconcilePscNetworking(boolean value) { + + reconcilePscNetworking_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config to
+     * reconcile the PSC networking.
+     * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearReconcilePscNetworking() { + bitField0_ = (bitField0_ & ~0x00000004); + reconcilePscNetworking_ = false; + onChanged(); + return this; + } + + private boolean reconcilePscNetworkingForce_; + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config and force
+     * reconcile the PSC networking.
+     * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reconcilePscNetworkingForce field is set. + */ + @java.lang.Override + public boolean hasReconcilePscNetworkingForce() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config and force
+     * reconcile the PSC networking.
+     * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reconcilePscNetworkingForce. + */ + @java.lang.Override + public boolean getReconcilePscNetworkingForce() { + return reconcilePscNetworkingForce_; + } + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config and force
+     * reconcile the PSC networking.
+     * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The reconcilePscNetworkingForce to set. + * @return This builder for chaining. + */ + public Builder setReconcilePscNetworkingForce(boolean value) { + + reconcilePscNetworkingForce_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config and force
+     * reconcile the PSC networking.
+     * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearReconcilePscNetworkingForce() { + bitField0_ = (bitField0_ & ~0x00000008); + reconcilePscNetworkingForce_ = false; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.DatabaseInstance body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.DatabaseInstance getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.DatabaseInstance value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.DatabaseInstance.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.DatabaseInstance value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000010); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public com.google.cloud.sql.v1.DatabaseInstance.Builder getBodyBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesPatchRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesPatchRequest) + private static final com.google.cloud.sql.v1.SqlInstancesPatchRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesPatchRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesPatchRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesPatchRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPatchRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPatchRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPatchRequestOrBuilder.java new file mode 100644 index 000000000000..9091f34069a0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPatchRequestOrBuilder.java @@ -0,0 +1,159 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesPatchRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesPatchRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config to
+   * reconcile the PSC networking.
+   * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reconcilePscNetworking field is set. + */ + boolean hasReconcilePscNetworking(); + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config to
+   * reconcile the PSC networking.
+   * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reconcilePscNetworking. + */ + boolean getReconcilePscNetworking(); + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config and force
+   * reconcile the PSC networking.
+   * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reconcilePscNetworkingForce field is set. + */ + boolean hasReconcilePscNetworkingForce(); + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config and force
+   * reconcile the PSC networking.
+   * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reconcilePscNetworkingForce. + */ + boolean getReconcilePscNetworkingForce(); + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.DatabaseInstance getBody(); + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPerformDiskShrinkRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPerformDiskShrinkRequest.java new file mode 100644 index 000000000000..b80e1deb0383 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPerformDiskShrinkRequest.java @@ -0,0 +1,1083 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance perform disk shrink request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesPerformDiskShrinkRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest) + SqlInstancesPerformDiskShrinkRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesPerformDiskShrinkRequest"); + } + + // Use SqlInstancesPerformDiskShrinkRequest.newBuilder() to construct. + private SqlInstancesPerformDiskShrinkRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesPerformDiskShrinkRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPerformDiskShrinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPerformDiskShrinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest.class, + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.PerformDiskShrinkContext body_; + + /** + * + * + *
+   * Perform disk shrink context.
+   * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Perform disk shrink context.
+   * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.PerformDiskShrinkContext getBody() { + return body_ == null + ? com.google.cloud.sql.v1.PerformDiskShrinkContext.getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * Perform disk shrink context.
+   * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + */ + @java.lang.Override + public com.google.cloud.sql.v1.PerformDiskShrinkContextOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.PerformDiskShrinkContext.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest other = + (com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance perform disk shrink request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest) + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPerformDiskShrinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPerformDiskShrinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest.class, + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPerformDiskShrinkRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest build() { + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest result = + new com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.PerformDiskShrinkContext body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PerformDiskShrinkContext, + com.google.cloud.sql.v1.PerformDiskShrinkContext.Builder, + com.google.cloud.sql.v1.PerformDiskShrinkContextOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.PerformDiskShrinkContext getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.PerformDiskShrinkContext.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + */ + public Builder setBody(com.google.cloud.sql.v1.PerformDiskShrinkContext value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + */ + public Builder setBody( + com.google.cloud.sql.v1.PerformDiskShrinkContext.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + */ + public Builder mergeBody(com.google.cloud.sql.v1.PerformDiskShrinkContext value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.PerformDiskShrinkContext.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + */ + public com.google.cloud.sql.v1.PerformDiskShrinkContext.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + */ + public com.google.cloud.sql.v1.PerformDiskShrinkContextOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.PerformDiskShrinkContext.getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PerformDiskShrinkContext, + com.google.cloud.sql.v1.PerformDiskShrinkContext.Builder, + com.google.cloud.sql.v1.PerformDiskShrinkContextOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PerformDiskShrinkContext, + com.google.cloud.sql.v1.PerformDiskShrinkContext.Builder, + com.google.cloud.sql.v1.PerformDiskShrinkContextOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest) + private static final com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesPerformDiskShrinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPerformDiskShrinkRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPerformDiskShrinkRequestOrBuilder.java new file mode 100644 index 000000000000..f40d596cc703 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPerformDiskShrinkRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesPerformDiskShrinkRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Perform disk shrink context.
+   * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * Perform disk shrink context.
+   * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.PerformDiskShrinkContext getBody(); + + /** + * + * + *
+   * Perform disk shrink context.
+   * 
+ * + * .google.cloud.sql.v1.PerformDiskShrinkContext body = 100; + */ + com.google.cloud.sql.v1.PerformDiskShrinkContextOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPointInTimeRestoreRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPointInTimeRestoreRequest.java new file mode 100644 index 000000000000..c0a8043d81fb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPointInTimeRestoreRequest.java @@ -0,0 +1,940 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Request to perform a point in time restore on a Google Cloud Backup and
+ * Disaster Recovery managed instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesPointInTimeRestoreRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest) + SqlInstancesPointInTimeRestoreRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesPointInTimeRestoreRequest"); + } + + // Use SqlInstancesPointInTimeRestoreRequest.newBuilder() to construct. + private SqlInstancesPointInTimeRestoreRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesPointInTimeRestoreRequest() { + parent_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPointInTimeRestoreRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPointInTimeRestoreRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest.class, + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest.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 you created this instance.
+   * Format: projects/{project}
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 you created this instance.
+   * Format: projects/{project}
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 CONTEXT_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.PointInTimeRestoreContext context_; + + /** + * + * + *
+   * Required. The context for request to perform a PITR on a Google Cloud
+   * Backup and Disaster Recovery managed instance.
+   * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the context field is set. + */ + @java.lang.Override + public boolean hasContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The context for request to perform a PITR on a Google Cloud
+   * Backup and Disaster Recovery managed instance.
+   * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The context. + */ + @java.lang.Override + public com.google.cloud.sql.v1.PointInTimeRestoreContext getContext() { + return context_ == null + ? com.google.cloud.sql.v1.PointInTimeRestoreContext.getDefaultInstance() + : context_; + } + + /** + * + * + *
+   * Required. The context for request to perform a PITR on a Google Cloud
+   * Backup and Disaster Recovery managed instance.
+   * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.PointInTimeRestoreContextOrBuilder getContextOrBuilder() { + return context_ == null + ? com.google.cloud.sql.v1.PointInTimeRestoreContext.getDefaultInstance() + : context_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getContext()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest other = + (com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasContext() != other.hasContext()) return false; + if (hasContext()) { + if (!getContext().equals(other.getContext())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasContext()) { + hash = (37 * hash) + CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request to perform a point in time restore on a Google Cloud Backup and
+   * Disaster Recovery managed instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest) + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPointInTimeRestoreRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPointInTimeRestoreRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest.class, + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + context_ = null; + if (contextBuilder_ != null) { + contextBuilder_.dispose(); + contextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPointInTimeRestoreRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest build() { + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest result = + new com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.context_ = contextBuilder_ == null ? context_ : contextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasContext()) { + mergeContext(other.getContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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 802: + { + input.readMessage(internalGetContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 you created this instance.
+     * Format: projects/{project}
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 you created this instance.
+     * Format: projects/{project}
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 you created this instance.
+     * Format: projects/{project}
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 you created this instance.
+     * Format: projects/{project}
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent resource where you created this instance.
+     * Format: projects/{project}
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.PointInTimeRestoreContext context_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PointInTimeRestoreContext, + com.google.cloud.sql.v1.PointInTimeRestoreContext.Builder, + com.google.cloud.sql.v1.PointInTimeRestoreContextOrBuilder> + contextBuilder_; + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the context field is set. + */ + public boolean hasContext() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The context. + */ + public com.google.cloud.sql.v1.PointInTimeRestoreContext getContext() { + if (contextBuilder_ == null) { + return context_ == null + ? com.google.cloud.sql.v1.PointInTimeRestoreContext.getDefaultInstance() + : context_; + } else { + return contextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setContext(com.google.cloud.sql.v1.PointInTimeRestoreContext value) { + if (contextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + context_ = value; + } else { + contextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setContext( + com.google.cloud.sql.v1.PointInTimeRestoreContext.Builder builderForValue) { + if (contextBuilder_ == null) { + context_ = builderForValue.build(); + } else { + contextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeContext(com.google.cloud.sql.v1.PointInTimeRestoreContext value) { + if (contextBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && context_ != null + && context_ != com.google.cloud.sql.v1.PointInTimeRestoreContext.getDefaultInstance()) { + getContextBuilder().mergeFrom(value); + } else { + context_ = value; + } + } else { + contextBuilder_.mergeFrom(value); + } + if (context_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearContext() { + bitField0_ = (bitField0_ & ~0x00000002); + context_ = null; + if (contextBuilder_ != null) { + contextBuilder_.dispose(); + contextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.PointInTimeRestoreContext.Builder getContextBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.PointInTimeRestoreContextOrBuilder getContextOrBuilder() { + if (contextBuilder_ != null) { + return contextBuilder_.getMessageOrBuilder(); + } else { + return context_ == null + ? com.google.cloud.sql.v1.PointInTimeRestoreContext.getDefaultInstance() + : context_; + } + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PointInTimeRestoreContext, + com.google.cloud.sql.v1.PointInTimeRestoreContext.Builder, + com.google.cloud.sql.v1.PointInTimeRestoreContextOrBuilder> + internalGetContextFieldBuilder() { + if (contextBuilder_ == null) { + contextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PointInTimeRestoreContext, + com.google.cloud.sql.v1.PointInTimeRestoreContext.Builder, + com.google.cloud.sql.v1.PointInTimeRestoreContextOrBuilder>( + getContext(), getParentForChildren(), isClean()); + context_ = null; + } + return contextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest) + private static final com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesPointInTimeRestoreRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPointInTimeRestoreRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPointInTimeRestoreRequestOrBuilder.java new file mode 100644 index 000000000000..412d64e0c7ec --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPointInTimeRestoreRequestOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesPointInTimeRestoreRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource where you created this instance.
+   * Format: projects/{project}
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent resource where you created this instance.
+   * Format: projects/{project}
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The context for request to perform a PITR on a Google Cloud
+   * Backup and Disaster Recovery managed instance.
+   * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the context field is set. + */ + boolean hasContext(); + + /** + * + * + *
+   * Required. The context for request to perform a PITR on a Google Cloud
+   * Backup and Disaster Recovery managed instance.
+   * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The context. + */ + com.google.cloud.sql.v1.PointInTimeRestoreContext getContext(); + + /** + * + * + *
+   * Required. The context for request to perform a PITR on a Google Cloud
+   * Backup and Disaster Recovery managed instance.
+   * 
+ * + * + * .google.cloud.sql.v1.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1.PointInTimeRestoreContextOrBuilder getContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPreCheckMajorVersionUpgradeRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPreCheckMajorVersionUpgradeRequest.java new file mode 100644 index 000000000000..ee3fa40e1cc7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPreCheckMajorVersionUpgradeRequest.java @@ -0,0 +1,1142 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Request for Pre-checks for MVU
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesPreCheckMajorVersionUpgradeRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest) + SqlInstancesPreCheckMajorVersionUpgradeRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesPreCheckMajorVersionUpgradeRequest"); + } + + // Use SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() to construct. + private SqlInstancesPreCheckMajorVersionUpgradeRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesPreCheckMajorVersionUpgradeRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPreCheckMajorVersionUpgradeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPreCheckMajorVersionUpgradeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest.class, + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 3; + private com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body_; + + /** + * + * + *
+   * Required. The context for request to perform the pre-check major version
+   * upgrade operation.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The context for request to perform the pre-check major version
+   * upgrade operation.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * Required. The context for request to perform the pre-check major version
+   * upgrade operation.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequestOrBuilder + getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest other = + (com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request for Pre-checks for MVU
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest) + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPreCheckMajorVersionUpgradeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPreCheckMajorVersionUpgradeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest.class, + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPreCheckMajorVersionUpgradeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest build() { + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest result = + new com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest) { + return mergeFrom( + (com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest, + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.Builder, + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequestOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + public com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBody( + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBody( + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.Builder + builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBody( + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.Builder + getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequestOrBuilder + getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest, + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.Builder, + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest, + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.Builder, + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest) + private static final com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesPreCheckMajorVersionUpgradeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser + parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser + getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPreCheckMajorVersionUpgradeRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPreCheckMajorVersionUpgradeRequestOrBuilder.java new file mode 100644 index 000000000000..a8b3215addf5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPreCheckMajorVersionUpgradeRequestOrBuilder.java @@ -0,0 +1,126 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesPreCheckMajorVersionUpgradeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Required. The context for request to perform the pre-check major version
+   * upgrade operation.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * Required. The context for request to perform the pre-check major version
+   * upgrade operation.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest getBody(); + + /** + * + * + *
+   * Required. The context for request to perform the pre-check major version
+   * upgrade operation.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPromoteReplicaRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPromoteReplicaRequest.java new file mode 100644 index 000000000000..1565c9404f82 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPromoteReplicaRequest.java @@ -0,0 +1,904 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance promote replica request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesPromoteReplicaRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest) + SqlInstancesPromoteReplicaRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesPromoteReplicaRequest"); + } + + // Use SqlInstancesPromoteReplicaRequest.newBuilder() to construct. + private SqlInstancesPromoteReplicaRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesPromoteReplicaRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPromoteReplicaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPromoteReplicaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest.class, + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FAILOVER_FIELD_NUMBER = 3; + private boolean failover_ = false; + + /** + * + * + *
+   * Set to true to invoke a replica failover to the DR
+   * replica. As part of replica failover, the promote operation attempts
+   * to add the original primary instance as a replica of the promoted
+   * DR replica when the original primary instance comes back online.
+   * If set to false or not specified, then the original primary
+   * instance becomes an independent Cloud SQL primary instance.
+   * 
+ * + * bool failover = 3; + * + * @return The failover. + */ + @java.lang.Override + public boolean getFailover() { + return failover_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (failover_ != false) { + output.writeBool(3, failover_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (failover_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, failover_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest other = + (com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (getFailover() != other.getFailover()) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + FAILOVER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFailover()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance promote replica request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest) + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPromoteReplicaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPromoteReplicaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest.class, + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + failover_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesPromoteReplicaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest build() { + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest result = + new com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.failover_ = failover_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getFailover() != false) { + setFailover(other.getFailover()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + failover_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean failover_; + + /** + * + * + *
+     * Set to true to invoke a replica failover to the DR
+     * replica. As part of replica failover, the promote operation attempts
+     * to add the original primary instance as a replica of the promoted
+     * DR replica when the original primary instance comes back online.
+     * If set to false or not specified, then the original primary
+     * instance becomes an independent Cloud SQL primary instance.
+     * 
+ * + * bool failover = 3; + * + * @return The failover. + */ + @java.lang.Override + public boolean getFailover() { + return failover_; + } + + /** + * + * + *
+     * Set to true to invoke a replica failover to the DR
+     * replica. As part of replica failover, the promote operation attempts
+     * to add the original primary instance as a replica of the promoted
+     * DR replica when the original primary instance comes back online.
+     * If set to false or not specified, then the original primary
+     * instance becomes an independent Cloud SQL primary instance.
+     * 
+ * + * bool failover = 3; + * + * @param value The failover to set. + * @return This builder for chaining. + */ + public Builder setFailover(boolean value) { + + failover_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Set to true to invoke a replica failover to the DR
+     * replica. As part of replica failover, the promote operation attempts
+     * to add the original primary instance as a replica of the promoted
+     * DR replica when the original primary instance comes back online.
+     * If set to false or not specified, then the original primary
+     * instance becomes an independent Cloud SQL primary instance.
+     * 
+ * + * bool failover = 3; + * + * @return This builder for chaining. + */ + public Builder clearFailover() { + bitField0_ = (bitField0_ & ~0x00000004); + failover_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest) + private static final com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesPromoteReplicaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPromoteReplicaRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPromoteReplicaRequestOrBuilder.java new file mode 100644 index 000000000000..8aa0a736018a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesPromoteReplicaRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesPromoteReplicaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Set to true to invoke a replica failover to the DR
+   * replica. As part of replica failover, the promote operation attempts
+   * to add the original primary instance as a replica of the promoted
+   * DR replica when the original primary instance comes back online.
+   * If set to false or not specified, then the original primary
+   * instance becomes an independent Cloud SQL primary instance.
+   * 
+ * + * bool failover = 3; + * + * @return The failover. + */ + boolean getFailover(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReencryptRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReencryptRequest.java new file mode 100644 index 000000000000..f43d92fd0f88 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReencryptRequest.java @@ -0,0 +1,1077 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance reencrypt request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesReencryptRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesReencryptRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesReencryptRequest) + SqlInstancesReencryptRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesReencryptRequest"); + } + + // Use SqlInstancesReencryptRequest.newBuilder() to construct. + private SqlInstancesReencryptRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesReencryptRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReencryptRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReencryptRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesReencryptRequest.class, + com.google.cloud.sql.v1.SqlInstancesReencryptRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 3; + private com.google.cloud.sql.v1.InstancesReencryptRequest body_; + + /** + * + * + *
+   * Reencrypt body that users request
+   * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Reencrypt body that users request
+   * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesReencryptRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesReencryptRequest.getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * Reencrypt body that users request
+   * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesReencryptRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesReencryptRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesReencryptRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesReencryptRequest other = + (com.google.cloud.sql.v1.SqlInstancesReencryptRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesReencryptRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesReencryptRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReencryptRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesReencryptRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReencryptRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesReencryptRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReencryptRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesReencryptRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReencryptRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesReencryptRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReencryptRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesReencryptRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlInstancesReencryptRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance reencrypt request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesReencryptRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesReencryptRequest) + com.google.cloud.sql.v1.SqlInstancesReencryptRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReencryptRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReencryptRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesReencryptRequest.class, + com.google.cloud.sql.v1.SqlInstancesReencryptRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesReencryptRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReencryptRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesReencryptRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesReencryptRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesReencryptRequest build() { + com.google.cloud.sql.v1.SqlInstancesReencryptRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesReencryptRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesReencryptRequest result = + new com.google.cloud.sql.v1.SqlInstancesReencryptRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesReencryptRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesReencryptRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesReencryptRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesReencryptRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesReencryptRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstancesReencryptRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesReencryptRequest, + com.google.cloud.sql.v1.InstancesReencryptRequest.Builder, + com.google.cloud.sql.v1.InstancesReencryptRequestOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + * + * @return The body. + */ + public com.google.cloud.sql.v1.InstancesReencryptRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.InstancesReencryptRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + */ + public Builder setBody(com.google.cloud.sql.v1.InstancesReencryptRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + */ + public Builder setBody( + com.google.cloud.sql.v1.InstancesReencryptRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + */ + public Builder mergeBody(com.google.cloud.sql.v1.InstancesReencryptRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.InstancesReencryptRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + */ + public com.google.cloud.sql.v1.InstancesReencryptRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + */ + public com.google.cloud.sql.v1.InstancesReencryptRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.InstancesReencryptRequest.getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesReencryptRequest, + com.google.cloud.sql.v1.InstancesReencryptRequest.Builder, + com.google.cloud.sql.v1.InstancesReencryptRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesReencryptRequest, + com.google.cloud.sql.v1.InstancesReencryptRequest.Builder, + com.google.cloud.sql.v1.InstancesReencryptRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesReencryptRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesReencryptRequest) + private static final com.google.cloud.sql.v1.SqlInstancesReencryptRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesReencryptRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesReencryptRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesReencryptRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesReencryptRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReencryptRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReencryptRequestOrBuilder.java new file mode 100644 index 000000000000..86a426d2b1e1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReencryptRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesReencryptRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesReencryptRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Reencrypt body that users request
+   * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * Reencrypt body that users request
+   * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + * + * @return The body. + */ + com.google.cloud.sql.v1.InstancesReencryptRequest getBody(); + + /** + * + * + *
+   * Reencrypt body that users request
+   * 
+ * + * .google.cloud.sql.v1.InstancesReencryptRequest body = 3; + */ + com.google.cloud.sql.v1.InstancesReencryptRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReleaseSsrsLeaseRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReleaseSsrsLeaseRequest.java new file mode 100644 index 000000000000..d867de76c36e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReleaseSsrsLeaseRequest.java @@ -0,0 +1,808 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Request to release a lease for SSRS.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesReleaseSsrsLeaseRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest) + SqlInstancesReleaseSsrsLeaseRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesReleaseSsrsLeaseRequest"); + } + + // Use SqlInstancesReleaseSsrsLeaseRequest.newBuilder() to construct. + private SqlInstancesReleaseSsrsLeaseRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesReleaseSsrsLeaseRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReleaseSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReleaseSsrsLeaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest.class, + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+   * The instance ID contains lowercase letters, numbers, and hyphens, and it
+   * must start with a letter. This ID can have a maximum length of 98
+   * characters.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+   * The instance ID contains lowercase letters, numbers, and hyphens, and it
+   * must start with a letter. This ID can have a maximum length of 98
+   * characters.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. The project ID that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The project ID that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest other = + (com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request to release a lease for SSRS.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest) + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReleaseSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReleaseSsrsLeaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest.class, + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReleaseSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest build() { + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest result = + new com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+     * The instance ID contains lowercase letters, numbers, and hyphens, and it
+     * must start with a letter. This ID can have a maximum length of 98
+     * characters.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+     * The instance ID contains lowercase letters, numbers, and hyphens, and it
+     * must start with a letter. This ID can have a maximum length of 98
+     * characters.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+     * The instance ID contains lowercase letters, numbers, and hyphens, and it
+     * must start with a letter. This ID can have a maximum length of 98
+     * characters.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+     * The instance ID contains lowercase letters, numbers, and hyphens, and it
+     * must start with a letter. This ID can have a maximum length of 98
+     * characters.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+     * The instance ID contains lowercase letters, numbers, and hyphens, and it
+     * must start with a letter. This ID can have a maximum length of 98
+     * characters.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. The project ID that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The project ID that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The project ID that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The project ID that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The project ID that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest) + private static final com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesReleaseSsrsLeaseRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReleaseSsrsLeaseRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReleaseSsrsLeaseRequestOrBuilder.java new file mode 100644 index 000000000000..c0b51fa2a78b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReleaseSsrsLeaseRequestOrBuilder.java @@ -0,0 +1,86 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesReleaseSsrsLeaseRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+   * The instance ID contains lowercase letters, numbers, and hyphens, and it
+   * must start with a letter. This ID can have a maximum length of 98
+   * characters.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+   * The instance ID contains lowercase letters, numbers, and hyphens, and it
+   * must start with a letter. This ID can have a maximum length of 98
+   * characters.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. The project ID that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. The project ID that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReleaseSsrsLeaseResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReleaseSsrsLeaseResponse.java new file mode 100644 index 000000000000..bfc4b48729a7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReleaseSsrsLeaseResponse.java @@ -0,0 +1,602 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Response for the release SSRS lease request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse} + */ +@com.google.protobuf.Generated +public final class SqlInstancesReleaseSsrsLeaseResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse) + SqlInstancesReleaseSsrsLeaseResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesReleaseSsrsLeaseResponse"); + } + + // Use SqlInstancesReleaseSsrsLeaseResponse.newBuilder() to construct. + private SqlInstancesReleaseSsrsLeaseResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesReleaseSsrsLeaseResponse() { + operationId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReleaseSsrsLeaseResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReleaseSsrsLeaseResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse.class, + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse.Builder.class); + } + + public static final int OPERATION_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object operationId_ = ""; + + /** + * + * + *
+   * The unique identifier for this operation.
+   * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + @java.lang.Override + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationId_ = s; + return s; + } + } + + /** + * + * + *
+   * The unique identifier for this operation.
+   * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = 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.GeneratedMessage.isStringEmpty(operationId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, operationId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operationId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, operationId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse other = + (com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse) obj; + + if (!getOperationId().equals(other.getOperationId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OPERATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getOperationId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response for the release SSRS lease request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse) + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReleaseSsrsLeaseResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReleaseSsrsLeaseResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse.class, + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + operationId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesReleaseSsrsLeaseResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse build() { + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse buildPartial() { + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse result = + new com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.operationId_ = operationId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse.getDefaultInstance()) + return this; + if (!other.getOperationId().isEmpty()) { + operationId_ = other.operationId_; + 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: + { + operationId_ = 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 operationId_ = ""; + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * string operation_id = 1; + * + * @param value The operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + operationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * string operation_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperationId() { + operationId_ = getDefaultInstance().getOperationId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * string operation_id = 1; + * + * @param value The bytes for operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + operationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse) + private static final com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse(); + } + + public static com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesReleaseSsrsLeaseResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReleaseSsrsLeaseResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReleaseSsrsLeaseResponseOrBuilder.java new file mode 100644 index 000000000000..8f40985fa6c2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesReleaseSsrsLeaseResponseOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesReleaseSsrsLeaseResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique identifier for this operation.
+   * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + java.lang.String getOperationId(); + + /** + * + * + *
+   * The unique identifier for this operation.
+   * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + com.google.protobuf.ByteString getOperationIdBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRescheduleMaintenanceRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRescheduleMaintenanceRequest.java new file mode 100644 index 000000000000..4e9075755e50 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRescheduleMaintenanceRequest.java @@ -0,0 +1,1023 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance reschedule maintenance request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesRescheduleMaintenanceRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest) + SqlInstancesRescheduleMaintenanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesRescheduleMaintenanceRequest"); + } + + // Use SqlInstancesRescheduleMaintenanceRequest.newBuilder() to construct. + private SqlInstancesRescheduleMaintenanceRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesRescheduleMaintenanceRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest.class, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body_; + + /** + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody getBody() { + return body_ == null + ? com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder + getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest other = + (com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance reschedule maintenance request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest) + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest.class, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest build() { + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest result = + new com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Builder, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + .getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + */ + public Builder setBody( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + */ + public Builder setBody( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Builder + builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + */ + public Builder mergeBody( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + .getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + */ + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Builder + getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + */ + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder + getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + .getDefaultInstance() + : body_; + } + } + + /** + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Builder, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Builder, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest) + private static final com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesRescheduleMaintenanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRescheduleMaintenanceRequestBody.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRescheduleMaintenanceRequestBody.java new file mode 100644 index 000000000000..2ab64eb3b739 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRescheduleMaintenanceRequestBody.java @@ -0,0 +1,1964 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Reschedule options for maintenance windows.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody} + */ +@com.google.protobuf.Generated +public final class SqlInstancesRescheduleMaintenanceRequestBody + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody) + SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesRescheduleMaintenanceRequestBody"); + } + + // Use SqlInstancesRescheduleMaintenanceRequestBody.newBuilder() to construct. + private SqlInstancesRescheduleMaintenanceRequestBody( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesRescheduleMaintenanceRequestBody() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequestBody_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequestBody_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.class, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Builder.class); + } + + /** + * Protobuf enum {@code + * google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType} + */ + public enum RescheduleType implements com.google.protobuf.ProtocolMessageEnum { + /** RESCHEDULE_TYPE_UNSPECIFIED = 0; */ + RESCHEDULE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Reschedules maintenance to happen now (within 5 minutes).
+     * 
+ * + * IMMEDIATE = 1; + */ + IMMEDIATE(1), + /** + * + * + *
+     * Reschedules maintenance to occur within one week from the originally
+     * scheduled day and time.
+     * 
+ * + * NEXT_AVAILABLE_WINDOW = 2; + */ + NEXT_AVAILABLE_WINDOW(2), + /** + * + * + *
+     * Reschedules maintenance to a specific time and day.
+     * 
+ * + * SPECIFIC_TIME = 3; + */ + SPECIFIC_TIME(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RescheduleType"); + } + + /** RESCHEDULE_TYPE_UNSPECIFIED = 0; */ + public static final int RESCHEDULE_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Reschedules maintenance to happen now (within 5 minutes).
+     * 
+ * + * IMMEDIATE = 1; + */ + public static final int IMMEDIATE_VALUE = 1; + + /** + * + * + *
+     * Reschedules maintenance to occur within one week from the originally
+     * scheduled day and time.
+     * 
+ * + * NEXT_AVAILABLE_WINDOW = 2; + */ + public static final int NEXT_AVAILABLE_WINDOW_VALUE = 2; + + /** + * + * + *
+     * Reschedules maintenance to a specific time and day.
+     * 
+ * + * SPECIFIC_TIME = 3; + */ + public static final int SPECIFIC_TIME_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 RescheduleType 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 RescheduleType forNumber(int value) { + switch (value) { + case 0: + return RESCHEDULE_TYPE_UNSPECIFIED; + case 1: + return IMMEDIATE; + case 2: + return NEXT_AVAILABLE_WINDOW; + case 3: + return SPECIFIC_TIME; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RescheduleType findValueByNumber(int number) { + return RescheduleType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final RescheduleType[] VALUES = values(); + + public static RescheduleType 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 RescheduleType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType) + } + + public interface RescheduleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The type of the reschedule.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @return The enum numeric value on the wire for rescheduleType. + */ + int getRescheduleTypeValue(); + + /** + * + * + *
+     * Required. The type of the reschedule.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @return The rescheduleType. + */ + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + getRescheduleType(); + + /** + * + * + *
+     * Optional. Timestamp when the maintenance shall be rescheduled to if
+     * reschedule_type=SPECIFIC_TIME, in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the scheduleTime field is set. + */ + boolean hasScheduleTime(); + + /** + * + * + *
+     * Optional. Timestamp when the maintenance shall be rescheduled to if
+     * reschedule_type=SPECIFIC_TIME, in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The scheduleTime. + */ + com.google.protobuf.Timestamp getScheduleTime(); + + /** + * + * + *
+     * Optional. Timestamp when the maintenance shall be rescheduled to if
+     * reschedule_type=SPECIFIC_TIME, in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder(); + } + + /** + * Protobuf type {@code + * google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule} + */ + public static final class Reschedule extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) + RescheduleOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Reschedule"); + } + + // Use Reschedule.newBuilder() to construct. + private Reschedule(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Reschedule() { + rescheduleType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.class, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .Builder.class); + } + + private int bitField0_; + public static final int RESCHEDULE_TYPE_FIELD_NUMBER = 1; + private int rescheduleType_ = 0; + + /** + * + * + *
+     * Required. The type of the reschedule.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @return The enum numeric value on the wire for rescheduleType. + */ + @java.lang.Override + public int getRescheduleTypeValue() { + return rescheduleType_; + } + + /** + * + * + *
+     * Required. The type of the reschedule.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @return The rescheduleType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + getRescheduleType() { + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType result = + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + .forNumber(rescheduleType_); + return result == null + ? com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + .UNRECOGNIZED + : result; + } + + public static final int SCHEDULE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp scheduleTime_; + + /** + * + * + *
+     * Optional. Timestamp when the maintenance shall be rescheduled to if
+     * reschedule_type=SPECIFIC_TIME, in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the scheduleTime field is set. + */ + @java.lang.Override + public boolean hasScheduleTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. Timestamp when the maintenance shall be rescheduled to if
+     * reschedule_type=SPECIFIC_TIME, in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The scheduleTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getScheduleTime() { + return scheduleTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleTime_; + } + + /** + * + * + *
+     * Optional. Timestamp when the maintenance shall be rescheduled to if
+     * reschedule_type=SPECIFIC_TIME, in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder() { + return scheduleTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (rescheduleType_ + != com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + .RESCHEDULE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, rescheduleType_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getScheduleTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rescheduleType_ + != com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + .RESCHEDULE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, rescheduleType_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getScheduleTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule other = + (com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) obj; + + if (rescheduleType_ != other.rescheduleType_) return false; + if (hasScheduleTime() != other.hasScheduleTime()) return false; + if (hasScheduleTime()) { + if (!getScheduleTime().equals(other.getScheduleTime())) return false; + } + if (!getUnknownFields().equals(other.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) + RESCHEDULE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + rescheduleType_; + if (hasScheduleTime()) { + hash = (37 * hash) + SCHEDULE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getScheduleTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code + * google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .class, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetScheduleTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rescheduleType_ = 0; + scheduleTime_ = null; + if (scheduleTimeBuilder_ != null) { + scheduleTimeBuilder_.dispose(); + scheduleTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + build() { + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + buildPartial() { + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule result = + new com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rescheduleType_ = rescheduleType_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.scheduleTime_ = + scheduleTimeBuilder_ == null ? scheduleTime_ : scheduleTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) { + return mergeFrom( + (com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .getDefaultInstance()) return this; + if (other.rescheduleType_ != 0) { + setRescheduleTypeValue(other.getRescheduleTypeValue()); + } + if (other.hasScheduleTime()) { + mergeScheduleTime(other.getScheduleTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + rescheduleType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetScheduleTimeFieldBuilder().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 rescheduleType_ = 0; + + /** + * + * + *
+       * Required. The type of the reschedule.
+       * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @return The enum numeric value on the wire for rescheduleType. + */ + @java.lang.Override + public int getRescheduleTypeValue() { + return rescheduleType_; + } + + /** + * + * + *
+       * Required. The type of the reschedule.
+       * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @param value The enum numeric value on the wire for rescheduleType to set. + * @return This builder for chaining. + */ + public Builder setRescheduleTypeValue(int value) { + rescheduleType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The type of the reschedule.
+       * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @return The rescheduleType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + getRescheduleType() { + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType result = + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + .forNumber(rescheduleType_); + return result == null + ? com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * Required. The type of the reschedule.
+       * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @param value The rescheduleType to set. + * @return This builder for chaining. + */ + public Builder setRescheduleType( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + rescheduleType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The type of the reschedule.
+       * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearRescheduleType() { + bitField0_ = (bitField0_ & ~0x00000001); + rescheduleType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp scheduleTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + scheduleTimeBuilder_; + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the scheduleTime field is set. + */ + public boolean hasScheduleTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The scheduleTime. + */ + public com.google.protobuf.Timestamp getScheduleTime() { + if (scheduleTimeBuilder_ == null) { + return scheduleTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleTime_; + } else { + return scheduleTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setScheduleTime(com.google.protobuf.Timestamp value) { + if (scheduleTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scheduleTime_ = value; + } else { + scheduleTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setScheduleTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (scheduleTimeBuilder_ == null) { + scheduleTime_ = builderForValue.build(); + } else { + scheduleTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeScheduleTime(com.google.protobuf.Timestamp value) { + if (scheduleTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && scheduleTime_ != null + && scheduleTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getScheduleTimeBuilder().mergeFrom(value); + } else { + scheduleTime_ = value; + } + } else { + scheduleTimeBuilder_.mergeFrom(value); + } + if (scheduleTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearScheduleTime() { + bitField0_ = (bitField0_ & ~0x00000002); + scheduleTime_ = null; + if (scheduleTimeBuilder_ != null) { + scheduleTimeBuilder_.dispose(); + scheduleTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getScheduleTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetScheduleTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder() { + if (scheduleTimeBuilder_ != null) { + return scheduleTimeBuilder_.getMessageOrBuilder(); + } else { + return scheduleTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleTime_; + } + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetScheduleTimeFieldBuilder() { + if (scheduleTimeBuilder_ == null) { + scheduleTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getScheduleTime(), getParentForChildren(), isClean()); + scheduleTime_ = null; + } + return scheduleTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) + private static final com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule(); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Reschedule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int RESCHEDULE_FIELD_NUMBER = 3; + private com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + reschedule_; + + /** + * + * + *
+   * Required. The type of the reschedule the user wants.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + * + * @return Whether the reschedule field is set. + */ + @java.lang.Override + public boolean hasReschedule() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The type of the reschedule the user wants.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + * + * @return The reschedule. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + getReschedule() { + return reschedule_ == null + ? com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .getDefaultInstance() + : reschedule_; + } + + /** + * + * + *
+   * Required. The type of the reschedule the user wants.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleOrBuilder + getRescheduleOrBuilder() { + return reschedule_ == null + ? com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .getDefaultInstance() + : reschedule_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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(3, getReschedule()); + } + 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(3, getReschedule()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody other = + (com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody) obj; + + if (hasReschedule() != other.hasReschedule()) return false; + if (hasReschedule()) { + if (!getReschedule().equals(other.getReschedule())) return false; + } + if (!getUnknownFields().equals(other.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 (hasReschedule()) { + hash = (37 * hash) + RESCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getReschedule().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Reschedule options for maintenance windows.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody) + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequestBody_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequestBody_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.class, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRescheduleFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + reschedule_ = null; + if (rescheduleBuilder_ != null) { + rescheduleBuilder_.dispose(); + rescheduleBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRescheduleMaintenanceRequestBody_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody build() { + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody buildPartial() { + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody result = + new com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.reschedule_ = rescheduleBuilder_ == null ? reschedule_ : rescheduleBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody) { + return mergeFrom( + (com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + .getDefaultInstance()) return this; + if (other.hasReschedule()) { + mergeReschedule(other.getReschedule()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 26: + { + input.readMessage( + internalGetRescheduleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + reschedule_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.Builder, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleOrBuilder> + rescheduleBuilder_; + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + * + * @return Whether the reschedule field is set. + */ + public boolean hasReschedule() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + * + * @return The reschedule. + */ + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + getReschedule() { + if (rescheduleBuilder_ == null) { + return reschedule_ == null + ? com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .getDefaultInstance() + : reschedule_; + } else { + return rescheduleBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + public Builder setReschedule( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule value) { + if (rescheduleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reschedule_ = value; + } else { + rescheduleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + public Builder setReschedule( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.Builder + builderForValue) { + if (rescheduleBuilder_ == null) { + reschedule_ = builderForValue.build(); + } else { + rescheduleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + public Builder mergeReschedule( + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule value) { + if (rescheduleBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && reschedule_ != null + && reschedule_ + != com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .getDefaultInstance()) { + getRescheduleBuilder().mergeFrom(value); + } else { + reschedule_ = value; + } + } else { + rescheduleBuilder_.mergeFrom(value); + } + if (reschedule_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + public Builder clearReschedule() { + bitField0_ = (bitField0_ & ~0x00000001); + reschedule_ = null; + if (rescheduleBuilder_ != null) { + rescheduleBuilder_.dispose(); + rescheduleBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.Builder + getRescheduleBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRescheduleFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleOrBuilder + getRescheduleOrBuilder() { + if (rescheduleBuilder_ != null) { + return rescheduleBuilder_.getMessageOrBuilder(); + } else { + return reschedule_ == null + ? com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .getDefaultInstance() + : reschedule_; + } + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.Builder, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleOrBuilder> + internalGetRescheduleFieldBuilder() { + if (rescheduleBuilder_ == null) { + rescheduleBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .Builder, + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleOrBuilder>(getReschedule(), getParentForChildren(), isClean()); + reschedule_ = null; + } + return rescheduleBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody) + private static final com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody(); + } + + public static com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesRescheduleMaintenanceRequestBody parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser + getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder.java new file mode 100644 index 000000000000..9e883d393cbb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The type of the reschedule the user wants.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + * + * @return Whether the reschedule field is set. + */ + boolean hasReschedule(); + + /** + * + * + *
+   * Required. The type of the reschedule the user wants.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + * + * @return The reschedule. + */ + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule getReschedule(); + + /** + * + * + *
+   * Required. The type of the reschedule the user wants.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleOrBuilder + getRescheduleOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRescheduleMaintenanceRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRescheduleMaintenanceRequestOrBuilder.java new file mode 100644 index 000000000000..3d4bf5d57e56 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRescheduleMaintenanceRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesRescheduleMaintenanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody getBody(); + + /** .google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody body = 100; */ + com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesResetReplicaSizeRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesResetReplicaSizeRequest.java new file mode 100644 index 000000000000..d8af73050eb1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesResetReplicaSizeRequest.java @@ -0,0 +1,787 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance reset replica size request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesResetReplicaSizeRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest) + SqlInstancesResetReplicaSizeRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesResetReplicaSizeRequest"); + } + + // Use SqlInstancesResetReplicaSizeRequest.newBuilder() to construct. + private SqlInstancesResetReplicaSizeRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesResetReplicaSizeRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesResetReplicaSizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesResetReplicaSizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest.class, + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest other = + (com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance reset replica size request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest) + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesResetReplicaSizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesResetReplicaSizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest.class, + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesResetReplicaSizeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest build() { + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest result = + new com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest) + private static final com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesResetReplicaSizeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesResetReplicaSizeRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesResetReplicaSizeRequestOrBuilder.java new file mode 100644 index 000000000000..a020e5b0417d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesResetReplicaSizeRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesResetReplicaSizeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesResetSslConfigRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesResetSslConfigRequest.java new file mode 100644 index 000000000000..eadfa7a0f8f9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesResetSslConfigRequest.java @@ -0,0 +1,1142 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance reset SSL config request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesResetSslConfigRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesResetSslConfigRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesResetSslConfigRequest) + SqlInstancesResetSslConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesResetSslConfigRequest"); + } + + // Use SqlInstancesResetSslConfigRequest.newBuilder() to construct. + private SqlInstancesResetSslConfigRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesResetSslConfigRequest() { + instance_ = ""; + project_ = ""; + mode_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesResetSslConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesResetSslConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.class, + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.Builder.class); + } + + /** + * + * + *
+   * Reset SSL mode to selectively refresh the SSL materials.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode} + */ + public enum ResetSslMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Reset SSL mode is not specified.
+     * 
+ * + * RESET_SSL_MODE_UNSPECIFIED = 0; + */ + RESET_SSL_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Refresh all TLS configs. This is the default behaviour.
+     * 
+ * + * ALL = 1; + */ + ALL(1), + /** + * + * + *
+     * Refreshes the replication-related TLS configuration settings provided by
+     * the primary instance.
+     * Not applicable to on-premises replication instances.
+     * 
+ * + * SYNC_FROM_PRIMARY = 2; + */ + SYNC_FROM_PRIMARY(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResetSslMode"); + } + + /** + * + * + *
+     * Reset SSL mode is not specified.
+     * 
+ * + * RESET_SSL_MODE_UNSPECIFIED = 0; + */ + public static final int RESET_SSL_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Refresh all TLS configs. This is the default behaviour.
+     * 
+ * + * ALL = 1; + */ + public static final int ALL_VALUE = 1; + + /** + * + * + *
+     * Refreshes the replication-related TLS configuration settings provided by
+     * the primary instance.
+     * Not applicable to on-premises replication instances.
+     * 
+ * + * SYNC_FROM_PRIMARY = 2; + */ + public static final int SYNC_FROM_PRIMARY_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 ResetSslMode 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 ResetSslMode forNumber(int value) { + switch (value) { + case 0: + return RESET_SSL_MODE_UNSPECIFIED; + case 1: + return ALL; + case 2: + return SYNC_FROM_PRIMARY; + 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 ResetSslMode findValueByNumber(int number) { + return ResetSslMode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ResetSslMode[] VALUES = values(); + + public static ResetSslMode 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 ResetSslMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode) + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODE_FIELD_NUMBER = 3; + private int mode_ = 0; + + /** + * + * + *
+   * Optional. Reset SSL mode to use.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + + /** + * + * + *
+   * Optional. Reset SSL mode to use.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode getMode() { + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode result = + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode.forNumber(mode_); + return result == null + ? com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode.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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (mode_ + != com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode + .RESET_SSL_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, mode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (mode_ + != com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode + .RESET_SSL_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, 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.sql.v1.SqlInstancesResetSslConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest other = + (com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) 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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().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.sql.v1.SqlInstancesResetSslConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance reset SSL config request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesResetSslConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesResetSslConfigRequest) + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesResetSslConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesResetSslConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.class, + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + mode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesResetSslConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest build() { + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest result = + new com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.mode_ = mode_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + 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 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int mode_ = 0; + + /** + * + * + *
+     * Optional. Reset SSL mode to use.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + + /** + * + * + *
+     * Optional. Reset SSL mode to use.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Reset SSL mode to use.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode getMode() { + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode result = + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode.forNumber(mode_); + return result == null + ? com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. Reset SSL mode to use.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + mode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Reset SSL mode to use.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00000004); + mode_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesResetSslConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesResetSslConfigRequest) + private static final com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesResetSslConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesResetSslConfigRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesResetSslConfigRequestOrBuilder.java new file mode 100644 index 000000000000..c7c4273cb2d0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesResetSslConfigRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesResetSslConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesResetSslConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Optional. Reset SSL mode to use.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + + /** + * + * + *
+   * Optional. Reset SSL mode to use.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode getMode(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRestartRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRestartRequest.java new file mode 100644 index 000000000000..48a68ec8804c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRestartRequest.java @@ -0,0 +1,785 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance restart request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesRestartRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesRestartRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesRestartRequest) + SqlInstancesRestartRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesRestartRequest"); + } + + // Use SqlInstancesRestartRequest.newBuilder() to construct. + private SqlInstancesRestartRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesRestartRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRestartRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRestartRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRestartRequest.class, + com.google.cloud.sql.v1.SqlInstancesRestartRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance to be restarted.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance to be restarted.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesRestartRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesRestartRequest other = + (com.google.cloud.sql.v1.SqlInstancesRestartRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesRestartRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestartRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestartRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestartRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestartRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestartRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestartRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestartRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestartRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestartRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestartRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestartRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlInstancesRestartRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance restart request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesRestartRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesRestartRequest) + com.google.cloud.sql.v1.SqlInstancesRestartRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRestartRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRestartRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRestartRequest.class, + com.google.cloud.sql.v1.SqlInstancesRestartRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesRestartRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRestartRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRestartRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesRestartRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRestartRequest build() { + com.google.cloud.sql.v1.SqlInstancesRestartRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRestartRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesRestartRequest result = + new com.google.cloud.sql.v1.SqlInstancesRestartRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesRestartRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesRestartRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesRestartRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesRestartRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesRestartRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance to be restarted.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be restarted.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be restarted.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be restarted.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be restarted.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesRestartRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesRestartRequest) + private static final com.google.cloud.sql.v1.SqlInstancesRestartRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesRestartRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestartRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesRestartRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRestartRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRestartRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRestartRequestOrBuilder.java new file mode 100644 index 000000000000..5706fabaefec --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRestartRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesRestartRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesRestartRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance to be restarted.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance to be restarted.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRestoreBackupRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRestoreBackupRequest.java new file mode 100644 index 000000000000..cf48f356823a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRestoreBackupRequest.java @@ -0,0 +1,992 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance restore backup request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesRestoreBackupRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesRestoreBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesRestoreBackupRequest) + SqlInstancesRestoreBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesRestoreBackupRequest"); + } + + // Use SqlInstancesRestoreBackupRequest.newBuilder() to construct. + private SqlInstancesRestoreBackupRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesRestoreBackupRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRestoreBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRestoreBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest.class, + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.InstancesRestoreBackupRequest body_; + + /** + * .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRestoreBackupRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRestoreBackupRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRestoreBackupRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRestoreBackupRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest other = + (com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance restore backup request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesRestoreBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesRestoreBackupRequest) + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRestoreBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRestoreBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest.class, + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRestoreBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest build() { + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest result = + new com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstancesRestoreBackupRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesRestoreBackupRequest, + com.google.cloud.sql.v1.InstancesRestoreBackupRequest.Builder, + com.google.cloud.sql.v1.InstancesRestoreBackupRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.InstancesRestoreBackupRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRestoreBackupRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.InstancesRestoreBackupRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1.InstancesRestoreBackupRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.InstancesRestoreBackupRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1.InstancesRestoreBackupRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; */ + public com.google.cloud.sql.v1.InstancesRestoreBackupRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; */ + public com.google.cloud.sql.v1.InstancesRestoreBackupRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRestoreBackupRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesRestoreBackupRequest, + com.google.cloud.sql.v1.InstancesRestoreBackupRequest.Builder, + com.google.cloud.sql.v1.InstancesRestoreBackupRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesRestoreBackupRequest, + com.google.cloud.sql.v1.InstancesRestoreBackupRequest.Builder, + com.google.cloud.sql.v1.InstancesRestoreBackupRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesRestoreBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesRestoreBackupRequest) + private static final com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesRestoreBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRestoreBackupRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRestoreBackupRequestOrBuilder.java new file mode 100644 index 000000000000..2be19bb2004c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRestoreBackupRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesRestoreBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesRestoreBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.InstancesRestoreBackupRequest getBody(); + + /** .google.cloud.sql.v1.InstancesRestoreBackupRequest body = 100; */ + com.google.cloud.sql.v1.InstancesRestoreBackupRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateEntraIdCertificateRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateEntraIdCertificateRequest.java new file mode 100644 index 000000000000..79df1d56518f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateEntraIdCertificateRequest.java @@ -0,0 +1,1124 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance rotate server certificate request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesRotateEntraIdCertificateRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest) + SqlInstancesRotateEntraIdCertificateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesRotateEntraIdCertificateRequest"); + } + + // Use SqlInstancesRotateEntraIdCertificateRequest.newBuilder() to construct. + private SqlInstancesRotateEntraIdCertificateRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesRotateEntraIdCertificateRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateEntraIdCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest.class, + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body_; + + /** + * + * + *
+   * Optional. Rotate Entra ID certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Rotate Entra ID certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * Optional. Rotate Entra ID certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequestOrBuilder + getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest other = + (com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance rotate server certificate request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest) + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateEntraIdCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest.class, + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest build() { + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest result = + new com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest) { + return mergeFrom( + (com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest, + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.Builder, + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequestOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * Optional. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The body. + */ + public com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setBody(com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setBody( + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeBody( + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest + .getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.Builder + getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequestOrBuilder + getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * Optional. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest, + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.Builder, + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest, + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.Builder, + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest) + private static final com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesRotateEntraIdCertificateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser + getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateEntraIdCertificateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateEntraIdCertificateRequestOrBuilder.java new file mode 100644 index 000000000000..d4a1b43c884e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateEntraIdCertificateRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesRotateEntraIdCertificateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Optional. Rotate Entra ID certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * Optional. Rotate Entra ID certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The body. + */ + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest getBody(); + + /** + * + * + *
+   * Optional. Rotate Entra ID certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateServerCaRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateServerCaRequest.java new file mode 100644 index 000000000000..b5c2dbaa3c4a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateServerCaRequest.java @@ -0,0 +1,992 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance rotate server CA request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesRotateServerCaRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesRotateServerCaRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesRotateServerCaRequest) + SqlInstancesRotateServerCaRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesRotateServerCaRequest"); + } + + // Use SqlInstancesRotateServerCaRequest.newBuilder() to construct. + private SqlInstancesRotateServerCaRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesRotateServerCaRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateServerCaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateServerCaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest.class, + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.InstancesRotateServerCaRequest body_; + + /** + * .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateServerCaRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRotateServerCaRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateServerCaRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRotateServerCaRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest other = + (com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance rotate server CA request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesRotateServerCaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesRotateServerCaRequest) + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateServerCaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateServerCaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest.class, + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateServerCaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest build() { + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest result = + new com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstancesRotateServerCaRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesRotateServerCaRequest, + com.google.cloud.sql.v1.InstancesRotateServerCaRequest.Builder, + com.google.cloud.sql.v1.InstancesRotateServerCaRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.InstancesRotateServerCaRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRotateServerCaRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.InstancesRotateServerCaRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1.InstancesRotateServerCaRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.InstancesRotateServerCaRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1.InstancesRotateServerCaRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; */ + public com.google.cloud.sql.v1.InstancesRotateServerCaRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; */ + public com.google.cloud.sql.v1.InstancesRotateServerCaRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRotateServerCaRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesRotateServerCaRequest, + com.google.cloud.sql.v1.InstancesRotateServerCaRequest.Builder, + com.google.cloud.sql.v1.InstancesRotateServerCaRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesRotateServerCaRequest, + com.google.cloud.sql.v1.InstancesRotateServerCaRequest.Builder, + com.google.cloud.sql.v1.InstancesRotateServerCaRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesRotateServerCaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesRotateServerCaRequest) + private static final com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesRotateServerCaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateServerCaRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateServerCaRequestOrBuilder.java new file mode 100644 index 000000000000..955a850d8cb6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateServerCaRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesRotateServerCaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesRotateServerCaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.InstancesRotateServerCaRequest getBody(); + + /** .google.cloud.sql.v1.InstancesRotateServerCaRequest body = 100; */ + com.google.cloud.sql.v1.InstancesRotateServerCaRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateServerCertificateRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateServerCertificateRequest.java new file mode 100644 index 000000000000..ed034795e645 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateServerCertificateRequest.java @@ -0,0 +1,1123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance rotate server certificate request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesRotateServerCertificateRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest) + SqlInstancesRotateServerCertificateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesRotateServerCertificateRequest"); + } + + // Use SqlInstancesRotateServerCertificateRequest.newBuilder() to construct. + private SqlInstancesRotateServerCertificateRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesRotateServerCertificateRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateServerCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateServerCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest.class, + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest body_; + + /** + * + * + *
+   * Optional. Rotate server certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Rotate server certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * Optional. Rotate server certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesRotateServerCertificateRequestOrBuilder + getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest other = + (com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance rotate server certificate request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest) + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateServerCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateServerCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest.class, + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesRotateServerCertificateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest build() { + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest result = + new com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest) { + return mergeFrom( + (com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest, + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.Builder, + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequestOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * Optional. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The body. + */ + public com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setBody(com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setBody( + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeBody( + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest + .getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.Builder + getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.InstancesRotateServerCertificateRequestOrBuilder + getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * Optional. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest, + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.Builder, + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest, + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.Builder, + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest) + private static final com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesRotateServerCertificateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateServerCertificateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateServerCertificateRequestOrBuilder.java new file mode 100644 index 000000000000..742594bcf7ab --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesRotateServerCertificateRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesRotateServerCertificateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Optional. Rotate server certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * Optional. Rotate server certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The body. + */ + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest getBody(); + + /** + * + * + *
+   * Optional. Rotate server certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.InstancesRotateServerCertificateRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStartExternalSyncRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStartExternalSyncRequest.java new file mode 100644 index 000000000000..43fd68a33484 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStartExternalSyncRequest.java @@ -0,0 +1,1959 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance start external sync request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesStartExternalSyncRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest) + SqlInstancesStartExternalSyncRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesStartExternalSyncRequest"); + } + + // Use SqlInstancesStartExternalSyncRequest.newBuilder() to construct. + private SqlInstancesStartExternalSyncRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesStartExternalSyncRequest() { + instance_ = ""; + project_ = ""; + syncMode_ = 0; + syncParallelLevel_ = 0; + migrationType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStartExternalSyncRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStartExternalSyncRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.class, + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.Builder.class); + } + + private int syncConfigCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object syncConfig_; + + public enum SyncConfigCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MYSQL_SYNC_CONFIG(6), + SYNCCONFIG_NOT_SET(0); + private final int value; + + private SyncConfigCase(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 SyncConfigCase valueOf(int value) { + return forNumber(value); + } + + public static SyncConfigCase forNumber(int value) { + switch (value) { + case 6: + return MYSQL_SYNC_CONFIG; + case 0: + return SYNCCONFIG_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SyncConfigCase getSyncConfigCase() { + return SyncConfigCase.forNumber(syncConfigCase_); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SYNC_MODE_FIELD_NUMBER = 3; + private int syncMode_ = 0; + + /** + * + * + *
+   * External sync mode.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @return The enum numeric value on the wire for syncMode. + */ + @java.lang.Override + public int getSyncModeValue() { + return syncMode_; + } + + /** + * + * + *
+   * External sync mode.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @return The syncMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + getSyncMode() { + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode result = + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + .forNumber(syncMode_); + return result == null + ? com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + .UNRECOGNIZED + : result; + } + + public static final int SKIP_VERIFICATION_FIELD_NUMBER = 4; + private boolean skipVerification_ = false; + + /** + * + * + *
+   * Whether to skip the verification step (VESS).
+   * 
+ * + * bool skip_verification = 4; + * + * @return The skipVerification. + */ + @java.lang.Override + public boolean getSkipVerification() { + return skipVerification_; + } + + public static final int MYSQL_SYNC_CONFIG_FIELD_NUMBER = 6; + + /** + * + * + *
+   * MySQL-specific settings for start external sync.
+   * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + * + * @return Whether the mysqlSyncConfig field is set. + */ + @java.lang.Override + public boolean hasMysqlSyncConfig() { + return syncConfigCase_ == 6; + } + + /** + * + * + *
+   * MySQL-specific settings for start external sync.
+   * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + * + * @return The mysqlSyncConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.MySqlSyncConfig getMysqlSyncConfig() { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance(); + } + + /** + * + * + *
+   * MySQL-specific settings for start external sync.
+   * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + */ + @java.lang.Override + public com.google.cloud.sql.v1.MySqlSyncConfigOrBuilder getMysqlSyncConfigOrBuilder() { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance(); + } + + public static final int SYNC_PARALLEL_LEVEL_FIELD_NUMBER = 7; + private int syncParallelLevel_ = 0; + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Currently only applicable
+   * for MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for syncParallelLevel. + */ + @java.lang.Override + public int getSyncParallelLevelValue() { + return syncParallelLevel_; + } + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Currently only applicable
+   * for MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The syncParallelLevel. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExternalSyncParallelLevel getSyncParallelLevel() { + com.google.cloud.sql.v1.ExternalSyncParallelLevel result = + com.google.cloud.sql.v1.ExternalSyncParallelLevel.forNumber(syncParallelLevel_); + return result == null ? com.google.cloud.sql.v1.ExternalSyncParallelLevel.UNRECOGNIZED : result; + } + + public static final int MIGRATION_TYPE_FIELD_NUMBER = 8; + private int migrationType_ = 0; + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for migrationType. + */ + @java.lang.Override + public int getMigrationTypeValue() { + return migrationType_; + } + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The migrationType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + getMigrationType() { + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType result = + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .forNumber(migrationType_); + return result == null + ? com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .UNRECOGNIZED + : result; + } + + public static final int REPLICA_OVERWRITE_ENABLED_FIELD_NUMBER = 9; + private boolean replicaOverwriteEnabled_ = false; + + /** + * + * + *
+   * Optional. MySQL only. True if end-user has confirmed that this SES call
+   * will wipe replica databases overlapping with the proposed selected_objects.
+   * If this field is not set and there are both overlapping and additional
+   * databases proposed, an error will be returned.
+   * 
+ * + * bool replica_overwrite_enabled = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaOverwriteEnabled. + */ + @java.lang.Override + public boolean getReplicaOverwriteEnabled() { + return replicaOverwriteEnabled_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (syncMode_ + != com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + .EXTERNAL_SYNC_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, syncMode_); + } + if (skipVerification_ != false) { + output.writeBool(4, skipVerification_); + } + if (syncConfigCase_ == 6) { + output.writeMessage(6, (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_); + } + if (syncParallelLevel_ + != com.google.cloud.sql.v1.ExternalSyncParallelLevel + .EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, syncParallelLevel_); + } + if (migrationType_ + != com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .MIGRATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, migrationType_); + } + if (replicaOverwriteEnabled_ != false) { + output.writeBool(9, replicaOverwriteEnabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (syncMode_ + != com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + .EXTERNAL_SYNC_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, syncMode_); + } + if (skipVerification_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, skipVerification_); + } + if (syncConfigCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_); + } + if (syncParallelLevel_ + != com.google.cloud.sql.v1.ExternalSyncParallelLevel + .EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, syncParallelLevel_); + } + if (migrationType_ + != com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .MIGRATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, migrationType_); + } + if (replicaOverwriteEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, replicaOverwriteEnabled_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest other = + (com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (syncMode_ != other.syncMode_) return false; + if (getSkipVerification() != other.getSkipVerification()) return false; + if (syncParallelLevel_ != other.syncParallelLevel_) return false; + if (migrationType_ != other.migrationType_) return false; + if (getReplicaOverwriteEnabled() != other.getReplicaOverwriteEnabled()) return false; + if (!getSyncConfigCase().equals(other.getSyncConfigCase())) return false; + switch (syncConfigCase_) { + case 6: + if (!getMysqlSyncConfig().equals(other.getMysqlSyncConfig())) 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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + SYNC_MODE_FIELD_NUMBER; + hash = (53 * hash) + syncMode_; + hash = (37 * hash) + SKIP_VERIFICATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSkipVerification()); + hash = (37 * hash) + SYNC_PARALLEL_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + syncParallelLevel_; + hash = (37 * hash) + MIGRATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + migrationType_; + hash = (37 * hash) + REPLICA_OVERWRITE_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReplicaOverwriteEnabled()); + switch (syncConfigCase_) { + case 6: + hash = (37 * hash) + MYSQL_SYNC_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getMysqlSyncConfig().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance start external sync request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest) + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStartExternalSyncRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStartExternalSyncRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.class, + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + syncMode_ = 0; + skipVerification_ = false; + if (mysqlSyncConfigBuilder_ != null) { + mysqlSyncConfigBuilder_.clear(); + } + syncParallelLevel_ = 0; + migrationType_ = 0; + replicaOverwriteEnabled_ = false; + syncConfigCase_ = 0; + syncConfig_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStartExternalSyncRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest build() { + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest result = + new com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.syncMode_ = syncMode_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.skipVerification_ = skipVerification_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.syncParallelLevel_ = syncParallelLevel_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.migrationType_ = migrationType_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.replicaOverwriteEnabled_ = replicaOverwriteEnabled_; + } + } + + private void buildPartialOneofs( + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest result) { + result.syncConfigCase_ = syncConfigCase_; + result.syncConfig_ = this.syncConfig_; + if (syncConfigCase_ == 6 && mysqlSyncConfigBuilder_ != null) { + result.syncConfig_ = mysqlSyncConfigBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.syncMode_ != 0) { + setSyncModeValue(other.getSyncModeValue()); + } + if (other.getSkipVerification() != false) { + setSkipVerification(other.getSkipVerification()); + } + if (other.syncParallelLevel_ != 0) { + setSyncParallelLevelValue(other.getSyncParallelLevelValue()); + } + if (other.migrationType_ != 0) { + setMigrationTypeValue(other.getMigrationTypeValue()); + } + if (other.getReplicaOverwriteEnabled() != false) { + setReplicaOverwriteEnabled(other.getReplicaOverwriteEnabled()); + } + switch (other.getSyncConfigCase()) { + case MYSQL_SYNC_CONFIG: + { + mergeMysqlSyncConfig(other.getMysqlSyncConfig()); + break; + } + case SYNCCONFIG_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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + syncMode_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + skipVerification_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 50: + { + input.readMessage( + internalGetMysqlSyncConfigFieldBuilder().getBuilder(), extensionRegistry); + syncConfigCase_ = 6; + break; + } // case 50 + case 56: + { + syncParallelLevel_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 56 + case 64: + { + migrationType_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 64 + case 72: + { + replicaOverwriteEnabled_ = input.readBool(); + bitField0_ |= 0x00000080; + 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 syncConfigCase_ = 0; + private java.lang.Object syncConfig_; + + public SyncConfigCase getSyncConfigCase() { + return SyncConfigCase.forNumber(syncConfigCase_); + } + + public Builder clearSyncConfig() { + syncConfigCase_ = 0; + syncConfig_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int syncMode_ = 0; + + /** + * + * + *
+     * External sync mode.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @return The enum numeric value on the wire for syncMode. + */ + @java.lang.Override + public int getSyncModeValue() { + return syncMode_; + } + + /** + * + * + *
+     * External sync mode.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @param value The enum numeric value on the wire for syncMode to set. + * @return This builder for chaining. + */ + public Builder setSyncModeValue(int value) { + syncMode_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * External sync mode.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @return The syncMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + getSyncMode() { + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + result = + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + .forNumber(syncMode_); + return result == null + ? com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * External sync mode.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @param value The syncMode to set. + * @return This builder for chaining. + */ + public Builder setSyncMode( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + syncMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * External sync mode.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearSyncMode() { + bitField0_ = (bitField0_ & ~0x00000004); + syncMode_ = 0; + onChanged(); + return this; + } + + private boolean skipVerification_; + + /** + * + * + *
+     * Whether to skip the verification step (VESS).
+     * 
+ * + * bool skip_verification = 4; + * + * @return The skipVerification. + */ + @java.lang.Override + public boolean getSkipVerification() { + return skipVerification_; + } + + /** + * + * + *
+     * Whether to skip the verification step (VESS).
+     * 
+ * + * bool skip_verification = 4; + * + * @param value The skipVerification to set. + * @return This builder for chaining. + */ + public Builder setSkipVerification(boolean value) { + + skipVerification_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether to skip the verification step (VESS).
+     * 
+ * + * bool skip_verification = 4; + * + * @return This builder for chaining. + */ + public Builder clearSkipVerification() { + bitField0_ = (bitField0_ & ~0x00000008); + skipVerification_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.MySqlSyncConfig, + com.google.cloud.sql.v1.MySqlSyncConfig.Builder, + com.google.cloud.sql.v1.MySqlSyncConfigOrBuilder> + mysqlSyncConfigBuilder_; + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + * + * @return Whether the mysqlSyncConfig field is set. + */ + @java.lang.Override + public boolean hasMysqlSyncConfig() { + return syncConfigCase_ == 6; + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + * + * @return The mysqlSyncConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.MySqlSyncConfig getMysqlSyncConfig() { + if (mysqlSyncConfigBuilder_ == null) { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance(); + } else { + if (syncConfigCase_ == 6) { + return mysqlSyncConfigBuilder_.getMessage(); + } + return com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance(); + } + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + */ + public Builder setMysqlSyncConfig(com.google.cloud.sql.v1.MySqlSyncConfig value) { + if (mysqlSyncConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + syncConfig_ = value; + onChanged(); + } else { + mysqlSyncConfigBuilder_.setMessage(value); + } + syncConfigCase_ = 6; + return this; + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + */ + public Builder setMysqlSyncConfig( + com.google.cloud.sql.v1.MySqlSyncConfig.Builder builderForValue) { + if (mysqlSyncConfigBuilder_ == null) { + syncConfig_ = builderForValue.build(); + onChanged(); + } else { + mysqlSyncConfigBuilder_.setMessage(builderForValue.build()); + } + syncConfigCase_ = 6; + return this; + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + */ + public Builder mergeMysqlSyncConfig(com.google.cloud.sql.v1.MySqlSyncConfig value) { + if (mysqlSyncConfigBuilder_ == null) { + if (syncConfigCase_ == 6 + && syncConfig_ != com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance()) { + syncConfig_ = + com.google.cloud.sql.v1.MySqlSyncConfig.newBuilder( + (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + syncConfig_ = value; + } + onChanged(); + } else { + if (syncConfigCase_ == 6) { + mysqlSyncConfigBuilder_.mergeFrom(value); + } else { + mysqlSyncConfigBuilder_.setMessage(value); + } + } + syncConfigCase_ = 6; + return this; + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + */ + public Builder clearMysqlSyncConfig() { + if (mysqlSyncConfigBuilder_ == null) { + if (syncConfigCase_ == 6) { + syncConfigCase_ = 0; + syncConfig_ = null; + onChanged(); + } + } else { + if (syncConfigCase_ == 6) { + syncConfigCase_ = 0; + syncConfig_ = null; + } + mysqlSyncConfigBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + */ + public com.google.cloud.sql.v1.MySqlSyncConfig.Builder getMysqlSyncConfigBuilder() { + return internalGetMysqlSyncConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + */ + @java.lang.Override + public com.google.cloud.sql.v1.MySqlSyncConfigOrBuilder getMysqlSyncConfigOrBuilder() { + if ((syncConfigCase_ == 6) && (mysqlSyncConfigBuilder_ != null)) { + return mysqlSyncConfigBuilder_.getMessageOrBuilder(); + } else { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance(); + } + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.MySqlSyncConfig, + com.google.cloud.sql.v1.MySqlSyncConfig.Builder, + com.google.cloud.sql.v1.MySqlSyncConfigOrBuilder> + internalGetMysqlSyncConfigFieldBuilder() { + if (mysqlSyncConfigBuilder_ == null) { + if (!(syncConfigCase_ == 6)) { + syncConfig_ = com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance(); + } + mysqlSyncConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.MySqlSyncConfig, + com.google.cloud.sql.v1.MySqlSyncConfig.Builder, + com.google.cloud.sql.v1.MySqlSyncConfigOrBuilder>( + (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_, + getParentForChildren(), + isClean()); + syncConfig_ = null; + } + syncConfigCase_ = 6; + onChanged(); + return mysqlSyncConfigBuilder_; + } + + private int syncParallelLevel_ = 0; + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Currently only applicable
+     * for MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for syncParallelLevel. + */ + @java.lang.Override + public int getSyncParallelLevelValue() { + return syncParallelLevel_; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Currently only applicable
+     * for MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for syncParallelLevel to set. + * @return This builder for chaining. + */ + public Builder setSyncParallelLevelValue(int value) { + syncParallelLevel_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Currently only applicable
+     * for MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The syncParallelLevel. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExternalSyncParallelLevel getSyncParallelLevel() { + com.google.cloud.sql.v1.ExternalSyncParallelLevel result = + com.google.cloud.sql.v1.ExternalSyncParallelLevel.forNumber(syncParallelLevel_); + return result == null + ? com.google.cloud.sql.v1.ExternalSyncParallelLevel.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Currently only applicable
+     * for MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The syncParallelLevel to set. + * @return This builder for chaining. + */ + public Builder setSyncParallelLevel(com.google.cloud.sql.v1.ExternalSyncParallelLevel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + syncParallelLevel_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Currently only applicable
+     * for MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSyncParallelLevel() { + bitField0_ = (bitField0_ & ~0x00000020); + syncParallelLevel_ = 0; + onChanged(); + return this; + } + + private int migrationType_ = 0; + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for migrationType. + */ + @java.lang.Override + public int getMigrationTypeValue() { + return migrationType_; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for migrationType to set. + * @return This builder for chaining. + */ + public Builder setMigrationTypeValue(int value) { + migrationType_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The migrationType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + getMigrationType() { + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType result = + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .forNumber(migrationType_); + return result == null + ? com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The migrationType to set. + * @return This builder for chaining. + */ + public Builder setMigrationType( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + migrationType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMigrationType() { + bitField0_ = (bitField0_ & ~0x00000040); + migrationType_ = 0; + onChanged(); + return this; + } + + private boolean replicaOverwriteEnabled_; + + /** + * + * + *
+     * Optional. MySQL only. True if end-user has confirmed that this SES call
+     * will wipe replica databases overlapping with the proposed selected_objects.
+     * If this field is not set and there are both overlapping and additional
+     * databases proposed, an error will be returned.
+     * 
+ * + * bool replica_overwrite_enabled = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaOverwriteEnabled. + */ + @java.lang.Override + public boolean getReplicaOverwriteEnabled() { + return replicaOverwriteEnabled_; + } + + /** + * + * + *
+     * Optional. MySQL only. True if end-user has confirmed that this SES call
+     * will wipe replica databases overlapping with the proposed selected_objects.
+     * If this field is not set and there are both overlapping and additional
+     * databases proposed, an error will be returned.
+     * 
+ * + * bool replica_overwrite_enabled = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The replicaOverwriteEnabled to set. + * @return This builder for chaining. + */ + public Builder setReplicaOverwriteEnabled(boolean value) { + + replicaOverwriteEnabled_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. MySQL only. True if end-user has confirmed that this SES call
+     * will wipe replica databases overlapping with the proposed selected_objects.
+     * If this field is not set and there are both overlapping and additional
+     * databases proposed, an error will be returned.
+     * 
+ * + * bool replica_overwrite_enabled = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearReplicaOverwriteEnabled() { + bitField0_ = (bitField0_ & ~0x00000080); + replicaOverwriteEnabled_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest) + private static final com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesStartExternalSyncRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStartExternalSyncRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStartExternalSyncRequestOrBuilder.java new file mode 100644 index 000000000000..37b0e7ccb805 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStartExternalSyncRequestOrBuilder.java @@ -0,0 +1,246 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesStartExternalSyncRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * External sync mode.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @return The enum numeric value on the wire for syncMode. + */ + int getSyncModeValue(); + + /** + * + * + *
+   * External sync mode.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @return The syncMode. + */ + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + getSyncMode(); + + /** + * + * + *
+   * Whether to skip the verification step (VESS).
+   * 
+ * + * bool skip_verification = 4; + * + * @return The skipVerification. + */ + boolean getSkipVerification(); + + /** + * + * + *
+   * MySQL-specific settings for start external sync.
+   * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + * + * @return Whether the mysqlSyncConfig field is set. + */ + boolean hasMysqlSyncConfig(); + + /** + * + * + *
+   * MySQL-specific settings for start external sync.
+   * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + * + * @return The mysqlSyncConfig. + */ + com.google.cloud.sql.v1.MySqlSyncConfig getMysqlSyncConfig(); + + /** + * + * + *
+   * MySQL-specific settings for start external sync.
+   * 
+ * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6; + */ + com.google.cloud.sql.v1.MySqlSyncConfigOrBuilder getMysqlSyncConfigOrBuilder(); + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Currently only applicable
+   * for MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for syncParallelLevel. + */ + int getSyncParallelLevelValue(); + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Currently only applicable
+   * for MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The syncParallelLevel. + */ + com.google.cloud.sql.v1.ExternalSyncParallelLevel getSyncParallelLevel(); + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for migrationType. + */ + int getMigrationTypeValue(); + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The migrationType. + */ + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + getMigrationType(); + + /** + * + * + *
+   * Optional. MySQL only. True if end-user has confirmed that this SES call
+   * will wipe replica databases overlapping with the proposed selected_objects.
+   * If this field is not set and there are both overlapping and additional
+   * databases proposed, an error will be returned.
+   * 
+ * + * bool replica_overwrite_enabled = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaOverwriteEnabled. + */ + boolean getReplicaOverwriteEnabled(); + + com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.SyncConfigCase getSyncConfigCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStartReplicaRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStartReplicaRequest.java new file mode 100644 index 000000000000..c9bdb53e3289 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStartReplicaRequest.java @@ -0,0 +1,786 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance start replica request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesStartReplicaRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesStartReplicaRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesStartReplicaRequest) + SqlInstancesStartReplicaRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesStartReplicaRequest"); + } + + // Use SqlInstancesStartReplicaRequest.newBuilder() to construct. + private SqlInstancesStartReplicaRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesStartReplicaRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStartReplicaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStartReplicaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest.class, + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest other = + (com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance start replica request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesStartReplicaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesStartReplicaRequest) + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStartReplicaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStartReplicaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest.class, + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStartReplicaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest build() { + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest result = + new com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesStartReplicaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesStartReplicaRequest) + private static final com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesStartReplicaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStartReplicaRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStartReplicaRequestOrBuilder.java new file mode 100644 index 000000000000..70e91839b738 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStartReplicaRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesStartReplicaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesStartReplicaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStopReplicaRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStopReplicaRequest.java new file mode 100644 index 000000000000..e1be6d6d8cba --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStopReplicaRequest.java @@ -0,0 +1,786 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance stop replica request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesStopReplicaRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesStopReplicaRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesStopReplicaRequest) + SqlInstancesStopReplicaRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesStopReplicaRequest"); + } + + // Use SqlInstancesStopReplicaRequest.newBuilder() to construct. + private SqlInstancesStopReplicaRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesStopReplicaRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStopReplicaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStopReplicaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest.class, + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest other = + (com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance stop replica request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesStopReplicaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesStopReplicaRequest) + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStopReplicaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStopReplicaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest.class, + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesStopReplicaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest build() { + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest result = + new com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesStopReplicaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesStopReplicaRequest) + private static final com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesStopReplicaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStopReplicaRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStopReplicaRequestOrBuilder.java new file mode 100644 index 000000000000..84687ab7e23c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesStopReplicaRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesStopReplicaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesStopReplicaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesSwitchoverRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesSwitchoverRequest.java new file mode 100644 index 000000000000..37793fdb6276 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesSwitchoverRequest.java @@ -0,0 +1,1106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance switchover request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesSwitchoverRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesSwitchoverRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesSwitchoverRequest) + SqlInstancesSwitchoverRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesSwitchoverRequest"); + } + + // Use SqlInstancesSwitchoverRequest.newBuilder() to construct. + private SqlInstancesSwitchoverRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesSwitchoverRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesSwitchoverRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesSwitchoverRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest.class, + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DB_TIMEOUT_FIELD_NUMBER = 3; + private com.google.protobuf.Duration dbTimeout_; + + /** + * + * + *
+   * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+   * timeout, which is a sum of all database operations. Default value is 10
+   * minutes and can be modified to a maximum value of 24 hours.
+   * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dbTimeout field is set. + */ + @java.lang.Override + public boolean hasDbTimeout() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+   * timeout, which is a sum of all database operations. Default value is 10
+   * minutes and can be modified to a maximum value of 24 hours.
+   * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dbTimeout. + */ + @java.lang.Override + public com.google.protobuf.Duration getDbTimeout() { + return dbTimeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : dbTimeout_; + } + + /** + * + * + *
+   * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+   * timeout, which is a sum of all database operations. Default value is 10
+   * minutes and can be modified to a maximum value of 24 hours.
+   * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDbTimeoutOrBuilder() { + return dbTimeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : dbTimeout_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getDbTimeout()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getDbTimeout()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest other = + (com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasDbTimeout() != other.hasDbTimeout()) return false; + if (hasDbTimeout()) { + if (!getDbTimeout().equals(other.getDbTimeout())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasDbTimeout()) { + hash = (37 * hash) + DB_TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getDbTimeout().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance switchover request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesSwitchoverRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesSwitchoverRequest) + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesSwitchoverRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesSwitchoverRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest.class, + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetDbTimeoutFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + dbTimeout_ = null; + if (dbTimeoutBuilder_ != null) { + dbTimeoutBuilder_.dispose(); + dbTimeoutBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesSwitchoverRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest build() { + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest result = + new com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dbTimeout_ = dbTimeoutBuilder_ == null ? dbTimeout_ : dbTimeoutBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasDbTimeout()) { + mergeDbTimeout(other.getDbTimeout()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetDbTimeoutFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the replica.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the replica.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the replica.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the replica.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the replica.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Duration dbTimeout_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + dbTimeoutBuilder_; + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dbTimeout field is set. + */ + public boolean hasDbTimeout() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dbTimeout. + */ + public com.google.protobuf.Duration getDbTimeout() { + if (dbTimeoutBuilder_ == null) { + return dbTimeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : dbTimeout_; + } else { + return dbTimeoutBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDbTimeout(com.google.protobuf.Duration value) { + if (dbTimeoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dbTimeout_ = value; + } else { + dbTimeoutBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDbTimeout(com.google.protobuf.Duration.Builder builderForValue) { + if (dbTimeoutBuilder_ == null) { + dbTimeout_ = builderForValue.build(); + } else { + dbTimeoutBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDbTimeout(com.google.protobuf.Duration value) { + if (dbTimeoutBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && dbTimeout_ != null + && dbTimeout_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDbTimeoutBuilder().mergeFrom(value); + } else { + dbTimeout_ = value; + } + } else { + dbTimeoutBuilder_.mergeFrom(value); + } + if (dbTimeout_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDbTimeout() { + bitField0_ = (bitField0_ & ~0x00000004); + dbTimeout_ = null; + if (dbTimeoutBuilder_ != null) { + dbTimeoutBuilder_.dispose(); + dbTimeoutBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Duration.Builder getDbTimeoutBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetDbTimeoutFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.DurationOrBuilder getDbTimeoutOrBuilder() { + if (dbTimeoutBuilder_ != null) { + return dbTimeoutBuilder_.getMessageOrBuilder(); + } else { + return dbTimeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : dbTimeout_; + } + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetDbTimeoutFieldBuilder() { + if (dbTimeoutBuilder_ == null) { + dbTimeoutBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDbTimeout(), getParentForChildren(), isClean()); + dbTimeout_ = null; + } + return dbTimeoutBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesSwitchoverRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesSwitchoverRequest) + private static final com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesSwitchoverRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesSwitchoverRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesSwitchoverRequestOrBuilder.java new file mode 100644 index 000000000000..832411c0ea60 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesSwitchoverRequestOrBuilder.java @@ -0,0 +1,126 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesSwitchoverRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesSwitchoverRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+   * timeout, which is a sum of all database operations. Default value is 10
+   * minutes and can be modified to a maximum value of 24 hours.
+   * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dbTimeout field is set. + */ + boolean hasDbTimeout(); + + /** + * + * + *
+   * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+   * timeout, which is a sum of all database operations. Default value is 10
+   * minutes and can be modified to a maximum value of 24 hours.
+   * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dbTimeout. + */ + com.google.protobuf.Duration getDbTimeout(); + + /** + * + * + *
+   * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+   * timeout, which is a sum of all database operations. Default value is 10
+   * minutes and can be modified to a maximum value of 24 hours.
+   * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.DurationOrBuilder getDbTimeoutOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesTruncateLogRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesTruncateLogRequest.java new file mode 100644 index 000000000000..0bb47b430c4c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesTruncateLogRequest.java @@ -0,0 +1,990 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance truncate log request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesTruncateLogRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesTruncateLogRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesTruncateLogRequest) + SqlInstancesTruncateLogRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesTruncateLogRequest"); + } + + // Use SqlInstancesTruncateLogRequest.newBuilder() to construct. + private SqlInstancesTruncateLogRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesTruncateLogRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesTruncateLogRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesTruncateLogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest.class, + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.InstancesTruncateLogRequest body_; + + /** + * .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesTruncateLogRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesTruncateLogRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.InstancesTruncateLogRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.InstancesTruncateLogRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest other = + (com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance truncate log request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesTruncateLogRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesTruncateLogRequest) + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesTruncateLogRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesTruncateLogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest.class, + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesTruncateLogRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest build() { + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest result = + new com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.InstancesTruncateLogRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesTruncateLogRequest, + com.google.cloud.sql.v1.InstancesTruncateLogRequest.Builder, + com.google.cloud.sql.v1.InstancesTruncateLogRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.InstancesTruncateLogRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.InstancesTruncateLogRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.InstancesTruncateLogRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1.InstancesTruncateLogRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.InstancesTruncateLogRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.InstancesTruncateLogRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; */ + public com.google.cloud.sql.v1.InstancesTruncateLogRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; */ + public com.google.cloud.sql.v1.InstancesTruncateLogRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.InstancesTruncateLogRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesTruncateLogRequest, + com.google.cloud.sql.v1.InstancesTruncateLogRequest.Builder, + com.google.cloud.sql.v1.InstancesTruncateLogRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.InstancesTruncateLogRequest, + com.google.cloud.sql.v1.InstancesTruncateLogRequest.Builder, + com.google.cloud.sql.v1.InstancesTruncateLogRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesTruncateLogRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesTruncateLogRequest) + private static final com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesTruncateLogRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesTruncateLogRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesTruncateLogRequestOrBuilder.java new file mode 100644 index 000000000000..dccf0a2e8505 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesTruncateLogRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesTruncateLogRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesTruncateLogRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.InstancesTruncateLogRequest getBody(); + + /** .google.cloud.sql.v1.InstancesTruncateLogRequest body = 100; */ + com.google.cloud.sql.v1.InstancesTruncateLogRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesUpdateRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesUpdateRequest.java new file mode 100644 index 000000000000..f324a2f29126 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesUpdateRequest.java @@ -0,0 +1,984 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance update request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesUpdateRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesUpdateRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesUpdateRequest) + SqlInstancesUpdateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesUpdateRequest"); + } + + // Use SqlInstancesUpdateRequest.newBuilder() to construct. + private SqlInstancesUpdateRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesUpdateRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesUpdateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesUpdateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesUpdateRequest.class, + com.google.cloud.sql.v1.SqlInstancesUpdateRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.DatabaseInstance body_; + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstance getBody() { + return body_ == null ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() : body_; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getBodyOrBuilder() { + return body_ == null ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlInstancesUpdateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesUpdateRequest other = + (com.google.cloud.sql.v1.SqlInstancesUpdateRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesUpdateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesUpdateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesUpdateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesUpdateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesUpdateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesUpdateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesUpdateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesUpdateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesUpdateRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesUpdateRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesUpdateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesUpdateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlInstancesUpdateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance update request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesUpdateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesUpdateRequest) + com.google.cloud.sql.v1.SqlInstancesUpdateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesUpdateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesUpdateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesUpdateRequest.class, + com.google.cloud.sql.v1.SqlInstancesUpdateRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlInstancesUpdateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesUpdateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesUpdateRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesUpdateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesUpdateRequest build() { + com.google.cloud.sql.v1.SqlInstancesUpdateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesUpdateRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesUpdateRequest result = + new com.google.cloud.sql.v1.SqlInstancesUpdateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlInstancesUpdateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesUpdateRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlInstancesUpdateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlInstancesUpdateRequest other) { + if (other == com.google.cloud.sql.v1.SqlInstancesUpdateRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.DatabaseInstance body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.DatabaseInstance getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.DatabaseInstance value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.DatabaseInstance.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.DatabaseInstance value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public com.google.cloud.sql.v1.DatabaseInstance.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + public com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.DatabaseInstance.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.DatabaseInstance, + com.google.cloud.sql.v1.DatabaseInstance.Builder, + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesUpdateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesUpdateRequest) + private static final com.google.cloud.sql.v1.SqlInstancesUpdateRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesUpdateRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesUpdateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesUpdateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesUpdateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesUpdateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesUpdateRequestOrBuilder.java new file mode 100644 index 000000000000..ae5774f73342 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesUpdateRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesUpdateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesUpdateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.DatabaseInstance body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.DatabaseInstance getBody(); + + /** .google.cloud.sql.v1.DatabaseInstance body = 100; */ + com.google.cloud.sql.v1.DatabaseInstanceOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesVerifyExternalSyncSettingsRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesVerifyExternalSyncSettingsRequest.java new file mode 100644 index 000000000000..dd92cf7040c0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesVerifyExternalSyncSettingsRequest.java @@ -0,0 +1,2927 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance verify external sync settings request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesVerifyExternalSyncSettingsRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest) + SqlInstancesVerifyExternalSyncSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesVerifyExternalSyncSettingsRequest"); + } + + // Use SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() to construct. + private SqlInstancesVerifyExternalSyncSettingsRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesVerifyExternalSyncSettingsRequest() { + instance_ = ""; + project_ = ""; + syncMode_ = 0; + migrationType_ = 0; + syncParallelLevel_ = 0; + selectedObjects_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesVerifyExternalSyncSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesVerifyExternalSyncSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.class, + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.Builder.class); + } + + /** + * Protobuf enum {@code + * google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode} + */ + public enum ExternalSyncMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown external sync mode, will be defaulted to ONLINE mode
+     * 
+ * + * EXTERNAL_SYNC_MODE_UNSPECIFIED = 0; + */ + EXTERNAL_SYNC_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Online external sync will set up replication after initial data external
+     * sync
+     * 
+ * + * ONLINE = 1; + */ + ONLINE(1), + /** + * + * + *
+     * Offline external sync only dumps and loads a one-time snapshot of
+     * the primary instance's data
+     * 
+ * + * OFFLINE = 2; + */ + OFFLINE(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExternalSyncMode"); + } + + /** + * + * + *
+     * Unknown external sync mode, will be defaulted to ONLINE mode
+     * 
+ * + * EXTERNAL_SYNC_MODE_UNSPECIFIED = 0; + */ + public static final int EXTERNAL_SYNC_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Online external sync will set up replication after initial data external
+     * sync
+     * 
+ * + * ONLINE = 1; + */ + public static final int ONLINE_VALUE = 1; + + /** + * + * + *
+     * Offline external sync only dumps and loads a one-time snapshot of
+     * the primary instance's data
+     * 
+ * + * OFFLINE = 2; + */ + public static final int OFFLINE_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 ExternalSyncMode 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 ExternalSyncMode forNumber(int value) { + switch (value) { + case 0: + return EXTERNAL_SYNC_MODE_UNSPECIFIED; + case 1: + return ONLINE; + case 2: + return OFFLINE; + 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 ExternalSyncMode findValueByNumber(int number) { + return ExternalSyncMode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ExternalSyncMode[] VALUES = values(); + + public static ExternalSyncMode 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 ExternalSyncMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode) + } + + /** + * + * + *
+   * MigrationType determines whether the migration is a physical file-based
+   * migration or a logical dump file-based migration.
+   * 
+ * + * Protobuf enum {@code + * google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType} + */ + public enum MigrationType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value is a logical dump file-based migration
+     * 
+ * + * MIGRATION_TYPE_UNSPECIFIED = 0; + */ + MIGRATION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Logical dump file-based migration
+     * 
+ * + * LOGICAL = 1; + */ + LOGICAL(1), + /** + * + * + *
+     * Physical file-based migration
+     * 
+ * + * PHYSICAL = 2; + */ + PHYSICAL(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MigrationType"); + } + + /** + * + * + *
+     * Default value is a logical dump file-based migration
+     * 
+ * + * MIGRATION_TYPE_UNSPECIFIED = 0; + */ + public static final int MIGRATION_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Logical dump file-based migration
+     * 
+ * + * LOGICAL = 1; + */ + public static final int LOGICAL_VALUE = 1; + + /** + * + * + *
+     * Physical file-based migration
+     * 
+ * + * PHYSICAL = 2; + */ + public static final int PHYSICAL_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 MigrationType 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 MigrationType forNumber(int value) { + switch (value) { + case 0: + return MIGRATION_TYPE_UNSPECIFIED; + case 1: + return LOGICAL; + case 2: + return PHYSICAL; + 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 MigrationType findValueByNumber(int number) { + return MigrationType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final MigrationType[] VALUES = values(); + + public static MigrationType 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 MigrationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType) + } + + private int syncConfigCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object syncConfig_; + + public enum SyncConfigCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MYSQL_SYNC_CONFIG(6), + SYNCCONFIG_NOT_SET(0); + private final int value; + + private SyncConfigCase(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 SyncConfigCase valueOf(int value) { + return forNumber(value); + } + + public static SyncConfigCase forNumber(int value) { + switch (value) { + case 6: + return MYSQL_SYNC_CONFIG; + case 0: + return SYNCCONFIG_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SyncConfigCase getSyncConfigCase() { + return SyncConfigCase.forNumber(syncConfigCase_); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERIFY_CONNECTION_ONLY_FIELD_NUMBER = 3; + private boolean verifyConnectionOnly_ = false; + + /** + * + * + *
+   * Flag to enable verifying connection only
+   * 
+ * + * bool verify_connection_only = 3; + * + * @return The verifyConnectionOnly. + */ + @java.lang.Override + public boolean getVerifyConnectionOnly() { + return verifyConnectionOnly_; + } + + public static final int SYNC_MODE_FIELD_NUMBER = 4; + private int syncMode_ = 0; + + /** + * + * + *
+   * External sync mode
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @return The enum numeric value on the wire for syncMode. + */ + @java.lang.Override + public int getSyncModeValue() { + return syncMode_; + } + + /** + * + * + *
+   * External sync mode
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @return The syncMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + getSyncMode() { + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode result = + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + .forNumber(syncMode_); + return result == null + ? com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + .UNRECOGNIZED + : result; + } + + public static final int VERIFY_REPLICATION_ONLY_FIELD_NUMBER = 5; + private boolean verifyReplicationOnly_ = false; + + /** + * + * + *
+   * Optional. Flag to verify settings required by replication setup only
+   * 
+ * + * bool verify_replication_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The verifyReplicationOnly. + */ + @java.lang.Override + public boolean getVerifyReplicationOnly() { + return verifyReplicationOnly_; + } + + public static final int MYSQL_SYNC_CONFIG_FIELD_NUMBER = 6; + + /** + * + * + *
+   * Optional. MySQL-specific settings for start external sync.
+   * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the mysqlSyncConfig field is set. + */ + @java.lang.Override + public boolean hasMysqlSyncConfig() { + return syncConfigCase_ == 6; + } + + /** + * + * + *
+   * Optional. MySQL-specific settings for start external sync.
+   * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mysqlSyncConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.MySqlSyncConfig getMysqlSyncConfig() { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance(); + } + + /** + * + * + *
+   * Optional. MySQL-specific settings for start external sync.
+   * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.MySqlSyncConfigOrBuilder getMysqlSyncConfigOrBuilder() { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance(); + } + + public static final int MIGRATION_TYPE_FIELD_NUMBER = 7; + private int migrationType_ = 0; + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for migrationType. + */ + @java.lang.Override + public int getMigrationTypeValue() { + return migrationType_; + } + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The migrationType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + getMigrationType() { + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType result = + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .forNumber(migrationType_); + return result == null + ? com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .UNRECOGNIZED + : result; + } + + public static final int SYNC_PARALLEL_LEVEL_FIELD_NUMBER = 8; + private int syncParallelLevel_ = 0; + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Only applicable for
+   * PostgreSQL.
+   * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for syncParallelLevel. + */ + @java.lang.Override + public int getSyncParallelLevelValue() { + return syncParallelLevel_; + } + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Only applicable for
+   * PostgreSQL.
+   * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The syncParallelLevel. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExternalSyncParallelLevel getSyncParallelLevel() { + com.google.cloud.sql.v1.ExternalSyncParallelLevel result = + com.google.cloud.sql.v1.ExternalSyncParallelLevel.forNumber(syncParallelLevel_); + return result == null ? com.google.cloud.sql.v1.ExternalSyncParallelLevel.UNRECOGNIZED : result; + } + + public static final int SELECTED_OBJECTS_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private java.util.List selectedObjects_; + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getSelectedObjectsList() { + return selectedObjects_; + } + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getSelectedObjectsOrBuilderList() { + return selectedObjects_; + } + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getSelectedObjectsCount() { + return selectedObjects_.size(); + } + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExternalSyncSelectedObject getSelectedObjects(int index) { + return selectedObjects_.get(index); + } + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExternalSyncSelectedObjectOrBuilder getSelectedObjectsOrBuilder( + int index) { + return selectedObjects_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (verifyConnectionOnly_ != false) { + output.writeBool(3, verifyConnectionOnly_); + } + if (syncMode_ + != com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + .EXTERNAL_SYNC_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, syncMode_); + } + if (verifyReplicationOnly_ != false) { + output.writeBool(5, verifyReplicationOnly_); + } + if (syncConfigCase_ == 6) { + output.writeMessage(6, (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_); + } + if (migrationType_ + != com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .MIGRATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, migrationType_); + } + if (syncParallelLevel_ + != com.google.cloud.sql.v1.ExternalSyncParallelLevel + .EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, syncParallelLevel_); + } + for (int i = 0; i < selectedObjects_.size(); i++) { + output.writeMessage(9, selectedObjects_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (verifyConnectionOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, verifyConnectionOnly_); + } + if (syncMode_ + != com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + .EXTERNAL_SYNC_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, syncMode_); + } + if (verifyReplicationOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, verifyReplicationOnly_); + } + if (syncConfigCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_); + } + if (migrationType_ + != com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .MIGRATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, migrationType_); + } + if (syncParallelLevel_ + != com.google.cloud.sql.v1.ExternalSyncParallelLevel + .EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, syncParallelLevel_); + } + for (int i = 0; i < selectedObjects_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, selectedObjects_.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.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest other = + (com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (getVerifyConnectionOnly() != other.getVerifyConnectionOnly()) return false; + if (syncMode_ != other.syncMode_) return false; + if (getVerifyReplicationOnly() != other.getVerifyReplicationOnly()) return false; + if (migrationType_ != other.migrationType_) return false; + if (syncParallelLevel_ != other.syncParallelLevel_) return false; + if (!getSelectedObjectsList().equals(other.getSelectedObjectsList())) return false; + if (!getSyncConfigCase().equals(other.getSyncConfigCase())) return false; + switch (syncConfigCase_) { + case 6: + if (!getMysqlSyncConfig().equals(other.getMysqlSyncConfig())) 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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + VERIFY_CONNECTION_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getVerifyConnectionOnly()); + hash = (37 * hash) + SYNC_MODE_FIELD_NUMBER; + hash = (53 * hash) + syncMode_; + hash = (37 * hash) + VERIFY_REPLICATION_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getVerifyReplicationOnly()); + hash = (37 * hash) + MIGRATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + migrationType_; + hash = (37 * hash) + SYNC_PARALLEL_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + syncParallelLevel_; + if (getSelectedObjectsCount() > 0) { + hash = (37 * hash) + SELECTED_OBJECTS_FIELD_NUMBER; + hash = (53 * hash) + getSelectedObjectsList().hashCode(); + } + switch (syncConfigCase_) { + case 6: + hash = (37 * hash) + MYSQL_SYNC_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getMysqlSyncConfig().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance verify external sync settings request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest) + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesVerifyExternalSyncSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesVerifyExternalSyncSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.class, + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + verifyConnectionOnly_ = false; + syncMode_ = 0; + verifyReplicationOnly_ = false; + if (mysqlSyncConfigBuilder_ != null) { + mysqlSyncConfigBuilder_.clear(); + } + migrationType_ = 0; + syncParallelLevel_ = 0; + if (selectedObjectsBuilder_ == null) { + selectedObjects_ = java.util.Collections.emptyList(); + } else { + selectedObjects_ = null; + selectedObjectsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + syncConfigCase_ = 0; + syncConfig_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesVerifyExternalSyncSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest build() { + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest buildPartial() { + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest result = + new com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest result) { + if (selectedObjectsBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0)) { + selectedObjects_ = java.util.Collections.unmodifiableList(selectedObjects_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.selectedObjects_ = selectedObjects_; + } else { + result.selectedObjects_ = selectedObjectsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.verifyConnectionOnly_ = verifyConnectionOnly_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.syncMode_ = syncMode_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.verifyReplicationOnly_ = verifyReplicationOnly_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.migrationType_ = migrationType_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.syncParallelLevel_ = syncParallelLevel_; + } + } + + private void buildPartialOneofs( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest result) { + result.syncConfigCase_ = syncConfigCase_; + result.syncConfig_ = this.syncConfig_; + if (syncConfigCase_ == 6 && mysqlSyncConfigBuilder_ != null) { + result.syncConfig_ = mysqlSyncConfigBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest) { + return mergeFrom( + (com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getVerifyConnectionOnly() != false) { + setVerifyConnectionOnly(other.getVerifyConnectionOnly()); + } + if (other.syncMode_ != 0) { + setSyncModeValue(other.getSyncModeValue()); + } + if (other.getVerifyReplicationOnly() != false) { + setVerifyReplicationOnly(other.getVerifyReplicationOnly()); + } + if (other.migrationType_ != 0) { + setMigrationTypeValue(other.getMigrationTypeValue()); + } + if (other.syncParallelLevel_ != 0) { + setSyncParallelLevelValue(other.getSyncParallelLevelValue()); + } + if (selectedObjectsBuilder_ == null) { + if (!other.selectedObjects_.isEmpty()) { + if (selectedObjects_.isEmpty()) { + selectedObjects_ = other.selectedObjects_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureSelectedObjectsIsMutable(); + selectedObjects_.addAll(other.selectedObjects_); + } + onChanged(); + } + } else { + if (!other.selectedObjects_.isEmpty()) { + if (selectedObjectsBuilder_.isEmpty()) { + selectedObjectsBuilder_.dispose(); + selectedObjectsBuilder_ = null; + selectedObjects_ = other.selectedObjects_; + bitField0_ = (bitField0_ & ~0x00000100); + selectedObjectsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetSelectedObjectsFieldBuilder() + : null; + } else { + selectedObjectsBuilder_.addAllMessages(other.selectedObjects_); + } + } + } + switch (other.getSyncConfigCase()) { + case MYSQL_SYNC_CONFIG: + { + mergeMysqlSyncConfig(other.getMysqlSyncConfig()); + break; + } + case SYNCCONFIG_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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + verifyConnectionOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + syncMode_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + verifyReplicationOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + input.readMessage( + internalGetMysqlSyncConfigFieldBuilder().getBuilder(), extensionRegistry); + syncConfigCase_ = 6; + break; + } // case 50 + case 56: + { + migrationType_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: + { + syncParallelLevel_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 74: + { + com.google.cloud.sql.v1.ExternalSyncSelectedObject m = + input.readMessage( + com.google.cloud.sql.v1.ExternalSyncSelectedObject.parser(), + extensionRegistry); + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(m); + } else { + selectedObjectsBuilder_.addMessage(m); + } + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int syncConfigCase_ = 0; + private java.lang.Object syncConfig_; + + public SyncConfigCase getSyncConfigCase() { + return SyncConfigCase.forNumber(syncConfigCase_); + } + + public Builder clearSyncConfig() { + syncConfigCase_ = 0; + syncConfig_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean verifyConnectionOnly_; + + /** + * + * + *
+     * Flag to enable verifying connection only
+     * 
+ * + * bool verify_connection_only = 3; + * + * @return The verifyConnectionOnly. + */ + @java.lang.Override + public boolean getVerifyConnectionOnly() { + return verifyConnectionOnly_; + } + + /** + * + * + *
+     * Flag to enable verifying connection only
+     * 
+ * + * bool verify_connection_only = 3; + * + * @param value The verifyConnectionOnly to set. + * @return This builder for chaining. + */ + public Builder setVerifyConnectionOnly(boolean value) { + + verifyConnectionOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Flag to enable verifying connection only
+     * 
+ * + * bool verify_connection_only = 3; + * + * @return This builder for chaining. + */ + public Builder clearVerifyConnectionOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + verifyConnectionOnly_ = false; + onChanged(); + return this; + } + + private int syncMode_ = 0; + + /** + * + * + *
+     * External sync mode
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @return The enum numeric value on the wire for syncMode. + */ + @java.lang.Override + public int getSyncModeValue() { + return syncMode_; + } + + /** + * + * + *
+     * External sync mode
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @param value The enum numeric value on the wire for syncMode to set. + * @return This builder for chaining. + */ + public Builder setSyncModeValue(int value) { + syncMode_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * External sync mode
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @return The syncMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + getSyncMode() { + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + result = + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + .forNumber(syncMode_); + return result == null + ? com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * External sync mode
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @param value The syncMode to set. + * @return This builder for chaining. + */ + public Builder setSyncMode( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + syncMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * External sync mode
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @return This builder for chaining. + */ + public Builder clearSyncMode() { + bitField0_ = (bitField0_ & ~0x00000008); + syncMode_ = 0; + onChanged(); + return this; + } + + private boolean verifyReplicationOnly_; + + /** + * + * + *
+     * Optional. Flag to verify settings required by replication setup only
+     * 
+ * + * bool verify_replication_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The verifyReplicationOnly. + */ + @java.lang.Override + public boolean getVerifyReplicationOnly() { + return verifyReplicationOnly_; + } + + /** + * + * + *
+     * Optional. Flag to verify settings required by replication setup only
+     * 
+ * + * bool verify_replication_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The verifyReplicationOnly to set. + * @return This builder for chaining. + */ + public Builder setVerifyReplicationOnly(boolean value) { + + verifyReplicationOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Flag to verify settings required by replication setup only
+     * 
+ * + * bool verify_replication_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearVerifyReplicationOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + verifyReplicationOnly_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.MySqlSyncConfig, + com.google.cloud.sql.v1.MySqlSyncConfig.Builder, + com.google.cloud.sql.v1.MySqlSyncConfigOrBuilder> + mysqlSyncConfigBuilder_; + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the mysqlSyncConfig field is set. + */ + @java.lang.Override + public boolean hasMysqlSyncConfig() { + return syncConfigCase_ == 6; + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mysqlSyncConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1.MySqlSyncConfig getMysqlSyncConfig() { + if (mysqlSyncConfigBuilder_ == null) { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance(); + } else { + if (syncConfigCase_ == 6) { + return mysqlSyncConfigBuilder_.getMessage(); + } + return com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setMysqlSyncConfig(com.google.cloud.sql.v1.MySqlSyncConfig value) { + if (mysqlSyncConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + syncConfig_ = value; + onChanged(); + } else { + mysqlSyncConfigBuilder_.setMessage(value); + } + syncConfigCase_ = 6; + return this; + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setMysqlSyncConfig( + com.google.cloud.sql.v1.MySqlSyncConfig.Builder builderForValue) { + if (mysqlSyncConfigBuilder_ == null) { + syncConfig_ = builderForValue.build(); + onChanged(); + } else { + mysqlSyncConfigBuilder_.setMessage(builderForValue.build()); + } + syncConfigCase_ = 6; + return this; + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeMysqlSyncConfig(com.google.cloud.sql.v1.MySqlSyncConfig value) { + if (mysqlSyncConfigBuilder_ == null) { + if (syncConfigCase_ == 6 + && syncConfig_ != com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance()) { + syncConfig_ = + com.google.cloud.sql.v1.MySqlSyncConfig.newBuilder( + (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + syncConfig_ = value; + } + onChanged(); + } else { + if (syncConfigCase_ == 6) { + mysqlSyncConfigBuilder_.mergeFrom(value); + } else { + mysqlSyncConfigBuilder_.setMessage(value); + } + } + syncConfigCase_ = 6; + return this; + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearMysqlSyncConfig() { + if (mysqlSyncConfigBuilder_ == null) { + if (syncConfigCase_ == 6) { + syncConfigCase_ = 0; + syncConfig_ = null; + onChanged(); + } + } else { + if (syncConfigCase_ == 6) { + syncConfigCase_ = 0; + syncConfig_ = null; + } + mysqlSyncConfigBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.MySqlSyncConfig.Builder getMysqlSyncConfigBuilder() { + return internalGetMysqlSyncConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.MySqlSyncConfigOrBuilder getMysqlSyncConfigOrBuilder() { + if ((syncConfigCase_ == 6) && (mysqlSyncConfigBuilder_ != null)) { + return mysqlSyncConfigBuilder_.getMessageOrBuilder(); + } else { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.MySqlSyncConfig, + com.google.cloud.sql.v1.MySqlSyncConfig.Builder, + com.google.cloud.sql.v1.MySqlSyncConfigOrBuilder> + internalGetMysqlSyncConfigFieldBuilder() { + if (mysqlSyncConfigBuilder_ == null) { + if (!(syncConfigCase_ == 6)) { + syncConfig_ = com.google.cloud.sql.v1.MySqlSyncConfig.getDefaultInstance(); + } + mysqlSyncConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.MySqlSyncConfig, + com.google.cloud.sql.v1.MySqlSyncConfig.Builder, + com.google.cloud.sql.v1.MySqlSyncConfigOrBuilder>( + (com.google.cloud.sql.v1.MySqlSyncConfig) syncConfig_, + getParentForChildren(), + isClean()); + syncConfig_ = null; + } + syncConfigCase_ = 6; + onChanged(); + return mysqlSyncConfigBuilder_; + } + + private int migrationType_ = 0; + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for migrationType. + */ + @java.lang.Override + public int getMigrationTypeValue() { + return migrationType_; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for migrationType to set. + * @return This builder for chaining. + */ + public Builder setMigrationTypeValue(int value) { + migrationType_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The migrationType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + getMigrationType() { + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType result = + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .forNumber(migrationType_); + return result == null + ? com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The migrationType to set. + * @return This builder for chaining. + */ + public Builder setMigrationType( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + migrationType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMigrationType() { + bitField0_ = (bitField0_ & ~0x00000040); + migrationType_ = 0; + onChanged(); + return this; + } + + private int syncParallelLevel_ = 0; + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Only applicable for
+     * PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for syncParallelLevel. + */ + @java.lang.Override + public int getSyncParallelLevelValue() { + return syncParallelLevel_; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Only applicable for
+     * PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for syncParallelLevel to set. + * @return This builder for chaining. + */ + public Builder setSyncParallelLevelValue(int value) { + syncParallelLevel_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Only applicable for
+     * PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The syncParallelLevel. + */ + @java.lang.Override + public com.google.cloud.sql.v1.ExternalSyncParallelLevel getSyncParallelLevel() { + com.google.cloud.sql.v1.ExternalSyncParallelLevel result = + com.google.cloud.sql.v1.ExternalSyncParallelLevel.forNumber(syncParallelLevel_); + return result == null + ? com.google.cloud.sql.v1.ExternalSyncParallelLevel.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Only applicable for
+     * PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The syncParallelLevel to set. + * @return This builder for chaining. + */ + public Builder setSyncParallelLevel(com.google.cloud.sql.v1.ExternalSyncParallelLevel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + syncParallelLevel_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Only applicable for
+     * PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSyncParallelLevel() { + bitField0_ = (bitField0_ & ~0x00000080); + syncParallelLevel_ = 0; + onChanged(); + return this; + } + + private java.util.List selectedObjects_ = + java.util.Collections.emptyList(); + + private void ensureSelectedObjectsIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + selectedObjects_ = + new java.util.ArrayList( + selectedObjects_); + bitField0_ |= 0x00000100; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ExternalSyncSelectedObject, + com.google.cloud.sql.v1.ExternalSyncSelectedObject.Builder, + com.google.cloud.sql.v1.ExternalSyncSelectedObjectOrBuilder> + selectedObjectsBuilder_; + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSelectedObjectsList() { + if (selectedObjectsBuilder_ == null) { + return java.util.Collections.unmodifiableList(selectedObjects_); + } else { + return selectedObjectsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getSelectedObjectsCount() { + if (selectedObjectsBuilder_ == null) { + return selectedObjects_.size(); + } else { + return selectedObjectsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ExternalSyncSelectedObject getSelectedObjects(int index) { + if (selectedObjectsBuilder_ == null) { + return selectedObjects_.get(index); + } else { + return selectedObjectsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSelectedObjects( + int index, com.google.cloud.sql.v1.ExternalSyncSelectedObject value) { + if (selectedObjectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSelectedObjectsIsMutable(); + selectedObjects_.set(index, value); + onChanged(); + } else { + selectedObjectsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSelectedObjects( + int index, com.google.cloud.sql.v1.ExternalSyncSelectedObject.Builder builderForValue) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.set(index, builderForValue.build()); + onChanged(); + } else { + selectedObjectsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects(com.google.cloud.sql.v1.ExternalSyncSelectedObject value) { + if (selectedObjectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(value); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects( + int index, com.google.cloud.sql.v1.ExternalSyncSelectedObject value) { + if (selectedObjectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(index, value); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects( + com.google.cloud.sql.v1.ExternalSyncSelectedObject.Builder builderForValue) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(builderForValue.build()); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects( + int index, com.google.cloud.sql.v1.ExternalSyncSelectedObject.Builder builderForValue) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(index, builderForValue.build()); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllSelectedObjects( + java.lang.Iterable values) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, selectedObjects_); + onChanged(); + } else { + selectedObjectsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSelectedObjects() { + if (selectedObjectsBuilder_ == null) { + selectedObjects_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + } else { + selectedObjectsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeSelectedObjects(int index) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.remove(index); + onChanged(); + } else { + selectedObjectsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ExternalSyncSelectedObject.Builder getSelectedObjectsBuilder( + int index) { + return internalGetSelectedObjectsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ExternalSyncSelectedObjectOrBuilder getSelectedObjectsOrBuilder( + int index) { + if (selectedObjectsBuilder_ == null) { + return selectedObjects_.get(index); + } else { + return selectedObjectsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSelectedObjectsOrBuilderList() { + if (selectedObjectsBuilder_ != null) { + return selectedObjectsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(selectedObjects_); + } + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ExternalSyncSelectedObject.Builder addSelectedObjectsBuilder() { + return internalGetSelectedObjectsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.ExternalSyncSelectedObject.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1.ExternalSyncSelectedObject.Builder addSelectedObjectsBuilder( + int index) { + return internalGetSelectedObjectsFieldBuilder() + .addBuilder( + index, com.google.cloud.sql.v1.ExternalSyncSelectedObject.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSelectedObjectsBuilderList() { + return internalGetSelectedObjectsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ExternalSyncSelectedObject, + com.google.cloud.sql.v1.ExternalSyncSelectedObject.Builder, + com.google.cloud.sql.v1.ExternalSyncSelectedObjectOrBuilder> + internalGetSelectedObjectsFieldBuilder() { + if (selectedObjectsBuilder_ == null) { + selectedObjectsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.ExternalSyncSelectedObject, + com.google.cloud.sql.v1.ExternalSyncSelectedObject.Builder, + com.google.cloud.sql.v1.ExternalSyncSelectedObjectOrBuilder>( + selectedObjects_, + ((bitField0_ & 0x00000100) != 0), + getParentForChildren(), + isClean()); + selectedObjects_ = null; + } + return selectedObjectsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest) + private static final com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest(); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesVerifyExternalSyncSettingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser + getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesVerifyExternalSyncSettingsRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesVerifyExternalSyncSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..e9685af0d7cf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesVerifyExternalSyncSettingsRequestOrBuilder.java @@ -0,0 +1,322 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesVerifyExternalSyncSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Flag to enable verifying connection only
+   * 
+ * + * bool verify_connection_only = 3; + * + * @return The verifyConnectionOnly. + */ + boolean getVerifyConnectionOnly(); + + /** + * + * + *
+   * External sync mode
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @return The enum numeric value on the wire for syncMode. + */ + int getSyncModeValue(); + + /** + * + * + *
+   * External sync mode
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @return The syncMode. + */ + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + getSyncMode(); + + /** + * + * + *
+   * Optional. Flag to verify settings required by replication setup only
+   * 
+ * + * bool verify_replication_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The verifyReplicationOnly. + */ + boolean getVerifyReplicationOnly(); + + /** + * + * + *
+   * Optional. MySQL-specific settings for start external sync.
+   * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the mysqlSyncConfig field is set. + */ + boolean hasMysqlSyncConfig(); + + /** + * + * + *
+   * Optional. MySQL-specific settings for start external sync.
+   * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mysqlSyncConfig. + */ + com.google.cloud.sql.v1.MySqlSyncConfig getMysqlSyncConfig(); + + /** + * + * + *
+   * Optional. MySQL-specific settings for start external sync.
+   * 
+ * + * + * .google.cloud.sql.v1.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.MySqlSyncConfigOrBuilder getMysqlSyncConfigOrBuilder(); + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for migrationType. + */ + int getMigrationTypeValue(); + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The migrationType. + */ + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + getMigrationType(); + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Only applicable for
+   * PostgreSQL.
+   * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for syncParallelLevel. + */ + int getSyncParallelLevelValue(); + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Only applicable for
+   * PostgreSQL.
+   * 
+ * + * + * .google.cloud.sql.v1.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The syncParallelLevel. + */ + com.google.cloud.sql.v1.ExternalSyncParallelLevel getSyncParallelLevel(); + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getSelectedObjectsList(); + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.ExternalSyncSelectedObject getSelectedObjects(int index); + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getSelectedObjectsCount(); + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getSelectedObjectsOrBuilderList(); + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1.ExternalSyncSelectedObjectOrBuilder getSelectedObjectsOrBuilder( + int index); + + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.SyncConfigCase + getSyncConfigCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesVerifyExternalSyncSettingsResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesVerifyExternalSyncSettingsResponse.java new file mode 100644 index 000000000000..c56104b531a8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesVerifyExternalSyncSettingsResponse.java @@ -0,0 +1,1656 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Instance verify external sync settings response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse} + */ +@com.google.protobuf.Generated +public final class SqlInstancesVerifyExternalSyncSettingsResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse) + SqlInstancesVerifyExternalSyncSettingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesVerifyExternalSyncSettingsResponse"); + } + + // Use SqlInstancesVerifyExternalSyncSettingsResponse.newBuilder() to construct. + private SqlInstancesVerifyExternalSyncSettingsResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesVerifyExternalSyncSettingsResponse() { + kind_ = ""; + errors_ = java.util.Collections.emptyList(); + warnings_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesVerifyExternalSyncSettingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesVerifyExternalSyncSettingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse.class, + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#migrationSettingErrorList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#migrationSettingErrorList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERRORS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List errors_; + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + @java.lang.Override + public java.util.List getErrorsList() { + return errors_; + } + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + @java.lang.Override + public java.util.List + getErrorsOrBuilderList() { + return errors_; + } + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + @java.lang.Override + public int getErrorsCount() { + return errors_.size(); + } + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlExternalSyncSettingError getErrors(int index) { + return errors_.get(index); + } + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlExternalSyncSettingErrorOrBuilder getErrorsOrBuilder( + int index) { + return errors_.get(index); + } + + public static final int WARNINGS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List warnings_; + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + @java.lang.Override + public java.util.List getWarningsList() { + return warnings_; + } + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + @java.lang.Override + public java.util.List + getWarningsOrBuilderList() { + return warnings_; + } + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + @java.lang.Override + public int getWarningsCount() { + return warnings_.size(); + } + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlExternalSyncSettingError getWarnings(int index) { + return warnings_.get(index); + } + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlExternalSyncSettingErrorOrBuilder getWarningsOrBuilder( + int index) { + return warnings_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < errors_.size(); i++) { + output.writeMessage(2, errors_.get(i)); + } + for (int i = 0; i < warnings_.size(); i++) { + output.writeMessage(3, warnings_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < errors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, errors_.get(i)); + } + for (int i = 0; i < warnings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, warnings_.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.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse other = + (com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getErrorsList().equals(other.getErrorsList())) return false; + if (!getWarningsList().equals(other.getWarningsList())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getErrorsCount() > 0) { + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrorsList().hashCode(); + } + if (getWarningsCount() > 0) { + hash = (37 * hash) + WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + getWarningsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance verify external sync settings response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse) + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesVerifyExternalSyncSettingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesVerifyExternalSyncSettingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse.class, + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (errorsBuilder_ == null) { + errors_ = java.util.Collections.emptyList(); + } else { + errors_ = null; + errorsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (warningsBuilder_ == null) { + warnings_ = java.util.Collections.emptyList(); + } else { + warnings_ = null; + warningsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SqlInstancesVerifyExternalSyncSettingsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse + getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse build() { + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse buildPartial() { + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse result = + new com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse result) { + if (errorsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + errors_ = java.util.Collections.unmodifiableList(errors_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.errors_ = errors_; + } else { + result.errors_ = errorsBuilder_.build(); + } + if (warningsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + warnings_ = java.util.Collections.unmodifiableList(warnings_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.warnings_ = warnings_; + } else { + result.warnings_ = warningsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse) { + return mergeFrom( + (com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse other) { + if (other + == com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse + .getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (errorsBuilder_ == null) { + if (!other.errors_.isEmpty()) { + if (errors_.isEmpty()) { + errors_ = other.errors_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureErrorsIsMutable(); + errors_.addAll(other.errors_); + } + onChanged(); + } + } else { + if (!other.errors_.isEmpty()) { + if (errorsBuilder_.isEmpty()) { + errorsBuilder_.dispose(); + errorsBuilder_ = null; + errors_ = other.errors_; + bitField0_ = (bitField0_ & ~0x00000002); + errorsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetErrorsFieldBuilder() + : null; + } else { + errorsBuilder_.addAllMessages(other.errors_); + } + } + } + if (warningsBuilder_ == null) { + if (!other.warnings_.isEmpty()) { + if (warnings_.isEmpty()) { + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureWarningsIsMutable(); + warnings_.addAll(other.warnings_); + } + onChanged(); + } + } else { + if (!other.warnings_.isEmpty()) { + if (warningsBuilder_.isEmpty()) { + warningsBuilder_.dispose(); + warningsBuilder_ = null; + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000004); + warningsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetWarningsFieldBuilder() + : null; + } else { + warningsBuilder_.addAllMessages(other.warnings_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1.SqlExternalSyncSettingError m = + input.readMessage( + com.google.cloud.sql.v1.SqlExternalSyncSettingError.parser(), + extensionRegistry); + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(m); + } else { + errorsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + com.google.cloud.sql.v1.SqlExternalSyncSettingError m = + input.readMessage( + com.google.cloud.sql.v1.SqlExternalSyncSettingError.parser(), + extensionRegistry); + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(m); + } else { + warningsBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#migrationSettingErrorList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#migrationSettingErrorList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#migrationSettingErrorList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#migrationSettingErrorList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#migrationSettingErrorList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List errors_ = + java.util.Collections.emptyList(); + + private void ensureErrorsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + errors_ = + new java.util.ArrayList(errors_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SqlExternalSyncSettingError, + com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder, + com.google.cloud.sql.v1.SqlExternalSyncSettingErrorOrBuilder> + errorsBuilder_; + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public java.util.List getErrorsList() { + if (errorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(errors_); + } else { + return errorsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public int getErrorsCount() { + if (errorsBuilder_ == null) { + return errors_.size(); + } else { + return errorsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public com.google.cloud.sql.v1.SqlExternalSyncSettingError getErrors(int index) { + if (errorsBuilder_ == null) { + return errors_.get(index); + } else { + return errorsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public Builder setErrors(int index, com.google.cloud.sql.v1.SqlExternalSyncSettingError value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.set(index, value); + onChanged(); + } else { + errorsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public Builder setErrors( + int index, com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.set(index, builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public Builder addErrors(com.google.cloud.sql.v1.SqlExternalSyncSettingError value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.add(value); + onChanged(); + } else { + errorsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public Builder addErrors(int index, com.google.cloud.sql.v1.SqlExternalSyncSettingError value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.add(index, value); + onChanged(); + } else { + errorsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public Builder addErrors( + com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public Builder addErrors( + int index, com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(index, builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public Builder addAllErrors( + java.lang.Iterable values) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errors_); + onChanged(); + } else { + errorsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public Builder clearErrors() { + if (errorsBuilder_ == null) { + errors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + errorsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public Builder removeErrors(int index) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.remove(index); + onChanged(); + } else { + errorsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder getErrorsBuilder(int index) { + return internalGetErrorsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public com.google.cloud.sql.v1.SqlExternalSyncSettingErrorOrBuilder getErrorsOrBuilder( + int index) { + if (errorsBuilder_ == null) { + return errors_.get(index); + } else { + return errorsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public java.util.List + getErrorsOrBuilderList() { + if (errorsBuilder_ != null) { + return errorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errors_); + } + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder addErrorsBuilder() { + return internalGetErrorsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.SqlExternalSyncSettingError.getDefaultInstance()); + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder addErrorsBuilder(int index) { + return internalGetErrorsFieldBuilder() + .addBuilder( + index, com.google.cloud.sql.v1.SqlExternalSyncSettingError.getDefaultInstance()); + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + public java.util.List + getErrorsBuilderList() { + return internalGetErrorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SqlExternalSyncSettingError, + com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder, + com.google.cloud.sql.v1.SqlExternalSyncSettingErrorOrBuilder> + internalGetErrorsFieldBuilder() { + if (errorsBuilder_ == null) { + errorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SqlExternalSyncSettingError, + com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder, + com.google.cloud.sql.v1.SqlExternalSyncSettingErrorOrBuilder>( + errors_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + errors_ = null; + } + return errorsBuilder_; + } + + private java.util.List warnings_ = + java.util.Collections.emptyList(); + + private void ensureWarningsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + warnings_ = + new java.util.ArrayList(warnings_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SqlExternalSyncSettingError, + com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder, + com.google.cloud.sql.v1.SqlExternalSyncSettingErrorOrBuilder> + warningsBuilder_; + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public java.util.List getWarningsList() { + if (warningsBuilder_ == null) { + return java.util.Collections.unmodifiableList(warnings_); + } else { + return warningsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public int getWarningsCount() { + if (warningsBuilder_ == null) { + return warnings_.size(); + } else { + return warningsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public com.google.cloud.sql.v1.SqlExternalSyncSettingError getWarnings(int index) { + if (warningsBuilder_ == null) { + return warnings_.get(index); + } else { + return warningsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public Builder setWarnings( + int index, com.google.cloud.sql.v1.SqlExternalSyncSettingError value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.set(index, value); + onChanged(); + } else { + warningsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public Builder setWarnings( + int index, com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.set(index, builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public Builder addWarnings(com.google.cloud.sql.v1.SqlExternalSyncSettingError value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(value); + onChanged(); + } else { + warningsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public Builder addWarnings( + int index, com.google.cloud.sql.v1.SqlExternalSyncSettingError value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(index, value); + onChanged(); + } else { + warningsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public Builder addWarnings( + com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public Builder addWarnings( + int index, com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(index, builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public Builder addAllWarnings( + java.lang.Iterable values) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, warnings_); + onChanged(); + } else { + warningsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public Builder clearWarnings() { + if (warningsBuilder_ == null) { + warnings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + warningsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public Builder removeWarnings(int index) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.remove(index); + onChanged(); + } else { + warningsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder getWarningsBuilder( + int index) { + return internalGetWarningsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public com.google.cloud.sql.v1.SqlExternalSyncSettingErrorOrBuilder getWarningsOrBuilder( + int index) { + if (warningsBuilder_ == null) { + return warnings_.get(index); + } else { + return warningsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public java.util.List + getWarningsOrBuilderList() { + if (warningsBuilder_ != null) { + return warningsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(warnings_); + } + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder addWarningsBuilder() { + return internalGetWarningsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.SqlExternalSyncSettingError.getDefaultInstance()); + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder addWarningsBuilder( + int index) { + return internalGetWarningsFieldBuilder() + .addBuilder( + index, com.google.cloud.sql.v1.SqlExternalSyncSettingError.getDefaultInstance()); + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + public java.util.List + getWarningsBuilderList() { + return internalGetWarningsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SqlExternalSyncSettingError, + com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder, + com.google.cloud.sql.v1.SqlExternalSyncSettingErrorOrBuilder> + internalGetWarningsFieldBuilder() { + if (warningsBuilder_ == null) { + warningsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SqlExternalSyncSettingError, + com.google.cloud.sql.v1.SqlExternalSyncSettingError.Builder, + com.google.cloud.sql.v1.SqlExternalSyncSettingErrorOrBuilder>( + warnings_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + warnings_ = null; + } + return warningsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse) + private static final com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse(); + } + + public static com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesVerifyExternalSyncSettingsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser + parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser + getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesVerifyExternalSyncSettingsResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesVerifyExternalSyncSettingsResponseOrBuilder.java new file mode 100644 index 000000000000..f7e866444da1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlInstancesVerifyExternalSyncSettingsResponseOrBuilder.java @@ -0,0 +1,166 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlInstancesVerifyExternalSyncSettingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#migrationSettingErrorList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#migrationSettingErrorList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + java.util.List getErrorsList(); + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + com.google.cloud.sql.v1.SqlExternalSyncSettingError getErrors(int index); + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + int getErrorsCount(); + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + java.util.List + getErrorsOrBuilderList(); + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError errors = 2; + */ + com.google.cloud.sql.v1.SqlExternalSyncSettingErrorOrBuilder getErrorsOrBuilder(int index); + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + java.util.List getWarningsList(); + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + com.google.cloud.sql.v1.SqlExternalSyncSettingError getWarnings(int index); + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + int getWarningsCount(); + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + java.util.List + getWarningsOrBuilderList(); + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1.SqlExternalSyncSettingError warnings = 3; + */ + com.google.cloud.sql.v1.SqlExternalSyncSettingErrorOrBuilder getWarningsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlIpAddressType.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlIpAddressType.java new file mode 100644 index 000000000000..5e9362795939 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlIpAddressType.java @@ -0,0 +1,241 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf enum {@code google.cloud.sql.v1.SqlIpAddressType} */ +@com.google.protobuf.Generated +public enum SqlIpAddressType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown IP address type.
+   * 
+ * + * SQL_IP_ADDRESS_TYPE_UNSPECIFIED = 0; + */ + SQL_IP_ADDRESS_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * IP address the customer is supposed to connect to. Usually this is the
+   * load balancer's IP address
+   * 
+ * + * PRIMARY = 1; + */ + PRIMARY(1), + /** + * + * + *
+   * Source IP address of the connection a read replica establishes to its
+   * external primary instance. This IP address can be allowlisted by the
+   * customer in case it has a firewall that filters incoming connection to its
+   * on premises primary instance.
+   * 
+ * + * OUTGOING = 2; + */ + OUTGOING(2), + /** + * + * + *
+   * Private IP used when using private IPs and network peering.
+   * 
+ * + * PRIVATE = 3; + */ + PRIVATE(3), + /** + * + * + *
+   * V1 IP of a migrated instance. We want the user to
+   * decommission this IP as soon as the migration is complete.
+   * Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
+   * 
+ * + * MIGRATED_1ST_GEN = 4; + */ + MIGRATED_1ST_GEN(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlIpAddressType"); + } + + /** + * + * + *
+   * This is an unknown IP address type.
+   * 
+ * + * SQL_IP_ADDRESS_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_IP_ADDRESS_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * IP address the customer is supposed to connect to. Usually this is the
+   * load balancer's IP address
+   * 
+ * + * PRIMARY = 1; + */ + public static final int PRIMARY_VALUE = 1; + + /** + * + * + *
+   * Source IP address of the connection a read replica establishes to its
+   * external primary instance. This IP address can be allowlisted by the
+   * customer in case it has a firewall that filters incoming connection to its
+   * on premises primary instance.
+   * 
+ * + * OUTGOING = 2; + */ + public static final int OUTGOING_VALUE = 2; + + /** + * + * + *
+   * Private IP used when using private IPs and network peering.
+   * 
+ * + * PRIVATE = 3; + */ + public static final int PRIVATE_VALUE = 3; + + /** + * + * + *
+   * V1 IP of a migrated instance. We want the user to
+   * decommission this IP as soon as the migration is complete.
+   * Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
+   * 
+ * + * MIGRATED_1ST_GEN = 4; + */ + public static final int MIGRATED_1ST_GEN_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 SqlIpAddressType 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 SqlIpAddressType forNumber(int value) { + switch (value) { + case 0: + return SQL_IP_ADDRESS_TYPE_UNSPECIFIED; + case 1: + return PRIMARY; + case 2: + return OUTGOING; + case 3: + return PRIVATE; + case 4: + return MIGRATED_1ST_GEN; + 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 SqlIpAddressType findValueByNumber(int number) { + return SqlIpAddressType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor().getEnumTypes().get(4); + } + + private static final SqlIpAddressType[] VALUES = values(); + + public static SqlIpAddressType 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 SqlIpAddressType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlIpAddressType) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlMaintenanceType.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlMaintenanceType.java new file mode 100644 index 000000000000..53551bb9c520 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlMaintenanceType.java @@ -0,0 +1,253 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The type of maintenance to be performed on the instance.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.SqlMaintenanceType} + */ +@com.google.protobuf.Generated +public enum SqlMaintenanceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Maintenance type is unspecified.
+   * 
+ * + * SQL_MAINTENANCE_TYPE_UNSPECIFIED = 0; + */ + SQL_MAINTENANCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Indicates that a standalone instance is undergoing maintenance. The
+   * instance can be either a primary instance or a replica.
+   * 
+ * + * INSTANCE_MAINTENANCE = 1; + */ + INSTANCE_MAINTENANCE(1), + /** + * + * + *
+   * Indicates that the primary instance and all of its replicas, including
+   * cascading replicas, are undergoing maintenance. Maintenance is performed on
+   * groups of replicas first, followed by the primary instance.
+   * 
+ * + * REPLICA_INCLUDED_MAINTENANCE = 2; + */ + REPLICA_INCLUDED_MAINTENANCE(2), + /** + * + * + *
+   * Indicates that the standalone instance is undergoing maintenance, initiated
+   * by self-service. The instance can be either a primary instance or a
+   * replica.
+   * 
+ * + * INSTANCE_SELF_SERVICE_MAINTENANCE = 3; + */ + INSTANCE_SELF_SERVICE_MAINTENANCE(3), + /** + * + * + *
+   * Indicates that the primary instance and all of its replicas are undergoing
+   * maintenance, initiated by self-service. Maintenance is performed on groups
+   * of replicas first, followed by the primary instance.
+   * 
+ * + * REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE = 4; + */ + REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlMaintenanceType"); + } + + /** + * + * + *
+   * Maintenance type is unspecified.
+   * 
+ * + * SQL_MAINTENANCE_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_MAINTENANCE_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Indicates that a standalone instance is undergoing maintenance. The
+   * instance can be either a primary instance or a replica.
+   * 
+ * + * INSTANCE_MAINTENANCE = 1; + */ + public static final int INSTANCE_MAINTENANCE_VALUE = 1; + + /** + * + * + *
+   * Indicates that the primary instance and all of its replicas, including
+   * cascading replicas, are undergoing maintenance. Maintenance is performed on
+   * groups of replicas first, followed by the primary instance.
+   * 
+ * + * REPLICA_INCLUDED_MAINTENANCE = 2; + */ + public static final int REPLICA_INCLUDED_MAINTENANCE_VALUE = 2; + + /** + * + * + *
+   * Indicates that the standalone instance is undergoing maintenance, initiated
+   * by self-service. The instance can be either a primary instance or a
+   * replica.
+   * 
+ * + * INSTANCE_SELF_SERVICE_MAINTENANCE = 3; + */ + public static final int INSTANCE_SELF_SERVICE_MAINTENANCE_VALUE = 3; + + /** + * + * + *
+   * Indicates that the primary instance and all of its replicas are undergoing
+   * maintenance, initiated by self-service. Maintenance is performed on groups
+   * of replicas first, followed by the primary instance.
+   * 
+ * + * REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE = 4; + */ + public static final int REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE_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 SqlMaintenanceType 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 SqlMaintenanceType forNumber(int value) { + switch (value) { + case 0: + return SQL_MAINTENANCE_TYPE_UNSPECIFIED; + case 1: + return INSTANCE_MAINTENANCE; + case 2: + return REPLICA_INCLUDED_MAINTENANCE; + case 3: + return INSTANCE_SELF_SERVICE_MAINTENANCE; + case 4: + return REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE; + 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 SqlMaintenanceType findValueByNumber(int number) { + return SqlMaintenanceType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor().getEnumTypes().get(2); + } + + private static final SqlMaintenanceType[] VALUES = values(); + + public static SqlMaintenanceType 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 SqlMaintenanceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlMaintenanceType) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsCancelRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsCancelRequest.java new file mode 100644 index 000000000000..a06ad5c419cf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsCancelRequest.java @@ -0,0 +1,785 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_operations.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Operations cancel request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlOperationsCancelRequest} + */ +@com.google.protobuf.Generated +public final class SqlOperationsCancelRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlOperationsCancelRequest) + SqlOperationsCancelRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlOperationsCancelRequest"); + } + + // Use SqlOperationsCancelRequest.newBuilder() to construct. + private SqlOperationsCancelRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlOperationsCancelRequest() { + operation_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsCancelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsCancelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlOperationsCancelRequest.class, + com.google.cloud.sql.v1.SqlOperationsCancelRequest.Builder.class); + } + + public static final int OPERATION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object operation_ = ""; + + /** + * + * + *
+   * Instance operation ID.
+   * 
+ * + * string operation = 1; + * + * @return The operation. + */ + @java.lang.Override + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operation_ = s; + return s; + } + } + + /** + * + * + *
+   * Instance operation ID.
+   * 
+ * + * string operation = 1; + * + * @return The bytes for operation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(operation_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, operation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operation_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, operation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlOperationsCancelRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlOperationsCancelRequest other = + (com.google.cloud.sql.v1.SqlOperationsCancelRequest) obj; + + if (!getOperation().equals(other.getOperation())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlOperationsCancelRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlOperationsCancelRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsCancelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlOperationsCancelRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsCancelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlOperationsCancelRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsCancelRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlOperationsCancelRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsCancelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlOperationsCancelRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsCancelRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlOperationsCancelRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlOperationsCancelRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Operations cancel request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlOperationsCancelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlOperationsCancelRequest) + com.google.cloud.sql.v1.SqlOperationsCancelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsCancelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsCancelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlOperationsCancelRequest.class, + com.google.cloud.sql.v1.SqlOperationsCancelRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlOperationsCancelRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + operation_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsCancelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlOperationsCancelRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlOperationsCancelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlOperationsCancelRequest build() { + com.google.cloud.sql.v1.SqlOperationsCancelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlOperationsCancelRequest buildPartial() { + com.google.cloud.sql.v1.SqlOperationsCancelRequest result = + new com.google.cloud.sql.v1.SqlOperationsCancelRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlOperationsCancelRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.operation_ = operation_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlOperationsCancelRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlOperationsCancelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlOperationsCancelRequest other) { + if (other == com.google.cloud.sql.v1.SqlOperationsCancelRequest.getDefaultInstance()) + return this; + if (!other.getOperation().isEmpty()) { + operation_ = other.operation_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + operation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 operation_ = ""; + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @return The operation. + */ + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @return The bytes for operation. + */ + public com.google.protobuf.ByteString getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @param value The operation to set. + * @return This builder for chaining. + */ + public Builder setOperation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperation() { + operation_ = getDefaultInstance().getOperation(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @param value The bytes for operation to set. + * @return This builder for chaining. + */ + public Builder setOperationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + operation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlOperationsCancelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlOperationsCancelRequest) + private static final com.google.cloud.sql.v1.SqlOperationsCancelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlOperationsCancelRequest(); + } + + public static com.google.cloud.sql.v1.SqlOperationsCancelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlOperationsCancelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlOperationsCancelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsCancelRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsCancelRequestOrBuilder.java new file mode 100644 index 000000000000..cd7242b89000 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsCancelRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_operations.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlOperationsCancelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlOperationsCancelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Instance operation ID.
+   * 
+ * + * string operation = 1; + * + * @return The operation. + */ + java.lang.String getOperation(); + + /** + * + * + *
+   * Instance operation ID.
+   * 
+ * + * string operation = 1; + * + * @return The bytes for operation. + */ + com.google.protobuf.ByteString getOperationBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsGetRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsGetRequest.java new file mode 100644 index 000000000000..0c7d22b2f31b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsGetRequest.java @@ -0,0 +1,785 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_operations.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Operations get request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlOperationsGetRequest} + */ +@com.google.protobuf.Generated +public final class SqlOperationsGetRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlOperationsGetRequest) + SqlOperationsGetRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlOperationsGetRequest"); + } + + // Use SqlOperationsGetRequest.newBuilder() to construct. + private SqlOperationsGetRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlOperationsGetRequest() { + operation_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlOperationsGetRequest.class, + com.google.cloud.sql.v1.SqlOperationsGetRequest.Builder.class); + } + + public static final int OPERATION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object operation_ = ""; + + /** + * + * + *
+   * Required. Instance operation ID.
+   * 
+ * + * string operation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The operation. + */ + @java.lang.Override + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operation_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Instance operation ID.
+   * 
+ * + * string operation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for operation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(operation_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, operation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operation_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, operation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlOperationsGetRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlOperationsGetRequest other = + (com.google.cloud.sql.v1.SqlOperationsGetRequest) obj; + + if (!getOperation().equals(other.getOperation())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlOperationsGetRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlOperationsGetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsGetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlOperationsGetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsGetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlOperationsGetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsGetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlOperationsGetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsGetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlOperationsGetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsGetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlOperationsGetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlOperationsGetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Operations get request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlOperationsGetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlOperationsGetRequest) + com.google.cloud.sql.v1.SqlOperationsGetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlOperationsGetRequest.class, + com.google.cloud.sql.v1.SqlOperationsGetRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlOperationsGetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + operation_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsGetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlOperationsGetRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlOperationsGetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlOperationsGetRequest build() { + com.google.cloud.sql.v1.SqlOperationsGetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlOperationsGetRequest buildPartial() { + com.google.cloud.sql.v1.SqlOperationsGetRequest result = + new com.google.cloud.sql.v1.SqlOperationsGetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlOperationsGetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.operation_ = operation_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlOperationsGetRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlOperationsGetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlOperationsGetRequest other) { + if (other == com.google.cloud.sql.v1.SqlOperationsGetRequest.getDefaultInstance()) + return this; + if (!other.getOperation().isEmpty()) { + operation_ = other.operation_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + operation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 operation_ = ""; + + /** + * + * + *
+     * Required. Instance operation ID.
+     * 
+ * + * string operation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The operation. + */ + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Instance operation ID.
+     * 
+ * + * string operation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for operation. + */ + public com.google.protobuf.ByteString getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Instance operation ID.
+     * 
+ * + * string operation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The operation to set. + * @return This builder for chaining. + */ + public Builder setOperation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Instance operation ID.
+     * 
+ * + * string operation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearOperation() { + operation_ = getDefaultInstance().getOperation(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Instance operation ID.
+     * 
+ * + * string operation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for operation to set. + * @return This builder for chaining. + */ + public Builder setOperationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + operation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlOperationsGetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlOperationsGetRequest) + private static final com.google.cloud.sql.v1.SqlOperationsGetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlOperationsGetRequest(); + } + + public static com.google.cloud.sql.v1.SqlOperationsGetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlOperationsGetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlOperationsGetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsGetRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsGetRequestOrBuilder.java new file mode 100644 index 000000000000..56610122c77b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsGetRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_operations.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlOperationsGetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlOperationsGetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Instance operation ID.
+   * 
+ * + * string operation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The operation. + */ + java.lang.String getOperation(); + + /** + * + * + *
+   * Required. Instance operation ID.
+   * 
+ * + * string operation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for operation. + */ + com.google.protobuf.ByteString getOperationBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsListRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsListRequest.java new file mode 100644 index 000000000000..a19a3f118d3b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsListRequest.java @@ -0,0 +1,1078 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_operations.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Operations list request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlOperationsListRequest} + */ +@com.google.protobuf.Generated +public final class SqlOperationsListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlOperationsListRequest) + SqlOperationsListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlOperationsListRequest"); + } + + // Use SqlOperationsListRequest.newBuilder() to construct. + private SqlOperationsListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlOperationsListRequest() { + instance_ = ""; + pageToken_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlOperationsListRequest.class, + com.google.cloud.sql.v1.SqlOperationsListRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_RESULTS_FIELD_NUMBER = 2; + private int maxResults_ = 0; + + /** + * + * + *
+   * Maximum number of operations per response.
+   * 
+ * + * uint32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (maxResults_ != 0) { + output.writeUInt32(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (maxResults_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlOperationsListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlOperationsListRequest other = + (com.google.cloud.sql.v1.SqlOperationsListRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (getMaxResults() != other.getMaxResults()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + MAX_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getMaxResults(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlOperationsListRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlOperationsListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlOperationsListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlOperationsListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsListRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlOperationsListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlOperationsListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlOperationsListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlOperationsListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlOperationsListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Operations list request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlOperationsListRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlOperationsListRequest) + com.google.cloud.sql.v1.SqlOperationsListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlOperationsListRequest.class, + com.google.cloud.sql.v1.SqlOperationsListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlOperationsListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + maxResults_ = 0; + pageToken_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlOperationsProto + .internal_static_google_cloud_sql_v1_SqlOperationsListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlOperationsListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlOperationsListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlOperationsListRequest build() { + com.google.cloud.sql.v1.SqlOperationsListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlOperationsListRequest buildPartial() { + com.google.cloud.sql.v1.SqlOperationsListRequest result = + new com.google.cloud.sql.v1.SqlOperationsListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlOperationsListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxResults_ = maxResults_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlOperationsListRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlOperationsListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlOperationsListRequest other) { + if (other == com.google.cloud.sql.v1.SqlOperationsListRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getMaxResults() != 0) { + setMaxResults(other.getMaxResults()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + maxResults_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int maxResults_; + + /** + * + * + *
+     * Maximum number of operations per response.
+     * 
+ * + * uint32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + /** + * + * + *
+     * Maximum number of operations per response.
+     * 
+ * + * uint32 max_results = 2; + * + * @param value The maxResults to set. + * @return This builder for chaining. + */ + public Builder setMaxResults(int value) { + + maxResults_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum number of operations per response.
+     * 
+ * + * uint32 max_results = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxResults() { + bitField0_ = (bitField0_ & ~0x00000002); + maxResults_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlOperationsListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlOperationsListRequest) + private static final com.google.cloud.sql.v1.SqlOperationsListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlOperationsListRequest(); + } + + public static com.google.cloud.sql.v1.SqlOperationsListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlOperationsListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlOperationsListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsListRequestOrBuilder.java new file mode 100644 index 000000000000..4a3b6bd5c5d4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlOperationsListRequestOrBuilder.java @@ -0,0 +1,121 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_operations.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlOperationsListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlOperationsListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Maximum number of operations per response.
+   * 
+ * + * uint32 max_results = 2; + * + * @return The maxResults. + */ + int getMaxResults(); + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlPricingPlan.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlPricingPlan.java new file mode 100644 index 000000000000..376908b6c6da --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlPricingPlan.java @@ -0,0 +1,191 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The pricing plan for this instance.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.SqlPricingPlan} + */ +@com.google.protobuf.Generated +public enum SqlPricingPlan implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown pricing plan for this instance.
+   * 
+ * + * SQL_PRICING_PLAN_UNSPECIFIED = 0; + */ + SQL_PRICING_PLAN_UNSPECIFIED(0), + /** + * + * + *
+   * The instance is billed at a monthly flat rate.
+   * 
+ * + * PACKAGE = 1; + */ + PACKAGE(1), + /** + * + * + *
+   * The instance is billed per usage.
+   * 
+ * + * PER_USE = 2; + */ + PER_USE(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlPricingPlan"); + } + + /** + * + * + *
+   * This is an unknown pricing plan for this instance.
+   * 
+ * + * SQL_PRICING_PLAN_UNSPECIFIED = 0; + */ + public static final int SQL_PRICING_PLAN_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The instance is billed at a monthly flat rate.
+   * 
+ * + * PACKAGE = 1; + */ + public static final int PACKAGE_VALUE = 1; + + /** + * + * + *
+   * The instance is billed per usage.
+   * 
+ * + * PER_USE = 2; + */ + public static final int PER_USE_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 SqlPricingPlan 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 SqlPricingPlan forNumber(int value) { + switch (value) { + case 0: + return SQL_PRICING_PLAN_UNSPECIFIED; + case 1: + return PACKAGE; + case 2: + return PER_USE; + 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 SqlPricingPlan findValueByNumber(int number) { + return SqlPricingPlan.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor().getEnumTypes().get(6); + } + + private static final SqlPricingPlan[] VALUES = values(); + + public static SqlPricingPlan 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 SqlPricingPlan(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlPricingPlan) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlReplicationType.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlReplicationType.java new file mode 100644 index 000000000000..eb7a3bd5be9b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlReplicationType.java @@ -0,0 +1,193 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf enum {@code google.cloud.sql.v1.SqlReplicationType} */ +@com.google.protobuf.Generated +public enum SqlReplicationType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown replication type for a Cloud SQL instance.
+   * 
+ * + * SQL_REPLICATION_TYPE_UNSPECIFIED = 0; + */ + SQL_REPLICATION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * The synchronous replication mode for First Generation instances. It is the
+   * default value.
+   * 
+ * + * SYNCHRONOUS = 1; + */ + SYNCHRONOUS(1), + /** + * + * + *
+   * The asynchronous replication mode for First Generation instances. It
+   * provides a slight performance gain, but if an outage occurs while this
+   * option is set to asynchronous, you can lose up to a few seconds of updates
+   * to your data.
+   * 
+ * + * ASYNCHRONOUS = 2; + */ + ASYNCHRONOUS(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlReplicationType"); + } + + /** + * + * + *
+   * This is an unknown replication type for a Cloud SQL instance.
+   * 
+ * + * SQL_REPLICATION_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_REPLICATION_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The synchronous replication mode for First Generation instances. It is the
+   * default value.
+   * 
+ * + * SYNCHRONOUS = 1; + */ + public static final int SYNCHRONOUS_VALUE = 1; + + /** + * + * + *
+   * The asynchronous replication mode for First Generation instances. It
+   * provides a slight performance gain, but if an outage occurs while this
+   * option is set to asynchronous, you can lose up to a few seconds of updates
+   * to your data.
+   * 
+ * + * ASYNCHRONOUS = 2; + */ + public static final int ASYNCHRONOUS_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 SqlReplicationType 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 SqlReplicationType forNumber(int value) { + switch (value) { + case 0: + return SQL_REPLICATION_TYPE_UNSPECIFIED; + case 1: + return SYNCHRONOUS; + case 2: + return ASYNCHRONOUS; + 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 SqlReplicationType findValueByNumber(int number) { + return SqlReplicationType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor().getEnumTypes().get(7); + } + + private static final SqlReplicationType[] VALUES = values(); + + public static SqlReplicationType 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 SqlReplicationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlReplicationType) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerAuditConfig.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerAuditConfig.java new file mode 100644 index 000000000000..b750df46a4ea --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerAuditConfig.java @@ -0,0 +1,1361 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * SQL Server specific audit configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlServerAuditConfig} + */ +@com.google.protobuf.Generated +public final class SqlServerAuditConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlServerAuditConfig) + SqlServerAuditConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlServerAuditConfig"); + } + + // Use SqlServerAuditConfig.newBuilder() to construct. + private SqlServerAuditConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlServerAuditConfig() { + kind_ = ""; + bucket_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerAuditConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerAuditConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlServerAuditConfig.class, + com.google.cloud.sql.v1.SqlServerAuditConfig.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always sql#sqlServerAuditConfig
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always sql#sqlServerAuditConfig
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUCKET_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object bucket_ = ""; + + /** + * + * + *
+   * The name of the destination bucket (e.g., gs://mybucket).
+   * 
+ * + * string bucket = 2; + * + * @return The bucket. + */ + @java.lang.Override + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the destination bucket (e.g., gs://mybucket).
+   * 
+ * + * string bucket = 2; + * + * @return The bytes for bucket. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RETENTION_INTERVAL_FIELD_NUMBER = 3; + private com.google.protobuf.Duration retentionInterval_; + + /** + * + * + *
+   * How long to keep generated audit files.
+   * 
+ * + * .google.protobuf.Duration retention_interval = 3; + * + * @return Whether the retentionInterval field is set. + */ + @java.lang.Override + public boolean hasRetentionInterval() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * How long to keep generated audit files.
+   * 
+ * + * .google.protobuf.Duration retention_interval = 3; + * + * @return The retentionInterval. + */ + @java.lang.Override + public com.google.protobuf.Duration getRetentionInterval() { + return retentionInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionInterval_; + } + + /** + * + * + *
+   * How long to keep generated audit files.
+   * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getRetentionIntervalOrBuilder() { + return retentionInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionInterval_; + } + + public static final int UPLOAD_INTERVAL_FIELD_NUMBER = 4; + private com.google.protobuf.Duration uploadInterval_; + + /** + * + * + *
+   * How often to upload generated audit files.
+   * 
+ * + * .google.protobuf.Duration upload_interval = 4; + * + * @return Whether the uploadInterval field is set. + */ + @java.lang.Override + public boolean hasUploadInterval() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * How often to upload generated audit files.
+   * 
+ * + * .google.protobuf.Duration upload_interval = 4; + * + * @return The uploadInterval. + */ + @java.lang.Override + public com.google.protobuf.Duration getUploadInterval() { + return uploadInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : uploadInterval_; + } + + /** + * + * + *
+   * How often to upload generated audit files.
+   * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getUploadIntervalOrBuilder() { + return uploadInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : uploadInterval_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(bucket_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, bucket_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getRetentionInterval()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getUploadInterval()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(bucket_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, bucket_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRetentionInterval()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUploadInterval()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlServerAuditConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlServerAuditConfig other = + (com.google.cloud.sql.v1.SqlServerAuditConfig) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getBucket().equals(other.getBucket())) return false; + if (hasRetentionInterval() != other.hasRetentionInterval()) return false; + if (hasRetentionInterval()) { + if (!getRetentionInterval().equals(other.getRetentionInterval())) return false; + } + if (hasUploadInterval() != other.hasUploadInterval()) return false; + if (hasUploadInterval()) { + if (!getUploadInterval().equals(other.getUploadInterval())) return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + if (hasRetentionInterval()) { + hash = (37 * hash) + RETENTION_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getRetentionInterval().hashCode(); + } + if (hasUploadInterval()) { + hash = (37 * hash) + UPLOAD_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getUploadInterval().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlServerAuditConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlServerAuditConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerAuditConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlServerAuditConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerAuditConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlServerAuditConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerAuditConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlServerAuditConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerAuditConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlServerAuditConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerAuditConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlServerAuditConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlServerAuditConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SQL Server specific audit configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlServerAuditConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlServerAuditConfig) + com.google.cloud.sql.v1.SqlServerAuditConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerAuditConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerAuditConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlServerAuditConfig.class, + com.google.cloud.sql.v1.SqlServerAuditConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlServerAuditConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRetentionIntervalFieldBuilder(); + internalGetUploadIntervalFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + bucket_ = ""; + retentionInterval_ = null; + if (retentionIntervalBuilder_ != null) { + retentionIntervalBuilder_.dispose(); + retentionIntervalBuilder_ = null; + } + uploadInterval_ = null; + if (uploadIntervalBuilder_ != null) { + uploadIntervalBuilder_.dispose(); + uploadIntervalBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerAuditConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerAuditConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlServerAuditConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerAuditConfig build() { + com.google.cloud.sql.v1.SqlServerAuditConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerAuditConfig buildPartial() { + com.google.cloud.sql.v1.SqlServerAuditConfig result = + new com.google.cloud.sql.v1.SqlServerAuditConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlServerAuditConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.bucket_ = bucket_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.retentionInterval_ = + retentionIntervalBuilder_ == null + ? retentionInterval_ + : retentionIntervalBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.uploadInterval_ = + uploadIntervalBuilder_ == null ? uploadInterval_ : uploadIntervalBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlServerAuditConfig) { + return mergeFrom((com.google.cloud.sql.v1.SqlServerAuditConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlServerAuditConfig other) { + if (other == com.google.cloud.sql.v1.SqlServerAuditConfig.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getBucket().isEmpty()) { + bucket_ = other.bucket_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasRetentionInterval()) { + mergeRetentionInterval(other.getRetentionInterval()); + } + if (other.hasUploadInterval()) { + mergeUploadInterval(other.getUploadInterval()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + bucket_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetRetentionIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetUploadIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always sql#sqlServerAuditConfig
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always sql#sqlServerAuditConfig
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always sql#sqlServerAuditConfig
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always sql#sqlServerAuditConfig
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always sql#sqlServerAuditConfig
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object bucket_ = ""; + + /** + * + * + *
+     * The name of the destination bucket (e.g., gs://mybucket).
+     * 
+ * + * string bucket = 2; + * + * @return The bucket. + */ + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the destination bucket (e.g., gs://mybucket).
+     * 
+ * + * string bucket = 2; + * + * @return The bytes for bucket. + */ + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the destination bucket (e.g., gs://mybucket).
+     * 
+ * + * string bucket = 2; + * + * @param value The bucket to set. + * @return This builder for chaining. + */ + public Builder setBucket(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bucket_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the destination bucket (e.g., gs://mybucket).
+     * 
+ * + * string bucket = 2; + * + * @return This builder for chaining. + */ + public Builder clearBucket() { + bucket_ = getDefaultInstance().getBucket(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the destination bucket (e.g., gs://mybucket).
+     * 
+ * + * string bucket = 2; + * + * @param value The bytes for bucket to set. + * @return This builder for chaining. + */ + public Builder setBucketBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bucket_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Duration retentionInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + retentionIntervalBuilder_; + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + * + * @return Whether the retentionInterval field is set. + */ + public boolean hasRetentionInterval() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + * + * @return The retentionInterval. + */ + public com.google.protobuf.Duration getRetentionInterval() { + if (retentionIntervalBuilder_ == null) { + return retentionInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionInterval_; + } else { + return retentionIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + public Builder setRetentionInterval(com.google.protobuf.Duration value) { + if (retentionIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retentionInterval_ = value; + } else { + retentionIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + public Builder setRetentionInterval(com.google.protobuf.Duration.Builder builderForValue) { + if (retentionIntervalBuilder_ == null) { + retentionInterval_ = builderForValue.build(); + } else { + retentionIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + public Builder mergeRetentionInterval(com.google.protobuf.Duration value) { + if (retentionIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && retentionInterval_ != null + && retentionInterval_ != com.google.protobuf.Duration.getDefaultInstance()) { + getRetentionIntervalBuilder().mergeFrom(value); + } else { + retentionInterval_ = value; + } + } else { + retentionIntervalBuilder_.mergeFrom(value); + } + if (retentionInterval_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + public Builder clearRetentionInterval() { + bitField0_ = (bitField0_ & ~0x00000004); + retentionInterval_ = null; + if (retentionIntervalBuilder_ != null) { + retentionIntervalBuilder_.dispose(); + retentionIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + public com.google.protobuf.Duration.Builder getRetentionIntervalBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetRetentionIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + public com.google.protobuf.DurationOrBuilder getRetentionIntervalOrBuilder() { + if (retentionIntervalBuilder_ != null) { + return retentionIntervalBuilder_.getMessageOrBuilder(); + } else { + return retentionInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionInterval_; + } + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetRetentionIntervalFieldBuilder() { + if (retentionIntervalBuilder_ == null) { + retentionIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getRetentionInterval(), getParentForChildren(), isClean()); + retentionInterval_ = null; + } + return retentionIntervalBuilder_; + } + + private com.google.protobuf.Duration uploadInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + uploadIntervalBuilder_; + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + * + * @return Whether the uploadInterval field is set. + */ + public boolean hasUploadInterval() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + * + * @return The uploadInterval. + */ + public com.google.protobuf.Duration getUploadInterval() { + if (uploadIntervalBuilder_ == null) { + return uploadInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : uploadInterval_; + } else { + return uploadIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + public Builder setUploadInterval(com.google.protobuf.Duration value) { + if (uploadIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + uploadInterval_ = value; + } else { + uploadIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + public Builder setUploadInterval(com.google.protobuf.Duration.Builder builderForValue) { + if (uploadIntervalBuilder_ == null) { + uploadInterval_ = builderForValue.build(); + } else { + uploadIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + public Builder mergeUploadInterval(com.google.protobuf.Duration value) { + if (uploadIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && uploadInterval_ != null + && uploadInterval_ != com.google.protobuf.Duration.getDefaultInstance()) { + getUploadIntervalBuilder().mergeFrom(value); + } else { + uploadInterval_ = value; + } + } else { + uploadIntervalBuilder_.mergeFrom(value); + } + if (uploadInterval_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + public Builder clearUploadInterval() { + bitField0_ = (bitField0_ & ~0x00000008); + uploadInterval_ = null; + if (uploadIntervalBuilder_ != null) { + uploadIntervalBuilder_.dispose(); + uploadIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + public com.google.protobuf.Duration.Builder getUploadIntervalBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetUploadIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + public com.google.protobuf.DurationOrBuilder getUploadIntervalOrBuilder() { + if (uploadIntervalBuilder_ != null) { + return uploadIntervalBuilder_.getMessageOrBuilder(); + } else { + return uploadInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : uploadInterval_; + } + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetUploadIntervalFieldBuilder() { + if (uploadIntervalBuilder_ == null) { + uploadIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getUploadInterval(), getParentForChildren(), isClean()); + uploadInterval_ = null; + } + return uploadIntervalBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlServerAuditConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlServerAuditConfig) + private static final com.google.cloud.sql.v1.SqlServerAuditConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlServerAuditConfig(); + } + + public static com.google.cloud.sql.v1.SqlServerAuditConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlServerAuditConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerAuditConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerAuditConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerAuditConfigOrBuilder.java new file mode 100644 index 000000000000..99c350182cc7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerAuditConfigOrBuilder.java @@ -0,0 +1,154 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlServerAuditConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlServerAuditConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always sql#sqlServerAuditConfig
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always sql#sqlServerAuditConfig
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The name of the destination bucket (e.g., gs://mybucket).
+   * 
+ * + * string bucket = 2; + * + * @return The bucket. + */ + java.lang.String getBucket(); + + /** + * + * + *
+   * The name of the destination bucket (e.g., gs://mybucket).
+   * 
+ * + * string bucket = 2; + * + * @return The bytes for bucket. + */ + com.google.protobuf.ByteString getBucketBytes(); + + /** + * + * + *
+   * How long to keep generated audit files.
+   * 
+ * + * .google.protobuf.Duration retention_interval = 3; + * + * @return Whether the retentionInterval field is set. + */ + boolean hasRetentionInterval(); + + /** + * + * + *
+   * How long to keep generated audit files.
+   * 
+ * + * .google.protobuf.Duration retention_interval = 3; + * + * @return The retentionInterval. + */ + com.google.protobuf.Duration getRetentionInterval(); + + /** + * + * + *
+   * How long to keep generated audit files.
+   * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + com.google.protobuf.DurationOrBuilder getRetentionIntervalOrBuilder(); + + /** + * + * + *
+   * How often to upload generated audit files.
+   * 
+ * + * .google.protobuf.Duration upload_interval = 4; + * + * @return Whether the uploadInterval field is set. + */ + boolean hasUploadInterval(); + + /** + * + * + *
+   * How often to upload generated audit files.
+   * 
+ * + * .google.protobuf.Duration upload_interval = 4; + * + * @return The uploadInterval. + */ + com.google.protobuf.Duration getUploadInterval(); + + /** + * + * + *
+   * How often to upload generated audit files.
+   * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + com.google.protobuf.DurationOrBuilder getUploadIntervalOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerDatabaseDetails.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerDatabaseDetails.java new file mode 100644 index 000000000000..9390824488ed --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerDatabaseDetails.java @@ -0,0 +1,693 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Represents a Sql Server database on the Cloud SQL instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlServerDatabaseDetails} + */ +@com.google.protobuf.Generated +public final class SqlServerDatabaseDetails extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlServerDatabaseDetails) + SqlServerDatabaseDetailsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlServerDatabaseDetails"); + } + + // Use SqlServerDatabaseDetails.newBuilder() to construct. + private SqlServerDatabaseDetails(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlServerDatabaseDetails() { + recoveryModel_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerDatabaseDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerDatabaseDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlServerDatabaseDetails.class, + com.google.cloud.sql.v1.SqlServerDatabaseDetails.Builder.class); + } + + public static final int COMPATIBILITY_LEVEL_FIELD_NUMBER = 1; + private int compatibilityLevel_ = 0; + + /** + * + * + *
+   * The version of SQL Server with which the database is to be made compatible
+   * 
+ * + * int32 compatibility_level = 1; + * + * @return The compatibilityLevel. + */ + @java.lang.Override + public int getCompatibilityLevel() { + return compatibilityLevel_; + } + + public static final int RECOVERY_MODEL_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object recoveryModel_ = ""; + + /** + * + * + *
+   * The recovery model of a SQL Server database
+   * 
+ * + * string recovery_model = 2; + * + * @return The recoveryModel. + */ + @java.lang.Override + public java.lang.String getRecoveryModel() { + java.lang.Object ref = recoveryModel_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recoveryModel_ = s; + return s; + } + } + + /** + * + * + *
+   * The recovery model of a SQL Server database
+   * 
+ * + * string recovery_model = 2; + * + * @return The bytes for recoveryModel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecoveryModelBytes() { + java.lang.Object ref = recoveryModel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recoveryModel_ = 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 (compatibilityLevel_ != 0) { + output.writeInt32(1, compatibilityLevel_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(recoveryModel_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, recoveryModel_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (compatibilityLevel_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, compatibilityLevel_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(recoveryModel_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, recoveryModel_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlServerDatabaseDetails)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlServerDatabaseDetails other = + (com.google.cloud.sql.v1.SqlServerDatabaseDetails) obj; + + if (getCompatibilityLevel() != other.getCompatibilityLevel()) return false; + if (!getRecoveryModel().equals(other.getRecoveryModel())) return false; + if (!getUnknownFields().equals(other.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) + COMPATIBILITY_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getCompatibilityLevel(); + hash = (37 * hash) + RECOVERY_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getRecoveryModel().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlServerDatabaseDetails parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlServerDatabaseDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerDatabaseDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlServerDatabaseDetails parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerDatabaseDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlServerDatabaseDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerDatabaseDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlServerDatabaseDetails parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerDatabaseDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlServerDatabaseDetails parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerDatabaseDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlServerDatabaseDetails parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlServerDatabaseDetails prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Represents a Sql Server database on the Cloud SQL instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlServerDatabaseDetails} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlServerDatabaseDetails) + com.google.cloud.sql.v1.SqlServerDatabaseDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerDatabaseDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerDatabaseDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlServerDatabaseDetails.class, + com.google.cloud.sql.v1.SqlServerDatabaseDetails.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlServerDatabaseDetails.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + compatibilityLevel_ = 0; + recoveryModel_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerDatabaseDetails_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerDatabaseDetails getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlServerDatabaseDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerDatabaseDetails build() { + com.google.cloud.sql.v1.SqlServerDatabaseDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerDatabaseDetails buildPartial() { + com.google.cloud.sql.v1.SqlServerDatabaseDetails result = + new com.google.cloud.sql.v1.SqlServerDatabaseDetails(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlServerDatabaseDetails result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.compatibilityLevel_ = compatibilityLevel_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recoveryModel_ = recoveryModel_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlServerDatabaseDetails) { + return mergeFrom((com.google.cloud.sql.v1.SqlServerDatabaseDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlServerDatabaseDetails other) { + if (other == com.google.cloud.sql.v1.SqlServerDatabaseDetails.getDefaultInstance()) + return this; + if (other.getCompatibilityLevel() != 0) { + setCompatibilityLevel(other.getCompatibilityLevel()); + } + if (!other.getRecoveryModel().isEmpty()) { + recoveryModel_ = other.recoveryModel_; + 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 8: + { + compatibilityLevel_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + recoveryModel_ = 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 int compatibilityLevel_; + + /** + * + * + *
+     * The version of SQL Server with which the database is to be made compatible
+     * 
+ * + * int32 compatibility_level = 1; + * + * @return The compatibilityLevel. + */ + @java.lang.Override + public int getCompatibilityLevel() { + return compatibilityLevel_; + } + + /** + * + * + *
+     * The version of SQL Server with which the database is to be made compatible
+     * 
+ * + * int32 compatibility_level = 1; + * + * @param value The compatibilityLevel to set. + * @return This builder for chaining. + */ + public Builder setCompatibilityLevel(int value) { + + compatibilityLevel_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The version of SQL Server with which the database is to be made compatible
+     * 
+ * + * int32 compatibility_level = 1; + * + * @return This builder for chaining. + */ + public Builder clearCompatibilityLevel() { + bitField0_ = (bitField0_ & ~0x00000001); + compatibilityLevel_ = 0; + onChanged(); + return this; + } + + private java.lang.Object recoveryModel_ = ""; + + /** + * + * + *
+     * The recovery model of a SQL Server database
+     * 
+ * + * string recovery_model = 2; + * + * @return The recoveryModel. + */ + public java.lang.String getRecoveryModel() { + java.lang.Object ref = recoveryModel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recoveryModel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The recovery model of a SQL Server database
+     * 
+ * + * string recovery_model = 2; + * + * @return The bytes for recoveryModel. + */ + public com.google.protobuf.ByteString getRecoveryModelBytes() { + java.lang.Object ref = recoveryModel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recoveryModel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The recovery model of a SQL Server database
+     * 
+ * + * string recovery_model = 2; + * + * @param value The recoveryModel to set. + * @return This builder for chaining. + */ + public Builder setRecoveryModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + recoveryModel_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The recovery model of a SQL Server database
+     * 
+ * + * string recovery_model = 2; + * + * @return This builder for chaining. + */ + public Builder clearRecoveryModel() { + recoveryModel_ = getDefaultInstance().getRecoveryModel(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The recovery model of a SQL Server database
+     * 
+ * + * string recovery_model = 2; + * + * @param value The bytes for recoveryModel to set. + * @return This builder for chaining. + */ + public Builder setRecoveryModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + recoveryModel_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlServerDatabaseDetails) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlServerDatabaseDetails) + private static final com.google.cloud.sql.v1.SqlServerDatabaseDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlServerDatabaseDetails(); + } + + public static com.google.cloud.sql.v1.SqlServerDatabaseDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlServerDatabaseDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerDatabaseDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerDatabaseDetailsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerDatabaseDetailsOrBuilder.java new file mode 100644 index 000000000000..a8ebf1d371d9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerDatabaseDetailsOrBuilder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlServerDatabaseDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlServerDatabaseDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The version of SQL Server with which the database is to be made compatible
+   * 
+ * + * int32 compatibility_level = 1; + * + * @return The compatibilityLevel. + */ + int getCompatibilityLevel(); + + /** + * + * + *
+   * The recovery model of a SQL Server database
+   * 
+ * + * string recovery_model = 2; + * + * @return The recoveryModel. + */ + java.lang.String getRecoveryModel(); + + /** + * + * + *
+   * The recovery model of a SQL Server database
+   * 
+ * + * string recovery_model = 2; + * + * @return The bytes for recoveryModel. + */ + com.google.protobuf.ByteString getRecoveryModelBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerEntraIdConfig.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerEntraIdConfig.java new file mode 100644 index 000000000000..58f38ec2baf9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerEntraIdConfig.java @@ -0,0 +1,973 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * SQL Server Entra ID configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlServerEntraIdConfig} + */ +@com.google.protobuf.Generated +public final class SqlServerEntraIdConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlServerEntraIdConfig) + SqlServerEntraIdConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlServerEntraIdConfig"); + } + + // Use SqlServerEntraIdConfig.newBuilder() to construct. + private SqlServerEntraIdConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlServerEntraIdConfig() { + kind_ = ""; + tenantId_ = ""; + applicationId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerEntraIdConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerEntraIdConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlServerEntraIdConfig.class, + com.google.cloud.sql.v1.SqlServerEntraIdConfig.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * Output only. This is always sql#sqlServerEntraIdConfig
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. This is always sql#sqlServerEntraIdConfig
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TENANT_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object tenantId_ = ""; + + /** + * + * + *
+   * Optional. The tenant ID for the Entra ID configuration.
+   * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The tenantId. + */ + @java.lang.Override + public java.lang.String getTenantId() { + java.lang.Object ref = tenantId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tenantId_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The tenant ID for the Entra ID configuration.
+   * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for tenantId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTenantIdBytes() { + java.lang.Object ref = tenantId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tenantId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APPLICATION_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object applicationId_ = ""; + + /** + * + * + *
+   * Optional. The application ID for the Entra ID configuration.
+   * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The applicationId. + */ + @java.lang.Override + public java.lang.String getApplicationId() { + java.lang.Object ref = applicationId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + applicationId_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The application ID for the Entra ID configuration.
+   * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for applicationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApplicationIdBytes() { + java.lang.Object ref = applicationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationId_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tenantId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, tenantId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, applicationId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tenantId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, tenantId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, applicationId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlServerEntraIdConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlServerEntraIdConfig other = + (com.google.cloud.sql.v1.SqlServerEntraIdConfig) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getTenantId().equals(other.getTenantId())) return false; + if (!getApplicationId().equals(other.getApplicationId())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + TENANT_ID_FIELD_NUMBER; + hash = (53 * hash) + getTenantId().hashCode(); + hash = (37 * hash) + APPLICATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getApplicationId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlServerEntraIdConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlServerEntraIdConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerEntraIdConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlServerEntraIdConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerEntraIdConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlServerEntraIdConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerEntraIdConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlServerEntraIdConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerEntraIdConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlServerEntraIdConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerEntraIdConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlServerEntraIdConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlServerEntraIdConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SQL Server Entra ID configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlServerEntraIdConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlServerEntraIdConfig) + com.google.cloud.sql.v1.SqlServerEntraIdConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerEntraIdConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerEntraIdConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlServerEntraIdConfig.class, + com.google.cloud.sql.v1.SqlServerEntraIdConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlServerEntraIdConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + tenantId_ = ""; + applicationId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlServerEntraIdConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerEntraIdConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlServerEntraIdConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerEntraIdConfig build() { + com.google.cloud.sql.v1.SqlServerEntraIdConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerEntraIdConfig buildPartial() { + com.google.cloud.sql.v1.SqlServerEntraIdConfig result = + new com.google.cloud.sql.v1.SqlServerEntraIdConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlServerEntraIdConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tenantId_ = tenantId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.applicationId_ = applicationId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlServerEntraIdConfig) { + return mergeFrom((com.google.cloud.sql.v1.SqlServerEntraIdConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlServerEntraIdConfig other) { + if (other == com.google.cloud.sql.v1.SqlServerEntraIdConfig.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTenantId().isEmpty()) { + tenantId_ = other.tenantId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getApplicationId().isEmpty()) { + applicationId_ = other.applicationId_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + tenantId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + applicationId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * Output only. This is always sql#sqlServerEntraIdConfig
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. This is always sql#sqlServerEntraIdConfig
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. This is always sql#sqlServerEntraIdConfig
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This is always sql#sqlServerEntraIdConfig
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This is always sql#sqlServerEntraIdConfig
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object tenantId_ = ""; + + /** + * + * + *
+     * Optional. The tenant ID for the Entra ID configuration.
+     * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The tenantId. + */ + public java.lang.String getTenantId() { + java.lang.Object ref = tenantId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tenantId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The tenant ID for the Entra ID configuration.
+     * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for tenantId. + */ + public com.google.protobuf.ByteString getTenantIdBytes() { + java.lang.Object ref = tenantId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tenantId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The tenant ID for the Entra ID configuration.
+     * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The tenantId to set. + * @return This builder for chaining. + */ + public Builder setTenantId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tenantId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The tenant ID for the Entra ID configuration.
+     * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearTenantId() { + tenantId_ = getDefaultInstance().getTenantId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The tenant ID for the Entra ID configuration.
+     * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for tenantId to set. + * @return This builder for chaining. + */ + public Builder setTenantIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tenantId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object applicationId_ = ""; + + /** + * + * + *
+     * Optional. The application ID for the Entra ID configuration.
+     * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The applicationId. + */ + public java.lang.String getApplicationId() { + java.lang.Object ref = applicationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + applicationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The application ID for the Entra ID configuration.
+     * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for applicationId. + */ + public com.google.protobuf.ByteString getApplicationIdBytes() { + java.lang.Object ref = applicationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The application ID for the Entra ID configuration.
+     * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The applicationId to set. + * @return This builder for chaining. + */ + public Builder setApplicationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + applicationId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The application ID for the Entra ID configuration.
+     * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearApplicationId() { + applicationId_ = getDefaultInstance().getApplicationId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The application ID for the Entra ID configuration.
+     * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for applicationId to set. + * @return This builder for chaining. + */ + public Builder setApplicationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + applicationId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlServerEntraIdConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlServerEntraIdConfig) + private static final com.google.cloud.sql.v1.SqlServerEntraIdConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlServerEntraIdConfig(); + } + + public static com.google.cloud.sql.v1.SqlServerEntraIdConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlServerEntraIdConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerEntraIdConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerEntraIdConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerEntraIdConfigOrBuilder.java new file mode 100644 index 000000000000..3f0422990600 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerEntraIdConfigOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlServerEntraIdConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlServerEntraIdConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. This is always sql#sqlServerEntraIdConfig
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * Output only. This is always sql#sqlServerEntraIdConfig
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Optional. The tenant ID for the Entra ID configuration.
+   * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The tenantId. + */ + java.lang.String getTenantId(); + + /** + * + * + *
+   * Optional. The tenant ID for the Entra ID configuration.
+   * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for tenantId. + */ + com.google.protobuf.ByteString getTenantIdBytes(); + + /** + * + * + *
+   * Optional. The application ID for the Entra ID configuration.
+   * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The applicationId. + */ + java.lang.String getApplicationId(); + + /** + * + * + *
+   * Optional. The application ID for the Entra ID configuration.
+   * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for applicationId. + */ + com.google.protobuf.ByteString getApplicationIdBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerUserDetails.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerUserDetails.java new file mode 100644 index 000000000000..3129afb5a2eb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerUserDetails.java @@ -0,0 +1,793 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Represents a Sql Server user on the Cloud SQL instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlServerUserDetails} + */ +@com.google.protobuf.Generated +public final class SqlServerUserDetails extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlServerUserDetails) + SqlServerUserDetailsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlServerUserDetails"); + } + + // Use SqlServerUserDetails.newBuilder() to construct. + private SqlServerUserDetails(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlServerUserDetails() { + serverRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlServerUserDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlServerUserDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlServerUserDetails.class, + com.google.cloud.sql.v1.SqlServerUserDetails.Builder.class); + } + + public static final int DISABLED_FIELD_NUMBER = 1; + private boolean disabled_ = false; + + /** + * + * + *
+   * If the user has been disabled
+   * 
+ * + * bool disabled = 1; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + public static final int SERVER_ROLES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList serverRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @return A list containing the serverRoles. + */ + public com.google.protobuf.ProtocolStringList getServerRolesList() { + return serverRoles_; + } + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @return The count of serverRoles. + */ + public int getServerRolesCount() { + return serverRoles_.size(); + } + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @param index The index of the element to return. + * @return The serverRoles at the given index. + */ + public java.lang.String getServerRoles(int index) { + return serverRoles_.get(index); + } + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @param index The index of the value to return. + * @return The bytes of the serverRoles at the given index. + */ + public com.google.protobuf.ByteString getServerRolesBytes(int index) { + return serverRoles_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (disabled_ != false) { + output.writeBool(1, disabled_); + } + for (int i = 0; i < serverRoles_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, serverRoles_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (disabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, disabled_); + } + { + int dataSize = 0; + for (int i = 0; i < serverRoles_.size(); i++) { + dataSize += computeStringSizeNoTag(serverRoles_.getRaw(i)); + } + size += dataSize; + size += 1 * getServerRolesList().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.sql.v1.SqlServerUserDetails)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlServerUserDetails other = + (com.google.cloud.sql.v1.SqlServerUserDetails) obj; + + if (getDisabled() != other.getDisabled()) return false; + if (!getServerRolesList().equals(other.getServerRolesList())) return false; + if (!getUnknownFields().equals(other.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) + DISABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisabled()); + if (getServerRolesCount() > 0) { + hash = (37 * hash) + SERVER_ROLES_FIELD_NUMBER; + hash = (53 * hash) + getServerRolesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlServerUserDetails parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlServerUserDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerUserDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlServerUserDetails parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerUserDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlServerUserDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerUserDetails parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlServerUserDetails parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerUserDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlServerUserDetails parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlServerUserDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlServerUserDetails parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlServerUserDetails prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Represents a Sql Server user on the Cloud SQL instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlServerUserDetails} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlServerUserDetails) + com.google.cloud.sql.v1.SqlServerUserDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlServerUserDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlServerUserDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlServerUserDetails.class, + com.google.cloud.sql.v1.SqlServerUserDetails.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlServerUserDetails.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + disabled_ = false; + serverRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlServerUserDetails_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerUserDetails getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlServerUserDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerUserDetails build() { + com.google.cloud.sql.v1.SqlServerUserDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerUserDetails buildPartial() { + com.google.cloud.sql.v1.SqlServerUserDetails result = + new com.google.cloud.sql.v1.SqlServerUserDetails(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlServerUserDetails result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.disabled_ = disabled_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + serverRoles_.makeImmutable(); + result.serverRoles_ = serverRoles_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlServerUserDetails) { + return mergeFrom((com.google.cloud.sql.v1.SqlServerUserDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlServerUserDetails other) { + if (other == com.google.cloud.sql.v1.SqlServerUserDetails.getDefaultInstance()) return this; + if (other.getDisabled() != false) { + setDisabled(other.getDisabled()); + } + if (!other.serverRoles_.isEmpty()) { + if (serverRoles_.isEmpty()) { + serverRoles_ = other.serverRoles_; + bitField0_ |= 0x00000002; + } else { + ensureServerRolesIsMutable(); + serverRoles_.addAll(other.serverRoles_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + disabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureServerRolesIsMutable(); + serverRoles_.add(s); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean disabled_; + + /** + * + * + *
+     * If the user has been disabled
+     * 
+ * + * bool disabled = 1; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + /** + * + * + *
+     * If the user has been disabled
+     * 
+ * + * bool disabled = 1; + * + * @param value The disabled to set. + * @return This builder for chaining. + */ + public Builder setDisabled(boolean value) { + + disabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * If the user has been disabled
+     * 
+ * + * bool disabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearDisabled() { + bitField0_ = (bitField0_ & ~0x00000001); + disabled_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList serverRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureServerRolesIsMutable() { + if (!serverRoles_.isModifiable()) { + serverRoles_ = new com.google.protobuf.LazyStringArrayList(serverRoles_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @return A list containing the serverRoles. + */ + public com.google.protobuf.ProtocolStringList getServerRolesList() { + serverRoles_.makeImmutable(); + return serverRoles_; + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @return The count of serverRoles. + */ + public int getServerRolesCount() { + return serverRoles_.size(); + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @param index The index of the element to return. + * @return The serverRoles at the given index. + */ + public java.lang.String getServerRoles(int index) { + return serverRoles_.get(index); + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @param index The index of the value to return. + * @return The bytes of the serverRoles at the given index. + */ + public com.google.protobuf.ByteString getServerRolesBytes(int index) { + return serverRoles_.getByteString(index); + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @param index The index to set the value at. + * @param value The serverRoles to set. + * @return This builder for chaining. + */ + public Builder setServerRoles(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerRolesIsMutable(); + serverRoles_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @param value The serverRoles to add. + * @return This builder for chaining. + */ + public Builder addServerRoles(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerRolesIsMutable(); + serverRoles_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @param values The serverRoles to add. + * @return This builder for chaining. + */ + public Builder addAllServerRoles(java.lang.Iterable values) { + ensureServerRolesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, serverRoles_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @return This builder for chaining. + */ + public Builder clearServerRoles() { + serverRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @param value The bytes of the serverRoles to add. + * @return This builder for chaining. + */ + public Builder addServerRolesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureServerRolesIsMutable(); + serverRoles_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlServerUserDetails) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlServerUserDetails) + private static final com.google.cloud.sql.v1.SqlServerUserDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlServerUserDetails(); + } + + public static com.google.cloud.sql.v1.SqlServerUserDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlServerUserDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerUserDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerUserDetailsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerUserDetailsOrBuilder.java new file mode 100644 index 000000000000..5bd61d84f49e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlServerUserDetailsOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlServerUserDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlServerUserDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If the user has been disabled
+   * 
+ * + * bool disabled = 1; + * + * @return The disabled. + */ + boolean getDisabled(); + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @return A list containing the serverRoles. + */ + java.util.List getServerRolesList(); + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @return The count of serverRoles. + */ + int getServerRolesCount(); + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @param index The index of the element to return. + * @return The serverRoles at the given index. + */ + java.lang.String getServerRoles(int index); + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @param index The index of the value to return. + * @return The bytes of the serverRoles at the given index. + */ + com.google.protobuf.ByteString getServerRolesBytes(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsDeleteRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsDeleteRequest.java new file mode 100644 index 000000000000..6052f0e59bdf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsDeleteRequest.java @@ -0,0 +1,958 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf type {@code google.cloud.sql.v1.SqlSslCertsDeleteRequest} */ +@com.google.protobuf.Generated +public final class SqlSslCertsDeleteRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlSslCertsDeleteRequest) + SqlSslCertsDeleteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlSslCertsDeleteRequest"); + } + + // Use SqlSslCertsDeleteRequest.newBuilder() to construct. + private SqlSslCertsDeleteRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlSslCertsDeleteRequest() { + instance_ = ""; + project_ = ""; + sha1Fingerprint_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest.class, + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SHA1_FINGERPRINT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object sha1Fingerprint_ = ""; + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The sha1Fingerprint. + */ + @java.lang.Override + public java.lang.String getSha1Fingerprint() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sha1Fingerprint_ = s; + return s; + } + } + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The bytes for sha1Fingerprint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSha1FingerprintBytes() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sha1Fingerprint_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sha1Fingerprint_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, sha1Fingerprint_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sha1Fingerprint_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, sha1Fingerprint_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlSslCertsDeleteRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest other = + (com.google.cloud.sql.v1.SqlSslCertsDeleteRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getSha1Fingerprint().equals(other.getSha1Fingerprint())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + SHA1_FINGERPRINT_FIELD_NUMBER; + hash = (53 * hash) + getSha1Fingerprint().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlSslCertsDeleteRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSslCertsDeleteRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsDeleteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSslCertsDeleteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsDeleteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSslCertsDeleteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsDeleteRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSslCertsDeleteRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsDeleteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSslCertsDeleteRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSslCertsDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlSslCertsDeleteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.SqlSslCertsDeleteRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlSslCertsDeleteRequest) + com.google.cloud.sql.v1.SqlSslCertsDeleteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest.class, + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlSslCertsDeleteRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + sha1Fingerprint_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsDeleteRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsDeleteRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlSslCertsDeleteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsDeleteRequest build() { + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsDeleteRequest buildPartial() { + com.google.cloud.sql.v1.SqlSslCertsDeleteRequest result = + new com.google.cloud.sql.v1.SqlSslCertsDeleteRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlSslCertsDeleteRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sha1Fingerprint_ = sha1Fingerprint_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlSslCertsDeleteRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlSslCertsDeleteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlSslCertsDeleteRequest other) { + if (other == com.google.cloud.sql.v1.SqlSslCertsDeleteRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSha1Fingerprint().isEmpty()) { + sha1Fingerprint_ = other.sha1Fingerprint_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + sha1Fingerprint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object sha1Fingerprint_ = ""; + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @return The sha1Fingerprint. + */ + public java.lang.String getSha1Fingerprint() { + java.lang.Object ref = sha1Fingerprint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sha1Fingerprint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @return The bytes for sha1Fingerprint. + */ + public com.google.protobuf.ByteString getSha1FingerprintBytes() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sha1Fingerprint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @param value The sha1Fingerprint to set. + * @return This builder for chaining. + */ + public Builder setSha1Fingerprint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sha1Fingerprint_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @return This builder for chaining. + */ + public Builder clearSha1Fingerprint() { + sha1Fingerprint_ = getDefaultInstance().getSha1Fingerprint(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @param value The bytes for sha1Fingerprint to set. + * @return This builder for chaining. + */ + public Builder setSha1FingerprintBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sha1Fingerprint_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlSslCertsDeleteRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlSslCertsDeleteRequest) + private static final com.google.cloud.sql.v1.SqlSslCertsDeleteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlSslCertsDeleteRequest(); + } + + public static com.google.cloud.sql.v1.SqlSslCertsDeleteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlSslCertsDeleteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsDeleteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsDeleteRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsDeleteRequestOrBuilder.java new file mode 100644 index 000000000000..aba4d31cd241 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsDeleteRequestOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlSslCertsDeleteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlSslCertsDeleteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The sha1Fingerprint. + */ + java.lang.String getSha1Fingerprint(); + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The bytes for sha1Fingerprint. + */ + com.google.protobuf.ByteString getSha1FingerprintBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsGetRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsGetRequest.java new file mode 100644 index 000000000000..994e6715d2c8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsGetRequest.java @@ -0,0 +1,957 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf type {@code google.cloud.sql.v1.SqlSslCertsGetRequest} */ +@com.google.protobuf.Generated +public final class SqlSslCertsGetRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlSslCertsGetRequest) + SqlSslCertsGetRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlSslCertsGetRequest"); + } + + // Use SqlSslCertsGetRequest.newBuilder() to construct. + private SqlSslCertsGetRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlSslCertsGetRequest() { + instance_ = ""; + project_ = ""; + sha1Fingerprint_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlSslCertsGetRequest.class, + com.google.cloud.sql.v1.SqlSslCertsGetRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SHA1_FINGERPRINT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object sha1Fingerprint_ = ""; + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The sha1Fingerprint. + */ + @java.lang.Override + public java.lang.String getSha1Fingerprint() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sha1Fingerprint_ = s; + return s; + } + } + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The bytes for sha1Fingerprint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSha1FingerprintBytes() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sha1Fingerprint_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sha1Fingerprint_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, sha1Fingerprint_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sha1Fingerprint_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, sha1Fingerprint_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlSslCertsGetRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlSslCertsGetRequest other = + (com.google.cloud.sql.v1.SqlSslCertsGetRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getSha1Fingerprint().equals(other.getSha1Fingerprint())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + SHA1_FINGERPRINT_FIELD_NUMBER; + hash = (53 * hash) + getSha1Fingerprint().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlSslCertsGetRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSslCertsGetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsGetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSslCertsGetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsGetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSslCertsGetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsGetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSslCertsGetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsGetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSslCertsGetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsGetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSslCertsGetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlSslCertsGetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.SqlSslCertsGetRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlSslCertsGetRequest) + com.google.cloud.sql.v1.SqlSslCertsGetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlSslCertsGetRequest.class, + com.google.cloud.sql.v1.SqlSslCertsGetRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlSslCertsGetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + sha1Fingerprint_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsGetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsGetRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlSslCertsGetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsGetRequest build() { + com.google.cloud.sql.v1.SqlSslCertsGetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsGetRequest buildPartial() { + com.google.cloud.sql.v1.SqlSslCertsGetRequest result = + new com.google.cloud.sql.v1.SqlSslCertsGetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlSslCertsGetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sha1Fingerprint_ = sha1Fingerprint_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlSslCertsGetRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlSslCertsGetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlSslCertsGetRequest other) { + if (other == com.google.cloud.sql.v1.SqlSslCertsGetRequest.getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSha1Fingerprint().isEmpty()) { + sha1Fingerprint_ = other.sha1Fingerprint_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + sha1Fingerprint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object sha1Fingerprint_ = ""; + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @return The sha1Fingerprint. + */ + public java.lang.String getSha1Fingerprint() { + java.lang.Object ref = sha1Fingerprint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sha1Fingerprint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @return The bytes for sha1Fingerprint. + */ + public com.google.protobuf.ByteString getSha1FingerprintBytes() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sha1Fingerprint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @param value The sha1Fingerprint to set. + * @return This builder for chaining. + */ + public Builder setSha1Fingerprint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sha1Fingerprint_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @return This builder for chaining. + */ + public Builder clearSha1Fingerprint() { + sha1Fingerprint_ = getDefaultInstance().getSha1Fingerprint(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @param value The bytes for sha1Fingerprint to set. + * @return This builder for chaining. + */ + public Builder setSha1FingerprintBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sha1Fingerprint_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlSslCertsGetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlSslCertsGetRequest) + private static final com.google.cloud.sql.v1.SqlSslCertsGetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlSslCertsGetRequest(); + } + + public static com.google.cloud.sql.v1.SqlSslCertsGetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlSslCertsGetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsGetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsGetRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsGetRequestOrBuilder.java new file mode 100644 index 000000000000..aac10d06bb48 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsGetRequestOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlSslCertsGetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlSslCertsGetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The sha1Fingerprint. + */ + java.lang.String getSha1Fingerprint(); + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The bytes for sha1Fingerprint. + */ + com.google.protobuf.ByteString getSha1FingerprintBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsInsertRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsInsertRequest.java new file mode 100644 index 000000000000..813568649090 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsInsertRequest.java @@ -0,0 +1,972 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf type {@code google.cloud.sql.v1.SqlSslCertsInsertRequest} */ +@com.google.protobuf.Generated +public final class SqlSslCertsInsertRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlSslCertsInsertRequest) + SqlSslCertsInsertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlSslCertsInsertRequest"); + } + + // Use SqlSslCertsInsertRequest.newBuilder() to construct. + private SqlSslCertsInsertRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlSslCertsInsertRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlSslCertsInsertRequest.class, + com.google.cloud.sql.v1.SqlSslCertsInsertRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.SslCertsInsertRequest body_; + + /** + * .google.cloud.sql.v1.SslCertsInsertRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.SslCertsInsertRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsInsertRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1.SslCertsInsertRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1.SslCertsInsertRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsInsertRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1.SslCertsInsertRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlSslCertsInsertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlSslCertsInsertRequest other = + (com.google.cloud.sql.v1.SqlSslCertsInsertRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlSslCertsInsertRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSslCertsInsertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsInsertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSslCertsInsertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsInsertRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSslCertsInsertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsInsertRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSslCertsInsertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsInsertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSslCertsInsertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSslCertsInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlSslCertsInsertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.SqlSslCertsInsertRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlSslCertsInsertRequest) + com.google.cloud.sql.v1.SqlSslCertsInsertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlSslCertsInsertRequest.class, + com.google.cloud.sql.v1.SqlSslCertsInsertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlSslCertsInsertRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsInsertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsInsertRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlSslCertsInsertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsInsertRequest build() { + com.google.cloud.sql.v1.SqlSslCertsInsertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsInsertRequest buildPartial() { + com.google.cloud.sql.v1.SqlSslCertsInsertRequest result = + new com.google.cloud.sql.v1.SqlSslCertsInsertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlSslCertsInsertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlSslCertsInsertRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlSslCertsInsertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlSslCertsInsertRequest other) { + if (other == com.google.cloud.sql.v1.SqlSslCertsInsertRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.SslCertsInsertRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCertsInsertRequest, + com.google.cloud.sql.v1.SslCertsInsertRequest.Builder, + com.google.cloud.sql.v1.SslCertsInsertRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.SslCertsInsertRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.SslCertsInsertRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.SslCertsInsertRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1.SslCertsInsertRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.SslCertsInsertRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.SslCertsInsertRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.SslCertsInsertRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.SslCertsInsertRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.SslCertsInsertRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.SslCertsInsertRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.SslCertsInsertRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.SslCertsInsertRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.SslCertsInsertRequest body = 100; */ + public com.google.cloud.sql.v1.SslCertsInsertRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.SslCertsInsertRequest body = 100; */ + public com.google.cloud.sql.v1.SslCertsInsertRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1.SslCertsInsertRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1.SslCertsInsertRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCertsInsertRequest, + com.google.cloud.sql.v1.SslCertsInsertRequest.Builder, + com.google.cloud.sql.v1.SslCertsInsertRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCertsInsertRequest, + com.google.cloud.sql.v1.SslCertsInsertRequest.Builder, + com.google.cloud.sql.v1.SslCertsInsertRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlSslCertsInsertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlSslCertsInsertRequest) + private static final com.google.cloud.sql.v1.SqlSslCertsInsertRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlSslCertsInsertRequest(); + } + + public static com.google.cloud.sql.v1.SqlSslCertsInsertRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlSslCertsInsertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsInsertRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsInsertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsInsertRequestOrBuilder.java new file mode 100644 index 000000000000..5fe7aabfaa44 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsInsertRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlSslCertsInsertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlSslCertsInsertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.SslCertsInsertRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.SslCertsInsertRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.SslCertsInsertRequest getBody(); + + /** .google.cloud.sql.v1.SslCertsInsertRequest body = 100; */ + com.google.cloud.sql.v1.SslCertsInsertRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsListRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsListRequest.java new file mode 100644 index 000000000000..a2424ab27cb9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsListRequest.java @@ -0,0 +1,768 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf type {@code google.cloud.sql.v1.SqlSslCertsListRequest} */ +@com.google.protobuf.Generated +public final class SqlSslCertsListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlSslCertsListRequest) + SqlSslCertsListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlSslCertsListRequest"); + } + + // Use SqlSslCertsListRequest.newBuilder() to construct. + private SqlSslCertsListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlSslCertsListRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlSslCertsListRequest.class, + com.google.cloud.sql.v1.SqlSslCertsListRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlSslCertsListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlSslCertsListRequest other = + (com.google.cloud.sql.v1.SqlSslCertsListRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlSslCertsListRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSslCertsListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSslCertsListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSslCertsListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsListRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSslCertsListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSslCertsListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSslCertsListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSslCertsListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlSslCertsListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.SqlSslCertsListRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlSslCertsListRequest) + com.google.cloud.sql.v1.SqlSslCertsListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlSslCertsListRequest.class, + com.google.cloud.sql.v1.SqlSslCertsListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlSslCertsListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SqlSslCertsListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlSslCertsListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsListRequest build() { + com.google.cloud.sql.v1.SqlSslCertsListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsListRequest buildPartial() { + com.google.cloud.sql.v1.SqlSslCertsListRequest result = + new com.google.cloud.sql.v1.SqlSslCertsListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlSslCertsListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlSslCertsListRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlSslCertsListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlSslCertsListRequest other) { + if (other == com.google.cloud.sql.v1.SqlSslCertsListRequest.getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlSslCertsListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlSslCertsListRequest) + private static final com.google.cloud.sql.v1.SqlSslCertsListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlSslCertsListRequest(); + } + + public static com.google.cloud.sql.v1.SqlSslCertsListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlSslCertsListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSslCertsListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsListRequestOrBuilder.java new file mode 100644 index 000000000000..5e85c43d46d4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSslCertsListRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlSslCertsListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlSslCertsListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSubOperationType.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSubOperationType.java new file mode 100644 index 000000000000..7f43a254cbe9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSubOperationType.java @@ -0,0 +1,690 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The sub operation type based on the operation type.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlSubOperationType} + */ +@com.google.protobuf.Generated +public final class SqlSubOperationType extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlSubOperationType) + SqlSubOperationTypeOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlSubOperationType"); + } + + // Use SqlSubOperationType.newBuilder() to construct. + private SqlSubOperationType(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlSubOperationType() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlSubOperationType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlSubOperationType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlSubOperationType.class, + com.google.cloud.sql.v1.SqlSubOperationType.Builder.class); + } + + private int subOperationDetailsCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object subOperationDetails_; + + public enum SubOperationDetailsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MAINTENANCE_TYPE(1), + SUBOPERATIONDETAILS_NOT_SET(0); + private final int value; + + private SubOperationDetailsCase(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 SubOperationDetailsCase valueOf(int value) { + return forNumber(value); + } + + public static SubOperationDetailsCase forNumber(int value) { + switch (value) { + case 1: + return MAINTENANCE_TYPE; + case 0: + return SUBOPERATIONDETAILS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SubOperationDetailsCase getSubOperationDetailsCase() { + return SubOperationDetailsCase.forNumber(subOperationDetailsCase_); + } + + public static final int MAINTENANCE_TYPE_FIELD_NUMBER = 1; + + /** + * + * + *
+   * The type of maintenance to be performed on the instance.
+   * 
+ * + * .google.cloud.sql.v1.SqlMaintenanceType maintenance_type = 1; + * + * @return Whether the maintenanceType field is set. + */ + public boolean hasMaintenanceType() { + return subOperationDetailsCase_ == 1; + } + + /** + * + * + *
+   * The type of maintenance to be performed on the instance.
+   * 
+ * + * .google.cloud.sql.v1.SqlMaintenanceType maintenance_type = 1; + * + * @return The enum numeric value on the wire for maintenanceType. + */ + public int getMaintenanceTypeValue() { + if (subOperationDetailsCase_ == 1) { + return (java.lang.Integer) subOperationDetails_; + } + return 0; + } + + /** + * + * + *
+   * The type of maintenance to be performed on the instance.
+   * 
+ * + * .google.cloud.sql.v1.SqlMaintenanceType maintenance_type = 1; + * + * @return The maintenanceType. + */ + public com.google.cloud.sql.v1.SqlMaintenanceType getMaintenanceType() { + if (subOperationDetailsCase_ == 1) { + com.google.cloud.sql.v1.SqlMaintenanceType result = + com.google.cloud.sql.v1.SqlMaintenanceType.forNumber( + (java.lang.Integer) subOperationDetails_); + return result == null ? com.google.cloud.sql.v1.SqlMaintenanceType.UNRECOGNIZED : result; + } + return com.google.cloud.sql.v1.SqlMaintenanceType.SQL_MAINTENANCE_TYPE_UNSPECIFIED; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (subOperationDetailsCase_ == 1) { + output.writeEnum(1, ((java.lang.Integer) subOperationDetails_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (subOperationDetailsCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize( + 1, ((java.lang.Integer) subOperationDetails_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlSubOperationType)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlSubOperationType other = + (com.google.cloud.sql.v1.SqlSubOperationType) obj; + + if (!getSubOperationDetailsCase().equals(other.getSubOperationDetailsCase())) return false; + switch (subOperationDetailsCase_) { + case 1: + if (getMaintenanceTypeValue() != other.getMaintenanceTypeValue()) 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 (subOperationDetailsCase_) { + case 1: + hash = (37 * hash) + MAINTENANCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceTypeValue(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlSubOperationType parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSubOperationType parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSubOperationType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSubOperationType parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSubOperationType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlSubOperationType parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSubOperationType parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSubOperationType parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSubOperationType parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSubOperationType parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlSubOperationType parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlSubOperationType parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlSubOperationType prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The sub operation type based on the operation type.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlSubOperationType} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlSubOperationType) + com.google.cloud.sql.v1.SqlSubOperationTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlSubOperationType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlSubOperationType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlSubOperationType.class, + com.google.cloud.sql.v1.SqlSubOperationType.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlSubOperationType.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + subOperationDetailsCase_ = 0; + subOperationDetails_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SqlSubOperationType_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSubOperationType getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlSubOperationType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSubOperationType build() { + com.google.cloud.sql.v1.SqlSubOperationType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSubOperationType buildPartial() { + com.google.cloud.sql.v1.SqlSubOperationType result = + new com.google.cloud.sql.v1.SqlSubOperationType(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlSubOperationType result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.sql.v1.SqlSubOperationType result) { + result.subOperationDetailsCase_ = subOperationDetailsCase_; + result.subOperationDetails_ = this.subOperationDetails_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlSubOperationType) { + return mergeFrom((com.google.cloud.sql.v1.SqlSubOperationType) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlSubOperationType other) { + if (other == com.google.cloud.sql.v1.SqlSubOperationType.getDefaultInstance()) return this; + switch (other.getSubOperationDetailsCase()) { + case MAINTENANCE_TYPE: + { + setMaintenanceTypeValue(other.getMaintenanceTypeValue()); + break; + } + case SUBOPERATIONDETAILS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + subOperationDetailsCase_ = 1; + subOperationDetails_ = rawValue; + 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 subOperationDetailsCase_ = 0; + private java.lang.Object subOperationDetails_; + + public SubOperationDetailsCase getSubOperationDetailsCase() { + return SubOperationDetailsCase.forNumber(subOperationDetailsCase_); + } + + public Builder clearSubOperationDetails() { + subOperationDetailsCase_ = 0; + subOperationDetails_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * The type of maintenance to be performed on the instance.
+     * 
+ * + * .google.cloud.sql.v1.SqlMaintenanceType maintenance_type = 1; + * + * @return Whether the maintenanceType field is set. + */ + @java.lang.Override + public boolean hasMaintenanceType() { + return subOperationDetailsCase_ == 1; + } + + /** + * + * + *
+     * The type of maintenance to be performed on the instance.
+     * 
+ * + * .google.cloud.sql.v1.SqlMaintenanceType maintenance_type = 1; + * + * @return The enum numeric value on the wire for maintenanceType. + */ + @java.lang.Override + public int getMaintenanceTypeValue() { + if (subOperationDetailsCase_ == 1) { + return ((java.lang.Integer) subOperationDetails_).intValue(); + } + return 0; + } + + /** + * + * + *
+     * The type of maintenance to be performed on the instance.
+     * 
+ * + * .google.cloud.sql.v1.SqlMaintenanceType maintenance_type = 1; + * + * @param value The enum numeric value on the wire for maintenanceType to set. + * @return This builder for chaining. + */ + public Builder setMaintenanceTypeValue(int value) { + subOperationDetailsCase_ = 1; + subOperationDetails_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of maintenance to be performed on the instance.
+     * 
+ * + * .google.cloud.sql.v1.SqlMaintenanceType maintenance_type = 1; + * + * @return The maintenanceType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlMaintenanceType getMaintenanceType() { + if (subOperationDetailsCase_ == 1) { + com.google.cloud.sql.v1.SqlMaintenanceType result = + com.google.cloud.sql.v1.SqlMaintenanceType.forNumber( + (java.lang.Integer) subOperationDetails_); + return result == null ? com.google.cloud.sql.v1.SqlMaintenanceType.UNRECOGNIZED : result; + } + return com.google.cloud.sql.v1.SqlMaintenanceType.SQL_MAINTENANCE_TYPE_UNSPECIFIED; + } + + /** + * + * + *
+     * The type of maintenance to be performed on the instance.
+     * 
+ * + * .google.cloud.sql.v1.SqlMaintenanceType maintenance_type = 1; + * + * @param value The maintenanceType to set. + * @return This builder for chaining. + */ + public Builder setMaintenanceType(com.google.cloud.sql.v1.SqlMaintenanceType value) { + if (value == null) { + throw new NullPointerException(); + } + subOperationDetailsCase_ = 1; + subOperationDetails_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of maintenance to be performed on the instance.
+     * 
+ * + * .google.cloud.sql.v1.SqlMaintenanceType maintenance_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearMaintenanceType() { + if (subOperationDetailsCase_ == 1) { + subOperationDetailsCase_ = 0; + subOperationDetails_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlSubOperationType) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlSubOperationType) + private static final com.google.cloud.sql.v1.SqlSubOperationType DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlSubOperationType(); + } + + public static com.google.cloud.sql.v1.SqlSubOperationType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlSubOperationType parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlSubOperationType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSubOperationTypeOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSubOperationTypeOrBuilder.java new file mode 100644 index 000000000000..39393a8a7105 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSubOperationTypeOrBuilder.java @@ -0,0 +1,69 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlSubOperationTypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlSubOperationType) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The type of maintenance to be performed on the instance.
+   * 
+ * + * .google.cloud.sql.v1.SqlMaintenanceType maintenance_type = 1; + * + * @return Whether the maintenanceType field is set. + */ + boolean hasMaintenanceType(); + + /** + * + * + *
+   * The type of maintenance to be performed on the instance.
+   * 
+ * + * .google.cloud.sql.v1.SqlMaintenanceType maintenance_type = 1; + * + * @return The enum numeric value on the wire for maintenanceType. + */ + int getMaintenanceTypeValue(); + + /** + * + * + *
+   * The type of maintenance to be performed on the instance.
+   * 
+ * + * .google.cloud.sql.v1.SqlMaintenanceType maintenance_type = 1; + * + * @return The maintenanceType. + */ + com.google.cloud.sql.v1.SqlMaintenanceType getMaintenanceType(); + + com.google.cloud.sql.v1.SqlSubOperationType.SubOperationDetailsCase getSubOperationDetailsCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSuspensionReason.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSuspensionReason.java new file mode 100644 index 000000000000..237e8228c80d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlSuspensionReason.java @@ -0,0 +1,269 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The suspension reason of the database instance if the state is SUSPENDED.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.SqlSuspensionReason} + */ +@com.google.protobuf.Generated +public enum SqlSuspensionReason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown suspension reason.
+   * 
+ * + * SQL_SUSPENSION_REASON_UNSPECIFIED = 0; + */ + SQL_SUSPENSION_REASON_UNSPECIFIED(0), + /** + * + * + *
+   * The instance is suspended due to billing issues (for example:, account
+   * issue)
+   * 
+ * + * BILLING_ISSUE = 2; + */ + BILLING_ISSUE(2), + /** + * + * + *
+   * The instance is suspended due to illegal content (for example:, child
+   * pornography, copyrighted material, etc.).
+   * 
+ * + * LEGAL_ISSUE = 3; + */ + LEGAL_ISSUE(3), + /** + * + * + *
+   * The instance is causing operational issues (for example:, causing the
+   * database to crash).
+   * 
+ * + * OPERATIONAL_ISSUE = 4; + */ + OPERATIONAL_ISSUE(4), + /** + * + * + *
+   * The KMS key used by the instance is either revoked or denied access to
+   * 
+ * + * KMS_KEY_ISSUE = 5; + */ + KMS_KEY_ISSUE(5), + /** + * + * + *
+   * The project is suspended due to abuse detected by Ares.
+   * 
+ * + * PROJECT_ABUSE = 8; + */ + PROJECT_ABUSE(8), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlSuspensionReason"); + } + + /** + * + * + *
+   * This is an unknown suspension reason.
+   * 
+ * + * SQL_SUSPENSION_REASON_UNSPECIFIED = 0; + */ + public static final int SQL_SUSPENSION_REASON_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The instance is suspended due to billing issues (for example:, account
+   * issue)
+   * 
+ * + * BILLING_ISSUE = 2; + */ + public static final int BILLING_ISSUE_VALUE = 2; + + /** + * + * + *
+   * The instance is suspended due to illegal content (for example:, child
+   * pornography, copyrighted material, etc.).
+   * 
+ * + * LEGAL_ISSUE = 3; + */ + public static final int LEGAL_ISSUE_VALUE = 3; + + /** + * + * + *
+   * The instance is causing operational issues (for example:, causing the
+   * database to crash).
+   * 
+ * + * OPERATIONAL_ISSUE = 4; + */ + public static final int OPERATIONAL_ISSUE_VALUE = 4; + + /** + * + * + *
+   * The KMS key used by the instance is either revoked or denied access to
+   * 
+ * + * KMS_KEY_ISSUE = 5; + */ + public static final int KMS_KEY_ISSUE_VALUE = 5; + + /** + * + * + *
+   * The project is suspended due to abuse detected by Ares.
+   * 
+ * + * PROJECT_ABUSE = 8; + */ + public static final int PROJECT_ABUSE_VALUE = 8; + + 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 SqlSuspensionReason 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 SqlSuspensionReason forNumber(int value) { + switch (value) { + case 0: + return SQL_SUSPENSION_REASON_UNSPECIFIED; + case 2: + return BILLING_ISSUE; + case 3: + return LEGAL_ISSUE; + case 4: + return OPERATIONAL_ISSUE; + case 5: + return KMS_KEY_ISSUE; + case 8: + return PROJECT_ABUSE; + 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 SqlSuspensionReason findValueByNumber(int number) { + return SqlSuspensionReason.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto.getDescriptor().getEnumTypes().get(2); + } + + private static final SqlSuspensionReason[] VALUES = values(); + + public static SqlSuspensionReason 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 SqlSuspensionReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlSuspensionReason) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlTiersListRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlTiersListRequest.java new file mode 100644 index 000000000000..22720ba65d57 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlTiersListRequest.java @@ -0,0 +1,595 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_tiers.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Tiers list request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlTiersListRequest} + */ +@com.google.protobuf.Generated +public final class SqlTiersListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlTiersListRequest) + SqlTiersListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlTiersListRequest"); + } + + // Use SqlTiersListRequest.newBuilder() to construct. + private SqlTiersListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlTiersListRequest() { + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_SqlTiersListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_SqlTiersListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlTiersListRequest.class, + com.google.cloud.sql.v1.SqlTiersListRequest.Builder.class); + } + + public static final int PROJECT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project for which to list tiers.
+   * 
+ * + * string project = 1; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project for which to list tiers.
+   * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlTiersListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlTiersListRequest other = + (com.google.cloud.sql.v1.SqlTiersListRequest) obj; + + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlTiersListRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlTiersListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlTiersListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlTiersListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlTiersListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlTiersListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlTiersListRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlTiersListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlTiersListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlTiersListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlTiersListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlTiersListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlTiersListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Tiers list request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlTiersListRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlTiersListRequest) + com.google.cloud.sql.v1.SqlTiersListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_SqlTiersListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_SqlTiersListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlTiersListRequest.class, + com.google.cloud.sql.v1.SqlTiersListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlTiersListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_SqlTiersListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlTiersListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlTiersListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlTiersListRequest build() { + com.google.cloud.sql.v1.SqlTiersListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlTiersListRequest buildPartial() { + com.google.cloud.sql.v1.SqlTiersListRequest result = + new com.google.cloud.sql.v1.SqlTiersListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlTiersListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlTiersListRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlTiersListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlTiersListRequest other) { + if (other == com.google.cloud.sql.v1.SqlTiersListRequest.getDefaultInstance()) return this; + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + project_ = 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 project_ = ""; + + /** + * + * + *
+     * Project ID of the project for which to list tiers.
+     * 
+ * + * string project = 1; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project for which to list tiers.
+     * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project for which to list tiers.
+     * 
+ * + * string project = 1; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project for which to list tiers.
+     * 
+ * + * string project = 1; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project for which to list tiers.
+     * 
+ * + * string project = 1; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlTiersListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlTiersListRequest) + private static final com.google.cloud.sql.v1.SqlTiersListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlTiersListRequest(); + } + + public static com.google.cloud.sql.v1.SqlTiersListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlTiersListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlTiersListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlTiersListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlTiersListRequestOrBuilder.java new file mode 100644 index 000000000000..de90ac7ba9a6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlTiersListRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_tiers.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlTiersListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlTiersListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Project ID of the project for which to list tiers.
+   * 
+ * + * string project = 1; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project for which to list tiers.
+   * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUpdateTrack.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUpdateTrack.java new file mode 100644 index 000000000000..a071774ffc6e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUpdateTrack.java @@ -0,0 +1,222 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf enum {@code google.cloud.sql.v1.SqlUpdateTrack} */ +@com.google.protobuf.Generated +public enum SqlUpdateTrack implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown maintenance timing preference.
+   * 
+ * + * SQL_UPDATE_TRACK_UNSPECIFIED = 0; + */ + SQL_UPDATE_TRACK_UNSPECIFIED(0), + /** + * + * + *
+   * For an instance with a scheduled maintenance window, this maintenance
+   * timing indicates that the maintenance update is scheduled 7 to 14 days
+   * after the notification is sent out. Also referred to as `Week 1` (Console)
+   * and `preview` (gcloud CLI).
+   * 
+ * + * canary = 1; + */ + canary(1), + /** + * + * + *
+   * For an instance with a scheduled maintenance window, this maintenance
+   * timing indicates that the maintenance update is scheduled 15 to 21 days
+   * after the notification is sent out. Also referred to as `Week 2` (Console)
+   * and `production` (gcloud CLI).
+   * 
+ * + * stable = 2; + */ + stable(2), + /** + * + * + *
+   * For instance with a scheduled maintenance window, this maintenance
+   * timing indicates that the maintenance update is scheduled 35 to 42 days
+   * after the notification is sent out.
+   * 
+ * + * week5 = 3; + */ + week5(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlUpdateTrack"); + } + + /** + * + * + *
+   * This is an unknown maintenance timing preference.
+   * 
+ * + * SQL_UPDATE_TRACK_UNSPECIFIED = 0; + */ + public static final int SQL_UPDATE_TRACK_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * For an instance with a scheduled maintenance window, this maintenance
+   * timing indicates that the maintenance update is scheduled 7 to 14 days
+   * after the notification is sent out. Also referred to as `Week 1` (Console)
+   * and `preview` (gcloud CLI).
+   * 
+ * + * canary = 1; + */ + public static final int canary_VALUE = 1; + + /** + * + * + *
+   * For an instance with a scheduled maintenance window, this maintenance
+   * timing indicates that the maintenance update is scheduled 15 to 21 days
+   * after the notification is sent out. Also referred to as `Week 2` (Console)
+   * and `production` (gcloud CLI).
+   * 
+ * + * stable = 2; + */ + public static final int stable_VALUE = 2; + + /** + * + * + *
+   * For instance with a scheduled maintenance window, this maintenance
+   * timing indicates that the maintenance update is scheduled 35 to 42 days
+   * after the notification is sent out.
+   * 
+ * + * week5 = 3; + */ + public static final int week5_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 SqlUpdateTrack 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 SqlUpdateTrack forNumber(int value) { + switch (value) { + case 0: + return SQL_UPDATE_TRACK_UNSPECIFIED; + case 1: + return canary; + case 2: + return stable; + case 3: + return week5; + 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 SqlUpdateTrack findValueByNumber(int number) { + return SqlUpdateTrack.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto.getDescriptor().getEnumTypes().get(10); + } + + private static final SqlUpdateTrack[] VALUES = values(); + + public static SqlUpdateTrack 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 SqlUpdateTrack(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.SqlUpdateTrack) +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersDeleteRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersDeleteRequest.java new file mode 100644 index 000000000000..013f397265b9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersDeleteRequest.java @@ -0,0 +1,1146 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf type {@code google.cloud.sql.v1.SqlUsersDeleteRequest} */ +@com.google.protobuf.Generated +public final class SqlUsersDeleteRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlUsersDeleteRequest) + SqlUsersDeleteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlUsersDeleteRequest"); + } + + // Use SqlUsersDeleteRequest.newBuilder() to construct. + private SqlUsersDeleteRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlUsersDeleteRequest() { + host_ = ""; + instance_ = ""; + name_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlUsersDeleteRequest.class, + com.google.cloud.sql.v1.SqlUsersDeleteRequest.Builder.class); + } + + public static final int HOST_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object host_ = ""; + + /** + * + * + *
+   * Host of the user in the instance.
+   * 
+ * + * string host = 1; + * + * @return The host. + */ + @java.lang.Override + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } + } + + /** + * + * + *
+   * Host of the user in the instance.
+   * 
+ * + * string host = 1; + * + * @return The bytes for host. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @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 PROJECT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(host_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, host_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, host_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlUsersDeleteRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlUsersDeleteRequest other = + (com.google.cloud.sql.v1.SqlUsersDeleteRequest) obj; + + if (!getHost().equals(other.getHost())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getName().equals(other.getName())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlUsersDeleteRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersDeleteRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersDeleteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersDeleteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersDeleteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersDeleteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersDeleteRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersDeleteRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersDeleteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersDeleteRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlUsersDeleteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.SqlUsersDeleteRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlUsersDeleteRequest) + com.google.cloud.sql.v1.SqlUsersDeleteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlUsersDeleteRequest.class, + com.google.cloud.sql.v1.SqlUsersDeleteRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlUsersDeleteRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + host_ = ""; + instance_ = ""; + name_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersDeleteRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersDeleteRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlUsersDeleteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersDeleteRequest build() { + com.google.cloud.sql.v1.SqlUsersDeleteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersDeleteRequest buildPartial() { + com.google.cloud.sql.v1.SqlUsersDeleteRequest result = + new com.google.cloud.sql.v1.SqlUsersDeleteRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlUsersDeleteRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.host_ = host_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlUsersDeleteRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlUsersDeleteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlUsersDeleteRequest other) { + if (other == com.google.cloud.sql.v1.SqlUsersDeleteRequest.getDefaultInstance()) return this; + if (!other.getHost().isEmpty()) { + host_ = other.host_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + host_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + project_ = 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 host_ = ""; + + /** + * + * + *
+     * Host of the user in the instance.
+     * 
+ * + * string host = 1; + * + * @return The host. + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Host of the user in the instance.
+     * 
+ * + * string host = 1; + * + * @return The bytes for host. + */ + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Host of the user in the instance.
+     * 
+ * + * string host = 1; + * + * @param value The host to set. + * @return This builder for chaining. + */ + public Builder setHost(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + host_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Host of the user in the instance.
+     * 
+ * + * string host = 1; + * + * @return This builder for chaining. + */ + public Builder clearHost() { + host_ = getDefaultInstance().getHost(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Host of the user in the instance.
+     * 
+ * + * string host = 1; + * + * @param value The bytes for host to set. + * @return This builder for chaining. + */ + public Builder setHostBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + host_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlUsersDeleteRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlUsersDeleteRequest) + private static final com.google.cloud.sql.v1.SqlUsersDeleteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlUsersDeleteRequest(); + } + + public static com.google.cloud.sql.v1.SqlUsersDeleteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlUsersDeleteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersDeleteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersDeleteRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersDeleteRequestOrBuilder.java new file mode 100644 index 000000000000..7b02d51cd537 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersDeleteRequestOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlUsersDeleteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlUsersDeleteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Host of the user in the instance.
+   * 
+ * + * string host = 1; + * + * @return The host. + */ + java.lang.String getHost(); + + /** + * + * + *
+   * Host of the user in the instance.
+   * 
+ * + * string host = 1; + * + * @return The bytes for host. + */ + com.google.protobuf.ByteString getHostBytes(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersGetRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersGetRequest.java new file mode 100644 index 000000000000..aa6562f2dbd0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersGetRequest.java @@ -0,0 +1,1162 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Request message for Users Get RPC
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlUsersGetRequest} + */ +@com.google.protobuf.Generated +public final class SqlUsersGetRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlUsersGetRequest) + SqlUsersGetRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlUsersGetRequest"); + } + + // Use SqlUsersGetRequest.newBuilder() to construct. + private SqlUsersGetRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlUsersGetRequest() { + instance_ = ""; + name_ = ""; + project_ = ""; + host_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlUsersGetRequest.class, + com.google.cloud.sql.v1.SqlUsersGetRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * User of the instance.
+   * 
+ * + * string name = 2; + * + * @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; + } + } + + /** + * + * + *
+   * User of the instance.
+   * 
+ * + * string name = 2; + * + * @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 PROJECT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HOST_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object host_ = ""; + + /** + * + * + *
+   * Host of a user of the instance.
+   * 
+ * + * string host = 4; + * + * @return The host. + */ + @java.lang.Override + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } + } + + /** + * + * + *
+   * Host of a user of the instance.
+   * 
+ * + * string host = 4; + * + * @return The bytes for host. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, host_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, host_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlUsersGetRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlUsersGetRequest other = + (com.google.cloud.sql.v1.SqlUsersGetRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getName().equals(other.getName())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getHost().equals(other.getHost())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlUsersGetRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersGetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersGetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersGetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersGetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersGetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersGetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersGetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersGetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersGetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersGetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersGetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlUsersGetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for Users Get RPC
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SqlUsersGetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlUsersGetRequest) + com.google.cloud.sql.v1.SqlUsersGetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlUsersGetRequest.class, + com.google.cloud.sql.v1.SqlUsersGetRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlUsersGetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + name_ = ""; + project_ = ""; + host_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersGetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersGetRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlUsersGetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersGetRequest build() { + com.google.cloud.sql.v1.SqlUsersGetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersGetRequest buildPartial() { + com.google.cloud.sql.v1.SqlUsersGetRequest result = + new com.google.cloud.sql.v1.SqlUsersGetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlUsersGetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.host_ = host_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlUsersGetRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlUsersGetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlUsersGetRequest other) { + if (other == com.google.cloud.sql.v1.SqlUsersGetRequest.getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getHost().isEmpty()) { + host_ = other.host_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + host_ = 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 instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * User of the instance.
+     * 
+ * + * string name = 2; + * + * @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; + } + } + + /** + * + * + *
+     * User of the instance.
+     * 
+ * + * string name = 2; + * + * @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; + } + } + + /** + * + * + *
+     * User of the instance.
+     * 
+ * + * string name = 2; + * + * @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; + } + + /** + * + * + *
+     * User of the instance.
+     * 
+ * + * string name = 2; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * User of the instance.
+     * 
+ * + * string name = 2; + * + * @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; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object host_ = ""; + + /** + * + * + *
+     * Host of a user of the instance.
+     * 
+ * + * string host = 4; + * + * @return The host. + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Host of a user of the instance.
+     * 
+ * + * string host = 4; + * + * @return The bytes for host. + */ + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Host of a user of the instance.
+     * 
+ * + * string host = 4; + * + * @param value The host to set. + * @return This builder for chaining. + */ + public Builder setHost(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + host_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Host of a user of the instance.
+     * 
+ * + * string host = 4; + * + * @return This builder for chaining. + */ + public Builder clearHost() { + host_ = getDefaultInstance().getHost(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Host of a user of the instance.
+     * 
+ * + * string host = 4; + * + * @param value The bytes for host to set. + * @return This builder for chaining. + */ + public Builder setHostBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + host_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlUsersGetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlUsersGetRequest) + private static final com.google.cloud.sql.v1.SqlUsersGetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlUsersGetRequest(); + } + + public static com.google.cloud.sql.v1.SqlUsersGetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlUsersGetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersGetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersGetRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersGetRequestOrBuilder.java new file mode 100644 index 000000000000..87a18c2f14a2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersGetRequestOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlUsersGetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlUsersGetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * User of the instance.
+   * 
+ * + * string name = 2; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * User of the instance.
+   * 
+ * + * string name = 2; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Host of a user of the instance.
+   * 
+ * + * string host = 4; + * + * @return The host. + */ + java.lang.String getHost(); + + /** + * + * + *
+   * Host of a user of the instance.
+   * 
+ * + * string host = 4; + * + * @return The bytes for host. + */ + com.google.protobuf.ByteString getHostBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersInsertRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersInsertRequest.java new file mode 100644 index 000000000000..ba4f1572cbbe --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersInsertRequest.java @@ -0,0 +1,963 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf type {@code google.cloud.sql.v1.SqlUsersInsertRequest} */ +@com.google.protobuf.Generated +public final class SqlUsersInsertRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlUsersInsertRequest) + SqlUsersInsertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlUsersInsertRequest"); + } + + // Use SqlUsersInsertRequest.newBuilder() to construct. + private SqlUsersInsertRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlUsersInsertRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlUsersInsertRequest.class, + com.google.cloud.sql.v1.SqlUsersInsertRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.User body_; + + /** + * .google.cloud.sql.v1.User body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1.User body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.User getBody() { + return body_ == null ? com.google.cloud.sql.v1.User.getDefaultInstance() : body_; + } + + /** .google.cloud.sql.v1.User body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.UserOrBuilder getBodyOrBuilder() { + return body_ == null ? com.google.cloud.sql.v1.User.getDefaultInstance() : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlUsersInsertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlUsersInsertRequest other = + (com.google.cloud.sql.v1.SqlUsersInsertRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlUsersInsertRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersInsertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersInsertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersInsertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersInsertRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersInsertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersInsertRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersInsertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersInsertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersInsertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlUsersInsertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.SqlUsersInsertRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlUsersInsertRequest) + com.google.cloud.sql.v1.SqlUsersInsertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlUsersInsertRequest.class, + com.google.cloud.sql.v1.SqlUsersInsertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlUsersInsertRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersInsertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersInsertRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlUsersInsertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersInsertRequest build() { + com.google.cloud.sql.v1.SqlUsersInsertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersInsertRequest buildPartial() { + com.google.cloud.sql.v1.SqlUsersInsertRequest result = + new com.google.cloud.sql.v1.SqlUsersInsertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlUsersInsertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlUsersInsertRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlUsersInsertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlUsersInsertRequest other) { + if (other == com.google.cloud.sql.v1.SqlUsersInsertRequest.getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.User body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.User, + com.google.cloud.sql.v1.User.Builder, + com.google.cloud.sql.v1.UserOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.User body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1.User body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.User getBody() { + if (bodyBuilder_ == null) { + return body_ == null ? com.google.cloud.sql.v1.User.getDefaultInstance() : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.User body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.User value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.User body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.User.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.User body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.User value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.User.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.User body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.User body = 100; */ + public com.google.cloud.sql.v1.User.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.User body = 100; */ + public com.google.cloud.sql.v1.UserOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null ? com.google.cloud.sql.v1.User.getDefaultInstance() : body_; + } + } + + /** .google.cloud.sql.v1.User body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.User, + com.google.cloud.sql.v1.User.Builder, + com.google.cloud.sql.v1.UserOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.User, + com.google.cloud.sql.v1.User.Builder, + com.google.cloud.sql.v1.UserOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlUsersInsertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlUsersInsertRequest) + private static final com.google.cloud.sql.v1.SqlUsersInsertRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlUsersInsertRequest(); + } + + public static com.google.cloud.sql.v1.SqlUsersInsertRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlUsersInsertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersInsertRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersInsertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersInsertRequestOrBuilder.java new file mode 100644 index 000000000000..0a640fd2ab55 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersInsertRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlUsersInsertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlUsersInsertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1.User body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.User body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.User getBody(); + + /** .google.cloud.sql.v1.User body = 100; */ + com.google.cloud.sql.v1.UserOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersListRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersListRequest.java new file mode 100644 index 000000000000..6aed31d8800f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersListRequest.java @@ -0,0 +1,768 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf type {@code google.cloud.sql.v1.SqlUsersListRequest} */ +@com.google.protobuf.Generated +public final class SqlUsersListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlUsersListRequest) + SqlUsersListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlUsersListRequest"); + } + + // Use SqlUsersListRequest.newBuilder() to construct. + private SqlUsersListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlUsersListRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlUsersListRequest.class, + com.google.cloud.sql.v1.SqlUsersListRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlUsersListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlUsersListRequest other = + (com.google.cloud.sql.v1.SqlUsersListRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlUsersListRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersListRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlUsersListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.SqlUsersListRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlUsersListRequest) + com.google.cloud.sql.v1.SqlUsersListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlUsersListRequest.class, + com.google.cloud.sql.v1.SqlUsersListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlUsersListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlUsersListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersListRequest build() { + com.google.cloud.sql.v1.SqlUsersListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersListRequest buildPartial() { + com.google.cloud.sql.v1.SqlUsersListRequest result = + new com.google.cloud.sql.v1.SqlUsersListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlUsersListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlUsersListRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlUsersListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlUsersListRequest other) { + if (other == com.google.cloud.sql.v1.SqlUsersListRequest.getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlUsersListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlUsersListRequest) + private static final com.google.cloud.sql.v1.SqlUsersListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlUsersListRequest(); + } + + public static com.google.cloud.sql.v1.SqlUsersListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlUsersListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersListRequestOrBuilder.java new file mode 100644 index 000000000000..e228cb324fe9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersListRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlUsersListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlUsersListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersUpdateRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersUpdateRequest.java new file mode 100644 index 000000000000..ca8ef2d13a28 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersUpdateRequest.java @@ -0,0 +1,1795 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** Protobuf type {@code google.cloud.sql.v1.SqlUsersUpdateRequest} */ +@com.google.protobuf.Generated +public final class SqlUsersUpdateRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SqlUsersUpdateRequest) + SqlUsersUpdateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlUsersUpdateRequest"); + } + + // Use SqlUsersUpdateRequest.newBuilder() to construct. + private SqlUsersUpdateRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlUsersUpdateRequest() { + host_ = ""; + instance_ = ""; + name_ = ""; + project_ = ""; + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersUpdateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersUpdateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlUsersUpdateRequest.class, + com.google.cloud.sql.v1.SqlUsersUpdateRequest.Builder.class); + } + + private int bitField0_; + public static final int HOST_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object host_ = ""; + + /** + * + * + *
+   * Optional. Host of the user in the instance.
+   * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The host. + */ + @java.lang.Override + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Host of the user in the instance.
+   * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for host. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @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 PROJECT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_ROLES_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList databaseRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + public com.google.protobuf.ProtocolStringList getDatabaseRolesList() { + return databaseRoles_; + } + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + public int getDatabaseRolesCount() { + return databaseRoles_.size(); + } + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + public java.lang.String getDatabaseRoles(int index) { + return databaseRoles_.get(index); + } + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + public com.google.protobuf.ByteString getDatabaseRolesBytes(int index) { + return databaseRoles_.getByteString(index); + } + + public static final int REVOKE_EXISTING_ROLES_FIELD_NUMBER = 6; + private boolean revokeExistingRoles_ = false; + + /** + * + * + *
+   * Optional. Specifies whether to revoke existing roles that are not present
+   * in the `database_roles` field. If `false` or unset, the database roles
+   * specified in `database_roles` are added to the user's existing roles.
+   * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the revokeExistingRoles field is set. + */ + @java.lang.Override + public boolean hasRevokeExistingRoles() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Specifies whether to revoke existing roles that are not present
+   * in the `database_roles` field. If `false` or unset, the database roles
+   * specified in `database_roles` are added to the user's existing roles.
+   * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The revokeExistingRoles. + */ + @java.lang.Override + public boolean getRevokeExistingRoles() { + return revokeExistingRoles_; + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1.User body_; + + /** + * .google.cloud.sql.v1.User body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.cloud.sql.v1.User body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1.User getBody() { + return body_ == null ? com.google.cloud.sql.v1.User.getDefaultInstance() : body_; + } + + /** .google.cloud.sql.v1.User body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1.UserOrBuilder getBodyOrBuilder() { + return body_ == null ? com.google.cloud.sql.v1.User.getDefaultInstance() : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(host_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, host_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, project_); + } + for (int i = 0; i < databaseRoles_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, databaseRoles_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(6, revokeExistingRoles_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, host_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, project_); + } + { + int dataSize = 0; + for (int i = 0; i < databaseRoles_.size(); i++) { + dataSize += computeStringSizeNoTag(databaseRoles_.getRaw(i)); + } + size += dataSize; + size += 1 * getDatabaseRolesList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, revokeExistingRoles_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SqlUsersUpdateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SqlUsersUpdateRequest other = + (com.google.cloud.sql.v1.SqlUsersUpdateRequest) obj; + + if (!getHost().equals(other.getHost())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getName().equals(other.getName())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getDatabaseRolesList().equals(other.getDatabaseRolesList())) return false; + if (hasRevokeExistingRoles() != other.hasRevokeExistingRoles()) return false; + if (hasRevokeExistingRoles()) { + if (getRevokeExistingRoles() != other.getRevokeExistingRoles()) return false; + } + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (getDatabaseRolesCount() > 0) { + hash = (37 * hash) + DATABASE_ROLES_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseRolesList().hashCode(); + } + if (hasRevokeExistingRoles()) { + hash = (37 * hash) + REVOKE_EXISTING_ROLES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRevokeExistingRoles()); + } + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SqlUsersUpdateRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersUpdateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersUpdateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersUpdateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersUpdateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SqlUsersUpdateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersUpdateRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersUpdateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersUpdateRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersUpdateRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SqlUsersUpdateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SqlUsersUpdateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SqlUsersUpdateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1.SqlUsersUpdateRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SqlUsersUpdateRequest) + com.google.cloud.sql.v1.SqlUsersUpdateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersUpdateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersUpdateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SqlUsersUpdateRequest.class, + com.google.cloud.sql.v1.SqlUsersUpdateRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SqlUsersUpdateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + host_ = ""; + instance_ = ""; + name_ = ""; + project_ = ""; + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + revokeExistingRoles_ = false; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_SqlUsersUpdateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersUpdateRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SqlUsersUpdateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersUpdateRequest build() { + com.google.cloud.sql.v1.SqlUsersUpdateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersUpdateRequest buildPartial() { + com.google.cloud.sql.v1.SqlUsersUpdateRequest result = + new com.google.cloud.sql.v1.SqlUsersUpdateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SqlUsersUpdateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.host_ = host_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + databaseRoles_.makeImmutable(); + result.databaseRoles_ = databaseRoles_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.revokeExistingRoles_ = revokeExistingRoles_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SqlUsersUpdateRequest) { + return mergeFrom((com.google.cloud.sql.v1.SqlUsersUpdateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SqlUsersUpdateRequest other) { + if (other == com.google.cloud.sql.v1.SqlUsersUpdateRequest.getDefaultInstance()) return this; + if (!other.getHost().isEmpty()) { + host_ = other.host_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.databaseRoles_.isEmpty()) { + if (databaseRoles_.isEmpty()) { + databaseRoles_ = other.databaseRoles_; + bitField0_ |= 0x00000010; + } else { + ensureDatabaseRolesIsMutable(); + databaseRoles_.addAll(other.databaseRoles_); + } + onChanged(); + } + if (other.hasRevokeExistingRoles()) { + setRevokeExistingRoles(other.getRevokeExistingRoles()); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + host_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(s); + break; + } // case 42 + case 48: + { + revokeExistingRoles_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 host_ = ""; + + /** + * + * + *
+     * Optional. Host of the user in the instance.
+     * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The host. + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Host of the user in the instance.
+     * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for host. + */ + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Host of the user in the instance.
+     * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The host to set. + * @return This builder for chaining. + */ + public Builder setHost(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + host_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Host of the user in the instance.
+     * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearHost() { + host_ = getDefaultInstance().getHost(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Host of the user in the instance.
+     * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for host to set. + * @return This builder for chaining. + */ + public Builder setHostBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + host_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList databaseRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDatabaseRolesIsMutable() { + if (!databaseRoles_.isModifiable()) { + databaseRoles_ = new com.google.protobuf.LazyStringArrayList(databaseRoles_); + } + bitField0_ |= 0x00000010; + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + public com.google.protobuf.ProtocolStringList getDatabaseRolesList() { + databaseRoles_.makeImmutable(); + return databaseRoles_; + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + public int getDatabaseRolesCount() { + return databaseRoles_.size(); + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + public java.lang.String getDatabaseRoles(int index) { + return databaseRoles_.get(index); + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + public com.google.protobuf.ByteString getDatabaseRolesBytes(int index) { + return databaseRoles_.getByteString(index); + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The databaseRoles to set. + * @return This builder for chaining. + */ + public Builder setDatabaseRoles(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseRolesIsMutable(); + databaseRoles_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addDatabaseRoles(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addAllDatabaseRoles(java.lang.Iterable values) { + ensureDatabaseRolesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, databaseRoles_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseRoles() { + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addDatabaseRolesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean revokeExistingRoles_; + + /** + * + * + *
+     * Optional. Specifies whether to revoke existing roles that are not present
+     * in the `database_roles` field. If `false` or unset, the database roles
+     * specified in `database_roles` are added to the user's existing roles.
+     * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the revokeExistingRoles field is set. + */ + @java.lang.Override + public boolean hasRevokeExistingRoles() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. Specifies whether to revoke existing roles that are not present
+     * in the `database_roles` field. If `false` or unset, the database roles
+     * specified in `database_roles` are added to the user's existing roles.
+     * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The revokeExistingRoles. + */ + @java.lang.Override + public boolean getRevokeExistingRoles() { + return revokeExistingRoles_; + } + + /** + * + * + *
+     * Optional. Specifies whether to revoke existing roles that are not present
+     * in the `database_roles` field. If `false` or unset, the database roles
+     * specified in `database_roles` are added to the user's existing roles.
+     * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The revokeExistingRoles to set. + * @return This builder for chaining. + */ + public Builder setRevokeExistingRoles(boolean value) { + + revokeExistingRoles_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies whether to revoke existing roles that are not present
+     * in the `database_roles` field. If `false` or unset, the database roles
+     * specified in `database_roles` are added to the user's existing roles.
+     * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRevokeExistingRoles() { + bitField0_ = (bitField0_ & ~0x00000020); + revokeExistingRoles_ = false; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.User body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.User, + com.google.cloud.sql.v1.User.Builder, + com.google.cloud.sql.v1.UserOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1.User body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * .google.cloud.sql.v1.User body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1.User getBody() { + if (bodyBuilder_ == null) { + return body_ == null ? com.google.cloud.sql.v1.User.getDefaultInstance() : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1.User body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.User value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.User body = 100; */ + public Builder setBody(com.google.cloud.sql.v1.User.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.User body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1.User value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1.User.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1.User body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000040); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1.User body = 100; */ + public com.google.cloud.sql.v1.User.Builder getBodyBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.User body = 100; */ + public com.google.cloud.sql.v1.UserOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null ? com.google.cloud.sql.v1.User.getDefaultInstance() : body_; + } + } + + /** .google.cloud.sql.v1.User body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.User, + com.google.cloud.sql.v1.User.Builder, + com.google.cloud.sql.v1.UserOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.User, + com.google.cloud.sql.v1.User.Builder, + com.google.cloud.sql.v1.UserOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SqlUsersUpdateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SqlUsersUpdateRequest) + private static final com.google.cloud.sql.v1.SqlUsersUpdateRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SqlUsersUpdateRequest(); + } + + public static com.google.cloud.sql.v1.SqlUsersUpdateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlUsersUpdateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SqlUsersUpdateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersUpdateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersUpdateRequestOrBuilder.java new file mode 100644 index 000000000000..be06f3fa555a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SqlUsersUpdateRequestOrBuilder.java @@ -0,0 +1,237 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SqlUsersUpdateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SqlUsersUpdateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Host of the user in the instance.
+   * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The host. + */ + java.lang.String getHost(); + + /** + * + * + *
+   * Optional. Host of the user in the instance.
+   * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for host. + */ + com.google.protobuf.ByteString getHostBytes(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + java.util.List getDatabaseRolesList(); + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + int getDatabaseRolesCount(); + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + java.lang.String getDatabaseRoles(int index); + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + com.google.protobuf.ByteString getDatabaseRolesBytes(int index); + + /** + * + * + *
+   * Optional. Specifies whether to revoke existing roles that are not present
+   * in the `database_roles` field. If `false` or unset, the database roles
+   * specified in `database_roles` are added to the user's existing roles.
+   * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the revokeExistingRoles field is set. + */ + boolean hasRevokeExistingRoles(); + + /** + * + * + *
+   * Optional. Specifies whether to revoke existing roles that are not present
+   * in the `database_roles` field. If `false` or unset, the database roles
+   * specified in `database_roles` are added to the user's existing roles.
+   * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The revokeExistingRoles. + */ + boolean getRevokeExistingRoles(); + + /** + * .google.cloud.sql.v1.User body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1.User body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1.User getBody(); + + /** .google.cloud.sql.v1.User body = 100; */ + com.google.cloud.sql.v1.UserOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCert.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCert.java new file mode 100644 index 000000000000..73e21313ed3e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCert.java @@ -0,0 +1,2342 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * SslCerts Resource
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SslCert} + */ +@com.google.protobuf.Generated +public final class SslCert extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SslCert) + SslCertOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslCert"); + } + + // Use SslCert.newBuilder() to construct. + private SslCert(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SslCert() { + kind_ = ""; + certSerialNumber_ = ""; + cert_ = ""; + commonName_ = ""; + sha1Fingerprint_ = ""; + instance_ = ""; + selfLink_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SslCert_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SslCert_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SslCert.class, com.google.cloud.sql.v1.SslCert.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#sslCert`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#sslCert`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CERT_SERIAL_NUMBER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object certSerialNumber_ = ""; + + /** + * + * + *
+   * Serial number, as extracted from the certificate.
+   * 
+ * + * string cert_serial_number = 2; + * + * @return The certSerialNumber. + */ + @java.lang.Override + public java.lang.String getCertSerialNumber() { + java.lang.Object ref = certSerialNumber_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certSerialNumber_ = s; + return s; + } + } + + /** + * + * + *
+   * Serial number, as extracted from the certificate.
+   * 
+ * + * string cert_serial_number = 2; + * + * @return The bytes for certSerialNumber. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCertSerialNumberBytes() { + java.lang.Object ref = certSerialNumber_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certSerialNumber_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CERT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object cert_ = ""; + + /** + * + * + *
+   * PEM representation.
+   * 
+ * + * string cert = 3; + * + * @return The cert. + */ + @java.lang.Override + public java.lang.String getCert() { + java.lang.Object ref = cert_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cert_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation.
+   * 
+ * + * string cert = 3; + * + * @return The bytes for cert. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCertBytes() { + java.lang.Object ref = cert_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cert_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * The time when the certificate was created in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time when the certificate was created in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * The time when the certificate was created in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int COMMON_NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object commonName_ = ""; + + /** + * + * + *
+   * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+   * 
+ * + * string common_name = 5; + * + * @return The commonName. + */ + @java.lang.Override + public java.lang.String getCommonName() { + java.lang.Object ref = commonName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + commonName_ = s; + return s; + } + } + + /** + * + * + *
+   * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+   * 
+ * + * string common_name = 5; + * + * @return The bytes for commonName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCommonNameBytes() { + java.lang.Object ref = commonName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + commonName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRATION_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp expirationTime_; + + /** + * + * + *
+   * The time when the certificate expires in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + * + * @return Whether the expirationTime field is set. + */ + @java.lang.Override + public boolean hasExpirationTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time when the certificate expires in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + * + * @return The expirationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpirationTime() { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + + /** + * + * + *
+   * The time when the certificate expires in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder() { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + + public static final int SHA1_FINGERPRINT_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object sha1Fingerprint_ = ""; + + /** + * + * + *
+   * Sha1 Fingerprint.
+   * 
+ * + * string sha1_fingerprint = 7; + * + * @return The sha1Fingerprint. + */ + @java.lang.Override + public java.lang.String getSha1Fingerprint() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sha1Fingerprint_ = s; + return s; + } + } + + /** + * + * + *
+   * Sha1 Fingerprint.
+   * 
+ * + * string sha1_fingerprint = 7; + * + * @return The bytes for sha1Fingerprint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSha1FingerprintBytes() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sha1Fingerprint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 8; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 8; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELF_LINK_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object selfLink_ = ""; + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 9; + * + * @return The selfLink. + */ + @java.lang.Override + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } + } + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 9; + * + * @return The bytes for selfLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(certSerialNumber_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, certSerialNumber_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cert_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, cert_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(commonName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, commonName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getExpirationTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sha1Fingerprint_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, sha1Fingerprint_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, selfLink_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(certSerialNumber_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, certSerialNumber_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cert_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, cert_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(commonName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, commonName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getExpirationTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sha1Fingerprint_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, sha1Fingerprint_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, selfLink_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SslCert)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SslCert other = (com.google.cloud.sql.v1.SslCert) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getCertSerialNumber().equals(other.getCertSerialNumber())) return false; + if (!getCert().equals(other.getCert())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getCommonName().equals(other.getCommonName())) return false; + if (hasExpirationTime() != other.hasExpirationTime()) return false; + if (hasExpirationTime()) { + if (!getExpirationTime().equals(other.getExpirationTime())) return false; + } + if (!getSha1Fingerprint().equals(other.getSha1Fingerprint())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getSelfLink().equals(other.getSelfLink())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + CERT_SERIAL_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getCertSerialNumber().hashCode(); + hash = (37 * hash) + CERT_FIELD_NUMBER; + hash = (53 * hash) + getCert().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + COMMON_NAME_FIELD_NUMBER; + hash = (53 * hash) + getCommonName().hashCode(); + if (hasExpirationTime()) { + hash = (37 * hash) + EXPIRATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpirationTime().hashCode(); + } + hash = (37 * hash) + SHA1_FINGERPRINT_FIELD_NUMBER; + hash = (53 * hash) + getSha1Fingerprint().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + SELF_LINK_FIELD_NUMBER; + hash = (53 * hash) + getSelfLink().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SslCert parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCert parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCert parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCert parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCert parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCert parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCert parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCert parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCert parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCert parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCert parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCert parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SslCert prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SslCerts Resource
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SslCert} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SslCert) + com.google.cloud.sql.v1.SslCertOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SslCert_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SslCert_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SslCert.class, com.google.cloud.sql.v1.SslCert.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SslCert.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + internalGetExpirationTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + certSerialNumber_ = ""; + cert_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + commonName_ = ""; + expirationTime_ = null; + if (expirationTimeBuilder_ != null) { + expirationTimeBuilder_.dispose(); + expirationTimeBuilder_ = null; + } + sha1Fingerprint_ = ""; + instance_ = ""; + selfLink_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SslCert_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCert getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SslCert.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCert build() { + com.google.cloud.sql.v1.SslCert result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCert buildPartial() { + com.google.cloud.sql.v1.SslCert result = new com.google.cloud.sql.v1.SslCert(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SslCert result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.certSerialNumber_ = certSerialNumber_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cert_ = cert_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.commonName_ = commonName_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.expirationTime_ = + expirationTimeBuilder_ == null ? expirationTime_ : expirationTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.sha1Fingerprint_ = sha1Fingerprint_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.selfLink_ = selfLink_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SslCert) { + return mergeFrom((com.google.cloud.sql.v1.SslCert) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SslCert other) { + if (other == com.google.cloud.sql.v1.SslCert.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getCertSerialNumber().isEmpty()) { + certSerialNumber_ = other.certSerialNumber_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getCert().isEmpty()) { + cert_ = other.cert_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.getCommonName().isEmpty()) { + commonName_ = other.commonName_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasExpirationTime()) { + mergeExpirationTime(other.getExpirationTime()); + } + if (!other.getSha1Fingerprint().isEmpty()) { + sha1Fingerprint_ = other.sha1Fingerprint_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (!other.getSelfLink().isEmpty()) { + selfLink_ = other.selfLink_; + bitField0_ |= 0x00000100; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + certSerialNumber_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + cert_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + commonName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetExpirationTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + sha1Fingerprint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + selfLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#sslCert`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#sslCert`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#sslCert`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#sslCert`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#sslCert`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object certSerialNumber_ = ""; + + /** + * + * + *
+     * Serial number, as extracted from the certificate.
+     * 
+ * + * string cert_serial_number = 2; + * + * @return The certSerialNumber. + */ + public java.lang.String getCertSerialNumber() { + java.lang.Object ref = certSerialNumber_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certSerialNumber_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Serial number, as extracted from the certificate.
+     * 
+ * + * string cert_serial_number = 2; + * + * @return The bytes for certSerialNumber. + */ + public com.google.protobuf.ByteString getCertSerialNumberBytes() { + java.lang.Object ref = certSerialNumber_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certSerialNumber_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Serial number, as extracted from the certificate.
+     * 
+ * + * string cert_serial_number = 2; + * + * @param value The certSerialNumber to set. + * @return This builder for chaining. + */ + public Builder setCertSerialNumber(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + certSerialNumber_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Serial number, as extracted from the certificate.
+     * 
+ * + * string cert_serial_number = 2; + * + * @return This builder for chaining. + */ + public Builder clearCertSerialNumber() { + certSerialNumber_ = getDefaultInstance().getCertSerialNumber(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Serial number, as extracted from the certificate.
+     * 
+ * + * string cert_serial_number = 2; + * + * @param value The bytes for certSerialNumber to set. + * @return This builder for chaining. + */ + public Builder setCertSerialNumberBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + certSerialNumber_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object cert_ = ""; + + /** + * + * + *
+     * PEM representation.
+     * 
+ * + * string cert = 3; + * + * @return The cert. + */ + public java.lang.String getCert() { + java.lang.Object ref = cert_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cert_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation.
+     * 
+ * + * string cert = 3; + * + * @return The bytes for cert. + */ + public com.google.protobuf.ByteString getCertBytes() { + java.lang.Object ref = cert_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cert_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation.
+     * 
+ * + * string cert = 3; + * + * @param value The cert to set. + * @return This builder for chaining. + */ + public Builder setCert(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + cert_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation.
+     * 
+ * + * string cert = 3; + * + * @return This builder for chaining. + */ + public Builder clearCert() { + cert_ = getDefaultInstance().getCert(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation.
+     * 
+ * + * string cert = 3; + * + * @param value The bytes for cert to set. + * @return This builder for chaining. + */ + public Builder setCertBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + cert_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * The time when the certificate was created in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * The time when the certificate was created in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @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(); + } + } + + /** + * + * + *
+     * The time when the certificate was created in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the certificate was created in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the certificate was created in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time when the certificate was created in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the certificate was created in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time when the certificate was created in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * The time when the certificate was created in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private java.lang.Object commonName_ = ""; + + /** + * + * + *
+     * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+     * 
+ * + * string common_name = 5; + * + * @return The commonName. + */ + public java.lang.String getCommonName() { + java.lang.Object ref = commonName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + commonName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+     * 
+ * + * string common_name = 5; + * + * @return The bytes for commonName. + */ + public com.google.protobuf.ByteString getCommonNameBytes() { + java.lang.Object ref = commonName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + commonName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+     * 
+ * + * string common_name = 5; + * + * @param value The commonName to set. + * @return This builder for chaining. + */ + public Builder setCommonName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + commonName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+     * 
+ * + * string common_name = 5; + * + * @return This builder for chaining. + */ + public Builder clearCommonName() { + commonName_ = getDefaultInstance().getCommonName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+     * 
+ * + * string common_name = 5; + * + * @param value The bytes for commonName to set. + * @return This builder for chaining. + */ + public Builder setCommonNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + commonName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expirationTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expirationTimeBuilder_; + + /** + * + * + *
+     * The time when the certificate expires in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + * + * @return Whether the expirationTime field is set. + */ + public boolean hasExpirationTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * The time when the certificate expires in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + * + * @return The expirationTime. + */ + public com.google.protobuf.Timestamp getExpirationTime() { + if (expirationTimeBuilder_ == null) { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } else { + return expirationTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time when the certificate expires in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public Builder setExpirationTime(com.google.protobuf.Timestamp value) { + if (expirationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expirationTime_ = value; + } else { + expirationTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the certificate expires in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public Builder setExpirationTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expirationTimeBuilder_ == null) { + expirationTime_ = builderForValue.build(); + } else { + expirationTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the certificate expires in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public Builder mergeExpirationTime(com.google.protobuf.Timestamp value) { + if (expirationTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && expirationTime_ != null + && expirationTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpirationTimeBuilder().mergeFrom(value); + } else { + expirationTime_ = value; + } + } else { + expirationTimeBuilder_.mergeFrom(value); + } + if (expirationTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time when the certificate expires in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public Builder clearExpirationTime() { + bitField0_ = (bitField0_ & ~0x00000020); + expirationTime_ = null; + if (expirationTimeBuilder_ != null) { + expirationTimeBuilder_.dispose(); + expirationTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the certificate expires in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getExpirationTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetExpirationTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time when the certificate expires in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder() { + if (expirationTimeBuilder_ != null) { + return expirationTimeBuilder_.getMessageOrBuilder(); + } else { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + } + + /** + * + * + *
+     * The time when the certificate expires in [RFC
+     * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExpirationTimeFieldBuilder() { + if (expirationTimeBuilder_ == null) { + expirationTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpirationTime(), getParentForChildren(), isClean()); + expirationTime_ = null; + } + return expirationTimeBuilder_; + } + + private java.lang.Object sha1Fingerprint_ = ""; + + /** + * + * + *
+     * Sha1 Fingerprint.
+     * 
+ * + * string sha1_fingerprint = 7; + * + * @return The sha1Fingerprint. + */ + public java.lang.String getSha1Fingerprint() { + java.lang.Object ref = sha1Fingerprint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sha1Fingerprint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Sha1 Fingerprint.
+     * 
+ * + * string sha1_fingerprint = 7; + * + * @return The bytes for sha1Fingerprint. + */ + public com.google.protobuf.ByteString getSha1FingerprintBytes() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sha1Fingerprint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Sha1 Fingerprint.
+     * 
+ * + * string sha1_fingerprint = 7; + * + * @param value The sha1Fingerprint to set. + * @return This builder for chaining. + */ + public Builder setSha1Fingerprint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sha1Fingerprint_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Sha1 Fingerprint.
+     * 
+ * + * string sha1_fingerprint = 7; + * + * @return This builder for chaining. + */ + public Builder clearSha1Fingerprint() { + sha1Fingerprint_ = getDefaultInstance().getSha1Fingerprint(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * Sha1 Fingerprint.
+     * 
+ * + * string sha1_fingerprint = 7; + * + * @param value The bytes for sha1Fingerprint to set. + * @return This builder for chaining. + */ + public Builder setSha1FingerprintBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sha1Fingerprint_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 8; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 8; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 8; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 8; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 8; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object selfLink_ = ""; + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 9; + * + * @return The selfLink. + */ + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 9; + * + * @return The bytes for selfLink. + */ + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 9; + * + * @param value The selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selfLink_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 9; + * + * @return This builder for chaining. + */ + public Builder clearSelfLink() { + selfLink_ = getDefaultInstance().getSelfLink(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 9; + * + * @param value The bytes for selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selfLink_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SslCert) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SslCert) + private static final com.google.cloud.sql.v1.SslCert DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SslCert(); + } + + public static com.google.cloud.sql.v1.SslCert getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslCert parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCert getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertDetail.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertDetail.java new file mode 100644 index 000000000000..1921490e2fee --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertDetail.java @@ -0,0 +1,884 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * SslCertDetail.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SslCertDetail} + */ +@com.google.protobuf.Generated +public final class SslCertDetail extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SslCertDetail) + SslCertDetailOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslCertDetail"); + } + + // Use SslCertDetail.newBuilder() to construct. + private SslCertDetail(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SslCertDetail() { + certPrivateKey_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SslCertDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SslCertDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SslCertDetail.class, + com.google.cloud.sql.v1.SslCertDetail.Builder.class); + } + + private int bitField0_; + public static final int CERT_INFO_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.SslCert certInfo_; + + /** + * + * + *
+   * The public information about the cert.
+   * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + * + * @return Whether the certInfo field is set. + */ + @java.lang.Override + public boolean hasCertInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The public information about the cert.
+   * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + * + * @return The certInfo. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCert getCertInfo() { + return certInfo_ == null ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() : certInfo_; + } + + /** + * + * + *
+   * The public information about the cert.
+   * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertOrBuilder getCertInfoOrBuilder() { + return certInfo_ == null ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() : certInfo_; + } + + public static final int CERT_PRIVATE_KEY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object certPrivateKey_ = ""; + + /** + * + * + *
+   * The private key for the client cert, in pem format.  Keep private in order
+   * to protect your security.
+   * 
+ * + * string cert_private_key = 2; + * + * @return The certPrivateKey. + */ + @java.lang.Override + public java.lang.String getCertPrivateKey() { + java.lang.Object ref = certPrivateKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certPrivateKey_ = s; + return s; + } + } + + /** + * + * + *
+   * The private key for the client cert, in pem format.  Keep private in order
+   * to protect your security.
+   * 
+ * + * string cert_private_key = 2; + * + * @return The bytes for certPrivateKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCertPrivateKeyBytes() { + java.lang.Object ref = certPrivateKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certPrivateKey_ = 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, getCertInfo()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(certPrivateKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, certPrivateKey_); + } + 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, getCertInfo()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(certPrivateKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, certPrivateKey_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SslCertDetail)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SslCertDetail other = (com.google.cloud.sql.v1.SslCertDetail) obj; + + if (hasCertInfo() != other.hasCertInfo()) return false; + if (hasCertInfo()) { + if (!getCertInfo().equals(other.getCertInfo())) return false; + } + if (!getCertPrivateKey().equals(other.getCertPrivateKey())) return false; + if (!getUnknownFields().equals(other.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 (hasCertInfo()) { + hash = (37 * hash) + CERT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getCertInfo().hashCode(); + } + hash = (37 * hash) + CERT_PRIVATE_KEY_FIELD_NUMBER; + hash = (53 * hash) + getCertPrivateKey().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SslCertDetail parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertDetail parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertDetail parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertDetail parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertDetail parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertDetail parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertDetail parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertDetail parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertDetail parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SslCertDetail prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SslCertDetail.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SslCertDetail} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SslCertDetail) + com.google.cloud.sql.v1.SslCertDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SslCertDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SslCertDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SslCertDetail.class, + com.google.cloud.sql.v1.SslCertDetail.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SslCertDetail.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCertInfoFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + certInfo_ = null; + if (certInfoBuilder_ != null) { + certInfoBuilder_.dispose(); + certInfoBuilder_ = null; + } + certPrivateKey_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SslCertDetail_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertDetail getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SslCertDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertDetail build() { + com.google.cloud.sql.v1.SslCertDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertDetail buildPartial() { + com.google.cloud.sql.v1.SslCertDetail result = + new com.google.cloud.sql.v1.SslCertDetail(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SslCertDetail result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.certInfo_ = certInfoBuilder_ == null ? certInfo_ : certInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.certPrivateKey_ = certPrivateKey_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SslCertDetail) { + return mergeFrom((com.google.cloud.sql.v1.SslCertDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SslCertDetail other) { + if (other == com.google.cloud.sql.v1.SslCertDetail.getDefaultInstance()) return this; + if (other.hasCertInfo()) { + mergeCertInfo(other.getCertInfo()); + } + if (!other.getCertPrivateKey().isEmpty()) { + certPrivateKey_ = other.certPrivateKey_; + 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: + { + input.readMessage( + internalGetCertInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + certPrivateKey_ = 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 com.google.cloud.sql.v1.SslCert certInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + certInfoBuilder_; + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + * + * @return Whether the certInfo field is set. + */ + public boolean hasCertInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + * + * @return The certInfo. + */ + public com.google.cloud.sql.v1.SslCert getCertInfo() { + if (certInfoBuilder_ == null) { + return certInfo_ == null ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() : certInfo_; + } else { + return certInfoBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + */ + public Builder setCertInfo(com.google.cloud.sql.v1.SslCert value) { + if (certInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + certInfo_ = value; + } else { + certInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + */ + public Builder setCertInfo(com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (certInfoBuilder_ == null) { + certInfo_ = builderForValue.build(); + } else { + certInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + */ + public Builder mergeCertInfo(com.google.cloud.sql.v1.SslCert value) { + if (certInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && certInfo_ != null + && certInfo_ != com.google.cloud.sql.v1.SslCert.getDefaultInstance()) { + getCertInfoBuilder().mergeFrom(value); + } else { + certInfo_ = value; + } + } else { + certInfoBuilder_.mergeFrom(value); + } + if (certInfo_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + */ + public Builder clearCertInfo() { + bitField0_ = (bitField0_ & ~0x00000001); + certInfo_ = null; + if (certInfoBuilder_ != null) { + certInfoBuilder_.dispose(); + certInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + */ + public com.google.cloud.sql.v1.SslCert.Builder getCertInfoBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetCertInfoFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + */ + public com.google.cloud.sql.v1.SslCertOrBuilder getCertInfoOrBuilder() { + if (certInfoBuilder_ != null) { + return certInfoBuilder_.getMessageOrBuilder(); + } else { + return certInfo_ == null ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() : certInfo_; + } + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + internalGetCertInfoFieldBuilder() { + if (certInfoBuilder_ == null) { + certInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder>( + getCertInfo(), getParentForChildren(), isClean()); + certInfo_ = null; + } + return certInfoBuilder_; + } + + private java.lang.Object certPrivateKey_ = ""; + + /** + * + * + *
+     * The private key for the client cert, in pem format.  Keep private in order
+     * to protect your security.
+     * 
+ * + * string cert_private_key = 2; + * + * @return The certPrivateKey. + */ + public java.lang.String getCertPrivateKey() { + java.lang.Object ref = certPrivateKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certPrivateKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The private key for the client cert, in pem format.  Keep private in order
+     * to protect your security.
+     * 
+ * + * string cert_private_key = 2; + * + * @return The bytes for certPrivateKey. + */ + public com.google.protobuf.ByteString getCertPrivateKeyBytes() { + java.lang.Object ref = certPrivateKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certPrivateKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The private key for the client cert, in pem format.  Keep private in order
+     * to protect your security.
+     * 
+ * + * string cert_private_key = 2; + * + * @param value The certPrivateKey to set. + * @return This builder for chaining. + */ + public Builder setCertPrivateKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + certPrivateKey_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The private key for the client cert, in pem format.  Keep private in order
+     * to protect your security.
+     * 
+ * + * string cert_private_key = 2; + * + * @return This builder for chaining. + */ + public Builder clearCertPrivateKey() { + certPrivateKey_ = getDefaultInstance().getCertPrivateKey(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The private key for the client cert, in pem format.  Keep private in order
+     * to protect your security.
+     * 
+ * + * string cert_private_key = 2; + * + * @param value The bytes for certPrivateKey to set. + * @return This builder for chaining. + */ + public Builder setCertPrivateKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + certPrivateKey_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SslCertDetail) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SslCertDetail) + private static final com.google.cloud.sql.v1.SslCertDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SslCertDetail(); + } + + public static com.google.cloud.sql.v1.SslCertDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslCertDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertDetailOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertDetailOrBuilder.java new file mode 100644 index 000000000000..8e0f01f1292f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertDetailOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SslCertDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SslCertDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The public information about the cert.
+   * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + * + * @return Whether the certInfo field is set. + */ + boolean hasCertInfo(); + + /** + * + * + *
+   * The public information about the cert.
+   * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + * + * @return The certInfo. + */ + com.google.cloud.sql.v1.SslCert getCertInfo(); + + /** + * + * + *
+   * The public information about the cert.
+   * 
+ * + * .google.cloud.sql.v1.SslCert cert_info = 1; + */ + com.google.cloud.sql.v1.SslCertOrBuilder getCertInfoOrBuilder(); + + /** + * + * + *
+   * The private key for the client cert, in pem format.  Keep private in order
+   * to protect your security.
+   * 
+ * + * string cert_private_key = 2; + * + * @return The certPrivateKey. + */ + java.lang.String getCertPrivateKey(); + + /** + * + * + *
+   * The private key for the client cert, in pem format.  Keep private in order
+   * to protect your security.
+   * 
+ * + * string cert_private_key = 2; + * + * @return The bytes for certPrivateKey. + */ + com.google.protobuf.ByteString getCertPrivateKeyBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertOrBuilder.java new file mode 100644 index 000000000000..58bac77c5c51 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertOrBuilder.java @@ -0,0 +1,296 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SslCertOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SslCert) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#sslCert`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#sslCert`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Serial number, as extracted from the certificate.
+   * 
+ * + * string cert_serial_number = 2; + * + * @return The certSerialNumber. + */ + java.lang.String getCertSerialNumber(); + + /** + * + * + *
+   * Serial number, as extracted from the certificate.
+   * 
+ * + * string cert_serial_number = 2; + * + * @return The bytes for certSerialNumber. + */ + com.google.protobuf.ByteString getCertSerialNumberBytes(); + + /** + * + * + *
+   * PEM representation.
+   * 
+ * + * string cert = 3; + * + * @return The cert. + */ + java.lang.String getCert(); + + /** + * + * + *
+   * PEM representation.
+   * 
+ * + * string cert = 3; + * + * @return The bytes for cert. + */ + com.google.protobuf.ByteString getCertBytes(); + + /** + * + * + *
+   * The time when the certificate was created in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * The time when the certificate was created in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * The time when the certificate was created in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+   * 
+ * + * string common_name = 5; + * + * @return The commonName. + */ + java.lang.String getCommonName(); + + /** + * + * + *
+   * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+   * 
+ * + * string common_name = 5; + * + * @return The bytes for commonName. + */ + com.google.protobuf.ByteString getCommonNameBytes(); + + /** + * + * + *
+   * The time when the certificate expires in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + * + * @return Whether the expirationTime field is set. + */ + boolean hasExpirationTime(); + + /** + * + * + *
+   * The time when the certificate expires in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + * + * @return The expirationTime. + */ + com.google.protobuf.Timestamp getExpirationTime(); + + /** + * + * + *
+   * The time when the certificate expires in [RFC
+   * 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder(); + + /** + * + * + *
+   * Sha1 Fingerprint.
+   * 
+ * + * string sha1_fingerprint = 7; + * + * @return The sha1Fingerprint. + */ + java.lang.String getSha1Fingerprint(); + + /** + * + * + *
+   * Sha1 Fingerprint.
+   * 
+ * + * string sha1_fingerprint = 7; + * + * @return The bytes for sha1Fingerprint. + */ + com.google.protobuf.ByteString getSha1FingerprintBytes(); + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 8; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 8; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 9; + * + * @return The selfLink. + */ + java.lang.String getSelfLink(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 9; + * + * @return The bytes for selfLink. + */ + com.google.protobuf.ByteString getSelfLinkBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsCreateEphemeralRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsCreateEphemeralRequest.java new file mode 100644 index 000000000000..a66941049daf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsCreateEphemeralRequest.java @@ -0,0 +1,786 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * SslCerts create ephemeral certificate request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SslCertsCreateEphemeralRequest} + */ +@com.google.protobuf.Generated +public final class SslCertsCreateEphemeralRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SslCertsCreateEphemeralRequest) + SslCertsCreateEphemeralRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslCertsCreateEphemeralRequest"); + } + + // Use SslCertsCreateEphemeralRequest.newBuilder() to construct. + private SslCertsCreateEphemeralRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SslCertsCreateEphemeralRequest() { + publicKey_ = ""; + accessToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SslCertsCreateEphemeralRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SslCertsCreateEphemeralRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.class, + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.Builder.class); + } + + public static final int PUBLIC_KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object publicKey_ = ""; + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @return The publicKey. + */ + @java.lang.Override + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @return The bytes for publicKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACCESS_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object accessToken_ = ""; + + /** + * + * + *
+   * Access token to include in the signed certificate.
+   * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @return The accessToken. + */ + @java.lang.Override + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Access token to include in the signed certificate.
+   * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @return The bytes for accessToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = 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.GeneratedMessage.isStringEmpty(publicKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, publicKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(accessToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, accessToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(publicKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, publicKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(accessToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, accessToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest other = + (com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest) obj; + + if (!getPublicKey().equals(other.getPublicKey())) return false; + if (!getAccessToken().equals(other.getAccessToken())) return false; + if (!getUnknownFields().equals(other.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) + PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getPublicKey().hashCode(); + hash = (37 * hash) + ACCESS_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAccessToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SslCerts create ephemeral certificate request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SslCertsCreateEphemeralRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SslCertsCreateEphemeralRequest) + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SslCertsCreateEphemeralRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SslCertsCreateEphemeralRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.class, + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + publicKey_ = ""; + accessToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_SslCertsCreateEphemeralRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest build() { + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest buildPartial() { + com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest result = + new com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.publicKey_ = publicKey_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.accessToken_ = accessToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest) { + return mergeFrom((com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest other) { + if (other == com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.getDefaultInstance()) + return this; + if (!other.getPublicKey().isEmpty()) { + publicKey_ = other.publicKey_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAccessToken().isEmpty()) { + accessToken_ = other.accessToken_; + 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: + { + publicKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + accessToken_ = 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 publicKey_ = ""; + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @return The publicKey. + */ + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @return The bytes for publicKey. + */ + public com.google.protobuf.ByteString getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @param value The publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + publicKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @return This builder for chaining. + */ + public Builder clearPublicKey() { + publicKey_ = getDefaultInstance().getPublicKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @param value The bytes for publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + publicKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object accessToken_ = ""; + + /** + * + * + *
+     * Access token to include in the signed certificate.
+     * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @return The accessToken. + */ + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Access token to include in the signed certificate.
+     * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @return The bytes for accessToken. + */ + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Access token to include in the signed certificate.
+     * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @param value The accessToken to set. + * @return This builder for chaining. + */ + public Builder setAccessToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + accessToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Access token to include in the signed certificate.
+     * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @return This builder for chaining. + */ + public Builder clearAccessToken() { + accessToken_ = getDefaultInstance().getAccessToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Access token to include in the signed certificate.
+     * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @param value The bytes for accessToken to set. + * @return This builder for chaining. + */ + public Builder setAccessTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + accessToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SslCertsCreateEphemeralRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SslCertsCreateEphemeralRequest) + private static final com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest(); + } + + public static com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslCertsCreateEphemeralRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsCreateEphemeralRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsCreateEphemeralRequestOrBuilder.java new file mode 100644 index 000000000000..c9b51900fbbb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsCreateEphemeralRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SslCertsCreateEphemeralRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SslCertsCreateEphemeralRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @return The publicKey. + */ + java.lang.String getPublicKey(); + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @return The bytes for publicKey. + */ + com.google.protobuf.ByteString getPublicKeyBytes(); + + /** + * + * + *
+   * Access token to include in the signed certificate.
+   * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @return The accessToken. + */ + java.lang.String getAccessToken(); + + /** + * + * + *
+   * Access token to include in the signed certificate.
+   * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @return The bytes for accessToken. + */ + com.google.protobuf.ByteString getAccessTokenBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsInsertRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsInsertRequest.java new file mode 100644 index 000000000000..91d3a77f8bc2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsInsertRequest.java @@ -0,0 +1,602 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * SslCerts insert request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SslCertsInsertRequest} + */ +@com.google.protobuf.Generated +public final class SslCertsInsertRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SslCertsInsertRequest) + SslCertsInsertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslCertsInsertRequest"); + } + + // Use SslCertsInsertRequest.newBuilder() to construct. + private SslCertsInsertRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SslCertsInsertRequest() { + commonName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SslCertsInsertRequest.class, + com.google.cloud.sql.v1.SslCertsInsertRequest.Builder.class); + } + + public static final int COMMON_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object commonName_ = ""; + + /** + * + * + *
+   * User supplied name.  Must be a distinct name from the other certificates
+   * for this instance.
+   * 
+ * + * string common_name = 1; + * + * @return The commonName. + */ + @java.lang.Override + public java.lang.String getCommonName() { + java.lang.Object ref = commonName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + commonName_ = s; + return s; + } + } + + /** + * + * + *
+   * User supplied name.  Must be a distinct name from the other certificates
+   * for this instance.
+   * 
+ * + * string common_name = 1; + * + * @return The bytes for commonName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCommonNameBytes() { + java.lang.Object ref = commonName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + commonName_ = 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.GeneratedMessage.isStringEmpty(commonName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, commonName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(commonName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, commonName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SslCertsInsertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SslCertsInsertRequest other = + (com.google.cloud.sql.v1.SslCertsInsertRequest) obj; + + if (!getCommonName().equals(other.getCommonName())) return false; + if (!getUnknownFields().equals(other.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) + COMMON_NAME_FIELD_NUMBER; + hash = (53 * hash) + getCommonName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SslCertsInsertRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertsInsertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsInsertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertsInsertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsInsertRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertsInsertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsInsertRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertsInsertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsInsertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertsInsertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertsInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SslCertsInsertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SslCerts insert request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SslCertsInsertRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SslCertsInsertRequest) + com.google.cloud.sql.v1.SslCertsInsertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SslCertsInsertRequest.class, + com.google.cloud.sql.v1.SslCertsInsertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SslCertsInsertRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + commonName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsInsertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsInsertRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SslCertsInsertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsInsertRequest build() { + com.google.cloud.sql.v1.SslCertsInsertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsInsertRequest buildPartial() { + com.google.cloud.sql.v1.SslCertsInsertRequest result = + new com.google.cloud.sql.v1.SslCertsInsertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SslCertsInsertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.commonName_ = commonName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SslCertsInsertRequest) { + return mergeFrom((com.google.cloud.sql.v1.SslCertsInsertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SslCertsInsertRequest other) { + if (other == com.google.cloud.sql.v1.SslCertsInsertRequest.getDefaultInstance()) return this; + if (!other.getCommonName().isEmpty()) { + commonName_ = other.commonName_; + 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: + { + commonName_ = 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 commonName_ = ""; + + /** + * + * + *
+     * User supplied name.  Must be a distinct name from the other certificates
+     * for this instance.
+     * 
+ * + * string common_name = 1; + * + * @return The commonName. + */ + public java.lang.String getCommonName() { + java.lang.Object ref = commonName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + commonName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * User supplied name.  Must be a distinct name from the other certificates
+     * for this instance.
+     * 
+ * + * string common_name = 1; + * + * @return The bytes for commonName. + */ + public com.google.protobuf.ByteString getCommonNameBytes() { + java.lang.Object ref = commonName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + commonName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * User supplied name.  Must be a distinct name from the other certificates
+     * for this instance.
+     * 
+ * + * string common_name = 1; + * + * @param value The commonName to set. + * @return This builder for chaining. + */ + public Builder setCommonName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + commonName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * User supplied name.  Must be a distinct name from the other certificates
+     * for this instance.
+     * 
+ * + * string common_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearCommonName() { + commonName_ = getDefaultInstance().getCommonName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * User supplied name.  Must be a distinct name from the other certificates
+     * for this instance.
+     * 
+ * + * string common_name = 1; + * + * @param value The bytes for commonName to set. + * @return This builder for chaining. + */ + public Builder setCommonNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + commonName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SslCertsInsertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SslCertsInsertRequest) + private static final com.google.cloud.sql.v1.SslCertsInsertRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SslCertsInsertRequest(); + } + + public static com.google.cloud.sql.v1.SslCertsInsertRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslCertsInsertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsInsertRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsInsertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsInsertRequestOrBuilder.java new file mode 100644 index 000000000000..2fcf77d243bb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsInsertRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SslCertsInsertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SslCertsInsertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * User supplied name.  Must be a distinct name from the other certificates
+   * for this instance.
+   * 
+ * + * string common_name = 1; + * + * @return The commonName. + */ + java.lang.String getCommonName(); + + /** + * + * + *
+   * User supplied name.  Must be a distinct name from the other certificates
+   * for this instance.
+   * 
+ * + * string common_name = 1; + * + * @return The bytes for commonName. + */ + com.google.protobuf.ByteString getCommonNameBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsInsertResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsInsertResponse.java new file mode 100644 index 000000000000..f352e53d23aa --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsInsertResponse.java @@ -0,0 +1,1470 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * SslCert insert response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SslCertsInsertResponse} + */ +@com.google.protobuf.Generated +public final class SslCertsInsertResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SslCertsInsertResponse) + SslCertsInsertResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslCertsInsertResponse"); + } + + // Use SslCertsInsertResponse.newBuilder() to construct. + private SslCertsInsertResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SslCertsInsertResponse() { + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsInsertResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsInsertResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SslCertsInsertResponse.class, + com.google.cloud.sql.v1.SslCertsInsertResponse.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#sslCertsInsert`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#sslCertsInsert`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPERATION_FIELD_NUMBER = 2; + private com.google.cloud.sql.v1.Operation operation_; + + /** + * + * + *
+   * The operation to track the ssl certs insert request.
+   * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + * + * @return Whether the operation field is set. + */ + @java.lang.Override + public boolean hasOperation() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The operation to track the ssl certs insert request.
+   * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + * + * @return The operation. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Operation getOperation() { + return operation_ == null ? com.google.cloud.sql.v1.Operation.getDefaultInstance() : operation_; + } + + /** + * + * + *
+   * The operation to track the ssl certs insert request.
+   * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.OperationOrBuilder getOperationOrBuilder() { + return operation_ == null ? com.google.cloud.sql.v1.Operation.getDefaultInstance() : operation_; + } + + public static final int SERVER_CA_CERT_FIELD_NUMBER = 3; + private com.google.cloud.sql.v1.SslCert serverCaCert_; + + /** + * + * + *
+   * The server Certificate Authority's certificate.  If this is missing you can
+   * force a new one to be generated by calling resetSslConfig method on
+   * instances resource.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + * + * @return Whether the serverCaCert field is set. + */ + @java.lang.Override + public boolean hasServerCaCert() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The server Certificate Authority's certificate.  If this is missing you can
+   * force a new one to be generated by calling resetSslConfig method on
+   * instances resource.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + * + * @return The serverCaCert. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCert getServerCaCert() { + return serverCaCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : serverCaCert_; + } + + /** + * + * + *
+   * The server Certificate Authority's certificate.  If this is missing you can
+   * force a new one to be generated by calling resetSslConfig method on
+   * instances resource.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertOrBuilder getServerCaCertOrBuilder() { + return serverCaCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : serverCaCert_; + } + + public static final int CLIENT_CERT_FIELD_NUMBER = 4; + private com.google.cloud.sql.v1.SslCertDetail clientCert_; + + /** + * + * + *
+   * The new client certificate and private key.
+   * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + * + * @return Whether the clientCert field is set. + */ + @java.lang.Override + public boolean hasClientCert() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The new client certificate and private key.
+   * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + * + * @return The clientCert. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertDetail getClientCert() { + return clientCert_ == null + ? com.google.cloud.sql.v1.SslCertDetail.getDefaultInstance() + : clientCert_; + } + + /** + * + * + *
+   * The new client certificate and private key.
+   * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertDetailOrBuilder getClientCertOrBuilder() { + return clientCert_ == null + ? com.google.cloud.sql.v1.SslCertDetail.getDefaultInstance() + : clientCert_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getOperation()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getServerCaCert()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getClientCert()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOperation()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getServerCaCert()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getClientCert()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SslCertsInsertResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SslCertsInsertResponse other = + (com.google.cloud.sql.v1.SslCertsInsertResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (hasOperation() != other.hasOperation()) return false; + if (hasOperation()) { + if (!getOperation().equals(other.getOperation())) return false; + } + if (hasServerCaCert() != other.hasServerCaCert()) return false; + if (hasServerCaCert()) { + if (!getServerCaCert().equals(other.getServerCaCert())) return false; + } + if (hasClientCert() != other.hasClientCert()) return false; + if (hasClientCert()) { + if (!getClientCert().equals(other.getClientCert())) return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasOperation()) { + hash = (37 * hash) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + } + if (hasServerCaCert()) { + hash = (37 * hash) + SERVER_CA_CERT_FIELD_NUMBER; + hash = (53 * hash) + getServerCaCert().hashCode(); + } + if (hasClientCert()) { + hash = (37 * hash) + CLIENT_CERT_FIELD_NUMBER; + hash = (53 * hash) + getClientCert().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SslCertsInsertResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertsInsertResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsInsertResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertsInsertResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsInsertResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertsInsertResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsInsertResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertsInsertResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsInsertResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertsInsertResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsInsertResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertsInsertResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SslCertsInsertResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SslCert insert response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SslCertsInsertResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SslCertsInsertResponse) + com.google.cloud.sql.v1.SslCertsInsertResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsInsertResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsInsertResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SslCertsInsertResponse.class, + com.google.cloud.sql.v1.SslCertsInsertResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SslCertsInsertResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOperationFieldBuilder(); + internalGetServerCaCertFieldBuilder(); + internalGetClientCertFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + operation_ = null; + if (operationBuilder_ != null) { + operationBuilder_.dispose(); + operationBuilder_ = null; + } + serverCaCert_ = null; + if (serverCaCertBuilder_ != null) { + serverCaCertBuilder_.dispose(); + serverCaCertBuilder_ = null; + } + clientCert_ = null; + if (clientCertBuilder_ != null) { + clientCertBuilder_.dispose(); + clientCertBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsInsertResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsInsertResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SslCertsInsertResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsInsertResponse build() { + com.google.cloud.sql.v1.SslCertsInsertResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsInsertResponse buildPartial() { + com.google.cloud.sql.v1.SslCertsInsertResponse result = + new com.google.cloud.sql.v1.SslCertsInsertResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SslCertsInsertResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.operation_ = operationBuilder_ == null ? operation_ : operationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.serverCaCert_ = + serverCaCertBuilder_ == null ? serverCaCert_ : serverCaCertBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.clientCert_ = clientCertBuilder_ == null ? clientCert_ : clientCertBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SslCertsInsertResponse) { + return mergeFrom((com.google.cloud.sql.v1.SslCertsInsertResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SslCertsInsertResponse other) { + if (other == com.google.cloud.sql.v1.SslCertsInsertResponse.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasOperation()) { + mergeOperation(other.getOperation()); + } + if (other.hasServerCaCert()) { + mergeServerCaCert(other.getServerCaCert()); + } + if (other.hasClientCert()) { + mergeClientCert(other.getClientCert()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetOperationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetServerCaCertFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetClientCertFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#sslCertsInsert`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#sslCertsInsert`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#sslCertsInsert`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#sslCertsInsert`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#sslCertsInsert`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.Operation operation_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Operation, + com.google.cloud.sql.v1.Operation.Builder, + com.google.cloud.sql.v1.OperationOrBuilder> + operationBuilder_; + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + * + * @return Whether the operation field is set. + */ + public boolean hasOperation() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + * + * @return The operation. + */ + public com.google.cloud.sql.v1.Operation getOperation() { + if (operationBuilder_ == null) { + return operation_ == null + ? com.google.cloud.sql.v1.Operation.getDefaultInstance() + : operation_; + } else { + return operationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + */ + public Builder setOperation(com.google.cloud.sql.v1.Operation value) { + if (operationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + } else { + operationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + */ + public Builder setOperation(com.google.cloud.sql.v1.Operation.Builder builderForValue) { + if (operationBuilder_ == null) { + operation_ = builderForValue.build(); + } else { + operationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + */ + public Builder mergeOperation(com.google.cloud.sql.v1.Operation value) { + if (operationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && operation_ != null + && operation_ != com.google.cloud.sql.v1.Operation.getDefaultInstance()) { + getOperationBuilder().mergeFrom(value); + } else { + operation_ = value; + } + } else { + operationBuilder_.mergeFrom(value); + } + if (operation_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + */ + public Builder clearOperation() { + bitField0_ = (bitField0_ & ~0x00000002); + operation_ = null; + if (operationBuilder_ != null) { + operationBuilder_.dispose(); + operationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + */ + public com.google.cloud.sql.v1.Operation.Builder getOperationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetOperationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + */ + public com.google.cloud.sql.v1.OperationOrBuilder getOperationOrBuilder() { + if (operationBuilder_ != null) { + return operationBuilder_.getMessageOrBuilder(); + } else { + return operation_ == null + ? com.google.cloud.sql.v1.Operation.getDefaultInstance() + : operation_; + } + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Operation, + com.google.cloud.sql.v1.Operation.Builder, + com.google.cloud.sql.v1.OperationOrBuilder> + internalGetOperationFieldBuilder() { + if (operationBuilder_ == null) { + operationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Operation, + com.google.cloud.sql.v1.Operation.Builder, + com.google.cloud.sql.v1.OperationOrBuilder>( + getOperation(), getParentForChildren(), isClean()); + operation_ = null; + } + return operationBuilder_; + } + + private com.google.cloud.sql.v1.SslCert serverCaCert_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + serverCaCertBuilder_; + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + * + * @return Whether the serverCaCert field is set. + */ + public boolean hasServerCaCert() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + * + * @return The serverCaCert. + */ + public com.google.cloud.sql.v1.SslCert getServerCaCert() { + if (serverCaCertBuilder_ == null) { + return serverCaCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : serverCaCert_; + } else { + return serverCaCertBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + */ + public Builder setServerCaCert(com.google.cloud.sql.v1.SslCert value) { + if (serverCaCertBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serverCaCert_ = value; + } else { + serverCaCertBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + */ + public Builder setServerCaCert(com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (serverCaCertBuilder_ == null) { + serverCaCert_ = builderForValue.build(); + } else { + serverCaCertBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + */ + public Builder mergeServerCaCert(com.google.cloud.sql.v1.SslCert value) { + if (serverCaCertBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && serverCaCert_ != null + && serverCaCert_ != com.google.cloud.sql.v1.SslCert.getDefaultInstance()) { + getServerCaCertBuilder().mergeFrom(value); + } else { + serverCaCert_ = value; + } + } else { + serverCaCertBuilder_.mergeFrom(value); + } + if (serverCaCert_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + */ + public Builder clearServerCaCert() { + bitField0_ = (bitField0_ & ~0x00000004); + serverCaCert_ = null; + if (serverCaCertBuilder_ != null) { + serverCaCertBuilder_.dispose(); + serverCaCertBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + */ + public com.google.cloud.sql.v1.SslCert.Builder getServerCaCertBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetServerCaCertFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + */ + public com.google.cloud.sql.v1.SslCertOrBuilder getServerCaCertOrBuilder() { + if (serverCaCertBuilder_ != null) { + return serverCaCertBuilder_.getMessageOrBuilder(); + } else { + return serverCaCert_ == null + ? com.google.cloud.sql.v1.SslCert.getDefaultInstance() + : serverCaCert_; + } + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + internalGetServerCaCertFieldBuilder() { + if (serverCaCertBuilder_ == null) { + serverCaCertBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder>( + getServerCaCert(), getParentForChildren(), isClean()); + serverCaCert_ = null; + } + return serverCaCertBuilder_; + } + + private com.google.cloud.sql.v1.SslCertDetail clientCert_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCertDetail, + com.google.cloud.sql.v1.SslCertDetail.Builder, + com.google.cloud.sql.v1.SslCertDetailOrBuilder> + clientCertBuilder_; + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + * + * @return Whether the clientCert field is set. + */ + public boolean hasClientCert() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + * + * @return The clientCert. + */ + public com.google.cloud.sql.v1.SslCertDetail getClientCert() { + if (clientCertBuilder_ == null) { + return clientCert_ == null + ? com.google.cloud.sql.v1.SslCertDetail.getDefaultInstance() + : clientCert_; + } else { + return clientCertBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + */ + public Builder setClientCert(com.google.cloud.sql.v1.SslCertDetail value) { + if (clientCertBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clientCert_ = value; + } else { + clientCertBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + */ + public Builder setClientCert(com.google.cloud.sql.v1.SslCertDetail.Builder builderForValue) { + if (clientCertBuilder_ == null) { + clientCert_ = builderForValue.build(); + } else { + clientCertBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + */ + public Builder mergeClientCert(com.google.cloud.sql.v1.SslCertDetail value) { + if (clientCertBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && clientCert_ != null + && clientCert_ != com.google.cloud.sql.v1.SslCertDetail.getDefaultInstance()) { + getClientCertBuilder().mergeFrom(value); + } else { + clientCert_ = value; + } + } else { + clientCertBuilder_.mergeFrom(value); + } + if (clientCert_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + */ + public Builder clearClientCert() { + bitField0_ = (bitField0_ & ~0x00000008); + clientCert_ = null; + if (clientCertBuilder_ != null) { + clientCertBuilder_.dispose(); + clientCertBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + */ + public com.google.cloud.sql.v1.SslCertDetail.Builder getClientCertBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetClientCertFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + */ + public com.google.cloud.sql.v1.SslCertDetailOrBuilder getClientCertOrBuilder() { + if (clientCertBuilder_ != null) { + return clientCertBuilder_.getMessageOrBuilder(); + } else { + return clientCert_ == null + ? com.google.cloud.sql.v1.SslCertDetail.getDefaultInstance() + : clientCert_; + } + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCertDetail, + com.google.cloud.sql.v1.SslCertDetail.Builder, + com.google.cloud.sql.v1.SslCertDetailOrBuilder> + internalGetClientCertFieldBuilder() { + if (clientCertBuilder_ == null) { + clientCertBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SslCertDetail, + com.google.cloud.sql.v1.SslCertDetail.Builder, + com.google.cloud.sql.v1.SslCertDetailOrBuilder>( + getClientCert(), getParentForChildren(), isClean()); + clientCert_ = null; + } + return clientCertBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SslCertsInsertResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SslCertsInsertResponse) + private static final com.google.cloud.sql.v1.SslCertsInsertResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SslCertsInsertResponse(); + } + + public static com.google.cloud.sql.v1.SslCertsInsertResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslCertsInsertResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsInsertResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsInsertResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsInsertResponseOrBuilder.java new file mode 100644 index 000000000000..a991892629d4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsInsertResponseOrBuilder.java @@ -0,0 +1,171 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SslCertsInsertResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SslCertsInsertResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#sslCertsInsert`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#sslCertsInsert`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The operation to track the ssl certs insert request.
+   * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + * + * @return Whether the operation field is set. + */ + boolean hasOperation(); + + /** + * + * + *
+   * The operation to track the ssl certs insert request.
+   * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + * + * @return The operation. + */ + com.google.cloud.sql.v1.Operation getOperation(); + + /** + * + * + *
+   * The operation to track the ssl certs insert request.
+   * 
+ * + * .google.cloud.sql.v1.Operation operation = 2; + */ + com.google.cloud.sql.v1.OperationOrBuilder getOperationOrBuilder(); + + /** + * + * + *
+   * The server Certificate Authority's certificate.  If this is missing you can
+   * force a new one to be generated by calling resetSslConfig method on
+   * instances resource.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + * + * @return Whether the serverCaCert field is set. + */ + boolean hasServerCaCert(); + + /** + * + * + *
+   * The server Certificate Authority's certificate.  If this is missing you can
+   * force a new one to be generated by calling resetSslConfig method on
+   * instances resource.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + * + * @return The serverCaCert. + */ + com.google.cloud.sql.v1.SslCert getServerCaCert(); + + /** + * + * + *
+   * The server Certificate Authority's certificate.  If this is missing you can
+   * force a new one to be generated by calling resetSslConfig method on
+   * instances resource.
+   * 
+ * + * .google.cloud.sql.v1.SslCert server_ca_cert = 3; + */ + com.google.cloud.sql.v1.SslCertOrBuilder getServerCaCertOrBuilder(); + + /** + * + * + *
+   * The new client certificate and private key.
+   * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + * + * @return Whether the clientCert field is set. + */ + boolean hasClientCert(); + + /** + * + * + *
+   * The new client certificate and private key.
+   * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + * + * @return The clientCert. + */ + com.google.cloud.sql.v1.SslCertDetail getClientCert(); + + /** + * + * + *
+   * The new client certificate and private key.
+   * 
+ * + * .google.cloud.sql.v1.SslCertDetail client_cert = 4; + */ + com.google.cloud.sql.v1.SslCertDetailOrBuilder getClientCertOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsListResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsListResponse.java new file mode 100644 index 000000000000..dfbb9c8204bd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsListResponse.java @@ -0,0 +1,1105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * SslCerts list response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SslCertsListResponse} + */ +@com.google.protobuf.Generated +public final class SslCertsListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SslCertsListResponse) + SslCertsListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslCertsListResponse"); + } + + // Use SslCertsListResponse.newBuilder() to construct. + private SslCertsListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SslCertsListResponse() { + kind_ = ""; + items_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SslCertsListResponse.class, + com.google.cloud.sql.v1.SslCertsListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#sslCertsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#sslCertsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCert getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.SslCertOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.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.sql.v1.SslCertsListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SslCertsListResponse other = + (com.google.cloud.sql.v1.SslCertsListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SslCertsListResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertsListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertsListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SslCertsListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsListResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertsListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertsListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SslCertsListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SslCertsListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SslCertsListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SslCerts list response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SslCertsListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SslCertsListResponse) + com.google.cloud.sql.v1.SslCertsListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SslCertsListResponse.class, + com.google.cloud.sql.v1.SslCertsListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SslCertsListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlSslCertsProto + .internal_static_google_cloud_sql_v1_SslCertsListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SslCertsListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsListResponse build() { + com.google.cloud.sql.v1.SslCertsListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsListResponse buildPartial() { + com.google.cloud.sql.v1.SslCertsListResponse result = + new com.google.cloud.sql.v1.SslCertsListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.SslCertsListResponse result) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.SslCertsListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SslCertsListResponse) { + return mergeFrom((com.google.cloud.sql.v1.SslCertsListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SslCertsListResponse other) { + if (other == com.google.cloud.sql.v1.SslCertsListResponse.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1.SslCert m = + input.readMessage(com.google.cloud.sql.v1.SslCert.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#sslCertsList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#sslCertsList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#sslCertsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#sslCertsList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#sslCertsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public com.google.cloud.sql.v1.SslCert getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.SslCert value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1.SslCert value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.SslCert value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.SslCert.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public com.google.cloud.sql.v1.SslCert.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public com.google.cloud.sql.v1.SslCertOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public com.google.cloud.sql.v1.SslCert.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public com.google.cloud.sql.v1.SslCert.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.SslCert, + com.google.cloud.sql.v1.SslCert.Builder, + com.google.cloud.sql.v1.SslCertOrBuilder>( + items_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SslCertsListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SslCertsListResponse) + private static final com.google.cloud.sql.v1.SslCertsListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SslCertsListResponse(); + } + + public static com.google.cloud.sql.v1.SslCertsListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslCertsListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SslCertsListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsListResponseOrBuilder.java new file mode 100644 index 000000000000..5ea67a068c51 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SslCertsListResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SslCertsListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SslCertsListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#sslCertsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#sslCertsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + com.google.cloud.sql.v1.SslCert getItems(int index); + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + int getItemsCount(); + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + java.util.List getItemsOrBuilderList(); + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.SslCert items = 2; + */ + com.google.cloud.sql.v1.SslCertOrBuilder getItemsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SyncFlags.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SyncFlags.java new file mode 100644 index 000000000000..75bc2dd0334e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SyncFlags.java @@ -0,0 +1,790 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Initial sync flags for certain Cloud SQL APIs.
+ * Currently used for the MySQL external server initial dump.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SyncFlags} + */ +@com.google.protobuf.Generated +public final class SyncFlags extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.SyncFlags) + SyncFlagsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SyncFlags"); + } + + // Use SyncFlags.newBuilder() to construct. + private SyncFlags(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SyncFlags() { + name_ = ""; + value_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SyncFlags_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SyncFlags_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SyncFlags.class, + com.google.cloud.sql.v1.SyncFlags.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the flag.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the flag.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + + /** + * + * + *
+   * The value of the flag. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + + /** + * + * + *
+   * The value of the flag. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.SyncFlags)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.SyncFlags other = (com.google.cloud.sql.v1.SyncFlags) obj; + + if (!getName().equals(other.getName())) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.SyncFlags parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SyncFlags parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SyncFlags parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SyncFlags parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SyncFlags parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.SyncFlags parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SyncFlags parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SyncFlags parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SyncFlags parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SyncFlags parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.SyncFlags parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.SyncFlags parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.SyncFlags prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Initial sync flags for certain Cloud SQL APIs.
+   * Currently used for the MySQL external server initial dump.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.SyncFlags} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.SyncFlags) + com.google.cloud.sql.v1.SyncFlagsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SyncFlags_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SyncFlags_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.SyncFlags.class, + com.google.cloud.sql.v1.SyncFlags.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.SyncFlags.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + value_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1_SyncFlags_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SyncFlags getDefaultInstanceForType() { + return com.google.cloud.sql.v1.SyncFlags.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.SyncFlags build() { + com.google.cloud.sql.v1.SyncFlags result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SyncFlags buildPartial() { + com.google.cloud.sql.v1.SyncFlags result = new com.google.cloud.sql.v1.SyncFlags(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.SyncFlags result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.SyncFlags) { + return mergeFrom((com.google.cloud.sql.v1.SyncFlags) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.SyncFlags other) { + if (other == com.google.cloud.sql.v1.SyncFlags.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + 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: + { + value_ = 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_ = ""; + + /** + * + * + *
+     * The name of the flag.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the flag.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the flag.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the flag.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the flag.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + + /** + * + * + *
+     * The value of the flag. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The value of the flag. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The value of the flag. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of the flag. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of the flag. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.SyncFlags) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.SyncFlags) + private static final com.google.cloud.sql.v1.SyncFlags DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.SyncFlags(); + } + + public static com.google.cloud.sql.v1.SyncFlags getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SyncFlags parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.SyncFlags getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SyncFlagsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SyncFlagsOrBuilder.java new file mode 100644 index 000000000000..7cc588c78698 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/SyncFlagsOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface SyncFlagsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.SyncFlags) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the flag.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the flag.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The value of the flag. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The value. + */ + java.lang.String getValue(); + + /** + * + * + *
+   * The value of the flag. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Tier.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Tier.java new file mode 100644 index 000000000000..08093cbd7af6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Tier.java @@ -0,0 +1,1270 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_tiers.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * A Google Cloud SQL service tier resource.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Tier} + */ +@com.google.protobuf.Generated +public final class Tier extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.Tier) + TierOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Tier"); + } + + // Use Tier.newBuilder() to construct. + private Tier(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Tier() { + tier_ = ""; + kind_ = ""; + region_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_Tier_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_Tier_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Tier.class, com.google.cloud.sql.v1.Tier.Builder.class); + } + + public static final int TIER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object tier_ = ""; + + /** + * + * + *
+   * An identifier for the machine type, for example, `db-custom-1-3840`. For
+   * related information, see [Pricing](/sql/pricing).
+   * 
+ * + * string tier = 1; + * + * @return The tier. + */ + @java.lang.Override + public java.lang.String getTier() { + java.lang.Object ref = tier_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tier_ = s; + return s; + } + } + + /** + * + * + *
+   * An identifier for the machine type, for example, `db-custom-1-3840`. For
+   * related information, see [Pricing](/sql/pricing).
+   * 
+ * + * string tier = 1; + * + * @return The bytes for tier. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTierBytes() { + java.lang.Object ref = tier_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RAM_FIELD_NUMBER = 2; + private long rAM_ = 0L; + + /** + * + * + *
+   * The maximum RAM usage of this tier in bytes.
+   * 
+ * + * int64 RAM = 2 [json_name = "RAM"]; + * + * @return The rAM. + */ + @java.lang.Override + public long getRAM() { + return rAM_; + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#tier`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#tier`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISK_QUOTA_FIELD_NUMBER = 4; + private long diskQuota_ = 0L; + + /** + * + * + *
+   * The maximum disk size of this tier in bytes.
+   * 
+ * + * int64 Disk_Quota = 4 [json_name = "DiskQuota"]; + * + * @return The diskQuota. + */ + @java.lang.Override + public long getDiskQuota() { + return diskQuota_; + } + + public static final int REGION_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList region_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @return A list containing the region. + */ + public com.google.protobuf.ProtocolStringList getRegionList() { + return region_; + } + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @return The count of region. + */ + public int getRegionCount() { + return region_.size(); + } + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @param index The index of the element to return. + * @return The region at the given index. + */ + public java.lang.String getRegion(int index) { + return region_.get(index); + } + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @param index The index of the value to return. + * @return The bytes of the region at the given index. + */ + public com.google.protobuf.ByteString getRegionBytes(int index) { + return region_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tier_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tier_); + } + if (rAM_ != 0L) { + output.writeInt64(2, rAM_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + if (diskQuota_ != 0L) { + output.writeInt64(4, diskQuota_); + } + for (int i = 0; i < region_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, region_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tier_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tier_); + } + if (rAM_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, rAM_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + if (diskQuota_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, diskQuota_); + } + { + int dataSize = 0; + for (int i = 0; i < region_.size(); i++) { + dataSize += computeStringSizeNoTag(region_.getRaw(i)); + } + size += dataSize; + size += 1 * getRegionList().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.sql.v1.Tier)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.Tier other = (com.google.cloud.sql.v1.Tier) obj; + + if (!getTier().equals(other.getTier())) return false; + if (getRAM() != other.getRAM()) return false; + if (!getKind().equals(other.getKind())) return false; + if (getDiskQuota() != other.getDiskQuota()) return false; + if (!getRegionList().equals(other.getRegionList())) return false; + if (!getUnknownFields().equals(other.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) + TIER_FIELD_NUMBER; + hash = (53 * hash) + getTier().hashCode(); + hash = (37 * hash) + RAM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRAM()); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + DISK_QUOTA_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDiskQuota()); + if (getRegionCount() > 0) { + hash = (37 * hash) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegionList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.Tier parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Tier parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Tier parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Tier parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Tier parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Tier parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Tier parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Tier parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Tier parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Tier parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Tier parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Tier parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.Tier prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A Google Cloud SQL service tier resource.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Tier} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.Tier) + com.google.cloud.sql.v1.TierOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_Tier_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_Tier_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Tier.class, com.google.cloud.sql.v1.Tier.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.Tier.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tier_ = ""; + rAM_ = 0L; + kind_ = ""; + diskQuota_ = 0L; + region_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_Tier_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Tier getDefaultInstanceForType() { + return com.google.cloud.sql.v1.Tier.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.Tier build() { + com.google.cloud.sql.v1.Tier result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Tier buildPartial() { + com.google.cloud.sql.v1.Tier result = new com.google.cloud.sql.v1.Tier(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.Tier result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tier_ = tier_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.rAM_ = rAM_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.diskQuota_ = diskQuota_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + region_.makeImmutable(); + result.region_ = region_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.Tier) { + return mergeFrom((com.google.cloud.sql.v1.Tier) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.Tier other) { + if (other == com.google.cloud.sql.v1.Tier.getDefaultInstance()) return this; + if (!other.getTier().isEmpty()) { + tier_ = other.tier_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getRAM() != 0L) { + setRAM(other.getRAM()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getDiskQuota() != 0L) { + setDiskQuota(other.getDiskQuota()); + } + if (!other.region_.isEmpty()) { + if (region_.isEmpty()) { + region_ = other.region_; + bitField0_ |= 0x00000010; + } else { + ensureRegionIsMutable(); + region_.addAll(other.region_); + } + 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: + { + tier_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + rAM_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + diskQuota_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRegionIsMutable(); + region_.add(s); + 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 tier_ = ""; + + /** + * + * + *
+     * An identifier for the machine type, for example, `db-custom-1-3840`. For
+     * related information, see [Pricing](/sql/pricing).
+     * 
+ * + * string tier = 1; + * + * @return The tier. + */ + public java.lang.String getTier() { + java.lang.Object ref = tier_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tier_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * An identifier for the machine type, for example, `db-custom-1-3840`. For
+     * related information, see [Pricing](/sql/pricing).
+     * 
+ * + * string tier = 1; + * + * @return The bytes for tier. + */ + public com.google.protobuf.ByteString getTierBytes() { + java.lang.Object ref = tier_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * An identifier for the machine type, for example, `db-custom-1-3840`. For
+     * related information, see [Pricing](/sql/pricing).
+     * 
+ * + * string tier = 1; + * + * @param value The tier to set. + * @return This builder for chaining. + */ + public Builder setTier(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tier_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * An identifier for the machine type, for example, `db-custom-1-3840`. For
+     * related information, see [Pricing](/sql/pricing).
+     * 
+ * + * string tier = 1; + * + * @return This builder for chaining. + */ + public Builder clearTier() { + tier_ = getDefaultInstance().getTier(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * An identifier for the machine type, for example, `db-custom-1-3840`. For
+     * related information, see [Pricing](/sql/pricing).
+     * 
+ * + * string tier = 1; + * + * @param value The bytes for tier to set. + * @return This builder for chaining. + */ + public Builder setTierBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tier_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long rAM_; + + /** + * + * + *
+     * The maximum RAM usage of this tier in bytes.
+     * 
+ * + * int64 RAM = 2 [json_name = "RAM"]; + * + * @return The rAM. + */ + @java.lang.Override + public long getRAM() { + return rAM_; + } + + /** + * + * + *
+     * The maximum RAM usage of this tier in bytes.
+     * 
+ * + * int64 RAM = 2 [json_name = "RAM"]; + * + * @param value The rAM to set. + * @return This builder for chaining. + */ + public Builder setRAM(long value) { + + rAM_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum RAM usage of this tier in bytes.
+     * 
+ * + * int64 RAM = 2 [json_name = "RAM"]; + * + * @return This builder for chaining. + */ + public Builder clearRAM() { + bitField0_ = (bitField0_ & ~0x00000002); + rAM_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#tier`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#tier`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#tier`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#tier`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#tier`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private long diskQuota_; + + /** + * + * + *
+     * The maximum disk size of this tier in bytes.
+     * 
+ * + * int64 Disk_Quota = 4 [json_name = "DiskQuota"]; + * + * @return The diskQuota. + */ + @java.lang.Override + public long getDiskQuota() { + return diskQuota_; + } + + /** + * + * + *
+     * The maximum disk size of this tier in bytes.
+     * 
+ * + * int64 Disk_Quota = 4 [json_name = "DiskQuota"]; + * + * @param value The diskQuota to set. + * @return This builder for chaining. + */ + public Builder setDiskQuota(long value) { + + diskQuota_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum disk size of this tier in bytes.
+     * 
+ * + * int64 Disk_Quota = 4 [json_name = "DiskQuota"]; + * + * @return This builder for chaining. + */ + public Builder clearDiskQuota() { + bitField0_ = (bitField0_ & ~0x00000008); + diskQuota_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList region_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureRegionIsMutable() { + if (!region_.isModifiable()) { + region_ = new com.google.protobuf.LazyStringArrayList(region_); + } + bitField0_ |= 0x00000010; + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @return A list containing the region. + */ + public com.google.protobuf.ProtocolStringList getRegionList() { + region_.makeImmutable(); + return region_; + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @return The count of region. + */ + public int getRegionCount() { + return region_.size(); + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @param index The index of the element to return. + * @return The region at the given index. + */ + public java.lang.String getRegion(int index) { + return region_.get(index); + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @param index The index of the value to return. + * @return The bytes of the region at the given index. + */ + public com.google.protobuf.ByteString getRegionBytes(int index) { + return region_.getByteString(index); + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @param index The index to set the value at. + * @param value The region to set. + * @return This builder for chaining. + */ + public Builder setRegion(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegionIsMutable(); + region_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @param value The region to add. + * @return This builder for chaining. + */ + public Builder addRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegionIsMutable(); + region_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @param values The region to add. + * @return This builder for chaining. + */ + public Builder addAllRegion(java.lang.Iterable values) { + ensureRegionIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, region_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @return This builder for chaining. + */ + public Builder clearRegion() { + region_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @param value The bytes of the region to add. + * @return This builder for chaining. + */ + public Builder addRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRegionIsMutable(); + region_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.Tier) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.Tier) + private static final com.google.cloud.sql.v1.Tier DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.Tier(); + } + + public static com.google.cloud.sql.v1.Tier getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Tier parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Tier getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TierOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TierOrBuilder.java new file mode 100644 index 000000000000..26c12fd9d178 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TierOrBuilder.java @@ -0,0 +1,162 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_tiers.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface TierOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.Tier) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * An identifier for the machine type, for example, `db-custom-1-3840`. For
+   * related information, see [Pricing](/sql/pricing).
+   * 
+ * + * string tier = 1; + * + * @return The tier. + */ + java.lang.String getTier(); + + /** + * + * + *
+   * An identifier for the machine type, for example, `db-custom-1-3840`. For
+   * related information, see [Pricing](/sql/pricing).
+   * 
+ * + * string tier = 1; + * + * @return The bytes for tier. + */ + com.google.protobuf.ByteString getTierBytes(); + + /** + * + * + *
+   * The maximum RAM usage of this tier in bytes.
+   * 
+ * + * int64 RAM = 2 [json_name = "RAM"]; + * + * @return The rAM. + */ + long getRAM(); + + /** + * + * + *
+   * This is always `sql#tier`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#tier`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The maximum disk size of this tier in bytes.
+   * 
+ * + * int64 Disk_Quota = 4 [json_name = "DiskQuota"]; + * + * @return The diskQuota. + */ + long getDiskQuota(); + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @return A list containing the region. + */ + java.util.List getRegionList(); + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @return The count of region. + */ + int getRegionCount(); + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @param index The index of the element to return. + * @return The region at the given index. + */ + java.lang.String getRegion(int index); + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @param index The index of the value to return. + * @return The bytes of the region at the given index. + */ + com.google.protobuf.ByteString getRegionBytes(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TiersListResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TiersListResponse.java new file mode 100644 index 000000000000..d1d39e93b27b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TiersListResponse.java @@ -0,0 +1,1101 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_tiers.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Tiers list response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.TiersListResponse} + */ +@com.google.protobuf.Generated +public final class TiersListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.TiersListResponse) + TiersListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TiersListResponse"); + } + + // Use TiersListResponse.newBuilder() to construct. + private TiersListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TiersListResponse() { + kind_ = ""; + items_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_TiersListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_TiersListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.TiersListResponse.class, + com.google.cloud.sql.v1.TiersListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#tiersList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#tiersList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + @java.lang.Override + public java.util.List getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.Tier getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.TierOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.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.sql.v1.TiersListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.TiersListResponse other = + (com.google.cloud.sql.v1.TiersListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.TiersListResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.TiersListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.TiersListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.TiersListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.TiersListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.TiersListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.TiersListResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.TiersListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.TiersListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.TiersListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.TiersListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.TiersListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.TiersListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Tiers list response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.TiersListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.TiersListResponse) + com.google.cloud.sql.v1.TiersListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_TiersListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_TiersListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.TiersListResponse.class, + com.google.cloud.sql.v1.TiersListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.TiersListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1_TiersListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.TiersListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1.TiersListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.TiersListResponse build() { + com.google.cloud.sql.v1.TiersListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.TiersListResponse buildPartial() { + com.google.cloud.sql.v1.TiersListResponse result = + new com.google.cloud.sql.v1.TiersListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.TiersListResponse result) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.TiersListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.TiersListResponse) { + return mergeFrom((com.google.cloud.sql.v1.TiersListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.TiersListResponse other) { + if (other == com.google.cloud.sql.v1.TiersListResponse.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1.Tier m = + input.readMessage(com.google.cloud.sql.v1.Tier.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#tiersList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#tiersList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#tiersList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#tiersList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#tiersList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List items_ = java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Tier, + com.google.cloud.sql.v1.Tier.Builder, + com.google.cloud.sql.v1.TierOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public com.google.cloud.sql.v1.Tier getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.Tier value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.Tier.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1.Tier value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.Tier value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1.Tier.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.Tier.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public Builder addAllItems(java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public com.google.cloud.sql.v1.Tier.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public com.google.cloud.sql.v1.TierOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public java.util.List getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public com.google.cloud.sql.v1.Tier.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.Tier.getDefaultInstance()); + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public com.google.cloud.sql.v1.Tier.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.Tier.getDefaultInstance()); + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Tier, + com.google.cloud.sql.v1.Tier.Builder, + com.google.cloud.sql.v1.TierOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.Tier, + com.google.cloud.sql.v1.Tier.Builder, + com.google.cloud.sql.v1.TierOrBuilder>( + items_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.TiersListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.TiersListResponse) + private static final com.google.cloud.sql.v1.TiersListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.TiersListResponse(); + } + + public static com.google.cloud.sql.v1.TiersListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TiersListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.TiersListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TiersListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TiersListResponseOrBuilder.java new file mode 100644 index 000000000000..978c7a52c8d4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TiersListResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_tiers.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface TiersListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.TiersListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#tiersList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#tiersList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + com.google.cloud.sql.v1.Tier getItems(int index); + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + int getItemsCount(); + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + java.util.List getItemsOrBuilderList(); + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1.Tier items = 2; + */ + com.google.cloud.sql.v1.TierOrBuilder getItemsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TruncateLogContext.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TruncateLogContext.java new file mode 100644 index 000000000000..df08b0c7d1fc --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TruncateLogContext.java @@ -0,0 +1,791 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * Database Instance truncate log context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.TruncateLogContext} + */ +@com.google.protobuf.Generated +public final class TruncateLogContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.TruncateLogContext) + TruncateLogContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TruncateLogContext"); + } + + // Use TruncateLogContext.newBuilder() to construct. + private TruncateLogContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TruncateLogContext() { + kind_ = ""; + logType_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_TruncateLogContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_TruncateLogContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.TruncateLogContext.class, + com.google.cloud.sql.v1.TruncateLogContext.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#truncateLogContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#truncateLogContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOG_TYPE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object logType_ = ""; + + /** + * + * + *
+   * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+   * `MYSQL_SLOW_TABLE`.
+   * 
+ * + * string log_type = 2; + * + * @return The logType. + */ + @java.lang.Override + public java.lang.String getLogType() { + java.lang.Object ref = logType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logType_ = s; + return s; + } + } + + /** + * + * + *
+   * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+   * `MYSQL_SLOW_TABLE`.
+   * 
+ * + * string log_type = 2; + * + * @return The bytes for logType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLogTypeBytes() { + java.lang.Object ref = logType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logType_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(logType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, logType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(logType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, logType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.TruncateLogContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.TruncateLogContext other = + (com.google.cloud.sql.v1.TruncateLogContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getLogType().equals(other.getLogType())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + LOG_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getLogType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.TruncateLogContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.TruncateLogContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.TruncateLogContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.TruncateLogContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.TruncateLogContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.TruncateLogContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.TruncateLogContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.TruncateLogContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.TruncateLogContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.TruncateLogContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.TruncateLogContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.TruncateLogContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.TruncateLogContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database Instance truncate log context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.TruncateLogContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.TruncateLogContext) + com.google.cloud.sql.v1.TruncateLogContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_TruncateLogContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_TruncateLogContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.TruncateLogContext.class, + com.google.cloud.sql.v1.TruncateLogContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.TruncateLogContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + logType_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_TruncateLogContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.TruncateLogContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1.TruncateLogContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.TruncateLogContext build() { + com.google.cloud.sql.v1.TruncateLogContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.TruncateLogContext buildPartial() { + com.google.cloud.sql.v1.TruncateLogContext result = + new com.google.cloud.sql.v1.TruncateLogContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.TruncateLogContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.logType_ = logType_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.TruncateLogContext) { + return mergeFrom((com.google.cloud.sql.v1.TruncateLogContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.TruncateLogContext other) { + if (other == com.google.cloud.sql.v1.TruncateLogContext.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getLogType().isEmpty()) { + logType_ = other.logType_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + logType_ = 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#truncateLogContext`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#truncateLogContext`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#truncateLogContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#truncateLogContext`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#truncateLogContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object logType_ = ""; + + /** + * + * + *
+     * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+     * `MYSQL_SLOW_TABLE`.
+     * 
+ * + * string log_type = 2; + * + * @return The logType. + */ + public java.lang.String getLogType() { + java.lang.Object ref = logType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+     * `MYSQL_SLOW_TABLE`.
+     * 
+ * + * string log_type = 2; + * + * @return The bytes for logType. + */ + public com.google.protobuf.ByteString getLogTypeBytes() { + java.lang.Object ref = logType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+     * `MYSQL_SLOW_TABLE`.
+     * 
+ * + * string log_type = 2; + * + * @param value The logType to set. + * @return This builder for chaining. + */ + public Builder setLogType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + logType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+     * `MYSQL_SLOW_TABLE`.
+     * 
+ * + * string log_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearLogType() { + logType_ = getDefaultInstance().getLogType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+     * `MYSQL_SLOW_TABLE`.
+     * 
+ * + * string log_type = 2; + * + * @param value The bytes for logType to set. + * @return This builder for chaining. + */ + public Builder setLogTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + logType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.TruncateLogContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.TruncateLogContext) + private static final com.google.cloud.sql.v1.TruncateLogContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.TruncateLogContext(); + } + + public static com.google.cloud.sql.v1.TruncateLogContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TruncateLogContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.TruncateLogContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TruncateLogContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TruncateLogContextOrBuilder.java new file mode 100644 index 000000000000..e47c8b4159b2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/TruncateLogContextOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface TruncateLogContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.TruncateLogContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#truncateLogContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#truncateLogContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+   * `MYSQL_SLOW_TABLE`.
+   * 
+ * + * string log_type = 2; + * + * @return The logType. + */ + java.lang.String getLogType(); + + /** + * + * + *
+   * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+   * `MYSQL_SLOW_TABLE`.
+   * 
+ * + * string log_type = 2; + * + * @return The bytes for logType. + */ + com.google.protobuf.ByteString getLogTypeBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UpdateBackupRequest.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UpdateBackupRequest.java new file mode 100644 index 000000000000..60c904fb8168 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UpdateBackupRequest.java @@ -0,0 +1,1010 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The request payload to update the backup.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.UpdateBackupRequest} + */ +@com.google.protobuf.Generated +public final class UpdateBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.UpdateBackupRequest) + UpdateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateBackupRequest"); + } + + // Use UpdateBackupRequest.newBuilder() to construct. + private UpdateBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateBackupRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.UpdateBackupRequest.class, + com.google.cloud.sql.v1.UpdateBackupRequest.Builder.class); + } + + private int bitField0_; + public static final int BACKUP_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1.Backup backup_; + + /** + * + * + *
+   * Required. The backup to update.
+   * The backup’s `name` field is used to identify the backup to update.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The backup to update.
+   * The backup’s `name` field is used to identify the backup to update.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backup. + */ + @java.lang.Override + public com.google.cloud.sql.v1.Backup getBackup() { + return backup_ == null ? com.google.cloud.sql.v1.Backup.getDefaultInstance() : backup_; + } + + /** + * + * + *
+   * Required. The backup to update.
+   * The backup’s `name` field is used to identify the backup to update.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.sql.v1.BackupOrBuilder getBackupOrBuilder() { + return backup_ == null ? com.google.cloud.sql.v1.Backup.getDefaultInstance() : backup_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * The list of fields that you can update. You can update only the description
+   * and retention period of the final backup.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The list of fields that you can update. You can update only the description
+   * and retention period of the final backup.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * The list of fields that you can update. You can update only the description
+   * and retention period of the final backup.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getBackup()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + 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, getBackup()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.UpdateBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.UpdateBackupRequest other = + (com.google.cloud.sql.v1.UpdateBackupRequest) obj; + + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.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 (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.UpdateBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.UpdateBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UpdateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.UpdateBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UpdateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.UpdateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UpdateBackupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.UpdateBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UpdateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.UpdateBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UpdateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.UpdateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.UpdateBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request payload to update the backup.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.UpdateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.UpdateBackupRequest) + com.google.cloud.sql.v1.UpdateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.UpdateBackupRequest.class, + com.google.cloud.sql.v1.UpdateBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.UpdateBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackupFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlBackupsProto + .internal_static_google_cloud_sql_v1_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.UpdateBackupRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1.UpdateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.UpdateBackupRequest build() { + com.google.cloud.sql.v1.UpdateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.UpdateBackupRequest buildPartial() { + com.google.cloud.sql.v1.UpdateBackupRequest result = + new com.google.cloud.sql.v1.UpdateBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.UpdateBackupRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backup_ = backupBuilder_ == null ? backup_ : backupBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.UpdateBackupRequest) { + return mergeFrom((com.google.cloud.sql.v1.UpdateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.UpdateBackupRequest other) { + if (other == com.google.cloud.sql.v1.UpdateBackupRequest.getDefaultInstance()) return this; + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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(internalGetBackupFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1.Backup backup_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Backup, + com.google.cloud.sql.v1.Backup.Builder, + com.google.cloud.sql.v1.BackupOrBuilder> + backupBuilder_; + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.cloud.sql.v1.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null ? com.google.cloud.sql.v1.Backup.getDefaultInstance() : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.sql.v1.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + } else { + backupBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.sql.v1.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.cloud.sql.v1.Backup value) { + if (backupBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && backup_ != null + && backup_ != com.google.cloud.sql.v1.Backup.getDefaultInstance()) { + getBackupBuilder().mergeFrom(value); + } else { + backup_ = value; + } + } else { + backupBuilder_.mergeFrom(value); + } + if (backup_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + bitField0_ = (bitField0_ & ~0x00000001); + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.Backup.Builder getBackupBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetBackupFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null ? com.google.cloud.sql.v1.Backup.getDefaultInstance() : backup_; + } + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Backup, + com.google.cloud.sql.v1.Backup.Builder, + com.google.cloud.sql.v1.BackupOrBuilder> + internalGetBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.Backup, + com.google.cloud.sql.v1.Backup.Builder, + com.google.cloud.sql.v1.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.UpdateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.UpdateBackupRequest) + private static final com.google.cloud.sql.v1.UpdateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.UpdateBackupRequest(); + } + + public static com.google.cloud.sql.v1.UpdateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.UpdateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UpdateBackupRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UpdateBackupRequestOrBuilder.java new file mode 100644 index 000000000000..5f04bad5a7dc --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UpdateBackupRequestOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_backups.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface UpdateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.UpdateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The backup to update.
+   * The backup’s `name` field is used to identify the backup to update.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + + /** + * + * + *
+   * Required. The backup to update.
+   * The backup’s `name` field is used to identify the backup to update.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backup. + */ + com.google.cloud.sql.v1.Backup getBackup(); + + /** + * + * + *
+   * Required. The backup to update.
+   * The backup’s `name` field is used to identify the backup to update.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * .google.cloud.sql.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.sql.v1.BackupOrBuilder getBackupOrBuilder(); + + /** + * + * + *
+   * The list of fields that you can update. You can update only the description
+   * and retention period of the final backup.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * The list of fields that you can update. You can update only the description
+   * and retention period of the final backup.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * The list of fields that you can update. You can update only the description
+   * and retention period of the final backup.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/User.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/User.java new file mode 100644 index 000000000000..18a3241609dd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/User.java @@ -0,0 +1,4088 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * A Cloud SQL user resource.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.User} + */ +@com.google.protobuf.Generated +public final class User extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.User) + UserOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "User"); + } + + // Use User.newBuilder() to construct. + private User(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private User() { + kind_ = ""; + password_ = ""; + etag_ = ""; + name_ = ""; + host_ = ""; + instance_ = ""; + project_ = ""; + type_ = 0; + iamEmail_ = ""; + dualPasswordType_ = 0; + iamStatus_ = 0; + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.User.class, com.google.cloud.sql.v1.User.Builder.class); + } + + /** + * + * + *
+   * The user type.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.User.SqlUserType} + */ + public enum SqlUserType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The database's built-in user type.
+     * 
+ * + * BUILT_IN = 0; + */ + BUILT_IN(0), + /** + * + * + *
+     * Cloud IAM user.
+     * 
+ * + * CLOUD_IAM_USER = 1; + */ + CLOUD_IAM_USER(1), + /** + * + * + *
+     * Cloud IAM service account.
+     * 
+ * + * CLOUD_IAM_SERVICE_ACCOUNT = 2; + */ + CLOUD_IAM_SERVICE_ACCOUNT(2), + /** + * + * + *
+     * Cloud IAM group. Not used for login.
+     * 
+ * + * CLOUD_IAM_GROUP = 3; + */ + CLOUD_IAM_GROUP(3), + /** + * + * + *
+     * Read-only. Login for a user that belongs to the Cloud IAM group.
+     * 
+ * + * CLOUD_IAM_GROUP_USER = 4; + */ + CLOUD_IAM_GROUP_USER(4), + /** + * + * + *
+     * Read-only. Login for a service account that belongs to the
+     * Cloud IAM group.
+     * 
+ * + * CLOUD_IAM_GROUP_SERVICE_ACCOUNT = 5; + */ + CLOUD_IAM_GROUP_SERVICE_ACCOUNT(5), + /** + * + * + *
+     * Cloud IAM workforce identity user managed via workforce identity
+     * federation.
+     * 
+ * + * CLOUD_IAM_WORKFORCE_IDENTITY = 6; + */ + CLOUD_IAM_WORKFORCE_IDENTITY(6), + /** + * + * + *
+     * Microsoft Entra ID user.
+     * 
+ * + * ENTRAID_USER = 7; + */ + ENTRAID_USER(7), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlUserType"); + } + + /** + * + * + *
+     * The database's built-in user type.
+     * 
+ * + * BUILT_IN = 0; + */ + public static final int BUILT_IN_VALUE = 0; + + /** + * + * + *
+     * Cloud IAM user.
+     * 
+ * + * CLOUD_IAM_USER = 1; + */ + public static final int CLOUD_IAM_USER_VALUE = 1; + + /** + * + * + *
+     * Cloud IAM service account.
+     * 
+ * + * CLOUD_IAM_SERVICE_ACCOUNT = 2; + */ + public static final int CLOUD_IAM_SERVICE_ACCOUNT_VALUE = 2; + + /** + * + * + *
+     * Cloud IAM group. Not used for login.
+     * 
+ * + * CLOUD_IAM_GROUP = 3; + */ + public static final int CLOUD_IAM_GROUP_VALUE = 3; + + /** + * + * + *
+     * Read-only. Login for a user that belongs to the Cloud IAM group.
+     * 
+ * + * CLOUD_IAM_GROUP_USER = 4; + */ + public static final int CLOUD_IAM_GROUP_USER_VALUE = 4; + + /** + * + * + *
+     * Read-only. Login for a service account that belongs to the
+     * Cloud IAM group.
+     * 
+ * + * CLOUD_IAM_GROUP_SERVICE_ACCOUNT = 5; + */ + public static final int CLOUD_IAM_GROUP_SERVICE_ACCOUNT_VALUE = 5; + + /** + * + * + *
+     * Cloud IAM workforce identity user managed via workforce identity
+     * federation.
+     * 
+ * + * CLOUD_IAM_WORKFORCE_IDENTITY = 6; + */ + public static final int CLOUD_IAM_WORKFORCE_IDENTITY_VALUE = 6; + + /** + * + * + *
+     * Microsoft Entra ID user.
+     * 
+ * + * ENTRAID_USER = 7; + */ + public static final int ENTRAID_USER_VALUE = 7; + + 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 SqlUserType 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 SqlUserType forNumber(int value) { + switch (value) { + case 0: + return BUILT_IN; + case 1: + return CLOUD_IAM_USER; + case 2: + return CLOUD_IAM_SERVICE_ACCOUNT; + case 3: + return CLOUD_IAM_GROUP; + case 4: + return CLOUD_IAM_GROUP_USER; + case 5: + return CLOUD_IAM_GROUP_SERVICE_ACCOUNT; + case 6: + return CLOUD_IAM_WORKFORCE_IDENTITY; + case 7: + return ENTRAID_USER; + 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 SqlUserType findValueByNumber(int number) { + return SqlUserType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.User.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlUserType[] VALUES = values(); + + public static SqlUserType 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 SqlUserType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.User.SqlUserType) + } + + /** + * + * + *
+   * The type of retained password.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.User.DualPasswordType} + */ + public enum DualPasswordType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The default value.
+     * 
+ * + * DUAL_PASSWORD_TYPE_UNSPECIFIED = 0; + */ + DUAL_PASSWORD_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Do not update the user's dual password status.
+     * 
+ * + * NO_MODIFY_DUAL_PASSWORD = 1; + */ + NO_MODIFY_DUAL_PASSWORD(1), + /** + * + * + *
+     * No dual password usable for connecting using this user.
+     * 
+ * + * NO_DUAL_PASSWORD = 2; + */ + NO_DUAL_PASSWORD(2), + /** + * + * + *
+     * Dual password usable for connecting using this user.
+     * 
+ * + * DUAL_PASSWORD = 3; + */ + DUAL_PASSWORD(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DualPasswordType"); + } + + /** + * + * + *
+     * The default value.
+     * 
+ * + * DUAL_PASSWORD_TYPE_UNSPECIFIED = 0; + */ + public static final int DUAL_PASSWORD_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Do not update the user's dual password status.
+     * 
+ * + * NO_MODIFY_DUAL_PASSWORD = 1; + */ + public static final int NO_MODIFY_DUAL_PASSWORD_VALUE = 1; + + /** + * + * + *
+     * No dual password usable for connecting using this user.
+     * 
+ * + * NO_DUAL_PASSWORD = 2; + */ + public static final int NO_DUAL_PASSWORD_VALUE = 2; + + /** + * + * + *
+     * Dual password usable for connecting using this user.
+     * 
+ * + * DUAL_PASSWORD = 3; + */ + public static final int DUAL_PASSWORD_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 DualPasswordType 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 DualPasswordType forNumber(int value) { + switch (value) { + case 0: + return DUAL_PASSWORD_TYPE_UNSPECIFIED; + case 1: + return NO_MODIFY_DUAL_PASSWORD; + case 2: + return NO_DUAL_PASSWORD; + case 3: + return DUAL_PASSWORD; + 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 DualPasswordType findValueByNumber(int number) { + return DualPasswordType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.User.getDescriptor().getEnumTypes().get(1); + } + + private static final DualPasswordType[] VALUES = values(); + + public static DualPasswordType 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 DualPasswordType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.User.DualPasswordType) + } + + /** + * + * + *
+   * Indicates if a group is available for IAM database authentication.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1.User.IamStatus} + */ + public enum IamStatus implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The default value for users that are not of type CLOUD_IAM_GROUP.
+     * Only CLOUD_IAM_GROUP users will be inactive or active.
+     * Users with an IamStatus of IAM_STATUS_UNSPECIFIED will not
+     * display whether they are active or inactive as that is not applicable to
+     * them.
+     * 
+ * + * IAM_STATUS_UNSPECIFIED = 0; + */ + IAM_STATUS_UNSPECIFIED(0), + /** + * + * + *
+     * INACTIVE indicates a group is not available for IAM database
+     * authentication.
+     * 
+ * + * INACTIVE = 1; + */ + INACTIVE(1), + /** + * + * + *
+     * ACTIVE indicates a group is available for IAM database authentication.
+     * 
+ * + * ACTIVE = 2; + */ + ACTIVE(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "IamStatus"); + } + + /** + * + * + *
+     * The default value for users that are not of type CLOUD_IAM_GROUP.
+     * Only CLOUD_IAM_GROUP users will be inactive or active.
+     * Users with an IamStatus of IAM_STATUS_UNSPECIFIED will not
+     * display whether they are active or inactive as that is not applicable to
+     * them.
+     * 
+ * + * IAM_STATUS_UNSPECIFIED = 0; + */ + public static final int IAM_STATUS_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * INACTIVE indicates a group is not available for IAM database
+     * authentication.
+     * 
+ * + * INACTIVE = 1; + */ + public static final int INACTIVE_VALUE = 1; + + /** + * + * + *
+     * ACTIVE indicates a group is available for IAM database authentication.
+     * 
+ * + * ACTIVE = 2; + */ + public static final int ACTIVE_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 IamStatus 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 IamStatus forNumber(int value) { + switch (value) { + case 0: + return IAM_STATUS_UNSPECIFIED; + case 1: + return INACTIVE; + case 2: + return ACTIVE; + 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 IamStatus findValueByNumber(int number) { + return IamStatus.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1.User.getDescriptor().getEnumTypes().get(2); + } + + private static final IamStatus[] VALUES = values(); + + public static IamStatus 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 IamStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1.User.IamStatus) + } + + private int bitField0_; + private int userDetailsCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object userDetails_; + + public enum UserDetailsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SQLSERVER_USER_DETAILS(9), + USERDETAILS_NOT_SET(0); + private final int value; + + private UserDetailsCase(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 UserDetailsCase valueOf(int value) { + return forNumber(value); + } + + public static UserDetailsCase forNumber(int value) { + switch (value) { + case 9: + return SQLSERVER_USER_DETAILS; + case 0: + return USERDETAILS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public UserDetailsCase getUserDetailsCase() { + return UserDetailsCase.forNumber(userDetailsCase_); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#user`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#user`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + + /** + * + * + *
+   * The password for the user.
+   * 
+ * + * string password = 2; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + + /** + * + * + *
+   * The password for the user.
+   * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the user in the Cloud SQL instance. Can be omitted for
+   * `update` because it is already specified in the URL.
+   * 
+ * + * string name = 4; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the user in the Cloud SQL instance. Can be omitted for
+   * `update` because it is already specified in the URL.
+   * 
+ * + * string name = 4; + * + * @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 HOST_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object host_ = ""; + + /** + * + * + *
+   * Optional. The host from which the user can connect. For `insert`
+   * operations, host defaults to an empty string. For `update`
+   * operations, host is specified as part of the request URL. The host name
+   * cannot be updated after insertion.  For a MySQL instance, it's required;
+   * for a PostgreSQL or SQL Server instance, it's optional.
+   * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The host. + */ + @java.lang.Override + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The host from which the user can connect. For `insert`
+   * operations, host defaults to an empty string. For `update`
+   * operations, host is specified as part of the request URL. The host name
+   * cannot be updated after insertion.  For a MySQL instance, it's required;
+   * for a PostgreSQL or SQL Server instance, it's optional.
+   * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for host. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * Can be omitted for `update` because it is already specified on the
+   * URL.
+   * 
+ * + * string instance = 6; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * Can be omitted for `update` because it is already specified on the
+   * URL.
+   * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable. Can be omitted for `update` because
+   * it is already specified on the URL.
+   * 
+ * + * string project = 7; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable. Can be omitted for `update` because
+   * it is already specified on the URL.
+   * 
+ * + * string project = 7; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 8; + private int type_ = 0; + + /** + * + * + *
+   * The user type. It determines the method to authenticate the user during
+   * login. The default is the database's built-in user type.
+   * 
+ * + * .google.cloud.sql.v1.User.SqlUserType type = 8; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * The user type. It determines the method to authenticate the user during
+   * login. The default is the database's built-in user type.
+   * 
+ * + * .google.cloud.sql.v1.User.SqlUserType type = 8; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1.User.SqlUserType getType() { + com.google.cloud.sql.v1.User.SqlUserType result = + com.google.cloud.sql.v1.User.SqlUserType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1.User.SqlUserType.UNRECOGNIZED : result; + } + + public static final int SQLSERVER_USER_DETAILS_FIELD_NUMBER = 9; + + /** + * .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; + * + * @return Whether the sqlserverUserDetails field is set. + */ + @java.lang.Override + public boolean hasSqlserverUserDetails() { + return userDetailsCase_ == 9; + } + + /** + * .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; + * + * @return The sqlserverUserDetails. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerUserDetails getSqlserverUserDetails() { + if (userDetailsCase_ == 9) { + return (com.google.cloud.sql.v1.SqlServerUserDetails) userDetails_; + } + return com.google.cloud.sql.v1.SqlServerUserDetails.getDefaultInstance(); + } + + /** .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerUserDetailsOrBuilder getSqlserverUserDetailsOrBuilder() { + if (userDetailsCase_ == 9) { + return (com.google.cloud.sql.v1.SqlServerUserDetails) userDetails_; + } + return com.google.cloud.sql.v1.SqlServerUserDetails.getDefaultInstance(); + } + + public static final int IAM_EMAIL_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object iamEmail_ = ""; + + /** + * + * + *
+   * Optional. The full email for an IAM user. For normal database users, this
+   * will not be filled. Only applicable to MySQL database users.
+   * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The iamEmail. + */ + @java.lang.Override + public java.lang.String getIamEmail() { + java.lang.Object ref = iamEmail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + iamEmail_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The full email for an IAM user. For normal database users, this
+   * will not be filled. Only applicable to MySQL database users.
+   * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for iamEmail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIamEmailBytes() { + java.lang.Object ref = iamEmail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + iamEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_POLICY_FIELD_NUMBER = 12; + private com.google.cloud.sql.v1.UserPasswordValidationPolicy passwordPolicy_; + + /** + * + * + *
+   * User level password validation policy.
+   * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + * + * @return Whether the passwordPolicy field is set. + */ + @java.lang.Override + public boolean hasPasswordPolicy() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * User level password validation policy.
+   * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + * + * @return The passwordPolicy. + */ + @java.lang.Override + public com.google.cloud.sql.v1.UserPasswordValidationPolicy getPasswordPolicy() { + return passwordPolicy_ == null + ? com.google.cloud.sql.v1.UserPasswordValidationPolicy.getDefaultInstance() + : passwordPolicy_; + } + + /** + * + * + *
+   * User level password validation policy.
+   * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + */ + @java.lang.Override + public com.google.cloud.sql.v1.UserPasswordValidationPolicyOrBuilder + getPasswordPolicyOrBuilder() { + return passwordPolicy_ == null + ? com.google.cloud.sql.v1.UserPasswordValidationPolicy.getDefaultInstance() + : passwordPolicy_; + } + + public static final int DUAL_PASSWORD_TYPE_FIELD_NUMBER = 13; + private int dualPasswordType_ = 0; + + /** + * + * + *
+   * Dual password status for the user.
+   * 
+ * + * optional .google.cloud.sql.v1.User.DualPasswordType dual_password_type = 13; + * + * @return Whether the dualPasswordType field is set. + */ + @java.lang.Override + public boolean hasDualPasswordType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Dual password status for the user.
+   * 
+ * + * optional .google.cloud.sql.v1.User.DualPasswordType dual_password_type = 13; + * + * @return The enum numeric value on the wire for dualPasswordType. + */ + @java.lang.Override + public int getDualPasswordTypeValue() { + return dualPasswordType_; + } + + /** + * + * + *
+   * Dual password status for the user.
+   * 
+ * + * optional .google.cloud.sql.v1.User.DualPasswordType dual_password_type = 13; + * + * @return The dualPasswordType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.User.DualPasswordType getDualPasswordType() { + com.google.cloud.sql.v1.User.DualPasswordType result = + com.google.cloud.sql.v1.User.DualPasswordType.forNumber(dualPasswordType_); + return result == null ? com.google.cloud.sql.v1.User.DualPasswordType.UNRECOGNIZED : result; + } + + public static final int IAM_STATUS_FIELD_NUMBER = 14; + private int iamStatus_ = 0; + + /** + * + * + *
+   * Indicates if a group is active or inactive for IAM database authentication.
+   * 
+ * + * optional .google.cloud.sql.v1.User.IamStatus iam_status = 14; + * + * @return Whether the iamStatus field is set. + */ + @java.lang.Override + public boolean hasIamStatus() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Indicates if a group is active or inactive for IAM database authentication.
+   * 
+ * + * optional .google.cloud.sql.v1.User.IamStatus iam_status = 14; + * + * @return The enum numeric value on the wire for iamStatus. + */ + @java.lang.Override + public int getIamStatusValue() { + return iamStatus_; + } + + /** + * + * + *
+   * Indicates if a group is active or inactive for IAM database authentication.
+   * 
+ * + * optional .google.cloud.sql.v1.User.IamStatus iam_status = 14; + * + * @return The iamStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1.User.IamStatus getIamStatus() { + com.google.cloud.sql.v1.User.IamStatus result = + com.google.cloud.sql.v1.User.IamStatus.forNumber(iamStatus_); + return result == null ? com.google.cloud.sql.v1.User.IamStatus.UNRECOGNIZED : result; + } + + public static final int DATABASE_ROLES_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList databaseRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + public com.google.protobuf.ProtocolStringList getDatabaseRolesList() { + return databaseRoles_; + } + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + public int getDatabaseRolesCount() { + return databaseRoles_.size(); + } + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + public java.lang.String getDatabaseRoles(int index) { + return databaseRoles_.get(index); + } + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + public com.google.protobuf.ByteString getDatabaseRolesBytes(int index) { + return databaseRoles_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, password_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, host_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, project_); + } + if (type_ != com.google.cloud.sql.v1.User.SqlUserType.BUILT_IN.getNumber()) { + output.writeEnum(8, type_); + } + if (userDetailsCase_ == 9) { + output.writeMessage(9, (com.google.cloud.sql.v1.SqlServerUserDetails) userDetails_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(iamEmail_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, iamEmail_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(12, getPasswordPolicy()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeEnum(13, dualPasswordType_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeEnum(14, iamStatus_); + } + for (int i = 0; i < databaseRoles_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 15, databaseRoles_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, password_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, host_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, project_); + } + if (type_ != com.google.cloud.sql.v1.User.SqlUserType.BUILT_IN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, type_); + } + if (userDetailsCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.cloud.sql.v1.SqlServerUserDetails) userDetails_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(iamEmail_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, iamEmail_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getPasswordPolicy()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, dualPasswordType_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(14, iamStatus_); + } + { + int dataSize = 0; + for (int i = 0; i < databaseRoles_.size(); i++) { + dataSize += computeStringSizeNoTag(databaseRoles_.getRaw(i)); + } + size += dataSize; + size += 1 * getDatabaseRolesList().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.sql.v1.User)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.User other = (com.google.cloud.sql.v1.User) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getName().equals(other.getName())) return false; + if (!getHost().equals(other.getHost())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (type_ != other.type_) return false; + if (!getIamEmail().equals(other.getIamEmail())) return false; + if (hasPasswordPolicy() != other.hasPasswordPolicy()) return false; + if (hasPasswordPolicy()) { + if (!getPasswordPolicy().equals(other.getPasswordPolicy())) return false; + } + if (hasDualPasswordType() != other.hasDualPasswordType()) return false; + if (hasDualPasswordType()) { + if (dualPasswordType_ != other.dualPasswordType_) return false; + } + if (hasIamStatus() != other.hasIamStatus()) return false; + if (hasIamStatus()) { + if (iamStatus_ != other.iamStatus_) return false; + } + if (!getDatabaseRolesList().equals(other.getDatabaseRolesList())) return false; + if (!getUserDetailsCase().equals(other.getUserDetailsCase())) return false; + switch (userDetailsCase_) { + case 9: + if (!getSqlserverUserDetails().equals(other.getSqlserverUserDetails())) 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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + IAM_EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getIamEmail().hashCode(); + if (hasPasswordPolicy()) { + hash = (37 * hash) + PASSWORD_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPasswordPolicy().hashCode(); + } + if (hasDualPasswordType()) { + hash = (37 * hash) + DUAL_PASSWORD_TYPE_FIELD_NUMBER; + hash = (53 * hash) + dualPasswordType_; + } + if (hasIamStatus()) { + hash = (37 * hash) + IAM_STATUS_FIELD_NUMBER; + hash = (53 * hash) + iamStatus_; + } + if (getDatabaseRolesCount() > 0) { + hash = (37 * hash) + DATABASE_ROLES_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseRolesList().hashCode(); + } + switch (userDetailsCase_) { + case 9: + hash = (37 * hash) + SQLSERVER_USER_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getSqlserverUserDetails().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.User parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.User parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.User parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.User parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.User parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.User parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.User parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.User parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.User parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.User parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.User parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.User parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.User prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A Cloud SQL user resource.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.User} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.User) + com.google.cloud.sql.v1.UserOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.User.class, com.google.cloud.sql.v1.User.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.User.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPasswordPolicyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + password_ = ""; + etag_ = ""; + name_ = ""; + host_ = ""; + instance_ = ""; + project_ = ""; + type_ = 0; + if (sqlserverUserDetailsBuilder_ != null) { + sqlserverUserDetailsBuilder_.clear(); + } + iamEmail_ = ""; + passwordPolicy_ = null; + if (passwordPolicyBuilder_ != null) { + passwordPolicyBuilder_.dispose(); + passwordPolicyBuilder_ = null; + } + dualPasswordType_ = 0; + iamStatus_ = 0; + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + userDetailsCase_ = 0; + userDetails_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_User_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.User getDefaultInstanceForType() { + return com.google.cloud.sql.v1.User.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.User build() { + com.google.cloud.sql.v1.User result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.User buildPartial() { + com.google.cloud.sql.v1.User result = new com.google.cloud.sql.v1.User(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.User result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.password_ = password_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.host_ = host_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.iamEmail_ = iamEmail_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000400) != 0)) { + result.passwordPolicy_ = + passwordPolicyBuilder_ == null ? passwordPolicy_ : passwordPolicyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.dualPasswordType_ = dualPasswordType_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.iamStatus_ = iamStatus_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + databaseRoles_.makeImmutable(); + result.databaseRoles_ = databaseRoles_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.sql.v1.User result) { + result.userDetailsCase_ = userDetailsCase_; + result.userDetails_ = this.userDetails_; + if (userDetailsCase_ == 9 && sqlserverUserDetailsBuilder_ != null) { + result.userDetails_ = sqlserverUserDetailsBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.User) { + return mergeFrom((com.google.cloud.sql.v1.User) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.User other) { + if (other == com.google.cloud.sql.v1.User.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getHost().isEmpty()) { + host_ = other.host_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getIamEmail().isEmpty()) { + iamEmail_ = other.iamEmail_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (other.hasPasswordPolicy()) { + mergePasswordPolicy(other.getPasswordPolicy()); + } + if (other.hasDualPasswordType()) { + setDualPasswordTypeValue(other.getDualPasswordTypeValue()); + } + if (other.hasIamStatus()) { + setIamStatusValue(other.getIamStatusValue()); + } + if (!other.databaseRoles_.isEmpty()) { + if (databaseRoles_.isEmpty()) { + databaseRoles_ = other.databaseRoles_; + bitField0_ |= 0x00002000; + } else { + ensureDatabaseRolesIsMutable(); + databaseRoles_.addAll(other.databaseRoles_); + } + onChanged(); + } + switch (other.getUserDetailsCase()) { + case SQLSERVER_USER_DETAILS: + { + mergeSqlserverUserDetails(other.getSqlserverUserDetails()); + break; + } + case USERDETAILS_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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + host_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 74: + { + input.readMessage( + internalGetSqlserverUserDetailsFieldBuilder().getBuilder(), extensionRegistry); + userDetailsCase_ = 9; + break; + } // case 74 + case 90: + { + iamEmail_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 90 + case 98: + { + input.readMessage( + internalGetPasswordPolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 98 + case 104: + { + dualPasswordType_ = input.readEnum(); + bitField0_ |= 0x00000800; + break; + } // case 104 + case 112: + { + iamStatus_ = input.readEnum(); + bitField0_ |= 0x00001000; + break; + } // case 112 + case 122: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(s); + break; + } // case 122 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int userDetailsCase_ = 0; + private java.lang.Object userDetails_; + + public UserDetailsCase getUserDetailsCase() { + return UserDetailsCase.forNumber(userDetailsCase_); + } + + public Builder clearUserDetails() { + userDetailsCase_ = 0; + userDetails_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#user`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#user`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#user`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#user`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#user`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + + /** + * + * + *
+     * The password for the user.
+     * 
+ * + * string password = 2; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The password for the user.
+     * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The password for the user.
+     * 
+ * + * string password = 2; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for the user.
+     * 
+ * + * string password = 2; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for the user.
+     * 
+ * + * string password = 2; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 3; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 3; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 3; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 3; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the user in the Cloud SQL instance. Can be omitted for
+     * `update` because it is already specified in the URL.
+     * 
+ * + * string name = 4; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the user in the Cloud SQL instance. Can be omitted for
+     * `update` because it is already specified in the URL.
+     * 
+ * + * string name = 4; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the user in the Cloud SQL instance. Can be omitted for
+     * `update` because it is already specified in the URL.
+     * 
+ * + * string name = 4; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the user in the Cloud SQL instance. Can be omitted for
+     * `update` because it is already specified in the URL.
+     * 
+ * + * string name = 4; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the user in the Cloud SQL instance. Can be omitted for
+     * `update` because it is already specified in the URL.
+     * 
+ * + * string name = 4; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object host_ = ""; + + /** + * + * + *
+     * Optional. The host from which the user can connect. For `insert`
+     * operations, host defaults to an empty string. For `update`
+     * operations, host is specified as part of the request URL. The host name
+     * cannot be updated after insertion.  For a MySQL instance, it's required;
+     * for a PostgreSQL or SQL Server instance, it's optional.
+     * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The host. + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The host from which the user can connect. For `insert`
+     * operations, host defaults to an empty string. For `update`
+     * operations, host is specified as part of the request URL. The host name
+     * cannot be updated after insertion.  For a MySQL instance, it's required;
+     * for a PostgreSQL or SQL Server instance, it's optional.
+     * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for host. + */ + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The host from which the user can connect. For `insert`
+     * operations, host defaults to an empty string. For `update`
+     * operations, host is specified as part of the request URL. The host name
+     * cannot be updated after insertion.  For a MySQL instance, it's required;
+     * for a PostgreSQL or SQL Server instance, it's optional.
+     * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The host to set. + * @return This builder for chaining. + */ + public Builder setHost(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + host_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The host from which the user can connect. For `insert`
+     * operations, host defaults to an empty string. For `update`
+     * operations, host is specified as part of the request URL. The host name
+     * cannot be updated after insertion.  For a MySQL instance, it's required;
+     * for a PostgreSQL or SQL Server instance, it's optional.
+     * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearHost() { + host_ = getDefaultInstance().getHost(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The host from which the user can connect. For `insert`
+     * operations, host defaults to an empty string. For `update`
+     * operations, host is specified as part of the request URL. The host name
+     * cannot be updated after insertion.  For a MySQL instance, it's required;
+     * for a PostgreSQL or SQL Server instance, it's optional.
+     * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for host to set. + * @return This builder for chaining. + */ + public Builder setHostBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + host_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * Can be omitted for `update` because it is already specified on the
+     * URL.
+     * 
+ * + * string instance = 6; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * Can be omitted for `update` because it is already specified on the
+     * URL.
+     * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * Can be omitted for `update` because it is already specified on the
+     * URL.
+     * 
+ * + * string instance = 6; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * Can be omitted for `update` because it is already specified on the
+     * URL.
+     * 
+ * + * string instance = 6; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * Can be omitted for `update` because it is already specified on the
+     * URL.
+     * 
+ * + * string instance = 6; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable. Can be omitted for `update` because
+     * it is already specified on the URL.
+     * 
+ * + * string project = 7; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable. Can be omitted for `update` because
+     * it is already specified on the URL.
+     * 
+ * + * string project = 7; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable. Can be omitted for `update` because
+     * it is already specified on the URL.
+     * 
+ * + * string project = 7; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable. Can be omitted for `update` because
+     * it is already specified on the URL.
+     * 
+ * + * string project = 7; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable. Can be omitted for `update` because
+     * it is already specified on the URL.
+     * 
+ * + * string project = 7; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private int type_ = 0; + + /** + * + * + *
+     * The user type. It determines the method to authenticate the user during
+     * login. The default is the database's built-in user type.
+     * 
+ * + * .google.cloud.sql.v1.User.SqlUserType type = 8; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * The user type. It determines the method to authenticate the user during
+     * login. The default is the database's built-in user type.
+     * 
+ * + * .google.cloud.sql.v1.User.SqlUserType type = 8; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The user type. It determines the method to authenticate the user during
+     * login. The default is the database's built-in user type.
+     * 
+ * + * .google.cloud.sql.v1.User.SqlUserType type = 8; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1.User.SqlUserType getType() { + com.google.cloud.sql.v1.User.SqlUserType result = + com.google.cloud.sql.v1.User.SqlUserType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1.User.SqlUserType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The user type. It determines the method to authenticate the user during
+     * login. The default is the database's built-in user type.
+     * 
+ * + * .google.cloud.sql.v1.User.SqlUserType type = 8; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.sql.v1.User.SqlUserType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The user type. It determines the method to authenticate the user during
+     * login. The default is the database's built-in user type.
+     * 
+ * + * .google.cloud.sql.v1.User.SqlUserType type = 8; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000080); + type_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlServerUserDetails, + com.google.cloud.sql.v1.SqlServerUserDetails.Builder, + com.google.cloud.sql.v1.SqlServerUserDetailsOrBuilder> + sqlserverUserDetailsBuilder_; + + /** + * .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; + * + * @return Whether the sqlserverUserDetails field is set. + */ + @java.lang.Override + public boolean hasSqlserverUserDetails() { + return userDetailsCase_ == 9; + } + + /** + * .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; + * + * @return The sqlserverUserDetails. + */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerUserDetails getSqlserverUserDetails() { + if (sqlserverUserDetailsBuilder_ == null) { + if (userDetailsCase_ == 9) { + return (com.google.cloud.sql.v1.SqlServerUserDetails) userDetails_; + } + return com.google.cloud.sql.v1.SqlServerUserDetails.getDefaultInstance(); + } else { + if (userDetailsCase_ == 9) { + return sqlserverUserDetailsBuilder_.getMessage(); + } + return com.google.cloud.sql.v1.SqlServerUserDetails.getDefaultInstance(); + } + } + + /** .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; */ + public Builder setSqlserverUserDetails(com.google.cloud.sql.v1.SqlServerUserDetails value) { + if (sqlserverUserDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userDetails_ = value; + onChanged(); + } else { + sqlserverUserDetailsBuilder_.setMessage(value); + } + userDetailsCase_ = 9; + return this; + } + + /** .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; */ + public Builder setSqlserverUserDetails( + com.google.cloud.sql.v1.SqlServerUserDetails.Builder builderForValue) { + if (sqlserverUserDetailsBuilder_ == null) { + userDetails_ = builderForValue.build(); + onChanged(); + } else { + sqlserverUserDetailsBuilder_.setMessage(builderForValue.build()); + } + userDetailsCase_ = 9; + return this; + } + + /** .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; */ + public Builder mergeSqlserverUserDetails(com.google.cloud.sql.v1.SqlServerUserDetails value) { + if (sqlserverUserDetailsBuilder_ == null) { + if (userDetailsCase_ == 9 + && userDetails_ != com.google.cloud.sql.v1.SqlServerUserDetails.getDefaultInstance()) { + userDetails_ = + com.google.cloud.sql.v1.SqlServerUserDetails.newBuilder( + (com.google.cloud.sql.v1.SqlServerUserDetails) userDetails_) + .mergeFrom(value) + .buildPartial(); + } else { + userDetails_ = value; + } + onChanged(); + } else { + if (userDetailsCase_ == 9) { + sqlserverUserDetailsBuilder_.mergeFrom(value); + } else { + sqlserverUserDetailsBuilder_.setMessage(value); + } + } + userDetailsCase_ = 9; + return this; + } + + /** .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; */ + public Builder clearSqlserverUserDetails() { + if (sqlserverUserDetailsBuilder_ == null) { + if (userDetailsCase_ == 9) { + userDetailsCase_ = 0; + userDetails_ = null; + onChanged(); + } + } else { + if (userDetailsCase_ == 9) { + userDetailsCase_ = 0; + userDetails_ = null; + } + sqlserverUserDetailsBuilder_.clear(); + } + return this; + } + + /** .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; */ + public com.google.cloud.sql.v1.SqlServerUserDetails.Builder getSqlserverUserDetailsBuilder() { + return internalGetSqlserverUserDetailsFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; */ + @java.lang.Override + public com.google.cloud.sql.v1.SqlServerUserDetailsOrBuilder + getSqlserverUserDetailsOrBuilder() { + if ((userDetailsCase_ == 9) && (sqlserverUserDetailsBuilder_ != null)) { + return sqlserverUserDetailsBuilder_.getMessageOrBuilder(); + } else { + if (userDetailsCase_ == 9) { + return (com.google.cloud.sql.v1.SqlServerUserDetails) userDetails_; + } + return com.google.cloud.sql.v1.SqlServerUserDetails.getDefaultInstance(); + } + } + + /** .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlServerUserDetails, + com.google.cloud.sql.v1.SqlServerUserDetails.Builder, + com.google.cloud.sql.v1.SqlServerUserDetailsOrBuilder> + internalGetSqlserverUserDetailsFieldBuilder() { + if (sqlserverUserDetailsBuilder_ == null) { + if (!(userDetailsCase_ == 9)) { + userDetails_ = com.google.cloud.sql.v1.SqlServerUserDetails.getDefaultInstance(); + } + sqlserverUserDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.SqlServerUserDetails, + com.google.cloud.sql.v1.SqlServerUserDetails.Builder, + com.google.cloud.sql.v1.SqlServerUserDetailsOrBuilder>( + (com.google.cloud.sql.v1.SqlServerUserDetails) userDetails_, + getParentForChildren(), + isClean()); + userDetails_ = null; + } + userDetailsCase_ = 9; + onChanged(); + return sqlserverUserDetailsBuilder_; + } + + private java.lang.Object iamEmail_ = ""; + + /** + * + * + *
+     * Optional. The full email for an IAM user. For normal database users, this
+     * will not be filled. Only applicable to MySQL database users.
+     * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The iamEmail. + */ + public java.lang.String getIamEmail() { + java.lang.Object ref = iamEmail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + iamEmail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The full email for an IAM user. For normal database users, this
+     * will not be filled. Only applicable to MySQL database users.
+     * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for iamEmail. + */ + public com.google.protobuf.ByteString getIamEmailBytes() { + java.lang.Object ref = iamEmail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + iamEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The full email for an IAM user. For normal database users, this
+     * will not be filled. Only applicable to MySQL database users.
+     * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The iamEmail to set. + * @return This builder for chaining. + */ + public Builder setIamEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + iamEmail_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The full email for an IAM user. For normal database users, this
+     * will not be filled. Only applicable to MySQL database users.
+     * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearIamEmail() { + iamEmail_ = getDefaultInstance().getIamEmail(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The full email for an IAM user. For normal database users, this
+     * will not be filled. Only applicable to MySQL database users.
+     * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for iamEmail to set. + * @return This builder for chaining. + */ + public Builder setIamEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + iamEmail_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.UserPasswordValidationPolicy passwordPolicy_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.UserPasswordValidationPolicy, + com.google.cloud.sql.v1.UserPasswordValidationPolicy.Builder, + com.google.cloud.sql.v1.UserPasswordValidationPolicyOrBuilder> + passwordPolicyBuilder_; + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + * + * @return Whether the passwordPolicy field is set. + */ + public boolean hasPasswordPolicy() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + * + * @return The passwordPolicy. + */ + public com.google.cloud.sql.v1.UserPasswordValidationPolicy getPasswordPolicy() { + if (passwordPolicyBuilder_ == null) { + return passwordPolicy_ == null + ? com.google.cloud.sql.v1.UserPasswordValidationPolicy.getDefaultInstance() + : passwordPolicy_; + } else { + return passwordPolicyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + */ + public Builder setPasswordPolicy(com.google.cloud.sql.v1.UserPasswordValidationPolicy value) { + if (passwordPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + passwordPolicy_ = value; + } else { + passwordPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + */ + public Builder setPasswordPolicy( + com.google.cloud.sql.v1.UserPasswordValidationPolicy.Builder builderForValue) { + if (passwordPolicyBuilder_ == null) { + passwordPolicy_ = builderForValue.build(); + } else { + passwordPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + */ + public Builder mergePasswordPolicy(com.google.cloud.sql.v1.UserPasswordValidationPolicy value) { + if (passwordPolicyBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && passwordPolicy_ != null + && passwordPolicy_ + != com.google.cloud.sql.v1.UserPasswordValidationPolicy.getDefaultInstance()) { + getPasswordPolicyBuilder().mergeFrom(value); + } else { + passwordPolicy_ = value; + } + } else { + passwordPolicyBuilder_.mergeFrom(value); + } + if (passwordPolicy_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + */ + public Builder clearPasswordPolicy() { + bitField0_ = (bitField0_ & ~0x00000400); + passwordPolicy_ = null; + if (passwordPolicyBuilder_ != null) { + passwordPolicyBuilder_.dispose(); + passwordPolicyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + */ + public com.google.cloud.sql.v1.UserPasswordValidationPolicy.Builder getPasswordPolicyBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return internalGetPasswordPolicyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + */ + public com.google.cloud.sql.v1.UserPasswordValidationPolicyOrBuilder + getPasswordPolicyOrBuilder() { + if (passwordPolicyBuilder_ != null) { + return passwordPolicyBuilder_.getMessageOrBuilder(); + } else { + return passwordPolicy_ == null + ? com.google.cloud.sql.v1.UserPasswordValidationPolicy.getDefaultInstance() + : passwordPolicy_; + } + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.UserPasswordValidationPolicy, + com.google.cloud.sql.v1.UserPasswordValidationPolicy.Builder, + com.google.cloud.sql.v1.UserPasswordValidationPolicyOrBuilder> + internalGetPasswordPolicyFieldBuilder() { + if (passwordPolicyBuilder_ == null) { + passwordPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.UserPasswordValidationPolicy, + com.google.cloud.sql.v1.UserPasswordValidationPolicy.Builder, + com.google.cloud.sql.v1.UserPasswordValidationPolicyOrBuilder>( + getPasswordPolicy(), getParentForChildren(), isClean()); + passwordPolicy_ = null; + } + return passwordPolicyBuilder_; + } + + private int dualPasswordType_ = 0; + + /** + * + * + *
+     * Dual password status for the user.
+     * 
+ * + * optional .google.cloud.sql.v1.User.DualPasswordType dual_password_type = 13; + * + * @return Whether the dualPasswordType field is set. + */ + @java.lang.Override + public boolean hasDualPasswordType() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Dual password status for the user.
+     * 
+ * + * optional .google.cloud.sql.v1.User.DualPasswordType dual_password_type = 13; + * + * @return The enum numeric value on the wire for dualPasswordType. + */ + @java.lang.Override + public int getDualPasswordTypeValue() { + return dualPasswordType_; + } + + /** + * + * + *
+     * Dual password status for the user.
+     * 
+ * + * optional .google.cloud.sql.v1.User.DualPasswordType dual_password_type = 13; + * + * @param value The enum numeric value on the wire for dualPasswordType to set. + * @return This builder for chaining. + */ + public Builder setDualPasswordTypeValue(int value) { + dualPasswordType_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Dual password status for the user.
+     * 
+ * + * optional .google.cloud.sql.v1.User.DualPasswordType dual_password_type = 13; + * + * @return The dualPasswordType. + */ + @java.lang.Override + public com.google.cloud.sql.v1.User.DualPasswordType getDualPasswordType() { + com.google.cloud.sql.v1.User.DualPasswordType result = + com.google.cloud.sql.v1.User.DualPasswordType.forNumber(dualPasswordType_); + return result == null ? com.google.cloud.sql.v1.User.DualPasswordType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Dual password status for the user.
+     * 
+ * + * optional .google.cloud.sql.v1.User.DualPasswordType dual_password_type = 13; + * + * @param value The dualPasswordType to set. + * @return This builder for chaining. + */ + public Builder setDualPasswordType(com.google.cloud.sql.v1.User.DualPasswordType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000800; + dualPasswordType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Dual password status for the user.
+     * 
+ * + * optional .google.cloud.sql.v1.User.DualPasswordType dual_password_type = 13; + * + * @return This builder for chaining. + */ + public Builder clearDualPasswordType() { + bitField0_ = (bitField0_ & ~0x00000800); + dualPasswordType_ = 0; + onChanged(); + return this; + } + + private int iamStatus_ = 0; + + /** + * + * + *
+     * Indicates if a group is active or inactive for IAM database authentication.
+     * 
+ * + * optional .google.cloud.sql.v1.User.IamStatus iam_status = 14; + * + * @return Whether the iamStatus field is set. + */ + @java.lang.Override + public boolean hasIamStatus() { + return ((bitField0_ & 0x00001000) != 0); + } + + /** + * + * + *
+     * Indicates if a group is active or inactive for IAM database authentication.
+     * 
+ * + * optional .google.cloud.sql.v1.User.IamStatus iam_status = 14; + * + * @return The enum numeric value on the wire for iamStatus. + */ + @java.lang.Override + public int getIamStatusValue() { + return iamStatus_; + } + + /** + * + * + *
+     * Indicates if a group is active or inactive for IAM database authentication.
+     * 
+ * + * optional .google.cloud.sql.v1.User.IamStatus iam_status = 14; + * + * @param value The enum numeric value on the wire for iamStatus to set. + * @return This builder for chaining. + */ + public Builder setIamStatusValue(int value) { + iamStatus_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates if a group is active or inactive for IAM database authentication.
+     * 
+ * + * optional .google.cloud.sql.v1.User.IamStatus iam_status = 14; + * + * @return The iamStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1.User.IamStatus getIamStatus() { + com.google.cloud.sql.v1.User.IamStatus result = + com.google.cloud.sql.v1.User.IamStatus.forNumber(iamStatus_); + return result == null ? com.google.cloud.sql.v1.User.IamStatus.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Indicates if a group is active or inactive for IAM database authentication.
+     * 
+ * + * optional .google.cloud.sql.v1.User.IamStatus iam_status = 14; + * + * @param value The iamStatus to set. + * @return This builder for chaining. + */ + public Builder setIamStatus(com.google.cloud.sql.v1.User.IamStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00001000; + iamStatus_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates if a group is active or inactive for IAM database authentication.
+     * 
+ * + * optional .google.cloud.sql.v1.User.IamStatus iam_status = 14; + * + * @return This builder for chaining. + */ + public Builder clearIamStatus() { + bitField0_ = (bitField0_ & ~0x00001000); + iamStatus_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList databaseRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDatabaseRolesIsMutable() { + if (!databaseRoles_.isModifiable()) { + databaseRoles_ = new com.google.protobuf.LazyStringArrayList(databaseRoles_); + } + bitField0_ |= 0x00002000; + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + public com.google.protobuf.ProtocolStringList getDatabaseRolesList() { + databaseRoles_.makeImmutable(); + return databaseRoles_; + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + public int getDatabaseRolesCount() { + return databaseRoles_.size(); + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + public java.lang.String getDatabaseRoles(int index) { + return databaseRoles_.get(index); + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + public com.google.protobuf.ByteString getDatabaseRolesBytes(int index) { + return databaseRoles_.getByteString(index); + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The databaseRoles to set. + * @return This builder for chaining. + */ + public Builder setDatabaseRoles(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseRolesIsMutable(); + databaseRoles_.set(index, value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addDatabaseRoles(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addAllDatabaseRoles(java.lang.Iterable values) { + ensureDatabaseRolesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, databaseRoles_); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseRoles() { + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addDatabaseRolesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.User) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.User) + private static final com.google.cloud.sql.v1.User DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.User(); + } + + public static com.google.cloud.sql.v1.User getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public User parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.User getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UserOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UserOrBuilder.java new file mode 100644 index 000000000000..4e00253b6232 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UserOrBuilder.java @@ -0,0 +1,474 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface UserOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.User) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#user`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#user`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The password for the user.
+   * 
+ * + * string password = 2; + * + * @return The password. + */ + java.lang.String getPassword(); + + /** + * + * + *
+   * The password for the user.
+   * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * The name of the user in the Cloud SQL instance. Can be omitted for
+   * `update` because it is already specified in the URL.
+   * 
+ * + * string name = 4; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the user in the Cloud SQL instance. Can be omitted for
+   * `update` because it is already specified in the URL.
+   * 
+ * + * string name = 4; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The host from which the user can connect. For `insert`
+   * operations, host defaults to an empty string. For `update`
+   * operations, host is specified as part of the request URL. The host name
+   * cannot be updated after insertion.  For a MySQL instance, it's required;
+   * for a PostgreSQL or SQL Server instance, it's optional.
+   * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The host. + */ + java.lang.String getHost(); + + /** + * + * + *
+   * Optional. The host from which the user can connect. For `insert`
+   * operations, host defaults to an empty string. For `update`
+   * operations, host is specified as part of the request URL. The host name
+   * cannot be updated after insertion.  For a MySQL instance, it's required;
+   * for a PostgreSQL or SQL Server instance, it's optional.
+   * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for host. + */ + com.google.protobuf.ByteString getHostBytes(); + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * Can be omitted for `update` because it is already specified on the
+   * URL.
+   * 
+ * + * string instance = 6; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * Can be omitted for `update` because it is already specified on the
+   * URL.
+   * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable. Can be omitted for `update` because
+   * it is already specified on the URL.
+   * 
+ * + * string project = 7; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable. Can be omitted for `update` because
+   * it is already specified on the URL.
+   * 
+ * + * string project = 7; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * The user type. It determines the method to authenticate the user during
+   * login. The default is the database's built-in user type.
+   * 
+ * + * .google.cloud.sql.v1.User.SqlUserType type = 8; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * The user type. It determines the method to authenticate the user during
+   * login. The default is the database's built-in user type.
+   * 
+ * + * .google.cloud.sql.v1.User.SqlUserType type = 8; + * + * @return The type. + */ + com.google.cloud.sql.v1.User.SqlUserType getType(); + + /** + * .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; + * + * @return Whether the sqlserverUserDetails field is set. + */ + boolean hasSqlserverUserDetails(); + + /** + * .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; + * + * @return The sqlserverUserDetails. + */ + com.google.cloud.sql.v1.SqlServerUserDetails getSqlserverUserDetails(); + + /** .google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9; */ + com.google.cloud.sql.v1.SqlServerUserDetailsOrBuilder getSqlserverUserDetailsOrBuilder(); + + /** + * + * + *
+   * Optional. The full email for an IAM user. For normal database users, this
+   * will not be filled. Only applicable to MySQL database users.
+   * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The iamEmail. + */ + java.lang.String getIamEmail(); + + /** + * + * + *
+   * Optional. The full email for an IAM user. For normal database users, this
+   * will not be filled. Only applicable to MySQL database users.
+   * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for iamEmail. + */ + com.google.protobuf.ByteString getIamEmailBytes(); + + /** + * + * + *
+   * User level password validation policy.
+   * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + * + * @return Whether the passwordPolicy field is set. + */ + boolean hasPasswordPolicy(); + + /** + * + * + *
+   * User level password validation policy.
+   * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + * + * @return The passwordPolicy. + */ + com.google.cloud.sql.v1.UserPasswordValidationPolicy getPasswordPolicy(); + + /** + * + * + *
+   * User level password validation policy.
+   * 
+ * + * .google.cloud.sql.v1.UserPasswordValidationPolicy password_policy = 12; + */ + com.google.cloud.sql.v1.UserPasswordValidationPolicyOrBuilder getPasswordPolicyOrBuilder(); + + /** + * + * + *
+   * Dual password status for the user.
+   * 
+ * + * optional .google.cloud.sql.v1.User.DualPasswordType dual_password_type = 13; + * + * @return Whether the dualPasswordType field is set. + */ + boolean hasDualPasswordType(); + + /** + * + * + *
+   * Dual password status for the user.
+   * 
+ * + * optional .google.cloud.sql.v1.User.DualPasswordType dual_password_type = 13; + * + * @return The enum numeric value on the wire for dualPasswordType. + */ + int getDualPasswordTypeValue(); + + /** + * + * + *
+   * Dual password status for the user.
+   * 
+ * + * optional .google.cloud.sql.v1.User.DualPasswordType dual_password_type = 13; + * + * @return The dualPasswordType. + */ + com.google.cloud.sql.v1.User.DualPasswordType getDualPasswordType(); + + /** + * + * + *
+   * Indicates if a group is active or inactive for IAM database authentication.
+   * 
+ * + * optional .google.cloud.sql.v1.User.IamStatus iam_status = 14; + * + * @return Whether the iamStatus field is set. + */ + boolean hasIamStatus(); + + /** + * + * + *
+   * Indicates if a group is active or inactive for IAM database authentication.
+   * 
+ * + * optional .google.cloud.sql.v1.User.IamStatus iam_status = 14; + * + * @return The enum numeric value on the wire for iamStatus. + */ + int getIamStatusValue(); + + /** + * + * + *
+   * Indicates if a group is active or inactive for IAM database authentication.
+   * 
+ * + * optional .google.cloud.sql.v1.User.IamStatus iam_status = 14; + * + * @return The iamStatus. + */ + com.google.cloud.sql.v1.User.IamStatus getIamStatus(); + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + java.util.List getDatabaseRolesList(); + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + int getDatabaseRolesCount(); + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + java.lang.String getDatabaseRoles(int index); + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + com.google.protobuf.ByteString getDatabaseRolesBytes(int index); + + com.google.cloud.sql.v1.User.UserDetailsCase getUserDetailsCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UserPasswordValidationPolicy.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UserPasswordValidationPolicy.java new file mode 100644 index 000000000000..e8392024db43 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UserPasswordValidationPolicy.java @@ -0,0 +1,1301 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * User level password validation policy.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.UserPasswordValidationPolicy} + */ +@com.google.protobuf.Generated +public final class UserPasswordValidationPolicy extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.UserPasswordValidationPolicy) + UserPasswordValidationPolicyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UserPasswordValidationPolicy"); + } + + // Use UserPasswordValidationPolicy.newBuilder() to construct. + private UserPasswordValidationPolicy(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UserPasswordValidationPolicy() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_UserPasswordValidationPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_UserPasswordValidationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.UserPasswordValidationPolicy.class, + com.google.cloud.sql.v1.UserPasswordValidationPolicy.Builder.class); + } + + private int bitField0_; + public static final int ALLOWED_FAILED_ATTEMPTS_FIELD_NUMBER = 1; + private int allowedFailedAttempts_ = 0; + + /** + * + * + *
+   * Number of failed login attempts allowed before user get locked.
+   * 
+ * + * int32 allowed_failed_attempts = 1; + * + * @return The allowedFailedAttempts. + */ + @java.lang.Override + public int getAllowedFailedAttempts() { + return allowedFailedAttempts_; + } + + public static final int PASSWORD_EXPIRATION_DURATION_FIELD_NUMBER = 2; + private com.google.protobuf.Duration passwordExpirationDuration_; + + /** + * + * + *
+   * Expiration duration after password is updated.
+   * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + * + * @return Whether the passwordExpirationDuration field is set. + */ + @java.lang.Override + public boolean hasPasswordExpirationDuration() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Expiration duration after password is updated.
+   * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + * + * @return The passwordExpirationDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getPasswordExpirationDuration() { + return passwordExpirationDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordExpirationDuration_; + } + + /** + * + * + *
+   * Expiration duration after password is updated.
+   * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getPasswordExpirationDurationOrBuilder() { + return passwordExpirationDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordExpirationDuration_; + } + + public static final int ENABLE_FAILED_ATTEMPTS_CHECK_FIELD_NUMBER = 3; + private boolean enableFailedAttemptsCheck_ = false; + + /** + * + * + *
+   * If true, failed login attempts check will be enabled.
+   * 
+ * + * bool enable_failed_attempts_check = 3; + * + * @return The enableFailedAttemptsCheck. + */ + @java.lang.Override + public boolean getEnableFailedAttemptsCheck() { + return enableFailedAttemptsCheck_; + } + + public static final int STATUS_FIELD_NUMBER = 4; + private com.google.cloud.sql.v1.PasswordStatus status_; + + /** + * + * + *
+   * Output only. Read-only password status.
+   * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. Read-only password status.
+   * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The status. + */ + @java.lang.Override + public com.google.cloud.sql.v1.PasswordStatus getStatus() { + return status_ == null ? com.google.cloud.sql.v1.PasswordStatus.getDefaultInstance() : status_; + } + + /** + * + * + *
+   * Output only. Read-only password status.
+   * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1.PasswordStatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.cloud.sql.v1.PasswordStatus.getDefaultInstance() : status_; + } + + public static final int ENABLE_PASSWORD_VERIFICATION_FIELD_NUMBER = 5; + private boolean enablePasswordVerification_ = false; + + /** + * + * + *
+   * If true, the user must specify the current password before changing the
+   * password. This flag is supported only for MySQL.
+   * 
+ * + * bool enable_password_verification = 5; + * + * @return The enablePasswordVerification. + */ + @java.lang.Override + public boolean getEnablePasswordVerification() { + return enablePasswordVerification_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (allowedFailedAttempts_ != 0) { + output.writeInt32(1, allowedFailedAttempts_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getPasswordExpirationDuration()); + } + if (enableFailedAttemptsCheck_ != false) { + output.writeBool(3, enableFailedAttemptsCheck_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getStatus()); + } + if (enablePasswordVerification_ != false) { + output.writeBool(5, enablePasswordVerification_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (allowedFailedAttempts_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, allowedFailedAttempts_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getPasswordExpirationDuration()); + } + if (enableFailedAttemptsCheck_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, enableFailedAttemptsCheck_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStatus()); + } + if (enablePasswordVerification_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, enablePasswordVerification_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.UserPasswordValidationPolicy)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.UserPasswordValidationPolicy other = + (com.google.cloud.sql.v1.UserPasswordValidationPolicy) obj; + + if (getAllowedFailedAttempts() != other.getAllowedFailedAttempts()) return false; + if (hasPasswordExpirationDuration() != other.hasPasswordExpirationDuration()) return false; + if (hasPasswordExpirationDuration()) { + if (!getPasswordExpirationDuration().equals(other.getPasswordExpirationDuration())) + return false; + } + if (getEnableFailedAttemptsCheck() != other.getEnableFailedAttemptsCheck()) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (getEnablePasswordVerification() != other.getEnablePasswordVerification()) return false; + if (!getUnknownFields().equals(other.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) + ALLOWED_FAILED_ATTEMPTS_FIELD_NUMBER; + hash = (53 * hash) + getAllowedFailedAttempts(); + if (hasPasswordExpirationDuration()) { + hash = (37 * hash) + PASSWORD_EXPIRATION_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getPasswordExpirationDuration().hashCode(); + } + hash = (37 * hash) + ENABLE_FAILED_ATTEMPTS_CHECK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableFailedAttemptsCheck()); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (37 * hash) + ENABLE_PASSWORD_VERIFICATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnablePasswordVerification()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.UserPasswordValidationPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.UserPasswordValidationPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UserPasswordValidationPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.UserPasswordValidationPolicy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UserPasswordValidationPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.UserPasswordValidationPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UserPasswordValidationPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.UserPasswordValidationPolicy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UserPasswordValidationPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.UserPasswordValidationPolicy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UserPasswordValidationPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.UserPasswordValidationPolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.UserPasswordValidationPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * User level password validation policy.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.UserPasswordValidationPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.UserPasswordValidationPolicy) + com.google.cloud.sql.v1.UserPasswordValidationPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_UserPasswordValidationPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_UserPasswordValidationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.UserPasswordValidationPolicy.class, + com.google.cloud.sql.v1.UserPasswordValidationPolicy.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.UserPasswordValidationPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPasswordExpirationDurationFieldBuilder(); + internalGetStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + allowedFailedAttempts_ = 0; + passwordExpirationDuration_ = null; + if (passwordExpirationDurationBuilder_ != null) { + passwordExpirationDurationBuilder_.dispose(); + passwordExpirationDurationBuilder_ = null; + } + enableFailedAttemptsCheck_ = false; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + enablePasswordVerification_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_UserPasswordValidationPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.UserPasswordValidationPolicy getDefaultInstanceForType() { + return com.google.cloud.sql.v1.UserPasswordValidationPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.UserPasswordValidationPolicy build() { + com.google.cloud.sql.v1.UserPasswordValidationPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.UserPasswordValidationPolicy buildPartial() { + com.google.cloud.sql.v1.UserPasswordValidationPolicy result = + new com.google.cloud.sql.v1.UserPasswordValidationPolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.UserPasswordValidationPolicy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.allowedFailedAttempts_ = allowedFailedAttempts_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.passwordExpirationDuration_ = + passwordExpirationDurationBuilder_ == null + ? passwordExpirationDuration_ + : passwordExpirationDurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.enableFailedAttemptsCheck_ = enableFailedAttemptsCheck_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.enablePasswordVerification_ = enablePasswordVerification_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.UserPasswordValidationPolicy) { + return mergeFrom((com.google.cloud.sql.v1.UserPasswordValidationPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.UserPasswordValidationPolicy other) { + if (other == com.google.cloud.sql.v1.UserPasswordValidationPolicy.getDefaultInstance()) + return this; + if (other.getAllowedFailedAttempts() != 0) { + setAllowedFailedAttempts(other.getAllowedFailedAttempts()); + } + if (other.hasPasswordExpirationDuration()) { + mergePasswordExpirationDuration(other.getPasswordExpirationDuration()); + } + if (other.getEnableFailedAttemptsCheck() != false) { + setEnableFailedAttemptsCheck(other.getEnableFailedAttemptsCheck()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.getEnablePasswordVerification() != false) { + setEnablePasswordVerification(other.getEnablePasswordVerification()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + allowedFailedAttempts_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetPasswordExpirationDurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + enableFailedAttemptsCheck_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage(internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + enablePasswordVerification_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int allowedFailedAttempts_; + + /** + * + * + *
+     * Number of failed login attempts allowed before user get locked.
+     * 
+ * + * int32 allowed_failed_attempts = 1; + * + * @return The allowedFailedAttempts. + */ + @java.lang.Override + public int getAllowedFailedAttempts() { + return allowedFailedAttempts_; + } + + /** + * + * + *
+     * Number of failed login attempts allowed before user get locked.
+     * 
+ * + * int32 allowed_failed_attempts = 1; + * + * @param value The allowedFailedAttempts to set. + * @return This builder for chaining. + */ + public Builder setAllowedFailedAttempts(int value) { + + allowedFailedAttempts_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of failed login attempts allowed before user get locked.
+     * 
+ * + * int32 allowed_failed_attempts = 1; + * + * @return This builder for chaining. + */ + public Builder clearAllowedFailedAttempts() { + bitField0_ = (bitField0_ & ~0x00000001); + allowedFailedAttempts_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Duration passwordExpirationDuration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + passwordExpirationDurationBuilder_; + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + * + * @return Whether the passwordExpirationDuration field is set. + */ + public boolean hasPasswordExpirationDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + * + * @return The passwordExpirationDuration. + */ + public com.google.protobuf.Duration getPasswordExpirationDuration() { + if (passwordExpirationDurationBuilder_ == null) { + return passwordExpirationDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordExpirationDuration_; + } else { + return passwordExpirationDurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + public Builder setPasswordExpirationDuration(com.google.protobuf.Duration value) { + if (passwordExpirationDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + passwordExpirationDuration_ = value; + } else { + passwordExpirationDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + public Builder setPasswordExpirationDuration( + com.google.protobuf.Duration.Builder builderForValue) { + if (passwordExpirationDurationBuilder_ == null) { + passwordExpirationDuration_ = builderForValue.build(); + } else { + passwordExpirationDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + public Builder mergePasswordExpirationDuration(com.google.protobuf.Duration value) { + if (passwordExpirationDurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && passwordExpirationDuration_ != null + && passwordExpirationDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getPasswordExpirationDurationBuilder().mergeFrom(value); + } else { + passwordExpirationDuration_ = value; + } + } else { + passwordExpirationDurationBuilder_.mergeFrom(value); + } + if (passwordExpirationDuration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + public Builder clearPasswordExpirationDuration() { + bitField0_ = (bitField0_ & ~0x00000002); + passwordExpirationDuration_ = null; + if (passwordExpirationDurationBuilder_ != null) { + passwordExpirationDurationBuilder_.dispose(); + passwordExpirationDurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + public com.google.protobuf.Duration.Builder getPasswordExpirationDurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetPasswordExpirationDurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + public com.google.protobuf.DurationOrBuilder getPasswordExpirationDurationOrBuilder() { + if (passwordExpirationDurationBuilder_ != null) { + return passwordExpirationDurationBuilder_.getMessageOrBuilder(); + } else { + return passwordExpirationDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordExpirationDuration_; + } + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetPasswordExpirationDurationFieldBuilder() { + if (passwordExpirationDurationBuilder_ == null) { + passwordExpirationDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getPasswordExpirationDuration(), getParentForChildren(), isClean()); + passwordExpirationDuration_ = null; + } + return passwordExpirationDurationBuilder_; + } + + private boolean enableFailedAttemptsCheck_; + + /** + * + * + *
+     * If true, failed login attempts check will be enabled.
+     * 
+ * + * bool enable_failed_attempts_check = 3; + * + * @return The enableFailedAttemptsCheck. + */ + @java.lang.Override + public boolean getEnableFailedAttemptsCheck() { + return enableFailedAttemptsCheck_; + } + + /** + * + * + *
+     * If true, failed login attempts check will be enabled.
+     * 
+ * + * bool enable_failed_attempts_check = 3; + * + * @param value The enableFailedAttemptsCheck to set. + * @return This builder for chaining. + */ + public Builder setEnableFailedAttemptsCheck(boolean value) { + + enableFailedAttemptsCheck_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If true, failed login attempts check will be enabled.
+     * 
+ * + * bool enable_failed_attempts_check = 3; + * + * @return This builder for chaining. + */ + public Builder clearEnableFailedAttemptsCheck() { + bitField0_ = (bitField0_ & ~0x00000004); + enableFailedAttemptsCheck_ = false; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1.PasswordStatus status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PasswordStatus, + com.google.cloud.sql.v1.PasswordStatus.Builder, + com.google.cloud.sql.v1.PasswordStatusOrBuilder> + statusBuilder_; + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The status. + */ + public com.google.cloud.sql.v1.PasswordStatus getStatus() { + if (statusBuilder_ == null) { + return status_ == null + ? com.google.cloud.sql.v1.PasswordStatus.getDefaultInstance() + : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStatus(com.google.cloud.sql.v1.PasswordStatus value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStatus(com.google.cloud.sql.v1.PasswordStatus.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStatus(com.google.cloud.sql.v1.PasswordStatus value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && status_ != null + && status_ != com.google.cloud.sql.v1.PasswordStatus.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000008); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.PasswordStatus.Builder getStatusBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1.PasswordStatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null + ? com.google.cloud.sql.v1.PasswordStatus.getDefaultInstance() + : status_; + } + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PasswordStatus, + com.google.cloud.sql.v1.PasswordStatus.Builder, + com.google.cloud.sql.v1.PasswordStatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1.PasswordStatus, + com.google.cloud.sql.v1.PasswordStatus.Builder, + com.google.cloud.sql.v1.PasswordStatusOrBuilder>( + getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private boolean enablePasswordVerification_; + + /** + * + * + *
+     * If true, the user must specify the current password before changing the
+     * password. This flag is supported only for MySQL.
+     * 
+ * + * bool enable_password_verification = 5; + * + * @return The enablePasswordVerification. + */ + @java.lang.Override + public boolean getEnablePasswordVerification() { + return enablePasswordVerification_; + } + + /** + * + * + *
+     * If true, the user must specify the current password before changing the
+     * password. This flag is supported only for MySQL.
+     * 
+ * + * bool enable_password_verification = 5; + * + * @param value The enablePasswordVerification to set. + * @return This builder for chaining. + */ + public Builder setEnablePasswordVerification(boolean value) { + + enablePasswordVerification_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * If true, the user must specify the current password before changing the
+     * password. This flag is supported only for MySQL.
+     * 
+ * + * bool enable_password_verification = 5; + * + * @return This builder for chaining. + */ + public Builder clearEnablePasswordVerification() { + bitField0_ = (bitField0_ & ~0x00000010); + enablePasswordVerification_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.UserPasswordValidationPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.UserPasswordValidationPolicy) + private static final com.google.cloud.sql.v1.UserPasswordValidationPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.UserPasswordValidationPolicy(); + } + + public static com.google.cloud.sql.v1.UserPasswordValidationPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserPasswordValidationPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.UserPasswordValidationPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UserPasswordValidationPolicyOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UserPasswordValidationPolicyOrBuilder.java new file mode 100644 index 000000000000..c42c535eabe6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UserPasswordValidationPolicyOrBuilder.java @@ -0,0 +1,148 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface UserPasswordValidationPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.UserPasswordValidationPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Number of failed login attempts allowed before user get locked.
+   * 
+ * + * int32 allowed_failed_attempts = 1; + * + * @return The allowedFailedAttempts. + */ + int getAllowedFailedAttempts(); + + /** + * + * + *
+   * Expiration duration after password is updated.
+   * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + * + * @return Whether the passwordExpirationDuration field is set. + */ + boolean hasPasswordExpirationDuration(); + + /** + * + * + *
+   * Expiration duration after password is updated.
+   * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + * + * @return The passwordExpirationDuration. + */ + com.google.protobuf.Duration getPasswordExpirationDuration(); + + /** + * + * + *
+   * Expiration duration after password is updated.
+   * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + com.google.protobuf.DurationOrBuilder getPasswordExpirationDurationOrBuilder(); + + /** + * + * + *
+   * If true, failed login attempts check will be enabled.
+   * 
+ * + * bool enable_failed_attempts_check = 3; + * + * @return The enableFailedAttemptsCheck. + */ + boolean getEnableFailedAttemptsCheck(); + + /** + * + * + *
+   * Output only. Read-only password status.
+   * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+   * Output only. Read-only password status.
+   * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The status. + */ + com.google.cloud.sql.v1.PasswordStatus getStatus(); + + /** + * + * + *
+   * Output only. Read-only password status.
+   * 
+ * + * + * .google.cloud.sql.v1.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1.PasswordStatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
+   * If true, the user must specify the current password before changing the
+   * password. This flag is supported only for MySQL.
+   * 
+ * + * bool enable_password_verification = 5; + * + * @return The enablePasswordVerification. + */ + boolean getEnablePasswordVerification(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UsersListResponse.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UsersListResponse.java new file mode 100644 index 000000000000..4cf423b750a7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UsersListResponse.java @@ -0,0 +1,1311 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * User list response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.UsersListResponse} + */ +@com.google.protobuf.Generated +public final class UsersListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.UsersListResponse) + UsersListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UsersListResponse"); + } + + // Use UsersListResponse.newBuilder() to construct. + private UsersListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UsersListResponse() { + kind_ = ""; + items_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_UsersListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_UsersListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.UsersListResponse.class, + com.google.cloud.sql.v1.UsersListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#usersList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#usersList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + @java.lang.Override + public java.util.List getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.User getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1.UserOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * Unused.
+   * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1/cloud_sql_users.proto;l=315 + * @return The nextPageToken. + */ + @java.lang.Override + @java.lang.Deprecated + 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; + } + } + + /** + * + * + *
+   * Unused.
+   * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1/cloud_sql_users.proto;l=315 + * @return The bytes for nextPageToken. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.UsersListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.UsersListResponse other = + (com.google.cloud.sql.v1.UsersListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.UsersListResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.UsersListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UsersListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.UsersListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UsersListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.UsersListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UsersListResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.UsersListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UsersListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.UsersListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.UsersListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.UsersListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.UsersListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * User list response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.UsersListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.UsersListResponse) + com.google.cloud.sql.v1.UsersListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_UsersListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_UsersListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.UsersListResponse.class, + com.google.cloud.sql.v1.UsersListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.UsersListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1_UsersListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.UsersListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1.UsersListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.UsersListResponse build() { + com.google.cloud.sql.v1.UsersListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.UsersListResponse buildPartial() { + com.google.cloud.sql.v1.UsersListResponse result = + new com.google.cloud.sql.v1.UsersListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1.UsersListResponse result) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1.UsersListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.UsersListResponse) { + return mergeFrom((com.google.cloud.sql.v1.UsersListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.UsersListResponse other) { + if (other == com.google.cloud.sql.v1.UsersListResponse.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1.User m = + input.readMessage(com.google.cloud.sql.v1.User.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#usersList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#usersList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#usersList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#usersList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#usersList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List items_ = java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.User, + com.google.cloud.sql.v1.User.Builder, + com.google.cloud.sql.v1.UserOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public com.google.cloud.sql.v1.User getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.User value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1.User.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1.User value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.User value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1.User.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1.User.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public Builder addAllItems(java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public com.google.cloud.sql.v1.User.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public com.google.cloud.sql.v1.UserOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public java.util.List getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public com.google.cloud.sql.v1.User.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1.User.getDefaultInstance()); + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public com.google.cloud.sql.v1.User.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1.User.getDefaultInstance()); + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.User, + com.google.cloud.sql.v1.User.Builder, + com.google.cloud.sql.v1.UserOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1.User, + com.google.cloud.sql.v1.User.Builder, + com.google.cloud.sql.v1.UserOrBuilder>( + items_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * Unused.
+     * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1/cloud_sql_users.proto;l=315 + * @return The nextPageToken. + */ + @java.lang.Deprecated + 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; + } + } + + /** + * + * + *
+     * Unused.
+     * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1/cloud_sql_users.proto;l=315 + * @return The bytes for nextPageToken. + */ + @java.lang.Deprecated + 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; + } + } + + /** + * + * + *
+     * Unused.
+     * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1/cloud_sql_users.proto;l=315 + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unused.
+     * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1/cloud_sql_users.proto;l=315 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Unused.
+     * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1/cloud_sql_users.proto;l=315 + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.UsersListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.UsersListResponse) + private static final com.google.cloud.sql.v1.UsersListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.UsersListResponse(); + } + + public static com.google.cloud.sql.v1.UsersListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UsersListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.UsersListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UsersListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UsersListResponseOrBuilder.java new file mode 100644 index 000000000000..4b09ae55d007 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/UsersListResponseOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface UsersListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.UsersListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#usersList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#usersList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + com.google.cloud.sql.v1.User getItems(int index); + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + int getItemsCount(); + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + java.util.List getItemsOrBuilderList(); + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1.User items = 2; + */ + com.google.cloud.sql.v1.UserOrBuilder getItemsOrBuilder(int index); + + /** + * + * + *
+   * Unused.
+   * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1/cloud_sql_users.proto;l=315 + * @return The nextPageToken. + */ + @java.lang.Deprecated + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * Unused.
+   * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1/cloud_sql_users.proto;l=315 + * @return The bytes for nextPageToken. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Value.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Value.java new file mode 100644 index 000000000000..f98622819caa --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/Value.java @@ -0,0 +1,687 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +/** + * + * + *
+ * The cell value of the table.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Value} + */ +@com.google.protobuf.Generated +public final class Value extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1.Value) + ValueOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Value"); + } + + // Use Value.newBuilder() to construct. + private Value(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Value() { + value_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Value_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Value_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Value.class, com.google.cloud.sql.v1.Value.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + + /** + * + * + *
+   * The cell value in string format.
+   * 
+ * + * string value = 1; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + + /** + * + * + *
+   * The cell value in string format.
+   * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NULL_VALUE_FIELD_NUMBER = 2; + private boolean nullValue_ = false; + + /** + * + * + *
+   * If cell value is null, then this flag will be set to true.
+   * 
+ * + * bool null_value = 2; + * + * @return The nullValue. + */ + @java.lang.Override + public boolean getNullValue() { + return nullValue_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, value_); + } + if (nullValue_ != false) { + output.writeBool(2, nullValue_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, value_); + } + if (nullValue_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, nullValue_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1.Value)) { + return super.equals(obj); + } + com.google.cloud.sql.v1.Value other = (com.google.cloud.sql.v1.Value) obj; + + if (!getValue().equals(other.getValue())) return false; + if (getNullValue() != other.getNullValue()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (37 * hash) + NULL_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getNullValue()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1.Value parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Value parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Value parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Value parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Value parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1.Value parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Value parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Value parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Value parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Value parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1.Value parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1.Value parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1.Value prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The cell value of the table.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1.Value} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1.Value) + com.google.cloud.sql.v1.ValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Value_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Value_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1.Value.class, com.google.cloud.sql.v1.Value.Builder.class); + } + + // Construct using com.google.cloud.sql.v1.Value.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = ""; + nullValue_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1_Value_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Value getDefaultInstanceForType() { + return com.google.cloud.sql.v1.Value.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1.Value build() { + com.google.cloud.sql.v1.Value result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Value buildPartial() { + com.google.cloud.sql.v1.Value result = new com.google.cloud.sql.v1.Value(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1.Value result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nullValue_ = nullValue_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1.Value) { + return mergeFrom((com.google.cloud.sql.v1.Value) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1.Value other) { + if (other == com.google.cloud.sql.v1.Value.getDefaultInstance()) return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getNullValue() != false) { + setNullValue(other.getNullValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + value_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + nullValue_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object value_ = ""; + + /** + * + * + *
+     * The cell value in string format.
+     * 
+ * + * string value = 1; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The cell value in string format.
+     * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The cell value in string format.
+     * 
+ * + * string value = 1; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The cell value in string format.
+     * 
+ * + * string value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The cell value in string format.
+     * 
+ * + * string value = 1; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean nullValue_; + + /** + * + * + *
+     * If cell value is null, then this flag will be set to true.
+     * 
+ * + * bool null_value = 2; + * + * @return The nullValue. + */ + @java.lang.Override + public boolean getNullValue() { + return nullValue_; + } + + /** + * + * + *
+     * If cell value is null, then this flag will be set to true.
+     * 
+ * + * bool null_value = 2; + * + * @param value The nullValue to set. + * @return This builder for chaining. + */ + public Builder setNullValue(boolean value) { + + nullValue_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * If cell value is null, then this flag will be set to true.
+     * 
+ * + * bool null_value = 2; + * + * @return This builder for chaining. + */ + public Builder clearNullValue() { + bitField0_ = (bitField0_ & ~0x00000002); + nullValue_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1.Value) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1.Value) + private static final com.google.cloud.sql.v1.Value DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1.Value(); + } + + public static com.google.cloud.sql.v1.Value getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Value parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1.Value getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ValueOrBuilder.java b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ValueOrBuilder.java new file mode 100644 index 000000000000..2fda9bda85b4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/java/com/google/cloud/sql/v1/ValueOrBuilder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1/cloud_sql_instances.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1; + +@com.google.protobuf.Generated +public interface ValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1.Value) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The cell value in string format.
+   * 
+ * + * string value = 1; + * + * @return The value. + */ + java.lang.String getValue(); + + /** + * + * + *
+   * The cell value in string format.
+   * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+   * If cell value is null, then this flag will be set to true.
+   * 
+ * + * bool null_value = 2; + * + * @return The nullValue. + */ + boolean getNullValue(); +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_available_database_versions.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_available_database_versions.proto new file mode 100644 index 000000000000..0147d26d397e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_available_database_versions.proto @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlAvailableDatabaseVersionsProto"; +option java_package = "com.google.cloud.sql.v1"; + +// Service that exposes Cloud SQL database versions information. This +// service is only used internally. +service SqlAvailableDatabaseVersionsService { + option (google.api.default_host) = "sqladmin.googleapis.com"; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_backup_runs.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_backup_runs.proto new file mode 100644 index 000000000000..b90def1581a8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_backup_runs.proto @@ -0,0 +1,270 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/sql/v1/cloud_sql_resources.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlBackupRunsProto"; +option java_package = "com.google.cloud.sql.v1"; + +// Service for managing database backups. +service SqlBackupRunsService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Deletes the backup taken by a backup run. + rpc Delete(SqlBackupRunsDeleteRequest) returns (Operation) { + option (google.api.http) = { + delete: "/v1/projects/{project}/instances/{instance}/backupRuns/{id}" + }; + } + + // Retrieves a resource containing information about a backup run. + rpc Get(SqlBackupRunsGetRequest) returns (BackupRun) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}/backupRuns/{id}" + }; + } + + // Creates a new backup run on demand. + rpc Insert(SqlBackupRunsInsertRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/backupRuns" + body: "body" + }; + } + + // Lists all backup runs associated with the project or a given instance + // and configuration in the reverse chronological order of the backup + // initiation time. + rpc List(SqlBackupRunsListRequest) returns (BackupRunsListResponse) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}/backupRuns" + }; + } +} + +// Backup runs delete request. +message SqlBackupRunsDeleteRequest { + // The ID of the backup run to delete. To find a backup run ID, use the + // [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list) + // method. + int64 id = 1; + + // Cloud SQL instance ID. This does not include the project ID. + string instance = 2; + + // Project ID of the project that contains the instance. + string project = 3; +} + +// Backup runs get request. +message SqlBackupRunsGetRequest { + // The ID of this backup run. + int64 id = 1; + + // Cloud SQL instance ID. This does not include the project ID. + string instance = 2; + + // Project ID of the project that contains the instance. + string project = 3; +} + +// Backup runs insert request. +message SqlBackupRunsInsertRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + BackupRun body = 100; +} + +// Backup runs list request. +message SqlBackupRunsListRequest { + // Cloud SQL instance ID, or "-" for all instances. This does not include + // the project ID. + string instance = 1; + + // Maximum number of backup runs per response. + int32 max_results = 2; + + // A previously-returned page token representing part of the larger set of + // results to view. + string page_token = 3; + + // Project ID of the project that contains the instance. + string project = 4; +} + +// A BackupRun resource. +message BackupRun { + // This is always `sql#backupRun`. + string kind = 1; + + // The status of this run. + SqlBackupRunStatus status = 2; + + // The time the run was enqueued in UTC timezone in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp enqueued_time = 3; + + // The identifier for this backup run. Unique only for a specific Cloud SQL + // instance. + int64 id = 4; + + // The time the backup operation actually started in UTC timezone in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp start_time = 5; + + // The time the backup operation completed in UTC timezone in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp end_time = 6; + + // Information about why the backup operation failed. This is only present if + // the run has the FAILED status. + OperationError error = 7; + + // The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL". + // This field defaults to "ON_DEMAND" and is ignored, when specified for + // insert requests. + SqlBackupRunType type = 8; + + // The description of this run, only applicable to on-demand backups. + string description = 9; + + // The start time of the backup window during which this the backup was + // attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for + // example `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp window_start_time = 10; + + // Name of the database instance. + string instance = 11; + + // The URI of this resource. + string self_link = 12; + + // Location of the backups. + string location = 13; + + // Output only. The instance database version at the time this backup was + // made. + SqlDatabaseVersion database_version = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Encryption configuration specific to a backup. + DiskEncryptionConfiguration disk_encryption_configuration = 16; + + // Encryption status specific to a backup. + DiskEncryptionStatus disk_encryption_status = 17; + + // Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT. + SqlBackupKind backup_kind = 19; + + // Backup time zone to prevent restores to an instance with + // a different time zone. Now relevant only for SQL Server. + string time_zone = 23; + + // Output only. The maximum chargeable bytes for the backup. + optional int64 max_chargeable_bytes = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Backup run list results. +message BackupRunsListResponse { + // This is always `sql#backupRunsList`. + string kind = 1; + + // A list of backup runs in reverse chronological order of the enqueued time. + repeated BackupRun items = 2; + + // The continuation token, used to page through large result sets. Provide + // this value in a subsequent request to return the next page of results. + string next_page_token = 3; +} + +// The status of a backup run. +enum SqlBackupRunStatus { + // The status of the run is unknown. + SQL_BACKUP_RUN_STATUS_UNSPECIFIED = 0; + + // The backup operation was enqueued. + ENQUEUED = 1; + + // The backup is overdue across a given backup window. Indicates a + // problem. Example: Long-running operation in progress during + // the whole window. + OVERDUE = 2; + + // The backup is in progress. + RUNNING = 3; + + // The backup failed. + FAILED = 4; + + // The backup was successful. + SUCCESSFUL = 5; + + // The backup was skipped (without problems) for a given backup + // window. Example: Instance was idle. + SKIPPED = 6; + + // The backup is about to be deleted. + DELETION_PENDING = 7; + + // The backup deletion failed. + DELETION_FAILED = 8; + + // The backup has been deleted. + DELETED = 9; +} + +// Defines the supported backup kinds. +enum SqlBackupKind { + // This is an unknown BackupKind. + SQL_BACKUP_KIND_UNSPECIFIED = 0; + + // Snapshot-based backups. + SNAPSHOT = 1; + + // Physical backups. + PHYSICAL = 2; +} + +// Type of backup (i.e. automated, on demand, etc). +enum SqlBackupRunType { + // This is an unknown BackupRun type. + SQL_BACKUP_RUN_TYPE_UNSPECIFIED = 0; + + // The backup schedule automatically triggers a backup. + AUTOMATED = 1; + + // The user manually triggers a backup. + ON_DEMAND = 2; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_backups.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_backups.proto new file mode 100644 index 000000000000..220be86b60fa --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_backups.proto @@ -0,0 +1,327 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/sql/v1/cloud_sql_backup_runs.proto"; +import "google/cloud/sql/v1/cloud_sql_instances.proto"; +import "google/cloud/sql/v1/cloud_sql_resources.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/type/interval.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlBackupsProto"; +option java_package = "com.google.cloud.sql.v1"; + +service SqlBackupsService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Creates a backup for a Cloud SQL instance. This API can be used only to + // create on-demand backups. + rpc CreateBackup(CreateBackupRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent, backup"; + } + + // Retrieves a resource containing information about a backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all backups associated with the project. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the retention period and description of the backup. You can use + // this API to update final backups only. + rpc UpdateBackup(UpdateBackupRequest) returns (Operation) { + option (google.api.http) = { + patch: "/v1/{backup.name=projects/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup, update_mask"; + } + + // Deletes the backup. + rpc DeleteBackup(DeleteBackupRequest) returns (Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request payload to create the backup +message CreateBackupRequest { + // Required. The parent resource where this backup is created. + // Format: projects/{project} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "sqladmin.googleapis.com/Backup" + } + ]; + + // Required. The Backup to create. + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request payload to get the backup. +message GetBackupRequest { + // Required. The name of the backup to retrieve. + // Format: projects/{project}/backups/{backup} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "sqladmin.googleapis.com/Backup" } + ]; +} + +// The request payload to list the backups. +message ListBackupsRequest { + // Required. The parent that owns this collection of backups. + // Format: projects/{project} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "sqladmin.googleapis.com/Backup" + } + ]; + + // The maximum number of backups to return per response. The service might + // return fewer backups than this value. If a value for this parameter isn't + // specified, then, at most, 500 backups are returned. The maximum value is + // 2,000. Any values that you set, which are greater than 2,000, are changed + // to 2,000. + int32 page_size = 2; + + // A page token, received from a previous `ListBackups` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListBackups` must match + // the call that provided the page token. + string page_token = 3; + + // Multiple filter queries are separated by spaces. For example, + // 'instance:abc AND type:FINAL, 'location:us', + // 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by + // type, instance, backupInterval.startTime (creation time), or location. + string filter = 4; +} + +// The response payload containing a list of the backups. +message ListBackupsResponse { + // A list of backups. + repeated Backup backups = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, then there aren't subsequent pages. + string next_page_token = 2; + + // If a region isn't unavailable or if an unknown error occurs, then a warning + // message is returned. + repeated ApiWarning warnings = 3; +} + +// The request payload to update the backup. +message UpdateBackupRequest { + // Required. The backup to update. + // The backup’s `name` field is used to identify the backup to update. + // Format: projects/{project}/backups/{backup} + Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields that you can update. You can update only the description + // and retention period of the final backup. + google.protobuf.FieldMask update_mask = 2; +} + +// The request payload to delete the backup. +message DeleteBackupRequest { + // Required. The name of the backup to delete. + // Format: projects/{project}/backups/{backup} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "sqladmin.googleapis.com/Backup" } + ]; +} + +// A backup resource. +message Backup { + option (google.api.resource) = { + type: "sqladmin.googleapis.com/Backup" + pattern: "projects/{project}/backups/{backup}" + }; + + // The backup type. + enum SqlBackupType { + // This is an unknown backup type. + SQL_BACKUP_TYPE_UNSPECIFIED = 0; + + // The backup schedule triggers a backup automatically. + AUTOMATED = 1; + + // The user triggers a backup manually. + ON_DEMAND = 2; + + // The backup created when instance is deleted. + FINAL = 3; + } + + // The backup's state + enum SqlBackupState { + // The state of the backup is unknown. + SQL_BACKUP_STATE_UNSPECIFIED = 0; + + // The backup that's added to a queue. + ENQUEUED = 1; + + // The backup is in progress. + RUNNING = 2; + + // The backup failed. + FAILED = 3; + + // The backup is successful. + SUCCESSFUL = 4; + + // The backup is being deleted. + DELETING = 5; + + // Deletion of the backup failed. + DELETION_FAILED = 6; + } + + // Output only. The resource name of the backup. + // Format: projects/{project}/backups/{backup}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This is always `sql#backup`. + string kind = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The URI of this resource. + string self_link = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of this backup. The type can be "AUTOMATED", + // "ON_DEMAND" or “FINAL”. + SqlBackupType type = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The description of this backup. + string description = 5; + + // The name of the source database instance. + string instance = 6; + + // The storage location of the backups. The location can be multi-regional. + string location = 7; + + // Output only. This output contains the following values: + // start_time: All database writes up to this time are available. + // end_time: Any database writes after this time aren't available. + google.type.Interval backup_interval = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The status of this backup. + SqlBackupState state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information about why the backup operation fails (for example, + // when the backup state fails). + OperationError error = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This output contains the encryption configuration for a backup + // and the resource name of the KMS key for disk encryption. + string kms_key = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This output contains the encryption status for a backup and + // the version of the KMS key that's used to encrypt the Cloud SQL instance. + string kms_key_version = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT. + SqlBackupKind backup_kind = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This output contains a backup time zone. If a Cloud SQL for + // SQL Server instance has a different time zone from the backup's time zone, + // then the restore to the instance doesn't happen. + string time_zone = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + oneof expiration { + // Input only. The time-to-live (TTL) interval for this resource (in days). + // For example: ttlDays:7, means 7 days from the current time. The + // expiration time can't exceed 365 days from the time that the backup is + // created. + int64 ttl_days = 16 [(google.api.field_behavior) = INPUT_ONLY]; + + // Backup expiration time. + // A UTC timestamp of when this backup expired. + google.protobuf.Timestamp expiry_time = 17; + } + + // Output only. The database version of the instance of at the time this + // backup was made. + SqlDatabaseVersion database_version = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The maximum chargeable bytes for the backup. + optional int64 max_chargeable_bytes = 23 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Output only. Timestamp in UTC of when the instance associated + // with this backup is deleted. + google.protobuf.Timestamp instance_deletion_time = 24 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Output only. The instance setting of the source instance that's + // associated with this backup. + DatabaseInstance instance_settings = 25 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. The mapping to backup run resource used for IAM validations. + string backup_run = 26 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This status indicates whether the backup satisfies PZS. + // + // The status is reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 27 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This status indicates whether the backup satisfies PZI. + // + // The status is reserved for future use. + google.protobuf.BoolValue satisfies_pzi = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_connect.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_connect.proto new file mode 100644 index 000000000000..cfc15831ec5d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_connect.proto @@ -0,0 +1,241 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/sql/v1/cloud_sql_resources.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlConnectProto"; +option java_package = "com.google.cloud.sql.v1"; + +// Cloud SQL connect service. +service SqlConnectService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Retrieves connect settings about a Cloud SQL instance. + rpc GetConnectSettings(GetConnectSettingsRequest) returns (ConnectSettings) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}/connectSettings" + }; + } + + // Retrieves connect settings about a Cloud SQL instance using the instance + // DNS name. + rpc ResolveConnectSettings(ResolveConnectSettingsRequest) + returns (ConnectSettings) { + option (google.api.http) = { + get: "/v1/locations/{location}/dns/{dns_name}:resolveConnectSettings" + }; + } + + // Generates a short-lived X509 certificate containing the provided public key + // and signed by a private key specific to the target instance. Users may use + // the certificate to authenticate as themselves when connecting to the + // database. + rpc GenerateEphemeralCert(GenerateEphemeralCertRequest) + returns (GenerateEphemeralCertResponse) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}:generateEphemeralCert" + body: "*" + }; + } +} + +// Connect settings retrieval request. +message GetConnectSettingsRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // Optional. Optional snapshot read timestamp to trade freshness for + // performance. + google.protobuf.Timestamp read_time = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Connect settings retrieval request. +message ResolveConnectSettingsRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string dns_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The region of the instance. + string location = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Connect settings retrieval response. +message ConnectSettings { + // Various Certificate Authority (CA) modes for certificate signing. + enum CaMode { + // CA mode is unknown. + CA_MODE_UNSPECIFIED = 0; + + // Google-managed self-signed internal CA. + GOOGLE_MANAGED_INTERNAL_CA = 1; + + // Google-managed regional CA part of root CA hierarchy hosted on Google + // Cloud's Certificate Authority Service (CAS). + GOOGLE_MANAGED_CAS_CA = 2; + + // Customer-managed CA hosted on Google Cloud's Certificate Authority + // Service (CAS). + CUSTOMER_MANAGED_CAS_CA = 3; + } + + // Details of a single read pool node of a read pool. + message ConnectPoolNodeConfig { + // Output only. The name of the read pool node. Doesn't include the project + // ID. + optional string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Mappings containing IP addresses that can be used to connect + // to the read pool node. + repeated IpMapping ip_addresses = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The DNS name of the read pool node. + optional string dns_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of DNS names used by this read pool node. + repeated DnsNameMapping dns_names = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // MdxProtocolSupport describes parts of the MDX protocol supported by this + // instance. + enum MdxProtocolSupport { + // Not specified. + MDX_PROTOCOL_SUPPORT_UNSPECIFIED = 0; + + // Client should send the client protocol type in the MDX request. + CLIENT_PROTOCOL_TYPE = 1; + } + + // This is always `sql#connectSettings`. + string kind = 1; + + // SSL configuration. + SslCert server_ca_cert = 2; + + // The assigned IP addresses for the instance. + repeated IpMapping ip_addresses = 3; + + // The cloud region for the instance. For example, `us-central1`, + // `europe-west1`. The region cannot be changed after instance creation. + string region = 4; + + // The database engine type and version. The `databaseVersion` + // field cannot be changed after instance creation. + // MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default), + // or `MYSQL_5_6`. + // PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`, + // `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`. + // SQL Server instances: `SQLSERVER_2017_STANDARD` (default), + // `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`, + // `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`, + // `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or + // `SQLSERVER_2019_WEB`. + SqlDatabaseVersion database_version = 31; + + // `SECOND_GEN`: Cloud SQL database instance. + // `EXTERNAL`: A database server that is not managed by Google. + // This property is read-only; use the `tier` property in the `settings` + // object to determine the database type. + SqlBackendType backend_type = 32; + + // Whether PSC connectivity is enabled for this instance. + bool psc_enabled = 33; + + // The dns name of the instance. + string dns_name = 34; + + // Specify what type of CA is used for the server certificate. + CaMode server_ca_mode = 35; + + // Custom subject alternative names for the server certificate. + repeated string custom_subject_alternative_names = 37; + + // Output only. The list of DNS names used by this instance. + repeated DnsNameMapping dns_names = 38 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The number of read pool nodes in a read pool. + optional int32 node_count = 63; + + // Output only. Entries containing information about each read pool node of + // the read pool. + repeated ConnectPoolNodeConfig nodes = 64 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Output only. mdx_protocol_support controls how the client uses + // metadata exchange when connecting to the instance. The values in the list + // representing parts of the MDX protocol that are supported by this instance. + // When the list is empty, the instance does not support MDX, so the client + // must not send an MDX request. The default is empty. + repeated MdxProtocolSupport mdx_protocol_support = 39 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Output only. Connection name of the Cloud SQL instance used in + // connection strings, in the format project:region:instance. + string connection_name = 40 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Ephemeral certificate creation request. +message GenerateEphemeralCertRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // PEM encoded public key to include in the signed certificate. + string public_key = 3 [json_name = "public_key"]; + + // Optional. Access token to include in the signed certificate. + string access_token = 4 + [json_name = "access_token", (google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional snapshot read timestamp to trade freshness for + // performance. + google.protobuf.Timestamp read_time = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, it will contain the cert valid duration. + google.protobuf.Duration valid_duration = 12 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Ephemeral certificate creation request. +message GenerateEphemeralCertResponse { + // Generated cert + SslCert ephemeral_cert = 1; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_databases.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_databases.proto new file mode 100644 index 000000000000..56e02ed26a9b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_databases.proto @@ -0,0 +1,152 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/sql/v1/cloud_sql_resources.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlDatabasesProto"; +option java_package = "com.google.cloud.sql.v1"; + +// Service to manage databases. +service SqlDatabasesService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Deletes a database from a Cloud SQL instance. + rpc Delete(SqlDatabasesDeleteRequest) returns (Operation) { + option (google.api.http) = { + delete: "/v1/projects/{project}/instances/{instance}/databases/{database}" + }; + } + + // Retrieves a resource containing information about a database inside a Cloud + // SQL instance. + rpc Get(SqlDatabasesGetRequest) returns (Database) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}/databases/{database}" + }; + } + + // Inserts a resource containing information about a database inside a Cloud + // SQL instance. + // + // **Note:** You can't modify the default character set and collation. + rpc Insert(SqlDatabasesInsertRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/databases" + body: "body" + }; + } + + // Lists databases in the specified Cloud SQL instance. + rpc List(SqlDatabasesListRequest) returns (DatabasesListResponse) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}/databases" + }; + } + + // Partially updates a resource containing information about a database inside + // a Cloud SQL instance. This method supports patch semantics. + rpc Patch(SqlDatabasesUpdateRequest) returns (Operation) { + option (google.api.http) = { + patch: "/v1/projects/{project}/instances/{instance}/databases/{database}" + body: "body" + }; + } + + // Updates a resource containing information about a database inside a Cloud + // SQL instance. + rpc Update(SqlDatabasesUpdateRequest) returns (Operation) { + option (google.api.http) = { + put: "/v1/projects/{project}/instances/{instance}/databases/{database}" + body: "body" + }; + } +} + +// Database delete request. +message SqlDatabasesDeleteRequest { + // Name of the database to be deleted in the instance. + string database = 1; + + // Database instance ID. This does not include the project ID. + string instance = 2; + + // Project ID of the project that contains the instance. + string project = 3; +} + +// Database get request. +message SqlDatabasesGetRequest { + // Name of the database in the instance. + string database = 1; + + // Database instance ID. This does not include the project ID. + string instance = 2; + + // Project ID of the project that contains the instance. + string project = 3; +} + +// Database insert request. +message SqlDatabasesInsertRequest { + // Database instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + Database body = 100; +} + +// Database list request. +message SqlDatabasesListRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +// Database update request. +message SqlDatabasesUpdateRequest { + // Name of the database to be updated in the instance. + string database = 1; + + // Database instance ID. This does not include the project ID. + string instance = 2; + + // Project ID of the project that contains the instance. + string project = 3; + + Database body = 100; +} + +// Database list response. +message DatabasesListResponse { + // This is always `sql#databasesList`. + string kind = 1; + + // List of database resources in the instance. + repeated Database items = 2; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_events.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_events.proto new file mode 100644 index 000000000000..3d1bb688c30b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_events.proto @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlEventsProto"; +option java_package = "com.google.cloud.sql.v1"; + +// Service that exposes Cloud SQL event information. This +// service is only used internally. +service SqlEventsService { + option (google.api.default_host) = "sqladmin.googleapis.com"; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_feature_eligibility.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_feature_eligibility.proto new file mode 100644 index 000000000000..d33e44df0c35 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_feature_eligibility.proto @@ -0,0 +1,31 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlFeatureEligibilityProto"; +option java_package = "com.google.cloud.sql.v1"; + +// Service to verify the eligibility of an instance for a given operation. +service SqlFeatureEligibilityService { + option (google.api.default_host) = "sqladmin.googleapis.com"; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_flags.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_flags.proto new file mode 100644 index 000000000000..b7b704399cf1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_flags.proto @@ -0,0 +1,161 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/sql/v1/cloud_sql_resources.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlFlagsProto"; +option java_package = "com.google.cloud.sql.v1"; + +// Service to manage database flags for Cloud SQL instances. +service SqlFlagsService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Lists all available database flags for Cloud SQL instances. + rpc List(SqlFlagsListRequest) returns (FlagsListResponse) { + option (google.api.http) = { + get: "/v1/flags" + }; + } +} + +// Flags list request. +message SqlFlagsListRequest { + // Database type and version you want to retrieve flags for. By default, this + // method returns flags for all database types and versions. + string database_version = 1; + + // Optional. Specify the scope of flags to be returned by SqlFlagsListService. + // Return list of database flags if unspecified. + optional SqlFlagScope flag_scope = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Flags list response. +message FlagsListResponse { + // This is always `sql#flagsList`. + string kind = 1; + + // List of flags. + repeated Flag items = 2; +} + +// A flag resource. +message Flag { + // This is the name of the flag. Flag names always use underscores, not + // hyphens, for example: `max_allowed_packet` + string name = 1; + + // The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`, + // `INTEGER` or `NONE`. `NONE` is used for flags that do not take a + // value, such as `skip_grant_tables`. + SqlFlagType type = 2; + + // The database version this flag applies to. Can be + // MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`, + // or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`, + // `POSTGRES_11` or `POSTGRES_12`. SQL Server instances: + // `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`, + // `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`, + // `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or + // `SQLSERVER_2019_WEB`. + // See [the complete + // list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion). + repeated SqlDatabaseVersion applies_to = 3; + + // For `STRING` flags, a list of strings that the value can be set to. + repeated string allowed_string_values = 4; + + // For `INTEGER` flags, the minimum allowed value. + google.protobuf.Int64Value min_value = 5; + + // For `INTEGER` flags, the maximum allowed value. + google.protobuf.Int64Value max_value = 6; + + // Indicates whether changing this flag will trigger a database restart. Only + // applicable to Second Generation instances. + google.protobuf.BoolValue requires_restart = 7; + + // This is always `sql#flag`. + string kind = 8; + + // Whether or not the flag is considered in beta. + google.protobuf.BoolValue in_beta = 9; + + // Use this field if only certain integers are accepted. Can be combined + // with min_value and max_value to add additional values. + repeated int64 allowed_int_values = 10; + + // Scope of flag. + SqlFlagScope flag_scope = 15; + + // Recommended flag value for UI display. + oneof recommended_value { + // Recommended string value in string format for UI display. + string recommended_string_value = 16; + + // Recommended int value in integer format for UI display. + google.protobuf.Int64Value recommended_int_value = 17; + } +} + +enum SqlFlagType { + // This is an unknown flag type. + SQL_FLAG_TYPE_UNSPECIFIED = 0; + + // Boolean type flag. + BOOLEAN = 1; + + // String type flag. + STRING = 2; + + // Integer type flag. + INTEGER = 3; + + // Flag type used for a server startup option. + NONE = 4; + + // Type introduced specially for MySQL TimeZone offset. Accept a string value + // with the format [-12:59, 13:00]. + MYSQL_TIMEZONE_OFFSET = 5; + + // Float type flag. + FLOAT = 6; + + // Comma-separated list of the strings in a SqlFlagType enum. + REPEATED_STRING = 7; +} + +// Scopes of a flag describe where the flag is used. +enum SqlFlagScope { + // Assume database flags if unspecified + SQL_FLAG_SCOPE_UNSPECIFIED = 0; + + // database flags + SQL_FLAG_SCOPE_DATABASE = 1; + + // connection pool configuration flags + SQL_FLAG_SCOPE_CONNECTION_POOL = 2; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_iam_policies.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_iam_policies.proto new file mode 100644 index 000000000000..4edbc6317695 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_iam_policies.proto @@ -0,0 +1,30 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlIamPoliciesProto"; +option java_package = "com.google.cloud.sql.v1"; + +// Service for providing IAM Meta APIs for Cloud SQL. +service SqlIamPoliciesService { + option (google.api.default_host) = "sqladmin.googleapis.com"; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_instance_names.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_instance_names.proto new file mode 100644 index 000000000000..cc00b42bda2f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_instance_names.proto @@ -0,0 +1,31 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlInstanceNamesServiceProto"; +option java_package = "com.google.cloud.sql.v1"; + +// Cloud SQL instance names service. +service SqlInstanceNamesService { + option (google.api.default_host) = "sqladmin.googleapis.com"; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_instances.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_instances.proto new file mode 100644 index 000000000000..ff26aa29cebd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_instances.proto @@ -0,0 +1,2540 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/sql/v1/cloud_sql_resources.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlServiceProto"; +option java_package = "com.google.cloud.sql.v1"; +option (google.api.resource_definition) = { + type: "backupdr.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; + +service SqlInstancesService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Adds a new trusted Certificate Authority (CA) version for the specified + // instance. Required to prepare for a certificate rotation. If a CA version + // was previously added but never used in a certificate rotation, this + // operation replaces that version. There cannot be more than one CA version + // waiting to be rotated in. For instances that have enabled Certificate + // Authority Service (CAS) based server CA, use AddServerCertificate to add a + // new server certificate. + rpc AddServerCa(SqlInstancesAddServerCaRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/addServerCa" + }; + } + + // Add a new trusted server certificate version for the specified instance + // using Certificate Authority Service (CAS) server CA. Required to prepare + // for a certificate rotation. If a server certificate version was previously + // added but never used in a certificate rotation, this operation replaces + // that version. There cannot be more than one certificate version waiting to + // be rotated in. For instances not using CAS server CA, use AddServerCa + // instead. + rpc AddServerCertificate(SqlInstancesAddServerCertificateRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/addServerCertificate" + }; + } + + // Adds a new Entra ID certificate for the specified instance. If an Entra ID + // certificate was previously added but never used in a certificate rotation, + // this operation replaces that version. + rpc AddEntraIdCertificate(SqlInstancesAddEntraIdCertificateRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/addEntraIdCertificate" + }; + } + + // Creates a Cloud SQL instance as a clone of the source instance. Using this + // operation might cause your instance to restart. + rpc Clone(SqlInstancesCloneRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/clone" + body: "body" + }; + } + + // Deletes a Cloud SQL instance. + rpc Delete(SqlInstancesDeleteRequest) returns (Operation) { + option (google.api.http) = { + delete: "/v1/projects/{project}/instances/{instance}" + }; + } + + // Demotes the stand-alone instance to be a Cloud SQL read replica for an + // external database server. + rpc DemoteMaster(SqlInstancesDemoteMasterRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/demoteMaster" + body: "body" + }; + } + + // Demotes an existing standalone instance to be a Cloud SQL read replica + // for an external database server. + rpc Demote(SqlInstancesDemoteRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/demote" + body: "body" + }; + } + + // Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL + // dump or CSV file. + rpc Export(SqlInstancesExportRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/export" + body: "body" + }; + } + + // Initiates a manual failover of a high availability (HA) primary instance + // to a standby instance, which becomes the primary instance. Users are + // then rerouted to the new primary. For more information, see the + // [Overview of high + // availability](https://cloud.google.com/sql/docs/mysql/high-availability) + // page in the Cloud SQL documentation. + // If using Legacy HA (MySQL only), this causes the instance to failover to + // its failover replica instance. + rpc Failover(SqlInstancesFailoverRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/failover" + body: "body" + }; + } + + // Reencrypt CMEK instance with latest key version. + rpc Reencrypt(SqlInstancesReencryptRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/reencrypt" + body: "body" + }; + } + + // Retrieves a resource containing information about a Cloud SQL instance. + rpc Get(SqlInstancesGetRequest) returns (DatabaseInstance) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}" + }; + } + + // Imports data into a Cloud SQL instance from a SQL dump or CSV file in + // Cloud Storage. + rpc Import(SqlInstancesImportRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/import" + body: "body" + }; + } + + // Creates a new Cloud SQL instance. + rpc Insert(SqlInstancesInsertRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances" + body: "body" + }; + } + + // Lists instances under a given project. + rpc List(SqlInstancesListRequest) returns (InstancesListResponse) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances" + }; + } + + // Lists all of the trusted Certificate Authorities (CAs) for the specified + // instance. There can be up to three CAs listed: the CA that was used to sign + // the certificate that is currently in use, a CA that has been added but not + // yet used to sign a certificate, and a CA used to sign a certificate that + // has previously rotated out. + rpc ListServerCas(SqlInstancesListServerCasRequest) + returns (InstancesListServerCasResponse) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}/listServerCas" + }; + } + + // Lists all versions of server certificates and certificate authorities (CAs) + // for the specified instance. There can be up to three sets of certs listed: + // the certificate that is currently in use, a future that has been added but + // not yet used to sign a certificate, and a certificate that has been rotated + // out. For instances not using Certificate Authority Service (CAS) server CA, + // use ListServerCas instead. + rpc ListServerCertificates(SqlInstancesListServerCertificatesRequest) + returns (InstancesListServerCertificatesResponse) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}/listServerCertificates" + }; + } + + // Lists all versions of EntraID certificates for the specified instance. + // There can be up to three sets of certificates listed: the certificate that + // is currently in use, a future that has been added but not yet used to sign + // a certificate, and a certificate that has been rotated out. + rpc ListEntraIdCertificates(SqlInstancesListEntraIdCertificatesRequest) + returns (InstancesListEntraIdCertificatesResponse) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}/listEntraIdCertificates" + }; + } + + // Partially updates settings of a Cloud SQL instance by merging the request + // with the current configuration. This method supports patch semantics. + rpc Patch(SqlInstancesPatchRequest) returns (Operation) { + option (google.api.http) = { + patch: "/v1/projects/{project}/instances/{instance}" + body: "body" + }; + } + + // Promotes the read replica instance to be an independent Cloud SQL + // primary instance. + // Using this operation might cause your instance to restart. + rpc PromoteReplica(SqlInstancesPromoteReplicaRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/promoteReplica" + }; + } + + // Switches over from the primary instance to the DR replica + // instance. + rpc Switchover(SqlInstancesSwitchoverRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/switchover" + }; + } + + // Deletes all client certificates and generates a new server SSL certificate + // for the instance. + rpc ResetSslConfig(SqlInstancesResetSslConfigRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/resetSslConfig" + }; + } + + // Restarts a Cloud SQL instance. + rpc Restart(SqlInstancesRestartRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/restart" + }; + } + + // Restores a backup of a Cloud SQL instance. Using this operation might cause + // your instance to restart. + rpc RestoreBackup(SqlInstancesRestoreBackupRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/restoreBackup" + body: "body" + }; + } + + // Rotates the server certificate to one signed by the Certificate Authority + // (CA) version previously added with the addServerCA method. For instances + // that have enabled Certificate Authority Service (CAS) based server CA, + // use RotateServerCertificate to rotate the server certificate. + rpc RotateServerCa(SqlInstancesRotateServerCaRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/rotateServerCa" + body: "body" + }; + } + + // Rotates the server certificate version to one previously added with the + // addServerCertificate method. For instances not using Certificate Authority + // Service (CAS) server CA, use RotateServerCa instead. + rpc RotateServerCertificate(SqlInstancesRotateServerCertificateRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/rotateServerCertificate" + body: "body" + }; + } + + // Rotates the server certificate version to one previously added with the + // addEntraIdCertificate method. + rpc RotateEntraIdCertificate(SqlInstancesRotateEntraIdCertificateRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/rotateEntraIdCertificate" + body: "body" + }; + } + + // Starts the replication in the read replica instance. + rpc StartReplica(SqlInstancesStartReplicaRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/startReplica" + }; + } + + // Stops the replication in the read replica instance. + rpc StopReplica(SqlInstancesStopReplicaRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/stopReplica" + }; + } + + // Truncate MySQL general and slow query log tables + // MySQL only. + rpc TruncateLog(SqlInstancesTruncateLogRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/truncateLog" + body: "body" + }; + } + + // Updates settings of a Cloud SQL instance. Using this operation might cause + // your instance to restart. + rpc Update(SqlInstancesUpdateRequest) returns (Operation) { + option (google.api.http) = { + put: "/v1/projects/{project}/instances/{instance}" + body: "body" + }; + } + + // Generates a short-lived X509 certificate containing the provided public key + // and signed by a private key specific to the target instance. Users may use + // the certificate to authenticate as themselves when connecting to the + // database. + rpc CreateEphemeral(SqlInstancesCreateEphemeralCertRequest) + returns (SslCert) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/createEphemeral" + body: "body" + }; + } + + // Reschedules the maintenance on the given instance. + rpc RescheduleMaintenance(SqlInstancesRescheduleMaintenanceRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/rescheduleMaintenance" + body: "body" + }; + } + + // Verify External primary instance external sync settings. + rpc VerifyExternalSyncSettings(SqlInstancesVerifyExternalSyncSettingsRequest) + returns (SqlInstancesVerifyExternalSyncSettingsResponse) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/verifyExternalSyncSettings" + body: "*" + }; + } + + // Start External primary instance migration. + rpc StartExternalSync(SqlInstancesStartExternalSyncRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/startExternalSync" + body: "*" + }; + } + + // Perform Disk Shrink on primary instance. + rpc PerformDiskShrink(SqlInstancesPerformDiskShrinkRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/performDiskShrink" + body: "body" + }; + } + + // Get Disk Shrink Config for a given instance. + rpc GetDiskShrinkConfig(SqlInstancesGetDiskShrinkConfigRequest) + returns (SqlInstancesGetDiskShrinkConfigResponse) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}/getDiskShrinkConfig" + }; + } + + // Reset Replica Size to primary instance disk size. + rpc ResetReplicaSize(SqlInstancesResetReplicaSizeRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/resetReplicaSize" + body: "*" + }; + } + + // Get Latest Recovery Time for a given instance. + rpc GetLatestRecoveryTime(SqlInstancesGetLatestRecoveryTimeRequest) + returns (SqlInstancesGetLatestRecoveryTimeResponse) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}/getLatestRecoveryTime" + }; + } + + // Execute SQL statements. + rpc ExecuteSql(SqlInstancesExecuteSqlRequest) + returns (SqlInstancesExecuteSqlResponse) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/executeSql" + body: "body" + }; + } + + // Acquire a lease for the setup of SQL Server Reporting Services (SSRS). + rpc AcquireSsrsLease(SqlInstancesAcquireSsrsLeaseRequest) + returns (SqlInstancesAcquireSsrsLeaseResponse) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/acquireSsrsLease" + body: "body" + }; + } + + // Release a lease for the setup of SQL Server Reporting Services (SSRS). + rpc ReleaseSsrsLease(SqlInstancesReleaseSsrsLeaseRequest) + returns (SqlInstancesReleaseSsrsLeaseResponse) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/releaseSsrsLease" + }; + } + + // Execute MVU Pre-checks + rpc PreCheckMajorVersionUpgrade( + SqlInstancesPreCheckMajorVersionUpgradeRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/preCheckMajorVersionUpgrade" + body: "body" + }; + } + + // Point in time restore for an instance managed by Google Cloud Backup and + // Disaster Recovery. + rpc PointInTimeRestore(SqlInstancesPointInTimeRestoreRequest) + returns (Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}:pointInTimeRestore" + body: "context" + }; + } +} + +// Instance add server CA request. +message SqlInstancesAddServerCaRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +// Instance add server certificate request. +message SqlInstancesAddServerCertificateRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +// Instance add Entra ID certificate request. +message SqlInstancesAddEntraIdCertificateRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Instance clone request. +message SqlInstancesCloneRequest { + // Required. The ID of the Cloud SQL instance to be cloned (source). This does + // not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the source Cloud SQL instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; + + InstancesCloneRequest body = 100 [(google.api.field_behavior) = REQUIRED]; +} + +// Instance delete request. +message SqlInstancesDeleteRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance to be deleted. + string project = 2; + + // Flag to opt-in for final backup. By default, it is turned off. + optional bool enable_final_backup = 7; + + oneof expiration { + // Optional. Retention period of the final backup. + int64 final_backup_ttl_days = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Final Backup expiration time. + // Timestamp in UTC of when this resource is considered expired. + google.protobuf.Timestamp final_backup_expiry_time = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The description of the final backup. + string final_backup_description = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Instance demote master request. +message SqlInstancesDemoteMasterRequest { + // Cloud SQL instance name. + string instance = 1; + + // ID of the project that contains the instance. + string project = 2; + + InstancesDemoteMasterRequest body = 100; +} + +// Instance demote request. +message SqlInstancesDemoteRequest { + // Required. Cloud SQL instance name. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The request body. + InstancesDemoteRequest body = 100 [(google.api.field_behavior) = REQUIRED]; +} + +// Instance export request. +message SqlInstancesExportRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance to be exported. + string project = 2; + + InstancesExportRequest body = 100; +} + +// Instance failover request. +message SqlInstancesFailoverRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // ID of the project that contains the read replica. + string project = 2; + + InstancesFailoverRequest body = 100; +} + +// Instance get request. +message SqlInstancesGetRequest { + // Required. Database instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Instance import request. +message SqlInstancesImportRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + InstancesImportRequest body = 100; +} + +// Instance insert request. +message SqlInstancesInsertRequest { + // Project ID of the project to which the newly created Cloud SQL instances + // should belong. + string project = 1; + + DatabaseInstance body = 100; +} + +// Instance list request. +message SqlInstancesListRequest { + // A filter expression that filters resources listed in the response. + // The expression is in the form of field:value. For example, + // 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per + // their JSON representation, such as 'settings.userLabels.auto_start:true'. + // + // Multiple filter queries are space-separated. For example. + // 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each + // expression is an AND expression. However, you can include AND and OR + // expressions explicitly. + string filter = 1; + + // The maximum number of instances to return. The service may return fewer + // than this value. + // If unspecified, at most 500 instances are returned. + // The maximum value is 1000; values above 1000 are coerced to 1000. + uint32 max_results = 2; + + // A previously-returned page token representing part of the larger set of + // results to view. + string page_token = 3; + + // Project ID of the project for which to list Cloud SQL instances. + string project = 4; +} + +// Instance list server CAs request. +message SqlInstancesListServerCasRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +// Instance list server certificates request. +message SqlInstancesListServerCertificatesRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Instance list Entra ID certificates request. +message SqlInstancesListEntraIdCertificatesRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Instance patch request. +message SqlInstancesPatchRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // Optional. Set PSC config to the same value as the existing config to + // reconcile the PSC networking. + optional bool reconcile_psc_networking = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set PSC config to the same value as the existing config and force + // reconcile the PSC networking. + optional bool reconcile_psc_networking_force = 5 + [(google.api.field_behavior) = OPTIONAL]; + + DatabaseInstance body = 100; +} + +// Instance promote replica request. +message SqlInstancesPromoteReplicaRequest { + // Cloud SQL read replica instance name. + string instance = 1; + + // ID of the project that contains the read replica. + string project = 2; + + // Set to true to invoke a replica failover to the DR + // replica. As part of replica failover, the promote operation attempts + // to add the original primary instance as a replica of the promoted + // DR replica when the original primary instance comes back online. + // If set to false or not specified, then the original primary + // instance becomes an independent Cloud SQL primary instance. + bool failover = 3; +} + +// Instance switchover request. +message SqlInstancesSwitchoverRequest { + // Cloud SQL read replica instance name. + string instance = 1; + + // ID of the project that contains the replica. + string project = 2; + + // Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations + // timeout, which is a sum of all database operations. Default value is 10 + // minutes and can be modified to a maximum value of 24 hours. + google.protobuf.Duration db_timeout = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Instance reset SSL config request. +message SqlInstancesResetSslConfigRequest { + // Reset SSL mode to selectively refresh the SSL materials. + enum ResetSslMode { + // Reset SSL mode is not specified. + RESET_SSL_MODE_UNSPECIFIED = 0; + + // Refresh all TLS configs. This is the default behaviour. + ALL = 1; + + // Refreshes the replication-related TLS configuration settings provided by + // the primary instance. + // Not applicable to on-premises replication instances. + SYNC_FROM_PRIMARY = 2; + } + + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // Optional. Reset SSL mode to use. + ResetSslMode mode = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Instance restart request. +message SqlInstancesRestartRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance to be restarted. + string project = 2; +} + +// Instance restore backup request. +message SqlInstancesRestoreBackupRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + InstancesRestoreBackupRequest body = 100; +} + +// Instance rotate server CA request. +message SqlInstancesRotateServerCaRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + InstancesRotateServerCaRequest body = 100; +} + +// Instance rotate server certificate request. +message SqlInstancesRotateServerCertificateRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Rotate server certificate request body. + InstancesRotateServerCertificateRequest body = 100 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Instance rotate server certificate request. +message SqlInstancesRotateEntraIdCertificateRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Rotate Entra ID certificate request body. + InstancesRotateEntraIdCertificateRequest body = 100 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Instance start replica request. +message SqlInstancesStartReplicaRequest { + // Cloud SQL read replica instance name. + string instance = 1; + + // ID of the project that contains the read replica. + string project = 2; +} + +// Instance stop replica request. +message SqlInstancesStopReplicaRequest { + // Cloud SQL read replica instance name. + string instance = 1; + + // ID of the project that contains the read replica. + string project = 2; +} + +// Instance truncate log request. +message SqlInstancesTruncateLogRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the Cloud SQL project. + string project = 2; + + InstancesTruncateLogRequest body = 100; +} + +// Instance perform disk shrink request. +message SqlInstancesPerformDiskShrinkRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // Perform disk shrink context. + PerformDiskShrinkContext body = 100; +} + +// Instance update request. +message SqlInstancesUpdateRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + DatabaseInstance body = 100; +} + +// Instance reschedule maintenance request. +message SqlInstancesRescheduleMaintenanceRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // ID of the project that contains the instance. + string project = 2; + + SqlInstancesRescheduleMaintenanceRequestBody body = 100; +} + +// Instance reencrypt request. +message SqlInstancesReencryptRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // ID of the project that contains the instance. + string project = 2; + + // Reencrypt body that users request + InstancesReencryptRequest body = 3; +} + +// Database Instance reencrypt request. +message InstancesReencryptRequest { + // Configuration specific to backup re-encryption + optional BackupReencryptionConfig backup_reencryption_config = 1; +} + +// Backup Reencryption Config +message BackupReencryptionConfig { + // Backup type for re-encryption + enum BackupType { + // Unknown backup type, will be defaulted to AUTOMATIC backup type + BACKUP_TYPE_UNSPECIFIED = 0; + + // Reencrypt automatic backups + AUTOMATED = 1; + + // Reencrypt on-demand backups + ON_DEMAND = 2; + } + + // Backup re-encryption limit + optional int32 backup_limit = 1; + + // Type of backups users want to re-encrypt. + optional BackupType backup_type = 2; +} + +// External Sync parallel level. +enum ExternalSyncParallelLevel { + // Unknown sync parallel level. Will be defaulted to OPTIMAL. + EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED = 0; + + // Minimal parallel level. + MIN = 1; + + // Optimal parallel level. + OPTIMAL = 2; + + // Maximum parallel level. + MAX = 3; +} + +// The selected object that Cloud SQL migrates. +message ExternalSyncSelectedObject { + // The name of the database that Cloud SQL migrates. + string database = 1; +} + +// Instance get disk shrink config request. +message SqlInstancesGetDiskShrinkConfigRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +// Instance verify external sync settings request. +message SqlInstancesVerifyExternalSyncSettingsRequest { + enum ExternalSyncMode { + // Unknown external sync mode, will be defaulted to ONLINE mode + EXTERNAL_SYNC_MODE_UNSPECIFIED = 0; + + // Online external sync will set up replication after initial data external + // sync + ONLINE = 1; + + // Offline external sync only dumps and loads a one-time snapshot of + // the primary instance's data + OFFLINE = 2; + } + + // MigrationType determines whether the migration is a physical file-based + // migration or a logical dump file-based migration. + enum MigrationType { + // Default value is a logical dump file-based migration + MIGRATION_TYPE_UNSPECIFIED = 0; + + // Logical dump file-based migration + LOGICAL = 1; + + // Physical file-based migration + PHYSICAL = 2; + } + + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // Flag to enable verifying connection only + bool verify_connection_only = 3; + + // External sync mode + ExternalSyncMode sync_mode = 4; + + // Optional. Flag to verify settings required by replication setup only + bool verify_replication_only = 5 [(google.api.field_behavior) = OPTIONAL]; + + oneof sync_config { + // Optional. MySQL-specific settings for start external sync. + MySqlSyncConfig mysql_sync_config = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. MigrationType configures the migration to use physical files or + // logical dump files. If not set, then the logical dump file configuration is + // used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + MigrationType migration_type = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Parallel level for initial data sync. Only applicable for + // PostgreSQL. + ExternalSyncParallelLevel sync_parallel_level = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Migrate only the specified objects from the source instance. If + // this field is empty, then migrate all objects. + repeated ExternalSyncSelectedObject selected_objects = 9 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Instance start external sync request. +message SqlInstancesStartExternalSyncRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // ID of the project that contains the instance. + string project = 2; + + // External sync mode. + SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + + // Whether to skip the verification step (VESS). + bool skip_verification = 4; + + oneof sync_config { + // MySQL-specific settings for start external sync. + MySqlSyncConfig mysql_sync_config = 6; + } + + // Optional. Parallel level for initial data sync. Currently only applicable + // for MySQL. + ExternalSyncParallelLevel sync_parallel_level = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. MigrationType configures the migration to use physical files or + // logical dump files. If not set, then the logical dump file configuration is + // used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. MySQL only. True if end-user has confirmed that this SES call + // will wipe replica databases overlapping with the proposed selected_objects. + // If this field is not set and there are both overlapping and additional + // databases proposed, an error will be returned. + bool replica_overwrite_enabled = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Instance reset replica size request. +message SqlInstancesResetReplicaSizeRequest { + // Cloud SQL read replica instance name. + string instance = 1; + + // ID of the project that contains the read replica. + string project = 2; +} + +// Instance create ephemeral certificate request. +message SqlInstancesCreateEphemeralCertRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the Cloud SQL project. + string project = 2; + + SslCertsCreateEphemeralRequest body = 100; +} + +// Database instance clone request. +message InstancesCloneRequest { + // Required. Contains details about the clone operation. + CloneContext clone_context = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Database demote primary instance request. +message InstancesDemoteMasterRequest { + // Contains details about the demoteMaster operation. + DemoteMasterContext demote_master_context = 1; +} + +// This request is used to demote an existing standalone instance to be a +// Cloud SQL read replica for an external database server. +message InstancesDemoteRequest { + // Required. Contains details about the demote operation. + DemoteContext demote_context = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Database instance export request. +message InstancesExportRequest { + // Contains details about the export operation. + ExportContext export_context = 1; +} + +// Instance failover request. +message InstancesFailoverRequest { + // Failover Context. + FailoverContext failover_context = 1; +} + +// SslCerts create ephemeral certificate request. +message SslCertsCreateEphemeralRequest { + // PEM encoded public key to include in the signed certificate. + string public_key = 1 [json_name = "public_key"]; + + // Access token to include in the signed certificate. + string access_token = 2 [json_name = "access_token"]; +} + +// Database instance import request. +message InstancesImportRequest { + // Contains details about the import operation. + ImportContext import_context = 1; +} + +// Request for Pre-checks for MVU +message InstancesPreCheckMajorVersionUpgradeRequest { + // Required. Contains details about the pre-check major version upgrade + // operation. + PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Database instances list response. +message InstancesListResponse { + // This is always `sql#instancesList`. + string kind = 1; + + // List of warnings that occurred while handling the request. + repeated ApiWarning warnings = 2; + + // List of database instance resources. + repeated DatabaseInstance items = 3; + + // The continuation token, used to page through large result sets. Provide + // this value in a subsequent request to return the next page of results. + string next_page_token = 4; +} + +// Instances ListServerCas response. +message InstancesListServerCasResponse { + // List of server CA certificates for the instance. + repeated SslCert certs = 1; + + string active_version = 2; + + // This is always `sql#instancesListServerCas`. + string kind = 3; +} + +// Instances ListServerCertificates response. +message InstancesListServerCertificatesResponse { + // List of server CA certificates for the instance. + repeated SslCert ca_certs = 1; + + // List of server certificates for the instance, signed by the corresponding + // CA from the `ca_certs` list. + repeated SslCert server_certs = 2; + + // The `sha1_fingerprint` of the active certificate from `server_certs`. + string active_version = 3; + + // This is always `sql#instancesListServerCertificates`. + string kind = 4; +} + +// Instances ListEntraIdCertificates response. +message InstancesListEntraIdCertificatesResponse { + // List of Entra ID certificates for the instance. + repeated SslCert certs = 1; + + // The `sha1_fingerprint` of the active certificate from `certs`. + string active_version = 2; + + // This is always `sql#instancesListEntraIdCertificates`. + string kind = 3; +} + +// Database instance restore backup request. +message InstancesRestoreBackupRequest { + // Parameters required to perform the restore backup operation. + RestoreBackupContext restore_backup_context = 1; + + // The name of the backup that's used to restore a Cloud SQL instance: + // Format: projects/{project-id}/backups/{backup-uid}. Only one of + // restore_backup_context, backup, backupdr_backup can be passed to the input. + string backup = 2 [ + (google.api.resource_reference) = { type: "sqladmin.googleapis.com/Backup" } + ]; + + // The name of the backup that's used to restore a Cloud SQL instance: + // Format: + // "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}". + // Only one of restore_backup_context, backup, backupdr_backup can be + // passed to the input. + string backupdr_backup = 4 [ + (google.api.resource_reference) = { type: "backupdr.googleapis.com/Backup" } + ]; + + // Optional. By using this parameter, Cloud SQL overrides any instance + // settings stored in the backup you are restoring from. You can't change the + // instance's major database version and you can only increase the disk size. + // You can use this field to restore new instances only. This field is not + // applicable for restore to existing instances. + DatabaseInstance restore_instance_settings = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This field has the same purpose as restore_instance_settings, + // changes any instance settings stored in the backup you are restoring from. + // With the difference that these fields are cleared in the settings. + repeated string restore_instance_clear_overrides_field_names = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Rotate server CA request. +message InstancesRotateServerCaRequest { + // Contains details about the rotate server CA operation. + RotateServerCaContext rotate_server_ca_context = 1; +} + +// Rotate server certificate request. +message InstancesRotateServerCertificateRequest { + // Optional. Contains details about the rotate server certificate operation. + RotateServerCertificateContext rotate_server_certificate_context = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Rotate Entra ID certificate request. +message InstancesRotateEntraIdCertificateRequest { + // Optional. Contains details about the rotate server certificate operation. + RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Instance truncate log request. +message InstancesTruncateLogRequest { + // Contains details about the truncate log operation. + TruncateLogContext truncate_log_context = 1; +} + +// Request to acquire a lease for SSRS. +message InstancesAcquireSsrsLeaseRequest { + // Contains details about the acquire SSRS lease operation. + AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; +} + +// Request for Pre-checks for MVU +message SqlInstancesPreCheckMajorVersionUpgradeRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The context for request to perform the pre-check major version + // upgrade operation. + InstancesPreCheckMajorVersionUpgradeRequest body = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Instance verify external sync settings response. +message SqlInstancesVerifyExternalSyncSettingsResponse { + // This is always `sql#migrationSettingErrorList`. + string kind = 1; + + // List of migration violations. + repeated SqlExternalSyncSettingError errors = 2; + + // List of migration warnings. + repeated SqlExternalSyncSettingError warnings = 3; +} + +// Instance get disk shrink config response. +message SqlInstancesGetDiskShrinkConfigResponse { + // This is always `sql#getDiskShrinkConfig`. + string kind = 1; + + // The minimum size to which a disk can be shrunk in GigaBytes. + int64 minimal_target_size_gb = 2; + + // Additional message to customers. + string message = 3; +} + +// Instance get latest recovery time request. +message SqlInstancesGetLatestRecoveryTimeRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // The timestamp used to identify the time when the source instance is + // deleted. If this instance is deleted, then you must set the timestamp. + optional google.protobuf.Timestamp source_instance_deletion_time = 3; +} + +// Instance get latest recovery time response. +message SqlInstancesGetLatestRecoveryTimeResponse { + // This is always `sql#getLatestRecoveryTime`. + string kind = 1; + + // Timestamp, identifies the latest recovery time of the source instance. + google.protobuf.Timestamp latest_recovery_time = 2; + + // Timestamp, identifies the earliest recovery time of the source instance. + google.protobuf.Timestamp earliest_recovery_time = 3; +} + +// Database instance clone context. +message CloneContext { + // This is always `sql#cloneContext`. + string kind = 1; + + // Reserved for future use. + int64 pitr_timestamp_ms = 2; + + // Required. Name of the Cloud SQL instance to be created as a clone. + string destination_instance_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // Binary log coordinates, if specified, identify the position up to which the + // source instance is cloned. If not specified, the source instance is + // cloned up to the most recent binary log coordinates. + BinLogCoordinates bin_log_coordinates = 4; + + // Timestamp, if specified, identifies the time to which the source instance + // is cloned. + google.protobuf.Timestamp point_in_time = 5; + + // The name of the allocated ip range for the private ip Cloud SQL instance. + // For example: "google-managed-services-default". If set, the cloned instance + // ip will be created in the allocated range. The range name must comply with + // [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name + // must be 1-63 characters long and match the regular expression + // [a-z]([-a-z0-9]*[a-z0-9])?. + // Reserved for future use. + string allocated_ip_range = 6; + + // (SQL Server only) Clone only the specified databases from the source + // instance. Clone all databases if empty. + repeated string database_names = 9; + + // Optional. Copy clone and point-in-time recovery clone of an instance to the + // specified zone. If no zone is specified, clone to the same primary zone as + // the source instance. This field applies to all DB types. + optional string preferred_zone = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Copy clone and point-in-time recovery clone of a regional + // instance in the specified zones. If not specified, clone to the same + // secondary zone as the source instance. This value cannot be the same as the + // preferred_zone field. This field applies to all DB types. + optional string preferred_secondary_zone = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // The timestamp used to identify the time when the source instance is + // deleted. If this instance is deleted, then you must set the timestamp. + optional google.protobuf.Timestamp source_instance_deletion_time = 12; + + // Optional. The project ID of the destination project where the cloned + // instance will be created. To perform a cross-project clone, this field is + // required. If not specified, the clone is created in the same project + // as the source instance. + optional string destination_project = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The fully qualified URI of the VPC network to which the cloned + // instance will be connected via private services access for private IP. For + // example:`projects/my-network-project/global/networks/my-network`. This + // field is only required for cross-project cloning. + optional string destination_network = 14 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; +} + +// The context to perform a point-in-time recovery of an instance managed by +// Backup and Disaster Recovery (DR) Service. +message PointInTimeRestoreContext { + // The Backup and Disaster Recovery (DR) Service Datasource URI. + // Format: + // projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}. + optional string datasource = 1; + + // Required. The date and time to which you want to restore the instance. + google.protobuf.Timestamp point_in_time = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Target instance name. + optional string target_instance = 3; + + // Optional. The resource link for the VPC network from which the Cloud SQL + // instance is accessible for private IP. For example, + // `/projects/myProject/global/networks/default`. + optional string private_network = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the allocated IP range for the internal IP Cloud SQL + // instance. For example: "google-managed-services-default". If you set this, + // then Cloud SQL creates the IP address for the cloned instance in the + // allocated range. This range must comply with [RFC + // 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the + // name must be 1-63 characters long and match the regular expression + // [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use. + optional string allocated_ip_range = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Point-in-time recovery of an instance to the specified zone. If + // no zone is specified, then clone to the same primary zone as the source + // instance. + optional string preferred_zone = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Point-in-time recovery of a regional instance in the specified + // zones. If not specified, clone to the same secondary zone as the source + // instance. This value cannot be the same as the preferred_zone field. + optional string preferred_secondary_zone = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the instance settings that will be overridden from the + // source instance. This field is only applicable for cross project PITRs. + DatabaseInstance target_instance_settings = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the instance settings that will be cleared from the + // source instance. This field is only applicable for cross project PITRs. + repeated string target_instance_clear_settings_field_names = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The region of the target instance where the datasource will be + // restored. For example: "us-central1". + optional string region = 13 [(google.api.field_behavior) = OPTIONAL]; +} + +// Binary log coordinates. +message BinLogCoordinates { + // Name of the binary log file for a Cloud SQL instance. + string bin_log_file_name = 1; + + // Position (offset) within the binary log file. + int64 bin_log_position = 2; + + // This is always `sql#binLogCoordinates`. + string kind = 3; +} + +// A Cloud SQL instance resource. +message DatabaseInstance { + // The current serving state of the database instance. + enum SqlInstanceState { + // The state of the instance is unknown. + SQL_INSTANCE_STATE_UNSPECIFIED = 0; + + // The instance is running, or has been stopped by owner. + RUNNABLE = 1; + + // The instance is not available, for example due to problems with billing. + SUSPENDED = 2; + + // The instance is being deleted. + PENDING_DELETE = 3; + + // The instance is being created. + PENDING_CREATE = 4; + + // The instance is down for maintenance. + MAINTENANCE = 5; + + // The creation of the instance failed or a fatal error occurred during + // maintenance. + FAILED = 6; + + // Deprecated + ONLINE_MAINTENANCE = 7 [deprecated = true]; + + // (Applicable to read pool nodes only.) The read pool node needs to be + // repaired. The database might be unavailable. + REPAIRING = 8; + } + + message SqlFailoverReplica { + // The name of the failover replica. If specified at instance creation, a + // failover replica is created for the instance. The name + // doesn't include the project ID. + string name = 1; + + // The availability status of the failover replica. A false status indicates + // that the failover replica is out of sync. The primary instance can only + // failover to the failover replica when the status is true. + google.protobuf.BoolValue available = 2; + } + + // Any scheduled maintenance for this instance. + message SqlScheduledMaintenance { + // The start time of any upcoming scheduled maintenance for this instance. + google.protobuf.Timestamp start_time = 1; + + bool can_defer = 2 [deprecated = true]; + + // If the scheduled maintenance can be rescheduled. + bool can_reschedule = 3; + + // Maintenance cannot be rescheduled to start beyond this deadline. + optional google.protobuf.Timestamp schedule_deadline_time = 4; + } + + // This message wraps up the information written by out-of-disk detection job. + message SqlOutOfDiskReport { + // This enum lists all possible states regarding out-of-disk issues. + enum SqlOutOfDiskState { + // Unspecified state + SQL_OUT_OF_DISK_STATE_UNSPECIFIED = 0; + + // The instance has plenty space on data disk + NORMAL = 1; + + // Data disk is almost used up. It is shutdown to prevent data + // corruption. + SOFT_SHUTDOWN = 2; + } + + // This field represents the state generated by the proactive database + // wellness job for OutOfDisk issues. + // * Writers: + // * the proactive database wellness job for OOD. + // * Readers: + // * the proactive database wellness job + optional SqlOutOfDiskState sql_out_of_disk_state = 1; + + // The minimum recommended increase size in GigaBytes + // This field is consumed by the frontend + // * Writers: + // * the proactive database wellness job for OOD. + // * Readers: + optional int32 sql_min_recommended_increase_size_gb = 2; + } + + // The SQL network architecture for the instance. + enum SqlNetworkArchitecture { + SQL_NETWORK_ARCHITECTURE_UNSPECIFIED = 0; + + // The instance uses the new network architecture. + NEW_NETWORK_ARCHITECTURE = 1; + + // The instance uses the old network architecture. + OLD_NETWORK_ARCHITECTURE = 2; + } + + // Details of a single read pool node of a read pool. + message PoolNodeConfig { + // Output only. The name of the read pool node, to be used for retrieving + // metrics and logs. + optional string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The zone of the read pool node. + optional string gce_zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Mappings containing IP addresses that can be used to connect + // to the read pool node. + repeated IpMapping ip_addresses = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The DNS name of the read pool node. + optional string dns_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the read pool node. + optional SqlInstanceState state = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of DNS names used by this read pool node. + repeated DnsNameMapping dns_names = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Private Service Connect (PSC) service attachment of the + // read pool node. + optional string psc_service_attachment_link = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of settings for requested automatically-setup + // Private Service Connect (PSC) consumer endpoints that can be used to + // connect to this read pool node. + repeated PscAutoConnectionConfig psc_auto_connections = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // This is always `sql#instance`. + string kind = 1; + + // The current serving state of the Cloud SQL instance. + SqlInstanceState state = 2; + + // The database engine type and version. The `databaseVersion` field cannot + // be changed after instance creation. + SqlDatabaseVersion database_version = 3; + + // The user settings. + Settings settings = 4; + + // This field is deprecated and will be removed from a future version of the + // API. Use the `settings.settingsVersion` field instead. + string etag = 5; + + // The name and status of the failover replica. + SqlFailoverReplica failover_replica = 6; + + // The name of the instance which will act as primary in the replication + // setup. + string master_instance_name = 7; + + // The replicas of the instance. + repeated string replica_names = 8; + + // The maximum disk size of the instance in bytes. + google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + + // The current disk usage of the instance in bytes. This property has been + // deprecated. Use the + // "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud + // Monitoring API instead. Please see [this + // announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ) + // for details. + google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + + // The assigned IP addresses for the instance. + repeated IpMapping ip_addresses = 11; + + // SSL configuration. + SslCert server_ca_cert = 12; + + // The instance type. + SqlInstanceType instance_type = 13; + + // The project ID of the project containing the Cloud SQL instance. The Google + // apps domain is prefixed if applicable. + string project = 14; + + // The IPv6 address assigned to the instance. + // (Deprecated) This property was applicable only + // to First Generation instances. + string ipv6_address = 15 [deprecated = true]; + + // The service account email address assigned to the instance.\This + // property is read-only. + string service_account_email_address = 16; + + // Configuration specific to on-premises instances. + OnPremisesConfiguration on_premises_configuration = 17; + + // Configuration specific to failover replicas and read replicas. + ReplicaConfiguration replica_configuration = 18; + + // The backend type. + // `SECOND_GEN`: Cloud SQL database instance. + // `EXTERNAL`: A database server that is not managed by Google. + // + // This property is read-only; use the `tier` property in the `settings` + // object to determine the database type. + SqlBackendType backend_type = 19; + + // The URI of this resource. + string self_link = 20; + + // If the instance state is SUSPENDED, the reason for the suspension. + repeated SqlSuspensionReason suspension_reason = 21; + + // Connection name of the Cloud SQL instance used in connection strings. + string connection_name = 22; + + // Name of the Cloud SQL instance. This does not include the project ID. + string name = 23; + + // The geographical region of the Cloud SQL instance. + // + // It can be one of the + // [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r) + // where Cloud SQL operates: + // + // For example, `asia-east1`, `europe-west1`, and `us-central1`. + // The default value is `us-central1`. + string region = 24; + + // The Compute Engine zone that the instance is currently serving from. This + // value could be different from the zone that was specified when the instance + // was created if the instance has failed over to its secondary zone. WARNING: + // Changing this might restart the instance. + string gce_zone = 25; + + // The Compute Engine zone that the failover instance is currently serving + // from for a regional instance. This value could be different + // from the zone that was specified when the instance + // was created if the instance has failed over to its secondary/failover zone. + string secondary_gce_zone = 34; + + // Disk encryption configuration specific to an instance. + DiskEncryptionConfiguration disk_encryption_configuration = 26; + + // Disk encryption status specific to an instance. + DiskEncryptionStatus disk_encryption_status = 27; + + // Initial root password. Use only on creation. You must set root passwords + // before you can connect to PostgreSQL instances. + string root_password = 29; + + // The start time of any upcoming scheduled maintenance for this instance. + SqlScheduledMaintenance scheduled_maintenance = 30; + + // This status indicates whether the instance satisfies PZS. + // + // The status is reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 35; + + // Output only. Stores the current database version running on the instance + // including minor version such as `MYSQL_8_0_18`. + string database_installed_version = 40 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // This field represents the report generated by the proactive database + // wellness job for OutOfDisk issues. + // * Writers: + // * the proactive database wellness job for OOD. + // * Readers: + // * the proactive database wellness job + optional SqlOutOfDiskReport out_of_disk_report = 38; + + // Output only. The time when the instance was created in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp create_time = 39 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List all maintenance versions applicable on the instance + repeated string available_maintenance_versions = 41 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The current software version on the instance. + string maintenance_version = 42; + + // Output only. All database versions that are available for upgrade. + repeated AvailableDatabaseVersion upgradable_database_versions = 45 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + optional SqlNetworkArchitecture sql_network_architecture = 47; + + // Output only. The link to service attachment of PSC instance. + optional string psc_service_attachment_link = 48 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The dns name of the instance. + optional string dns_name = 49 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. DEPRECATED: please use write_endpoint instead. + optional string primary_dns_name = 51 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The dns name of the primary instance in a replication group. + optional string write_endpoint = 52 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A primary instance and disaster recovery (DR) replica pair. + // A DR replica is a cross-region replica that you designate + // for failover in the event that the primary instance + // experiences regional failure. + // Applicable to MySQL and PostgreSQL. + ReplicationCluster replication_cluster = 54 + [(google.api.field_behavior) = OPTIONAL]; + + // Gemini instance configuration. + optional GeminiInstanceConfig gemini_config = 55; + + // Output only. This status indicates whether the instance satisfies PZI. + // + // The status is reserved for future use. + google.protobuf.BoolValue satisfies_pzi = 56 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Whether Cloud SQL is enabled to switch storing point-in-time + // recovery log files from a data disk to Cloud Storage. + optional google.protobuf.BoolValue + switch_transaction_logs_to_cloud_storage_enabled = 57 + [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. Determines whether an in-place major version upgrade of + // replicas happens when an in-place major version upgrade of a primary + // instance is initiated. + optional google.protobuf.BoolValue + include_replicas_for_major_version_upgrade = 59 + [(google.api.field_behavior) = INPUT_ONLY]; + + // Optional. Input only. Immutable. Tag keys and tag values that are bound to + // this instance. You must represent each item in the map as: + // `"" : ""`. + // + // For example, a single resource can have the following tags: + // ``` + // "123/environment": "production", + // "123/costCenter": "marketing", + // ``` + // + // For more information on tag creation and management, see + // https://cloud.google.com/resource-manager/docs/tags/tags-overview. + map tags = 60 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; + + // The number of read pool nodes in a read pool. + optional int32 node_count = 63; + + // Output only. Entries containing information about each read pool node of + // the read pool. + repeated PoolNodeConfig nodes = 64 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of DNS names used by this instance. + repeated DnsNameMapping dns_names = 67 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Gemini instance configuration. +message GeminiInstanceConfig { + // Output only. Whether Gemini is enabled. + optional bool entitled = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the vacuum management is enabled. + optional bool google_vacuum_mgmt_enabled = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether canceling the out-of-memory (OOM) session is enabled. + optional bool oom_session_cancel_enabled = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the active query is enabled. + optional bool active_query_enabled = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the index advisor is enabled. + optional bool index_advisor_enabled = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the flag recommender is enabled. + optional bool flag_recommender_enabled = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A primary instance and disaster recovery (DR) replica pair. +// A DR replica is a cross-region replica that you designate for failover in +// the event that the primary instance experiences regional failure. +// Applicable to MySQL and PostgreSQL. +message ReplicationCluster { + // Output only. If set, this field indicates this instance has a private + // service access (PSA) DNS endpoint that is pointing to the primary instance + // of the cluster. If this instance is the primary, then the DNS endpoint + // points to this instance. After a switchover or replica failover operation, + // this DNS endpoint points to the promoted instance. This is a read-only + // field, returned to the user as information. This field can exist even if a + // standalone instance doesn't have a DR replica yet or the DR replica is + // deleted. + string psa_write_endpoint = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. If the instance is a primary instance, then this field identifies + // the disaster recovery (DR) replica. A DR replica is an optional + // configuration for Enterprise Plus edition instances. If the instance is a + // read replica, then the field is not set. Set this field to a replica name + // to designate a DR replica for a primary instance. Remove the replica name + // to remove the DR replica designation. + string failover_dr_replica_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Read-only field that indicates whether the replica is a DR + // replica. This field is not set if the instance is a primary instance. + bool dr_replica = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// An available database version. It can be a major or a minor version. +message AvailableDatabaseVersion { + // The version's major version name. + optional string major_version = 3; + + // The database version name. For MySQL 8.0, this string provides the database + // major and minor version. + optional string name = 8; + + // The database version's display name. + optional string display_name = 9; +} + +// Reschedule options for maintenance windows. +message SqlInstancesRescheduleMaintenanceRequestBody { + enum RescheduleType { + RESCHEDULE_TYPE_UNSPECIFIED = 0; + + // Reschedules maintenance to happen now (within 5 minutes). + IMMEDIATE = 1; + + // Reschedules maintenance to occur within one week from the originally + // scheduled day and time. + NEXT_AVAILABLE_WINDOW = 2; + + // Reschedules maintenance to a specific time and day. + SPECIFIC_TIME = 3; + } + + message Reschedule { + // Required. The type of the reschedule. + RescheduleType reschedule_type = 1; + + // Optional. Timestamp when the maintenance shall be rescheduled to if + // reschedule_type=SPECIFIC_TIME, in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp schedule_time = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The type of the reschedule the user wants. + Reschedule reschedule = 3; +} + +// Database instance demote primary instance context. +message DemoteMasterContext { + // This is always `sql#demoteMasterContext`. + string kind = 1; + + // Verify the GTID consistency for demote operation. Default value: + // `True`. Setting this flag to `false` enables you to bypass the GTID + // consistency check between on-premises primary instance and Cloud SQL + // instance during the demotion operation but also exposes you to the risk of + // future replication failures. Change the value only if you know the reason + // for the GTID divergence and are confident that doing so will not cause any + // replication issues. + google.protobuf.BoolValue verify_gtid_consistency = 2; + + // The name of the instance which will act as on-premises primary instance + // in the replication setup. + string master_instance_name = 3; + + // Configuration specific to read-replicas replicating from the on-premises + // primary instance. + DemoteMasterConfiguration replica_configuration = 4; + + // Flag to skip replication setup on the instance. + bool skip_replication_setup = 5; +} + +// This context is used to demote an existing standalone instance to be +// a Cloud SQL read replica for an external database server. +message DemoteContext { + // This is always `sql#demoteContext`. + string kind = 1; + + // Required. The name of the instance which acts as the on-premises primary + // instance in the replication setup. + string source_representative_instance_name = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Database instance failover context. +message FailoverContext { + // The current settings version of this instance. Request will be rejected if + // this version doesn't match the current settings version. + int64 settings_version = 1; + + // This is always `sql#failoverContext`. + string kind = 2; +} + +// Database instance restore from backup context. +// Backup context contains source instance id and project id. +message RestoreBackupContext { + // This is always `sql#restoreBackupContext`. + string kind = 1; + + // The ID of the backup run to restore from. + int64 backup_run_id = 2; + + // The ID of the instance that the backup was taken from. + string instance_id = 3; + + // The full project ID of the source instance. + string project = 4; +} + +// Instance rotate server CA context. +message RotateServerCaContext { + // This is always `sql#rotateServerCaContext`. + string kind = 1; + + // The fingerprint of the next version to be rotated to. If left unspecified, + // will be rotated to the most recently added server CA version. + string next_version = 2; +} + +// Instance rotate server certificate context. +message RotateServerCertificateContext { + // Optional. This is always `sql#rotateServerCertificateContext`. + string kind = 1 [(google.api.field_behavior) = OPTIONAL]; + + // The fingerprint of the next version to be rotated to. If left unspecified, + // will be rotated to the most recently added server certificate version. + string next_version = 2; +} + +// Instance rotate Entra ID certificate context. +message RotateEntraIdCertificateContext { + // Optional. This is always `sql#rotateEntraIdCertificateContext`. + string kind = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The fingerprint of the next version to be rotated to. If left + // unspecified, will be rotated to the most recently added server certificate + // version. + string next_version = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Database Instance truncate log context. +message TruncateLogContext { + // This is always `sql#truncateLogContext`. + string kind = 1; + + // The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and + // `MYSQL_SLOW_TABLE`. + string log_type = 2; +} + +// External primary instance migration setting error/warning. +message SqlExternalSyncSettingError { + enum SqlExternalSyncSettingErrorType { + SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED = 0; + + CONNECTION_FAILURE = 1; + + BINLOG_NOT_ENABLED = 2; + + INCOMPATIBLE_DATABASE_VERSION = 3; + + REPLICA_ALREADY_SETUP = 4; + + // The replication user is missing privileges that are required. + INSUFFICIENT_PRIVILEGE = 5; + + // Unsupported migration type. + UNSUPPORTED_MIGRATION_TYPE = 6; + + // No pglogical extension installed on databases, applicable for postgres. + NO_PGLOGICAL_INSTALLED = 7; + + // pglogical node already exists on databases, applicable for postgres. + PGLOGICAL_NODE_ALREADY_EXISTS = 8; + + // The value of parameter wal_level is not set to logical. + INVALID_WAL_LEVEL = 9; + + // The value of parameter shared_preload_libraries does not include + // pglogical. + INVALID_SHARED_PRELOAD_LIBRARY = 10; + + // The value of parameter max_replication_slots is not sufficient. + INSUFFICIENT_MAX_REPLICATION_SLOTS = 11; + + // The value of parameter max_wal_senders is not sufficient. + INSUFFICIENT_MAX_WAL_SENDERS = 12; + + // The value of parameter max_worker_processes is not sufficient. + INSUFFICIENT_MAX_WORKER_PROCESSES = 13; + + // Extensions installed are either not supported or having unsupported + // versions. + UNSUPPORTED_EXTENSIONS = 14; + + // The value of parameter rds.logical_replication is not set to 1. + INVALID_RDS_LOGICAL_REPLICATION = 15; + + // The primary instance logging setup doesn't allow EM sync. + INVALID_LOGGING_SETUP = 16; + + // The primary instance database parameter setup doesn't allow EM sync. + INVALID_DB_PARAM = 17; + + // The gtid_mode is not supported, applicable for MySQL. + UNSUPPORTED_GTID_MODE = 18; + + // SQL Server Agent is not running. + SQLSERVER_AGENT_NOT_RUNNING = 19; + + // The table definition is not support due to missing primary key or replica + // identity, applicable for postgres. Note that this is a warning and won't + // block the migration. + UNSUPPORTED_TABLE_DEFINITION = 20; + + // The customer has a definer that will break EM setup. + UNSUPPORTED_DEFINER = 21; + + // SQL Server @@SERVERNAME does not match actual host name. + SQLSERVER_SERVERNAME_MISMATCH = 22; + + // The primary instance has been setup and will fail the setup. + PRIMARY_ALREADY_SETUP = 23; + + // The primary instance has unsupported binary log format. + UNSUPPORTED_BINLOG_FORMAT = 24; + + // The primary instance's binary log retention setting. + BINLOG_RETENTION_SETTING = 25; + + // The primary instance has tables with unsupported storage engine. + UNSUPPORTED_STORAGE_ENGINE = 26; + + // Source has tables with limited support + // eg: PostgreSQL tables without primary keys. + LIMITED_SUPPORT_TABLES = 27; + + // The replica instance contains existing data. + EXISTING_DATA_IN_REPLICA = 28; + + // The replication user is missing privileges that are optional. + MISSING_OPTIONAL_PRIVILEGES = 29; + + // Additional BACKUP_ADMIN privilege is granted to the replication user + // which may lock source MySQL 8 instance for DDLs during initial sync. + RISKY_BACKUP_ADMIN_PRIVILEGE = 30; + + // The Cloud Storage bucket is missing necessary permissions. + INSUFFICIENT_GCS_PERMISSIONS = 31; + + // The Cloud Storage bucket has an error in the file or contains invalid + // file information. + INVALID_FILE_INFO = 32; + + // The source instance has unsupported database settings for migration. + UNSUPPORTED_DATABASE_SETTINGS = 33; + + // The replication user is missing parallel import specific privileges. + // (e.g. LOCK TABLES) for MySQL. + MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE = 34; + + // The global variable local_infile is off on external server replica. + LOCAL_INFILE_OFF = 35; + + // This code instructs customers to turn on point-in-time recovery manually + // for the instance after promoting the Cloud SQL for PostgreSQL instance. + TURN_ON_PITR_AFTER_PROMOTE = 36; + + // The minor version of replica database is incompatible with the source. + INCOMPATIBLE_DATABASE_MINOR_VERSION = 37; + + // This warning message indicates that Cloud SQL uses the maximum number of + // subscriptions to migrate data from the source to the destination. + SOURCE_MAX_SUBSCRIPTIONS = 38; + + // Unable to verify definers on the source for MySQL. + UNABLE_TO_VERIFY_DEFINERS = 39; + + // If a time out occurs while the subscription counts are calculated, then + // this value is set to 1. Otherwise, this value is set to 2. + SUBSCRIPTION_CALCULATION_STATUS = 40; + + // Count of subscriptions needed to sync source data for PostgreSQL + // database. + PG_SUBSCRIPTION_COUNT = 41; + + // Final parallel level that is used to do migration. + PG_SYNC_PARALLEL_LEVEL = 42; + + // The disk size of the replica instance is smaller than the data size of + // the source instance. + INSUFFICIENT_DISK_SIZE = 43; + + // The data size of the source instance is greater than 1 TB, the number of + // cores of the replica instance is less than 8, and the memory of the + // replica is less than 32 GB. + INSUFFICIENT_MACHINE_TIER = 44; + + // The warning message indicates the unsupported extensions will not be + // migrated to the destination. + UNSUPPORTED_EXTENSIONS_NOT_MIGRATED = 45; + + // The warning message indicates the pg_cron extension and settings will not + // be migrated to the destination. + EXTENSIONS_NOT_MIGRATED = 46; + + // The error message indicates that pg_cron flags are enabled on the + // destination which is not supported during the migration. + PG_CRON_FLAG_ENABLED_IN_REPLICA = 47; + + // This error message indicates that the specified extensions are not + // enabled on destination instance. For example, before you can migrate + // data to the destination instance, you must enable the PGAudit extension + // on the instance. + EXTENSIONS_NOT_ENABLED_IN_REPLICA = 48; + + // The source database has generated columns that can't be migrated. Please + // change them to regular columns before migration. + UNSUPPORTED_COLUMNS = 49; + + // The source database has users that aren't created in the replica. + // First, create all users, which are in the pg_user_mappings table + // of the source database, in the destination instance. Then, perform the + // migration. + USERS_NOT_CREATED_IN_REPLICA = 50; + + // The selected objects include system objects that aren't supported for + // migration. + UNSUPPORTED_SYSTEM_OBJECTS = 51; + + // The source database has tables with the FULL or NOTHING replica identity. + // Before starting your migration, either remove the identity or change it + // to DEFAULT. Note that this is an error and will block the migration. + UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY = 52; + + // The selected objects don't exist on the source instance. + SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE = 53; + + // PSC only destination instance does not have a network attachment URI. + PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI = 54; + + // Selected objects reference unselected objects. Based on their object type + // (foreign key constraint or view), selected objects will fail during + // migration. + SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS = 55; + + // The migration will delete existing data in the replica; set + // [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled] + // in the request to acknowledge this. This is an error. MySQL only. + PROMPT_DELETE_EXISTING = 56; + + // The migration will delete existing data in the replica; + // [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled] + // was set in the request acknowledging this. This is a warning rather than + // an error. MySQL only. + WILL_DELETE_EXISTING = 57; + + // The replication user is missing specific privileges to setup DDL + // replication. (e.g. CREATE EVENT TRIGGER, CREATE SCHEMA) for PostgreSQL. + PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE = 58; + } + + // Can be `sql#externalSyncSettingError` or + // `sql#externalSyncSettingWarning`. + string kind = 1; + + // Identifies the specific error that occurred. + SqlExternalSyncSettingErrorType type = 2; + + // Additional information about the error encountered. + string detail = 3; +} + +// A list of objects that the user selects for replication from an external +// source instance. +message SelectedObjects { + // Required. The name of the database to migrate. + string database = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// On-premises instance configuration. +message OnPremisesConfiguration { + // SslOption defines the SSL mode to be used for replica connection to the + // on-premises source. + enum SslOption { + // Unknown SSL option i.e. SSL option not specified by user. + SSL_OPTION_UNSPECIFIED = 0; + + // SSL is not used for replica connection to the on-premises source. + DISABLE = 1; + + // SSL is required for replica connection to the on-premises source. + REQUIRE = 2; + + // Verify CA is required for replica connection to the on-premises source. + VERIFY_CA = 3; + } + + // The host and port of the on-premises instance in host:port format + string host_port = 1; + + // This is always `sql#onPremisesConfiguration`. + string kind = 2; + + // The username for connecting to on-premises instance. + string username = 3; + + // The password for connecting to on-premises instance. + string password = 4; + + // PEM representation of the trusted CA's x509 certificate. + string ca_certificate = 5; + + // PEM representation of the replica's x509 certificate. + string client_certificate = 6; + + // PEM representation of the replica's private key. The corresponding public + // key is encoded in the client's certificate. + string client_key = 7; + + // The dump file to create the Cloud SQL replica. + string dump_file_path = 8; + + // The reference to Cloud SQL instance if the source is Cloud SQL. + InstanceReference source_instance = 15; + + // Optional. A list of objects that the user selects for replication from an + // external source instance. + repeated SelectedObjects selected_objects = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. SSL option for replica connection to the on-premises source. + SslOption ssl_option = 18 [(google.api.field_behavior) = OPTIONAL]; +} + +// Read-replica configuration for connecting to the primary instance. +message ReplicaConfiguration { + // This is always `sql#replicaConfiguration`. + string kind = 1; + + // MySQL specific configuration when replicating from a MySQL on-premises + // primary instance. Replication configuration information such as the + // username, password, certificates, and keys are not stored in the instance + // metadata. The configuration information is used only to set up the + // replication connection and is stored by MySQL in a file named + // `master.info` in the data directory. + MySqlReplicaConfiguration mysql_replica_configuration = 2; + + // Specifies if the replica is the failover target. If the field is set to + // `true`, the replica will be designated as a failover replica. In case the + // primary instance fails, the replica instance will be promoted as the new + // primary instance. Only one replica can be specified as failover target, and + // the replica has to be in different zone with the primary instance. + google.protobuf.BoolValue failover_target = 3; + + // Optional. Specifies if a SQL Server replica is a cascadable replica. A + // cascadable replica is a SQL Server cross region replica that supports + // replica(s) under it. + google.protobuf.BoolValue cascadable_replica = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Execute SQL statements request. +message SqlInstancesExecuteSqlRequest { + // Required. Database instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; + + // The request body. + ExecuteSqlPayload body = 100; +} + +// The request payload used to execute SQL statements. +message ExecuteSqlPayload { + // Controls how the API should respond when the SQL execution result exceeds + // 10 MB. + enum PartialResultMode { + // Unspecified mode, effectively the same as `FAIL_PARTIAL_RESULT`. + PARTIAL_RESULT_MODE_UNSPECIFIED = 0; + + // Throw an error if the result exceeds 10 MB or if only a partial result + // can be retrieved. Don't return the result. + FAIL_PARTIAL_RESULT = 1; + + // Return a truncated result and set `partial_result` to true if the result + // exceeds 10 MB or if only a partial result can be retrieved due to error. + // Don't throw an error. + ALLOW_PARTIAL_RESULT = 2; + } + + // Optional. The name of an existing database user to connect to the database. + // When `auto_iam_authn` is set to true, this field is ignored and the API + // caller's IAM user is used. + string user = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. SQL statements to run on the database. It can be a single + // statement or a sequence of statements separated by semicolons. + string sql_statement = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Name of the database on which the statement will be executed. + string database = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Credentials for the database connection. + oneof user_password { + // Optional. When set to `true`, the API caller identity associated with the + // request is used for database authentication. The API caller must be an + // IAM user in the database. + bool auto_iam_authn = 11 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The maximum number of rows returned per SQL statement. + int64 row_limit = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls how the API should respond when the SQL execution result + // is incomplete due to the size limit or another error. The default mode is + // to throw an error. + PartialResultMode partial_result_mode = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the name of the application that is making the request. + // This field is used for telemetry. Only alphanumeric characters, dashes, and + // underscores are allowed. The maximum length is 32 characters. + string application = 16 [(google.api.field_behavior) = OPTIONAL]; +} + +// Execute SQL statements response. +message SqlInstancesExecuteSqlResponse { + // Represents a notice or warning message from the database. + message Message { + // The full message string. + // For PostgreSQL, this is a formatted string that may include severity, + // code, and the notice/warning message. + // For MySQL, this contains the warning message. + optional string message = 1; + + // The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for + // MySQL). + optional string severity = 2; + } + + // A list of notices and warnings generated during query execution. + // For PostgreSQL, this includes all notices and warnings. + // For MySQL, this includes warnings generated by the last executed statement. + // To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must + // be executed after each statement. + repeated Message messages = 9; + + // The additional metadata information regarding the execution of the SQL + // statements. + Metadata metadata = 6; + + // The list of results after executing all the SQL statements. + repeated QueryResult results = 7; + + // Contains the error from the database if the SQL execution failed. + google.rpc.Status status = 8; +} + +// QueryResult contains the result of executing a single SQL statement. +message QueryResult { + // List of columns included in the result. This also includes the data type + // of the column. + repeated Column columns = 1; + + // Rows returned by the SQL statement. + repeated Row rows = 2; + + // Message related to the SQL execution result. + string message = 3; + + // Set to true if the SQL execution's result is truncated due to size limits + // or an error retrieving results. + bool partial_result = 4; + + // If results were truncated due to an error, details of that error. + google.rpc.Status status = 8; +} + +// Contains the name and datatype of a column. +message Column { + // Name of the column. + string name = 1; + + // Datatype of the column. + string type = 2; +} + +// Contains the values for a row. +message Row { + // The values for the row. + repeated Value values = 1; +} + +// The cell value of the table. +message Value { + // The cell value in string format. + string value = 1; + + // If cell value is null, then this flag will be set to true. + bool null_value = 2; +} + +// The additional metadata information regarding the execution of the SQL +// statements. +message Metadata { + // The time taken to execute the SQL statements. + google.protobuf.Duration sql_statement_execution_time = 1; +} + +// Request to acquire a lease for SSRS. +message SqlInstancesAcquireSsrsLeaseRequest { + // Required. Cloud SQL instance ID. This doesn't include the project ID. It's + // composed of lowercase letters, numbers, and hyphens, and it must start with + // a letter. The total length must be 98 characters or less (Example: + // instance-id). + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance (Example: + // project-id). + string project = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The request body. + InstancesAcquireSsrsLeaseRequest body = 100 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response for the acquire SSRS lease request. +message SqlInstancesAcquireSsrsLeaseResponse { + // The unique identifier for this operation. + string operation_id = 1; +} + +// Request to release a lease for SSRS. +message SqlInstancesReleaseSsrsLeaseRequest { + // Required. The Cloud SQL instance ID. This doesn't include the project ID. + // The instance ID contains lowercase letters, numbers, and hyphens, and it + // must start with a letter. This ID can have a maximum length of 98 + // characters. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The project ID that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for the release SSRS lease request. +message SqlInstancesReleaseSsrsLeaseResponse { + // The unique identifier for this operation. + string operation_id = 1; +} + +// Request to perform a point in time restore on a Google Cloud Backup and +// Disaster Recovery managed instance. +message SqlInstancesPointInTimeRestoreRequest { + // Required. The parent resource where you created this instance. + // Format: projects/{project} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The context for request to perform a PITR on a Google Cloud + // Backup and Disaster Recovery managed instance. + PointInTimeRestoreContext context = 100 + [(google.api.field_behavior) = REQUIRED]; +} + +enum SqlInstanceType { + // This is an unknown Cloud SQL instance type. + SQL_INSTANCE_TYPE_UNSPECIFIED = 0; + + // A regular Cloud SQL instance that is not replicating from a primary + // instance. + CLOUD_SQL_INSTANCE = 1; + + // An instance running on the customer's premises that is not managed by + // Cloud SQL. + ON_PREMISES_INSTANCE = 2; + + // A Cloud SQL instance acting as a read-replica. + READ_REPLICA_INSTANCE = 3; + + // A Cloud SQL read pool. + READ_POOL_INSTANCE = 5; +} + +// The suspension reason of the database instance if the state is SUSPENDED. +enum SqlSuspensionReason { + // This is an unknown suspension reason. + SQL_SUSPENSION_REASON_UNSPECIFIED = 0; + + // The instance is suspended due to billing issues (for example:, account + // issue) + BILLING_ISSUE = 2; + + // The instance is suspended due to illegal content (for example:, child + // pornography, copyrighted material, etc.). + LEGAL_ISSUE = 3; + + // The instance is causing operational issues (for example:, causing the + // database to crash). + OPERATIONAL_ISSUE = 4; + + // The KMS key used by the instance is either revoked or denied access to + KMS_KEY_ISSUE = 5; + + // The project is suspended due to abuse detected by Ares. + PROJECT_ABUSE = 8; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_operations.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_operations.proto new file mode 100644 index 000000000000..dd4c3fa7e5ef --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_operations.proto @@ -0,0 +1,105 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/sql/v1/cloud_sql_resources.proto"; +import "google/protobuf/empty.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlOperationsProto"; +option java_package = "com.google.cloud.sql.v1"; + +// Service to fetch operations for database instances. +service SqlOperationsService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Retrieves an instance operation that has been performed on an instance. + rpc Get(SqlOperationsGetRequest) returns (Operation) { + option (google.api.http) = { + get: "/v1/projects/{project}/operations/{operation}" + }; + } + + // Lists all instance operations that have been performed on the given Cloud + // SQL instance in the reverse chronological order of the start time. + rpc List(SqlOperationsListRequest) returns (OperationsListResponse) { + option (google.api.http) = { + get: "/v1/projects/{project}/operations" + }; + } + + // Cancels an instance operation that has been performed on an instance. + rpc Cancel(SqlOperationsCancelRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/projects/{project}/operations/{operation}/cancel" + }; + } +} + +// Operations get request. +message SqlOperationsGetRequest { + // Required. Instance operation ID. + string operation = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Operations list request. +message SqlOperationsListRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Maximum number of operations per response. + uint32 max_results = 2; + + // A previously-returned page token representing part of the larger set of + // results to view. + string page_token = 3; + + // Project ID of the project that contains the instance. + string project = 4; +} + +// Operations list response. +message OperationsListResponse { + // This is always `sql#operationsList`. + string kind = 1; + + // List of operation resources. + repeated Operation items = 2; + + // The continuation token, used to page through large result sets. Provide + // this value in a subsequent request to return the next page of results. + string next_page_token = 3; +} + +// Operations cancel request. +message SqlOperationsCancelRequest { + // Instance operation ID. + string operation = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_regions.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_regions.proto new file mode 100644 index 000000000000..91d841faf5ca --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_regions.proto @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlRegionsServiceProto"; +option java_package = "com.google.cloud.sql.v1"; + +// Service that exposes Cloud SQL region information. This service is only used +// internally and does not follow the same patterns as the other v1 RPCs. +service SqlRegionsService { + option (google.api.default_host) = "sqladmin.googleapis.com"; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_resources.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_resources.proto new file mode 100644 index 000000000000..b8b56ef7cf65 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_resources.proto @@ -0,0 +1,2525 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlResourcesProto"; +option java_package = "com.google.cloud.sql.v1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/ServiceConnectionPolicy" + pattern: "projects/{project}/regions/{region}/serviceConnectionPolicies/{service_connection_policy}" +}; +option (google.api.resource_definition) = { + type: "cloudsql.googleapis.com/Instance" + pattern: "projects/{project}/instances/{instance}" +}; + +// An entry for an Access Control list. +message AclEntry { + // The allowlisted value for the access control list. + string value = 1; + + // The time when this access control entry expires in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp expiration_time = 2; + + // Optional. A label to identify this entry. + string name = 3 [(google.api.field_behavior) = OPTIONAL]; + + // This is always `sql#aclEntry`. + string kind = 4; +} + +// An Admin API warning message. +message ApiWarning { + enum SqlApiWarningCode { + // An unknown or unset warning type from Cloud SQL API. + SQL_API_WARNING_CODE_UNSPECIFIED = 0; + + // Warning when one or more regions are not reachable. The returned result + // set may be incomplete. + REGION_UNREACHABLE = 1; + + // Warning when user provided maxResults parameter exceeds the limit. The + // returned result set may be incomplete. + MAX_RESULTS_EXCEEDS_LIMIT = 2; + + // Warning when user tries to create/update a user with credentials that + // have previously been compromised by a public data breach. + COMPROMISED_CREDENTIALS = 3; + + // Warning when the operation succeeds but some non-critical workflow state + // failed. + INTERNAL_STATE_FAILURE = 4; + } + + // Code to uniquely identify the warning type. + SqlApiWarningCode code = 1; + + // The warning message. + string message = 2; + + // The region name for REGION_UNREACHABLE warning. + string region = 3; +} + +// We currently only support backup retention by specifying the number +// of backups we will retain. +message BackupRetentionSettings { + // The units that retained_backups specifies, we only support COUNT. + enum RetentionUnit { + // Backup retention unit is unspecified, will be treated as COUNT. + RETENTION_UNIT_UNSPECIFIED = 0; + + // Retention will be by count, eg. "retain the most recent 7 backups". + COUNT = 1; + } + + // The unit that 'retained_backups' represents. + RetentionUnit retention_unit = 1; + + // Depending on the value of retention_unit, this is used to determine + // if a backup needs to be deleted. If retention_unit is 'COUNT', we will + // retain this many backups. + google.protobuf.Int32Value retained_backups = 2; +} + +// Database instance backup configuration. +message BackupConfiguration { + // This value contains the storage location of the transactional logs + // used to perform point-in-time recovery (PITR) for the database. + enum TransactionalLogStorageState { + // Unspecified. + TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED = 0; + + // The transaction logs used for PITR for the instance are stored + // on a data disk. + DISK = 1; + + // The transaction logs used for PITR for the instance are switching from + // being stored on a data disk to being stored in Cloud Storage. + // Only applicable to MySQL. + SWITCHING_TO_CLOUD_STORAGE = 2; + + // The transaction logs used for PITR for the instance are now stored + // in Cloud Storage. Previously, they were stored on a data disk. + // Only applicable to MySQL. + SWITCHED_TO_CLOUD_STORAGE = 3; + + // The transaction logs used for PITR for the instance are stored in + // Cloud Storage. Only applicable to MySQL and PostgreSQL. + CLOUD_STORAGE = 4; + } + + // Backup tier that manages the backups for the instance. + enum BackupTier { + // Unspecified. + BACKUP_TIER_UNSPECIFIED = 0; + + // Instance is managed by Cloud SQL. + STANDARD = 1; + + // Deprecated: ADVANCED is deprecated. Please use ENHANCED instead. + ADVANCED = 2 [deprecated = true]; + + // Instance is managed by Google Cloud Backup and DR Service. + ENHANCED = 3; + } + + // Start time for the daily backup configuration in UTC timezone in the 24 + // hour format - `HH:MM`. + string start_time = 1; + + // Whether this configuration is enabled. + google.protobuf.BoolValue enabled = 2; + + // This is always `sql#backupConfiguration`. + string kind = 3; + + // (MySQL only) Whether binary log is enabled. If backup configuration is + // disabled, binarylog must be disabled as well. + google.protobuf.BoolValue binary_log_enabled = 4; + + // Optional. Deprecated: replication_log_archiving_enabled is deprecated and + // will be removed from a future version of the API. Use + // [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled] + // instead. + google.protobuf.BoolValue replication_log_archiving_enabled = 5 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Location of the backup + string location = 6; + + // Whether point in time recovery is enabled. + google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + + // Backup retention settings. + BackupRetentionSettings backup_retention_settings = 8; + + // The number of days of transaction logs we retain for point in time + // restore, from 1-7. + google.protobuf.Int32Value transaction_log_retention_days = 9; + + // Output only. This value contains the storage location of transactional logs + // used to perform point-in-time recovery (PITR) for the database. + optional TransactionalLogStorageState transactional_log_storage_state = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Backup tier that manages the backups for the instance. + optional BackupTier backup_tier = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Perform disk shrink context. +message PerformDiskShrinkContext { + // The target disk shrink size in GigaBytes. + int64 target_size_gb = 1; +} + +// Structured PreCheckResponse containing message, type, and required +// actions. +message PreCheckResponse { + // The type of message which can be an info, a warning, or an error that + // requires user intervention. + enum MessageType { + // Default unspecified value to prevent unintended behavior changes. + MESSAGE_TYPE_UNSPECIFIED = 0; + + // General informational messages that don't require action. + INFO = 1; + + // Warnings that might impact the upgrade but don't block it. + WARNING = 2; + + // Errors that a user must resolve before proceeding with the upgrade. + ERROR = 3; + } + + // The message to be displayed to the user. + optional string message = 2; + + // The type of message whether it is an info, warning, or error. + optional MessageType message_type = 3; + + // The actions that the user needs to take. Use repeated for multiple + // actions. + repeated string actions_required = 4; +} + +// Pre-check major version upgrade context. +message PreCheckMajorVersionUpgradeContext { + // Required. The target database version to upgrade to. + SqlDatabaseVersion target_database_version = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Output only. The responses from the precheck operation. + repeated PreCheckResponse pre_check_response = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. This is always `sql#preCheckMajorVersionUpgradeContext`. + string kind = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Backup context. +message BackupContext { + // The identifier of the backup. + int64 backup_id = 1; + + // This is always `sql#backupContext`. + string kind = 2; + + // The name of the backup. + // Format: projects/{project}/backups/{backup} + string name = 3; +} + +// Represents a SQL database on the Cloud SQL instance. +message Database { + // This is always `sql#database`. + string kind = 1; + + // The Cloud SQL charset value. + string charset = 2; + + // The Cloud SQL collation value. + string collation = 3; + + // This field is deprecated and will be removed from a future version of the + // API. + string etag = 4; + + // The name of the database in the Cloud SQL instance. This does not include + // the project ID or instance name. + string name = 5; + + // The name of the Cloud SQL instance. This does not include the project ID. + string instance = 6; + + // The URI of this resource. + string self_link = 7; + + // The project ID of the project containing the Cloud SQL database. The Google + // apps domain is prefixed if applicable. + string project = 8; + + oneof database_details { + SqlServerDatabaseDetails sqlserver_database_details = 9; + } +} + +// Represents a Sql Server database on the Cloud SQL instance. +message SqlServerDatabaseDetails { + // The version of SQL Server with which the database is to be made compatible + int32 compatibility_level = 1; + + // The recovery model of a SQL Server database + string recovery_model = 2; +} + +// Database flags for Cloud SQL instances. +message DatabaseFlags { + // The name of the flag. These flags are passed at instance startup, so + // include both server options and system variables. Flags are + // specified with underscores, not hyphens. For more information, see + // [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags) + // in the Cloud SQL documentation. + string name = 1; + + // The value of the flag. Boolean flags are set to `on` for true + // and `off` for false. This field must be omitted if the flag + // doesn't take a value. + string value = 2; +} + +// MySQL-specific external server sync settings. +message MySqlSyncConfig { + // Flags to use for the initial dump. + repeated SyncFlags initial_sync_flags = 1; +} + +// Initial sync flags for certain Cloud SQL APIs. +// Currently used for the MySQL external server initial dump. +message SyncFlags { + // The name of the flag. + string name = 1; + + // The value of the flag. This field must be omitted if the flag + // doesn't take a value. + string value = 2; +} + +// Reference to another Cloud SQL instance. +message InstanceReference { + // The name of the Cloud SQL instance being referenced. + // This does not include the project ID. + string name = 1; + + // The region of the Cloud SQL instance being referenced. + string region = 2; + + // The project ID of the Cloud SQL instance being referenced. + // The default is the same project ID as the instance references it. + string project = 3; +} + +// Read-replica configuration for connecting to the on-premises primary +// instance. +message DemoteMasterConfiguration { + // This is always `sql#demoteMasterConfiguration`. + string kind = 1; + + // MySQL specific configuration when replicating from a MySQL on-premises + // primary instance. Replication configuration information such as the + // username, password, certificates, and keys are not stored in the instance + // metadata. The configuration information is used only to set up the + // replication connection and is stored by MySQL in a file named + // `master.info` in the data directory. + DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; +} + +// Read-replica configuration specific to MySQL databases. +message DemoteMasterMySqlReplicaConfiguration { + // This is always `sql#demoteMasterMysqlReplicaConfiguration`. + string kind = 1; + + // The username for the replication connection. + string username = 2; + + // The password for the replication connection. + string password = 3; + + // PEM representation of the replica's private key. The corresponding public + // key is encoded in the client's certificate. The format of the replica's + // private key can be either PKCS #1 or PKCS #8. + string client_key = 4; + + // PEM representation of the replica's x509 certificate. + string client_certificate = 5; + + // PEM representation of the trusted CA's x509 certificate. + string ca_certificate = 6; +} + +enum SqlFileType { + // Unknown file type. + SQL_FILE_TYPE_UNSPECIFIED = 0; + + // File containing SQL statements. + SQL = 1; + + // File in CSV format. + CSV = 2; + + BAK = 4; + + // TDE certificate. + TDE = 8; +} + +// Database instance export context. +message ExportContext { + message SqlCsvExportOptions { + // The select query used to extract the data. + string select_query = 1; + + // Specifies the character that should appear before a data character that + // needs to be escaped. + string escape_character = 2; + + // Specifies the quoting character to be used when a data value is quoted. + string quote_character = 3; + + // Specifies the character that separates columns within each row (line) of + // the file. + string fields_terminated_by = 4; + + // This is used to separate lines. If a line does not contain all fields, + // the rest of the columns are set to their default values. + string lines_terminated_by = 6; + } + + message SqlExportOptions { + // Options for exporting from MySQL. + message MysqlExportOptions { + // Option to include SQL statement required to set up replication. If set + // to `1`, the dump file includes a CHANGE MASTER TO statement with the + // binary log coordinates, and --set-gtid-purged is set to ON. If set to + // `2`, the CHANGE MASTER TO statement is written as a SQL comment and + // has no effect. If set to any value other than `1`, --set-gtid-purged + // is set to OFF. + google.protobuf.Int32Value master_data = 1; + } + + // Options for exporting from a Cloud SQL for PostgreSQL instance. + message PostgresExportOptions { + // Optional. Use this option to include DROP <object> + // SQL statements. Use these statements to delete database objects before + // running the import operation. + google.protobuf.BoolValue clean = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Option to include an IF EXISTS SQL statement with each DROP + // statement produced by clean. + google.protobuf.BoolValue if_exists = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Tables to export, or that were exported, from the specified database. If + // you specify tables, specify one and only one database. For PostgreSQL + // instances, you can specify only one table. + repeated string tables = 1; + + // Export only schemas. + google.protobuf.BoolValue schema_only = 2; + + MysqlExportOptions mysql_export_options = 3; + + // Optional. The number of threads to use for parallel export. + google.protobuf.Int32Value threads = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether or not the export should be parallel. + google.protobuf.BoolValue parallel = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Options for exporting from a Cloud SQL for PostgreSQL instance. + PostgresExportOptions postgres_export_options = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Options for exporting BAK files (SQL Server-only) + message SqlBakExportOptions { + // Whether or not the export should be striped. + google.protobuf.BoolValue striped = 1; + + // Option for specifying how many stripes to use for the export. + // If blank, and the value of the striped field is true, + // the number of stripes is automatically chosen. + google.protobuf.Int32Value stripe_count = 2; + + // Type of this bak file will be export, FULL or DIFF, SQL Server only + BakType bak_type = 4; + + // Deprecated: copy_only is deprecated. Use differential_base instead + google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + + // Whether or not the backup can be used as a differential base + // copy_only backup can not be served as differential base + google.protobuf.BoolValue differential_base = 6; + + // Optional. The begin timestamp when transaction log will be included in + // the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) + // format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all + // available logs from the beginning of retention period will be included. + // Only applied to Cloud SQL for SQL Server. + google.protobuf.Timestamp export_log_start_time = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The end timestamp when transaction log will be included in the + // export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format + // (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all + // available logs until current time will be included. Only applied to Cloud + // SQL for SQL Server. + google.protobuf.Timestamp export_log_end_time = 8 + [(google.api.field_behavior) = OPTIONAL]; + } + + message SqlTdeExportOptions { + // Required. Path to the TDE certificate public key + // in the form gs://bucketName/fileName. + // The instance must have write access to the bucket. + // Applicable only for SQL Server instances. + string certificate_path = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Path to the TDE certificate private key + // in the form gs://bucketName/fileName. + // The instance must have write access to the location. + // Applicable only for SQL Server instances. + string private_key_path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Password that encrypts the private key. + string private_key_password = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Certificate name. + // Applicable only for SQL Server instances. + string name = 5 [(google.api.field_behavior) = REQUIRED]; + } + + // The path to the file in Google Cloud Storage where the export will be + // stored. The URI is in the form `gs://bucketName/fileName`. If the file + // already exists, the request succeeds, but the operation fails. If + // `fileType` is `SQL` and the filename ends with .gz, + // the contents are compressed. + string uri = 1; + + // Databases to be exported.
`MySQL instances:` If + // `fileType` is `SQL` and no database is specified, all + // databases are exported, except for the `mysql` system database. + // If `fileType` is `CSV`, you can specify one database, + // either by using this property or by using the + // `csvExportOptions.selectQuery` property, which takes precedence + // over this property.
`PostgreSQL instances:` If you don't specify a + // database by name, all user databases in the instance are exported. + // This excludes system databases and Cloud SQL databases used to manage + // internal operations. Exporting all user databases is only available for + // directory-formatted parallel export. If `fileType` is `CSV`, + // this database must match the one specified in the + // `csvExportOptions.selectQuery` property.
`SQL Server + // instances:` You must specify one database to be exported, and the + // `fileType` must be `BAK`. + repeated string databases = 2; + + // This is always `sql#exportContext`. + string kind = 3; + + // Options for exporting data as SQL statements. + SqlExportOptions sql_export_options = 4; + + // Options for exporting data as CSV. `MySQL` and `PostgreSQL` + // instances only. + SqlCsvExportOptions csv_export_options = 5; + + // The file type for the specified uri. + SqlFileType file_type = 6; + + // Whether to perform a serverless export. + google.protobuf.BoolValue offload = 8; + + // Options for exporting data as BAK files. + SqlBakExportOptions bak_export_options = 9; + + // Optional. Export parameters specific to SQL Server TDE certificates + SqlTdeExportOptions tde_export_options = 10 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Database instance import context. +message ImportContext { + message SqlImportOptions { + message PostgresImportOptions { + // Optional. The --clean flag for the pg_restore utility. This flag + // applies only if you enabled Cloud SQL to import files in parallel. + google.protobuf.BoolValue clean = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The --if-exists flag for the pg_restore utility. This flag + // applies only if you enabled Cloud SQL to import files in parallel. + google.protobuf.BoolValue if_exists = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The number of threads to use for parallel import. + google.protobuf.Int32Value threads = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether or not the import should be parallel. + google.protobuf.BoolValue parallel = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Options for importing from a Cloud SQL for PostgreSQL instance. + PostgresImportOptions postgres_import_options = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + message SqlCsvImportOptions { + // The table to which CSV data is imported. + string table = 1; + + // The columns to which CSV data is imported. If not specified, all columns + // of the database table are loaded with CSV data. + repeated string columns = 2; + + // Specifies the character that should appear before a data character that + // needs to be escaped. + string escape_character = 4; + + // Specifies the quoting character to be used when a data value is quoted. + string quote_character = 5; + + // Specifies the character that separates columns within each row (line) of + // the file. + string fields_terminated_by = 6; + + // This is used to separate lines. If a line does not contain all fields, + // the rest of the columns are set to their default values. + string lines_terminated_by = 8; + } + + message SqlBakImportOptions { + message EncryptionOptions { + // Path to the Certificate (.cer) in Cloud Storage, in the form + // `gs://bucketName/fileName`. The instance must have + // write permissions to the bucket and read access to the file. + string cert_path = 1; + + // Path to the Certificate Private Key (.pvk) in Cloud Storage, in the + // form `gs://bucketName/fileName`. The instance must have + // write permissions to the bucket and read access to the file. + string pvk_path = 2; + + // Password that encrypts the private key + string pvk_password = 3; + + // Optional. Whether the imported file remains encrypted. + google.protobuf.BoolValue keep_encrypted = 5 + [(google.api.field_behavior) = OPTIONAL]; + } + + EncryptionOptions encryption_options = 1; + + // Whether or not the backup set being restored is striped. + // Applies only to Cloud SQL for SQL Server. + google.protobuf.BoolValue striped = 2; + + // Whether or not the backup importing will restore database + // with NORECOVERY option. + // Applies only to Cloud SQL for SQL Server. + google.protobuf.BoolValue no_recovery = 4; + + // Whether or not the backup importing request will just bring database + // online without downloading Bak content only one of "no_recovery" and + // "recovery_only" can be true otherwise error will return. Applies only to + // Cloud SQL for SQL Server. + google.protobuf.BoolValue recovery_only = 5; + + // Type of the bak content, FULL or DIFF + BakType bak_type = 6; + + // Optional. The timestamp when the import should stop. This timestamp is in + // the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example, + // `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT + // keyword and applies to Cloud SQL for SQL Server only. + google.protobuf.Timestamp stop_at = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The marked transaction where the import should stop. This field + // is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL + // Server only. + string stop_at_mark = 8 [(google.api.field_behavior) = OPTIONAL]; + } + + message SqlTdeImportOptions { + // Required. Path to the TDE certificate public key + // in the form gs://bucketName/fileName. + // The instance must have read access to the file. + // Applicable only for SQL Server instances. + string certificate_path = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Path to the TDE certificate private key + // in the form gs://bucketName/fileName. + // The instance must have read access to the file. + // Applicable only for SQL Server instances. + string private_key_path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Password that encrypts the private key. + string private_key_password = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Certificate name. + // Applicable only for SQL Server instances. + string name = 5 [(google.api.field_behavior) = REQUIRED]; + } + + // Path to the import file in Cloud Storage, in the form + // `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported + // when `fileType` is `SQL`. The instance must have + // write permissions to the bucket and read access to the file. + string uri = 1; + + // The target database for the import. If `fileType` is `SQL`, this field + // is required only if the import file does not specify a database, and is + // overridden by any database specification in the import file. For entire + // instance parallel import operations, the database is overridden by the + // database name stored in subdirectory name. If + // `fileType` is `CSV`, one database must be specified. + string database = 2; + + // This is always `sql#importContext`. + string kind = 3; + + // The file type for the specified uri.\`SQL`: The file + // contains SQL statements. \`CSV`: The file contains CSV data. + SqlFileType file_type = 4; + + // Options for importing data as CSV. + SqlCsvImportOptions csv_import_options = 5; + + // The PostgreSQL user for this import operation. PostgreSQL instances only. + string import_user = 6; + + // Import parameters specific to SQL Server .BAK files + SqlBakImportOptions bak_import_options = 7; + + // Optional. Options for importing data from SQL statements. + SqlImportOptions sql_import_options = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Import parameters specific to SQL Server TDE certificates + SqlTdeImportOptions tde_import_options = 9 + [(google.api.field_behavior) = OPTIONAL]; +} + +enum BakType { + // Default type. + BAK_TYPE_UNSPECIFIED = 0; + + // Full backup. + FULL = 1; + + // Differential backup. + DIFF = 2; + + // Transaction Log backup + TLOG = 3; +} + +// IP Management configuration. +message IpConfiguration { + // The SSL options for database connections. + enum SslMode { + // The SSL mode is unknown. + SSL_MODE_UNSPECIFIED = 0; + + // Allow non-SSL/non-TLS and SSL/TLS connections. + // For SSL connections to MySQL and PostgreSQL, the client certificate + // isn't verified. + // + // When this value is used, the legacy `require_ssl` flag must be false or + // cleared to avoid a conflict between the values of the two flags. + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 1; + + // Only allow connections encrypted with SSL/TLS. + // For SSL connections to MySQL and PostgreSQL, the client certificate + // isn't verified. + // + // When this value is used, the legacy `require_ssl` flag must be false or + // cleared to avoid a conflict between the values of the two flags. + ENCRYPTED_ONLY = 2; + + // Only allow connections encrypted with SSL/TLS and with valid + // client certificates. + // + // When this value is used, the legacy `require_ssl` flag must be true or + // cleared to avoid the conflict between values of two flags. + // PostgreSQL clients or users that connect using IAM database + // authentication must use either the + // [Cloud SQL Auth + // Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or + // [Cloud SQL + // Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors) + // to enforce client identity verification. + // + // Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server. + TRUSTED_CLIENT_CERTIFICATE_REQUIRED = 3; + } + + // Various Certificate Authority (CA) modes for certificate signing. + enum CaMode { + // CA mode is unspecified. It is effectively the same as + // `GOOGLE_MANAGED_INTERNAL_CA`. + CA_MODE_UNSPECIFIED = 0; + + // Google-managed self-signed internal CA. + GOOGLE_MANAGED_INTERNAL_CA = 1; + + // Google-managed regional CA part of root CA hierarchy hosted on Google + // Cloud's Certificate Authority Service (CAS). + GOOGLE_MANAGED_CAS_CA = 2; + + // Customer-managed CA hosted on Google Cloud's Certificate Authority + // Service (CAS). + CUSTOMER_MANAGED_CAS_CA = 3; + } + + // Settings for automatic server certificate rotation. + enum ServerCertificateRotationMode { + // Unspecified: no automatic server certificate rotation. + SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED = 0; + + // No automatic server certificate rotation. The user must [manage server + // certificate + // rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas) + // on their side. + NO_AUTOMATIC_ROTATION = 1; + + // Automatic server certificate rotation during Cloud SQL scheduled + // maintenance or self-service maintenance updates. Requires + // `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or + // `CUSTOMER_MANAGED_CAS_CA`. + AUTOMATIC_ROTATION_DURING_MAINTENANCE = 2; + } + + // Whether the instance is assigned a public IP address or not. + google.protobuf.BoolValue ipv4_enabled = 1; + + // The resource link for the VPC network from which the Cloud SQL instance is + // accessible for private IP. For example, + // `/projects/myProject/global/networks/default`. This setting can + // be updated, but it cannot be removed after it is set. + string private_network = 2; + + // Use `ssl_mode` instead. + // + // Whether SSL/TLS connections over IP are enforced. + // If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. + // For SSL/TLS connections, the client certificate won't be verified. If + // set to true, then only allow connections encrypted with SSL/TLS and with + // valid client certificates. If you want to enforce SSL/TLS without enforcing + // the requirement for valid client certificates, then use the `ssl_mode` flag + // instead of the `require_ssl` flag. + google.protobuf.BoolValue require_ssl = 3; + + // The list of external networks that are allowed to connect to the instance + // using the IP. In 'CIDR' notation, also known as 'slash' notation (for + // example: `157.197.200.0/24`). + repeated AclEntry authorized_networks = 4; + + // The name of the allocated ip range for the private ip Cloud SQL instance. + // For example: "google-managed-services-default". If set, the instance ip + // will be created in the allocated range. The range name must comply with + // [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name + // must be 1-63 characters long and match the regular expression + // `[a-z]([-a-z0-9]*[a-z0-9])?.` + string allocated_ip_range = 6; + + // Controls connectivity to private IP instances from Google services, + // such as BigQuery. + google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + + // Specify how SSL/TLS is enforced in database connections. If you must use + // the `require_ssl` flag for backward compatibility, then only the following + // value pairs are valid: + // + // For PostgreSQL and MySQL: + // + // * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` + // * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false` + // * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true` + // + // For SQL Server: + // + // * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` + // * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true` + // + // The value of `ssl_mode` has priority over the value of `require_ssl`. + // + // For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and + // `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL + // connections, while `require_ssl=false` means accept both non-SSL + // and SSL connections. In this case, MySQL and PostgreSQL databases respect + // `ssl_mode` and accepts only SSL connections. + SslMode ssl_mode = 8; + + // PSC settings for this instance. + optional PscConfig psc_config = 9; + + // Specify what type of CA is used for the server certificate. + optional CaMode server_ca_mode = 10; + + // Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance. + repeated string custom_subject_alternative_names = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The resource name of the server CA pool for an instance with + // `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`. + // Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID} + optional string server_ca_pool = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls the automatic server certificate rotation feature. This + // feature is disabled by default. When enabled, the server certificate will + // be automatically rotated during Cloud SQL scheduled maintenance or + // self-service maintenance updates up to six months before it expires. This + // setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA + // or CUSTOMER_MANAGED_CAS_CA. + optional ServerCertificateRotationMode server_certificate_rotation_mode = 16 + [(google.api.field_behavior) = OPTIONAL]; +} + +// PSC settings for a Cloud SQL instance. +message PscConfig { + // Whether PSC connectivity is enabled for this instance. + optional bool psc_enabled = 1; + + // Optional. The list of consumer projects that are allow-listed for PSC + // connections to this instance. This instance can be connected to with PSC + // from any network in these projects. + // + // Each consumer project in this list may be represented by a project number + // (numeric) or by a project id (alphanumeric). + repeated string allowed_consumer_projects = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of settings for requested Private Service Connect + // consumer endpoints that can be used to connect to this Cloud SQL instance. + repeated PscAutoConnectionConfig psc_auto_connections = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The network attachment of the consumer network that the + // Private Service Connect enabled Cloud SQL instance is + // authorized to connect via PSC interface. + // format: projects/PROJECT/regions/REGION/networkAttachments/ID + string network_attachment_uri = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether Private Service Connect DNS automation is + // enabled for this instance. When enabled, Cloud SQL provisions a universal + // DNS record across all networks configured with Private Service Connect + // auto-connections. This will default to true for new instances when + // Private Service Connect is enabled. + optional bool psc_auto_dns_enabled = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether Private Service Connect write endpoint DNS + // automation is enabled for this instance. When enabled, Cloud SQL provisions + // a universal global DNS record across all networks configured with Private + // Service Connect auto-connections that points to the cluster primary + // instance. This feature is only supported for Enterprise Plus edition. This + // will default to true for new Enterprise Plus instances when + // `psc_auto_dns_enabled` is enabled. + optional bool psc_write_endpoint_dns_enabled = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to set up the PSC service connection policy + // automatically. + optional bool psc_auto_connection_policy_enabled = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings for an automatically-setup Private Service Connect consumer endpoint +// that is used to connect to a Cloud SQL instance. +message PscAutoConnectionConfig { + // Optional. This is the project ID of consumer service project of this + // consumer endpoint. + // + // This is only applicable if `consumer_network` is a shared VPC + // network. + string consumer_project = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The consumer network of this consumer endpoint. This must be a + // resource path that includes both the host project and the network name. + // + // For example, `projects/project1/global/networks/network1`. + // + // The consumer host project of this network might be different from the + // consumer service project. + string consumer_network = 2 [(google.api.field_behavior) = OPTIONAL]; + + // The IP address of the consumer endpoint. + optional string ip_address = 3 + [(google.api.field_info).format = IPV4_OR_IPV6]; + + // The connection status of the consumer endpoint. + optional string status = 4; + + // The connection policy status of the consumer network. + optional string consumer_network_status = 5; + + // Output only. The service connection policy created automatically for the + // consumer network when `psc_auto_connection_policy_enabled` is true. It is + // in the format of: + // `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}` + // The `policy_id` is in format of `$NETWORK-$RANDOM`. + optional string service_connection_policy = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ServiceConnectionPolicy" + } + ]; + + // Output only. The status of service connection policy creation. + optional string service_connection_policy_creation_result = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The status of automated DNS provisioning. + optional AutoDnsStatus instance_auto_dns_status = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The status of automated DNS provisioning for the write + // endpoint. + optional AutoDnsStatus write_endpoint_auto_dns_status = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Preferred location. This specifies where a Cloud SQL instance is located. +// Note that if the preferred location is not available, the instance will be +// located as close as possible within the region. Only one location may be +// specified. +message LocationPreference { + // The App Engine application to follow, it must be in the same region as the + // Cloud SQL instance. WARNING: Changing this might restart the instance. + string follow_gae_application = 1 [deprecated = true]; + + // The preferred Compute Engine zone (for example: us-central1-a, + // us-central1-b, etc.). WARNING: Changing this might restart the instance. + string zone = 2; + + // The preferred Compute Engine zone for the secondary/failover + // (for example: us-central1-a, us-central1-b, etc.). + // To disable this field, set it to 'no_secondary_zone'. + string secondary_zone = 4; + + // This is always `sql#locationPreference`. + string kind = 3; +} + +// Maintenance window. This specifies when a Cloud SQL instance is +// restarted for system maintenance purposes. +message MaintenanceWindow { + // Hour of day - 0 to 23. Specify in the UTC time zone. + google.protobuf.Int32Value hour = 1; + + // Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`, + // `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone. + // Returned in output as an integer, 1 to 7, where `1` equals Monday. + google.protobuf.Int32Value day = 2; + + // Maintenance timing settings: `canary`, `stable`, or `week5`. + // For more information, see [About maintenance on Cloud SQL + // instances](https://cloud.google.com/sql/docs/mysql/maintenance). + SqlUpdateTrack update_track = 3; + + // This is always `sql#maintenanceWindow`. + string kind = 4; +} + +// Deny maintenance Periods. This specifies a date range during when all CSA +// rollout will be denied. +message DenyMaintenancePeriod { + // "deny maintenance period" start date. If the year of the start date is + // empty, the year of the end date also must be empty. In this case, it means + // the deny maintenance period recurs every year. The date is in format + // yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01 + string start_date = 1; + + // "deny maintenance period" end date. If the year of the end date is empty, + // the year of the start date also must be empty. In this case, it means the + // no maintenance interval recurs every year. The date is in format yyyy-mm-dd + // i.e., 2020-11-01, or mm-dd, i.e., 11-01 + string end_date = 2; + + // Time in UTC when the "deny maintenance period" starts on start_date and + // ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00 + string time = 3; +} + +// Insights configuration. This specifies when Cloud SQL Insights feature is +// enabled and optional configuration. +message InsightsConfig { + // Whether Query Insights feature is enabled. + bool query_insights_enabled = 1; + + // Whether Query Insights will record client address when enabled. + bool record_client_address = 2; + + // Whether Query Insights will record application tags from query when + // enabled. + bool record_application_tags = 3; + + // Maximum query length stored in bytes. Default value: 1024 bytes. + // Range: 256-4500 bytes. Query lengths greater than this field value will be + // truncated to this value. When unset, query length will be the default + // value. Changing query length will restart the database. + google.protobuf.Int32Value query_string_length = 4; + + // Number of query execution plans captured by Insights per minute + // for all queries combined. Default is 5. + google.protobuf.Int32Value query_plans_per_minute = 5; + + // Optional. Whether enhanced query insights feature is enabled. + google.protobuf.BoolValue enhanced_query_insights_enabled = 8 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Read-replica configuration specific to MySQL databases. +message MySqlReplicaConfiguration { + // Path to a SQL dump file in Google Cloud Storage from which the replica + // instance is to be created. The URI is in the form gs://bucketName/fileName. + // Compressed gzip files (.gz) are also supported. + // Dumps have the binlog co-ordinates from which replication + // begins. This can be accomplished by setting --master-data to 1 when using + // mysqldump. + string dump_file_path = 1; + + // The username for the replication connection. + string username = 2; + + // The password for the replication connection. + string password = 3; + + // Seconds to wait between connect retries. MySQL's default is 60 seconds. + google.protobuf.Int32Value connect_retry_interval = 4; + + // Interval in milliseconds between replication heartbeats. + google.protobuf.Int64Value master_heartbeat_period = 5; + + // PEM representation of the trusted CA's x509 certificate. + string ca_certificate = 6; + + // PEM representation of the replica's x509 certificate. + string client_certificate = 7; + + // PEM representation of the replica's private key. The corresponding public + // key is encoded in the client's certificate. + string client_key = 8; + + // A list of permissible ciphers to use for SSL encryption. + string ssl_cipher = 9; + + // Whether or not to check the primary instance's Common Name value in the + // certificate that it sends during the SSL handshake. + google.protobuf.BoolValue verify_server_certificate = 10; + + // This is always `sql#mysqlReplicaConfiguration`. + string kind = 11; +} + +// Disk encryption configuration for an instance. +message DiskEncryptionConfiguration { + // Resource name of KMS key for disk encryption + string kms_key_name = 1; + + // This is always `sql#diskEncryptionConfiguration`. + string kind = 2; +} + +// Disk encryption status for an instance. +message DiskEncryptionStatus { + // KMS key version used to encrypt the Cloud SQL instance resource + string kms_key_version_name = 1; + + // This is always `sql#diskEncryptionStatus`. + string kind = 2; +} + +// Database instance IP mapping +message IpMapping { + // The type of this IP address. A `PRIMARY` address is a public address that + // can accept incoming connections. A `PRIVATE` address is a private address + // that can accept incoming connections. An `OUTGOING` address is the source + // address of connections originating from the instance, if supported. + SqlIpAddressType type = 1; + + // The IP address assigned. + string ip_address = 2; + + // The due time for this IP to be retired in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. This field is only available when + // the IP is scheduled to be retired. + google.protobuf.Timestamp time_to_retire = 3; +} + +// The type of maintenance to be performed on the instance. +enum SqlMaintenanceType { + // Maintenance type is unspecified. + SQL_MAINTENANCE_TYPE_UNSPECIFIED = 0; + + // Indicates that a standalone instance is undergoing maintenance. The + // instance can be either a primary instance or a replica. + INSTANCE_MAINTENANCE = 1; + + // Indicates that the primary instance and all of its replicas, including + // cascading replicas, are undergoing maintenance. Maintenance is performed on + // groups of replicas first, followed by the primary instance. + REPLICA_INCLUDED_MAINTENANCE = 2; + + // Indicates that the standalone instance is undergoing maintenance, initiated + // by self-service. The instance can be either a primary instance or a + // replica. + INSTANCE_SELF_SERVICE_MAINTENANCE = 3; + + // Indicates that the primary instance and all of its replicas are undergoing + // maintenance, initiated by self-service. Maintenance is performed on groups + // of replicas first, followed by the primary instance. + REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE = 4; +} + +// The sub operation type based on the operation type. +message SqlSubOperationType { + // Sub operation details corresponding to the operation type. + oneof sub_operation_details { + // The type of maintenance to be performed on the instance. + SqlMaintenanceType maintenance_type = 1; + } +} + +// An Operation resource. For successful operations that return an +// Operation resource, only the fields relevant to the operation are populated +// in the resource. +message Operation { + // The type of Cloud SQL operation. + enum SqlOperationType { + // Unknown operation type. + SQL_OPERATION_TYPE_UNSPECIFIED = 0; + + // Imports data into a Cloud SQL instance. + IMPORT = 1; + + // Exports data from a Cloud SQL instance to a Cloud Storage + // bucket. + EXPORT = 2; + + // Creates a new Cloud SQL instance. + CREATE = 3; + + // Updates the settings of a Cloud SQL instance. + UPDATE = 4; + + // Deletes a Cloud SQL instance. + DELETE = 5; + + // Restarts the Cloud SQL instance. + RESTART = 6; + + BACKUP = 7 [deprecated = true]; + + SNAPSHOT = 8 [deprecated = true]; + + // Performs instance backup. + BACKUP_VOLUME = 9; + + // Deletes an instance backup. + DELETE_VOLUME = 10; + + // Restores an instance backup. + RESTORE_VOLUME = 11; + + // Injects a privileged user in mysql for MOB instances. + INJECT_USER = 12; + + // Clones a Cloud SQL instance. + CLONE = 14; + + // Stops replication on a Cloud SQL read replica instance. + STOP_REPLICA = 15; + + // Starts replication on a Cloud SQL read replica instance. + START_REPLICA = 16; + + // Promotes a Cloud SQL replica instance. + PROMOTE_REPLICA = 17; + + // Creates a Cloud SQL replica instance. + CREATE_REPLICA = 18; + + // Creates a new user in a Cloud SQL instance. + CREATE_USER = 19; + + // Deletes a user from a Cloud SQL instance. + DELETE_USER = 20; + + // Updates an existing user in a Cloud SQL instance. If a user with the + // specified username doesn't exist, a new user is created. + UPDATE_USER = 21; + + // Creates a database in the Cloud SQL instance. + CREATE_DATABASE = 22; + + // Deletes a database in the Cloud SQL instance. + DELETE_DATABASE = 23; + + // Updates a database in the Cloud SQL instance. + UPDATE_DATABASE = 24; + + // Performs failover of an HA-enabled Cloud SQL + // failover replica. + FAILOVER = 25; + + // Deletes the backup taken by a backup run. + DELETE_BACKUP = 26; + + RECREATE_REPLICA = 27; + + // Truncates a general or slow log table in MySQL. + TRUNCATE_LOG = 28; + + // Demotes the stand-alone instance to be a Cloud SQL + // read replica for an external database server. + DEMOTE_MASTER = 29; + + // Indicates that the instance is currently in maintenance. Maintenance + // typically causes the instance to be unavailable for 1-3 minutes. + MAINTENANCE = 30; + + // This field is deprecated, and will be removed in future version of API. + ENABLE_PRIVATE_IP = 31 [deprecated = true]; + + DEFER_MAINTENANCE = 32 [deprecated = true]; + + // Creates clone instance. + CREATE_CLONE = 33 [deprecated = true]; + + // Reschedule maintenance to another time. + RESCHEDULE_MAINTENANCE = 34; + + // Starts external sync of a Cloud SQL EM replica to an external primary + // instance. + START_EXTERNAL_SYNC = 35; + + // Recovers logs from an instance's old data disk. + LOG_CLEANUP = 36; + + // Performs auto-restart of an HA-enabled Cloud SQL database for auto + // recovery. + AUTO_RESTART = 37; + + // Re-encrypts CMEK instances with latest key version. + REENCRYPT = 38; + + // Switches the roles of the primary and replica pair. The target instance + // should be the replica. + SWITCHOVER = 39; + + // Update a backup. + UPDATE_BACKUP = 40; + + // Acquire a lease for the setup of SQL Server Reporting Services (SSRS). + ACQUIRE_SSRS_LEASE = 42; + + // Release a lease for the setup of SQL Server Reporting Services (SSRS). + RELEASE_SSRS_LEASE = 43; + + // Reconfigures old primary after a promote replica operation. Effect of a + // promote operation to the old primary is executed in this operation, + // asynchronously from the promote replica operation executed to the + // replica. + RECONFIGURE_OLD_PRIMARY = 44; + + // Indicates that the instance, its read replicas, and its cascading + // replicas are in maintenance. Maintenance typically gets initiated on + // groups of replicas first, followed by the primary instance. For each + // instance, maintenance typically causes the instance to be unavailable for + // 1-3 minutes. + CLUSTER_MAINTENANCE = 45 [deprecated = true]; + + // Indicates that the instance (and any of its replicas) are currently in + // maintenance. This is initiated as a self-service request by using SSM. + // Maintenance typically causes the instance to be unavailable for 1-3 + // minutes. + SELF_SERVICE_MAINTENANCE = 46 [deprecated = true]; + + // Switches a primary instance to a replica. This operation runs as part of + // a switchover operation to the original primary instance. + SWITCHOVER_TO_REPLICA = 47; + + // Updates the major version of a Cloud SQL instance. + MAJOR_VERSION_UPGRADE = 48; + + // Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead. + ADVANCED_BACKUP = 49 [deprecated = true]; + + // Changes the BackupTier of a Cloud SQL instance. + MANAGE_BACKUP = 50; + + // Creates a backup for an Enhanced BackupTier Cloud SQL instance. + ENHANCED_BACKUP = 51; + + // Repairs entire read pool or specified read pool nodes in the read pool. + REPAIR_READ_POOL = 52; + + // Creates a Cloud SQL read pool instance. + CREATE_READ_POOL = 53; + + // Pre-checks the major version upgrade operation. + PRE_CHECK_MAJOR_VERSION_UPGRADE = 54; + + // This operation type represents individual steps in a multi-step setup + // migration workflow: including configuration, replication, + // switchover/back, and data reseeding, as defined by operation's intent. + SETUP_MIGRATION = 55; + } + + // The status of an operation. + enum SqlOperationStatus { + // The state of the operation is unknown. + SQL_OPERATION_STATUS_UNSPECIFIED = 0; + + // The operation has been queued, but has not started yet. + PENDING = 1; + + // The operation is running. + RUNNING = 2; + + // The operation completed. + DONE = 3; + } + + // This is always `sql#operation`. + string kind = 1; + + string target_link = 2; + + // The status of an operation. + SqlOperationStatus status = 3; + + // The email address of the user who initiated this operation. + string user = 4; + + // The time this operation was enqueued in UTC timezone in [RFC + // 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp insert_time = 5; + + // The time this operation actually started in UTC timezone in [RFC + // 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp start_time = 6; + + // The time this operation finished in UTC timezone in [RFC + // 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp end_time = 7; + + // If errors occurred during processing of this operation, this field will be + // populated. + OperationErrors error = 8; + + // An Admin API warning message. + ApiWarning api_warning = 19; + + // The type of the operation. Valid values are: + // * `CREATE` + // * `DELETE` + // * `UPDATE` + // * `RESTART` + // * `IMPORT` + // * `EXPORT` + // * `BACKUP_VOLUME` + // * `RESTORE_VOLUME` + // * `CREATE_USER` + // * `DELETE_USER` + // * `CREATE_DATABASE` + // * `DELETE_DATABASE` + SqlOperationType operation_type = 9; + + // The context for import operation, if applicable. + ImportContext import_context = 10; + + // The context for export operation, if applicable. + ExportContext export_context = 11; + + // The context for backup operation, if applicable. + BackupContext backup_context = 17; + + // This field is only populated when the operation_type is + // PRE_CHECK_MAJOR_VERSION_UPGRADE. + // The PreCheckMajorVersionUpgradeContext message itself contains the details + // for that pre-check, such as the target database version for the upgrade + // and the results of the check (including any warnings or errors found). + PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = + 50; + + // An identifier that uniquely identifies the operation. You can use this + // identifier to retrieve the Operations resource that has information about + // the operation. + string name = 12; + + // Name of the resource on which this operation runs. + string target_id = 13; + + // The URI of this resource. + string self_link = 14; + + // The project ID of the target instance related to this operation. + string target_project = 15; + + // The context for acquire SSRS lease operation, if applicable. + AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + + // Optional. The sub operation based on the operation type. + SqlSubOperationType sub_operation_type = 48 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Database instance operation error. +message OperationError { + // This is always `sql#operationError`. + string kind = 1; + + // Identifies the specific error that occurred. + string code = 2; + + // Additional information about the error encountered. + string message = 3; +} + +// Database instance operation errors list wrapper. +message OperationErrors { + // This is always `sql#operationErrors`. + string kind = 1; + + // The list of errors encountered while processing this operation. + repeated OperationError errors = 2; +} + +// Database instance local user password validation policy. +// This message defines the password policy for local database users. +// When enabled, it enforces constraints on password complexity, length, +// and reuse. Keep this policy enabled to help prevent unauthorized access. +message PasswordValidationPolicy { + // The complexity choices of the password. + enum Complexity { + // Complexity check is not specified. + COMPLEXITY_UNSPECIFIED = 0; + + // A combination of lowercase, uppercase, numeric, and non-alphanumeric + // characters. + COMPLEXITY_DEFAULT = 1; + } + + // Minimum number of characters allowed. + google.protobuf.Int32Value min_length = 1; + + // The complexity of the password. + Complexity complexity = 2; + + // Number of previous passwords that cannot be reused. + google.protobuf.Int32Value reuse_interval = 3; + + // Disallow username as a part of the password. + google.protobuf.BoolValue disallow_username_substring = 4; + + // Minimum interval after which the password can be changed. This flag is only + // supported for PostgreSQL. + google.protobuf.Duration password_change_interval = 5; + + // Whether to enable the password policy or not. When enabled, passwords must + // meet complexity requirements. Keep this policy enabled to help prevent + // unauthorized access. Disabling this policy allows weak passwords. + google.protobuf.BoolValue enable_password_policy = 6; + + // This field is deprecated and will be removed in a future version of the + // API. + google.protobuf.BoolValue disallow_compromised_credentials = 7 + [deprecated = true]; +} + +// Data cache configurations. +message DataCacheConfig { + // Whether data cache is enabled for the instance. + bool data_cache_enabled = 1; +} + +// Config used to determine the final backup settings for the instance. +message FinalBackupConfig { + // Whether the final backup is enabled for the instance. + optional bool enabled = 1; + + // The number of days to retain the final backup after the instance deletion. + // The final backup will be purged at (time_of_instance_deletion + + // retention_days). + optional int32 retention_days = 3; +} + +// Database instance settings. +message Settings { + // Specifies when the instance is activated. + enum SqlActivationPolicy { + // Unknown activation plan. + SQL_ACTIVATION_POLICY_UNSPECIFIED = 0; + + // The instance is always up and running. + ALWAYS = 1; + + // The instance never starts. + NEVER = 2; + + // The instance starts upon receiving requests. + ON_DEMAND = 3 [deprecated = true]; + } + + // The list of Cloud SQL editions available to users. + enum Edition { + // The instance did not specify the edition. + EDITION_UNSPECIFIED = 0; + + // The instance is an enterprise edition. + ENTERPRISE = 2; + + // The instance is an Enterprise Plus edition. + ENTERPRISE_PLUS = 3; + + // This instance is a Cloud SQL developer edition instance. + DEVELOPER = 5; + } + + // The options for enforcing Cloud SQL connectors in the instance. + enum ConnectorEnforcement { + // The requirement for Cloud SQL connectors is unknown. + CONNECTOR_ENFORCEMENT_UNSPECIFIED = 0; + + // Do not require Cloud SQL connectors. + NOT_REQUIRED = 1; + + // Require all connections to use Cloud SQL connectors, including the + // Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors. + // Note: This disables all existing authorized networks. + REQUIRED = 2; + } + + // ExecuteSql API's access to the instance. + enum DataApiAccess { + // Unspecified, effectively the same as `DISALLOW_DATA_API`. + DATA_API_ACCESS_UNSPECIFIED = 0; + + // Disallow using ExecuteSql API to connect to the instance. + DISALLOW_DATA_API = 1; + + // Allow using ExecuteSql API to connect to the instance. For private IP + // instances, this allows authorized users to access the instance from + // the public internet using ExecuteSql API. + ALLOW_DATA_API = 2; + } + + // The version of instance settings. This is a required field for update + // method to make sure concurrent updates are handled properly. During update, + // use the most recent settingsVersion value for this instance and do not try + // to update this value. + google.protobuf.Int64Value settings_version = 1; + + // The App Engine app IDs that can access this instance. + // (Deprecated) Applied to First Generation instances only. + repeated string authorized_gae_applications = 2 [deprecated = true]; + + // The tier (or machine type) for this instance, for example + // `db-custom-1-3840`. WARNING: Changing this restarts the instance. + string tier = 3; + + // This is always `sql#settings`. + string kind = 4; + + // User-provided labels, represented as a dictionary where each label is a + // single key value pair. + map user_labels = 5; + + // Availability type. Potential values: + // * `ZONAL`: The instance serves data from only one zone. Outages in that + // zone affect data accessibility. + // * `REGIONAL`: The instance can serve data from more than one zone in a + // region (it is highly available)./ + // + // For more information, see [Overview of the High Availability + // Configuration](https://cloud.google.com/sql/docs/mysql/high-availability). + SqlAvailabilityType availability_type = 6; + + // The pricing plan for this instance. This can be either `PER_USE` or + // `PACKAGE`. Only `PER_USE` is supported for Second Generation instances. + SqlPricingPlan pricing_plan = 7; + + // The type of replication this instance uses. This can be either + // `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only + // applicable to First Generation instances. + SqlReplicationType replication_type = 8 [deprecated = true]; + + // The maximum size to which storage capacity can be automatically increased. + // The default value is 0, which specifies that there is no limit. + google.protobuf.Int64Value storage_auto_resize_limit = 9; + + // The activation policy specifies when the instance is activated; it is + // applicable only when the instance state is RUNNABLE. Valid values: + // * `ALWAYS`: The instance is on, and remains so even in the absence of + // connection requests. + // * `NEVER`: The instance is off; it is not activated, even if a + // connection request arrives. + SqlActivationPolicy activation_policy = 10; + + // The settings for IP Management. This allows to enable or disable the + // instance IP and manage which external networks can connect to the instance. + // The IPv4 address cannot be disabled for Second Generation instances. + IpConfiguration ip_configuration = 11; + + // Configuration to increase storage size automatically. The default value is + // true. + google.protobuf.BoolValue storage_auto_resize = 12; + + // The location preference settings. This allows the instance to be located as + // near as possible to either an App Engine app or Compute Engine zone for + // better performance. App Engine co-location was only applicable to First + // Generation instances. + LocationPreference location_preference = 13; + + // The database flags passed to the instance at startup. + repeated DatabaseFlags database_flags = 14; + + // The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for + // First Generation instances. + SqlDataDiskType data_disk_type = 15; + + // The maintenance window for this instance. This specifies when the instance + // can be restarted for maintenance purposes. + MaintenanceWindow maintenance_window = 16; + + // The daily backup configuration for the instance. + BackupConfiguration backup_configuration = 17; + + // Configuration specific to read replica instances. Indicates whether + // replication is enabled or not. WARNING: Changing this restarts the + // instance. + google.protobuf.BoolValue database_replication_enabled = 18; + + // Configuration specific to read replica instances. Indicates whether + // database flags for crash-safe replication are enabled. This property was + // only applicable to First Generation instances. + google.protobuf.BoolValue crash_safe_replication_enabled = 19 + [deprecated = true]; + + // The size of data disk, in GB. The data disk size minimum is 10GB. + google.protobuf.Int64Value data_disk_size_gb = 20; + + // Active Directory configuration, relevant only for Cloud SQL for SQL Server. + SqlActiveDirectoryConfig active_directory_config = 22; + + // The name of server Instance collation. + string collation = 23; + + // Deny maintenance periods + repeated DenyMaintenancePeriod deny_maintenance_periods = 24; + + // Insights configuration, for now relevant only for Postgres. + InsightsConfig insights_config = 25; + + // The local user password validation policy of the instance. + PasswordValidationPolicy password_validation_policy = 27; + + // SQL Server specific audit configuration. + SqlServerAuditConfig sql_server_audit_config = 29; + + // Optional. The edition type of the Cloud SQL instance. + Edition edition = 38 [(google.api.field_behavior) = OPTIONAL]; + + // Specifies if connections must use Cloud SQL connectors. + // Option values include the following: `NOT_REQUIRED` (Cloud SQL instances + // can be connected without Cloud SQL + // Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL + // Connectors). + // + // Note that using REQUIRED disables all existing authorized networks. If + // this field is not specified when creating a new instance, NOT_REQUIRED is + // used. If this field is not specified when patching or updating an existing + // instance, it is left unchanged in the instance. + ConnectorEnforcement connector_enforcement = 32; + + // Configuration to protect against accidental instance deletion. + google.protobuf.BoolValue deletion_protection_enabled = 33; + + // Server timezone, relevant only for Cloud SQL for SQL Server. + string time_zone = 34; + + // Specifies advanced machine configuration for the instances relevant only + // for SQL Server. + AdvancedMachineFeatures advanced_machine_features = 35; + + // Configuration for data cache. + DataCacheConfig data_cache_config = 37; + + // Optional. Configuration value for recreation of replica after certain + // replication lag + google.protobuf.Int32Value replication_lag_max_seconds = 39 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When this parameter is set to true, Cloud SQL instances can + // connect to Vertex AI to pass requests for real-time predictions and + // insights to the AI. The default value is false. This applies only to Cloud + // SQL for MySQL and Cloud SQL for PostgreSQL instances. + google.protobuf.BoolValue enable_google_ml_integration = 40 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. By default, Cloud SQL instances have schema extraction disabled + // for Dataplex. When this parameter is set to true, schema extraction for + // Dataplex on Cloud SQL instances is activated. + google.protobuf.BoolValue enable_dataplex_integration = 41 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When this parameter is set to true, Cloud SQL retains backups of + // the instance even after the instance is deleted. The ON_DEMAND backup will + // be retained until customer deletes the backup or the project. The AUTOMATED + // backup will be retained based on the backups retention setting. + google.protobuf.BoolValue retain_backups_on_delete = 42 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Provisioned number of I/O operations per second for the data + // disk. This field is only used for hyperdisk-balanced disk types. + optional int64 data_disk_provisioned_iops = 43 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Provisioned throughput measured in MiB per second for the data + // disk. This field is only used for hyperdisk-balanced disk types. + optional int64 data_disk_provisioned_throughput = 44 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The managed connection pooling configuration for the instance. + optional ConnectionPoolConfig connection_pool_config = 45 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The final backup configuration for the instance. + optional FinalBackupConfig final_backup_config = 47 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The read pool auto-scale configuration for the instance. + optional ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the replica is in accelerated mode. This feature is in + // private preview and requires allowlisting to take effect. + google.protobuf.BoolValue accelerated_replica_mode = 49 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud SQL for MySQL auto-upgrade configuration. When this + // parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor + // versions. The MySQL version must be 8.0.35 or higher. + optional bool auto_upgrade_enabled = 50 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Microsoft Entra ID configuration for the SQL Server instance. + SqlServerEntraIdConfig entraid_config = 52 + [(google.api.field_behavior) = OPTIONAL]; + + // This parameter controls whether to allow using ExecuteSql API to connect to + // the instance. Not allowed by default. + optional DataApiAccess data_api_access = 53; + + // Optional. Configuration for Performance Capture, provides diagnostic + // metrics during high load situations. + PerformanceCaptureConfig performance_capture_config = 54 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Performance capture configuration. +message PerformanceCaptureConfig { + // Defines the categories of long-running transactions eligible for automatic + // termination by the Performance Capture. + enum TransactionKillType { + // Unspecified. + TRANSACTION_KILL_TYPE_UNSPECIFIED = 0; + + // Only read-only transactions are eligible for termination. + READ_ONLY_TRANSACTIONS = 1; + + // All transactions are eligible for termination, including those with write + // operations (such as INSERT, UPDATE, DELETE, or DDL). + ALL_TRANSACTIONS = 2; + } + + // Optional. Enables or disables the performance capture feature. + optional bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the interval in seconds between consecutive probes that + // check if any trigger condition thresholds have been reached. + optional int32 probing_interval_seconds = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum number of consecutive probe threshold that + // triggers performance capture. + optional int32 probe_threshold = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum number of MySQL `Threads_running` to + // trigger the performance capture on the primary instance. + optional int32 running_threads_threshold = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum number of seconds replica must be lagging + // behind primary instance to trigger the performance capture on replica. + optional int32 seconds_behind_source_threshold = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the amount of time in seconds that a transaction needs + // to have been open before the watcher starts recording it. + optional int32 transaction_duration_threshold = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum percentage of CPU utilization to trigger + // the performance capture. Valid integers range from `10` to `99`. Enter `0` + // to disable the check. + optional int32 cpu_utilization_threshold_percent = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum percentage of memory usage to trigger the + // performance capture. + // Valid integers range from `10` to `99`. Enter `0` to disable the check. + optional int32 memory_usage_threshold_percent = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum allowed number of transactions in lock wait + // state to trigger the performance capture. Valid integers range from `10` to + // `10000`. Enter `0` to disable the check. + optional int32 transaction_lock_wait_threshold_count = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum allowed number of semaphore waits to + // trigger the performance capture. Valid integers range from `10` to `10000`. + // Enter `0` to disable the check. + optional int32 semaphore_wait_threshold_count = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum number of undo log entries in the history + // list length to trigger the performance capture. Valid integers range from + // `10000` to `10000000`. Enter `0` to disable the check. + optional int32 history_list_length_threshold_count = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the amount of time in seconds that a transaction needs + // to have been open before the watcher starts terminating it. Valid integers + // range from `60` to `604800` (7 days). Enter `0` to disable. If enabled + // (i.e., > 0), this value must be greater than or equal to + // `transaction_duration_threshold`. Configurations where + // `0 < transaction_kill_threshold_seconds < transaction_duration_threshold` + // will be rejected. + optional int32 transaction_kill_threshold_seconds = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a customer-defined list of users to exclude from + // transaction termination. Entries can be in the format 'user@host' or just + // 'user'. A standalone 'user' implies 'user@%', excluding the user from any + // host. Wildcard '%' is allowed in the host part of the 'user@host' format. + // Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]` + repeated string transaction_kill_excluded_user_hosts = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Determines which transactions are allowed to be terminated when + // they exceed `transaction_kill_threshold_seconds`. This allows protecting + // write-heavy transactions from auto-termination if desired. Defaults to + // `READ_ONLY_TRANSACTIONS` if unspecified. + optional TransactionKillType transaction_kill_type = 17 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Connection pool flags for Cloud SQL instances managed connection pool +// configuration. +message ConnectionPoolFlags { + // Required. The name of the flag. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The value of the flag. Boolean flags are set to `on` for true + // and `off` for false. This field must be omitted if the flag + // doesn't take a value. + string value = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The managed connection pooling configuration. +message ConnectionPoolConfig { + // Whether managed connection pooling is enabled. + optional bool connection_pooling_enabled = 1; + + // Optional. List of connection pool configuration flags. + repeated ConnectionPoolFlags flags = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Number of connection poolers. + optional int32 pooler_count = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The read pool auto-scale configuration. +message ReadPoolAutoScaleConfig { + // Target metric for read pool auto scaling. + message TargetMetric { + // The metric name to be used for auto scaling. + optional string metric = 1; + + // The target value for the metric. + optional float target_value = 2; + } + + // Indicates whether read pool auto scaling is enabled. + optional bool enabled = 1; + + // Minimum number of read pool nodes to be maintained. + optional int32 min_node_count = 2; + + // Maximum number of read pool nodes to be maintained. + optional int32 max_node_count = 3; + + // Optional. Target metrics for read pool auto scaling. + repeated TargetMetric target_metrics = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Indicates whether read pool auto scaling supports scale in operations + // (removing nodes). + optional bool disable_scale_in = 5; + + // The cooldown period for scale-in operations. + optional int32 scale_in_cooldown_seconds = 6; + + // The cooldown period for scale-out operations. + optional int32 scale_out_cooldown_seconds = 7; +} + +// Specifies options for controlling advanced machine features. +message AdvancedMachineFeatures { + // The number of threads per physical core. + int32 threads_per_core = 1; +} + +// SslCerts Resource +message SslCert { + // This is always `sql#sslCert`. + string kind = 1; + + // Serial number, as extracted from the certificate. + string cert_serial_number = 2; + + // PEM representation. + string cert = 3; + + // The time when the certificate was created in [RFC + // 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z` + google.protobuf.Timestamp create_time = 4; + + // User supplied name. Constrained to [a-zA-Z.-_ ]+. + string common_name = 5; + + // The time when the certificate expires in [RFC + // 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp expiration_time = 6; + + // Sha1 Fingerprint. + string sha1_fingerprint = 7; + + // Name of the database instance. + string instance = 8; + + // The URI of this resource. + string self_link = 9; +} + +// SslCertDetail. +message SslCertDetail { + // The public information about the cert. + SslCert cert_info = 1; + + // The private key for the client cert, in pem format. Keep private in order + // to protect your security. + string cert_private_key = 2; +} + +// Active Directory configuration, relevant only for Cloud SQL for SQL Server. +message SqlActiveDirectoryConfig { + // The modes of Active Directory configuration. + enum ActiveDirectoryMode { + // Unspecified mode. Will default to MANAGED_ACTIVE_DIRECTORY if the mode is + // not specified to maintain backward compatibility. + ACTIVE_DIRECTORY_MODE_UNSPECIFIED = 0; + + // Managed Active Directory mode. + MANAGED_ACTIVE_DIRECTORY = 1; + + // Deprecated: Use CUSTOMER_MANAGED_ACTIVE_DIRECTORY instead. + SELF_MANAGED_ACTIVE_DIRECTORY = 2 [deprecated = true]; + + // Customer-managed Active Directory mode. + CUSTOMER_MANAGED_ACTIVE_DIRECTORY = 3; + } + + // This is always sql#activeDirectoryConfig. + string kind = 1; + + // The name of the domain (e.g., mydomain.com). + string domain = 2; + + // Optional. The mode of the Active Directory configuration. + ActiveDirectoryMode mode = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Domain controller IPv4 addresses used to bootstrap Active + // Directory. + repeated string dns_servers = 4 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. The secret manager key storing the administrator credential. + // (e.g., projects/{project}/secrets/{secret}). + string admin_credential_secret_name = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The organizational unit distinguished name. This is the full + // hierarchical path to the organizational unit. + string organizational_unit = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// SQL Server specific audit configuration. +message SqlServerAuditConfig { + // This is always sql#sqlServerAuditConfig + string kind = 1; + + // The name of the destination bucket (e.g., gs://mybucket). + string bucket = 2; + + // How long to keep generated audit files. + google.protobuf.Duration retention_interval = 3; + + // How often to upload generated audit files. + google.protobuf.Duration upload_interval = 4; +} + +// SQL Server Entra ID configuration. +message SqlServerEntraIdConfig { + // Output only. This is always sql#sqlServerEntraIdConfig + string kind = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The tenant ID for the Entra ID configuration. + string tenant_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The application ID for the Entra ID configuration. + string application_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +enum SqlBackendType { + // This is an unknown backend type for instance. + SQL_BACKEND_TYPE_UNSPECIFIED = 0; + + // V1 speckle instance. + FIRST_GEN = 1 [deprecated = true]; + + // V2 speckle instance. + SECOND_GEN = 2; + + // On premises instance. + EXTERNAL = 3; +} + +enum SqlIpAddressType { + // This is an unknown IP address type. + SQL_IP_ADDRESS_TYPE_UNSPECIFIED = 0; + + // IP address the customer is supposed to connect to. Usually this is the + // load balancer's IP address + PRIMARY = 1; + + // Source IP address of the connection a read replica establishes to its + // external primary instance. This IP address can be allowlisted by the + // customer in case it has a firewall that filters incoming connection to its + // on premises primary instance. + OUTGOING = 2; + + // Private IP used when using private IPs and network peering. + PRIVATE = 3; + + // V1 IP of a migrated instance. We want the user to + // decommission this IP as soon as the migration is complete. + // Note: V1 instances with V1 ip addresses will be counted as PRIMARY. + MIGRATED_1ST_GEN = 4; +} + +// The database engine type and version. +enum SqlDatabaseVersion { + // This is an unknown database version. + SQL_DATABASE_VERSION_UNSPECIFIED = 0; + + // The database version is MySQL 5.1. + MYSQL_5_1 = 2 [deprecated = true]; + + // The database version is MySQL 5.5. + MYSQL_5_5 = 3 [deprecated = true]; + + // The database version is MySQL 5.6. + MYSQL_5_6 = 5; + + // The database version is MySQL 5.7. + MYSQL_5_7 = 6; + + // The database version is MySQL 8. + MYSQL_8_0 = 20; + + // The database major version is MySQL 8.0 and the minor version is 18. + MYSQL_8_0_18 = 41; + + // The database major version is MySQL 8.0 and the minor version is 26. + MYSQL_8_0_26 = 85; + + // The database major version is MySQL 8.0 and the minor version is 27. + MYSQL_8_0_27 = 111; + + // The database major version is MySQL 8.0 and the minor version is 28. + MYSQL_8_0_28 = 132; + + // The database major version is MySQL 8.0 and the minor version is 29. + MYSQL_8_0_29 = 148 [deprecated = true]; + + // The database major version is MySQL 8.0 and the minor version is 30. + MYSQL_8_0_30 = 174; + + // The database major version is MySQL 8.0 and the minor version is 31. + MYSQL_8_0_31 = 197; + + // The database major version is MySQL 8.0 and the minor version is 32. + MYSQL_8_0_32 = 213; + + // The database major version is MySQL 8.0 and the minor version is 33. + MYSQL_8_0_33 = 238; + + // The database major version is MySQL 8.0 and the minor version is 34. + MYSQL_8_0_34 = 239; + + // The database major version is MySQL 8.0 and the minor version is 35. + MYSQL_8_0_35 = 240; + + // The database major version is MySQL 8.0 and the minor version is 36. + MYSQL_8_0_36 = 241; + + // The database major version is MySQL 8.0 and the minor version is 37. + MYSQL_8_0_37 = 355; + + // The database major version is MySQL 8.0 and the minor version is 39. + MYSQL_8_0_39 = 357; + + // The database major version is MySQL 8.0 and the minor version is 40. + MYSQL_8_0_40 = 358; + + // The database major version is MySQL 8.0 and the minor version is 41. + MYSQL_8_0_41 = 488; + + // The database major version is MySQL 8.0 and the minor version is 42. + MYSQL_8_0_42 = 489; + + // The database major version is MySQL 8.0 and the minor version is 43. + MYSQL_8_0_43 = 553; + + // The database major version is MySQL 8.0 and the minor version is 44. + MYSQL_8_0_44 = 554; + + // The database major version is MySQL 8.0 and the minor version is 45. + MYSQL_8_0_45 = 555; + + // The database major version is MySQL 8.0 and the minor version is 46. + MYSQL_8_0_46 = 556; + + // The database version is MySQL 8.4. + MYSQL_8_4 = 398; + + // The database version is MySQL 9.7. + MYSQL_9_7 = 654; + + // The database version is SQL Server 2017 Standard. + SQLSERVER_2017_STANDARD = 11; + + // The database version is SQL Server 2017 Enterprise. + SQLSERVER_2017_ENTERPRISE = 14; + + // The database version is SQL Server 2017 Express. + SQLSERVER_2017_EXPRESS = 15; + + // The database version is SQL Server 2017 Web. + SQLSERVER_2017_WEB = 16; + + // The database version is PostgreSQL 9.6. + POSTGRES_9_6 = 9; + + // The database version is PostgreSQL 10. + POSTGRES_10 = 18; + + // The database version is PostgreSQL 11. + POSTGRES_11 = 10; + + // The database version is PostgreSQL 12. + POSTGRES_12 = 19; + + // The database version is PostgreSQL 13. + POSTGRES_13 = 23; + + // The database version is PostgreSQL 14. + POSTGRES_14 = 110; + + // The database version is PostgreSQL 15. + POSTGRES_15 = 172; + + // The database version is PostgreSQL 16. + POSTGRES_16 = 272; + + // The database version is PostgreSQL 17. + POSTGRES_17 = 408; + + // The database version is PostgreSQL 18. + POSTGRES_18 = 557; + + // The database version is PostgreSQL 19. + POSTGRES_19 = 684; + + // The database version is PostgreSQL 20. + POSTGRES_20 = 781; + + // The database version is SQL Server 2019 Standard. + SQLSERVER_2019_STANDARD = 26; + + // The database version is SQL Server 2019 Enterprise. + SQLSERVER_2019_ENTERPRISE = 27; + + // The database version is SQL Server 2019 Express. + SQLSERVER_2019_EXPRESS = 28; + + // The database version is SQL Server 2019 Web. + SQLSERVER_2019_WEB = 29; + + // The database version is SQL Server 2022 Standard. + SQLSERVER_2022_STANDARD = 199; + + // The database version is SQL Server 2022 Enterprise. + SQLSERVER_2022_ENTERPRISE = 200; + + // The database version is SQL Server 2022 Express. + SQLSERVER_2022_EXPRESS = 201; + + // The database version is SQL Server 2022 Web. + SQLSERVER_2022_WEB = 202; + + // The database version is SQL Server 2025 Standard. + SQLSERVER_2025_STANDARD = 549; + + // The database version is SQL Server 2025 Enterprise. + SQLSERVER_2025_ENTERPRISE = 550; + + // The database version is SQL Server 2025 Express. + SQLSERVER_2025_EXPRESS = 551; +} + +// The pricing plan for this instance. +enum SqlPricingPlan { + // This is an unknown pricing plan for this instance. + SQL_PRICING_PLAN_UNSPECIFIED = 0; + + // The instance is billed at a monthly flat rate. + PACKAGE = 1; + + // The instance is billed per usage. + PER_USE = 2; +} + +enum SqlReplicationType { + // This is an unknown replication type for a Cloud SQL instance. + SQL_REPLICATION_TYPE_UNSPECIFIED = 0; + + // The synchronous replication mode for First Generation instances. It is the + // default value. + SYNCHRONOUS = 1; + + // The asynchronous replication mode for First Generation instances. It + // provides a slight performance gain, but if an outage occurs while this + // option is set to asynchronous, you can lose up to a few seconds of updates + // to your data. + ASYNCHRONOUS = 2; +} + +// The type of disk that is used for a v2 instance to use. +enum SqlDataDiskType { + // This is an unknown data disk type. + SQL_DATA_DISK_TYPE_UNSPECIFIED = 0; + + // An SSD data disk. + PD_SSD = 1; + + // An HDD data disk. + PD_HDD = 2; + + // This field is deprecated and will be removed from a future version of the + // API. + OBSOLETE_LOCAL_SSD = 3 [deprecated = true]; + + // A Hyperdisk Balanced data disk. + HYPERDISK_BALANCED = 4; +} + +// The availability type of the given Cloud SQL instance. +enum SqlAvailabilityType { + // This is an unknown Availability type. + SQL_AVAILABILITY_TYPE_UNSPECIFIED = 0; + + // Zonal available instance. + ZONAL = 1; + + // Regional available instance. + REGIONAL = 2; +} + +enum SqlUpdateTrack { + // This is an unknown maintenance timing preference. + SQL_UPDATE_TRACK_UNSPECIFIED = 0; + + // For an instance with a scheduled maintenance window, this maintenance + // timing indicates that the maintenance update is scheduled 7 to 14 days + // after the notification is sent out. Also referred to as `Week 1` (Console) + // and `preview` (gcloud CLI). + canary = 1; + + // For an instance with a scheduled maintenance window, this maintenance + // timing indicates that the maintenance update is scheduled 15 to 21 days + // after the notification is sent out. Also referred to as `Week 2` (Console) + // and `production` (gcloud CLI). + stable = 2; + + // For instance with a scheduled maintenance window, this maintenance + // timing indicates that the maintenance update is scheduled 35 to 42 days + // after the notification is sent out. + week5 = 3; +} + +// Acquire SSRS lease context. +message AcquireSsrsLeaseContext { + // The username to be used as the setup login to connect to the database + // server for SSRS setup. + optional string setup_login = 1; + + // The username to be used as the service login to connect to the report + // database for SSRS setup. + optional string service_login = 2; + + // The report database to be used for SSRS setup. + optional string report_database = 3; + + // Lease duration needed for SSRS setup. + optional google.protobuf.Duration duration = 4; +} + +// DNS metadata. +message DnsNameMapping { + // The connection type of the DNS name. + // This enum is not frozen, and new values may be added in the future. + enum ConnectionType { + // Unknown connection type. + CONNECTION_TYPE_UNSPECIFIED = 0; + + // Public IP. + PUBLIC = 1; + + // Private services access (private IP). + PRIVATE_SERVICES_ACCESS = 2; + + // Private Service Connect. + PRIVATE_SERVICE_CONNECT = 3; + } + + // The scope that the DNS name applies to. + enum DnsScope { + // DNS scope not set. This value should not be used. + DNS_SCOPE_UNSPECIFIED = 0; + + // Indicates an instance-level DNS name. + INSTANCE = 1; + + // Indicates a cluster-level DNS name. + CLUSTER = 2; + } + + // The system responsible for managing the DNS record. + enum RecordManager { + // Record manager not set. This value should not be used. + RECORD_MANAGER_UNSPECIFIED = 0; + + // The record may be managed by the customer. It is not automatically + // managed by Cloud SQL automation. + CUSTOMER = 1; + + // The record is managed by Cloud SQL, which will create, update, + // and delete the DNS records for the zone automatically when + // the Cloud SQL database instance is created or updated. + CLOUD_SQL_AUTOMATION = 2; + } + + // Output only. The DNS name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The connection type of the DNS name. + ConnectionType connection_type = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The scope that the DNS name applies to. + DnsScope dns_scope = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The manager for this DNS record. + RecordManager record_manager = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The status of automated DNS provisioning. +enum AutoDnsStatus { + // Unspecified status. This means status is missing from dependency service. + AUTO_DNS_STATUS_UNSPECIFIED = 0; + + // DNS provisioning is OK. + AUTO_DNS_OK = 1; + + // DNS provisioning failed. + AUTO_DNS_FAILED = 2; + + // DNS provisioning status is not recognized by Cloud SQL. + AUTO_DNS_UNKNOWN = 3; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_ssl_certs.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_ssl_certs.proto new file mode 100644 index 000000000000..1a39afd1c8bf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_ssl_certs.proto @@ -0,0 +1,141 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/sql/v1/cloud_sql_resources.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlSslCertsProto"; +option java_package = "com.google.cloud.sql.v1"; + +// Service to manage SSL certs for Cloud SQL instances. +service SqlSslCertsService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Deletes the SSL certificate. For First Generation instances, the + // certificate remains valid until the instance is restarted. + rpc Delete(SqlSslCertsDeleteRequest) returns (Operation) { + option (google.api.http) = { + delete: "/v1/projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}" + }; + } + + // Retrieves a particular SSL certificate. Does not include the private key + // (required for usage). The private key must be saved from the response to + // initial creation. + rpc Get(SqlSslCertsGetRequest) returns (SslCert) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}" + }; + } + + // Creates an SSL certificate and returns it along with the private key and + // server certificate authority. The new certificate will not be usable until + // the instance is restarted. + rpc Insert(SqlSslCertsInsertRequest) returns (SslCertsInsertResponse) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/sslCerts" + body: "body" + }; + } + + // Lists all of the current SSL certificates for the instance. + rpc List(SqlSslCertsListRequest) returns (SslCertsListResponse) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}/sslCerts" + }; + } +} + +message SqlSslCertsDeleteRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // Sha1 FingerPrint. + string sha1_fingerprint = 3; +} + +message SqlSslCertsGetRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // Sha1 FingerPrint. + string sha1_fingerprint = 3; +} + +message SqlSslCertsInsertRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + SslCertsInsertRequest body = 100; +} + +message SqlSslCertsListRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +// SslCerts insert request. +message SslCertsInsertRequest { + // User supplied name. Must be a distinct name from the other certificates + // for this instance. + string common_name = 1; +} + +// SslCert insert response. +message SslCertsInsertResponse { + // This is always `sql#sslCertsInsert`. + string kind = 1; + + // The operation to track the ssl certs insert request. + Operation operation = 2; + + // The server Certificate Authority's certificate. If this is missing you can + // force a new one to be generated by calling resetSslConfig method on + // instances resource. + SslCert server_ca_cert = 3; + + // The new client certificate and private key. + SslCertDetail client_cert = 4; +} + +// SslCerts list response. +message SslCertsListResponse { + // This is always `sql#sslCertsList`. + string kind = 1; + + // List of client certificates for the instance. + repeated SslCert items = 2; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_tiers.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_tiers.proto new file mode 100644 index 000000000000..42bec043bef0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_tiers.proto @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlTiersProto"; +option java_package = "com.google.cloud.sql.v1"; + +// Service for providing machine types (tiers) for Cloud SQL instances. +service SqlTiersService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Lists all available machine types (tiers) for Cloud SQL, for example, + // `db-custom-1-3840`. For more information, see + // https://cloud.google.com/sql/pricing. + rpc List(SqlTiersListRequest) returns (TiersListResponse) { + option (google.api.http) = { + get: "/v1/projects/{project}/tiers" + }; + } +} + +// Tiers list request. +message SqlTiersListRequest { + // Project ID of the project for which to list tiers. + string project = 1; +} + +// Tiers list response. +message TiersListResponse { + // This is always `sql#tiersList`. + string kind = 1; + + // List of tiers. + repeated Tier items = 2; +} + +// A Google Cloud SQL service tier resource. +message Tier { + // An identifier for the machine type, for example, `db-custom-1-3840`. For + // related information, see [Pricing](/sql/pricing). + string tier = 1; + + // The maximum RAM usage of this tier in bytes. + int64 RAM = 2 [json_name = "RAM"]; + + // This is always `sql#tier`. + string kind = 3; + + // The maximum disk size of this tier in bytes. + int64 Disk_Quota = 4 [json_name = "DiskQuota"]; + + // The applicable regions for this tier. + repeated string region = 5; +} diff --git a/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_users.proto b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_users.proto new file mode 100644 index 000000000000..0d82159bf690 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1/src/main/proto/google/cloud/sql/v1/cloud_sql_users.proto @@ -0,0 +1,317 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/sql/v1/cloud_sql_resources.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlUsersProto"; +option java_package = "com.google.cloud.sql.v1"; + +// Cloud SQL users service. +service SqlUsersService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Deletes a user from a Cloud SQL instance. + rpc Delete(SqlUsersDeleteRequest) returns (Operation) { + option (google.api.http) = { + delete: "/v1/projects/{project}/instances/{instance}/users" + }; + } + + // Retrieves a resource containing information about a user. + rpc Get(SqlUsersGetRequest) returns (User) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}/users/{name}" + }; + } + + // Creates a new user in a Cloud SQL instance. + rpc Insert(SqlUsersInsertRequest) returns (Operation) { + option (google.api.http) = { + post: "/v1/projects/{project}/instances/{instance}/users" + body: "body" + }; + } + + // Lists users in the specified Cloud SQL instance. + rpc List(SqlUsersListRequest) returns (UsersListResponse) { + option (google.api.http) = { + get: "/v1/projects/{project}/instances/{instance}/users" + }; + } + + // Updates an existing user in a Cloud SQL instance. + rpc Update(SqlUsersUpdateRequest) returns (Operation) { + option (google.api.http) = { + put: "/v1/projects/{project}/instances/{instance}/users" + body: "body" + }; + } +} + +message SqlUsersDeleteRequest { + // Host of the user in the instance. + string host = 1; + + // Database instance ID. This does not include the project ID. + string instance = 2; + + // Name of the user in the instance. + string name = 3; + + // Project ID of the project that contains the instance. + string project = 4; +} + +// Request message for Users Get RPC +message SqlUsersGetRequest { + // Database instance ID. This does not include the project ID. + string instance = 1; + + // User of the instance. + string name = 2; + + // Project ID of the project that contains the instance. + string project = 3; + + // Host of a user of the instance. + string host = 4; +} + +message SqlUsersInsertRequest { + // Database instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + User body = 100; +} + +message SqlUsersListRequest { + // Database instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +message SqlUsersUpdateRequest { + // Optional. Host of the user in the instance. + string host = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Database instance ID. This does not include the project ID. + string instance = 2; + + // Name of the user in the instance. + string name = 3; + + // Project ID of the project that contains the instance. + string project = 4; + + // Optional. List of database roles to grant to the user. body.database_roles + // will be ignored for update request. + repeated string database_roles = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether to revoke existing roles that are not present + // in the `database_roles` field. If `false` or unset, the database roles + // specified in `database_roles` are added to the user's existing roles. + optional bool revoke_existing_roles = 6 + [(google.api.field_behavior) = OPTIONAL]; + + User body = 100; +} + +// User level password validation policy. +message UserPasswordValidationPolicy { + // Number of failed login attempts allowed before user get locked. + int32 allowed_failed_attempts = 1; + + // Expiration duration after password is updated. + google.protobuf.Duration password_expiration_duration = 2; + + // If true, failed login attempts check will be enabled. + bool enable_failed_attempts_check = 3; + + // Output only. Read-only password status. + PasswordStatus status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // If true, the user must specify the current password before changing the + // password. This flag is supported only for MySQL. + bool enable_password_verification = 5; +} + +// Read-only password status. +message PasswordStatus { + // If true, user does not have login privileges. + bool locked = 1; + + // The expiration time of the current password. + google.protobuf.Timestamp password_expiration_time = 2; +} + +// A Cloud SQL user resource. +message User { + // The user type. + enum SqlUserType { + // The database's built-in user type. + BUILT_IN = 0; + + // Cloud IAM user. + CLOUD_IAM_USER = 1; + + // Cloud IAM service account. + CLOUD_IAM_SERVICE_ACCOUNT = 2; + + // Cloud IAM group. Not used for login. + CLOUD_IAM_GROUP = 3; + + // Read-only. Login for a user that belongs to the Cloud IAM group. + CLOUD_IAM_GROUP_USER = 4; + + // Read-only. Login for a service account that belongs to the + // Cloud IAM group. + CLOUD_IAM_GROUP_SERVICE_ACCOUNT = 5; + + // Cloud IAM workforce identity user managed via workforce identity + // federation. + CLOUD_IAM_WORKFORCE_IDENTITY = 6; + + // Microsoft Entra ID user. + ENTRAID_USER = 7; + } + + // The type of retained password. + enum DualPasswordType { + // The default value. + DUAL_PASSWORD_TYPE_UNSPECIFIED = 0; + + // Do not update the user's dual password status. + NO_MODIFY_DUAL_PASSWORD = 1; + + // No dual password usable for connecting using this user. + NO_DUAL_PASSWORD = 2; + + // Dual password usable for connecting using this user. + DUAL_PASSWORD = 3; + } + + // Indicates if a group is available for IAM database authentication. + enum IamStatus { + // The default value for users that are not of type CLOUD_IAM_GROUP. + // Only CLOUD_IAM_GROUP users will be inactive or active. + // Users with an IamStatus of IAM_STATUS_UNSPECIFIED will not + // display whether they are active or inactive as that is not applicable to + // them. + IAM_STATUS_UNSPECIFIED = 0; + + // INACTIVE indicates a group is not available for IAM database + // authentication. + INACTIVE = 1; + + // ACTIVE indicates a group is available for IAM database authentication. + ACTIVE = 2; + } + + // This is always `sql#user`. + string kind = 1; + + // The password for the user. + string password = 2; + + // This field is deprecated and will be removed from a future version of the + // API. + string etag = 3; + + // The name of the user in the Cloud SQL instance. Can be omitted for + // `update` because it is already specified in the URL. + string name = 4; + + // Optional. The host from which the user can connect. For `insert` + // operations, host defaults to an empty string. For `update` + // operations, host is specified as part of the request URL. The host name + // cannot be updated after insertion. For a MySQL instance, it's required; + // for a PostgreSQL or SQL Server instance, it's optional. + string host = 5 [(google.api.field_behavior) = OPTIONAL]; + + // The name of the Cloud SQL instance. This does not include the project ID. + // Can be omitted for `update` because it is already specified on the + // URL. + string instance = 6; + + // The project ID of the project containing the Cloud SQL database. The Google + // apps domain is prefixed if applicable. Can be omitted for `update` because + // it is already specified on the URL. + string project = 7; + + // The user type. It determines the method to authenticate the user during + // login. The default is the database's built-in user type. + SqlUserType type = 8; + + // User details for specific database type + oneof user_details { + SqlServerUserDetails sqlserver_user_details = 9; + } + + // Optional. The full email for an IAM user. For normal database users, this + // will not be filled. Only applicable to MySQL database users. + string iam_email = 11 [(google.api.field_behavior) = OPTIONAL]; + + // User level password validation policy. + UserPasswordValidationPolicy password_policy = 12; + + // Dual password status for the user. + optional DualPasswordType dual_password_type = 13; + + // Indicates if a group is active or inactive for IAM database authentication. + optional IamStatus iam_status = 14; + + // Optional. Role memberships of the user + repeated string database_roles = 15 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents a Sql Server user on the Cloud SQL instance. +message SqlServerUserDetails { + // If the user has been disabled + bool disabled = 1; + + // The server roles for this user + repeated string server_roles = 2; +} + +// User list response. +message UsersListResponse { + // This is always `sql#usersList`. + string kind = 1; + + // List of user resources in the instance. + repeated User items = 2; + + // Unused. + string next_page_token = 3 [deprecated = true]; +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/clirr-ignored-differences.xml b/java-sql/proto-google-cloud-sql-v1beta4/clirr-ignored-differences.xml new file mode 100644 index 000000000000..28d85f5d6002 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/clirr-ignored-differences.xml @@ -0,0 +1,80 @@ + + + + + 7012 + com/google/cloud/sql/v1beta4/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/sql/v1beta4/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/sql/v1beta4/*OrBuilder + boolean has*(*) + + + + 7006 + com/google/cloud/sql/v1beta4/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/cloud/sql/v1beta4/** + * addRepeatedField(*) + ** + + + 7006 + com/google/cloud/sql/v1beta4/** + * clear() + ** + + + 7006 + com/google/cloud/sql/v1beta4/** + * clearField(*) + ** + + + 7006 + com/google/cloud/sql/v1beta4/** + * clearOneof(*) + ** + + + 7006 + com/google/cloud/sql/v1beta4/** + * clone() + ** + + + 7006 + com/google/cloud/sql/v1beta4/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/cloud/sql/v1beta4/** + * setField(*) + ** + + + 7006 + com/google/cloud/sql/v1beta4/** + * setRepeatedField(*) + ** + + + 7006 + com/google/cloud/sql/v1beta4/** + * setUnknownFields(*) + ** + + diff --git a/java-sql/proto-google-cloud-sql-v1beta4/pom.xml b/java-sql/proto-google-cloud-sql-v1beta4/pom.xml new file mode 100644 index 000000000000..6f70fd30e7cb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/pom.xml @@ -0,0 +1,41 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-sql-v1beta4 + 0.1.0-SNAPSHOT + proto-google-cloud-sql-v1beta4 + Proto library for google-cloud-sql + + com.google.cloud + google-cloud-sql-parent + 0.1.0-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 + + + org.jspecify + jspecify + + + diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Ack.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Ack.java new file mode 100644 index 000000000000..09cbdf8741f7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Ack.java @@ -0,0 +1,498 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Acknowledges data received by the client or server.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Ack} + */ +@com.google.protobuf.Generated +public final class Ack extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.Ack) + AckOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Ack"); + } + + // Use Ack.newBuilder() to construct. + private Ack(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Ack() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_Ack_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_Ack_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Ack.class, com.google.cloud.sql.v1beta4.Ack.Builder.class); + } + + public static final int RECEIVED_OFFSET_FIELD_NUMBER = 1; + private long receivedOffset_ = 0L; + + /** + * + * + *
+   * Required. The absolute number of bytes processed in the session.
+   * 
+ * + * int64 received_offset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The receivedOffset. + */ + @java.lang.Override + public long getReceivedOffset() { + return receivedOffset_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (receivedOffset_ != 0L) { + output.writeInt64(1, receivedOffset_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (receivedOffset_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, receivedOffset_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.Ack)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.Ack other = (com.google.cloud.sql.v1beta4.Ack) obj; + + if (getReceivedOffset() != other.getReceivedOffset()) return false; + if (!getUnknownFields().equals(other.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) + RECEIVED_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getReceivedOffset()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.Ack parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Ack parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Ack parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Ack parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Ack parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Ack parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Ack parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Ack parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Ack parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Ack parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Ack parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Ack parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.Ack prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Acknowledges data received by the client or server.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Ack} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.Ack) + com.google.cloud.sql.v1beta4.AckOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_Ack_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_Ack_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Ack.class, + com.google.cloud.sql.v1beta4.Ack.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.Ack.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + receivedOffset_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_Ack_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Ack getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.Ack.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Ack build() { + com.google.cloud.sql.v1beta4.Ack result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Ack buildPartial() { + com.google.cloud.sql.v1beta4.Ack result = new com.google.cloud.sql.v1beta4.Ack(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.Ack result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.receivedOffset_ = receivedOffset_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.Ack) { + return mergeFrom((com.google.cloud.sql.v1beta4.Ack) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.Ack other) { + if (other == com.google.cloud.sql.v1beta4.Ack.getDefaultInstance()) return this; + if (other.getReceivedOffset() != 0L) { + setReceivedOffset(other.getReceivedOffset()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + receivedOffset_ = input.readInt64(); + 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 long receivedOffset_; + + /** + * + * + *
+     * Required. The absolute number of bytes processed in the session.
+     * 
+ * + * int64 received_offset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The receivedOffset. + */ + @java.lang.Override + public long getReceivedOffset() { + return receivedOffset_; + } + + /** + * + * + *
+     * Required. The absolute number of bytes processed in the session.
+     * 
+ * + * int64 received_offset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The receivedOffset to set. + * @return This builder for chaining. + */ + public Builder setReceivedOffset(long value) { + + receivedOffset_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The absolute number of bytes processed in the session.
+     * 
+ * + * int64 received_offset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearReceivedOffset() { + bitField0_ = (bitField0_ & ~0x00000001); + receivedOffset_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.Ack) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.Ack) + private static final com.google.cloud.sql.v1beta4.Ack DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.Ack(); + } + + public static com.google.cloud.sql.v1beta4.Ack getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Ack parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Ack getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AckOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AckOrBuilder.java new file mode 100644 index 000000000000..a6ce1136eda7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AckOrBuilder.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface AckOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.Ack) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The absolute number of bytes processed in the session.
+   * 
+ * + * int64 received_offset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The receivedOffset. + */ + long getReceivedOffset(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AclEntry.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AclEntry.java new file mode 100644 index 000000000000..bcf7fe444dd4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AclEntry.java @@ -0,0 +1,1288 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * An entry for an Access Control list.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.AclEntry} + */ +@com.google.protobuf.Generated +public final class AclEntry extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.AclEntry) + AclEntryOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AclEntry"); + } + + // Use AclEntry.newBuilder() to construct. + private AclEntry(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AclEntry() { + value_ = ""; + name_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AclEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AclEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.AclEntry.class, + com.google.cloud.sql.v1beta4.AclEntry.Builder.class); + } + + private int bitField0_; + public static final int VALUE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + + /** + * + * + *
+   * The allowlisted value for the access control list.
+   * 
+ * + * string value = 1; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + + /** + * + * + *
+   * The allowlisted value for the access control list.
+   * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRATION_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp expirationTime_; + + /** + * + * + *
+   * The time when this access control entry expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return Whether the expirationTime field is set. + */ + @java.lang.Override + public boolean hasExpirationTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time when this access control entry expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return The expirationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpirationTime() { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + + /** + * + * + *
+   * The time when this access control entry expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder() { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + + public static final int NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Optional. A label to identify this entry.
+   * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+   * Optional. A label to identify this entry.
+   * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 KIND_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#aclEntry`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#aclEntry`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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.GeneratedMessage.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, value_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getExpirationTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, value_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExpirationTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.AclEntry)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.AclEntry other = (com.google.cloud.sql.v1beta4.AclEntry) obj; + + if (!getValue().equals(other.getValue())) return false; + if (hasExpirationTime() != other.hasExpirationTime()) return false; + if (hasExpirationTime()) { + if (!getExpirationTime().equals(other.getExpirationTime())) return false; + } + if (!getName().equals(other.getName())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + if (hasExpirationTime()) { + hash = (37 * hash) + EXPIRATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpirationTime().hashCode(); + } + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.AclEntry parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.AclEntry parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AclEntry parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.AclEntry parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AclEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.AclEntry parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AclEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.AclEntry parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AclEntry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.AclEntry parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AclEntry parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.AclEntry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.AclEntry prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * An entry for an Access Control list.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.AclEntry} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.AclEntry) + com.google.cloud.sql.v1beta4.AclEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AclEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AclEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.AclEntry.class, + com.google.cloud.sql.v1beta4.AclEntry.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.AclEntry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetExpirationTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = ""; + expirationTime_ = null; + if (expirationTimeBuilder_ != null) { + expirationTimeBuilder_.dispose(); + expirationTimeBuilder_ = null; + } + name_ = ""; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AclEntry_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AclEntry getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.AclEntry.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AclEntry build() { + com.google.cloud.sql.v1beta4.AclEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AclEntry buildPartial() { + com.google.cloud.sql.v1beta4.AclEntry result = + new com.google.cloud.sql.v1beta4.AclEntry(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.AclEntry result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.expirationTime_ = + expirationTimeBuilder_ == null ? expirationTime_ : expirationTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.kind_ = kind_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.AclEntry) { + return mergeFrom((com.google.cloud.sql.v1beta4.AclEntry) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.AclEntry other) { + if (other == com.google.cloud.sql.v1beta4.AclEntry.getDefaultInstance()) return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasExpirationTime()) { + mergeExpirationTime(other.getExpirationTime()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + value_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetExpirationTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + kind_ = 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 value_ = ""; + + /** + * + * + *
+     * The allowlisted value for the access control list.
+     * 
+ * + * string value = 1; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The allowlisted value for the access control list.
+     * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The allowlisted value for the access control list.
+     * 
+ * + * string value = 1; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The allowlisted value for the access control list.
+     * 
+ * + * string value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The allowlisted value for the access control list.
+     * 
+ * + * string value = 1; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expirationTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expirationTimeBuilder_; + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return Whether the expirationTime field is set. + */ + public boolean hasExpirationTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return The expirationTime. + */ + public com.google.protobuf.Timestamp getExpirationTime() { + if (expirationTimeBuilder_ == null) { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } else { + return expirationTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder setExpirationTime(com.google.protobuf.Timestamp value) { + if (expirationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expirationTime_ = value; + } else { + expirationTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder setExpirationTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expirationTimeBuilder_ == null) { + expirationTime_ = builderForValue.build(); + } else { + expirationTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder mergeExpirationTime(com.google.protobuf.Timestamp value) { + if (expirationTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && expirationTime_ != null + && expirationTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpirationTimeBuilder().mergeFrom(value); + } else { + expirationTime_ = value; + } + } else { + expirationTimeBuilder_.mergeFrom(value); + } + if (expirationTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder clearExpirationTime() { + bitField0_ = (bitField0_ & ~0x00000002); + expirationTime_ = null; + if (expirationTimeBuilder_ != null) { + expirationTimeBuilder_.dispose(); + expirationTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getExpirationTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetExpirationTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder() { + if (expirationTimeBuilder_ != null) { + return expirationTimeBuilder_.getMessageOrBuilder(); + } else { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + } + + /** + * + * + *
+     * The time when this access control entry expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExpirationTimeFieldBuilder() { + if (expirationTimeBuilder_ == null) { + expirationTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpirationTime(), getParentForChildren(), isClean()); + expirationTime_ = null; + } + return expirationTimeBuilder_; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Optional. A label to identify this entry.
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+     * Optional. A label to identify this entry.
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+     * Optional. A label to identify this entry.
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A label to identify this entry.
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A label to identify this entry.
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#aclEntry`.
+     * 
+ * + * string kind = 4; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#aclEntry`.
+     * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#aclEntry`.
+     * 
+ * + * string kind = 4; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#aclEntry`.
+     * 
+ * + * string kind = 4; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#aclEntry`.
+     * 
+ * + * string kind = 4; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.AclEntry) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.AclEntry) + private static final com.google.cloud.sql.v1beta4.AclEntry DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.AclEntry(); + } + + public static com.google.cloud.sql.v1beta4.AclEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AclEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AclEntry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AclEntryOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AclEntryOrBuilder.java new file mode 100644 index 000000000000..2f7f0f6f3578 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AclEntryOrBuilder.java @@ -0,0 +1,149 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface AclEntryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.AclEntry) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The allowlisted value for the access control list.
+   * 
+ * + * string value = 1; + * + * @return The value. + */ + java.lang.String getValue(); + + /** + * + * + *
+   * The allowlisted value for the access control list.
+   * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+   * The time when this access control entry expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return Whether the expirationTime field is set. + */ + boolean hasExpirationTime(); + + /** + * + * + *
+   * The time when this access control entry expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return The expirationTime. + */ + com.google.protobuf.Timestamp getExpirationTime(); + + /** + * + * + *
+   * The time when this access control entry expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder(); + + /** + * + * + *
+   * Optional. A label to identify this entry.
+   * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Optional. A label to identify this entry.
+   * 
+ * + * string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * This is always `sql#aclEntry`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#aclEntry`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AcquireSsrsLeaseContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AcquireSsrsLeaseContext.java new file mode 100644 index 000000000000..b3b31a58a9b7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AcquireSsrsLeaseContext.java @@ -0,0 +1,1387 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Acquire SSRS lease context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.AcquireSsrsLeaseContext} + */ +@com.google.protobuf.Generated +public final class AcquireSsrsLeaseContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.AcquireSsrsLeaseContext) + AcquireSsrsLeaseContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AcquireSsrsLeaseContext"); + } + + // Use AcquireSsrsLeaseContext.newBuilder() to construct. + private AcquireSsrsLeaseContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AcquireSsrsLeaseContext() { + setupLogin_ = ""; + serviceLogin_ = ""; + reportDatabase_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AcquireSsrsLeaseContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AcquireSsrsLeaseContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.class, + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.Builder.class); + } + + private int bitField0_; + public static final int SETUP_LOGIN_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object setupLogin_ = ""; + + /** + * + * + *
+   * The username to be used as the setup login to connect to the database
+   * server for SSRS setup.
+   * 
+ * + * optional string setup_login = 1; + * + * @return Whether the setupLogin field is set. + */ + @java.lang.Override + public boolean hasSetupLogin() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The username to be used as the setup login to connect to the database
+   * server for SSRS setup.
+   * 
+ * + * optional string setup_login = 1; + * + * @return The setupLogin. + */ + @java.lang.Override + public java.lang.String getSetupLogin() { + java.lang.Object ref = setupLogin_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + setupLogin_ = s; + return s; + } + } + + /** + * + * + *
+   * The username to be used as the setup login to connect to the database
+   * server for SSRS setup.
+   * 
+ * + * optional string setup_login = 1; + * + * @return The bytes for setupLogin. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSetupLoginBytes() { + java.lang.Object ref = setupLogin_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + setupLogin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_LOGIN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceLogin_ = ""; + + /** + * + * + *
+   * The username to be used as the service login to connect to the report
+   * database for SSRS setup.
+   * 
+ * + * optional string service_login = 2; + * + * @return Whether the serviceLogin field is set. + */ + @java.lang.Override + public boolean hasServiceLogin() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The username to be used as the service login to connect to the report
+   * database for SSRS setup.
+   * 
+ * + * optional string service_login = 2; + * + * @return The serviceLogin. + */ + @java.lang.Override + public java.lang.String getServiceLogin() { + java.lang.Object ref = serviceLogin_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceLogin_ = s; + return s; + } + } + + /** + * + * + *
+   * The username to be used as the service login to connect to the report
+   * database for SSRS setup.
+   * 
+ * + * optional string service_login = 2; + * + * @return The bytes for serviceLogin. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceLoginBytes() { + java.lang.Object ref = serviceLogin_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceLogin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPORT_DATABASE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object reportDatabase_ = ""; + + /** + * + * + *
+   * The report database to be used for the SSRS setup.
+   * 
+ * + * optional string report_database = 3; + * + * @return Whether the reportDatabase field is set. + */ + @java.lang.Override + public boolean hasReportDatabase() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The report database to be used for the SSRS setup.
+   * 
+ * + * optional string report_database = 3; + * + * @return The reportDatabase. + */ + @java.lang.Override + public java.lang.String getReportDatabase() { + java.lang.Object ref = reportDatabase_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reportDatabase_ = s; + return s; + } + } + + /** + * + * + *
+   * The report database to be used for the SSRS setup.
+   * 
+ * + * optional string report_database = 3; + * + * @return The bytes for reportDatabase. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReportDatabaseBytes() { + java.lang.Object ref = reportDatabase_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reportDatabase_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DURATION_FIELD_NUMBER = 4; + private com.google.protobuf.Duration duration_; + + /** + * + * + *
+   * Lease duration needed for the SSRS setup.
+   * 
+ * + * optional .google.protobuf.Duration duration = 4; + * + * @return Whether the duration field is set. + */ + @java.lang.Override + public boolean hasDuration() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Lease duration needed for the SSRS setup.
+   * 
+ * + * optional .google.protobuf.Duration duration = 4; + * + * @return The duration. + */ + @java.lang.Override + public com.google.protobuf.Duration getDuration() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + + /** + * + * + *
+   * Lease duration needed for the SSRS setup.
+   * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, setupLogin_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, serviceLogin_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, reportDatabase_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(4, getDuration()); + } + 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.GeneratedMessage.computeStringSize(1, setupLogin_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, serviceLogin_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, reportDatabase_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDuration()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext other = + (com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext) obj; + + if (hasSetupLogin() != other.hasSetupLogin()) return false; + if (hasSetupLogin()) { + if (!getSetupLogin().equals(other.getSetupLogin())) return false; + } + if (hasServiceLogin() != other.hasServiceLogin()) return false; + if (hasServiceLogin()) { + if (!getServiceLogin().equals(other.getServiceLogin())) return false; + } + if (hasReportDatabase() != other.hasReportDatabase()) return false; + if (hasReportDatabase()) { + if (!getReportDatabase().equals(other.getReportDatabase())) return false; + } + if (hasDuration() != other.hasDuration()) return false; + if (hasDuration()) { + if (!getDuration().equals(other.getDuration())) return false; + } + if (!getUnknownFields().equals(other.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 (hasSetupLogin()) { + hash = (37 * hash) + SETUP_LOGIN_FIELD_NUMBER; + hash = (53 * hash) + getSetupLogin().hashCode(); + } + if (hasServiceLogin()) { + hash = (37 * hash) + SERVICE_LOGIN_FIELD_NUMBER; + hash = (53 * hash) + getServiceLogin().hashCode(); + } + if (hasReportDatabase()) { + hash = (37 * hash) + REPORT_DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getReportDatabase().hashCode(); + } + if (hasDuration()) { + hash = (37 * hash) + DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDuration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Acquire SSRS lease context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.AcquireSsrsLeaseContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.AcquireSsrsLeaseContext) + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AcquireSsrsLeaseContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AcquireSsrsLeaseContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.class, + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetDurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + setupLogin_ = ""; + serviceLogin_ = ""; + reportDatabase_ = ""; + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AcquireSsrsLeaseContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext build() { + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext buildPartial() { + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext result = + new com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.setupLogin_ = setupLogin_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.serviceLogin_ = serviceLogin_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.reportDatabase_ = reportDatabase_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.duration_ = durationBuilder_ == null ? duration_ : durationBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext other) { + if (other == com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.getDefaultInstance()) + return this; + if (other.hasSetupLogin()) { + setupLogin_ = other.setupLogin_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasServiceLogin()) { + serviceLogin_ = other.serviceLogin_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasReportDatabase()) { + reportDatabase_ = other.reportDatabase_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasDuration()) { + mergeDuration(other.getDuration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + setupLogin_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + serviceLogin_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + reportDatabase_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object setupLogin_ = ""; + + /** + * + * + *
+     * The username to be used as the setup login to connect to the database
+     * server for SSRS setup.
+     * 
+ * + * optional string setup_login = 1; + * + * @return Whether the setupLogin field is set. + */ + public boolean hasSetupLogin() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The username to be used as the setup login to connect to the database
+     * server for SSRS setup.
+     * 
+ * + * optional string setup_login = 1; + * + * @return The setupLogin. + */ + public java.lang.String getSetupLogin() { + java.lang.Object ref = setupLogin_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + setupLogin_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The username to be used as the setup login to connect to the database
+     * server for SSRS setup.
+     * 
+ * + * optional string setup_login = 1; + * + * @return The bytes for setupLogin. + */ + public com.google.protobuf.ByteString getSetupLoginBytes() { + java.lang.Object ref = setupLogin_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + setupLogin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The username to be used as the setup login to connect to the database
+     * server for SSRS setup.
+     * 
+ * + * optional string setup_login = 1; + * + * @param value The setupLogin to set. + * @return This builder for chaining. + */ + public Builder setSetupLogin(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + setupLogin_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The username to be used as the setup login to connect to the database
+     * server for SSRS setup.
+     * 
+ * + * optional string setup_login = 1; + * + * @return This builder for chaining. + */ + public Builder clearSetupLogin() { + setupLogin_ = getDefaultInstance().getSetupLogin(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The username to be used as the setup login to connect to the database
+     * server for SSRS setup.
+     * 
+ * + * optional string setup_login = 1; + * + * @param value The bytes for setupLogin to set. + * @return This builder for chaining. + */ + public Builder setSetupLoginBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + setupLogin_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object serviceLogin_ = ""; + + /** + * + * + *
+     * The username to be used as the service login to connect to the report
+     * database for SSRS setup.
+     * 
+ * + * optional string service_login = 2; + * + * @return Whether the serviceLogin field is set. + */ + public boolean hasServiceLogin() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The username to be used as the service login to connect to the report
+     * database for SSRS setup.
+     * 
+ * + * optional string service_login = 2; + * + * @return The serviceLogin. + */ + public java.lang.String getServiceLogin() { + java.lang.Object ref = serviceLogin_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceLogin_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The username to be used as the service login to connect to the report
+     * database for SSRS setup.
+     * 
+ * + * optional string service_login = 2; + * + * @return The bytes for serviceLogin. + */ + public com.google.protobuf.ByteString getServiceLoginBytes() { + java.lang.Object ref = serviceLogin_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceLogin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The username to be used as the service login to connect to the report
+     * database for SSRS setup.
+     * 
+ * + * optional string service_login = 2; + * + * @param value The serviceLogin to set. + * @return This builder for chaining. + */ + public Builder setServiceLogin(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceLogin_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The username to be used as the service login to connect to the report
+     * database for SSRS setup.
+     * 
+ * + * optional string service_login = 2; + * + * @return This builder for chaining. + */ + public Builder clearServiceLogin() { + serviceLogin_ = getDefaultInstance().getServiceLogin(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The username to be used as the service login to connect to the report
+     * database for SSRS setup.
+     * 
+ * + * optional string service_login = 2; + * + * @param value The bytes for serviceLogin to set. + * @return This builder for chaining. + */ + public Builder setServiceLoginBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceLogin_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object reportDatabase_ = ""; + + /** + * + * + *
+     * The report database to be used for the SSRS setup.
+     * 
+ * + * optional string report_database = 3; + * + * @return Whether the reportDatabase field is set. + */ + public boolean hasReportDatabase() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The report database to be used for the SSRS setup.
+     * 
+ * + * optional string report_database = 3; + * + * @return The reportDatabase. + */ + public java.lang.String getReportDatabase() { + java.lang.Object ref = reportDatabase_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reportDatabase_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The report database to be used for the SSRS setup.
+     * 
+ * + * optional string report_database = 3; + * + * @return The bytes for reportDatabase. + */ + public com.google.protobuf.ByteString getReportDatabaseBytes() { + java.lang.Object ref = reportDatabase_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reportDatabase_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The report database to be used for the SSRS setup.
+     * 
+ * + * optional string report_database = 3; + * + * @param value The reportDatabase to set. + * @return This builder for chaining. + */ + public Builder setReportDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + reportDatabase_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The report database to be used for the SSRS setup.
+     * 
+ * + * optional string report_database = 3; + * + * @return This builder for chaining. + */ + public Builder clearReportDatabase() { + reportDatabase_ = getDefaultInstance().getReportDatabase(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The report database to be used for the SSRS setup.
+     * 
+ * + * optional string report_database = 3; + * + * @param value The bytes for reportDatabase to set. + * @return This builder for chaining. + */ + public Builder setReportDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + reportDatabase_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Duration duration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + durationBuilder_; + + /** + * + * + *
+     * Lease duration needed for the SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + * + * @return Whether the duration field is set. + */ + public boolean hasDuration() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Lease duration needed for the SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + * + * @return The duration. + */ + public com.google.protobuf.Duration getDuration() { + if (durationBuilder_ == null) { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } else { + return durationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Lease duration needed for the SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + public Builder setDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + duration_ = value; + } else { + durationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Lease duration needed for the SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (durationBuilder_ == null) { + duration_ = builderForValue.build(); + } else { + durationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Lease duration needed for the SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + public Builder mergeDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && duration_ != null + && duration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDurationBuilder().mergeFrom(value); + } else { + duration_ = value; + } + } else { + durationBuilder_.mergeFrom(value); + } + if (duration_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Lease duration needed for the SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + public Builder clearDuration() { + bitField0_ = (bitField0_ & ~0x00000008); + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Lease duration needed for the SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + public com.google.protobuf.Duration.Builder getDurationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetDurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Lease duration needed for the SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + if (durationBuilder_ != null) { + return durationBuilder_.getMessageOrBuilder(); + } else { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + } + + /** + * + * + *
+     * Lease duration needed for the SSRS setup.
+     * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetDurationFieldBuilder() { + if (durationBuilder_ == null) { + durationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDuration(), getParentForChildren(), isClean()); + duration_ = null; + } + return durationBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.AcquireSsrsLeaseContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.AcquireSsrsLeaseContext) + private static final com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext(); + } + + public static com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AcquireSsrsLeaseContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AcquireSsrsLeaseContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AcquireSsrsLeaseContextOrBuilder.java new file mode 100644 index 000000000000..db85ad6e55bd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AcquireSsrsLeaseContextOrBuilder.java @@ -0,0 +1,188 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface AcquireSsrsLeaseContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.AcquireSsrsLeaseContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The username to be used as the setup login to connect to the database
+   * server for SSRS setup.
+   * 
+ * + * optional string setup_login = 1; + * + * @return Whether the setupLogin field is set. + */ + boolean hasSetupLogin(); + + /** + * + * + *
+   * The username to be used as the setup login to connect to the database
+   * server for SSRS setup.
+   * 
+ * + * optional string setup_login = 1; + * + * @return The setupLogin. + */ + java.lang.String getSetupLogin(); + + /** + * + * + *
+   * The username to be used as the setup login to connect to the database
+   * server for SSRS setup.
+   * 
+ * + * optional string setup_login = 1; + * + * @return The bytes for setupLogin. + */ + com.google.protobuf.ByteString getSetupLoginBytes(); + + /** + * + * + *
+   * The username to be used as the service login to connect to the report
+   * database for SSRS setup.
+   * 
+ * + * optional string service_login = 2; + * + * @return Whether the serviceLogin field is set. + */ + boolean hasServiceLogin(); + + /** + * + * + *
+   * The username to be used as the service login to connect to the report
+   * database for SSRS setup.
+   * 
+ * + * optional string service_login = 2; + * + * @return The serviceLogin. + */ + java.lang.String getServiceLogin(); + + /** + * + * + *
+   * The username to be used as the service login to connect to the report
+   * database for SSRS setup.
+   * 
+ * + * optional string service_login = 2; + * + * @return The bytes for serviceLogin. + */ + com.google.protobuf.ByteString getServiceLoginBytes(); + + /** + * + * + *
+   * The report database to be used for the SSRS setup.
+   * 
+ * + * optional string report_database = 3; + * + * @return Whether the reportDatabase field is set. + */ + boolean hasReportDatabase(); + + /** + * + * + *
+   * The report database to be used for the SSRS setup.
+   * 
+ * + * optional string report_database = 3; + * + * @return The reportDatabase. + */ + java.lang.String getReportDatabase(); + + /** + * + * + *
+   * The report database to be used for the SSRS setup.
+   * 
+ * + * optional string report_database = 3; + * + * @return The bytes for reportDatabase. + */ + com.google.protobuf.ByteString getReportDatabaseBytes(); + + /** + * + * + *
+   * Lease duration needed for the SSRS setup.
+   * 
+ * + * optional .google.protobuf.Duration duration = 4; + * + * @return Whether the duration field is set. + */ + boolean hasDuration(); + + /** + * + * + *
+   * Lease duration needed for the SSRS setup.
+   * 
+ * + * optional .google.protobuf.Duration duration = 4; + * + * @return The duration. + */ + com.google.protobuf.Duration getDuration(); + + /** + * + * + *
+   * Lease duration needed for the SSRS setup.
+   * 
+ * + * optional .google.protobuf.Duration duration = 4; + */ + com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AdvancedMachineFeatures.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AdvancedMachineFeatures.java new file mode 100644 index 000000000000..3cad695235e0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AdvancedMachineFeatures.java @@ -0,0 +1,503 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Specifies options for controlling advanced machine features.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.AdvancedMachineFeatures} + */ +@com.google.protobuf.Generated +public final class AdvancedMachineFeatures extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.AdvancedMachineFeatures) + AdvancedMachineFeaturesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AdvancedMachineFeatures"); + } + + // Use AdvancedMachineFeatures.newBuilder() to construct. + private AdvancedMachineFeatures(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AdvancedMachineFeatures() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AdvancedMachineFeatures_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AdvancedMachineFeatures_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.class, + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.Builder.class); + } + + public static final int THREADS_PER_CORE_FIELD_NUMBER = 1; + private int threadsPerCore_ = 0; + + /** + * + * + *
+   * The number of threads per physical core.
+   * 
+ * + * int32 threads_per_core = 1; + * + * @return The threadsPerCore. + */ + @java.lang.Override + public int getThreadsPerCore() { + return threadsPerCore_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (threadsPerCore_ != 0) { + output.writeInt32(1, threadsPerCore_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (threadsPerCore_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, threadsPerCore_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.AdvancedMachineFeatures)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures other = + (com.google.cloud.sql.v1beta4.AdvancedMachineFeatures) obj; + + if (getThreadsPerCore() != other.getThreadsPerCore()) return false; + if (!getUnknownFields().equals(other.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) + THREADS_PER_CORE_FIELD_NUMBER; + hash = (53 * hash) + getThreadsPerCore(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.AdvancedMachineFeatures parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.AdvancedMachineFeatures parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AdvancedMachineFeatures parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.AdvancedMachineFeatures parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AdvancedMachineFeatures parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.AdvancedMachineFeatures parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AdvancedMachineFeatures parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.AdvancedMachineFeatures parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AdvancedMachineFeatures parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.AdvancedMachineFeatures parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AdvancedMachineFeatures parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.AdvancedMachineFeatures parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.AdvancedMachineFeatures prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specifies options for controlling advanced machine features.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.AdvancedMachineFeatures} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.AdvancedMachineFeatures) + com.google.cloud.sql.v1beta4.AdvancedMachineFeaturesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AdvancedMachineFeatures_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AdvancedMachineFeatures_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.class, + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + threadsPerCore_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AdvancedMachineFeatures_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AdvancedMachineFeatures getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AdvancedMachineFeatures build() { + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AdvancedMachineFeatures buildPartial() { + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures result = + new com.google.cloud.sql.v1beta4.AdvancedMachineFeatures(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.AdvancedMachineFeatures result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.threadsPerCore_ = threadsPerCore_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.AdvancedMachineFeatures) { + return mergeFrom((com.google.cloud.sql.v1beta4.AdvancedMachineFeatures) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.AdvancedMachineFeatures other) { + if (other == com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.getDefaultInstance()) + return this; + if (other.getThreadsPerCore() != 0) { + setThreadsPerCore(other.getThreadsPerCore()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + threadsPerCore_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int threadsPerCore_; + + /** + * + * + *
+     * The number of threads per physical core.
+     * 
+ * + * int32 threads_per_core = 1; + * + * @return The threadsPerCore. + */ + @java.lang.Override + public int getThreadsPerCore() { + return threadsPerCore_; + } + + /** + * + * + *
+     * The number of threads per physical core.
+     * 
+ * + * int32 threads_per_core = 1; + * + * @param value The threadsPerCore to set. + * @return This builder for chaining. + */ + public Builder setThreadsPerCore(int value) { + + threadsPerCore_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of threads per physical core.
+     * 
+ * + * int32 threads_per_core = 1; + * + * @return This builder for chaining. + */ + public Builder clearThreadsPerCore() { + bitField0_ = (bitField0_ & ~0x00000001); + threadsPerCore_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.AdvancedMachineFeatures) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.AdvancedMachineFeatures) + private static final com.google.cloud.sql.v1beta4.AdvancedMachineFeatures DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.AdvancedMachineFeatures(); + } + + public static com.google.cloud.sql.v1beta4.AdvancedMachineFeatures getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AdvancedMachineFeatures parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AdvancedMachineFeatures getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AdvancedMachineFeaturesOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AdvancedMachineFeaturesOrBuilder.java new file mode 100644 index 000000000000..a1daa7583b6d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AdvancedMachineFeaturesOrBuilder.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface AdvancedMachineFeaturesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.AdvancedMachineFeatures) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The number of threads per physical core.
+   * 
+ * + * int32 threads_per_core = 1; + * + * @return The threadsPerCore. + */ + int getThreadsPerCore(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ApiWarning.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ApiWarning.java new file mode 100644 index 000000000000..6d6da3058524 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ApiWarning.java @@ -0,0 +1,1166 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * An Admin API warning message.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ApiWarning} + */ +@com.google.protobuf.Generated +public final class ApiWarning extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ApiWarning) + ApiWarningOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ApiWarning"); + } + + // Use ApiWarning.newBuilder() to construct. + private ApiWarning(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ApiWarning() { + code_ = 0; + message_ = ""; + region_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ApiWarning_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ApiWarning_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ApiWarning.class, + com.google.cloud.sql.v1beta4.ApiWarning.Builder.class); + } + + /** Protobuf enum {@code google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode} */ + public enum SqlApiWarningCode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * An unknown or unset warning type from Cloud SQL API.
+     * 
+ * + * SQL_API_WARNING_CODE_UNSPECIFIED = 0; + */ + SQL_API_WARNING_CODE_UNSPECIFIED(0), + /** + * + * + *
+     * Warning when one or more regions are not reachable.  The returned result
+     * set may be incomplete.
+     * 
+ * + * REGION_UNREACHABLE = 1; + */ + REGION_UNREACHABLE(1), + /** + * + * + *
+     * Warning when user provided maxResults parameter exceeds the limit.  The
+     * returned result set may be incomplete.
+     * 
+ * + * MAX_RESULTS_EXCEEDS_LIMIT = 2; + */ + MAX_RESULTS_EXCEEDS_LIMIT(2), + /** + * + * + *
+     * Warning when user tries to create/update a user with credentials that
+     * have previously been compromised by a public data breach.
+     * 
+ * + * COMPROMISED_CREDENTIALS = 3; + */ + COMPROMISED_CREDENTIALS(3), + /** + * + * + *
+     * Warning when the operation succeeds but some non-critical workflow state
+     * failed.
+     * 
+ * + * INTERNAL_STATE_FAILURE = 4; + */ + INTERNAL_STATE_FAILURE(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlApiWarningCode"); + } + + /** + * + * + *
+     * An unknown or unset warning type from Cloud SQL API.
+     * 
+ * + * SQL_API_WARNING_CODE_UNSPECIFIED = 0; + */ + public static final int SQL_API_WARNING_CODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Warning when one or more regions are not reachable.  The returned result
+     * set may be incomplete.
+     * 
+ * + * REGION_UNREACHABLE = 1; + */ + public static final int REGION_UNREACHABLE_VALUE = 1; + + /** + * + * + *
+     * Warning when user provided maxResults parameter exceeds the limit.  The
+     * returned result set may be incomplete.
+     * 
+ * + * MAX_RESULTS_EXCEEDS_LIMIT = 2; + */ + public static final int MAX_RESULTS_EXCEEDS_LIMIT_VALUE = 2; + + /** + * + * + *
+     * Warning when user tries to create/update a user with credentials that
+     * have previously been compromised by a public data breach.
+     * 
+ * + * COMPROMISED_CREDENTIALS = 3; + */ + public static final int COMPROMISED_CREDENTIALS_VALUE = 3; + + /** + * + * + *
+     * Warning when the operation succeeds but some non-critical workflow state
+     * failed.
+     * 
+ * + * INTERNAL_STATE_FAILURE = 4; + */ + public static final int INTERNAL_STATE_FAILURE_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 SqlApiWarningCode 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 SqlApiWarningCode forNumber(int value) { + switch (value) { + case 0: + return SQL_API_WARNING_CODE_UNSPECIFIED; + case 1: + return REGION_UNREACHABLE; + case 2: + return MAX_RESULTS_EXCEEDS_LIMIT; + case 3: + return COMPROMISED_CREDENTIALS; + case 4: + return INTERNAL_STATE_FAILURE; + 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 SqlApiWarningCode findValueByNumber(int number) { + return SqlApiWarningCode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.ApiWarning.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlApiWarningCode[] VALUES = values(); + + public static SqlApiWarningCode 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 SqlApiWarningCode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode) + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_ = 0; + + /** + * + * + *
+   * Code to uniquely identify the warning type.
+   * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + + /** + * + * + *
+   * Code to uniquely identify the warning type.
+   * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode getCode() { + com.google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode result = + com.google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode.forNumber(code_); + return result == null + ? com.google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode.UNRECOGNIZED + : result; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
+   * The warning message.
+   * 
+ * + * string message = 2; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + + /** + * + * + *
+   * The warning message.
+   * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REGION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object region_ = ""; + + /** + * + * + *
+   * The region name for REGION_UNREACHABLE warning.
+   * 
+ * + * string region = 3; + * + * @return The region. + */ + @java.lang.Override + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } + } + + /** + * + * + *
+   * The region name for REGION_UNREACHABLE warning.
+   * 
+ * + * string region = 3; + * + * @return The bytes for region. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = 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 (code_ + != com.google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode + .SQL_API_WARNING_CODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, code_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, message_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, region_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ + != com.google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode + .SQL_API_WARNING_CODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, code_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, message_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, region_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ApiWarning)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ApiWarning other = (com.google.cloud.sql.v1beta4.ApiWarning) obj; + + if (code_ != other.code_) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (!getRegion().equals(other.getRegion())) return false; + if (!getUnknownFields().equals(other.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) + CODE_FIELD_NUMBER; + hash = (53 * hash) + code_; + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ApiWarning parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ApiWarning parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ApiWarning parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ApiWarning parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ApiWarning parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ApiWarning parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ApiWarning parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ApiWarning parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ApiWarning parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ApiWarning parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ApiWarning parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ApiWarning parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.ApiWarning prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * An Admin API warning message.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ApiWarning} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ApiWarning) + com.google.cloud.sql.v1beta4.ApiWarningOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ApiWarning_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ApiWarning_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ApiWarning.class, + com.google.cloud.sql.v1beta4.ApiWarning.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ApiWarning.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = 0; + message_ = ""; + region_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ApiWarning_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ApiWarning getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ApiWarning.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ApiWarning build() { + com.google.cloud.sql.v1beta4.ApiWarning result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ApiWarning buildPartial() { + com.google.cloud.sql.v1beta4.ApiWarning result = + new com.google.cloud.sql.v1beta4.ApiWarning(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ApiWarning result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.message_ = message_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.region_ = region_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ApiWarning) { + return mergeFrom((com.google.cloud.sql.v1beta4.ApiWarning) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ApiWarning other) { + if (other == com.google.cloud.sql.v1beta4.ApiWarning.getDefaultInstance()) return this; + if (other.code_ != 0) { + setCodeValue(other.getCodeValue()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getRegion().isEmpty()) { + region_ = other.region_; + 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 8: + { + code_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + region_ = 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 int code_ = 0; + + /** + * + * + *
+     * Code to uniquely identify the warning type.
+     * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + + /** + * + * + *
+     * Code to uniquely identify the warning type.
+     * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode code = 1; + * + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + code_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Code to uniquely identify the warning type.
+     * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode getCode() { + com.google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode result = + com.google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode.forNumber(code_); + return result == null + ? com.google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Code to uniquely identify the warning type.
+     * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(com.google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + code_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Code to uniquely identify the warning type.
+     * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + bitField0_ = (bitField0_ & ~0x00000001); + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + + /** + * + * + *
+     * The warning message.
+     * 
+ * + * string message = 2; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The warning message.
+     * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The warning message.
+     * 
+ * + * string message = 2; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The warning message.
+     * 
+ * + * string message = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The warning message.
+     * 
+ * + * string message = 2; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object region_ = ""; + + /** + * + * + *
+     * The region name for REGION_UNREACHABLE warning.
+     * 
+ * + * string region = 3; + * + * @return The region. + */ + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The region name for REGION_UNREACHABLE warning.
+     * 
+ * + * string region = 3; + * + * @return The bytes for region. + */ + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The region name for REGION_UNREACHABLE warning.
+     * 
+ * + * string region = 3; + * + * @param value The region to set. + * @return This builder for chaining. + */ + public Builder setRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + region_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The region name for REGION_UNREACHABLE warning.
+     * 
+ * + * string region = 3; + * + * @return This builder for chaining. + */ + public Builder clearRegion() { + region_ = getDefaultInstance().getRegion(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The region name for REGION_UNREACHABLE warning.
+     * 
+ * + * string region = 3; + * + * @param value The bytes for region to set. + * @return This builder for chaining. + */ + public Builder setRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + region_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ApiWarning) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ApiWarning) + private static final com.google.cloud.sql.v1beta4.ApiWarning DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ApiWarning(); + } + + public static com.google.cloud.sql.v1beta4.ApiWarning getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ApiWarning parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ApiWarning getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ApiWarningOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ApiWarningOrBuilder.java new file mode 100644 index 000000000000..dc0282c17788 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ApiWarningOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ApiWarningOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ApiWarning) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Code to uniquely identify the warning type.
+   * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode code = 1; + * + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + + /** + * + * + *
+   * Code to uniquely identify the warning type.
+   * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode code = 1; + * + * @return The code. + */ + com.google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode getCode(); + + /** + * + * + *
+   * The warning message.
+   * 
+ * + * string message = 2; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
+   * The warning message.
+   * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
+   * The region name for REGION_UNREACHABLE warning.
+   * 
+ * + * string region = 3; + * + * @return The region. + */ + java.lang.String getRegion(); + + /** + * + * + *
+   * The region name for REGION_UNREACHABLE warning.
+   * 
+ * + * string region = 3; + * + * @return The bytes for region. + */ + com.google.protobuf.ByteString getRegionBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AutoDnsStatus.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AutoDnsStatus.java new file mode 100644 index 000000000000..09d710df3b11 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AutoDnsStatus.java @@ -0,0 +1,216 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The status of automated DNS provisioning.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.AutoDnsStatus} + */ +@com.google.protobuf.Generated +public enum AutoDnsStatus implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified status. This means status is missing from dependency service.
+   * 
+ * + * AUTO_DNS_STATUS_UNSPECIFIED = 0; + */ + AUTO_DNS_STATUS_UNSPECIFIED(0), + /** + * + * + *
+   * DNS provisioning is OK.
+   * 
+ * + * AUTO_DNS_OK = 1; + */ + AUTO_DNS_OK(1), + /** + * + * + *
+   * DNS provisioning failed.
+   * 
+ * + * AUTO_DNS_FAILED = 2; + */ + AUTO_DNS_FAILED(2), + /** + * + * + *
+   * DNS provisioning status is not recognized by Cloud SQL.
+   * 
+ * + * AUTO_DNS_UNKNOWN = 3; + */ + AUTO_DNS_UNKNOWN(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AutoDnsStatus"); + } + + /** + * + * + *
+   * Unspecified status. This means status is missing from dependency service.
+   * 
+ * + * AUTO_DNS_STATUS_UNSPECIFIED = 0; + */ + public static final int AUTO_DNS_STATUS_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * DNS provisioning is OK.
+   * 
+ * + * AUTO_DNS_OK = 1; + */ + public static final int AUTO_DNS_OK_VALUE = 1; + + /** + * + * + *
+   * DNS provisioning failed.
+   * 
+ * + * AUTO_DNS_FAILED = 2; + */ + public static final int AUTO_DNS_FAILED_VALUE = 2; + + /** + * + * + *
+   * DNS provisioning status is not recognized by Cloud SQL.
+   * 
+ * + * AUTO_DNS_UNKNOWN = 3; + */ + public static final int AUTO_DNS_UNKNOWN_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 AutoDnsStatus 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 AutoDnsStatus forNumber(int value) { + switch (value) { + case 0: + return AUTO_DNS_STATUS_UNSPECIFIED; + case 1: + return AUTO_DNS_OK; + case 2: + return AUTO_DNS_FAILED; + case 3: + return AUTO_DNS_UNKNOWN; + 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 AutoDnsStatus findValueByNumber(int number) { + return AutoDnsStatus.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(2); + } + + private static final AutoDnsStatus[] VALUES = values(); + + public static AutoDnsStatus 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 AutoDnsStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.AutoDnsStatus) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AvailableDatabaseVersion.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AvailableDatabaseVersion.java new file mode 100644 index 000000000000..cac9d4500398 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AvailableDatabaseVersion.java @@ -0,0 +1,1098 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * An available database version. It can be a major or a minor version.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.AvailableDatabaseVersion} + */ +@com.google.protobuf.Generated +public final class AvailableDatabaseVersion extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.AvailableDatabaseVersion) + AvailableDatabaseVersionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AvailableDatabaseVersion"); + } + + // Use AvailableDatabaseVersion.newBuilder() to construct. + private AvailableDatabaseVersion(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AvailableDatabaseVersion() { + majorVersion_ = ""; + name_ = ""; + displayName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AvailableDatabaseVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AvailableDatabaseVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.class, + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.Builder.class); + } + + private int bitField0_; + public static final int MAJOR_VERSION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object majorVersion_ = ""; + + /** + * + * + *
+   * The version's major version name.
+   * 
+ * + * optional string major_version = 3; + * + * @return Whether the majorVersion field is set. + */ + @java.lang.Override + public boolean hasMajorVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The version's major version name.
+   * 
+ * + * optional string major_version = 3; + * + * @return The majorVersion. + */ + @java.lang.Override + public java.lang.String getMajorVersion() { + java.lang.Object ref = majorVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + majorVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * The version's major version name.
+   * 
+ * + * optional string major_version = 3; + * + * @return The bytes for majorVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMajorVersionBytes() { + java.lang.Object ref = majorVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + majorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The database version name. For MySQL 8.0, this string provides the database
+   * major and minor version.
+   * 
+ * + * optional string name = 8; + * + * @return Whether the name field is set. + */ + @java.lang.Override + public boolean hasName() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The database version name. For MySQL 8.0, this string provides the database
+   * major and minor version.
+   * 
+ * + * optional string name = 8; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The database version name. For MySQL 8.0, this string provides the database
+   * major and minor version.
+   * 
+ * + * optional string name = 8; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
+   * The database version's display name.
+   * 
+ * + * optional string display_name = 9; + * + * @return Whether the displayName field is set. + */ + @java.lang.Override + public boolean hasDisplayName() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The database version's display name.
+   * 
+ * + * optional string display_name = 9; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
+   * The database version's display name.
+   * 
+ * + * optional string display_name = 9; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, majorVersion_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, name_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, displayName_); + } + 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.GeneratedMessage.computeStringSize(3, majorVersion_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, name_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, displayName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.AvailableDatabaseVersion)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion other = + (com.google.cloud.sql.v1beta4.AvailableDatabaseVersion) obj; + + if (hasMajorVersion() != other.hasMajorVersion()) return false; + if (hasMajorVersion()) { + if (!getMajorVersion().equals(other.getMajorVersion())) return false; + } + if (hasName() != other.hasName()) return false; + if (hasName()) { + if (!getName().equals(other.getName())) return false; + } + if (hasDisplayName() != other.hasDisplayName()) return false; + if (hasDisplayName()) { + if (!getDisplayName().equals(other.getDisplayName())) return false; + } + if (!getUnknownFields().equals(other.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 (hasMajorVersion()) { + hash = (37 * hash) + MAJOR_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getMajorVersion().hashCode(); + } + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasDisplayName()) { + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.AvailableDatabaseVersion parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.AvailableDatabaseVersion parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AvailableDatabaseVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.AvailableDatabaseVersion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AvailableDatabaseVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.AvailableDatabaseVersion parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AvailableDatabaseVersion parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.AvailableDatabaseVersion parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AvailableDatabaseVersion parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.AvailableDatabaseVersion parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.AvailableDatabaseVersion parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.AvailableDatabaseVersion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * An available database version. It can be a major or a minor version.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.AvailableDatabaseVersion} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.AvailableDatabaseVersion) + com.google.cloud.sql.v1beta4.AvailableDatabaseVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AvailableDatabaseVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AvailableDatabaseVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.class, + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + majorVersion_ = ""; + name_ = ""; + displayName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_AvailableDatabaseVersion_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AvailableDatabaseVersion getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AvailableDatabaseVersion build() { + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AvailableDatabaseVersion buildPartial() { + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion result = + new com.google.cloud.sql.v1beta4.AvailableDatabaseVersion(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.AvailableDatabaseVersion result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.majorVersion_ = majorVersion_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.displayName_ = displayName_; + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.AvailableDatabaseVersion) { + return mergeFrom((com.google.cloud.sql.v1beta4.AvailableDatabaseVersion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.AvailableDatabaseVersion other) { + if (other == com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.getDefaultInstance()) + return this; + if (other.hasMajorVersion()) { + majorVersion_ = other.majorVersion_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasName()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasDisplayName()) { + displayName_ = other.displayName_; + 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 26: + { + majorVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 26 + case 66: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 66 + case 74: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object majorVersion_ = ""; + + /** + * + * + *
+     * The version's major version name.
+     * 
+ * + * optional string major_version = 3; + * + * @return Whether the majorVersion field is set. + */ + public boolean hasMajorVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The version's major version name.
+     * 
+ * + * optional string major_version = 3; + * + * @return The majorVersion. + */ + public java.lang.String getMajorVersion() { + java.lang.Object ref = majorVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + majorVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The version's major version name.
+     * 
+ * + * optional string major_version = 3; + * + * @return The bytes for majorVersion. + */ + public com.google.protobuf.ByteString getMajorVersionBytes() { + java.lang.Object ref = majorVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + majorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The version's major version name.
+     * 
+ * + * optional string major_version = 3; + * + * @param value The majorVersion to set. + * @return This builder for chaining. + */ + public Builder setMajorVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + majorVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The version's major version name.
+     * 
+ * + * optional string major_version = 3; + * + * @return This builder for chaining. + */ + public Builder clearMajorVersion() { + majorVersion_ = getDefaultInstance().getMajorVersion(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The version's major version name.
+     * 
+ * + * optional string major_version = 3; + * + * @param value The bytes for majorVersion to set. + * @return This builder for chaining. + */ + public Builder setMajorVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + majorVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The database version name. For MySQL 8.0, this string provides the database
+     * major and minor version.
+     * 
+ * + * optional string name = 8; + * + * @return Whether the name field is set. + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The database version name. For MySQL 8.0, this string provides the database
+     * major and minor version.
+     * 
+ * + * optional string name = 8; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The database version name. For MySQL 8.0, this string provides the database
+     * major and minor version.
+     * 
+ * + * optional string name = 8; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The database version name. For MySQL 8.0, this string provides the database
+     * major and minor version.
+     * 
+ * + * optional string name = 8; + * + * @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; + } + + /** + * + * + *
+     * The database version name. For MySQL 8.0, this string provides the database
+     * major and minor version.
+     * 
+ * + * optional string name = 8; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version name. For MySQL 8.0, this string provides the database
+     * major and minor version.
+     * 
+ * + * optional string name = 8; + * + * @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; + } + + private java.lang.Object displayName_ = ""; + + /** + * + * + *
+     * The database version's display name.
+     * 
+ * + * optional string display_name = 9; + * + * @return Whether the displayName field is set. + */ + public boolean hasDisplayName() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The database version's display name.
+     * 
+ * + * optional string display_name = 9; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The database version's display name.
+     * 
+ * + * optional string display_name = 9; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The database version's display name.
+     * 
+ * + * optional string display_name = 9; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version's display name.
+     * 
+ * + * optional string display_name = 9; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version's display name.
+     * 
+ * + * optional string display_name = 9; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.AvailableDatabaseVersion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.AvailableDatabaseVersion) + private static final com.google.cloud.sql.v1beta4.AvailableDatabaseVersion DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.AvailableDatabaseVersion(); + } + + public static com.google.cloud.sql.v1beta4.AvailableDatabaseVersion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AvailableDatabaseVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.AvailableDatabaseVersion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AvailableDatabaseVersionOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AvailableDatabaseVersionOrBuilder.java new file mode 100644 index 000000000000..1f22f499f419 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/AvailableDatabaseVersionOrBuilder.java @@ -0,0 +1,148 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface AvailableDatabaseVersionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.AvailableDatabaseVersion) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The version's major version name.
+   * 
+ * + * optional string major_version = 3; + * + * @return Whether the majorVersion field is set. + */ + boolean hasMajorVersion(); + + /** + * + * + *
+   * The version's major version name.
+   * 
+ * + * optional string major_version = 3; + * + * @return The majorVersion. + */ + java.lang.String getMajorVersion(); + + /** + * + * + *
+   * The version's major version name.
+   * 
+ * + * optional string major_version = 3; + * + * @return The bytes for majorVersion. + */ + com.google.protobuf.ByteString getMajorVersionBytes(); + + /** + * + * + *
+   * The database version name. For MySQL 8.0, this string provides the database
+   * major and minor version.
+   * 
+ * + * optional string name = 8; + * + * @return Whether the name field is set. + */ + boolean hasName(); + + /** + * + * + *
+   * The database version name. For MySQL 8.0, this string provides the database
+   * major and minor version.
+   * 
+ * + * optional string name = 8; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The database version name. For MySQL 8.0, this string provides the database
+   * major and minor version.
+   * 
+ * + * optional string name = 8; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The database version's display name.
+   * 
+ * + * optional string display_name = 9; + * + * @return Whether the displayName field is set. + */ + boolean hasDisplayName(); + + /** + * + * + *
+   * The database version's display name.
+   * 
+ * + * optional string display_name = 9; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
+   * The database version's display name.
+   * 
+ * + * optional string display_name = 9; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Backup.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Backup.java new file mode 100644 index 000000000000..b37c096b65df --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Backup.java @@ -0,0 +1,6132 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * A backup resource.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Backup} + */ +@com.google.protobuf.Generated +public final class Backup extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.Backup) + BackupOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Backup"); + } + + // Use Backup.newBuilder() to construct. + private Backup(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Backup() { + name_ = ""; + kind_ = ""; + selfLink_ = ""; + type_ = 0; + description_ = ""; + instance_ = ""; + location_ = ""; + state_ = 0; + kmsKey_ = ""; + kmsKeyVersion_ = ""; + backupKind_ = 0; + timeZone_ = ""; + databaseVersion_ = 0; + backupRun_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Backup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Backup.class, + com.google.cloud.sql.v1beta4.Backup.Builder.class); + } + + /** + * + * + *
+   * The backup type.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.Backup.SqlBackupType} + */ + public enum SqlBackupType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * This is an unknown backup type.
+     * 
+ * + * SQL_BACKUP_TYPE_UNSPECIFIED = 0; + */ + SQL_BACKUP_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The backup schedule triggers a backup automatically.
+     * 
+ * + * AUTOMATED = 1; + */ + AUTOMATED(1), + /** + * + * + *
+     * The user triggers a backup manually.
+     * 
+ * + * ON_DEMAND = 2; + */ + ON_DEMAND(2), + /** + * + * + *
+     * The backup that's created when the instance is deleted.
+     * 
+ * + * FINAL = 3; + */ + FINAL(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupType"); + } + + /** + * + * + *
+     * This is an unknown backup type.
+     * 
+ * + * SQL_BACKUP_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_BACKUP_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The backup schedule triggers a backup automatically.
+     * 
+ * + * AUTOMATED = 1; + */ + public static final int AUTOMATED_VALUE = 1; + + /** + * + * + *
+     * The user triggers a backup manually.
+     * 
+ * + * ON_DEMAND = 2; + */ + public static final int ON_DEMAND_VALUE = 2; + + /** + * + * + *
+     * The backup that's created when the instance is deleted.
+     * 
+ * + * FINAL = 3; + */ + public static final int FINAL_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 SqlBackupType 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 SqlBackupType forNumber(int value) { + switch (value) { + case 0: + return SQL_BACKUP_TYPE_UNSPECIFIED; + case 1: + return AUTOMATED; + case 2: + return ON_DEMAND; + case 3: + return FINAL; + 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 SqlBackupType findValueByNumber(int number) { + return SqlBackupType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.Backup.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlBackupType[] VALUES = values(); + + public static SqlBackupType 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 SqlBackupType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.Backup.SqlBackupType) + } + + /** + * + * + *
+   * The backup's state
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.Backup.SqlBackupState} + */ + public enum SqlBackupState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the backup is unknown.
+     * 
+ * + * SQL_BACKUP_STATE_UNSPECIFIED = 0; + */ + SQL_BACKUP_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The backup that's added to a queue.
+     * 
+ * + * ENQUEUED = 1; + */ + ENQUEUED(1), + /** + * + * + *
+     * The backup is in progress.
+     * 
+ * + * RUNNING = 2; + */ + RUNNING(2), + /** + * + * + *
+     * The backup failed.
+     * 
+ * + * FAILED = 3; + */ + FAILED(3), + /** + * + * + *
+     * The backup is successful.
+     * 
+ * + * SUCCESSFUL = 4; + */ + SUCCESSFUL(4), + /** + * + * + *
+     * The backup is being deleted.
+     * 
+ * + * DELETING = 5; + */ + DELETING(5), + /** + * + * + *
+     * Deletion of the backup failed.
+     * 
+ * + * DELETION_FAILED = 6; + */ + DELETION_FAILED(6), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupState"); + } + + /** + * + * + *
+     * The state of the backup is unknown.
+     * 
+ * + * SQL_BACKUP_STATE_UNSPECIFIED = 0; + */ + public static final int SQL_BACKUP_STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The backup that's added to a queue.
+     * 
+ * + * ENQUEUED = 1; + */ + public static final int ENQUEUED_VALUE = 1; + + /** + * + * + *
+     * The backup is in progress.
+     * 
+ * + * RUNNING = 2; + */ + public static final int RUNNING_VALUE = 2; + + /** + * + * + *
+     * The backup failed.
+     * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + + /** + * + * + *
+     * The backup is successful.
+     * 
+ * + * SUCCESSFUL = 4; + */ + public static final int SUCCESSFUL_VALUE = 4; + + /** + * + * + *
+     * The backup is being deleted.
+     * 
+ * + * DELETING = 5; + */ + public static final int DELETING_VALUE = 5; + + /** + * + * + *
+     * Deletion of the backup failed.
+     * 
+ * + * DELETION_FAILED = 6; + */ + public static final int DELETION_FAILED_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SqlBackupState 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 SqlBackupState forNumber(int value) { + switch (value) { + case 0: + return SQL_BACKUP_STATE_UNSPECIFIED; + case 1: + return ENQUEUED; + case 2: + return RUNNING; + case 3: + return FAILED; + case 4: + return SUCCESSFUL; + case 5: + return DELETING; + case 6: + return DELETION_FAILED; + 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 SqlBackupState findValueByNumber(int number) { + return SqlBackupState.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.Backup.getDescriptor().getEnumTypes().get(1); + } + + private static final SqlBackupState[] VALUES = values(); + + public static SqlBackupState 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 SqlBackupState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.Backup.SqlBackupState) + } + + private int bitField0_; + private int expirationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object expiration_; + + public enum ExpirationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TTL_DAYS(16), + EXPIRY_TIME(17), + EXPIRATION_NOT_SET(0); + private final int value; + + private ExpirationCase(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 ExpirationCase valueOf(int value) { + return forNumber(value); + } + + public static ExpirationCase forNumber(int value) { + switch (value) { + case 16: + return TTL_DAYS; + case 17: + return EXPIRY_TIME; + case 0: + return EXPIRATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Output only. The resource name of the backup.
+   * Format: projects/{project}/backups/{backup}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The resource name of the backup.
+   * Format: projects/{project}/backups/{backup}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * Output only. This is always `sql#backup`.
+   * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. This is always `sql#backup`.
+   * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELF_LINK_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object selfLink_ = ""; + + /** + * + * + *
+   * Output only. The URI of this resource.
+   * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The selfLink. + */ + @java.lang.Override + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The URI of this resource.
+   * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for selfLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 4; + private int type_ = 0; + + /** + * + * + *
+   * Output only. The type of this backup. The type can be "AUTOMATED",
+   * "ON_DEMAND", or “FINAL”.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * Output only. The type of this backup. The type can be "AUTOMATED",
+   * "ON_DEMAND", or “FINAL”.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Backup.SqlBackupType getType() { + com.google.cloud.sql.v1beta4.Backup.SqlBackupType result = + com.google.cloud.sql.v1beta4.Backup.SqlBackupType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1beta4.Backup.SqlBackupType.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * The description of this backup.
+   * 
+ * + * string description = 5; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + + /** + * + * + *
+   * The description of this backup.
+   * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * The name of the database instance.
+   * 
+ * + * string instance = 6; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the database instance.
+   * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + + /** + * + * + *
+   * The storage location of the backups. The location can be multi-regional.
+   * 
+ * + * string location = 7; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + + /** + * + * + *
+   * The storage location of the backups. The location can be multi-regional.
+   * 
+ * + * string location = 7; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_INTERVAL_FIELD_NUMBER = 8; + private com.google.type.Interval backupInterval_; + + /** + * + * + *
+   * Output only. This output contains the following values:
+   * start_time: All database writes up to this time are available.
+   * end_time: Any database writes after this time aren't available.
+   * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupInterval field is set. + */ + @java.lang.Override + public boolean hasBackupInterval() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. This output contains the following values:
+   * start_time: All database writes up to this time are available.
+   * end_time: Any database writes after this time aren't available.
+   * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupInterval. + */ + @java.lang.Override + public com.google.type.Interval getBackupInterval() { + return backupInterval_ == null + ? com.google.type.Interval.getDefaultInstance() + : backupInterval_; + } + + /** + * + * + *
+   * Output only. This output contains the following values:
+   * start_time: All database writes up to this time are available.
+   * end_time: Any database writes after this time aren't available.
+   * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.type.IntervalOrBuilder getBackupIntervalOrBuilder() { + return backupInterval_ == null + ? com.google.type.Interval.getDefaultInstance() + : backupInterval_; + } + + public static final int STATE_FIELD_NUMBER = 9; + private int state_ = 0; + + /** + * + * + *
+   * Output only. The state of this backup.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+   * Output only. The state of this backup.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Backup.SqlBackupState getState() { + com.google.cloud.sql.v1beta4.Backup.SqlBackupState result = + com.google.cloud.sql.v1beta4.Backup.SqlBackupState.forNumber(state_); + return result == null + ? com.google.cloud.sql.v1beta4.Backup.SqlBackupState.UNRECOGNIZED + : result; + } + + public static final int ERROR_FIELD_NUMBER = 10; + private com.google.cloud.sql.v1beta4.OperationError error_; + + /** + * + * + *
+   * Output only. Information about why the backup operation fails (for example,
+   * when the backup state fails).
+   * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. Information about why the backup operation fails (for example,
+   * when the backup state fails).
+   * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The error. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationError getError() { + return error_ == null + ? com.google.cloud.sql.v1beta4.OperationError.getDefaultInstance() + : error_; + } + + /** + * + * + *
+   * Output only. Information about why the backup operation fails (for example,
+   * when the backup state fails).
+   * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationErrorOrBuilder getErrorOrBuilder() { + return error_ == null + ? com.google.cloud.sql.v1beta4.OperationError.getDefaultInstance() + : error_; + } + + public static final int KMS_KEY_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKey_ = ""; + + /** + * + * + *
+   * Output only. This output contains the encryption configuration for a backup
+   * and the resource name of the KMS key for disk encryption.
+   * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsKey. + */ + @java.lang.Override + public java.lang.String getKmsKey() { + java.lang.Object ref = kmsKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKey_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. This output contains the encryption configuration for a backup
+   * and the resource name of the KMS key for disk encryption.
+   * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyBytes() { + java.lang.Object ref = kmsKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KMS_KEY_VERSION_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyVersion_ = ""; + + /** + * + * + *
+   * Output only. This output contains the encryption status for a backup and
+   * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+   * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsKeyVersion. + */ + @java.lang.Override + public java.lang.String getKmsKeyVersion() { + java.lang.Object ref = kmsKeyVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. This output contains the encryption status for a backup and
+   * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+   * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsKeyVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyVersionBytes() { + java.lang.Object ref = kmsKeyVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_KIND_FIELD_NUMBER = 13; + private int backupKind_ = 0; + + /** + * + * + *
+   * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for backupKind. + */ + @java.lang.Override + public int getBackupKindValue() { + return backupKind_; + } + + /** + * + * + *
+   * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupKind. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupKind getBackupKind() { + com.google.cloud.sql.v1beta4.SqlBackupKind result = + com.google.cloud.sql.v1beta4.SqlBackupKind.forNumber(backupKind_); + return result == null ? com.google.cloud.sql.v1beta4.SqlBackupKind.UNRECOGNIZED : result; + } + + public static final int TIME_ZONE_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object timeZone_ = ""; + + /** + * + * + *
+   * Output only. This output contains a backup time zone. If a Cloud SQL for
+   * SQL Server instance has a different time zone from the backup's time zone,
+   * then the restore to the instance doesn't happen.
+   * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The timeZone. + */ + @java.lang.Override + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. This output contains a backup time zone. If a Cloud SQL for
+   * SQL Server instance has a different time zone from the backup's time zone,
+   * then the restore to the instance doesn't happen.
+   * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for timeZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TTL_DAYS_FIELD_NUMBER = 16; + + /** + * + * + *
+   * Input only. The time-to-live (TTL) interval for this resource (in days).
+   * For example: ttlDays:7, means 7 days from the current time. The
+   * expiration time can't exceed 365 days from the time that the backup is
+   * created.
+   * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttlDays field is set. + */ + @java.lang.Override + public boolean hasTtlDays() { + return expirationCase_ == 16; + } + + /** + * + * + *
+   * Input only. The time-to-live (TTL) interval for this resource (in days).
+   * For example: ttlDays:7, means 7 days from the current time. The
+   * expiration time can't exceed 365 days from the time that the backup is
+   * created.
+   * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttlDays. + */ + @java.lang.Override + public long getTtlDays() { + if (expirationCase_ == 16) { + return (java.lang.Long) expiration_; + } + return 0L; + } + + public static final int EXPIRY_TIME_FIELD_NUMBER = 17; + + /** + * + * + *
+   * Backup expiration time.
+   * A UTC timestamp of when this resource expired.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + * + * @return Whether the expiryTime field is set. + */ + @java.lang.Override + public boolean hasExpiryTime() { + return expirationCase_ == 17; + } + + /** + * + * + *
+   * Backup expiration time.
+   * A UTC timestamp of when this resource expired.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + * + * @return The expiryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpiryTime() { + if (expirationCase_ == 17) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + /** + * + * + *
+   * Backup expiration time.
+   * A UTC timestamp of when this resource expired.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder() { + if (expirationCase_ == 17) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int DATABASE_VERSION_FIELD_NUMBER = 20; + private int databaseVersion_ = 0; + + /** + * + * + *
+   * Output only. The database version of the instance of at the time this
+   * backup was made.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+   * Output only. The database version of the instance of at the time this
+   * backup was made.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1beta4.SqlDatabaseVersion result = + com.google.cloud.sql.v1beta4.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1beta4.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + public static final int MAX_CHARGEABLE_BYTES_FIELD_NUMBER = 23; + private long maxChargeableBytes_ = 0L; + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maxChargeableBytes field is set. + */ + @java.lang.Override + public boolean hasMaxChargeableBytes() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maxChargeableBytes. + */ + @java.lang.Override + public long getMaxChargeableBytes() { + return maxChargeableBytes_; + } + + public static final int INSTANCE_DELETION_TIME_FIELD_NUMBER = 24; + private com.google.protobuf.Timestamp instanceDeletionTime_; + + /** + * + * + *
+   * Optional. Output only. Timestamp in UTC of when the instance associated
+   * with this backup is deleted.
+   * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceDeletionTime field is set. + */ + @java.lang.Override + public boolean hasInstanceDeletionTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. Output only. Timestamp in UTC of when the instance associated
+   * with this backup is deleted.
+   * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceDeletionTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getInstanceDeletionTime() { + return instanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : instanceDeletionTime_; + } + + /** + * + * + *
+   * Optional. Output only. Timestamp in UTC of when the instance associated
+   * with this backup is deleted.
+   * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getInstanceDeletionTimeOrBuilder() { + return instanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : instanceDeletionTime_; + } + + public static final int INSTANCE_SETTINGS_FIELD_NUMBER = 25; + private com.google.cloud.sql.v1beta4.DatabaseInstance instanceSettings_; + + /** + * + * + *
+   * Optional. Output only. Instance setting of the source instance that's
+   * associated with this backup.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceSettings field is set. + */ + @java.lang.Override + public boolean hasInstanceSettings() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Optional. Output only. Instance setting of the source instance that's
+   * associated with this backup.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceSettings. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance getInstanceSettings() { + return instanceSettings_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : instanceSettings_; + } + + /** + * + * + *
+   * Optional. Output only. Instance setting of the source instance that's
+   * associated with this backup.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getInstanceSettingsOrBuilder() { + return instanceSettings_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : instanceSettings_; + } + + public static final int BACKUP_RUN_FIELD_NUMBER = 26; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupRun_ = ""; + + /** + * + * + *
+   * Output only. The mapping to backup run resource used for IAM validations.
+   * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupRun. + */ + @java.lang.Override + public java.lang.String getBackupRun() { + java.lang.Object ref = backupRun_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupRun_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The mapping to backup run resource used for IAM validations.
+   * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupRun. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupRunBytes() { + java.lang.Object ref = backupRun_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupRun_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SATISFIES_PZS_FIELD_NUMBER = 27; + private com.google.protobuf.BoolValue satisfiesPzs_; + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzs() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSatisfiesPzs() { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + + public static final int SATISFIES_PZI_FIELD_NUMBER = 28; + private com.google.protobuf.BoolValue satisfiesPzi_; + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzi field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzi() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzi. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSatisfiesPzi() { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPziOrBuilder() { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, selfLink_); + } + if (type_ + != com.google.cloud.sql.v1beta4.Backup.SqlBackupType.SQL_BACKUP_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, location_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(8, getBackupInterval()); + } + if (state_ + != com.google.cloud.sql.v1beta4.Backup.SqlBackupState.SQL_BACKUP_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, state_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(10, getError()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kmsKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, kmsKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kmsKeyVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, kmsKeyVersion_); + } + if (backupKind_ + != com.google.cloud.sql.v1beta4.SqlBackupKind.SQL_BACKUP_KIND_UNSPECIFIED.getNumber()) { + output.writeEnum(13, backupKind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(timeZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 15, timeZone_); + } + if (expirationCase_ == 16) { + output.writeInt64(16, (long) ((java.lang.Long) expiration_)); + } + if (expirationCase_ == 17) { + output.writeMessage(17, (com.google.protobuf.Timestamp) expiration_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1beta4.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(20, databaseVersion_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt64(23, maxChargeableBytes_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(24, getInstanceDeletionTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(25, getInstanceSettings()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backupRun_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 26, backupRun_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(27, getSatisfiesPzs()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(28, getSatisfiesPzi()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, selfLink_); + } + if (type_ + != com.google.cloud.sql.v1beta4.Backup.SqlBackupType.SQL_BACKUP_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, location_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getBackupInterval()); + } + if (state_ + != com.google.cloud.sql.v1beta4.Backup.SqlBackupState.SQL_BACKUP_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, state_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getError()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kmsKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, kmsKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kmsKeyVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, kmsKeyVersion_); + } + if (backupKind_ + != com.google.cloud.sql.v1beta4.SqlBackupKind.SQL_BACKUP_KIND_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, backupKind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(timeZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(15, timeZone_); + } + if (expirationCase_ == 16) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 16, (long) ((java.lang.Long) expiration_)); + } + if (expirationCase_ == 17) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 17, (com.google.protobuf.Timestamp) expiration_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1beta4.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(20, databaseVersion_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(23, maxChargeableBytes_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(24, getInstanceDeletionTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, getInstanceSettings()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backupRun_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(26, backupRun_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(27, getSatisfiesPzs()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(28, getSatisfiesPzi()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.Backup)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.Backup other = (com.google.cloud.sql.v1beta4.Backup) obj; + + if (!getName().equals(other.getName())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getSelfLink().equals(other.getSelfLink())) return false; + if (type_ != other.type_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (hasBackupInterval() != other.hasBackupInterval()) return false; + if (hasBackupInterval()) { + if (!getBackupInterval().equals(other.getBackupInterval())) return false; + } + if (state_ != other.state_) return false; + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (!getKmsKey().equals(other.getKmsKey())) return false; + if (!getKmsKeyVersion().equals(other.getKmsKeyVersion())) return false; + if (backupKind_ != other.backupKind_) return false; + if (!getTimeZone().equals(other.getTimeZone())) return false; + if (databaseVersion_ != other.databaseVersion_) return false; + if (hasMaxChargeableBytes() != other.hasMaxChargeableBytes()) return false; + if (hasMaxChargeableBytes()) { + if (getMaxChargeableBytes() != other.getMaxChargeableBytes()) return false; + } + if (hasInstanceDeletionTime() != other.hasInstanceDeletionTime()) return false; + if (hasInstanceDeletionTime()) { + if (!getInstanceDeletionTime().equals(other.getInstanceDeletionTime())) return false; + } + if (hasInstanceSettings() != other.hasInstanceSettings()) return false; + if (hasInstanceSettings()) { + if (!getInstanceSettings().equals(other.getInstanceSettings())) return false; + } + if (!getBackupRun().equals(other.getBackupRun())) return false; + if (hasSatisfiesPzs() != other.hasSatisfiesPzs()) return false; + if (hasSatisfiesPzs()) { + if (!getSatisfiesPzs().equals(other.getSatisfiesPzs())) return false; + } + if (hasSatisfiesPzi() != other.hasSatisfiesPzi()) return false; + if (hasSatisfiesPzi()) { + if (!getSatisfiesPzi().equals(other.getSatisfiesPzi())) return false; + } + if (!getExpirationCase().equals(other.getExpirationCase())) return false; + switch (expirationCase_) { + case 16: + if (getTtlDays() != other.getTtlDays()) return false; + break; + case 17: + if (!getExpiryTime().equals(other.getExpiryTime())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + SELF_LINK_FIELD_NUMBER; + hash = (53 * hash) + getSelfLink().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + if (hasBackupInterval()) { + hash = (37 * hash) + BACKUP_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getBackupInterval().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (37 * hash) + KMS_KEY_FIELD_NUMBER; + hash = (53 * hash) + getKmsKey().hashCode(); + hash = (37 * hash) + KMS_KEY_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyVersion().hashCode(); + hash = (37 * hash) + BACKUP_KIND_FIELD_NUMBER; + hash = (53 * hash) + backupKind_; + hash = (37 * hash) + TIME_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getTimeZone().hashCode(); + hash = (37 * hash) + DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + databaseVersion_; + if (hasMaxChargeableBytes()) { + hash = (37 * hash) + MAX_CHARGEABLE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxChargeableBytes()); + } + if (hasInstanceDeletionTime()) { + hash = (37 * hash) + INSTANCE_DELETION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getInstanceDeletionTime().hashCode(); + } + if (hasInstanceSettings()) { + hash = (37 * hash) + INSTANCE_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getInstanceSettings().hashCode(); + } + hash = (37 * hash) + BACKUP_RUN_FIELD_NUMBER; + hash = (53 * hash) + getBackupRun().hashCode(); + if (hasSatisfiesPzs()) { + hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; + hash = (53 * hash) + getSatisfiesPzs().hashCode(); + } + if (hasSatisfiesPzi()) { + hash = (37 * hash) + SATISFIES_PZI_FIELD_NUMBER; + hash = (53 * hash) + getSatisfiesPzi().hashCode(); + } + switch (expirationCase_) { + case 16: + hash = (37 * hash) + TTL_DAYS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTtlDays()); + break; + case 17: + hash = (37 * hash) + EXPIRY_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpiryTime().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.Backup parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Backup parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Backup parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Backup parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Backup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Backup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Backup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Backup parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Backup parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Backup parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Backup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Backup parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.Backup prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A backup resource.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Backup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.Backup) + com.google.cloud.sql.v1beta4.BackupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Backup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Backup.class, + com.google.cloud.sql.v1beta4.Backup.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.Backup.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackupIntervalFieldBuilder(); + internalGetErrorFieldBuilder(); + internalGetInstanceDeletionTimeFieldBuilder(); + internalGetInstanceSettingsFieldBuilder(); + internalGetSatisfiesPzsFieldBuilder(); + internalGetSatisfiesPziFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + kind_ = ""; + selfLink_ = ""; + type_ = 0; + description_ = ""; + instance_ = ""; + location_ = ""; + backupInterval_ = null; + if (backupIntervalBuilder_ != null) { + backupIntervalBuilder_.dispose(); + backupIntervalBuilder_ = null; + } + state_ = 0; + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + kmsKey_ = ""; + kmsKeyVersion_ = ""; + backupKind_ = 0; + timeZone_ = ""; + if (expiryTimeBuilder_ != null) { + expiryTimeBuilder_.clear(); + } + databaseVersion_ = 0; + maxChargeableBytes_ = 0L; + instanceDeletionTime_ = null; + if (instanceDeletionTimeBuilder_ != null) { + instanceDeletionTimeBuilder_.dispose(); + instanceDeletionTimeBuilder_ = null; + } + instanceSettings_ = null; + if (instanceSettingsBuilder_ != null) { + instanceSettingsBuilder_.dispose(); + instanceSettingsBuilder_ = null; + } + backupRun_ = ""; + satisfiesPzs_ = null; + if (satisfiesPzsBuilder_ != null) { + satisfiesPzsBuilder_.dispose(); + satisfiesPzsBuilder_ = null; + } + satisfiesPzi_ = null; + if (satisfiesPziBuilder_ != null) { + satisfiesPziBuilder_.dispose(); + satisfiesPziBuilder_ = null; + } + expirationCase_ = 0; + expiration_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Backup_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Backup getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.Backup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Backup build() { + com.google.cloud.sql.v1beta4.Backup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Backup buildPartial() { + com.google.cloud.sql.v1beta4.Backup result = new com.google.cloud.sql.v1beta4.Backup(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.Backup result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.selfLink_ = selfLink_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.location_ = location_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000080) != 0)) { + result.backupInterval_ = + backupIntervalBuilder_ == null ? backupInterval_ : backupIntervalBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.kmsKey_ = kmsKey_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.kmsKeyVersion_ = kmsKeyVersion_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.backupKind_ = backupKind_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.timeZone_ = timeZone_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.databaseVersion_ = databaseVersion_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.maxChargeableBytes_ = maxChargeableBytes_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.instanceDeletionTime_ = + instanceDeletionTimeBuilder_ == null + ? instanceDeletionTime_ + : instanceDeletionTimeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.instanceSettings_ = + instanceSettingsBuilder_ == null ? instanceSettings_ : instanceSettingsBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.backupRun_ = backupRun_; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.satisfiesPzs_ = + satisfiesPzsBuilder_ == null ? satisfiesPzs_ : satisfiesPzsBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.satisfiesPzi_ = + satisfiesPziBuilder_ == null ? satisfiesPzi_ : satisfiesPziBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.sql.v1beta4.Backup result) { + result.expirationCase_ = expirationCase_; + result.expiration_ = this.expiration_; + if (expirationCase_ == 17 && expiryTimeBuilder_ != null) { + result.expiration_ = expiryTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.Backup) { + return mergeFrom((com.google.cloud.sql.v1beta4.Backup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.Backup other) { + if (other == com.google.cloud.sql.v1beta4.Backup.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSelfLink().isEmpty()) { + selfLink_ = other.selfLink_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasBackupInterval()) { + mergeBackupInterval(other.getBackupInterval()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (!other.getKmsKey().isEmpty()) { + kmsKey_ = other.kmsKey_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (!other.getKmsKeyVersion().isEmpty()) { + kmsKeyVersion_ = other.kmsKeyVersion_; + bitField0_ |= 0x00000800; + onChanged(); + } + if (other.backupKind_ != 0) { + setBackupKindValue(other.getBackupKindValue()); + } + if (!other.getTimeZone().isEmpty()) { + timeZone_ = other.timeZone_; + bitField0_ |= 0x00002000; + onChanged(); + } + if (other.databaseVersion_ != 0) { + setDatabaseVersionValue(other.getDatabaseVersionValue()); + } + if (other.hasMaxChargeableBytes()) { + setMaxChargeableBytes(other.getMaxChargeableBytes()); + } + if (other.hasInstanceDeletionTime()) { + mergeInstanceDeletionTime(other.getInstanceDeletionTime()); + } + if (other.hasInstanceSettings()) { + mergeInstanceSettings(other.getInstanceSettings()); + } + if (!other.getBackupRun().isEmpty()) { + backupRun_ = other.backupRun_; + bitField0_ |= 0x00100000; + onChanged(); + } + if (other.hasSatisfiesPzs()) { + mergeSatisfiesPzs(other.getSatisfiesPzs()); + } + if (other.hasSatisfiesPzi()) { + mergeSatisfiesPzi(other.getSatisfiesPzi()); + } + switch (other.getExpirationCase()) { + case TTL_DAYS: + { + setTtlDays(other.getTtlDays()); + break; + } + case EXPIRY_TIME: + { + mergeExpiryTime(other.getExpiryTime()); + break; + } + case EXPIRATION_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_ |= 0x00000001; + break; + } // case 10 + case 18: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + selfLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage( + internalGetBackupIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 82: + { + input.readMessage(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + kmsKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + kmsKeyVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 104: + { + backupKind_ = input.readEnum(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 122: + { + timeZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00002000; + break; + } // case 122 + case 128: + { + expiration_ = input.readInt64(); + expirationCase_ = 16; + break; + } // case 128 + case 138: + { + input.readMessage( + internalGetExpiryTimeFieldBuilder().getBuilder(), extensionRegistry); + expirationCase_ = 17; + break; + } // case 138 + case 160: + { + databaseVersion_ = input.readEnum(); + bitField0_ |= 0x00010000; + break; + } // case 160 + case 184: + { + maxChargeableBytes_ = input.readInt64(); + bitField0_ |= 0x00020000; + break; + } // case 184 + case 194: + { + input.readMessage( + internalGetInstanceDeletionTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 194 + case 202: + { + input.readMessage( + internalGetInstanceSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 202 + case 210: + { + backupRun_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00100000; + break; + } // case 210 + case 218: + { + input.readMessage( + internalGetSatisfiesPzsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00200000; + break; + } // case 218 + case 226: + { + input.readMessage( + internalGetSatisfiesPziFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00400000; + break; + } // case 226 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int expirationCase_ = 0; + private java.lang.Object expiration_; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public Builder clearExpiration() { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. The resource name of the backup.
+     * Format: projects/{project}/backups/{backup}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The resource name of the backup.
+     * Format: projects/{project}/backups/{backup}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The resource name of the backup.
+     * Format: projects/{project}/backups/{backup}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource name of the backup.
+     * Format: projects/{project}/backups/{backup}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource name of the backup.
+     * Format: projects/{project}/backups/{backup}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * Output only. This is always `sql#backup`.
+     * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. This is always `sql#backup`.
+     * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. This is always `sql#backup`.
+     * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This is always `sql#backup`.
+     * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This is always `sql#backup`.
+     * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object selfLink_ = ""; + + /** + * + * + *
+     * Output only. The URI of this resource.
+     * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The selfLink. + */ + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The URI of this resource.
+     * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for selfLink. + */ + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The URI of this resource.
+     * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selfLink_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The URI of this resource.
+     * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSelfLink() { + selfLink_ = getDefaultInstance().getSelfLink(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The URI of this resource.
+     * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selfLink_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int type_ = 0; + + /** + * + * + *
+     * Output only. The type of this backup. The type can be "AUTOMATED",
+     * "ON_DEMAND", or “FINAL”.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * Output only. The type of this backup. The type can be "AUTOMATED",
+     * "ON_DEMAND", or “FINAL”.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The type of this backup. The type can be "AUTOMATED",
+     * "ON_DEMAND", or “FINAL”.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Backup.SqlBackupType getType() { + com.google.cloud.sql.v1beta4.Backup.SqlBackupType result = + com.google.cloud.sql.v1beta4.Backup.SqlBackupType.forNumber(type_); + return result == null + ? com.google.cloud.sql.v1beta4.Backup.SqlBackupType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. The type of this backup. The type can be "AUTOMATED",
+     * "ON_DEMAND", or “FINAL”.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.sql.v1beta4.Backup.SqlBackupType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The type of this backup. The type can be "AUTOMATED",
+     * "ON_DEMAND", or “FINAL”.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000008); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * The description of this backup.
+     * 
+ * + * string description = 5; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The description of this backup.
+     * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The description of this backup.
+     * 
+ * + * string description = 5; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The description of this backup.
+     * 
+ * + * string description = 5; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * The description of this backup.
+     * 
+ * + * string description = 5; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * The name of the database instance.
+     * 
+ * + * string instance = 6; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the database instance.
+     * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the database instance.
+     * 
+ * + * string instance = 6; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the database instance.
+     * 
+ * + * string instance = 6; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the database instance.
+     * 
+ * + * string instance = 6; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object location_ = ""; + + /** + * + * + *
+     * The storage location of the backups. The location can be multi-regional.
+     * 
+ * + * string location = 7; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The storage location of the backups. The location can be multi-regional.
+     * 
+ * + * string location = 7; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The storage location of the backups. The location can be multi-regional.
+     * 
+ * + * string location = 7; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The storage location of the backups. The location can be multi-regional.
+     * 
+ * + * string location = 7; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * The storage location of the backups. The location can be multi-regional.
+     * 
+ * + * string location = 7; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.type.Interval backupInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + backupIntervalBuilder_; + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupInterval field is set. + */ + public boolean hasBackupInterval() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupInterval. + */ + public com.google.type.Interval getBackupInterval() { + if (backupIntervalBuilder_ == null) { + return backupInterval_ == null + ? com.google.type.Interval.getDefaultInstance() + : backupInterval_; + } else { + return backupIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBackupInterval(com.google.type.Interval value) { + if (backupIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupInterval_ = value; + } else { + backupIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBackupInterval(com.google.type.Interval.Builder builderForValue) { + if (backupIntervalBuilder_ == null) { + backupInterval_ = builderForValue.build(); + } else { + backupIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeBackupInterval(com.google.type.Interval value) { + if (backupIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && backupInterval_ != null + && backupInterval_ != com.google.type.Interval.getDefaultInstance()) { + getBackupIntervalBuilder().mergeFrom(value); + } else { + backupInterval_ = value; + } + } else { + backupIntervalBuilder_.mergeFrom(value); + } + if (backupInterval_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearBackupInterval() { + bitField0_ = (bitField0_ & ~0x00000080); + backupInterval_ = null; + if (backupIntervalBuilder_ != null) { + backupIntervalBuilder_.dispose(); + backupIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.type.Interval.Builder getBackupIntervalBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetBackupIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.type.IntervalOrBuilder getBackupIntervalOrBuilder() { + if (backupIntervalBuilder_ != null) { + return backupIntervalBuilder_.getMessageOrBuilder(); + } else { + return backupInterval_ == null + ? com.google.type.Interval.getDefaultInstance() + : backupInterval_; + } + } + + /** + * + * + *
+     * Output only. This output contains the following values:
+     * start_time: All database writes up to this time are available.
+     * end_time: Any database writes after this time aren't available.
+     * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + internalGetBackupIntervalFieldBuilder() { + if (backupIntervalBuilder_ == null) { + backupIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder>( + getBackupInterval(), getParentForChildren(), isClean()); + backupInterval_ = null; + } + return backupIntervalBuilder_; + } + + private int state_ = 0; + + /** + * + * + *
+     * Output only. The state of this backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+     * Output only. The state of this backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupState state = 9 [(.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_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The state of this backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Backup.SqlBackupState getState() { + com.google.cloud.sql.v1beta4.Backup.SqlBackupState result = + com.google.cloud.sql.v1beta4.Backup.SqlBackupState.forNumber(state_); + return result == null + ? com.google.cloud.sql.v1beta4.Backup.SqlBackupState.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. The state of this backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.sql.v1beta4.Backup.SqlBackupState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The state of this backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000100); + state_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.OperationError error_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.OperationError, + com.google.cloud.sql.v1beta4.OperationError.Builder, + com.google.cloud.sql.v1beta4.OperationErrorOrBuilder> + errorBuilder_; + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The error. + */ + public com.google.cloud.sql.v1beta4.OperationError getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.cloud.sql.v1beta4.OperationError.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setError(com.google.cloud.sql.v1beta4.OperationError value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setError(com.google.cloud.sql.v1beta4.OperationError.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeError(com.google.cloud.sql.v1beta4.OperationError value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && error_ != null + && error_ != com.google.cloud.sql.v1beta4.OperationError.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000200); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.OperationError.Builder getErrorBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.OperationErrorOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.cloud.sql.v1beta4.OperationError.getDefaultInstance() + : error_; + } + } + + /** + * + * + *
+     * Output only. Information about why the backup operation fails (for example,
+     * when the backup state fails).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.OperationError, + com.google.cloud.sql.v1beta4.OperationError.Builder, + com.google.cloud.sql.v1beta4.OperationErrorOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.OperationError, + com.google.cloud.sql.v1beta4.OperationError.Builder, + com.google.cloud.sql.v1beta4.OperationErrorOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + private java.lang.Object kmsKey_ = ""; + + /** + * + * + *
+     * Output only. This output contains the encryption configuration for a backup
+     * and the resource name of the KMS key for disk encryption.
+     * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsKey. + */ + public java.lang.String getKmsKey() { + java.lang.Object ref = kmsKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. This output contains the encryption configuration for a backup
+     * and the resource name of the KMS key for disk encryption.
+     * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsKey. + */ + public com.google.protobuf.ByteString getKmsKeyBytes() { + java.lang.Object ref = kmsKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. This output contains the encryption configuration for a backup
+     * and the resource name of the KMS key for disk encryption.
+     * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The kmsKey to set. + * @return This builder for chaining. + */ + public Builder setKmsKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKey_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains the encryption configuration for a backup
+     * and the resource name of the KMS key for disk encryption.
+     * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearKmsKey() { + kmsKey_ = getDefaultInstance().getKmsKey(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains the encryption configuration for a backup
+     * and the resource name of the KMS key for disk encryption.
+     * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for kmsKey to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKey_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object kmsKeyVersion_ = ""; + + /** + * + * + *
+     * Output only. This output contains the encryption status for a backup and
+     * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+     * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsKeyVersion. + */ + public java.lang.String getKmsKeyVersion() { + java.lang.Object ref = kmsKeyVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. This output contains the encryption status for a backup and
+     * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+     * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsKeyVersion. + */ + public com.google.protobuf.ByteString getKmsKeyVersionBytes() { + java.lang.Object ref = kmsKeyVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. This output contains the encryption status for a backup and
+     * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+     * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The kmsKeyVersion to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyVersion_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains the encryption status for a backup and
+     * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+     * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyVersion() { + kmsKeyVersion_ = getDefaultInstance().getKmsKeyVersion(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains the encryption status for a backup and
+     * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+     * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for kmsKeyVersion to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyVersion_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private int backupKind_ = 0; + + /** + * + * + *
+     * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for backupKind. + */ + @java.lang.Override + public int getBackupKindValue() { + return backupKind_; + } + + /** + * + * + *
+     * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for backupKind to set. + * @return This builder for chaining. + */ + public Builder setBackupKindValue(int value) { + backupKind_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupKind. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupKind getBackupKind() { + com.google.cloud.sql.v1beta4.SqlBackupKind result = + com.google.cloud.sql.v1beta4.SqlBackupKind.forNumber(backupKind_); + return result == null ? com.google.cloud.sql.v1beta4.SqlBackupKind.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The backupKind to set. + * @return This builder for chaining. + */ + public Builder setBackupKind(com.google.cloud.sql.v1beta4.SqlBackupKind value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00001000; + backupKind_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearBackupKind() { + bitField0_ = (bitField0_ & ~0x00001000); + backupKind_ = 0; + onChanged(); + return this; + } + + private java.lang.Object timeZone_ = ""; + + /** + * + * + *
+     * Output only. This output contains a backup time zone. If a Cloud SQL for
+     * SQL Server instance has a different time zone from the backup's time zone,
+     * then the restore to the instance doesn't happen.
+     * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The timeZone. + */ + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. This output contains a backup time zone. If a Cloud SQL for
+     * SQL Server instance has a different time zone from the backup's time zone,
+     * then the restore to the instance doesn't happen.
+     * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for timeZone. + */ + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. This output contains a backup time zone. If a Cloud SQL for
+     * SQL Server instance has a different time zone from the backup's time zone,
+     * then the restore to the instance doesn't happen.
+     * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + timeZone_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains a backup time zone. If a Cloud SQL for
+     * SQL Server instance has a different time zone from the backup's time zone,
+     * then the restore to the instance doesn't happen.
+     * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTimeZone() { + timeZone_ = getDefaultInstance().getTimeZone(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This output contains a backup time zone. If a Cloud SQL for
+     * SQL Server instance has a different time zone from the backup's time zone,
+     * then the restore to the instance doesn't happen.
+     * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + timeZone_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. The time-to-live (TTL) interval for this resource (in days).
+     * For example: ttlDays:7, means 7 days from the current time. The
+     * expiration time can't exceed 365 days from the time that the backup is
+     * created.
+     * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttlDays field is set. + */ + public boolean hasTtlDays() { + return expirationCase_ == 16; + } + + /** + * + * + *
+     * Input only. The time-to-live (TTL) interval for this resource (in days).
+     * For example: ttlDays:7, means 7 days from the current time. The
+     * expiration time can't exceed 365 days from the time that the backup is
+     * created.
+     * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttlDays. + */ + public long getTtlDays() { + if (expirationCase_ == 16) { + return (java.lang.Long) expiration_; + } + return 0L; + } + + /** + * + * + *
+     * Input only. The time-to-live (TTL) interval for this resource (in days).
+     * For example: ttlDays:7, means 7 days from the current time. The
+     * expiration time can't exceed 365 days from the time that the backup is
+     * created.
+     * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param value The ttlDays to set. + * @return This builder for chaining. + */ + public Builder setTtlDays(long value) { + + expirationCase_ = 16; + expiration_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. The time-to-live (TTL) interval for this resource (in days).
+     * For example: ttlDays:7, means 7 days from the current time. The
+     * expiration time can't exceed 365 days from the time that the backup is
+     * created.
+     * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTtlDays() { + if (expirationCase_ == 16) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expiryTimeBuilder_; + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this resource expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + * + * @return Whether the expiryTime field is set. + */ + @java.lang.Override + public boolean hasExpiryTime() { + return expirationCase_ == 17; + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this resource expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + * + * @return The expiryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpiryTime() { + if (expiryTimeBuilder_ == null) { + if (expirationCase_ == 17) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (expirationCase_ == 17) { + return expiryTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this resource expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + public Builder setExpiryTime(com.google.protobuf.Timestamp value) { + if (expiryTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + expiryTimeBuilder_.setMessage(value); + } + expirationCase_ = 17; + return this; + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this resource expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + public Builder setExpiryTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expiryTimeBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + expiryTimeBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 17; + return this; + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this resource expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + public Builder mergeExpiryTime(com.google.protobuf.Timestamp value) { + if (expiryTimeBuilder_ == null) { + if (expirationCase_ == 17 + && expiration_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 17) { + expiryTimeBuilder_.mergeFrom(value); + } else { + expiryTimeBuilder_.setMessage(value); + } + } + expirationCase_ = 17; + return this; + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this resource expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + public Builder clearExpiryTime() { + if (expiryTimeBuilder_ == null) { + if (expirationCase_ == 17) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 17) { + expirationCase_ = 0; + expiration_ = null; + } + expiryTimeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this resource expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + public com.google.protobuf.Timestamp.Builder getExpiryTimeBuilder() { + return internalGetExpiryTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this resource expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder() { + if ((expirationCase_ == 17) && (expiryTimeBuilder_ != null)) { + return expiryTimeBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 17) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Backup expiration time.
+     * A UTC timestamp of when this resource expired.
+     * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExpiryTimeFieldBuilder() { + if (expiryTimeBuilder_ == null) { + if (!(expirationCase_ == 17)) { + expiration_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + expiryTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 17; + onChanged(); + return expiryTimeBuilder_; + } + + private int databaseVersion_ = 0; + + /** + * + * + *
+     * Output only. The database version of the instance of at the time this
+     * backup was made.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+     * Output only. The database version of the instance of at the time this
+     * backup was made.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersionValue(int value) { + databaseVersion_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The database version of the instance of at the time this
+     * backup was made.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1beta4.SqlDatabaseVersion result = + com.google.cloud.sql.v1beta4.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1beta4.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The database version of the instance of at the time this
+     * backup was made.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersion(com.google.cloud.sql.v1beta4.SqlDatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00010000; + databaseVersion_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The database version of the instance of at the time this
+     * backup was made.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDatabaseVersion() { + bitField0_ = (bitField0_ & ~0x00010000); + databaseVersion_ = 0; + onChanged(); + return this; + } + + private long maxChargeableBytes_; + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maxChargeableBytes field is set. + */ + @java.lang.Override + public boolean hasMaxChargeableBytes() { + return ((bitField0_ & 0x00020000) != 0); + } + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maxChargeableBytes. + */ + @java.lang.Override + public long getMaxChargeableBytes() { + return maxChargeableBytes_; + } + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The maxChargeableBytes to set. + * @return This builder for chaining. + */ + public Builder setMaxChargeableBytes(long value) { + + maxChargeableBytes_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearMaxChargeableBytes() { + bitField0_ = (bitField0_ & ~0x00020000); + maxChargeableBytes_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp instanceDeletionTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + instanceDeletionTimeBuilder_; + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceDeletionTime field is set. + */ + public boolean hasInstanceDeletionTime() { + return ((bitField0_ & 0x00040000) != 0); + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceDeletionTime. + */ + public com.google.protobuf.Timestamp getInstanceDeletionTime() { + if (instanceDeletionTimeBuilder_ == null) { + return instanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : instanceDeletionTime_; + } else { + return instanceDeletionTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setInstanceDeletionTime(com.google.protobuf.Timestamp value) { + if (instanceDeletionTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instanceDeletionTime_ = value; + } else { + instanceDeletionTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setInstanceDeletionTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (instanceDeletionTimeBuilder_ == null) { + instanceDeletionTime_ = builderForValue.build(); + } else { + instanceDeletionTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeInstanceDeletionTime(com.google.protobuf.Timestamp value) { + if (instanceDeletionTimeBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) + && instanceDeletionTime_ != null + && instanceDeletionTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getInstanceDeletionTimeBuilder().mergeFrom(value); + } else { + instanceDeletionTime_ = value; + } + } else { + instanceDeletionTimeBuilder_.mergeFrom(value); + } + if (instanceDeletionTime_ != null) { + bitField0_ |= 0x00040000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearInstanceDeletionTime() { + bitField0_ = (bitField0_ & ~0x00040000); + instanceDeletionTime_ = null; + if (instanceDeletionTimeBuilder_ != null) { + instanceDeletionTimeBuilder_.dispose(); + instanceDeletionTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getInstanceDeletionTimeBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return internalGetInstanceDeletionTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getInstanceDeletionTimeOrBuilder() { + if (instanceDeletionTimeBuilder_ != null) { + return instanceDeletionTimeBuilder_.getMessageOrBuilder(); + } else { + return instanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : instanceDeletionTime_; + } + } + + /** + * + * + *
+     * Optional. Output only. Timestamp in UTC of when the instance associated
+     * with this backup is deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetInstanceDeletionTimeFieldBuilder() { + if (instanceDeletionTimeBuilder_ == null) { + instanceDeletionTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getInstanceDeletionTime(), getParentForChildren(), isClean()); + instanceDeletionTime_ = null; + } + return instanceDeletionTimeBuilder_; + } + + private com.google.cloud.sql.v1beta4.DatabaseInstance instanceSettings_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder> + instanceSettingsBuilder_; + + /** + * + * + *
+     * Optional. Output only. Instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceSettings field is set. + */ + public boolean hasInstanceSettings() { + return ((bitField0_ & 0x00080000) != 0); + } + + /** + * + * + *
+     * Optional. Output only. Instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceSettings. + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance getInstanceSettings() { + if (instanceSettingsBuilder_ == null) { + return instanceSettings_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : instanceSettings_; + } else { + return instanceSettingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Output only. Instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setInstanceSettings(com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (instanceSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instanceSettings_ = value; + } else { + instanceSettingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. Instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setInstanceSettings( + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder builderForValue) { + if (instanceSettingsBuilder_ == null) { + instanceSettings_ = builderForValue.build(); + } else { + instanceSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. Instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeInstanceSettings(com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (instanceSettingsBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0) + && instanceSettings_ != null + && instanceSettings_ + != com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance()) { + getInstanceSettingsBuilder().mergeFrom(value); + } else { + instanceSettings_ = value; + } + } else { + instanceSettingsBuilder_.mergeFrom(value); + } + if (instanceSettings_ != null) { + bitField0_ |= 0x00080000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Output only. Instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearInstanceSettings() { + bitField0_ = (bitField0_ & ~0x00080000); + instanceSettings_ = null; + if (instanceSettingsBuilder_ != null) { + instanceSettingsBuilder_.dispose(); + instanceSettingsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. Instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.Builder getInstanceSettingsBuilder() { + bitField0_ |= 0x00080000; + onChanged(); + return internalGetInstanceSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Output only. Instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getInstanceSettingsOrBuilder() { + if (instanceSettingsBuilder_ != null) { + return instanceSettingsBuilder_.getMessageOrBuilder(); + } else { + return instanceSettings_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : instanceSettings_; + } + } + + /** + * + * + *
+     * Optional. Output only. Instance setting of the source instance that's
+     * associated with this backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder> + internalGetInstanceSettingsFieldBuilder() { + if (instanceSettingsBuilder_ == null) { + instanceSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder>( + getInstanceSettings(), getParentForChildren(), isClean()); + instanceSettings_ = null; + } + return instanceSettingsBuilder_; + } + + private java.lang.Object backupRun_ = ""; + + /** + * + * + *
+     * Output only. The mapping to backup run resource used for IAM validations.
+     * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupRun. + */ + public java.lang.String getBackupRun() { + java.lang.Object ref = backupRun_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupRun_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The mapping to backup run resource used for IAM validations.
+     * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupRun. + */ + public com.google.protobuf.ByteString getBackupRunBytes() { + java.lang.Object ref = backupRun_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupRun_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The mapping to backup run resource used for IAM validations.
+     * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The backupRun to set. + * @return This builder for chaining. + */ + public Builder setBackupRun(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupRun_ = value; + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The mapping to backup run resource used for IAM validations.
+     * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearBackupRun() { + backupRun_ = getDefaultInstance().getBackupRun(); + bitField0_ = (bitField0_ & ~0x00100000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The mapping to backup run resource used for IAM validations.
+     * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for backupRun to set. + * @return This builder for chaining. + */ + public Builder setBackupRunBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupRun_ = value; + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue satisfiesPzs_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + satisfiesPzsBuilder_; + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + public boolean hasSatisfiesPzs() { + return ((bitField0_ & 0x00200000) != 0); + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + public com.google.protobuf.BoolValue getSatisfiesPzs() { + if (satisfiesPzsBuilder_ == null) { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } else { + return satisfiesPzsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + satisfiesPzs_ = value; + } else { + satisfiesPzsBuilder_.setMessage(value); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue.Builder builderForValue) { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = builderForValue.build(); + } else { + satisfiesPzsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (((bitField0_ & 0x00200000) != 0) + && satisfiesPzs_ != null + && satisfiesPzs_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getSatisfiesPzsBuilder().mergeFrom(value); + } else { + satisfiesPzs_ = value; + } + } else { + satisfiesPzsBuilder_.mergeFrom(value); + } + if (satisfiesPzs_ != null) { + bitField0_ |= 0x00200000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSatisfiesPzs() { + bitField0_ = (bitField0_ & ~0x00200000); + satisfiesPzs_ = null; + if (satisfiesPzsBuilder_ != null) { + satisfiesPzsBuilder_.dispose(); + satisfiesPzsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValue.Builder getSatisfiesPzsBuilder() { + bitField0_ |= 0x00200000; + onChanged(); + return internalGetSatisfiesPzsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + if (satisfiesPzsBuilder_ != null) { + return satisfiesPzsBuilder_.getMessageOrBuilder(); + } else { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetSatisfiesPzsFieldBuilder() { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSatisfiesPzs(), getParentForChildren(), isClean()); + satisfiesPzs_ = null; + } + return satisfiesPzsBuilder_; + } + + private com.google.protobuf.BoolValue satisfiesPzi_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + satisfiesPziBuilder_; + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzi field is set. + */ + public boolean hasSatisfiesPzi() { + return ((bitField0_ & 0x00400000) != 0); + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzi. + */ + public com.google.protobuf.BoolValue getSatisfiesPzi() { + if (satisfiesPziBuilder_ == null) { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } else { + return satisfiesPziBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzi(com.google.protobuf.BoolValue value) { + if (satisfiesPziBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + satisfiesPzi_ = value; + } else { + satisfiesPziBuilder_.setMessage(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzi(com.google.protobuf.BoolValue.Builder builderForValue) { + if (satisfiesPziBuilder_ == null) { + satisfiesPzi_ = builderForValue.build(); + } else { + satisfiesPziBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSatisfiesPzi(com.google.protobuf.BoolValue value) { + if (satisfiesPziBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0) + && satisfiesPzi_ != null + && satisfiesPzi_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getSatisfiesPziBuilder().mergeFrom(value); + } else { + satisfiesPzi_ = value; + } + } else { + satisfiesPziBuilder_.mergeFrom(value); + } + if (satisfiesPzi_ != null) { + bitField0_ |= 0x00400000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSatisfiesPzi() { + bitField0_ = (bitField0_ & ~0x00400000); + satisfiesPzi_ = null; + if (satisfiesPziBuilder_ != null) { + satisfiesPziBuilder_.dispose(); + satisfiesPziBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValue.Builder getSatisfiesPziBuilder() { + bitField0_ |= 0x00400000; + onChanged(); + return internalGetSatisfiesPziFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPziOrBuilder() { + if (satisfiesPziBuilder_ != null) { + return satisfiesPziBuilder_.getMessageOrBuilder(); + } else { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } + } + + /** + * + * + *
+     * Output only. This status indicates whether the backup satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetSatisfiesPziFieldBuilder() { + if (satisfiesPziBuilder_ == null) { + satisfiesPziBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSatisfiesPzi(), getParentForChildren(), isClean()); + satisfiesPzi_ = null; + } + return satisfiesPziBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.Backup) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.Backup) + private static final com.google.cloud.sql.v1beta4.Backup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.Backup(); + } + + public static com.google.cloud.sql.v1beta4.Backup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Backup parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Backup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupConfiguration.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupConfiguration.java new file mode 100644 index 000000000000..584fce746397 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupConfiguration.java @@ -0,0 +1,3614 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance backup configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.BackupConfiguration} + */ +@com.google.protobuf.Generated +public final class BackupConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.BackupConfiguration) + BackupConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupConfiguration"); + } + + // Use BackupConfiguration.newBuilder() to construct. + private BackupConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackupConfiguration() { + startTime_ = ""; + kind_ = ""; + location_ = ""; + transactionalLogStorageState_ = 0; + backupTier_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.BackupConfiguration.class, + com.google.cloud.sql.v1beta4.BackupConfiguration.Builder.class); + } + + /** + * + * + *
+   * This value contains the storage location of the transactional logs
+   * used to perform point-in-time recovery (PITR) for the database.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState} + */ + public enum TransactionalLogStorageState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED = 0; + */ + TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The transaction logs used for PITR for the instance are stored
+     * on a data disk.
+     * 
+ * + * DISK = 1; + */ + DISK(1), + /** + * + * + *
+     * The transaction logs used for PITR for the instance are switching from
+     * being stored on a data disk to being stored in Cloud Storage.
+     * Only applicable to MySQL.
+     * 
+ * + * SWITCHING_TO_CLOUD_STORAGE = 2; + */ + SWITCHING_TO_CLOUD_STORAGE(2), + /** + * + * + *
+     * The transaction logs used for PITR for the instance are now stored
+     * in Cloud Storage. Previously, they were stored on a data disk.
+     * Only applicable to MySQL.
+     * 
+ * + * SWITCHED_TO_CLOUD_STORAGE = 3; + */ + SWITCHED_TO_CLOUD_STORAGE(3), + /** + * + * + *
+     * The transaction logs used for PITR for the instance are stored in
+     * Cloud Storage. Only applicable to MySQL and PostgreSQL.
+     * 
+ * + * CLOUD_STORAGE = 4; + */ + CLOUD_STORAGE(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TransactionalLogStorageState"); + } + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED = 0; + */ + public static final int TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The transaction logs used for PITR for the instance are stored
+     * on a data disk.
+     * 
+ * + * DISK = 1; + */ + public static final int DISK_VALUE = 1; + + /** + * + * + *
+     * The transaction logs used for PITR for the instance are switching from
+     * being stored on a data disk to being stored in Cloud Storage.
+     * Only applicable to MySQL.
+     * 
+ * + * SWITCHING_TO_CLOUD_STORAGE = 2; + */ + public static final int SWITCHING_TO_CLOUD_STORAGE_VALUE = 2; + + /** + * + * + *
+     * The transaction logs used for PITR for the instance are now stored
+     * in Cloud Storage. Previously, they were stored on a data disk.
+     * Only applicable to MySQL.
+     * 
+ * + * SWITCHED_TO_CLOUD_STORAGE = 3; + */ + public static final int SWITCHED_TO_CLOUD_STORAGE_VALUE = 3; + + /** + * + * + *
+     * The transaction logs used for PITR for the instance are stored in
+     * Cloud Storage. Only applicable to MySQL and PostgreSQL.
+     * 
+ * + * CLOUD_STORAGE = 4; + */ + public static final int CLOUD_STORAGE_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 TransactionalLogStorageState 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 TransactionalLogStorageState forNumber(int value) { + switch (value) { + case 0: + return TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED; + case 1: + return DISK; + case 2: + return SWITCHING_TO_CLOUD_STORAGE; + case 3: + return SWITCHED_TO_CLOUD_STORAGE; + case 4: + return CLOUD_STORAGE; + 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 TransactionalLogStorageState findValueByNumber(int number) { + return TransactionalLogStorageState.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.BackupConfiguration.getDescriptor().getEnumTypes().get(0); + } + + private static final TransactionalLogStorageState[] VALUES = values(); + + public static TransactionalLogStorageState 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 TransactionalLogStorageState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState) + } + + /** + * + * + *
+   * Backup tier that manages the backups for the instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.BackupConfiguration.BackupTier} + */ + public enum BackupTier implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * BACKUP_TIER_UNSPECIFIED = 0; + */ + BACKUP_TIER_UNSPECIFIED(0), + /** + * + * + *
+     * Instance is managed by Cloud SQL.
+     * 
+ * + * STANDARD = 1; + */ + STANDARD(1), + /** + * + * + *
+     * Deprecated: ADVANCED is deprecated. Please use ENHANCED instead.
+     * 
+ * + * ADVANCED = 2 [deprecated = true]; + */ + @java.lang.Deprecated + ADVANCED(2), + /** + * + * + *
+     * Instance is managed by Google Cloud Backup and DR Service.
+     * 
+ * + * ENHANCED = 3; + */ + ENHANCED(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupTier"); + } + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * BACKUP_TIER_UNSPECIFIED = 0; + */ + public static final int BACKUP_TIER_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Instance is managed by Cloud SQL.
+     * 
+ * + * STANDARD = 1; + */ + public static final int STANDARD_VALUE = 1; + + /** + * + * + *
+     * Deprecated: ADVANCED is deprecated. Please use ENHANCED instead.
+     * 
+ * + * ADVANCED = 2 [deprecated = true]; + */ + @java.lang.Deprecated public static final int ADVANCED_VALUE = 2; + + /** + * + * + *
+     * Instance is managed by Google Cloud Backup and DR Service.
+     * 
+ * + * ENHANCED = 3; + */ + public static final int ENHANCED_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 BackupTier 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 BackupTier forNumber(int value) { + switch (value) { + case 0: + return BACKUP_TIER_UNSPECIFIED; + case 1: + return STANDARD; + case 2: + return ADVANCED; + case 3: + return ENHANCED; + 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 BackupTier findValueByNumber(int number) { + return BackupTier.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.BackupConfiguration.getDescriptor().getEnumTypes().get(1); + } + + private static final BackupTier[] VALUES = values(); + + public static BackupTier 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 BackupTier(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.BackupConfiguration.BackupTier) + } + + private int bitField0_; + public static final int START_TIME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object startTime_ = ""; + + /** + * + * + *
+   * Start time for the daily backup configuration in UTC timezone in the 24
+   * hour format - `HH:MM`.
+   * 
+ * + * string start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public java.lang.String getStartTime() { + java.lang.Object ref = startTime_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startTime_ = s; + return s; + } + } + + /** + * + * + *
+   * Start time for the daily backup configuration in UTC timezone in the 24
+   * hour format - `HH:MM`.
+   * 
+ * + * string start_time = 1; + * + * @return The bytes for startTime. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStartTimeBytes() { + java.lang.Object ref = startTime_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + startTime_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLED_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue enabled_; + + /** + * + * + *
+   * Whether this configuration is enabled.
+   * 
+ * + * .google.protobuf.BoolValue enabled = 2; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Whether this configuration is enabled.
+   * 
+ * + * .google.protobuf.BoolValue enabled = 2; + * + * @return The enabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnabled() { + return enabled_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enabled_; + } + + /** + * + * + *
+   * Whether this configuration is enabled.
+   * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getEnabledOrBuilder() { + return enabled_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enabled_; + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#backupConfiguration`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#backupConfiguration`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BINARY_LOG_ENABLED_FIELD_NUMBER = 4; + private com.google.protobuf.BoolValue binaryLogEnabled_; + + /** + * + * + *
+   * (MySQL only) Whether binary log is enabled. If backup configuration is
+   * disabled, binarylog must be disabled as well.
+   * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + * + * @return Whether the binaryLogEnabled field is set. + */ + @java.lang.Override + public boolean hasBinaryLogEnabled() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * (MySQL only) Whether binary log is enabled. If backup configuration is
+   * disabled, binarylog must be disabled as well.
+   * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + * + * @return The binaryLogEnabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getBinaryLogEnabled() { + return binaryLogEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : binaryLogEnabled_; + } + + /** + * + * + *
+   * (MySQL only) Whether binary log is enabled. If backup configuration is
+   * disabled, binarylog must be disabled as well.
+   * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getBinaryLogEnabledOrBuilder() { + return binaryLogEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : binaryLogEnabled_; + } + + public static final int REPLICATION_LOG_ARCHIVING_ENABLED_FIELD_NUMBER = 5; + private com.google.protobuf.BoolValue replicationLogArchivingEnabled_; + + /** + * + * + *
+   * Reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + * + * @return Whether the replicationLogArchivingEnabled field is set. + */ + @java.lang.Override + public boolean hasReplicationLogArchivingEnabled() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + * + * @return The replicationLogArchivingEnabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getReplicationLogArchivingEnabled() { + return replicationLogArchivingEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : replicationLogArchivingEnabled_; + } + + /** + * + * + *
+   * Reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getReplicationLogArchivingEnabledOrBuilder() { + return replicationLogArchivingEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : replicationLogArchivingEnabled_; + } + + public static final int LOCATION_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + + /** + * + * + *
+   * Location of the backup
+   * 
+ * + * string location = 6; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + + /** + * + * + *
+   * Location of the backup
+   * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POINT_IN_TIME_RECOVERY_ENABLED_FIELD_NUMBER = 7; + private com.google.protobuf.BoolValue pointInTimeRecoveryEnabled_; + + /** + * + * + *
+   * Whether point in time recovery is enabled.
+   * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + * + * @return Whether the pointInTimeRecoveryEnabled field is set. + */ + @java.lang.Override + public boolean hasPointInTimeRecoveryEnabled() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Whether point in time recovery is enabled.
+   * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + * + * @return The pointInTimeRecoveryEnabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getPointInTimeRecoveryEnabled() { + return pointInTimeRecoveryEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : pointInTimeRecoveryEnabled_; + } + + /** + * + * + *
+   * Whether point in time recovery is enabled.
+   * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getPointInTimeRecoveryEnabledOrBuilder() { + return pointInTimeRecoveryEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : pointInTimeRecoveryEnabled_; + } + + public static final int TRANSACTION_LOG_RETENTION_DAYS_FIELD_NUMBER = 9; + private com.google.protobuf.Int32Value transactionLogRetentionDays_; + + /** + * + * + *
+   * The number of days of transaction logs we retain for point in time
+   * restore, from 1-7.
+   * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + * + * @return Whether the transactionLogRetentionDays field is set. + */ + @java.lang.Override + public boolean hasTransactionLogRetentionDays() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * The number of days of transaction logs we retain for point in time
+   * restore, from 1-7.
+   * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + * + * @return The transactionLogRetentionDays. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getTransactionLogRetentionDays() { + return transactionLogRetentionDays_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : transactionLogRetentionDays_; + } + + /** + * + * + *
+   * The number of days of transaction logs we retain for point in time
+   * restore, from 1-7.
+   * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getTransactionLogRetentionDaysOrBuilder() { + return transactionLogRetentionDays_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : transactionLogRetentionDays_; + } + + public static final int BACKUP_RETENTION_SETTINGS_FIELD_NUMBER = 10; + private com.google.cloud.sql.v1beta4.BackupRetentionSettings backupRetentionSettings_; + + /** + * + * + *
+   * Backup retention settings.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + * + * @return Whether the backupRetentionSettings field is set. + */ + @java.lang.Override + public boolean hasBackupRetentionSettings() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Backup retention settings.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + * + * @return The backupRetentionSettings. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRetentionSettings getBackupRetentionSettings() { + return backupRetentionSettings_ == null + ? com.google.cloud.sql.v1beta4.BackupRetentionSettings.getDefaultInstance() + : backupRetentionSettings_; + } + + /** + * + * + *
+   * Backup retention settings.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRetentionSettingsOrBuilder + getBackupRetentionSettingsOrBuilder() { + return backupRetentionSettings_ == null + ? com.google.cloud.sql.v1beta4.BackupRetentionSettings.getDefaultInstance() + : backupRetentionSettings_; + } + + public static final int TRANSACTIONAL_LOG_STORAGE_STATE_FIELD_NUMBER = 11; + private int transactionalLogStorageState_ = 0; + + /** + * + * + *
+   * Output only. This value contains the storage location of transactional logs
+   * for the database for point-in-time recovery.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the transactionalLogStorageState field is set. + */ + @java.lang.Override + public boolean hasTransactionalLogStorageState() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Output only. This value contains the storage location of transactional logs
+   * for the database for point-in-time recovery.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for transactionalLogStorageState. + */ + @java.lang.Override + public int getTransactionalLogStorageStateValue() { + return transactionalLogStorageState_; + } + + /** + * + * + *
+   * Output only. This value contains the storage location of transactional logs
+   * for the database for point-in-time recovery.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The transactionalLogStorageState. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState + getTransactionalLogStorageState() { + com.google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState result = + com.google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState.forNumber( + transactionalLogStorageState_); + return result == null + ? com.google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState.UNRECOGNIZED + : result; + } + + public static final int BACKUP_TIER_FIELD_NUMBER = 12; + private int backupTier_ = 0; + + /** + * + * + *
+   * Output only. Backup tier that manages the backups for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.BackupTier backup_tier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupTier field is set. + */ + @java.lang.Override + public boolean hasBackupTier() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * Output only. Backup tier that manages the backups for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.BackupTier backup_tier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for backupTier. + */ + @java.lang.Override + public int getBackupTierValue() { + return backupTier_; + } + + /** + * + * + *
+   * Output only. Backup tier that manages the backups for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.BackupTier backup_tier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupTier. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupConfiguration.BackupTier getBackupTier() { + com.google.cloud.sql.v1beta4.BackupConfiguration.BackupTier result = + com.google.cloud.sql.v1beta4.BackupConfiguration.BackupTier.forNumber(backupTier_); + return result == null + ? com.google.cloud.sql.v1beta4.BackupConfiguration.BackupTier.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.GeneratedMessage.isStringEmpty(startTime_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, startTime_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getEnabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getBinaryLogEnabled()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getReplicationLogArchivingEnabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, location_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(7, getPointInTimeRecoveryEnabled()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(9, getTransactionLogRetentionDays()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(10, getBackupRetentionSettings()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeEnum(11, transactionalLogStorageState_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeEnum(12, backupTier_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(startTime_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, startTime_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEnabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getBinaryLogEnabled()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, getReplicationLogArchivingEnabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, location_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, getPointInTimeRecoveryEnabled()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, getTransactionLogRetentionDays()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, getBackupRetentionSettings()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize(11, transactionalLogStorageState_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, backupTier_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.BackupConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.BackupConfiguration other = + (com.google.cloud.sql.v1beta4.BackupConfiguration) obj; + + if (!getStartTime().equals(other.getStartTime())) return false; + if (hasEnabled() != other.hasEnabled()) return false; + if (hasEnabled()) { + if (!getEnabled().equals(other.getEnabled())) return false; + } + if (!getKind().equals(other.getKind())) return false; + if (hasBinaryLogEnabled() != other.hasBinaryLogEnabled()) return false; + if (hasBinaryLogEnabled()) { + if (!getBinaryLogEnabled().equals(other.getBinaryLogEnabled())) return false; + } + if (hasReplicationLogArchivingEnabled() != other.hasReplicationLogArchivingEnabled()) + return false; + if (hasReplicationLogArchivingEnabled()) { + if (!getReplicationLogArchivingEnabled().equals(other.getReplicationLogArchivingEnabled())) + return false; + } + if (!getLocation().equals(other.getLocation())) return false; + if (hasPointInTimeRecoveryEnabled() != other.hasPointInTimeRecoveryEnabled()) return false; + if (hasPointInTimeRecoveryEnabled()) { + if (!getPointInTimeRecoveryEnabled().equals(other.getPointInTimeRecoveryEnabled())) + return false; + } + if (hasTransactionLogRetentionDays() != other.hasTransactionLogRetentionDays()) return false; + if (hasTransactionLogRetentionDays()) { + if (!getTransactionLogRetentionDays().equals(other.getTransactionLogRetentionDays())) + return false; + } + if (hasBackupRetentionSettings() != other.hasBackupRetentionSettings()) return false; + if (hasBackupRetentionSettings()) { + if (!getBackupRetentionSettings().equals(other.getBackupRetentionSettings())) return false; + } + if (hasTransactionalLogStorageState() != other.hasTransactionalLogStorageState()) return false; + if (hasTransactionalLogStorageState()) { + if (transactionalLogStorageState_ != other.transactionalLogStorageState_) return false; + } + if (hasBackupTier() != other.hasBackupTier()) return false; + if (hasBackupTier()) { + if (backupTier_ != other.backupTier_) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + if (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getEnabled().hashCode(); + } + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasBinaryLogEnabled()) { + hash = (37 * hash) + BINARY_LOG_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getBinaryLogEnabled().hashCode(); + } + if (hasReplicationLogArchivingEnabled()) { + hash = (37 * hash) + REPLICATION_LOG_ARCHIVING_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getReplicationLogArchivingEnabled().hashCode(); + } + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + if (hasPointInTimeRecoveryEnabled()) { + hash = (37 * hash) + POINT_IN_TIME_RECOVERY_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getPointInTimeRecoveryEnabled().hashCode(); + } + if (hasTransactionLogRetentionDays()) { + hash = (37 * hash) + TRANSACTION_LOG_RETENTION_DAYS_FIELD_NUMBER; + hash = (53 * hash) + getTransactionLogRetentionDays().hashCode(); + } + if (hasBackupRetentionSettings()) { + hash = (37 * hash) + BACKUP_RETENTION_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getBackupRetentionSettings().hashCode(); + } + if (hasTransactionalLogStorageState()) { + hash = (37 * hash) + TRANSACTIONAL_LOG_STORAGE_STATE_FIELD_NUMBER; + hash = (53 * hash) + transactionalLogStorageState_; + } + if (hasBackupTier()) { + hash = (37 * hash) + BACKUP_TIER_FIELD_NUMBER; + hash = (53 * hash) + backupTier_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.BackupConfiguration parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.BackupConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance backup configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.BackupConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.BackupConfiguration) + com.google.cloud.sql.v1beta4.BackupConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.BackupConfiguration.class, + com.google.cloud.sql.v1beta4.BackupConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.BackupConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEnabledFieldBuilder(); + internalGetBinaryLogEnabledFieldBuilder(); + internalGetReplicationLogArchivingEnabledFieldBuilder(); + internalGetPointInTimeRecoveryEnabledFieldBuilder(); + internalGetTransactionLogRetentionDaysFieldBuilder(); + internalGetBackupRetentionSettingsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startTime_ = ""; + enabled_ = null; + if (enabledBuilder_ != null) { + enabledBuilder_.dispose(); + enabledBuilder_ = null; + } + kind_ = ""; + binaryLogEnabled_ = null; + if (binaryLogEnabledBuilder_ != null) { + binaryLogEnabledBuilder_.dispose(); + binaryLogEnabledBuilder_ = null; + } + replicationLogArchivingEnabled_ = null; + if (replicationLogArchivingEnabledBuilder_ != null) { + replicationLogArchivingEnabledBuilder_.dispose(); + replicationLogArchivingEnabledBuilder_ = null; + } + location_ = ""; + pointInTimeRecoveryEnabled_ = null; + if (pointInTimeRecoveryEnabledBuilder_ != null) { + pointInTimeRecoveryEnabledBuilder_.dispose(); + pointInTimeRecoveryEnabledBuilder_ = null; + } + transactionLogRetentionDays_ = null; + if (transactionLogRetentionDaysBuilder_ != null) { + transactionLogRetentionDaysBuilder_.dispose(); + transactionLogRetentionDaysBuilder_ = null; + } + backupRetentionSettings_ = null; + if (backupRetentionSettingsBuilder_ != null) { + backupRetentionSettingsBuilder_.dispose(); + backupRetentionSettingsBuilder_ = null; + } + transactionalLogStorageState_ = 0; + backupTier_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupConfiguration getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.BackupConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupConfiguration build() { + com.google.cloud.sql.v1beta4.BackupConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupConfiguration buildPartial() { + com.google.cloud.sql.v1beta4.BackupConfiguration result = + new com.google.cloud.sql.v1beta4.BackupConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.BackupConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startTime_ = startTime_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.enabled_ = enabledBuilder_ == null ? enabled_ : enabledBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.binaryLogEnabled_ = + binaryLogEnabledBuilder_ == null ? binaryLogEnabled_ : binaryLogEnabledBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.replicationLogArchivingEnabled_ = + replicationLogArchivingEnabledBuilder_ == null + ? replicationLogArchivingEnabled_ + : replicationLogArchivingEnabledBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pointInTimeRecoveryEnabled_ = + pointInTimeRecoveryEnabledBuilder_ == null + ? pointInTimeRecoveryEnabled_ + : pointInTimeRecoveryEnabledBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.transactionLogRetentionDays_ = + transactionLogRetentionDaysBuilder_ == null + ? transactionLogRetentionDays_ + : transactionLogRetentionDaysBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.backupRetentionSettings_ = + backupRetentionSettingsBuilder_ == null + ? backupRetentionSettings_ + : backupRetentionSettingsBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.transactionalLogStorageState_ = transactionalLogStorageState_; + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.backupTier_ = backupTier_; + to_bitField0_ |= 0x00000080; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.BackupConfiguration) { + return mergeFrom((com.google.cloud.sql.v1beta4.BackupConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.BackupConfiguration other) { + if (other == com.google.cloud.sql.v1beta4.BackupConfiguration.getDefaultInstance()) + return this; + if (!other.getStartTime().isEmpty()) { + startTime_ = other.startTime_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasEnabled()) { + mergeEnabled(other.getEnabled()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasBinaryLogEnabled()) { + mergeBinaryLogEnabled(other.getBinaryLogEnabled()); + } + if (other.hasReplicationLogArchivingEnabled()) { + mergeReplicationLogArchivingEnabled(other.getReplicationLogArchivingEnabled()); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasPointInTimeRecoveryEnabled()) { + mergePointInTimeRecoveryEnabled(other.getPointInTimeRecoveryEnabled()); + } + if (other.hasTransactionLogRetentionDays()) { + mergeTransactionLogRetentionDays(other.getTransactionLogRetentionDays()); + } + if (other.hasBackupRetentionSettings()) { + mergeBackupRetentionSettings(other.getBackupRetentionSettings()); + } + if (other.hasTransactionalLogStorageState()) { + setTransactionalLogStorageStateValue(other.getTransactionalLogStorageStateValue()); + } + if (other.hasBackupTier()) { + setBackupTierValue(other.getBackupTierValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + startTime_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetEnabledFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetBinaryLogEnabledFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetReplicationLogArchivingEnabledFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetPointInTimeRecoveryEnabledFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 74: + { + input.readMessage( + internalGetTransactionLogRetentionDaysFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 74 + case 82: + { + input.readMessage( + internalGetBackupRetentionSettingsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 82 + case 88: + { + transactionalLogStorageState_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 88 + case 96: + { + backupTier_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 96 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object startTime_ = ""; + + /** + * + * + *
+     * Start time for the daily backup configuration in UTC timezone in the 24
+     * hour format - `HH:MM`.
+     * 
+ * + * string start_time = 1; + * + * @return The startTime. + */ + public java.lang.String getStartTime() { + java.lang.Object ref = startTime_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startTime_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Start time for the daily backup configuration in UTC timezone in the 24
+     * hour format - `HH:MM`.
+     * 
+ * + * string start_time = 1; + * + * @return The bytes for startTime. + */ + public com.google.protobuf.ByteString getStartTimeBytes() { + java.lang.Object ref = startTime_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + startTime_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Start time for the daily backup configuration in UTC timezone in the 24
+     * hour format - `HH:MM`.
+     * 
+ * + * string start_time = 1; + * + * @param value The startTime to set. + * @return This builder for chaining. + */ + public Builder setStartTime(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Start time for the daily backup configuration in UTC timezone in the 24
+     * hour format - `HH:MM`.
+     * 
+ * + * string start_time = 1; + * + * @return This builder for chaining. + */ + public Builder clearStartTime() { + startTime_ = getDefaultInstance().getStartTime(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Start time for the daily backup configuration in UTC timezone in the 24
+     * hour format - `HH:MM`.
+     * 
+ * + * string start_time = 1; + * + * @param value The bytes for startTime to set. + * @return This builder for chaining. + */ + public Builder setStartTimeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + startTime_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue enabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + enabledBuilder_; + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + * + * @return Whether the enabled field is set. + */ + public boolean hasEnabled() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + * + * @return The enabled. + */ + public com.google.protobuf.BoolValue getEnabled() { + if (enabledBuilder_ == null) { + return enabled_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enabled_; + } else { + return enabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + public Builder setEnabled(com.google.protobuf.BoolValue value) { + if (enabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enabled_ = value; + } else { + enabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + public Builder setEnabled(com.google.protobuf.BoolValue.Builder builderForValue) { + if (enabledBuilder_ == null) { + enabled_ = builderForValue.build(); + } else { + enabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + public Builder mergeEnabled(com.google.protobuf.BoolValue value) { + if (enabledBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && enabled_ != null + && enabled_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getEnabledBuilder().mergeFrom(value); + } else { + enabled_ = value; + } + } else { + enabledBuilder_.mergeFrom(value); + } + if (enabled_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000002); + enabled_ = null; + if (enabledBuilder_ != null) { + enabledBuilder_.dispose(); + enabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + public com.google.protobuf.BoolValue.Builder getEnabledBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + public com.google.protobuf.BoolValueOrBuilder getEnabledOrBuilder() { + if (enabledBuilder_ != null) { + return enabledBuilder_.getMessageOrBuilder(); + } else { + return enabled_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enabled_; + } + } + + /** + * + * + *
+     * Whether this configuration is enabled.
+     * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetEnabledFieldBuilder() { + if (enabledBuilder_ == null) { + enabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getEnabled(), getParentForChildren(), isClean()); + enabled_ = null; + } + return enabledBuilder_; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#backupConfiguration`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupConfiguration`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupConfiguration`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupConfiguration`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupConfiguration`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue binaryLogEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + binaryLogEnabledBuilder_; + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + * + * @return Whether the binaryLogEnabled field is set. + */ + public boolean hasBinaryLogEnabled() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + * + * @return The binaryLogEnabled. + */ + public com.google.protobuf.BoolValue getBinaryLogEnabled() { + if (binaryLogEnabledBuilder_ == null) { + return binaryLogEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : binaryLogEnabled_; + } else { + return binaryLogEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + public Builder setBinaryLogEnabled(com.google.protobuf.BoolValue value) { + if (binaryLogEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + binaryLogEnabled_ = value; + } else { + binaryLogEnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + public Builder setBinaryLogEnabled(com.google.protobuf.BoolValue.Builder builderForValue) { + if (binaryLogEnabledBuilder_ == null) { + binaryLogEnabled_ = builderForValue.build(); + } else { + binaryLogEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + public Builder mergeBinaryLogEnabled(com.google.protobuf.BoolValue value) { + if (binaryLogEnabledBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && binaryLogEnabled_ != null + && binaryLogEnabled_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getBinaryLogEnabledBuilder().mergeFrom(value); + } else { + binaryLogEnabled_ = value; + } + } else { + binaryLogEnabledBuilder_.mergeFrom(value); + } + if (binaryLogEnabled_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + public Builder clearBinaryLogEnabled() { + bitField0_ = (bitField0_ & ~0x00000008); + binaryLogEnabled_ = null; + if (binaryLogEnabledBuilder_ != null) { + binaryLogEnabledBuilder_.dispose(); + binaryLogEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + public com.google.protobuf.BoolValue.Builder getBinaryLogEnabledBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetBinaryLogEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + public com.google.protobuf.BoolValueOrBuilder getBinaryLogEnabledOrBuilder() { + if (binaryLogEnabledBuilder_ != null) { + return binaryLogEnabledBuilder_.getMessageOrBuilder(); + } else { + return binaryLogEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : binaryLogEnabled_; + } + } + + /** + * + * + *
+     * (MySQL only) Whether binary log is enabled. If backup configuration is
+     * disabled, binarylog must be disabled as well.
+     * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetBinaryLogEnabledFieldBuilder() { + if (binaryLogEnabledBuilder_ == null) { + binaryLogEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getBinaryLogEnabled(), getParentForChildren(), isClean()); + binaryLogEnabled_ = null; + } + return binaryLogEnabledBuilder_; + } + + private com.google.protobuf.BoolValue replicationLogArchivingEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + replicationLogArchivingEnabledBuilder_; + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + * + * @return Whether the replicationLogArchivingEnabled field is set. + */ + public boolean hasReplicationLogArchivingEnabled() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + * + * @return The replicationLogArchivingEnabled. + */ + public com.google.protobuf.BoolValue getReplicationLogArchivingEnabled() { + if (replicationLogArchivingEnabledBuilder_ == null) { + return replicationLogArchivingEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : replicationLogArchivingEnabled_; + } else { + return replicationLogArchivingEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + */ + public Builder setReplicationLogArchivingEnabled(com.google.protobuf.BoolValue value) { + if (replicationLogArchivingEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replicationLogArchivingEnabled_ = value; + } else { + replicationLogArchivingEnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + */ + public Builder setReplicationLogArchivingEnabled( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (replicationLogArchivingEnabledBuilder_ == null) { + replicationLogArchivingEnabled_ = builderForValue.build(); + } else { + replicationLogArchivingEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + */ + public Builder mergeReplicationLogArchivingEnabled(com.google.protobuf.BoolValue value) { + if (replicationLogArchivingEnabledBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && replicationLogArchivingEnabled_ != null + && replicationLogArchivingEnabled_ + != com.google.protobuf.BoolValue.getDefaultInstance()) { + getReplicationLogArchivingEnabledBuilder().mergeFrom(value); + } else { + replicationLogArchivingEnabled_ = value; + } + } else { + replicationLogArchivingEnabledBuilder_.mergeFrom(value); + } + if (replicationLogArchivingEnabled_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + */ + public Builder clearReplicationLogArchivingEnabled() { + bitField0_ = (bitField0_ & ~0x00000010); + replicationLogArchivingEnabled_ = null; + if (replicationLogArchivingEnabledBuilder_ != null) { + replicationLogArchivingEnabledBuilder_.dispose(); + replicationLogArchivingEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + */ + public com.google.protobuf.BoolValue.Builder getReplicationLogArchivingEnabledBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetReplicationLogArchivingEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + */ + public com.google.protobuf.BoolValueOrBuilder getReplicationLogArchivingEnabledOrBuilder() { + if (replicationLogArchivingEnabledBuilder_ != null) { + return replicationLogArchivingEnabledBuilder_.getMessageOrBuilder(); + } else { + return replicationLogArchivingEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : replicationLogArchivingEnabled_; + } + } + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetReplicationLogArchivingEnabledFieldBuilder() { + if (replicationLogArchivingEnabledBuilder_ == null) { + replicationLogArchivingEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getReplicationLogArchivingEnabled(), getParentForChildren(), isClean()); + replicationLogArchivingEnabled_ = null; + } + return replicationLogArchivingEnabledBuilder_; + } + + private java.lang.Object location_ = ""; + + /** + * + * + *
+     * Location of the backup
+     * 
+ * + * string location = 6; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Location of the backup
+     * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Location of the backup
+     * 
+ * + * string location = 6; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Location of the backup
+     * 
+ * + * string location = 6; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Location of the backup
+     * 
+ * + * string location = 6; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue pointInTimeRecoveryEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + pointInTimeRecoveryEnabledBuilder_; + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + * + * @return Whether the pointInTimeRecoveryEnabled field is set. + */ + public boolean hasPointInTimeRecoveryEnabled() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + * + * @return The pointInTimeRecoveryEnabled. + */ + public com.google.protobuf.BoolValue getPointInTimeRecoveryEnabled() { + if (pointInTimeRecoveryEnabledBuilder_ == null) { + return pointInTimeRecoveryEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : pointInTimeRecoveryEnabled_; + } else { + return pointInTimeRecoveryEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + public Builder setPointInTimeRecoveryEnabled(com.google.protobuf.BoolValue value) { + if (pointInTimeRecoveryEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pointInTimeRecoveryEnabled_ = value; + } else { + pointInTimeRecoveryEnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + public Builder setPointInTimeRecoveryEnabled( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (pointInTimeRecoveryEnabledBuilder_ == null) { + pointInTimeRecoveryEnabled_ = builderForValue.build(); + } else { + pointInTimeRecoveryEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + public Builder mergePointInTimeRecoveryEnabled(com.google.protobuf.BoolValue value) { + if (pointInTimeRecoveryEnabledBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && pointInTimeRecoveryEnabled_ != null + && pointInTimeRecoveryEnabled_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getPointInTimeRecoveryEnabledBuilder().mergeFrom(value); + } else { + pointInTimeRecoveryEnabled_ = value; + } + } else { + pointInTimeRecoveryEnabledBuilder_.mergeFrom(value); + } + if (pointInTimeRecoveryEnabled_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + public Builder clearPointInTimeRecoveryEnabled() { + bitField0_ = (bitField0_ & ~0x00000040); + pointInTimeRecoveryEnabled_ = null; + if (pointInTimeRecoveryEnabledBuilder_ != null) { + pointInTimeRecoveryEnabledBuilder_.dispose(); + pointInTimeRecoveryEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + public com.google.protobuf.BoolValue.Builder getPointInTimeRecoveryEnabledBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetPointInTimeRecoveryEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + public com.google.protobuf.BoolValueOrBuilder getPointInTimeRecoveryEnabledOrBuilder() { + if (pointInTimeRecoveryEnabledBuilder_ != null) { + return pointInTimeRecoveryEnabledBuilder_.getMessageOrBuilder(); + } else { + return pointInTimeRecoveryEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : pointInTimeRecoveryEnabled_; + } + } + + /** + * + * + *
+     * Whether point in time recovery is enabled.
+     * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetPointInTimeRecoveryEnabledFieldBuilder() { + if (pointInTimeRecoveryEnabledBuilder_ == null) { + pointInTimeRecoveryEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getPointInTimeRecoveryEnabled(), getParentForChildren(), isClean()); + pointInTimeRecoveryEnabled_ = null; + } + return pointInTimeRecoveryEnabledBuilder_; + } + + private com.google.protobuf.Int32Value transactionLogRetentionDays_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + transactionLogRetentionDaysBuilder_; + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + * + * @return Whether the transactionLogRetentionDays field is set. + */ + public boolean hasTransactionLogRetentionDays() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + * + * @return The transactionLogRetentionDays. + */ + public com.google.protobuf.Int32Value getTransactionLogRetentionDays() { + if (transactionLogRetentionDaysBuilder_ == null) { + return transactionLogRetentionDays_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : transactionLogRetentionDays_; + } else { + return transactionLogRetentionDaysBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + public Builder setTransactionLogRetentionDays(com.google.protobuf.Int32Value value) { + if (transactionLogRetentionDaysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transactionLogRetentionDays_ = value; + } else { + transactionLogRetentionDaysBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + public Builder setTransactionLogRetentionDays( + com.google.protobuf.Int32Value.Builder builderForValue) { + if (transactionLogRetentionDaysBuilder_ == null) { + transactionLogRetentionDays_ = builderForValue.build(); + } else { + transactionLogRetentionDaysBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + public Builder mergeTransactionLogRetentionDays(com.google.protobuf.Int32Value value) { + if (transactionLogRetentionDaysBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && transactionLogRetentionDays_ != null + && transactionLogRetentionDays_ + != com.google.protobuf.Int32Value.getDefaultInstance()) { + getTransactionLogRetentionDaysBuilder().mergeFrom(value); + } else { + transactionLogRetentionDays_ = value; + } + } else { + transactionLogRetentionDaysBuilder_.mergeFrom(value); + } + if (transactionLogRetentionDays_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + public Builder clearTransactionLogRetentionDays() { + bitField0_ = (bitField0_ & ~0x00000080); + transactionLogRetentionDays_ = null; + if (transactionLogRetentionDaysBuilder_ != null) { + transactionLogRetentionDaysBuilder_.dispose(); + transactionLogRetentionDaysBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + public com.google.protobuf.Int32Value.Builder getTransactionLogRetentionDaysBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetTransactionLogRetentionDaysFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + public com.google.protobuf.Int32ValueOrBuilder getTransactionLogRetentionDaysOrBuilder() { + if (transactionLogRetentionDaysBuilder_ != null) { + return transactionLogRetentionDaysBuilder_.getMessageOrBuilder(); + } else { + return transactionLogRetentionDays_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : transactionLogRetentionDays_; + } + } + + /** + * + * + *
+     * The number of days of transaction logs we retain for point in time
+     * restore, from 1-7.
+     * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetTransactionLogRetentionDaysFieldBuilder() { + if (transactionLogRetentionDaysBuilder_ == null) { + transactionLogRetentionDaysBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getTransactionLogRetentionDays(), getParentForChildren(), isClean()); + transactionLogRetentionDays_ = null; + } + return transactionLogRetentionDaysBuilder_; + } + + private com.google.cloud.sql.v1beta4.BackupRetentionSettings backupRetentionSettings_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupRetentionSettings, + com.google.cloud.sql.v1beta4.BackupRetentionSettings.Builder, + com.google.cloud.sql.v1beta4.BackupRetentionSettingsOrBuilder> + backupRetentionSettingsBuilder_; + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + * + * + * @return Whether the backupRetentionSettings field is set. + */ + public boolean hasBackupRetentionSettings() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + * + * + * @return The backupRetentionSettings. + */ + public com.google.cloud.sql.v1beta4.BackupRetentionSettings getBackupRetentionSettings() { + if (backupRetentionSettingsBuilder_ == null) { + return backupRetentionSettings_ == null + ? com.google.cloud.sql.v1beta4.BackupRetentionSettings.getDefaultInstance() + : backupRetentionSettings_; + } else { + return backupRetentionSettingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + * + */ + public Builder setBackupRetentionSettings( + com.google.cloud.sql.v1beta4.BackupRetentionSettings value) { + if (backupRetentionSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupRetentionSettings_ = value; + } else { + backupRetentionSettingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + * + */ + public Builder setBackupRetentionSettings( + com.google.cloud.sql.v1beta4.BackupRetentionSettings.Builder builderForValue) { + if (backupRetentionSettingsBuilder_ == null) { + backupRetentionSettings_ = builderForValue.build(); + } else { + backupRetentionSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + * + */ + public Builder mergeBackupRetentionSettings( + com.google.cloud.sql.v1beta4.BackupRetentionSettings value) { + if (backupRetentionSettingsBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && backupRetentionSettings_ != null + && backupRetentionSettings_ + != com.google.cloud.sql.v1beta4.BackupRetentionSettings.getDefaultInstance()) { + getBackupRetentionSettingsBuilder().mergeFrom(value); + } else { + backupRetentionSettings_ = value; + } + } else { + backupRetentionSettingsBuilder_.mergeFrom(value); + } + if (backupRetentionSettings_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + * + */ + public Builder clearBackupRetentionSettings() { + bitField0_ = (bitField0_ & ~0x00000100); + backupRetentionSettings_ = null; + if (backupRetentionSettingsBuilder_ != null) { + backupRetentionSettingsBuilder_.dispose(); + backupRetentionSettingsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + * + */ + public com.google.cloud.sql.v1beta4.BackupRetentionSettings.Builder + getBackupRetentionSettingsBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetBackupRetentionSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + * + */ + public com.google.cloud.sql.v1beta4.BackupRetentionSettingsOrBuilder + getBackupRetentionSettingsOrBuilder() { + if (backupRetentionSettingsBuilder_ != null) { + return backupRetentionSettingsBuilder_.getMessageOrBuilder(); + } else { + return backupRetentionSettings_ == null + ? com.google.cloud.sql.v1beta4.BackupRetentionSettings.getDefaultInstance() + : backupRetentionSettings_; + } + } + + /** + * + * + *
+     * Backup retention settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupRetentionSettings, + com.google.cloud.sql.v1beta4.BackupRetentionSettings.Builder, + com.google.cloud.sql.v1beta4.BackupRetentionSettingsOrBuilder> + internalGetBackupRetentionSettingsFieldBuilder() { + if (backupRetentionSettingsBuilder_ == null) { + backupRetentionSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupRetentionSettings, + com.google.cloud.sql.v1beta4.BackupRetentionSettings.Builder, + com.google.cloud.sql.v1beta4.BackupRetentionSettingsOrBuilder>( + getBackupRetentionSettings(), getParentForChildren(), isClean()); + backupRetentionSettings_ = null; + } + return backupRetentionSettingsBuilder_; + } + + private int transactionalLogStorageState_ = 0; + + /** + * + * + *
+     * Output only. This value contains the storage location of transactional logs
+     * for the database for point-in-time recovery.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the transactionalLogStorageState field is set. + */ + @java.lang.Override + public boolean hasTransactionalLogStorageState() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Output only. This value contains the storage location of transactional logs
+     * for the database for point-in-time recovery.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for transactionalLogStorageState. + */ + @java.lang.Override + public int getTransactionalLogStorageStateValue() { + return transactionalLogStorageState_; + } + + /** + * + * + *
+     * Output only. This value contains the storage location of transactional logs
+     * for the database for point-in-time recovery.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for transactionalLogStorageState to set. + * @return This builder for chaining. + */ + public Builder setTransactionalLogStorageStateValue(int value) { + transactionalLogStorageState_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This value contains the storage location of transactional logs
+     * for the database for point-in-time recovery.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The transactionalLogStorageState. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState + getTransactionalLogStorageState() { + com.google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState result = + com.google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState.forNumber( + transactionalLogStorageState_); + return result == null + ? com.google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. This value contains the storage location of transactional logs
+     * for the database for point-in-time recovery.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The transactionalLogStorageState to set. + * @return This builder for chaining. + */ + public Builder setTransactionalLogStorageState( + com.google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + transactionalLogStorageState_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This value contains the storage location of transactional logs
+     * for the database for point-in-time recovery.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransactionalLogStorageState() { + bitField0_ = (bitField0_ & ~0x00000200); + transactionalLogStorageState_ = 0; + onChanged(); + return this; + } + + private int backupTier_ = 0; + + /** + * + * + *
+     * Output only. Backup tier that manages the backups for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.BackupTier backup_tier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupTier field is set. + */ + @java.lang.Override + public boolean hasBackupTier() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Output only. Backup tier that manages the backups for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.BackupTier backup_tier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for backupTier. + */ + @java.lang.Override + public int getBackupTierValue() { + return backupTier_; + } + + /** + * + * + *
+     * Output only. Backup tier that manages the backups for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.BackupTier backup_tier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for backupTier to set. + * @return This builder for chaining. + */ + public Builder setBackupTierValue(int value) { + backupTier_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Backup tier that manages the backups for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.BackupTier backup_tier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupTier. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupConfiguration.BackupTier getBackupTier() { + com.google.cloud.sql.v1beta4.BackupConfiguration.BackupTier result = + com.google.cloud.sql.v1beta4.BackupConfiguration.BackupTier.forNumber(backupTier_); + return result == null + ? com.google.cloud.sql.v1beta4.BackupConfiguration.BackupTier.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. Backup tier that manages the backups for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.BackupTier backup_tier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The backupTier to set. + * @return This builder for chaining. + */ + public Builder setBackupTier( + com.google.cloud.sql.v1beta4.BackupConfiguration.BackupTier value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + backupTier_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Backup tier that manages the backups for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.BackupTier backup_tier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearBackupTier() { + bitField0_ = (bitField0_ & ~0x00000400); + backupTier_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.BackupConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.BackupConfiguration) + private static final com.google.cloud.sql.v1beta4.BackupConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.BackupConfiguration(); + } + + public static com.google.cloud.sql.v1beta4.BackupConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupConfigurationOrBuilder.java new file mode 100644 index 000000000000..9fe81315ac08 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupConfigurationOrBuilder.java @@ -0,0 +1,431 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface BackupConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.BackupConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Start time for the daily backup configuration in UTC timezone in the 24
+   * hour format - `HH:MM`.
+   * 
+ * + * string start_time = 1; + * + * @return The startTime. + */ + java.lang.String getStartTime(); + + /** + * + * + *
+   * Start time for the daily backup configuration in UTC timezone in the 24
+   * hour format - `HH:MM`.
+   * 
+ * + * string start_time = 1; + * + * @return The bytes for startTime. + */ + com.google.protobuf.ByteString getStartTimeBytes(); + + /** + * + * + *
+   * Whether this configuration is enabled.
+   * 
+ * + * .google.protobuf.BoolValue enabled = 2; + * + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + + /** + * + * + *
+   * Whether this configuration is enabled.
+   * 
+ * + * .google.protobuf.BoolValue enabled = 2; + * + * @return The enabled. + */ + com.google.protobuf.BoolValue getEnabled(); + + /** + * + * + *
+   * Whether this configuration is enabled.
+   * 
+ * + * .google.protobuf.BoolValue enabled = 2; + */ + com.google.protobuf.BoolValueOrBuilder getEnabledOrBuilder(); + + /** + * + * + *
+   * This is always `sql#backupConfiguration`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#backupConfiguration`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * (MySQL only) Whether binary log is enabled. If backup configuration is
+   * disabled, binarylog must be disabled as well.
+   * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + * + * @return Whether the binaryLogEnabled field is set. + */ + boolean hasBinaryLogEnabled(); + + /** + * + * + *
+   * (MySQL only) Whether binary log is enabled. If backup configuration is
+   * disabled, binarylog must be disabled as well.
+   * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + * + * @return The binaryLogEnabled. + */ + com.google.protobuf.BoolValue getBinaryLogEnabled(); + + /** + * + * + *
+   * (MySQL only) Whether binary log is enabled. If backup configuration is
+   * disabled, binarylog must be disabled as well.
+   * 
+ * + * .google.protobuf.BoolValue binary_log_enabled = 4; + */ + com.google.protobuf.BoolValueOrBuilder getBinaryLogEnabledOrBuilder(); + + /** + * + * + *
+   * Reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + * + * @return Whether the replicationLogArchivingEnabled field is set. + */ + boolean hasReplicationLogArchivingEnabled(); + + /** + * + * + *
+   * Reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + * + * @return The replicationLogArchivingEnabled. + */ + com.google.protobuf.BoolValue getReplicationLogArchivingEnabled(); + + /** + * + * + *
+   * Reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue replication_log_archiving_enabled = 5; + */ + com.google.protobuf.BoolValueOrBuilder getReplicationLogArchivingEnabledOrBuilder(); + + /** + * + * + *
+   * Location of the backup
+   * 
+ * + * string location = 6; + * + * @return The location. + */ + java.lang.String getLocation(); + + /** + * + * + *
+   * Location of the backup
+   * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Whether point in time recovery is enabled.
+   * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + * + * @return Whether the pointInTimeRecoveryEnabled field is set. + */ + boolean hasPointInTimeRecoveryEnabled(); + + /** + * + * + *
+   * Whether point in time recovery is enabled.
+   * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + * + * @return The pointInTimeRecoveryEnabled. + */ + com.google.protobuf.BoolValue getPointInTimeRecoveryEnabled(); + + /** + * + * + *
+   * Whether point in time recovery is enabled.
+   * 
+ * + * .google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + */ + com.google.protobuf.BoolValueOrBuilder getPointInTimeRecoveryEnabledOrBuilder(); + + /** + * + * + *
+   * The number of days of transaction logs we retain for point in time
+   * restore, from 1-7.
+   * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + * + * @return Whether the transactionLogRetentionDays field is set. + */ + boolean hasTransactionLogRetentionDays(); + + /** + * + * + *
+   * The number of days of transaction logs we retain for point in time
+   * restore, from 1-7.
+   * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + * + * @return The transactionLogRetentionDays. + */ + com.google.protobuf.Int32Value getTransactionLogRetentionDays(); + + /** + * + * + *
+   * The number of days of transaction logs we retain for point in time
+   * restore, from 1-7.
+   * 
+ * + * .google.protobuf.Int32Value transaction_log_retention_days = 9; + */ + com.google.protobuf.Int32ValueOrBuilder getTransactionLogRetentionDaysOrBuilder(); + + /** + * + * + *
+   * Backup retention settings.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + * + * @return Whether the backupRetentionSettings field is set. + */ + boolean hasBackupRetentionSettings(); + + /** + * + * + *
+   * Backup retention settings.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + * + * @return The backupRetentionSettings. + */ + com.google.cloud.sql.v1beta4.BackupRetentionSettings getBackupRetentionSettings(); + + /** + * + * + *
+   * Backup retention settings.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings backup_retention_settings = 10; + */ + com.google.cloud.sql.v1beta4.BackupRetentionSettingsOrBuilder + getBackupRetentionSettingsOrBuilder(); + + /** + * + * + *
+   * Output only. This value contains the storage location of transactional logs
+   * for the database for point-in-time recovery.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the transactionalLogStorageState field is set. + */ + boolean hasTransactionalLogStorageState(); + + /** + * + * + *
+   * Output only. This value contains the storage location of transactional logs
+   * for the database for point-in-time recovery.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for transactionalLogStorageState. + */ + int getTransactionalLogStorageStateValue(); + + /** + * + * + *
+   * Output only. This value contains the storage location of transactional logs
+   * for the database for point-in-time recovery.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState transactional_log_storage_state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The transactionalLogStorageState. + */ + com.google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState + getTransactionalLogStorageState(); + + /** + * + * + *
+   * Output only. Backup tier that manages the backups for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.BackupTier backup_tier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupTier field is set. + */ + boolean hasBackupTier(); + + /** + * + * + *
+   * Output only. Backup tier that manages the backups for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.BackupTier backup_tier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for backupTier. + */ + int getBackupTierValue(); + + /** + * + * + *
+   * Output only. Backup tier that manages the backups for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupConfiguration.BackupTier backup_tier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupTier. + */ + com.google.cloud.sql.v1beta4.BackupConfiguration.BackupTier getBackupTier(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupContext.java new file mode 100644 index 000000000000..764aaffc687f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupContext.java @@ -0,0 +1,888 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Backup context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.BackupContext} + */ +@com.google.protobuf.Generated +public final class BackupContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.BackupContext) + BackupContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupContext"); + } + + // Use BackupContext.newBuilder() to construct. + private BackupContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackupContext() { + kind_ = ""; + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.BackupContext.class, + com.google.cloud.sql.v1beta4.BackupContext.Builder.class); + } + + public static final int BACKUP_ID_FIELD_NUMBER = 1; + private long backupId_ = 0L; + + /** + * + * + *
+   * The identifier of the backup.
+   * 
+ * + * int64 backup_id = 1; + * + * @return The backupId. + */ + @java.lang.Override + public long getBackupId() { + return backupId_; + } + + public static final int KIND_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#backupContext`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#backupContext`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the backup.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * string name = 3; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the backup.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * string name = 3; + * + * @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 (backupId_ != 0L) { + output.writeInt64(1, backupId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (backupId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, backupId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, 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.sql.v1beta4.BackupContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.BackupContext other = + (com.google.cloud.sql.v1beta4.BackupContext) obj; + + if (getBackupId() != other.getBackupId()) return false; + if (!getKind().equals(other.getKind())) return false; + 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) + BACKUP_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getBackupId()); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().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.sql.v1beta4.BackupContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.BackupContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Backup context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.BackupContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.BackupContext) + com.google.cloud.sql.v1beta4.BackupContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.BackupContext.class, + com.google.cloud.sql.v1beta4.BackupContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.BackupContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backupId_ = 0L; + kind_ = ""; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.BackupContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupContext build() { + com.google.cloud.sql.v1beta4.BackupContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupContext buildPartial() { + com.google.cloud.sql.v1beta4.BackupContext result = + new com.google.cloud.sql.v1beta4.BackupContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.BackupContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backupId_ = backupId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.BackupContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.BackupContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.BackupContext other) { + if (other == com.google.cloud.sql.v1beta4.BackupContext.getDefaultInstance()) return this; + if (other.getBackupId() != 0L) { + setBackupId(other.getBackupId()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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 8: + { + backupId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + name_ = 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 long backupId_; + + /** + * + * + *
+     * The identifier of the backup.
+     * 
+ * + * int64 backup_id = 1; + * + * @return The backupId. + */ + @java.lang.Override + public long getBackupId() { + return backupId_; + } + + /** + * + * + *
+     * The identifier of the backup.
+     * 
+ * + * int64 backup_id = 1; + * + * @param value The backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupId(long value) { + + backupId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The identifier of the backup.
+     * 
+ * + * int64 backup_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearBackupId() { + bitField0_ = (bitField0_ & ~0x00000001); + backupId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#backupContext`.
+     * 
+ * + * string kind = 2; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupContext`.
+     * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupContext`.
+     * 
+ * + * string kind = 2; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupContext`.
+     * 
+ * + * string kind = 2; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupContext`.
+     * 
+ * + * string kind = 2; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the backup.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * string name = 3; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the backup.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * string name = 3; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the backup.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * string name = 3; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * string name = 3; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * string name = 3; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.BackupContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.BackupContext) + private static final com.google.cloud.sql.v1beta4.BackupContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.BackupContext(); + } + + public static com.google.cloud.sql.v1beta4.BackupContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupContextOrBuilder.java new file mode 100644 index 000000000000..e7498092ae1f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupContextOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface BackupContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.BackupContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The identifier of the backup.
+   * 
+ * + * int64 backup_id = 1; + * + * @return The backupId. + */ + long getBackupId(); + + /** + * + * + *
+   * This is always `sql#backupContext`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#backupContext`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The name of the backup.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * string name = 3; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the backup.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * string name = 3; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupName.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupName.java new file mode 100644 index 000000000000..3fb0312e1f88 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupName.java @@ -0,0 +1,194 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +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; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@NullMarked +@Generated("by gapic-generator-java") +public class BackupName implements ResourceName { + private static final PathTemplate PROJECT_BACKUP = + PathTemplate.createWithoutUrlEncoding("projects/{project}/backups/{backup}"); + private volatile Map fieldValuesMap; + private final String project; + private final String backup; + + @Deprecated + protected BackupName() { + project = null; + backup = null; + } + + private BackupName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + backup = Preconditions.checkNotNull(builder.getBackup()); + } + + public String getProject() { + return project; + } + + public String getBackup() { + return backup; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BackupName of(String project, String backup) { + return newBuilder().setProject(project).setBackup(backup).build(); + } + + public static String format(String project, String backup) { + return newBuilder().setProject(project).setBackup(backup).build().toString(); + } + + public static @Nullable BackupName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_BACKUP.validatedMatch( + formattedString, "BackupName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("backup")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List<@Nullable BackupName> values) { + List list = new ArrayList<>(values.size()); + for (BackupName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_BACKUP.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (backup != null) { + fieldMapBuilder.put("backup", backup); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_BACKUP.instantiate("project", project, "backup", backup); + } + + @Override + public boolean equals(@Nullable Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + BackupName that = ((BackupName) o); + return Objects.equals(this.project, that.project) && Objects.equals(this.backup, that.backup); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(backup); + return h; + } + + /** Builder for projects/{project}/backups/{backup}. */ + public static class Builder { + private String project; + private String backup; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getBackup() { + return backup; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setBackup(String backup) { + this.backup = backup; + return this; + } + + private Builder(BackupName backupName) { + this.project = backupName.project; + this.backup = backupName.backup; + } + + public BackupName build() { + return new BackupName(this); + } + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupOrBuilder.java new file mode 100644 index 000000000000..f398927fee95 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupOrBuilder.java @@ -0,0 +1,806 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface BackupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.Backup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the backup.
+   * Format: projects/{project}/backups/{backup}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Output only. The resource name of the backup.
+   * Format: projects/{project}/backups/{backup}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. This is always `sql#backup`.
+   * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * Output only. This is always `sql#backup`.
+   * 
+ * + * string kind = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Output only. The URI of this resource.
+   * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The selfLink. + */ + java.lang.String getSelfLink(); + + /** + * + * + *
+   * Output only. The URI of this resource.
+   * 
+ * + * string self_link = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for selfLink. + */ + com.google.protobuf.ByteString getSelfLinkBytes(); + + /** + * + * + *
+   * Output only. The type of this backup. The type can be "AUTOMATED",
+   * "ON_DEMAND", or “FINAL”.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * Output only. The type of this backup. The type can be "AUTOMATED",
+   * "ON_DEMAND", or “FINAL”.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + com.google.cloud.sql.v1beta4.Backup.SqlBackupType getType(); + + /** + * + * + *
+   * The description of this backup.
+   * 
+ * + * string description = 5; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * The description of this backup.
+   * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * The name of the database instance.
+   * 
+ * + * string instance = 6; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * The name of the database instance.
+   * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * The storage location of the backups. The location can be multi-regional.
+   * 
+ * + * string location = 7; + * + * @return The location. + */ + java.lang.String getLocation(); + + /** + * + * + *
+   * The storage location of the backups. The location can be multi-regional.
+   * 
+ * + * string location = 7; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Output only. This output contains the following values:
+   * start_time: All database writes up to this time are available.
+   * end_time: Any database writes after this time aren't available.
+   * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the backupInterval field is set. + */ + boolean hasBackupInterval(); + + /** + * + * + *
+   * Output only. This output contains the following values:
+   * start_time: All database writes up to this time are available.
+   * end_time: Any database writes after this time aren't available.
+   * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupInterval. + */ + com.google.type.Interval getBackupInterval(); + + /** + * + * + *
+   * Output only. This output contains the following values:
+   * start_time: All database writes up to this time are available.
+   * end_time: Any database writes after this time aren't available.
+   * 
+ * + * .google.type.Interval backup_interval = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.type.IntervalOrBuilder getBackupIntervalOrBuilder(); + + /** + * + * + *
+   * Output only. The state of this backup.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+   * Output only. The state of this backup.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.Backup.SqlBackupState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.sql.v1beta4.Backup.SqlBackupState getState(); + + /** + * + * + *
+   * Output only. Information about why the backup operation fails (for example,
+   * when the backup state fails).
+   * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
+   * Output only. Information about why the backup operation fails (for example,
+   * when the backup state fails).
+   * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The error. + */ + com.google.cloud.sql.v1beta4.OperationError getError(); + + /** + * + * + *
+   * Output only. Information about why the backup operation fails (for example,
+   * when the backup state fails).
+   * 
+ * + * + * .google.cloud.sql.v1beta4.OperationError error = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.OperationErrorOrBuilder getErrorOrBuilder(); + + /** + * + * + *
+   * Output only. This output contains the encryption configuration for a backup
+   * and the resource name of the KMS key for disk encryption.
+   * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsKey. + */ + java.lang.String getKmsKey(); + + /** + * + * + *
+   * Output only. This output contains the encryption configuration for a backup
+   * and the resource name of the KMS key for disk encryption.
+   * 
+ * + * string kms_key = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsKey. + */ + com.google.protobuf.ByteString getKmsKeyBytes(); + + /** + * + * + *
+   * Output only. This output contains the encryption status for a backup and
+   * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+   * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsKeyVersion. + */ + java.lang.String getKmsKeyVersion(); + + /** + * + * + *
+   * Output only. This output contains the encryption status for a backup and
+   * the version of the KMS key that's used to encrypt the Cloud SQL instance.
+   * 
+ * + * string kms_key_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsKeyVersion. + */ + com.google.protobuf.ByteString getKmsKeyVersionBytes(); + + /** + * + * + *
+   * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for backupKind. + */ + int getBackupKindValue(); + + /** + * + * + *
+   * Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The backupKind. + */ + com.google.cloud.sql.v1beta4.SqlBackupKind getBackupKind(); + + /** + * + * + *
+   * Output only. This output contains a backup time zone. If a Cloud SQL for
+   * SQL Server instance has a different time zone from the backup's time zone,
+   * then the restore to the instance doesn't happen.
+   * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The timeZone. + */ + java.lang.String getTimeZone(); + + /** + * + * + *
+   * Output only. This output contains a backup time zone. If a Cloud SQL for
+   * SQL Server instance has a different time zone from the backup's time zone,
+   * then the restore to the instance doesn't happen.
+   * 
+ * + * string time_zone = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for timeZone. + */ + com.google.protobuf.ByteString getTimeZoneBytes(); + + /** + * + * + *
+   * Input only. The time-to-live (TTL) interval for this resource (in days).
+   * For example: ttlDays:7, means 7 days from the current time. The
+   * expiration time can't exceed 365 days from the time that the backup is
+   * created.
+   * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttlDays field is set. + */ + boolean hasTtlDays(); + + /** + * + * + *
+   * Input only. The time-to-live (TTL) interval for this resource (in days).
+   * For example: ttlDays:7, means 7 days from the current time. The
+   * expiration time can't exceed 365 days from the time that the backup is
+   * created.
+   * 
+ * + * int64 ttl_days = 16 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttlDays. + */ + long getTtlDays(); + + /** + * + * + *
+   * Backup expiration time.
+   * A UTC timestamp of when this resource expired.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + * + * @return Whether the expiryTime field is set. + */ + boolean hasExpiryTime(); + + /** + * + * + *
+   * Backup expiration time.
+   * A UTC timestamp of when this resource expired.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + * + * @return The expiryTime. + */ + com.google.protobuf.Timestamp getExpiryTime(); + + /** + * + * + *
+   * Backup expiration time.
+   * A UTC timestamp of when this resource expired.
+   * 
+ * + * .google.protobuf.Timestamp expiry_time = 17; + */ + com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The database version of the instance of at the time this
+   * backup was made.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + int getDatabaseVersionValue(); + + /** + * + * + *
+   * Output only. The database version of the instance of at the time this
+   * backup was made.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + com.google.cloud.sql.v1beta4.SqlDatabaseVersion getDatabaseVersion(); + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maxChargeableBytes field is set. + */ + boolean hasMaxChargeableBytes(); + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maxChargeableBytes. + */ + long getMaxChargeableBytes(); + + /** + * + * + *
+   * Optional. Output only. Timestamp in UTC of when the instance associated
+   * with this backup is deleted.
+   * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceDeletionTime field is set. + */ + boolean hasInstanceDeletionTime(); + + /** + * + * + *
+   * Optional. Output only. Timestamp in UTC of when the instance associated
+   * with this backup is deleted.
+   * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceDeletionTime. + */ + com.google.protobuf.Timestamp getInstanceDeletionTime(); + + /** + * + * + *
+   * Optional. Output only. Timestamp in UTC of when the instance associated
+   * with this backup is deleted.
+   * 
+ * + * + * .google.protobuf.Timestamp instance_deletion_time = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getInstanceDeletionTimeOrBuilder(); + + /** + * + * + *
+   * Optional. Output only. Instance setting of the source instance that's
+   * associated with this backup.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceSettings field is set. + */ + boolean hasInstanceSettings(); + + /** + * + * + *
+   * Optional. Output only. Instance setting of the source instance that's
+   * associated with this backup.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceSettings. + */ + com.google.cloud.sql.v1beta4.DatabaseInstance getInstanceSettings(); + + /** + * + * + *
+   * Optional. Output only. Instance setting of the source instance that's
+   * associated with this backup.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance instance_settings = 25 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getInstanceSettingsOrBuilder(); + + /** + * + * + *
+   * Output only. The mapping to backup run resource used for IAM validations.
+   * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backupRun. + */ + java.lang.String getBackupRun(); + + /** + * + * + *
+   * Output only. The mapping to backup run resource used for IAM validations.
+   * 
+ * + * string backup_run = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backupRun. + */ + com.google.protobuf.ByteString getBackupRunBytes(); + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + boolean hasSatisfiesPzs(); + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + com.google.protobuf.BoolValue getSatisfiesPzs(); + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder(); + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzi field is set. + */ + boolean hasSatisfiesPzi(); + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzi. + */ + com.google.protobuf.BoolValue getSatisfiesPzi(); + + /** + * + * + *
+   * Output only. This status indicates whether the backup satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.BoolValueOrBuilder getSatisfiesPziOrBuilder(); + + com.google.cloud.sql.v1beta4.Backup.ExpirationCase getExpirationCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupReencryptionConfig.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupReencryptionConfig.java new file mode 100644 index 000000000000..e7b66d35fc2a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupReencryptionConfig.java @@ -0,0 +1,924 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Backup Reencryption Config
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.BackupReencryptionConfig} + */ +@com.google.protobuf.Generated +public final class BackupReencryptionConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.BackupReencryptionConfig) + BackupReencryptionConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupReencryptionConfig"); + } + + // Use BackupReencryptionConfig.newBuilder() to construct. + private BackupReencryptionConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackupReencryptionConfig() { + backupType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_BackupReencryptionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_BackupReencryptionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.BackupReencryptionConfig.class, + com.google.cloud.sql.v1beta4.BackupReencryptionConfig.Builder.class); + } + + /** + * + * + *
+   * Backup type for re-encryption
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType} + */ + public enum BackupType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown backup type, will be defaulted to AUTOMATIC backup type
+     * 
+ * + * BACKUP_TYPE_UNSPECIFIED = 0; + */ + BACKUP_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Reencrypt automatic backups
+     * 
+ * + * AUTOMATED = 1; + */ + AUTOMATED(1), + /** + * + * + *
+     * Reencrypt on-demand backups
+     * 
+ * + * ON_DEMAND = 2; + */ + ON_DEMAND(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupType"); + } + + /** + * + * + *
+     * Unknown backup type, will be defaulted to AUTOMATIC backup type
+     * 
+ * + * BACKUP_TYPE_UNSPECIFIED = 0; + */ + public static final int BACKUP_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Reencrypt automatic backups
+     * 
+ * + * AUTOMATED = 1; + */ + public static final int AUTOMATED_VALUE = 1; + + /** + * + * + *
+     * Reencrypt on-demand backups
+     * 
+ * + * ON_DEMAND = 2; + */ + public static final int ON_DEMAND_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 BackupType 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 BackupType forNumber(int value) { + switch (value) { + case 0: + return BACKUP_TYPE_UNSPECIFIED; + case 1: + return AUTOMATED; + case 2: + return ON_DEMAND; + 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 BackupType findValueByNumber(int number) { + return BackupType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.BackupReencryptionConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final BackupType[] VALUES = values(); + + public static BackupType 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 BackupType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType) + } + + private int bitField0_; + public static final int BACKUP_LIMIT_FIELD_NUMBER = 1; + private int backupLimit_ = 0; + + /** + * + * + *
+   * Backup re-encryption limit
+   * 
+ * + * optional int32 backup_limit = 1; + * + * @return Whether the backupLimit field is set. + */ + @java.lang.Override + public boolean hasBackupLimit() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Backup re-encryption limit
+   * 
+ * + * optional int32 backup_limit = 1; + * + * @return The backupLimit. + */ + @java.lang.Override + public int getBackupLimit() { + return backupLimit_; + } + + public static final int BACKUP_TYPE_FIELD_NUMBER = 2; + private int backupType_ = 0; + + /** + * + * + *
+   * Type of backups users want to re-encrypt.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @return Whether the backupType field is set. + */ + @java.lang.Override + public boolean hasBackupType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Type of backups users want to re-encrypt.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @return The enum numeric value on the wire for backupType. + */ + @java.lang.Override + public int getBackupTypeValue() { + return backupType_; + } + + /** + * + * + *
+   * Type of backups users want to re-encrypt.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @return The backupType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType getBackupType() { + com.google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType result = + com.google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType.forNumber(backupType_); + return result == null + ? com.google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, backupLimit_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeEnum(2, backupType_); + } + 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, backupLimit_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, backupType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.BackupReencryptionConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.BackupReencryptionConfig other = + (com.google.cloud.sql.v1beta4.BackupReencryptionConfig) obj; + + if (hasBackupLimit() != other.hasBackupLimit()) return false; + if (hasBackupLimit()) { + if (getBackupLimit() != other.getBackupLimit()) return false; + } + if (hasBackupType() != other.hasBackupType()) return false; + if (hasBackupType()) { + if (backupType_ != other.backupType_) return false; + } + if (!getUnknownFields().equals(other.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 (hasBackupLimit()) { + hash = (37 * hash) + BACKUP_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getBackupLimit(); + } + if (hasBackupType()) { + hash = (37 * hash) + BACKUP_TYPE_FIELD_NUMBER; + hash = (53 * hash) + backupType_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.BackupReencryptionConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupReencryptionConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupReencryptionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupReencryptionConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupReencryptionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupReencryptionConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupReencryptionConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupReencryptionConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupReencryptionConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupReencryptionConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupReencryptionConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupReencryptionConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.BackupReencryptionConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Backup Reencryption Config
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.BackupReencryptionConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.BackupReencryptionConfig) + com.google.cloud.sql.v1beta4.BackupReencryptionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_BackupReencryptionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_BackupReencryptionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.BackupReencryptionConfig.class, + com.google.cloud.sql.v1beta4.BackupReencryptionConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.BackupReencryptionConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backupLimit_ = 0; + backupType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_BackupReencryptionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupReencryptionConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.BackupReencryptionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupReencryptionConfig build() { + com.google.cloud.sql.v1beta4.BackupReencryptionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupReencryptionConfig buildPartial() { + com.google.cloud.sql.v1beta4.BackupReencryptionConfig result = + new com.google.cloud.sql.v1beta4.BackupReencryptionConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.BackupReencryptionConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backupLimit_ = backupLimit_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupType_ = backupType_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.BackupReencryptionConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.BackupReencryptionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.BackupReencryptionConfig other) { + if (other == com.google.cloud.sql.v1beta4.BackupReencryptionConfig.getDefaultInstance()) + return this; + if (other.hasBackupLimit()) { + setBackupLimit(other.getBackupLimit()); + } + if (other.hasBackupType()) { + setBackupTypeValue(other.getBackupTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + backupLimit_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + backupType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int backupLimit_; + + /** + * + * + *
+     * Backup re-encryption limit
+     * 
+ * + * optional int32 backup_limit = 1; + * + * @return Whether the backupLimit field is set. + */ + @java.lang.Override + public boolean hasBackupLimit() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Backup re-encryption limit
+     * 
+ * + * optional int32 backup_limit = 1; + * + * @return The backupLimit. + */ + @java.lang.Override + public int getBackupLimit() { + return backupLimit_; + } + + /** + * + * + *
+     * Backup re-encryption limit
+     * 
+ * + * optional int32 backup_limit = 1; + * + * @param value The backupLimit to set. + * @return This builder for chaining. + */ + public Builder setBackupLimit(int value) { + + backupLimit_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Backup re-encryption limit
+     * 
+ * + * optional int32 backup_limit = 1; + * + * @return This builder for chaining. + */ + public Builder clearBackupLimit() { + bitField0_ = (bitField0_ & ~0x00000001); + backupLimit_ = 0; + onChanged(); + return this; + } + + private int backupType_ = 0; + + /** + * + * + *
+     * Type of backups users want to re-encrypt.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @return Whether the backupType field is set. + */ + @java.lang.Override + public boolean hasBackupType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Type of backups users want to re-encrypt.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @return The enum numeric value on the wire for backupType. + */ + @java.lang.Override + public int getBackupTypeValue() { + return backupType_; + } + + /** + * + * + *
+     * Type of backups users want to re-encrypt.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @param value The enum numeric value on the wire for backupType to set. + * @return This builder for chaining. + */ + public Builder setBackupTypeValue(int value) { + backupType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Type of backups users want to re-encrypt.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @return The backupType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType getBackupType() { + com.google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType result = + com.google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType.forNumber(backupType_); + return result == null + ? com.google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Type of backups users want to re-encrypt.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @param value The backupType to set. + * @return This builder for chaining. + */ + public Builder setBackupType( + com.google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + backupType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Type of backups users want to re-encrypt.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearBackupType() { + bitField0_ = (bitField0_ & ~0x00000002); + backupType_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.BackupReencryptionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.BackupReencryptionConfig) + private static final com.google.cloud.sql.v1beta4.BackupReencryptionConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.BackupReencryptionConfig(); + } + + public static com.google.cloud.sql.v1beta4.BackupReencryptionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupReencryptionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupReencryptionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupReencryptionConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupReencryptionConfigOrBuilder.java new file mode 100644 index 000000000000..3de428ee7183 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupReencryptionConfigOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface BackupReencryptionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.BackupReencryptionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Backup re-encryption limit
+   * 
+ * + * optional int32 backup_limit = 1; + * + * @return Whether the backupLimit field is set. + */ + boolean hasBackupLimit(); + + /** + * + * + *
+   * Backup re-encryption limit
+   * 
+ * + * optional int32 backup_limit = 1; + * + * @return The backupLimit. + */ + int getBackupLimit(); + + /** + * + * + *
+   * Type of backups users want to re-encrypt.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @return Whether the backupType field is set. + */ + boolean hasBackupType(); + + /** + * + * + *
+   * Type of backups users want to re-encrypt.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @return The enum numeric value on the wire for backupType. + */ + int getBackupTypeValue(); + + /** + * + * + *
+   * Type of backups users want to re-encrypt.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType backup_type = 2; + * + * + * @return The backupType. + */ + com.google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType getBackupType(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRetentionSettings.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRetentionSettings.java new file mode 100644 index 000000000000..623604b867dd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRetentionSettings.java @@ -0,0 +1,1049 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * We currently only support backup retention by specifying the number
+ * of backups we will retain.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.BackupRetentionSettings} + */ +@com.google.protobuf.Generated +public final class BackupRetentionSettings extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.BackupRetentionSettings) + BackupRetentionSettingsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupRetentionSettings"); + } + + // Use BackupRetentionSettings.newBuilder() to construct. + private BackupRetentionSettings(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackupRetentionSettings() { + retentionUnit_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRetentionSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRetentionSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.BackupRetentionSettings.class, + com.google.cloud.sql.v1beta4.BackupRetentionSettings.Builder.class); + } + + /** + * + * + *
+   * The units that retained_backups specifies, we only support COUNT.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit} + */ + public enum RetentionUnit implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Backup retention unit is unspecified, will be treated as COUNT.
+     * 
+ * + * RETENTION_UNIT_UNSPECIFIED = 0; + */ + RETENTION_UNIT_UNSPECIFIED(0), + /** + * + * + *
+     * Retention will be by count, eg. "retain the most recent 7 backups".
+     * 
+ * + * COUNT = 1; + */ + COUNT(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RetentionUnit"); + } + + /** + * + * + *
+     * Backup retention unit is unspecified, will be treated as COUNT.
+     * 
+ * + * RETENTION_UNIT_UNSPECIFIED = 0; + */ + public static final int RETENTION_UNIT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Retention will be by count, eg. "retain the most recent 7 backups".
+     * 
+ * + * COUNT = 1; + */ + public static final int COUNT_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RetentionUnit 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 RetentionUnit forNumber(int value) { + switch (value) { + case 0: + return RETENTION_UNIT_UNSPECIFIED; + case 1: + return COUNT; + 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 RetentionUnit findValueByNumber(int number) { + return RetentionUnit.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.BackupRetentionSettings.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final RetentionUnit[] VALUES = values(); + + public static RetentionUnit 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 RetentionUnit(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit) + } + + private int bitField0_; + public static final int RETENTION_UNIT_FIELD_NUMBER = 1; + private int retentionUnit_ = 0; + + /** + * + * + *
+   * The unit that 'retained_backups' represents.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * + * @return The enum numeric value on the wire for retentionUnit. + */ + @java.lang.Override + public int getRetentionUnitValue() { + return retentionUnit_; + } + + /** + * + * + *
+   * The unit that 'retained_backups' represents.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * + * @return The retentionUnit. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit getRetentionUnit() { + com.google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit result = + com.google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit.forNumber( + retentionUnit_); + return result == null + ? com.google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit.UNRECOGNIZED + : result; + } + + public static final int RETAINED_BACKUPS_FIELD_NUMBER = 2; + private com.google.protobuf.Int32Value retainedBackups_; + + /** + * + * + *
+   * Depending on the value of retention_unit, this is used to determine
+   * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+   * retain this many backups.
+   * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + * + * @return Whether the retainedBackups field is set. + */ + @java.lang.Override + public boolean hasRetainedBackups() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Depending on the value of retention_unit, this is used to determine
+   * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+   * retain this many backups.
+   * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + * + * @return The retainedBackups. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getRetainedBackups() { + return retainedBackups_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : retainedBackups_; + } + + /** + * + * + *
+   * Depending on the value of retention_unit, this is used to determine
+   * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+   * retain this many backups.
+   * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getRetainedBackupsOrBuilder() { + return retainedBackups_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : retainedBackups_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (retentionUnit_ + != com.google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit + .RETENTION_UNIT_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, retentionUnit_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getRetainedBackups()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (retentionUnit_ + != com.google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit + .RETENTION_UNIT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, retentionUnit_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRetainedBackups()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.BackupRetentionSettings)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.BackupRetentionSettings other = + (com.google.cloud.sql.v1beta4.BackupRetentionSettings) obj; + + if (retentionUnit_ != other.retentionUnit_) return false; + if (hasRetainedBackups() != other.hasRetainedBackups()) return false; + if (hasRetainedBackups()) { + if (!getRetainedBackups().equals(other.getRetainedBackups())) return false; + } + if (!getUnknownFields().equals(other.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) + RETENTION_UNIT_FIELD_NUMBER; + hash = (53 * hash) + retentionUnit_; + if (hasRetainedBackups()) { + hash = (37 * hash) + RETAINED_BACKUPS_FIELD_NUMBER; + hash = (53 * hash) + getRetainedBackups().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.BackupRetentionSettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupRetentionSettings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRetentionSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupRetentionSettings parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRetentionSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupRetentionSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRetentionSettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupRetentionSettings parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRetentionSettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupRetentionSettings parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRetentionSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupRetentionSettings parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.BackupRetentionSettings prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * We currently only support backup retention by specifying the number
+   * of backups we will retain.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.BackupRetentionSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.BackupRetentionSettings) + com.google.cloud.sql.v1beta4.BackupRetentionSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRetentionSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRetentionSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.BackupRetentionSettings.class, + com.google.cloud.sql.v1beta4.BackupRetentionSettings.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.BackupRetentionSettings.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRetainedBackupsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + retentionUnit_ = 0; + retainedBackups_ = null; + if (retainedBackupsBuilder_ != null) { + retainedBackupsBuilder_.dispose(); + retainedBackupsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRetentionSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRetentionSettings getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.BackupRetentionSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRetentionSettings build() { + com.google.cloud.sql.v1beta4.BackupRetentionSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRetentionSettings buildPartial() { + com.google.cloud.sql.v1beta4.BackupRetentionSettings result = + new com.google.cloud.sql.v1beta4.BackupRetentionSettings(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.BackupRetentionSettings result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.retentionUnit_ = retentionUnit_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.retainedBackups_ = + retainedBackupsBuilder_ == null ? retainedBackups_ : retainedBackupsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.BackupRetentionSettings) { + return mergeFrom((com.google.cloud.sql.v1beta4.BackupRetentionSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.BackupRetentionSettings other) { + if (other == com.google.cloud.sql.v1beta4.BackupRetentionSettings.getDefaultInstance()) + return this; + if (other.retentionUnit_ != 0) { + setRetentionUnitValue(other.getRetentionUnitValue()); + } + if (other.hasRetainedBackups()) { + mergeRetainedBackups(other.getRetainedBackups()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + retentionUnit_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetRetainedBackupsFieldBuilder().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 retentionUnit_ = 0; + + /** + * + * + *
+     * The unit that 'retained_backups' represents.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * + * @return The enum numeric value on the wire for retentionUnit. + */ + @java.lang.Override + public int getRetentionUnitValue() { + return retentionUnit_; + } + + /** + * + * + *
+     * The unit that 'retained_backups' represents.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * + * @param value The enum numeric value on the wire for retentionUnit to set. + * @return This builder for chaining. + */ + public Builder setRetentionUnitValue(int value) { + retentionUnit_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unit that 'retained_backups' represents.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * + * @return The retentionUnit. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit getRetentionUnit() { + com.google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit result = + com.google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit.forNumber( + retentionUnit_); + return result == null + ? com.google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The unit that 'retained_backups' represents.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * + * @param value The retentionUnit to set. + * @return This builder for chaining. + */ + public Builder setRetentionUnit( + com.google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + retentionUnit_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unit that 'retained_backups' represents.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearRetentionUnit() { + bitField0_ = (bitField0_ & ~0x00000001); + retentionUnit_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Int32Value retainedBackups_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + retainedBackupsBuilder_; + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + * + * @return Whether the retainedBackups field is set. + */ + public boolean hasRetainedBackups() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + * + * @return The retainedBackups. + */ + public com.google.protobuf.Int32Value getRetainedBackups() { + if (retainedBackupsBuilder_ == null) { + return retainedBackups_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : retainedBackups_; + } else { + return retainedBackupsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + public Builder setRetainedBackups(com.google.protobuf.Int32Value value) { + if (retainedBackupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retainedBackups_ = value; + } else { + retainedBackupsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + public Builder setRetainedBackups(com.google.protobuf.Int32Value.Builder builderForValue) { + if (retainedBackupsBuilder_ == null) { + retainedBackups_ = builderForValue.build(); + } else { + retainedBackupsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + public Builder mergeRetainedBackups(com.google.protobuf.Int32Value value) { + if (retainedBackupsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && retainedBackups_ != null + && retainedBackups_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getRetainedBackupsBuilder().mergeFrom(value); + } else { + retainedBackups_ = value; + } + } else { + retainedBackupsBuilder_.mergeFrom(value); + } + if (retainedBackups_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + public Builder clearRetainedBackups() { + bitField0_ = (bitField0_ & ~0x00000002); + retainedBackups_ = null; + if (retainedBackupsBuilder_ != null) { + retainedBackupsBuilder_.dispose(); + retainedBackupsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + public com.google.protobuf.Int32Value.Builder getRetainedBackupsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetRetainedBackupsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + public com.google.protobuf.Int32ValueOrBuilder getRetainedBackupsOrBuilder() { + if (retainedBackupsBuilder_ != null) { + return retainedBackupsBuilder_.getMessageOrBuilder(); + } else { + return retainedBackups_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : retainedBackups_; + } + } + + /** + * + * + *
+     * Depending on the value of retention_unit, this is used to determine
+     * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+     * retain this many backups.
+     * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetRetainedBackupsFieldBuilder() { + if (retainedBackupsBuilder_ == null) { + retainedBackupsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getRetainedBackups(), getParentForChildren(), isClean()); + retainedBackups_ = null; + } + return retainedBackupsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.BackupRetentionSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.BackupRetentionSettings) + private static final com.google.cloud.sql.v1beta4.BackupRetentionSettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.BackupRetentionSettings(); + } + + public static com.google.cloud.sql.v1beta4.BackupRetentionSettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupRetentionSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRetentionSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRetentionSettingsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRetentionSettingsOrBuilder.java new file mode 100644 index 000000000000..20254c7c08b7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRetentionSettingsOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface BackupRetentionSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.BackupRetentionSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unit that 'retained_backups' represents.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * + * @return The enum numeric value on the wire for retentionUnit. + */ + int getRetentionUnitValue(); + + /** + * + * + *
+   * The unit that 'retained_backups' represents.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit retention_unit = 1; + * + * + * @return The retentionUnit. + */ + com.google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit getRetentionUnit(); + + /** + * + * + *
+   * Depending on the value of retention_unit, this is used to determine
+   * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+   * retain this many backups.
+   * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + * + * @return Whether the retainedBackups field is set. + */ + boolean hasRetainedBackups(); + + /** + * + * + *
+   * Depending on the value of retention_unit, this is used to determine
+   * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+   * retain this many backups.
+   * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + * + * @return The retainedBackups. + */ + com.google.protobuf.Int32Value getRetainedBackups(); + + /** + * + * + *
+   * Depending on the value of retention_unit, this is used to determine
+   * if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
+   * retain this many backups.
+   * 
+ * + * .google.protobuf.Int32Value retained_backups = 2; + */ + com.google.protobuf.Int32ValueOrBuilder getRetainedBackupsOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRun.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRun.java new file mode 100644 index 000000000000..64903c26237f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRun.java @@ -0,0 +1,4574 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * A BackupRun resource.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.BackupRun} + */ +@com.google.protobuf.Generated +public final class BackupRun extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.BackupRun) + BackupRunOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupRun"); + } + + // Use BackupRun.newBuilder() to construct. + private BackupRun(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackupRun() { + kind_ = ""; + status_ = 0; + type_ = 0; + description_ = ""; + instance_ = ""; + selfLink_ = ""; + location_ = ""; + databaseVersion_ = 0; + backupKind_ = 0; + timeZone_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRun_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRun_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.BackupRun.class, + com.google.cloud.sql.v1beta4.BackupRun.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#backupRun`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#backupRun`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 2; + private int status_ = 0; + + /** + * + * + *
+   * The status of this run.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunStatus status = 2; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
+   * The status of this run.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunStatus status = 2; + * + * @return The status. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunStatus getStatus() { + com.google.cloud.sql.v1beta4.SqlBackupRunStatus result = + com.google.cloud.sql.v1beta4.SqlBackupRunStatus.forNumber(status_); + return result == null ? com.google.cloud.sql.v1beta4.SqlBackupRunStatus.UNRECOGNIZED : result; + } + + public static final int ENQUEUED_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp enqueuedTime_; + + /** + * + * + *
+   * The time the run was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + * + * @return Whether the enqueuedTime field is set. + */ + @java.lang.Override + public boolean hasEnqueuedTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time the run was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + * + * @return The enqueuedTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEnqueuedTime() { + return enqueuedTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : enqueuedTime_; + } + + /** + * + * + *
+   * The time the run was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEnqueuedTimeOrBuilder() { + return enqueuedTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : enqueuedTime_; + } + + public static final int ID_FIELD_NUMBER = 4; + private long id_ = 0L; + + /** + * + * + *
+   * The identifier for this backup run. Unique only for a specific Cloud SQL
+   * instance.
+   * 
+ * + * int64 id = 4; + * + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int START_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The time the backup operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time the backup operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The time the backup operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * The time the backup operation completed in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The time the backup operation completed in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * The time the backup operation completed in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int ERROR_FIELD_NUMBER = 7; + private com.google.cloud.sql.v1beta4.OperationError error_; + + /** + * + * + *
+   * Information about why the backup operation failed. This is only present if
+   * the run has the FAILED status.
+   * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Information about why the backup operation failed. This is only present if
+   * the run has the FAILED status.
+   * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + * + * @return The error. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationError getError() { + return error_ == null + ? com.google.cloud.sql.v1beta4.OperationError.getDefaultInstance() + : error_; + } + + /** + * + * + *
+   * Information about why the backup operation failed. This is only present if
+   * the run has the FAILED status.
+   * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationErrorOrBuilder getErrorOrBuilder() { + return error_ == null + ? com.google.cloud.sql.v1beta4.OperationError.getDefaultInstance() + : error_; + } + + public static final int TYPE_FIELD_NUMBER = 8; + private int type_ = 0; + + /** + * + * + *
+   * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+   * This field defaults to "ON_DEMAND" and is ignored, when specified for
+   * insert requests.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunType type = 8; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+   * This field defaults to "ON_DEMAND" and is ignored, when specified for
+   * insert requests.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunType type = 8; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunType getType() { + com.google.cloud.sql.v1beta4.SqlBackupRunType result = + com.google.cloud.sql.v1beta4.SqlBackupRunType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1beta4.SqlBackupRunType.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * The description of this run, only applicable to on-demand backups.
+   * 
+ * + * string description = 9; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + + /** + * + * + *
+   * The description of this run, only applicable to on-demand backups.
+   * 
+ * + * string description = 9; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WINDOW_START_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp windowStartTime_; + + /** + * + * + *
+   * The start time of the backup window during which this the backup was
+   * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+   * example `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + * + * @return Whether the windowStartTime field is set. + */ + @java.lang.Override + public boolean hasWindowStartTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * The start time of the backup window during which this the backup was
+   * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+   * example `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + * + * @return The windowStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getWindowStartTime() { + return windowStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : windowStartTime_; + } + + /** + * + * + *
+   * The start time of the backup window during which this the backup was
+   * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+   * example `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getWindowStartTimeOrBuilder() { + return windowStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : windowStartTime_; + } + + public static final int INSTANCE_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 11; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 11; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELF_LINK_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object selfLink_ = ""; + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 12; + * + * @return The selfLink. + */ + @java.lang.Override + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } + } + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 12; + * + * @return The bytes for selfLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + + /** + * + * + *
+   * Location of the backups.
+   * 
+ * + * string location = 13; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + + /** + * + * + *
+   * Location of the backups.
+   * 
+ * + * string location = 13; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_VERSION_FIELD_NUMBER = 15; + private int databaseVersion_ = 0; + + /** + * + * + *
+   * Output only. The instance database version at the time this backup was
+   * made.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+   * Output only. The instance database version at the time this backup was
+   * made.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1beta4.SqlDatabaseVersion result = + com.google.cloud.sql.v1beta4.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1beta4.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + public static final int DISK_ENCRYPTION_CONFIGURATION_FIELD_NUMBER = 16; + private com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration diskEncryptionConfiguration_; + + /** + * + * + *
+   * Encryption configuration specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + * + * @return Whether the diskEncryptionConfiguration field is set. + */ + @java.lang.Override + public boolean hasDiskEncryptionConfiguration() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Encryption configuration specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + * + * @return The diskEncryptionConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration getDiskEncryptionConfiguration() { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } + + /** + * + * + *
+   * Encryption configuration specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionConfigurationOrBuilder + getDiskEncryptionConfigurationOrBuilder() { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } + + public static final int DISK_ENCRYPTION_STATUS_FIELD_NUMBER = 17; + private com.google.cloud.sql.v1beta4.DiskEncryptionStatus diskEncryptionStatus_; + + /** + * + * + *
+   * Encryption status specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + * + * @return Whether the diskEncryptionStatus field is set. + */ + @java.lang.Override + public boolean hasDiskEncryptionStatus() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Encryption status specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + * + * @return The diskEncryptionStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionStatus getDiskEncryptionStatus() { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } + + /** + * + * + *
+   * Encryption status specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionStatusOrBuilder + getDiskEncryptionStatusOrBuilder() { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } + + public static final int BACKUP_KIND_FIELD_NUMBER = 19; + private int backupKind_ = 0; + + /** + * + * + *
+   * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 19; + * + * @return The enum numeric value on the wire for backupKind. + */ + @java.lang.Override + public int getBackupKindValue() { + return backupKind_; + } + + /** + * + * + *
+   * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 19; + * + * @return The backupKind. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupKind getBackupKind() { + com.google.cloud.sql.v1beta4.SqlBackupKind result = + com.google.cloud.sql.v1beta4.SqlBackupKind.forNumber(backupKind_); + return result == null ? com.google.cloud.sql.v1beta4.SqlBackupKind.UNRECOGNIZED : result; + } + + public static final int TIME_ZONE_FIELD_NUMBER = 23; + + @SuppressWarnings("serial") + private volatile java.lang.Object timeZone_ = ""; + + /** + * + * + *
+   * Backup time zone to prevent restores to an instance with
+   * a different time zone. Now relevant only for SQL Server.
+   * 
+ * + * string time_zone = 23; + * + * @return The timeZone. + */ + @java.lang.Override + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } + } + + /** + * + * + *
+   * Backup time zone to prevent restores to an instance with
+   * a different time zone. Now relevant only for SQL Server.
+   * 
+ * + * string time_zone = 23; + * + * @return The bytes for timeZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_CHARGEABLE_BYTES_FIELD_NUMBER = 24; + private long maxChargeableBytes_ = 0L; + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maxChargeableBytes field is set. + */ + @java.lang.Override + public boolean hasMaxChargeableBytes() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maxChargeableBytes. + */ + @java.lang.Override + public long getMaxChargeableBytes() { + return maxChargeableBytes_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (status_ + != com.google.cloud.sql.v1beta4.SqlBackupRunStatus.SQL_BACKUP_RUN_STATUS_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, status_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getEnqueuedTime()); + } + if (id_ != 0L) { + output.writeInt64(4, id_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(6, getEndTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(7, getError()); + } + if (type_ + != com.google.cloud.sql.v1beta4.SqlBackupRunType.SQL_BACKUP_RUN_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, description_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(10, getWindowStartTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, selfLink_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 13, location_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1beta4.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(15, databaseVersion_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(16, getDiskEncryptionConfiguration()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(17, getDiskEncryptionStatus()); + } + if (backupKind_ + != com.google.cloud.sql.v1beta4.SqlBackupKind.SQL_BACKUP_KIND_UNSPECIFIED.getNumber()) { + output.writeEnum(19, backupKind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(timeZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 23, timeZone_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeInt64(24, maxChargeableBytes_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (status_ + != com.google.cloud.sql.v1beta4.SqlBackupRunStatus.SQL_BACKUP_RUN_STATUS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, status_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEnqueuedTime()); + } + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, id_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getEndTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getError()); + } + if (type_ + != com.google.cloud.sql.v1beta4.SqlBackupRunType.SQL_BACKUP_RUN_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, description_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getWindowStartTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, selfLink_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(13, location_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1beta4.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(15, databaseVersion_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 16, getDiskEncryptionConfiguration()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(17, getDiskEncryptionStatus()); + } + if (backupKind_ + != com.google.cloud.sql.v1beta4.SqlBackupKind.SQL_BACKUP_KIND_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(19, backupKind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(timeZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(23, timeZone_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(24, maxChargeableBytes_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.BackupRun)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.BackupRun other = (com.google.cloud.sql.v1beta4.BackupRun) obj; + + if (!getKind().equals(other.getKind())) return false; + if (status_ != other.status_) return false; + if (hasEnqueuedTime() != other.hasEnqueuedTime()) return false; + if (hasEnqueuedTime()) { + if (!getEnqueuedTime().equals(other.getEnqueuedTime())) return false; + } + if (getId() != other.getId()) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (type_ != other.type_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasWindowStartTime() != other.hasWindowStartTime()) return false; + if (hasWindowStartTime()) { + if (!getWindowStartTime().equals(other.getWindowStartTime())) return false; + } + if (!getInstance().equals(other.getInstance())) return false; + if (!getSelfLink().equals(other.getSelfLink())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (databaseVersion_ != other.databaseVersion_) return false; + if (hasDiskEncryptionConfiguration() != other.hasDiskEncryptionConfiguration()) return false; + if (hasDiskEncryptionConfiguration()) { + if (!getDiskEncryptionConfiguration().equals(other.getDiskEncryptionConfiguration())) + return false; + } + if (hasDiskEncryptionStatus() != other.hasDiskEncryptionStatus()) return false; + if (hasDiskEncryptionStatus()) { + if (!getDiskEncryptionStatus().equals(other.getDiskEncryptionStatus())) return false; + } + if (backupKind_ != other.backupKind_) return false; + if (!getTimeZone().equals(other.getTimeZone())) return false; + if (hasMaxChargeableBytes() != other.hasMaxChargeableBytes()) return false; + if (hasMaxChargeableBytes()) { + if (getMaxChargeableBytes() != other.getMaxChargeableBytes()) return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + if (hasEnqueuedTime()) { + hash = (37 * hash) + ENQUEUED_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEnqueuedTime().hashCode(); + } + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getId()); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasWindowStartTime()) { + hash = (37 * hash) + WINDOW_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getWindowStartTime().hashCode(); + } + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + SELF_LINK_FIELD_NUMBER; + hash = (53 * hash) + getSelfLink().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (37 * hash) + DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + databaseVersion_; + if (hasDiskEncryptionConfiguration()) { + hash = (37 * hash) + DISK_ENCRYPTION_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getDiskEncryptionConfiguration().hashCode(); + } + if (hasDiskEncryptionStatus()) { + hash = (37 * hash) + DISK_ENCRYPTION_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getDiskEncryptionStatus().hashCode(); + } + hash = (37 * hash) + BACKUP_KIND_FIELD_NUMBER; + hash = (53 * hash) + backupKind_; + hash = (37 * hash) + TIME_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getTimeZone().hashCode(); + if (hasMaxChargeableBytes()) { + hash = (37 * hash) + MAX_CHARGEABLE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxChargeableBytes()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.BackupRun parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupRun parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRun parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupRun parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRun parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupRun parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRun parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupRun parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRun parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupRun parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRun parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupRun parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.BackupRun prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A BackupRun resource.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.BackupRun} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.BackupRun) + com.google.cloud.sql.v1beta4.BackupRunOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRun_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRun_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.BackupRun.class, + com.google.cloud.sql.v1beta4.BackupRun.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.BackupRun.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEnqueuedTimeFieldBuilder(); + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + internalGetErrorFieldBuilder(); + internalGetWindowStartTimeFieldBuilder(); + internalGetDiskEncryptionConfigurationFieldBuilder(); + internalGetDiskEncryptionStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + status_ = 0; + enqueuedTime_ = null; + if (enqueuedTimeBuilder_ != null) { + enqueuedTimeBuilder_.dispose(); + enqueuedTimeBuilder_ = null; + } + id_ = 0L; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + type_ = 0; + description_ = ""; + windowStartTime_ = null; + if (windowStartTimeBuilder_ != null) { + windowStartTimeBuilder_.dispose(); + windowStartTimeBuilder_ = null; + } + instance_ = ""; + selfLink_ = ""; + location_ = ""; + databaseVersion_ = 0; + diskEncryptionConfiguration_ = null; + if (diskEncryptionConfigurationBuilder_ != null) { + diskEncryptionConfigurationBuilder_.dispose(); + diskEncryptionConfigurationBuilder_ = null; + } + diskEncryptionStatus_ = null; + if (diskEncryptionStatusBuilder_ != null) { + diskEncryptionStatusBuilder_.dispose(); + diskEncryptionStatusBuilder_ = null; + } + backupKind_ = 0; + timeZone_ = ""; + maxChargeableBytes_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRun_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRun getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.BackupRun.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRun build() { + com.google.cloud.sql.v1beta4.BackupRun result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRun buildPartial() { + com.google.cloud.sql.v1beta4.BackupRun result = + new com.google.cloud.sql.v1beta4.BackupRun(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.BackupRun result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.status_ = status_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.enqueuedTime_ = + enqueuedTimeBuilder_ == null ? enqueuedTime_ : enqueuedTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.windowStartTime_ = + windowStartTimeBuilder_ == null ? windowStartTime_ : windowStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.selfLink_ = selfLink_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.databaseVersion_ = databaseVersion_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.diskEncryptionConfiguration_ = + diskEncryptionConfigurationBuilder_ == null + ? diskEncryptionConfiguration_ + : diskEncryptionConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.diskEncryptionStatus_ = + diskEncryptionStatusBuilder_ == null + ? diskEncryptionStatus_ + : diskEncryptionStatusBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.backupKind_ = backupKind_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.timeZone_ = timeZone_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.maxChargeableBytes_ = maxChargeableBytes_; + to_bitField0_ |= 0x00000080; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.BackupRun) { + return mergeFrom((com.google.cloud.sql.v1beta4.BackupRun) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.BackupRun other) { + if (other == com.google.cloud.sql.v1beta4.BackupRun.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + if (other.hasEnqueuedTime()) { + mergeEnqueuedTime(other.getEnqueuedTime()); + } + if (other.getId() != 0L) { + setId(other.getId()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.hasWindowStartTime()) { + mergeWindowStartTime(other.getWindowStartTime()); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (!other.getSelfLink().isEmpty()) { + selfLink_ = other.selfLink_; + bitField0_ |= 0x00000800; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (other.databaseVersion_ != 0) { + setDatabaseVersionValue(other.getDatabaseVersionValue()); + } + if (other.hasDiskEncryptionConfiguration()) { + mergeDiskEncryptionConfiguration(other.getDiskEncryptionConfiguration()); + } + if (other.hasDiskEncryptionStatus()) { + mergeDiskEncryptionStatus(other.getDiskEncryptionStatus()); + } + if (other.backupKind_ != 0) { + setBackupKindValue(other.getBackupKindValue()); + } + if (!other.getTimeZone().isEmpty()) { + timeZone_ = other.timeZone_; + bitField0_ |= 0x00020000; + onChanged(); + } + if (other.hasMaxChargeableBytes()) { + setMaxChargeableBytes(other.getMaxChargeableBytes()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + status_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage( + internalGetEnqueuedTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + id_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 74: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + input.readMessage( + internalGetWindowStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + selfLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 106: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 120: + { + databaseVersion_ = input.readEnum(); + bitField0_ |= 0x00002000; + break; + } // case 120 + case 130: + { + input.readMessage( + internalGetDiskEncryptionConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00004000; + break; + } // case 130 + case 138: + { + input.readMessage( + internalGetDiskEncryptionStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00008000; + break; + } // case 138 + case 152: + { + backupKind_ = input.readEnum(); + bitField0_ |= 0x00010000; + break; + } // case 152 + case 186: + { + timeZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00020000; + break; + } // case 186 + case 192: + { + maxChargeableBytes_ = input.readInt64(); + bitField0_ |= 0x00040000; + break; + } // case 192 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#backupRun`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupRun`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupRun`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupRun`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupRun`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int status_ = 0; + + /** + * + * + *
+     * The status of this run.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunStatus status = 2; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
+     * The status of this run.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunStatus status = 2; + * + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + status_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The status of this run.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunStatus status = 2; + * + * @return The status. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunStatus getStatus() { + com.google.cloud.sql.v1beta4.SqlBackupRunStatus result = + com.google.cloud.sql.v1beta4.SqlBackupRunStatus.forNumber(status_); + return result == null ? com.google.cloud.sql.v1beta4.SqlBackupRunStatus.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The status of this run.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunStatus status = 2; + * + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(com.google.cloud.sql.v1beta4.SqlBackupRunStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + status_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The status of this run.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunStatus status = 2; + * + * @return This builder for chaining. + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000002); + status_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp enqueuedTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + enqueuedTimeBuilder_; + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + * + * @return Whether the enqueuedTime field is set. + */ + public boolean hasEnqueuedTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + * + * @return The enqueuedTime. + */ + public com.google.protobuf.Timestamp getEnqueuedTime() { + if (enqueuedTimeBuilder_ == null) { + return enqueuedTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : enqueuedTime_; + } else { + return enqueuedTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + public Builder setEnqueuedTime(com.google.protobuf.Timestamp value) { + if (enqueuedTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enqueuedTime_ = value; + } else { + enqueuedTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + public Builder setEnqueuedTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (enqueuedTimeBuilder_ == null) { + enqueuedTime_ = builderForValue.build(); + } else { + enqueuedTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + public Builder mergeEnqueuedTime(com.google.protobuf.Timestamp value) { + if (enqueuedTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && enqueuedTime_ != null + && enqueuedTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEnqueuedTimeBuilder().mergeFrom(value); + } else { + enqueuedTime_ = value; + } + } else { + enqueuedTimeBuilder_.mergeFrom(value); + } + if (enqueuedTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + public Builder clearEnqueuedTime() { + bitField0_ = (bitField0_ & ~0x00000004); + enqueuedTime_ = null; + if (enqueuedTimeBuilder_ != null) { + enqueuedTimeBuilder_.dispose(); + enqueuedTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEnqueuedTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEnqueuedTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEnqueuedTimeOrBuilder() { + if (enqueuedTimeBuilder_ != null) { + return enqueuedTimeBuilder_.getMessageOrBuilder(); + } else { + return enqueuedTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : enqueuedTime_; + } + } + + /** + * + * + *
+     * The time the run was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEnqueuedTimeFieldBuilder() { + if (enqueuedTimeBuilder_ == null) { + enqueuedTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEnqueuedTime(), getParentForChildren(), isClean()); + enqueuedTime_ = null; + } + return enqueuedTimeBuilder_; + } + + private long id_; + + /** + * + * + *
+     * The identifier for this backup run. Unique only for a specific Cloud SQL
+     * instance.
+     * 
+ * + * int64 id = 4; + * + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + /** + * + * + *
+     * The identifier for this backup run. Unique only for a specific Cloud SQL
+     * instance.
+     * 
+ * + * int64 id = 4; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The identifier for this backup run. Unique only for a specific Cloud SQL
+     * instance.
+     * 
+ * + * int64 id = 4; + * + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000008); + id_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000010); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The time the backup operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + * + * @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(); + } + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000020); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * The time the backup operation completed in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private com.google.cloud.sql.v1beta4.OperationError error_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.OperationError, + com.google.cloud.sql.v1beta4.OperationError.Builder, + com.google.cloud.sql.v1beta4.OperationErrorOrBuilder> + errorBuilder_; + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + * + * @return The error. + */ + public com.google.cloud.sql.v1beta4.OperationError getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.cloud.sql.v1beta4.OperationError.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + */ + public Builder setError(com.google.cloud.sql.v1beta4.OperationError value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + */ + public Builder setError(com.google.cloud.sql.v1beta4.OperationError.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + */ + public Builder mergeError(com.google.cloud.sql.v1beta4.OperationError value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && error_ != null + && error_ != com.google.cloud.sql.v1beta4.OperationError.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000040); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + */ + public com.google.cloud.sql.v1beta4.OperationError.Builder getErrorBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + */ + public com.google.cloud.sql.v1beta4.OperationErrorOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.cloud.sql.v1beta4.OperationError.getDefaultInstance() + : error_; + } + } + + /** + * + * + *
+     * Information about why the backup operation failed. This is only present if
+     * the run has the FAILED status.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.OperationError, + com.google.cloud.sql.v1beta4.OperationError.Builder, + com.google.cloud.sql.v1beta4.OperationErrorOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.OperationError, + com.google.cloud.sql.v1beta4.OperationError.Builder, + com.google.cloud.sql.v1beta4.OperationErrorOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + private int type_ = 0; + + /** + * + * + *
+     * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+     * This field defaults to "ON_DEMAND" and is ignored, when specified for
+     * insert requests.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunType type = 8; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+     * This field defaults to "ON_DEMAND" and is ignored, when specified for
+     * insert requests.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunType type = 8; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+     * This field defaults to "ON_DEMAND" and is ignored, when specified for
+     * insert requests.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunType type = 8; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunType getType() { + com.google.cloud.sql.v1beta4.SqlBackupRunType result = + com.google.cloud.sql.v1beta4.SqlBackupRunType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1beta4.SqlBackupRunType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+     * This field defaults to "ON_DEMAND" and is ignored, when specified for
+     * insert requests.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunType type = 8; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.sql.v1beta4.SqlBackupRunType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+     * This field defaults to "ON_DEMAND" and is ignored, when specified for
+     * insert requests.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunType type = 8; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000080); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * The description of this run, only applicable to on-demand backups.
+     * 
+ * + * string description = 9; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The description of this run, only applicable to on-demand backups.
+     * 
+ * + * string description = 9; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The description of this run, only applicable to on-demand backups.
+     * 
+ * + * string description = 9; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The description of this run, only applicable to on-demand backups.
+     * 
+ * + * string description = 9; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
+     * The description of this run, only applicable to on-demand backups.
+     * 
+ * + * string description = 9; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp windowStartTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + windowStartTimeBuilder_; + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + * + * @return Whether the windowStartTime field is set. + */ + public boolean hasWindowStartTime() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + * + * @return The windowStartTime. + */ + public com.google.protobuf.Timestamp getWindowStartTime() { + if (windowStartTimeBuilder_ == null) { + return windowStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : windowStartTime_; + } else { + return windowStartTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + public Builder setWindowStartTime(com.google.protobuf.Timestamp value) { + if (windowStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + windowStartTime_ = value; + } else { + windowStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + public Builder setWindowStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (windowStartTimeBuilder_ == null) { + windowStartTime_ = builderForValue.build(); + } else { + windowStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + public Builder mergeWindowStartTime(com.google.protobuf.Timestamp value) { + if (windowStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && windowStartTime_ != null + && windowStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getWindowStartTimeBuilder().mergeFrom(value); + } else { + windowStartTime_ = value; + } + } else { + windowStartTimeBuilder_.mergeFrom(value); + } + if (windowStartTime_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + public Builder clearWindowStartTime() { + bitField0_ = (bitField0_ & ~0x00000200); + windowStartTime_ = null; + if (windowStartTimeBuilder_ != null) { + windowStartTimeBuilder_.dispose(); + windowStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + public com.google.protobuf.Timestamp.Builder getWindowStartTimeBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetWindowStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getWindowStartTimeOrBuilder() { + if (windowStartTimeBuilder_ != null) { + return windowStartTimeBuilder_.getMessageOrBuilder(); + } else { + return windowStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : windowStartTime_; + } + } + + /** + * + * + *
+     * The start time of the backup window during which this the backup was
+     * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+     * example `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetWindowStartTimeFieldBuilder() { + if (windowStartTimeBuilder_ == null) { + windowStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getWindowStartTime(), getParentForChildren(), isClean()); + windowStartTime_ = null; + } + return windowStartTimeBuilder_; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 11; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 11; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 11; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 11; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 11; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object selfLink_ = ""; + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 12; + * + * @return The selfLink. + */ + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 12; + * + * @return The bytes for selfLink. + */ + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 12; + * + * @param value The selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selfLink_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 12; + * + * @return This builder for chaining. + */ + public Builder clearSelfLink() { + selfLink_ = getDefaultInstance().getSelfLink(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 12; + * + * @param value The bytes for selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selfLink_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private java.lang.Object location_ = ""; + + /** + * + * + *
+     * Location of the backups.
+     * 
+ * + * string location = 13; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Location of the backups.
+     * 
+ * + * string location = 13; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Location of the backups.
+     * 
+ * + * string location = 13; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Location of the backups.
+     * 
+ * + * string location = 13; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Location of the backups.
+     * 
+ * + * string location = 13; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private int databaseVersion_ = 0; + + /** + * + * + *
+     * Output only. The instance database version at the time this backup was
+     * made.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+     * Output only. The instance database version at the time this backup was
+     * made.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersionValue(int value) { + databaseVersion_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The instance database version at the time this backup was
+     * made.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1beta4.SqlDatabaseVersion result = + com.google.cloud.sql.v1beta4.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1beta4.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The instance database version at the time this backup was
+     * made.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersion(com.google.cloud.sql.v1beta4.SqlDatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00002000; + databaseVersion_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The instance database version at the time this backup was
+     * made.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDatabaseVersion() { + bitField0_ = (bitField0_ & ~0x00002000); + databaseVersion_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration diskEncryptionConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration, + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.Builder, + com.google.cloud.sql.v1beta4.DiskEncryptionConfigurationOrBuilder> + diskEncryptionConfigurationBuilder_; + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + * + * @return Whether the diskEncryptionConfiguration field is set. + */ + public boolean hasDiskEncryptionConfiguration() { + return ((bitField0_ & 0x00004000) != 0); + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + * + * @return The diskEncryptionConfiguration. + */ + public com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration + getDiskEncryptionConfiguration() { + if (diskEncryptionConfigurationBuilder_ == null) { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } else { + return diskEncryptionConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + public Builder setDiskEncryptionConfiguration( + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration value) { + if (diskEncryptionConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + diskEncryptionConfiguration_ = value; + } else { + diskEncryptionConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + public Builder setDiskEncryptionConfiguration( + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.Builder builderForValue) { + if (diskEncryptionConfigurationBuilder_ == null) { + diskEncryptionConfiguration_ = builderForValue.build(); + } else { + diskEncryptionConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + public Builder mergeDiskEncryptionConfiguration( + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration value) { + if (diskEncryptionConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0) + && diskEncryptionConfiguration_ != null + && diskEncryptionConfiguration_ + != com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.getDefaultInstance()) { + getDiskEncryptionConfigurationBuilder().mergeFrom(value); + } else { + diskEncryptionConfiguration_ = value; + } + } else { + diskEncryptionConfigurationBuilder_.mergeFrom(value); + } + if (diskEncryptionConfiguration_ != null) { + bitField0_ |= 0x00004000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + public Builder clearDiskEncryptionConfiguration() { + bitField0_ = (bitField0_ & ~0x00004000); + diskEncryptionConfiguration_ = null; + if (diskEncryptionConfigurationBuilder_ != null) { + diskEncryptionConfigurationBuilder_.dispose(); + diskEncryptionConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + public com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.Builder + getDiskEncryptionConfigurationBuilder() { + bitField0_ |= 0x00004000; + onChanged(); + return internalGetDiskEncryptionConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + public com.google.cloud.sql.v1beta4.DiskEncryptionConfigurationOrBuilder + getDiskEncryptionConfigurationOrBuilder() { + if (diskEncryptionConfigurationBuilder_ != null) { + return diskEncryptionConfigurationBuilder_.getMessageOrBuilder(); + } else { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } + } + + /** + * + * + *
+     * Encryption configuration specific to a backup.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration, + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.Builder, + com.google.cloud.sql.v1beta4.DiskEncryptionConfigurationOrBuilder> + internalGetDiskEncryptionConfigurationFieldBuilder() { + if (diskEncryptionConfigurationBuilder_ == null) { + diskEncryptionConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration, + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.Builder, + com.google.cloud.sql.v1beta4.DiskEncryptionConfigurationOrBuilder>( + getDiskEncryptionConfiguration(), getParentForChildren(), isClean()); + diskEncryptionConfiguration_ = null; + } + return diskEncryptionConfigurationBuilder_; + } + + private com.google.cloud.sql.v1beta4.DiskEncryptionStatus diskEncryptionStatus_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DiskEncryptionStatus, + com.google.cloud.sql.v1beta4.DiskEncryptionStatus.Builder, + com.google.cloud.sql.v1beta4.DiskEncryptionStatusOrBuilder> + diskEncryptionStatusBuilder_; + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + * + * @return Whether the diskEncryptionStatus field is set. + */ + public boolean hasDiskEncryptionStatus() { + return ((bitField0_ & 0x00008000) != 0); + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + * + * @return The diskEncryptionStatus. + */ + public com.google.cloud.sql.v1beta4.DiskEncryptionStatus getDiskEncryptionStatus() { + if (diskEncryptionStatusBuilder_ == null) { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } else { + return diskEncryptionStatusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + */ + public Builder setDiskEncryptionStatus( + com.google.cloud.sql.v1beta4.DiskEncryptionStatus value) { + if (diskEncryptionStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + diskEncryptionStatus_ = value; + } else { + diskEncryptionStatusBuilder_.setMessage(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + */ + public Builder setDiskEncryptionStatus( + com.google.cloud.sql.v1beta4.DiskEncryptionStatus.Builder builderForValue) { + if (diskEncryptionStatusBuilder_ == null) { + diskEncryptionStatus_ = builderForValue.build(); + } else { + diskEncryptionStatusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + */ + public Builder mergeDiskEncryptionStatus( + com.google.cloud.sql.v1beta4.DiskEncryptionStatus value) { + if (diskEncryptionStatusBuilder_ == null) { + if (((bitField0_ & 0x00008000) != 0) + && diskEncryptionStatus_ != null + && diskEncryptionStatus_ + != com.google.cloud.sql.v1beta4.DiskEncryptionStatus.getDefaultInstance()) { + getDiskEncryptionStatusBuilder().mergeFrom(value); + } else { + diskEncryptionStatus_ = value; + } + } else { + diskEncryptionStatusBuilder_.mergeFrom(value); + } + if (diskEncryptionStatus_ != null) { + bitField0_ |= 0x00008000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + */ + public Builder clearDiskEncryptionStatus() { + bitField0_ = (bitField0_ & ~0x00008000); + diskEncryptionStatus_ = null; + if (diskEncryptionStatusBuilder_ != null) { + diskEncryptionStatusBuilder_.dispose(); + diskEncryptionStatusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + */ + public com.google.cloud.sql.v1beta4.DiskEncryptionStatus.Builder + getDiskEncryptionStatusBuilder() { + bitField0_ |= 0x00008000; + onChanged(); + return internalGetDiskEncryptionStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + */ + public com.google.cloud.sql.v1beta4.DiskEncryptionStatusOrBuilder + getDiskEncryptionStatusOrBuilder() { + if (diskEncryptionStatusBuilder_ != null) { + return diskEncryptionStatusBuilder_.getMessageOrBuilder(); + } else { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } + } + + /** + * + * + *
+     * Encryption status specific to a backup.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DiskEncryptionStatus, + com.google.cloud.sql.v1beta4.DiskEncryptionStatus.Builder, + com.google.cloud.sql.v1beta4.DiskEncryptionStatusOrBuilder> + internalGetDiskEncryptionStatusFieldBuilder() { + if (diskEncryptionStatusBuilder_ == null) { + diskEncryptionStatusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DiskEncryptionStatus, + com.google.cloud.sql.v1beta4.DiskEncryptionStatus.Builder, + com.google.cloud.sql.v1beta4.DiskEncryptionStatusOrBuilder>( + getDiskEncryptionStatus(), getParentForChildren(), isClean()); + diskEncryptionStatus_ = null; + } + return diskEncryptionStatusBuilder_; + } + + private int backupKind_ = 0; + + /** + * + * + *
+     * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 19; + * + * @return The enum numeric value on the wire for backupKind. + */ + @java.lang.Override + public int getBackupKindValue() { + return backupKind_; + } + + /** + * + * + *
+     * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 19; + * + * @param value The enum numeric value on the wire for backupKind to set. + * @return This builder for chaining. + */ + public Builder setBackupKindValue(int value) { + backupKind_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 19; + * + * @return The backupKind. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupKind getBackupKind() { + com.google.cloud.sql.v1beta4.SqlBackupKind result = + com.google.cloud.sql.v1beta4.SqlBackupKind.forNumber(backupKind_); + return result == null ? com.google.cloud.sql.v1beta4.SqlBackupKind.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 19; + * + * @param value The backupKind to set. + * @return This builder for chaining. + */ + public Builder setBackupKind(com.google.cloud.sql.v1beta4.SqlBackupKind value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00010000; + backupKind_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 19; + * + * @return This builder for chaining. + */ + public Builder clearBackupKind() { + bitField0_ = (bitField0_ & ~0x00010000); + backupKind_ = 0; + onChanged(); + return this; + } + + private java.lang.Object timeZone_ = ""; + + /** + * + * + *
+     * Backup time zone to prevent restores to an instance with
+     * a different time zone. Now relevant only for SQL Server.
+     * 
+ * + * string time_zone = 23; + * + * @return The timeZone. + */ + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Backup time zone to prevent restores to an instance with
+     * a different time zone. Now relevant only for SQL Server.
+     * 
+ * + * string time_zone = 23; + * + * @return The bytes for timeZone. + */ + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Backup time zone to prevent restores to an instance with
+     * a different time zone. Now relevant only for SQL Server.
+     * 
+ * + * string time_zone = 23; + * + * @param value The timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + timeZone_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Backup time zone to prevent restores to an instance with
+     * a different time zone. Now relevant only for SQL Server.
+     * 
+ * + * string time_zone = 23; + * + * @return This builder for chaining. + */ + public Builder clearTimeZone() { + timeZone_ = getDefaultInstance().getTimeZone(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Backup time zone to prevent restores to an instance with
+     * a different time zone. Now relevant only for SQL Server.
+     * 
+ * + * string time_zone = 23; + * + * @param value The bytes for timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + timeZone_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + private long maxChargeableBytes_; + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maxChargeableBytes field is set. + */ + @java.lang.Override + public boolean hasMaxChargeableBytes() { + return ((bitField0_ & 0x00040000) != 0); + } + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maxChargeableBytes. + */ + @java.lang.Override + public long getMaxChargeableBytes() { + return maxChargeableBytes_; + } + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The maxChargeableBytes to set. + * @return This builder for chaining. + */ + public Builder setMaxChargeableBytes(long value) { + + maxChargeableBytes_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The maximum chargeable bytes for the backup.
+     * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearMaxChargeableBytes() { + bitField0_ = (bitField0_ & ~0x00040000); + maxChargeableBytes_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.BackupRun) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.BackupRun) + private static final com.google.cloud.sql.v1beta4.BackupRun DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.BackupRun(); + } + + public static com.google.cloud.sql.v1beta4.BackupRun getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupRun parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRun getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRunOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRunOrBuilder.java new file mode 100644 index 000000000000..b4c575588147 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRunOrBuilder.java @@ -0,0 +1,632 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface BackupRunOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.BackupRun) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#backupRun`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#backupRun`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The status of this run.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunStatus status = 2; + * + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + + /** + * + * + *
+   * The status of this run.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunStatus status = 2; + * + * @return The status. + */ + com.google.cloud.sql.v1beta4.SqlBackupRunStatus getStatus(); + + /** + * + * + *
+   * The time the run was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + * + * @return Whether the enqueuedTime field is set. + */ + boolean hasEnqueuedTime(); + + /** + * + * + *
+   * The time the run was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + * + * @return The enqueuedTime. + */ + com.google.protobuf.Timestamp getEnqueuedTime(); + + /** + * + * + *
+   * The time the run was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp enqueued_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEnqueuedTimeOrBuilder(); + + /** + * + * + *
+   * The identifier for this backup run. Unique only for a specific Cloud SQL
+   * instance.
+   * 
+ * + * int64 id = 4; + * + * @return The id. + */ + long getId(); + + /** + * + * + *
+   * The time the backup operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The time the backup operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The time the backup operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The time the backup operation completed in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * The time the backup operation completed in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * The time the backup operation completed in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Information about why the backup operation failed. This is only present if
+   * the run has the FAILED status.
+   * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
+   * Information about why the backup operation failed. This is only present if
+   * the run has the FAILED status.
+   * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + * + * @return The error. + */ + com.google.cloud.sql.v1beta4.OperationError getError(); + + /** + * + * + *
+   * Information about why the backup operation failed. This is only present if
+   * the run has the FAILED status.
+   * 
+ * + * .google.cloud.sql.v1beta4.OperationError error = 7; + */ + com.google.cloud.sql.v1beta4.OperationErrorOrBuilder getErrorOrBuilder(); + + /** + * + * + *
+   * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+   * This field defaults to "ON_DEMAND" and is ignored, when specified for
+   * insert requests.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunType type = 8; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
+   * This field defaults to "ON_DEMAND" and is ignored, when specified for
+   * insert requests.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupRunType type = 8; + * + * @return The type. + */ + com.google.cloud.sql.v1beta4.SqlBackupRunType getType(); + + /** + * + * + *
+   * The description of this run, only applicable to on-demand backups.
+   * 
+ * + * string description = 9; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * The description of this run, only applicable to on-demand backups.
+   * 
+ * + * string description = 9; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * The start time of the backup window during which this the backup was
+   * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+   * example `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + * + * @return Whether the windowStartTime field is set. + */ + boolean hasWindowStartTime(); + + /** + * + * + *
+   * The start time of the backup window during which this the backup was
+   * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+   * example `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + * + * @return The windowStartTime. + */ + com.google.protobuf.Timestamp getWindowStartTime(); + + /** + * + * + *
+   * The start time of the backup window during which this the backup was
+   * attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
+   * example `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp window_start_time = 10; + */ + com.google.protobuf.TimestampOrBuilder getWindowStartTimeOrBuilder(); + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 11; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 11; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 12; + * + * @return The selfLink. + */ + java.lang.String getSelfLink(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 12; + * + * @return The bytes for selfLink. + */ + com.google.protobuf.ByteString getSelfLinkBytes(); + + /** + * + * + *
+   * Location of the backups.
+   * 
+ * + * string location = 13; + * + * @return The location. + */ + java.lang.String getLocation(); + + /** + * + * + *
+   * Location of the backups.
+   * 
+ * + * string location = 13; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Output only. The instance database version at the time this backup was
+   * made.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for databaseVersion. + */ + int getDatabaseVersionValue(); + + /** + * + * + *
+   * Output only. The instance database version at the time this backup was
+   * made.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseVersion. + */ + com.google.cloud.sql.v1beta4.SqlDatabaseVersion getDatabaseVersion(); + + /** + * + * + *
+   * Encryption configuration specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + * + * @return Whether the diskEncryptionConfiguration field is set. + */ + boolean hasDiskEncryptionConfiguration(); + + /** + * + * + *
+   * Encryption configuration specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + * + * @return The diskEncryptionConfiguration. + */ + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration getDiskEncryptionConfiguration(); + + /** + * + * + *
+   * Encryption configuration specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 16; + * + */ + com.google.cloud.sql.v1beta4.DiskEncryptionConfigurationOrBuilder + getDiskEncryptionConfigurationOrBuilder(); + + /** + * + * + *
+   * Encryption status specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + * + * @return Whether the diskEncryptionStatus field is set. + */ + boolean hasDiskEncryptionStatus(); + + /** + * + * + *
+   * Encryption status specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + * + * @return The diskEncryptionStatus. + */ + com.google.cloud.sql.v1beta4.DiskEncryptionStatus getDiskEncryptionStatus(); + + /** + * + * + *
+   * Encryption status specific to a backup.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 17; + */ + com.google.cloud.sql.v1beta4.DiskEncryptionStatusOrBuilder getDiskEncryptionStatusOrBuilder(); + + /** + * + * + *
+   * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 19; + * + * @return The enum numeric value on the wire for backupKind. + */ + int getBackupKindValue(); + + /** + * + * + *
+   * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackupKind backup_kind = 19; + * + * @return The backupKind. + */ + com.google.cloud.sql.v1beta4.SqlBackupKind getBackupKind(); + + /** + * + * + *
+   * Backup time zone to prevent restores to an instance with
+   * a different time zone. Now relevant only for SQL Server.
+   * 
+ * + * string time_zone = 23; + * + * @return The timeZone. + */ + java.lang.String getTimeZone(); + + /** + * + * + *
+   * Backup time zone to prevent restores to an instance with
+   * a different time zone. Now relevant only for SQL Server.
+   * 
+ * + * string time_zone = 23; + * + * @return The bytes for timeZone. + */ + com.google.protobuf.ByteString getTimeZoneBytes(); + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maxChargeableBytes field is set. + */ + boolean hasMaxChargeableBytes(); + + /** + * + * + *
+   * Output only. The maximum chargeable bytes for the backup.
+   * 
+ * + * optional int64 max_chargeable_bytes = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maxChargeableBytes. + */ + long getMaxChargeableBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRunsListResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRunsListResponse.java new file mode 100644 index 000000000000..48ec2efbd1ad --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRunsListResponse.java @@ -0,0 +1,1306 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Backup run list results.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.BackupRunsListResponse} + */ +@com.google.protobuf.Generated +public final class BackupRunsListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.BackupRunsListResponse) + BackupRunsListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupRunsListResponse"); + } + + // Use BackupRunsListResponse.newBuilder() to construct. + private BackupRunsListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackupRunsListResponse() { + kind_ = ""; + items_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRunsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRunsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.BackupRunsListResponse.class, + com.google.cloud.sql.v1beta4.BackupRunsListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#backupRunsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#backupRunsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRun getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRunOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.BackupRunsListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.BackupRunsListResponse other = + (com.google.cloud.sql.v1beta4.BackupRunsListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.BackupRunsListResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupRunsListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRunsListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupRunsListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRunsListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BackupRunsListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRunsListResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupRunsListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRunsListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupRunsListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BackupRunsListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BackupRunsListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.BackupRunsListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Backup run list results.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.BackupRunsListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.BackupRunsListResponse) + com.google.cloud.sql.v1beta4.BackupRunsListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRunsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRunsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.BackupRunsListResponse.class, + com.google.cloud.sql.v1beta4.BackupRunsListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.BackupRunsListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BackupRunsListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRunsListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.BackupRunsListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRunsListResponse build() { + com.google.cloud.sql.v1beta4.BackupRunsListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRunsListResponse buildPartial() { + com.google.cloud.sql.v1beta4.BackupRunsListResponse result = + new com.google.cloud.sql.v1beta4.BackupRunsListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.BackupRunsListResponse result) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.BackupRunsListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.BackupRunsListResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.BackupRunsListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.BackupRunsListResponse other) { + if (other == com.google.cloud.sql.v1beta4.BackupRunsListResponse.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1beta4.BackupRun m = + input.readMessage( + com.google.cloud.sql.v1beta4.BackupRun.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#backupRunsList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupRunsList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#backupRunsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupRunsList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#backupRunsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.BackupRun, + com.google.cloud.sql.v1beta4.BackupRun.Builder, + com.google.cloud.sql.v1beta4.BackupRunOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public com.google.cloud.sql.v1beta4.BackupRun getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1beta4.BackupRun value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public Builder setItems( + int index, com.google.cloud.sql.v1beta4.BackupRun.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.BackupRun value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1beta4.BackupRun value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.BackupRun.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public Builder addItems( + int index, com.google.cloud.sql.v1beta4.BackupRun.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public com.google.cloud.sql.v1beta4.BackupRun.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public com.google.cloud.sql.v1beta4.BackupRunOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public com.google.cloud.sql.v1beta4.BackupRun.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.BackupRun.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public com.google.cloud.sql.v1beta4.BackupRun.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.BackupRun.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of backup runs in reverse chronological order of the enqueued time.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.BackupRun, + com.google.cloud.sql.v1beta4.BackupRun.Builder, + com.google.cloud.sql.v1beta4.BackupRunOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.BackupRun, + com.google.cloud.sql.v1beta4.BackupRun.Builder, + com.google.cloud.sql.v1beta4.BackupRunOrBuilder>( + items_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.BackupRunsListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.BackupRunsListResponse) + private static final com.google.cloud.sql.v1beta4.BackupRunsListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.BackupRunsListResponse(); + } + + public static com.google.cloud.sql.v1beta4.BackupRunsListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupRunsListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRunsListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRunsListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRunsListResponseOrBuilder.java new file mode 100644 index 000000000000..1f37ef31a568 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BackupRunsListResponseOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface BackupRunsListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.BackupRunsListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#backupRunsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#backupRunsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + com.google.cloud.sql.v1beta4.BackupRun getItems(int index); + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + int getItemsCount(); + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + java.util.List getItemsOrBuilderList(); + + /** + * + * + *
+   * A list of backup runs in reverse chronological order of the enqueued time.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.BackupRun items = 2; + */ + com.google.cloud.sql.v1beta4.BackupRunOrBuilder getItemsOrBuilder(int index); + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BakType.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BakType.java new file mode 100644 index 000000000000..3a8e31b55e68 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BakType.java @@ -0,0 +1,208 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf enum {@code google.cloud.sql.v1beta4.BakType} */ +@com.google.protobuf.Generated +public enum BakType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Default type.
+   * 
+ * + * BAK_TYPE_UNSPECIFIED = 0; + */ + BAK_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Full backup.
+   * 
+ * + * FULL = 1; + */ + FULL(1), + /** + * + * + *
+   * Differential backup.
+   * 
+ * + * DIFF = 2; + */ + DIFF(2), + /** + * + * + *
+   * SQL Server Transaction Log
+   * 
+ * + * TLOG = 3; + */ + TLOG(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BakType"); + } + + /** + * + * + *
+   * Default type.
+   * 
+ * + * BAK_TYPE_UNSPECIFIED = 0; + */ + public static final int BAK_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Full backup.
+   * 
+ * + * FULL = 1; + */ + public static final int FULL_VALUE = 1; + + /** + * + * + *
+   * Differential backup.
+   * 
+ * + * DIFF = 2; + */ + public static final int DIFF_VALUE = 2; + + /** + * + * + *
+   * SQL Server Transaction Log
+   * 
+ * + * TLOG = 3; + */ + public static final int TLOG_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 BakType 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 BakType forNumber(int value) { + switch (value) { + case 0: + return BAK_TYPE_UNSPECIFIED; + case 1: + return FULL; + case 2: + return DIFF; + case 3: + return TLOG; + 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 BakType findValueByNumber(int number) { + return BakType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final BakType[] VALUES = values(); + + public static BakType 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 BakType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.BakType) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BinLogCoordinates.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BinLogCoordinates.java new file mode 100644 index 000000000000..20e084b4ab85 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BinLogCoordinates.java @@ -0,0 +1,881 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Binary log coordinates.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.BinLogCoordinates} + */ +@com.google.protobuf.Generated +public final class BinLogCoordinates extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.BinLogCoordinates) + BinLogCoordinatesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BinLogCoordinates"); + } + + // Use BinLogCoordinates.newBuilder() to construct. + private BinLogCoordinates(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BinLogCoordinates() { + binLogFileName_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BinLogCoordinates_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BinLogCoordinates_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.BinLogCoordinates.class, + com.google.cloud.sql.v1beta4.BinLogCoordinates.Builder.class); + } + + public static final int BIN_LOG_FILE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object binLogFileName_ = ""; + + /** + * + * + *
+   * Name of the binary log file for a Cloud SQL instance.
+   * 
+ * + * string bin_log_file_name = 1; + * + * @return The binLogFileName. + */ + @java.lang.Override + public java.lang.String getBinLogFileName() { + java.lang.Object ref = binLogFileName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + binLogFileName_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the binary log file for a Cloud SQL instance.
+   * 
+ * + * string bin_log_file_name = 1; + * + * @return The bytes for binLogFileName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBinLogFileNameBytes() { + java.lang.Object ref = binLogFileName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + binLogFileName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BIN_LOG_POSITION_FIELD_NUMBER = 2; + private long binLogPosition_ = 0L; + + /** + * + * + *
+   * Position (offset) within the binary log file.
+   * 
+ * + * int64 bin_log_position = 2; + * + * @return The binLogPosition. + */ + @java.lang.Override + public long getBinLogPosition() { + return binLogPosition_; + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#binLogCoordinates`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#binLogCoordinates`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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.GeneratedMessage.isStringEmpty(binLogFileName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, binLogFileName_); + } + if (binLogPosition_ != 0L) { + output.writeInt64(2, binLogPosition_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(binLogFileName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, binLogFileName_); + } + if (binLogPosition_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, binLogPosition_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.BinLogCoordinates)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.BinLogCoordinates other = + (com.google.cloud.sql.v1beta4.BinLogCoordinates) obj; + + if (!getBinLogFileName().equals(other.getBinLogFileName())) return false; + if (getBinLogPosition() != other.getBinLogPosition()) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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) + BIN_LOG_FILE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getBinLogFileName().hashCode(); + hash = (37 * hash) + BIN_LOG_POSITION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getBinLogPosition()); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.BinLogCoordinates parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BinLogCoordinates parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BinLogCoordinates parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BinLogCoordinates parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BinLogCoordinates parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.BinLogCoordinates parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BinLogCoordinates parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BinLogCoordinates parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BinLogCoordinates parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BinLogCoordinates parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.BinLogCoordinates parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.BinLogCoordinates parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.BinLogCoordinates prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Binary log coordinates.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.BinLogCoordinates} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.BinLogCoordinates) + com.google.cloud.sql.v1beta4.BinLogCoordinatesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BinLogCoordinates_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BinLogCoordinates_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.BinLogCoordinates.class, + com.google.cloud.sql.v1beta4.BinLogCoordinates.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.BinLogCoordinates.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + binLogFileName_ = ""; + binLogPosition_ = 0L; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_BinLogCoordinates_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BinLogCoordinates getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.BinLogCoordinates.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BinLogCoordinates build() { + com.google.cloud.sql.v1beta4.BinLogCoordinates result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BinLogCoordinates buildPartial() { + com.google.cloud.sql.v1beta4.BinLogCoordinates result = + new com.google.cloud.sql.v1beta4.BinLogCoordinates(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.BinLogCoordinates result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.binLogFileName_ = binLogFileName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.binLogPosition_ = binLogPosition_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.BinLogCoordinates) { + return mergeFrom((com.google.cloud.sql.v1beta4.BinLogCoordinates) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.BinLogCoordinates other) { + if (other == com.google.cloud.sql.v1beta4.BinLogCoordinates.getDefaultInstance()) return this; + if (!other.getBinLogFileName().isEmpty()) { + binLogFileName_ = other.binLogFileName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getBinLogPosition() != 0L) { + setBinLogPosition(other.getBinLogPosition()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + binLogFileName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + binLogPosition_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object binLogFileName_ = ""; + + /** + * + * + *
+     * Name of the binary log file for a Cloud SQL instance.
+     * 
+ * + * string bin_log_file_name = 1; + * + * @return The binLogFileName. + */ + public java.lang.String getBinLogFileName() { + java.lang.Object ref = binLogFileName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + binLogFileName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the binary log file for a Cloud SQL instance.
+     * 
+ * + * string bin_log_file_name = 1; + * + * @return The bytes for binLogFileName. + */ + public com.google.protobuf.ByteString getBinLogFileNameBytes() { + java.lang.Object ref = binLogFileName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + binLogFileName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the binary log file for a Cloud SQL instance.
+     * 
+ * + * string bin_log_file_name = 1; + * + * @param value The binLogFileName to set. + * @return This builder for chaining. + */ + public Builder setBinLogFileName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + binLogFileName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the binary log file for a Cloud SQL instance.
+     * 
+ * + * string bin_log_file_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearBinLogFileName() { + binLogFileName_ = getDefaultInstance().getBinLogFileName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the binary log file for a Cloud SQL instance.
+     * 
+ * + * string bin_log_file_name = 1; + * + * @param value The bytes for binLogFileName to set. + * @return This builder for chaining. + */ + public Builder setBinLogFileNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + binLogFileName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long binLogPosition_; + + /** + * + * + *
+     * Position (offset) within the binary log file.
+     * 
+ * + * int64 bin_log_position = 2; + * + * @return The binLogPosition. + */ + @java.lang.Override + public long getBinLogPosition() { + return binLogPosition_; + } + + /** + * + * + *
+     * Position (offset) within the binary log file.
+     * 
+ * + * int64 bin_log_position = 2; + * + * @param value The binLogPosition to set. + * @return This builder for chaining. + */ + public Builder setBinLogPosition(long value) { + + binLogPosition_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Position (offset) within the binary log file.
+     * 
+ * + * int64 bin_log_position = 2; + * + * @return This builder for chaining. + */ + public Builder clearBinLogPosition() { + bitField0_ = (bitField0_ & ~0x00000002); + binLogPosition_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#binLogCoordinates`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#binLogCoordinates`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#binLogCoordinates`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#binLogCoordinates`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#binLogCoordinates`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.BinLogCoordinates) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.BinLogCoordinates) + private static final com.google.cloud.sql.v1beta4.BinLogCoordinates DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.BinLogCoordinates(); + } + + public static com.google.cloud.sql.v1beta4.BinLogCoordinates getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BinLogCoordinates parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.BinLogCoordinates getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BinLogCoordinatesOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BinLogCoordinatesOrBuilder.java new file mode 100644 index 000000000000..701ddd8863c4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/BinLogCoordinatesOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface BinLogCoordinatesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.BinLogCoordinates) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the binary log file for a Cloud SQL instance.
+   * 
+ * + * string bin_log_file_name = 1; + * + * @return The binLogFileName. + */ + java.lang.String getBinLogFileName(); + + /** + * + * + *
+   * Name of the binary log file for a Cloud SQL instance.
+   * 
+ * + * string bin_log_file_name = 1; + * + * @return The bytes for binLogFileName. + */ + com.google.protobuf.ByteString getBinLogFileNameBytes(); + + /** + * + * + *
+   * Position (offset) within the binary log file.
+   * 
+ * + * int64 bin_log_position = 2; + * + * @return The binLogPosition. + */ + long getBinLogPosition(); + + /** + * + * + *
+   * This is always `sql#binLogCoordinates`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#binLogCoordinates`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloneContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloneContext.java new file mode 100644 index 000000000000..4b0af17cbd37 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloneContext.java @@ -0,0 +1,3372 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance clone context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.CloneContext} + */ +@com.google.protobuf.Generated +public final class CloneContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.CloneContext) + CloneContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloneContext"); + } + + // Use CloneContext.newBuilder() to construct. + private CloneContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CloneContext() { + kind_ = ""; + destinationInstanceName_ = ""; + allocatedIpRange_ = ""; + databaseNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + preferredZone_ = ""; + preferredSecondaryZone_ = ""; + destinationProject_ = ""; + destinationNetwork_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_CloneContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_CloneContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.CloneContext.class, + com.google.cloud.sql.v1beta4.CloneContext.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#cloneContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#cloneContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PITR_TIMESTAMP_MS_FIELD_NUMBER = 2; + private long pitrTimestampMs_ = 0L; + + /** + * + * + *
+   * Reserved for future use.
+   * 
+ * + * int64 pitr_timestamp_ms = 2; + * + * @return The pitrTimestampMs. + */ + @java.lang.Override + public long getPitrTimestampMs() { + return pitrTimestampMs_; + } + + public static final int DESTINATION_INSTANCE_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object destinationInstanceName_ = ""; + + /** + * + * + *
+   * Name of the Cloud SQL instance to be created as a clone.
+   * 
+ * + * string destination_instance_name = 3; + * + * @return The destinationInstanceName. + */ + @java.lang.Override + public java.lang.String getDestinationInstanceName() { + java.lang.Object ref = destinationInstanceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationInstanceName_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the Cloud SQL instance to be created as a clone.
+   * 
+ * + * string destination_instance_name = 3; + * + * @return The bytes for destinationInstanceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationInstanceNameBytes() { + java.lang.Object ref = destinationInstanceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationInstanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BIN_LOG_COORDINATES_FIELD_NUMBER = 4; + private com.google.cloud.sql.v1beta4.BinLogCoordinates binLogCoordinates_; + + /** + * + * + *
+   * Binary log coordinates, if specified, identify the position up to which the
+   * source instance is cloned. If not specified, the source instance is
+   * cloned up to the most recent binary log coordinates.
+   * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + * + * @return Whether the binLogCoordinates field is set. + */ + @java.lang.Override + public boolean hasBinLogCoordinates() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Binary log coordinates, if specified, identify the position up to which the
+   * source instance is cloned. If not specified, the source instance is
+   * cloned up to the most recent binary log coordinates.
+   * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + * + * @return The binLogCoordinates. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BinLogCoordinates getBinLogCoordinates() { + return binLogCoordinates_ == null + ? com.google.cloud.sql.v1beta4.BinLogCoordinates.getDefaultInstance() + : binLogCoordinates_; + } + + /** + * + * + *
+   * Binary log coordinates, if specified, identify the position up to which the
+   * source instance is cloned. If not specified, the source instance is
+   * cloned up to the most recent binary log coordinates.
+   * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BinLogCoordinatesOrBuilder getBinLogCoordinatesOrBuilder() { + return binLogCoordinates_ == null + ? com.google.cloud.sql.v1beta4.BinLogCoordinates.getDefaultInstance() + : binLogCoordinates_; + } + + public static final int POINT_IN_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp pointInTime_; + + /** + * + * + *
+   * Timestamp, if specified, identifies the time to which the source instance
+   * is cloned.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + * + * @return Whether the pointInTime field is set. + */ + @java.lang.Override + public boolean hasPointInTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Timestamp, if specified, identifies the time to which the source instance
+   * is cloned.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + * + * @return The pointInTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPointInTime() { + return pointInTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : pointInTime_; + } + + /** + * + * + *
+   * Timestamp, if specified, identifies the time to which the source instance
+   * is cloned.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder() { + return pointInTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : pointInTime_; + } + + public static final int ALLOCATED_IP_RANGE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object allocatedIpRange_ = ""; + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the cloned instance
+   * ip will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?.
+   * Reserved for future use.
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The allocatedIpRange. + */ + @java.lang.Override + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the cloned instance
+   * ip will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?.
+   * Reserved for future use.
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The bytes for allocatedIpRange. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_NAMES_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList databaseNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @return A list containing the databaseNames. + */ + public com.google.protobuf.ProtocolStringList getDatabaseNamesList() { + return databaseNames_; + } + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @return The count of databaseNames. + */ + public int getDatabaseNamesCount() { + return databaseNames_.size(); + } + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @param index The index of the element to return. + * @return The databaseNames at the given index. + */ + public java.lang.String getDatabaseNames(int index) { + return databaseNames_.get(index); + } + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @param index The index of the value to return. + * @return The bytes of the databaseNames at the given index. + */ + public com.google.protobuf.ByteString getDatabaseNamesBytes(int index) { + return databaseNames_.getByteString(index); + } + + public static final int PREFERRED_ZONE_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object preferredZone_ = ""; + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of an instance to the
+   * specified zone. If no zone is specified, clone to the same primary zone as
+   * the source instance.
+   * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the preferredZone field is set. + */ + @java.lang.Override + public boolean hasPreferredZone() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of an instance to the
+   * specified zone. If no zone is specified, clone to the same primary zone as
+   * the source instance.
+   * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The preferredZone. + */ + @java.lang.Override + public java.lang.String getPreferredZone() { + java.lang.Object ref = preferredZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredZone_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of an instance to the
+   * specified zone. If no zone is specified, clone to the same primary zone as
+   * the source instance.
+   * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for preferredZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPreferredZoneBytes() { + java.lang.Object ref = preferredZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PREFERRED_SECONDARY_ZONE_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object preferredSecondaryZone_ = ""; + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of a regional
+   * instance in the specified zones. If not specified, clone to the same
+   * secondary zone as the source instance. This value cannot be the same as the
+   * preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the preferredSecondaryZone field is set. + */ + @java.lang.Override + public boolean hasPreferredSecondaryZone() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of a regional
+   * instance in the specified zones. If not specified, clone to the same
+   * secondary zone as the source instance. This value cannot be the same as the
+   * preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The preferredSecondaryZone. + */ + @java.lang.Override + public java.lang.String getPreferredSecondaryZone() { + java.lang.Object ref = preferredSecondaryZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredSecondaryZone_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of a regional
+   * instance in the specified zones. If not specified, clone to the same
+   * secondary zone as the source instance. This value cannot be the same as the
+   * preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for preferredSecondaryZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPreferredSecondaryZoneBytes() { + java.lang.Object ref = preferredSecondaryZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredSecondaryZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_INSTANCE_DELETION_TIME_FIELD_NUMBER = 12; + private com.google.protobuf.Timestamp sourceInstanceDeletionTime_; + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + * + * @return Whether the sourceInstanceDeletionTime field is set. + */ + @java.lang.Override + public boolean hasSourceInstanceDeletionTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + * + * @return The sourceInstanceDeletionTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSourceInstanceDeletionTime() { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSourceInstanceDeletionTimeOrBuilder() { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } + + public static final int DESTINATION_PROJECT_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private volatile java.lang.Object destinationProject_ = ""; + + /** + * + * + *
+   * Optional. The project ID of the destination project where the cloned
+   * instance will be created. To perform a cross-project clone, this field is
+   * required. If not specified, the clone is created in the same project
+   * as the source instance.
+   * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the destinationProject field is set. + */ + @java.lang.Override + public boolean hasDestinationProject() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Optional. The project ID of the destination project where the cloned
+   * instance will be created. To perform a cross-project clone, this field is
+   * required. If not specified, the clone is created in the same project
+   * as the source instance.
+   * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The destinationProject. + */ + @java.lang.Override + public java.lang.String getDestinationProject() { + java.lang.Object ref = destinationProject_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationProject_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The project ID of the destination project where the cloned
+   * instance will be created. To perform a cross-project clone, this field is
+   * required. If not specified, the clone is created in the same project
+   * as the source instance.
+   * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for destinationProject. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationProjectBytes() { + java.lang.Object ref = destinationProject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATION_NETWORK_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object destinationNetwork_ = ""; + + /** + * + * + *
+   * Optional. The fully qualified URI of the VPC network to which the cloned
+   * instance will be connected via private services access for private IP. For
+   * example:`projects/my-network-project/global/networks/my-network`. This
+   * field is only required for cross-project cloning.
+   * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the destinationNetwork field is set. + */ + @java.lang.Override + public boolean hasDestinationNetwork() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Optional. The fully qualified URI of the VPC network to which the cloned
+   * instance will be connected via private services access for private IP. For
+   * example:`projects/my-network-project/global/networks/my-network`. This
+   * field is only required for cross-project cloning.
+   * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The destinationNetwork. + */ + @java.lang.Override + public java.lang.String getDestinationNetwork() { + java.lang.Object ref = destinationNetwork_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationNetwork_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The fully qualified URI of the VPC network to which the cloned
+   * instance will be connected via private services access for private IP. For
+   * example:`projects/my-network-project/global/networks/my-network`. This
+   * field is only required for cross-project cloning.
+   * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destinationNetwork. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationNetworkBytes() { + java.lang.Object ref = destinationNetwork_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationNetwork_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (pitrTimestampMs_ != 0L) { + output.writeInt64(2, pitrTimestampMs_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(destinationInstanceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, destinationInstanceName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getBinLogCoordinates()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getPointInTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatedIpRange_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, allocatedIpRange_); + } + for (int i = 0; i < databaseNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, databaseNames_.getRaw(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 10, preferredZone_); + } + if (((bitField0_ & 0x00000008) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, preferredSecondaryZone_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(12, getSourceInstanceDeletionTime()); + } + if (((bitField0_ & 0x00000020) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 13, destinationProject_); + } + if (((bitField0_ & 0x00000040) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 14, destinationNetwork_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (pitrTimestampMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, pitrTimestampMs_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(destinationInstanceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, destinationInstanceName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getBinLogCoordinates()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getPointInTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatedIpRange_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, allocatedIpRange_); + } + { + int dataSize = 0; + for (int i = 0; i < databaseNames_.size(); i++) { + dataSize += computeStringSizeNoTag(databaseNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getDatabaseNamesList().size(); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(10, preferredZone_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, preferredSecondaryZone_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 12, getSourceInstanceDeletionTime()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(13, destinationProject_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(14, destinationNetwork_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.CloneContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.CloneContext other = + (com.google.cloud.sql.v1beta4.CloneContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (getPitrTimestampMs() != other.getPitrTimestampMs()) return false; + if (!getDestinationInstanceName().equals(other.getDestinationInstanceName())) return false; + if (hasBinLogCoordinates() != other.hasBinLogCoordinates()) return false; + if (hasBinLogCoordinates()) { + if (!getBinLogCoordinates().equals(other.getBinLogCoordinates())) return false; + } + if (hasPointInTime() != other.hasPointInTime()) return false; + if (hasPointInTime()) { + if (!getPointInTime().equals(other.getPointInTime())) return false; + } + if (!getAllocatedIpRange().equals(other.getAllocatedIpRange())) return false; + if (!getDatabaseNamesList().equals(other.getDatabaseNamesList())) return false; + if (hasPreferredZone() != other.hasPreferredZone()) return false; + if (hasPreferredZone()) { + if (!getPreferredZone().equals(other.getPreferredZone())) return false; + } + if (hasPreferredSecondaryZone() != other.hasPreferredSecondaryZone()) return false; + if (hasPreferredSecondaryZone()) { + if (!getPreferredSecondaryZone().equals(other.getPreferredSecondaryZone())) return false; + } + if (hasSourceInstanceDeletionTime() != other.hasSourceInstanceDeletionTime()) return false; + if (hasSourceInstanceDeletionTime()) { + if (!getSourceInstanceDeletionTime().equals(other.getSourceInstanceDeletionTime())) + return false; + } + if (hasDestinationProject() != other.hasDestinationProject()) return false; + if (hasDestinationProject()) { + if (!getDestinationProject().equals(other.getDestinationProject())) return false; + } + if (hasDestinationNetwork() != other.hasDestinationNetwork()) return false; + if (hasDestinationNetwork()) { + if (!getDestinationNetwork().equals(other.getDestinationNetwork())) return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + PITR_TIMESTAMP_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPitrTimestampMs()); + hash = (37 * hash) + DESTINATION_INSTANCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDestinationInstanceName().hashCode(); + if (hasBinLogCoordinates()) { + hash = (37 * hash) + BIN_LOG_COORDINATES_FIELD_NUMBER; + hash = (53 * hash) + getBinLogCoordinates().hashCode(); + } + if (hasPointInTime()) { + hash = (37 * hash) + POINT_IN_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPointInTime().hashCode(); + } + hash = (37 * hash) + ALLOCATED_IP_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getAllocatedIpRange().hashCode(); + if (getDatabaseNamesCount() > 0) { + hash = (37 * hash) + DATABASE_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseNamesList().hashCode(); + } + if (hasPreferredZone()) { + hash = (37 * hash) + PREFERRED_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getPreferredZone().hashCode(); + } + if (hasPreferredSecondaryZone()) { + hash = (37 * hash) + PREFERRED_SECONDARY_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getPreferredSecondaryZone().hashCode(); + } + if (hasSourceInstanceDeletionTime()) { + hash = (37 * hash) + SOURCE_INSTANCE_DELETION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSourceInstanceDeletionTime().hashCode(); + } + if (hasDestinationProject()) { + hash = (37 * hash) + DESTINATION_PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getDestinationProject().hashCode(); + } + if (hasDestinationNetwork()) { + hash = (37 * hash) + DESTINATION_NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getDestinationNetwork().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.CloneContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.CloneContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.CloneContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.CloneContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.CloneContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.CloneContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.CloneContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.CloneContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.CloneContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.CloneContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.CloneContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.CloneContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.CloneContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance clone context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.CloneContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.CloneContext) + com.google.cloud.sql.v1beta4.CloneContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_CloneContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_CloneContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.CloneContext.class, + com.google.cloud.sql.v1beta4.CloneContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.CloneContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBinLogCoordinatesFieldBuilder(); + internalGetPointInTimeFieldBuilder(); + internalGetSourceInstanceDeletionTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + pitrTimestampMs_ = 0L; + destinationInstanceName_ = ""; + binLogCoordinates_ = null; + if (binLogCoordinatesBuilder_ != null) { + binLogCoordinatesBuilder_.dispose(); + binLogCoordinatesBuilder_ = null; + } + pointInTime_ = null; + if (pointInTimeBuilder_ != null) { + pointInTimeBuilder_.dispose(); + pointInTimeBuilder_ = null; + } + allocatedIpRange_ = ""; + databaseNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + preferredZone_ = ""; + preferredSecondaryZone_ = ""; + sourceInstanceDeletionTime_ = null; + if (sourceInstanceDeletionTimeBuilder_ != null) { + sourceInstanceDeletionTimeBuilder_.dispose(); + sourceInstanceDeletionTimeBuilder_ = null; + } + destinationProject_ = ""; + destinationNetwork_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_CloneContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.CloneContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.CloneContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.CloneContext build() { + com.google.cloud.sql.v1beta4.CloneContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.CloneContext buildPartial() { + com.google.cloud.sql.v1beta4.CloneContext result = + new com.google.cloud.sql.v1beta4.CloneContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.CloneContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pitrTimestampMs_ = pitrTimestampMs_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.destinationInstanceName_ = destinationInstanceName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.binLogCoordinates_ = + binLogCoordinatesBuilder_ == null + ? binLogCoordinates_ + : binLogCoordinatesBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pointInTime_ = + pointInTimeBuilder_ == null ? pointInTime_ : pointInTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.allocatedIpRange_ = allocatedIpRange_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + databaseNames_.makeImmutable(); + result.databaseNames_ = databaseNames_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.preferredZone_ = preferredZone_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.preferredSecondaryZone_ = preferredSecondaryZone_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.sourceInstanceDeletionTime_ = + sourceInstanceDeletionTimeBuilder_ == null + ? sourceInstanceDeletionTime_ + : sourceInstanceDeletionTimeBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.destinationProject_ = destinationProject_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.destinationNetwork_ = destinationNetwork_; + to_bitField0_ |= 0x00000040; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.CloneContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.CloneContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.CloneContext other) { + if (other == com.google.cloud.sql.v1beta4.CloneContext.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPitrTimestampMs() != 0L) { + setPitrTimestampMs(other.getPitrTimestampMs()); + } + if (!other.getDestinationInstanceName().isEmpty()) { + destinationInstanceName_ = other.destinationInstanceName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasBinLogCoordinates()) { + mergeBinLogCoordinates(other.getBinLogCoordinates()); + } + if (other.hasPointInTime()) { + mergePointInTime(other.getPointInTime()); + } + if (!other.getAllocatedIpRange().isEmpty()) { + allocatedIpRange_ = other.allocatedIpRange_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.databaseNames_.isEmpty()) { + if (databaseNames_.isEmpty()) { + databaseNames_ = other.databaseNames_; + bitField0_ |= 0x00000040; + } else { + ensureDatabaseNamesIsMutable(); + databaseNames_.addAll(other.databaseNames_); + } + onChanged(); + } + if (other.hasPreferredZone()) { + preferredZone_ = other.preferredZone_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.hasPreferredSecondaryZone()) { + preferredSecondaryZone_ = other.preferredSecondaryZone_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.hasSourceInstanceDeletionTime()) { + mergeSourceInstanceDeletionTime(other.getSourceInstanceDeletionTime()); + } + if (other.hasDestinationProject()) { + destinationProject_ = other.destinationProject_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (other.hasDestinationNetwork()) { + destinationNetwork_ = other.destinationNetwork_; + bitField0_ |= 0x00000800; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pitrTimestampMs_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + destinationInstanceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetBinLogCoordinatesFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetPointInTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + allocatedIpRange_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDatabaseNamesIsMutable(); + databaseNames_.add(s); + break; + } // case 74 + case 82: + { + preferredZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 82 + case 90: + { + preferredSecondaryZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 90 + case 98: + { + input.readMessage( + internalGetSourceInstanceDeletionTimeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 98 + case 106: + { + destinationProject_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 106 + case 114: + { + destinationNetwork_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 114 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#cloneContext`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#cloneContext`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#cloneContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#cloneContext`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#cloneContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long pitrTimestampMs_; + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * int64 pitr_timestamp_ms = 2; + * + * @return The pitrTimestampMs. + */ + @java.lang.Override + public long getPitrTimestampMs() { + return pitrTimestampMs_; + } + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * int64 pitr_timestamp_ms = 2; + * + * @param value The pitrTimestampMs to set. + * @return This builder for chaining. + */ + public Builder setPitrTimestampMs(long value) { + + pitrTimestampMs_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * int64 pitr_timestamp_ms = 2; + * + * @return This builder for chaining. + */ + public Builder clearPitrTimestampMs() { + bitField0_ = (bitField0_ & ~0x00000002); + pitrTimestampMs_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object destinationInstanceName_ = ""; + + /** + * + * + *
+     * Name of the Cloud SQL instance to be created as a clone.
+     * 
+ * + * string destination_instance_name = 3; + * + * @return The destinationInstanceName. + */ + public java.lang.String getDestinationInstanceName() { + java.lang.Object ref = destinationInstanceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationInstanceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the Cloud SQL instance to be created as a clone.
+     * 
+ * + * string destination_instance_name = 3; + * + * @return The bytes for destinationInstanceName. + */ + public com.google.protobuf.ByteString getDestinationInstanceNameBytes() { + java.lang.Object ref = destinationInstanceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationInstanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the Cloud SQL instance to be created as a clone.
+     * 
+ * + * string destination_instance_name = 3; + * + * @param value The destinationInstanceName to set. + * @return This builder for chaining. + */ + public Builder setDestinationInstanceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationInstanceName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the Cloud SQL instance to be created as a clone.
+     * 
+ * + * string destination_instance_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearDestinationInstanceName() { + destinationInstanceName_ = getDefaultInstance().getDestinationInstanceName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the Cloud SQL instance to be created as a clone.
+     * 
+ * + * string destination_instance_name = 3; + * + * @param value The bytes for destinationInstanceName to set. + * @return This builder for chaining. + */ + public Builder setDestinationInstanceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationInstanceName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.BinLogCoordinates binLogCoordinates_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BinLogCoordinates, + com.google.cloud.sql.v1beta4.BinLogCoordinates.Builder, + com.google.cloud.sql.v1beta4.BinLogCoordinatesOrBuilder> + binLogCoordinatesBuilder_; + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + * + * @return Whether the binLogCoordinates field is set. + */ + public boolean hasBinLogCoordinates() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + * + * @return The binLogCoordinates. + */ + public com.google.cloud.sql.v1beta4.BinLogCoordinates getBinLogCoordinates() { + if (binLogCoordinatesBuilder_ == null) { + return binLogCoordinates_ == null + ? com.google.cloud.sql.v1beta4.BinLogCoordinates.getDefaultInstance() + : binLogCoordinates_; + } else { + return binLogCoordinatesBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + */ + public Builder setBinLogCoordinates(com.google.cloud.sql.v1beta4.BinLogCoordinates value) { + if (binLogCoordinatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + binLogCoordinates_ = value; + } else { + binLogCoordinatesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + */ + public Builder setBinLogCoordinates( + com.google.cloud.sql.v1beta4.BinLogCoordinates.Builder builderForValue) { + if (binLogCoordinatesBuilder_ == null) { + binLogCoordinates_ = builderForValue.build(); + } else { + binLogCoordinatesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + */ + public Builder mergeBinLogCoordinates(com.google.cloud.sql.v1beta4.BinLogCoordinates value) { + if (binLogCoordinatesBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && binLogCoordinates_ != null + && binLogCoordinates_ + != com.google.cloud.sql.v1beta4.BinLogCoordinates.getDefaultInstance()) { + getBinLogCoordinatesBuilder().mergeFrom(value); + } else { + binLogCoordinates_ = value; + } + } else { + binLogCoordinatesBuilder_.mergeFrom(value); + } + if (binLogCoordinates_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + */ + public Builder clearBinLogCoordinates() { + bitField0_ = (bitField0_ & ~0x00000008); + binLogCoordinates_ = null; + if (binLogCoordinatesBuilder_ != null) { + binLogCoordinatesBuilder_.dispose(); + binLogCoordinatesBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + */ + public com.google.cloud.sql.v1beta4.BinLogCoordinates.Builder getBinLogCoordinatesBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetBinLogCoordinatesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + */ + public com.google.cloud.sql.v1beta4.BinLogCoordinatesOrBuilder getBinLogCoordinatesOrBuilder() { + if (binLogCoordinatesBuilder_ != null) { + return binLogCoordinatesBuilder_.getMessageOrBuilder(); + } else { + return binLogCoordinates_ == null + ? com.google.cloud.sql.v1beta4.BinLogCoordinates.getDefaultInstance() + : binLogCoordinates_; + } + } + + /** + * + * + *
+     * Binary log coordinates, if specified, identify the position up to which the
+     * source instance is cloned. If not specified, the source instance is
+     * cloned up to the most recent binary log coordinates.
+     * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BinLogCoordinates, + com.google.cloud.sql.v1beta4.BinLogCoordinates.Builder, + com.google.cloud.sql.v1beta4.BinLogCoordinatesOrBuilder> + internalGetBinLogCoordinatesFieldBuilder() { + if (binLogCoordinatesBuilder_ == null) { + binLogCoordinatesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BinLogCoordinates, + com.google.cloud.sql.v1beta4.BinLogCoordinates.Builder, + com.google.cloud.sql.v1beta4.BinLogCoordinatesOrBuilder>( + getBinLogCoordinates(), getParentForChildren(), isClean()); + binLogCoordinates_ = null; + } + return binLogCoordinatesBuilder_; + } + + private com.google.protobuf.Timestamp pointInTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + pointInTimeBuilder_; + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + * + * @return Whether the pointInTime field is set. + */ + public boolean hasPointInTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + * + * @return The pointInTime. + */ + public com.google.protobuf.Timestamp getPointInTime() { + if (pointInTimeBuilder_ == null) { + return pointInTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : pointInTime_; + } else { + return pointInTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + public Builder setPointInTime(com.google.protobuf.Timestamp value) { + if (pointInTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pointInTime_ = value; + } else { + pointInTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + public Builder setPointInTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (pointInTimeBuilder_ == null) { + pointInTime_ = builderForValue.build(); + } else { + pointInTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + public Builder mergePointInTime(com.google.protobuf.Timestamp value) { + if (pointInTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && pointInTime_ != null + && pointInTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getPointInTimeBuilder().mergeFrom(value); + } else { + pointInTime_ = value; + } + } else { + pointInTimeBuilder_.mergeFrom(value); + } + if (pointInTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + public Builder clearPointInTime() { + bitField0_ = (bitField0_ & ~0x00000010); + pointInTime_ = null; + if (pointInTimeBuilder_ != null) { + pointInTimeBuilder_.dispose(); + pointInTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getPointInTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetPointInTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder() { + if (pointInTimeBuilder_ != null) { + return pointInTimeBuilder_.getMessageOrBuilder(); + } else { + return pointInTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : pointInTime_; + } + } + + /** + * + * + *
+     * Timestamp, if specified, identifies the time to which the source instance
+     * is cloned.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetPointInTimeFieldBuilder() { + if (pointInTimeBuilder_ == null) { + pointInTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPointInTime(), getParentForChildren(), isClean()); + pointInTime_ = null; + } + return pointInTimeBuilder_; + } + + private java.lang.Object allocatedIpRange_ = ""; + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the cloned instance
+     * ip will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?.
+     * Reserved for future use.
+     * 
+ * + * string allocated_ip_range = 6; + * + * @return The allocatedIpRange. + */ + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the cloned instance
+     * ip will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?.
+     * Reserved for future use.
+     * 
+ * + * string allocated_ip_range = 6; + * + * @return The bytes for allocatedIpRange. + */ + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the cloned instance
+     * ip will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?.
+     * Reserved for future use.
+     * 
+ * + * string allocated_ip_range = 6; + * + * @param value The allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRange(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + allocatedIpRange_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the cloned instance
+     * ip will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?.
+     * Reserved for future use.
+     * 
+ * + * string allocated_ip_range = 6; + * + * @return This builder for chaining. + */ + public Builder clearAllocatedIpRange() { + allocatedIpRange_ = getDefaultInstance().getAllocatedIpRange(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the cloned instance
+     * ip will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?.
+     * Reserved for future use.
+     * 
+ * + * string allocated_ip_range = 6; + * + * @param value The bytes for allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRangeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + allocatedIpRange_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList databaseNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDatabaseNamesIsMutable() { + if (!databaseNames_.isModifiable()) { + databaseNames_ = new com.google.protobuf.LazyStringArrayList(databaseNames_); + } + bitField0_ |= 0x00000040; + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @return A list containing the databaseNames. + */ + public com.google.protobuf.ProtocolStringList getDatabaseNamesList() { + databaseNames_.makeImmutable(); + return databaseNames_; + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @return The count of databaseNames. + */ + public int getDatabaseNamesCount() { + return databaseNames_.size(); + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @param index The index of the element to return. + * @return The databaseNames at the given index. + */ + public java.lang.String getDatabaseNames(int index) { + return databaseNames_.get(index); + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @param index The index of the value to return. + * @return The bytes of the databaseNames at the given index. + */ + public com.google.protobuf.ByteString getDatabaseNamesBytes(int index) { + return databaseNames_.getByteString(index); + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @param index The index to set the value at. + * @param value The databaseNames to set. + * @return This builder for chaining. + */ + public Builder setDatabaseNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseNamesIsMutable(); + databaseNames_.set(index, value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @param value The databaseNames to add. + * @return This builder for chaining. + */ + public Builder addDatabaseNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseNamesIsMutable(); + databaseNames_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @param values The databaseNames to add. + * @return This builder for chaining. + */ + public Builder addAllDatabaseNames(java.lang.Iterable values) { + ensureDatabaseNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, databaseNames_); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseNames() { + databaseNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * (SQL Server only) Clone only the specified databases from the source
+     * instance. Clone all databases if empty.
+     * 
+ * + * repeated string database_names = 9; + * + * @param value The bytes of the databaseNames to add. + * @return This builder for chaining. + */ + public Builder addDatabaseNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDatabaseNamesIsMutable(); + databaseNames_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object preferredZone_ = ""; + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of an instance to the
+     * specified zone. If no zone is specified, clone to the same primary zone as
+     * the source instance.
+     * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the preferredZone field is set. + */ + public boolean hasPreferredZone() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of an instance to the
+     * specified zone. If no zone is specified, clone to the same primary zone as
+     * the source instance.
+     * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The preferredZone. + */ + public java.lang.String getPreferredZone() { + java.lang.Object ref = preferredZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of an instance to the
+     * specified zone. If no zone is specified, clone to the same primary zone as
+     * the source instance.
+     * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for preferredZone. + */ + public com.google.protobuf.ByteString getPreferredZoneBytes() { + java.lang.Object ref = preferredZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of an instance to the
+     * specified zone. If no zone is specified, clone to the same primary zone as
+     * the source instance.
+     * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The preferredZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + preferredZone_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of an instance to the
+     * specified zone. If no zone is specified, clone to the same primary zone as
+     * the source instance.
+     * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPreferredZone() { + preferredZone_ = getDefaultInstance().getPreferredZone(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of an instance to the
+     * specified zone. If no zone is specified, clone to the same primary zone as
+     * the source instance.
+     * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for preferredZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + preferredZone_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object preferredSecondaryZone_ = ""; + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of a regional
+     * instance in the specified zones. If not specified, clone to the same
+     * secondary zone as the source instance. This value cannot be the same as the
+     * preferred_zone field.
+     * 
+ * + * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the preferredSecondaryZone field is set. + */ + public boolean hasPreferredSecondaryZone() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of a regional
+     * instance in the specified zones. If not specified, clone to the same
+     * secondary zone as the source instance. This value cannot be the same as the
+     * preferred_zone field.
+     * 
+ * + * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The preferredSecondaryZone. + */ + public java.lang.String getPreferredSecondaryZone() { + java.lang.Object ref = preferredSecondaryZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredSecondaryZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of a regional
+     * instance in the specified zones. If not specified, clone to the same
+     * secondary zone as the source instance. This value cannot be the same as the
+     * preferred_zone field.
+     * 
+ * + * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for preferredSecondaryZone. + */ + public com.google.protobuf.ByteString getPreferredSecondaryZoneBytes() { + java.lang.Object ref = preferredSecondaryZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredSecondaryZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of a regional
+     * instance in the specified zones. If not specified, clone to the same
+     * secondary zone as the source instance. This value cannot be the same as the
+     * preferred_zone field.
+     * 
+ * + * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The preferredSecondaryZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredSecondaryZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + preferredSecondaryZone_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of a regional
+     * instance in the specified zones. If not specified, clone to the same
+     * secondary zone as the source instance. This value cannot be the same as the
+     * preferred_zone field.
+     * 
+ * + * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPreferredSecondaryZone() { + preferredSecondaryZone_ = getDefaultInstance().getPreferredSecondaryZone(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Copy clone and point-in-time recovery clone of a regional
+     * instance in the specified zones. If not specified, clone to the same
+     * secondary zone as the source instance. This value cannot be the same as the
+     * preferred_zone field.
+     * 
+ * + * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for preferredSecondaryZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredSecondaryZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + preferredSecondaryZone_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp sourceInstanceDeletionTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + sourceInstanceDeletionTimeBuilder_; + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + * + * @return Whether the sourceInstanceDeletionTime field is set. + */ + public boolean hasSourceInstanceDeletionTime() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + * + * @return The sourceInstanceDeletionTime. + */ + public com.google.protobuf.Timestamp getSourceInstanceDeletionTime() { + if (sourceInstanceDeletionTimeBuilder_ == null) { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } else { + return sourceInstanceDeletionTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + public Builder setSourceInstanceDeletionTime(com.google.protobuf.Timestamp value) { + if (sourceInstanceDeletionTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceInstanceDeletionTime_ = value; + } else { + sourceInstanceDeletionTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + public Builder setSourceInstanceDeletionTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (sourceInstanceDeletionTimeBuilder_ == null) { + sourceInstanceDeletionTime_ = builderForValue.build(); + } else { + sourceInstanceDeletionTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + public Builder mergeSourceInstanceDeletionTime(com.google.protobuf.Timestamp value) { + if (sourceInstanceDeletionTimeBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && sourceInstanceDeletionTime_ != null + && sourceInstanceDeletionTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getSourceInstanceDeletionTimeBuilder().mergeFrom(value); + } else { + sourceInstanceDeletionTime_ = value; + } + } else { + sourceInstanceDeletionTimeBuilder_.mergeFrom(value); + } + if (sourceInstanceDeletionTime_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + public Builder clearSourceInstanceDeletionTime() { + bitField0_ = (bitField0_ & ~0x00000200); + sourceInstanceDeletionTime_ = null; + if (sourceInstanceDeletionTimeBuilder_ != null) { + sourceInstanceDeletionTimeBuilder_.dispose(); + sourceInstanceDeletionTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + public com.google.protobuf.Timestamp.Builder getSourceInstanceDeletionTimeBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetSourceInstanceDeletionTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + public com.google.protobuf.TimestampOrBuilder getSourceInstanceDeletionTimeOrBuilder() { + if (sourceInstanceDeletionTimeBuilder_ != null) { + return sourceInstanceDeletionTimeBuilder_.getMessageOrBuilder(); + } else { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetSourceInstanceDeletionTimeFieldBuilder() { + if (sourceInstanceDeletionTimeBuilder_ == null) { + sourceInstanceDeletionTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSourceInstanceDeletionTime(), getParentForChildren(), isClean()); + sourceInstanceDeletionTime_ = null; + } + return sourceInstanceDeletionTimeBuilder_; + } + + private java.lang.Object destinationProject_ = ""; + + /** + * + * + *
+     * Optional. The project ID of the destination project where the cloned
+     * instance will be created. To perform a cross-project clone, this field is
+     * required. If not specified, the clone is created in the same project
+     * as the source instance.
+     * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the destinationProject field is set. + */ + public boolean hasDestinationProject() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Optional. The project ID of the destination project where the cloned
+     * instance will be created. To perform a cross-project clone, this field is
+     * required. If not specified, the clone is created in the same project
+     * as the source instance.
+     * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The destinationProject. + */ + public java.lang.String getDestinationProject() { + java.lang.Object ref = destinationProject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationProject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The project ID of the destination project where the cloned
+     * instance will be created. To perform a cross-project clone, this field is
+     * required. If not specified, the clone is created in the same project
+     * as the source instance.
+     * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for destinationProject. + */ + public com.google.protobuf.ByteString getDestinationProjectBytes() { + java.lang.Object ref = destinationProject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The project ID of the destination project where the cloned
+     * instance will be created. To perform a cross-project clone, this field is
+     * required. If not specified, the clone is created in the same project
+     * as the source instance.
+     * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The destinationProject to set. + * @return This builder for chaining. + */ + public Builder setDestinationProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationProject_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The project ID of the destination project where the cloned
+     * instance will be created. To perform a cross-project clone, this field is
+     * required. If not specified, the clone is created in the same project
+     * as the source instance.
+     * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearDestinationProject() { + destinationProject_ = getDefaultInstance().getDestinationProject(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The project ID of the destination project where the cloned
+     * instance will be created. To perform a cross-project clone, this field is
+     * required. If not specified, the clone is created in the same project
+     * as the source instance.
+     * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for destinationProject to set. + * @return This builder for chaining. + */ + public Builder setDestinationProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationProject_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object destinationNetwork_ = ""; + + /** + * + * + *
+     * Optional. The fully qualified URI of the VPC network to which the cloned
+     * instance will be connected via private services access for private IP. For
+     * example:`projects/my-network-project/global/networks/my-network`. This
+     * field is only required for cross-project cloning.
+     * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the destinationNetwork field is set. + */ + public boolean hasDestinationNetwork() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Optional. The fully qualified URI of the VPC network to which the cloned
+     * instance will be connected via private services access for private IP. For
+     * example:`projects/my-network-project/global/networks/my-network`. This
+     * field is only required for cross-project cloning.
+     * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The destinationNetwork. + */ + public java.lang.String getDestinationNetwork() { + java.lang.Object ref = destinationNetwork_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationNetwork_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The fully qualified URI of the VPC network to which the cloned
+     * instance will be connected via private services access for private IP. For
+     * example:`projects/my-network-project/global/networks/my-network`. This
+     * field is only required for cross-project cloning.
+     * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destinationNetwork. + */ + public com.google.protobuf.ByteString getDestinationNetworkBytes() { + java.lang.Object ref = destinationNetwork_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The fully qualified URI of the VPC network to which the cloned
+     * instance will be connected via private services access for private IP. For
+     * example:`projects/my-network-project/global/networks/my-network`. This
+     * field is only required for cross-project cloning.
+     * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The destinationNetwork to set. + * @return This builder for chaining. + */ + public Builder setDestinationNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationNetwork_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The fully qualified URI of the VPC network to which the cloned
+     * instance will be connected via private services access for private IP. For
+     * example:`projects/my-network-project/global/networks/my-network`. This
+     * field is only required for cross-project cloning.
+     * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDestinationNetwork() { + destinationNetwork_ = getDefaultInstance().getDestinationNetwork(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The fully qualified URI of the VPC network to which the cloned
+     * instance will be connected via private services access for private IP. For
+     * example:`projects/my-network-project/global/networks/my-network`. This
+     * field is only required for cross-project cloning.
+     * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for destinationNetwork to set. + * @return This builder for chaining. + */ + public Builder setDestinationNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationNetwork_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.CloneContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.CloneContext) + private static final com.google.cloud.sql.v1beta4.CloneContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.CloneContext(); + } + + public static com.google.cloud.sql.v1beta4.CloneContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloneContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.CloneContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloneContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloneContextOrBuilder.java new file mode 100644 index 000000000000..fcc40beb0323 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloneContextOrBuilder.java @@ -0,0 +1,513 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface CloneContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.CloneContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#cloneContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#cloneContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Reserved for future use.
+   * 
+ * + * int64 pitr_timestamp_ms = 2; + * + * @return The pitrTimestampMs. + */ + long getPitrTimestampMs(); + + /** + * + * + *
+   * Name of the Cloud SQL instance to be created as a clone.
+   * 
+ * + * string destination_instance_name = 3; + * + * @return The destinationInstanceName. + */ + java.lang.String getDestinationInstanceName(); + + /** + * + * + *
+   * Name of the Cloud SQL instance to be created as a clone.
+   * 
+ * + * string destination_instance_name = 3; + * + * @return The bytes for destinationInstanceName. + */ + com.google.protobuf.ByteString getDestinationInstanceNameBytes(); + + /** + * + * + *
+   * Binary log coordinates, if specified, identify the position up to which the
+   * source instance is cloned. If not specified, the source instance is
+   * cloned up to the most recent binary log coordinates.
+   * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + * + * @return Whether the binLogCoordinates field is set. + */ + boolean hasBinLogCoordinates(); + + /** + * + * + *
+   * Binary log coordinates, if specified, identify the position up to which the
+   * source instance is cloned. If not specified, the source instance is
+   * cloned up to the most recent binary log coordinates.
+   * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + * + * @return The binLogCoordinates. + */ + com.google.cloud.sql.v1beta4.BinLogCoordinates getBinLogCoordinates(); + + /** + * + * + *
+   * Binary log coordinates, if specified, identify the position up to which the
+   * source instance is cloned. If not specified, the source instance is
+   * cloned up to the most recent binary log coordinates.
+   * 
+ * + * .google.cloud.sql.v1beta4.BinLogCoordinates bin_log_coordinates = 4; + */ + com.google.cloud.sql.v1beta4.BinLogCoordinatesOrBuilder getBinLogCoordinatesOrBuilder(); + + /** + * + * + *
+   * Timestamp, if specified, identifies the time to which the source instance
+   * is cloned.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + * + * @return Whether the pointInTime field is set. + */ + boolean hasPointInTime(); + + /** + * + * + *
+   * Timestamp, if specified, identifies the time to which the source instance
+   * is cloned.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + * + * @return The pointInTime. + */ + com.google.protobuf.Timestamp getPointInTime(); + + /** + * + * + *
+   * Timestamp, if specified, identifies the time to which the source instance
+   * is cloned.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder(); + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the cloned instance
+   * ip will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?.
+   * Reserved for future use.
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The allocatedIpRange. + */ + java.lang.String getAllocatedIpRange(); + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the cloned instance
+   * ip will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?.
+   * Reserved for future use.
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The bytes for allocatedIpRange. + */ + com.google.protobuf.ByteString getAllocatedIpRangeBytes(); + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @return A list containing the databaseNames. + */ + java.util.List getDatabaseNamesList(); + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @return The count of databaseNames. + */ + int getDatabaseNamesCount(); + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @param index The index of the element to return. + * @return The databaseNames at the given index. + */ + java.lang.String getDatabaseNames(int index); + + /** + * + * + *
+   * (SQL Server only) Clone only the specified databases from the source
+   * instance. Clone all databases if empty.
+   * 
+ * + * repeated string database_names = 9; + * + * @param index The index of the value to return. + * @return The bytes of the databaseNames at the given index. + */ + com.google.protobuf.ByteString getDatabaseNamesBytes(int index); + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of an instance to the
+   * specified zone. If no zone is specified, clone to the same primary zone as
+   * the source instance.
+   * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the preferredZone field is set. + */ + boolean hasPreferredZone(); + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of an instance to the
+   * specified zone. If no zone is specified, clone to the same primary zone as
+   * the source instance.
+   * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The preferredZone. + */ + java.lang.String getPreferredZone(); + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of an instance to the
+   * specified zone. If no zone is specified, clone to the same primary zone as
+   * the source instance.
+   * 
+ * + * optional string preferred_zone = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for preferredZone. + */ + com.google.protobuf.ByteString getPreferredZoneBytes(); + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of a regional
+   * instance in the specified zones. If not specified, clone to the same
+   * secondary zone as the source instance. This value cannot be the same as the
+   * preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the preferredSecondaryZone field is set. + */ + boolean hasPreferredSecondaryZone(); + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of a regional
+   * instance in the specified zones. If not specified, clone to the same
+   * secondary zone as the source instance. This value cannot be the same as the
+   * preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The preferredSecondaryZone. + */ + java.lang.String getPreferredSecondaryZone(); + + /** + * + * + *
+   * Optional. Copy clone and point-in-time recovery clone of a regional
+   * instance in the specified zones. If not specified, clone to the same
+   * secondary zone as the source instance. This value cannot be the same as the
+   * preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for preferredSecondaryZone. + */ + com.google.protobuf.ByteString getPreferredSecondaryZoneBytes(); + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + * + * @return Whether the sourceInstanceDeletionTime field is set. + */ + boolean hasSourceInstanceDeletionTime(); + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + * + * @return The sourceInstanceDeletionTime. + */ + com.google.protobuf.Timestamp getSourceInstanceDeletionTime(); + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 12; + */ + com.google.protobuf.TimestampOrBuilder getSourceInstanceDeletionTimeOrBuilder(); + + /** + * + * + *
+   * Optional. The project ID of the destination project where the cloned
+   * instance will be created. To perform a cross-project clone, this field is
+   * required. If not specified, the clone is created in the same project
+   * as the source instance.
+   * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the destinationProject field is set. + */ + boolean hasDestinationProject(); + + /** + * + * + *
+   * Optional. The project ID of the destination project where the cloned
+   * instance will be created. To perform a cross-project clone, this field is
+   * required. If not specified, the clone is created in the same project
+   * as the source instance.
+   * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The destinationProject. + */ + java.lang.String getDestinationProject(); + + /** + * + * + *
+   * Optional. The project ID of the destination project where the cloned
+   * instance will be created. To perform a cross-project clone, this field is
+   * required. If not specified, the clone is created in the same project
+   * as the source instance.
+   * 
+ * + * optional string destination_project = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for destinationProject. + */ + com.google.protobuf.ByteString getDestinationProjectBytes(); + + /** + * + * + *
+   * Optional. The fully qualified URI of the VPC network to which the cloned
+   * instance will be connected via private services access for private IP. For
+   * example:`projects/my-network-project/global/networks/my-network`. This
+   * field is only required for cross-project cloning.
+   * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the destinationNetwork field is set. + */ + boolean hasDestinationNetwork(); + + /** + * + * + *
+   * Optional. The fully qualified URI of the VPC network to which the cloned
+   * instance will be connected via private services access for private IP. For
+   * example:`projects/my-network-project/global/networks/my-network`. This
+   * field is only required for cross-project cloning.
+   * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The destinationNetwork. + */ + java.lang.String getDestinationNetwork(); + + /** + * + * + *
+   * Optional. The fully qualified URI of the VPC network to which the cloned
+   * instance will be connected via private services access for private IP. For
+   * example:`projects/my-network-project/global/networks/my-network`. This
+   * field is only required for cross-project cloning.
+   * 
+ * + * + * optional string destination_network = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destinationNetwork. + */ + com.google.protobuf.ByteString getDestinationNetworkBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlConnectProto.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlConnectProto.java new file mode 100644 index 000000000000..37a2e113f6d9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlConnectProto.java @@ -0,0 +1,250 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public final class CloudSqlConnectProto extends com.google.protobuf.GeneratedFile { + private CloudSqlConnectProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlConnectProto"); + } + + 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_sql_v1beta4_GetConnectSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_GetConnectSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ResolveConnectSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ResolveConnectSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ConnectSettings_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ConnectSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ConnectSettings_ConnectPoolNodeConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ConnectSettings_ConnectPoolNodeConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertResponse_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" + + "0google/cloud/sql/v1beta4/cloud_sql_con" + + "nect.proto\022\030google.cloud.sql.v1beta4\032\034go" + + "ogle/api/annotations.proto\032\027google/api/c" + + "lient.proto\032\037google/api/field_behavior.p" + + "roto\0322google/cloud/sql/v1beta4/cloud_sql" + + "_resources.proto\032\036google/protobuf/durati" + + "on.proto\032\037google/protobuf/timestamp.proto\"r\n" + + "\031GetConnectSettingsRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\0222\n" + + "\tread_time\030\007 \001(\0132\032.google.protobuf.TimestampB\003\340A\001\"M\n" + + "\035ResolveConnectSettingsRequest\022\025\n" + + "\010dns_name\030\001 \001(\tB\003\340A\002\022\025\n" + + "\010location\030\002 \001(\tB\003\340A\002\"\303\t\n" + + "\017ConnectSettings\022\014\n" + + "\004kind\030\001 \001(\t\0229\n" + + "\016server_ca_cert\030\002 \001(\0132!.google.cloud.sql.v1beta4.SslCert\0229\n" + + "\014ip_addresses\030\003 \003(\0132#.google.cloud.sql.v1beta4.IpMapping\022\016\n" + + "\006region\030\004 \001(\t\022F\n" + + "\020database_version\030\037" + + " \001(\0162,.google.cloud.sql.v1beta4.SqlDatabaseVersion\022>\n" + + "\014backend_type\030 \001(\0162(.google.cloud.sql.v1beta4.SqlBackendType\022\023\n" + + "\013psc_enabled\030! \001(\010\022\020\n" + + "\010dns_name\030\" \001(\t\022H\n" + + "\016server_ca_mode\030# " + + "\001(\01620.google.cloud.sql.v1beta4.ConnectSettings.CaMode\022(\n" + + " custom_subject_alternative_names\030% \003(\t\022@\n" + + "\tdns_names\030& \003(\0132(.goo" + + "gle.cloud.sql.v1beta4.DnsNameMappingB\003\340A\003\022\027\n\n" + + "node_count\030? \001(\005H\000\210\001\001\022S\n" + + "\005nodes\030@ \003(" + + "\0132?.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfigB\003\340A\003\022b\n" + + "\024mdx_protocol_support\030\' \003(\0162<.google.cloud.sql" + + ".v1beta4.ConnectSettings.MdxProtocolSupportB\006\340A\003\340A\001\022\037\n" + + "\017connection_name\030( \001(\tB\006\340A\003\340A\001\032\343\001\n" + + "\025ConnectPoolNodeConfig\022\026\n" + + "\004name\030\001 \001(\tB\003\340A\003H\000\210\001\001\022>\n" + + "\014ip_addresses\030\002 \003(\0132#.g" + + "oogle.cloud.sql.v1beta4.IpMappingB\003\340A\003\022\032\n" + + "\010dns_name\030\003 \001(\tB\003\340A\003H\001\210\001\001\022@\n" + + "\tdns_names\030\004" + + " \003(\0132(.google.cloud.sql.v1beta4.DnsNameMappingB\003\340A\003B\007\n" + + "\005_nameB\013\n" + + "\t_dns_name\"y\n" + + "\006CaMode\022\027\n" + + "\023CA_MODE_UNSPECIFIED\020\000\022\036\n" + + "\032GOOGLE_MANAGED_INTERNAL_CA\020\001\022\031\n" + + "\025GOOGLE_MANAGED_CAS_CA\020\002\022\033\n" + + "\027CUSTOMER_MANAGED_CAS_CA\020\003\"T\n" + + "\022MdxProtocolSupport\022$\n" + + " MDX_PROTOCOL_SUPPORT_UNSPECIFIED\020\000\022\030\n" + + "\024CLIENT_PROTOCOL_TYPE\020\001B\r\n" + + "\013_node_count\"\366\001\n" + + "\034GenerateEphemeralCertRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022\036\n\n" + + "public_key\030\003 \001(\tR\n" + + "public_key\022\'\n" + + "\014access_token\030\004 \001(\tB\003\340A\001R\014access_token\0222\n" + + "\tread_time\030\007 \001(\0132\032.google.protobuf.TimestampB\003\340A\001\0226\n" + + "\016valid_duration\030\014 \001(\0132\031.google.protobuf.DurationB\003\340A\001\"Z\n" + + "\035GenerateEphemeralCertResponse\0229\n" + + "\016ephemeral_cert\030\001 \001(\0132!.google.cloud.sql.v1beta4.SslCert2\210\006\n" + + "\021SqlConnectService\022\302\001\n" + + "\022GetConnectSettings\0223.google.cloud.sql.v1beta4.GetConne" + + "ctSettingsRequest\032).google.cloud.sql.v1b" + + "eta4.ConnectSettings\"L\202\323\344\223\002F\022D/sql/v1bet" + + "a4/projects/{project}/instances/{instance}/connectSettings\022\315\001\n" + + "\026ResolveConnectSettings\0227.google.cloud.sql.v1beta4.Resolve" + + "ConnectSettingsRequest\032).google.cloud.sq" + + "l.v1beta4.ConnectSettings\"O\202\323\344\223\002I\022G/sql/" + + "v1beta4/locations/{location}/dns/{dns_name}:resolveConnectSettings\022\337\001\n" + + "\025GenerateEphemeralCert\0226.google.cloud.sql.v1beta4." + + "GenerateEphemeralCertRequest\0327.google.cloud.sql.v1beta4.GenerateEphemeralCertRes" + + "ponse\"U\202\323\344\223\002O\"J/sql/v1beta4/projects/{pr" + + "oject}/instances/{instance}:generateEphe" + + "meralCert:\001*\032|\312A\027sqladmin.googleapis.com" + + "\322A_https://www.googleapis.com/auth/cloud" + + "-platform,https://www.googleapis.com/auth/sqlservice.adminBf\n" + + "\034com.google.cloud.sql.v1beta4B\024CloudSqlConnectProtoP\001Z.clou" + + "d.google.com/go/sql/apiv1beta4/sqlpb;sqlpbb\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.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_sql_v1beta4_GetConnectSettingsRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_sql_v1beta4_GetConnectSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_GetConnectSettingsRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "ReadTime", + }); + internal_static_google_cloud_sql_v1beta4_ResolveConnectSettingsRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_sql_v1beta4_ResolveConnectSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ResolveConnectSettingsRequest_descriptor, + new java.lang.String[] { + "DnsName", "Location", + }); + internal_static_google_cloud_sql_v1beta4_ConnectSettings_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_sql_v1beta4_ConnectSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ConnectSettings_descriptor, + new java.lang.String[] { + "Kind", + "ServerCaCert", + "IpAddresses", + "Region", + "DatabaseVersion", + "BackendType", + "PscEnabled", + "DnsName", + "ServerCaMode", + "CustomSubjectAlternativeNames", + "DnsNames", + "NodeCount", + "Nodes", + "MdxProtocolSupport", + "ConnectionName", + }); + internal_static_google_cloud_sql_v1beta4_ConnectSettings_ConnectPoolNodeConfig_descriptor = + internal_static_google_cloud_sql_v1beta4_ConnectSettings_descriptor.getNestedType(0); + internal_static_google_cloud_sql_v1beta4_ConnectSettings_ConnectPoolNodeConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ConnectSettings_ConnectPoolNodeConfig_descriptor, + new java.lang.String[] { + "Name", "IpAddresses", "DnsName", "DnsNames", + }); + internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "PublicKey", "AccessToken", "ReadTime", "ValidDuration", + }); + internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertResponse_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertResponse_descriptor, + new java.lang.String[] { + "EphemeralCert", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlDataProto.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlDataProto.java new file mode 100644 index 000000000000..13b4e441ae57 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlDataProto.java @@ -0,0 +1,237 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public final class CloudSqlDataProto extends com.google.protobuf.GeneratedFile { + private CloudSqlDataProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlDataProto"); + } + + 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_sql_v1beta4_StreamSqlDataRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_StreamSqlDataRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_StartSession_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_StartSession_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ContinueSession_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ContinueSession_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_StreamSqlDataResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_StreamSqlDataResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SessionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SessionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DataPacket_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DataPacket_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_Ack_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_Ack_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_TerminateSession_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_TerminateSession_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/sql/v1beta4/cloud_sql_dat" + + "a.proto\022\030google.cloud.sql.v1beta4\032\034googl" + + "e/api/annotations.proto\032\027google/api/clie" + + "nt.proto\032\037google/api/field_behavior.prot" + + "o\032\031google/api/resource.proto\032\027google/rpc/status.proto\"\230\003\n" + + "\024StreamSqlDataRequest\022/\n" + + "\003ack\030\004 \001(\0132\035.google.cloud.sql.v1beta4.AckB\003\340A\001\022?\n\r" + + "start_session\030\005 \001(\0132&.google.cloud.sql.v1beta4.StartSessionH\000\022E\n" + + "\020continue_session\030\006" + + " \001(\0132).google.cloud.sql.v1beta4.ContinueSessionH\000\0224\n" + + "\004data\030\007 \001(\0132$.google.cloud.sql.v1beta4.DataPacketH\000\022G\n" + + "\021terminate_session\030\010" + + " \001(\0132*.google.cloud.sql.v1beta4.TerminateSessionH\000\022=\n" + + "\013instance_id\030\t \001(\tB(\340A\001\372A\"\n" + + " cloudsql.googleapis.com/InstanceB\t\n" + + "\007message\"\200\001\n" + + "\014StartSession\022\030\n" + + "\013location_id\030\001 \001(\tB\003\340A\002\022=\n" + + "\013instance_id\030\002 \001(\tB(\340A\002\372A\"\n" + + " cloudsql.googleapis.com/Instance\022\027\n\n" + + "session_id\030\003 \001(\tB\003\340A\001\"\203\001\n" + + "\017ContinueSession\022\030\n" + + "\013location_id\030\001 \001(\tB\003\340A\002\022=\n" + + "\013instance_id\030\002 \001(\tB(\340A\002\372A\"\n" + + " cloudsql.googleapis.com/Instance\022\027\n\n" + + "session_id\030\003 \001(\tB\003\340A\002\"\224\002\n" + + "\025StreamSqlDataResponse\022*\n" + + "\003ack\030\002 \001(\0132\035.google.cloud.sql.v1beta4.Ack\022E\n" + + "\020session_metadata\030\003" + + " \001(\0132).google.cloud.sql.v1beta4.SessionMetadataH\000\0224\n" + + "\004data\030\004 \001(\0132$.google.cloud.sql.v1beta4.DataPacketH\000\022G\n" + + "\021terminate_session\030\005" + + " \001(\0132*.google.cloud.sql.v1beta4.TerminateSessionH\000B\t\n" + + "\007message\"W\n" + + "\017SessionMetadata\022D\n" + + "\022supported_features\030\001" + + " \003(\0162(.google.cloud.sql.v1beta4.SqlDataFeature\"?\n\n" + + "DataPacket\022\036\n" + + "\021first_byte_offset\030\001 \001(\003B\003\340A\001\022\021\n" + + "\004data\030\002 \001(\014B\003\340A\002\"#\n" + + "\003Ack\022\034\n" + + "\017received_offset\030\001 \001(\003B\003\340A\002\";\n" + + "\020TerminateSession\022\'\n" + + "\006status\030\001 \001(\0132\022.google.rpc.StatusB\003\340A\002*R\n" + + "\016SqlDataFeature\022 \n" + + "\034SQL_DATA_FEATURE_UNSPECIFIED\020\000\022\036\n" + + "\032SQL_DATA_FEATURE_RECONNECT\020\0012\206\002\n" + + "\016SqlDataService\022v\n\r" + + "StreamSqlData\022..google.cloud.sql.v1beta4.StreamSqlDataRequest\032/.google.cl" + + "oud.sql.v1beta4.StreamSqlDataResponse\"\000(" + + "\0010\001\032|\312A\027sqladmin.googleapis.com\322A_https:" + + "//www.googleapis.com/auth/cloud-platform" + + ",https://www.googleapis.com/auth/sqlservice.adminBc\n" + + "\034com.google.cloud.sql.v1beta4B\021CloudSqlDataProtoP\001Z.cloud.google.com" + + "/go/sql/apiv1beta4/sqlpb;sqlpbb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_cloud_sql_v1beta4_StreamSqlDataRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_sql_v1beta4_StreamSqlDataRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_StreamSqlDataRequest_descriptor, + new java.lang.String[] { + "Ack", + "StartSession", + "ContinueSession", + "Data", + "TerminateSession", + "InstanceId", + "Message", + }); + internal_static_google_cloud_sql_v1beta4_StartSession_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_sql_v1beta4_StartSession_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_StartSession_descriptor, + new java.lang.String[] { + "LocationId", "InstanceId", "SessionId", + }); + internal_static_google_cloud_sql_v1beta4_ContinueSession_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_sql_v1beta4_ContinueSession_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ContinueSession_descriptor, + new java.lang.String[] { + "LocationId", "InstanceId", "SessionId", + }); + internal_static_google_cloud_sql_v1beta4_StreamSqlDataResponse_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_sql_v1beta4_StreamSqlDataResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_StreamSqlDataResponse_descriptor, + new java.lang.String[] { + "Ack", "SessionMetadata", "Data", "TerminateSession", "Message", + }); + internal_static_google_cloud_sql_v1beta4_SessionMetadata_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_cloud_sql_v1beta4_SessionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SessionMetadata_descriptor, + new java.lang.String[] { + "SupportedFeatures", + }); + internal_static_google_cloud_sql_v1beta4_DataPacket_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_cloud_sql_v1beta4_DataPacket_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DataPacket_descriptor, + new java.lang.String[] { + "FirstByteOffset", "Data", + }); + internal_static_google_cloud_sql_v1beta4_Ack_descriptor = getDescriptor().getMessageType(6); + internal_static_google_cloud_sql_v1beta4_Ack_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_Ack_descriptor, + new java.lang.String[] { + "ReceivedOffset", + }); + internal_static_google_cloud_sql_v1beta4_TerminateSession_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_cloud_sql_v1beta4_TerminateSession_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_TerminateSession_descriptor, + new java.lang.String[] { + "Status", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + 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.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlIamPoliciesProto.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlIamPoliciesProto.java new file mode 100644 index 000000000000..1d7c794f8a7d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlIamPoliciesProto.java @@ -0,0 +1,78 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_iam_policies.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public final class CloudSqlIamPoliciesProto extends com.google.protobuf.GeneratedFile { + private CloudSqlIamPoliciesProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlIamPoliciesProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n5google/cloud/sql/v1beta4/cloud_sql_iam" + + "_policies.proto\022\030google.cloud.sql.v1beta" + + "4\032\034google/api/annotations.proto\032\027google/" + + "api/client.proto23\n\025SqlIamPoliciesServic" + + "e\032\032\312A\027sqladmin.googleapis.comBj\n\034com.goo" + + "gle.cloud.sql.v1beta4B\030CloudSqlIamPolici" + + "esProtoP\001Z.cloud.google.com/go/sql/apiv1" + + "beta4/sqlpb;sqlpbb\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(), + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlResourcesProto.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlResourcesProto.java new file mode 100644 index 000000000000..cc0b518a0136 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlResourcesProto.java @@ -0,0 +1,3303 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public final class CloudSqlResourcesProto extends com.google.protobuf.GeneratedFile { + private CloudSqlResourcesProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlResourcesProto"); + } + + 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_sql_v1beta4_AclEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_AclEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ApiWarning_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ApiWarning_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_BackupRetentionSettings_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_BackupRetentionSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_BackupConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_BackupConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_BackupRun_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_BackupRun_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_Backup_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_Backup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_BackupRunsListResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_BackupRunsListResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_BinLogCoordinates_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_BinLogCoordinates_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_BackupContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_BackupContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_CloneContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_CloneContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_Database_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_Database_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlServerDatabaseDetails_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlServerDatabaseDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DatabaseFlags_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DatabaseFlags_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SyncFlags_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SyncFlags_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstanceReference_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstanceReference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlFailoverReplica_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlFailoverReplica_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlScheduledMaintenance_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlScheduledMaintenance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlOutOfDiskReport_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlOutOfDiskReport_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_PoolNodeConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_PoolNodeConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_TagsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_TagsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DnsNameMapping_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DnsNameMapping_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_GeminiInstanceConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_GeminiInstanceConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ReplicationCluster_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ReplicationCluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_AvailableDatabaseVersion_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_AvailableDatabaseVersion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DatabasesListResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DatabasesListResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DemoteMasterConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DemoteMasterConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DemoteMasterContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DemoteMasterContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DemoteMasterMySqlReplicaConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DemoteMasterMySqlReplicaConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DemoteContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DemoteContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ExportContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ExportContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlCsvExportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlCsvExportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_MysqlExportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_MysqlExportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_PostgresExportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_PostgresExportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlBakExportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlBakExportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlTdeExportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlTdeExportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_FailoverContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_FailoverContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_Flag_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_Flag_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_FlagsListResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_FlagsListResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ImportContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ImportContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_PostgresImportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_PostgresImportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlCsvImportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlCsvImportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_EncryptionOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_EncryptionOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlTdeImportOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlTdeImportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesCloneRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesCloneRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesDemoteMasterRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesDemoteMasterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesDemoteRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesDemoteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesExportRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesExportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesFailoverRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesFailoverRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesImportRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesImportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesPreCheckMajorVersionUpgradeRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesPreCheckMajorVersionUpgradeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_MySqlSyncConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_MySqlSyncConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesListResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesListResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesListServerCasResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesListServerCasResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesListServerCertificatesResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesListServerCertificatesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesListEntraIdCertificatesResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesListEntraIdCertificatesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesRestoreBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesRestoreBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCaRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCertificateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCertificateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesRotateEntraIdCertificateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesRotateEntraIdCertificateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesTruncateLogRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesTruncateLogRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesAcquireSsrsLeaseRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesAcquireSsrsLeaseRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_PointInTimeRestoreContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_PointInTimeRestoreContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_PerformDiskShrinkContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_PerformDiskShrinkContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_PreCheckResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_PreCheckResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_PreCheckMajorVersionUpgradeContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_PreCheckMajorVersionUpgradeContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlExternalSyncSettingError_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlExternalSyncSettingError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_IpConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_IpConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_PscConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_PscConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_PscAutoConnectionConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_PscAutoConnectionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_IpMapping_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_IpMapping_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_LocationPreference_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_LocationPreference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_MaintenanceWindow_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_MaintenanceWindow_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DenyMaintenancePeriod_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DenyMaintenancePeriod_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InsightsConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InsightsConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_MySqlReplicaConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_MySqlReplicaConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SelectedObjects_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SelectedObjects_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_OnPremisesConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_OnPremisesConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DiskEncryptionConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DiskEncryptionConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DiskEncryptionStatus_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DiskEncryptionStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlSubOperationType_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlSubOperationType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_Operation_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_Operation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_OperationError_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_OperationError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_OperationErrors_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_OperationErrors_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_PasswordValidationPolicy_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_PasswordValidationPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_OperationsListResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_OperationsListResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ReplicaConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ReplicaConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_RestoreBackupContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_RestoreBackupContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_RotateServerCaContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_RotateServerCaContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_RotateServerCertificateContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_RotateServerCertificateContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_RotateEntraIdCertificateContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_RotateEntraIdCertificateContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DataCacheConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DataCacheConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_FinalBackupConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_FinalBackupConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_Settings_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_Settings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_Settings_UserLabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_Settings_UserLabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_PerformanceCaptureConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_PerformanceCaptureConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_AdvancedMachineFeatures_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_AdvancedMachineFeatures_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SslCert_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SslCert_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SslCertDetail_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SslCertDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SslCertsCreateEphemeralRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SslCertsCreateEphemeralRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SslCertsInsertRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SslCertsInsertRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SslCertsInsertResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SslCertsInsertResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SslCertsListResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SslCertsListResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_TruncateLogContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_TruncateLogContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlActiveDirectoryConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlActiveDirectoryConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlServerAuditConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlServerAuditConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlServerEntraIdConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlServerEntraIdConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ConnectionPoolFlags_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ConnectionPoolFlags_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_TargetMetric_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_TargetMetric_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ConnectionPoolConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ConnectionPoolConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_AcquireSsrsLeaseContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_AcquireSsrsLeaseContext_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" + + "2google/cloud/sql/v1beta4/cloud_sql_res" + + "ources.proto\022\030google.cloud.sql.v1beta4\032\037" + + "google/api/field_behavior.proto\032\033google/" + + "api/field_info.proto\032\031google/api/resourc" + + "e.proto\032\036google/protobuf/duration.proto\032" + + "\037google/protobuf/timestamp.proto\032\036google" + + "/protobuf/wrappers.proto\032\032google/type/interval.proto\"o\n" + + "\010AclEntry\022\r\n" + + "\005value\030\001 \001(\t\0223\n" + + "\017expiration_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022\021\n" + + "\004name\030\003 \001(\tB\003\340A\001\022\014\n" + + "\004kind\030\004 \001(\t\"\237\002\n\n" + + "ApiWarning\022D\n" + + "\004code\030\001 \001(\01626.goo" + + "gle.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode\022\017\n" + + "\007message\030\002 \001(\t\022\016\n" + + "\006region\030\003 \001(\t\"\251\001\n" + + "\021SqlApiWarningCode\022$\n" + + " SQL_API_WARNING_CODE_UNSPECIFIED\020\000\022\026\n" + + "\022REGION_UNREACHABLE\020\001\022\035\n" + + "\031MAX_RESULTS_EXCEEDS_LIMIT\020\002\022\033\n" + + "\027COMPROMISED_CREDENTIALS\020\003\022\032\n" + + "\026INTERNAL_STATE_FAILURE\020\004\"\345\001\n" + + "\027BackupRetentionSettings\022W\n" + + "\016retention_unit\030\001 \001(\0162?.google.clo" + + "ud.sql.v1beta4.BackupRetentionSettings.RetentionUnit\0225\n" + + "\020retained_backups\030\002 \001(\0132\033.google.protobuf.Int32Value\":\n\r" + + "RetentionUnit\022\036\n" + + "\032RETENTION_UNIT_UNSPECIFIED\020\000\022\t\n" + + "\005COUNT\020\001\"\347\007\n" + + "\023BackupConfiguration\022\022\n\n" + + "start_time\030\001 \001(\t\022+\n" + + "\007enabled\030\002 \001(\0132\032.google.protobuf.BoolValue\022\014\n" + + "\004kind\030\003 \001(\t\0226\n" + + "\022binary_log_enabled\030\004 \001(\0132\032.google.protobuf.BoolValue\022E\n" + + "!replication_log_archiving_enabled\030\005" + + " \001(\0132\032.google.protobuf.BoolValue\022\020\n" + + "\010location\030\006 \001(\t\022B\n" + + "\036point_in_time_recovery_enabled\030\007" + + " \001(\0132\032.google.protobuf.BoolValue\022C\n" + + "\036transaction_log_retention_days\030\t" + + " \001(\0132\033.google.protobuf.Int32Value\022T\n" + + "\031backup_retention_settings\030\n" + + " \001(\01321.google.cloud.sql.v1beta4.BackupRetentionSettings\022}\n" + + "\037transactional_log_storage_state\030\013 \001(\0162" + + "J.google.cloud.sql.v1beta4.BackupConfigu" + + "ration.TransactionalLogStorageStateB\003\340A\003H\000\210\001\001\022W\n" + + "\013backup_tier\030\014 \001(\01628.google.clou" + + "d.sql.v1beta4.BackupConfiguration.BackupTierB\003\340A\003H\001\210\001\001\"\253\001\n" + + "\034TransactionalLogStorageState\022/\n" + + "+TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED\020\000\022\010\n" + + "\004DISK\020\001\022\036\n" + + "\032SWITCHING_TO_CLOUD_STORAGE\020\002\022\035\n" + + "\031SWITCHED_TO_CLOUD_STORAGE\020\003\022\021\n\r" + + "CLOUD_STORAGE\020\004\"W\n\n" + + "BackupTier\022\033\n" + + "\027BACKUP_TIER_UNSPECIFIED\020\000\022\014\n" + + "\010STANDARD\020\001\022\020\n" + + "\010ADVANCED\020\002\032\002\010\001\022\014\n" + + "\010ENHANCED\020\003B\"\n" + + " _transactional_log_storage_stateB\016\n" + + "\014_backup_tier\"\367\006\n" + + "\tBackupRun\022\014\n" + + "\004kind\030\001 \001(\t\022<\n" + + "\006status\030\002 \001(\0162,.google.cloud.sql.v1beta4.SqlBackupRunStatus\0221\n\r" + + "enqueued_time\030\003 \001(\0132\032.google.protobuf.Timestamp\022\n\n" + + "\002id\030\004 \001(\003\022.\n\n" + + "start_time\030\005 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\006 \001(\0132\032.google.protobuf.Timestamp\0227\n" + + "\005error\030\007 \001(\0132(.google.cloud.sql.v1beta4.OperationError\0228\n" + + "\004type\030\010 \001(\0162*.google.cloud.sql.v1beta4.SqlBackupRunType\022\023\n" + + "\013description\030\t \001(\t\0225\n" + + "\021window_start_time\030\n" + + " \001(\0132\032.google.protobuf.Timestamp\022\020\n" + + "\010instance\030\013 \001(\t\022\021\n" + + "\tself_link\030\014 \001(\t\022\020\n" + + "\010location\030\r" + + " \001(\t\022K\n" + + "\020database_version\030\017" + + " \001(\0162,.google.cloud.sql.v1beta4.SqlDatabaseVersionB\003\340A\003\022\\\n" + + "\035disk_encryption_configuration\030\020" + + " \001(\01325.google.cloud.sql.v1beta4.DiskEncryptionConfiguration\022N\n" + + "\026disk_encryption_status\030\021" + + " \001(\0132..google.cloud.sql.v1beta4.DiskEncryptionStatus\022<\n" + + "\013backup_kind\030\023 \001(\0162\'.google.cloud.sql.v1beta4.SqlBackupKind\022\021\n" + + "\ttime_zone\030\027 \001(\t\022&\n" + + "\024max_chargeable_bytes\030\030 \001(\003B\003\340A\003H\000\210\001\001B\027\n" + + "\025_max_chargeable_bytes\"\301\n\n" + + "\006Backup\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\003\022\021\n" + + "\004kind\030\002 \001(\tB\003\340A\003\022\026\n" + + "\tself_link\030\003 \001(\tB\003\340A\003\022A\n" + + "\004type\030\004 \001(\0162..google.clou" + + "d.sql.v1beta4.Backup.SqlBackupTypeB\003\340A\003\022\023\n" + + "\013description\030\005 \001(\t\022\020\n" + + "\010instance\030\006 \001(\t\022\020\n" + + "\010location\030\007 \001(\t\0223\n" + + "\017backup_interval\030\010 \001(\0132\025.google.type.IntervalB\003\340A\003\022C\n" + + "\005state\030\t" + + " \001(\0162/.google.cloud.sql.v1beta4.Backup.SqlBackupStateB\003\340A\003\022<\n" + + "\005error\030\n" + + " \001(\0132(.google.cloud.sql.v1beta4.OperationErrorB\003\340A\003\022\024\n" + + "\007kms_key\030\013 \001(\tB\003\340A\003\022\034\n" + + "\017kms_key_version\030\014 \001(\tB\003\340A\003\022A\n" + + "\013backup_kind\030\r" + + " \001(\0162\'.google.cloud.sql.v1beta4.SqlBackupKindB\003\340A\003\022\026\n" + + "\ttime_zone\030\017 \001(\tB\003\340A\003\022\027\n" + + "\010ttl_days\030\020 \001(\003B\003\340A\004H\000\0221\n" + + "\013expiry_time\030\021 \001(\0132\032.google.protobuf.TimestampH\000\022K\n" + + "\020database_version\030\024" + + " \001(\0162,.google.cloud.sql.v1beta4.SqlDatabaseVersionB\003\340A\003\022&\n" + + "\024max_chargeable_bytes\030\027 \001(\003B\003\340A\003H\001\210\001\001\022B\n" + + "\026instance_deletion_time\030\030" + + " \001(\0132\032.google.protobuf.TimestampB\006\340A\001\340A\003\022M\n" + + "\021instance_settings\030\031 \001(\0132*.google" + + ".cloud.sql.v1beta4.DatabaseInstanceB\006\340A\001\340A\003\022\027\n\n" + + "backup_run\030\032 \001(\tB\003\340A\003\0226\n\r" + + "satisfies_pzs\030\033 \001(\0132\032.google.protobuf.BoolValueB\003\340A\003\0226\n\r" + + "satisfies_pzi\030\034 \001(\0132\032.google.protobuf.BoolValueB\003\340A\003\"Y\n\r" + + "SqlBackupType\022\037\n" + + "\033SQL_BACKUP_TYPE_UNSPECIFIED\020\000\022\r\n" + + "\tAUTOMATED\020\001\022\r\n" + + "\tON_DEMAND\020\002\022\t\n" + + "\005FINAL\020\003\"\214\001\n" + + "\016SqlBackupState\022 \n" + + "\034SQL_BACKUP_STATE_UNSPECIFIED\020\000\022\014\n" + + "\010ENQUEUED\020\001\022\013\n" + + "\007RUNNING\020\002\022\n\n" + + "\006FAILED\020\003\022\016\n\n" + + "SUCCESSFUL\020\004\022\014\n" + + "\010DELETING\020\005\022\023\n" + + "\017DELETION_FAILED\020\006:H\352AE\n" + + "\036sqladmin.googleapis.com/Backup\022#projects/{project}/backups/{backup}B\014\n\n" + + "expirationB\027\n" + + "\025_max_chargeable_bytes\"s\n" + + "\026BackupRunsListResponse\022\014\n" + + "\004kind\030\001 \001(\t\0222\n" + + "\005items\030\002 \003(\0132#.google.cloud.sql.v1beta4.BackupRun\022\027\n" + + "\017next_page_token\030\003 \001(\t\"V\n" + + "\021BinLogCoordinates\022\031\n" + + "\021bin_log_file_name\030\001 \001(\t\022\030\n" + + "\020bin_log_position\030\002 \001(\003\022\014\n" + + "\004kind\030\003 \001(\t\">\n\r" + + "BackupContext\022\021\n" + + "\tbackup_id\030\001 \001(\003\022\014\n" + + "\004kind\030\002 \001(\t\022\014\n" + + "\004name\030\003 \001(\t\"\224\005\n" + + "\014CloneContext\022\014\n" + + "\004kind\030\001 \001(\t\022\031\n" + + "\021pitr_timestamp_ms\030\002 \001(\003\022!\n" + + "\031destination_instance_name\030\003 \001(\t\022H\n" + + "\023bin_log_coordinates\030\004 \001(\0132+" + + ".google.cloud.sql.v1beta4.BinLogCoordinates\0221\n\r" + + "point_in_time\030\005 \001(\0132\032.google.protobuf.Timestamp\022\032\n" + + "\022allocated_ip_range\030\006 \001(\t\022\026\n" + + "\016database_names\030\t \003(\t\022 \n" + + "\016preferred_zone\030\n" + + " \001(\tB\003\340A\001H\000\210\001\001\022*\n" + + "\030preferred_secondary_zone\030\013 \001(\tB\003\340A\001H\001\210\001\001\022F\n" + + "\035source_instance_deletion_time\030\014" + + " \001(\0132\032.google.protobuf.TimestampH\002\210\001\001\022%\n" + + "\023destination_project\030\r" + + " \001(\tB\003\340A\001H\003\210\001\001\022H\n" + + "\023destination_network\030\016 \001(\tB&\340A\001\372A \n" + + "\036compute.googleapis.com/NetworkH\004\210\001\001B\021\n" + + "\017_preferred_zoneB\033\n" + + "\031_preferred_secondary_zoneB \n" + + "\036_source_instance_deletion_timeB\026\n" + + "\024_destination_projectB\026\n" + + "\024_destination_network\"\374\001\n" + + "\010Database\022\014\n" + + "\004kind\030\001 \001(\t\022\017\n" + + "\007charset\030\002 \001(\t\022\021\n" + + "\tcollation\030\003 \001(\t\022\014\n" + + "\004etag\030\004 \001(\t\022\014\n" + + "\004name\030\005 \001(\t\022\020\n" + + "\010instance\030\006 \001(\t\022\021\n" + + "\tself_link\030\007 \001(\t\022\017\n" + + "\007project\030\010 \001(\t\022X\n" + + "\032sqlserver_database_details\030\t \001(\013" + + "22.google.cloud.sql.v1beta4.SqlServerDatabaseDetailsH\000B\022\n" + + "\020database_details\"O\n" + + "\030SqlServerDatabaseDetails\022\033\n" + + "\023compatibility_level\030\001 \001(\005\022\026\n" + + "\016recovery_model\030\002 \001(\t\",\n\r" + + "DatabaseFlags\022\014\n" + + "\004name\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t\"(\n" + + "\tSyncFlags\022\014\n" + + "\004name\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t\"B\n" + + "\021InstanceReference\022\014\n" + + "\004name\030\001 \001(\t\022\016\n" + + "\006region\030\002 \001(\t\022\017\n" + + "\007project\030\003 \001(\t\"\237$\n" + + "\020DatabaseInstance\022\014\n" + + "\004kind\030\001 \001(\t\022J\n" + + "\005state\030\002 \001(" + + "\0162;.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState\022F\n" + + "\020database_version\030\003" + + " \001(\0162,.google.cloud.sql.v1beta4.SqlDatabaseVersion\0224\n" + + "\010settings\030\004 \001(\0132\".google.cloud.sql.v1beta4.Settings\022\014\n" + + "\004etag\030\005 \001(\t\022W\n" + + "\020failover_replica\030\006 \001(\0132=.google.cl" + + "oud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica\022\034\n" + + "\024master_instance_name\030\007 \001(\t\022\025\n\r" + + "replica_names\030\010 \003(\t\0226\n\r" + + "max_disk_size\030\t \001(\0132\033.google.protobuf.Int64ValueB\002\030\001\022:\n" + + "\021current_disk_size\030\n" + + " \001(\0132\033.google.protobuf.Int64ValueB\002\030\001\0229\n" + + "\014ip_addresses\030\013 \003(\0132#.google.cloud.sql.v1beta4.IpMapping\0229\n" + + "\016server_ca_cert\030\014 \001(\0132!.google.cloud.sql.v1beta4.SslCert\022@\n\r" + + "instance_type\030\r" + + " \001(\0162).google.cloud.sql.v1beta4.SqlInstanceType\022\017\n" + + "\007project\030\016 \001(\t\022\030\n" + + "\014ipv6_address\030\017 \001(\tB\002\030\001\022%\n" + + "\035service_account_email_address\030\020 \001(\t\022T\n" + + "\031on_premises_configuration\030\021 \001(" + + "\01321.google.cloud.sql.v1beta4.OnPremisesConfiguration\022M\n" + + "\025replica_configuration\030\022 " + + "\001(\0132..google.cloud.sql.v1beta4.ReplicaConfiguration\022>\n" + + "\014backend_type\030\023 \001(\0162(.google.cloud.sql.v1beta4.SqlBackendType\022\021\n" + + "\tself_link\030\024 \001(\t\022H\n" + + "\021suspension_reason\030\025 \003(" + + "\0162-.google.cloud.sql.v1beta4.SqlSuspensionReason\022\027\n" + + "\017connection_name\030\026 \001(\t\022\014\n" + + "\004name\030\027 \001(\t\022\016\n" + + "\006region\030\030 \001(\t\022\020\n" + + "\010gce_zone\030\031 \001(\t\022\032\n" + + "\022secondary_gce_zone\030\" \001(\t\022\\\n" + + "\035disk_encryption_configuration\030\032 \001(\01325.google.cl" + + "oud.sql.v1beta4.DiskEncryptionConfiguration\022N\n" + + "\026disk_encryption_status\030\033 \001(\0132..go" + + "ogle.cloud.sql.v1beta4.DiskEncryptionStatus\022\025\n\r" + + "root_password\030\035 \001(\t\022a\n" + + "\025scheduled_maintenance\030\036 \001(\0132B.google.cloud.sql.v1b" + + "eta4.DatabaseInstance.SqlScheduledMaintenance\0221\n\r" + + "satisfies_pzs\030# \001(\0132\032.google.protobuf.BoolValue\022\'\n" + + "\032database_installed_version\030( \001(\tB\003\340A\003\022^\n" + + "\022out_of_disk_report\030&" + + " \001(\0132=.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReportH\000\210\001\001\0224\n" + + "\013create_time\030\' \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022+\n" + + "\036available_maintenance_versions\030) \003(\tB\003\340A\003\022\033\n" + + "\023maintenance_version\030* \001(\t\022]\n" + + "\034upgradable_database_versions\030- \003(\0132" + + "2.google.cloud.sql.v1beta4.AvailableDatabaseVersionB\003\340A\003\022h\n" + + "\030sql_network_architecture\030/ \001(\0162A.google.cloud.sql.v1beta4.Da" + + "tabaseInstance.SqlNetworkArchitectureH\001\210\001\001\022-\n" + + "\033psc_service_attachment_link\0300 \001(\tB\003\340A\003H\002\210\001\001\022\032\n" + + "\010dns_name\0301 \001(\tB\003\340A\003H\003\210\001\001\022$\n" + + "\020primary_dns_name\0303 \001(\tB\005\030\001\340A\003H\004\210\001\001\022 \n" + + "\016write_endpoint\0304 \001(\tB\003\340A\003H\005\210\001\001\022N\n" + + "\023replication_cluster\0306" + + " \001(\0132,.google.cloud.sql.v1beta4.ReplicationClusterH\006\210\001\001\022J\n\r" + + "gemini_config\0307" + + " \001(\0132..google.cloud.sql.v1beta4.GeminiInstanceConfigH\007\210\001\001\0226\n\r" + + "satisfies_pzi\0308 \001(\0132\032.google.protobuf.BoolValueB\003\340A\003\022^\n" + + "0switch_transaction_logs_to_cloud_storage_enabled\0309" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\004H\010\210\001\001\022X\n" + + "*include_replicas_for_major_version_upgrade\030;" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\004H\t\210\001\001\022M\n" + + "\004tags\030< \003(\01324.google.cloud.sql.v1beta4.DatabaseInstance.TagsEntryB" + + "\t\340A\004\340A\005\340A\001\022\027\n\n" + + "node_count\030? \001(\005H\n" + + "\210\001\001\022M\n" + + "\005nodes\030@ \003(\01329.google.clou" + + "d.sql.v1beta4.DatabaseInstance.PoolNodeConfigB\003\340A\003\022@\n" + + "\tdns_names\030C" + + " \003(\0132(.google.cloud.sql.v1beta4.DnsNameMappingB\003\340A\003\032Q\n" + + "\022SqlFailoverReplica\022\014\n" + + "\004name\030\001 \001(\t\022-\n" + + "\tavailable\030\002 \001(\0132\032.google.protobuf.BoolValue\032\324\001\n" + + "\027SqlScheduledMaintenance\022.\n\n" + + "start_time\030\001 \001(\0132\032.google.protobuf.Timestamp\022\025\n" + + "\tcan_defer\030\002 \001(\010B\002\030\001\022\026\n" + + "\016can_reschedule\030\003 \001(\010\022?\n" + + "\026schedule_deadline_time\030\004" + + " \001(\0132\032.google.protobuf.TimestampH\000\210\001\001B\031\n" + + "\027_schedule_deadline_time\032\332\002\n" + + "\022SqlOutOfDiskReport\022s\n" + + "\025sql_out_of_disk_state\030\001 \001(\0162O.google.cl" + + "oud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskStateH\000\210\001\001\0221\n" + + "$sql_min_recommended_increase_size_gb\030\002 \001(\005H\001\210\001\001\"Y\n" + + "\021SqlOutOfDiskState\022%\n" + + "!SQL_OUT_OF_DISK_STATE_UNSPECIFIED\020\000\022\n\n" + + "\006NORMAL\020\001\022\021\n" + + "\r" + + "SOFT_SHUTDOWN\020\002B\030\n" + + "\026_sql_out_of_disk_stateB\'\n" + + "%_sql_min_recommended_increase_size_gb\032\212\004\n" + + "\016PoolNodeConfig\022\026\n" + + "\004name\030\001 \001(\tB\003\340A\003H\000\210\001\001\022\032\n" + + "\010gce_zone\030\002 \001(\tB\003\340A\003H\001\210\001\001\022>\n" + + "\014ip_addresses\030\003" + + " \003(\0132#.google.cloud.sql.v1beta4.IpMappingB\003\340A\003\022\032\n" + + "\010dns_name\030\004 \001(\tB\003\340A\003H\002\210\001\001\022T\n" + + "\005state\030\005 \001(\0162;.google.cloud.sql" + + ".v1beta4.DatabaseInstance.SqlInstanceStateB\003\340A\003H\003\210\001\001\022@\n" + + "\tdns_names\030\006 \003(\0132(.google" + + ".cloud.sql.v1beta4.DnsNameMappingB\003\340A\003\022-\n" + + "\033psc_service_attachment_link\030\007 \001(\tB\003\340A\003H\004\210\001\001\022T\n" + + "\024psc_auto_connections\030\010 \003(\01321.go" + + "ogle.cloud.sql.v1beta4.PscAutoConnectionConfigB\003\340A\003B\007\n" + + "\005_nameB\013\n" + + "\t_gce_zoneB\013\n" + + "\t_dns_nameB\010\n" + + "\006_stateB\036\n" + + "\034_psc_service_attachment_link\032+\n" + + "\tTagsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"\303\001\n" + + "\020SqlInstanceState\022\"\n" + + "\036SQL_INSTANCE_STATE_UNSPECIFIED\020\000\022\014\n" + + "\010RUNNABLE\020\001\022\r\n" + + "\tSUSPENDED\020\002\022\022\n" + + "\016PENDING_DELETE\020\003\022\022\n" + + "\016PENDING_CREATE\020\004\022\017\n" + + "\013MAINTENANCE\020\005\022\n\n" + + "\006FAILED\020\006\022\032\n" + + "\022ONLINE_MAINTENANCE\020\007\032\002\010\001\022\r\n" + + "\tREPAIRING\020\010\"~\n" + + "\026SqlNetworkArchitecture\022(\n" + + "$SQL_NETWORK_ARCHITECTURE_UNSPECIFIED\020\000\022\034\n" + + "\030NEW_NETWORK_ARCHITECTURE\020\001\022\034\n" + + "\030OLD_NETWORK_ARCHITECTURE\020\002B\025\n" + + "\023_out_of_disk_reportB\033\n" + + "\031_sql_network_architectureB\036\n" + + "\034_psc_service_attachment_linkB\013\n" + + "\t_dns_nameB\023\n" + + "\021_primary_dns_nameB\021\n" + + "\017_write_endpointB\026\n" + + "\024_replication_clusterB\020\n" + + "\016_gemini_configB3\n" + + "1_switch_transaction_logs_to_cloud_storage_enabledB-\n" + + "+_include_replicas_for_major_version_upgradeB\r\n" + + "\013_node_count\"\256\004\n" + + "\016DnsNameMapping\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\003\022U\n" + + "\017connection_type\030\002 \001(\01627.google.cloud.sql.v1be" + + "ta4.DnsNameMapping.ConnectionTypeB\003\340A\003\022I\n" + + "\tdns_scope\030\003" + + " \001(\01621.google.cloud.sql.v1beta4.DnsNameMapping.DnsScopeB\003\340A\003\022S\n" + + "\016record_manager\030\004 \001(\01626.google.cloud.sql.v1b" + + "eta4.DnsNameMapping.RecordManagerB\003\340A\003\"w\n" + + "\016ConnectionType\022\037\n" + + "\033CONNECTION_TYPE_UNSPECIFIED\020\000\022\n\n" + + "\006PUBLIC\020\001\022\033\n" + + "\027PRIVATE_SERVICES_ACCESS\020\002\022\033\n" + + "\027PRIVATE_SERVICE_CONNECT\020\003\"@\n" + + "\010DnsScope\022\031\n" + + "\025DNS_SCOPE_UNSPECIFIED\020\000\022\014\n" + + "\010INSTANCE\020\001\022\013\n" + + "\007CLUSTER\020\002\"W\n\r" + + "RecordManager\022\036\n" + + "\032RECORD_MANAGER_UNSPECIFIED\020\000\022\014\n" + + "\010CUSTOMER\020\001\022\030\n" + + "\024CLOUD_SQL_AUTOMATION\020\002\"\246\003\n" + + "\024GeminiInstanceConfig\022\032\n" + + "\010entitled\030\001 \001(\010B\003\340A\003H\000\210\001\001\022,\n" + + "\032google_vacuum_mgmt_enabled\030\002 \001(\010B\003\340A\003H\001\210\001\001\022,\n" + + "\032oom_session_cancel_enabled\030\003 \001(\010B\003\340A\003H\002\210\001\001\022&\n" + + "\024active_query_enabled\030\004 \001(\010B\003\340A\003H\003\210\001\001\022\'\n" + + "\025index_advisor_enabled\030\005 \001(\010B\003\340A\003H\004\210\001\001\022*\n" + + "\030flag_recommender_enabled\030\006 \001(\010B\003\340A\003H\005\210\001\001B\013\n" + + "\t_entitledB\035\n" + + "\033_google_vacuum_mgmt_enabledB\035\n" + + "\033_oom_session_cancel_enabledB\027\n" + + "\025_active_query_enabledB\030\n" + + "\026_index_advisor_enabledB\033\n" + + "\031_flag_recommender_enabled\"\307\001\n" + + "\022ReplicationCluster\022$\n" + + "\022psa_write_endpoint\030\001 \001(\tB\003\340A\003H\000\210\001\001\022*\n" + + "\030failover_dr_replica_name\030\002 \001(" + + "\tB\003\340A\001H\001\210\001\001\022\034\n\n" + + "dr_replica\030\004 \001(\010B\003\340A\003H\002\210\001\001B\025\n" + + "\023_psa_write_endpointB\033\n" + + "\031_failover_dr_replica_nameB\r\n" + + "\013_dr_replica\"\220\001\n" + + "\030AvailableDatabaseVersion\022\032\n\r" + + "major_version\030\003 \001(\tH\000\210\001\001\022\021\n" + + "\004name\030\010 \001(\tH\001\210\001\001\022\031\n" + + "\014display_name\030\t \001(\tH\002\210\001\001B\020\n" + + "\016_major_versionB\007\n" + + "\005_nameB\017\n\r" + + "_display_name\"X\n" + + "\025DatabasesListResponse\022\014\n" + + "\004kind\030\001 \001(\t\0221\n" + + "\005items\030\002 \003(\0132\".google.cloud.sql.v1beta4.Database\"\217\001\n" + + "\031DemoteMasterConfiguration\022\014\n" + + "\004kind\030\001 \001(\t\022d\n" + + "\033mysql_replica_configuration\030\002 \001(\0132?.google.cloud.sql.v" + + "1beta4.DemoteMasterMySqlReplicaConfiguration\"\362\001\n" + + "\023DemoteMasterContext\022\014\n" + + "\004kind\030\001 \001(\t\022;\n" + + "\027verify_gtid_consistency\030\002 \001(\0132\032.google.protobuf.BoolValue\022\034\n" + + "\024master_instance_name\030\003 \001(\t\022R\n" + + "\025replica_configuration\030\004" + + " \001(\01323.google.cloud.sql.v1beta4.DemoteMasterConfiguration\022\036\n" + + "\026skip_replication_setup\030\005 \001(\010\"\241\001\n" + + "%DemoteMasterMySqlReplicaConfiguration\022\014\n" + + "\004kind\030\001 \001(\t\022\020\n" + + "\010username\030\002 \001(\t\022\020\n" + + "\010password\030\003 \001(\t\022\022\n\n" + + "client_key\030\004 \001(\t\022\032\n" + + "\022client_certificate\030\005 \001(\t\022\026\n" + + "\016ca_certificate\030\006 \001(\t\"O\n\r" + + "DemoteContext\022\014\n" + + "\004kind\030\001 \001(\t\0220\n" + + "#source_representative_instance_name\030\002 \001(\tB\003\340A\002\"\251\016\n\r" + + "ExportContext\022\013\n" + + "\003uri\030\001 \001(\t\022\021\n" + + "\tdatabases\030\002 \003(\t\022\014\n" + + "\004kind\030\003 \001(\t\022T\n" + + "\022sql_export_options\030\004 \001(\01328.google.clou" + + "d.sql.v1beta4.ExportContext.SqlExportOptions\022W\n" + + "\022csv_export_options\030\005 \001(\0132;.googl" + + "e.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions\0228\n" + + "\tfile_type\030\006 \001(\0162%.google.cloud.sql.v1beta4.SqlFileType\022+\n" + + "\007offload\030\010 \001(\0132\032.google.protobuf.BoolValue\022W\n" + + "\022bak_export_options\030\t \001(\0132;.google.cloud." + + "sql.v1beta4.ExportContext.SqlBakExportOptions\022\\\n" + + "\022tde_export_options\030\n" + + " \001(\0132;.goog" + + "le.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptionsB\003\340A\001\032\231\001\n" + + "\023SqlCsvExportOptions\022\024\n" + + "\014select_query\030\001 \001(\t\022\030\n" + + "\020escape_character\030\002 \001(\t\022\027\n" + + "\017quote_character\030\003 \001(\t\022\034\n" + + "\024fields_terminated_by\030\004 \001(\t\022\033\n" + + "\023lines_terminated_by\030\006 \001(\t\032\337\004\n" + + "\020SqlExportOptions\022\016\n" + + "\006tables\030\001 \003(\t\022/\n" + + "\013schema_only\030\002 \001(\0132\032.google.protobuf.BoolValue\022i\n" + + "\024mysql_export_options\030\003 \001(\0132K.google.cloud.sql.v1beta4.E" + + "xportContext.SqlExportOptions.MysqlExportOptions\0221\n" + + "\007threads\030\004 \001(\0132\033.google.protobuf.Int32ValueB\003\340A\001\0221\n" + + "\010parallel\030\005 \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\022t\n" + + "\027postgres_export_options\030\006 \001(\0132N.google.cloud.s" + + "ql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptionsB\003\340A\001\032F\n" + + "\022MysqlExportOptions\0220\n" + + "\013master_data\030\001 \001(\0132\033.google.protobuf.Int32Value\032{\n" + + "\025PostgresExportOptions\022.\n" + + "\005clean\030\001 \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\0222\n" + + "\tif_exists\030\002" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\032\222\003\n" + + "\023SqlBakExportOptions\022+\n" + + "\007striped\030\001 \001(\0132\032.google.protobuf.BoolValue\0221\n" + + "\014stripe_count\030\002 \001(\0132\033.google.protobuf.Int32Value\0223\n" + + "\010bak_type\030\004 \001(\0162!.google.cloud.sql.v1beta4.BakType\0221\n" + + "\tcopy_only\030\005 \001(\0132\032.google.protobuf.BoolValueB\002\030\001\0225\n" + + "\021differential_base\030\006 \001(\0132\032.google.protobuf.BoolValue\022>\n" + + "\025export_log_start_time\030\007" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\001\022<\n" + + "\023export_log_end_time\030\010" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\001\032\211\001\n" + + "\023SqlTdeExportOptions\022\035\n" + + "\020certificate_path\030\001 \001(\tB\003\340A\002\022\035\n" + + "\020private_key_path\030\002 \001(\tB\003\340A\002\022!\n" + + "\024private_key_password\030\003 \001(\tB\003\340A\002\022\021\n" + + "\004name\030\005 \001(\tB\003\340A\002\"9\n" + + "\017FailoverContext\022\030\n" + + "\020settings_version\030\001 \001(\003\022\014\n" + + "\004kind\030\002 \001(\t\"\312\004\n" + + "\004Flag\022\014\n" + + "\004name\030\001 \001(\t\0223\n" + + "\004type\030\002 \001(\0162%.google.cloud.sql.v1beta4.SqlFlagType\022@\n\n" + + "applies_to\030\003 \003(\0162,.google.cloud.sql.v1beta4.SqlDatabaseVersion\022\035\n" + + "\025allowed_string_values\030\004 \003(\t\022.\n" + + "\tmin_value\030\005 \001(\0132\033.google.protobuf.Int64Value\022.\n" + + "\tmax_value\030\006 \001(\0132\033.google.protobuf.Int64Value\0224\n" + + "\020requires_restart\030\007 \001(\0132\032.google.protobuf.BoolValue\022\014\n" + + "\004kind\030\010 \001(\t\022+\n" + + "\007in_beta\030\t \001(\0132\032.google.protobuf.BoolValue\022\032\n" + + "\022allowed_int_values\030\n" + + " \003(\003\022:\n\n" + + "flag_scope\030\017 \001(\0162&.google.cloud.sql.v1beta4.SqlFlagScope\022\"\n" + + "\030recommended_string_value\030\020 \001(\tH\000\022<\n" + + "\025recommended_int_value\030\021" + + " \001(\0132\033.google.protobuf.Int64ValueH\000B\023\n" + + "\021recommended_value\"P\n" + + "\021FlagsListResponse\022\014\n" + + "\004kind\030\001 \001(\t\022-\n" + + "\005items\030\002 \003(\0132\036.google.cloud.sql.v1beta4.Flag\"\266\r\n\r" + + "ImportContext\022\013\n" + + "\003uri\030\001 \001(\t\022\020\n" + + "\010database\030\002 \001(\t\022\014\n" + + "\004kind\030\003 \001(\t\0228\n" + + "\tfile_type\030\004 \001(\0162%.google.cloud.sql.v1beta4.SqlFileType\022W\n" + + "\022csv_import_options\030\005" + + " \001(\0132;.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions\022\023\n" + + "\013import_user\030\006 \001(\t\022W\n" + + "\022bak_import_options\030\007 \001(\0132" + + ";.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions\022Y\n" + + "\022sql_import_options\030\010" + + " \001(\01328.google.cloud.sql.v1beta4.ImportContext.SqlImportOptionsB\003\340A\001\022\\\n" + + "\022tde_import_options\030\t \001(\0132;.google.cloud.sql.v" + + "1beta4.ImportContext.SqlTdeImportOptionsB\003\340A\001\032\353\002\n" + + "\020SqlImportOptions\0221\n" + + "\007threads\030\001 \001(\0132\033.google.protobuf.Int32ValueB\003\340A\001\0221\n" + + "\010parallel\030\002 \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\022t\n" + + "\027postgres_import_options\030\003 \001(\0132N.google.cloud.sql.v1beta4.ImportConte" + + "xt.SqlImportOptions.PostgresImportOptionsB\003\340A\001\032{\n" + + "\025PostgresImportOptions\022.\n" + + "\005clean\030\001 \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\0222\n" + + "\tif_exists\030\002" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\032\243\001\n" + + "\023SqlCsvImportOptions\022\r\n" + + "\005table\030\001 \001(\t\022\017\n" + + "\007columns\030\002 \003(\t\022\030\n" + + "\020escape_character\030\004 \001(\t\022\027\n" + + "\017quote_character\030\005 \001(\t\022\034\n" + + "\024fields_terminated_by\030\006 \001(\t\022\033\n" + + "\023lines_terminated_by\030\010 \001(\t\032\235\004\n" + + "\023SqlBakImportOptions\022i\n" + + "\022encryption_options\030\001 \001(\0132M.google.c" + + "loud.sql.v1beta4.ImportContext.SqlBakImp", + "ortOptions.EncryptionOptions\022+\n" + + "\007striped\030\002 \001(\0132\032.google.protobuf.BoolValue\022/\n" + + "\013no_recovery\030\004 \001(\0132\032.google.protobuf.BoolValue\0221\n\r" + + "recovery_only\030\005 \001(\0132\032.google.protobuf.BoolValue\0223\n" + + "\010bak_type\030\006 \001(\0162!.google.cloud.sql.v1beta4.BakType\0220\n" + + "\007stop_at\030\007 \001(\0132\032.google.protobuf.TimestampB\003\340A\001\022\031\n" + + "\014stop_at_mark\030\010 \001(\tB\003\340A\001\032\207\001\n" + + "\021EncryptionOptions\022\021\n" + + "\tcert_path\030\001 \001(\t\022\020\n" + + "\010pvk_path\030\002 \001(\t\022\024\n" + + "\014pvk_password\030\003 \001(\t\0227\n" + + "\016keep_encrypted\030\005" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\032\211\001\n" + + "\023SqlTdeImportOptions\022\035\n" + + "\020certificate_path\030\001 \001(\tB\003\340A\002\022\035\n" + + "\020private_key_path\030\002 \001(\tB\003\340A\002\022!\n" + + "\024private_key_password\030\003 \001(\tB\003\340A\002\022\021\n" + + "\004name\030\005 \001(\tB\003\340A\002\"V\n" + + "\025InstancesCloneRequest\022=\n\r" + + "clone_context\030\001 \001(\0132&.google.cloud.sql.v1beta4.CloneContext\"l\n" + + "\034InstancesDemoteMasterRequest\022L\n" + + "\025demote_master_context\030\001" + + " \001(\0132-.google.cloud.sql.v1beta4.DemoteMasterContext\"^\n" + + "\026InstancesDemoteRequest\022D\n" + + "\016demote_context\030\001" + + " \001(\0132\'.google.cloud.sql.v1beta4.DemoteContextB\003\340A\002\"Y\n" + + "\026InstancesExportRequest\022?\n" + + "\016export_context\030\001 \001(\0132\'.google.cloud.sql.v1beta4.ExportContext\"_\n" + + "\030InstancesFailoverRequest\022C\n" + + "\020failover_context\030\001 \001(\0132).google.cloud.sql.v1beta4.FailoverContext\"Y\n" + + "\026InstancesImportRequest\022?\n" + + "\016import_context\030\001" + + " \001(\0132\'.google.cloud.sql.v1beta4.ImportContext\"\241\001\n" + + "+InstancesPreCheckMajorVersionUpgradeRequest\022r\n" + + "\'pre_check_major_version_upgrade_context\030\001" + + " \001(\0132<.google.cloud.sql.v1beta4.P" + + "reCheckMajorVersionUpgradeContextB\003\340A\002\"R\n" + + "\017MySqlSyncConfig\022?\n" + + "\022initial_sync_flags\030\001" + + " \003(\0132#.google.cloud.sql.v1beta4.SyncFlags\"\261\001\n" + + "\025InstancesListResponse\022\014\n" + + "\004kind\030\001 \001(\t\0226\n" + + "\010warnings\030\002 \003(\0132$.google.cloud.sql.v1beta4.ApiWarning\0229\n" + + "\005items\030\003 \003(\0132*.google.cloud.sql.v1beta4.DatabaseInstance\022\027\n" + + "\017next_page_token\030\004 \001(\t\"x\n" + + "\036InstancesListServerCasResponse\0220\n" + + "\005certs\030\001 \003(\0132!.google.cloud.sql.v1beta4.SslCert\022\026\n" + + "\016active_version\030\002 \001(\t\022\014\n" + + "\004kind\030\003 \001(\t\"\275\001\n" + + "\'InstancesListServerCertificatesResponse\0223\n" + + "\010ca_certs\030\001 \003(\0132!.google.cloud.sql.v1beta4.SslCert\0227\n" + + "\014server_certs\030\002 \003(\0132!.google.cloud.sql.v1beta4.SslCert\022\026\n" + + "\016active_version\030\003 \001(\t\022\014\n" + + "\004kind\030\004 \001(\t\"\202\001\n" + + "(InstancesListEntraIdCertificatesResponse\0220\n" + + "\005certs\030\001 \003(\0132!.google.cloud.sql.v1beta4.SslCert\022\026\n" + + "\016active_version\030\002 \001(\t\022\014\n" + + "\004kind\030\003 \001(\t\"\361\002\n" + + "\035InstancesRestoreBackupRequest\022N\n" + + "\026restore_backup_context\030\001" + + " \001(\0132..google.cloud.sql.v1beta4.RestoreBackupContext\0223\n" + + "\006backup\030\002 \001(\tB#\372A \n" + + "\036sqladmin.googleapis.com/Backup\022<\n" + + "\017backupdr_backup\030\004 \001(\tB#\372A \n" + + "\036backupdr.googleapis.com/Backup\022R\n" + + "\031restore_instance_settings\030\003" + + " \001(\0132*.google.cloud.sql.v1beta4.DatabaseInstanceB\003\340A\001\0229\n" + + ",restore_instance_clear_overrides_field_names\030\005 \003(\tB\003\340A\001\"s\n" + + "\036InstancesRotateServerCaRequest\022Q\n" + + "\030rotate_server_ca_context\030\001 \001(\0132/.google.c" + + "loud.sql.v1beta4.RotateServerCaContext\"\223\001\n" + + "\'InstancesRotateServerCertificateRequest\022h\n" + + "!rotate_server_certificate_context\030\001" + + " \001(\01328.google.cloud.sql.v1beta4.RotateServerCertificateContextB\003\340A\001\"\227\001\n" + + "(InstancesRotateEntraIdCertificateRequest\022k\n" + + "#rotate_entra_id_certificate_context\030\001 \001(\01329" + + ".google.cloud.sql.v1beta4.RotateEntraIdCertificateContextB\003\340A\001\"i\n" + + "\033InstancesTruncateLogRequest\022J\n" + + "\024truncate_log_context\030\001 " + + "\001(\0132,.google.cloud.sql.v1beta4.TruncateLogContext\"y\n" + + " InstancesAcquireSsrsLeaseRequest\022U\n" + + "\032acquire_ssrs_lease_context\030\001 \001(" + + "\01321.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext\"\320\004\n" + + "\031PointInTimeRestoreContext\022\027\n\n" + + "datasource\030\001 \001(\tH\000\210\001\001\0226\n\r" + + "point_in_time\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340A\002\022\034\n" + + "\017target_instance\030\003 \001(\tH\001\210\001\001\022!\n" + + "\017private_network\030\004 \001(\tB\003\340A\001H\002\210\001\001\022$\n" + + "\022allocated_ip_range\030\005 \001(\tB\003\340A\001H\003\210\001\001\022 \n" + + "\016preferred_zone\030\006 \001(\tB\003\340A\001H\004\210\001\001\022*\n" + + "\030preferred_secondary_zone\030\t \001(\tB\003\340A\001H\005\210\001\001\022Q\n" + + "\030target_instance_settings\030\013" + + " \001(\0132*.google.cloud.sql.v1beta4.DatabaseInstanceB\003\340A\001\0227\n" + + "*target_instance_clear_settings_field_names\030\014 \003(\tB\003\340A\001\022\030\n" + + "\006region\030\r" + + " \001(\tB\003\340A\001H\006\210\001\001B\r\n" + + "\013_datasourceB\022\n" + + "\020_target_instanceB\022\n" + + "\020_private_networkB\025\n" + + "\023_allocated_ip_rangeB\021\n" + + "\017_preferred_zoneB\033\n" + + "\031_preferred_secondary_zoneB\t\n" + + "\007_region\"2\n" + + "\030PerformDiskShrinkContext\022\026\n" + + "\016target_size_gb\030\001 \001(\003\"\201\002\n" + + "\020PreCheckResponse\022\024\n" + + "\007message\030\002 \001(\tH\000\210\001\001\022Q\n" + + "\014message_type\030\003" + + " \001(\01626.google.cloud.sql.v1beta4.PreCheckResponse.MessageTypeH\001\210\001\001\022\030\n" + + "\020actions_required\030\004 \003(\t\"M\n" + + "\013MessageType\022\034\n" + + "\030MESSAGE_TYPE_UNSPECIFIED\020\000\022\010\n" + + "\004INFO\020\001\022\013\n" + + "\007WARNING\020\002\022\t\n" + + "\005ERROR\020\003B\n\n" + + "\010_messageB\017\n\r" + + "_message_type\"\330\001\n" + + "\"PreCheckMajorVersionUpgradeContext\022R\n" + + "\027target_database_version\030\001 \001(\0162,.google" + + ".cloud.sql.v1beta4.SqlDatabaseVersionB\003\340A\002\022K\n" + + "\022pre_check_response\030\002 \003(\0132*.google." + + "cloud.sql.v1beta4.PreCheckResponseB\003\340A\003\022\021\n" + + "\004kind\030\003 \001(\tB\003\340A\001\"h\n" + + "\'SqlInstancesGetDiskShrinkConfigResponse\022\014\n" + + "\004kind\030\001 \001(\t\022\036\n" + + "\026minimal_target_size_gb\030\002 \001(\003\022\017\n" + + "\007message\030\003 \001(\t\"\316\001\n" + + ".SqlInstancesVerifyExternalSyncSettingsResponse\022\014\n" + + "\004kind\030\001 \001(\t\022E\n" + + "\006errors\030\002" + + " \003(\01325.google.cloud.sql.v1beta4.SqlExternalSyncSettingError\022G\n" + + "\010warnings\030\003 \003(\01325" + + ".google.cloud.sql.v1beta4.SqlExternalSyncSettingError\"\344\020\n" + + "\033SqlExternalSyncSettingError\022\014\n" + + "\004kind\030\001 \001(\t\022c\n" + + "\004type\030\002 \001(\0162U.google.cloud.sql.v1beta4.SqlExternalSyncSett" + + "ingError.SqlExternalSyncSettingErrorType\022\016\n" + + "\006detail\030\003 \001(\t\"\301\017\n" + + "\037SqlExternalSyncSettingErrorType\0224\n" + + "0SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED\020\000\022\026\n" + + "\022CONNECTION_FAILURE\020\001\022\026\n" + + "\022BINLOG_NOT_ENABLED\020\002\022!\n" + + "\035INCOMPATIBLE_DATABASE_VERSION\020\003\022\031\n" + + "\025REPLICA_ALREADY_SETUP\020\004\022\032\n" + + "\026INSUFFICIENT_PRIVILEGE\020\005\022\036\n" + + "\032UNSUPPORTED_MIGRATION_TYPE\020\006\022\032\n" + + "\026NO_PGLOGICAL_INSTALLED\020\007\022!\n" + + "\035PGLOGICAL_NODE_ALREADY_EXISTS\020\010\022\025\n" + + "\021INVALID_WAL_LEVEL\020\t\022\"\n" + + "\036INVALID_SHARED_PRELOAD_LIBRARY\020\n" + + "\022&\n" + + "\"INSUFFICIENT_MAX_REPLICATION_SLOTS\020\013\022 \n" + + "\034INSUFFICIENT_MAX_WAL_SENDERS\020\014\022%\n" + + "!INSUFFICIENT_MAX_WORKER_PROCESSES\020\r" + + "\022\032\n" + + "\026UNSUPPORTED_EXTENSIONS\020\016\022#\n" + + "\037INVALID_RDS_LOGICAL_REPLICATION\020\017\022\031\n" + + "\025INVALID_LOGGING_SETUP\020\020\022\024\n" + + "\020INVALID_DB_PARAM\020\021\022\031\n" + + "\025UNSUPPORTED_GTID_MODE\020\022\022\037\n" + + "\033SQLSERVER_AGENT_NOT_RUNNING\020\023\022 \n" + + "\034UNSUPPORTED_TABLE_DEFINITION\020\024\022\027\n" + + "\023UNSUPPORTED_DEFINER\020\025\022!\n" + + "\035SQLSERVER_SERVERNAME_MISMATCH\020\026\022\031\n" + + "\025PRIMARY_ALREADY_SETUP\020\027\022\035\n" + + "\031UNSUPPORTED_BINLOG_FORMAT\020\030\022\034\n" + + "\030BINLOG_RETENTION_SETTING\020\031\022\036\n" + + "\032UNSUPPORTED_STORAGE_ENGINE\020\032\022\032\n" + + "\026LIMITED_SUPPORT_TABLES\020\033\022\034\n" + + "\030EXISTING_DATA_IN_REPLICA\020\034\022\037\n" + + "\033MISSING_OPTIONAL_PRIVILEGES\020\035\022 \n" + + "\034RISKY_BACKUP_ADMIN_PRIVILEGE\020\036\022 \n" + + "\034INSUFFICIENT_GCS_PERMISSIONS\020\037\022\025\n" + + "\021INVALID_FILE_INFO\020 \022!\n" + + "\035UNSUPPORTED_DATABASE_SETTINGS\020!\0220\n" + + ",MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE\020\"\022\024\n" + + "\020LOCAL_INFILE_OFF\020#\022\036\n" + + "\032TURN_ON_PITR_AFTER_PROMOTE\020$\022\'\n" + + "#INCOMPATIBLE_DATABASE_MINOR_VERSION\020%\022\034\n" + + "\030SOURCE_MAX_SUBSCRIPTIONS\020&\022\035\n" + + "\031UNABLE_TO_VERIFY_DEFINERS\020\'\022#\n" + + "\037SUBSCRIPTION_CALCULATION_STATUS\020(\022\031\n" + + "\025PG_SUBSCRIPTION_COUNT\020)\022\032\n" + + "\026PG_SYNC_PARALLEL_LEVEL\020*\022\032\n" + + "\026INSUFFICIENT_DISK_SIZE\020+\022\035\n" + + "\031INSUFFICIENT_MACHINE_TIER\020,\022\'\n" + + "#UNSUPPORTED_EXTENSIONS_NOT_MIGRATED\020-\022\033\n" + + "\027EXTENSIONS_NOT_MIGRATED\020.\022#\n" + + "\037PG_CRON_FLAG_ENABLED_IN_REPLICA\020/\022%\n" + + "!EXTENSIONS_NOT_ENABLED_IN_REPLICA\0200\022\027\n" + + "\023UNSUPPORTED_COLUMNS\0201\022 \n" + + "\034USERS_NOT_CREATED_IN_REPLICA\0202\022\036\n" + + "\032UNSUPPORTED_SYSTEM_OBJECTS\0203\022,\n" + + "(UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY\0204\022(\n" + + "$SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE\0205\0224\n" + + "0PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI\0206\0221\n" + + "-SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS\0207\022\032\n" + + "\026PROMPT_DELETE_EXISTING\0208\022\030\n" + + "\024WILL_DELETE_EXISTING\0209\022-\n" + + ")PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE\020:\"\324\t\n" + + "\017IpConfiguration\0220\n" + + "\014ipv4_enabled\030\001 \001(\0132\032.google.protobuf.BoolValue\022\027\n" + + "\017private_network\030\002 \001(\t\022/\n" + + "\013require_ssl\030\003 \001(\0132\032.google.protobuf.BoolValue\022?\n" + + "\023authorized_networks\030\004" + + " \003(\0132\".google.cloud.sql.v1beta4.AclEntry\022\032\n" + + "\022allocated_ip_range\030\006 \001(\t\022Q\n" + + "-enable_private_path_for_google_cloud_services\030\007" + + " \001(\0132\032.google.protobuf.BoolValue\022C\n" + + "\010ssl_mode\030\010" + + " \001(\01621.google.cloud.sql.v1beta4.IpConfiguration.SslMode\022<\n\n" + + "psc_config\030\t" + + " \001(\0132#.google.cloud.sql.v1beta4.PscConfigH\000\210\001\001\022M\n" + + "\016server_ca_mode\030\n" + + " \001(\01620.google.cloud.sql.v1beta4.IpConfiguration.CaModeH\001\210\001\001\022-\n" + + " custom_subject_alternative_names\030\013 \003(\tB\003\340A\001\022 \n" + + "\016server_ca_pool\030\014 \001(\tB\003\340A\001H\002\210\001\001\022{\n" + + " server_certificate_rotation_mode\030\020 \001(\0162G.google.cloud.sql.v1b" + + "eta4.IpConfiguration.ServerCertificateRotationModeB\003\340A\001H\003\210\001\001\"\205\001\n" + + "\007SslMode\022\030\n" + + "\024SSL_MODE_UNSPECIFIED\020\000\022#\n" + + "\037ALLOW_UNENCRYPTED_AND_ENCRYPTED\020\001\022\022\n" + + "\016ENCRYPTED_ONLY\020\002\022\'\n" + + "#TRUSTED_CLIENT_CERTIFICATE_REQUIRED\020\003\"y\n" + + "\006CaMode\022\027\n" + + "\023CA_MODE_UNSPECIFIED\020\000\022\036\n" + + "\032GOOGLE_MANAGED_INTERNAL_CA\020\001\022\031\n" + + "\025GOOGLE_MANAGED_CAS_CA\020\002\022\033\n" + + "\027CUSTOMER_MANAGED_CAS_CA\020\003\"\227\001\n" + + "\035ServerCertificateRotationMode\0220\n" + + ",SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED\020\000\022\031\n" + + "\025NO_AUTOMATIC_ROTATION\020\001\022)\n" + + "%AUTOMATIC_ROTATION_DURING_MAINTENANCE\020\002B\r\n" + + "\013_psc_configB\021\n" + + "\017_server_ca_modeB\021\n" + + "\017_server_ca_poolB#\n" + + "!_server_certificate_rotation_mode\"\313\003\n" + + "\tPscConfig\022\030\n" + + "\013psc_enabled\030\001 \001(\010H\000\210\001\001\022&\n" + + "\031allowed_consumer_projects\030\002 \003(\tB\003\340A\001\022T\n" + + "\024psc_auto_connections\030\003 \003(\01321.goog" + + "le.cloud.sql.v1beta4.PscAutoConnectionConfigB\003\340A\001\022#\n" + + "\026network_attachment_uri\030\004 \001(\tB\003\340A\001\022&\n" + + "\024psc_auto_dns_enabled\030\005 \001(\010B\003\340A\001H\001\210\001\001\0220\n" + + "\036psc_write_endpoint_dns_enabled\030\006" + + " \001(\010B\003\340A\001H\002\210\001\001\0224\n" + + "\"psc_auto_connection_policy_enabled\030\007" + + " \001(\010B\003\340A\001H\003\210\001\001B\016\n" + + "\014_psc_enabledB\027\n" + + "\025_psc_auto_dns_enabledB!\n" + + "\037_psc_write_endpoint_dns_enabledB%\n" + + "#_psc_auto_connection_policy_enabled\"\304\005\n" + + "\027PscAutoConnectionConfig\022\035\n" + + "\020consumer_project\030\001 \001(\tB\003\340A\001\022\035\n" + + "\020consumer_network\030\002 \001(\tB\003\340A\001\022!\n\n" + + "ip_address\030\003 \001(" + + "\tB\010\342\214\317\327\010\002\010\004H\000\210\001\001\022\023\n" + + "\006status\030\004 \001(\tH\001\210\001\001\022$\n" + + "\027consumer_network_status\030\005 \001(\tH\002\210\001\001\022^\n" + + "\031service_connection_policy\030\006 \001(\tB6\340A\003\372A0\n" + + ".compute.googleapis.com/ServiceConnectionPolicyH\003\210\001\001\022;\n" + + ")service_connection_policy_creation_result\030\007 \001(" + + "\tB\003\340A\003H\004\210\001\001\022S\n" + + "\030instance_auto_dns_status\030\010 \001(\016" + + "2\'.google.cloud.sql.v1beta4.AutoDnsStatusB\003\340A\003H\005\210\001\001\022Y\n" + + "\036write_endpoint_auto_dns_status\030\t" + + " \001(\0162\'.google.cloud.sql.v1beta4.AutoDnsStatusB\003\340A\003H\006\210\001\001B\r\n" + + "\013_ip_addressB\t\n" + + "\007_statusB\032\n" + + "\030_consumer_network_statusB\034\n" + + "\032_service_connection_policyB,\n" + + "*_service_connection_policy_creation_resultB\033\n" + + "\031_instance_auto_dns_statusB!\n" + + "\037_write_endpoint_auto_dns_status\"\215\001\n" + + "\tIpMapping\0228\n" + + "\004type\030\001 \001(\0162*.google.cloud.sql.v1beta4.SqlIpAddressType\022\022\n\n" + + "ip_address\030\002 \001(\t\0222\n" + + "\016time_to_retire\030\003 \001(\0132\032.google.protobuf.Timestamp\"l\n" + + "\022LocationPreference\022\"\n" + + "\026follow_gae_application\030\001 \001(\tB\002\030\001\022\014\n" + + "\004zone\030\002 \001(\t\022\026\n" + + "\016secondary_zone\030\004 \001(\t\022\014\n" + + "\004kind\030\003 \001(\t\"\266\001\n" + + "\021MaintenanceWindow\022)\n" + + "\004hour\030\001 \001(\0132\033.google.protobuf.Int32Value\022(\n" + + "\003day\030\002 \001(\0132\033.google.protobuf.Int32Value\022>\n" + + "\014update_track\030\003 \001(\0162(.google.cloud.sql.v1beta4.SqlUpdateTrack\022\014\n" + + "\004kind\030\004 \001(\t\"K\n" + + "\025DenyMaintenancePeriod\022\022\n\n" + + "start_date\030\001 \001(\t\022\020\n" + + "\010end_date\030\002 \001(\t\022\014\n" + + "\004time\030\003 \001(\t\"\261\002\n" + + "\016InsightsConfig\022\036\n" + + "\026query_insights_enabled\030\001 \001(\010\022\035\n" + + "\025record_client_address\030\002 \001(\010\022\037\n" + + "\027record_application_tags\030\003 \001(\010\0228\n" + + "\023query_string_length\030\004 \001(\0132\033.google.protobuf.Int32Value\022;\n" + + "\026query_plans_per_minute\030\005 \001(\0132\033.google.protobuf.Int32Value\022H\n" + + "\037enhanced_query_insights_enabled\030\010" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\"\373\002\n" + + "\031MySqlReplicaConfiguration\022\026\n" + + "\016dump_file_path\030\001 \001(\t\022\020\n" + + "\010username\030\002 \001(\t\022\020\n" + + "\010password\030\003 \001(\t\022;\n" + + "\026connect_retry_interval\030\004 \001(\0132\033.google.protobuf.Int32Value\022<\n" + + "\027master_heartbeat_period\030\005" + + " \001(\0132\033.google.protobuf.Int64Value\022\026\n" + + "\016ca_certificate\030\006 \001(\t\022\032\n" + + "\022client_certificate\030\007 \001(\t\022\022\n\n" + + "client_key\030\010 \001(\t\022\022\n\n" + + "ssl_cipher\030\t \001(\t\022=\n" + + "\031verify_server_certificate\030\n" + + " \001(\0132\032.google.protobuf.BoolValue\022\014\n" + + "\004kind\030\013 \001(\t\"(\n" + + "\017SelectedObjects\022\025\n" + + "\010database\030\001 \001(\tB\003\340A\002\"\366\003\n" + + "\027OnPremisesConfiguration\022\021\n" + + "\thost_port\030\001 \001(\t\022\014\n" + + "\004kind\030\002 \001(\t\022\020\n" + + "\010username\030\003 \001(\t\022\020\n" + + "\010password\030\004 \001(\t\022\026\n" + + "\016ca_certificate\030\005 \001(\t\022\032\n" + + "\022client_certificate\030\006 \001(\t\022\022\n\n" + + "client_key\030\007 \001(\t\022\026\n" + + "\016dump_file_path\030\010 \001(\t\022D\n" + + "\017source_instance\030\017 \001" + + "(\0132+.google.cloud.sql.v1beta4.InstanceReference\022H\n" + + "\020selected_objects\030\020 \003(\0132).goog" + + "le.cloud.sql.v1beta4.SelectedObjectsB\003\340A\001\022T\n\n" + + "ssl_option\030\022 \001(\0162;.google.cloud.sql" + + ".v1beta4.OnPremisesConfiguration.SslOptionB\003\340A\001\"P\n" + + "\tSslOption\022\032\n" + + "\026SSL_OPTION_UNSPECIFIED\020\000\022\013\n" + + "\007DISABLE\020\001\022\013\n" + + "\007REQUIRE\020\002\022\r\n" + + "\tVERIFY_CA\020\003\"A\n" + + "\033DiskEncryptionConfiguration\022\024\n" + + "\014kms_key_name\030\001 \001(\t\022\014\n" + + "\004kind\030\002 \001(\t\"B\n" + + "\024DiskEncryptionStatus\022\034\n" + + "\024kms_key_version_name\030\001 \001(\t\022\014\n" + + "\004kind\030\002 \001(\t\"x\n" + + "\023SqlSubOperationType\022H\n" + + "\020maintenance_type\030\001 \001(\0162,.goog" + + "le.cloud.sql.v1beta4.SqlMaintenanceTypeH\000B\027\n" + + "\025sub_operation_details\"\331\021\n" + + "\tOperation\022\014\n" + + "\004kind\030\001 \001(\t\022\023\n" + + "\013target_link\030\002 \001(\t\022F\n" + + "\006status\030\003" + + " \001(\01626.google.cloud.sql.v1beta4.Operation.SqlOperationStatus\022\014\n" + + "\004user\030\004 \001(\t\022/\n" + + "\013insert_time\030\005 \001(\0132\032.google.protobuf.Timestamp\022.\n\n" + + "start_time\030\006 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\007 \001(\0132\032.google.protobuf.Timestamp\0228\n" + + "\005error\030\010 \001(\0132).google.cloud.sql.v1beta4.OperationErrors\0229\n" + + "\013api_warning\030\023 \001(\0132$.google.cloud.sql.v1beta4.ApiWarning\022L\n" + + "\016operation_type\030\t" + + " \001(\01624.google.cloud.sql.v1beta4.Operation.SqlOperationType\022?\n" + + "\016import_context\030\n" + + " \001(\0132\'.google.cloud.sql.v1beta4.ImportContext\022?\n" + + "\016export_context\030\013 \001(\0132\'.google.cloud.sql.v1beta4.ExportContext\022?\n" + + "\016backup_context\030\021 \001(\0132\'.google.cloud.sql.v1beta4.BackupContext\022m\n" + + "\'pre_check_major_version_upgrade_context\0302 \001(\0132<.google.cloud.s" + + "ql.v1beta4.PreCheckMajorVersionUpgradeContext\022\014\n" + + "\004name\030\014 \001(\t\022\021\n" + + "\ttarget_id\030\r" + + " \001(\t\022\021\n" + + "\tself_link\030\016 \001(\t\022\026\n" + + "\016target_project\030\017 \001(\t\022U\n" + + "\032acquire_ssrs_lease_context\030\024 \001(\01321." + + "google.cloud.sql.v1beta4.AcquireSsrsLeaseContext\022N\n" + + "\022sub_operation_type\0300 \001(\0132-.g" + + "oogle.cloud.sql.v1beta4.SqlSubOperationTypeB\003\340A\001\"\373\010\n" + + "\020SqlOperationType\022\"\n" + + "\036SQL_OPERATION_TYPE_UNSPECIFIED\020\000\022\n\n" + + "\006IMPORT\020\001\022\n\n" + + "\006EXPORT\020\002\022\n\n" + + "\006CREATE\020\003\022\n\n" + + "\006UPDATE\020\004\022\n\n" + + "\006DELETE\020\005\022\013\n" + + "\007RESTART\020\006\022\016\n" + + "\006BACKUP\020\007\032\002\010\001\022\020\n" + + "\010SNAPSHOT\020\010\032\002\010\001\022\021\n\r" + + "BACKUP_VOLUME\020\t\022\021\n\r" + + "DELETE_VOLUME\020\n" + + "\022\022\n" + + "\016RESTORE_VOLUME\020\013\022\017\n" + + "\013INJECT_USER\020\014\022\t\n" + + "\005CLONE\020\016\022\020\n" + + "\014STOP_REPLICA\020\017\022\021\n\r" + + "START_REPLICA\020\020\022\023\n" + + "\017PROMOTE_REPLICA\020\021\022\022\n" + + "\016CREATE_REPLICA\020\022\022\017\n" + + "\013CREATE_USER\020\023\022\017\n" + + "\013DELETE_USER\020\024\022\017\n" + + "\013UPDATE_USER\020\025\022\023\n" + + "\017CREATE_DATABASE\020\026\022\023\n" + + "\017DELETE_DATABASE\020\027\022\023\n" + + "\017UPDATE_DATABASE\020\030\022\014\n" + + "\010FAILOVER\020\031\022\021\n\r" + + "DELETE_BACKUP\020\032\022\024\n" + + "\020RECREATE_REPLICA\020\033\022\020\n" + + "\014TRUNCATE_LOG\020\034\022\021\n\r" + + "DEMOTE_MASTER\020\035\022\017\n" + + "\013MAINTENANCE\020\036\022\031\n" + + "\021ENABLE_PRIVATE_IP\020\037\032\002\010\001\022\031\n" + + "\021DEFER_MAINTENANCE\020 \032\002\010\001\022\024\n" + + "\014CREATE_CLONE\020!\032\002\010\001\022\032\n" + + "\026RESCHEDULE_MAINTENANCE\020\"\022\027\n" + + "\023START_EXTERNAL_SYNC\020#\022\017\n" + + "\013LOG_CLEANUP\020$\022\020\n" + + "\014AUTO_RESTART\020%\022\r\n" + + "\tREENCRYPT\020&\022\016\n\n" + + "SWITCHOVER\020\'\022\021\n\r" + + "UPDATE_BACKUP\020(\022\026\n" + + "\022ACQUIRE_SSRS_LEASE\020*\022\026\n" + + "\022RELEASE_SSRS_LEASE\020+\022\033\n" + + "\027RECONFIGURE_OLD_PRIMARY\020,\022\033\n" + + "\023CLUSTER_MAINTENANCE\020-\032\002\010\001\022 \n" + + "\030SELF_SERVICE_MAINTENANCE\020.\032\002\010\001\022\031\n" + + "\025SWITCHOVER_TO_REPLICA\020/\022\031\n" + + "\025MAJOR_VERSION_UPGRADE\0200\022\027\n" + + "\017ADVANCED_BACKUP\0201\032\002\010\001\022\021\n\r" + + "MANAGE_BACKUP\0202\022\023\n" + + "\017ENHANCED_BACKUP\0203\022\024\n" + + "\020REPAIR_READ_POOL\0204\022\024\n" + + "\020CREATE_READ_POOL\0205\022#\n" + + "\037PRE_CHECK_MAJOR_VERSION_UPGRADE\0206\022\023\n" + + "\017SETUP_MIGRATION\020:\022\026\n" + + "\022AGENT_SEND_MESSAGE\020;\"^\n" + + "\022SqlOperationStatus\022$\n" + + " SQL_OPERATION_STATUS_UNSPECIFIED\020\000\022\013\n" + + "\007PENDING\020\001\022\013\n" + + "\007RUNNING\020\002\022\010\n" + + "\004DONE\020\003\"=\n" + + "\016OperationError\022\014\n" + + "\004kind\030\001 \001(\t\022\014\n" + + "\004code\030\002 \001(\t\022\017\n" + + "\007message\030\003 \001(\t\"Y\n" + + "\017OperationErrors\022\014\n" + + "\004kind\030\001 \001(\t\0228\n" + + "\006errors\030\002 \003(\0132(.google.cloud.sql.v1beta4.OperationError\"\231\004\n" + + "\030PasswordValidationPolicy\022/\n" + + "\n" + + "min_length\030\001 \001(\0132\033.google.protobuf.Int32Value\022Q\n\n" + + "complexity\030\002 \001(\0162=.google.clou" + + "d.sql.v1beta4.PasswordValidationPolicy.Complexity\0223\n" + + "\016reuse_interval\030\003 \001(\0132\033.google.protobuf.Int32Value\022?\n" + + "\033disallow_username_substring\030\004" + + " \001(\0132\032.google.protobuf.BoolValue\022;\n" + + "\030password_change_interval\030\005 \001(\0132\031.google.protobuf.Duration\022:\n" + + "\026enable_password_policy\030\006 \001(\0132\032.google.protobuf.BoolValue\022H\n" + + " disallow_compromised_credentials\030\007" + + " \001(\0132\032.google.protobuf.BoolValueB\002\030\001\"@\n\n" + + "Complexity\022\032\n" + + "\026COMPLEXITY_UNSPECIFIED\020\000\022\026\n" + + "\022COMPLEXITY_DEFAULT\020\001\"s\n" + + "\026OperationsListResponse\022\014\n" + + "\004kind\030\001 \001(\t\0222\n" + + "\005items\030\002 \003(\0132#.google.cloud.sql.v1beta4.Operation\022\027\n" + + "\017next_page_token\030\003 \001(\t\"\360\001\n" + + "\024ReplicaConfiguration\022\014\n" + + "\004kind\030\001 \001(\t\022X\n" + + "\033mysql_replica_configuration\030\002" + + " \001(\01323.google.cloud.sql.v1beta4.MySqlReplicaConfiguration\0223\n" + + "\017failover_target\030\003 \001(\0132\032.google.protobuf.BoolValue\022;\n" + + "\022cascadable_replica\030\005" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\"a\n" + + "\024RestoreBackupContext\022\014\n" + + "\004kind\030\001 \001(\t\022\025\n\r" + + "backup_run_id\030\002 \001(\003\022\023\n" + + "\013instance_id\030\003 \001(\t\022\017\n" + + "\007project\030\004 \001(\t\";\n" + + "\025RotateServerCaContext\022\014\n" + + "\004kind\030\001 \001(\t\022\024\n" + + "\014next_version\030\002 \001(\t\"N\n" + + "\036RotateServerCertificateContext\022\021\n" + + "\004kind\030\001 \001(\tB\003\340A\001\022\031\n" + + "\014next_version\030\002 \001(\tB\003\340A\001\"O\n" + + "\037RotateEntraIdCertificateContext\022\021\n" + + "\004kind\030\001 \001(\tB\003\340A\001\022\031\n" + + "\014next_version\030\002 \001(\tB\003\340A\001\"-\n" + + "\017DataCacheConfig\022\032\n" + + "\022data_cache_enabled\030\001 \001(\010\"e\n" + + "\021FinalBackupConfig\022\024\n" + + "\007enabled\030\001 \001(\010H\000\210\001\001\022\033\n" + + "\016retention_days\030\003 \001(\005H\001\210\001\001B\n\n" + + "\010_enabledB\021\n" + + "\017_retention_days\"\361\034\n" + + "\010Settings\0225\n" + + "\020settings_version\030\001 \001(\0132\033.google.protobuf.Int64Value\022\'\n" + + "\033authorized_gae_applications\030\002 \003(\tB\002\030\001\022\014\n" + + "\004tier\030\003 \001(\t\022\014\n" + + "\004kind\030\004 \001(\t\022G\n" + + "\013user_labels\030\005" + + " \003(\01322.google.cloud.sql.v1beta4.Settings.UserLabelsEntry\022H\n" + + "\021availability_type\030\006" + + " \001(\0162-.google.cloud.sql.v1beta4.SqlAvailabilityType\022>\n" + + "\014pricing_plan\030\007 \001(\0162(.google.cloud.sql.v1beta4.SqlPricingPlan\022J\n" + + "\020replication_type\030\010 \001(\0162,.goog" + + "le.cloud.sql.v1beta4.SqlReplicationTypeB\002\030\001\022>\n" + + "\031storage_auto_resize_limit\030\t \001(\0132\033.google.protobuf.Int64Value\022Q\n" + + "\021activation_policy\030\n" + + " \001(\01626.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy\022C\n" + + "\020ip_configuration\030\013" + + " \001(\0132).google.cloud.sql.v1beta4.IpConfiguration\0227\n" + + "\023storage_auto_resize\030\014 \001(\0132\032.google.protobuf.BoolValue\022I\n" + + "\023location_preference\030\r" + + " \001(\0132,.google.cloud.sql.v1beta4.LocationPreference\022?\n" + + "\016database_flags\030\016 \003(\0132\'.google.cloud.sql.v1beta4.DatabaseFlags\022A\n" + + "\016data_disk_type\030\017 \001(\0162).google.cloud.sql.v1beta4.SqlDataDiskType\022G\n" + + "\022maintenance_window\030\020" + + " \001(\0132+.google.cloud.sql.v1beta4.MaintenanceWindow\022K\n" + + "\024backup_configuration\030\021" + + " \001(\0132-.google.cloud.sql.v1beta4.BackupConfiguration\022@\n" + + "\034database_replication_enabled\030\022" + + " \001(\0132\032.google.protobuf.BoolValue\022F\n" + + "\036crash_safe_replic", + "ation_enabled\030\023 \001(\0132\032.google.protobuf.BoolValueB\002\030\001\0226\n" + + "\021data_disk_size_gb\030\024 \001(\0132\033.google.protobuf.Int64Value\022S\n" + + "\027active_directory_config\030\026" + + " \001(\01322.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig\022\021\n" + + "\tcollation\030\027 \001(\t\022Q\n" + + "\030deny_maintenance_periods\030\030" + + " \003(\0132/.google.cloud.sql.v1beta4.DenyMaintenancePeriod\022A\n" + + "\017insights_config\030\031 \001(\0132(.google.cloud.sql.v1beta4.InsightsConfig\022V\n" + + "\032password_validation_policy\030\033 \001(\01322." + + "google.cloud.sql.v1beta4.PasswordValidationPolicy\022O\n" + + "\027sql_server_audit_config\030\035 \001" + + "(\0132..google.cloud.sql.v1beta4.SqlServerAuditConfig\022@\n" + + "\007edition\030&" + + " \001(\0162*.google.cloud.sql.v1beta4.Settings.EditionB\003\340A\001\022V\n" + + "\025connector_enforcement\030 \001(\01627.google.clo" + + "ud.sql.v1beta4.Settings.ConnectorEnforcement\022?\n" + + "\033deletion_protection_enabled\030!" + + " \001(\0132\032.google.protobuf.BoolValue\022\021\n" + + "\ttime_zone\030\" \001(\t\022T\n" + + "\031advanced_machine_features\030# " + + "\001(\01321.google.cloud.sql.v1beta4.AdvancedMachineFeatures\022D\n" + + "\021data_cache_config\030% \001(\0132).google.cloud.sql.v1beta4.DataCacheConfig\022E\n" + + "\033replication_lag_max_seconds\030\'" + + " \001(\0132\033.google.protobuf.Int32ValueB\003\340A\001\022E\n" + + "\034enable_google_ml_integration\030(" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\022D\n" + + "\033enable_dataplex_integration\030)" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\022A\n" + + "\030retain_backups_on_delete\030*" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\022,\n" + + "\032data_disk_provisioned_iops\030+ \001(\003B\003\340A\001H\000\210\001\001\0222\n" + + " data_disk_provisioned_throughput\030, \001(\003B\003\340A\001H\001\210\001\001\022X\n" + + "\026connection_pool_config\030-" + + " \001(\0132..google.cloud.sql.v1beta4.ConnectionPoolConfigB\003\340A\001H\002\210\001\001\022R\n" + + "\023final_backup_config\030/" + + " \001(\0132+.google.cloud.sql.v1beta4.FinalBackupConfigB\003\340A\001H\003\210\001\001\022`\n" + + "\033read_pool_auto_scale_config\0300 \001(\01321.googl" + + "e.cloud.sql.v1beta4.ReadPoolAutoScaleConfigB\003\340A\001H\004\210\001\001\022A\n" + + "\030accelerated_replica_mode\0301" + + " \001(\0132\032.google.protobuf.BoolValueB\003\340A\001\022&\n" + + "\024auto_upgrade_enabled\0302 \001(\010B\003\340A\001H\005\210\001\001\022M\n" + + "\016entraid_config\0304 \001(\01320.google.cloud." + + "sql.v1beta4.SqlServerEntraIdConfigB\003\340A\001\022N\n" + + "\017data_api_access\0305 \001(\01620.google.cloud." + + "sql.v1beta4.Settings.DataApiAccessH\006\210\001\001\022[\n" + + "\032performance_capture_config\0306 \001(\01322.go" + + "ogle.cloud.sql.v1beta4.PerformanceCaptureConfigB\003\340A\001\0321\n" + + "\017UserLabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"f\n" + + "\023SqlActivationPolicy\022%\n" + + "!SQL_ACTIVATION_POLICY_UNSPECIFIED\020\000\022\n\n" + + "\006ALWAYS\020\001\022\t\n" + + "\005NEVER\020\002\022\021\n" + + "\tON_DEMAND\020\003\032\002\010\001\"V\n" + + "\007Edition\022\027\n" + + "\023EDITION_UNSPECIFIED\020\000\022\016\n\n" + + "ENTERPRISE\020\002\022\023\n" + + "\017ENTERPRISE_PLUS\020\003\022\r\n" + + "\tDEVELOPER\020\005\"]\n" + + "\024ConnectorEnforcement\022%\n" + + "!CONNECTOR_ENFORCEMENT_UNSPECIFIED\020\000\022\020\n" + + "\014NOT_REQUIRED\020\001\022\014\n" + + "\010REQUIRED\020\002\"[\n\r" + + "DataApiAccess\022\037\n" + + "\033DATA_API_ACCESS_UNSPECIFIED\020\000\022\025\n" + + "\021DISALLOW_DATA_API\020\001\022\022\n" + + "\016ALLOW_DATA_API\020\002B\035\n" + + "\033_data_disk_provisioned_iopsB#\n" + + "!_data_disk_provisioned_throughputB\031\n" + + "\027_connection_pool_configB\026\n" + + "\024_final_backup_configB\036\n" + + "\034_read_pool_auto_scale_configB\027\n" + + "\025_auto_upgrade_enabledB\022\n" + + "\020_data_api_access\"\212\n\n" + + "\030PerformanceCaptureConfig\022\031\n" + + "\007enabled\030\001 \001(\010B\003\340A\001H\000\210\001\001\022*\n" + + "\030probing_interval_seconds\030\002 \001(\005B\003\340A\001H\001\210\001\001\022!\n" + + "\017probe_threshold\030\003 \001(\005B\003\340A\001H\002\210\001\001\022+\n" + + "\031running_threads_threshold\030\004 \001(\005B\003\340A\001H\003\210\001\001\0221\n" + + "\037seconds_behind_source_threshold\030\005" + + " \001(\005B\003\340A\001H\004\210\001\001\0220\n" + + "\036transaction_duration_threshold\030\010" + + " \001(\005B\003\340A\001H\005\210\001\001\0223\n" + + "!cpu_utilization_threshold_percent\030\t" + + " \001(\005B\003\340A\001H\006\210\001\001\0220\n" + + "\036memory_usage_threshold_percent\030\n" + + " \001(\005B\003\340A\001H\007\210\001\001\0227\n" + + "%transaction_lock_wait_threshold_count\030\013" + + " \001(\005B\003\340A\001H\010\210\001\001\0220\n" + + "\036semaphore_wait_threshold_count\030\014 \001(\005B\003\340A\001H" + + "\t\210\001\001\0225\n" + + "#history_list_length_threshold_count\030\r" + + " \001(\005B\003\340A\001H\n" + + "\210\001\001\0224\n" + + "\"transaction_kill_threshold_seconds\030\016" + + " \001(\005B\003\340A\001H\013\210\001\001\0221\n" + + "$transaction_kill_excluded_user_hosts\030\020 \003(\tB\003\340A\001\022o\n" + + "\025transaction_kill_type\030\021 \001(\0162F.google.cloud.sql.v1beta4.Performance" + + "CaptureConfig.TransactionKillTypeB\003\340A\001H\014\210\001\001\"n\n" + + "\023TransactionKillType\022%\n" + + "!TRANSACTION_KILL_TYPE_UNSPECIFIED\020\000\022\032\n" + + "\026READ_ONLY_TRANSACTIONS\020\001\022\024\n" + + "\020ALL_TRANSACTIONS\020\002B\n\n" + + "\010_enabledB\033\n" + + "\031_probing_interval_secondsB\022\n" + + "\020_probe_thresholdB\034\n" + + "\032_running_threads_thresholdB\"\n" + + " _seconds_behind_source_thresholdB!\n" + + "\037_transaction_duration_thresholdB$\n" + + "\"_cpu_utilization_threshold_percentB!\n" + + "\037_memory_usage_threshold_percentB(\n" + + "&_transaction_lock_wait_threshold_countB!\n" + + "\037_semaphore_wait_threshold_countB&\n" + + "$_history_list_length_threshold_countB%\n" + + "#_transaction_kill_threshold_secondsB\030\n" + + "\026_transaction_kill_type\"3\n" + + "\027AdvancedMachineFeatures\022\030\n" + + "\020threads_per_core\030\001 \001(\005\"\373\001\n" + + "\007SslCert\022\014\n" + + "\004kind\030\001 \001(\t\022\032\n" + + "\022cert_serial_number\030\002 \001(\t\022\014\n" + + "\004cert\030\003 \001(\t\022/\n" + + "\013create_time\030\004 \001(\0132\032.google.protobuf.Timestamp\022\023\n" + + "\013common_name\030\005 \001(\t\0223\n" + + "\017expiration_time\030\006 \001(\0132\032.google.protobuf.Timestamp\022\030\n" + + "\020sha1_fingerprint\030\007 \001(\t\022\020\n" + + "\010instance\030\010 \001(\t\022\021\n" + + "\tself_link\030\t \001(\t\"_\n\r" + + "SslCertDetail\0224\n" + + "\tcert_info\030\001 \001(\0132!.google.cloud.sql.v1beta4.SslCert\022\030\n" + + "\020cert_private_key\030\002 \001(\t\"d\n" + + "\036SslCertsCreateEphemeralRequest\022\036\n\n" + + "public_key\030\001 \001(\tR\n" + + "public_key\022\"\n" + + "\014access_token\030\002 \001(\tR\014access_token\",\n" + + "\025SslCertsInsertRequest\022\023\n" + + "\013common_name\030\001 \001(\t\"\274\003\n" + + ",SqlInstancesRescheduleMaintenanceRequestBody\022e\n\n" + + "reschedule\030\003 \001(\0132Q.goog" + + "le.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule\032\264\001\n" + + "\n" + + "Reschedule\022n\n" + + "\017reschedule_type\030\001 \001(\0162U.google.cloud.sql.v1beta4.SqlInstancesResc" + + "heduleMaintenanceRequestBody.RescheduleType\0226\n\r" + + "schedule_time\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340A\001\"n\n" + + "\016RescheduleType\022\037\n" + + "\033RESCHEDULE_TYPE_UNSPECIFIED\020\000\022\r\n" + + "\tIMMEDIATE\020\001\022\031\n" + + "\025NEXT_AVAILABLE_WINDOW\020\002\022\021\n\r" + + "SPECIFIC_TIME\020\003\"\327\001\n" + + "\026SslCertsInsertResponse\022\014\n" + + "\004kind\030\001 \001(\t\0226\n" + + "\toperation\030\002 \001(\0132#.google.cloud.sql.v1beta4.Operation\0229\n" + + "\016server_ca_cert\030\003 \001(\0132!.google.cloud.sql.v1beta4.SslCert\022<\n" + + "\013client_cert\030\004 \001(\0132\'.google.cloud.sql.v1beta4.SslCertDetail\"V\n" + + "\024SslCertsListResponse\022\014\n" + + "\004kind\030\001 \001(\t\0220\n" + + "\005items\030\002 \003(\0132!.google.cloud.sql.v1beta4.SslCert\"4\n" + + "\022TruncateLogContext\022\014\n" + + "\004kind\030\001 \001(\t\022\020\n" + + "\010log_type\030\002 \001(\t\"\255\003\n" + + "\030SqlActiveDirectoryConfig\022\014\n" + + "\004kind\030\001 \001(\t\022\016\n" + + "\006domain\030\002 \001(\t\022Y\n" + + "\004mode\030\003 \001(\0162F.google.cloud.sql.v1beta4.SqlActiv" + + "eDirectoryConfig.ActiveDirectoryModeB\003\340A\001\022 \n" + + "\013dns_servers\030\004 \003(\tB\013\340A\001\342\214\317\327\010\002\010\002\022)\n" + + "\034admin_credential_secret_name\030\005 \001(\tB\003\340A\001\022 \n" + + "\023organizational_unit\030\006 \001(\tB\003\340A\001\"\250\001\n" + + "\023ActiveDirectoryMode\022%\n" + + "!ACTIVE_DIRECTORY_MODE_UNSPECIFIED\020\000\022\034\n" + + "\030MANAGED_ACTIVE_DIRECTORY\020\001\022%\n" + + "\035SELF_MANAGED_ACTIVE_DIRECTORY\020\002\032\002\010\001\022%\n" + + "!CUSTOMER_MANAGED_ACTIVE_DIRECTORY\020\003\"\237\001\n" + + "\024SqlServerAuditConfig\022\014\n" + + "\004kind\030\001 \001(\t\022\016\n" + + "\006bucket\030\002 \001(\t\0225\n" + + "\022retention_interval\030\003 \001(\0132\031.google.protobuf.Duration\0222\n" + + "\017upload_interval\030\004 \001(\0132\031.google.protobuf.Duration\"`\n" + + "\026SqlServerEntraIdConfig\022\021\n" + + "\004kind\030\001 \001(\tB\003\340A\003\022\026\n" + + "\ttenant_id\030\002 \001(\tB\003\340A\001\022\033\n" + + "\016application_id\030\003 \001(\tB\003\340A\001\"<\n" + + "\023ConnectionPoolFlags\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\022\022\n" + + "\005value\030\002 \001(\tB\003\340A\002\"\226\004\n" + + "\027ReadPoolAutoScaleConfig\022\024\n" + + "\007enabled\030\001 \001(\010H\000\210\001\001\022\033\n" + + "\016min_node_count\030\002 \001(\005H\001\210\001\001\022\033\n" + + "\016max_node_count\030\003 \001(\005H\002\210\001\001\022[\n" + + "\016target_metrics\030\004 \003(\0132>.google.cloud.sql.v1b" + + "eta4.ReadPoolAutoScaleConfig.TargetMetricB\003\340A\001\022\035\n" + + "\020disable_scale_in\030\005 \001(\010H\003\210\001\001\022&\n" + + "\031scale_in_cooldown_seconds\030\006 \001(\005H\004\210\001\001\022\'\n" + + "\032scale_out_cooldown_seconds\030\007 \001(\005H\005\210\001\001\032Z\n" + + "\014TargetMetric\022\023\n" + + "\006metric\030\001 \001(\tH\000\210\001\001\022\031\n" + + "\014target_value\030\002 \001(\002H\001\210\001\001B\t\n" + + "\007_metricB\017\n\r" + + "_target_valueB\n\n" + + "\010_enabledB\021\n" + + "\017_min_node_countB\021\n" + + "\017_max_node_countB\023\n" + + "\021_disable_scale_inB\034\n" + + "\032_scale_in_cooldown_secondsB\035\n" + + "\033_scale_out_cooldown_seconds\"\322\001\n" + + "\024ConnectionPoolConfig\022\'\n" + + "\032connection_pooling_enabled\030\001 \001(\010H\000\210\001\001\022A\n" + + "\005flags\030\010" + + " \003(\0132-.google.cloud.sql.v1beta4.ConnectionPoolFlagsB\003\340A\001\022\036\n" + + "\014pooler_count\030\t \001(\005B\003\340A\003H\001\210\001\001B\035\n" + + "\033_connection_pooling_enabledB\017\n\r" + + "_pooler_count\"\342\001\n" + + "\027AcquireSsrsLeaseContext\022\030\n" + + "\013setup_login\030\001 \001(\tH\000\210\001\001\022\032\n\r" + + "service_login\030\002 \001(\tH\001\210\001\001\022\034\n" + + "\017report_database\030\003 \001(\tH\002\210\001\001\0220\n" + + "\010duration\030\004 \001(\0132\031.google.protobuf.DurationH\003\210\001\001B\016\n" + + "\014_setup_loginB\020\n" + + "\016_service_loginB\022\n" + + "\020_report_databaseB\013\n" + + "\t_duration*P\n" + + "\013SqlFileType\022\035\n" + + "\031SQL_FILE_TYPE_UNSPECIFIED\020\000\022\007\n" + + "\003SQL\020\001\022\007\n" + + "\003CSV\020\002\022\007\n" + + "\003BAK\020\004\022\007\n" + + "\003TDE\020\010*A\n" + + "\007BakType\022\030\n" + + "\024BAK_TYPE_UNSPECIFIED\020\000\022\010\n" + + "\004FULL\020\001\022\010\n" + + "\004DIFF\020\002\022\010\n" + + "\004TLOG\020\003*l\n\r" + + "AutoDnsStatus\022\037\n" + + "\033AUTO_DNS_STATUS_UNSPECIFIED\020\000\022\017\n" + + "\013AUTO_DNS_OK\020\001\022\023\n" + + "\017AUTO_DNS_FAILED\020\002\022\024\n" + + "\020AUTO_DNS_UNKNOWN\020\003*\314\001\n" + + "\022SqlMaintenanceType\022$\n" + + " SQL_MAINTENANCE_TYPE_UNSPECIFIED\020\000\022\030\n" + + "\024INSTANCE_MAINTENANCE\020\001\022 \n" + + "\034REPLICA_INCLUDED_MAINTENANCE\020\002\022%\n" + + "!INSTANCE_SELF_SERVICE_MAINTENANCE\020\003\022-\n" + + ")REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE\020\004*\304\001\n" + + "\022SqlBackupRunStatus\022%\n" + + "!SQL_BACKUP_RUN_STATUS_UNSPECIFIED\020\000\022\014\n" + + "\010ENQUEUED\020\001\022\013\n" + + "\007OVERDUE\020\002\022\013\n" + + "\007RUNNING\020\003\022\n\n" + + "\006FAILED\020\004\022\016\n\n" + + "SUCCESSFUL\020\005\022\013\n" + + "\007SKIPPED\020\006\022\024\n" + + "\020DELETION_PENDING\020\007\022\023\n" + + "\017DELETION_FAILED\020\010\022\013\n" + + "\007DELETED\020\t*U\n" + + "\020SqlBackupRunType\022#\n" + + "\037SQL_BACKUP_RUN_TYPE_UNSPECIFIED\020\000\022\r\n" + + "\tAUTOMATED\020\001\022\r\n" + + "\tON_DEMAND\020\002*L\n\r" + + "SqlBackupKind\022\037\n" + + "\033SQL_BACKUP_KIND_UNSPECIFIED\020\000\022\014\n" + + "\010SNAPSHOT\020\001\022\014\n" + + "\010PHYSICAL\020\002*c\n" + + "\016SqlBackendType\022 \n" + + "\034SQL_BACKEND_TYPE_UNSPECIFIED\020\000\022\021\n" + + "\tFIRST_GEN\020\001\032\002\010\001\022\016\n\n" + + "SECOND_GEN\020\002\022\014\n" + + "\010EXTERNAL\020\003*u\n" + + "\020SqlIpAddressType\022#\n" + + "\037SQL_IP_ADDRESS_TYPE_UNSPECIFIED\020\000\022\013\n" + + "\007PRIMARY\020\001\022\014\n" + + "\010OUTGOING\020\002\022\013\n" + + "\007PRIVATE\020\003\022\024\n" + + "\020MIGRATED_1ST_GEN\020\004*\231\001\n" + + "\017SqlInstanceType\022!\n" + + "\035SQL_INSTANCE_TYPE_UNSPECIFIED\020\000\022\026\n" + + "\022CLOUD_SQL_INSTANCE\020\001\022\030\n" + + "\024ON_PREMISES_INSTANCE\020\002\022\031\n" + + "\025READ_REPLICA_INSTANCE\020\003\022\026\n" + + "\022READ_POOL_INSTANCE\020\005*\277\t\n" + + "\022SqlDatabaseVersion\022$\n" + + " SQL_DATABASE_VERSION_UNSPECIFIED\020\000\022\021\n" + + "\tMYSQL_5_1\020\002\032\002\010\001\022\021\n" + + "\tMYSQL_5_5\020\003\032\002\010\001\022\r\n" + + "\tMYSQL_5_6\020\005\022\r\n" + + "\tMYSQL_5_7\020\006\022\r\n" + + "\tMYSQL_8_0\020\024\022\020\n" + + "\014MYSQL_8_0_18\020)\022\020\n" + + "\014MYSQL_8_0_26\020U\022\020\n" + + "\014MYSQL_8_0_27\020o\022\021\n" + + "\014MYSQL_8_0_28\020\204\001\022\025\n" + + "\014MYSQL_8_0_29\020\224\001\032\002\010\001\022\021\n" + + "\014MYSQL_8_0_30\020\256\001\022\021\n" + + "\014MYSQL_8_0_31\020\305\001\022\021\n" + + "\014MYSQL_8_0_32\020\325\001\022\021\n" + + "\014MYSQL_8_0_33\020\356\001\022\021\n" + + "\014MYSQL_8_0_34\020\357\001\022\021\n" + + "\014MYSQL_8_0_35\020\360\001\022\021\n" + + "\014MYSQL_8_0_36\020\361\001\022\021\n" + + "\014MYSQL_8_0_37\020\343\002\022\021\n" + + "\014MYSQL_8_0_39\020\345\002\022\021\n" + + "\014MYSQL_8_0_40\020\346\002\022\021\n" + + "\014MYSQL_8_0_41\020\350\003\022\021\n" + + "\014MYSQL_8_0_42\020\351\003\022\021\n" + + "\014MYSQL_8_0_43\020\251\004\022\021\n" + + "\014MYSQL_8_0_44\020\252\004\022\021\n" + + "\014MYSQL_8_0_45\020\253\004\022\021\n" + + "\014MYSQL_8_0_46\020\254\004\022\016\n" + + "\tMYSQL_8_4\020\216\003\022\016\n" + + "\tMYSQL_9_7\020\216\005\022\033\n" + + "\027SQLSERVER_2017_STANDARD\020\013\022\035\n" + + "\031SQLSERVER_2017_ENTERPRISE\020\016\022\032\n" + + "\026SQLSERVER_2017_EXPRESS\020\017\022\026\n" + + "\022SQLSERVER_2017_WEB\020\020\022\020\n" + + "\014POSTGRES_9_6\020\t\022\017\n" + + "\013POSTGRES_10\020\022\022\017\n" + + "\013POSTGRES_11\020\n" + + "\022\017\n" + + "\013POSTGRES_12\020\023\022\017\n" + + "\013POSTGRES_13\020\027\022\017\n" + + "\013POSTGRES_14\020n\022\020\n" + + "\013POSTGRES_15\020\254\001\022\020\n" + + "\013POSTGRES_16\020\220\002\022\020\n" + + "\013POSTGRES_17\020\230\003\022\020\n" + + "\013POSTGRES_18\020\255\004\022\020\n" + + "\013POSTGRES_19\020\254\005\022\020\n" + + "\013POSTGRES_20\020\215\006\022\033\n" + + "\027SQLSERVER_2019_STANDARD\020\032\022\035\n" + + "\031SQLSERVER_2019_ENTERPRISE\020\033\022\032\n" + + "\026SQLSERVER_2019_EXPRESS\020\034\022\026\n" + + "\022SQLSERVER_2019_WEB\020\035\022\034\n" + + "\027SQLSERVER_2022_STANDARD\020\307\001\022\036\n" + + "\031SQLSERVER_2022_ENTERPRISE\020\310\001\022\033\n" + + "\026SQLSERVER_2022_EXPRESS\020\311\001\022\027\n" + + "\022SQLSERVER_2022_WEB\020\312\001\022\034\n" + + "\027SQLSERVER_2025_STANDARD\020\245\004\022\036\n" + + "\031SQLSERVER_2025_ENTERPRISE\020\246\004\022\033\n" + + "\026SQLSERVER_2025_EXPRESS\020\247\004*\235\001\n" + + "\023SqlSuspensionReason\022%\n" + + "!SQL_SUSPENSION_REASON_UNSPECIFIED\020\000\022\021\n\r" + + "BILLING_ISSUE\020\002\022\017\n" + + "\013LEGAL_ISSUE\020\003\022\025\n" + + "\021OPERATIONAL_ISSUE\020\004\022\021\n\r" + + "KMS_KEY_ISSUE\020\005\022\021\n\r" + + "PROJECT_ABUSE\020\010*L\n" + + "\016SqlPricingPlan\022 \n" + + "\034SQL_PRICING_PLAN_UNSPECIFIED\020\000\022\013\n" + + "\007PACKAGE\020\001\022\013\n" + + "\007PER_USE\020\002*]\n" + + "\022SqlReplicationType\022$\n" + + " SQL_REPLICATION_TYPE_UNSPECIFIED\020\000\022\017\n" + + "\013SYNCHRONOUS\020\001\022\020\n" + + "\014ASYNCHRONOUS\020\002*\201\001\n" + + "\017SqlDataDiskType\022\"\n" + + "\036SQL_DATA_DISK_TYPE_UNSPECIFIED\020\000\022\n\n" + + "\006PD_SSD\020\001\022\n\n" + + "\006PD_HDD\020\002\022\032\n" + + "\022OBSOLETE_LOCAL_SSD\020\003\032\002\010\001\022\026\n" + + "\022HYPERDISK_BALANCED\020\004*U\n" + + "\023SqlAvailabilityType\022%\n" + + "!SQL_AVAILABILITY_TYPE_UNSPECIFIED\020\000\022\t\n" + + "\005ZONAL\020\001\022\014\n" + + "\010REGIONAL\020\002*U\n" + + "\016SqlUpdateTrack\022 \n" + + "\034SQL_UPDATE_TRACK_UNSPECIFIED\020\000\022\n\n" + + "\006canary\020\001\022\n\n" + + "\006stable\020\002\022\t\n" + + "\005week5\020\003*\227\001\n" + + "\013SqlFlagType\022\035\n" + + "\031SQL_FLAG_TYPE_UNSPECIFIED\020\000\022\013\n" + + "\007BOOLEAN\020\001\022\n\n" + + "\006STRING\020\002\022\013\n" + + "\007INTEGER\020\003\022\010\n" + + "\004NONE\020\004\022\031\n" + + "\025MYSQL_TIMEZONE_OFFSET\020\005\022\t\n" + + "\005FLOAT\020\006\022\023\n" + + "\017REPEATED_STRING\020\007*o\n" + + "\014SqlFlagScope\022\036\n" + + "\032SQL_FLAG_SCOPE_UNSPECIFIED\020\000\022\033\n" + + "\027SQL_FLAG_SCOPE_DATABASE\020\001\022\"\n" + + "\036SQL_FLAG_SCOPE_CONNECTION_POOL\020\002B\250\004\n" + + "\034com.google.cloud.sql.v1beta4B\026CloudSqlRes" + + "ourcesProtoP\001Z.cloud.google.com/go/sql/apiv1beta4/sqlpb;sqlpb\352A\216\001\n" + + "\036backupdr.googleapis.com/Backup\022lprojects/{project}/lo" + + "cations/{location}/backupVaults/{backupv" + + "ault}/dataSources/{datasource}/backups/{backup}\352AN\n" + + "\036compute.googleapis.com/Netwo" + + "rk\022,projects/{project}/global/networks/{network}\352A\213\001\n" + + ".compute.googleapis.com/ServiceConnectionPolicy\022Yprojects/{project}" + + "/regions/{region}/serviceConnectionPolicies/{service_connection_policy}\352AK\n" + + " cloudsql.googleapis.com/Instance\022\'projects/{" + + "project}/instances/{instance}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.FieldInfoProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + com.google.type.IntervalProto.getDescriptor(), + }); + internal_static_google_cloud_sql_v1beta4_AclEntry_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_sql_v1beta4_AclEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_AclEntry_descriptor, + new java.lang.String[] { + "Value", "ExpirationTime", "Name", "Kind", + }); + internal_static_google_cloud_sql_v1beta4_ApiWarning_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_sql_v1beta4_ApiWarning_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ApiWarning_descriptor, + new java.lang.String[] { + "Code", "Message", "Region", + }); + internal_static_google_cloud_sql_v1beta4_BackupRetentionSettings_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_sql_v1beta4_BackupRetentionSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_BackupRetentionSettings_descriptor, + new java.lang.String[] { + "RetentionUnit", "RetainedBackups", + }); + internal_static_google_cloud_sql_v1beta4_BackupConfiguration_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_sql_v1beta4_BackupConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_BackupConfiguration_descriptor, + new java.lang.String[] { + "StartTime", + "Enabled", + "Kind", + "BinaryLogEnabled", + "ReplicationLogArchivingEnabled", + "Location", + "PointInTimeRecoveryEnabled", + "TransactionLogRetentionDays", + "BackupRetentionSettings", + "TransactionalLogStorageState", + "BackupTier", + }); + internal_static_google_cloud_sql_v1beta4_BackupRun_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_cloud_sql_v1beta4_BackupRun_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_BackupRun_descriptor, + new java.lang.String[] { + "Kind", + "Status", + "EnqueuedTime", + "Id", + "StartTime", + "EndTime", + "Error", + "Type", + "Description", + "WindowStartTime", + "Instance", + "SelfLink", + "Location", + "DatabaseVersion", + "DiskEncryptionConfiguration", + "DiskEncryptionStatus", + "BackupKind", + "TimeZone", + "MaxChargeableBytes", + }); + internal_static_google_cloud_sql_v1beta4_Backup_descriptor = getDescriptor().getMessageType(5); + internal_static_google_cloud_sql_v1beta4_Backup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_Backup_descriptor, + new java.lang.String[] { + "Name", + "Kind", + "SelfLink", + "Type", + "Description", + "Instance", + "Location", + "BackupInterval", + "State", + "Error", + "KmsKey", + "KmsKeyVersion", + "BackupKind", + "TimeZone", + "TtlDays", + "ExpiryTime", + "DatabaseVersion", + "MaxChargeableBytes", + "InstanceDeletionTime", + "InstanceSettings", + "BackupRun", + "SatisfiesPzs", + "SatisfiesPzi", + "Expiration", + }); + internal_static_google_cloud_sql_v1beta4_BackupRunsListResponse_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_cloud_sql_v1beta4_BackupRunsListResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_BackupRunsListResponse_descriptor, + new java.lang.String[] { + "Kind", "Items", "NextPageToken", + }); + internal_static_google_cloud_sql_v1beta4_BinLogCoordinates_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_cloud_sql_v1beta4_BinLogCoordinates_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_BinLogCoordinates_descriptor, + new java.lang.String[] { + "BinLogFileName", "BinLogPosition", "Kind", + }); + internal_static_google_cloud_sql_v1beta4_BackupContext_descriptor = + getDescriptor().getMessageType(8); + internal_static_google_cloud_sql_v1beta4_BackupContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_BackupContext_descriptor, + new java.lang.String[] { + "BackupId", "Kind", "Name", + }); + internal_static_google_cloud_sql_v1beta4_CloneContext_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_cloud_sql_v1beta4_CloneContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_CloneContext_descriptor, + new java.lang.String[] { + "Kind", + "PitrTimestampMs", + "DestinationInstanceName", + "BinLogCoordinates", + "PointInTime", + "AllocatedIpRange", + "DatabaseNames", + "PreferredZone", + "PreferredSecondaryZone", + "SourceInstanceDeletionTime", + "DestinationProject", + "DestinationNetwork", + }); + internal_static_google_cloud_sql_v1beta4_Database_descriptor = + getDescriptor().getMessageType(10); + internal_static_google_cloud_sql_v1beta4_Database_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_Database_descriptor, + new java.lang.String[] { + "Kind", + "Charset", + "Collation", + "Etag", + "Name", + "Instance", + "SelfLink", + "Project", + "SqlserverDatabaseDetails", + "DatabaseDetails", + }); + internal_static_google_cloud_sql_v1beta4_SqlServerDatabaseDetails_descriptor = + getDescriptor().getMessageType(11); + internal_static_google_cloud_sql_v1beta4_SqlServerDatabaseDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlServerDatabaseDetails_descriptor, + new java.lang.String[] { + "CompatibilityLevel", "RecoveryModel", + }); + internal_static_google_cloud_sql_v1beta4_DatabaseFlags_descriptor = + getDescriptor().getMessageType(12); + internal_static_google_cloud_sql_v1beta4_DatabaseFlags_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DatabaseFlags_descriptor, + new java.lang.String[] { + "Name", "Value", + }); + internal_static_google_cloud_sql_v1beta4_SyncFlags_descriptor = + getDescriptor().getMessageType(13); + internal_static_google_cloud_sql_v1beta4_SyncFlags_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SyncFlags_descriptor, + new java.lang.String[] { + "Name", "Value", + }); + internal_static_google_cloud_sql_v1beta4_InstanceReference_descriptor = + getDescriptor().getMessageType(14); + internal_static_google_cloud_sql_v1beta4_InstanceReference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstanceReference_descriptor, + new java.lang.String[] { + "Name", "Region", "Project", + }); + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_descriptor = + getDescriptor().getMessageType(15); + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_descriptor, + new java.lang.String[] { + "Kind", + "State", + "DatabaseVersion", + "Settings", + "Etag", + "FailoverReplica", + "MasterInstanceName", + "ReplicaNames", + "MaxDiskSize", + "CurrentDiskSize", + "IpAddresses", + "ServerCaCert", + "InstanceType", + "Project", + "Ipv6Address", + "ServiceAccountEmailAddress", + "OnPremisesConfiguration", + "ReplicaConfiguration", + "BackendType", + "SelfLink", + "SuspensionReason", + "ConnectionName", + "Name", + "Region", + "GceZone", + "SecondaryGceZone", + "DiskEncryptionConfiguration", + "DiskEncryptionStatus", + "RootPassword", + "ScheduledMaintenance", + "SatisfiesPzs", + "DatabaseInstalledVersion", + "OutOfDiskReport", + "CreateTime", + "AvailableMaintenanceVersions", + "MaintenanceVersion", + "UpgradableDatabaseVersions", + "SqlNetworkArchitecture", + "PscServiceAttachmentLink", + "DnsName", + "PrimaryDnsName", + "WriteEndpoint", + "ReplicationCluster", + "GeminiConfig", + "SatisfiesPzi", + "SwitchTransactionLogsToCloudStorageEnabled", + "IncludeReplicasForMajorVersionUpgrade", + "Tags", + "NodeCount", + "Nodes", + "DnsNames", + }); + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlFailoverReplica_descriptor = + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_descriptor.getNestedType(0); + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlFailoverReplica_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlFailoverReplica_descriptor, + new java.lang.String[] { + "Name", "Available", + }); + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlScheduledMaintenance_descriptor = + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_descriptor.getNestedType(1); + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlScheduledMaintenance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlScheduledMaintenance_descriptor, + new java.lang.String[] { + "StartTime", "CanDefer", "CanReschedule", "ScheduleDeadlineTime", + }); + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlOutOfDiskReport_descriptor = + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_descriptor.getNestedType(2); + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlOutOfDiskReport_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlOutOfDiskReport_descriptor, + new java.lang.String[] { + "SqlOutOfDiskState", "SqlMinRecommendedIncreaseSizeGb", + }); + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_PoolNodeConfig_descriptor = + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_descriptor.getNestedType(3); + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_PoolNodeConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_PoolNodeConfig_descriptor, + new java.lang.String[] { + "Name", + "GceZone", + "IpAddresses", + "DnsName", + "State", + "DnsNames", + "PscServiceAttachmentLink", + "PscAutoConnections", + }); + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_TagsEntry_descriptor = + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_descriptor.getNestedType(4); + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_TagsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DatabaseInstance_TagsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_sql_v1beta4_DnsNameMapping_descriptor = + getDescriptor().getMessageType(16); + internal_static_google_cloud_sql_v1beta4_DnsNameMapping_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DnsNameMapping_descriptor, + new java.lang.String[] { + "Name", "ConnectionType", "DnsScope", "RecordManager", + }); + internal_static_google_cloud_sql_v1beta4_GeminiInstanceConfig_descriptor = + getDescriptor().getMessageType(17); + internal_static_google_cloud_sql_v1beta4_GeminiInstanceConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_GeminiInstanceConfig_descriptor, + new java.lang.String[] { + "Entitled", + "GoogleVacuumMgmtEnabled", + "OomSessionCancelEnabled", + "ActiveQueryEnabled", + "IndexAdvisorEnabled", + "FlagRecommenderEnabled", + }); + internal_static_google_cloud_sql_v1beta4_ReplicationCluster_descriptor = + getDescriptor().getMessageType(18); + internal_static_google_cloud_sql_v1beta4_ReplicationCluster_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ReplicationCluster_descriptor, + new java.lang.String[] { + "PsaWriteEndpoint", "FailoverDrReplicaName", "DrReplica", + }); + internal_static_google_cloud_sql_v1beta4_AvailableDatabaseVersion_descriptor = + getDescriptor().getMessageType(19); + internal_static_google_cloud_sql_v1beta4_AvailableDatabaseVersion_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_AvailableDatabaseVersion_descriptor, + new java.lang.String[] { + "MajorVersion", "Name", "DisplayName", + }); + internal_static_google_cloud_sql_v1beta4_DatabasesListResponse_descriptor = + getDescriptor().getMessageType(20); + internal_static_google_cloud_sql_v1beta4_DatabasesListResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DatabasesListResponse_descriptor, + new java.lang.String[] { + "Kind", "Items", + }); + internal_static_google_cloud_sql_v1beta4_DemoteMasterConfiguration_descriptor = + getDescriptor().getMessageType(21); + internal_static_google_cloud_sql_v1beta4_DemoteMasterConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DemoteMasterConfiguration_descriptor, + new java.lang.String[] { + "Kind", "MysqlReplicaConfiguration", + }); + internal_static_google_cloud_sql_v1beta4_DemoteMasterContext_descriptor = + getDescriptor().getMessageType(22); + internal_static_google_cloud_sql_v1beta4_DemoteMasterContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DemoteMasterContext_descriptor, + new java.lang.String[] { + "Kind", + "VerifyGtidConsistency", + "MasterInstanceName", + "ReplicaConfiguration", + "SkipReplicationSetup", + }); + internal_static_google_cloud_sql_v1beta4_DemoteMasterMySqlReplicaConfiguration_descriptor = + getDescriptor().getMessageType(23); + internal_static_google_cloud_sql_v1beta4_DemoteMasterMySqlReplicaConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DemoteMasterMySqlReplicaConfiguration_descriptor, + new java.lang.String[] { + "Kind", "Username", "Password", "ClientKey", "ClientCertificate", "CaCertificate", + }); + internal_static_google_cloud_sql_v1beta4_DemoteContext_descriptor = + getDescriptor().getMessageType(24); + internal_static_google_cloud_sql_v1beta4_DemoteContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DemoteContext_descriptor, + new java.lang.String[] { + "Kind", "SourceRepresentativeInstanceName", + }); + internal_static_google_cloud_sql_v1beta4_ExportContext_descriptor = + getDescriptor().getMessageType(25); + internal_static_google_cloud_sql_v1beta4_ExportContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ExportContext_descriptor, + new java.lang.String[] { + "Uri", + "Databases", + "Kind", + "SqlExportOptions", + "CsvExportOptions", + "FileType", + "Offload", + "BakExportOptions", + "TdeExportOptions", + }); + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlCsvExportOptions_descriptor = + internal_static_google_cloud_sql_v1beta4_ExportContext_descriptor.getNestedType(0); + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlCsvExportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlCsvExportOptions_descriptor, + new java.lang.String[] { + "SelectQuery", + "EscapeCharacter", + "QuoteCharacter", + "FieldsTerminatedBy", + "LinesTerminatedBy", + }); + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_descriptor = + internal_static_google_cloud_sql_v1beta4_ExportContext_descriptor.getNestedType(1); + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_descriptor, + new java.lang.String[] { + "Tables", + "SchemaOnly", + "MysqlExportOptions", + "Threads", + "Parallel", + "PostgresExportOptions", + }); + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_MysqlExportOptions_descriptor = + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_descriptor + .getNestedType(0); + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_MysqlExportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_MysqlExportOptions_descriptor, + new java.lang.String[] { + "MasterData", + }); + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_PostgresExportOptions_descriptor = + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_descriptor + .getNestedType(1); + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_PostgresExportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_PostgresExportOptions_descriptor, + new java.lang.String[] { + "Clean", "IfExists", + }); + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlBakExportOptions_descriptor = + internal_static_google_cloud_sql_v1beta4_ExportContext_descriptor.getNestedType(2); + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlBakExportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlBakExportOptions_descriptor, + new java.lang.String[] { + "Striped", + "StripeCount", + "BakType", + "CopyOnly", + "DifferentialBase", + "ExportLogStartTime", + "ExportLogEndTime", + }); + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlTdeExportOptions_descriptor = + internal_static_google_cloud_sql_v1beta4_ExportContext_descriptor.getNestedType(3); + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlTdeExportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ExportContext_SqlTdeExportOptions_descriptor, + new java.lang.String[] { + "CertificatePath", "PrivateKeyPath", "PrivateKeyPassword", "Name", + }); + internal_static_google_cloud_sql_v1beta4_FailoverContext_descriptor = + getDescriptor().getMessageType(26); + internal_static_google_cloud_sql_v1beta4_FailoverContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_FailoverContext_descriptor, + new java.lang.String[] { + "SettingsVersion", "Kind", + }); + internal_static_google_cloud_sql_v1beta4_Flag_descriptor = getDescriptor().getMessageType(27); + internal_static_google_cloud_sql_v1beta4_Flag_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_Flag_descriptor, + new java.lang.String[] { + "Name", + "Type", + "AppliesTo", + "AllowedStringValues", + "MinValue", + "MaxValue", + "RequiresRestart", + "Kind", + "InBeta", + "AllowedIntValues", + "FlagScope", + "RecommendedStringValue", + "RecommendedIntValue", + "RecommendedValue", + }); + internal_static_google_cloud_sql_v1beta4_FlagsListResponse_descriptor = + getDescriptor().getMessageType(28); + internal_static_google_cloud_sql_v1beta4_FlagsListResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_FlagsListResponse_descriptor, + new java.lang.String[] { + "Kind", "Items", + }); + internal_static_google_cloud_sql_v1beta4_ImportContext_descriptor = + getDescriptor().getMessageType(29); + internal_static_google_cloud_sql_v1beta4_ImportContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ImportContext_descriptor, + new java.lang.String[] { + "Uri", + "Database", + "Kind", + "FileType", + "CsvImportOptions", + "ImportUser", + "BakImportOptions", + "SqlImportOptions", + "TdeImportOptions", + }); + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_descriptor = + internal_static_google_cloud_sql_v1beta4_ImportContext_descriptor.getNestedType(0); + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_descriptor, + new java.lang.String[] { + "Threads", "Parallel", "PostgresImportOptions", + }); + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_PostgresImportOptions_descriptor = + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_descriptor + .getNestedType(0); + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_PostgresImportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_PostgresImportOptions_descriptor, + new java.lang.String[] { + "Clean", "IfExists", + }); + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlCsvImportOptions_descriptor = + internal_static_google_cloud_sql_v1beta4_ImportContext_descriptor.getNestedType(1); + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlCsvImportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlCsvImportOptions_descriptor, + new java.lang.String[] { + "Table", + "Columns", + "EscapeCharacter", + "QuoteCharacter", + "FieldsTerminatedBy", + "LinesTerminatedBy", + }); + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_descriptor = + internal_static_google_cloud_sql_v1beta4_ImportContext_descriptor.getNestedType(2); + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_descriptor, + new java.lang.String[] { + "EncryptionOptions", + "Striped", + "NoRecovery", + "RecoveryOnly", + "BakType", + "StopAt", + "StopAtMark", + }); + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_EncryptionOptions_descriptor = + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_descriptor + .getNestedType(0); + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_EncryptionOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_EncryptionOptions_descriptor, + new java.lang.String[] { + "CertPath", "PvkPath", "PvkPassword", "KeepEncrypted", + }); + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlTdeImportOptions_descriptor = + internal_static_google_cloud_sql_v1beta4_ImportContext_descriptor.getNestedType(3); + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlTdeImportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ImportContext_SqlTdeImportOptions_descriptor, + new java.lang.String[] { + "CertificatePath", "PrivateKeyPath", "PrivateKeyPassword", "Name", + }); + internal_static_google_cloud_sql_v1beta4_InstancesCloneRequest_descriptor = + getDescriptor().getMessageType(30); + internal_static_google_cloud_sql_v1beta4_InstancesCloneRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesCloneRequest_descriptor, + new java.lang.String[] { + "CloneContext", + }); + internal_static_google_cloud_sql_v1beta4_InstancesDemoteMasterRequest_descriptor = + getDescriptor().getMessageType(31); + internal_static_google_cloud_sql_v1beta4_InstancesDemoteMasterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesDemoteMasterRequest_descriptor, + new java.lang.String[] { + "DemoteMasterContext", + }); + internal_static_google_cloud_sql_v1beta4_InstancesDemoteRequest_descriptor = + getDescriptor().getMessageType(32); + internal_static_google_cloud_sql_v1beta4_InstancesDemoteRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesDemoteRequest_descriptor, + new java.lang.String[] { + "DemoteContext", + }); + internal_static_google_cloud_sql_v1beta4_InstancesExportRequest_descriptor = + getDescriptor().getMessageType(33); + internal_static_google_cloud_sql_v1beta4_InstancesExportRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesExportRequest_descriptor, + new java.lang.String[] { + "ExportContext", + }); + internal_static_google_cloud_sql_v1beta4_InstancesFailoverRequest_descriptor = + getDescriptor().getMessageType(34); + internal_static_google_cloud_sql_v1beta4_InstancesFailoverRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesFailoverRequest_descriptor, + new java.lang.String[] { + "FailoverContext", + }); + internal_static_google_cloud_sql_v1beta4_InstancesImportRequest_descriptor = + getDescriptor().getMessageType(35); + internal_static_google_cloud_sql_v1beta4_InstancesImportRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesImportRequest_descriptor, + new java.lang.String[] { + "ImportContext", + }); + internal_static_google_cloud_sql_v1beta4_InstancesPreCheckMajorVersionUpgradeRequest_descriptor = + getDescriptor().getMessageType(36); + internal_static_google_cloud_sql_v1beta4_InstancesPreCheckMajorVersionUpgradeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesPreCheckMajorVersionUpgradeRequest_descriptor, + new java.lang.String[] { + "PreCheckMajorVersionUpgradeContext", + }); + internal_static_google_cloud_sql_v1beta4_MySqlSyncConfig_descriptor = + getDescriptor().getMessageType(37); + internal_static_google_cloud_sql_v1beta4_MySqlSyncConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_MySqlSyncConfig_descriptor, + new java.lang.String[] { + "InitialSyncFlags", + }); + internal_static_google_cloud_sql_v1beta4_InstancesListResponse_descriptor = + getDescriptor().getMessageType(38); + internal_static_google_cloud_sql_v1beta4_InstancesListResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesListResponse_descriptor, + new java.lang.String[] { + "Kind", "Warnings", "Items", "NextPageToken", + }); + internal_static_google_cloud_sql_v1beta4_InstancesListServerCasResponse_descriptor = + getDescriptor().getMessageType(39); + internal_static_google_cloud_sql_v1beta4_InstancesListServerCasResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesListServerCasResponse_descriptor, + new java.lang.String[] { + "Certs", "ActiveVersion", "Kind", + }); + internal_static_google_cloud_sql_v1beta4_InstancesListServerCertificatesResponse_descriptor = + getDescriptor().getMessageType(40); + internal_static_google_cloud_sql_v1beta4_InstancesListServerCertificatesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesListServerCertificatesResponse_descriptor, + new java.lang.String[] { + "CaCerts", "ServerCerts", "ActiveVersion", "Kind", + }); + internal_static_google_cloud_sql_v1beta4_InstancesListEntraIdCertificatesResponse_descriptor = + getDescriptor().getMessageType(41); + internal_static_google_cloud_sql_v1beta4_InstancesListEntraIdCertificatesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesListEntraIdCertificatesResponse_descriptor, + new java.lang.String[] { + "Certs", "ActiveVersion", "Kind", + }); + internal_static_google_cloud_sql_v1beta4_InstancesRestoreBackupRequest_descriptor = + getDescriptor().getMessageType(42); + internal_static_google_cloud_sql_v1beta4_InstancesRestoreBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesRestoreBackupRequest_descriptor, + new java.lang.String[] { + "RestoreBackupContext", + "Backup", + "BackupdrBackup", + "RestoreInstanceSettings", + "RestoreInstanceClearOverridesFieldNames", + }); + internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCaRequest_descriptor = + getDescriptor().getMessageType(43); + internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCaRequest_descriptor, + new java.lang.String[] { + "RotateServerCaContext", + }); + internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCertificateRequest_descriptor = + getDescriptor().getMessageType(44); + internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCertificateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCertificateRequest_descriptor, + new java.lang.String[] { + "RotateServerCertificateContext", + }); + internal_static_google_cloud_sql_v1beta4_InstancesRotateEntraIdCertificateRequest_descriptor = + getDescriptor().getMessageType(45); + internal_static_google_cloud_sql_v1beta4_InstancesRotateEntraIdCertificateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesRotateEntraIdCertificateRequest_descriptor, + new java.lang.String[] { + "RotateEntraIdCertificateContext", + }); + internal_static_google_cloud_sql_v1beta4_InstancesTruncateLogRequest_descriptor = + getDescriptor().getMessageType(46); + internal_static_google_cloud_sql_v1beta4_InstancesTruncateLogRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesTruncateLogRequest_descriptor, + new java.lang.String[] { + "TruncateLogContext", + }); + internal_static_google_cloud_sql_v1beta4_InstancesAcquireSsrsLeaseRequest_descriptor = + getDescriptor().getMessageType(47); + internal_static_google_cloud_sql_v1beta4_InstancesAcquireSsrsLeaseRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesAcquireSsrsLeaseRequest_descriptor, + new java.lang.String[] { + "AcquireSsrsLeaseContext", + }); + internal_static_google_cloud_sql_v1beta4_PointInTimeRestoreContext_descriptor = + getDescriptor().getMessageType(48); + internal_static_google_cloud_sql_v1beta4_PointInTimeRestoreContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_PointInTimeRestoreContext_descriptor, + new java.lang.String[] { + "Datasource", + "PointInTime", + "TargetInstance", + "PrivateNetwork", + "AllocatedIpRange", + "PreferredZone", + "PreferredSecondaryZone", + "TargetInstanceSettings", + "TargetInstanceClearSettingsFieldNames", + "Region", + }); + internal_static_google_cloud_sql_v1beta4_PerformDiskShrinkContext_descriptor = + getDescriptor().getMessageType(49); + internal_static_google_cloud_sql_v1beta4_PerformDiskShrinkContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_PerformDiskShrinkContext_descriptor, + new java.lang.String[] { + "TargetSizeGb", + }); + internal_static_google_cloud_sql_v1beta4_PreCheckResponse_descriptor = + getDescriptor().getMessageType(50); + internal_static_google_cloud_sql_v1beta4_PreCheckResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_PreCheckResponse_descriptor, + new java.lang.String[] { + "Message", "MessageType", "ActionsRequired", + }); + internal_static_google_cloud_sql_v1beta4_PreCheckMajorVersionUpgradeContext_descriptor = + getDescriptor().getMessageType(51); + internal_static_google_cloud_sql_v1beta4_PreCheckMajorVersionUpgradeContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_PreCheckMajorVersionUpgradeContext_descriptor, + new java.lang.String[] { + "TargetDatabaseVersion", "PreCheckResponse", "Kind", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigResponse_descriptor = + getDescriptor().getMessageType(52); + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigResponse_descriptor, + new java.lang.String[] { + "Kind", "MinimalTargetSizeGb", "Message", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsResponse_descriptor = + getDescriptor().getMessageType(53); + internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsResponse_descriptor, + new java.lang.String[] { + "Kind", "Errors", "Warnings", + }); + internal_static_google_cloud_sql_v1beta4_SqlExternalSyncSettingError_descriptor = + getDescriptor().getMessageType(54); + internal_static_google_cloud_sql_v1beta4_SqlExternalSyncSettingError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlExternalSyncSettingError_descriptor, + new java.lang.String[] { + "Kind", "Type", "Detail", + }); + internal_static_google_cloud_sql_v1beta4_IpConfiguration_descriptor = + getDescriptor().getMessageType(55); + internal_static_google_cloud_sql_v1beta4_IpConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_IpConfiguration_descriptor, + new java.lang.String[] { + "Ipv4Enabled", + "PrivateNetwork", + "RequireSsl", + "AuthorizedNetworks", + "AllocatedIpRange", + "EnablePrivatePathForGoogleCloudServices", + "SslMode", + "PscConfig", + "ServerCaMode", + "CustomSubjectAlternativeNames", + "ServerCaPool", + "ServerCertificateRotationMode", + }); + internal_static_google_cloud_sql_v1beta4_PscConfig_descriptor = + getDescriptor().getMessageType(56); + internal_static_google_cloud_sql_v1beta4_PscConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_PscConfig_descriptor, + new java.lang.String[] { + "PscEnabled", + "AllowedConsumerProjects", + "PscAutoConnections", + "NetworkAttachmentUri", + "PscAutoDnsEnabled", + "PscWriteEndpointDnsEnabled", + "PscAutoConnectionPolicyEnabled", + }); + internal_static_google_cloud_sql_v1beta4_PscAutoConnectionConfig_descriptor = + getDescriptor().getMessageType(57); + internal_static_google_cloud_sql_v1beta4_PscAutoConnectionConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_PscAutoConnectionConfig_descriptor, + new java.lang.String[] { + "ConsumerProject", + "ConsumerNetwork", + "IpAddress", + "Status", + "ConsumerNetworkStatus", + "ServiceConnectionPolicy", + "ServiceConnectionPolicyCreationResult", + "InstanceAutoDnsStatus", + "WriteEndpointAutoDnsStatus", + }); + internal_static_google_cloud_sql_v1beta4_IpMapping_descriptor = + getDescriptor().getMessageType(58); + internal_static_google_cloud_sql_v1beta4_IpMapping_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_IpMapping_descriptor, + new java.lang.String[] { + "Type", "IpAddress", "TimeToRetire", + }); + internal_static_google_cloud_sql_v1beta4_LocationPreference_descriptor = + getDescriptor().getMessageType(59); + internal_static_google_cloud_sql_v1beta4_LocationPreference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_LocationPreference_descriptor, + new java.lang.String[] { + "FollowGaeApplication", "Zone", "SecondaryZone", "Kind", + }); + internal_static_google_cloud_sql_v1beta4_MaintenanceWindow_descriptor = + getDescriptor().getMessageType(60); + internal_static_google_cloud_sql_v1beta4_MaintenanceWindow_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_MaintenanceWindow_descriptor, + new java.lang.String[] { + "Hour", "Day", "UpdateTrack", "Kind", + }); + internal_static_google_cloud_sql_v1beta4_DenyMaintenancePeriod_descriptor = + getDescriptor().getMessageType(61); + internal_static_google_cloud_sql_v1beta4_DenyMaintenancePeriod_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DenyMaintenancePeriod_descriptor, + new java.lang.String[] { + "StartDate", "EndDate", "Time", + }); + internal_static_google_cloud_sql_v1beta4_InsightsConfig_descriptor = + getDescriptor().getMessageType(62); + internal_static_google_cloud_sql_v1beta4_InsightsConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InsightsConfig_descriptor, + new java.lang.String[] { + "QueryInsightsEnabled", + "RecordClientAddress", + "RecordApplicationTags", + "QueryStringLength", + "QueryPlansPerMinute", + "EnhancedQueryInsightsEnabled", + }); + internal_static_google_cloud_sql_v1beta4_MySqlReplicaConfiguration_descriptor = + getDescriptor().getMessageType(63); + internal_static_google_cloud_sql_v1beta4_MySqlReplicaConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_MySqlReplicaConfiguration_descriptor, + new java.lang.String[] { + "DumpFilePath", + "Username", + "Password", + "ConnectRetryInterval", + "MasterHeartbeatPeriod", + "CaCertificate", + "ClientCertificate", + "ClientKey", + "SslCipher", + "VerifyServerCertificate", + "Kind", + }); + internal_static_google_cloud_sql_v1beta4_SelectedObjects_descriptor = + getDescriptor().getMessageType(64); + internal_static_google_cloud_sql_v1beta4_SelectedObjects_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SelectedObjects_descriptor, + new java.lang.String[] { + "Database", + }); + internal_static_google_cloud_sql_v1beta4_OnPremisesConfiguration_descriptor = + getDescriptor().getMessageType(65); + internal_static_google_cloud_sql_v1beta4_OnPremisesConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_OnPremisesConfiguration_descriptor, + new java.lang.String[] { + "HostPort", + "Kind", + "Username", + "Password", + "CaCertificate", + "ClientCertificate", + "ClientKey", + "DumpFilePath", + "SourceInstance", + "SelectedObjects", + "SslOption", + }); + internal_static_google_cloud_sql_v1beta4_DiskEncryptionConfiguration_descriptor = + getDescriptor().getMessageType(66); + internal_static_google_cloud_sql_v1beta4_DiskEncryptionConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DiskEncryptionConfiguration_descriptor, + new java.lang.String[] { + "KmsKeyName", "Kind", + }); + internal_static_google_cloud_sql_v1beta4_DiskEncryptionStatus_descriptor = + getDescriptor().getMessageType(67); + internal_static_google_cloud_sql_v1beta4_DiskEncryptionStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DiskEncryptionStatus_descriptor, + new java.lang.String[] { + "KmsKeyVersionName", "Kind", + }); + internal_static_google_cloud_sql_v1beta4_SqlSubOperationType_descriptor = + getDescriptor().getMessageType(68); + internal_static_google_cloud_sql_v1beta4_SqlSubOperationType_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlSubOperationType_descriptor, + new java.lang.String[] { + "MaintenanceType", "SubOperationDetails", + }); + internal_static_google_cloud_sql_v1beta4_Operation_descriptor = + getDescriptor().getMessageType(69); + internal_static_google_cloud_sql_v1beta4_Operation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_Operation_descriptor, + new java.lang.String[] { + "Kind", + "TargetLink", + "Status", + "User", + "InsertTime", + "StartTime", + "EndTime", + "Error", + "ApiWarning", + "OperationType", + "ImportContext", + "ExportContext", + "BackupContext", + "PreCheckMajorVersionUpgradeContext", + "Name", + "TargetId", + "SelfLink", + "TargetProject", + "AcquireSsrsLeaseContext", + "SubOperationType", + }); + internal_static_google_cloud_sql_v1beta4_OperationError_descriptor = + getDescriptor().getMessageType(70); + internal_static_google_cloud_sql_v1beta4_OperationError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_OperationError_descriptor, + new java.lang.String[] { + "Kind", "Code", "Message", + }); + internal_static_google_cloud_sql_v1beta4_OperationErrors_descriptor = + getDescriptor().getMessageType(71); + internal_static_google_cloud_sql_v1beta4_OperationErrors_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_OperationErrors_descriptor, + new java.lang.String[] { + "Kind", "Errors", + }); + internal_static_google_cloud_sql_v1beta4_PasswordValidationPolicy_descriptor = + getDescriptor().getMessageType(72); + internal_static_google_cloud_sql_v1beta4_PasswordValidationPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_PasswordValidationPolicy_descriptor, + new java.lang.String[] { + "MinLength", + "Complexity", + "ReuseInterval", + "DisallowUsernameSubstring", + "PasswordChangeInterval", + "EnablePasswordPolicy", + "DisallowCompromisedCredentials", + }); + internal_static_google_cloud_sql_v1beta4_OperationsListResponse_descriptor = + getDescriptor().getMessageType(73); + internal_static_google_cloud_sql_v1beta4_OperationsListResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_OperationsListResponse_descriptor, + new java.lang.String[] { + "Kind", "Items", "NextPageToken", + }); + internal_static_google_cloud_sql_v1beta4_ReplicaConfiguration_descriptor = + getDescriptor().getMessageType(74); + internal_static_google_cloud_sql_v1beta4_ReplicaConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ReplicaConfiguration_descriptor, + new java.lang.String[] { + "Kind", "MysqlReplicaConfiguration", "FailoverTarget", "CascadableReplica", + }); + internal_static_google_cloud_sql_v1beta4_RestoreBackupContext_descriptor = + getDescriptor().getMessageType(75); + internal_static_google_cloud_sql_v1beta4_RestoreBackupContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_RestoreBackupContext_descriptor, + new java.lang.String[] { + "Kind", "BackupRunId", "InstanceId", "Project", + }); + internal_static_google_cloud_sql_v1beta4_RotateServerCaContext_descriptor = + getDescriptor().getMessageType(76); + internal_static_google_cloud_sql_v1beta4_RotateServerCaContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_RotateServerCaContext_descriptor, + new java.lang.String[] { + "Kind", "NextVersion", + }); + internal_static_google_cloud_sql_v1beta4_RotateServerCertificateContext_descriptor = + getDescriptor().getMessageType(77); + internal_static_google_cloud_sql_v1beta4_RotateServerCertificateContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_RotateServerCertificateContext_descriptor, + new java.lang.String[] { + "Kind", "NextVersion", + }); + internal_static_google_cloud_sql_v1beta4_RotateEntraIdCertificateContext_descriptor = + getDescriptor().getMessageType(78); + internal_static_google_cloud_sql_v1beta4_RotateEntraIdCertificateContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_RotateEntraIdCertificateContext_descriptor, + new java.lang.String[] { + "Kind", "NextVersion", + }); + internal_static_google_cloud_sql_v1beta4_DataCacheConfig_descriptor = + getDescriptor().getMessageType(79); + internal_static_google_cloud_sql_v1beta4_DataCacheConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DataCacheConfig_descriptor, + new java.lang.String[] { + "DataCacheEnabled", + }); + internal_static_google_cloud_sql_v1beta4_FinalBackupConfig_descriptor = + getDescriptor().getMessageType(80); + internal_static_google_cloud_sql_v1beta4_FinalBackupConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_FinalBackupConfig_descriptor, + new java.lang.String[] { + "Enabled", "RetentionDays", + }); + internal_static_google_cloud_sql_v1beta4_Settings_descriptor = + getDescriptor().getMessageType(81); + internal_static_google_cloud_sql_v1beta4_Settings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_Settings_descriptor, + new java.lang.String[] { + "SettingsVersion", + "AuthorizedGaeApplications", + "Tier", + "Kind", + "UserLabels", + "AvailabilityType", + "PricingPlan", + "ReplicationType", + "StorageAutoResizeLimit", + "ActivationPolicy", + "IpConfiguration", + "StorageAutoResize", + "LocationPreference", + "DatabaseFlags", + "DataDiskType", + "MaintenanceWindow", + "BackupConfiguration", + "DatabaseReplicationEnabled", + "CrashSafeReplicationEnabled", + "DataDiskSizeGb", + "ActiveDirectoryConfig", + "Collation", + "DenyMaintenancePeriods", + "InsightsConfig", + "PasswordValidationPolicy", + "SqlServerAuditConfig", + "Edition", + "ConnectorEnforcement", + "DeletionProtectionEnabled", + "TimeZone", + "AdvancedMachineFeatures", + "DataCacheConfig", + "ReplicationLagMaxSeconds", + "EnableGoogleMlIntegration", + "EnableDataplexIntegration", + "RetainBackupsOnDelete", + "DataDiskProvisionedIops", + "DataDiskProvisionedThroughput", + "ConnectionPoolConfig", + "FinalBackupConfig", + "ReadPoolAutoScaleConfig", + "AcceleratedReplicaMode", + "AutoUpgradeEnabled", + "EntraidConfig", + "DataApiAccess", + "PerformanceCaptureConfig", + }); + internal_static_google_cloud_sql_v1beta4_Settings_UserLabelsEntry_descriptor = + internal_static_google_cloud_sql_v1beta4_Settings_descriptor.getNestedType(0); + internal_static_google_cloud_sql_v1beta4_Settings_UserLabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_Settings_UserLabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_sql_v1beta4_PerformanceCaptureConfig_descriptor = + getDescriptor().getMessageType(82); + internal_static_google_cloud_sql_v1beta4_PerformanceCaptureConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_PerformanceCaptureConfig_descriptor, + new java.lang.String[] { + "Enabled", + "ProbingIntervalSeconds", + "ProbeThreshold", + "RunningThreadsThreshold", + "SecondsBehindSourceThreshold", + "TransactionDurationThreshold", + "CpuUtilizationThresholdPercent", + "MemoryUsageThresholdPercent", + "TransactionLockWaitThresholdCount", + "SemaphoreWaitThresholdCount", + "HistoryListLengthThresholdCount", + "TransactionKillThresholdSeconds", + "TransactionKillExcludedUserHosts", + "TransactionKillType", + }); + internal_static_google_cloud_sql_v1beta4_AdvancedMachineFeatures_descriptor = + getDescriptor().getMessageType(83); + internal_static_google_cloud_sql_v1beta4_AdvancedMachineFeatures_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_AdvancedMachineFeatures_descriptor, + new java.lang.String[] { + "ThreadsPerCore", + }); + internal_static_google_cloud_sql_v1beta4_SslCert_descriptor = + getDescriptor().getMessageType(84); + internal_static_google_cloud_sql_v1beta4_SslCert_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SslCert_descriptor, + new java.lang.String[] { + "Kind", + "CertSerialNumber", + "Cert", + "CreateTime", + "CommonName", + "ExpirationTime", + "Sha1Fingerprint", + "Instance", + "SelfLink", + }); + internal_static_google_cloud_sql_v1beta4_SslCertDetail_descriptor = + getDescriptor().getMessageType(85); + internal_static_google_cloud_sql_v1beta4_SslCertDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SslCertDetail_descriptor, + new java.lang.String[] { + "CertInfo", "CertPrivateKey", + }); + internal_static_google_cloud_sql_v1beta4_SslCertsCreateEphemeralRequest_descriptor = + getDescriptor().getMessageType(86); + internal_static_google_cloud_sql_v1beta4_SslCertsCreateEphemeralRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SslCertsCreateEphemeralRequest_descriptor, + new java.lang.String[] { + "PublicKey", "AccessToken", + }); + internal_static_google_cloud_sql_v1beta4_SslCertsInsertRequest_descriptor = + getDescriptor().getMessageType(87); + internal_static_google_cloud_sql_v1beta4_SslCertsInsertRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SslCertsInsertRequest_descriptor, + new java.lang.String[] { + "CommonName", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_descriptor = + getDescriptor().getMessageType(88); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_descriptor, + new java.lang.String[] { + "Reschedule", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_descriptor = + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_descriptor + .getNestedType(0); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_descriptor, + new java.lang.String[] { + "RescheduleType", "ScheduleTime", + }); + internal_static_google_cloud_sql_v1beta4_SslCertsInsertResponse_descriptor = + getDescriptor().getMessageType(89); + internal_static_google_cloud_sql_v1beta4_SslCertsInsertResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SslCertsInsertResponse_descriptor, + new java.lang.String[] { + "Kind", "Operation", "ServerCaCert", "ClientCert", + }); + internal_static_google_cloud_sql_v1beta4_SslCertsListResponse_descriptor = + getDescriptor().getMessageType(90); + internal_static_google_cloud_sql_v1beta4_SslCertsListResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SslCertsListResponse_descriptor, + new java.lang.String[] { + "Kind", "Items", + }); + internal_static_google_cloud_sql_v1beta4_TruncateLogContext_descriptor = + getDescriptor().getMessageType(91); + internal_static_google_cloud_sql_v1beta4_TruncateLogContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_TruncateLogContext_descriptor, + new java.lang.String[] { + "Kind", "LogType", + }); + internal_static_google_cloud_sql_v1beta4_SqlActiveDirectoryConfig_descriptor = + getDescriptor().getMessageType(92); + internal_static_google_cloud_sql_v1beta4_SqlActiveDirectoryConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlActiveDirectoryConfig_descriptor, + new java.lang.String[] { + "Kind", + "Domain", + "Mode", + "DnsServers", + "AdminCredentialSecretName", + "OrganizationalUnit", + }); + internal_static_google_cloud_sql_v1beta4_SqlServerAuditConfig_descriptor = + getDescriptor().getMessageType(93); + internal_static_google_cloud_sql_v1beta4_SqlServerAuditConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlServerAuditConfig_descriptor, + new java.lang.String[] { + "Kind", "Bucket", "RetentionInterval", "UploadInterval", + }); + internal_static_google_cloud_sql_v1beta4_SqlServerEntraIdConfig_descriptor = + getDescriptor().getMessageType(94); + internal_static_google_cloud_sql_v1beta4_SqlServerEntraIdConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlServerEntraIdConfig_descriptor, + new java.lang.String[] { + "Kind", "TenantId", "ApplicationId", + }); + internal_static_google_cloud_sql_v1beta4_ConnectionPoolFlags_descriptor = + getDescriptor().getMessageType(95); + internal_static_google_cloud_sql_v1beta4_ConnectionPoolFlags_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ConnectionPoolFlags_descriptor, + new java.lang.String[] { + "Name", "Value", + }); + internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_descriptor = + getDescriptor().getMessageType(96); + internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_descriptor, + new java.lang.String[] { + "Enabled", + "MinNodeCount", + "MaxNodeCount", + "TargetMetrics", + "DisableScaleIn", + "ScaleInCooldownSeconds", + "ScaleOutCooldownSeconds", + }); + internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_TargetMetric_descriptor = + internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_descriptor.getNestedType( + 0); + internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_TargetMetric_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_TargetMetric_descriptor, + new java.lang.String[] { + "Metric", "TargetValue", + }); + internal_static_google_cloud_sql_v1beta4_ConnectionPoolConfig_descriptor = + getDescriptor().getMessageType(97); + internal_static_google_cloud_sql_v1beta4_ConnectionPoolConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ConnectionPoolConfig_descriptor, + new java.lang.String[] { + "ConnectionPoolingEnabled", "Flags", "PoolerCount", + }); + internal_static_google_cloud_sql_v1beta4_AcquireSsrsLeaseContext_descriptor = + getDescriptor().getMessageType(98); + internal_static_google_cloud_sql_v1beta4_AcquireSsrsLeaseContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_AcquireSsrsLeaseContext_descriptor, + new java.lang.String[] { + "SetupLogin", "ServiceLogin", "ReportDatabase", "Duration", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.FieldInfoProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + com.google.type.IntervalProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.FieldInfoProto.fieldInfo); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlServiceProto.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlServiceProto.java new file mode 100644 index 000000000000..542e5279ea5b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlServiceProto.java @@ -0,0 +1,1805 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public final class CloudSqlServiceProto extends com.google.protobuf.GeneratedFile { + private CloudSqlServiceProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlServiceProto"); + } + + 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_sql_v1beta4_CreateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_CreateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_GetBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_GetBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ListBackupsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ListBackupsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ListBackupsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ListBackupsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_UpdateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_UpdateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_DeleteBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_DeleteBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsDeleteRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsDeleteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsGetRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsGetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsInsertRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsInsertRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsListRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsListRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlDatabasesDeleteRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlDatabasesDeleteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlDatabasesGetRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlDatabasesGetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlDatabasesInsertRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlDatabasesInsertRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlDatabasesListRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlDatabasesListRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlDatabasesUpdateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlDatabasesUpdateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlFlagsListRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlFlagsListRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCaRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCertificateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCertificateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddEntraIdCertificateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddEntraIdCertificateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesCloneRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesCloneRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesDeleteRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesDeleteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteMasterRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteMasterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesExportRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesExportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesFailoverRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesFailoverRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesImportRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesImportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesInsertRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesInsertRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesListRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesListRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCasRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCasRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCertificatesRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCertificatesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesListEntraIdCertificatesRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesListEntraIdCertificatesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesPatchRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesPatchRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesPromoteReplicaRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesPromoteReplicaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesSwitchoverRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesSwitchoverRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesResetSslConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesResetSslConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesRestartRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesRestartRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesRestoreBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesRestoreBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCaRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCertificateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCertificateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateEntraIdCertificateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateEntraIdCertificateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesStartReplicaRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesStartReplicaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesStopReplicaRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesStopReplicaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesTruncateLogRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesTruncateLogRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesUpdateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesUpdateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesReencryptRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesReencryptRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_InstancesReencryptRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_InstancesReencryptRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_BackupReencryptionConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_BackupReencryptionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesPerformDiskShrinkRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesPerformDiskShrinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ExternalSyncSelectedObject_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ExternalSyncSelectedObject_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesStartExternalSyncRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesStartExternalSyncRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesResetReplicaSizeRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesResetReplicaSizeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlOperationsGetRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlOperationsGetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlOperationsListRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlOperationsListRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlOperationsCancelRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlOperationsCancelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesCreateEphemeralCertRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesCreateEphemeralCertRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlSslCertsDeleteRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlSslCertsDeleteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlSslCertsGetRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlSslCertsGetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlSslCertsInsertRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlSslCertsInsertRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlSslCertsListRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlSslCertsListRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_ExecuteSqlPayload_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_ExecuteSqlPayload_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_Message_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_Message_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_QueryResult_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_QueryResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_Column_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_Column_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_Row_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_Row_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_Value_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_Value_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_Metadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_Metadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesPreCheckMajorVersionUpgradeRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesPreCheckMajorVersionUpgradeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlInstancesPointInTimeRestoreRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlInstancesPointInTimeRestoreRequest_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/sql/v1beta4/cloud_sql.pro" + + "to\022\030google.cloud.sql.v1beta4\032\034google/api" + + "/annotations.proto\032\027google/api/client.pr" + + "oto\032\037google/api/field_behavior.proto\032\031go" + + "ogle/api/resource.proto\0322google/cloud/sq" + + "l/v1beta4/cloud_sql_resources.proto\032\036goo" + + "gle/protobuf/duration.proto\032\033google/protobuf/empty.proto\032" + + " google/protobuf/field_" + + "mask.proto\032\037google/protobuf/timestamp.proto\032\027google/rpc/status.proto\"\204\001\n" + + "\023CreateBackupRequest\0226\n" + + "\006parent\030\001 \001(\tB&\340A\002\372A" + + " \022\036sqladmin.googleapis.com/Backup\0225\n" + + "\006backup\030\002 \001(\0132 .google.cloud.sql.v1beta4.BackupB\003\340A\002\"H\n" + + "\020GetBackupRequest\0224\n" + + "\004name\030\001 \001(\tB&\340A\002\372A \n" + + "\036sqladmin.googleapis.com/Backup\"\203\001\n" + + "\022ListBackupsRequest\0226\n" + + "\006parent\030\001 \001(\tB&\340A\002\372A" + + " \022\036sqladmin.googleapis.com/Backup\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\022\016\n" + + "\006filter\030\004 \001(\t\"\231\001\n" + + "\023ListBackupsResponse\0221\n" + + "\007backups\030\001 \003(\0132 .google.cloud.sql.v1beta4.Backup\022\027\n" + + "\017next_page_token\030\002 \001(\t\0226\n" + + "\010warnings\030\003 \003(\0132$.google.cloud.sql.v1beta4.ApiWarning\"}\n" + + "\023UpdateBackupRequest\0225\n" + + "\006backup\030\001 \001(\0132 .google.cloud.sql.v1beta4.BackupB\003\340A\002\022/\n" + + "\013update_mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"K\n" + + "\023DeleteBackupRequest\0224\n" + + "\004name\030\001 \001(\tB&\340A\002\372A \n" + + "\036sqladmin.googleapis.com/Backup\"K\n" + + "\032SqlBackupRunsDeleteRequest\022\n\n" + + "\002id\030\001 \001(\003\022\020\n" + + "\010instance\030\002 \001(\t\022\017\n" + + "\007project\030\003 \001(\t\"H\n" + + "\027SqlBackupRunsGetRequest\022\n\n" + + "\002id\030\001 \001(\003\022\020\n" + + "\010instance\030\002 \001(\t\022\017\n" + + "\007project\030\003 \001(\t\"r\n" + + "\032SqlBackupRunsInsertRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\0221\n" + + "\004body\030d \001(\0132#.google.cloud.sql.v1beta4.BackupRun\"f\n" + + "\030SqlBackupRunsListRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\023\n" + + "\013max_results\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\022\017\n" + + "\007project\030\004 \001(\t\"P\n" + + "\031SqlDatabasesDeleteRequest\022\020\n" + + "\010database\030\001 \001(\t\022\020\n" + + "\010instance\030\002 \001(\t\022\017\n" + + "\007project\030\003 \001(\t\"M\n" + + "\026SqlDatabasesGetRequest\022\020\n" + + "\010database\030\001 \001(\t\022\020\n" + + "\010instance\030\002 \001(\t\022\017\n" + + "\007project\030\003 \001(\t\"p\n" + + "\031SqlDatabasesInsertRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\0220\n" + + "\004body\030d \001(\0132\".google.cloud.sql.v1beta4.Database\"<\n" + + "\027SqlDatabasesListRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"\202\001\n" + + "\031SqlDatabasesUpdateRequest\022\020\n" + + "\010database\030\001 \001(\t\022\020\n" + + "\010instance\030\002 \001(\t\022\017\n" + + "\007project\030\003 \001(\t\0220\n" + + "\004body\030d \001(\0132\".google.cloud.sql.v1beta4.Database\"\204\001\n" + + "\023SqlFlagsListRequest\022\030\n" + + "\020database_version\030\001 \001(\t\022D\n\n" + + "flag_scope\030\003 \001" + + "(\0162&.google.cloud.sql.v1beta4.SqlFlagScopeB\003\340A\001H\000\210\001\001B\r\n" + + "\013_flag_scope\"C\n" + + "\036SqlInstancesAddServerCaRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"V\n" + + "\'SqlInstancesAddServerCertificateRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\"W\n" + + "(SqlInstancesAddEntraIdCertificateRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\"|\n" + + "\030SqlInstancesCloneRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022=\n" + + "\004body\030d \001(\0132/.google.cloud.sql.v1beta4.InstancesCloneRequest\"\230\002\n" + + "\031SqlInstancesDeleteRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022 \n" + + "\023enable_final_backup\030\007 \001(\010H\001\210\001\001\022$\n" + + "\025final_backup_ttl_days\030\004 \001(\003B\003\340A\001H\000\022C\n" + + "\030final_backup_expiry_time\030\006" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\001H\000\022%\n" + + "\030final_backup_description\030\005 \001(\tB\003\340A\001B\014\n\n" + + "expirationB\026\n" + + "\024_enable_final_backup\"\212\001\n" + + "\037SqlInstancesDemoteMasterRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022D\n" + + "\004body\030d" + + " \001(\01326.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest\"\210\001\n" + + "\031SqlInstancesDemoteRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\022>\n" + + "\004body\030d \001(\01320.google.cloud.sql.v1beta4.InstancesDemoteRequest\"~\n" + + "\031SqlInstancesExportRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022>\n" + + "\004body\030d \001(\01320.google.cloud.sql.v1beta4.InstancesExportRequest\"\202\001\n" + + "\033SqlInstancesFailoverRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022@\n" + + "\004body\030d \001(\01322.google.cloud.sql.v1beta4.InstancesFailoverRequest\";\n" + + "\026SqlInstancesGetRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"~\n" + + "\031SqlInstancesImportRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022>\n" + + "\004body\030d \001(\01320.google.cloud.sql.v1beta4.InstancesImportRequest\"f\n" + + "\031SqlInstancesInsertRequest\022\017\n" + + "\007project\030\001 \001(\t\0228\n" + + "\004body\030d \001(\0132*.google.cloud.sql.v1beta4.DatabaseInstance\"c\n" + + "\027SqlInstancesListRequest\022\016\n" + + "\006filter\030\001 \001(\t\022\023\n" + + "\013max_results\030\002 \001(\r" + + "\022\022\n\n" + + "page_token\030\003 \001(\t\022\017\n" + + "\007project\030\004 \001(\t\"E\n" + + " SqlInstancesListServerCasRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"X\n" + + ")SqlInstancesListServerCertificatesRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\"Y\n" + + "*SqlInstancesListEntraIdCertificatesRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\"\225\002\n" + + "\030SqlInstancesPatchRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022*\n" + + "\030reconcile_psc_networking\030\004 \001(\010B\003\340A\001H\000\210\001\001\0220\n" + + "\036reconcile_psc_networking_force\030\005" + + " \001(\010B\003\340A\001H\001\210\001\001\0228\n" + + "\004body\030d \001(\0132*.google.cloud.sql.v1beta4.DatabaseInstanceB\033\n" + + "\031_reconcile_psc_networkingB!\n" + + "\037_reconcile_psc_networking_force\"X\n" + + "!SqlInstancesPromoteReplicaRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022\020\n" + + "\010failover\030\003 \001(\010\"v\n" + + "\035SqlInstancesSwitchoverRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\0222\n\n" + + "db_timeout\030\003 \001(\0132\031.google.protobuf.DurationB\003\340A\001\"\363\001\n" + + "!SqlInstancesResetSslConfigRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022[\n" + + "\004mode\030\003 \001(\0162H.google.cloud.sql.v1beta4.SqlIns" + + "tancesResetSslConfigRequest.ResetSslModeB\003\340A\001\"N\n" + + "\014ResetSslMode\022\036\n" + + "\032RESET_SSL_MODE_UNSPECIFIED\020\000\022\007\n" + + "\003ALL\020\001\022\025\n" + + "\021SYNC_FROM_PRIMARY\020\002\"?\n" + + "\032SqlInstancesRestartRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"\214\001\n" + + " SqlInstancesRestoreBackupRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022E\n" + + "\004body\030d \001(\01327.g" + + "oogle.cloud.sql.v1beta4.InstancesRestoreBackupRequest\"\216\001\n" + + "!SqlInstancesRotateServerCaRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022F\n" + + "\004body\030d \001(\01328.google.cloud.sql." + + "v1beta4.InstancesRotateServerCaRequest\"\257\001\n" + + "*SqlInstancesRotateServerCertificateRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\022T\n" + + "\004body\030d \001(\0132A.google.cloud." + + "sql.v1beta4.InstancesRotateServerCertificateRequestB\003\340A\002\"\261\001\n" + + "+SqlInstancesRotateEntraIdCertificateRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\022U\n" + + "\004body\030d " + + "\001(\0132B.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequestB\003\340A\002\"D\n" + + "\037SqlInstancesStartReplicaRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"C\n" + + "\036SqlInstancesStopReplicaRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"\210\001\n" + + "\036SqlInstancesTruncateLogRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022C\n" + + "\004body\030d \001(\01325.google.cloud.sql.v1beta4.InstancesTruncateLogRequest\"x\n" + + "\031SqlInstancesUpdateRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\0228\n" + + "\004body\030d \001(\0132*.google.cloud.sql.v1beta4.DatabaseInstance\"\204\001\n" + + "\034SqlInstancesReencryptRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022A\n" + + "\004body\030\003 \001(\01323" + + ".google.cloud.sql.v1beta4.InstancesReencryptRequest\"\227\001\n" + + "\031InstancesReencryptRequest\022[\n" + + "\032backup_reencryption_config\030\001 \001(\01322." + + "google.cloud.sql.v1beta4.BackupReencryptionConfigH\000\210\001\001B\035\n" + + "\033_backup_reencryption_config\"\370\001\n" + + "\030BackupReencryptionConfig\022\031\n" + + "\014backup_limit\030\001 \001(\005H\000\210\001\001\022W\n" + + "\013backup_type\030\002 \001" + + "(\0162=.google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupTypeH\001\210\001\001\"G\n\n" + + "BackupType\022\033\n" + + "\027BACKUP_TYPE_UNSPECIFIED\020\000\022\r\n" + + "\tAUTOMATED\020\001\022\r\n" + + "\tON_DEMAND\020\002B\017\n\r" + + "_backup_limitB\016\n" + + "\014_backup_type\"\243\001\n" + + "(SqlInstancesRescheduleMaintenanceRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022T\n" + + "\004body\030d \001(\0132F.google." + + "cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody\"\213\001\n" + + "$SqlInstancesPerformDiskShrinkRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022@\n" + + "\004body\030d \001(\01322.google.cloud.sql.v1beta4.PerformDiskShrinkContext\".\n" + + "\032ExternalSyncSelectedObject\022\020\n" + + "\010database\030\001 \001(\t\"\236\006\n" + + "-SqlInstancesVerifyExternalSyncSettingsRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022\036\n" + + "\026verify_connection_only\030\003 \001(\010\022k\n" + + "\tsync_mode\030\004 \001(\0162X.google.cloud.sql.v1beta4.SqlInstancesVerifyExtern" + + "alSyncSettingsRequest.ExternalSyncMode\022$\n" + + "\027verify_replication_only\030\005 \001(\010B\003\340A\001\022K\n" + + "\021mysql_sync_config\030\006" + + " \001(\0132).google.cloud.sql.v1beta4.MySqlSyncConfigB\003\340A\001H\000\022r\n" + + "\016migration_type\030\007 \001(\0162U.google.cloud.sql.v1b" + + "eta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationTypeB\003\340A\001\022U\n" + + "\023sync_parallel_level\030\010" + + " \001(\01623.google.cloud.sql.v1beta4.ExternalSyncParallelLevelB\003\340A\001\022S\n" + + "\020selected_objects\030\t \003(\01324.google.cloud.sq" + + "l.v1beta4.ExternalSyncSelectedObjectB\003\340A\001\"O\n" + + "\020ExternalSyncMode\022\"\n" + + "\036EXTERNAL_SYNC_MODE_UNSPECIFIED\020\000\022\n\n" + + "\006ONLINE\020\001\022\013\n" + + "\007OFFLINE\020\002\"J\n\r" + + "MigrationType\022\036\n" + + "\032MIGRATION_TYPE_UNSPECIFIED\020\000\022\013\n" + + "\007LOGICAL\020\001\022\014\n" + + "\010PHYSICAL\020\002B\r" + + "\n" + + "\013sync_config\"\233\004\n" + + "$SqlInstancesStartExternalSyncRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022k\n" + + "\tsync_mode\030\003 \001(\0162X.google.cloud.sql.v1beta4.SqlInstancesVerifyExtern" + + "alSyncSettingsRequest.ExternalSyncMode\022\031\n" + + "\021skip_verification\030\004 \001(\010\022F\n" + + "\021mysql_sync_config\030\006" + + " \001(\0132).google.cloud.sql.v1beta4.MySqlSyncConfigH\000\022U\n" + + "\023sync_parallel_level\030\007" + + " \001(\01623.google.cloud.sql.v1beta4.ExternalSyncParallelLevelB\003\340A\001\022r\n" + + "\016migration_type\030\010 \001(\0162U.google.cloud.sql.v1beta4.SqlI" + + "nstancesVerifyExternalSyncSettingsRequest.MigrationTypeB\003\340A\001\022&\n" + + "\031replica_overwrite_enabled\030\t \001(\010B\003\340A\001B\r\n" + + "\013sync_config\"H\n" + + "#SqlInstancesResetReplicaSizeRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"=\n" + + "\027SqlOperationsGetRequest\022\021\n" + + "\toperation\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"f\n" + + "\030SqlOperationsListRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\023\n" + + "\013max_results\030\002 \001(\r" + + "\022\022\n\n" + + "page_token\030\003 \001(\t\022\017\n" + + "\007project\030\004 \001(\t\"@\n" + + "\032SqlOperationsCancelRequest\022\021\n" + + "\toperation\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"\223\001\n" + + "&SqlInstancesCreateEphemeralCertRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022F\n" + + "\004body\030d \001(\01328.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest\"W\n" + + "\030SqlSslCertsDeleteRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022\030\n" + + "\020sha1_fingerprint\030\003 \001(\t\"T\n" + + "\025SqlSslCertsGetRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022\030\n" + + "\020sha1_fingerprint\030\003 \001(\t\"|\n" + + "\030SqlSslCertsInsertRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022=\n" + + "\004body\030d \001(\0132/.google.cloud.sql.v1beta4.SslCertsInsertRequest\";\n" + + "\026SqlSslCertsListRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"K\n" + + "&SqlInstancesGetDiskShrinkConfigRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"\267\001\n" + + "(SqlInstancesGetLatestRecoveryTimeRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022F\n" + + "\035source_instance_deletion_time\030\003" + + " \001(\0132\032.google.protobuf.TimestampH\000\210\001\001B \n" + + "\036_source_instance_deletion_time\"\257\001\n" + + ")SqlInstancesGetLatestRecoveryTimeResponse\022\014\n" + + "\004kind\030\001 \001(\t\0228\n" + + "\024latest_recovery_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022:\n" + + "\026earliest_recovery_time\030\003" + + " \001(\0132\032.google.protobuf.Timestamp\"\207\001\n" + + "\035SqlInstancesExecuteSqlRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\0229\n" + + "\004body\030d \001(\0132+.google.cloud.sql.v1beta4.ExecuteSqlPayload\"R\n" + + "#SqlInstancesReleaseSsrsLeaseRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\"<\n" + + "$SqlInstancesReleaseSsrsLeaseResponse\022\024\n" + + "\014operation_id\030\001 \001(\t\"\211\003\n" + + "\021ExecuteSqlPayload\022\021\n" + + "\004user\030\001 \001(\tB\003\340A\001\022\032\n\r" + + "sql_statement\030\002 \001(\tB\003\340A\002\022\025\n" + + "\010database\030\003 \001(\tB\003\340A\001\022\035\n" + + "\016auto_iam_authn\030\013 \001(\010B\003\340A\001H\000\022\026\n" + + "\trow_limit\030\n" + + " \001(\003B\003\340A\001\022_\n" + + "\023partial_result_mode\030\r" + + " \001(\0162=.go" + + "ogle.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultModeB\003\340A\001\022\030\n" + + "\013application\030\020 \001(\tB\003\340A\001\"k\n" + + "\021PartialResultMode\022#\n" + + "\037PARTIAL_RESULT_MODE_UNSPECIFIED\020\000\022\027\n" + + "\023FAIL_PARTIAL_RESULT\020\001\022\030\n" + + "\024ALLOW_PARTIAL_RESULT\020\002B\017\n\r" + + "user_password\"\327\002\n" + + "\036SqlInstancesExecuteSqlResponse\022R\n" + + "\010messages\030\t \003(\0132@.google.cl" + + "oud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message\0224\n" + + "\010metadata\030\006 \001(\0132\".google.cloud.sql.v1beta4.Metadata\0226\n" + + "\007results\030\007 \003(\0132%.google.cloud.sql.v1beta4.QueryResult\022\"\n" + + "\006status\030\010 \001(\0132\022.google.rpc.Status\032O\n" + + "\007Message\022\024\n" + + "\007message\030\001 \001(\tH\000\210\001\001\022\025\n" + + "\010severity\030\002 \001(\tH\001\210\001\001B\n\n" + + "\010_messageB\013\n" + + "\t_severity\"\272\001\n" + + "\013QueryResult\0221\n" + + "\007columns\030\001 \003(\0132 .google.cloud.sql.v1beta4.Column\022+\n" + + "\004rows\030\002 \003(\0132\035.google.cloud.sql.v1beta4.Row\022\017\n" + + "\007message\030\003 \001(\t\022\026\n" + + "\016partial_result\030\004 \001(\010\022\"\n" + + "\006status\030\010 \001(\0132\022.google.rpc.Status\"$\n" + + "\006Column\022\014\n" + + "\004name\030\001 \001(\t\022\014\n" + + "\004type\030\002 \001(\t\"6\n" + + "\003Row\022/\n" + + "\006values\030\001 \003(\0132\037.google.cloud.sql.v1beta4.Value\"*\n" + + "\005Value\022\r\n" + + "\005value\030\001 \001(\t\022\022\n\n" + + "null_value\030\002 \001(\010\"K\n" + + "\010Metadata\022?\n" + + "\034sql_statement_execution_time\030\001" + + " \001(\0132\031.google.protobuf.Duration\"\234\001\n" + + "#SqlInstancesAcquireSsrsLeaseRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\022H\n" + + "\004body\030d \001(\0132:.google.cloud." + + "sql.v1beta4.InstancesAcquireSsrsLeaseRequest\"\267\001\n" + + ".SqlInstancesPreCheckMajorVersionUpgradeRequest\022\025\n" + + "\010instance\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007project\030\002 \001(\tB\003\340A\002\022X\n" + + "\004body\030\003 \001(\0132E.goo" + + "gle.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequestB\003\340A\002\"R\n" + + "$SqlInstancesAcquireSsrsLeaseResponse\022\031\n" + + "\014operation_id\030\001 \001(\tH\000\210\001\001B\017\n\r" + + "_operation_id\"\207\001\n" + + "%SqlInstancesPointInTimeRestoreRequest\022\023\n" + + "\006parent\030\001 \001(\tB\003\340A\002\022I\n" + + "\007context\030d \001(\01323.goo" + + "gle.cloud.sql.v1beta4.PointInTimeRestoreContextB\003\340A\002*h\n" + + "\031ExternalSyncParallelLevel\022,\n" + + "(EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED\020\000\022\007\n" + + "\003MIN\020\001\022\013\n" + + "\007OPTIMAL\020\002\022\007\n" + + "\003MAX\020\0032\343\006\n" + + "\024SqlBackupRunsService\022\261\001\n" + + "\006Delete\0224.google.cloud.sql.v1beta4.SqlBackupRunsDelet" + + "eRequest\032#.google.cloud.sql.v1beta4.Oper" + + "ation\"L\202\323\344\223\002F*D/sql/v1beta4/projects/{pr" + + "oject}/instances/{instance}/backupRuns/{id}\022\253\001\n" + + "\003Get\0221.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest\032#.google.cloud.sq" + + "l.v1beta4.BackupRun\"L\202\323\344\223\002F\022D/sql/v1beta" + + "4/projects/{project}/instances/{instance}/backupRuns/{id}\022\262\001\n" + + "\006Insert\0224.google.cloud.sql.v1beta4.SqlBackupRunsInsertReque" + + "st\032#.google.cloud.sql.v1beta4.Operation\"" + + "M\202\323\344\223\002G\"?/sql/v1beta4/projects/{project}" + + "/instances/{instance}/backupRuns:\004body\022\265\001\n" + + "\004List\0222.google.cloud.sql.v1beta4.SqlBa" + + "ckupRunsListRequest\0320.google.cloud.sql.v" + + "1beta4.BackupRunsListResponse\"G\202\323\344\223\002A\022?/" + + "sql/v1beta4/projects/{project}/instances" + + "/{instance}/backupRuns\032|\312A\027sqladmin.goog" + + "leapis.com\322A_https://www.googleapis.com/" + + "auth/cloud-platform,https://www.googleapis.com/auth/sqlservice.admin2\337\t\n" + + "\023SqlDatabasesService\022\265\001\n" + + "\006Delete\0223.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest\032#.g" + + "oogle.cloud.sql.v1beta4.Operation\"Q\202\323\344\223\002" + + "K*I/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}\022\256\001\n" + + "\003Get\0220.google.cloud.sql.v1beta4.SqlDatab" + + "asesGetRequest\032\".google.cloud.sql.v1beta" + + "4.Database\"Q\202\323\344\223\002K\022I/sql/v1beta4/project" + + "s/{project}/instances/{instance}/databases/{database}\022\260\001\n" + + "\006Insert\0223.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest\032#." + + "google.cloud.sql.v1beta4.Operation\"L\202\323\344\223" + + "\002F\">/sql/v1beta4/projects/{project}/instances/{instance}/databases:\004body\022\262\001\n" + + "\004List\0221.google.cloud.sql.v1beta4.SqlDatabase" + + "sListRequest\032/.google.cloud.sql.v1beta4." + + "DatabasesListResponse\"F\202\323\344\223\002@\022>/sql/v1be" + + "ta4/projects/{project}/instances/{instance}/databases\022\272\001\n" + + "\005Patch\0223.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest\032#.g" + + "oogle.cloud.sql.v1beta4.Operation\"W\202\323\344\223\002" + + "Q2I/sql/v1beta4/projects/{project}/insta" + + "nces/{instance}/databases/{database}:\004body\022\273\001\n" + + "\006Update\0223.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest\032#.google.clou" + + "d.sql.v1beta4.Operation\"W\202\323\344\223\002Q\032I/sql/v1" + + "beta4/projects/{project}/instances/{inst" + + "ance}/databases/{database}:\004body\032|\312A\027sql" + + "admin.googleapis.com\322A_https://www.googleapis.com/auth/cloud-platform,https://ww" + + "w.googleapis.com/auth/sqlservice.admin2\217\002\n" + + "\017SqlFlagsService\022~\n" + + "\004List\022-.google.cloud.sql.v1beta4.SqlFlagsListRequest\032+.goog" + + "le.cloud.sql.v1beta4.FlagsListResponse\"\032" + + "\202\323\344\223\002\024\022\022/sql/v1beta4/flags\032|\312A\027sqladmin." + + "googleapis.com\322A_https://www.googleapis." + + "com/auth/cloud-platform,https://www.googleapis.com/auth/sqlservice.admin2\312D\n" + + "\023SqlInstancesService\022\266\001\n" + + "\013AddServerCa\0228.google.cloud.sql.v1beta4.SqlInstancesAddServe" + + "rCaRequest\032#.google.cloud.sql.v1beta4.Op" + + "eration\"H\202\323\344\223\002B\"@/sql/v1beta4/projects/{" + + "project}/instances/{instance}/addServerCa\022\321\001\n" + + "\024AddServerCertificate\022A.google.cloud.sql.v1beta4.SqlInstancesAddServerCerti" + + "ficateRequest\032#.google.cloud.sql.v1beta4" + + ".Operation\"Q\202\323\344\223\002K\"I/sql/v1beta4/project" + + "s/{project}/instances/{instance}/addServerCertificate\022\324\001\n" + + "\025AddEntraIdCertificate\022B.google.cloud.sql.v1beta4.SqlInstancesA" + + "ddEntraIdCertificateRequest\032#.google.clo" + + "ud.sql.v1beta4.Operation\"R\202\323\344\223\002L\"J/sql/v" + + "1beta4/projects/{project}/instances/{instance}/addEntraIdCertificate\022\252\001\n" + + "\005Clone\0222.google.cloud.sql.v1beta4.SqlInstancesCl" + + "oneRequest\032#.google.cloud.sql.v1beta4.Op" + + "eration\"H\202\323\344\223\002B\":/sql/v1beta4/projects/{" + + "project}/instances/{instance}/clone:\004body\022\240\001\n" + + "\006Delete\0223.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest\032#.google.cloud" + + ".sql.v1beta4.Operation\"<\202\323\344\223\0026*4/sql/v1b" + + "eta4/projects/{project}/instances/{instance}\022\277\001\n" + + "\014DemoteMaster\0229.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest" + + "\032#.google.cloud.sql.v1beta4.Operation\"O\202" + + "\323\344\223\002I\"A/sql/v1beta4/projects/{project}/i" + + "nstances/{instance}/demoteMaster:\004body\022\255\001\n" + + "\006Demote\0223.google.cloud.sql.v1beta4.Sql" + + "InstancesDemoteRequest\032#.google.cloud.sq" + + "l.v1beta4.Operation\"I\202\323\344\223\002C\";/sql/v1beta" + + "4/projects/{project}/instances/{instance}/demote:\004body\022\255\001\n" + + "\006Export\0223.google.cloud.sql.v1beta4.SqlInstancesExportRequest\032#" + + ".google.cloud.sql.v1beta4.Operation\"I\202\323\344" + + "\223\002C\";/sql/v1beta4/projects/{project}/instances/{instance}/export:\004body\022\263\001\n" + + "\010Failover\0225.google.cloud.sql.v1beta4.SqlInstan" + + "cesFailoverRequest\032#.google.cloud.sql.v1" + + "beta4.Operation\"K\202\323\344\223\002E\"=/sql/v1beta4/pr" + + "ojects/{project}/instances/{instance}/failover:\004body\022\266\001\n" + + "\tReencrypt\0226.google.cloud.sql.v1beta4.SqlInstancesReencryptReque" + + "st\032#.google.cloud.sql.v1beta4.Operation\"" + + "L\202\323\344\223\002F\">/sql/v1beta4/projects/{project}" + + "/instances/{instance}/reencrypt:\004body\022\241\001\n" + + "\003Get\0220.google.cloud.sql.v1beta4.SqlInst" + + "ancesGetRequest\032*.google.cloud.sql.v1bet" + + "a4.DatabaseInstance\"<\202\323\344\223\0026\0224/sql/v1beta" + + "4/projects/{project}/instances/{instance}\022\255\001\n" + + "\006Import\0223.google.cloud.sql.v1beta4.SqlInstancesImportRequest\032#.google.cloud" + + ".sql.v1beta4.Operation\"I\202\323\344\223\002C\";/sql/v1b" + + "eta4/projects/{project}/instances/{instance}/import:\004body\022\233\001\n" + + "\006Insert\0223.google.cl", + "oud.sql.v1beta4.SqlInstancesInsertReques" + + "t\032#.google.cloud.sql.v1beta4.Operation\"7" + + "\202\323\344\223\0021\")/sql/v1beta4/projects/{project}/" + + "instances:\004body\022\235\001\n\004List\0221.google.cloud." + + "sql.v1beta4.SqlInstancesListRequest\032/.go" + + "ogle.cloud.sql.v1beta4.InstancesListResp" + + "onse\"1\202\323\344\223\002+\022)/sql/v1beta4/projects/{pro" + + "ject}/instances\022\321\001\n\rListServerCas\022:.goog" + + "le.cloud.sql.v1beta4.SqlInstancesListSer" + + "verCasRequest\0328.google.cloud.sql.v1beta4" + + ".InstancesListServerCasResponse\"J\202\323\344\223\002D\022" + + "B/sql/v1beta4/projects/{project}/instanc" + + "es/{instance}/listServerCas\022\365\001\n\026ListServ" + + "erCertificates\022C.google.cloud.sql.v1beta" + + "4.SqlInstancesListServerCertificatesRequ" + + "est\032A.google.cloud.sql.v1beta4.Instances" + + "ListServerCertificatesResponse\"S\202\323\344\223\002M\022K" + + "/sql/v1beta4/projects/{project}/instance" + + "s/{instance}/listServerCertificates\022\371\001\n\027" + + "ListEntraIdCertificates\022D.google.cloud.s" + + "ql.v1beta4.SqlInstancesListEntraIdCertif" + + "icatesRequest\032B.google.cloud.sql.v1beta4" + + ".InstancesListEntraIdCertificatesRespons" + + "e\"T\202\323\344\223\002N\022L/sql/v1beta4/projects/{projec" + + "t}/instances/{instance}/listEntraIdCerti" + + "ficates\022\244\001\n\005Patch\0222.google.cloud.sql.v1b" + + "eta4.SqlInstancesPatchRequest\032#.google.c" + + "loud.sql.v1beta4.Operation\"B\202\323\344\223\002<24/sql" + + "/v1beta4/projects/{project}/instances/{i" + + "nstance}:\004body\022\277\001\n\016PromoteReplica\022;.goog" + + "le.cloud.sql.v1beta4.SqlInstancesPromote" + + "ReplicaRequest\032#.google.cloud.sql.v1beta" + + "4.Operation\"K\202\323\344\223\002E\"C/sql/v1beta4/projec" + + "ts/{project}/instances/{instance}/promot" + + "eReplica\022\263\001\n\nSwitchover\0227.google.cloud.s" + + "ql.v1beta4.SqlInstancesSwitchoverRequest" + + "\032#.google.cloud.sql.v1beta4.Operation\"G\202" + + "\323\344\223\002A\"?/sql/v1beta4/projects/{project}/i" + + "nstances/{instance}/switchover\022\277\001\n\016Reset" + + "SslConfig\022;.google.cloud.sql.v1beta4.Sql" + + "InstancesResetSslConfigRequest\032#.google." + + "cloud.sql.v1beta4.Operation\"K\202\323\344\223\002E\"C/sq" + + "l/v1beta4/projects/{project}/instances/{" + + "instance}/resetSslConfig\022\252\001\n\007Restart\0224.g" + + "oogle.cloud.sql.v1beta4.SqlInstancesRest" + + "artRequest\032#.google.cloud.sql.v1beta4.Op" + + "eration\"D\202\323\344\223\002>\".google.cloud.sq" + + "l.v1beta4.SqlInstancesStartExternalSyncR" + + "equest\032#.google.cloud.sql.v1beta4.Operat" + + "ion\"Q\202\323\344\223\002K\"F/sql/v1beta4/projects/{proj" + + "ect}/instances/{instance}/startExternalS" + + "ync:\001*\022\316\001\n\021PerformDiskShrink\022>.google.cl" + + "oud.sql.v1beta4.SqlInstancesPerformDiskS" + + "hrinkRequest\032#.google.cloud.sql.v1beta4." + + "Operation\"T\202\323\344\223\002N\"F/sql/v1beta4/projects" + + "/{project}/instances/{instance}/performD" + + "iskShrink:\004body\022\354\001\n\023GetDiskShrinkConfig\022" + + "@.google.cloud.sql.v1beta4.SqlInstancesG" + + "etDiskShrinkConfigRequest\032A.google.cloud" + + ".sql.v1beta4.SqlInstancesGetDiskShrinkCo" + + "nfigResponse\"P\202\323\344\223\002J\022H/sql/v1beta4/proje" + + "cts/{project}/instances/{instance}/getDi" + + "skShrinkConfig\022\310\001\n\020ResetReplicaSize\022=.go" + + "ogle.cloud.sql.v1beta4.SqlInstancesReset" + + "ReplicaSizeRequest\032#.google.cloud.sql.v1" + + "beta4.Operation\"P\202\323\344\223\002J\"E/sql/v1beta4/pr" + + "ojects/{project}/instances/{instance}/re" + + "setReplicaSize:\001*\022\364\001\n\025GetLatestRecoveryT" + + "ime\022B.google.cloud.sql.v1beta4.SqlInstan" + + "cesGetLatestRecoveryTimeRequest\032C.google" + + ".cloud.sql.v1beta4.SqlInstancesGetLatest" + + "RecoveryTimeResponse\"R\202\323\344\223\002L\022J/sql/v1bet" + + "a4/projects/{project}/instances/{instanc" + + "e}/getLatestRecoveryTime\022\316\001\n\nExecuteSql\022" + + "7.google.cloud.sql.v1beta4.SqlInstancesE" + + "xecuteSqlRequest\0328.google.cloud.sql.v1be" + + "ta4.SqlInstancesExecuteSqlResponse\"M\202\323\344\223" + + "\002G\"?/sql/v1beta4/projects/{project}/inst" + + "ances/{instance}/executeSql:\004body\022\346\001\n\020Ac" + + "quireSsrsLease\022=.google.cloud.sql.v1beta" + + "4.SqlInstancesAcquireSsrsLeaseRequest\032>." + + "google.cloud.sql.v1beta4.SqlInstancesAcq" + + "uireSsrsLeaseResponse\"S\202\323\344\223\002M\"E/sql/v1be" + + "ta4/projects/{project}/instances/{instan" + + "ce}/acquireSsrsLease:\004body\022\340\001\n\020ReleaseSs" + + "rsLease\022=.google.cloud.sql.v1beta4.SqlIn" + + "stancesReleaseSsrsLeaseRequest\032>.google." + + "cloud.sql.v1beta4.SqlInstancesReleaseSsr" + + "sLeaseResponse\"M\202\323\344\223\002G\"E/sql/v1beta4/pro" + + "jects/{project}/instances/{instance}/rel" + + "easeSsrsLease\022\354\001\n\033PreCheckMajorVersionUp" + + "grade\022H.google.cloud.sql.v1beta4.SqlInst" + + "ancesPreCheckMajorVersionUpgradeRequest\032" + + "#.google.cloud.sql.v1beta4.Operation\"^\202\323" + + "\344\223\002X\"P/sql/v1beta4/projects/{project}/in" + + "stances/{instance}/preCheckMajorVersionU" + + "pgrade:\004body\022\300\001\n\022PointInTimeRestore\022?.go" + + "ogle.cloud.sql.v1beta4.SqlInstancesPoint" + + "InTimeRestoreRequest\032#.google.cloud.sql." + + "v1beta4.Operation\"D\202\323\344\223\002>\"3/sql/v1beta4/" + + "{parent=projects/*}:pointInTimeRestore:\007" + + "context\032|\312A\027sqladmin.googleapis.com\322A_ht" + + "tps://www.googleapis.com/auth/cloud-plat" + + "form,https://www.googleapis.com/auth/sql" + + "service.admin2\367\004\n\024SqlOperationsService\022\235" + + "\001\n\003Get\0221.google.cloud.sql.v1beta4.SqlOpe" + + "rationsGetRequest\032#.google.cloud.sql.v1b" + + "eta4.Operation\">\202\323\344\223\0028\0226/sql/v1beta4/pro" + + "jects/{project}/operations/{operation}\022\240" + + "\001\n\004List\0222.google.cloud.sql.v1beta4.SqlOp" + + "erationsListRequest\0320.google.cloud.sql.v" + + "1beta4.OperationsListResponse\"2\202\323\344\223\002,\022*/" + + "sql/v1beta4/projects/{project}/operation" + + "s\022\235\001\n\006Cancel\0224.google.cloud.sql.v1beta4." + + "SqlOperationsCancelRequest\032\026.google.prot" + + "obuf.Empty\"E\202\323\344\223\002?\"=/sql/v1beta4/project" + + "s/{project}/operations/{operation}/cance" + + "l\032|\312A\027sqladmin.googleapis.com\322A_https://" + + "www.googleapis.com/auth/cloud-platform,h" + + "ttps://www.googleapis.com/auth/sqlservic" + + "e.admin2\366\006\n\022SqlSslCertsService\022\273\001\n\006Delet" + + "e\0222.google.cloud.sql.v1beta4.SqlSslCerts" + + "DeleteRequest\032#.google.cloud.sql.v1beta4" + + ".Operation\"X\202\323\344\223\002R*P/sql/v1beta4/project" + + "s/{project}/instances/{instance}/sslCert" + + "s/{sha1_fingerprint}\022\263\001\n\003Get\022/.google.cl" + + "oud.sql.v1beta4.SqlSslCertsGetRequest\032!." + + "google.cloud.sql.v1beta4.SslCert\"X\202\323\344\223\002R" + + "\022P/sql/v1beta4/projects/{project}/instan" + + "ces/{instance}/sslCerts/{sha1_fingerprin" + + "t}\022\273\001\n\006Insert\0222.google.cloud.sql.v1beta4" + + ".SqlSslCertsInsertRequest\0320.google.cloud" + + ".sql.v1beta4.SslCertsInsertResponse\"K\202\323\344" + + "\223\002E\"=/sql/v1beta4/projects/{project}/ins" + + "tances/{instance}/sslCerts:\004body\022\257\001\n\004Lis" + + "t\0220.google.cloud.sql.v1beta4.SqlSslCerts" + + "ListRequest\032..google.cloud.sql.v1beta4.S" + + "slCertsListResponse\"E\202\323\344\223\002?\022=/sql/v1beta" + + "4/projects/{project}/instances/{instance" + + "}/sslCerts\032|\312A\027sqladmin.googleapis.com\322A" + + "_https://www.googleapis.com/auth/cloud-p" + + "latform,https://www.googleapis.com/auth/" + + "sqlservice.admin2\330\007\n\021SqlBackupsService\022\255" + + "\001\n\014CreateBackup\022-.google.cloud.sql.v1bet" + + "a4.CreateBackupRequest\032#.google.cloud.sq" + + "l.v1beta4.Operation\"I\332A\016parent, backup\202\323" + + "\344\223\0022\"(/sql/v1beta4/{parent=projects/*}/b" + + "ackups:\006backup\022\222\001\n\tGetBackup\022*.google.cl" + + "oud.sql.v1beta4.GetBackupRequest\032 .googl" + + "e.cloud.sql.v1beta4.Backup\"7\332A\004name\202\323\344\223\002" + + "*\022(/sql/v1beta4/{name=projects/*/backups" + + "/*}\022\245\001\n\013ListBackups\022,.google.cloud.sql.v" + + "1beta4.ListBackupsRequest\032-.google.cloud" + + ".sql.v1beta4.ListBackupsResponse\"9\332A\006par" + + "ent\202\323\344\223\002*\022(/sql/v1beta4/{parent=projects" + + "/*}/backups\022\271\001\n\014UpdateBackup\022-.google.cl" + + "oud.sql.v1beta4.UpdateBackupRequest\032#.go" + + "ogle.cloud.sql.v1beta4.Operation\"U\332A\023bac" + + "kup, update_mask\202\323\344\223\00292//sql/v1beta4/{ba" + + "ckup.name=projects/*/backups/*}:\006backup\022" + + "\233\001\n\014DeleteBackup\022-.google.cloud.sql.v1be" + + "ta4.DeleteBackupRequest\032#.google.cloud.s" + + "ql.v1beta4.Operation\"7\332A\004name\202\323\344\223\002**(/sq" + + "l/v1beta4/{name=projects/*/backups/*}\032|\312" + + "A\027sqladmin.googleapis.com\322A_https://www." + + "googleapis.com/auth/cloud-platform,https" + + "://www.googleapis.com/auth/sqlservice.ad" + + "minBf\n\034com.google.cloud.sql.v1beta4B\024Clo" + + "udSqlServiceProtoP\001Z.cloud.google.com/go" + + "/sql/apiv1beta4/sqlpb;sqlpbb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_cloud_sql_v1beta4_CreateBackupRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_sql_v1beta4_CreateBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_CreateBackupRequest_descriptor, + new java.lang.String[] { + "Parent", "Backup", + }); + internal_static_google_cloud_sql_v1beta4_GetBackupRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_sql_v1beta4_GetBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_GetBackupRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_sql_v1beta4_ListBackupsRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_sql_v1beta4_ListBackupsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ListBackupsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", + }); + internal_static_google_cloud_sql_v1beta4_ListBackupsResponse_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_sql_v1beta4_ListBackupsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ListBackupsResponse_descriptor, + new java.lang.String[] { + "Backups", "NextPageToken", "Warnings", + }); + internal_static_google_cloud_sql_v1beta4_UpdateBackupRequest_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_cloud_sql_v1beta4_UpdateBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_UpdateBackupRequest_descriptor, + new java.lang.String[] { + "Backup", "UpdateMask", + }); + internal_static_google_cloud_sql_v1beta4_DeleteBackupRequest_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_cloud_sql_v1beta4_DeleteBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_DeleteBackupRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsDeleteRequest_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsDeleteRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsDeleteRequest_descriptor, + new java.lang.String[] { + "Id", "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsGetRequest_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsGetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsGetRequest_descriptor, + new java.lang.String[] { + "Id", "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsInsertRequest_descriptor = + getDescriptor().getMessageType(8); + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsInsertRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsInsertRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsListRequest_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsListRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlBackupRunsListRequest_descriptor, + new java.lang.String[] { + "Instance", "MaxResults", "PageToken", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlDatabasesDeleteRequest_descriptor = + getDescriptor().getMessageType(10); + internal_static_google_cloud_sql_v1beta4_SqlDatabasesDeleteRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlDatabasesDeleteRequest_descriptor, + new java.lang.String[] { + "Database", "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlDatabasesGetRequest_descriptor = + getDescriptor().getMessageType(11); + internal_static_google_cloud_sql_v1beta4_SqlDatabasesGetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlDatabasesGetRequest_descriptor, + new java.lang.String[] { + "Database", "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlDatabasesInsertRequest_descriptor = + getDescriptor().getMessageType(12); + internal_static_google_cloud_sql_v1beta4_SqlDatabasesInsertRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlDatabasesInsertRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlDatabasesListRequest_descriptor = + getDescriptor().getMessageType(13); + internal_static_google_cloud_sql_v1beta4_SqlDatabasesListRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlDatabasesListRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlDatabasesUpdateRequest_descriptor = + getDescriptor().getMessageType(14); + internal_static_google_cloud_sql_v1beta4_SqlDatabasesUpdateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlDatabasesUpdateRequest_descriptor, + new java.lang.String[] { + "Database", "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlFlagsListRequest_descriptor = + getDescriptor().getMessageType(15); + internal_static_google_cloud_sql_v1beta4_SqlFlagsListRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlFlagsListRequest_descriptor, + new java.lang.String[] { + "DatabaseVersion", "FlagScope", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCaRequest_descriptor = + getDescriptor().getMessageType(16); + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCaRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCertificateRequest_descriptor = + getDescriptor().getMessageType(17); + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCertificateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCertificateRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddEntraIdCertificateRequest_descriptor = + getDescriptor().getMessageType(18); + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddEntraIdCertificateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesAddEntraIdCertificateRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesCloneRequest_descriptor = + getDescriptor().getMessageType(19); + internal_static_google_cloud_sql_v1beta4_SqlInstancesCloneRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesCloneRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesDeleteRequest_descriptor = + getDescriptor().getMessageType(20); + internal_static_google_cloud_sql_v1beta4_SqlInstancesDeleteRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesDeleteRequest_descriptor, + new java.lang.String[] { + "Instance", + "Project", + "EnableFinalBackup", + "FinalBackupTtlDays", + "FinalBackupExpiryTime", + "FinalBackupDescription", + "Expiration", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteMasterRequest_descriptor = + getDescriptor().getMessageType(21); + internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteMasterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteMasterRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteRequest_descriptor = + getDescriptor().getMessageType(22); + internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesExportRequest_descriptor = + getDescriptor().getMessageType(23); + internal_static_google_cloud_sql_v1beta4_SqlInstancesExportRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesExportRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesFailoverRequest_descriptor = + getDescriptor().getMessageType(24); + internal_static_google_cloud_sql_v1beta4_SqlInstancesFailoverRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesFailoverRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetRequest_descriptor = + getDescriptor().getMessageType(25); + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesImportRequest_descriptor = + getDescriptor().getMessageType(26); + internal_static_google_cloud_sql_v1beta4_SqlInstancesImportRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesImportRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesInsertRequest_descriptor = + getDescriptor().getMessageType(27); + internal_static_google_cloud_sql_v1beta4_SqlInstancesInsertRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesInsertRequest_descriptor, + new java.lang.String[] { + "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesListRequest_descriptor = + getDescriptor().getMessageType(28); + internal_static_google_cloud_sql_v1beta4_SqlInstancesListRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesListRequest_descriptor, + new java.lang.String[] { + "Filter", "MaxResults", "PageToken", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCasRequest_descriptor = + getDescriptor().getMessageType(29); + internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCasRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCasRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCertificatesRequest_descriptor = + getDescriptor().getMessageType(30); + internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCertificatesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCertificatesRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesListEntraIdCertificatesRequest_descriptor = + getDescriptor().getMessageType(31); + internal_static_google_cloud_sql_v1beta4_SqlInstancesListEntraIdCertificatesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesListEntraIdCertificatesRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesPatchRequest_descriptor = + getDescriptor().getMessageType(32); + internal_static_google_cloud_sql_v1beta4_SqlInstancesPatchRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesPatchRequest_descriptor, + new java.lang.String[] { + "Instance", + "Project", + "ReconcilePscNetworking", + "ReconcilePscNetworkingForce", + "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesPromoteReplicaRequest_descriptor = + getDescriptor().getMessageType(33); + internal_static_google_cloud_sql_v1beta4_SqlInstancesPromoteReplicaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesPromoteReplicaRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Failover", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesSwitchoverRequest_descriptor = + getDescriptor().getMessageType(34); + internal_static_google_cloud_sql_v1beta4_SqlInstancesSwitchoverRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesSwitchoverRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "DbTimeout", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesResetSslConfigRequest_descriptor = + getDescriptor().getMessageType(35); + internal_static_google_cloud_sql_v1beta4_SqlInstancesResetSslConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesResetSslConfigRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Mode", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRestartRequest_descriptor = + getDescriptor().getMessageType(36); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRestartRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesRestartRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRestoreBackupRequest_descriptor = + getDescriptor().getMessageType(37); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRestoreBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesRestoreBackupRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCaRequest_descriptor = + getDescriptor().getMessageType(38); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCaRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCertificateRequest_descriptor = + getDescriptor().getMessageType(39); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCertificateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCertificateRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateEntraIdCertificateRequest_descriptor = + getDescriptor().getMessageType(40); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateEntraIdCertificateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateEntraIdCertificateRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesStartReplicaRequest_descriptor = + getDescriptor().getMessageType(41); + internal_static_google_cloud_sql_v1beta4_SqlInstancesStartReplicaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesStartReplicaRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesStopReplicaRequest_descriptor = + getDescriptor().getMessageType(42); + internal_static_google_cloud_sql_v1beta4_SqlInstancesStopReplicaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesStopReplicaRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesTruncateLogRequest_descriptor = + getDescriptor().getMessageType(43); + internal_static_google_cloud_sql_v1beta4_SqlInstancesTruncateLogRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesTruncateLogRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesUpdateRequest_descriptor = + getDescriptor().getMessageType(44); + internal_static_google_cloud_sql_v1beta4_SqlInstancesUpdateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesUpdateRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesReencryptRequest_descriptor = + getDescriptor().getMessageType(45); + internal_static_google_cloud_sql_v1beta4_SqlInstancesReencryptRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesReencryptRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_InstancesReencryptRequest_descriptor = + getDescriptor().getMessageType(46); + internal_static_google_cloud_sql_v1beta4_InstancesReencryptRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_InstancesReencryptRequest_descriptor, + new java.lang.String[] { + "BackupReencryptionConfig", + }); + internal_static_google_cloud_sql_v1beta4_BackupReencryptionConfig_descriptor = + getDescriptor().getMessageType(47); + internal_static_google_cloud_sql_v1beta4_BackupReencryptionConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_BackupReencryptionConfig_descriptor, + new java.lang.String[] { + "BackupLimit", "BackupType", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequest_descriptor = + getDescriptor().getMessageType(48); + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesPerformDiskShrinkRequest_descriptor = + getDescriptor().getMessageType(49); + internal_static_google_cloud_sql_v1beta4_SqlInstancesPerformDiskShrinkRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesPerformDiskShrinkRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_ExternalSyncSelectedObject_descriptor = + getDescriptor().getMessageType(50); + internal_static_google_cloud_sql_v1beta4_ExternalSyncSelectedObject_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ExternalSyncSelectedObject_descriptor, + new java.lang.String[] { + "Database", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsRequest_descriptor = + getDescriptor().getMessageType(51); + internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsRequest_descriptor, + new java.lang.String[] { + "Instance", + "Project", + "VerifyConnectionOnly", + "SyncMode", + "VerifyReplicationOnly", + "MysqlSyncConfig", + "MigrationType", + "SyncParallelLevel", + "SelectedObjects", + "SyncConfig", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesStartExternalSyncRequest_descriptor = + getDescriptor().getMessageType(52); + internal_static_google_cloud_sql_v1beta4_SqlInstancesStartExternalSyncRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesStartExternalSyncRequest_descriptor, + new java.lang.String[] { + "Instance", + "Project", + "SyncMode", + "SkipVerification", + "MysqlSyncConfig", + "SyncParallelLevel", + "MigrationType", + "ReplicaOverwriteEnabled", + "SyncConfig", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesResetReplicaSizeRequest_descriptor = + getDescriptor().getMessageType(53); + internal_static_google_cloud_sql_v1beta4_SqlInstancesResetReplicaSizeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesResetReplicaSizeRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlOperationsGetRequest_descriptor = + getDescriptor().getMessageType(54); + internal_static_google_cloud_sql_v1beta4_SqlOperationsGetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlOperationsGetRequest_descriptor, + new java.lang.String[] { + "Operation", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlOperationsListRequest_descriptor = + getDescriptor().getMessageType(55); + internal_static_google_cloud_sql_v1beta4_SqlOperationsListRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlOperationsListRequest_descriptor, + new java.lang.String[] { + "Instance", "MaxResults", "PageToken", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlOperationsCancelRequest_descriptor = + getDescriptor().getMessageType(56); + internal_static_google_cloud_sql_v1beta4_SqlOperationsCancelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlOperationsCancelRequest_descriptor, + new java.lang.String[] { + "Operation", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesCreateEphemeralCertRequest_descriptor = + getDescriptor().getMessageType(57); + internal_static_google_cloud_sql_v1beta4_SqlInstancesCreateEphemeralCertRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesCreateEphemeralCertRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlSslCertsDeleteRequest_descriptor = + getDescriptor().getMessageType(58); + internal_static_google_cloud_sql_v1beta4_SqlSslCertsDeleteRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlSslCertsDeleteRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Sha1Fingerprint", + }); + internal_static_google_cloud_sql_v1beta4_SqlSslCertsGetRequest_descriptor = + getDescriptor().getMessageType(59); + internal_static_google_cloud_sql_v1beta4_SqlSslCertsGetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlSslCertsGetRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Sha1Fingerprint", + }); + internal_static_google_cloud_sql_v1beta4_SqlSslCertsInsertRequest_descriptor = + getDescriptor().getMessageType(60); + internal_static_google_cloud_sql_v1beta4_SqlSslCertsInsertRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlSslCertsInsertRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlSslCertsListRequest_descriptor = + getDescriptor().getMessageType(61); + internal_static_google_cloud_sql_v1beta4_SqlSslCertsListRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlSslCertsListRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigRequest_descriptor = + getDescriptor().getMessageType(62); + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeRequest_descriptor = + getDescriptor().getMessageType(63); + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "SourceInstanceDeletionTime", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeResponse_descriptor = + getDescriptor().getMessageType(64); + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeResponse_descriptor, + new java.lang.String[] { + "Kind", "LatestRecoveryTime", "EarliestRecoveryTime", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlRequest_descriptor = + getDescriptor().getMessageType(65); + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseRequest_descriptor = + getDescriptor().getMessageType(66); + internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseResponse_descriptor = + getDescriptor().getMessageType(67); + internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseResponse_descriptor, + new java.lang.String[] { + "OperationId", + }); + internal_static_google_cloud_sql_v1beta4_ExecuteSqlPayload_descriptor = + getDescriptor().getMessageType(68); + internal_static_google_cloud_sql_v1beta4_ExecuteSqlPayload_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_ExecuteSqlPayload_descriptor, + new java.lang.String[] { + "User", + "SqlStatement", + "Database", + "AutoIamAuthn", + "RowLimit", + "PartialResultMode", + "Application", + "UserPassword", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_descriptor = + getDescriptor().getMessageType(69); + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_descriptor, + new java.lang.String[] { + "Messages", "Metadata", "Results", "Status", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_Message_descriptor = + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_descriptor + .getNestedType(0); + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_Message_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_Message_descriptor, + new java.lang.String[] { + "Message", "Severity", + }); + internal_static_google_cloud_sql_v1beta4_QueryResult_descriptor = + getDescriptor().getMessageType(70); + internal_static_google_cloud_sql_v1beta4_QueryResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_QueryResult_descriptor, + new java.lang.String[] { + "Columns", "Rows", "Message", "PartialResult", "Status", + }); + internal_static_google_cloud_sql_v1beta4_Column_descriptor = getDescriptor().getMessageType(71); + internal_static_google_cloud_sql_v1beta4_Column_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_Column_descriptor, + new java.lang.String[] { + "Name", "Type", + }); + internal_static_google_cloud_sql_v1beta4_Row_descriptor = getDescriptor().getMessageType(72); + internal_static_google_cloud_sql_v1beta4_Row_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_Row_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_sql_v1beta4_Value_descriptor = getDescriptor().getMessageType(73); + internal_static_google_cloud_sql_v1beta4_Value_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_Value_descriptor, + new java.lang.String[] { + "Value", "NullValue", + }); + internal_static_google_cloud_sql_v1beta4_Metadata_descriptor = + getDescriptor().getMessageType(74); + internal_static_google_cloud_sql_v1beta4_Metadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_Metadata_descriptor, + new java.lang.String[] { + "SqlStatementExecutionTime", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseRequest_descriptor = + getDescriptor().getMessageType(75); + internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesPreCheckMajorVersionUpgradeRequest_descriptor = + getDescriptor().getMessageType(76); + internal_static_google_cloud_sql_v1beta4_SqlInstancesPreCheckMajorVersionUpgradeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesPreCheckMajorVersionUpgradeRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseResponse_descriptor = + getDescriptor().getMessageType(77); + internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseResponse_descriptor, + new java.lang.String[] { + "OperationId", + }); + internal_static_google_cloud_sql_v1beta4_SqlInstancesPointInTimeRestoreRequest_descriptor = + getDescriptor().getMessageType(78); + internal_static_google_cloud_sql_v1beta4_SqlInstancesPointInTimeRestoreRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlInstancesPointInTimeRestoreRequest_descriptor, + new java.lang.String[] { + "Parent", "Context", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlTiersProto.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlTiersProto.java new file mode 100644 index 000000000000..5bfb1c1198b8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlTiersProto.java @@ -0,0 +1,127 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_tiers.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public final class CloudSqlTiersProto extends com.google.protobuf.GeneratedFile { + private CloudSqlTiersProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlTiersProto"); + } + + 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_sql_v1beta4_SqlTiersListRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlTiersListRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_TiersListResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_TiersListResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_Tier_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_Tier_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/sql/v1beta4/cloud_sql_tie" + + "rs.proto\022\030google.cloud.sql.v1beta4\032\034goog" + + "le/api/annotations.proto\032\027google/api/cli" + + "ent.proto\"&\n\023SqlTiersListRequest\022\017\n\007proj" + + "ect\030\001 \001(\t\"P\n\021TiersListResponse\022\014\n\004kind\030\001" + + " \001(\t\022-\n\005items\030\002 \003(\0132\036.google.cloud.sql.v" + + "1beta4.Tier\"c\n\004Tier\022\014\n\004tier\030\001 \001(\t\022\020\n\003RAM" + + "\030\002 \001(\003R\003RAM\022\014\n\004kind\030\003 \001(\t\022\035\n\nDisk_Quota\030" + + "\004 \001(\003R\tDiskQuota\022\016\n\006region\030\005 \003(\t2\243\002\n\017Sql" + + "TiersService\022\221\001\n\004List\022-.google.cloud.sql" + + ".v1beta4.SqlTiersListRequest\032+.google.cl" + + "oud.sql.v1beta4.TiersListResponse\"-\202\323\344\223\002" + + "\'\022%/sql/v1beta4/projects/{project}/tiers" + + "\032|\312A\027sqladmin.googleapis.com\322A_https://w" + + "ww.googleapis.com/auth/cloud-platform,ht" + + "tps://www.googleapis.com/auth/sqlservice" + + ".adminBd\n\034com.google.cloud.sql.v1beta4B\022" + + "CloudSqlTiersProtoP\001Z.cloud.google.com/g" + + "o/sql/apiv1beta4/sqlpb;sqlpbb\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(), + }); + internal_static_google_cloud_sql_v1beta4_SqlTiersListRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_sql_v1beta4_SqlTiersListRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlTiersListRequest_descriptor, + new java.lang.String[] { + "Project", + }); + internal_static_google_cloud_sql_v1beta4_TiersListResponse_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_sql_v1beta4_TiersListResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_TiersListResponse_descriptor, + new java.lang.String[] { + "Kind", "Items", + }); + internal_static_google_cloud_sql_v1beta4_Tier_descriptor = getDescriptor().getMessageType(2); + internal_static_google_cloud_sql_v1beta4_Tier_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_Tier_descriptor, + new java.lang.String[] { + "Tier", "RAM", "Kind", "DiskQuota", "Region", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlUsersProto.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlUsersProto.java new file mode 100644 index 000000000000..b8aadf9fbf03 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CloudSqlUsersProto.java @@ -0,0 +1,334 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public final class CloudSqlUsersProto extends com.google.protobuf.GeneratedFile { + private CloudSqlUsersProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudSqlUsersProto"); + } + + 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_sql_v1beta4_SqlUsersDeleteRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlUsersDeleteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlUsersGetRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlUsersGetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlUsersInsertRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlUsersInsertRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlUsersListRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlUsersListRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlUsersUpdateRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlUsersUpdateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_UserPasswordValidationPolicy_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_UserPasswordValidationPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_PasswordStatus_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_PasswordStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_User_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_User_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_SqlServerUserDetails_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_SqlServerUserDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_sql_v1beta4_UsersListResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_sql_v1beta4_UsersListResponse_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/sql/v1beta4/cloud_sql_use" + + "rs.proto\022\030google.cloud.sql.v1beta4\032\034goog" + + "le/api/annotations.proto\032\027google/api/cli" + + "ent.proto\032\037google/api/field_behavior.pro" + + "to\0322google/cloud/sql/v1beta4/cloud_sql_r" + + "esources.proto\032\036google/protobuf/duration" + + ".proto\032\037google/protobuf/timestamp.proto\"V\n" + + "\025SqlUsersDeleteRequest\022\014\n" + + "\004host\030\001 \001(\t\022\020\n" + + "\010instance\030\002 \001(\t\022\014\n" + + "\004name\030\003 \001(\t\022\017\n" + + "\007project\030\004 \001(\t\"S\n" + + "\022SqlUsersGetRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\014\n" + + "\004name\030\002 \001(\t\022\017\n" + + "\007project\030\003 \001(\t\022\014\n" + + "\004host\030\004 \001(\t\"h\n" + + "\025SqlUsersInsertRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\022,\n" + + "\004body\030d \001(\0132\036.google.cloud.sql.v1beta4.User\"8\n" + + "\023SqlUsersListRequest\022\020\n" + + "\010instance\030\001 \001(\t\022\017\n" + + "\007project\030\002 \001(\t\"\351\001\n" + + "\025SqlUsersUpdateRequest\022\021\n" + + "\004host\030\001 \001(\tB\003\340A\001\022\020\n" + + "\010instance\030\002 \001(\t\022\014\n" + + "\004name\030\003 \001(\t\022\017\n" + + "\007project\030\004 \001(\t\022\033\n" + + "\016database_roles\030\005 \003(\tB\003\340A\001\022\'\n" + + "\025revoke_existing_roles\030\006 \001(\010B\003\340A\001H\000\210\001\001\022,\n" + + "\004body\030d \001(\0132\036.google.cloud.sql.v1beta4.UserB\030\n" + + "\026_revoke_existing_roles\"\213\002\n" + + "\034UserPasswordValidationPolicy\022\037\n" + + "\027allowed_failed_attempts\030\001 \001(\005\022?\n" + + "\034password_expiration_duration\030\002" + + " \001(\0132\031.google.protobuf.Duration\022$\n" + + "\034enable_failed_attempts_check\030\003 \001(\010\022=\n" + + "\006status\030\004 \001(\0132(." + + "google.cloud.sql.v1beta4.PasswordStatusB\003\340A\003\022$\n" + + "\034enable_password_verification\030\005 \001(\010\"^\n" + + "\016PasswordStatus\022\016\n" + + "\006locked\030\001 \001(\010\022<\n" + + "\030password_expiration_time\030\002" + + " \001(\0132\032.google.protobuf.Timestamp\"\357\007\n" + + "\004User\022\014\n" + + "\004kind\030\001 \001(\t\022\020\n" + + "\010password\030\002 \001(\t\022\014\n" + + "\004etag\030\003 \001(\t\022\014\n" + + "\004name\030\004 \001(\t\022\021\n" + + "\004host\030\005 \001(\tB\003\340A\001\022\020\n" + + "\010instance\030\006 \001(\t\022\017\n" + + "\007project\030\007 \001(\t\0228\n" + + "\004type\030\010 \001(\0162*.google.cloud.sql.v1beta4.User.SqlUserType\022P\n" + + "\026sqlserver_user_details\030\t \001(\0132..google" + + ".cloud.sql.v1beta4.SqlServerUserDetailsH\000\022\026\n" + + "\tiam_email\030\013 \001(\tB\003\340A\001\022O\n" + + "\017password_policy\030\014" + + " \001(\01326.google.cloud.sql.v1beta4.UserPasswordValidationPolicy\022P\n" + + "\022dual_password_type\030\r" + + " \001(\0162/.google.cloud.sql.v1beta4.User.DualPasswordTypeH\001\210\001\001\022A\n\n" + + "iam_status\030\016" + + " \001(\0162(.google.cloud.sql.v1beta4.User.IamStatusH\002\210\001\001\022\033\n" + + "\016database_roles\030\017 \003(\tB\003\340A\001\"\326\001\n" + + "\013SqlUserType\022\014\n" + + "\010BUILT_IN\020\000\022\022\n" + + "\016CLOUD_IAM_USER\020\001\022\035\n" + + "\031CLOUD_IAM_SERVICE_ACCOUNT\020\002\022\023\n" + + "\017CLOUD_IAM_GROUP\020\003\022\030\n" + + "\024CLOUD_IAM_GROUP_USER\020\004\022#\n" + + "\037CLOUD_IAM_GROUP_SERVICE_ACCOUNT\020\005\022 \n" + + "\034CLOUD_IAM_WORKFORCE_IDENTITY\020\006\022\020\n" + + "\014ENTRAID_USER\020\007\"|\n" + + "\020DualPasswordType\022\"\n" + + "\036DUAL_PASSWORD_TYPE_UNSPECIFIED\020\000\022\033\n" + + "\027NO_MODIFY_DUAL_PASSWORD\020\001\022\024\n" + + "\020NO_DUAL_PASSWORD\020\002\022\021\n\r" + + "DUAL_PASSWORD\020\003\"A\n" + + "\tIamStatus\022\032\n" + + "\026IAM_STATUS_UNSPECIFIED\020\000\022\014\n" + + "\010INACTIVE\020\001\022\n\n" + + "\006ACTIVE\020\002B\016\n" + + "\014user_detailsB\025\n" + + "\023_dual_password_typeB\r\n" + + "\013_iam_status\">\n" + + "\024SqlServerUserDetails\022\020\n" + + "\010disabled\030\001 \001(\010\022\024\n" + + "\014server_roles\030\002 \003(\t\"m\n" + + "\021UsersListResponse\022\014\n" + + "\004kind\030\001 \001(\t\022-\n" + + "\005items\030\002 \003(\0132\036.google.cloud.sql.v1beta4.User\022\033\n" + + "\017next_page_token\030\003 \001(\tB\002\030\0012\324\007\n" + + "\017SqlUsersService\022\242\001\n" + + "\006Delete\022/.google.cloud.sql.v1beta4.SqlUsersDeleteRequ" + + "est\032#.google.cloud.sql.v1beta4.Operation" + + "\"B\202\323\344\223\002<*:/sql/v1beta4/projects/{project}/instances/{instance}/users\022\236\001\n" + + "\003Get\022,.google.cloud.sql.v1beta4.SqlUsersGetReque" + + "st\032\036.google.cloud.sql.v1beta4.User\"I\202\323\344\223" + + "\002C\022A/sql/v1beta4/projects/{project}/instances/{instance}/users/{name}\022\250\001\n" + + "\006Insert\022/.google.cloud.sql.v1beta4.SqlUsersInse" + + "rtRequest\032#.google.cloud.sql.v1beta4.Ope" + + "ration\"H\202\323\344\223\002B\":/sql/v1beta4/projects/{p" + + "roject}/instances/{instance}/users:\004body\022\246\001\n" + + "\004List\022-.google.cloud.sql.v1beta4.SqlUsersListRequest\032+.google.cloud.sql.v1be" + + "ta4.UsersListResponse\"B\202\323\344\223\002<\022:/sql/v1be" + + "ta4/projects/{project}/instances/{instance}/users\022\250\001\n" + + "\006Update\022/.google.cloud.sql.v1beta4.SqlUsersUpdateRequest\032#.google.c" + + "loud.sql.v1beta4.Operation\"H\202\323\344\223\002B\032:/sql" + + "/v1beta4/projects/{project}/instances/{i" + + "nstance}/users:\004body\032|\312A\027sqladmin.google" + + "apis.com\322A_https://www.googleapis.com/au" + + "th/cloud-platform,https://www.googleapis.com/auth/sqlservice.adminBd\n" + + "\034com.google.cloud.sql.v1beta4B\022CloudSqlUsersProtoP\001" + + "Z.cloud.google.com/go/sql/apiv1beta4/sqlpb;sqlpbb\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.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_sql_v1beta4_SqlUsersDeleteRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_sql_v1beta4_SqlUsersDeleteRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlUsersDeleteRequest_descriptor, + new java.lang.String[] { + "Host", "Instance", "Name", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlUsersGetRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_sql_v1beta4_SqlUsersGetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlUsersGetRequest_descriptor, + new java.lang.String[] { + "Instance", "Name", "Project", "Host", + }); + internal_static_google_cloud_sql_v1beta4_SqlUsersInsertRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_sql_v1beta4_SqlUsersInsertRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlUsersInsertRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", "Body", + }); + internal_static_google_cloud_sql_v1beta4_SqlUsersListRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_sql_v1beta4_SqlUsersListRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlUsersListRequest_descriptor, + new java.lang.String[] { + "Instance", "Project", + }); + internal_static_google_cloud_sql_v1beta4_SqlUsersUpdateRequest_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_cloud_sql_v1beta4_SqlUsersUpdateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlUsersUpdateRequest_descriptor, + new java.lang.String[] { + "Host", "Instance", "Name", "Project", "DatabaseRoles", "RevokeExistingRoles", "Body", + }); + internal_static_google_cloud_sql_v1beta4_UserPasswordValidationPolicy_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_cloud_sql_v1beta4_UserPasswordValidationPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_UserPasswordValidationPolicy_descriptor, + new java.lang.String[] { + "AllowedFailedAttempts", + "PasswordExpirationDuration", + "EnableFailedAttemptsCheck", + "Status", + "EnablePasswordVerification", + }); + internal_static_google_cloud_sql_v1beta4_PasswordStatus_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_cloud_sql_v1beta4_PasswordStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_PasswordStatus_descriptor, + new java.lang.String[] { + "Locked", "PasswordExpirationTime", + }); + internal_static_google_cloud_sql_v1beta4_User_descriptor = getDescriptor().getMessageType(7); + internal_static_google_cloud_sql_v1beta4_User_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_User_descriptor, + new java.lang.String[] { + "Kind", + "Password", + "Etag", + "Name", + "Host", + "Instance", + "Project", + "Type", + "SqlserverUserDetails", + "IamEmail", + "PasswordPolicy", + "DualPasswordType", + "IamStatus", + "DatabaseRoles", + "UserDetails", + }); + internal_static_google_cloud_sql_v1beta4_SqlServerUserDetails_descriptor = + getDescriptor().getMessageType(8); + internal_static_google_cloud_sql_v1beta4_SqlServerUserDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_SqlServerUserDetails_descriptor, + new java.lang.String[] { + "Disabled", "ServerRoles", + }); + internal_static_google_cloud_sql_v1beta4_UsersListResponse_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_cloud_sql_v1beta4_UsersListResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_sql_v1beta4_UsersListResponse_descriptor, + new java.lang.String[] { + "Kind", "Items", "NextPageToken", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Column.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Column.java new file mode 100644 index 000000000000..c30f11d1d3ab --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Column.java @@ -0,0 +1,781 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Contains the name and datatype of a column.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Column} + */ +@com.google.protobuf.Generated +public final class Column extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.Column) + ColumnOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Column"); + } + + // Use Column.newBuilder() to construct. + private Column(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Column() { + name_ = ""; + type_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Column_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Column_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Column.class, + com.google.cloud.sql.v1beta4.Column.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Name of the column.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the column.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + + /** + * + * + *
+   * Datatype of the column.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + + /** + * + * + *
+   * Datatype of the column.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, type_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, type_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.Column)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.Column other = (com.google.cloud.sql.v1beta4.Column) obj; + + if (!getName().equals(other.getName())) return false; + if (!getType().equals(other.getType())) return false; + if (!getUnknownFields().equals(other.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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.Column parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Column parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Column parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Column parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Column parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Column parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Column parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Column parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Column parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Column parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Column parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Column parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.Column prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Contains the name and datatype of a column.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Column} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.Column) + com.google.cloud.sql.v1beta4.ColumnOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Column_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Column_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Column.class, + com.google.cloud.sql.v1beta4.Column.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.Column.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + type_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Column_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Column getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.Column.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Column build() { + com.google.cloud.sql.v1beta4.Column result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Column buildPartial() { + com.google.cloud.sql.v1beta4.Column result = new com.google.cloud.sql.v1beta4.Column(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.Column result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = type_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.Column) { + return mergeFrom((com.google.cloud.sql.v1beta4.Column) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.Column other) { + if (other == com.google.cloud.sql.v1beta4.Column.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + 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: + { + type_ = 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_ = ""; + + /** + * + * + *
+     * Name of the column.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the column.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the column.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the column.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the column.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + + /** + * + * + *
+     * Datatype of the column.
+     * 
+ * + * string type = 2; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Datatype of the column.
+     * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Datatype of the column.
+     * 
+ * + * string type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Datatype of the column.
+     * 
+ * + * string type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Datatype of the column.
+     * 
+ * + * string type = 2; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.Column) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.Column) + private static final com.google.cloud.sql.v1beta4.Column DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.Column(); + } + + public static com.google.cloud.sql.v1beta4.Column getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Column parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Column getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ColumnOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ColumnOrBuilder.java new file mode 100644 index 000000000000..92aed033529c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ColumnOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ColumnOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.Column) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the column.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Name of the column.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Datatype of the column.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + java.lang.String getType(); + + /** + * + * + *
+   * Datatype of the column.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectSettings.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectSettings.java new file mode 100644 index 000000000000..c7f981be09a5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectSettings.java @@ -0,0 +1,7354 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Connect settings retrieval response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ConnectSettings} + */ +@com.google.protobuf.Generated +public final class ConnectSettings extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ConnectSettings) + ConnectSettingsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ConnectSettings"); + } + + // Use ConnectSettings.newBuilder() to construct. + private ConnectSettings(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ConnectSettings() { + kind_ = ""; + ipAddresses_ = java.util.Collections.emptyList(); + region_ = ""; + databaseVersion_ = 0; + backendType_ = 0; + dnsName_ = ""; + serverCaMode_ = 0; + customSubjectAlternativeNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + dnsNames_ = java.util.Collections.emptyList(); + nodes_ = java.util.Collections.emptyList(); + mdxProtocolSupport_ = emptyIntList(); + connectionName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ConnectSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ConnectSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ConnectSettings.class, + com.google.cloud.sql.v1beta4.ConnectSettings.Builder.class); + } + + /** + * + * + *
+   * Various Certificate Authority (CA) modes for certificate signing.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.ConnectSettings.CaMode} + */ + public enum CaMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * CA mode is unspecified. It is effectively the same as
+     * `GOOGLE_MANAGED_INTERNAL_CA`.
+     * 
+ * + * CA_MODE_UNSPECIFIED = 0; + */ + CA_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Google-managed self-signed internal CA.
+     * 
+ * + * GOOGLE_MANAGED_INTERNAL_CA = 1; + */ + GOOGLE_MANAGED_INTERNAL_CA(1), + /** + * + * + *
+     * Google-managed regional CA part of root CA hierarchy hosted on Google
+     * Cloud's Certificate Authority Service (CAS).
+     * 
+ * + * GOOGLE_MANAGED_CAS_CA = 2; + */ + GOOGLE_MANAGED_CAS_CA(2), + /** + * + * + *
+     * Customer-managed CA hosted on Google Cloud's Certificate Authority
+     * Service (CAS).
+     * 
+ * + * CUSTOMER_MANAGED_CAS_CA = 3; + */ + CUSTOMER_MANAGED_CAS_CA(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CaMode"); + } + + /** + * + * + *
+     * CA mode is unspecified. It is effectively the same as
+     * `GOOGLE_MANAGED_INTERNAL_CA`.
+     * 
+ * + * CA_MODE_UNSPECIFIED = 0; + */ + public static final int CA_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Google-managed self-signed internal CA.
+     * 
+ * + * GOOGLE_MANAGED_INTERNAL_CA = 1; + */ + public static final int GOOGLE_MANAGED_INTERNAL_CA_VALUE = 1; + + /** + * + * + *
+     * Google-managed regional CA part of root CA hierarchy hosted on Google
+     * Cloud's Certificate Authority Service (CAS).
+     * 
+ * + * GOOGLE_MANAGED_CAS_CA = 2; + */ + public static final int GOOGLE_MANAGED_CAS_CA_VALUE = 2; + + /** + * + * + *
+     * Customer-managed CA hosted on Google Cloud's Certificate Authority
+     * Service (CAS).
+     * 
+ * + * CUSTOMER_MANAGED_CAS_CA = 3; + */ + public static final int CUSTOMER_MANAGED_CAS_CA_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CaMode 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 CaMode forNumber(int value) { + switch (value) { + case 0: + return CA_MODE_UNSPECIFIED; + case 1: + return GOOGLE_MANAGED_INTERNAL_CA; + case 2: + return GOOGLE_MANAGED_CAS_CA; + case 3: + return CUSTOMER_MANAGED_CAS_CA; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CaMode findValueByNumber(int number) { + return CaMode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.ConnectSettings.getDescriptor().getEnumTypes().get(0); + } + + private static final CaMode[] VALUES = values(); + + public static CaMode 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 CaMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.ConnectSettings.CaMode) + } + + /** + * + * + *
+   * MdxProtocolSupport describes parts of the MDX protocol supported by this
+   * instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport} + */ + public enum MdxProtocolSupport implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * MDX_PROTOCOL_SUPPORT_UNSPECIFIED = 0; + */ + MDX_PROTOCOL_SUPPORT_UNSPECIFIED(0), + /** + * + * + *
+     * Client should send the client protocol type in the MDX request.
+     * 
+ * + * CLIENT_PROTOCOL_TYPE = 1; + */ + CLIENT_PROTOCOL_TYPE(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MdxProtocolSupport"); + } + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * MDX_PROTOCOL_SUPPORT_UNSPECIFIED = 0; + */ + public static final int MDX_PROTOCOL_SUPPORT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Client should send the client protocol type in the MDX request.
+     * 
+ * + * CLIENT_PROTOCOL_TYPE = 1; + */ + public static final int CLIENT_PROTOCOL_TYPE_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MdxProtocolSupport 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 MdxProtocolSupport forNumber(int value) { + switch (value) { + case 0: + return MDX_PROTOCOL_SUPPORT_UNSPECIFIED; + case 1: + return CLIENT_PROTOCOL_TYPE; + 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 MdxProtocolSupport findValueByNumber(int number) { + return MdxProtocolSupport.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.ConnectSettings.getDescriptor().getEnumTypes().get(1); + } + + private static final MdxProtocolSupport[] VALUES = values(); + + public static MdxProtocolSupport 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 MdxProtocolSupport(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport) + } + + public interface ConnectPoolNodeConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. The name of the read pool node. Doesn't include the project
+     * ID.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the name field is set. + */ + boolean hasName(); + + /** + * + * + *
+     * Output only. The name of the read pool node. Doesn't include the project
+     * ID.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+     * Output only. The name of the read pool node. Doesn't include the project
+     * ID.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getIpAddressesList(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.IpMapping getIpAddresses(int index); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getIpAddressesCount(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getIpAddressesOrBuilderList(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.IpMappingOrBuilder getIpAddressesOrBuilder(int index); + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + boolean hasDnsName(); + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + java.lang.String getDnsName(); + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + com.google.protobuf.ByteString getDnsNameBytes(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getDnsNamesList(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.DnsNameMapping getDnsNames(int index); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getDnsNamesCount(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getDnsNamesOrBuilderList(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index); + } + + /** + * + * + *
+   * Details of a single read pool node of a read pool.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig} + */ + public static final class ConnectPoolNodeConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig) + ConnectPoolNodeConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ConnectPoolNodeConfig"); + } + + // Use ConnectPoolNodeConfig.newBuilder() to construct. + private ConnectPoolNodeConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ConnectPoolNodeConfig() { + name_ = ""; + ipAddresses_ = java.util.Collections.emptyList(); + dnsName_ = ""; + dnsNames_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ConnectSettings_ConnectPoolNodeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ConnectSettings_ConnectPoolNodeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.class, + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. The name of the read pool node. Doesn't include the project
+     * ID.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the name field is set. + */ + @java.lang.Override + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Output only. The name of the read pool node. Doesn't include the project
+     * ID.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The name of the read pool node. Doesn't include the project
+     * ID.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESSES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List ipAddresses_; + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getIpAddressesList() { + return ipAddresses_; + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getIpAddressesOrBuilderList() { + return ipAddresses_; + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getIpAddressesCount() { + return ipAddresses_.size(); + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpMapping getIpAddresses(int index) { + return ipAddresses_.get(index); + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + return ipAddresses_.get(index); + } + + public static final int DNS_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object dnsName_ = ""; + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + @java.lang.Override + public boolean hasDnsName() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + @java.lang.Override + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DNS_NAMES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List dnsNames_; + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getDnsNamesList() { + return dnsNames_; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDnsNamesOrBuilderList() { + return dnsNames_; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getDnsNamesCount() { + return dnsNames_.size(); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMapping getDnsNames(int index) { + return dnsNames_.get(index); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + return dnsNames_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + output.writeMessage(2, ipAddresses_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, dnsName_); + } + for (int i = 0; i < dnsNames_.size(); i++) { + output.writeMessage(4, dnsNames_.get(i)); + } + 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.GeneratedMessage.computeStringSize(1, name_); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, ipAddresses_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, dnsName_); + } + for (int i = 0; i < dnsNames_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, dnsNames_.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.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig other = + (com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig) obj; + + if (hasName() != other.hasName()) return false; + if (hasName()) { + if (!getName().equals(other.getName())) return false; + } + if (!getIpAddressesList().equals(other.getIpAddressesList())) return false; + if (hasDnsName() != other.hasDnsName()) return false; + if (hasDnsName()) { + if (!getDnsName().equals(other.getDnsName())) return false; + } + if (!getDnsNamesList().equals(other.getDnsNamesList())) return false; + if (!getUnknownFields().equals(other.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 (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (getIpAddressesCount() > 0) { + hash = (37 * hash) + IP_ADDRESSES_FIELD_NUMBER; + hash = (53 * hash) + getIpAddressesList().hashCode(); + } + if (hasDnsName()) { + hash = (37 * hash) + DNS_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDnsName().hashCode(); + } + if (getDnsNamesCount() > 0) { + hash = (37 * hash) + DNS_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getDnsNamesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Details of a single read pool node of a read pool.
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig) + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ConnectSettings_ConnectPoolNodeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ConnectSettings_ConnectPoolNodeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.class, + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + } else { + ipAddresses_ = null; + ipAddressesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + dnsName_ = ""; + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + } else { + dnsNames_ = null; + dnsNamesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ConnectSettings_ConnectPoolNodeConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig build() { + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig buildPartial() { + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig result = + new com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig result) { + if (ipAddressesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + ipAddresses_ = java.util.Collections.unmodifiableList(ipAddresses_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.ipAddresses_ = ipAddresses_; + } else { + result.ipAddresses_ = ipAddressesBuilder_.build(); + } + if (dnsNamesBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + dnsNames_ = java.util.Collections.unmodifiableList(dnsNames_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.dnsNames_ = dnsNames_; + } else { + result.dnsNames_ = dnsNamesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dnsName_ = dnsName_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig other) { + if (other + == com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig + .getDefaultInstance()) return this; + if (other.hasName()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (ipAddressesBuilder_ == null) { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddresses_.isEmpty()) { + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureIpAddressesIsMutable(); + ipAddresses_.addAll(other.ipAddresses_); + } + onChanged(); + } + } else { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddressesBuilder_.isEmpty()) { + ipAddressesBuilder_.dispose(); + ipAddressesBuilder_ = null; + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000002); + ipAddressesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetIpAddressesFieldBuilder() + : null; + } else { + ipAddressesBuilder_.addAllMessages(other.ipAddresses_); + } + } + } + if (other.hasDnsName()) { + dnsName_ = other.dnsName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (dnsNamesBuilder_ == null) { + if (!other.dnsNames_.isEmpty()) { + if (dnsNames_.isEmpty()) { + dnsNames_ = other.dnsNames_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureDnsNamesIsMutable(); + dnsNames_.addAll(other.dnsNames_); + } + onChanged(); + } + } else { + if (!other.dnsNames_.isEmpty()) { + if (dnsNamesBuilder_.isEmpty()) { + dnsNamesBuilder_.dispose(); + dnsNamesBuilder_ = null; + dnsNames_ = other.dnsNames_; + bitField0_ = (bitField0_ & ~0x00000008); + dnsNamesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDnsNamesFieldBuilder() + : null; + } else { + dnsNamesBuilder_.addAllMessages(other.dnsNames_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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: + { + com.google.cloud.sql.v1beta4.IpMapping m = + input.readMessage( + com.google.cloud.sql.v1beta4.IpMapping.parser(), extensionRegistry); + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(m); + } else { + ipAddressesBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + dnsName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.cloud.sql.v1beta4.DnsNameMapping m = + input.readMessage( + com.google.cloud.sql.v1beta4.DnsNameMapping.parser(), extensionRegistry); + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(m); + } else { + dnsNamesBuilder_.addMessage(m); + } + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+       * Output only. The name of the read pool node. Doesn't include the project
+       * ID.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the name field is set. + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Output only. The name of the read pool node. Doesn't include the project
+       * ID.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The name of the read pool node. Doesn't include the project
+       * ID.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The name of the read pool node. Doesn't include the project
+       * ID.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The name of the read pool node. Doesn't include the project
+       * ID.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The name of the read pool node. Doesn't include the project
+       * ID.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List ipAddresses_ = + java.util.Collections.emptyList(); + + private void ensureIpAddressesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + ipAddresses_ = + new java.util.ArrayList(ipAddresses_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.IpMapping, + com.google.cloud.sql.v1beta4.IpMapping.Builder, + com.google.cloud.sql.v1beta4.IpMappingOrBuilder> + ipAddressesBuilder_; + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getIpAddressesList() { + if (ipAddressesBuilder_ == null) { + return java.util.Collections.unmodifiableList(ipAddresses_); + } else { + return ipAddressesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getIpAddressesCount() { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.size(); + } else { + return ipAddressesBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.IpMapping getIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setIpAddresses(int index, com.google.cloud.sql.v1beta4.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, value); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setIpAddresses( + int index, com.google.cloud.sql.v1beta4.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses(com.google.cloud.sql.v1beta4.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses(int index, com.google.cloud.sql.v1beta4.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses( + com.google.cloud.sql.v1beta4.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses( + int index, com.google.cloud.sql.v1beta4.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllIpAddresses( + java.lang.Iterable values) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipAddresses_); + onChanged(); + } else { + ipAddressesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearIpAddresses() { + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + ipAddressesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.remove(index); + onChanged(); + } else { + ipAddressesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.IpMapping.Builder getIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getIpAddressesOrBuilderList() { + if (ipAddressesBuilder_ != null) { + return ipAddressesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(ipAddresses_); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.IpMapping.Builder addIpAddressesBuilder() { + return internalGetIpAddressesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.IpMapping.Builder addIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getIpAddressesBuilderList() { + return internalGetIpAddressesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.IpMapping, + com.google.cloud.sql.v1beta4.IpMapping.Builder, + com.google.cloud.sql.v1beta4.IpMappingOrBuilder> + internalGetIpAddressesFieldBuilder() { + if (ipAddressesBuilder_ == null) { + ipAddressesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.IpMapping, + com.google.cloud.sql.v1beta4.IpMapping.Builder, + com.google.cloud.sql.v1beta4.IpMappingOrBuilder>( + ipAddresses_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + ipAddresses_ = null; + } + return ipAddressesBuilder_; + } + + private java.lang.Object dnsName_ = ""; + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + public boolean hasDnsName() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dnsName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDnsName() { + dnsName_ = getDefaultInstance().getDnsName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dnsName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List dnsNames_ = + java.util.Collections.emptyList(); + + private void ensureDnsNamesIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + dnsNames_ = + new java.util.ArrayList(dnsNames_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DnsNameMapping, + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder, + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder> + dnsNamesBuilder_; + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getDnsNamesList() { + if (dnsNamesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dnsNames_); + } else { + return dnsNamesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getDnsNamesCount() { + if (dnsNamesBuilder_ == null) { + return dnsNames_.size(); + } else { + return dnsNamesBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping getDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames(int index, com.google.cloud.sql.v1beta4.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.set(index, value); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames( + int index, com.google.cloud.sql.v1beta4.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.set(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(com.google.cloud.sql.v1beta4.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(int index, com.google.cloud.sql.v1beta4.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(index, value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames( + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames( + int index, com.google.cloud.sql.v1beta4.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllDnsNames( + java.lang.Iterable values) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dnsNames_); + onChanged(); + } else { + dnsNamesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDnsNames() { + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + dnsNamesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.remove(index); + onChanged(); + } else { + dnsNamesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping.Builder getDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDnsNamesOrBuilderList() { + if (dnsNamesBuilder_ != null) { + return dnsNamesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dnsNames_); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping.Builder addDnsNamesBuilder() { + return internalGetDnsNamesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping.Builder addDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDnsNamesBuilderList() { + return internalGetDnsNamesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DnsNameMapping, + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder, + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder> + internalGetDnsNamesFieldBuilder() { + if (dnsNamesBuilder_ == null) { + dnsNamesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DnsNameMapping, + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder, + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder>( + dnsNames_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + dnsNames_ = null; + } + return dnsNamesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig) + private static final com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig(); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectPoolNodeConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#connectSettings`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#connectSettings`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVER_CA_CERT_FIELD_NUMBER = 2; + private com.google.cloud.sql.v1beta4.SslCert serverCaCert_; + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + * + * @return Whether the serverCaCert field is set. + */ + @java.lang.Override + public boolean hasServerCaCert() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + * + * @return The serverCaCert. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCert getServerCaCert() { + return serverCaCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : serverCaCert_; + } + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getServerCaCertOrBuilder() { + return serverCaCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : serverCaCert_; + } + + public static final int IP_ADDRESSES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List ipAddresses_; + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + @java.lang.Override + public java.util.List getIpAddressesList() { + return ipAddresses_; + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + @java.lang.Override + public java.util.List + getIpAddressesOrBuilderList() { + return ipAddresses_; + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + @java.lang.Override + public int getIpAddressesCount() { + return ipAddresses_.size(); + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpMapping getIpAddresses(int index) { + return ipAddresses_.get(index); + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + return ipAddresses_.get(index); + } + + public static final int REGION_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object region_ = ""; + + /** + * + * + *
+   * The cloud region for the instance. e.g. `us-central1`, `europe-west1`.
+   * The region cannot be changed after instance creation.
+   * 
+ * + * string region = 4; + * + * @return The region. + */ + @java.lang.Override + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } + } + + /** + * + * + *
+   * The cloud region for the instance. e.g. `us-central1`, `europe-west1`.
+   * The region cannot be changed after instance creation.
+   * 
+ * + * string region = 4; + * + * @return The bytes for region. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_VERSION_FIELD_NUMBER = 31; + private int databaseVersion_ = 0; + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion`
+   * field cannot be changed after instance creation.
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+   * or `MYSQL_5_6`.
+   * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+   * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+   * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+   * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 31; + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion`
+   * field cannot be changed after instance creation.
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+   * or `MYSQL_5_6`.
+   * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+   * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+   * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+   * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 31; + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1beta4.SqlDatabaseVersion result = + com.google.cloud.sql.v1beta4.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1beta4.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + public static final int BACKEND_TYPE_FIELD_NUMBER = 32; + private int backendType_ = 0; + + /** + * + * + *
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 32; + * + * @return The enum numeric value on the wire for backendType. + */ + @java.lang.Override + public int getBackendTypeValue() { + return backendType_; + } + + /** + * + * + *
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 32; + * + * @return The backendType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackendType getBackendType() { + com.google.cloud.sql.v1beta4.SqlBackendType result = + com.google.cloud.sql.v1beta4.SqlBackendType.forNumber(backendType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlBackendType.UNRECOGNIZED : result; + } + + public static final int PSC_ENABLED_FIELD_NUMBER = 33; + private boolean pscEnabled_ = false; + + /** + * + * + *
+   * Whether PSC connectivity is enabled for this instance.
+   * 
+ * + * bool psc_enabled = 33; + * + * @return The pscEnabled. + */ + @java.lang.Override + public boolean getPscEnabled() { + return pscEnabled_; + } + + public static final int DNS_NAME_FIELD_NUMBER = 34; + + @SuppressWarnings("serial") + private volatile java.lang.Object dnsName_ = ""; + + /** + * + * + *
+   * The dns name of the instance.
+   * 
+ * + * string dns_name = 34; + * + * @return The dnsName. + */ + @java.lang.Override + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } + } + + /** + * + * + *
+   * The dns name of the instance.
+   * 
+ * + * string dns_name = 34; + * + * @return The bytes for dnsName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVER_CA_MODE_FIELD_NUMBER = 35; + private int serverCaMode_ = 0; + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * .google.cloud.sql.v1beta4.ConnectSettings.CaMode server_ca_mode = 35; + * + * @return The enum numeric value on the wire for serverCaMode. + */ + @java.lang.Override + public int getServerCaModeValue() { + return serverCaMode_; + } + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * .google.cloud.sql.v1beta4.ConnectSettings.CaMode server_ca_mode = 35; + * + * @return The serverCaMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectSettings.CaMode getServerCaMode() { + com.google.cloud.sql.v1beta4.ConnectSettings.CaMode result = + com.google.cloud.sql.v1beta4.ConnectSettings.CaMode.forNumber(serverCaMode_); + return result == null + ? com.google.cloud.sql.v1beta4.ConnectSettings.CaMode.UNRECOGNIZED + : result; + } + + public static final int CUSTOM_SUBJECT_ALTERNATIVE_NAMES_FIELD_NUMBER = 37; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList customSubjectAlternativeNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @return A list containing the customSubjectAlternativeNames. + */ + public com.google.protobuf.ProtocolStringList getCustomSubjectAlternativeNamesList() { + return customSubjectAlternativeNames_; + } + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @return The count of customSubjectAlternativeNames. + */ + public int getCustomSubjectAlternativeNamesCount() { + return customSubjectAlternativeNames_.size(); + } + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param index The index of the element to return. + * @return The customSubjectAlternativeNames at the given index. + */ + public java.lang.String getCustomSubjectAlternativeNames(int index) { + return customSubjectAlternativeNames_.get(index); + } + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param index The index of the value to return. + * @return The bytes of the customSubjectAlternativeNames at the given index. + */ + public com.google.protobuf.ByteString getCustomSubjectAlternativeNamesBytes(int index) { + return customSubjectAlternativeNames_.getByteString(index); + } + + public static final int DNS_NAMES_FIELD_NUMBER = 38; + + @SuppressWarnings("serial") + private java.util.List dnsNames_; + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getDnsNamesList() { + return dnsNames_; + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDnsNamesOrBuilderList() { + return dnsNames_; + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getDnsNamesCount() { + return dnsNames_.size(); + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMapping getDnsNames(int index) { + return dnsNames_.get(index); + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + return dnsNames_.get(index); + } + + public static final int NODE_COUNT_FIELD_NUMBER = 63; + private int nodeCount_ = 0; + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return Whether the nodeCount field is set. + */ + @java.lang.Override + public boolean hasNodeCount() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + + public static final int NODES_FIELD_NUMBER = 64; + + @SuppressWarnings("serial") + private java.util.List nodes_; + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getNodesList() { + return nodes_; + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfigOrBuilder> + getNodesOrBuilderList() { + return nodes_; + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getNodesCount() { + return nodes_.size(); + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig getNodes(int index) { + return nodes_.get(index); + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfigOrBuilder + getNodesOrBuilder(int index) { + return nodes_.get(index); + } + + public static final int MDX_PROTOCOL_SUPPORT_FIELD_NUMBER = 39; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList mdxProtocolSupport_ = emptyIntList(); + + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport> + mdxProtocolSupport_converter_ = + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport>() { + public com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport convert( + int from) { + com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport result = + com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport.forNumber(from); + return result == null + ? com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport.UNRECOGNIZED + : result; + } + }; + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the mdxProtocolSupport. + */ + @java.lang.Override + public java.util.List + getMdxProtocolSupportList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport>( + mdxProtocolSupport_, mdxProtocolSupport_converter_); + } + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of mdxProtocolSupport. + */ + @java.lang.Override + public int getMdxProtocolSupportCount() { + return mdxProtocolSupport_.size(); + } + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The mdxProtocolSupport at the given index. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport getMdxProtocolSupport( + int index) { + return mdxProtocolSupport_converter_.convert(mdxProtocolSupport_.getInt(index)); + } + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for mdxProtocolSupport. + */ + @java.lang.Override + public java.util.List getMdxProtocolSupportValueList() { + return mdxProtocolSupport_; + } + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of mdxProtocolSupport at the given index. + */ + @java.lang.Override + public int getMdxProtocolSupportValue(int index) { + return mdxProtocolSupport_.getInt(index); + } + + private int mdxProtocolSupportMemoizedSerializedSize; + + public static final int CONNECTION_NAME_FIELD_NUMBER = 40; + + @SuppressWarnings("serial") + private volatile java.lang.Object connectionName_ = ""; + + /** + * + * + *
+   * Optional. Output only. Connection name of the Cloud SQL instance used in
+   * connection strings, in the format project:region:instance.
+   * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The connectionName. + */ + @java.lang.Override + public java.lang.String getConnectionName() { + java.lang.Object ref = connectionName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Output only. Connection name of the Cloud SQL instance used in
+   * connection strings, in the format project:region:instance.
+   * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for connectionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConnectionNameBytes() { + java.lang.Object ref = connectionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionName_ = 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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getServerCaCert()); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + output.writeMessage(3, ipAddresses_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, region_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1beta4.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(31, databaseVersion_); + } + if (backendType_ + != com.google.cloud.sql.v1beta4.SqlBackendType.SQL_BACKEND_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(32, backendType_); + } + if (pscEnabled_ != false) { + output.writeBool(33, pscEnabled_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dnsName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 34, dnsName_); + } + if (serverCaMode_ + != com.google.cloud.sql.v1beta4.ConnectSettings.CaMode.CA_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(35, serverCaMode_); + } + for (int i = 0; i < customSubjectAlternativeNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 37, customSubjectAlternativeNames_.getRaw(i)); + } + for (int i = 0; i < dnsNames_.size(); i++) { + output.writeMessage(38, dnsNames_.get(i)); + } + if (getMdxProtocolSupportList().size() > 0) { + output.writeUInt32NoTag(314); + output.writeUInt32NoTag(mdxProtocolSupportMemoizedSerializedSize); + } + for (int i = 0; i < mdxProtocolSupport_.size(); i++) { + output.writeEnumNoTag(mdxProtocolSupport_.getInt(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(connectionName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 40, connectionName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(63, nodeCount_); + } + for (int i = 0; i < nodes_.size(); i++) { + output.writeMessage(64, nodes_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getServerCaCert()); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, ipAddresses_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, region_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1beta4.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(31, databaseVersion_); + } + if (backendType_ + != com.google.cloud.sql.v1beta4.SqlBackendType.SQL_BACKEND_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(32, backendType_); + } + if (pscEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(33, pscEnabled_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dnsName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(34, dnsName_); + } + if (serverCaMode_ + != com.google.cloud.sql.v1beta4.ConnectSettings.CaMode.CA_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(35, serverCaMode_); + } + { + int dataSize = 0; + for (int i = 0; i < customSubjectAlternativeNames_.size(); i++) { + dataSize += computeStringSizeNoTag(customSubjectAlternativeNames_.getRaw(i)); + } + size += dataSize; + size += 2 * getCustomSubjectAlternativeNamesList().size(); + } + for (int i = 0; i < dnsNames_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(38, dnsNames_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < mdxProtocolSupport_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag( + mdxProtocolSupport_.getInt(i)); + } + size += dataSize; + if (!getMdxProtocolSupportList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + mdxProtocolSupportMemoizedSerializedSize = dataSize; + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(connectionName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(40, connectionName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(63, nodeCount_); + } + for (int i = 0; i < nodes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(64, nodes_.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.sql.v1beta4.ConnectSettings)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ConnectSettings other = + (com.google.cloud.sql.v1beta4.ConnectSettings) obj; + + if (!getKind().equals(other.getKind())) return false; + if (hasServerCaCert() != other.hasServerCaCert()) return false; + if (hasServerCaCert()) { + if (!getServerCaCert().equals(other.getServerCaCert())) return false; + } + if (!getIpAddressesList().equals(other.getIpAddressesList())) return false; + if (!getRegion().equals(other.getRegion())) return false; + if (databaseVersion_ != other.databaseVersion_) return false; + if (backendType_ != other.backendType_) return false; + if (getPscEnabled() != other.getPscEnabled()) return false; + if (!getDnsName().equals(other.getDnsName())) return false; + if (serverCaMode_ != other.serverCaMode_) return false; + if (!getCustomSubjectAlternativeNamesList() + .equals(other.getCustomSubjectAlternativeNamesList())) return false; + if (!getDnsNamesList().equals(other.getDnsNamesList())) return false; + if (hasNodeCount() != other.hasNodeCount()) return false; + if (hasNodeCount()) { + if (getNodeCount() != other.getNodeCount()) return false; + } + if (!getNodesList().equals(other.getNodesList())) return false; + if (!mdxProtocolSupport_.equals(other.mdxProtocolSupport_)) return false; + if (!getConnectionName().equals(other.getConnectionName())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasServerCaCert()) { + hash = (37 * hash) + SERVER_CA_CERT_FIELD_NUMBER; + hash = (53 * hash) + getServerCaCert().hashCode(); + } + if (getIpAddressesCount() > 0) { + hash = (37 * hash) + IP_ADDRESSES_FIELD_NUMBER; + hash = (53 * hash) + getIpAddressesList().hashCode(); + } + hash = (37 * hash) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegion().hashCode(); + hash = (37 * hash) + DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + databaseVersion_; + hash = (37 * hash) + BACKEND_TYPE_FIELD_NUMBER; + hash = (53 * hash) + backendType_; + hash = (37 * hash) + PSC_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPscEnabled()); + hash = (37 * hash) + DNS_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDnsName().hashCode(); + hash = (37 * hash) + SERVER_CA_MODE_FIELD_NUMBER; + hash = (53 * hash) + serverCaMode_; + if (getCustomSubjectAlternativeNamesCount() > 0) { + hash = (37 * hash) + CUSTOM_SUBJECT_ALTERNATIVE_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getCustomSubjectAlternativeNamesList().hashCode(); + } + if (getDnsNamesCount() > 0) { + hash = (37 * hash) + DNS_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getDnsNamesList().hashCode(); + } + if (hasNodeCount()) { + hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getNodeCount(); + } + if (getNodesCount() > 0) { + hash = (37 * hash) + NODES_FIELD_NUMBER; + hash = (53 * hash) + getNodesList().hashCode(); + } + if (getMdxProtocolSupportCount() > 0) { + hash = (37 * hash) + MDX_PROTOCOL_SUPPORT_FIELD_NUMBER; + hash = (53 * hash) + mdxProtocolSupport_.hashCode(); + } + hash = (37 * hash) + CONNECTION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getConnectionName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.ConnectSettings prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Connect settings retrieval response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ConnectSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ConnectSettings) + com.google.cloud.sql.v1beta4.ConnectSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ConnectSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ConnectSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ConnectSettings.class, + com.google.cloud.sql.v1beta4.ConnectSettings.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ConnectSettings.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetServerCaCertFieldBuilder(); + internalGetIpAddressesFieldBuilder(); + internalGetDnsNamesFieldBuilder(); + internalGetNodesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + serverCaCert_ = null; + if (serverCaCertBuilder_ != null) { + serverCaCertBuilder_.dispose(); + serverCaCertBuilder_ = null; + } + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + } else { + ipAddresses_ = null; + ipAddressesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + region_ = ""; + databaseVersion_ = 0; + backendType_ = 0; + pscEnabled_ = false; + dnsName_ = ""; + serverCaMode_ = 0; + customSubjectAlternativeNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + } else { + dnsNames_ = null; + dnsNamesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + nodeCount_ = 0; + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + } else { + nodes_ = null; + nodesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00001000); + mdxProtocolSupport_ = emptyIntList(); + connectionName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ConnectSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectSettings getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ConnectSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectSettings build() { + com.google.cloud.sql.v1beta4.ConnectSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectSettings buildPartial() { + com.google.cloud.sql.v1beta4.ConnectSettings result = + new com.google.cloud.sql.v1beta4.ConnectSettings(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1beta4.ConnectSettings result) { + if (ipAddressesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + ipAddresses_ = java.util.Collections.unmodifiableList(ipAddresses_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.ipAddresses_ = ipAddresses_; + } else { + result.ipAddresses_ = ipAddressesBuilder_.build(); + } + if (dnsNamesBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + dnsNames_ = java.util.Collections.unmodifiableList(dnsNames_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.dnsNames_ = dnsNames_; + } else { + result.dnsNames_ = dnsNamesBuilder_.build(); + } + if (nodesBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0)) { + nodes_ = java.util.Collections.unmodifiableList(nodes_); + bitField0_ = (bitField0_ & ~0x00001000); + } + result.nodes_ = nodes_; + } else { + result.nodes_ = nodesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ConnectSettings result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.serverCaCert_ = + serverCaCertBuilder_ == null ? serverCaCert_ : serverCaCertBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.region_ = region_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.databaseVersion_ = databaseVersion_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.backendType_ = backendType_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pscEnabled_ = pscEnabled_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.dnsName_ = dnsName_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.serverCaMode_ = serverCaMode_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + customSubjectAlternativeNames_.makeImmutable(); + result.customSubjectAlternativeNames_ = customSubjectAlternativeNames_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.nodeCount_ = nodeCount_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + mdxProtocolSupport_.makeImmutable(); + result.mdxProtocolSupport_ = mdxProtocolSupport_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.connectionName_ = connectionName_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ConnectSettings) { + return mergeFrom((com.google.cloud.sql.v1beta4.ConnectSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ConnectSettings other) { + if (other == com.google.cloud.sql.v1beta4.ConnectSettings.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasServerCaCert()) { + mergeServerCaCert(other.getServerCaCert()); + } + if (ipAddressesBuilder_ == null) { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddresses_.isEmpty()) { + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureIpAddressesIsMutable(); + ipAddresses_.addAll(other.ipAddresses_); + } + onChanged(); + } + } else { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddressesBuilder_.isEmpty()) { + ipAddressesBuilder_.dispose(); + ipAddressesBuilder_ = null; + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000004); + ipAddressesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetIpAddressesFieldBuilder() + : null; + } else { + ipAddressesBuilder_.addAllMessages(other.ipAddresses_); + } + } + } + if (!other.getRegion().isEmpty()) { + region_ = other.region_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.databaseVersion_ != 0) { + setDatabaseVersionValue(other.getDatabaseVersionValue()); + } + if (other.backendType_ != 0) { + setBackendTypeValue(other.getBackendTypeValue()); + } + if (other.getPscEnabled() != false) { + setPscEnabled(other.getPscEnabled()); + } + if (!other.getDnsName().isEmpty()) { + dnsName_ = other.dnsName_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.serverCaMode_ != 0) { + setServerCaModeValue(other.getServerCaModeValue()); + } + if (!other.customSubjectAlternativeNames_.isEmpty()) { + if (customSubjectAlternativeNames_.isEmpty()) { + customSubjectAlternativeNames_ = other.customSubjectAlternativeNames_; + bitField0_ |= 0x00000200; + } else { + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.addAll(other.customSubjectAlternativeNames_); + } + onChanged(); + } + if (dnsNamesBuilder_ == null) { + if (!other.dnsNames_.isEmpty()) { + if (dnsNames_.isEmpty()) { + dnsNames_ = other.dnsNames_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureDnsNamesIsMutable(); + dnsNames_.addAll(other.dnsNames_); + } + onChanged(); + } + } else { + if (!other.dnsNames_.isEmpty()) { + if (dnsNamesBuilder_.isEmpty()) { + dnsNamesBuilder_.dispose(); + dnsNamesBuilder_ = null; + dnsNames_ = other.dnsNames_; + bitField0_ = (bitField0_ & ~0x00000400); + dnsNamesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDnsNamesFieldBuilder() + : null; + } else { + dnsNamesBuilder_.addAllMessages(other.dnsNames_); + } + } + } + if (other.hasNodeCount()) { + setNodeCount(other.getNodeCount()); + } + if (nodesBuilder_ == null) { + if (!other.nodes_.isEmpty()) { + if (nodes_.isEmpty()) { + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00001000); + } else { + ensureNodesIsMutable(); + nodes_.addAll(other.nodes_); + } + onChanged(); + } + } else { + if (!other.nodes_.isEmpty()) { + if (nodesBuilder_.isEmpty()) { + nodesBuilder_.dispose(); + nodesBuilder_ = null; + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00001000); + nodesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetNodesFieldBuilder() + : null; + } else { + nodesBuilder_.addAllMessages(other.nodes_); + } + } + } + if (!other.mdxProtocolSupport_.isEmpty()) { + if (mdxProtocolSupport_.isEmpty()) { + mdxProtocolSupport_ = other.mdxProtocolSupport_; + mdxProtocolSupport_.makeImmutable(); + bitField0_ |= 0x00002000; + } else { + ensureMdxProtocolSupportIsMutable(); + mdxProtocolSupport_.addAll(other.mdxProtocolSupport_); + } + onChanged(); + } + if (!other.getConnectionName().isEmpty()) { + connectionName_ = other.connectionName_; + bitField0_ |= 0x00004000; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetServerCaCertFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.cloud.sql.v1beta4.IpMapping m = + input.readMessage( + com.google.cloud.sql.v1beta4.IpMapping.parser(), extensionRegistry); + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(m); + } else { + ipAddressesBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + region_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 248: + { + databaseVersion_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 248 + case 256: + { + backendType_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 256 + case 264: + { + pscEnabled_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 264 + case 274: + { + dnsName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 274 + case 280: + { + serverCaMode_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 280 + case 298: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.add(s); + break; + } // case 298 + case 306: + { + com.google.cloud.sql.v1beta4.DnsNameMapping m = + input.readMessage( + com.google.cloud.sql.v1beta4.DnsNameMapping.parser(), extensionRegistry); + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(m); + } else { + dnsNamesBuilder_.addMessage(m); + } + break; + } // case 306 + case 312: + { + int tmpRaw = input.readEnum(); + ensureMdxProtocolSupportIsMutable(); + mdxProtocolSupport_.addInt(tmpRaw); + break; + } // case 312 + case 314: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureMdxProtocolSupportIsMutable(); + while (input.getBytesUntilLimit() > 0) { + mdxProtocolSupport_.addInt(input.readEnum()); + } + input.popLimit(limit); + break; + } // case 314 + case 322: + { + connectionName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 322 + case 504: + { + nodeCount_ = input.readInt32(); + bitField0_ |= 0x00000800; + break; + } // case 504 + case 514: + { + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig m = + input.readMessage( + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.parser(), + extensionRegistry); + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(m); + } else { + nodesBuilder_.addMessage(m); + } + break; + } // case 514 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#connectSettings`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#connectSettings`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#connectSettings`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#connectSettings`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#connectSettings`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.SslCert serverCaCert_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + serverCaCertBuilder_; + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + * + * @return Whether the serverCaCert field is set. + */ + public boolean hasServerCaCert() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + * + * @return The serverCaCert. + */ + public com.google.cloud.sql.v1beta4.SslCert getServerCaCert() { + if (serverCaCertBuilder_ == null) { + return serverCaCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : serverCaCert_; + } else { + return serverCaCertBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + */ + public Builder setServerCaCert(com.google.cloud.sql.v1beta4.SslCert value) { + if (serverCaCertBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serverCaCert_ = value; + } else { + serverCaCertBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + */ + public Builder setServerCaCert(com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (serverCaCertBuilder_ == null) { + serverCaCert_ = builderForValue.build(); + } else { + serverCaCertBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + */ + public Builder mergeServerCaCert(com.google.cloud.sql.v1beta4.SslCert value) { + if (serverCaCertBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && serverCaCert_ != null + && serverCaCert_ != com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()) { + getServerCaCertBuilder().mergeFrom(value); + } else { + serverCaCert_ = value; + } + } else { + serverCaCertBuilder_.mergeFrom(value); + } + if (serverCaCert_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + */ + public Builder clearServerCaCert() { + bitField0_ = (bitField0_ & ~0x00000002); + serverCaCert_ = null; + if (serverCaCertBuilder_ != null) { + serverCaCertBuilder_.dispose(); + serverCaCertBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder getServerCaCertBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetServerCaCertFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + */ + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getServerCaCertOrBuilder() { + if (serverCaCertBuilder_ != null) { + return serverCaCertBuilder_.getMessageOrBuilder(); + } else { + return serverCaCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : serverCaCert_; + } + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + internalGetServerCaCertFieldBuilder() { + if (serverCaCertBuilder_ == null) { + serverCaCertBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder>( + getServerCaCert(), getParentForChildren(), isClean()); + serverCaCert_ = null; + } + return serverCaCertBuilder_; + } + + private java.util.List ipAddresses_ = + java.util.Collections.emptyList(); + + private void ensureIpAddressesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + ipAddresses_ = + new java.util.ArrayList(ipAddresses_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.IpMapping, + com.google.cloud.sql.v1beta4.IpMapping.Builder, + com.google.cloud.sql.v1beta4.IpMappingOrBuilder> + ipAddressesBuilder_; + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public java.util.List getIpAddressesList() { + if (ipAddressesBuilder_ == null) { + return java.util.Collections.unmodifiableList(ipAddresses_); + } else { + return ipAddressesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public int getIpAddressesCount() { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.size(); + } else { + return ipAddressesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public com.google.cloud.sql.v1beta4.IpMapping getIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public Builder setIpAddresses(int index, com.google.cloud.sql.v1beta4.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, value); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public Builder setIpAddresses( + int index, com.google.cloud.sql.v1beta4.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public Builder addIpAddresses(com.google.cloud.sql.v1beta4.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public Builder addIpAddresses(int index, com.google.cloud.sql.v1beta4.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public Builder addIpAddresses(com.google.cloud.sql.v1beta4.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public Builder addIpAddresses( + int index, com.google.cloud.sql.v1beta4.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public Builder addAllIpAddresses( + java.lang.Iterable values) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipAddresses_); + onChanged(); + } else { + ipAddressesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public Builder clearIpAddresses() { + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + ipAddressesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public Builder removeIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.remove(index); + onChanged(); + } else { + ipAddressesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public com.google.cloud.sql.v1beta4.IpMapping.Builder getIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public com.google.cloud.sql.v1beta4.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public java.util.List + getIpAddressesOrBuilderList() { + if (ipAddressesBuilder_ != null) { + return ipAddressesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(ipAddresses_); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public com.google.cloud.sql.v1beta4.IpMapping.Builder addIpAddressesBuilder() { + return internalGetIpAddressesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public com.google.cloud.sql.v1beta4.IpMapping.Builder addIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + public java.util.List + getIpAddressesBuilderList() { + return internalGetIpAddressesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.IpMapping, + com.google.cloud.sql.v1beta4.IpMapping.Builder, + com.google.cloud.sql.v1beta4.IpMappingOrBuilder> + internalGetIpAddressesFieldBuilder() { + if (ipAddressesBuilder_ == null) { + ipAddressesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.IpMapping, + com.google.cloud.sql.v1beta4.IpMapping.Builder, + com.google.cloud.sql.v1beta4.IpMappingOrBuilder>( + ipAddresses_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + ipAddresses_ = null; + } + return ipAddressesBuilder_; + } + + private java.lang.Object region_ = ""; + + /** + * + * + *
+     * The cloud region for the instance. e.g. `us-central1`, `europe-west1`.
+     * The region cannot be changed after instance creation.
+     * 
+ * + * string region = 4; + * + * @return The region. + */ + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The cloud region for the instance. e.g. `us-central1`, `europe-west1`.
+     * The region cannot be changed after instance creation.
+     * 
+ * + * string region = 4; + * + * @return The bytes for region. + */ + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The cloud region for the instance. e.g. `us-central1`, `europe-west1`.
+     * The region cannot be changed after instance creation.
+     * 
+ * + * string region = 4; + * + * @param value The region to set. + * @return This builder for chaining. + */ + public Builder setRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + region_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The cloud region for the instance. e.g. `us-central1`, `europe-west1`.
+     * The region cannot be changed after instance creation.
+     * 
+ * + * string region = 4; + * + * @return This builder for chaining. + */ + public Builder clearRegion() { + region_ = getDefaultInstance().getRegion(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The cloud region for the instance. e.g. `us-central1`, `europe-west1`.
+     * The region cannot be changed after instance creation.
+     * 
+ * + * string region = 4; + * + * @param value The bytes for region to set. + * @return This builder for chaining. + */ + public Builder setRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + region_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int databaseVersion_ = 0; + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion`
+     * field cannot be changed after instance creation.
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+     * or `MYSQL_5_6`.
+     * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+     * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+     * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+     * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 31; + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion`
+     * field cannot be changed after instance creation.
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+     * or `MYSQL_5_6`.
+     * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+     * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+     * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+     * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 31; + * + * @param value The enum numeric value on the wire for databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersionValue(int value) { + databaseVersion_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion`
+     * field cannot be changed after instance creation.
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+     * or `MYSQL_5_6`.
+     * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+     * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+     * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+     * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 31; + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1beta4.SqlDatabaseVersion result = + com.google.cloud.sql.v1beta4.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1beta4.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion`
+     * field cannot be changed after instance creation.
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+     * or `MYSQL_5_6`.
+     * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+     * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+     * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+     * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 31; + * + * @param value The databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersion(com.google.cloud.sql.v1beta4.SqlDatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + databaseVersion_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion`
+     * field cannot be changed after instance creation.
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+     * or `MYSQL_5_6`.
+     * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+     * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+     * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+     * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 31; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseVersion() { + bitField0_ = (bitField0_ & ~0x00000010); + databaseVersion_ = 0; + onChanged(); + return this; + } + + private int backendType_ = 0; + + /** + * + * + *
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 32; + * + * @return The enum numeric value on the wire for backendType. + */ + @java.lang.Override + public int getBackendTypeValue() { + return backendType_; + } + + /** + * + * + *
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 32; + * + * @param value The enum numeric value on the wire for backendType to set. + * @return This builder for chaining. + */ + public Builder setBackendTypeValue(int value) { + backendType_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 32; + * + * @return The backendType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackendType getBackendType() { + com.google.cloud.sql.v1beta4.SqlBackendType result = + com.google.cloud.sql.v1beta4.SqlBackendType.forNumber(backendType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlBackendType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 32; + * + * @param value The backendType to set. + * @return This builder for chaining. + */ + public Builder setBackendType(com.google.cloud.sql.v1beta4.SqlBackendType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + backendType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 32; + * + * @return This builder for chaining. + */ + public Builder clearBackendType() { + bitField0_ = (bitField0_ & ~0x00000020); + backendType_ = 0; + onChanged(); + return this; + } + + private boolean pscEnabled_; + + /** + * + * + *
+     * Whether PSC connectivity is enabled for this instance.
+     * 
+ * + * bool psc_enabled = 33; + * + * @return The pscEnabled. + */ + @java.lang.Override + public boolean getPscEnabled() { + return pscEnabled_; + } + + /** + * + * + *
+     * Whether PSC connectivity is enabled for this instance.
+     * 
+ * + * bool psc_enabled = 33; + * + * @param value The pscEnabled to set. + * @return This builder for chaining. + */ + public Builder setPscEnabled(boolean value) { + + pscEnabled_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether PSC connectivity is enabled for this instance.
+     * 
+ * + * bool psc_enabled = 33; + * + * @return This builder for chaining. + */ + public Builder clearPscEnabled() { + bitField0_ = (bitField0_ & ~0x00000040); + pscEnabled_ = false; + onChanged(); + return this; + } + + private java.lang.Object dnsName_ = ""; + + /** + * + * + *
+     * The dns name of the instance.
+     * 
+ * + * string dns_name = 34; + * + * @return The dnsName. + */ + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The dns name of the instance.
+     * 
+ * + * string dns_name = 34; + * + * @return The bytes for dnsName. + */ + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The dns name of the instance.
+     * 
+ * + * string dns_name = 34; + * + * @param value The dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dnsName_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The dns name of the instance.
+     * 
+ * + * string dns_name = 34; + * + * @return This builder for chaining. + */ + public Builder clearDnsName() { + dnsName_ = getDefaultInstance().getDnsName(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * The dns name of the instance.
+     * 
+ * + * string dns_name = 34; + * + * @param value The bytes for dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dnsName_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private int serverCaMode_ = 0; + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * .google.cloud.sql.v1beta4.ConnectSettings.CaMode server_ca_mode = 35; + * + * @return The enum numeric value on the wire for serverCaMode. + */ + @java.lang.Override + public int getServerCaModeValue() { + return serverCaMode_; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * .google.cloud.sql.v1beta4.ConnectSettings.CaMode server_ca_mode = 35; + * + * @param value The enum numeric value on the wire for serverCaMode to set. + * @return This builder for chaining. + */ + public Builder setServerCaModeValue(int value) { + serverCaMode_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * .google.cloud.sql.v1beta4.ConnectSettings.CaMode server_ca_mode = 35; + * + * @return The serverCaMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectSettings.CaMode getServerCaMode() { + com.google.cloud.sql.v1beta4.ConnectSettings.CaMode result = + com.google.cloud.sql.v1beta4.ConnectSettings.CaMode.forNumber(serverCaMode_); + return result == null + ? com.google.cloud.sql.v1beta4.ConnectSettings.CaMode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * .google.cloud.sql.v1beta4.ConnectSettings.CaMode server_ca_mode = 35; + * + * @param value The serverCaMode to set. + * @return This builder for chaining. + */ + public Builder setServerCaMode(com.google.cloud.sql.v1beta4.ConnectSettings.CaMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + serverCaMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * .google.cloud.sql.v1beta4.ConnectSettings.CaMode server_ca_mode = 35; + * + * @return This builder for chaining. + */ + public Builder clearServerCaMode() { + bitField0_ = (bitField0_ & ~0x00000100); + serverCaMode_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList customSubjectAlternativeNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureCustomSubjectAlternativeNamesIsMutable() { + if (!customSubjectAlternativeNames_.isModifiable()) { + customSubjectAlternativeNames_ = + new com.google.protobuf.LazyStringArrayList(customSubjectAlternativeNames_); + } + bitField0_ |= 0x00000200; + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @return A list containing the customSubjectAlternativeNames. + */ + public com.google.protobuf.ProtocolStringList getCustomSubjectAlternativeNamesList() { + customSubjectAlternativeNames_.makeImmutable(); + return customSubjectAlternativeNames_; + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @return The count of customSubjectAlternativeNames. + */ + public int getCustomSubjectAlternativeNamesCount() { + return customSubjectAlternativeNames_.size(); + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param index The index of the element to return. + * @return The customSubjectAlternativeNames at the given index. + */ + public java.lang.String getCustomSubjectAlternativeNames(int index) { + return customSubjectAlternativeNames_.get(index); + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param index The index of the value to return. + * @return The bytes of the customSubjectAlternativeNames at the given index. + */ + public com.google.protobuf.ByteString getCustomSubjectAlternativeNamesBytes(int index) { + return customSubjectAlternativeNames_.getByteString(index); + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param index The index to set the value at. + * @param value The customSubjectAlternativeNames to set. + * @return This builder for chaining. + */ + public Builder setCustomSubjectAlternativeNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.set(index, value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param value The customSubjectAlternativeNames to add. + * @return This builder for chaining. + */ + public Builder addCustomSubjectAlternativeNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.add(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param values The customSubjectAlternativeNames to add. + * @return This builder for chaining. + */ + public Builder addAllCustomSubjectAlternativeNames( + java.lang.Iterable values) { + ensureCustomSubjectAlternativeNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, customSubjectAlternativeNames_); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @return This builder for chaining. + */ + public Builder clearCustomSubjectAlternativeNames() { + customSubjectAlternativeNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Custom subject alternative names for the server certificate.
+     * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param value The bytes of the customSubjectAlternativeNames to add. + * @return This builder for chaining. + */ + public Builder addCustomSubjectAlternativeNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.add(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.util.List dnsNames_ = + java.util.Collections.emptyList(); + + private void ensureDnsNamesIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + dnsNames_ = new java.util.ArrayList(dnsNames_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DnsNameMapping, + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder, + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder> + dnsNamesBuilder_; + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getDnsNamesList() { + if (dnsNamesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dnsNames_); + } else { + return dnsNamesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getDnsNamesCount() { + if (dnsNamesBuilder_ == null) { + return dnsNames_.size(); + } else { + return dnsNamesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping getDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames(int index, com.google.cloud.sql.v1beta4.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.set(index, value); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames( + int index, com.google.cloud.sql.v1beta4.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.set(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(com.google.cloud.sql.v1beta4.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(int index, com.google.cloud.sql.v1beta4.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(index, value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames( + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames( + int index, com.google.cloud.sql.v1beta4.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllDnsNames( + java.lang.Iterable values) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dnsNames_); + onChanged(); + } else { + dnsNamesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDnsNames() { + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + dnsNamesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.remove(index); + onChanged(); + } else { + dnsNamesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping.Builder getDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDnsNamesOrBuilderList() { + if (dnsNamesBuilder_ != null) { + return dnsNamesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dnsNames_); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping.Builder addDnsNamesBuilder() { + return internalGetDnsNamesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping.Builder addDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDnsNamesBuilderList() { + return internalGetDnsNamesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DnsNameMapping, + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder, + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder> + internalGetDnsNamesFieldBuilder() { + if (dnsNamesBuilder_ == null) { + dnsNamesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DnsNameMapping, + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder, + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder>( + dnsNames_, ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean()); + dnsNames_ = null; + } + return dnsNamesBuilder_; + } + + private int nodeCount_; + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @return Whether the nodeCount field is set. + */ + @java.lang.Override + public boolean hasNodeCount() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @param value The nodeCount to set. + * @return This builder for chaining. + */ + public Builder setNodeCount(int value) { + + nodeCount_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @return This builder for chaining. + */ + public Builder clearNodeCount() { + bitField0_ = (bitField0_ & ~0x00000800); + nodeCount_ = 0; + onChanged(); + return this; + } + + private java.util.List + nodes_ = java.util.Collections.emptyList(); + + private void ensureNodesIsMutable() { + if (!((bitField0_ & 0x00001000) != 0)) { + nodes_ = + new java.util.ArrayList< + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig>(nodes_); + bitField0_ |= 0x00001000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig, + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.Builder, + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfigOrBuilder> + nodesBuilder_; + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNodesList() { + if (nodesBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodes_); + } else { + return nodesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getNodesCount() { + if (nodesBuilder_ == null) { + return nodes_.size(); + } else { + return nodesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig getNodes(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodes( + int index, com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.set(index, value); + onChanged(); + } else { + nodesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodes( + int index, + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.Builder + builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.set(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(value); + onChanged(); + } else { + nodesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + int index, com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(index, value); + onChanged(); + } else { + nodesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.Builder + builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + int index, + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.Builder + builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllNodes( + java.lang.Iterable< + ? extends com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig> + values) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, nodes_); + onChanged(); + } else { + nodesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearNodes() { + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + } else { + nodesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeNodes(int index) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.remove(index); + onChanged(); + } else { + nodesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.Builder + getNodesBuilder(int index) { + return internalGetNodesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfigOrBuilder + getNodesOrBuilder(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + ? extends com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfigOrBuilder> + getNodesOrBuilderList() { + if (nodesBuilder_ != null) { + return nodesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodes_); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.Builder + addNodesBuilder() { + return internalGetNodesFieldBuilder() + .addBuilder( + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig + .getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.Builder + addNodesBuilder(int index) { + return internalGetNodesFieldBuilder() + .addBuilder( + index, + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig + .getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.Builder> + getNodesBuilderList() { + return internalGetNodesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig, + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.Builder, + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfigOrBuilder> + internalGetNodesFieldBuilder() { + if (nodesBuilder_ == null) { + nodesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig, + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.Builder, + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfigOrBuilder>( + nodes_, ((bitField0_ & 0x00001000) != 0), getParentForChildren(), isClean()); + nodes_ = null; + } + return nodesBuilder_; + } + + private com.google.protobuf.Internal.IntList mdxProtocolSupport_ = emptyIntList(); + + private void ensureMdxProtocolSupportIsMutable() { + if (!mdxProtocolSupport_.isModifiable()) { + mdxProtocolSupport_ = makeMutableCopy(mdxProtocolSupport_); + } + bitField0_ |= 0x00002000; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the mdxProtocolSupport. + */ + public java.util.List + getMdxProtocolSupportList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport>( + mdxProtocolSupport_, mdxProtocolSupport_converter_); + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of mdxProtocolSupport. + */ + public int getMdxProtocolSupportCount() { + return mdxProtocolSupport_.size(); + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The mdxProtocolSupport at the given index. + */ + public com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport getMdxProtocolSupport( + int index) { + return mdxProtocolSupport_converter_.convert(mdxProtocolSupport_.getInt(index)); + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The mdxProtocolSupport to set. + * @return This builder for chaining. + */ + public Builder setMdxProtocolSupport( + int index, com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMdxProtocolSupportIsMutable(); + mdxProtocolSupport_.setInt(index, value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mdxProtocolSupport to add. + * @return This builder for chaining. + */ + public Builder addMdxProtocolSupport( + com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMdxProtocolSupportIsMutable(); + mdxProtocolSupport_.addInt(value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The mdxProtocolSupport to add. + * @return This builder for chaining. + */ + public Builder addAllMdxProtocolSupport( + java.lang.Iterable< + ? extends com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport> + values) { + ensureMdxProtocolSupportIsMutable(); + for (com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport value : values) { + mdxProtocolSupport_.addInt(value.getNumber()); + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMdxProtocolSupport() { + mdxProtocolSupport_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for mdxProtocolSupport. + */ + public java.util.List getMdxProtocolSupportValueList() { + mdxProtocolSupport_.makeImmutable(); + return mdxProtocolSupport_; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of mdxProtocolSupport at the given index. + */ + public int getMdxProtocolSupportValue(int index) { + return mdxProtocolSupport_.getInt(index); + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for mdxProtocolSupport to set. + * @return This builder for chaining. + */ + public Builder setMdxProtocolSupportValue(int index, int value) { + ensureMdxProtocolSupportIsMutable(); + mdxProtocolSupport_.setInt(index, value); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for mdxProtocolSupport to add. + * @return This builder for chaining. + */ + public Builder addMdxProtocolSupportValue(int value) { + ensureMdxProtocolSupportIsMutable(); + mdxProtocolSupport_.addInt(value); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. mdx_protocol_support controls how the client uses
+     * metadata exchange when connecting to the instance. The values in the list
+     * representing parts of the MDX protocol that are supported by this instance.
+     * When the list is empty, the instance does not support MDX, so the client
+     * must not send an MDX request. The default is empty.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The enum numeric values on the wire for mdxProtocolSupport to add. + * @return This builder for chaining. + */ + public Builder addAllMdxProtocolSupportValue(java.lang.Iterable values) { + ensureMdxProtocolSupportIsMutable(); + for (int value : values) { + mdxProtocolSupport_.addInt(value); + } + onChanged(); + return this; + } + + private java.lang.Object connectionName_ = ""; + + /** + * + * + *
+     * Optional. Output only. Connection name of the Cloud SQL instance used in
+     * connection strings, in the format project:region:instance.
+     * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The connectionName. + */ + public java.lang.String getConnectionName() { + java.lang.Object ref = connectionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Output only. Connection name of the Cloud SQL instance used in
+     * connection strings, in the format project:region:instance.
+     * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for connectionName. + */ + public com.google.protobuf.ByteString getConnectionNameBytes() { + java.lang.Object ref = connectionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Output only. Connection name of the Cloud SQL instance used in
+     * connection strings, in the format project:region:instance.
+     * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The connectionName to set. + * @return This builder for chaining. + */ + public Builder setConnectionName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + connectionName_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. Connection name of the Cloud SQL instance used in
+     * connection strings, in the format project:region:instance.
+     * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearConnectionName() { + connectionName_ = getDefaultInstance().getConnectionName(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Output only. Connection name of the Cloud SQL instance used in
+     * connection strings, in the format project:region:instance.
+     * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for connectionName to set. + * @return This builder for chaining. + */ + public Builder setConnectionNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + connectionName_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ConnectSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ConnectSettings) + private static final com.google.cloud.sql.v1beta4.ConnectSettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ConnectSettings(); + } + + public static com.google.cloud.sql.v1beta4.ConnectSettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectSettingsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectSettingsOrBuilder.java new file mode 100644 index 000000000000..1fcbba8968b6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectSettingsOrBuilder.java @@ -0,0 +1,667 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ConnectSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ConnectSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#connectSettings`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#connectSettings`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + * + * @return Whether the serverCaCert field is set. + */ + boolean hasServerCaCert(); + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + * + * @return The serverCaCert. + */ + com.google.cloud.sql.v1beta4.SslCert getServerCaCert(); + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 2; + */ + com.google.cloud.sql.v1beta4.SslCertOrBuilder getServerCaCertOrBuilder(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + java.util.List getIpAddressesList(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + com.google.cloud.sql.v1beta4.IpMapping getIpAddresses(int index); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + int getIpAddressesCount(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + java.util.List + getIpAddressesOrBuilderList(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3; + */ + com.google.cloud.sql.v1beta4.IpMappingOrBuilder getIpAddressesOrBuilder(int index); + + /** + * + * + *
+   * The cloud region for the instance. e.g. `us-central1`, `europe-west1`.
+   * The region cannot be changed after instance creation.
+   * 
+ * + * string region = 4; + * + * @return The region. + */ + java.lang.String getRegion(); + + /** + * + * + *
+   * The cloud region for the instance. e.g. `us-central1`, `europe-west1`.
+   * The region cannot be changed after instance creation.
+   * 
+ * + * string region = 4; + * + * @return The bytes for region. + */ + com.google.protobuf.ByteString getRegionBytes(); + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion`
+   * field cannot be changed after instance creation.
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+   * or `MYSQL_5_6`.
+   * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+   * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+   * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+   * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 31; + * + * @return The enum numeric value on the wire for databaseVersion. + */ + int getDatabaseVersionValue(); + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion`
+   * field cannot be changed after instance creation.
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
+   * or `MYSQL_5_6`.
+   * PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
+   * SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
+   * `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
+   * `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 31; + * + * @return The databaseVersion. + */ + com.google.cloud.sql.v1beta4.SqlDatabaseVersion getDatabaseVersion(); + + /** + * + * + *
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 32; + * + * @return The enum numeric value on the wire for backendType. + */ + int getBackendTypeValue(); + + /** + * + * + *
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 32; + * + * @return The backendType. + */ + com.google.cloud.sql.v1beta4.SqlBackendType getBackendType(); + + /** + * + * + *
+   * Whether PSC connectivity is enabled for this instance.
+   * 
+ * + * bool psc_enabled = 33; + * + * @return The pscEnabled. + */ + boolean getPscEnabled(); + + /** + * + * + *
+   * The dns name of the instance.
+   * 
+ * + * string dns_name = 34; + * + * @return The dnsName. + */ + java.lang.String getDnsName(); + + /** + * + * + *
+   * The dns name of the instance.
+   * 
+ * + * string dns_name = 34; + * + * @return The bytes for dnsName. + */ + com.google.protobuf.ByteString getDnsNameBytes(); + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * .google.cloud.sql.v1beta4.ConnectSettings.CaMode server_ca_mode = 35; + * + * @return The enum numeric value on the wire for serverCaMode. + */ + int getServerCaModeValue(); + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * .google.cloud.sql.v1beta4.ConnectSettings.CaMode server_ca_mode = 35; + * + * @return The serverCaMode. + */ + com.google.cloud.sql.v1beta4.ConnectSettings.CaMode getServerCaMode(); + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @return A list containing the customSubjectAlternativeNames. + */ + java.util.List getCustomSubjectAlternativeNamesList(); + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @return The count of customSubjectAlternativeNames. + */ + int getCustomSubjectAlternativeNamesCount(); + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param index The index of the element to return. + * @return The customSubjectAlternativeNames at the given index. + */ + java.lang.String getCustomSubjectAlternativeNames(int index); + + /** + * + * + *
+   * Custom subject alternative names for the server certificate.
+   * 
+ * + * repeated string custom_subject_alternative_names = 37; + * + * @param index The index of the value to return. + * @return The bytes of the customSubjectAlternativeNames at the given index. + */ + com.google.protobuf.ByteString getCustomSubjectAlternativeNamesBytes(int index); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getDnsNamesList(); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.DnsNameMapping getDnsNames(int index); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getDnsNamesCount(); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getDnsNamesOrBuilderList(); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index); + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return Whether the nodeCount field is set. + */ + boolean hasNodeCount(); + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return The nodeCount. + */ + int getNodeCount(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getNodesList(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig getNodes(int index); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getNodesCount(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List< + ? extends com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfigOrBuilder> + getNodesOrBuilderList(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfigOrBuilder getNodesOrBuilder( + int index); + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the mdxProtocolSupport. + */ + java.util.List + getMdxProtocolSupportList(); + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of mdxProtocolSupport. + */ + int getMdxProtocolSupportCount(); + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The mdxProtocolSupport at the given index. + */ + com.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport getMdxProtocolSupport(int index); + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for mdxProtocolSupport. + */ + java.util.List getMdxProtocolSupportValueList(); + + /** + * + * + *
+   * Optional. Output only. mdx_protocol_support controls how the client uses
+   * metadata exchange when connecting to the instance. The values in the list
+   * representing parts of the MDX protocol that are supported by this instance.
+   * When the list is empty, the instance does not support MDX, so the client
+   * must not send an MDX request. The default is empty.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport mdx_protocol_support = 39 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of mdxProtocolSupport at the given index. + */ + int getMdxProtocolSupportValue(int index); + + /** + * + * + *
+   * Optional. Output only. Connection name of the Cloud SQL instance used in
+   * connection strings, in the format project:region:instance.
+   * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The connectionName. + */ + java.lang.String getConnectionName(); + + /** + * + * + *
+   * Optional. Output only. Connection name of the Cloud SQL instance used in
+   * connection strings, in the format project:region:instance.
+   * 
+ * + * + * string connection_name = 40 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for connectionName. + */ + com.google.protobuf.ByteString getConnectionNameBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectionPoolConfig.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectionPoolConfig.java new file mode 100644 index 000000000000..8aa4f82fed08 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectionPoolConfig.java @@ -0,0 +1,1243 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The managed connection pooling configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ConnectionPoolConfig} + */ +@com.google.protobuf.Generated +public final class ConnectionPoolConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ConnectionPoolConfig) + ConnectionPoolConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ConnectionPoolConfig"); + } + + // Use ConnectionPoolConfig.newBuilder() to construct. + private ConnectionPoolConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ConnectionPoolConfig() { + flags_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ConnectionPoolConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ConnectionPoolConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ConnectionPoolConfig.class, + com.google.cloud.sql.v1beta4.ConnectionPoolConfig.Builder.class); + } + + private int bitField0_; + public static final int CONNECTION_POOLING_ENABLED_FIELD_NUMBER = 1; + private boolean connectionPoolingEnabled_ = false; + + /** + * + * + *
+   * Whether managed connection pooling is enabled.
+   * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @return Whether the connectionPoolingEnabled field is set. + */ + @java.lang.Override + public boolean hasConnectionPoolingEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Whether managed connection pooling is enabled.
+   * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @return The connectionPoolingEnabled. + */ + @java.lang.Override + public boolean getConnectionPoolingEnabled() { + return connectionPoolingEnabled_; + } + + public static final int FLAGS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private java.util.List flags_; + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getFlagsList() { + return flags_; + } + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getFlagsOrBuilderList() { + return flags_; + } + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getFlagsCount() { + return flags_.size(); + } + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectionPoolFlags getFlags(int index) { + return flags_.get(index); + } + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectionPoolFlagsOrBuilder getFlagsOrBuilder(int index) { + return flags_.get(index); + } + + public static final int POOLER_COUNT_FIELD_NUMBER = 9; + private int poolerCount_ = 0; + + /** + * + * + *
+   * Output only. Number of connection poolers.
+   * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the poolerCount field is set. + */ + @java.lang.Override + public boolean hasPoolerCount() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. Number of connection poolers.
+   * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The poolerCount. + */ + @java.lang.Override + public int getPoolerCount() { + return poolerCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, connectionPoolingEnabled_); + } + for (int i = 0; i < flags_.size(); i++) { + output.writeMessage(8, flags_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(9, poolerCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, connectionPoolingEnabled_); + } + for (int i = 0; i < flags_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, flags_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, poolerCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ConnectionPoolConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ConnectionPoolConfig other = + (com.google.cloud.sql.v1beta4.ConnectionPoolConfig) obj; + + if (hasConnectionPoolingEnabled() != other.hasConnectionPoolingEnabled()) return false; + if (hasConnectionPoolingEnabled()) { + if (getConnectionPoolingEnabled() != other.getConnectionPoolingEnabled()) return false; + } + if (!getFlagsList().equals(other.getFlagsList())) return false; + if (hasPoolerCount() != other.hasPoolerCount()) return false; + if (hasPoolerCount()) { + if (getPoolerCount() != other.getPoolerCount()) return false; + } + if (!getUnknownFields().equals(other.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 (hasConnectionPoolingEnabled()) { + hash = (37 * hash) + CONNECTION_POOLING_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getConnectionPoolingEnabled()); + } + if (getFlagsCount() > 0) { + hash = (37 * hash) + FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getFlagsList().hashCode(); + } + if (hasPoolerCount()) { + hash = (37 * hash) + POOLER_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPoolerCount(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.ConnectionPoolConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The managed connection pooling configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ConnectionPoolConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ConnectionPoolConfig) + com.google.cloud.sql.v1beta4.ConnectionPoolConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ConnectionPoolConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ConnectionPoolConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ConnectionPoolConfig.class, + com.google.cloud.sql.v1beta4.ConnectionPoolConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ConnectionPoolConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + connectionPoolingEnabled_ = false; + if (flagsBuilder_ == null) { + flags_ = java.util.Collections.emptyList(); + } else { + flags_ = null; + flagsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + poolerCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ConnectionPoolConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectionPoolConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ConnectionPoolConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectionPoolConfig build() { + com.google.cloud.sql.v1beta4.ConnectionPoolConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectionPoolConfig buildPartial() { + com.google.cloud.sql.v1beta4.ConnectionPoolConfig result = + new com.google.cloud.sql.v1beta4.ConnectionPoolConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.ConnectionPoolConfig result) { + if (flagsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + flags_ = java.util.Collections.unmodifiableList(flags_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.flags_ = flags_; + } else { + result.flags_ = flagsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ConnectionPoolConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.connectionPoolingEnabled_ = connectionPoolingEnabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.poolerCount_ = poolerCount_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ConnectionPoolConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.ConnectionPoolConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ConnectionPoolConfig other) { + if (other == com.google.cloud.sql.v1beta4.ConnectionPoolConfig.getDefaultInstance()) + return this; + if (other.hasConnectionPoolingEnabled()) { + setConnectionPoolingEnabled(other.getConnectionPoolingEnabled()); + } + if (flagsBuilder_ == null) { + if (!other.flags_.isEmpty()) { + if (flags_.isEmpty()) { + flags_ = other.flags_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFlagsIsMutable(); + flags_.addAll(other.flags_); + } + onChanged(); + } + } else { + if (!other.flags_.isEmpty()) { + if (flagsBuilder_.isEmpty()) { + flagsBuilder_.dispose(); + flagsBuilder_ = null; + flags_ = other.flags_; + bitField0_ = (bitField0_ & ~0x00000002); + flagsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetFlagsFieldBuilder() + : null; + } else { + flagsBuilder_.addAllMessages(other.flags_); + } + } + } + if (other.hasPoolerCount()) { + setPoolerCount(other.getPoolerCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + connectionPoolingEnabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 66: + { + com.google.cloud.sql.v1beta4.ConnectionPoolFlags m = + input.readMessage( + com.google.cloud.sql.v1beta4.ConnectionPoolFlags.parser(), + extensionRegistry); + if (flagsBuilder_ == null) { + ensureFlagsIsMutable(); + flags_.add(m); + } else { + flagsBuilder_.addMessage(m); + } + break; + } // case 66 + case 72: + { + poolerCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + 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 bitField0_; + + private boolean connectionPoolingEnabled_; + + /** + * + * + *
+     * Whether managed connection pooling is enabled.
+     * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @return Whether the connectionPoolingEnabled field is set. + */ + @java.lang.Override + public boolean hasConnectionPoolingEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Whether managed connection pooling is enabled.
+     * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @return The connectionPoolingEnabled. + */ + @java.lang.Override + public boolean getConnectionPoolingEnabled() { + return connectionPoolingEnabled_; + } + + /** + * + * + *
+     * Whether managed connection pooling is enabled.
+     * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @param value The connectionPoolingEnabled to set. + * @return This builder for chaining. + */ + public Builder setConnectionPoolingEnabled(boolean value) { + + connectionPoolingEnabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether managed connection pooling is enabled.
+     * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearConnectionPoolingEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + connectionPoolingEnabled_ = false; + onChanged(); + return this; + } + + private java.util.List flags_ = + java.util.Collections.emptyList(); + + private void ensureFlagsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + flags_ = new java.util.ArrayList(flags_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ConnectionPoolFlags, + com.google.cloud.sql.v1beta4.ConnectionPoolFlags.Builder, + com.google.cloud.sql.v1beta4.ConnectionPoolFlagsOrBuilder> + flagsBuilder_; + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getFlagsList() { + if (flagsBuilder_ == null) { + return java.util.Collections.unmodifiableList(flags_); + } else { + return flagsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getFlagsCount() { + if (flagsBuilder_ == null) { + return flags_.size(); + } else { + return flagsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ConnectionPoolFlags getFlags(int index) { + if (flagsBuilder_ == null) { + return flags_.get(index); + } else { + return flagsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFlags(int index, com.google.cloud.sql.v1beta4.ConnectionPoolFlags value) { + if (flagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlagsIsMutable(); + flags_.set(index, value); + onChanged(); + } else { + flagsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFlags( + int index, com.google.cloud.sql.v1beta4.ConnectionPoolFlags.Builder builderForValue) { + if (flagsBuilder_ == null) { + ensureFlagsIsMutable(); + flags_.set(index, builderForValue.build()); + onChanged(); + } else { + flagsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addFlags(com.google.cloud.sql.v1beta4.ConnectionPoolFlags value) { + if (flagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlagsIsMutable(); + flags_.add(value); + onChanged(); + } else { + flagsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addFlags(int index, com.google.cloud.sql.v1beta4.ConnectionPoolFlags value) { + if (flagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlagsIsMutable(); + flags_.add(index, value); + onChanged(); + } else { + flagsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addFlags( + com.google.cloud.sql.v1beta4.ConnectionPoolFlags.Builder builderForValue) { + if (flagsBuilder_ == null) { + ensureFlagsIsMutable(); + flags_.add(builderForValue.build()); + onChanged(); + } else { + flagsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addFlags( + int index, com.google.cloud.sql.v1beta4.ConnectionPoolFlags.Builder builderForValue) { + if (flagsBuilder_ == null) { + ensureFlagsIsMutable(); + flags_.add(index, builderForValue.build()); + onChanged(); + } else { + flagsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllFlags( + java.lang.Iterable values) { + if (flagsBuilder_ == null) { + ensureFlagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, flags_); + onChanged(); + } else { + flagsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFlags() { + if (flagsBuilder_ == null) { + flags_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + flagsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeFlags(int index) { + if (flagsBuilder_ == null) { + ensureFlagsIsMutable(); + flags_.remove(index); + onChanged(); + } else { + flagsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ConnectionPoolFlags.Builder getFlagsBuilder(int index) { + return internalGetFlagsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ConnectionPoolFlagsOrBuilder getFlagsOrBuilder(int index) { + if (flagsBuilder_ == null) { + return flags_.get(index); + } else { + return flagsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getFlagsOrBuilderList() { + if (flagsBuilder_ != null) { + return flagsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(flags_); + } + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ConnectionPoolFlags.Builder addFlagsBuilder() { + return internalGetFlagsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.ConnectionPoolFlags.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ConnectionPoolFlags.Builder addFlagsBuilder(int index) { + return internalGetFlagsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.ConnectionPoolFlags.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. List of connection pool configuration flags.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getFlagsBuilderList() { + return internalGetFlagsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ConnectionPoolFlags, + com.google.cloud.sql.v1beta4.ConnectionPoolFlags.Builder, + com.google.cloud.sql.v1beta4.ConnectionPoolFlagsOrBuilder> + internalGetFlagsFieldBuilder() { + if (flagsBuilder_ == null) { + flagsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ConnectionPoolFlags, + com.google.cloud.sql.v1beta4.ConnectionPoolFlags.Builder, + com.google.cloud.sql.v1beta4.ConnectionPoolFlagsOrBuilder>( + flags_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + flags_ = null; + } + return flagsBuilder_; + } + + private int poolerCount_; + + /** + * + * + *
+     * Output only. Number of connection poolers.
+     * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the poolerCount field is set. + */ + @java.lang.Override + public boolean hasPoolerCount() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Output only. Number of connection poolers.
+     * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The poolerCount. + */ + @java.lang.Override + public int getPoolerCount() { + return poolerCount_; + } + + /** + * + * + *
+     * Output only. Number of connection poolers.
+     * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The poolerCount to set. + * @return This builder for chaining. + */ + public Builder setPoolerCount(int value) { + + poolerCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Number of connection poolers.
+     * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPoolerCount() { + bitField0_ = (bitField0_ & ~0x00000004); + poolerCount_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ConnectionPoolConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ConnectionPoolConfig) + private static final com.google.cloud.sql.v1beta4.ConnectionPoolConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ConnectionPoolConfig(); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionPoolConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectionPoolConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectionPoolConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectionPoolConfigOrBuilder.java new file mode 100644 index 000000000000..71e43afe557a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectionPoolConfigOrBuilder.java @@ -0,0 +1,146 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ConnectionPoolConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ConnectionPoolConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether managed connection pooling is enabled.
+   * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @return Whether the connectionPoolingEnabled field is set. + */ + boolean hasConnectionPoolingEnabled(); + + /** + * + * + *
+   * Whether managed connection pooling is enabled.
+   * 
+ * + * optional bool connection_pooling_enabled = 1; + * + * @return The connectionPoolingEnabled. + */ + boolean getConnectionPoolingEnabled(); + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getFlagsList(); + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.ConnectionPoolFlags getFlags(int index); + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getFlagsCount(); + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getFlagsOrBuilderList(); + + /** + * + * + *
+   * Optional. List of connection pool configuration flags.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ConnectionPoolFlags flags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.ConnectionPoolFlagsOrBuilder getFlagsOrBuilder(int index); + + /** + * + * + *
+   * Output only. Number of connection poolers.
+   * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the poolerCount field is set. + */ + boolean hasPoolerCount(); + + /** + * + * + *
+   * Output only. Number of connection poolers.
+   * 
+ * + * optional int32 pooler_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The poolerCount. + */ + int getPoolerCount(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectionPoolFlags.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectionPoolFlags.java new file mode 100644 index 000000000000..60b71a09b7a1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectionPoolFlags.java @@ -0,0 +1,801 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Connection pool flags for Cloud SQL instances managed connection pool
+ * configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ConnectionPoolFlags} + */ +@com.google.protobuf.Generated +public final class ConnectionPoolFlags extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ConnectionPoolFlags) + ConnectionPoolFlagsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ConnectionPoolFlags"); + } + + // Use ConnectionPoolFlags.newBuilder() to construct. + private ConnectionPoolFlags(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ConnectionPoolFlags() { + name_ = ""; + value_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ConnectionPoolFlags_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ConnectionPoolFlags_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ConnectionPoolFlags.class, + com.google.cloud.sql.v1beta4.ConnectionPoolFlags.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The name of the flag.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name of the flag.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + + /** + * + * + *
+   * Required. The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ConnectionPoolFlags)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ConnectionPoolFlags other = + (com.google.cloud.sql.v1beta4.ConnectionPoolFlags) obj; + + if (!getName().equals(other.getName())) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolFlags parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolFlags parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolFlags parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolFlags parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolFlags parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolFlags parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolFlags parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolFlags parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolFlags parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolFlags parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolFlags parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolFlags parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.ConnectionPoolFlags prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Connection pool flags for Cloud SQL instances managed connection pool
+   * configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ConnectionPoolFlags} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ConnectionPoolFlags) + com.google.cloud.sql.v1beta4.ConnectionPoolFlagsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ConnectionPoolFlags_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ConnectionPoolFlags_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ConnectionPoolFlags.class, + com.google.cloud.sql.v1beta4.ConnectionPoolFlags.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ConnectionPoolFlags.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + value_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ConnectionPoolFlags_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectionPoolFlags getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ConnectionPoolFlags.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectionPoolFlags build() { + com.google.cloud.sql.v1beta4.ConnectionPoolFlags result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectionPoolFlags buildPartial() { + com.google.cloud.sql.v1beta4.ConnectionPoolFlags result = + new com.google.cloud.sql.v1beta4.ConnectionPoolFlags(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ConnectionPoolFlags result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ConnectionPoolFlags) { + return mergeFrom((com.google.cloud.sql.v1beta4.ConnectionPoolFlags) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ConnectionPoolFlags other) { + if (other == com.google.cloud.sql.v1beta4.ConnectionPoolFlags.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + 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: + { + value_ = 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 flag.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name of the flag.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name of the flag.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the flag.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the flag.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + + /** + * + * + *
+     * Required. The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ConnectionPoolFlags) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ConnectionPoolFlags) + private static final com.google.cloud.sql.v1beta4.ConnectionPoolFlags DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ConnectionPoolFlags(); + } + + public static com.google.cloud.sql.v1beta4.ConnectionPoolFlags getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionPoolFlags parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectionPoolFlags getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectionPoolFlagsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectionPoolFlagsOrBuilder.java new file mode 100644 index 000000000000..666b907595dc --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ConnectionPoolFlagsOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ConnectionPoolFlagsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ConnectionPoolFlags) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the flag.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The name of the flag.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + java.lang.String getValue(); + + /** + * + * + *
+   * Required. The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ContinueSession.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ContinueSession.java new file mode 100644 index 000000000000..0d8bf06f3eda --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ContinueSession.java @@ -0,0 +1,1019 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Reconnects to an existing session. The client must send this as the first
+ * message to the server to reconnect to an existing session. The client may
+ * immediately send Data messages without waiting for a reply from the server.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ContinueSession} + */ +@com.google.protobuf.Generated +public final class ContinueSession extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ContinueSession) + ContinueSessionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ContinueSession"); + } + + // Use ContinueSession.newBuilder() to construct. + private ContinueSession(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ContinueSession() { + locationId_ = ""; + instanceId_ = ""; + sessionId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_ContinueSession_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_ContinueSession_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ContinueSession.class, + com.google.cloud.sql.v1beta4.ContinueSession.Builder.class); + } + + public static final int LOCATION_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object locationId_ = ""; + + /** + * + * + *
+   * Required. `location_id` is used to route the
+   * request to a specific region. Use the same region which was used to create
+   * the instance. Use the format `locations/{location}`, for example:
+   * `locations/us-central1`.
+   * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The locationId. + */ + @java.lang.Override + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. `location_id` is used to route the
+   * request to a specific region. Use the same region which was used to create
+   * the instance. Use the format `locations/{location}`, for example:
+   * `locations/us-central1`.
+   * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for locationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationId_ = 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 Cloud SQL instance resource name, for example:
+   * projects/example-project/instances/example-instance
+   * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 Cloud SQL instance resource name, for example:
+   * projects/example-project/instances/example-instance
+   * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 SESSION_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object sessionId_ = ""; + + /** + * + * + *
+   * Required. The id of the session to reconnect.
+   * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sessionId. + */ + @java.lang.Override + public java.lang.String getSessionId() { + java.lang.Object ref = sessionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sessionId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The id of the session to reconnect.
+   * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for sessionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSessionIdBytes() { + java.lang.Object ref = sessionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sessionId_ = 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.GeneratedMessage.isStringEmpty(locationId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, locationId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instanceId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sessionId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, sessionId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(locationId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, locationId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instanceId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sessionId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, sessionId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ContinueSession)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ContinueSession other = + (com.google.cloud.sql.v1beta4.ContinueSession) obj; + + if (!getLocationId().equals(other.getLocationId())) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (!getSessionId().equals(other.getSessionId())) return false; + if (!getUnknownFields().equals(other.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) + LOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getLocationId().hashCode(); + hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + hash = (37 * hash) + SESSION_ID_FIELD_NUMBER; + hash = (53 * hash) + getSessionId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ContinueSession parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ContinueSession parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ContinueSession parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ContinueSession parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ContinueSession parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ContinueSession parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ContinueSession parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ContinueSession parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ContinueSession parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ContinueSession parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ContinueSession parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ContinueSession parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.ContinueSession prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Reconnects to an existing session. The client must send this as the first
+   * message to the server to reconnect to an existing session. The client may
+   * immediately send Data messages without waiting for a reply from the server.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ContinueSession} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ContinueSession) + com.google.cloud.sql.v1beta4.ContinueSessionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_ContinueSession_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_ContinueSession_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ContinueSession.class, + com.google.cloud.sql.v1beta4.ContinueSession.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ContinueSession.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + locationId_ = ""; + instanceId_ = ""; + sessionId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_ContinueSession_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ContinueSession getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ContinueSession.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ContinueSession build() { + com.google.cloud.sql.v1beta4.ContinueSession result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ContinueSession buildPartial() { + com.google.cloud.sql.v1beta4.ContinueSession result = + new com.google.cloud.sql.v1beta4.ContinueSession(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ContinueSession result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.locationId_ = locationId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceId_ = instanceId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sessionId_ = sessionId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ContinueSession) { + return mergeFrom((com.google.cloud.sql.v1beta4.ContinueSession) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ContinueSession other) { + if (other == com.google.cloud.sql.v1beta4.ContinueSession.getDefaultInstance()) return this; + if (!other.getLocationId().isEmpty()) { + locationId_ = other.locationId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSessionId().isEmpty()) { + sessionId_ = other.sessionId_; + 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: + { + locationId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + sessionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object locationId_ = ""; + + /** + * + * + *
+     * Required. `location_id` is used to route the
+     * request to a specific region. Use the same region which was used to create
+     * the instance. Use the format `locations/{location}`, for example:
+     * `locations/us-central1`.
+     * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The locationId. + */ + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. `location_id` is used to route the
+     * request to a specific region. Use the same region which was used to create
+     * the instance. Use the format `locations/{location}`, for example:
+     * `locations/us-central1`.
+     * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for locationId. + */ + public com.google.protobuf.ByteString getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. `location_id` is used to route the
+     * request to a specific region. Use the same region which was used to create
+     * the instance. Use the format `locations/{location}`, for example:
+     * `locations/us-central1`.
+     * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The locationId to set. + * @return This builder for chaining. + */ + public Builder setLocationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + locationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. `location_id` is used to route the
+     * request to a specific region. Use the same region which was used to create
+     * the instance. Use the format `locations/{location}`, for example:
+     * `locations/us-central1`.
+     * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearLocationId() { + locationId_ = getDefaultInstance().getLocationId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. `location_id` is used to route the
+     * request to a specific region. Use the same region which was used to create
+     * the instance. Use the format `locations/{location}`, for example:
+     * `locations/us-central1`.
+     * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for locationId to set. + * @return This builder for chaining. + */ + public Builder setLocationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + locationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + + /** + * + * + *
+     * Required. The Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 java.lang.Object sessionId_ = ""; + + /** + * + * + *
+     * Required. The id of the session to reconnect.
+     * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sessionId. + */ + public java.lang.String getSessionId() { + java.lang.Object ref = sessionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sessionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The id of the session to reconnect.
+     * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for sessionId. + */ + public com.google.protobuf.ByteString getSessionIdBytes() { + java.lang.Object ref = sessionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sessionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The id of the session to reconnect.
+     * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The sessionId to set. + * @return This builder for chaining. + */ + public Builder setSessionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sessionId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The id of the session to reconnect.
+     * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearSessionId() { + sessionId_ = getDefaultInstance().getSessionId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The id of the session to reconnect.
+     * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for sessionId to set. + * @return This builder for chaining. + */ + public Builder setSessionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sessionId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ContinueSession) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ContinueSession) + private static final com.google.cloud.sql.v1beta4.ContinueSession DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ContinueSession(); + } + + public static com.google.cloud.sql.v1beta4.ContinueSession getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContinueSession parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ContinueSession getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ContinueSessionOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ContinueSessionOrBuilder.java new file mode 100644 index 000000000000..e9a2be2938b6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ContinueSessionOrBuilder.java @@ -0,0 +1,118 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ContinueSessionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ContinueSession) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. `location_id` is used to route the
+   * request to a specific region. Use the same region which was used to create
+   * the instance. Use the format `locations/{location}`, for example:
+   * `locations/us-central1`.
+   * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The locationId. + */ + java.lang.String getLocationId(); + + /** + * + * + *
+   * Required. `location_id` is used to route the
+   * request to a specific region. Use the same region which was used to create
+   * the instance. Use the format `locations/{location}`, for example:
+   * `locations/us-central1`.
+   * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for locationId. + */ + com.google.protobuf.ByteString getLocationIdBytes(); + + /** + * + * + *
+   * Required. The Cloud SQL instance resource name, for example:
+   * projects/example-project/instances/example-instance
+   * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + + /** + * + * + *
+   * Required. The Cloud SQL instance resource name, for example:
+   * projects/example-project/instances/example-instance
+   * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * Required. The id of the session to reconnect.
+   * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sessionId. + */ + java.lang.String getSessionId(); + + /** + * + * + *
+   * Required. The id of the session to reconnect.
+   * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for sessionId. + */ + com.google.protobuf.ByteString getSessionIdBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CreateBackupRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CreateBackupRequest.java new file mode 100644 index 000000000000..cf9e87ec0e3a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CreateBackupRequest.java @@ -0,0 +1,912 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The request payload to create the backup
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.CreateBackupRequest} + */ +@com.google.protobuf.Generated +public final class CreateBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.CreateBackupRequest) + CreateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateBackupRequest"); + } + + // Use CreateBackupRequest.newBuilder() to construct. + private CreateBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateBackupRequest() { + parent_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.CreateBackupRequest.class, + com.google.cloud.sql.v1beta4.CreateBackupRequest.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 backup is created.
+   * Format: projects/{project}
+   * 
+ * + * + * 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 backup is created.
+   * Format: projects/{project}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_FIELD_NUMBER = 2; + private com.google.cloud.sql.v1beta4.Backup backup_; + + /** + * + * + *
+   * Required. The Backup to create.
+   * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The Backup to create.
+   * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Backup getBackup() { + return backup_ == null ? com.google.cloud.sql.v1beta4.Backup.getDefaultInstance() : backup_; + } + + /** + * + * + *
+   * Required. The Backup to create.
+   * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupOrBuilder getBackupOrBuilder() { + return backup_ == null ? com.google.cloud.sql.v1beta4.Backup.getDefaultInstance() : backup_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getBackup()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBackup()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.CreateBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.CreateBackupRequest other = + (com.google.cloud.sql.v1beta4.CreateBackupRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.CreateBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.CreateBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.CreateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.CreateBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.CreateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.CreateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.CreateBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.CreateBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.CreateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.CreateBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.CreateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.CreateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.CreateBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request payload to create the backup
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.CreateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.CreateBackupRequest) + com.google.cloud.sql.v1beta4.CreateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.CreateBackupRequest.class, + com.google.cloud.sql.v1beta4.CreateBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.CreateBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackupFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_CreateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.CreateBackupRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.CreateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.CreateBackupRequest build() { + com.google.cloud.sql.v1beta4.CreateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.CreateBackupRequest buildPartial() { + com.google.cloud.sql.v1beta4.CreateBackupRequest result = + new com.google.cloud.sql.v1beta4.CreateBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.CreateBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backup_ = backupBuilder_ == null ? backup_ : backupBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.CreateBackupRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.CreateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.CreateBackupRequest other) { + if (other == com.google.cloud.sql.v1beta4.CreateBackupRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetBackupFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The parent resource where this backup is created.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 backup is created.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 backup is created.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 backup is created.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 backup is created.
+     * Format: projects/{project}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.Backup backup_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Backup, + com.google.cloud.sql.v1beta4.Backup.Builder, + com.google.cloud.sql.v1beta4.BackupOrBuilder> + backupBuilder_; + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.cloud.sql.v1beta4.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null ? com.google.cloud.sql.v1beta4.Backup.getDefaultInstance() : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.sql.v1beta4.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + } else { + backupBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.sql.v1beta4.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.cloud.sql.v1beta4.Backup value) { + if (backupBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && backup_ != null + && backup_ != com.google.cloud.sql.v1beta4.Backup.getDefaultInstance()) { + getBackupBuilder().mergeFrom(value); + } else { + backup_ = value; + } + } else { + backupBuilder_.mergeFrom(value); + } + if (backup_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + bitField0_ = (bitField0_ & ~0x00000002); + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.Backup.Builder getBackupBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetBackupFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null ? com.google.cloud.sql.v1beta4.Backup.getDefaultInstance() : backup_; + } + } + + /** + * + * + *
+     * Required. The Backup to create.
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Backup, + com.google.cloud.sql.v1beta4.Backup.Builder, + com.google.cloud.sql.v1beta4.BackupOrBuilder> + internalGetBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Backup, + com.google.cloud.sql.v1beta4.Backup.Builder, + com.google.cloud.sql.v1beta4.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.CreateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.CreateBackupRequest) + private static final com.google.cloud.sql.v1beta4.CreateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.CreateBackupRequest(); + } + + public static com.google.cloud.sql.v1beta4.CreateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.CreateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CreateBackupRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CreateBackupRequestOrBuilder.java new file mode 100644 index 000000000000..f1ddd9486072 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/CreateBackupRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface CreateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.CreateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource where this backup is created.
+   * Format: projects/{project}
+   * 
+ * + * + * 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 backup is created.
+   * Format: projects/{project}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The Backup to create.
+   * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + + /** + * + * + *
+   * Required. The Backup to create.
+   * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.cloud.sql.v1beta4.Backup getBackup(); + + /** + * + * + *
+   * Required. The Backup to create.
+   * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1beta4.BackupOrBuilder getBackupOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DataCacheConfig.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DataCacheConfig.java new file mode 100644 index 000000000000..14cf9d2100fc --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DataCacheConfig.java @@ -0,0 +1,502 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Data cache configurations.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DataCacheConfig} + */ +@com.google.protobuf.Generated +public final class DataCacheConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DataCacheConfig) + DataCacheConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DataCacheConfig"); + } + + // Use DataCacheConfig.newBuilder() to construct. + private DataCacheConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DataCacheConfig() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DataCacheConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DataCacheConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DataCacheConfig.class, + com.google.cloud.sql.v1beta4.DataCacheConfig.Builder.class); + } + + public static final int DATA_CACHE_ENABLED_FIELD_NUMBER = 1; + private boolean dataCacheEnabled_ = false; + + /** + * + * + *
+   * Whether data cache is enabled for the instance.
+   * 
+ * + * bool data_cache_enabled = 1; + * + * @return The dataCacheEnabled. + */ + @java.lang.Override + public boolean getDataCacheEnabled() { + return dataCacheEnabled_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (dataCacheEnabled_ != false) { + output.writeBool(1, dataCacheEnabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dataCacheEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, dataCacheEnabled_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.DataCacheConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DataCacheConfig other = + (com.google.cloud.sql.v1beta4.DataCacheConfig) obj; + + if (getDataCacheEnabled() != other.getDataCacheEnabled()) return false; + if (!getUnknownFields().equals(other.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) + DATA_CACHE_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDataCacheEnabled()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DataCacheConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DataCacheConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DataCacheConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DataCacheConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DataCacheConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DataCacheConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DataCacheConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DataCacheConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DataCacheConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DataCacheConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DataCacheConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DataCacheConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.DataCacheConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Data cache configurations.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DataCacheConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DataCacheConfig) + com.google.cloud.sql.v1beta4.DataCacheConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DataCacheConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DataCacheConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DataCacheConfig.class, + com.google.cloud.sql.v1beta4.DataCacheConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.DataCacheConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dataCacheEnabled_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DataCacheConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataCacheConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DataCacheConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataCacheConfig build() { + com.google.cloud.sql.v1beta4.DataCacheConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataCacheConfig buildPartial() { + com.google.cloud.sql.v1beta4.DataCacheConfig result = + new com.google.cloud.sql.v1beta4.DataCacheConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.DataCacheConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dataCacheEnabled_ = dataCacheEnabled_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DataCacheConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.DataCacheConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.DataCacheConfig other) { + if (other == com.google.cloud.sql.v1beta4.DataCacheConfig.getDefaultInstance()) return this; + if (other.getDataCacheEnabled() != false) { + setDataCacheEnabled(other.getDataCacheEnabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + dataCacheEnabled_ = input.readBool(); + 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 boolean dataCacheEnabled_; + + /** + * + * + *
+     * Whether data cache is enabled for the instance.
+     * 
+ * + * bool data_cache_enabled = 1; + * + * @return The dataCacheEnabled. + */ + @java.lang.Override + public boolean getDataCacheEnabled() { + return dataCacheEnabled_; + } + + /** + * + * + *
+     * Whether data cache is enabled for the instance.
+     * 
+ * + * bool data_cache_enabled = 1; + * + * @param value The dataCacheEnabled to set. + * @return This builder for chaining. + */ + public Builder setDataCacheEnabled(boolean value) { + + dataCacheEnabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether data cache is enabled for the instance.
+     * 
+ * + * bool data_cache_enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearDataCacheEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + dataCacheEnabled_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DataCacheConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DataCacheConfig) + private static final com.google.cloud.sql.v1beta4.DataCacheConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DataCacheConfig(); + } + + public static com.google.cloud.sql.v1beta4.DataCacheConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataCacheConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataCacheConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DataCacheConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DataCacheConfigOrBuilder.java new file mode 100644 index 000000000000..29372967eb10 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DataCacheConfigOrBuilder.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DataCacheConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DataCacheConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether data cache is enabled for the instance.
+   * 
+ * + * bool data_cache_enabled = 1; + * + * @return The dataCacheEnabled. + */ + boolean getDataCacheEnabled(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DataPacket.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DataPacket.java new file mode 100644 index 000000000000..7094f079879e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DataPacket.java @@ -0,0 +1,610 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Contains data being sent or received by the database.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DataPacket} + */ +@com.google.protobuf.Generated +public final class DataPacket extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DataPacket) + DataPacketOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DataPacket"); + } + + // Use DataPacket.newBuilder() to construct. + private DataPacket(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DataPacket() { + data_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_DataPacket_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_DataPacket_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DataPacket.class, + com.google.cloud.sql.v1beta4.DataPacket.Builder.class); + } + + public static final int FIRST_BYTE_OFFSET_FIELD_NUMBER = 1; + private long firstByteOffset_ = 0L; + + /** + * + * + *
+   * Optional. The absolute byte offset of the first byte in this payload.
+   * 0 for new connections or resumed connections that hasn't acked any bytes
+   * from server. Non-zero for resumed connections
+   * 
+ * + * int64 first_byte_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The firstByteOffset. + */ + @java.lang.Override + public long getFirstByteOffset() { + return firstByteOffset_; + } + + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Required. Raw data being sent or received by the database.
+   * 
+ * + * bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (firstByteOffset_ != 0L) { + output.writeInt64(1, firstByteOffset_); + } + if (!data_.isEmpty()) { + output.writeBytes(2, data_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (firstByteOffset_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, firstByteOffset_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, data_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.DataPacket)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DataPacket other = (com.google.cloud.sql.v1beta4.DataPacket) obj; + + if (getFirstByteOffset() != other.getFirstByteOffset()) return false; + if (!getData().equals(other.getData())) return false; + if (!getUnknownFields().equals(other.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) + FIRST_BYTE_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFirstByteOffset()); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DataPacket parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DataPacket parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DataPacket parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DataPacket parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DataPacket parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DataPacket parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DataPacket parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DataPacket parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DataPacket parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DataPacket parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DataPacket parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DataPacket parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.DataPacket prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Contains data being sent or received by the database.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DataPacket} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DataPacket) + com.google.cloud.sql.v1beta4.DataPacketOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_DataPacket_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_DataPacket_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DataPacket.class, + com.google.cloud.sql.v1beta4.DataPacket.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.DataPacket.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + firstByteOffset_ = 0L; + data_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_DataPacket_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataPacket getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataPacket build() { + com.google.cloud.sql.v1beta4.DataPacket result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataPacket buildPartial() { + com.google.cloud.sql.v1beta4.DataPacket result = + new com.google.cloud.sql.v1beta4.DataPacket(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.DataPacket result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.firstByteOffset_ = firstByteOffset_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.data_ = data_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DataPacket) { + return mergeFrom((com.google.cloud.sql.v1beta4.DataPacket) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.DataPacket other) { + if (other == com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance()) return this; + if (other.getFirstByteOffset() != 0L) { + setFirstByteOffset(other.getFirstByteOffset()); + } + if (!other.getData().isEmpty()) { + setData(other.getData()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + firstByteOffset_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + data_ = input.readBytes(); + 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 long firstByteOffset_; + + /** + * + * + *
+     * Optional. The absolute byte offset of the first byte in this payload.
+     * 0 for new connections or resumed connections that hasn't acked any bytes
+     * from server. Non-zero for resumed connections
+     * 
+ * + * int64 first_byte_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The firstByteOffset. + */ + @java.lang.Override + public long getFirstByteOffset() { + return firstByteOffset_; + } + + /** + * + * + *
+     * Optional. The absolute byte offset of the first byte in this payload.
+     * 0 for new connections or resumed connections that hasn't acked any bytes
+     * from server. Non-zero for resumed connections
+     * 
+ * + * int64 first_byte_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The firstByteOffset to set. + * @return This builder for chaining. + */ + public Builder setFirstByteOffset(long value) { + + firstByteOffset_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The absolute byte offset of the first byte in this payload.
+     * 0 for new connections or resumed connections that hasn't acked any bytes
+     * from server. Non-zero for resumed connections
+     * 
+ * + * int64 first_byte_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFirstByteOffset() { + bitField0_ = (bitField0_ & ~0x00000001); + firstByteOffset_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Required. Raw data being sent or received by the database.
+     * 
+ * + * bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + /** + * + * + *
+     * Required. Raw data being sent or received by the database.
+     * 
+ * + * bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Raw data being sent or received by the database.
+     * 
+ * + * bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearData() { + bitField0_ = (bitField0_ & ~0x00000002); + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DataPacket) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DataPacket) + private static final com.google.cloud.sql.v1beta4.DataPacket DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DataPacket(); + } + + public static com.google.cloud.sql.v1beta4.DataPacket getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataPacket parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataPacket getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DataPacketOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DataPacketOrBuilder.java new file mode 100644 index 000000000000..f9f381fc4cd7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DataPacketOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DataPacketOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DataPacket) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The absolute byte offset of the first byte in this payload.
+   * 0 for new connections or resumed connections that hasn't acked any bytes
+   * from server. Non-zero for resumed connections
+   * 
+ * + * int64 first_byte_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The firstByteOffset. + */ + long getFirstByteOffset(); + + /** + * + * + *
+   * Required. Raw data being sent or received by the database.
+   * 
+ * + * bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The data. + */ + com.google.protobuf.ByteString getData(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Database.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Database.java new file mode 100644 index 000000000000..a4af2ebfd83b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Database.java @@ -0,0 +1,2273 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Represents a SQL database on the Cloud SQL instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Database} + */ +@com.google.protobuf.Generated +public final class Database extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.Database) + DatabaseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Database"); + } + + // Use Database.newBuilder() to construct. + private Database(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Database() { + kind_ = ""; + charset_ = ""; + collation_ = ""; + etag_ = ""; + name_ = ""; + instance_ = ""; + selfLink_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Database_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Database_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Database.class, + com.google.cloud.sql.v1beta4.Database.Builder.class); + } + + private int databaseDetailsCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object databaseDetails_; + + public enum DatabaseDetailsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SQLSERVER_DATABASE_DETAILS(9), + DATABASEDETAILS_NOT_SET(0); + private final int value; + + private DatabaseDetailsCase(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 DatabaseDetailsCase valueOf(int value) { + return forNumber(value); + } + + public static DatabaseDetailsCase forNumber(int value) { + switch (value) { + case 9: + return SQLSERVER_DATABASE_DETAILS; + case 0: + return DATABASEDETAILS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DatabaseDetailsCase getDatabaseDetailsCase() { + return DatabaseDetailsCase.forNumber(databaseDetailsCase_); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#database`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#database`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CHARSET_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object charset_ = ""; + + /** + * + * + *
+   * The Cloud SQL charset value.
+   * 
+ * + * string charset = 2; + * + * @return The charset. + */ + @java.lang.Override + public java.lang.String getCharset() { + java.lang.Object ref = charset_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + charset_ = s; + return s; + } + } + + /** + * + * + *
+   * The Cloud SQL charset value.
+   * 
+ * + * string charset = 2; + * + * @return The bytes for charset. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCharsetBytes() { + java.lang.Object ref = charset_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + charset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLLATION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object collation_ = ""; + + /** + * + * + *
+   * The Cloud SQL collation value.
+   * 
+ * + * string collation = 3; + * + * @return The collation. + */ + @java.lang.Override + public java.lang.String getCollation() { + java.lang.Object ref = collation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collation_ = s; + return s; + } + } + + /** + * + * + *
+   * The Cloud SQL collation value.
+   * 
+ * + * string collation = 3; + * + * @return The bytes for collation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCollationBytes() { + java.lang.Object ref = collation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 4; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 4; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the database in the Cloud SQL instance. This does not include
+   * the project ID or instance name.
+   * 
+ * + * string name = 5; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the database in the Cloud SQL instance. This does not include
+   * the project ID or instance name.
+   * 
+ * + * string name = 5; + * + * @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 INSTANCE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string instance = 6; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELF_LINK_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object selfLink_ = ""; + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 7; + * + * @return The selfLink. + */ + @java.lang.Override + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } + } + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 7; + * + * @return The bytes for selfLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 8; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 8; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SQLSERVER_DATABASE_DETAILS_FIELD_NUMBER = 9; + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + * @return Whether the sqlserverDatabaseDetails field is set. + */ + @java.lang.Override + public boolean hasSqlserverDatabaseDetails() { + return databaseDetailsCase_ == 9; + } + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + * @return The sqlserverDatabaseDetails. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails getSqlserverDatabaseDetails() { + if (databaseDetailsCase_ == 9) { + return (com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails) databaseDetails_; + } + return com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.getDefaultInstance(); + } + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerDatabaseDetailsOrBuilder + getSqlserverDatabaseDetailsOrBuilder() { + if (databaseDetailsCase_ == 9) { + return (com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails) databaseDetails_; + } + return com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(charset_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, charset_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(collation_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, collation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, selfLink_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, project_); + } + if (databaseDetailsCase_ == 9) { + output.writeMessage( + 9, (com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails) databaseDetails_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(charset_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, charset_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(collation_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, collation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, selfLink_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, project_); + } + if (databaseDetailsCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails) databaseDetails_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.Database)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.Database other = (com.google.cloud.sql.v1beta4.Database) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getCharset().equals(other.getCharset())) return false; + if (!getCollation().equals(other.getCollation())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getName().equals(other.getName())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getSelfLink().equals(other.getSelfLink())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getDatabaseDetailsCase().equals(other.getDatabaseDetailsCase())) return false; + switch (databaseDetailsCase_) { + case 9: + if (!getSqlserverDatabaseDetails().equals(other.getSqlserverDatabaseDetails())) + 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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + CHARSET_FIELD_NUMBER; + hash = (53 * hash) + getCharset().hashCode(); + hash = (37 * hash) + COLLATION_FIELD_NUMBER; + hash = (53 * hash) + getCollation().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + SELF_LINK_FIELD_NUMBER; + hash = (53 * hash) + getSelfLink().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + switch (databaseDetailsCase_) { + case 9: + hash = (37 * hash) + SQLSERVER_DATABASE_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getSqlserverDatabaseDetails().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.Database parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Database parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Database parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Database parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Database parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Database parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Database parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Database parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Database parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Database parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Database parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Database parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.Database prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Represents a SQL database on the Cloud SQL instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Database} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.Database) + com.google.cloud.sql.v1beta4.DatabaseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Database_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Database_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Database.class, + com.google.cloud.sql.v1beta4.Database.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.Database.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + charset_ = ""; + collation_ = ""; + etag_ = ""; + name_ = ""; + instance_ = ""; + selfLink_ = ""; + project_ = ""; + if (sqlserverDatabaseDetailsBuilder_ != null) { + sqlserverDatabaseDetailsBuilder_.clear(); + } + databaseDetailsCase_ = 0; + databaseDetails_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Database_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Database getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.Database.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Database build() { + com.google.cloud.sql.v1beta4.Database result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Database buildPartial() { + com.google.cloud.sql.v1beta4.Database result = + new com.google.cloud.sql.v1beta4.Database(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.Database result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.charset_ = charset_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.collation_ = collation_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.selfLink_ = selfLink_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.project_ = project_; + } + } + + private void buildPartialOneofs(com.google.cloud.sql.v1beta4.Database result) { + result.databaseDetailsCase_ = databaseDetailsCase_; + result.databaseDetails_ = this.databaseDetails_; + if (databaseDetailsCase_ == 9 && sqlserverDatabaseDetailsBuilder_ != null) { + result.databaseDetails_ = sqlserverDatabaseDetailsBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.Database) { + return mergeFrom((com.google.cloud.sql.v1beta4.Database) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.Database other) { + if (other == com.google.cloud.sql.v1beta4.Database.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getCharset().isEmpty()) { + charset_ = other.charset_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getCollation().isEmpty()) { + collation_ = other.collation_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getSelfLink().isEmpty()) { + selfLink_ = other.selfLink_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000080; + onChanged(); + } + switch (other.getDatabaseDetailsCase()) { + case SQLSERVER_DATABASE_DETAILS: + { + mergeSqlserverDatabaseDetails(other.getSqlserverDatabaseDetails()); + break; + } + case DATABASEDETAILS_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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + charset_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + collation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + selfLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + input.readMessage( + internalGetSqlserverDatabaseDetailsFieldBuilder().getBuilder(), + extensionRegistry); + databaseDetailsCase_ = 9; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int databaseDetailsCase_ = 0; + private java.lang.Object databaseDetails_; + + public DatabaseDetailsCase getDatabaseDetailsCase() { + return DatabaseDetailsCase.forNumber(databaseDetailsCase_); + } + + public Builder clearDatabaseDetails() { + databaseDetailsCase_ = 0; + databaseDetails_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#database`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#database`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#database`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#database`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#database`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object charset_ = ""; + + /** + * + * + *
+     * The Cloud SQL charset value.
+     * 
+ * + * string charset = 2; + * + * @return The charset. + */ + public java.lang.String getCharset() { + java.lang.Object ref = charset_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + charset_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Cloud SQL charset value.
+     * 
+ * + * string charset = 2; + * + * @return The bytes for charset. + */ + public com.google.protobuf.ByteString getCharsetBytes() { + java.lang.Object ref = charset_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + charset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Cloud SQL charset value.
+     * 
+ * + * string charset = 2; + * + * @param value The charset to set. + * @return This builder for chaining. + */ + public Builder setCharset(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + charset_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud SQL charset value.
+     * 
+ * + * string charset = 2; + * + * @return This builder for chaining. + */ + public Builder clearCharset() { + charset_ = getDefaultInstance().getCharset(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud SQL charset value.
+     * 
+ * + * string charset = 2; + * + * @param value The bytes for charset to set. + * @return This builder for chaining. + */ + public Builder setCharsetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + charset_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object collation_ = ""; + + /** + * + * + *
+     * The Cloud SQL collation value.
+     * 
+ * + * string collation = 3; + * + * @return The collation. + */ + public java.lang.String getCollation() { + java.lang.Object ref = collation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Cloud SQL collation value.
+     * 
+ * + * string collation = 3; + * + * @return The bytes for collation. + */ + public com.google.protobuf.ByteString getCollationBytes() { + java.lang.Object ref = collation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Cloud SQL collation value.
+     * 
+ * + * string collation = 3; + * + * @param value The collation to set. + * @return This builder for chaining. + */ + public Builder setCollation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + collation_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud SQL collation value.
+     * 
+ * + * string collation = 3; + * + * @return This builder for chaining. + */ + public Builder clearCollation() { + collation_ = getDefaultInstance().getCollation(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud SQL collation value.
+     * 
+ * + * string collation = 3; + * + * @param value The bytes for collation to set. + * @return This builder for chaining. + */ + public Builder setCollationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + collation_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 4; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 4; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 4; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 4; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 4; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the database in the Cloud SQL instance. This does not include
+     * the project ID or instance name.
+     * 
+ * + * string name = 5; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the database in the Cloud SQL instance. This does not include
+     * the project ID or instance name.
+     * 
+ * + * string name = 5; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the database in the Cloud SQL instance. This does not include
+     * the project ID or instance name.
+     * 
+ * + * string name = 5; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the database in the Cloud SQL instance. This does not include
+     * the project ID or instance name.
+     * 
+ * + * string name = 5; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the database in the Cloud SQL instance. This does not include
+     * the project ID or instance name.
+     * 
+ * + * string name = 5; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string instance = 6; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string instance = 6; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string instance = 6; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string instance = 6; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object selfLink_ = ""; + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 7; + * + * @return The selfLink. + */ + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 7; + * + * @return The bytes for selfLink. + */ + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 7; + * + * @param value The selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selfLink_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 7; + * + * @return This builder for chaining. + */ + public Builder clearSelfLink() { + selfLink_ = getDefaultInstance().getSelfLink(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 7; + * + * @param value The bytes for selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selfLink_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 8; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 8; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 8; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 8; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 8; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails, + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.Builder, + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetailsOrBuilder> + sqlserverDatabaseDetailsBuilder_; + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + * + * @return Whether the sqlserverDatabaseDetails field is set. + */ + @java.lang.Override + public boolean hasSqlserverDatabaseDetails() { + return databaseDetailsCase_ == 9; + } + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + * + * @return The sqlserverDatabaseDetails. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails getSqlserverDatabaseDetails() { + if (sqlserverDatabaseDetailsBuilder_ == null) { + if (databaseDetailsCase_ == 9) { + return (com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails) databaseDetails_; + } + return com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.getDefaultInstance(); + } else { + if (databaseDetailsCase_ == 9) { + return sqlserverDatabaseDetailsBuilder_.getMessage(); + } + return com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.getDefaultInstance(); + } + } + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + */ + public Builder setSqlserverDatabaseDetails( + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails value) { + if (sqlserverDatabaseDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + databaseDetails_ = value; + onChanged(); + } else { + sqlserverDatabaseDetailsBuilder_.setMessage(value); + } + databaseDetailsCase_ = 9; + return this; + } + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + */ + public Builder setSqlserverDatabaseDetails( + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.Builder builderForValue) { + if (sqlserverDatabaseDetailsBuilder_ == null) { + databaseDetails_ = builderForValue.build(); + onChanged(); + } else { + sqlserverDatabaseDetailsBuilder_.setMessage(builderForValue.build()); + } + databaseDetailsCase_ = 9; + return this; + } + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + */ + public Builder mergeSqlserverDatabaseDetails( + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails value) { + if (sqlserverDatabaseDetailsBuilder_ == null) { + if (databaseDetailsCase_ == 9 + && databaseDetails_ + != com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.getDefaultInstance()) { + databaseDetails_ = + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.newBuilder( + (com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails) databaseDetails_) + .mergeFrom(value) + .buildPartial(); + } else { + databaseDetails_ = value; + } + onChanged(); + } else { + if (databaseDetailsCase_ == 9) { + sqlserverDatabaseDetailsBuilder_.mergeFrom(value); + } else { + sqlserverDatabaseDetailsBuilder_.setMessage(value); + } + } + databaseDetailsCase_ = 9; + return this; + } + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + */ + public Builder clearSqlserverDatabaseDetails() { + if (sqlserverDatabaseDetailsBuilder_ == null) { + if (databaseDetailsCase_ == 9) { + databaseDetailsCase_ = 0; + databaseDetails_ = null; + onChanged(); + } + } else { + if (databaseDetailsCase_ == 9) { + databaseDetailsCase_ = 0; + databaseDetails_ = null; + } + sqlserverDatabaseDetailsBuilder_.clear(); + } + return this; + } + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + */ + public com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.Builder + getSqlserverDatabaseDetailsBuilder() { + return internalGetSqlserverDatabaseDetailsFieldBuilder().getBuilder(); + } + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerDatabaseDetailsOrBuilder + getSqlserverDatabaseDetailsOrBuilder() { + if ((databaseDetailsCase_ == 9) && (sqlserverDatabaseDetailsBuilder_ != null)) { + return sqlserverDatabaseDetailsBuilder_.getMessageOrBuilder(); + } else { + if (databaseDetailsCase_ == 9) { + return (com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails) databaseDetails_; + } + return com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.getDefaultInstance(); + } + } + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails, + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.Builder, + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetailsOrBuilder> + internalGetSqlserverDatabaseDetailsFieldBuilder() { + if (sqlserverDatabaseDetailsBuilder_ == null) { + if (!(databaseDetailsCase_ == 9)) { + databaseDetails_ = + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.getDefaultInstance(); + } + sqlserverDatabaseDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails, + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.Builder, + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetailsOrBuilder>( + (com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails) databaseDetails_, + getParentForChildren(), + isClean()); + databaseDetails_ = null; + } + databaseDetailsCase_ = 9; + onChanged(); + return sqlserverDatabaseDetailsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.Database) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.Database) + private static final com.google.cloud.sql.v1beta4.Database DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.Database(); + } + + public static com.google.cloud.sql.v1beta4.Database getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Database parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Database getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseFlags.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseFlags.java new file mode 100644 index 000000000000..9e5d5f352a03 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseFlags.java @@ -0,0 +1,826 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database flags for Cloud SQL instances.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DatabaseFlags} + */ +@com.google.protobuf.Generated +public final class DatabaseFlags extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DatabaseFlags) + DatabaseFlagsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DatabaseFlags"); + } + + // Use DatabaseFlags.newBuilder() to construct. + private DatabaseFlags(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DatabaseFlags() { + name_ = ""; + value_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseFlags_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseFlags_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DatabaseFlags.class, + com.google.cloud.sql.v1beta4.DatabaseFlags.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the flag. These flags are passed at instance startup, so
+   * include both server options and system variables. Flags are
+   * specified with underscores, not hyphens. For more information, see
+   * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+   * in the Cloud SQL documentation.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the flag. These flags are passed at instance startup, so
+   * include both server options and system variables. Flags are
+   * specified with underscores, not hyphens. For more information, see
+   * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+   * in the Cloud SQL documentation.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + + /** + * + * + *
+   * The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + + /** + * + * + *
+   * The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.DatabaseFlags)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DatabaseFlags other = + (com.google.cloud.sql.v1beta4.DatabaseFlags) obj; + + if (!getName().equals(other.getName())) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DatabaseFlags parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseFlags parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseFlags parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseFlags parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseFlags parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseFlags parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseFlags parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseFlags parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseFlags parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseFlags parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseFlags parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseFlags parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.DatabaseFlags prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database flags for Cloud SQL instances.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DatabaseFlags} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DatabaseFlags) + com.google.cloud.sql.v1beta4.DatabaseFlagsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseFlags_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseFlags_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DatabaseFlags.class, + com.google.cloud.sql.v1beta4.DatabaseFlags.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.DatabaseFlags.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + value_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseFlags_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseFlags getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DatabaseFlags.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseFlags build() { + com.google.cloud.sql.v1beta4.DatabaseFlags result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseFlags buildPartial() { + com.google.cloud.sql.v1beta4.DatabaseFlags result = + new com.google.cloud.sql.v1beta4.DatabaseFlags(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.DatabaseFlags result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DatabaseFlags) { + return mergeFrom((com.google.cloud.sql.v1beta4.DatabaseFlags) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.DatabaseFlags other) { + if (other == com.google.cloud.sql.v1beta4.DatabaseFlags.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + 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: + { + value_ = 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_ = ""; + + /** + * + * + *
+     * The name of the flag. These flags are passed at instance startup, so
+     * include both server options and system variables. Flags are
+     * specified with underscores, not hyphens. For more information, see
+     * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+     * in the Cloud SQL documentation.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the flag. These flags are passed at instance startup, so
+     * include both server options and system variables. Flags are
+     * specified with underscores, not hyphens. For more information, see
+     * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+     * in the Cloud SQL documentation.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the flag. These flags are passed at instance startup, so
+     * include both server options and system variables. Flags are
+     * specified with underscores, not hyphens. For more information, see
+     * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+     * in the Cloud SQL documentation.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the flag. These flags are passed at instance startup, so
+     * include both server options and system variables. Flags are
+     * specified with underscores, not hyphens. For more information, see
+     * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+     * in the Cloud SQL documentation.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the flag. These flags are passed at instance startup, so
+     * include both server options and system variables. Flags are
+     * specified with underscores, not hyphens. For more information, see
+     * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+     * in the Cloud SQL documentation.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + + /** + * + * + *
+     * The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of the flag. Boolean flags are set to `on` for true
+     * and `off` for false. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DatabaseFlags) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DatabaseFlags) + private static final com.google.cloud.sql.v1beta4.DatabaseFlags DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DatabaseFlags(); + } + + public static com.google.cloud.sql.v1beta4.DatabaseFlags getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DatabaseFlags parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseFlags getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseFlagsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseFlagsOrBuilder.java new file mode 100644 index 000000000000..94a184e41d16 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseFlagsOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DatabaseFlagsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DatabaseFlags) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the flag. These flags are passed at instance startup, so
+   * include both server options and system variables. Flags are
+   * specified with underscores, not hyphens. For more information, see
+   * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+   * in the Cloud SQL documentation.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the flag. These flags are passed at instance startup, so
+   * include both server options and system variables. Flags are
+   * specified with underscores, not hyphens. For more information, see
+   * [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
+   * in the Cloud SQL documentation.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The value. + */ + java.lang.String getValue(); + + /** + * + * + *
+   * The value of the flag. Boolean flags are set to `on` for true
+   * and `off` for false. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseInstance.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseInstance.java new file mode 100644 index 000000000000..dda51f6b534f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseInstance.java @@ -0,0 +1,22463 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * A Cloud SQL instance resource.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DatabaseInstance} + */ +@com.google.protobuf.Generated +public final class DatabaseInstance extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DatabaseInstance) + DatabaseInstanceOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DatabaseInstance"); + } + + // Use DatabaseInstance.newBuilder() to construct. + private DatabaseInstance(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DatabaseInstance() { + kind_ = ""; + state_ = 0; + databaseVersion_ = 0; + etag_ = ""; + masterInstanceName_ = ""; + replicaNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + ipAddresses_ = java.util.Collections.emptyList(); + instanceType_ = 0; + project_ = ""; + ipv6Address_ = ""; + serviceAccountEmailAddress_ = ""; + backendType_ = 0; + selfLink_ = ""; + suspensionReason_ = emptyIntList(); + connectionName_ = ""; + name_ = ""; + region_ = ""; + gceZone_ = ""; + secondaryGceZone_ = ""; + rootPassword_ = ""; + databaseInstalledVersion_ = ""; + availableMaintenanceVersions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + maintenanceVersion_ = ""; + upgradableDatabaseVersions_ = java.util.Collections.emptyList(); + sqlNetworkArchitecture_ = 0; + pscServiceAttachmentLink_ = ""; + dnsName_ = ""; + primaryDnsName_ = ""; + writeEndpoint_ = ""; + nodes_ = java.util.Collections.emptyList(); + dnsNames_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 60: + return internalGetTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DatabaseInstance.class, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder.class); + } + + /** + * + * + *
+   * The current serving state of the database instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState} + */ + public enum SqlInstanceState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * SQL_INSTANCE_STATE_UNSPECIFIED = 0; + */ + SQL_INSTANCE_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The instance is running, or has been stopped by owner.
+     * 
+ * + * RUNNABLE = 1; + */ + RUNNABLE(1), + /** + * + * + *
+     * The instance is not available, for example due to problems with billing.
+     * 
+ * + * SUSPENDED = 2; + */ + SUSPENDED(2), + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * PENDING_DELETE = 3; + */ + PENDING_DELETE(3), + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * PENDING_CREATE = 4; + */ + PENDING_CREATE(4), + /** + * + * + *
+     * The instance is down for maintenance.
+     * 
+ * + * MAINTENANCE = 5; + */ + MAINTENANCE(5), + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * maintenance.
+     * 
+ * + * FAILED = 6; + */ + FAILED(6), + /** + * + * + *
+     * Deprecated
+     * 
+ * + * ONLINE_MAINTENANCE = 7 [deprecated = true]; + */ + @java.lang.Deprecated + ONLINE_MAINTENANCE(7), + /** + * + * + *
+     * (Applicable to read pool nodes only.) The read pool node needs to be
+     * repaired. The database might be unavailable.
+     * 
+ * + * REPAIRING = 8; + */ + REPAIRING(8), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstanceState"); + } + + /** + * + * + *
+     * The state of the instance is unknown.
+     * 
+ * + * SQL_INSTANCE_STATE_UNSPECIFIED = 0; + */ + public static final int SQL_INSTANCE_STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The instance is running, or has been stopped by owner.
+     * 
+ * + * RUNNABLE = 1; + */ + public static final int RUNNABLE_VALUE = 1; + + /** + * + * + *
+     * The instance is not available, for example due to problems with billing.
+     * 
+ * + * SUSPENDED = 2; + */ + public static final int SUSPENDED_VALUE = 2; + + /** + * + * + *
+     * The instance is being deleted.
+     * 
+ * + * PENDING_DELETE = 3; + */ + public static final int PENDING_DELETE_VALUE = 3; + + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * PENDING_CREATE = 4; + */ + public static final int PENDING_CREATE_VALUE = 4; + + /** + * + * + *
+     * The instance is down for maintenance.
+     * 
+ * + * MAINTENANCE = 5; + */ + public static final int MAINTENANCE_VALUE = 5; + + /** + * + * + *
+     * The creation of the instance failed or a fatal error occurred during
+     * maintenance.
+     * 
+ * + * FAILED = 6; + */ + public static final int FAILED_VALUE = 6; + + /** + * + * + *
+     * Deprecated
+     * 
+ * + * ONLINE_MAINTENANCE = 7 [deprecated = true]; + */ + @java.lang.Deprecated public static final int ONLINE_MAINTENANCE_VALUE = 7; + + /** + * + * + *
+     * (Applicable to read pool nodes only.) The read pool node needs to be
+     * repaired. The database might be unavailable.
+     * 
+ * + * REPAIRING = 8; + */ + public static final int REPAIRING_VALUE = 8; + + 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 SqlInstanceState 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 SqlInstanceState forNumber(int value) { + switch (value) { + case 0: + return SQL_INSTANCE_STATE_UNSPECIFIED; + case 1: + return RUNNABLE; + case 2: + return SUSPENDED; + case 3: + return PENDING_DELETE; + case 4: + return PENDING_CREATE; + case 5: + return MAINTENANCE; + case 6: + return FAILED; + case 7: + return ONLINE_MAINTENANCE; + case 8: + return REPAIRING; + 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 SqlInstanceState findValueByNumber(int number) { + return SqlInstanceState.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.DatabaseInstance.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlInstanceState[] VALUES = values(); + + public static SqlInstanceState 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 SqlInstanceState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState) + } + + /** + * + * + *
+   * The SQL network architecture for the instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture} + */ + public enum SqlNetworkArchitecture implements com.google.protobuf.ProtocolMessageEnum { + /** SQL_NETWORK_ARCHITECTURE_UNSPECIFIED = 0; */ + SQL_NETWORK_ARCHITECTURE_UNSPECIFIED(0), + /** + * + * + *
+     * The instance uses the new network architecture.
+     * 
+ * + * NEW_NETWORK_ARCHITECTURE = 1; + */ + NEW_NETWORK_ARCHITECTURE(1), + /** + * + * + *
+     * The instance uses the old network architecture.
+     * 
+ * + * OLD_NETWORK_ARCHITECTURE = 2; + */ + OLD_NETWORK_ARCHITECTURE(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlNetworkArchitecture"); + } + + /** SQL_NETWORK_ARCHITECTURE_UNSPECIFIED = 0; */ + public static final int SQL_NETWORK_ARCHITECTURE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The instance uses the new network architecture.
+     * 
+ * + * NEW_NETWORK_ARCHITECTURE = 1; + */ + public static final int NEW_NETWORK_ARCHITECTURE_VALUE = 1; + + /** + * + * + *
+     * The instance uses the old network architecture.
+     * 
+ * + * OLD_NETWORK_ARCHITECTURE = 2; + */ + public static final int OLD_NETWORK_ARCHITECTURE_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 SqlNetworkArchitecture 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 SqlNetworkArchitecture forNumber(int value) { + switch (value) { + case 0: + return SQL_NETWORK_ARCHITECTURE_UNSPECIFIED; + case 1: + return NEW_NETWORK_ARCHITECTURE; + case 2: + return OLD_NETWORK_ARCHITECTURE; + 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 SqlNetworkArchitecture findValueByNumber(int number) { + return SqlNetworkArchitecture.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.DatabaseInstance.getDescriptor().getEnumTypes().get(1); + } + + private static final SqlNetworkArchitecture[] VALUES = values(); + + public static SqlNetworkArchitecture 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 SqlNetworkArchitecture(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture) + } + + public interface SqlFailoverReplicaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the failover replica. If specified at instance creation, a
+     * failover replica is created for the instance. The name
+     * doesn't include the project ID.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+     * The name of the failover replica. If specified at instance creation, a
+     * failover replica is created for the instance. The name
+     * doesn't include the project ID.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * The availability status of the failover replica. A false status indicates
+     * that the failover replica is out of sync. The primary instance can only
+     * failover to the failover replica when the status is true.
+     * 
+ * + * .google.protobuf.BoolValue available = 2; + * + * @return Whether the available field is set. + */ + boolean hasAvailable(); + + /** + * + * + *
+     * The availability status of the failover replica. A false status indicates
+     * that the failover replica is out of sync. The primary instance can only
+     * failover to the failover replica when the status is true.
+     * 
+ * + * .google.protobuf.BoolValue available = 2; + * + * @return The available. + */ + com.google.protobuf.BoolValue getAvailable(); + + /** + * + * + *
+     * The availability status of the failover replica. A false status indicates
+     * that the failover replica is out of sync. The primary instance can only
+     * failover to the failover replica when the status is true.
+     * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + com.google.protobuf.BoolValueOrBuilder getAvailableOrBuilder(); + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica} */ + public static final class SqlFailoverReplica extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica) + SqlFailoverReplicaOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlFailoverReplica"); + } + + // Use SqlFailoverReplica.newBuilder() to construct. + private SqlFailoverReplica(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlFailoverReplica() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlFailoverReplica_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlFailoverReplica_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.class, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the failover replica. If specified at instance creation, a
+     * failover replica is created for the instance. The name
+     * doesn't include the project ID.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+     * The name of the failover replica. If specified at instance creation, a
+     * failover replica is created for the instance. The name
+     * doesn't include the project ID.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AVAILABLE_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue available_; + + /** + * + * + *
+     * The availability status of the failover replica. A false status indicates
+     * that the failover replica is out of sync. The primary instance can only
+     * failover to the failover replica when the status is true.
+     * 
+ * + * .google.protobuf.BoolValue available = 2; + * + * @return Whether the available field is set. + */ + @java.lang.Override + public boolean hasAvailable() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The availability status of the failover replica. A false status indicates
+     * that the failover replica is out of sync. The primary instance can only
+     * failover to the failover replica when the status is true.
+     * 
+ * + * .google.protobuf.BoolValue available = 2; + * + * @return The available. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getAvailable() { + return available_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : available_; + } + + /** + * + * + *
+     * The availability status of the failover replica. A false status indicates
+     * that the failover replica is out of sync. The primary instance can only
+     * failover to the failover replica when the status is true.
+     * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getAvailableOrBuilder() { + return available_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : available_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAvailable()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAvailable()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica other = + (com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica) obj; + + if (!getName().equals(other.getName())) return false; + if (hasAvailable() != other.hasAvailable()) return false; + if (hasAvailable()) { + if (!getAvailable().equals(other.getAvailable())) return false; + } + if (!getUnknownFields().equals(other.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 (hasAvailable()) { + hash = (37 * hash) + AVAILABLE_FIELD_NUMBER; + hash = (53 * hash) + getAvailable().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica) + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplicaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlFailoverReplica_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlFailoverReplica_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.class, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAvailableFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + available_ = null; + if (availableBuilder_ != null) { + availableBuilder_.dispose(); + availableBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlFailoverReplica_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica build() { + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica buildPartial() { + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica result = + new com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.available_ = availableBuilder_ == null ? available_ : availableBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica other) { + if (other + == com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasAvailable()) { + mergeAvailable(other.getAvailable()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetAvailableFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+       * The name of the failover replica. If specified at instance creation, a
+       * failover replica is created for the instance. The name
+       * doesn't include the project ID.
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The name of the failover replica. If specified at instance creation, a
+       * failover replica is created for the instance. The name
+       * doesn't include the project ID.
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The name of the failover replica. If specified at instance creation, a
+       * failover replica is created for the instance. The name
+       * doesn't include the project ID.
+       * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The name of the failover replica. If specified at instance creation, a
+       * failover replica is created for the instance. The name
+       * doesn't include the project ID.
+       * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The name of the failover replica. If specified at instance creation, a
+       * failover replica is created for the instance. The name
+       * doesn't include the project ID.
+       * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue available_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + availableBuilder_; + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + * + * @return Whether the available field is set. + */ + public boolean hasAvailable() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + * + * @return The available. + */ + public com.google.protobuf.BoolValue getAvailable() { + if (availableBuilder_ == null) { + return available_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : available_; + } else { + return availableBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + public Builder setAvailable(com.google.protobuf.BoolValue value) { + if (availableBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + available_ = value; + } else { + availableBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + public Builder setAvailable(com.google.protobuf.BoolValue.Builder builderForValue) { + if (availableBuilder_ == null) { + available_ = builderForValue.build(); + } else { + availableBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + public Builder mergeAvailable(com.google.protobuf.BoolValue value) { + if (availableBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && available_ != null + && available_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getAvailableBuilder().mergeFrom(value); + } else { + available_ = value; + } + } else { + availableBuilder_.mergeFrom(value); + } + if (available_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + public Builder clearAvailable() { + bitField0_ = (bitField0_ & ~0x00000002); + available_ = null; + if (availableBuilder_ != null) { + availableBuilder_.dispose(); + availableBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + public com.google.protobuf.BoolValue.Builder getAvailableBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetAvailableFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + public com.google.protobuf.BoolValueOrBuilder getAvailableOrBuilder() { + if (availableBuilder_ != null) { + return availableBuilder_.getMessageOrBuilder(); + } else { + return available_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : available_; + } + } + + /** + * + * + *
+       * The availability status of the failover replica. A false status indicates
+       * that the failover replica is out of sync. The primary instance can only
+       * failover to the failover replica when the status is true.
+       * 
+ * + * .google.protobuf.BoolValue available = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetAvailableFieldBuilder() { + if (availableBuilder_ == null) { + availableBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getAvailable(), getParentForChildren(), isClean()); + available_ = null; + } + return availableBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica) + private static final com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica(); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlFailoverReplica parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlScheduledMaintenanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * bool can_defer = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.can_defer is + * deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=663 + * @return The canDefer. + */ + @java.lang.Deprecated + boolean getCanDefer(); + + /** + * + * + *
+     * If the scheduled maintenance can be rescheduled.
+     * 
+ * + * bool can_reschedule = 3; + * + * @return The canReschedule. + */ + boolean getCanReschedule(); + + /** + * + * + *
+     * Maintenance cannot be rescheduled to start beyond this deadline.
+     * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + * + * @return Whether the scheduleDeadlineTime field is set. + */ + boolean hasScheduleDeadlineTime(); + + /** + * + * + *
+     * Maintenance cannot be rescheduled to start beyond this deadline.
+     * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + * + * @return The scheduleDeadlineTime. + */ + com.google.protobuf.Timestamp getScheduleDeadlineTime(); + + /** + * + * + *
+     * Maintenance cannot be rescheduled to start beyond this deadline.
+     * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getScheduleDeadlineTimeOrBuilder(); + } + + /** + * + * + *
+   * Any scheduled maintenance for this instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance} + */ + public static final class SqlScheduledMaintenance extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance) + SqlScheduledMaintenanceOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlScheduledMaintenance"); + } + + // Use SqlScheduledMaintenance.newBuilder() to construct. + private SqlScheduledMaintenance(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlScheduledMaintenance() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlScheduledMaintenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlScheduledMaintenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.class, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.Builder.class); + } + + private int bitField0_; + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int CAN_DEFER_FIELD_NUMBER = 2; + private boolean canDefer_ = false; + + /** + * bool can_defer = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.can_defer is + * deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=663 + * @return The canDefer. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean getCanDefer() { + return canDefer_; + } + + public static final int CAN_RESCHEDULE_FIELD_NUMBER = 3; + private boolean canReschedule_ = false; + + /** + * + * + *
+     * If the scheduled maintenance can be rescheduled.
+     * 
+ * + * bool can_reschedule = 3; + * + * @return The canReschedule. + */ + @java.lang.Override + public boolean getCanReschedule() { + return canReschedule_; + } + + public static final int SCHEDULE_DEADLINE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp scheduleDeadlineTime_; + + /** + * + * + *
+     * Maintenance cannot be rescheduled to start beyond this deadline.
+     * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + * + * @return Whether the scheduleDeadlineTime field is set. + */ + @java.lang.Override + public boolean hasScheduleDeadlineTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Maintenance cannot be rescheduled to start beyond this deadline.
+     * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + * + * @return The scheduleDeadlineTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getScheduleDeadlineTime() { + return scheduleDeadlineTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleDeadlineTime_; + } + + /** + * + * + *
+     * Maintenance cannot be rescheduled to start beyond this deadline.
+     * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getScheduleDeadlineTimeOrBuilder() { + return scheduleDeadlineTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleDeadlineTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getStartTime()); + } + if (canDefer_ != false) { + output.writeBool(2, canDefer_); + } + if (canReschedule_ != false) { + output.writeBool(3, canReschedule_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getScheduleDeadlineTime()); + } + 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, getStartTime()); + } + if (canDefer_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, canDefer_); + } + if (canReschedule_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, canReschedule_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, getScheduleDeadlineTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance other = + (com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance) obj; + + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (getCanDefer() != other.getCanDefer()) return false; + if (getCanReschedule() != other.getCanReschedule()) return false; + if (hasScheduleDeadlineTime() != other.hasScheduleDeadlineTime()) return false; + if (hasScheduleDeadlineTime()) { + if (!getScheduleDeadlineTime().equals(other.getScheduleDeadlineTime())) return false; + } + if (!getUnknownFields().equals(other.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 (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + hash = (37 * hash) + CAN_DEFER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCanDefer()); + hash = (37 * hash) + CAN_RESCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCanReschedule()); + if (hasScheduleDeadlineTime()) { + hash = (37 * hash) + SCHEDULE_DEADLINE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getScheduleDeadlineTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Any scheduled maintenance for this instance.
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance) + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlScheduledMaintenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlScheduledMaintenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.class, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.Builder + .class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + internalGetScheduleDeadlineTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + canDefer_ = false; + canReschedule_ = false; + scheduleDeadlineTime_ = null; + if (scheduleDeadlineTimeBuilder_ != null) { + scheduleDeadlineTimeBuilder_.dispose(); + scheduleDeadlineTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlScheduledMaintenance_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance build() { + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance buildPartial() { + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance result = + new com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.canDefer_ = canDefer_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.canReschedule_ = canReschedule_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.scheduleDeadlineTime_ = + scheduleDeadlineTimeBuilder_ == null + ? scheduleDeadlineTime_ + : scheduleDeadlineTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance other) { + if (other + == com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + .getDefaultInstance()) return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.getCanDefer() != false) { + setCanDefer(other.getCanDefer()); + } + if (other.getCanReschedule() != false) { + setCanReschedule(other.getCanReschedule()); + } + if (other.hasScheduleDeadlineTime()) { + mergeScheduleDeadlineTime(other.getScheduleDeadlineTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + canDefer_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + canReschedule_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage( + internalGetScheduleDeadlineTimeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000001); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTime_; + } + } + + /** + * + * + *
+       * The start time of any upcoming scheduled maintenance for this instance.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private boolean canDefer_; + + /** + * bool can_defer = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.can_defer is + * deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=663 + * @return The canDefer. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean getCanDefer() { + return canDefer_; + } + + /** + * bool can_defer = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.can_defer is + * deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=663 + * @param value The canDefer to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setCanDefer(boolean value) { + + canDefer_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * bool can_defer = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.can_defer is + * deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=663 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearCanDefer() { + bitField0_ = (bitField0_ & ~0x00000002); + canDefer_ = false; + onChanged(); + return this; + } + + private boolean canReschedule_; + + /** + * + * + *
+       * If the scheduled maintenance can be rescheduled.
+       * 
+ * + * bool can_reschedule = 3; + * + * @return The canReschedule. + */ + @java.lang.Override + public boolean getCanReschedule() { + return canReschedule_; + } + + /** + * + * + *
+       * If the scheduled maintenance can be rescheduled.
+       * 
+ * + * bool can_reschedule = 3; + * + * @param value The canReschedule to set. + * @return This builder for chaining. + */ + public Builder setCanReschedule(boolean value) { + + canReschedule_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * If the scheduled maintenance can be rescheduled.
+       * 
+ * + * bool can_reschedule = 3; + * + * @return This builder for chaining. + */ + public Builder clearCanReschedule() { + bitField0_ = (bitField0_ & ~0x00000004); + canReschedule_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp scheduleDeadlineTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + scheduleDeadlineTimeBuilder_; + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + * + * @return Whether the scheduleDeadlineTime field is set. + */ + public boolean hasScheduleDeadlineTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + * + * @return The scheduleDeadlineTime. + */ + public com.google.protobuf.Timestamp getScheduleDeadlineTime() { + if (scheduleDeadlineTimeBuilder_ == null) { + return scheduleDeadlineTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleDeadlineTime_; + } else { + return scheduleDeadlineTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + public Builder setScheduleDeadlineTime(com.google.protobuf.Timestamp value) { + if (scheduleDeadlineTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scheduleDeadlineTime_ = value; + } else { + scheduleDeadlineTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + public Builder setScheduleDeadlineTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (scheduleDeadlineTimeBuilder_ == null) { + scheduleDeadlineTime_ = builderForValue.build(); + } else { + scheduleDeadlineTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + public Builder mergeScheduleDeadlineTime(com.google.protobuf.Timestamp value) { + if (scheduleDeadlineTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && scheduleDeadlineTime_ != null + && scheduleDeadlineTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getScheduleDeadlineTimeBuilder().mergeFrom(value); + } else { + scheduleDeadlineTime_ = value; + } + } else { + scheduleDeadlineTimeBuilder_.mergeFrom(value); + } + if (scheduleDeadlineTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + public Builder clearScheduleDeadlineTime() { + bitField0_ = (bitField0_ & ~0x00000008); + scheduleDeadlineTime_ = null; + if (scheduleDeadlineTimeBuilder_ != null) { + scheduleDeadlineTimeBuilder_.dispose(); + scheduleDeadlineTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getScheduleDeadlineTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetScheduleDeadlineTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getScheduleDeadlineTimeOrBuilder() { + if (scheduleDeadlineTimeBuilder_ != null) { + return scheduleDeadlineTimeBuilder_.getMessageOrBuilder(); + } else { + return scheduleDeadlineTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleDeadlineTime_; + } + } + + /** + * + * + *
+       * Maintenance cannot be rescheduled to start beyond this deadline.
+       * 
+ * + * optional .google.protobuf.Timestamp schedule_deadline_time = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetScheduleDeadlineTimeFieldBuilder() { + if (scheduleDeadlineTimeBuilder_ == null) { + scheduleDeadlineTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getScheduleDeadlineTime(), getParentForChildren(), isClean()); + scheduleDeadlineTime_ = null; + } + return scheduleDeadlineTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance) + private static final com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance(); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlScheduledMaintenance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlOutOfDiskReportOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * This field represents the state generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return Whether the sqlOutOfDiskState field is set. + */ + boolean hasSqlOutOfDiskState(); + + /** + * + * + *
+     * This field represents the state generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return The enum numeric value on the wire for sqlOutOfDiskState. + */ + int getSqlOutOfDiskStateValue(); + + /** + * + * + *
+     * This field represents the state generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return The sqlOutOfDiskState. + */ + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState + getSqlOutOfDiskState(); + + /** + * + * + *
+     * The minimum recommended increase size in GigaBytes
+     * This field is consumed by the frontend
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @return Whether the sqlMinRecommendedIncreaseSizeGb field is set. + */ + boolean hasSqlMinRecommendedIncreaseSizeGb(); + + /** + * + * + *
+     * The minimum recommended increase size in GigaBytes
+     * This field is consumed by the frontend
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @return The sqlMinRecommendedIncreaseSizeGb. + */ + int getSqlMinRecommendedIncreaseSizeGb(); + } + + /** + * + * + *
+   * This message wraps up the information written by out-of-disk detection job.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport} + */ + public static final class SqlOutOfDiskReport extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport) + SqlOutOfDiskReportOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlOutOfDiskReport"); + } + + // Use SqlOutOfDiskReport.newBuilder() to construct. + private SqlOutOfDiskReport(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlOutOfDiskReport() { + sqlOutOfDiskState_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlOutOfDiskReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlOutOfDiskReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.class, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.Builder.class); + } + + /** + * + * + *
+     * This enum lists all possible states regarding out-of-disk issues.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState} + */ + public enum SqlOutOfDiskState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified state
+       * 
+ * + * SQL_OUT_OF_DISK_STATE_UNSPECIFIED = 0; + */ + SQL_OUT_OF_DISK_STATE_UNSPECIFIED(0), + /** + * + * + *
+       * The instance has plenty space on data disk
+       * 
+ * + * NORMAL = 1; + */ + NORMAL(1), + /** + * + * + *
+       * Data disk is almost used up. It is shutdown to prevent data
+       * corruption.
+       * 
+ * + * SOFT_SHUTDOWN = 2; + */ + SOFT_SHUTDOWN(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlOutOfDiskState"); + } + + /** + * + * + *
+       * Unspecified state
+       * 
+ * + * SQL_OUT_OF_DISK_STATE_UNSPECIFIED = 0; + */ + public static final int SQL_OUT_OF_DISK_STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+       * The instance has plenty space on data disk
+       * 
+ * + * NORMAL = 1; + */ + public static final int NORMAL_VALUE = 1; + + /** + * + * + *
+       * Data disk is almost used up. It is shutdown to prevent data
+       * corruption.
+       * 
+ * + * SOFT_SHUTDOWN = 2; + */ + public static final int SOFT_SHUTDOWN_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 SqlOutOfDiskState 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 SqlOutOfDiskState forNumber(int value) { + switch (value) { + case 0: + return SQL_OUT_OF_DISK_STATE_UNSPECIFIED; + case 1: + return NORMAL; + case 2: + return SOFT_SHUTDOWN; + 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 SqlOutOfDiskState findValueByNumber(int number) { + return SqlOutOfDiskState.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final SqlOutOfDiskState[] VALUES = values(); + + public static SqlOutOfDiskState 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 SqlOutOfDiskState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState) + } + + private int bitField0_; + public static final int SQL_OUT_OF_DISK_STATE_FIELD_NUMBER = 1; + private int sqlOutOfDiskState_ = 0; + + /** + * + * + *
+     * This field represents the state generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return Whether the sqlOutOfDiskState field is set. + */ + @java.lang.Override + public boolean hasSqlOutOfDiskState() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * This field represents the state generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return The enum numeric value on the wire for sqlOutOfDiskState. + */ + @java.lang.Override + public int getSqlOutOfDiskStateValue() { + return sqlOutOfDiskState_; + } + + /** + * + * + *
+     * This field represents the state generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return The sqlOutOfDiskState. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState + getSqlOutOfDiskState() { + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState result = + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState + .forNumber(sqlOutOfDiskState_); + return result == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState + .UNRECOGNIZED + : result; + } + + public static final int SQL_MIN_RECOMMENDED_INCREASE_SIZE_GB_FIELD_NUMBER = 2; + private int sqlMinRecommendedIncreaseSizeGb_ = 0; + + /** + * + * + *
+     * The minimum recommended increase size in GigaBytes
+     * This field is consumed by the frontend
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @return Whether the sqlMinRecommendedIncreaseSizeGb field is set. + */ + @java.lang.Override + public boolean hasSqlMinRecommendedIncreaseSizeGb() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The minimum recommended increase size in GigaBytes
+     * This field is consumed by the frontend
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @return The sqlMinRecommendedIncreaseSizeGb. + */ + @java.lang.Override + public int getSqlMinRecommendedIncreaseSizeGb() { + return sqlMinRecommendedIncreaseSizeGb_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.writeEnum(1, sqlOutOfDiskState_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(2, sqlMinRecommendedIncreaseSizeGb_); + } + 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.computeEnumSize(1, sqlOutOfDiskState_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 2, sqlMinRecommendedIncreaseSizeGb_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport other = + (com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport) obj; + + if (hasSqlOutOfDiskState() != other.hasSqlOutOfDiskState()) return false; + if (hasSqlOutOfDiskState()) { + if (sqlOutOfDiskState_ != other.sqlOutOfDiskState_) return false; + } + if (hasSqlMinRecommendedIncreaseSizeGb() != other.hasSqlMinRecommendedIncreaseSizeGb()) + return false; + if (hasSqlMinRecommendedIncreaseSizeGb()) { + if (getSqlMinRecommendedIncreaseSizeGb() != other.getSqlMinRecommendedIncreaseSizeGb()) + return false; + } + if (!getUnknownFields().equals(other.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 (hasSqlOutOfDiskState()) { + hash = (37 * hash) + SQL_OUT_OF_DISK_STATE_FIELD_NUMBER; + hash = (53 * hash) + sqlOutOfDiskState_; + } + if (hasSqlMinRecommendedIncreaseSizeGb()) { + hash = (37 * hash) + SQL_MIN_RECOMMENDED_INCREASE_SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + getSqlMinRecommendedIncreaseSizeGb(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * This message wraps up the information written by out-of-disk detection job.
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport) + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReportOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlOutOfDiskReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlOutOfDiskReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.class, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sqlOutOfDiskState_ = 0; + sqlMinRecommendedIncreaseSizeGb_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_SqlOutOfDiskReport_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport build() { + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport buildPartial() { + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport result = + new com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sqlOutOfDiskState_ = sqlOutOfDiskState_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sqlMinRecommendedIncreaseSizeGb_ = sqlMinRecommendedIncreaseSizeGb_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport other) { + if (other + == com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport + .getDefaultInstance()) return this; + if (other.hasSqlOutOfDiskState()) { + setSqlOutOfDiskStateValue(other.getSqlOutOfDiskStateValue()); + } + if (other.hasSqlMinRecommendedIncreaseSizeGb()) { + setSqlMinRecommendedIncreaseSizeGb(other.getSqlMinRecommendedIncreaseSizeGb()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + sqlOutOfDiskState_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + sqlMinRecommendedIncreaseSizeGb_ = 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 sqlOutOfDiskState_ = 0; + + /** + * + * + *
+       * This field represents the state generated by the proactive database
+       * wellness job for OutOfDisk issues.
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * *  the proactive database wellness job
+       * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return Whether the sqlOutOfDiskState field is set. + */ + @java.lang.Override + public boolean hasSqlOutOfDiskState() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * This field represents the state generated by the proactive database
+       * wellness job for OutOfDisk issues.
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * *  the proactive database wellness job
+       * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return The enum numeric value on the wire for sqlOutOfDiskState. + */ + @java.lang.Override + public int getSqlOutOfDiskStateValue() { + return sqlOutOfDiskState_; + } + + /** + * + * + *
+       * This field represents the state generated by the proactive database
+       * wellness job for OutOfDisk issues.
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * *  the proactive database wellness job
+       * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @param value The enum numeric value on the wire for sqlOutOfDiskState to set. + * @return This builder for chaining. + */ + public Builder setSqlOutOfDiskStateValue(int value) { + sqlOutOfDiskState_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * This field represents the state generated by the proactive database
+       * wellness job for OutOfDisk issues.
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * *  the proactive database wellness job
+       * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return The sqlOutOfDiskState. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState + getSqlOutOfDiskState() { + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState result = + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState + .forNumber(sqlOutOfDiskState_); + return result == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * This field represents the state generated by the proactive database
+       * wellness job for OutOfDisk issues.
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * *  the proactive database wellness job
+       * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @param value The sqlOutOfDiskState to set. + * @return This builder for chaining. + */ + public Builder setSqlOutOfDiskState( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + sqlOutOfDiskState_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * This field represents the state generated by the proactive database
+       * wellness job for OutOfDisk issues.
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * *  the proactive database wellness job
+       * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState sql_out_of_disk_state = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearSqlOutOfDiskState() { + bitField0_ = (bitField0_ & ~0x00000001); + sqlOutOfDiskState_ = 0; + onChanged(); + return this; + } + + private int sqlMinRecommendedIncreaseSizeGb_; + + /** + * + * + *
+       * The minimum recommended increase size in GigaBytes
+       * This field is consumed by the frontend
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @return Whether the sqlMinRecommendedIncreaseSizeGb field is set. + */ + @java.lang.Override + public boolean hasSqlMinRecommendedIncreaseSizeGb() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The minimum recommended increase size in GigaBytes
+       * This field is consumed by the frontend
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @return The sqlMinRecommendedIncreaseSizeGb. + */ + @java.lang.Override + public int getSqlMinRecommendedIncreaseSizeGb() { + return sqlMinRecommendedIncreaseSizeGb_; + } + + /** + * + * + *
+       * The minimum recommended increase size in GigaBytes
+       * This field is consumed by the frontend
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @param value The sqlMinRecommendedIncreaseSizeGb to set. + * @return This builder for chaining. + */ + public Builder setSqlMinRecommendedIncreaseSizeGb(int value) { + + sqlMinRecommendedIncreaseSizeGb_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The minimum recommended increase size in GigaBytes
+       * This field is consumed by the frontend
+       * *  Writers:
+       * *  the proactive database wellness job for OOD.
+       * *  Readers:
+       * 
+ * + * optional int32 sql_min_recommended_increase_size_gb = 2; + * + * @return This builder for chaining. + */ + public Builder clearSqlMinRecommendedIncreaseSizeGb() { + bitField0_ = (bitField0_ & ~0x00000002); + sqlMinRecommendedIncreaseSizeGb_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport) + private static final com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport(); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlOutOfDiskReport parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PoolNodeConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. The name of the read pool node, to be used for retrieving
+     * metrics and logs.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the name field is set. + */ + boolean hasName(); + + /** + * + * + *
+     * Output only. The name of the read pool node, to be used for retrieving
+     * metrics and logs.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+     * Output only. The name of the read pool node, to be used for retrieving
+     * metrics and logs.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * Output only. The zone of the read pool node.
+     * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the gceZone field is set. + */ + boolean hasGceZone(); + + /** + * + * + *
+     * Output only. The zone of the read pool node.
+     * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The gceZone. + */ + java.lang.String getGceZone(); + + /** + * + * + *
+     * Output only. The zone of the read pool node.
+     * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for gceZone. + */ + com.google.protobuf.ByteString getGceZoneBytes(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getIpAddressesList(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.IpMapping getIpAddresses(int index); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getIpAddressesCount(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getIpAddressesOrBuilderList(); + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.IpMappingOrBuilder getIpAddressesOrBuilder(int index); + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + boolean hasDnsName(); + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + java.lang.String getDnsName(); + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + com.google.protobuf.ByteString getDnsNameBytes(); + + /** + * + * + *
+     * Output only. The current state of the read pool node.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the state field is set. + */ + boolean hasState(); + + /** + * + * + *
+     * Output only. The current state of the read pool node.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+     * Output only. The current state of the read pool node.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState getState(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getDnsNamesList(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.DnsNameMapping getDnsNames(int index); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getDnsNamesCount(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getDnsNamesOrBuilderList(); + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index); + + /** + * + * + *
+     * Output only. The Private Service Connect (PSC) service attachment of the
+     * read pool node.
+     * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscServiceAttachmentLink field is set. + */ + boolean hasPscServiceAttachmentLink(); + + /** + * + * + *
+     * Output only. The Private Service Connect (PSC) service attachment of the
+     * read pool node.
+     * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscServiceAttachmentLink. + */ + java.lang.String getPscServiceAttachmentLink(); + + /** + * + * + *
+     * Output only. The Private Service Connect (PSC) service attachment of the
+     * read pool node.
+     * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for pscServiceAttachmentLink. + */ + com.google.protobuf.ByteString getPscServiceAttachmentLinkBytes(); + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getPscAutoConnectionsList(); + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig getPscAutoConnections(int index); + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getPscAutoConnectionsCount(); + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getPscAutoConnectionsOrBuilderList(); + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.PscAutoConnectionConfigOrBuilder getPscAutoConnectionsOrBuilder( + int index); + } + + /** + * + * + *
+   * Details of a single read pool node of a read pool.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig} + */ + public static final class PoolNodeConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig) + PoolNodeConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PoolNodeConfig"); + } + + // Use PoolNodeConfig.newBuilder() to construct. + private PoolNodeConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PoolNodeConfig() { + name_ = ""; + gceZone_ = ""; + ipAddresses_ = java.util.Collections.emptyList(); + dnsName_ = ""; + state_ = 0; + dnsNames_ = java.util.Collections.emptyList(); + pscServiceAttachmentLink_ = ""; + pscAutoConnections_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_PoolNodeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_PoolNodeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.class, + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. The name of the read pool node, to be used for retrieving
+     * metrics and logs.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the name field is set. + */ + @java.lang.Override + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Output only. The name of the read pool node, to be used for retrieving
+     * metrics and logs.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The name of the read pool node, to be used for retrieving
+     * metrics and logs.
+     * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GCE_ZONE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object gceZone_ = ""; + + /** + * + * + *
+     * Output only. The zone of the read pool node.
+     * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the gceZone field is set. + */ + @java.lang.Override + public boolean hasGceZone() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. The zone of the read pool node.
+     * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The gceZone. + */ + @java.lang.Override + public java.lang.String getGceZone() { + java.lang.Object ref = gceZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gceZone_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The zone of the read pool node.
+     * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for gceZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGceZoneBytes() { + java.lang.Object ref = gceZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESSES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List ipAddresses_; + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getIpAddressesList() { + return ipAddresses_; + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getIpAddressesOrBuilderList() { + return ipAddresses_; + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getIpAddressesCount() { + return ipAddresses_.size(); + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpMapping getIpAddresses(int index) { + return ipAddresses_.get(index); + } + + /** + * + * + *
+     * Output only. Mappings containing IP addresses that can be used to connect
+     * to the read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + return ipAddresses_.get(index); + } + + public static final int DNS_NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object dnsName_ = ""; + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + @java.lang.Override + public boolean hasDnsName() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + @java.lang.Override + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The DNS name of the read pool node.
+     * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 5; + private int state_ = 0; + + /** + * + * + *
+     * Output only. The current state of the read pool node.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the state field is set. + */ + @java.lang.Override + public boolean hasState() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Output only. The current state of the read pool node.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState 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. The current state of the read pool node.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState getState() { + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState result = + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState.forNumber(state_); + return result == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState.UNRECOGNIZED + : result; + } + + public static final int DNS_NAMES_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private java.util.List dnsNames_; + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getDnsNamesList() { + return dnsNames_; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDnsNamesOrBuilderList() { + return dnsNames_; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getDnsNamesCount() { + return dnsNames_.size(); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMapping getDnsNames(int index) { + return dnsNames_.get(index); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + return dnsNames_.get(index); + } + + public static final int PSC_SERVICE_ATTACHMENT_LINK_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object pscServiceAttachmentLink_ = ""; + + /** + * + * + *
+     * Output only. The Private Service Connect (PSC) service attachment of the
+     * read pool node.
+     * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscServiceAttachmentLink field is set. + */ + @java.lang.Override + public boolean hasPscServiceAttachmentLink() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Output only. The Private Service Connect (PSC) service attachment of the
+     * read pool node.
+     * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscServiceAttachmentLink. + */ + @java.lang.Override + public java.lang.String getPscServiceAttachmentLink() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pscServiceAttachmentLink_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The Private Service Connect (PSC) service attachment of the
+     * read pool node.
+     * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for pscServiceAttachmentLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPscServiceAttachmentLinkBytes() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pscServiceAttachmentLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PSC_AUTO_CONNECTIONS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private java.util.List + pscAutoConnections_; + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getPscAutoConnectionsList() { + return pscAutoConnections_; + } + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getPscAutoConnectionsOrBuilderList() { + return pscAutoConnections_; + } + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getPscAutoConnectionsCount() { + return pscAutoConnections_.size(); + } + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfig getPscAutoConnections(int index) { + return pscAutoConnections_.get(index); + } + + /** + * + * + *
+     * Output only. The list of settings for requested automatically-setup
+     * Private Service Connect (PSC) consumer endpoints that can be used to
+     * connect to this read pool node.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfigOrBuilder + getPscAutoConnectionsOrBuilder(int index) { + return pscAutoConnections_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, gceZone_); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + output.writeMessage(3, ipAddresses_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, dnsName_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeEnum(5, state_); + } + for (int i = 0; i < dnsNames_.size(); i++) { + output.writeMessage(6, dnsNames_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, pscServiceAttachmentLink_); + } + for (int i = 0; i < pscAutoConnections_.size(); i++) { + output.writeMessage(8, pscAutoConnections_.get(i)); + } + 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.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, gceZone_); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, ipAddresses_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, dnsName_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_); + } + for (int i = 0; i < dnsNames_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, dnsNames_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.GeneratedMessage.computeStringSize(7, pscServiceAttachmentLink_); + } + for (int i = 0; i < pscAutoConnections_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(8, pscAutoConnections_.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.sql.v1beta4.DatabaseInstance.PoolNodeConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig other = + (com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig) obj; + + if (hasName() != other.hasName()) return false; + if (hasName()) { + if (!getName().equals(other.getName())) return false; + } + if (hasGceZone() != other.hasGceZone()) return false; + if (hasGceZone()) { + if (!getGceZone().equals(other.getGceZone())) return false; + } + if (!getIpAddressesList().equals(other.getIpAddressesList())) return false; + if (hasDnsName() != other.hasDnsName()) return false; + if (hasDnsName()) { + if (!getDnsName().equals(other.getDnsName())) return false; + } + if (hasState() != other.hasState()) return false; + if (hasState()) { + if (state_ != other.state_) return false; + } + if (!getDnsNamesList().equals(other.getDnsNamesList())) return false; + if (hasPscServiceAttachmentLink() != other.hasPscServiceAttachmentLink()) return false; + if (hasPscServiceAttachmentLink()) { + if (!getPscServiceAttachmentLink().equals(other.getPscServiceAttachmentLink())) + return false; + } + if (!getPscAutoConnectionsList().equals(other.getPscAutoConnectionsList())) return false; + if (!getUnknownFields().equals(other.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 (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasGceZone()) { + hash = (37 * hash) + GCE_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getGceZone().hashCode(); + } + if (getIpAddressesCount() > 0) { + hash = (37 * hash) + IP_ADDRESSES_FIELD_NUMBER; + hash = (53 * hash) + getIpAddressesList().hashCode(); + } + if (hasDnsName()) { + hash = (37 * hash) + DNS_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDnsName().hashCode(); + } + if (hasState()) { + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + } + if (getDnsNamesCount() > 0) { + hash = (37 * hash) + DNS_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getDnsNamesList().hashCode(); + } + if (hasPscServiceAttachmentLink()) { + hash = (37 * hash) + PSC_SERVICE_ATTACHMENT_LINK_FIELD_NUMBER; + hash = (53 * hash) + getPscServiceAttachmentLink().hashCode(); + } + if (getPscAutoConnectionsCount() > 0) { + hash = (37 * hash) + PSC_AUTO_CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPscAutoConnectionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Details of a single read pool node of a read pool.
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig) + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_PoolNodeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_PoolNodeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.class, + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + gceZone_ = ""; + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + } else { + ipAddresses_ = null; + ipAddressesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + dnsName_ = ""; + state_ = 0; + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + } else { + dnsNames_ = null; + dnsNamesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + pscServiceAttachmentLink_ = ""; + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnections_ = java.util.Collections.emptyList(); + } else { + pscAutoConnections_ = null; + pscAutoConnectionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_PoolNodeConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig build() { + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig buildPartial() { + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig result = + new com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig result) { + if (ipAddressesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + ipAddresses_ = java.util.Collections.unmodifiableList(ipAddresses_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.ipAddresses_ = ipAddresses_; + } else { + result.ipAddresses_ = ipAddressesBuilder_.build(); + } + if (dnsNamesBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + dnsNames_ = java.util.Collections.unmodifiableList(dnsNames_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.dnsNames_ = dnsNames_; + } else { + result.dnsNames_ = dnsNamesBuilder_.build(); + } + if (pscAutoConnectionsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + pscAutoConnections_ = java.util.Collections.unmodifiableList(pscAutoConnections_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.pscAutoConnections_ = pscAutoConnections_; + } else { + result.pscAutoConnections_ = pscAutoConnectionsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.gceZone_ = gceZone_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.dnsName_ = dnsName_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.state_ = state_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pscServiceAttachmentLink_ = pscServiceAttachmentLink_; + to_bitField0_ |= 0x00000010; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig other) { + if (other + == com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.getDefaultInstance()) + return this; + if (other.hasName()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasGceZone()) { + gceZone_ = other.gceZone_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (ipAddressesBuilder_ == null) { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddresses_.isEmpty()) { + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureIpAddressesIsMutable(); + ipAddresses_.addAll(other.ipAddresses_); + } + onChanged(); + } + } else { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddressesBuilder_.isEmpty()) { + ipAddressesBuilder_.dispose(); + ipAddressesBuilder_ = null; + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000004); + ipAddressesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetIpAddressesFieldBuilder() + : null; + } else { + ipAddressesBuilder_.addAllMessages(other.ipAddresses_); + } + } + } + if (other.hasDnsName()) { + dnsName_ = other.dnsName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasState()) { + setStateValue(other.getStateValue()); + } + if (dnsNamesBuilder_ == null) { + if (!other.dnsNames_.isEmpty()) { + if (dnsNames_.isEmpty()) { + dnsNames_ = other.dnsNames_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureDnsNamesIsMutable(); + dnsNames_.addAll(other.dnsNames_); + } + onChanged(); + } + } else { + if (!other.dnsNames_.isEmpty()) { + if (dnsNamesBuilder_.isEmpty()) { + dnsNamesBuilder_.dispose(); + dnsNamesBuilder_ = null; + dnsNames_ = other.dnsNames_; + bitField0_ = (bitField0_ & ~0x00000020); + dnsNamesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDnsNamesFieldBuilder() + : null; + } else { + dnsNamesBuilder_.addAllMessages(other.dnsNames_); + } + } + } + if (other.hasPscServiceAttachmentLink()) { + pscServiceAttachmentLink_ = other.pscServiceAttachmentLink_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (pscAutoConnectionsBuilder_ == null) { + if (!other.pscAutoConnections_.isEmpty()) { + if (pscAutoConnections_.isEmpty()) { + pscAutoConnections_ = other.pscAutoConnections_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.addAll(other.pscAutoConnections_); + } + onChanged(); + } + } else { + if (!other.pscAutoConnections_.isEmpty()) { + if (pscAutoConnectionsBuilder_.isEmpty()) { + pscAutoConnectionsBuilder_.dispose(); + pscAutoConnectionsBuilder_ = null; + pscAutoConnections_ = other.pscAutoConnections_; + bitField0_ = (bitField0_ & ~0x00000080); + pscAutoConnectionsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPscAutoConnectionsFieldBuilder() + : null; + } else { + pscAutoConnectionsBuilder_.addAllMessages(other.pscAutoConnections_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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: + { + gceZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.cloud.sql.v1beta4.IpMapping m = + input.readMessage( + com.google.cloud.sql.v1beta4.IpMapping.parser(), extensionRegistry); + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(m); + } else { + ipAddressesBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + dnsName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + com.google.cloud.sql.v1beta4.DnsNameMapping m = + input.readMessage( + com.google.cloud.sql.v1beta4.DnsNameMapping.parser(), extensionRegistry); + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(m); + } else { + dnsNamesBuilder_.addMessage(m); + } + break; + } // case 50 + case 58: + { + pscServiceAttachmentLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig m = + input.readMessage( + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.parser(), + extensionRegistry); + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(m); + } else { + pscAutoConnectionsBuilder_.addMessage(m); + } + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+       * Output only. The name of the read pool node, to be used for retrieving
+       * metrics and logs.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the name field is set. + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Output only. The name of the read pool node, to be used for retrieving
+       * metrics and logs.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The name of the read pool node, to be used for retrieving
+       * metrics and logs.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The name of the read pool node, to be used for retrieving
+       * metrics and logs.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The name of the read pool node, to be used for retrieving
+       * metrics and logs.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The name of the read pool node, to be used for retrieving
+       * metrics and logs.
+       * 
+ * + * optional string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object gceZone_ = ""; + + /** + * + * + *
+       * Output only. The zone of the read pool node.
+       * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the gceZone field is set. + */ + public boolean hasGceZone() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Output only. The zone of the read pool node.
+       * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The gceZone. + */ + public java.lang.String getGceZone() { + java.lang.Object ref = gceZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gceZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The zone of the read pool node.
+       * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for gceZone. + */ + public com.google.protobuf.ByteString getGceZoneBytes() { + java.lang.Object ref = gceZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The zone of the read pool node.
+       * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The gceZone to set. + * @return This builder for chaining. + */ + public Builder setGceZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + gceZone_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The zone of the read pool node.
+       * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearGceZone() { + gceZone_ = getDefaultInstance().getGceZone(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The zone of the read pool node.
+       * 
+ * + * optional string gce_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for gceZone to set. + * @return This builder for chaining. + */ + public Builder setGceZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + gceZone_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List ipAddresses_ = + java.util.Collections.emptyList(); + + private void ensureIpAddressesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + ipAddresses_ = + new java.util.ArrayList(ipAddresses_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.IpMapping, + com.google.cloud.sql.v1beta4.IpMapping.Builder, + com.google.cloud.sql.v1beta4.IpMappingOrBuilder> + ipAddressesBuilder_; + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getIpAddressesList() { + if (ipAddressesBuilder_ == null) { + return java.util.Collections.unmodifiableList(ipAddresses_); + } else { + return ipAddressesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getIpAddressesCount() { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.size(); + } else { + return ipAddressesBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.IpMapping getIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setIpAddresses(int index, com.google.cloud.sql.v1beta4.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, value); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setIpAddresses( + int index, com.google.cloud.sql.v1beta4.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses(com.google.cloud.sql.v1beta4.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses(int index, com.google.cloud.sql.v1beta4.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses( + com.google.cloud.sql.v1beta4.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIpAddresses( + int index, com.google.cloud.sql.v1beta4.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllIpAddresses( + java.lang.Iterable values) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipAddresses_); + onChanged(); + } else { + ipAddressesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearIpAddresses() { + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + ipAddressesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.remove(index); + onChanged(); + } else { + ipAddressesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.IpMapping.Builder getIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getIpAddressesOrBuilderList() { + if (ipAddressesBuilder_ != null) { + return ipAddressesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(ipAddresses_); + } + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.IpMapping.Builder addIpAddressesBuilder() { + return internalGetIpAddressesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.IpMapping.Builder addIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. Mappings containing IP addresses that can be used to connect
+       * to the read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getIpAddressesBuilderList() { + return internalGetIpAddressesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.IpMapping, + com.google.cloud.sql.v1beta4.IpMapping.Builder, + com.google.cloud.sql.v1beta4.IpMappingOrBuilder> + internalGetIpAddressesFieldBuilder() { + if (ipAddressesBuilder_ == null) { + ipAddressesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.IpMapping, + com.google.cloud.sql.v1beta4.IpMapping.Builder, + com.google.cloud.sql.v1beta4.IpMappingOrBuilder>( + ipAddresses_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + ipAddresses_ = null; + } + return ipAddressesBuilder_; + } + + private java.lang.Object dnsName_ = ""; + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + public boolean hasDnsName() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dnsName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDnsName() { + dnsName_ = getDefaultInstance().getDnsName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The DNS name of the read pool node.
+       * 
+ * + * optional string dns_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dnsName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int state_ = 0; + + /** + * + * + *
+       * Output only. The current state of the read pool node.
+       * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the state field is set. + */ + @java.lang.Override + public boolean hasState() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+       * Output only. The current state of the read pool node.
+       * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState 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. The current state of the read pool node.
+       * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState 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. The current state of the read pool node.
+       * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState getState() { + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState result = + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState.forNumber(state_); + return result == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * Output only. The current state of the read pool node.
+       * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState 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.sql.v1beta4.DatabaseInstance.SqlInstanceState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The current state of the read pool node.
+       * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState 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 java.util.List dnsNames_ = + java.util.Collections.emptyList(); + + private void ensureDnsNamesIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + dnsNames_ = + new java.util.ArrayList(dnsNames_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DnsNameMapping, + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder, + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder> + dnsNamesBuilder_; + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getDnsNamesList() { + if (dnsNamesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dnsNames_); + } else { + return dnsNamesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getDnsNamesCount() { + if (dnsNamesBuilder_ == null) { + return dnsNames_.size(); + } else { + return dnsNamesBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping getDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames(int index, com.google.cloud.sql.v1beta4.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.set(index, value); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames( + int index, com.google.cloud.sql.v1beta4.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.set(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(com.google.cloud.sql.v1beta4.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(int index, com.google.cloud.sql.v1beta4.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(index, value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames( + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames( + int index, com.google.cloud.sql.v1beta4.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllDnsNames( + java.lang.Iterable values) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dnsNames_); + onChanged(); + } else { + dnsNamesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDnsNames() { + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + dnsNamesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.remove(index); + onChanged(); + } else { + dnsNamesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping.Builder getDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDnsNamesOrBuilderList() { + if (dnsNamesBuilder_ != null) { + return dnsNamesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dnsNames_); + } + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping.Builder addDnsNamesBuilder() { + return internalGetDnsNamesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping.Builder addDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. The list of DNS names used by this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDnsNamesBuilderList() { + return internalGetDnsNamesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DnsNameMapping, + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder, + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder> + internalGetDnsNamesFieldBuilder() { + if (dnsNamesBuilder_ == null) { + dnsNamesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DnsNameMapping, + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder, + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder>( + dnsNames_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); + dnsNames_ = null; + } + return dnsNamesBuilder_; + } + + private java.lang.Object pscServiceAttachmentLink_ = ""; + + /** + * + * + *
+       * Output only. The Private Service Connect (PSC) service attachment of the
+       * read pool node.
+       * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscServiceAttachmentLink field is set. + */ + public boolean hasPscServiceAttachmentLink() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+       * Output only. The Private Service Connect (PSC) service attachment of the
+       * read pool node.
+       * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscServiceAttachmentLink. + */ + public java.lang.String getPscServiceAttachmentLink() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pscServiceAttachmentLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The Private Service Connect (PSC) service attachment of the
+       * read pool node.
+       * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for pscServiceAttachmentLink. + */ + public com.google.protobuf.ByteString getPscServiceAttachmentLinkBytes() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pscServiceAttachmentLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The Private Service Connect (PSC) service attachment of the
+       * read pool node.
+       * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The pscServiceAttachmentLink to set. + * @return This builder for chaining. + */ + public Builder setPscServiceAttachmentLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pscServiceAttachmentLink_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The Private Service Connect (PSC) service attachment of the
+       * read pool node.
+       * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearPscServiceAttachmentLink() { + pscServiceAttachmentLink_ = getDefaultInstance().getPscServiceAttachmentLink(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The Private Service Connect (PSC) service attachment of the
+       * read pool node.
+       * 
+ * + * + * optional string psc_service_attachment_link = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for pscServiceAttachmentLink to set. + * @return This builder for chaining. + */ + public Builder setPscServiceAttachmentLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pscServiceAttachmentLink_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.util.List + pscAutoConnections_ = java.util.Collections.emptyList(); + + private void ensurePscAutoConnectionsIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + pscAutoConnections_ = + new java.util.ArrayList( + pscAutoConnections_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig, + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder, + com.google.cloud.sql.v1beta4.PscAutoConnectionConfigOrBuilder> + pscAutoConnectionsBuilder_; + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPscAutoConnectionsList() { + if (pscAutoConnectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pscAutoConnections_); + } else { + return pscAutoConnectionsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getPscAutoConnectionsCount() { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.size(); + } else { + return pscAutoConnectionsBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfig getPscAutoConnections(int index) { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.get(index); + } else { + return pscAutoConnectionsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPscAutoConnections( + int index, com.google.cloud.sql.v1beta4.PscAutoConnectionConfig value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.set(index, value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPscAutoConnections( + int index, com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.set(index, builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscAutoConnections( + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscAutoConnections( + int index, com.google.cloud.sql.v1beta4.PscAutoConnectionConfig value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(index, value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscAutoConnections( + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscAutoConnections( + int index, com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(index, builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPscAutoConnections() { + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + pscAutoConnectionsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removePscAutoConnections(int index) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.remove(index); + onChanged(); + } else { + pscAutoConnectionsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder + getPscAutoConnectionsBuilder(int index) { + return internalGetPscAutoConnectionsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfigOrBuilder + getPscAutoConnectionsOrBuilder(int index) { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.get(index); + } else { + return pscAutoConnectionsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPscAutoConnectionsOrBuilderList() { + if (pscAutoConnectionsBuilder_ != null) { + return pscAutoConnectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pscAutoConnections_); + } + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder + addPscAutoConnectionsBuilder() { + return internalGetPscAutoConnectionsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder + addPscAutoConnectionsBuilder(int index) { + return internalGetPscAutoConnectionsFieldBuilder() + .addBuilder( + index, com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. The list of settings for requested automatically-setup
+       * Private Service Connect (PSC) consumer endpoints that can be used to
+       * connect to this read pool node.
+       * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPscAutoConnectionsBuilderList() { + return internalGetPscAutoConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig, + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder, + com.google.cloud.sql.v1beta4.PscAutoConnectionConfigOrBuilder> + internalGetPscAutoConnectionsFieldBuilder() { + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig, + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder, + com.google.cloud.sql.v1beta4.PscAutoConnectionConfigOrBuilder>( + pscAutoConnections_, + ((bitField0_ & 0x00000080) != 0), + getParentForChildren(), + isClean()); + pscAutoConnections_ = null; + } + return pscAutoConnectionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig) + private static final com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig(); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PoolNodeConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#instance`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#instance`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 2; + private int state_ = 0; + + /** + * + * + *
+   * The current serving state of the Cloud SQL instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 2; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+   * The current serving state of the Cloud SQL instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 2; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState getState() { + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState result = + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState.forNumber(state_); + return result == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState.UNRECOGNIZED + : result; + } + + public static final int DATABASE_VERSION_FIELD_NUMBER = 3; + private int databaseVersion_ = 0; + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion` field cannot
+   * be changed after instance creation.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 3; + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion` field cannot
+   * be changed after instance creation.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 3; + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1beta4.SqlDatabaseVersion result = + com.google.cloud.sql.v1beta4.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1beta4.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + public static final int SETTINGS_FIELD_NUMBER = 4; + private com.google.cloud.sql.v1beta4.Settings settings_; + + /** + * + * + *
+   * The user settings.
+   * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + * + * @return Whether the settings field is set. + */ + @java.lang.Override + public boolean hasSettings() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The user settings.
+   * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + * + * @return The settings. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Settings getSettings() { + return settings_ == null + ? com.google.cloud.sql.v1beta4.Settings.getDefaultInstance() + : settings_; + } + + /** + * + * + *
+   * The user settings.
+   * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SettingsOrBuilder getSettingsOrBuilder() { + return settings_ == null + ? com.google.cloud.sql.v1beta4.Settings.getDefaultInstance() + : settings_; + } + + public static final int ETAG_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API. Use the `settings.settingsVersion` field instead.
+   * 
+ * + * string etag = 5; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API. Use the `settings.settingsVersion` field instead.
+   * 
+ * + * string etag = 5; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FAILOVER_REPLICA_FIELD_NUMBER = 6; + private com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failoverReplica_; + + /** + * + * + *
+   * The name and status of the failover replica.
+   * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + * + * @return Whether the failoverReplica field is set. + */ + @java.lang.Override + public boolean hasFailoverReplica() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The name and status of the failover replica.
+   * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + * + * @return The failoverReplica. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica getFailoverReplica() { + return failoverReplica_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.getDefaultInstance() + : failoverReplica_; + } + + /** + * + * + *
+   * The name and status of the failover replica.
+   * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplicaOrBuilder + getFailoverReplicaOrBuilder() { + return failoverReplica_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.getDefaultInstance() + : failoverReplica_; + } + + public static final int MASTER_INSTANCE_NAME_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object masterInstanceName_ = ""; + + /** + * + * + *
+   * The name of the instance which will act as primary in the replication
+   * setup.
+   * 
+ * + * string master_instance_name = 7; + * + * @return The masterInstanceName. + */ + @java.lang.Override + public java.lang.String getMasterInstanceName() { + java.lang.Object ref = masterInstanceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + masterInstanceName_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the instance which will act as primary in the replication
+   * setup.
+   * 
+ * + * string master_instance_name = 7; + * + * @return The bytes for masterInstanceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMasterInstanceNameBytes() { + java.lang.Object ref = masterInstanceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + masterInstanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPLICA_NAMES_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList replicaNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @return A list containing the replicaNames. + */ + public com.google.protobuf.ProtocolStringList getReplicaNamesList() { + return replicaNames_; + } + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @return The count of replicaNames. + */ + public int getReplicaNamesCount() { + return replicaNames_.size(); + } + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @param index The index of the element to return. + * @return The replicaNames at the given index. + */ + public java.lang.String getReplicaNames(int index) { + return replicaNames_.get(index); + } + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @param index The index of the value to return. + * @return The bytes of the replicaNames at the given index. + */ + public com.google.protobuf.ByteString getReplicaNamesBytes(int index) { + return replicaNames_.getByteString(index); + } + + public static final int MAX_DISK_SIZE_FIELD_NUMBER = 9; + private com.google.protobuf.Int64Value maxDiskSize_; + + /** + * + * + *
+   * The maximum disk size of the instance in bytes.
+   * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.max_disk_size is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=779 + * @return Whether the maxDiskSize field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasMaxDiskSize() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The maximum disk size of the instance in bytes.
+   * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.max_disk_size is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=779 + * @return The maxDiskSize. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.Int64Value getMaxDiskSize() { + return maxDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : maxDiskSize_; + } + + /** + * + * + *
+   * The maximum disk size of the instance in bytes.
+   * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.Int64ValueOrBuilder getMaxDiskSizeOrBuilder() { + return maxDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : maxDiskSize_; + } + + public static final int CURRENT_DISK_SIZE_FIELD_NUMBER = 10; + private com.google.protobuf.Int64Value currentDiskSize_; + + /** + * + * + *
+   * The current disk usage of the instance in bytes. This property has been
+   * deprecated. Use the
+   * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+   * Monitoring API instead. Please see [this
+   * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+   * for details.
+   * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.current_disk_size is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=787 + * @return Whether the currentDiskSize field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasCurrentDiskSize() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * The current disk usage of the instance in bytes. This property has been
+   * deprecated. Use the
+   * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+   * Monitoring API instead. Please see [this
+   * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+   * for details.
+   * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.current_disk_size is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=787 + * @return The currentDiskSize. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.Int64Value getCurrentDiskSize() { + return currentDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : currentDiskSize_; + } + + /** + * + * + *
+   * The current disk usage of the instance in bytes. This property has been
+   * deprecated. Use the
+   * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+   * Monitoring API instead. Please see [this
+   * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+   * for details.
+   * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.Int64ValueOrBuilder getCurrentDiskSizeOrBuilder() { + return currentDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : currentDiskSize_; + } + + public static final int IP_ADDRESSES_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private java.util.List ipAddresses_; + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + @java.lang.Override + public java.util.List getIpAddressesList() { + return ipAddresses_; + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + @java.lang.Override + public java.util.List + getIpAddressesOrBuilderList() { + return ipAddresses_; + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + @java.lang.Override + public int getIpAddressesCount() { + return ipAddresses_.size(); + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpMapping getIpAddresses(int index) { + return ipAddresses_.get(index); + } + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + return ipAddresses_.get(index); + } + + public static final int SERVER_CA_CERT_FIELD_NUMBER = 12; + private com.google.cloud.sql.v1beta4.SslCert serverCaCert_; + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + * + * @return Whether the serverCaCert field is set. + */ + @java.lang.Override + public boolean hasServerCaCert() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + * + * @return The serverCaCert. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCert getServerCaCert() { + return serverCaCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : serverCaCert_; + } + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getServerCaCertOrBuilder() { + return serverCaCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : serverCaCert_; + } + + public static final int INSTANCE_TYPE_FIELD_NUMBER = 13; + private int instanceType_ = 0; + + /** + * + * + *
+   * The instance type.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlInstanceType instance_type = 13; + * + * @return The enum numeric value on the wire for instanceType. + */ + @java.lang.Override + public int getInstanceTypeValue() { + return instanceType_; + } + + /** + * + * + *
+   * The instance type.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlInstanceType instance_type = 13; + * + * @return The instanceType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstanceType getInstanceType() { + com.google.cloud.sql.v1beta4.SqlInstanceType result = + com.google.cloud.sql.v1beta4.SqlInstanceType.forNumber(instanceType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlInstanceType.UNRECOGNIZED : result; + } + + public static final int PROJECT_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL instance. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 14; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL instance. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 14; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IPV6_ADDRESS_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipv6Address_ = ""; + + /** + * + * + *
+   * The IPv6 address assigned to the instance.
+   * (Deprecated) This property was applicable only
+   * to First Generation instances.
+   * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=805 + * @return The ipv6Address. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getIpv6Address() { + java.lang.Object ref = ipv6Address_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipv6Address_ = s; + return s; + } + } + + /** + * + * + *
+   * The IPv6 address assigned to the instance.
+   * (Deprecated) This property was applicable only
+   * to First Generation instances.
+   * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=805 + * @return The bytes for ipv6Address. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getIpv6AddressBytes() { + java.lang.Object ref = ipv6Address_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipv6Address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_EMAIL_ADDRESS_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceAccountEmailAddress_ = ""; + + /** + * + * + *
+   * The service account email address assigned to the instance. \This
+   * property is read-only.
+   * 
+ * + * string service_account_email_address = 16; + * + * @return The serviceAccountEmailAddress. + */ + @java.lang.Override + public java.lang.String getServiceAccountEmailAddress() { + java.lang.Object ref = serviceAccountEmailAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmailAddress_ = s; + return s; + } + } + + /** + * + * + *
+   * The service account email address assigned to the instance. \This
+   * property is read-only.
+   * 
+ * + * string service_account_email_address = 16; + * + * @return The bytes for serviceAccountEmailAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountEmailAddressBytes() { + java.lang.Object ref = serviceAccountEmailAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmailAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ON_PREMISES_CONFIGURATION_FIELD_NUMBER = 17; + private com.google.cloud.sql.v1beta4.OnPremisesConfiguration onPremisesConfiguration_; + + /** + * + * + *
+   * Configuration specific to on-premises instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + * + * @return Whether the onPremisesConfiguration field is set. + */ + @java.lang.Override + public boolean hasOnPremisesConfiguration() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Configuration specific to on-premises instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + * + * @return The onPremisesConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.OnPremisesConfiguration getOnPremisesConfiguration() { + return onPremisesConfiguration_ == null + ? com.google.cloud.sql.v1beta4.OnPremisesConfiguration.getDefaultInstance() + : onPremisesConfiguration_; + } + + /** + * + * + *
+   * Configuration specific to on-premises instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.OnPremisesConfigurationOrBuilder + getOnPremisesConfigurationOrBuilder() { + return onPremisesConfiguration_ == null + ? com.google.cloud.sql.v1beta4.OnPremisesConfiguration.getDefaultInstance() + : onPremisesConfiguration_; + } + + public static final int REPLICA_CONFIGURATION_FIELD_NUMBER = 18; + private com.google.cloud.sql.v1beta4.ReplicaConfiguration replicaConfiguration_; + + /** + * + * + *
+   * Configuration specific to failover replicas and read replicas.
+   * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + * + * @return Whether the replicaConfiguration field is set. + */ + @java.lang.Override + public boolean hasReplicaConfiguration() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Configuration specific to failover replicas and read replicas.
+   * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + * + * @return The replicaConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReplicaConfiguration getReplicaConfiguration() { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.ReplicaConfiguration.getDefaultInstance() + : replicaConfiguration_; + } + + /** + * + * + *
+   * Configuration specific to failover replicas and read replicas.
+   * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReplicaConfigurationOrBuilder + getReplicaConfigurationOrBuilder() { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.ReplicaConfiguration.getDefaultInstance() + : replicaConfiguration_; + } + + public static final int BACKEND_TYPE_FIELD_NUMBER = 19; + private int backendType_ = 0; + + /** + * + * + *
+   * The backend type.
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   *
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 19; + * + * @return The enum numeric value on the wire for backendType. + */ + @java.lang.Override + public int getBackendTypeValue() { + return backendType_; + } + + /** + * + * + *
+   * The backend type.
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   *
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 19; + * + * @return The backendType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackendType getBackendType() { + com.google.cloud.sql.v1beta4.SqlBackendType result = + com.google.cloud.sql.v1beta4.SqlBackendType.forNumber(backendType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlBackendType.UNRECOGNIZED : result; + } + + public static final int SELF_LINK_FIELD_NUMBER = 20; + + @SuppressWarnings("serial") + private volatile java.lang.Object selfLink_ = ""; + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 20; + * + * @return The selfLink. + */ + @java.lang.Override + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } + } + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 20; + * + * @return The bytes for selfLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUSPENSION_REASON_FIELD_NUMBER = 21; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList suspensionReason_ = emptyIntList(); + + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.cloud.sql.v1beta4.SqlSuspensionReason> + suspensionReason_converter_ = + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.cloud.sql.v1beta4.SqlSuspensionReason>() { + public com.google.cloud.sql.v1beta4.SqlSuspensionReason convert(int from) { + com.google.cloud.sql.v1beta4.SqlSuspensionReason result = + com.google.cloud.sql.v1beta4.SqlSuspensionReason.forNumber(from); + return result == null + ? com.google.cloud.sql.v1beta4.SqlSuspensionReason.UNRECOGNIZED + : result; + } + }; + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @return A list containing the suspensionReason. + */ + @java.lang.Override + public java.util.List + getSuspensionReasonList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.cloud.sql.v1beta4.SqlSuspensionReason>( + suspensionReason_, suspensionReason_converter_); + } + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @return The count of suspensionReason. + */ + @java.lang.Override + public int getSuspensionReasonCount() { + return suspensionReason_.size(); + } + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index of the element to return. + * @return The suspensionReason at the given index. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSuspensionReason getSuspensionReason(int index) { + return suspensionReason_converter_.convert(suspensionReason_.getInt(index)); + } + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @return A list containing the enum numeric values on the wire for suspensionReason. + */ + @java.lang.Override + public java.util.List getSuspensionReasonValueList() { + return suspensionReason_; + } + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of suspensionReason at the given index. + */ + @java.lang.Override + public int getSuspensionReasonValue(int index) { + return suspensionReason_.getInt(index); + } + + private int suspensionReasonMemoizedSerializedSize; + + public static final int CONNECTION_NAME_FIELD_NUMBER = 22; + + @SuppressWarnings("serial") + private volatile java.lang.Object connectionName_ = ""; + + /** + * + * + *
+   * Connection name of the Cloud SQL instance used in connection strings.
+   * 
+ * + * string connection_name = 22; + * + * @return The connectionName. + */ + @java.lang.Override + public java.lang.String getConnectionName() { + java.lang.Object ref = connectionName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionName_ = s; + return s; + } + } + + /** + * + * + *
+   * Connection name of the Cloud SQL instance used in connection strings.
+   * 
+ * + * string connection_name = 22; + * + * @return The bytes for connectionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConnectionNameBytes() { + java.lang.Object ref = connectionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 23; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string name = 23; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string name = 23; + * + * @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 REGION_FIELD_NUMBER = 24; + + @SuppressWarnings("serial") + private volatile java.lang.Object region_ = ""; + + /** + * + * + *
+   * The geographical region of the Cloud SQL instance.
+   *
+   * It can be one of the
+   * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+   * where Cloud SQL operates:
+   *
+   * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+   * The default value is `us-central1`.
+   * 
+ * + * string region = 24; + * + * @return The region. + */ + @java.lang.Override + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } + } + + /** + * + * + *
+   * The geographical region of the Cloud SQL instance.
+   *
+   * It can be one of the
+   * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+   * where Cloud SQL operates:
+   *
+   * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+   * The default value is `us-central1`.
+   * 
+ * + * string region = 24; + * + * @return The bytes for region. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GCE_ZONE_FIELD_NUMBER = 25; + + @SuppressWarnings("serial") + private volatile java.lang.Object gceZone_ = ""; + + /** + * + * + *
+   * The Compute Engine zone that the instance is currently serving from. This
+   * value could be different from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary zone. WARNING:
+   * Changing this might restart the instance.
+   * 
+ * + * string gce_zone = 25; + * + * @return The gceZone. + */ + @java.lang.Override + public java.lang.String getGceZone() { + java.lang.Object ref = gceZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gceZone_ = s; + return s; + } + } + + /** + * + * + *
+   * The Compute Engine zone that the instance is currently serving from. This
+   * value could be different from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary zone. WARNING:
+   * Changing this might restart the instance.
+   * 
+ * + * string gce_zone = 25; + * + * @return The bytes for gceZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGceZoneBytes() { + java.lang.Object ref = gceZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SECONDARY_GCE_ZONE_FIELD_NUMBER = 34; + + @SuppressWarnings("serial") + private volatile java.lang.Object secondaryGceZone_ = ""; + + /** + * + * + *
+   * The Compute Engine zone that the failover instance is currently serving
+   * from for a regional instance. This value could be different
+   * from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary/failover zone.
+   * 
+ * + * string secondary_gce_zone = 34; + * + * @return The secondaryGceZone. + */ + @java.lang.Override + public java.lang.String getSecondaryGceZone() { + java.lang.Object ref = secondaryGceZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secondaryGceZone_ = s; + return s; + } + } + + /** + * + * + *
+   * The Compute Engine zone that the failover instance is currently serving
+   * from for a regional instance. This value could be different
+   * from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary/failover zone.
+   * 
+ * + * string secondary_gce_zone = 34; + * + * @return The bytes for secondaryGceZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSecondaryGceZoneBytes() { + java.lang.Object ref = secondaryGceZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secondaryGceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISK_ENCRYPTION_CONFIGURATION_FIELD_NUMBER = 26; + private com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration diskEncryptionConfiguration_; + + /** + * + * + *
+   * Disk encryption configuration specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + * + * @return Whether the diskEncryptionConfiguration field is set. + */ + @java.lang.Override + public boolean hasDiskEncryptionConfiguration() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * Disk encryption configuration specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + * + * @return The diskEncryptionConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration getDiskEncryptionConfiguration() { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } + + /** + * + * + *
+   * Disk encryption configuration specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionConfigurationOrBuilder + getDiskEncryptionConfigurationOrBuilder() { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } + + public static final int DISK_ENCRYPTION_STATUS_FIELD_NUMBER = 27; + private com.google.cloud.sql.v1beta4.DiskEncryptionStatus diskEncryptionStatus_; + + /** + * + * + *
+   * Disk encryption status specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + * + * @return Whether the diskEncryptionStatus field is set. + */ + @java.lang.Override + public boolean hasDiskEncryptionStatus() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+   * Disk encryption status specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + * + * @return The diskEncryptionStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionStatus getDiskEncryptionStatus() { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } + + /** + * + * + *
+   * Disk encryption status specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionStatusOrBuilder + getDiskEncryptionStatusOrBuilder() { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } + + public static final int ROOT_PASSWORD_FIELD_NUMBER = 29; + + @SuppressWarnings("serial") + private volatile java.lang.Object rootPassword_ = ""; + + /** + * + * + *
+   * Initial root password. Use only on creation. You must set root passwords
+   * before you can connect to PostgreSQL instances.
+   * 
+ * + * string root_password = 29; + * + * @return The rootPassword. + */ + @java.lang.Override + public java.lang.String getRootPassword() { + java.lang.Object ref = rootPassword_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rootPassword_ = s; + return s; + } + } + + /** + * + * + *
+   * Initial root password. Use only on creation. You must set root passwords
+   * before you can connect to PostgreSQL instances.
+   * 
+ * + * string root_password = 29; + * + * @return The bytes for rootPassword. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRootPasswordBytes() { + java.lang.Object ref = rootPassword_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rootPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCHEDULED_MAINTENANCE_FIELD_NUMBER = 30; + private com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + scheduledMaintenance_; + + /** + * + * + *
+   * The start time of any upcoming scheduled maintenance for this instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + * + * @return Whether the scheduledMaintenance field is set. + */ + @java.lang.Override + public boolean hasScheduledMaintenance() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+   * The start time of any upcoming scheduled maintenance for this instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + * + * @return The scheduledMaintenance. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + getScheduledMaintenance() { + return scheduledMaintenance_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.getDefaultInstance() + : scheduledMaintenance_; + } + + /** + * + * + *
+   * The start time of any upcoming scheduled maintenance for this instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenanceOrBuilder + getScheduledMaintenanceOrBuilder() { + return scheduledMaintenance_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.getDefaultInstance() + : scheduledMaintenance_; + } + + public static final int SATISFIES_PZS_FIELD_NUMBER = 35; + private com.google.protobuf.BoolValue satisfiesPzs_; + + /** + * + * + *
+   * This status indicates whether the instance satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + * + * @return Whether the satisfiesPzs field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzs() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+   * This status indicates whether the instance satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSatisfiesPzs() { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + + /** + * + * + *
+   * This status indicates whether the instance satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + + public static final int DATABASE_INSTALLED_VERSION_FIELD_NUMBER = 40; + + @SuppressWarnings("serial") + private volatile java.lang.Object databaseInstalledVersion_ = ""; + + /** + * + * + *
+   * Output only. Stores the current database version running on the instance
+   * including minor version such as `MYSQL_8_0_18`.
+   * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseInstalledVersion. + */ + @java.lang.Override + public java.lang.String getDatabaseInstalledVersion() { + java.lang.Object ref = databaseInstalledVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + databaseInstalledVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. Stores the current database version running on the instance
+   * including minor version such as `MYSQL_8_0_18`.
+   * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for databaseInstalledVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseInstalledVersionBytes() { + java.lang.Object ref = databaseInstalledVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + databaseInstalledVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OUT_OF_DISK_REPORT_FIELD_NUMBER = 38; + private com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport outOfDiskReport_; + + /** + * + * + *
+   * This field represents the report generated by the proactive database
+   * wellness job for OutOfDisk issues.
+   * *  Writers:
+   * *  the proactive database wellness job for OOD.
+   * *  Readers:
+   * *  the proactive database wellness job
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + * + * @return Whether the outOfDiskReport field is set. + */ + @java.lang.Override + public boolean hasOutOfDiskReport() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+   * This field represents the report generated by the proactive database
+   * wellness job for OutOfDisk issues.
+   * *  Writers:
+   * *  the proactive database wellness job for OOD.
+   * *  Readers:
+   * *  the proactive database wellness job
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + * + * @return The outOfDiskReport. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport getOutOfDiskReport() { + return outOfDiskReport_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.getDefaultInstance() + : outOfDiskReport_; + } + + /** + * + * + *
+   * This field represents the report generated by the proactive database
+   * wellness job for OutOfDisk issues.
+   * *  Writers:
+   * *  the proactive database wellness job for OOD.
+   * *  Readers:
+   * *  the proactive database wellness job
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReportOrBuilder + getOutOfDiskReportOrBuilder() { + return outOfDiskReport_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.getDefaultInstance() + : outOfDiskReport_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 39; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * Output only. The time when the instance was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00001000) != 0); + } + + /** + * + * + *
+   * Output only. The time when the instance was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * Output only. The time when the instance was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 39 [(.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 AVAILABLE_MAINTENANCE_VERSIONS_FIELD_NUMBER = 41; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList availableMaintenanceVersions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the availableMaintenanceVersions. + */ + public com.google.protobuf.ProtocolStringList getAvailableMaintenanceVersionsList() { + return availableMaintenanceVersions_; + } + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of availableMaintenanceVersions. + */ + public int getAvailableMaintenanceVersionsCount() { + return availableMaintenanceVersions_.size(); + } + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The availableMaintenanceVersions at the given index. + */ + public java.lang.String getAvailableMaintenanceVersions(int index) { + return availableMaintenanceVersions_.get(index); + } + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the availableMaintenanceVersions at the given index. + */ + public com.google.protobuf.ByteString getAvailableMaintenanceVersionsBytes(int index) { + return availableMaintenanceVersions_.getByteString(index); + } + + public static final int MAINTENANCE_VERSION_FIELD_NUMBER = 42; + + @SuppressWarnings("serial") + private volatile java.lang.Object maintenanceVersion_ = ""; + + /** + * + * + *
+   * The current software version on the instance.
+   * 
+ * + * string maintenance_version = 42; + * + * @return The maintenanceVersion. + */ + @java.lang.Override + public java.lang.String getMaintenanceVersion() { + java.lang.Object ref = maintenanceVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + maintenanceVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * The current software version on the instance.
+   * 
+ * + * string maintenance_version = 42; + * + * @return The bytes for maintenanceVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMaintenanceVersionBytes() { + java.lang.Object ref = maintenanceVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + maintenanceVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UPGRADABLE_DATABASE_VERSIONS_FIELD_NUMBER = 45; + + @SuppressWarnings("serial") + private java.util.List + upgradableDatabaseVersions_; + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getUpgradableDatabaseVersionsList() { + return upgradableDatabaseVersions_; + } + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getUpgradableDatabaseVersionsOrBuilderList() { + return upgradableDatabaseVersions_; + } + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getUpgradableDatabaseVersionsCount() { + return upgradableDatabaseVersions_.size(); + } + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AvailableDatabaseVersion getUpgradableDatabaseVersions( + int index) { + return upgradableDatabaseVersions_.get(index); + } + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AvailableDatabaseVersionOrBuilder + getUpgradableDatabaseVersionsOrBuilder(int index) { + return upgradableDatabaseVersions_.get(index); + } + + public static final int SQL_NETWORK_ARCHITECTURE_FIELD_NUMBER = 47; + private int sqlNetworkArchitecture_ = 0; + + /** + * + * + *
+   * The SQL network architecture for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return Whether the sqlNetworkArchitecture field is set. + */ + @java.lang.Override + public boolean hasSqlNetworkArchitecture() { + return ((bitField0_ & 0x00002000) != 0); + } + + /** + * + * + *
+   * The SQL network architecture for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return The enum numeric value on the wire for sqlNetworkArchitecture. + */ + @java.lang.Override + public int getSqlNetworkArchitectureValue() { + return sqlNetworkArchitecture_; + } + + /** + * + * + *
+   * The SQL network architecture for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return The sqlNetworkArchitecture. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture + getSqlNetworkArchitecture() { + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture result = + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture.forNumber( + sqlNetworkArchitecture_); + return result == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture.UNRECOGNIZED + : result; + } + + public static final int PSC_SERVICE_ATTACHMENT_LINK_FIELD_NUMBER = 48; + + @SuppressWarnings("serial") + private volatile java.lang.Object pscServiceAttachmentLink_ = ""; + + /** + * + * + *
+   * Output only. The link to service attachment of PSC instance.
+   * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscServiceAttachmentLink field is set. + */ + @java.lang.Override + public boolean hasPscServiceAttachmentLink() { + return ((bitField0_ & 0x00004000) != 0); + } + + /** + * + * + *
+   * Output only. The link to service attachment of PSC instance.
+   * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscServiceAttachmentLink. + */ + @java.lang.Override + public java.lang.String getPscServiceAttachmentLink() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pscServiceAttachmentLink_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The link to service attachment of PSC instance.
+   * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for pscServiceAttachmentLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPscServiceAttachmentLinkBytes() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pscServiceAttachmentLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DNS_NAME_FIELD_NUMBER = 49; + + @SuppressWarnings("serial") + private volatile java.lang.Object dnsName_ = ""; + + /** + * + * + *
+   * Output only. The dns name of the instance.
+   * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + @java.lang.Override + public boolean hasDnsName() { + return ((bitField0_ & 0x00008000) != 0); + } + + /** + * + * + *
+   * Output only. The dns name of the instance.
+   * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + @java.lang.Override + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The dns name of the instance.
+   * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIMARY_DNS_NAME_FIELD_NUMBER = 51; + + @SuppressWarnings("serial") + private volatile java.lang.Object primaryDnsName_ = ""; + + /** + * + * + *
+   * Output only. DEPRECATED: please use write_endpoint instead.
+   * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=918 + * @return Whether the primaryDnsName field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasPrimaryDnsName() { + return ((bitField0_ & 0x00010000) != 0); + } + + /** + * + * + *
+   * Output only. DEPRECATED: please use write_endpoint instead.
+   * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=918 + * @return The primaryDnsName. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getPrimaryDnsName() { + java.lang.Object ref = primaryDnsName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryDnsName_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. DEPRECATED: please use write_endpoint instead.
+   * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=918 + * @return The bytes for primaryDnsName. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getPrimaryDnsNameBytes() { + java.lang.Object ref = primaryDnsName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryDnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WRITE_ENDPOINT_FIELD_NUMBER = 52; + + @SuppressWarnings("serial") + private volatile java.lang.Object writeEndpoint_ = ""; + + /** + * + * + *
+   * Output only. The dns name of the primary instance in a replication group.
+   * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the writeEndpoint field is set. + */ + @java.lang.Override + public boolean hasWriteEndpoint() { + return ((bitField0_ & 0x00020000) != 0); + } + + /** + * + * + *
+   * Output only. The dns name of the primary instance in a replication group.
+   * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The writeEndpoint. + */ + @java.lang.Override + public java.lang.String getWriteEndpoint() { + java.lang.Object ref = writeEndpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + writeEndpoint_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The dns name of the primary instance in a replication group.
+   * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for writeEndpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWriteEndpointBytes() { + java.lang.Object ref = writeEndpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + writeEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPLICATION_CLUSTER_FIELD_NUMBER = 54; + private com.google.cloud.sql.v1beta4.ReplicationCluster replicationCluster_; + + /** + * + * + *
+   * A primary instance and disaster recovery (DR) replica pair.
+   * A DR replica is a cross-region replica that you designate
+   * for failover in the event that the primary instance
+   * experiences regional failure.
+   * Applicable to MySQL and PostgreSQL.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + * + * @return Whether the replicationCluster field is set. + */ + @java.lang.Override + public boolean hasReplicationCluster() { + return ((bitField0_ & 0x00040000) != 0); + } + + /** + * + * + *
+   * A primary instance and disaster recovery (DR) replica pair.
+   * A DR replica is a cross-region replica that you designate
+   * for failover in the event that the primary instance
+   * experiences regional failure.
+   * Applicable to MySQL and PostgreSQL.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + * + * @return The replicationCluster. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReplicationCluster getReplicationCluster() { + return replicationCluster_ == null + ? com.google.cloud.sql.v1beta4.ReplicationCluster.getDefaultInstance() + : replicationCluster_; + } + + /** + * + * + *
+   * A primary instance and disaster recovery (DR) replica pair.
+   * A DR replica is a cross-region replica that you designate
+   * for failover in the event that the primary instance
+   * experiences regional failure.
+   * Applicable to MySQL and PostgreSQL.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReplicationClusterOrBuilder getReplicationClusterOrBuilder() { + return replicationCluster_ == null + ? com.google.cloud.sql.v1beta4.ReplicationCluster.getDefaultInstance() + : replicationCluster_; + } + + public static final int GEMINI_CONFIG_FIELD_NUMBER = 55; + private com.google.cloud.sql.v1beta4.GeminiInstanceConfig geminiConfig_; + + /** + * + * + *
+   * Gemini instance configuration.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + * + * @return Whether the geminiConfig field is set. + */ + @java.lang.Override + public boolean hasGeminiConfig() { + return ((bitField0_ & 0x00080000) != 0); + } + + /** + * + * + *
+   * Gemini instance configuration.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + * + * @return The geminiConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.GeminiInstanceConfig getGeminiConfig() { + return geminiConfig_ == null + ? com.google.cloud.sql.v1beta4.GeminiInstanceConfig.getDefaultInstance() + : geminiConfig_; + } + + /** + * + * + *
+   * Gemini instance configuration.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.GeminiInstanceConfigOrBuilder getGeminiConfigOrBuilder() { + return geminiConfig_ == null + ? com.google.cloud.sql.v1beta4.GeminiInstanceConfig.getDefaultInstance() + : geminiConfig_; + } + + public static final int SATISFIES_PZI_FIELD_NUMBER = 56; + private com.google.protobuf.BoolValue satisfiesPzi_; + + /** + * + * + *
+   * Output only. This status indicates whether the instance satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzi field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzi() { + return ((bitField0_ & 0x00100000) != 0); + } + + /** + * + * + *
+   * Output only. This status indicates whether the instance satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzi. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSatisfiesPzi() { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } + + /** + * + * + *
+   * Output only. This status indicates whether the instance satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPziOrBuilder() { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } + + public static final int SWITCH_TRANSACTION_LOGS_TO_CLOUD_STORAGE_ENABLED_FIELD_NUMBER = 57; + private com.google.protobuf.BoolValue switchTransactionLogsToCloudStorageEnabled_; + + /** + * + * + *
+   * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+   * recovery log files from a data disk to Cloud Storage.
+   * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the switchTransactionLogsToCloudStorageEnabled field is set. + */ + @java.lang.Override + public boolean hasSwitchTransactionLogsToCloudStorageEnabled() { + return ((bitField0_ & 0x00200000) != 0); + } + + /** + * + * + *
+   * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+   * recovery log files from a data disk to Cloud Storage.
+   * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The switchTransactionLogsToCloudStorageEnabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSwitchTransactionLogsToCloudStorageEnabled() { + return switchTransactionLogsToCloudStorageEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : switchTransactionLogsToCloudStorageEnabled_; + } + + /** + * + * + *
+   * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+   * recovery log files from a data disk to Cloud Storage.
+   * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder + getSwitchTransactionLogsToCloudStorageEnabledOrBuilder() { + return switchTransactionLogsToCloudStorageEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : switchTransactionLogsToCloudStorageEnabled_; + } + + public static final int INCLUDE_REPLICAS_FOR_MAJOR_VERSION_UPGRADE_FIELD_NUMBER = 59; + private com.google.protobuf.BoolValue includeReplicasForMajorVersionUpgrade_; + + /** + * + * + *
+   * Input only. Determines whether an in-place major version upgrade of
+   * replicas happens when an in-place major version upgrade of a primary
+   * instance is initiated.
+   * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the includeReplicasForMajorVersionUpgrade field is set. + */ + @java.lang.Override + public boolean hasIncludeReplicasForMajorVersionUpgrade() { + return ((bitField0_ & 0x00400000) != 0); + } + + /** + * + * + *
+   * Input only. Determines whether an in-place major version upgrade of
+   * replicas happens when an in-place major version upgrade of a primary
+   * instance is initiated.
+   * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The includeReplicasForMajorVersionUpgrade. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getIncludeReplicasForMajorVersionUpgrade() { + return includeReplicasForMajorVersionUpgrade_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : includeReplicasForMajorVersionUpgrade_; + } + + /** + * + * + *
+   * Input only. Determines whether an in-place major version upgrade of
+   * replicas happens when an in-place major version upgrade of a primary
+   * instance is initiated.
+   * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder + getIncludeReplicasForMajorVersionUpgradeOrBuilder() { + return includeReplicasForMajorVersionUpgrade_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : includeReplicasForMajorVersionUpgrade_; + } + + public static final int TAGS_FIELD_NUMBER = 60; + + private static final class TagsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_TagsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField tags_; + + private com.google.protobuf.MapField internalGetTags() { + if (tags_ == null) { + return com.google.protobuf.MapField.emptyMapField(TagsDefaultEntryHolder.defaultEntry); + } + return tags_; + } + + public int getTagsCount() { + return internalGetTags().getMap().size(); + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTags().getMap().containsKey(key); + } + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTags() { + return getTagsMap(); + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getTagsMap() { + return internalGetTags().getMap(); + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getTagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NODE_COUNT_FIELD_NUMBER = 63; + private int nodeCount_ = 0; + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return Whether the nodeCount field is set. + */ + @java.lang.Override + public boolean hasNodeCount() { + return ((bitField0_ & 0x00800000) != 0); + } + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + + public static final int NODES_FIELD_NUMBER = 64; + + @SuppressWarnings("serial") + private java.util.List nodes_; + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getNodesList() { + return nodes_; + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfigOrBuilder> + getNodesOrBuilderList() { + return nodes_; + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getNodesCount() { + return nodes_.size(); + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig getNodes(int index) { + return nodes_.get(index); + } + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfigOrBuilder getNodesOrBuilder( + int index) { + return nodes_.get(index); + } + + public static final int DNS_NAMES_FIELD_NUMBER = 67; + + @SuppressWarnings("serial") + private java.util.List dnsNames_; + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getDnsNamesList() { + return dnsNames_; + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDnsNamesOrBuilderList() { + return dnsNames_; + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getDnsNamesCount() { + return dnsNames_.size(); + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMapping getDnsNames(int index) { + return dnsNames_.get(index); + } + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + return dnsNames_.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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (state_ + != com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState + .SQL_INSTANCE_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, state_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1beta4.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, databaseVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getSettings()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, etag_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getFailoverReplica()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(masterInstanceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, masterInstanceName_); + } + for (int i = 0; i < replicaNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, replicaNames_.getRaw(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(9, getMaxDiskSize()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(10, getCurrentDiskSize()); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + output.writeMessage(11, ipAddresses_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(12, getServerCaCert()); + } + if (instanceType_ + != com.google.cloud.sql.v1beta4.SqlInstanceType.SQL_INSTANCE_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(13, instanceType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 14, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(ipv6Address_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 15, ipv6Address_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceAccountEmailAddress_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 16, serviceAccountEmailAddress_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(17, getOnPremisesConfiguration()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(18, getReplicaConfiguration()); + } + if (backendType_ + != com.google.cloud.sql.v1beta4.SqlBackendType.SQL_BACKEND_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(19, backendType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 20, selfLink_); + } + if (getSuspensionReasonList().size() > 0) { + output.writeUInt32NoTag(170); + output.writeUInt32NoTag(suspensionReasonMemoizedSerializedSize); + } + for (int i = 0; i < suspensionReason_.size(); i++) { + output.writeEnumNoTag(suspensionReason_.getInt(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(connectionName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 22, connectionName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 23, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 24, region_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(gceZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 25, gceZone_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(26, getDiskEncryptionConfiguration()); + } + if (((bitField0_ & 0x00000100) != 0)) { + output.writeMessage(27, getDiskEncryptionStatus()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(rootPassword_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 29, rootPassword_); + } + if (((bitField0_ & 0x00000200) != 0)) { + output.writeMessage(30, getScheduledMaintenance()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(secondaryGceZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 34, secondaryGceZone_); + } + if (((bitField0_ & 0x00000400) != 0)) { + output.writeMessage(35, getSatisfiesPzs()); + } + if (((bitField0_ & 0x00000800) != 0)) { + output.writeMessage(38, getOutOfDiskReport()); + } + if (((bitField0_ & 0x00001000) != 0)) { + output.writeMessage(39, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(databaseInstalledVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 40, databaseInstalledVersion_); + } + for (int i = 0; i < availableMaintenanceVersions_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 41, availableMaintenanceVersions_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(maintenanceVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 42, maintenanceVersion_); + } + for (int i = 0; i < upgradableDatabaseVersions_.size(); i++) { + output.writeMessage(45, upgradableDatabaseVersions_.get(i)); + } + if (((bitField0_ & 0x00002000) != 0)) { + output.writeEnum(47, sqlNetworkArchitecture_); + } + if (((bitField0_ & 0x00004000) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 48, pscServiceAttachmentLink_); + } + if (((bitField0_ & 0x00008000) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 49, dnsName_); + } + if (((bitField0_ & 0x00010000) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 51, primaryDnsName_); + } + if (((bitField0_ & 0x00020000) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 52, writeEndpoint_); + } + if (((bitField0_ & 0x00040000) != 0)) { + output.writeMessage(54, getReplicationCluster()); + } + if (((bitField0_ & 0x00080000) != 0)) { + output.writeMessage(55, getGeminiConfig()); + } + if (((bitField0_ & 0x00100000) != 0)) { + output.writeMessage(56, getSatisfiesPzi()); + } + if (((bitField0_ & 0x00200000) != 0)) { + output.writeMessage(57, getSwitchTransactionLogsToCloudStorageEnabled()); + } + if (((bitField0_ & 0x00400000) != 0)) { + output.writeMessage(59, getIncludeReplicasForMajorVersionUpgrade()); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetTags(), TagsDefaultEntryHolder.defaultEntry, 60); + if (((bitField0_ & 0x00800000) != 0)) { + output.writeInt32(63, nodeCount_); + } + for (int i = 0; i < nodes_.size(); i++) { + output.writeMessage(64, nodes_.get(i)); + } + for (int i = 0; i < dnsNames_.size(); i++) { + output.writeMessage(67, dnsNames_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (state_ + != com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState + .SQL_INSTANCE_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, state_); + } + if (databaseVersion_ + != com.google.cloud.sql.v1beta4.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, databaseVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getSettings()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, etag_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getFailoverReplica()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(masterInstanceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, masterInstanceName_); + } + { + int dataSize = 0; + for (int i = 0; i < replicaNames_.size(); i++) { + dataSize += computeStringSizeNoTag(replicaNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getReplicaNamesList().size(); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getMaxDiskSize()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getCurrentDiskSize()); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, ipAddresses_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getServerCaCert()); + } + if (instanceType_ + != com.google.cloud.sql.v1beta4.SqlInstanceType.SQL_INSTANCE_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, instanceType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(14, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(ipv6Address_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(15, ipv6Address_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceAccountEmailAddress_)) { + size += + com.google.protobuf.GeneratedMessage.computeStringSize(16, serviceAccountEmailAddress_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 17, getOnPremisesConfiguration()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(18, getReplicaConfiguration()); + } + if (backendType_ + != com.google.cloud.sql.v1beta4.SqlBackendType.SQL_BACKEND_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(19, backendType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(20, selfLink_); + } + { + int dataSize = 0; + for (int i = 0; i < suspensionReason_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(suspensionReason_.getInt(i)); + } + size += dataSize; + if (!getSuspensionReasonList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + suspensionReasonMemoizedSerializedSize = dataSize; + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(connectionName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(22, connectionName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(23, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(24, region_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(gceZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(25, gceZone_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 26, getDiskEncryptionConfiguration()); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(27, getDiskEncryptionStatus()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(rootPassword_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(29, rootPassword_); + } + if (((bitField0_ & 0x00000200) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(30, getScheduledMaintenance()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(secondaryGceZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(34, secondaryGceZone_); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(35, getSatisfiesPzs()); + } + if (((bitField0_ & 0x00000800) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(38, getOutOfDiskReport()); + } + if (((bitField0_ & 0x00001000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(39, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(databaseInstalledVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(40, databaseInstalledVersion_); + } + { + int dataSize = 0; + for (int i = 0; i < availableMaintenanceVersions_.size(); i++) { + dataSize += computeStringSizeNoTag(availableMaintenanceVersions_.getRaw(i)); + } + size += dataSize; + size += 2 * getAvailableMaintenanceVersionsList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(maintenanceVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(42, maintenanceVersion_); + } + for (int i = 0; i < upgradableDatabaseVersions_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 45, upgradableDatabaseVersions_.get(i)); + } + if (((bitField0_ & 0x00002000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(47, sqlNetworkArchitecture_); + } + if (((bitField0_ & 0x00004000) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(48, pscServiceAttachmentLink_); + } + if (((bitField0_ & 0x00008000) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(49, dnsName_); + } + if (((bitField0_ & 0x00010000) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(51, primaryDnsName_); + } + if (((bitField0_ & 0x00020000) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(52, writeEndpoint_); + } + if (((bitField0_ & 0x00040000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(54, getReplicationCluster()); + } + if (((bitField0_ & 0x00080000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(55, getGeminiConfig()); + } + if (((bitField0_ & 0x00100000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(56, getSatisfiesPzi()); + } + if (((bitField0_ & 0x00200000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 57, getSwitchTransactionLogsToCloudStorageEnabled()); + } + if (((bitField0_ & 0x00400000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 59, getIncludeReplicasForMajorVersionUpgrade()); + } + for (java.util.Map.Entry entry : + internalGetTags().getMap().entrySet()) { + com.google.protobuf.MapEntry tags__ = + TagsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(60, tags__); + } + if (((bitField0_ & 0x00800000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(63, nodeCount_); + } + for (int i = 0; i < nodes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(64, nodes_.get(i)); + } + for (int i = 0; i < dnsNames_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(67, dnsNames_.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.sql.v1beta4.DatabaseInstance)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DatabaseInstance other = + (com.google.cloud.sql.v1beta4.DatabaseInstance) obj; + + if (!getKind().equals(other.getKind())) return false; + if (state_ != other.state_) return false; + if (databaseVersion_ != other.databaseVersion_) return false; + if (hasSettings() != other.hasSettings()) return false; + if (hasSettings()) { + if (!getSettings().equals(other.getSettings())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (hasFailoverReplica() != other.hasFailoverReplica()) return false; + if (hasFailoverReplica()) { + if (!getFailoverReplica().equals(other.getFailoverReplica())) return false; + } + if (!getMasterInstanceName().equals(other.getMasterInstanceName())) return false; + if (!getReplicaNamesList().equals(other.getReplicaNamesList())) return false; + if (hasMaxDiskSize() != other.hasMaxDiskSize()) return false; + if (hasMaxDiskSize()) { + if (!getMaxDiskSize().equals(other.getMaxDiskSize())) return false; + } + if (hasCurrentDiskSize() != other.hasCurrentDiskSize()) return false; + if (hasCurrentDiskSize()) { + if (!getCurrentDiskSize().equals(other.getCurrentDiskSize())) return false; + } + if (!getIpAddressesList().equals(other.getIpAddressesList())) return false; + if (hasServerCaCert() != other.hasServerCaCert()) return false; + if (hasServerCaCert()) { + if (!getServerCaCert().equals(other.getServerCaCert())) return false; + } + if (instanceType_ != other.instanceType_) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getIpv6Address().equals(other.getIpv6Address())) return false; + if (!getServiceAccountEmailAddress().equals(other.getServiceAccountEmailAddress())) + return false; + if (hasOnPremisesConfiguration() != other.hasOnPremisesConfiguration()) return false; + if (hasOnPremisesConfiguration()) { + if (!getOnPremisesConfiguration().equals(other.getOnPremisesConfiguration())) return false; + } + if (hasReplicaConfiguration() != other.hasReplicaConfiguration()) return false; + if (hasReplicaConfiguration()) { + if (!getReplicaConfiguration().equals(other.getReplicaConfiguration())) return false; + } + if (backendType_ != other.backendType_) return false; + if (!getSelfLink().equals(other.getSelfLink())) return false; + if (!suspensionReason_.equals(other.suspensionReason_)) return false; + if (!getConnectionName().equals(other.getConnectionName())) return false; + if (!getName().equals(other.getName())) return false; + if (!getRegion().equals(other.getRegion())) return false; + if (!getGceZone().equals(other.getGceZone())) return false; + if (!getSecondaryGceZone().equals(other.getSecondaryGceZone())) return false; + if (hasDiskEncryptionConfiguration() != other.hasDiskEncryptionConfiguration()) return false; + if (hasDiskEncryptionConfiguration()) { + if (!getDiskEncryptionConfiguration().equals(other.getDiskEncryptionConfiguration())) + return false; + } + if (hasDiskEncryptionStatus() != other.hasDiskEncryptionStatus()) return false; + if (hasDiskEncryptionStatus()) { + if (!getDiskEncryptionStatus().equals(other.getDiskEncryptionStatus())) return false; + } + if (!getRootPassword().equals(other.getRootPassword())) return false; + if (hasScheduledMaintenance() != other.hasScheduledMaintenance()) return false; + if (hasScheduledMaintenance()) { + if (!getScheduledMaintenance().equals(other.getScheduledMaintenance())) return false; + } + if (hasSatisfiesPzs() != other.hasSatisfiesPzs()) return false; + if (hasSatisfiesPzs()) { + if (!getSatisfiesPzs().equals(other.getSatisfiesPzs())) return false; + } + if (!getDatabaseInstalledVersion().equals(other.getDatabaseInstalledVersion())) return false; + if (hasOutOfDiskReport() != other.hasOutOfDiskReport()) return false; + if (hasOutOfDiskReport()) { + if (!getOutOfDiskReport().equals(other.getOutOfDiskReport())) return false; + } + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getAvailableMaintenanceVersionsList().equals(other.getAvailableMaintenanceVersionsList())) + return false; + if (!getMaintenanceVersion().equals(other.getMaintenanceVersion())) return false; + if (!getUpgradableDatabaseVersionsList().equals(other.getUpgradableDatabaseVersionsList())) + return false; + if (hasSqlNetworkArchitecture() != other.hasSqlNetworkArchitecture()) return false; + if (hasSqlNetworkArchitecture()) { + if (sqlNetworkArchitecture_ != other.sqlNetworkArchitecture_) return false; + } + if (hasPscServiceAttachmentLink() != other.hasPscServiceAttachmentLink()) return false; + if (hasPscServiceAttachmentLink()) { + if (!getPscServiceAttachmentLink().equals(other.getPscServiceAttachmentLink())) return false; + } + if (hasDnsName() != other.hasDnsName()) return false; + if (hasDnsName()) { + if (!getDnsName().equals(other.getDnsName())) return false; + } + if (hasPrimaryDnsName() != other.hasPrimaryDnsName()) return false; + if (hasPrimaryDnsName()) { + if (!getPrimaryDnsName().equals(other.getPrimaryDnsName())) return false; + } + if (hasWriteEndpoint() != other.hasWriteEndpoint()) return false; + if (hasWriteEndpoint()) { + if (!getWriteEndpoint().equals(other.getWriteEndpoint())) return false; + } + if (hasReplicationCluster() != other.hasReplicationCluster()) return false; + if (hasReplicationCluster()) { + if (!getReplicationCluster().equals(other.getReplicationCluster())) return false; + } + if (hasGeminiConfig() != other.hasGeminiConfig()) return false; + if (hasGeminiConfig()) { + if (!getGeminiConfig().equals(other.getGeminiConfig())) return false; + } + if (hasSatisfiesPzi() != other.hasSatisfiesPzi()) return false; + if (hasSatisfiesPzi()) { + if (!getSatisfiesPzi().equals(other.getSatisfiesPzi())) return false; + } + if (hasSwitchTransactionLogsToCloudStorageEnabled() + != other.hasSwitchTransactionLogsToCloudStorageEnabled()) return false; + if (hasSwitchTransactionLogsToCloudStorageEnabled()) { + if (!getSwitchTransactionLogsToCloudStorageEnabled() + .equals(other.getSwitchTransactionLogsToCloudStorageEnabled())) return false; + } + if (hasIncludeReplicasForMajorVersionUpgrade() + != other.hasIncludeReplicasForMajorVersionUpgrade()) return false; + if (hasIncludeReplicasForMajorVersionUpgrade()) { + if (!getIncludeReplicasForMajorVersionUpgrade() + .equals(other.getIncludeReplicasForMajorVersionUpgrade())) return false; + } + if (!internalGetTags().equals(other.internalGetTags())) return false; + if (hasNodeCount() != other.hasNodeCount()) return false; + if (hasNodeCount()) { + if (getNodeCount() != other.getNodeCount()) return false; + } + if (!getNodesList().equals(other.getNodesList())) return false; + if (!getDnsNamesList().equals(other.getDnsNamesList())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + databaseVersion_; + if (hasSettings()) { + hash = (37 * hash) + SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getSettings().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (hasFailoverReplica()) { + hash = (37 * hash) + FAILOVER_REPLICA_FIELD_NUMBER; + hash = (53 * hash) + getFailoverReplica().hashCode(); + } + hash = (37 * hash) + MASTER_INSTANCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMasterInstanceName().hashCode(); + if (getReplicaNamesCount() > 0) { + hash = (37 * hash) + REPLICA_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getReplicaNamesList().hashCode(); + } + if (hasMaxDiskSize()) { + hash = (37 * hash) + MAX_DISK_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getMaxDiskSize().hashCode(); + } + if (hasCurrentDiskSize()) { + hash = (37 * hash) + CURRENT_DISK_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getCurrentDiskSize().hashCode(); + } + if (getIpAddressesCount() > 0) { + hash = (37 * hash) + IP_ADDRESSES_FIELD_NUMBER; + hash = (53 * hash) + getIpAddressesList().hashCode(); + } + if (hasServerCaCert()) { + hash = (37 * hash) + SERVER_CA_CERT_FIELD_NUMBER; + hash = (53 * hash) + getServerCaCert().hashCode(); + } + hash = (37 * hash) + INSTANCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + instanceType_; + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + IPV6_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpv6Address().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccountEmailAddress().hashCode(); + if (hasOnPremisesConfiguration()) { + hash = (37 * hash) + ON_PREMISES_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getOnPremisesConfiguration().hashCode(); + } + if (hasReplicaConfiguration()) { + hash = (37 * hash) + REPLICA_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getReplicaConfiguration().hashCode(); + } + hash = (37 * hash) + BACKEND_TYPE_FIELD_NUMBER; + hash = (53 * hash) + backendType_; + hash = (37 * hash) + SELF_LINK_FIELD_NUMBER; + hash = (53 * hash) + getSelfLink().hashCode(); + if (getSuspensionReasonCount() > 0) { + hash = (37 * hash) + SUSPENSION_REASON_FIELD_NUMBER; + hash = (53 * hash) + suspensionReason_.hashCode(); + } + hash = (37 * hash) + CONNECTION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getConnectionName().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegion().hashCode(); + hash = (37 * hash) + GCE_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getGceZone().hashCode(); + hash = (37 * hash) + SECONDARY_GCE_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getSecondaryGceZone().hashCode(); + if (hasDiskEncryptionConfiguration()) { + hash = (37 * hash) + DISK_ENCRYPTION_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getDiskEncryptionConfiguration().hashCode(); + } + if (hasDiskEncryptionStatus()) { + hash = (37 * hash) + DISK_ENCRYPTION_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getDiskEncryptionStatus().hashCode(); + } + hash = (37 * hash) + ROOT_PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getRootPassword().hashCode(); + if (hasScheduledMaintenance()) { + hash = (37 * hash) + SCHEDULED_MAINTENANCE_FIELD_NUMBER; + hash = (53 * hash) + getScheduledMaintenance().hashCode(); + } + if (hasSatisfiesPzs()) { + hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; + hash = (53 * hash) + getSatisfiesPzs().hashCode(); + } + hash = (37 * hash) + DATABASE_INSTALLED_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseInstalledVersion().hashCode(); + if (hasOutOfDiskReport()) { + hash = (37 * hash) + OUT_OF_DISK_REPORT_FIELD_NUMBER; + hash = (53 * hash) + getOutOfDiskReport().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (getAvailableMaintenanceVersionsCount() > 0) { + hash = (37 * hash) + AVAILABLE_MAINTENANCE_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getAvailableMaintenanceVersionsList().hashCode(); + } + hash = (37 * hash) + MAINTENANCE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceVersion().hashCode(); + if (getUpgradableDatabaseVersionsCount() > 0) { + hash = (37 * hash) + UPGRADABLE_DATABASE_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getUpgradableDatabaseVersionsList().hashCode(); + } + if (hasSqlNetworkArchitecture()) { + hash = (37 * hash) + SQL_NETWORK_ARCHITECTURE_FIELD_NUMBER; + hash = (53 * hash) + sqlNetworkArchitecture_; + } + if (hasPscServiceAttachmentLink()) { + hash = (37 * hash) + PSC_SERVICE_ATTACHMENT_LINK_FIELD_NUMBER; + hash = (53 * hash) + getPscServiceAttachmentLink().hashCode(); + } + if (hasDnsName()) { + hash = (37 * hash) + DNS_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDnsName().hashCode(); + } + if (hasPrimaryDnsName()) { + hash = (37 * hash) + PRIMARY_DNS_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryDnsName().hashCode(); + } + if (hasWriteEndpoint()) { + hash = (37 * hash) + WRITE_ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getWriteEndpoint().hashCode(); + } + if (hasReplicationCluster()) { + hash = (37 * hash) + REPLICATION_CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getReplicationCluster().hashCode(); + } + if (hasGeminiConfig()) { + hash = (37 * hash) + GEMINI_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getGeminiConfig().hashCode(); + } + if (hasSatisfiesPzi()) { + hash = (37 * hash) + SATISFIES_PZI_FIELD_NUMBER; + hash = (53 * hash) + getSatisfiesPzi().hashCode(); + } + if (hasSwitchTransactionLogsToCloudStorageEnabled()) { + hash = (37 * hash) + SWITCH_TRANSACTION_LOGS_TO_CLOUD_STORAGE_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getSwitchTransactionLogsToCloudStorageEnabled().hashCode(); + } + if (hasIncludeReplicasForMajorVersionUpgrade()) { + hash = (37 * hash) + INCLUDE_REPLICAS_FOR_MAJOR_VERSION_UPGRADE_FIELD_NUMBER; + hash = (53 * hash) + getIncludeReplicasForMajorVersionUpgrade().hashCode(); + } + if (!internalGetTags().getMap().isEmpty()) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetTags().hashCode(); + } + if (hasNodeCount()) { + hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getNodeCount(); + } + if (getNodesCount() > 0) { + hash = (37 * hash) + NODES_FIELD_NUMBER; + hash = (53 * hash) + getNodesList().hashCode(); + } + if (getDnsNamesCount() > 0) { + hash = (37 * hash) + DNS_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getDnsNamesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.DatabaseInstance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A Cloud SQL instance resource.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DatabaseInstance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DatabaseInstance) + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 60: + return internalGetTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 60: + return internalGetMutableTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DatabaseInstance.class, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.DatabaseInstance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSettingsFieldBuilder(); + internalGetFailoverReplicaFieldBuilder(); + internalGetMaxDiskSizeFieldBuilder(); + internalGetCurrentDiskSizeFieldBuilder(); + internalGetIpAddressesFieldBuilder(); + internalGetServerCaCertFieldBuilder(); + internalGetOnPremisesConfigurationFieldBuilder(); + internalGetReplicaConfigurationFieldBuilder(); + internalGetDiskEncryptionConfigurationFieldBuilder(); + internalGetDiskEncryptionStatusFieldBuilder(); + internalGetScheduledMaintenanceFieldBuilder(); + internalGetSatisfiesPzsFieldBuilder(); + internalGetOutOfDiskReportFieldBuilder(); + internalGetCreateTimeFieldBuilder(); + internalGetUpgradableDatabaseVersionsFieldBuilder(); + internalGetReplicationClusterFieldBuilder(); + internalGetGeminiConfigFieldBuilder(); + internalGetSatisfiesPziFieldBuilder(); + internalGetSwitchTransactionLogsToCloudStorageEnabledFieldBuilder(); + internalGetIncludeReplicasForMajorVersionUpgradeFieldBuilder(); + internalGetNodesFieldBuilder(); + internalGetDnsNamesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bitField1_ = 0; + kind_ = ""; + state_ = 0; + databaseVersion_ = 0; + settings_ = null; + if (settingsBuilder_ != null) { + settingsBuilder_.dispose(); + settingsBuilder_ = null; + } + etag_ = ""; + failoverReplica_ = null; + if (failoverReplicaBuilder_ != null) { + failoverReplicaBuilder_.dispose(); + failoverReplicaBuilder_ = null; + } + masterInstanceName_ = ""; + replicaNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + maxDiskSize_ = null; + if (maxDiskSizeBuilder_ != null) { + maxDiskSizeBuilder_.dispose(); + maxDiskSizeBuilder_ = null; + } + currentDiskSize_ = null; + if (currentDiskSizeBuilder_ != null) { + currentDiskSizeBuilder_.dispose(); + currentDiskSizeBuilder_ = null; + } + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + } else { + ipAddresses_ = null; + ipAddressesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + serverCaCert_ = null; + if (serverCaCertBuilder_ != null) { + serverCaCertBuilder_.dispose(); + serverCaCertBuilder_ = null; + } + instanceType_ = 0; + project_ = ""; + ipv6Address_ = ""; + serviceAccountEmailAddress_ = ""; + onPremisesConfiguration_ = null; + if (onPremisesConfigurationBuilder_ != null) { + onPremisesConfigurationBuilder_.dispose(); + onPremisesConfigurationBuilder_ = null; + } + replicaConfiguration_ = null; + if (replicaConfigurationBuilder_ != null) { + replicaConfigurationBuilder_.dispose(); + replicaConfigurationBuilder_ = null; + } + backendType_ = 0; + selfLink_ = ""; + suspensionReason_ = emptyIntList(); + connectionName_ = ""; + name_ = ""; + region_ = ""; + gceZone_ = ""; + secondaryGceZone_ = ""; + diskEncryptionConfiguration_ = null; + if (diskEncryptionConfigurationBuilder_ != null) { + diskEncryptionConfigurationBuilder_.dispose(); + diskEncryptionConfigurationBuilder_ = null; + } + diskEncryptionStatus_ = null; + if (diskEncryptionStatusBuilder_ != null) { + diskEncryptionStatusBuilder_.dispose(); + diskEncryptionStatusBuilder_ = null; + } + rootPassword_ = ""; + scheduledMaintenance_ = null; + if (scheduledMaintenanceBuilder_ != null) { + scheduledMaintenanceBuilder_.dispose(); + scheduledMaintenanceBuilder_ = null; + } + satisfiesPzs_ = null; + if (satisfiesPzsBuilder_ != null) { + satisfiesPzsBuilder_.dispose(); + satisfiesPzsBuilder_ = null; + } + databaseInstalledVersion_ = ""; + outOfDiskReport_ = null; + if (outOfDiskReportBuilder_ != null) { + outOfDiskReportBuilder_.dispose(); + outOfDiskReportBuilder_ = null; + } + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + availableMaintenanceVersions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + maintenanceVersion_ = ""; + if (upgradableDatabaseVersionsBuilder_ == null) { + upgradableDatabaseVersions_ = java.util.Collections.emptyList(); + } else { + upgradableDatabaseVersions_ = null; + upgradableDatabaseVersionsBuilder_.clear(); + } + bitField1_ = (bitField1_ & ~0x00000010); + sqlNetworkArchitecture_ = 0; + pscServiceAttachmentLink_ = ""; + dnsName_ = ""; + primaryDnsName_ = ""; + writeEndpoint_ = ""; + replicationCluster_ = null; + if (replicationClusterBuilder_ != null) { + replicationClusterBuilder_.dispose(); + replicationClusterBuilder_ = null; + } + geminiConfig_ = null; + if (geminiConfigBuilder_ != null) { + geminiConfigBuilder_.dispose(); + geminiConfigBuilder_ = null; + } + satisfiesPzi_ = null; + if (satisfiesPziBuilder_ != null) { + satisfiesPziBuilder_.dispose(); + satisfiesPziBuilder_ = null; + } + switchTransactionLogsToCloudStorageEnabled_ = null; + if (switchTransactionLogsToCloudStorageEnabledBuilder_ != null) { + switchTransactionLogsToCloudStorageEnabledBuilder_.dispose(); + switchTransactionLogsToCloudStorageEnabledBuilder_ = null; + } + includeReplicasForMajorVersionUpgrade_ = null; + if (includeReplicasForMajorVersionUpgradeBuilder_ != null) { + includeReplicasForMajorVersionUpgradeBuilder_.dispose(); + includeReplicasForMajorVersionUpgradeBuilder_ = null; + } + internalGetMutableTags().clear(); + nodeCount_ = 0; + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + } else { + nodes_ = null; + nodesBuilder_.clear(); + } + bitField1_ = (bitField1_ & ~0x00020000); + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + } else { + dnsNames_ = null; + dnsNamesBuilder_.clear(); + } + bitField1_ = (bitField1_ & ~0x00040000); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabaseInstance_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance build() { + com.google.cloud.sql.v1beta4.DatabaseInstance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance buildPartial() { + com.google.cloud.sql.v1beta4.DatabaseInstance result = + new com.google.cloud.sql.v1beta4.DatabaseInstance(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + if (bitField1_ != 0) { + buildPartial1(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1beta4.DatabaseInstance result) { + if (ipAddressesBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + ipAddresses_ = java.util.Collections.unmodifiableList(ipAddresses_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.ipAddresses_ = ipAddresses_; + } else { + result.ipAddresses_ = ipAddressesBuilder_.build(); + } + if (upgradableDatabaseVersionsBuilder_ == null) { + if (((bitField1_ & 0x00000010) != 0)) { + upgradableDatabaseVersions_ = + java.util.Collections.unmodifiableList(upgradableDatabaseVersions_); + bitField1_ = (bitField1_ & ~0x00000010); + } + result.upgradableDatabaseVersions_ = upgradableDatabaseVersions_; + } else { + result.upgradableDatabaseVersions_ = upgradableDatabaseVersionsBuilder_.build(); + } + if (nodesBuilder_ == null) { + if (((bitField1_ & 0x00020000) != 0)) { + nodes_ = java.util.Collections.unmodifiableList(nodes_); + bitField1_ = (bitField1_ & ~0x00020000); + } + result.nodes_ = nodes_; + } else { + result.nodes_ = nodesBuilder_.build(); + } + if (dnsNamesBuilder_ == null) { + if (((bitField1_ & 0x00040000) != 0)) { + dnsNames_ = java.util.Collections.unmodifiableList(dnsNames_); + bitField1_ = (bitField1_ & ~0x00040000); + } + result.dnsNames_ = dnsNames_; + } else { + result.dnsNames_ = dnsNamesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.DatabaseInstance result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.databaseVersion_ = databaseVersion_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.settings_ = settingsBuilder_ == null ? settings_ : settingsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.failoverReplica_ = + failoverReplicaBuilder_ == null ? failoverReplica_ : failoverReplicaBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.masterInstanceName_ = masterInstanceName_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + replicaNames_.makeImmutable(); + result.replicaNames_ = replicaNames_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.maxDiskSize_ = + maxDiskSizeBuilder_ == null ? maxDiskSize_ : maxDiskSizeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.currentDiskSize_ = + currentDiskSizeBuilder_ == null ? currentDiskSize_ : currentDiskSizeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.serverCaCert_ = + serverCaCertBuilder_ == null ? serverCaCert_ : serverCaCertBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.instanceType_ = instanceType_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.ipv6Address_ = ipv6Address_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.serviceAccountEmailAddress_ = serviceAccountEmailAddress_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.onPremisesConfiguration_ = + onPremisesConfigurationBuilder_ == null + ? onPremisesConfiguration_ + : onPremisesConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.replicaConfiguration_ = + replicaConfigurationBuilder_ == null + ? replicaConfiguration_ + : replicaConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.backendType_ = backendType_; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.selfLink_ = selfLink_; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + suspensionReason_.makeImmutable(); + result.suspensionReason_ = suspensionReason_; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.connectionName_ = connectionName_; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.region_ = region_; + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.gceZone_ = gceZone_; + } + if (((from_bitField0_ & 0x02000000) != 0)) { + result.secondaryGceZone_ = secondaryGceZone_; + } + if (((from_bitField0_ & 0x04000000) != 0)) { + result.diskEncryptionConfiguration_ = + diskEncryptionConfigurationBuilder_ == null + ? diskEncryptionConfiguration_ + : diskEncryptionConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x08000000) != 0)) { + result.diskEncryptionStatus_ = + diskEncryptionStatusBuilder_ == null + ? diskEncryptionStatus_ + : diskEncryptionStatusBuilder_.build(); + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x10000000) != 0)) { + result.rootPassword_ = rootPassword_; + } + if (((from_bitField0_ & 0x20000000) != 0)) { + result.scheduledMaintenance_ = + scheduledMaintenanceBuilder_ == null + ? scheduledMaintenance_ + : scheduledMaintenanceBuilder_.build(); + to_bitField0_ |= 0x00000200; + } + if (((from_bitField0_ & 0x40000000) != 0)) { + result.satisfiesPzs_ = + satisfiesPzsBuilder_ == null ? satisfiesPzs_ : satisfiesPzsBuilder_.build(); + to_bitField0_ |= 0x00000400; + } + if (((from_bitField0_ & 0x80000000) != 0)) { + result.databaseInstalledVersion_ = databaseInstalledVersion_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartial1(com.google.cloud.sql.v1beta4.DatabaseInstance result) { + int from_bitField1_ = bitField1_; + int to_bitField0_ = 0; + if (((from_bitField1_ & 0x00000001) != 0)) { + result.outOfDiskReport_ = + outOfDiskReportBuilder_ == null ? outOfDiskReport_ : outOfDiskReportBuilder_.build(); + to_bitField0_ |= 0x00000800; + } + if (((from_bitField1_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00001000; + } + if (((from_bitField1_ & 0x00000004) != 0)) { + availableMaintenanceVersions_.makeImmutable(); + result.availableMaintenanceVersions_ = availableMaintenanceVersions_; + } + if (((from_bitField1_ & 0x00000008) != 0)) { + result.maintenanceVersion_ = maintenanceVersion_; + } + if (((from_bitField1_ & 0x00000020) != 0)) { + result.sqlNetworkArchitecture_ = sqlNetworkArchitecture_; + to_bitField0_ |= 0x00002000; + } + if (((from_bitField1_ & 0x00000040) != 0)) { + result.pscServiceAttachmentLink_ = pscServiceAttachmentLink_; + to_bitField0_ |= 0x00004000; + } + if (((from_bitField1_ & 0x00000080) != 0)) { + result.dnsName_ = dnsName_; + to_bitField0_ |= 0x00008000; + } + if (((from_bitField1_ & 0x00000100) != 0)) { + result.primaryDnsName_ = primaryDnsName_; + to_bitField0_ |= 0x00010000; + } + if (((from_bitField1_ & 0x00000200) != 0)) { + result.writeEndpoint_ = writeEndpoint_; + to_bitField0_ |= 0x00020000; + } + if (((from_bitField1_ & 0x00000400) != 0)) { + result.replicationCluster_ = + replicationClusterBuilder_ == null + ? replicationCluster_ + : replicationClusterBuilder_.build(); + to_bitField0_ |= 0x00040000; + } + if (((from_bitField1_ & 0x00000800) != 0)) { + result.geminiConfig_ = + geminiConfigBuilder_ == null ? geminiConfig_ : geminiConfigBuilder_.build(); + to_bitField0_ |= 0x00080000; + } + if (((from_bitField1_ & 0x00001000) != 0)) { + result.satisfiesPzi_ = + satisfiesPziBuilder_ == null ? satisfiesPzi_ : satisfiesPziBuilder_.build(); + to_bitField0_ |= 0x00100000; + } + if (((from_bitField1_ & 0x00002000) != 0)) { + result.switchTransactionLogsToCloudStorageEnabled_ = + switchTransactionLogsToCloudStorageEnabledBuilder_ == null + ? switchTransactionLogsToCloudStorageEnabled_ + : switchTransactionLogsToCloudStorageEnabledBuilder_.build(); + to_bitField0_ |= 0x00200000; + } + if (((from_bitField1_ & 0x00004000) != 0)) { + result.includeReplicasForMajorVersionUpgrade_ = + includeReplicasForMajorVersionUpgradeBuilder_ == null + ? includeReplicasForMajorVersionUpgrade_ + : includeReplicasForMajorVersionUpgradeBuilder_.build(); + to_bitField0_ |= 0x00400000; + } + if (((from_bitField1_ & 0x00008000) != 0)) { + result.tags_ = internalGetTags(); + result.tags_.makeImmutable(); + } + if (((from_bitField1_ & 0x00010000) != 0)) { + result.nodeCount_ = nodeCount_; + to_bitField0_ |= 0x00800000; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DatabaseInstance) { + return mergeFrom((com.google.cloud.sql.v1beta4.DatabaseInstance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.DatabaseInstance other) { + if (other == com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.databaseVersion_ != 0) { + setDatabaseVersionValue(other.getDatabaseVersionValue()); + } + if (other.hasSettings()) { + mergeSettings(other.getSettings()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasFailoverReplica()) { + mergeFailoverReplica(other.getFailoverReplica()); + } + if (!other.getMasterInstanceName().isEmpty()) { + masterInstanceName_ = other.masterInstanceName_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.replicaNames_.isEmpty()) { + if (replicaNames_.isEmpty()) { + replicaNames_ = other.replicaNames_; + bitField0_ |= 0x00000080; + } else { + ensureReplicaNamesIsMutable(); + replicaNames_.addAll(other.replicaNames_); + } + onChanged(); + } + if (other.hasMaxDiskSize()) { + mergeMaxDiskSize(other.getMaxDiskSize()); + } + if (other.hasCurrentDiskSize()) { + mergeCurrentDiskSize(other.getCurrentDiskSize()); + } + if (ipAddressesBuilder_ == null) { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddresses_.isEmpty()) { + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureIpAddressesIsMutable(); + ipAddresses_.addAll(other.ipAddresses_); + } + onChanged(); + } + } else { + if (!other.ipAddresses_.isEmpty()) { + if (ipAddressesBuilder_.isEmpty()) { + ipAddressesBuilder_.dispose(); + ipAddressesBuilder_ = null; + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000400); + ipAddressesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetIpAddressesFieldBuilder() + : null; + } else { + ipAddressesBuilder_.addAllMessages(other.ipAddresses_); + } + } + } + if (other.hasServerCaCert()) { + mergeServerCaCert(other.getServerCaCert()); + } + if (other.instanceType_ != 0) { + setInstanceTypeValue(other.getInstanceTypeValue()); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00002000; + onChanged(); + } + if (!other.getIpv6Address().isEmpty()) { + ipv6Address_ = other.ipv6Address_; + bitField0_ |= 0x00004000; + onChanged(); + } + if (!other.getServiceAccountEmailAddress().isEmpty()) { + serviceAccountEmailAddress_ = other.serviceAccountEmailAddress_; + bitField0_ |= 0x00008000; + onChanged(); + } + if (other.hasOnPremisesConfiguration()) { + mergeOnPremisesConfiguration(other.getOnPremisesConfiguration()); + } + if (other.hasReplicaConfiguration()) { + mergeReplicaConfiguration(other.getReplicaConfiguration()); + } + if (other.backendType_ != 0) { + setBackendTypeValue(other.getBackendTypeValue()); + } + if (!other.getSelfLink().isEmpty()) { + selfLink_ = other.selfLink_; + bitField0_ |= 0x00080000; + onChanged(); + } + if (!other.suspensionReason_.isEmpty()) { + if (suspensionReason_.isEmpty()) { + suspensionReason_ = other.suspensionReason_; + suspensionReason_.makeImmutable(); + bitField0_ |= 0x00100000; + } else { + ensureSuspensionReasonIsMutable(); + suspensionReason_.addAll(other.suspensionReason_); + } + onChanged(); + } + if (!other.getConnectionName().isEmpty()) { + connectionName_ = other.connectionName_; + bitField0_ |= 0x00200000; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00400000; + onChanged(); + } + if (!other.getRegion().isEmpty()) { + region_ = other.region_; + bitField0_ |= 0x00800000; + onChanged(); + } + if (!other.getGceZone().isEmpty()) { + gceZone_ = other.gceZone_; + bitField0_ |= 0x01000000; + onChanged(); + } + if (!other.getSecondaryGceZone().isEmpty()) { + secondaryGceZone_ = other.secondaryGceZone_; + bitField0_ |= 0x02000000; + onChanged(); + } + if (other.hasDiskEncryptionConfiguration()) { + mergeDiskEncryptionConfiguration(other.getDiskEncryptionConfiguration()); + } + if (other.hasDiskEncryptionStatus()) { + mergeDiskEncryptionStatus(other.getDiskEncryptionStatus()); + } + if (!other.getRootPassword().isEmpty()) { + rootPassword_ = other.rootPassword_; + bitField0_ |= 0x10000000; + onChanged(); + } + if (other.hasScheduledMaintenance()) { + mergeScheduledMaintenance(other.getScheduledMaintenance()); + } + if (other.hasSatisfiesPzs()) { + mergeSatisfiesPzs(other.getSatisfiesPzs()); + } + if (!other.getDatabaseInstalledVersion().isEmpty()) { + databaseInstalledVersion_ = other.databaseInstalledVersion_; + bitField0_ |= 0x80000000; + onChanged(); + } + if (other.hasOutOfDiskReport()) { + mergeOutOfDiskReport(other.getOutOfDiskReport()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.availableMaintenanceVersions_.isEmpty()) { + if (availableMaintenanceVersions_.isEmpty()) { + availableMaintenanceVersions_ = other.availableMaintenanceVersions_; + bitField1_ |= 0x00000004; + } else { + ensureAvailableMaintenanceVersionsIsMutable(); + availableMaintenanceVersions_.addAll(other.availableMaintenanceVersions_); + } + onChanged(); + } + if (!other.getMaintenanceVersion().isEmpty()) { + maintenanceVersion_ = other.maintenanceVersion_; + bitField1_ |= 0x00000008; + onChanged(); + } + if (upgradableDatabaseVersionsBuilder_ == null) { + if (!other.upgradableDatabaseVersions_.isEmpty()) { + if (upgradableDatabaseVersions_.isEmpty()) { + upgradableDatabaseVersions_ = other.upgradableDatabaseVersions_; + bitField1_ = (bitField1_ & ~0x00000010); + } else { + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.addAll(other.upgradableDatabaseVersions_); + } + onChanged(); + } + } else { + if (!other.upgradableDatabaseVersions_.isEmpty()) { + if (upgradableDatabaseVersionsBuilder_.isEmpty()) { + upgradableDatabaseVersionsBuilder_.dispose(); + upgradableDatabaseVersionsBuilder_ = null; + upgradableDatabaseVersions_ = other.upgradableDatabaseVersions_; + bitField1_ = (bitField1_ & ~0x00000010); + upgradableDatabaseVersionsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetUpgradableDatabaseVersionsFieldBuilder() + : null; + } else { + upgradableDatabaseVersionsBuilder_.addAllMessages(other.upgradableDatabaseVersions_); + } + } + } + if (other.hasSqlNetworkArchitecture()) { + setSqlNetworkArchitectureValue(other.getSqlNetworkArchitectureValue()); + } + if (other.hasPscServiceAttachmentLink()) { + pscServiceAttachmentLink_ = other.pscServiceAttachmentLink_; + bitField1_ |= 0x00000040; + onChanged(); + } + if (other.hasDnsName()) { + dnsName_ = other.dnsName_; + bitField1_ |= 0x00000080; + onChanged(); + } + if (other.hasPrimaryDnsName()) { + primaryDnsName_ = other.primaryDnsName_; + bitField1_ |= 0x00000100; + onChanged(); + } + if (other.hasWriteEndpoint()) { + writeEndpoint_ = other.writeEndpoint_; + bitField1_ |= 0x00000200; + onChanged(); + } + if (other.hasReplicationCluster()) { + mergeReplicationCluster(other.getReplicationCluster()); + } + if (other.hasGeminiConfig()) { + mergeGeminiConfig(other.getGeminiConfig()); + } + if (other.hasSatisfiesPzi()) { + mergeSatisfiesPzi(other.getSatisfiesPzi()); + } + if (other.hasSwitchTransactionLogsToCloudStorageEnabled()) { + mergeSwitchTransactionLogsToCloudStorageEnabled( + other.getSwitchTransactionLogsToCloudStorageEnabled()); + } + if (other.hasIncludeReplicasForMajorVersionUpgrade()) { + mergeIncludeReplicasForMajorVersionUpgrade( + other.getIncludeReplicasForMajorVersionUpgrade()); + } + internalGetMutableTags().mergeFrom(other.internalGetTags()); + bitField1_ |= 0x00008000; + if (other.hasNodeCount()) { + setNodeCount(other.getNodeCount()); + } + if (nodesBuilder_ == null) { + if (!other.nodes_.isEmpty()) { + if (nodes_.isEmpty()) { + nodes_ = other.nodes_; + bitField1_ = (bitField1_ & ~0x00020000); + } else { + ensureNodesIsMutable(); + nodes_.addAll(other.nodes_); + } + onChanged(); + } + } else { + if (!other.nodes_.isEmpty()) { + if (nodesBuilder_.isEmpty()) { + nodesBuilder_.dispose(); + nodesBuilder_ = null; + nodes_ = other.nodes_; + bitField1_ = (bitField1_ & ~0x00020000); + nodesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetNodesFieldBuilder() + : null; + } else { + nodesBuilder_.addAllMessages(other.nodes_); + } + } + } + if (dnsNamesBuilder_ == null) { + if (!other.dnsNames_.isEmpty()) { + if (dnsNames_.isEmpty()) { + dnsNames_ = other.dnsNames_; + bitField1_ = (bitField1_ & ~0x00040000); + } else { + ensureDnsNamesIsMutable(); + dnsNames_.addAll(other.dnsNames_); + } + onChanged(); + } + } else { + if (!other.dnsNames_.isEmpty()) { + if (dnsNamesBuilder_.isEmpty()) { + dnsNamesBuilder_.dispose(); + dnsNamesBuilder_ = null; + dnsNames_ = other.dnsNames_; + bitField1_ = (bitField1_ & ~0x00040000); + dnsNamesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDnsNamesFieldBuilder() + : null; + } else { + dnsNamesBuilder_.addAllMessages(other.dnsNames_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + databaseVersion_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage( + internalGetSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetFailoverReplicaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + masterInstanceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureReplicaNamesIsMutable(); + replicaNames_.add(s); + break; + } // case 66 + case 74: + { + input.readMessage( + internalGetMaxDiskSizeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + input.readMessage( + internalGetCurrentDiskSizeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + com.google.cloud.sql.v1beta4.IpMapping m = + input.readMessage( + com.google.cloud.sql.v1beta4.IpMapping.parser(), extensionRegistry); + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(m); + } else { + ipAddressesBuilder_.addMessage(m); + } + break; + } // case 90 + case 98: + { + input.readMessage( + internalGetServerCaCertFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 104: + { + instanceType_ = input.readEnum(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 114: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 122: + { + ipv6Address_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 122 + case 130: + { + serviceAccountEmailAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 130 + case 138: + { + input.readMessage( + internalGetOnPremisesConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 138 + case 146: + { + input.readMessage( + internalGetReplicaConfigurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 146 + case 152: + { + backendType_ = input.readEnum(); + bitField0_ |= 0x00040000; + break; + } // case 152 + case 162: + { + selfLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00080000; + break; + } // case 162 + case 168: + { + int tmpRaw = input.readEnum(); + ensureSuspensionReasonIsMutable(); + suspensionReason_.addInt(tmpRaw); + break; + } // case 168 + case 170: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureSuspensionReasonIsMutable(); + while (input.getBytesUntilLimit() > 0) { + suspensionReason_.addInt(input.readEnum()); + } + input.popLimit(limit); + break; + } // case 170 + case 178: + { + connectionName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00200000; + break; + } // case 178 + case 186: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00400000; + break; + } // case 186 + case 194: + { + region_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00800000; + break; + } // case 194 + case 202: + { + gceZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x01000000; + break; + } // case 202 + case 210: + { + input.readMessage( + internalGetDiskEncryptionConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x04000000; + break; + } // case 210 + case 218: + { + input.readMessage( + internalGetDiskEncryptionStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x08000000; + break; + } // case 218 + case 234: + { + rootPassword_ = input.readStringRequireUtf8(); + bitField0_ |= 0x10000000; + break; + } // case 234 + case 242: + { + input.readMessage( + internalGetScheduledMaintenanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x20000000; + break; + } // case 242 + case 274: + { + secondaryGceZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x02000000; + break; + } // case 274 + case 282: + { + input.readMessage( + internalGetSatisfiesPzsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x40000000; + break; + } // case 282 + case 306: + { + input.readMessage( + internalGetOutOfDiskReportFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000001; + break; + } // case 306 + case 314: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000002; + break; + } // case 314 + case 322: + { + databaseInstalledVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x80000000; + break; + } // case 322 + case 330: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAvailableMaintenanceVersionsIsMutable(); + availableMaintenanceVersions_.add(s); + break; + } // case 330 + case 338: + { + maintenanceVersion_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000008; + break; + } // case 338 + case 362: + { + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion m = + input.readMessage( + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.parser(), + extensionRegistry); + if (upgradableDatabaseVersionsBuilder_ == null) { + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.add(m); + } else { + upgradableDatabaseVersionsBuilder_.addMessage(m); + } + break; + } // case 362 + case 376: + { + sqlNetworkArchitecture_ = input.readEnum(); + bitField1_ |= 0x00000020; + break; + } // case 376 + case 386: + { + pscServiceAttachmentLink_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000040; + break; + } // case 386 + case 394: + { + dnsName_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000080; + break; + } // case 394 + case 410: + { + primaryDnsName_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000100; + break; + } // case 410 + case 418: + { + writeEndpoint_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000200; + break; + } // case 418 + case 434: + { + input.readMessage( + internalGetReplicationClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000400; + break; + } // case 434 + case 442: + { + input.readMessage( + internalGetGeminiConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000800; + break; + } // case 442 + case 450: + { + input.readMessage( + internalGetSatisfiesPziFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00001000; + break; + } // case 450 + case 458: + { + input.readMessage( + internalGetSwitchTransactionLogsToCloudStorageEnabledFieldBuilder() + .getBuilder(), + extensionRegistry); + bitField1_ |= 0x00002000; + break; + } // case 458 + case 474: + { + input.readMessage( + internalGetIncludeReplicasForMajorVersionUpgradeFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00004000; + break; + } // case 474 + case 482: + { + com.google.protobuf.MapEntry tags__ = + input.readMessage( + TagsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableTags().getMutableMap().put(tags__.getKey(), tags__.getValue()); + bitField1_ |= 0x00008000; + break; + } // case 482 + case 504: + { + nodeCount_ = input.readInt32(); + bitField1_ |= 0x00010000; + break; + } // case 504 + case 514: + { + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig m = + input.readMessage( + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.parser(), + extensionRegistry); + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(m); + } else { + nodesBuilder_.addMessage(m); + } + break; + } // case 514 + case 538: + { + com.google.cloud.sql.v1beta4.DnsNameMapping m = + input.readMessage( + com.google.cloud.sql.v1beta4.DnsNameMapping.parser(), extensionRegistry); + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(m); + } else { + dnsNamesBuilder_.addMessage(m); + } + break; + } // case 538 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 bitField1_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#instance`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instance`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instance`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instance`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instance`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int state_ = 0; + + /** + * + * + *
+     * The current serving state of the Cloud SQL instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 2; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+     * The current serving state of the Cloud SQL instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 2; + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The current serving state of the Cloud SQL instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 2; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState getState() { + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState result = + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState.forNumber(state_); + return result == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The current serving state of the Cloud SQL instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 2; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The current serving state of the Cloud SQL instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 2; + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000002); + state_ = 0; + onChanged(); + return this; + } + + private int databaseVersion_ = 0; + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion` field cannot
+     * be changed after instance creation.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 3; + * + * @return The enum numeric value on the wire for databaseVersion. + */ + @java.lang.Override + public int getDatabaseVersionValue() { + return databaseVersion_; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion` field cannot
+     * be changed after instance creation.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 3; + * + * @param value The enum numeric value on the wire for databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersionValue(int value) { + databaseVersion_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion` field cannot
+     * be changed after instance creation.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 3; + * + * @return The databaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabaseVersion getDatabaseVersion() { + com.google.cloud.sql.v1beta4.SqlDatabaseVersion result = + com.google.cloud.sql.v1beta4.SqlDatabaseVersion.forNumber(databaseVersion_); + return result == null ? com.google.cloud.sql.v1beta4.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion` field cannot
+     * be changed after instance creation.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 3; + * + * @param value The databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersion(com.google.cloud.sql.v1beta4.SqlDatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + databaseVersion_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database engine type and version. The `databaseVersion` field cannot
+     * be changed after instance creation.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 3; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseVersion() { + bitField0_ = (bitField0_ & ~0x00000004); + databaseVersion_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.Settings settings_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Settings, + com.google.cloud.sql.v1beta4.Settings.Builder, + com.google.cloud.sql.v1beta4.SettingsOrBuilder> + settingsBuilder_; + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + * + * @return Whether the settings field is set. + */ + public boolean hasSettings() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + * + * @return The settings. + */ + public com.google.cloud.sql.v1beta4.Settings getSettings() { + if (settingsBuilder_ == null) { + return settings_ == null + ? com.google.cloud.sql.v1beta4.Settings.getDefaultInstance() + : settings_; + } else { + return settingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + */ + public Builder setSettings(com.google.cloud.sql.v1beta4.Settings value) { + if (settingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + settings_ = value; + } else { + settingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + */ + public Builder setSettings(com.google.cloud.sql.v1beta4.Settings.Builder builderForValue) { + if (settingsBuilder_ == null) { + settings_ = builderForValue.build(); + } else { + settingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + */ + public Builder mergeSettings(com.google.cloud.sql.v1beta4.Settings value) { + if (settingsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && settings_ != null + && settings_ != com.google.cloud.sql.v1beta4.Settings.getDefaultInstance()) { + getSettingsBuilder().mergeFrom(value); + } else { + settings_ = value; + } + } else { + settingsBuilder_.mergeFrom(value); + } + if (settings_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + */ + public Builder clearSettings() { + bitField0_ = (bitField0_ & ~0x00000008); + settings_ = null; + if (settingsBuilder_ != null) { + settingsBuilder_.dispose(); + settingsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + */ + public com.google.cloud.sql.v1beta4.Settings.Builder getSettingsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + */ + public com.google.cloud.sql.v1beta4.SettingsOrBuilder getSettingsOrBuilder() { + if (settingsBuilder_ != null) { + return settingsBuilder_.getMessageOrBuilder(); + } else { + return settings_ == null + ? com.google.cloud.sql.v1beta4.Settings.getDefaultInstance() + : settings_; + } + } + + /** + * + * + *
+     * The user settings.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Settings, + com.google.cloud.sql.v1beta4.Settings.Builder, + com.google.cloud.sql.v1beta4.SettingsOrBuilder> + internalGetSettingsFieldBuilder() { + if (settingsBuilder_ == null) { + settingsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Settings, + com.google.cloud.sql.v1beta4.Settings.Builder, + com.google.cloud.sql.v1beta4.SettingsOrBuilder>( + getSettings(), getParentForChildren(), isClean()); + settings_ = null; + } + return settingsBuilder_; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API. Use the `settings.settingsVersion` field instead.
+     * 
+ * + * string etag = 5; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API. Use the `settings.settingsVersion` field instead.
+     * 
+ * + * string etag = 5; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API. Use the `settings.settingsVersion` field instead.
+     * 
+ * + * string etag = 5; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API. Use the `settings.settingsVersion` field instead.
+     * 
+ * + * string etag = 5; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API. Use the `settings.settingsVersion` field instead.
+     * 
+ * + * string etag = 5; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failoverReplica_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplicaOrBuilder> + failoverReplicaBuilder_; + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + * + * @return Whether the failoverReplica field is set. + */ + public boolean hasFailoverReplica() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + * + * @return The failoverReplica. + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica getFailoverReplica() { + if (failoverReplicaBuilder_ == null) { + return failoverReplica_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.getDefaultInstance() + : failoverReplica_; + } else { + return failoverReplicaBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + */ + public Builder setFailoverReplica( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica value) { + if (failoverReplicaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + failoverReplica_ = value; + } else { + failoverReplicaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + */ + public Builder setFailoverReplica( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.Builder builderForValue) { + if (failoverReplicaBuilder_ == null) { + failoverReplica_ = builderForValue.build(); + } else { + failoverReplicaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + */ + public Builder mergeFailoverReplica( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica value) { + if (failoverReplicaBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && failoverReplica_ != null + && failoverReplica_ + != com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica + .getDefaultInstance()) { + getFailoverReplicaBuilder().mergeFrom(value); + } else { + failoverReplica_ = value; + } + } else { + failoverReplicaBuilder_.mergeFrom(value); + } + if (failoverReplica_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + */ + public Builder clearFailoverReplica() { + bitField0_ = (bitField0_ & ~0x00000020); + failoverReplica_ = null; + if (failoverReplicaBuilder_ != null) { + failoverReplicaBuilder_.dispose(); + failoverReplicaBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.Builder + getFailoverReplicaBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetFailoverReplicaFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplicaOrBuilder + getFailoverReplicaOrBuilder() { + if (failoverReplicaBuilder_ != null) { + return failoverReplicaBuilder_.getMessageOrBuilder(); + } else { + return failoverReplica_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.getDefaultInstance() + : failoverReplica_; + } + } + + /** + * + * + *
+     * The name and status of the failover replica.
+     * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplicaOrBuilder> + internalGetFailoverReplicaFieldBuilder() { + if (failoverReplicaBuilder_ == null) { + failoverReplicaBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplicaOrBuilder>( + getFailoverReplica(), getParentForChildren(), isClean()); + failoverReplica_ = null; + } + return failoverReplicaBuilder_; + } + + private java.lang.Object masterInstanceName_ = ""; + + /** + * + * + *
+     * The name of the instance which will act as primary in the replication
+     * setup.
+     * 
+ * + * string master_instance_name = 7; + * + * @return The masterInstanceName. + */ + public java.lang.String getMasterInstanceName() { + java.lang.Object ref = masterInstanceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + masterInstanceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the instance which will act as primary in the replication
+     * setup.
+     * 
+ * + * string master_instance_name = 7; + * + * @return The bytes for masterInstanceName. + */ + public com.google.protobuf.ByteString getMasterInstanceNameBytes() { + java.lang.Object ref = masterInstanceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + masterInstanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the instance which will act as primary in the replication
+     * setup.
+     * 
+ * + * string master_instance_name = 7; + * + * @param value The masterInstanceName to set. + * @return This builder for chaining. + */ + public Builder setMasterInstanceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + masterInstanceName_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the instance which will act as primary in the replication
+     * setup.
+     * 
+ * + * string master_instance_name = 7; + * + * @return This builder for chaining. + */ + public Builder clearMasterInstanceName() { + masterInstanceName_ = getDefaultInstance().getMasterInstanceName(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the instance which will act as primary in the replication
+     * setup.
+     * 
+ * + * string master_instance_name = 7; + * + * @param value The bytes for masterInstanceName to set. + * @return This builder for chaining. + */ + public Builder setMasterInstanceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + masterInstanceName_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList replicaNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureReplicaNamesIsMutable() { + if (!replicaNames_.isModifiable()) { + replicaNames_ = new com.google.protobuf.LazyStringArrayList(replicaNames_); + } + bitField0_ |= 0x00000080; + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @return A list containing the replicaNames. + */ + public com.google.protobuf.ProtocolStringList getReplicaNamesList() { + replicaNames_.makeImmutable(); + return replicaNames_; + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @return The count of replicaNames. + */ + public int getReplicaNamesCount() { + return replicaNames_.size(); + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @param index The index of the element to return. + * @return The replicaNames at the given index. + */ + public java.lang.String getReplicaNames(int index) { + return replicaNames_.get(index); + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @param index The index of the value to return. + * @return The bytes of the replicaNames at the given index. + */ + public com.google.protobuf.ByteString getReplicaNamesBytes(int index) { + return replicaNames_.getByteString(index); + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @param index The index to set the value at. + * @param value The replicaNames to set. + * @return This builder for chaining. + */ + public Builder setReplicaNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureReplicaNamesIsMutable(); + replicaNames_.set(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @param value The replicaNames to add. + * @return This builder for chaining. + */ + public Builder addReplicaNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureReplicaNamesIsMutable(); + replicaNames_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @param values The replicaNames to add. + * @return This builder for chaining. + */ + public Builder addAllReplicaNames(java.lang.Iterable values) { + ensureReplicaNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, replicaNames_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @return This builder for chaining. + */ + public Builder clearReplicaNames() { + replicaNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * The replicas of the instance.
+     * 
+ * + * repeated string replica_names = 8; + * + * @param value The bytes of the replicaNames to add. + * @return This builder for chaining. + */ + public Builder addReplicaNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureReplicaNamesIsMutable(); + replicaNames_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.protobuf.Int64Value maxDiskSize_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + maxDiskSizeBuilder_; + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.max_disk_size is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=779 + * @return Whether the maxDiskSize field is set. + */ + @java.lang.Deprecated + public boolean hasMaxDiskSize() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.max_disk_size is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=779 + * @return The maxDiskSize. + */ + @java.lang.Deprecated + public com.google.protobuf.Int64Value getMaxDiskSize() { + if (maxDiskSizeBuilder_ == null) { + return maxDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : maxDiskSize_; + } else { + return maxDiskSizeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setMaxDiskSize(com.google.protobuf.Int64Value value) { + if (maxDiskSizeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxDiskSize_ = value; + } else { + maxDiskSizeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setMaxDiskSize(com.google.protobuf.Int64Value.Builder builderForValue) { + if (maxDiskSizeBuilder_ == null) { + maxDiskSize_ = builderForValue.build(); + } else { + maxDiskSizeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder mergeMaxDiskSize(com.google.protobuf.Int64Value value) { + if (maxDiskSizeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && maxDiskSize_ != null + && maxDiskSize_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getMaxDiskSizeBuilder().mergeFrom(value); + } else { + maxDiskSize_ = value; + } + } else { + maxDiskSizeBuilder_.mergeFrom(value); + } + if (maxDiskSize_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder clearMaxDiskSize() { + bitField0_ = (bitField0_ & ~0x00000100); + maxDiskSize_ = null; + if (maxDiskSizeBuilder_ != null) { + maxDiskSizeBuilder_.dispose(); + maxDiskSizeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.Int64Value.Builder getMaxDiskSizeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetMaxDiskSizeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.Int64ValueOrBuilder getMaxDiskSizeOrBuilder() { + if (maxDiskSizeBuilder_ != null) { + return maxDiskSizeBuilder_.getMessageOrBuilder(); + } else { + return maxDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : maxDiskSize_; + } + } + + /** + * + * + *
+     * The maximum disk size of the instance in bytes.
+     * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetMaxDiskSizeFieldBuilder() { + if (maxDiskSizeBuilder_ == null) { + maxDiskSizeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getMaxDiskSize(), getParentForChildren(), isClean()); + maxDiskSize_ = null; + } + return maxDiskSizeBuilder_; + } + + private com.google.protobuf.Int64Value currentDiskSize_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + currentDiskSizeBuilder_; + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.current_disk_size is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=787 + * @return Whether the currentDiskSize field is set. + */ + @java.lang.Deprecated + public boolean hasCurrentDiskSize() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.current_disk_size is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=787 + * @return The currentDiskSize. + */ + @java.lang.Deprecated + public com.google.protobuf.Int64Value getCurrentDiskSize() { + if (currentDiskSizeBuilder_ == null) { + return currentDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : currentDiskSize_; + } else { + return currentDiskSizeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setCurrentDiskSize(com.google.protobuf.Int64Value value) { + if (currentDiskSizeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + currentDiskSize_ = value; + } else { + currentDiskSizeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setCurrentDiskSize(com.google.protobuf.Int64Value.Builder builderForValue) { + if (currentDiskSizeBuilder_ == null) { + currentDiskSize_ = builderForValue.build(); + } else { + currentDiskSizeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder mergeCurrentDiskSize(com.google.protobuf.Int64Value value) { + if (currentDiskSizeBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && currentDiskSize_ != null + && currentDiskSize_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getCurrentDiskSizeBuilder().mergeFrom(value); + } else { + currentDiskSize_ = value; + } + } else { + currentDiskSizeBuilder_.mergeFrom(value); + } + if (currentDiskSize_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder clearCurrentDiskSize() { + bitField0_ = (bitField0_ & ~0x00000200); + currentDiskSize_ = null; + if (currentDiskSizeBuilder_ != null) { + currentDiskSizeBuilder_.dispose(); + currentDiskSizeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.Int64Value.Builder getCurrentDiskSizeBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetCurrentDiskSizeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.Int64ValueOrBuilder getCurrentDiskSizeOrBuilder() { + if (currentDiskSizeBuilder_ != null) { + return currentDiskSizeBuilder_.getMessageOrBuilder(); + } else { + return currentDiskSize_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : currentDiskSize_; + } + } + + /** + * + * + *
+     * The current disk usage of the instance in bytes. This property has been
+     * deprecated. Use the
+     * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+     * Monitoring API instead. Please see [this
+     * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+     * for details.
+     * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetCurrentDiskSizeFieldBuilder() { + if (currentDiskSizeBuilder_ == null) { + currentDiskSizeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getCurrentDiskSize(), getParentForChildren(), isClean()); + currentDiskSize_ = null; + } + return currentDiskSizeBuilder_; + } + + private java.util.List ipAddresses_ = + java.util.Collections.emptyList(); + + private void ensureIpAddressesIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + ipAddresses_ = + new java.util.ArrayList(ipAddresses_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.IpMapping, + com.google.cloud.sql.v1beta4.IpMapping.Builder, + com.google.cloud.sql.v1beta4.IpMappingOrBuilder> + ipAddressesBuilder_; + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public java.util.List getIpAddressesList() { + if (ipAddressesBuilder_ == null) { + return java.util.Collections.unmodifiableList(ipAddresses_); + } else { + return ipAddressesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public int getIpAddressesCount() { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.size(); + } else { + return ipAddressesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public com.google.cloud.sql.v1beta4.IpMapping getIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public Builder setIpAddresses(int index, com.google.cloud.sql.v1beta4.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, value); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public Builder setIpAddresses( + int index, com.google.cloud.sql.v1beta4.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public Builder addIpAddresses(com.google.cloud.sql.v1beta4.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public Builder addIpAddresses(int index, com.google.cloud.sql.v1beta4.IpMapping value) { + if (ipAddressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, value); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public Builder addIpAddresses(com.google.cloud.sql.v1beta4.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public Builder addIpAddresses( + int index, com.google.cloud.sql.v1beta4.IpMapping.Builder builderForValue) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.add(index, builderForValue.build()); + onChanged(); + } else { + ipAddressesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public Builder addAllIpAddresses( + java.lang.Iterable values) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipAddresses_); + onChanged(); + } else { + ipAddressesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public Builder clearIpAddresses() { + if (ipAddressesBuilder_ == null) { + ipAddresses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + ipAddressesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public Builder removeIpAddresses(int index) { + if (ipAddressesBuilder_ == null) { + ensureIpAddressesIsMutable(); + ipAddresses_.remove(index); + onChanged(); + } else { + ipAddressesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public com.google.cloud.sql.v1beta4.IpMapping.Builder getIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public com.google.cloud.sql.v1beta4.IpMappingOrBuilder getIpAddressesOrBuilder(int index) { + if (ipAddressesBuilder_ == null) { + return ipAddresses_.get(index); + } else { + return ipAddressesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public java.util.List + getIpAddressesOrBuilderList() { + if (ipAddressesBuilder_ != null) { + return ipAddressesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(ipAddresses_); + } + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public com.google.cloud.sql.v1beta4.IpMapping.Builder addIpAddressesBuilder() { + return internalGetIpAddressesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public com.google.cloud.sql.v1beta4.IpMapping.Builder addIpAddressesBuilder(int index) { + return internalGetIpAddressesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.IpMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * The assigned IP addresses for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + public java.util.List + getIpAddressesBuilderList() { + return internalGetIpAddressesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.IpMapping, + com.google.cloud.sql.v1beta4.IpMapping.Builder, + com.google.cloud.sql.v1beta4.IpMappingOrBuilder> + internalGetIpAddressesFieldBuilder() { + if (ipAddressesBuilder_ == null) { + ipAddressesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.IpMapping, + com.google.cloud.sql.v1beta4.IpMapping.Builder, + com.google.cloud.sql.v1beta4.IpMappingOrBuilder>( + ipAddresses_, ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean()); + ipAddresses_ = null; + } + return ipAddressesBuilder_; + } + + private com.google.cloud.sql.v1beta4.SslCert serverCaCert_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + serverCaCertBuilder_; + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + * + * @return Whether the serverCaCert field is set. + */ + public boolean hasServerCaCert() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + * + * @return The serverCaCert. + */ + public com.google.cloud.sql.v1beta4.SslCert getServerCaCert() { + if (serverCaCertBuilder_ == null) { + return serverCaCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : serverCaCert_; + } else { + return serverCaCertBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + */ + public Builder setServerCaCert(com.google.cloud.sql.v1beta4.SslCert value) { + if (serverCaCertBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serverCaCert_ = value; + } else { + serverCaCertBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + */ + public Builder setServerCaCert(com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (serverCaCertBuilder_ == null) { + serverCaCert_ = builderForValue.build(); + } else { + serverCaCertBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + */ + public Builder mergeServerCaCert(com.google.cloud.sql.v1beta4.SslCert value) { + if (serverCaCertBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && serverCaCert_ != null + && serverCaCert_ != com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()) { + getServerCaCertBuilder().mergeFrom(value); + } else { + serverCaCert_ = value; + } + } else { + serverCaCertBuilder_.mergeFrom(value); + } + if (serverCaCert_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + */ + public Builder clearServerCaCert() { + bitField0_ = (bitField0_ & ~0x00000800); + serverCaCert_ = null; + if (serverCaCertBuilder_ != null) { + serverCaCertBuilder_.dispose(); + serverCaCertBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder getServerCaCertBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return internalGetServerCaCertFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + */ + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getServerCaCertOrBuilder() { + if (serverCaCertBuilder_ != null) { + return serverCaCertBuilder_.getMessageOrBuilder(); + } else { + return serverCaCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : serverCaCert_; + } + } + + /** + * + * + *
+     * SSL configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + internalGetServerCaCertFieldBuilder() { + if (serverCaCertBuilder_ == null) { + serverCaCertBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder>( + getServerCaCert(), getParentForChildren(), isClean()); + serverCaCert_ = null; + } + return serverCaCertBuilder_; + } + + private int instanceType_ = 0; + + /** + * + * + *
+     * The instance type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlInstanceType instance_type = 13; + * + * @return The enum numeric value on the wire for instanceType. + */ + @java.lang.Override + public int getInstanceTypeValue() { + return instanceType_; + } + + /** + * + * + *
+     * The instance type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlInstanceType instance_type = 13; + * + * @param value The enum numeric value on the wire for instanceType to set. + * @return This builder for chaining. + */ + public Builder setInstanceTypeValue(int value) { + instanceType_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The instance type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlInstanceType instance_type = 13; + * + * @return The instanceType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstanceType getInstanceType() { + com.google.cloud.sql.v1beta4.SqlInstanceType result = + com.google.cloud.sql.v1beta4.SqlInstanceType.forNumber(instanceType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlInstanceType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The instance type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlInstanceType instance_type = 13; + * + * @param value The instanceType to set. + * @return This builder for chaining. + */ + public Builder setInstanceType(com.google.cloud.sql.v1beta4.SqlInstanceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00001000; + instanceType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The instance type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlInstanceType instance_type = 13; + * + * @return This builder for chaining. + */ + public Builder clearInstanceType() { + bitField0_ = (bitField0_ & ~0x00001000); + instanceType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL instance. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 14; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL instance. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 14; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL instance. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 14; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL instance. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 14; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL instance. The Google
+     * apps domain is prefixed if applicable.
+     * 
+ * + * string project = 14; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + private java.lang.Object ipv6Address_ = ""; + + /** + * + * + *
+     * The IPv6 address assigned to the instance.
+     * (Deprecated) This property was applicable only
+     * to First Generation instances.
+     * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=805 + * @return The ipv6Address. + */ + @java.lang.Deprecated + public java.lang.String getIpv6Address() { + java.lang.Object ref = ipv6Address_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipv6Address_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The IPv6 address assigned to the instance.
+     * (Deprecated) This property was applicable only
+     * to First Generation instances.
+     * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=805 + * @return The bytes for ipv6Address. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getIpv6AddressBytes() { + java.lang.Object ref = ipv6Address_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipv6Address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The IPv6 address assigned to the instance.
+     * (Deprecated) This property was applicable only
+     * to First Generation instances.
+     * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=805 + * @param value The ipv6Address to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setIpv6Address(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ipv6Address_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The IPv6 address assigned to the instance.
+     * (Deprecated) This property was applicable only
+     * to First Generation instances.
+     * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=805 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearIpv6Address() { + ipv6Address_ = getDefaultInstance().getIpv6Address(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The IPv6 address assigned to the instance.
+     * (Deprecated) This property was applicable only
+     * to First Generation instances.
+     * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=805 + * @param value The bytes for ipv6Address to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setIpv6AddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ipv6Address_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + private java.lang.Object serviceAccountEmailAddress_ = ""; + + /** + * + * + *
+     * The service account email address assigned to the instance. \This
+     * property is read-only.
+     * 
+ * + * string service_account_email_address = 16; + * + * @return The serviceAccountEmailAddress. + */ + public java.lang.String getServiceAccountEmailAddress() { + java.lang.Object ref = serviceAccountEmailAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmailAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The service account email address assigned to the instance. \This
+     * property is read-only.
+     * 
+ * + * string service_account_email_address = 16; + * + * @return The bytes for serviceAccountEmailAddress. + */ + public com.google.protobuf.ByteString getServiceAccountEmailAddressBytes() { + java.lang.Object ref = serviceAccountEmailAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmailAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The service account email address assigned to the instance. \This
+     * property is read-only.
+     * 
+ * + * string service_account_email_address = 16; + * + * @param value The serviceAccountEmailAddress to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmailAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceAccountEmailAddress_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The service account email address assigned to the instance. \This
+     * property is read-only.
+     * 
+ * + * string service_account_email_address = 16; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccountEmailAddress() { + serviceAccountEmailAddress_ = getDefaultInstance().getServiceAccountEmailAddress(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The service account email address assigned to the instance. \This
+     * property is read-only.
+     * 
+ * + * string service_account_email_address = 16; + * + * @param value The bytes for serviceAccountEmailAddress to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmailAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceAccountEmailAddress_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.OnPremisesConfiguration onPremisesConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.OnPremisesConfiguration, + com.google.cloud.sql.v1beta4.OnPremisesConfiguration.Builder, + com.google.cloud.sql.v1beta4.OnPremisesConfigurationOrBuilder> + onPremisesConfigurationBuilder_; + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + * + * + * @return Whether the onPremisesConfiguration field is set. + */ + public boolean hasOnPremisesConfiguration() { + return ((bitField0_ & 0x00010000) != 0); + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + * + * + * @return The onPremisesConfiguration. + */ + public com.google.cloud.sql.v1beta4.OnPremisesConfiguration getOnPremisesConfiguration() { + if (onPremisesConfigurationBuilder_ == null) { + return onPremisesConfiguration_ == null + ? com.google.cloud.sql.v1beta4.OnPremisesConfiguration.getDefaultInstance() + : onPremisesConfiguration_; + } else { + return onPremisesConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + * + */ + public Builder setOnPremisesConfiguration( + com.google.cloud.sql.v1beta4.OnPremisesConfiguration value) { + if (onPremisesConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + onPremisesConfiguration_ = value; + } else { + onPremisesConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + * + */ + public Builder setOnPremisesConfiguration( + com.google.cloud.sql.v1beta4.OnPremisesConfiguration.Builder builderForValue) { + if (onPremisesConfigurationBuilder_ == null) { + onPremisesConfiguration_ = builderForValue.build(); + } else { + onPremisesConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + * + */ + public Builder mergeOnPremisesConfiguration( + com.google.cloud.sql.v1beta4.OnPremisesConfiguration value) { + if (onPremisesConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && onPremisesConfiguration_ != null + && onPremisesConfiguration_ + != com.google.cloud.sql.v1beta4.OnPremisesConfiguration.getDefaultInstance()) { + getOnPremisesConfigurationBuilder().mergeFrom(value); + } else { + onPremisesConfiguration_ = value; + } + } else { + onPremisesConfigurationBuilder_.mergeFrom(value); + } + if (onPremisesConfiguration_ != null) { + bitField0_ |= 0x00010000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + * + */ + public Builder clearOnPremisesConfiguration() { + bitField0_ = (bitField0_ & ~0x00010000); + onPremisesConfiguration_ = null; + if (onPremisesConfigurationBuilder_ != null) { + onPremisesConfigurationBuilder_.dispose(); + onPremisesConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + * + */ + public com.google.cloud.sql.v1beta4.OnPremisesConfiguration.Builder + getOnPremisesConfigurationBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return internalGetOnPremisesConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + * + */ + public com.google.cloud.sql.v1beta4.OnPremisesConfigurationOrBuilder + getOnPremisesConfigurationOrBuilder() { + if (onPremisesConfigurationBuilder_ != null) { + return onPremisesConfigurationBuilder_.getMessageOrBuilder(); + } else { + return onPremisesConfiguration_ == null + ? com.google.cloud.sql.v1beta4.OnPremisesConfiguration.getDefaultInstance() + : onPremisesConfiguration_; + } + } + + /** + * + * + *
+     * Configuration specific to on-premises instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.OnPremisesConfiguration, + com.google.cloud.sql.v1beta4.OnPremisesConfiguration.Builder, + com.google.cloud.sql.v1beta4.OnPremisesConfigurationOrBuilder> + internalGetOnPremisesConfigurationFieldBuilder() { + if (onPremisesConfigurationBuilder_ == null) { + onPremisesConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.OnPremisesConfiguration, + com.google.cloud.sql.v1beta4.OnPremisesConfiguration.Builder, + com.google.cloud.sql.v1beta4.OnPremisesConfigurationOrBuilder>( + getOnPremisesConfiguration(), getParentForChildren(), isClean()); + onPremisesConfiguration_ = null; + } + return onPremisesConfigurationBuilder_; + } + + private com.google.cloud.sql.v1beta4.ReplicaConfiguration replicaConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ReplicaConfiguration, + com.google.cloud.sql.v1beta4.ReplicaConfiguration.Builder, + com.google.cloud.sql.v1beta4.ReplicaConfigurationOrBuilder> + replicaConfigurationBuilder_; + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + * + * @return Whether the replicaConfiguration field is set. + */ + public boolean hasReplicaConfiguration() { + return ((bitField0_ & 0x00020000) != 0); + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + * + * @return The replicaConfiguration. + */ + public com.google.cloud.sql.v1beta4.ReplicaConfiguration getReplicaConfiguration() { + if (replicaConfigurationBuilder_ == null) { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.ReplicaConfiguration.getDefaultInstance() + : replicaConfiguration_; + } else { + return replicaConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + */ + public Builder setReplicaConfiguration( + com.google.cloud.sql.v1beta4.ReplicaConfiguration value) { + if (replicaConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replicaConfiguration_ = value; + } else { + replicaConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + */ + public Builder setReplicaConfiguration( + com.google.cloud.sql.v1beta4.ReplicaConfiguration.Builder builderForValue) { + if (replicaConfigurationBuilder_ == null) { + replicaConfiguration_ = builderForValue.build(); + } else { + replicaConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + */ + public Builder mergeReplicaConfiguration( + com.google.cloud.sql.v1beta4.ReplicaConfiguration value) { + if (replicaConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) + && replicaConfiguration_ != null + && replicaConfiguration_ + != com.google.cloud.sql.v1beta4.ReplicaConfiguration.getDefaultInstance()) { + getReplicaConfigurationBuilder().mergeFrom(value); + } else { + replicaConfiguration_ = value; + } + } else { + replicaConfigurationBuilder_.mergeFrom(value); + } + if (replicaConfiguration_ != null) { + bitField0_ |= 0x00020000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + */ + public Builder clearReplicaConfiguration() { + bitField0_ = (bitField0_ & ~0x00020000); + replicaConfiguration_ = null; + if (replicaConfigurationBuilder_ != null) { + replicaConfigurationBuilder_.dispose(); + replicaConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + */ + public com.google.cloud.sql.v1beta4.ReplicaConfiguration.Builder + getReplicaConfigurationBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return internalGetReplicaConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + */ + public com.google.cloud.sql.v1beta4.ReplicaConfigurationOrBuilder + getReplicaConfigurationOrBuilder() { + if (replicaConfigurationBuilder_ != null) { + return replicaConfigurationBuilder_.getMessageOrBuilder(); + } else { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.ReplicaConfiguration.getDefaultInstance() + : replicaConfiguration_; + } + } + + /** + * + * + *
+     * Configuration specific to failover replicas and read replicas.
+     * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ReplicaConfiguration, + com.google.cloud.sql.v1beta4.ReplicaConfiguration.Builder, + com.google.cloud.sql.v1beta4.ReplicaConfigurationOrBuilder> + internalGetReplicaConfigurationFieldBuilder() { + if (replicaConfigurationBuilder_ == null) { + replicaConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ReplicaConfiguration, + com.google.cloud.sql.v1beta4.ReplicaConfiguration.Builder, + com.google.cloud.sql.v1beta4.ReplicaConfigurationOrBuilder>( + getReplicaConfiguration(), getParentForChildren(), isClean()); + replicaConfiguration_ = null; + } + return replicaConfigurationBuilder_; + } + + private int backendType_ = 0; + + /** + * + * + *
+     * The backend type.
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     *
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 19; + * + * @return The enum numeric value on the wire for backendType. + */ + @java.lang.Override + public int getBackendTypeValue() { + return backendType_; + } + + /** + * + * + *
+     * The backend type.
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     *
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 19; + * + * @param value The enum numeric value on the wire for backendType to set. + * @return This builder for chaining. + */ + public Builder setBackendTypeValue(int value) { + backendType_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The backend type.
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     *
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 19; + * + * @return The backendType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackendType getBackendType() { + com.google.cloud.sql.v1beta4.SqlBackendType result = + com.google.cloud.sql.v1beta4.SqlBackendType.forNumber(backendType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlBackendType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The backend type.
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     *
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 19; + * + * @param value The backendType to set. + * @return This builder for chaining. + */ + public Builder setBackendType(com.google.cloud.sql.v1beta4.SqlBackendType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00040000; + backendType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The backend type.
+     * `SECOND_GEN`: Cloud SQL database instance.
+     * `EXTERNAL`: A database server that is not managed by Google.
+     *
+     * This property is read-only; use the `tier` property in the `settings`
+     * object to determine the database type.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 19; + * + * @return This builder for chaining. + */ + public Builder clearBackendType() { + bitField0_ = (bitField0_ & ~0x00040000); + backendType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object selfLink_ = ""; + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 20; + * + * @return The selfLink. + */ + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 20; + * + * @return The bytes for selfLink. + */ + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 20; + * + * @param value The selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selfLink_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 20; + * + * @return This builder for chaining. + */ + public Builder clearSelfLink() { + selfLink_ = getDefaultInstance().getSelfLink(); + bitField0_ = (bitField0_ & ~0x00080000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 20; + * + * @param value The bytes for selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selfLink_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList suspensionReason_ = emptyIntList(); + + private void ensureSuspensionReasonIsMutable() { + if (!suspensionReason_.isModifiable()) { + suspensionReason_ = makeMutableCopy(suspensionReason_); + } + bitField0_ |= 0x00100000; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @return A list containing the suspensionReason. + */ + public java.util.List + getSuspensionReasonList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.cloud.sql.v1beta4.SqlSuspensionReason>( + suspensionReason_, suspensionReason_converter_); + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @return The count of suspensionReason. + */ + public int getSuspensionReasonCount() { + return suspensionReason_.size(); + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index of the element to return. + * @return The suspensionReason at the given index. + */ + public com.google.cloud.sql.v1beta4.SqlSuspensionReason getSuspensionReason(int index) { + return suspensionReason_converter_.convert(suspensionReason_.getInt(index)); + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index to set the value at. + * @param value The suspensionReason to set. + * @return This builder for chaining. + */ + public Builder setSuspensionReason( + int index, com.google.cloud.sql.v1beta4.SqlSuspensionReason value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSuspensionReasonIsMutable(); + suspensionReason_.setInt(index, value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @param value The suspensionReason to add. + * @return This builder for chaining. + */ + public Builder addSuspensionReason(com.google.cloud.sql.v1beta4.SqlSuspensionReason value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSuspensionReasonIsMutable(); + suspensionReason_.addInt(value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @param values The suspensionReason to add. + * @return This builder for chaining. + */ + public Builder addAllSuspensionReason( + java.lang.Iterable values) { + ensureSuspensionReasonIsMutable(); + for (com.google.cloud.sql.v1beta4.SqlSuspensionReason value : values) { + suspensionReason_.addInt(value.getNumber()); + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @return This builder for chaining. + */ + public Builder clearSuspensionReason() { + suspensionReason_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00100000); + onChanged(); + return this; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @return A list containing the enum numeric values on the wire for suspensionReason. + */ + public java.util.List getSuspensionReasonValueList() { + suspensionReason_.makeImmutable(); + return suspensionReason_; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of suspensionReason at the given index. + */ + public int getSuspensionReasonValue(int index) { + return suspensionReason_.getInt(index); + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for suspensionReason to set. + * @return This builder for chaining. + */ + public Builder setSuspensionReasonValue(int index, int value) { + ensureSuspensionReasonIsMutable(); + suspensionReason_.setInt(index, value); + onChanged(); + return this; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @param value The enum numeric value on the wire for suspensionReason to add. + * @return This builder for chaining. + */ + public Builder addSuspensionReasonValue(int value) { + ensureSuspensionReasonIsMutable(); + suspensionReason_.addInt(value); + onChanged(); + return this; + } + + /** + * + * + *
+     * If the instance state is SUSPENDED, the reason for the suspension.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @param values The enum numeric values on the wire for suspensionReason to add. + * @return This builder for chaining. + */ + public Builder addAllSuspensionReasonValue(java.lang.Iterable values) { + ensureSuspensionReasonIsMutable(); + for (int value : values) { + suspensionReason_.addInt(value); + } + onChanged(); + return this; + } + + private java.lang.Object connectionName_ = ""; + + /** + * + * + *
+     * Connection name of the Cloud SQL instance used in connection strings.
+     * 
+ * + * string connection_name = 22; + * + * @return The connectionName. + */ + public java.lang.String getConnectionName() { + java.lang.Object ref = connectionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Connection name of the Cloud SQL instance used in connection strings.
+     * 
+ * + * string connection_name = 22; + * + * @return The bytes for connectionName. + */ + public com.google.protobuf.ByteString getConnectionNameBytes() { + java.lang.Object ref = connectionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Connection name of the Cloud SQL instance used in connection strings.
+     * 
+ * + * string connection_name = 22; + * + * @param value The connectionName to set. + * @return This builder for chaining. + */ + public Builder setConnectionName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + connectionName_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Connection name of the Cloud SQL instance used in connection strings.
+     * 
+ * + * string connection_name = 22; + * + * @return This builder for chaining. + */ + public Builder clearConnectionName() { + connectionName_ = getDefaultInstance().getConnectionName(); + bitField0_ = (bitField0_ & ~0x00200000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Connection name of the Cloud SQL instance used in connection strings.
+     * 
+ * + * string connection_name = 22; + * + * @param value The bytes for connectionName to set. + * @return This builder for chaining. + */ + public Builder setConnectionNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + connectionName_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string name = 23; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string name = 23; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string name = 23; + * + * @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_ |= 0x00400000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string name = 23; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00400000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the Cloud SQL instance. This does not include the project ID.
+     * 
+ * + * string name = 23; + * + * @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_ |= 0x00400000; + onChanged(); + return this; + } + + private java.lang.Object region_ = ""; + + /** + * + * + *
+     * The geographical region of the Cloud SQL instance.
+     *
+     * It can be one of the
+     * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+     * where Cloud SQL operates:
+     *
+     * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+     * The default value is `us-central1`.
+     * 
+ * + * string region = 24; + * + * @return The region. + */ + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The geographical region of the Cloud SQL instance.
+     *
+     * It can be one of the
+     * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+     * where Cloud SQL operates:
+     *
+     * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+     * The default value is `us-central1`.
+     * 
+ * + * string region = 24; + * + * @return The bytes for region. + */ + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The geographical region of the Cloud SQL instance.
+     *
+     * It can be one of the
+     * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+     * where Cloud SQL operates:
+     *
+     * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+     * The default value is `us-central1`.
+     * 
+ * + * string region = 24; + * + * @param value The region to set. + * @return This builder for chaining. + */ + public Builder setRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + region_ = value; + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The geographical region of the Cloud SQL instance.
+     *
+     * It can be one of the
+     * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+     * where Cloud SQL operates:
+     *
+     * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+     * The default value is `us-central1`.
+     * 
+ * + * string region = 24; + * + * @return This builder for chaining. + */ + public Builder clearRegion() { + region_ = getDefaultInstance().getRegion(); + bitField0_ = (bitField0_ & ~0x00800000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The geographical region of the Cloud SQL instance.
+     *
+     * It can be one of the
+     * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+     * where Cloud SQL operates:
+     *
+     * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+     * The default value is `us-central1`.
+     * 
+ * + * string region = 24; + * + * @param value The bytes for region to set. + * @return This builder for chaining. + */ + public Builder setRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + region_ = value; + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + + private java.lang.Object gceZone_ = ""; + + /** + * + * + *
+     * The Compute Engine zone that the instance is currently serving from. This
+     * value could be different from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary zone. WARNING:
+     * Changing this might restart the instance.
+     * 
+ * + * string gce_zone = 25; + * + * @return The gceZone. + */ + public java.lang.String getGceZone() { + java.lang.Object ref = gceZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gceZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Compute Engine zone that the instance is currently serving from. This
+     * value could be different from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary zone. WARNING:
+     * Changing this might restart the instance.
+     * 
+ * + * string gce_zone = 25; + * + * @return The bytes for gceZone. + */ + public com.google.protobuf.ByteString getGceZoneBytes() { + java.lang.Object ref = gceZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Compute Engine zone that the instance is currently serving from. This
+     * value could be different from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary zone. WARNING:
+     * Changing this might restart the instance.
+     * 
+ * + * string gce_zone = 25; + * + * @param value The gceZone to set. + * @return This builder for chaining. + */ + public Builder setGceZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + gceZone_ = value; + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Compute Engine zone that the instance is currently serving from. This
+     * value could be different from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary zone. WARNING:
+     * Changing this might restart the instance.
+     * 
+ * + * string gce_zone = 25; + * + * @return This builder for chaining. + */ + public Builder clearGceZone() { + gceZone_ = getDefaultInstance().getGceZone(); + bitField0_ = (bitField0_ & ~0x01000000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Compute Engine zone that the instance is currently serving from. This
+     * value could be different from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary zone. WARNING:
+     * Changing this might restart the instance.
+     * 
+ * + * string gce_zone = 25; + * + * @param value The bytes for gceZone to set. + * @return This builder for chaining. + */ + public Builder setGceZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + gceZone_ = value; + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + + private java.lang.Object secondaryGceZone_ = ""; + + /** + * + * + *
+     * The Compute Engine zone that the failover instance is currently serving
+     * from for a regional instance. This value could be different
+     * from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary/failover zone.
+     * 
+ * + * string secondary_gce_zone = 34; + * + * @return The secondaryGceZone. + */ + public java.lang.String getSecondaryGceZone() { + java.lang.Object ref = secondaryGceZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secondaryGceZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Compute Engine zone that the failover instance is currently serving
+     * from for a regional instance. This value could be different
+     * from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary/failover zone.
+     * 
+ * + * string secondary_gce_zone = 34; + * + * @return The bytes for secondaryGceZone. + */ + public com.google.protobuf.ByteString getSecondaryGceZoneBytes() { + java.lang.Object ref = secondaryGceZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secondaryGceZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Compute Engine zone that the failover instance is currently serving
+     * from for a regional instance. This value could be different
+     * from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary/failover zone.
+     * 
+ * + * string secondary_gce_zone = 34; + * + * @param value The secondaryGceZone to set. + * @return This builder for chaining. + */ + public Builder setSecondaryGceZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + secondaryGceZone_ = value; + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Compute Engine zone that the failover instance is currently serving
+     * from for a regional instance. This value could be different
+     * from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary/failover zone.
+     * 
+ * + * string secondary_gce_zone = 34; + * + * @return This builder for chaining. + */ + public Builder clearSecondaryGceZone() { + secondaryGceZone_ = getDefaultInstance().getSecondaryGceZone(); + bitField0_ = (bitField0_ & ~0x02000000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Compute Engine zone that the failover instance is currently serving
+     * from for a regional instance. This value could be different
+     * from the zone that was specified when the instance
+     * was created if the instance has failed over to its secondary/failover zone.
+     * 
+ * + * string secondary_gce_zone = 34; + * + * @param value The bytes for secondaryGceZone to set. + * @return This builder for chaining. + */ + public Builder setSecondaryGceZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + secondaryGceZone_ = value; + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration diskEncryptionConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration, + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.Builder, + com.google.cloud.sql.v1beta4.DiskEncryptionConfigurationOrBuilder> + diskEncryptionConfigurationBuilder_; + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + * + * @return Whether the diskEncryptionConfiguration field is set. + */ + public boolean hasDiskEncryptionConfiguration() { + return ((bitField0_ & 0x04000000) != 0); + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + * + * @return The diskEncryptionConfiguration. + */ + public com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration + getDiskEncryptionConfiguration() { + if (diskEncryptionConfigurationBuilder_ == null) { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } else { + return diskEncryptionConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + public Builder setDiskEncryptionConfiguration( + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration value) { + if (diskEncryptionConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + diskEncryptionConfiguration_ = value; + } else { + diskEncryptionConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + public Builder setDiskEncryptionConfiguration( + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.Builder builderForValue) { + if (diskEncryptionConfigurationBuilder_ == null) { + diskEncryptionConfiguration_ = builderForValue.build(); + } else { + diskEncryptionConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + public Builder mergeDiskEncryptionConfiguration( + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration value) { + if (diskEncryptionConfigurationBuilder_ == null) { + if (((bitField0_ & 0x04000000) != 0) + && diskEncryptionConfiguration_ != null + && diskEncryptionConfiguration_ + != com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.getDefaultInstance()) { + getDiskEncryptionConfigurationBuilder().mergeFrom(value); + } else { + diskEncryptionConfiguration_ = value; + } + } else { + diskEncryptionConfigurationBuilder_.mergeFrom(value); + } + if (diskEncryptionConfiguration_ != null) { + bitField0_ |= 0x04000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + public Builder clearDiskEncryptionConfiguration() { + bitField0_ = (bitField0_ & ~0x04000000); + diskEncryptionConfiguration_ = null; + if (diskEncryptionConfigurationBuilder_ != null) { + diskEncryptionConfigurationBuilder_.dispose(); + diskEncryptionConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + public com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.Builder + getDiskEncryptionConfigurationBuilder() { + bitField0_ |= 0x04000000; + onChanged(); + return internalGetDiskEncryptionConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + public com.google.cloud.sql.v1beta4.DiskEncryptionConfigurationOrBuilder + getDiskEncryptionConfigurationOrBuilder() { + if (diskEncryptionConfigurationBuilder_ != null) { + return diskEncryptionConfigurationBuilder_.getMessageOrBuilder(); + } else { + return diskEncryptionConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.getDefaultInstance() + : diskEncryptionConfiguration_; + } + } + + /** + * + * + *
+     * Disk encryption configuration specific to an instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration, + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.Builder, + com.google.cloud.sql.v1beta4.DiskEncryptionConfigurationOrBuilder> + internalGetDiskEncryptionConfigurationFieldBuilder() { + if (diskEncryptionConfigurationBuilder_ == null) { + diskEncryptionConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration, + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.Builder, + com.google.cloud.sql.v1beta4.DiskEncryptionConfigurationOrBuilder>( + getDiskEncryptionConfiguration(), getParentForChildren(), isClean()); + diskEncryptionConfiguration_ = null; + } + return diskEncryptionConfigurationBuilder_; + } + + private com.google.cloud.sql.v1beta4.DiskEncryptionStatus diskEncryptionStatus_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DiskEncryptionStatus, + com.google.cloud.sql.v1beta4.DiskEncryptionStatus.Builder, + com.google.cloud.sql.v1beta4.DiskEncryptionStatusOrBuilder> + diskEncryptionStatusBuilder_; + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + * + * @return Whether the diskEncryptionStatus field is set. + */ + public boolean hasDiskEncryptionStatus() { + return ((bitField0_ & 0x08000000) != 0); + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + * + * @return The diskEncryptionStatus. + */ + public com.google.cloud.sql.v1beta4.DiskEncryptionStatus getDiskEncryptionStatus() { + if (diskEncryptionStatusBuilder_ == null) { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } else { + return diskEncryptionStatusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + */ + public Builder setDiskEncryptionStatus( + com.google.cloud.sql.v1beta4.DiskEncryptionStatus value) { + if (diskEncryptionStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + diskEncryptionStatus_ = value; + } else { + diskEncryptionStatusBuilder_.setMessage(value); + } + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + */ + public Builder setDiskEncryptionStatus( + com.google.cloud.sql.v1beta4.DiskEncryptionStatus.Builder builderForValue) { + if (diskEncryptionStatusBuilder_ == null) { + diskEncryptionStatus_ = builderForValue.build(); + } else { + diskEncryptionStatusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + */ + public Builder mergeDiskEncryptionStatus( + com.google.cloud.sql.v1beta4.DiskEncryptionStatus value) { + if (diskEncryptionStatusBuilder_ == null) { + if (((bitField0_ & 0x08000000) != 0) + && diskEncryptionStatus_ != null + && diskEncryptionStatus_ + != com.google.cloud.sql.v1beta4.DiskEncryptionStatus.getDefaultInstance()) { + getDiskEncryptionStatusBuilder().mergeFrom(value); + } else { + diskEncryptionStatus_ = value; + } + } else { + diskEncryptionStatusBuilder_.mergeFrom(value); + } + if (diskEncryptionStatus_ != null) { + bitField0_ |= 0x08000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + */ + public Builder clearDiskEncryptionStatus() { + bitField0_ = (bitField0_ & ~0x08000000); + diskEncryptionStatus_ = null; + if (diskEncryptionStatusBuilder_ != null) { + diskEncryptionStatusBuilder_.dispose(); + diskEncryptionStatusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + */ + public com.google.cloud.sql.v1beta4.DiskEncryptionStatus.Builder + getDiskEncryptionStatusBuilder() { + bitField0_ |= 0x08000000; + onChanged(); + return internalGetDiskEncryptionStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + */ + public com.google.cloud.sql.v1beta4.DiskEncryptionStatusOrBuilder + getDiskEncryptionStatusOrBuilder() { + if (diskEncryptionStatusBuilder_ != null) { + return diskEncryptionStatusBuilder_.getMessageOrBuilder(); + } else { + return diskEncryptionStatus_ == null + ? com.google.cloud.sql.v1beta4.DiskEncryptionStatus.getDefaultInstance() + : diskEncryptionStatus_; + } + } + + /** + * + * + *
+     * Disk encryption status specific to an instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DiskEncryptionStatus, + com.google.cloud.sql.v1beta4.DiskEncryptionStatus.Builder, + com.google.cloud.sql.v1beta4.DiskEncryptionStatusOrBuilder> + internalGetDiskEncryptionStatusFieldBuilder() { + if (diskEncryptionStatusBuilder_ == null) { + diskEncryptionStatusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DiskEncryptionStatus, + com.google.cloud.sql.v1beta4.DiskEncryptionStatus.Builder, + com.google.cloud.sql.v1beta4.DiskEncryptionStatusOrBuilder>( + getDiskEncryptionStatus(), getParentForChildren(), isClean()); + diskEncryptionStatus_ = null; + } + return diskEncryptionStatusBuilder_; + } + + private java.lang.Object rootPassword_ = ""; + + /** + * + * + *
+     * Initial root password. Use only on creation. You must set root passwords
+     * before you can connect to PostgreSQL instances.
+     * 
+ * + * string root_password = 29; + * + * @return The rootPassword. + */ + public java.lang.String getRootPassword() { + java.lang.Object ref = rootPassword_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rootPassword_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Initial root password. Use only on creation. You must set root passwords
+     * before you can connect to PostgreSQL instances.
+     * 
+ * + * string root_password = 29; + * + * @return The bytes for rootPassword. + */ + public com.google.protobuf.ByteString getRootPasswordBytes() { + java.lang.Object ref = rootPassword_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rootPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Initial root password. Use only on creation. You must set root passwords
+     * before you can connect to PostgreSQL instances.
+     * 
+ * + * string root_password = 29; + * + * @param value The rootPassword to set. + * @return This builder for chaining. + */ + public Builder setRootPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + rootPassword_ = value; + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Initial root password. Use only on creation. You must set root passwords
+     * before you can connect to PostgreSQL instances.
+     * 
+ * + * string root_password = 29; + * + * @return This builder for chaining. + */ + public Builder clearRootPassword() { + rootPassword_ = getDefaultInstance().getRootPassword(); + bitField0_ = (bitField0_ & ~0x10000000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Initial root password. Use only on creation. You must set root passwords
+     * before you can connect to PostgreSQL instances.
+     * 
+ * + * string root_password = 29; + * + * @param value The bytes for rootPassword to set. + * @return This builder for chaining. + */ + public Builder setRootPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + rootPassword_ = value; + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + scheduledMaintenance_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenanceOrBuilder> + scheduledMaintenanceBuilder_; + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + * + * @return Whether the scheduledMaintenance field is set. + */ + public boolean hasScheduledMaintenance() { + return ((bitField0_ & 0x20000000) != 0); + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + * + * @return The scheduledMaintenance. + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + getScheduledMaintenance() { + if (scheduledMaintenanceBuilder_ == null) { + return scheduledMaintenance_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + .getDefaultInstance() + : scheduledMaintenance_; + } else { + return scheduledMaintenanceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + public Builder setScheduledMaintenance( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance value) { + if (scheduledMaintenanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scheduledMaintenance_ = value; + } else { + scheduledMaintenanceBuilder_.setMessage(value); + } + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + public Builder setScheduledMaintenance( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.Builder + builderForValue) { + if (scheduledMaintenanceBuilder_ == null) { + scheduledMaintenance_ = builderForValue.build(); + } else { + scheduledMaintenanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + public Builder mergeScheduledMaintenance( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance value) { + if (scheduledMaintenanceBuilder_ == null) { + if (((bitField0_ & 0x20000000) != 0) + && scheduledMaintenance_ != null + && scheduledMaintenance_ + != com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + .getDefaultInstance()) { + getScheduledMaintenanceBuilder().mergeFrom(value); + } else { + scheduledMaintenance_ = value; + } + } else { + scheduledMaintenanceBuilder_.mergeFrom(value); + } + if (scheduledMaintenance_ != null) { + bitField0_ |= 0x20000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + public Builder clearScheduledMaintenance() { + bitField0_ = (bitField0_ & ~0x20000000); + scheduledMaintenance_ = null; + if (scheduledMaintenanceBuilder_ != null) { + scheduledMaintenanceBuilder_.dispose(); + scheduledMaintenanceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.Builder + getScheduledMaintenanceBuilder() { + bitField0_ |= 0x20000000; + onChanged(); + return internalGetScheduledMaintenanceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenanceOrBuilder + getScheduledMaintenanceOrBuilder() { + if (scheduledMaintenanceBuilder_ != null) { + return scheduledMaintenanceBuilder_.getMessageOrBuilder(); + } else { + return scheduledMaintenance_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance + .getDefaultInstance() + : scheduledMaintenance_; + } + } + + /** + * + * + *
+     * The start time of any upcoming scheduled maintenance for this instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenanceOrBuilder> + internalGetScheduledMaintenanceFieldBuilder() { + if (scheduledMaintenanceBuilder_ == null) { + scheduledMaintenanceBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenanceOrBuilder>( + getScheduledMaintenance(), getParentForChildren(), isClean()); + scheduledMaintenance_ = null; + } + return scheduledMaintenanceBuilder_; + } + + private com.google.protobuf.BoolValue satisfiesPzs_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + satisfiesPzsBuilder_; + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + * + * @return Whether the satisfiesPzs field is set. + */ + public boolean hasSatisfiesPzs() { + return ((bitField0_ & 0x40000000) != 0); + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + * + * @return The satisfiesPzs. + */ + public com.google.protobuf.BoolValue getSatisfiesPzs() { + if (satisfiesPzsBuilder_ == null) { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } else { + return satisfiesPzsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + satisfiesPzs_ = value; + } else { + satisfiesPzsBuilder_.setMessage(value); + } + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue.Builder builderForValue) { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = builderForValue.build(); + } else { + satisfiesPzsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + public Builder mergeSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (((bitField0_ & 0x40000000) != 0) + && satisfiesPzs_ != null + && satisfiesPzs_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getSatisfiesPzsBuilder().mergeFrom(value); + } else { + satisfiesPzs_ = value; + } + } else { + satisfiesPzsBuilder_.mergeFrom(value); + } + if (satisfiesPzs_ != null) { + bitField0_ |= 0x40000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + public Builder clearSatisfiesPzs() { + bitField0_ = (bitField0_ & ~0x40000000); + satisfiesPzs_ = null; + if (satisfiesPzsBuilder_ != null) { + satisfiesPzsBuilder_.dispose(); + satisfiesPzsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + public com.google.protobuf.BoolValue.Builder getSatisfiesPzsBuilder() { + bitField0_ |= 0x40000000; + onChanged(); + return internalGetSatisfiesPzsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + if (satisfiesPzsBuilder_ != null) { + return satisfiesPzsBuilder_.getMessageOrBuilder(); + } else { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + } + + /** + * + * + *
+     * This status indicates whether the instance satisfies PZS.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetSatisfiesPzsFieldBuilder() { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSatisfiesPzs(), getParentForChildren(), isClean()); + satisfiesPzs_ = null; + } + return satisfiesPzsBuilder_; + } + + private java.lang.Object databaseInstalledVersion_ = ""; + + /** + * + * + *
+     * Output only. Stores the current database version running on the instance
+     * including minor version such as `MYSQL_8_0_18`.
+     * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseInstalledVersion. + */ + public java.lang.String getDatabaseInstalledVersion() { + java.lang.Object ref = databaseInstalledVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + databaseInstalledVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. Stores the current database version running on the instance
+     * including minor version such as `MYSQL_8_0_18`.
+     * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for databaseInstalledVersion. + */ + public com.google.protobuf.ByteString getDatabaseInstalledVersionBytes() { + java.lang.Object ref = databaseInstalledVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + databaseInstalledVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. Stores the current database version running on the instance
+     * including minor version such as `MYSQL_8_0_18`.
+     * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The databaseInstalledVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseInstalledVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + databaseInstalledVersion_ = value; + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Stores the current database version running on the instance
+     * including minor version such as `MYSQL_8_0_18`.
+     * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDatabaseInstalledVersion() { + databaseInstalledVersion_ = getDefaultInstance().getDatabaseInstalledVersion(); + bitField0_ = (bitField0_ & ~0x80000000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Stores the current database version running on the instance
+     * including minor version such as `MYSQL_8_0_18`.
+     * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for databaseInstalledVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseInstalledVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + databaseInstalledVersion_ = value; + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport outOfDiskReport_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReportOrBuilder> + outOfDiskReportBuilder_; + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + * + * @return Whether the outOfDiskReport field is set. + */ + public boolean hasOutOfDiskReport() { + return ((bitField1_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + * + * @return The outOfDiskReport. + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport getOutOfDiskReport() { + if (outOfDiskReportBuilder_ == null) { + return outOfDiskReport_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.getDefaultInstance() + : outOfDiskReport_; + } else { + return outOfDiskReportBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + public Builder setOutOfDiskReport( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport value) { + if (outOfDiskReportBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outOfDiskReport_ = value; + } else { + outOfDiskReportBuilder_.setMessage(value); + } + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + public Builder setOutOfDiskReport( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.Builder builderForValue) { + if (outOfDiskReportBuilder_ == null) { + outOfDiskReport_ = builderForValue.build(); + } else { + outOfDiskReportBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + public Builder mergeOutOfDiskReport( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport value) { + if (outOfDiskReportBuilder_ == null) { + if (((bitField1_ & 0x00000001) != 0) + && outOfDiskReport_ != null + && outOfDiskReport_ + != com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport + .getDefaultInstance()) { + getOutOfDiskReportBuilder().mergeFrom(value); + } else { + outOfDiskReport_ = value; + } + } else { + outOfDiskReportBuilder_.mergeFrom(value); + } + if (outOfDiskReport_ != null) { + bitField1_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + public Builder clearOutOfDiskReport() { + bitField1_ = (bitField1_ & ~0x00000001); + outOfDiskReport_ = null; + if (outOfDiskReportBuilder_ != null) { + outOfDiskReportBuilder_.dispose(); + outOfDiskReportBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.Builder + getOutOfDiskReportBuilder() { + bitField1_ |= 0x00000001; + onChanged(); + return internalGetOutOfDiskReportFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReportOrBuilder + getOutOfDiskReportOrBuilder() { + if (outOfDiskReportBuilder_ != null) { + return outOfDiskReportBuilder_.getMessageOrBuilder(); + } else { + return outOfDiskReport_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.getDefaultInstance() + : outOfDiskReport_; + } + } + + /** + * + * + *
+     * This field represents the report generated by the proactive database
+     * wellness job for OutOfDisk issues.
+     * *  Writers:
+     * *  the proactive database wellness job for OOD.
+     * *  Readers:
+     * *  the proactive database wellness job
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReportOrBuilder> + internalGetOutOfDiskReportFieldBuilder() { + if (outOfDiskReportBuilder_ == null) { + outOfDiskReportBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReportOrBuilder>( + getOutOfDiskReport(), getParentForChildren(), isClean()); + outOfDiskReport_ = null; + } + return outOfDiskReportBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField1_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.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); + } + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.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()); + } + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField1_ & 0x00000002) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField1_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField1_ = (bitField1_ & ~0x00000002); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField1_ |= 0x00000002; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * Output only. The time when the instance was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.LazyStringArrayList availableMaintenanceVersions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAvailableMaintenanceVersionsIsMutable() { + if (!availableMaintenanceVersions_.isModifiable()) { + availableMaintenanceVersions_ = + new com.google.protobuf.LazyStringArrayList(availableMaintenanceVersions_); + } + bitField1_ |= 0x00000004; + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the availableMaintenanceVersions. + */ + public com.google.protobuf.ProtocolStringList getAvailableMaintenanceVersionsList() { + availableMaintenanceVersions_.makeImmutable(); + return availableMaintenanceVersions_; + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of availableMaintenanceVersions. + */ + public int getAvailableMaintenanceVersionsCount() { + return availableMaintenanceVersions_.size(); + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The availableMaintenanceVersions at the given index. + */ + public java.lang.String getAvailableMaintenanceVersions(int index) { + return availableMaintenanceVersions_.get(index); + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the availableMaintenanceVersions at the given index. + */ + public com.google.protobuf.ByteString getAvailableMaintenanceVersionsBytes(int index) { + return availableMaintenanceVersions_.getByteString(index); + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The availableMaintenanceVersions to set. + * @return This builder for chaining. + */ + public Builder setAvailableMaintenanceVersions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAvailableMaintenanceVersionsIsMutable(); + availableMaintenanceVersions_.set(index, value); + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The availableMaintenanceVersions to add. + * @return This builder for chaining. + */ + public Builder addAvailableMaintenanceVersions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAvailableMaintenanceVersionsIsMutable(); + availableMaintenanceVersions_.add(value); + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The availableMaintenanceVersions to add. + * @return This builder for chaining. + */ + public Builder addAllAvailableMaintenanceVersions(java.lang.Iterable values) { + ensureAvailableMaintenanceVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, availableMaintenanceVersions_); + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearAvailableMaintenanceVersions() { + availableMaintenanceVersions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField1_ = (bitField1_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. List all maintenance versions applicable on the instance
+     * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes of the availableMaintenanceVersions to add. + * @return This builder for chaining. + */ + public Builder addAvailableMaintenanceVersionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAvailableMaintenanceVersionsIsMutable(); + availableMaintenanceVersions_.add(value); + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object maintenanceVersion_ = ""; + + /** + * + * + *
+     * The current software version on the instance.
+     * 
+ * + * string maintenance_version = 42; + * + * @return The maintenanceVersion. + */ + public java.lang.String getMaintenanceVersion() { + java.lang.Object ref = maintenanceVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + maintenanceVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The current software version on the instance.
+     * 
+ * + * string maintenance_version = 42; + * + * @return The bytes for maintenanceVersion. + */ + public com.google.protobuf.ByteString getMaintenanceVersionBytes() { + java.lang.Object ref = maintenanceVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + maintenanceVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The current software version on the instance.
+     * 
+ * + * string maintenance_version = 42; + * + * @param value The maintenanceVersion to set. + * @return This builder for chaining. + */ + public Builder setMaintenanceVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceVersion_ = value; + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The current software version on the instance.
+     * 
+ * + * string maintenance_version = 42; + * + * @return This builder for chaining. + */ + public Builder clearMaintenanceVersion() { + maintenanceVersion_ = getDefaultInstance().getMaintenanceVersion(); + bitField1_ = (bitField1_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The current software version on the instance.
+     * 
+ * + * string maintenance_version = 42; + * + * @param value The bytes for maintenanceVersion to set. + * @return This builder for chaining. + */ + public Builder setMaintenanceVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + maintenanceVersion_ = value; + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + + private java.util.List + upgradableDatabaseVersions_ = java.util.Collections.emptyList(); + + private void ensureUpgradableDatabaseVersionsIsMutable() { + if (!((bitField1_ & 0x00000010) != 0)) { + upgradableDatabaseVersions_ = + new java.util.ArrayList( + upgradableDatabaseVersions_); + bitField1_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion, + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.Builder, + com.google.cloud.sql.v1beta4.AvailableDatabaseVersionOrBuilder> + upgradableDatabaseVersionsBuilder_; + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getUpgradableDatabaseVersionsList() { + if (upgradableDatabaseVersionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(upgradableDatabaseVersions_); + } else { + return upgradableDatabaseVersionsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getUpgradableDatabaseVersionsCount() { + if (upgradableDatabaseVersionsBuilder_ == null) { + return upgradableDatabaseVersions_.size(); + } else { + return upgradableDatabaseVersionsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.AvailableDatabaseVersion getUpgradableDatabaseVersions( + int index) { + if (upgradableDatabaseVersionsBuilder_ == null) { + return upgradableDatabaseVersions_.get(index); + } else { + return upgradableDatabaseVersionsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpgradableDatabaseVersions( + int index, com.google.cloud.sql.v1beta4.AvailableDatabaseVersion value) { + if (upgradableDatabaseVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.set(index, value); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpgradableDatabaseVersions( + int index, com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.Builder builderForValue) { + if (upgradableDatabaseVersionsBuilder_ == null) { + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.set(index, builderForValue.build()); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpgradableDatabaseVersions( + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion value) { + if (upgradableDatabaseVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.add(value); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpgradableDatabaseVersions( + int index, com.google.cloud.sql.v1beta4.AvailableDatabaseVersion value) { + if (upgradableDatabaseVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.add(index, value); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpgradableDatabaseVersions( + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.Builder builderForValue) { + if (upgradableDatabaseVersionsBuilder_ == null) { + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.add(builderForValue.build()); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpgradableDatabaseVersions( + int index, com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.Builder builderForValue) { + if (upgradableDatabaseVersionsBuilder_ == null) { + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.add(index, builderForValue.build()); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllUpgradableDatabaseVersions( + java.lang.Iterable + values) { + if (upgradableDatabaseVersionsBuilder_ == null) { + ensureUpgradableDatabaseVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, upgradableDatabaseVersions_); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpgradableDatabaseVersions() { + if (upgradableDatabaseVersionsBuilder_ == null) { + upgradableDatabaseVersions_ = java.util.Collections.emptyList(); + bitField1_ = (bitField1_ & ~0x00000010); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeUpgradableDatabaseVersions(int index) { + if (upgradableDatabaseVersionsBuilder_ == null) { + ensureUpgradableDatabaseVersionsIsMutable(); + upgradableDatabaseVersions_.remove(index); + onChanged(); + } else { + upgradableDatabaseVersionsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.Builder + getUpgradableDatabaseVersionsBuilder(int index) { + return internalGetUpgradableDatabaseVersionsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.AvailableDatabaseVersionOrBuilder + getUpgradableDatabaseVersionsOrBuilder(int index) { + if (upgradableDatabaseVersionsBuilder_ == null) { + return upgradableDatabaseVersions_.get(index); + } else { + return upgradableDatabaseVersionsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getUpgradableDatabaseVersionsOrBuilderList() { + if (upgradableDatabaseVersionsBuilder_ != null) { + return upgradableDatabaseVersionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(upgradableDatabaseVersions_); + } + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.Builder + addUpgradableDatabaseVersionsBuilder() { + return internalGetUpgradableDatabaseVersionsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.Builder + addUpgradableDatabaseVersionsBuilder(int index) { + return internalGetUpgradableDatabaseVersionsFieldBuilder() + .addBuilder( + index, com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. All database versions that are available for upgrade.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getUpgradableDatabaseVersionsBuilderList() { + return internalGetUpgradableDatabaseVersionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion, + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.Builder, + com.google.cloud.sql.v1beta4.AvailableDatabaseVersionOrBuilder> + internalGetUpgradableDatabaseVersionsFieldBuilder() { + if (upgradableDatabaseVersionsBuilder_ == null) { + upgradableDatabaseVersionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion, + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion.Builder, + com.google.cloud.sql.v1beta4.AvailableDatabaseVersionOrBuilder>( + upgradableDatabaseVersions_, + ((bitField1_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + upgradableDatabaseVersions_ = null; + } + return upgradableDatabaseVersionsBuilder_; + } + + private int sqlNetworkArchitecture_ = 0; + + /** + * + * + *
+     * The SQL network architecture for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return Whether the sqlNetworkArchitecture field is set. + */ + @java.lang.Override + public boolean hasSqlNetworkArchitecture() { + return ((bitField1_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * The SQL network architecture for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return The enum numeric value on the wire for sqlNetworkArchitecture. + */ + @java.lang.Override + public int getSqlNetworkArchitectureValue() { + return sqlNetworkArchitecture_; + } + + /** + * + * + *
+     * The SQL network architecture for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @param value The enum numeric value on the wire for sqlNetworkArchitecture to set. + * @return This builder for chaining. + */ + public Builder setSqlNetworkArchitectureValue(int value) { + sqlNetworkArchitecture_ = value; + bitField1_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The SQL network architecture for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return The sqlNetworkArchitecture. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture + getSqlNetworkArchitecture() { + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture result = + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture.forNumber( + sqlNetworkArchitecture_); + return result == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The SQL network architecture for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @param value The sqlNetworkArchitecture to set. + * @return This builder for chaining. + */ + public Builder setSqlNetworkArchitecture( + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture value) { + if (value == null) { + throw new NullPointerException(); + } + bitField1_ |= 0x00000020; + sqlNetworkArchitecture_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The SQL network architecture for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return This builder for chaining. + */ + public Builder clearSqlNetworkArchitecture() { + bitField1_ = (bitField1_ & ~0x00000020); + sqlNetworkArchitecture_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pscServiceAttachmentLink_ = ""; + + /** + * + * + *
+     * Output only. The link to service attachment of PSC instance.
+     * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscServiceAttachmentLink field is set. + */ + public boolean hasPscServiceAttachmentLink() { + return ((bitField1_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Output only. The link to service attachment of PSC instance.
+     * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscServiceAttachmentLink. + */ + public java.lang.String getPscServiceAttachmentLink() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pscServiceAttachmentLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The link to service attachment of PSC instance.
+     * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for pscServiceAttachmentLink. + */ + public com.google.protobuf.ByteString getPscServiceAttachmentLinkBytes() { + java.lang.Object ref = pscServiceAttachmentLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pscServiceAttachmentLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The link to service attachment of PSC instance.
+     * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The pscServiceAttachmentLink to set. + * @return This builder for chaining. + */ + public Builder setPscServiceAttachmentLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pscServiceAttachmentLink_ = value; + bitField1_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The link to service attachment of PSC instance.
+     * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearPscServiceAttachmentLink() { + pscServiceAttachmentLink_ = getDefaultInstance().getPscServiceAttachmentLink(); + bitField1_ = (bitField1_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The link to service attachment of PSC instance.
+     * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for pscServiceAttachmentLink to set. + * @return This builder for chaining. + */ + public Builder setPscServiceAttachmentLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pscServiceAttachmentLink_ = value; + bitField1_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object dnsName_ = ""; + + /** + * + * + *
+     * Output only. The dns name of the instance.
+     * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + public boolean hasDnsName() { + return ((bitField1_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Output only. The dns name of the instance.
+     * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The dns name of the instance.
+     * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The dns name of the instance.
+     * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dnsName_ = value; + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The dns name of the instance.
+     * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDnsName() { + dnsName_ = getDefaultInstance().getDnsName(); + bitField1_ = (bitField1_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The dns name of the instance.
+     * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dnsName_ = value; + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object primaryDnsName_ = ""; + + /** + * + * + *
+     * Output only. DEPRECATED: please use write_endpoint instead.
+     * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=918 + * @return Whether the primaryDnsName field is set. + */ + @java.lang.Deprecated + public boolean hasPrimaryDnsName() { + return ((bitField1_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Output only. DEPRECATED: please use write_endpoint instead.
+     * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=918 + * @return The primaryDnsName. + */ + @java.lang.Deprecated + public java.lang.String getPrimaryDnsName() { + java.lang.Object ref = primaryDnsName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryDnsName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. DEPRECATED: please use write_endpoint instead.
+     * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=918 + * @return The bytes for primaryDnsName. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getPrimaryDnsNameBytes() { + java.lang.Object ref = primaryDnsName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryDnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. DEPRECATED: please use write_endpoint instead.
+     * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=918 + * @param value The primaryDnsName to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setPrimaryDnsName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + primaryDnsName_ = value; + bitField1_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. DEPRECATED: please use write_endpoint instead.
+     * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=918 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearPrimaryDnsName() { + primaryDnsName_ = getDefaultInstance().getPrimaryDnsName(); + bitField1_ = (bitField1_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. DEPRECATED: please use write_endpoint instead.
+     * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=918 + * @param value The bytes for primaryDnsName to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setPrimaryDnsNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + primaryDnsName_ = value; + bitField1_ |= 0x00000100; + onChanged(); + return this; + } + + private java.lang.Object writeEndpoint_ = ""; + + /** + * + * + *
+     * Output only. The dns name of the primary instance in a replication group.
+     * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writeEndpoint field is set. + */ + public boolean hasWriteEndpoint() { + return ((bitField1_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Output only. The dns name of the primary instance in a replication group.
+     * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writeEndpoint. + */ + public java.lang.String getWriteEndpoint() { + java.lang.Object ref = writeEndpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + writeEndpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The dns name of the primary instance in a replication group.
+     * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for writeEndpoint. + */ + public com.google.protobuf.ByteString getWriteEndpointBytes() { + java.lang.Object ref = writeEndpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + writeEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The dns name of the primary instance in a replication group.
+     * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The writeEndpoint to set. + * @return This builder for chaining. + */ + public Builder setWriteEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + writeEndpoint_ = value; + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The dns name of the primary instance in a replication group.
+     * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearWriteEndpoint() { + writeEndpoint_ = getDefaultInstance().getWriteEndpoint(); + bitField1_ = (bitField1_ & ~0x00000200); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The dns name of the primary instance in a replication group.
+     * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for writeEndpoint to set. + * @return This builder for chaining. + */ + public Builder setWriteEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + writeEndpoint_ = value; + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.ReplicationCluster replicationCluster_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ReplicationCluster, + com.google.cloud.sql.v1beta4.ReplicationCluster.Builder, + com.google.cloud.sql.v1beta4.ReplicationClusterOrBuilder> + replicationClusterBuilder_; + + /** + * + * + *
+     * A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + * + * @return Whether the replicationCluster field is set. + */ + public boolean hasReplicationCluster() { + return ((bitField1_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + * + * @return The replicationCluster. + */ + public com.google.cloud.sql.v1beta4.ReplicationCluster getReplicationCluster() { + if (replicationClusterBuilder_ == null) { + return replicationCluster_ == null + ? com.google.cloud.sql.v1beta4.ReplicationCluster.getDefaultInstance() + : replicationCluster_; + } else { + return replicationClusterBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + */ + public Builder setReplicationCluster(com.google.cloud.sql.v1beta4.ReplicationCluster value) { + if (replicationClusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replicationCluster_ = value; + } else { + replicationClusterBuilder_.setMessage(value); + } + bitField1_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + */ + public Builder setReplicationCluster( + com.google.cloud.sql.v1beta4.ReplicationCluster.Builder builderForValue) { + if (replicationClusterBuilder_ == null) { + replicationCluster_ = builderForValue.build(); + } else { + replicationClusterBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + */ + public Builder mergeReplicationCluster(com.google.cloud.sql.v1beta4.ReplicationCluster value) { + if (replicationClusterBuilder_ == null) { + if (((bitField1_ & 0x00000400) != 0) + && replicationCluster_ != null + && replicationCluster_ + != com.google.cloud.sql.v1beta4.ReplicationCluster.getDefaultInstance()) { + getReplicationClusterBuilder().mergeFrom(value); + } else { + replicationCluster_ = value; + } + } else { + replicationClusterBuilder_.mergeFrom(value); + } + if (replicationCluster_ != null) { + bitField1_ |= 0x00000400; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + */ + public Builder clearReplicationCluster() { + bitField1_ = (bitField1_ & ~0x00000400); + replicationCluster_ = null; + if (replicationClusterBuilder_ != null) { + replicationClusterBuilder_.dispose(); + replicationClusterBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + */ + public com.google.cloud.sql.v1beta4.ReplicationCluster.Builder getReplicationClusterBuilder() { + bitField1_ |= 0x00000400; + onChanged(); + return internalGetReplicationClusterFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + */ + public com.google.cloud.sql.v1beta4.ReplicationClusterOrBuilder + getReplicationClusterOrBuilder() { + if (replicationClusterBuilder_ != null) { + return replicationClusterBuilder_.getMessageOrBuilder(); + } else { + return replicationCluster_ == null + ? com.google.cloud.sql.v1beta4.ReplicationCluster.getDefaultInstance() + : replicationCluster_; + } + } + + /** + * + * + *
+     * A primary instance and disaster recovery (DR) replica pair.
+     * A DR replica is a cross-region replica that you designate
+     * for failover in the event that the primary instance
+     * experiences regional failure.
+     * Applicable to MySQL and PostgreSQL.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ReplicationCluster, + com.google.cloud.sql.v1beta4.ReplicationCluster.Builder, + com.google.cloud.sql.v1beta4.ReplicationClusterOrBuilder> + internalGetReplicationClusterFieldBuilder() { + if (replicationClusterBuilder_ == null) { + replicationClusterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ReplicationCluster, + com.google.cloud.sql.v1beta4.ReplicationCluster.Builder, + com.google.cloud.sql.v1beta4.ReplicationClusterOrBuilder>( + getReplicationCluster(), getParentForChildren(), isClean()); + replicationCluster_ = null; + } + return replicationClusterBuilder_; + } + + private com.google.cloud.sql.v1beta4.GeminiInstanceConfig geminiConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.GeminiInstanceConfig, + com.google.cloud.sql.v1beta4.GeminiInstanceConfig.Builder, + com.google.cloud.sql.v1beta4.GeminiInstanceConfigOrBuilder> + geminiConfigBuilder_; + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + * + * @return Whether the geminiConfig field is set. + */ + public boolean hasGeminiConfig() { + return ((bitField1_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + * + * @return The geminiConfig. + */ + public com.google.cloud.sql.v1beta4.GeminiInstanceConfig getGeminiConfig() { + if (geminiConfigBuilder_ == null) { + return geminiConfig_ == null + ? com.google.cloud.sql.v1beta4.GeminiInstanceConfig.getDefaultInstance() + : geminiConfig_; + } else { + return geminiConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + */ + public Builder setGeminiConfig(com.google.cloud.sql.v1beta4.GeminiInstanceConfig value) { + if (geminiConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + geminiConfig_ = value; + } else { + geminiConfigBuilder_.setMessage(value); + } + bitField1_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + */ + public Builder setGeminiConfig( + com.google.cloud.sql.v1beta4.GeminiInstanceConfig.Builder builderForValue) { + if (geminiConfigBuilder_ == null) { + geminiConfig_ = builderForValue.build(); + } else { + geminiConfigBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + */ + public Builder mergeGeminiConfig(com.google.cloud.sql.v1beta4.GeminiInstanceConfig value) { + if (geminiConfigBuilder_ == null) { + if (((bitField1_ & 0x00000800) != 0) + && geminiConfig_ != null + && geminiConfig_ + != com.google.cloud.sql.v1beta4.GeminiInstanceConfig.getDefaultInstance()) { + getGeminiConfigBuilder().mergeFrom(value); + } else { + geminiConfig_ = value; + } + } else { + geminiConfigBuilder_.mergeFrom(value); + } + if (geminiConfig_ != null) { + bitField1_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + */ + public Builder clearGeminiConfig() { + bitField1_ = (bitField1_ & ~0x00000800); + geminiConfig_ = null; + if (geminiConfigBuilder_ != null) { + geminiConfigBuilder_.dispose(); + geminiConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + */ + public com.google.cloud.sql.v1beta4.GeminiInstanceConfig.Builder getGeminiConfigBuilder() { + bitField1_ |= 0x00000800; + onChanged(); + return internalGetGeminiConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + */ + public com.google.cloud.sql.v1beta4.GeminiInstanceConfigOrBuilder getGeminiConfigOrBuilder() { + if (geminiConfigBuilder_ != null) { + return geminiConfigBuilder_.getMessageOrBuilder(); + } else { + return geminiConfig_ == null + ? com.google.cloud.sql.v1beta4.GeminiInstanceConfig.getDefaultInstance() + : geminiConfig_; + } + } + + /** + * + * + *
+     * Gemini instance configuration.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.GeminiInstanceConfig, + com.google.cloud.sql.v1beta4.GeminiInstanceConfig.Builder, + com.google.cloud.sql.v1beta4.GeminiInstanceConfigOrBuilder> + internalGetGeminiConfigFieldBuilder() { + if (geminiConfigBuilder_ == null) { + geminiConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.GeminiInstanceConfig, + com.google.cloud.sql.v1beta4.GeminiInstanceConfig.Builder, + com.google.cloud.sql.v1beta4.GeminiInstanceConfigOrBuilder>( + getGeminiConfig(), getParentForChildren(), isClean()); + geminiConfig_ = null; + } + return geminiConfigBuilder_; + } + + private com.google.protobuf.BoolValue satisfiesPzi_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + satisfiesPziBuilder_; + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzi field is set. + */ + public boolean hasSatisfiesPzi() { + return ((bitField1_ & 0x00001000) != 0); + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzi. + */ + public com.google.protobuf.BoolValue getSatisfiesPzi() { + if (satisfiesPziBuilder_ == null) { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } else { + return satisfiesPziBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzi(com.google.protobuf.BoolValue value) { + if (satisfiesPziBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + satisfiesPzi_ = value; + } else { + satisfiesPziBuilder_.setMessage(value); + } + bitField1_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzi(com.google.protobuf.BoolValue.Builder builderForValue) { + if (satisfiesPziBuilder_ == null) { + satisfiesPzi_ = builderForValue.build(); + } else { + satisfiesPziBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSatisfiesPzi(com.google.protobuf.BoolValue value) { + if (satisfiesPziBuilder_ == null) { + if (((bitField1_ & 0x00001000) != 0) + && satisfiesPzi_ != null + && satisfiesPzi_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getSatisfiesPziBuilder().mergeFrom(value); + } else { + satisfiesPzi_ = value; + } + } else { + satisfiesPziBuilder_.mergeFrom(value); + } + if (satisfiesPzi_ != null) { + bitField1_ |= 0x00001000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSatisfiesPzi() { + bitField1_ = (bitField1_ & ~0x00001000); + satisfiesPzi_ = null; + if (satisfiesPziBuilder_ != null) { + satisfiesPziBuilder_.dispose(); + satisfiesPziBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValue.Builder getSatisfiesPziBuilder() { + bitField1_ |= 0x00001000; + onChanged(); + return internalGetSatisfiesPziFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPziOrBuilder() { + if (satisfiesPziBuilder_ != null) { + return satisfiesPziBuilder_.getMessageOrBuilder(); + } else { + return satisfiesPzi_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzi_; + } + } + + /** + * + * + *
+     * Output only. This status indicates whether the instance satisfies PZI.
+     *
+     * The status is reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetSatisfiesPziFieldBuilder() { + if (satisfiesPziBuilder_ == null) { + satisfiesPziBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSatisfiesPzi(), getParentForChildren(), isClean()); + satisfiesPzi_ = null; + } + return satisfiesPziBuilder_; + } + + private com.google.protobuf.BoolValue switchTransactionLogsToCloudStorageEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + switchTransactionLogsToCloudStorageEnabledBuilder_; + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the switchTransactionLogsToCloudStorageEnabled field is set. + */ + public boolean hasSwitchTransactionLogsToCloudStorageEnabled() { + return ((bitField1_ & 0x00002000) != 0); + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The switchTransactionLogsToCloudStorageEnabled. + */ + public com.google.protobuf.BoolValue getSwitchTransactionLogsToCloudStorageEnabled() { + if (switchTransactionLogsToCloudStorageEnabledBuilder_ == null) { + return switchTransactionLogsToCloudStorageEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : switchTransactionLogsToCloudStorageEnabled_; + } else { + return switchTransactionLogsToCloudStorageEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setSwitchTransactionLogsToCloudStorageEnabled( + com.google.protobuf.BoolValue value) { + if (switchTransactionLogsToCloudStorageEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + switchTransactionLogsToCloudStorageEnabled_ = value; + } else { + switchTransactionLogsToCloudStorageEnabledBuilder_.setMessage(value); + } + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setSwitchTransactionLogsToCloudStorageEnabled( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (switchTransactionLogsToCloudStorageEnabledBuilder_ == null) { + switchTransactionLogsToCloudStorageEnabled_ = builderForValue.build(); + } else { + switchTransactionLogsToCloudStorageEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder mergeSwitchTransactionLogsToCloudStorageEnabled( + com.google.protobuf.BoolValue value) { + if (switchTransactionLogsToCloudStorageEnabledBuilder_ == null) { + if (((bitField1_ & 0x00002000) != 0) + && switchTransactionLogsToCloudStorageEnabled_ != null + && switchTransactionLogsToCloudStorageEnabled_ + != com.google.protobuf.BoolValue.getDefaultInstance()) { + getSwitchTransactionLogsToCloudStorageEnabledBuilder().mergeFrom(value); + } else { + switchTransactionLogsToCloudStorageEnabled_ = value; + } + } else { + switchTransactionLogsToCloudStorageEnabledBuilder_.mergeFrom(value); + } + if (switchTransactionLogsToCloudStorageEnabled_ != null) { + bitField1_ |= 0x00002000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder clearSwitchTransactionLogsToCloudStorageEnabled() { + bitField1_ = (bitField1_ & ~0x00002000); + switchTransactionLogsToCloudStorageEnabled_ = null; + if (switchTransactionLogsToCloudStorageEnabledBuilder_ != null) { + switchTransactionLogsToCloudStorageEnabledBuilder_.dispose(); + switchTransactionLogsToCloudStorageEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValue.Builder + getSwitchTransactionLogsToCloudStorageEnabledBuilder() { + bitField1_ |= 0x00002000; + onChanged(); + return internalGetSwitchTransactionLogsToCloudStorageEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValueOrBuilder + getSwitchTransactionLogsToCloudStorageEnabledOrBuilder() { + if (switchTransactionLogsToCloudStorageEnabledBuilder_ != null) { + return switchTransactionLogsToCloudStorageEnabledBuilder_.getMessageOrBuilder(); + } else { + return switchTransactionLogsToCloudStorageEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : switchTransactionLogsToCloudStorageEnabled_; + } + } + + /** + * + * + *
+     * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+     * recovery log files from a data disk to Cloud Storage.
+     * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetSwitchTransactionLogsToCloudStorageEnabledFieldBuilder() { + if (switchTransactionLogsToCloudStorageEnabledBuilder_ == null) { + switchTransactionLogsToCloudStorageEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSwitchTransactionLogsToCloudStorageEnabled(), getParentForChildren(), isClean()); + switchTransactionLogsToCloudStorageEnabled_ = null; + } + return switchTransactionLogsToCloudStorageEnabledBuilder_; + } + + private com.google.protobuf.BoolValue includeReplicasForMajorVersionUpgrade_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + includeReplicasForMajorVersionUpgradeBuilder_; + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the includeReplicasForMajorVersionUpgrade field is set. + */ + public boolean hasIncludeReplicasForMajorVersionUpgrade() { + return ((bitField1_ & 0x00004000) != 0); + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The includeReplicasForMajorVersionUpgrade. + */ + public com.google.protobuf.BoolValue getIncludeReplicasForMajorVersionUpgrade() { + if (includeReplicasForMajorVersionUpgradeBuilder_ == null) { + return includeReplicasForMajorVersionUpgrade_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : includeReplicasForMajorVersionUpgrade_; + } else { + return includeReplicasForMajorVersionUpgradeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setIncludeReplicasForMajorVersionUpgrade(com.google.protobuf.BoolValue value) { + if (includeReplicasForMajorVersionUpgradeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + includeReplicasForMajorVersionUpgrade_ = value; + } else { + includeReplicasForMajorVersionUpgradeBuilder_.setMessage(value); + } + bitField1_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setIncludeReplicasForMajorVersionUpgrade( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (includeReplicasForMajorVersionUpgradeBuilder_ == null) { + includeReplicasForMajorVersionUpgrade_ = builderForValue.build(); + } else { + includeReplicasForMajorVersionUpgradeBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder mergeIncludeReplicasForMajorVersionUpgrade(com.google.protobuf.BoolValue value) { + if (includeReplicasForMajorVersionUpgradeBuilder_ == null) { + if (((bitField1_ & 0x00004000) != 0) + && includeReplicasForMajorVersionUpgrade_ != null + && includeReplicasForMajorVersionUpgrade_ + != com.google.protobuf.BoolValue.getDefaultInstance()) { + getIncludeReplicasForMajorVersionUpgradeBuilder().mergeFrom(value); + } else { + includeReplicasForMajorVersionUpgrade_ = value; + } + } else { + includeReplicasForMajorVersionUpgradeBuilder_.mergeFrom(value); + } + if (includeReplicasForMajorVersionUpgrade_ != null) { + bitField1_ |= 0x00004000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder clearIncludeReplicasForMajorVersionUpgrade() { + bitField1_ = (bitField1_ & ~0x00004000); + includeReplicasForMajorVersionUpgrade_ = null; + if (includeReplicasForMajorVersionUpgradeBuilder_ != null) { + includeReplicasForMajorVersionUpgradeBuilder_.dispose(); + includeReplicasForMajorVersionUpgradeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValue.Builder getIncludeReplicasForMajorVersionUpgradeBuilder() { + bitField1_ |= 0x00004000; + onChanged(); + return internalGetIncludeReplicasForMajorVersionUpgradeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValueOrBuilder + getIncludeReplicasForMajorVersionUpgradeOrBuilder() { + if (includeReplicasForMajorVersionUpgradeBuilder_ != null) { + return includeReplicasForMajorVersionUpgradeBuilder_.getMessageOrBuilder(); + } else { + return includeReplicasForMajorVersionUpgrade_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : includeReplicasForMajorVersionUpgrade_; + } + } + + /** + * + * + *
+     * Input only. Determines whether an in-place major version upgrade of
+     * replicas happens when an in-place major version upgrade of a primary
+     * instance is initiated.
+     * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetIncludeReplicasForMajorVersionUpgradeFieldBuilder() { + if (includeReplicasForMajorVersionUpgradeBuilder_ == null) { + includeReplicasForMajorVersionUpgradeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getIncludeReplicasForMajorVersionUpgrade(), getParentForChildren(), isClean()); + includeReplicasForMajorVersionUpgrade_ = null; + } + return includeReplicasForMajorVersionUpgradeBuilder_; + } + + private com.google.protobuf.MapField tags_; + + private com.google.protobuf.MapField internalGetTags() { + if (tags_ == null) { + return com.google.protobuf.MapField.emptyMapField(TagsDefaultEntryHolder.defaultEntry); + } + return tags_; + } + + private com.google.protobuf.MapField + internalGetMutableTags() { + if (tags_ == null) { + tags_ = com.google.protobuf.MapField.newMapField(TagsDefaultEntryHolder.defaultEntry); + } + if (!tags_.isMutable()) { + tags_ = tags_.copy(); + } + bitField1_ |= 0x00008000; + onChanged(); + return tags_; + } + + public int getTagsCount() { + return internalGetTags().getMap().size(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+     * this instance. You must represent each item in the map as:
+     * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+     *
+     * For example, a single resource can have the following tags:
+     * ```
+     * "123/environment": "production",
+     * "123/costCenter": "marketing",
+     * ```
+     *
+     * For more information on tag creation and management, see
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+     * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTags().getMap().containsKey(key); + } + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTags() { + return getTagsMap(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+     * this instance. You must represent each item in the map as:
+     * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+     *
+     * For example, a single resource can have the following tags:
+     * ```
+     * "123/environment": "production",
+     * "123/costCenter": "marketing",
+     * ```
+     *
+     * For more information on tag creation and management, see
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+     * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getTagsMap() { + return internalGetTags().getMap(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+     * this instance. You must represent each item in the map as:
+     * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+     *
+     * For example, a single resource can have the following tags:
+     * ```
+     * "123/environment": "production",
+     * "123/costCenter": "marketing",
+     * ```
+     *
+     * For more information on tag creation and management, see
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+     * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+     * this instance. You must represent each item in the map as:
+     * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+     *
+     * For example, a single resource can have the following tags:
+     * ```
+     * "123/environment": "production",
+     * "123/costCenter": "marketing",
+     * ```
+     *
+     * For more information on tag creation and management, see
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+     * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getTagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearTags() { + bitField1_ = (bitField1_ & ~0x00008000); + internalGetMutableTags().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+     * this instance. You must represent each item in the map as:
+     * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+     *
+     * For example, a single resource can have the following tags:
+     * ```
+     * "123/environment": "production",
+     * "123/costCenter": "marketing",
+     * ```
+     *
+     * For more information on tag creation and management, see
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+     * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableTags().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableTags() { + bitField1_ |= 0x00008000; + return internalGetMutableTags().getMutableMap(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+     * this instance. You must represent each item in the map as:
+     * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+     *
+     * For example, a single resource can have the following tags:
+     * ```
+     * "123/environment": "production",
+     * "123/costCenter": "marketing",
+     * ```
+     *
+     * For more information on tag creation and management, see
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+     * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putTags(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableTags().getMutableMap().put(key, value); + bitField1_ |= 0x00008000; + return this; + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+     * this instance. You must represent each item in the map as:
+     * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+     *
+     * For example, a single resource can have the following tags:
+     * ```
+     * "123/environment": "production",
+     * "123/costCenter": "marketing",
+     * ```
+     *
+     * For more information on tag creation and management, see
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+     * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllTags(java.util.Map values) { + internalGetMutableTags().getMutableMap().putAll(values); + bitField1_ |= 0x00008000; + return this; + } + + private int nodeCount_; + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @return Whether the nodeCount field is set. + */ + @java.lang.Override + public boolean hasNodeCount() { + return ((bitField1_ & 0x00010000) != 0); + } + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @param value The nodeCount to set. + * @return This builder for chaining. + */ + public Builder setNodeCount(int value) { + + nodeCount_ = value; + bitField1_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of read pool nodes in a read pool.
+     * 
+ * + * optional int32 node_count = 63; + * + * @return This builder for chaining. + */ + public Builder clearNodeCount() { + bitField1_ = (bitField1_ & ~0x00010000); + nodeCount_ = 0; + onChanged(); + return this; + } + + private java.util.List nodes_ = + java.util.Collections.emptyList(); + + private void ensureNodesIsMutable() { + if (!((bitField1_ & 0x00020000) != 0)) { + nodes_ = + new java.util.ArrayList( + nodes_); + bitField1_ |= 0x00020000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig, + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfigOrBuilder> + nodesBuilder_; + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNodesList() { + if (nodesBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodes_); + } else { + return nodesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getNodesCount() { + if (nodesBuilder_ == null) { + return nodes_.size(); + } else { + return nodesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig getNodes(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodes( + int index, com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.set(index, value); + onChanged(); + } else { + nodesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodes( + int index, + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.set(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes(com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(value); + onChanged(); + } else { + nodesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + int index, com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(index, value); + onChanged(); + } else { + nodesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNodes( + int index, + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllNodes( + java.lang.Iterable + values) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, nodes_); + onChanged(); + } else { + nodesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearNodes() { + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + bitField1_ = (bitField1_ & ~0x00020000); + onChanged(); + } else { + nodesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeNodes(int index) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.remove(index); + onChanged(); + } else { + nodesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.Builder getNodesBuilder( + int index) { + return internalGetNodesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfigOrBuilder getNodesOrBuilder( + int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + ? extends com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfigOrBuilder> + getNodesOrBuilderList() { + if (nodesBuilder_ != null) { + return nodesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodes_); + } + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.Builder addNodesBuilder() { + return internalGetNodesFieldBuilder() + .addBuilder( + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.Builder addNodesBuilder( + int index) { + return internalGetNodesFieldBuilder() + .addBuilder( + index, + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Entries containing information about each read pool node of
+     * the read pool.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNodesBuilderList() { + return internalGetNodesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig, + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfigOrBuilder> + internalGetNodesFieldBuilder() { + if (nodesBuilder_ == null) { + nodesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig, + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfigOrBuilder>( + nodes_, ((bitField1_ & 0x00020000) != 0), getParentForChildren(), isClean()); + nodes_ = null; + } + return nodesBuilder_; + } + + private java.util.List dnsNames_ = + java.util.Collections.emptyList(); + + private void ensureDnsNamesIsMutable() { + if (!((bitField1_ & 0x00040000) != 0)) { + dnsNames_ = new java.util.ArrayList(dnsNames_); + bitField1_ |= 0x00040000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DnsNameMapping, + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder, + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder> + dnsNamesBuilder_; + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getDnsNamesList() { + if (dnsNamesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dnsNames_); + } else { + return dnsNamesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getDnsNamesCount() { + if (dnsNamesBuilder_ == null) { + return dnsNames_.size(); + } else { + return dnsNamesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping getDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames(int index, com.google.cloud.sql.v1beta4.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.set(index, value); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDnsNames( + int index, com.google.cloud.sql.v1beta4.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.set(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(com.google.cloud.sql.v1beta4.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames(int index, com.google.cloud.sql.v1beta4.DnsNameMapping value) { + if (dnsNamesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsNamesIsMutable(); + dnsNames_.add(index, value); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames( + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDnsNames( + int index, com.google.cloud.sql.v1beta4.DnsNameMapping.Builder builderForValue) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.add(index, builderForValue.build()); + onChanged(); + } else { + dnsNamesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllDnsNames( + java.lang.Iterable values) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dnsNames_); + onChanged(); + } else { + dnsNamesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDnsNames() { + if (dnsNamesBuilder_ == null) { + dnsNames_ = java.util.Collections.emptyList(); + bitField1_ = (bitField1_ & ~0x00040000); + onChanged(); + } else { + dnsNamesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeDnsNames(int index) { + if (dnsNamesBuilder_ == null) { + ensureDnsNamesIsMutable(); + dnsNames_.remove(index); + onChanged(); + } else { + dnsNamesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping.Builder getDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index) { + if (dnsNamesBuilder_ == null) { + return dnsNames_.get(index); + } else { + return dnsNamesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDnsNamesOrBuilderList() { + if (dnsNamesBuilder_ != null) { + return dnsNamesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dnsNames_); + } + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping.Builder addDnsNamesBuilder() { + return internalGetDnsNamesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.DnsNameMapping.Builder addDnsNamesBuilder(int index) { + return internalGetDnsNamesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.DnsNameMapping.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The list of DNS names used by this instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDnsNamesBuilderList() { + return internalGetDnsNamesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DnsNameMapping, + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder, + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder> + internalGetDnsNamesFieldBuilder() { + if (dnsNamesBuilder_ == null) { + dnsNamesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DnsNameMapping, + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder, + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder>( + dnsNames_, ((bitField1_ & 0x00040000) != 0), getParentForChildren(), isClean()); + dnsNames_ = null; + } + return dnsNamesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DatabaseInstance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DatabaseInstance) + private static final com.google.cloud.sql.v1beta4.DatabaseInstance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DatabaseInstance(); + } + + public static com.google.cloud.sql.v1beta4.DatabaseInstance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DatabaseInstance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseInstanceOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseInstanceOrBuilder.java new file mode 100644 index 000000000000..1b02355483ac --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseInstanceOrBuilder.java @@ -0,0 +1,2198 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DatabaseInstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DatabaseInstance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#instance`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#instance`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The current serving state of the Cloud SQL instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 2; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+   * The current serving state of the Cloud SQL instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState state = 2; + * + * @return The state. + */ + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState getState(); + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion` field cannot
+   * be changed after instance creation.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 3; + * + * @return The enum numeric value on the wire for databaseVersion. + */ + int getDatabaseVersionValue(); + + /** + * + * + *
+   * The database engine type and version. The `databaseVersion` field cannot
+   * be changed after instance creation.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion database_version = 3; + * + * @return The databaseVersion. + */ + com.google.cloud.sql.v1beta4.SqlDatabaseVersion getDatabaseVersion(); + + /** + * + * + *
+   * The user settings.
+   * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + * + * @return Whether the settings field is set. + */ + boolean hasSettings(); + + /** + * + * + *
+   * The user settings.
+   * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + * + * @return The settings. + */ + com.google.cloud.sql.v1beta4.Settings getSettings(); + + /** + * + * + *
+   * The user settings.
+   * 
+ * + * .google.cloud.sql.v1beta4.Settings settings = 4; + */ + com.google.cloud.sql.v1beta4.SettingsOrBuilder getSettingsOrBuilder(); + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API. Use the `settings.settingsVersion` field instead.
+   * 
+ * + * string etag = 5; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API. Use the `settings.settingsVersion` field instead.
+   * 
+ * + * string etag = 5; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * The name and status of the failover replica.
+   * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + * + * @return Whether the failoverReplica field is set. + */ + boolean hasFailoverReplica(); + + /** + * + * + *
+   * The name and status of the failover replica.
+   * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + * + * @return The failoverReplica. + */ + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica getFailoverReplica(); + + /** + * + * + *
+   * The name and status of the failover replica.
+   * 
+ * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica failover_replica = 6; + * + */ + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplicaOrBuilder + getFailoverReplicaOrBuilder(); + + /** + * + * + *
+   * The name of the instance which will act as primary in the replication
+   * setup.
+   * 
+ * + * string master_instance_name = 7; + * + * @return The masterInstanceName. + */ + java.lang.String getMasterInstanceName(); + + /** + * + * + *
+   * The name of the instance which will act as primary in the replication
+   * setup.
+   * 
+ * + * string master_instance_name = 7; + * + * @return The bytes for masterInstanceName. + */ + com.google.protobuf.ByteString getMasterInstanceNameBytes(); + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @return A list containing the replicaNames. + */ + java.util.List getReplicaNamesList(); + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @return The count of replicaNames. + */ + int getReplicaNamesCount(); + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @param index The index of the element to return. + * @return The replicaNames at the given index. + */ + java.lang.String getReplicaNames(int index); + + /** + * + * + *
+   * The replicas of the instance.
+   * 
+ * + * repeated string replica_names = 8; + * + * @param index The index of the value to return. + * @return The bytes of the replicaNames at the given index. + */ + com.google.protobuf.ByteString getReplicaNamesBytes(int index); + + /** + * + * + *
+   * The maximum disk size of the instance in bytes.
+   * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.max_disk_size is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=779 + * @return Whether the maxDiskSize field is set. + */ + @java.lang.Deprecated + boolean hasMaxDiskSize(); + + /** + * + * + *
+   * The maximum disk size of the instance in bytes.
+   * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.max_disk_size is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=779 + * @return The maxDiskSize. + */ + @java.lang.Deprecated + com.google.protobuf.Int64Value getMaxDiskSize(); + + /** + * + * + *
+   * The maximum disk size of the instance in bytes.
+   * 
+ * + * .google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + */ + @java.lang.Deprecated + com.google.protobuf.Int64ValueOrBuilder getMaxDiskSizeOrBuilder(); + + /** + * + * + *
+   * The current disk usage of the instance in bytes. This property has been
+   * deprecated. Use the
+   * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+   * Monitoring API instead. Please see [this
+   * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+   * for details.
+   * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.current_disk_size is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=787 + * @return Whether the currentDiskSize field is set. + */ + @java.lang.Deprecated + boolean hasCurrentDiskSize(); + + /** + * + * + *
+   * The current disk usage of the instance in bytes. This property has been
+   * deprecated. Use the
+   * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+   * Monitoring API instead. Please see [this
+   * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+   * for details.
+   * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.current_disk_size is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=787 + * @return The currentDiskSize. + */ + @java.lang.Deprecated + com.google.protobuf.Int64Value getCurrentDiskSize(); + + /** + * + * + *
+   * The current disk usage of the instance in bytes. This property has been
+   * deprecated. Use the
+   * "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
+   * Monitoring API instead. Please see [this
+   * announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
+   * for details.
+   * 
+ * + * .google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + */ + @java.lang.Deprecated + com.google.protobuf.Int64ValueOrBuilder getCurrentDiskSizeOrBuilder(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + java.util.List getIpAddressesList(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + com.google.cloud.sql.v1beta4.IpMapping getIpAddresses(int index); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + int getIpAddressesCount(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + java.util.List + getIpAddressesOrBuilderList(); + + /** + * + * + *
+   * The assigned IP addresses for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.IpMapping ip_addresses = 11; + */ + com.google.cloud.sql.v1beta4.IpMappingOrBuilder getIpAddressesOrBuilder(int index); + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + * + * @return Whether the serverCaCert field is set. + */ + boolean hasServerCaCert(); + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + * + * @return The serverCaCert. + */ + com.google.cloud.sql.v1beta4.SslCert getServerCaCert(); + + /** + * + * + *
+   * SSL configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 12; + */ + com.google.cloud.sql.v1beta4.SslCertOrBuilder getServerCaCertOrBuilder(); + + /** + * + * + *
+   * The instance type.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlInstanceType instance_type = 13; + * + * @return The enum numeric value on the wire for instanceType. + */ + int getInstanceTypeValue(); + + /** + * + * + *
+   * The instance type.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlInstanceType instance_type = 13; + * + * @return The instanceType. + */ + com.google.cloud.sql.v1beta4.SqlInstanceType getInstanceType(); + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL instance. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 14; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL instance. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 14; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * The IPv6 address assigned to the instance.
+   * (Deprecated) This property was applicable only
+   * to First Generation instances.
+   * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=805 + * @return The ipv6Address. + */ + @java.lang.Deprecated + java.lang.String getIpv6Address(); + + /** + * + * + *
+   * The IPv6 address assigned to the instance.
+   * (Deprecated) This property was applicable only
+   * to First Generation instances.
+   * 
+ * + * string ipv6_address = 15 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.ipv6_address is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=805 + * @return The bytes for ipv6Address. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getIpv6AddressBytes(); + + /** + * + * + *
+   * The service account email address assigned to the instance. \This
+   * property is read-only.
+   * 
+ * + * string service_account_email_address = 16; + * + * @return The serviceAccountEmailAddress. + */ + java.lang.String getServiceAccountEmailAddress(); + + /** + * + * + *
+   * The service account email address assigned to the instance. \This
+   * property is read-only.
+   * 
+ * + * string service_account_email_address = 16; + * + * @return The bytes for serviceAccountEmailAddress. + */ + com.google.protobuf.ByteString getServiceAccountEmailAddressBytes(); + + /** + * + * + *
+   * Configuration specific to on-premises instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + * + * @return Whether the onPremisesConfiguration field is set. + */ + boolean hasOnPremisesConfiguration(); + + /** + * + * + *
+   * Configuration specific to on-premises instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + * + * @return The onPremisesConfiguration. + */ + com.google.cloud.sql.v1beta4.OnPremisesConfiguration getOnPremisesConfiguration(); + + /** + * + * + *
+   * Configuration specific to on-premises instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration on_premises_configuration = 17; + */ + com.google.cloud.sql.v1beta4.OnPremisesConfigurationOrBuilder + getOnPremisesConfigurationOrBuilder(); + + /** + * + * + *
+   * Configuration specific to failover replicas and read replicas.
+   * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + * + * @return Whether the replicaConfiguration field is set. + */ + boolean hasReplicaConfiguration(); + + /** + * + * + *
+   * Configuration specific to failover replicas and read replicas.
+   * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + * + * @return The replicaConfiguration. + */ + com.google.cloud.sql.v1beta4.ReplicaConfiguration getReplicaConfiguration(); + + /** + * + * + *
+   * Configuration specific to failover replicas and read replicas.
+   * 
+ * + * .google.cloud.sql.v1beta4.ReplicaConfiguration replica_configuration = 18; + */ + com.google.cloud.sql.v1beta4.ReplicaConfigurationOrBuilder getReplicaConfigurationOrBuilder(); + + /** + * + * + *
+   * The backend type.
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   *
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 19; + * + * @return The enum numeric value on the wire for backendType. + */ + int getBackendTypeValue(); + + /** + * + * + *
+   * The backend type.
+   * `SECOND_GEN`: Cloud SQL database instance.
+   * `EXTERNAL`: A database server that is not managed by Google.
+   *
+   * This property is read-only; use the `tier` property in the `settings`
+   * object to determine the database type.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlBackendType backend_type = 19; + * + * @return The backendType. + */ + com.google.cloud.sql.v1beta4.SqlBackendType getBackendType(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 20; + * + * @return The selfLink. + */ + java.lang.String getSelfLink(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 20; + * + * @return The bytes for selfLink. + */ + com.google.protobuf.ByteString getSelfLinkBytes(); + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @return A list containing the suspensionReason. + */ + java.util.List getSuspensionReasonList(); + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @return The count of suspensionReason. + */ + int getSuspensionReasonCount(); + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index of the element to return. + * @return The suspensionReason at the given index. + */ + com.google.cloud.sql.v1beta4.SqlSuspensionReason getSuspensionReason(int index); + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @return A list containing the enum numeric values on the wire for suspensionReason. + */ + java.util.List getSuspensionReasonValueList(); + + /** + * + * + *
+   * If the instance state is SUSPENDED, the reason for the suspension.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlSuspensionReason suspension_reason = 21; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of suspensionReason at the given index. + */ + int getSuspensionReasonValue(int index); + + /** + * + * + *
+   * Connection name of the Cloud SQL instance used in connection strings.
+   * 
+ * + * string connection_name = 22; + * + * @return The connectionName. + */ + java.lang.String getConnectionName(); + + /** + * + * + *
+   * Connection name of the Cloud SQL instance used in connection strings.
+   * 
+ * + * string connection_name = 22; + * + * @return The bytes for connectionName. + */ + com.google.protobuf.ByteString getConnectionNameBytes(); + + /** + * + * + *
+   * Name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string name = 23; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string name = 23; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The geographical region of the Cloud SQL instance.
+   *
+   * It can be one of the
+   * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+   * where Cloud SQL operates:
+   *
+   * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+   * The default value is `us-central1`.
+   * 
+ * + * string region = 24; + * + * @return The region. + */ + java.lang.String getRegion(); + + /** + * + * + *
+   * The geographical region of the Cloud SQL instance.
+   *
+   * It can be one of the
+   * [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
+   * where Cloud SQL operates:
+   *
+   * For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
+   * The default value is `us-central1`.
+   * 
+ * + * string region = 24; + * + * @return The bytes for region. + */ + com.google.protobuf.ByteString getRegionBytes(); + + /** + * + * + *
+   * The Compute Engine zone that the instance is currently serving from. This
+   * value could be different from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary zone. WARNING:
+   * Changing this might restart the instance.
+   * 
+ * + * string gce_zone = 25; + * + * @return The gceZone. + */ + java.lang.String getGceZone(); + + /** + * + * + *
+   * The Compute Engine zone that the instance is currently serving from. This
+   * value could be different from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary zone. WARNING:
+   * Changing this might restart the instance.
+   * 
+ * + * string gce_zone = 25; + * + * @return The bytes for gceZone. + */ + com.google.protobuf.ByteString getGceZoneBytes(); + + /** + * + * + *
+   * The Compute Engine zone that the failover instance is currently serving
+   * from for a regional instance. This value could be different
+   * from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary/failover zone.
+   * 
+ * + * string secondary_gce_zone = 34; + * + * @return The secondaryGceZone. + */ + java.lang.String getSecondaryGceZone(); + + /** + * + * + *
+   * The Compute Engine zone that the failover instance is currently serving
+   * from for a regional instance. This value could be different
+   * from the zone that was specified when the instance
+   * was created if the instance has failed over to its secondary/failover zone.
+   * 
+ * + * string secondary_gce_zone = 34; + * + * @return The bytes for secondaryGceZone. + */ + com.google.protobuf.ByteString getSecondaryGceZoneBytes(); + + /** + * + * + *
+   * Disk encryption configuration specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + * + * @return Whether the diskEncryptionConfiguration field is set. + */ + boolean hasDiskEncryptionConfiguration(); + + /** + * + * + *
+   * Disk encryption configuration specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + * + * @return The diskEncryptionConfiguration. + */ + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration getDiskEncryptionConfiguration(); + + /** + * + * + *
+   * Disk encryption configuration specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionConfiguration disk_encryption_configuration = 26; + * + */ + com.google.cloud.sql.v1beta4.DiskEncryptionConfigurationOrBuilder + getDiskEncryptionConfigurationOrBuilder(); + + /** + * + * + *
+   * Disk encryption status specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + * + * @return Whether the diskEncryptionStatus field is set. + */ + boolean hasDiskEncryptionStatus(); + + /** + * + * + *
+   * Disk encryption status specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + * + * @return The diskEncryptionStatus. + */ + com.google.cloud.sql.v1beta4.DiskEncryptionStatus getDiskEncryptionStatus(); + + /** + * + * + *
+   * Disk encryption status specific to an instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DiskEncryptionStatus disk_encryption_status = 27; + */ + com.google.cloud.sql.v1beta4.DiskEncryptionStatusOrBuilder getDiskEncryptionStatusOrBuilder(); + + /** + * + * + *
+   * Initial root password. Use only on creation. You must set root passwords
+   * before you can connect to PostgreSQL instances.
+   * 
+ * + * string root_password = 29; + * + * @return The rootPassword. + */ + java.lang.String getRootPassword(); + + /** + * + * + *
+   * Initial root password. Use only on creation. You must set root passwords
+   * before you can connect to PostgreSQL instances.
+   * 
+ * + * string root_password = 29; + * + * @return The bytes for rootPassword. + */ + com.google.protobuf.ByteString getRootPasswordBytes(); + + /** + * + * + *
+   * The start time of any upcoming scheduled maintenance for this instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + * + * @return Whether the scheduledMaintenance field is set. + */ + boolean hasScheduledMaintenance(); + + /** + * + * + *
+   * The start time of any upcoming scheduled maintenance for this instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + * + * @return The scheduledMaintenance. + */ + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance getScheduledMaintenance(); + + /** + * + * + *
+   * The start time of any upcoming scheduled maintenance for this instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance scheduled_maintenance = 30; + * + */ + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenanceOrBuilder + getScheduledMaintenanceOrBuilder(); + + /** + * + * + *
+   * This status indicates whether the instance satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + * + * @return Whether the satisfiesPzs field is set. + */ + boolean hasSatisfiesPzs(); + + /** + * + * + *
+   * This status indicates whether the instance satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + * + * @return The satisfiesPzs. + */ + com.google.protobuf.BoolValue getSatisfiesPzs(); + + /** + * + * + *
+   * This status indicates whether the instance satisfies PZS.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * .google.protobuf.BoolValue satisfies_pzs = 35; + */ + com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder(); + + /** + * + * + *
+   * Output only. Stores the current database version running on the instance
+   * including minor version such as `MYSQL_8_0_18`.
+   * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The databaseInstalledVersion. + */ + java.lang.String getDatabaseInstalledVersion(); + + /** + * + * + *
+   * Output only. Stores the current database version running on the instance
+   * including minor version such as `MYSQL_8_0_18`.
+   * 
+ * + * string database_installed_version = 40 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for databaseInstalledVersion. + */ + com.google.protobuf.ByteString getDatabaseInstalledVersionBytes(); + + /** + * + * + *
+   * This field represents the report generated by the proactive database
+   * wellness job for OutOfDisk issues.
+   * *  Writers:
+   * *  the proactive database wellness job for OOD.
+   * *  Readers:
+   * *  the proactive database wellness job
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + * + * @return Whether the outOfDiskReport field is set. + */ + boolean hasOutOfDiskReport(); + + /** + * + * + *
+   * This field represents the report generated by the proactive database
+   * wellness job for OutOfDisk issues.
+   * *  Writers:
+   * *  the proactive database wellness job for OOD.
+   * *  Readers:
+   * *  the proactive database wellness job
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + * + * @return The outOfDiskReport. + */ + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport getOutOfDiskReport(); + + /** + * + * + *
+   * This field represents the report generated by the proactive database
+   * wellness job for OutOfDisk issues.
+   * *  Writers:
+   * *  the proactive database wellness job for OOD.
+   * *  Readers:
+   * *  the proactive database wellness job
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport out_of_disk_report = 38; + * + */ + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReportOrBuilder + getOutOfDiskReportOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the instance was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * Output only. The time when the instance was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * Output only. The time when the instance was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the availableMaintenanceVersions. + */ + java.util.List getAvailableMaintenanceVersionsList(); + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of availableMaintenanceVersions. + */ + int getAvailableMaintenanceVersionsCount(); + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The availableMaintenanceVersions at the given index. + */ + java.lang.String getAvailableMaintenanceVersions(int index); + + /** + * + * + *
+   * Output only. List all maintenance versions applicable on the instance
+   * 
+ * + * + * repeated string available_maintenance_versions = 41 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the availableMaintenanceVersions at the given index. + */ + com.google.protobuf.ByteString getAvailableMaintenanceVersionsBytes(int index); + + /** + * + * + *
+   * The current software version on the instance.
+   * 
+ * + * string maintenance_version = 42; + * + * @return The maintenanceVersion. + */ + java.lang.String getMaintenanceVersion(); + + /** + * + * + *
+   * The current software version on the instance.
+   * 
+ * + * string maintenance_version = 42; + * + * @return The bytes for maintenanceVersion. + */ + com.google.protobuf.ByteString getMaintenanceVersionBytes(); + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getUpgradableDatabaseVersionsList(); + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.AvailableDatabaseVersion getUpgradableDatabaseVersions(int index); + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getUpgradableDatabaseVersionsCount(); + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getUpgradableDatabaseVersionsOrBuilderList(); + + /** + * + * + *
+   * Output only. All database versions that are available for upgrade.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.AvailableDatabaseVersion upgradable_database_versions = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.AvailableDatabaseVersionOrBuilder + getUpgradableDatabaseVersionsOrBuilder(int index); + + /** + * + * + *
+   * The SQL network architecture for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return Whether the sqlNetworkArchitecture field is set. + */ + boolean hasSqlNetworkArchitecture(); + + /** + * + * + *
+   * The SQL network architecture for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return The enum numeric value on the wire for sqlNetworkArchitecture. + */ + int getSqlNetworkArchitectureValue(); + + /** + * + * + *
+   * The SQL network architecture for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture sql_network_architecture = 47; + * + * + * @return The sqlNetworkArchitecture. + */ + com.google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture getSqlNetworkArchitecture(); + + /** + * + * + *
+   * Output only. The link to service attachment of PSC instance.
+   * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscServiceAttachmentLink field is set. + */ + boolean hasPscServiceAttachmentLink(); + + /** + * + * + *
+   * Output only. The link to service attachment of PSC instance.
+   * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscServiceAttachmentLink. + */ + java.lang.String getPscServiceAttachmentLink(); + + /** + * + * + *
+   * Output only. The link to service attachment of PSC instance.
+   * 
+ * + * + * optional string psc_service_attachment_link = 48 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for pscServiceAttachmentLink. + */ + com.google.protobuf.ByteString getPscServiceAttachmentLinkBytes(); + + /** + * + * + *
+   * Output only. The dns name of the instance.
+   * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the dnsName field is set. + */ + boolean hasDnsName(); + + /** + * + * + *
+   * Output only. The dns name of the instance.
+   * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dnsName. + */ + java.lang.String getDnsName(); + + /** + * + * + *
+   * Output only. The dns name of the instance.
+   * 
+ * + * optional string dns_name = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dnsName. + */ + com.google.protobuf.ByteString getDnsNameBytes(); + + /** + * + * + *
+   * Output only. DEPRECATED: please use write_endpoint instead.
+   * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=918 + * @return Whether the primaryDnsName field is set. + */ + @java.lang.Deprecated + boolean hasPrimaryDnsName(); + + /** + * + * + *
+   * Output only. DEPRECATED: please use write_endpoint instead.
+   * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=918 + * @return The primaryDnsName. + */ + @java.lang.Deprecated + java.lang.String getPrimaryDnsName(); + + /** + * + * + *
+   * Output only. DEPRECATED: please use write_endpoint instead.
+   * 
+ * + * + * optional string primary_dns_name = 51 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @deprecated google.cloud.sql.v1beta4.DatabaseInstance.primary_dns_name is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=918 + * @return The bytes for primaryDnsName. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getPrimaryDnsNameBytes(); + + /** + * + * + *
+   * Output only. The dns name of the primary instance in a replication group.
+   * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the writeEndpoint field is set. + */ + boolean hasWriteEndpoint(); + + /** + * + * + *
+   * Output only. The dns name of the primary instance in a replication group.
+   * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The writeEndpoint. + */ + java.lang.String getWriteEndpoint(); + + /** + * + * + *
+   * Output only. The dns name of the primary instance in a replication group.
+   * 
+ * + * optional string write_endpoint = 52 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for writeEndpoint. + */ + com.google.protobuf.ByteString getWriteEndpointBytes(); + + /** + * + * + *
+   * A primary instance and disaster recovery (DR) replica pair.
+   * A DR replica is a cross-region replica that you designate
+   * for failover in the event that the primary instance
+   * experiences regional failure.
+   * Applicable to MySQL and PostgreSQL.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + * + * @return Whether the replicationCluster field is set. + */ + boolean hasReplicationCluster(); + + /** + * + * + *
+   * A primary instance and disaster recovery (DR) replica pair.
+   * A DR replica is a cross-region replica that you designate
+   * for failover in the event that the primary instance
+   * experiences regional failure.
+   * Applicable to MySQL and PostgreSQL.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + * + * @return The replicationCluster. + */ + com.google.cloud.sql.v1beta4.ReplicationCluster getReplicationCluster(); + + /** + * + * + *
+   * A primary instance and disaster recovery (DR) replica pair.
+   * A DR replica is a cross-region replica that you designate
+   * for failover in the event that the primary instance
+   * experiences regional failure.
+   * Applicable to MySQL and PostgreSQL.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.ReplicationCluster replication_cluster = 54; + */ + com.google.cloud.sql.v1beta4.ReplicationClusterOrBuilder getReplicationClusterOrBuilder(); + + /** + * + * + *
+   * Gemini instance configuration.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + * + * @return Whether the geminiConfig field is set. + */ + boolean hasGeminiConfig(); + + /** + * + * + *
+   * Gemini instance configuration.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + * + * @return The geminiConfig. + */ + com.google.cloud.sql.v1beta4.GeminiInstanceConfig getGeminiConfig(); + + /** + * + * + *
+   * Gemini instance configuration.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.GeminiInstanceConfig gemini_config = 55; + */ + com.google.cloud.sql.v1beta4.GeminiInstanceConfigOrBuilder getGeminiConfigOrBuilder(); + + /** + * + * + *
+   * Output only. This status indicates whether the instance satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzi field is set. + */ + boolean hasSatisfiesPzi(); + + /** + * + * + *
+   * Output only. This status indicates whether the instance satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzi. + */ + com.google.protobuf.BoolValue getSatisfiesPzi(); + + /** + * + * + *
+   * Output only. This status indicates whether the instance satisfies PZI.
+   *
+   * The status is reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzi = 56 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.BoolValueOrBuilder getSatisfiesPziOrBuilder(); + + /** + * + * + *
+   * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+   * recovery log files from a data disk to Cloud Storage.
+   * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the switchTransactionLogsToCloudStorageEnabled field is set. + */ + boolean hasSwitchTransactionLogsToCloudStorageEnabled(); + + /** + * + * + *
+   * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+   * recovery log files from a data disk to Cloud Storage.
+   * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The switchTransactionLogsToCloudStorageEnabled. + */ + com.google.protobuf.BoolValue getSwitchTransactionLogsToCloudStorageEnabled(); + + /** + * + * + *
+   * Input only. Whether Cloud SQL is enabled to switch storing point-in-time
+   * recovery log files from a data disk to Cloud Storage.
+   * 
+ * + * + * optional .google.protobuf.BoolValue switch_transaction_logs_to_cloud_storage_enabled = 57 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + com.google.protobuf.BoolValueOrBuilder getSwitchTransactionLogsToCloudStorageEnabledOrBuilder(); + + /** + * + * + *
+   * Input only. Determines whether an in-place major version upgrade of
+   * replicas happens when an in-place major version upgrade of a primary
+   * instance is initiated.
+   * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the includeReplicasForMajorVersionUpgrade field is set. + */ + boolean hasIncludeReplicasForMajorVersionUpgrade(); + + /** + * + * + *
+   * Input only. Determines whether an in-place major version upgrade of
+   * replicas happens when an in-place major version upgrade of a primary
+   * instance is initiated.
+   * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The includeReplicasForMajorVersionUpgrade. + */ + com.google.protobuf.BoolValue getIncludeReplicasForMajorVersionUpgrade(); + + /** + * + * + *
+   * Input only. Determines whether an in-place major version upgrade of
+   * replicas happens when an in-place major version upgrade of a primary
+   * instance is initiated.
+   * 
+ * + * + * optional .google.protobuf.BoolValue include_replicas_for_major_version_upgrade = 59 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + com.google.protobuf.BoolValueOrBuilder getIncludeReplicasForMajorVersionUpgradeOrBuilder(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + int getTagsCount(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsTags(java.lang.String key); + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getTags(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getTagsMap(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys and tag values that are bound to
+   * this instance. You must represent each item in the map as:
+   * `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
+   *
+   * For example, a single resource can have the following tags:
+   * ```
+   * "123/environment": "production",
+   * "123/costCenter": "marketing",
+   * ```
+   *
+   * For more information on tag creation and management, see
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+   * 
+ * + * + * map<string, string> tags = 60 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getTagsOrThrow(java.lang.String key); + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return Whether the nodeCount field is set. + */ + boolean hasNodeCount(); + + /** + * + * + *
+   * The number of read pool nodes in a read pool.
+   * 
+ * + * optional int32 node_count = 63; + * + * @return The nodeCount. + */ + int getNodeCount(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getNodesList(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig getNodes(int index); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getNodesCount(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getNodesOrBuilderList(); + + /** + * + * + *
+   * Output only. Entries containing information about each read pool node of
+   * the read pool.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig nodes = 64 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfigOrBuilder getNodesOrBuilder( + int index); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getDnsNamesList(); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.DnsNameMapping getDnsNames(int index); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getDnsNamesCount(); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getDnsNamesOrBuilderList(); + + /** + * + * + *
+   * Output only. The list of DNS names used by this instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.DnsNameMapping dns_names = 67 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder getDnsNamesOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseOrBuilder.java new file mode 100644 index 000000000000..b01b15b409a5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabaseOrBuilder.java @@ -0,0 +1,264 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DatabaseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.Database) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#database`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#database`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The Cloud SQL charset value.
+   * 
+ * + * string charset = 2; + * + * @return The charset. + */ + java.lang.String getCharset(); + + /** + * + * + *
+   * The Cloud SQL charset value.
+   * 
+ * + * string charset = 2; + * + * @return The bytes for charset. + */ + com.google.protobuf.ByteString getCharsetBytes(); + + /** + * + * + *
+   * The Cloud SQL collation value.
+   * 
+ * + * string collation = 3; + * + * @return The collation. + */ + java.lang.String getCollation(); + + /** + * + * + *
+   * The Cloud SQL collation value.
+   * 
+ * + * string collation = 3; + * + * @return The bytes for collation. + */ + com.google.protobuf.ByteString getCollationBytes(); + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 4; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 4; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * The name of the database in the Cloud SQL instance. This does not include
+   * the project ID or instance name.
+   * 
+ * + * string name = 5; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the database in the Cloud SQL instance. This does not include
+   * the project ID or instance name.
+   * 
+ * + * string name = 5; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string instance = 6; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 7; + * + * @return The selfLink. + */ + java.lang.String getSelfLink(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 7; + * + * @return The bytes for selfLink. + */ + com.google.protobuf.ByteString getSelfLinkBytes(); + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 8; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable.
+   * 
+ * + * string project = 8; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + * @return Whether the sqlserverDatabaseDetails field is set. + */ + boolean hasSqlserverDatabaseDetails(); + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + * + * @return The sqlserverDatabaseDetails. + */ + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails getSqlserverDatabaseDetails(); + + /** + * .google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9; + */ + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetailsOrBuilder + getSqlserverDatabaseDetailsOrBuilder(); + + com.google.cloud.sql.v1beta4.Database.DatabaseDetailsCase getDatabaseDetailsCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabasesListResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabasesListResponse.java new file mode 100644 index 000000000000..a9a6b01f5dd3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabasesListResponse.java @@ -0,0 +1,1110 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database list response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DatabasesListResponse} + */ +@com.google.protobuf.Generated +public final class DatabasesListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DatabasesListResponse) + DatabasesListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DatabasesListResponse"); + } + + // Use DatabasesListResponse.newBuilder() to construct. + private DatabasesListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DatabasesListResponse() { + kind_ = ""; + items_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabasesListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabasesListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DatabasesListResponse.class, + com.google.cloud.sql.v1beta4.DatabasesListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#databasesList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#databasesList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Database getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.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.sql.v1beta4.DatabasesListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DatabasesListResponse other = + (com.google.cloud.sql.v1beta4.DatabasesListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DatabasesListResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabasesListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabasesListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabasesListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabasesListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DatabasesListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabasesListResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabasesListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabasesListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabasesListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DatabasesListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DatabasesListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.DatabasesListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database list response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DatabasesListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DatabasesListResponse) + com.google.cloud.sql.v1beta4.DatabasesListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabasesListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabasesListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DatabasesListResponse.class, + com.google.cloud.sql.v1beta4.DatabasesListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.DatabasesListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DatabasesListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabasesListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DatabasesListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabasesListResponse build() { + com.google.cloud.sql.v1beta4.DatabasesListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabasesListResponse buildPartial() { + com.google.cloud.sql.v1beta4.DatabasesListResponse result = + new com.google.cloud.sql.v1beta4.DatabasesListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.DatabasesListResponse result) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.DatabasesListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DatabasesListResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.DatabasesListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.DatabasesListResponse other) { + if (other == com.google.cloud.sql.v1beta4.DatabasesListResponse.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1beta4.Database m = + input.readMessage( + com.google.cloud.sql.v1beta4.Database.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#databasesList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#databasesList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#databasesList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#databasesList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#databasesList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Database, + com.google.cloud.sql.v1beta4.Database.Builder, + com.google.cloud.sql.v1beta4.DatabaseOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public com.google.cloud.sql.v1beta4.Database getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1beta4.Database value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public Builder setItems( + int index, com.google.cloud.sql.v1beta4.Database.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.Database value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1beta4.Database value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.Database.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public Builder addItems( + int index, com.google.cloud.sql.v1beta4.Database.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public com.google.cloud.sql.v1beta4.Database.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public com.google.cloud.sql.v1beta4.DatabaseOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public com.google.cloud.sql.v1beta4.Database.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.Database.getDefaultInstance()); + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public com.google.cloud.sql.v1beta4.Database.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.Database.getDefaultInstance()); + } + + /** + * + * + *
+     * List of database resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Database, + com.google.cloud.sql.v1beta4.Database.Builder, + com.google.cloud.sql.v1beta4.DatabaseOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Database, + com.google.cloud.sql.v1beta4.Database.Builder, + com.google.cloud.sql.v1beta4.DatabaseOrBuilder>( + items_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DatabasesListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DatabasesListResponse) + private static final com.google.cloud.sql.v1beta4.DatabasesListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DatabasesListResponse(); + } + + public static com.google.cloud.sql.v1beta4.DatabasesListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DatabasesListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabasesListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabasesListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabasesListResponseOrBuilder.java new file mode 100644 index 000000000000..3253e0c534e1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DatabasesListResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DatabasesListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DatabasesListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#databasesList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#databasesList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + com.google.cloud.sql.v1beta4.Database getItems(int index); + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + int getItemsCount(); + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + java.util.List getItemsOrBuilderList(); + + /** + * + * + *
+   * List of database resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Database items = 2; + */ + com.google.cloud.sql.v1beta4.DatabaseOrBuilder getItemsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DeleteBackupRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DeleteBackupRequest.java new file mode 100644 index 000000000000..7214ac5c0688 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DeleteBackupRequest.java @@ -0,0 +1,617 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The request payload to delete the backup.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DeleteBackupRequest} + */ +@com.google.protobuf.Generated +public final class DeleteBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DeleteBackupRequest) + DeleteBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteBackupRequest"); + } + + // Use DeleteBackupRequest.newBuilder() to construct. + private DeleteBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteBackupRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DeleteBackupRequest.class, + com.google.cloud.sql.v1beta4.DeleteBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The name of the backup to delete.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * 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 backup to delete.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.sql.v1beta4.DeleteBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DeleteBackupRequest other = + (com.google.cloud.sql.v1beta4.DeleteBackupRequest) 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.sql.v1beta4.DeleteBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DeleteBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DeleteBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DeleteBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DeleteBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DeleteBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DeleteBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DeleteBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DeleteBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DeleteBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DeleteBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DeleteBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.DeleteBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request payload to delete the backup.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DeleteBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DeleteBackupRequest) + com.google.cloud.sql.v1beta4.DeleteBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DeleteBackupRequest.class, + com.google.cloud.sql.v1beta4.DeleteBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.DeleteBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DeleteBackupRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DeleteBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DeleteBackupRequest build() { + com.google.cloud.sql.v1beta4.DeleteBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DeleteBackupRequest buildPartial() { + com.google.cloud.sql.v1beta4.DeleteBackupRequest result = + new com.google.cloud.sql.v1beta4.DeleteBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.DeleteBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DeleteBackupRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.DeleteBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.DeleteBackupRequest other) { + if (other == com.google.cloud.sql.v1beta4.DeleteBackupRequest.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 backup to delete.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to delete.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to delete.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to delete.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to delete.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DeleteBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DeleteBackupRequest) + private static final com.google.cloud.sql.v1beta4.DeleteBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DeleteBackupRequest(); + } + + public static com.google.cloud.sql.v1beta4.DeleteBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DeleteBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DeleteBackupRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DeleteBackupRequestOrBuilder.java new file mode 100644 index 000000000000..dacdaaa15e62 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DeleteBackupRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DeleteBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DeleteBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the backup to delete.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The name of the backup to delete.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * 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-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteContext.java new file mode 100644 index 000000000000..66f3a1d4eeba --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteContext.java @@ -0,0 +1,810 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * This context is used to demote an existing standalone instance to be
+ * a Cloud SQL read replica for an external database server.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DemoteContext} + */ +@com.google.protobuf.Generated +public final class DemoteContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DemoteContext) + DemoteContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DemoteContext"); + } + + // Use DemoteContext.newBuilder() to construct. + private DemoteContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DemoteContext() { + kind_ = ""; + sourceRepresentativeInstanceName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DemoteContext.class, + com.google.cloud.sql.v1beta4.DemoteContext.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#demoteContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#demoteContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_REPRESENTATIVE_INSTANCE_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceRepresentativeInstanceName_ = ""; + + /** + * + * + *
+   * Required. The name of the instance which acts as an on-premises primary
+   * instance in the replication setup.
+   * 
+ * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sourceRepresentativeInstanceName. + */ + @java.lang.Override + public java.lang.String getSourceRepresentativeInstanceName() { + java.lang.Object ref = sourceRepresentativeInstanceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceRepresentativeInstanceName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name of the instance which acts as an on-premises primary
+   * instance in the replication setup.
+   * 
+ * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for sourceRepresentativeInstanceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceRepresentativeInstanceNameBytes() { + java.lang.Object ref = sourceRepresentativeInstanceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceRepresentativeInstanceName_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceRepresentativeInstanceName_)) { + com.google.protobuf.GeneratedMessage.writeString( + output, 2, sourceRepresentativeInstanceName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceRepresentativeInstanceName_)) { + size += + com.google.protobuf.GeneratedMessage.computeStringSize( + 2, sourceRepresentativeInstanceName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.DemoteContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DemoteContext other = + (com.google.cloud.sql.v1beta4.DemoteContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getSourceRepresentativeInstanceName().equals(other.getSourceRepresentativeInstanceName())) + return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + SOURCE_REPRESENTATIVE_INSTANCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSourceRepresentativeInstanceName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DemoteContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DemoteContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DemoteContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DemoteContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DemoteContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DemoteContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DemoteContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.DemoteContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * This context is used to demote an existing standalone instance to be
+   * a Cloud SQL read replica for an external database server.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DemoteContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DemoteContext) + com.google.cloud.sql.v1beta4.DemoteContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DemoteContext.class, + com.google.cloud.sql.v1beta4.DemoteContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.DemoteContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + sourceRepresentativeInstanceName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DemoteContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteContext build() { + com.google.cloud.sql.v1beta4.DemoteContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteContext buildPartial() { + com.google.cloud.sql.v1beta4.DemoteContext result = + new com.google.cloud.sql.v1beta4.DemoteContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.DemoteContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sourceRepresentativeInstanceName_ = sourceRepresentativeInstanceName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DemoteContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.DemoteContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.DemoteContext other) { + if (other == com.google.cloud.sql.v1beta4.DemoteContext.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getSourceRepresentativeInstanceName().isEmpty()) { + sourceRepresentativeInstanceName_ = other.sourceRepresentativeInstanceName_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + sourceRepresentativeInstanceName_ = 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#demoteContext`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteContext`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteContext`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object sourceRepresentativeInstanceName_ = ""; + + /** + * + * + *
+     * Required. The name of the instance which acts as an on-premises primary
+     * instance in the replication setup.
+     * 
+ * + * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sourceRepresentativeInstanceName. + */ + public java.lang.String getSourceRepresentativeInstanceName() { + java.lang.Object ref = sourceRepresentativeInstanceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceRepresentativeInstanceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name of the instance which acts as an on-premises primary
+     * instance in the replication setup.
+     * 
+ * + * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for sourceRepresentativeInstanceName. + */ + public com.google.protobuf.ByteString getSourceRepresentativeInstanceNameBytes() { + java.lang.Object ref = sourceRepresentativeInstanceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceRepresentativeInstanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name of the instance which acts as an on-premises primary
+     * instance in the replication setup.
+     * 
+ * + * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The sourceRepresentativeInstanceName to set. + * @return This builder for chaining. + */ + public Builder setSourceRepresentativeInstanceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceRepresentativeInstanceName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the instance which acts as an on-premises primary
+     * instance in the replication setup.
+     * 
+ * + * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearSourceRepresentativeInstanceName() { + sourceRepresentativeInstanceName_ = + getDefaultInstance().getSourceRepresentativeInstanceName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the instance which acts as an on-premises primary
+     * instance in the replication setup.
+     * 
+ * + * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The bytes for sourceRepresentativeInstanceName to set. + * @return This builder for chaining. + */ + public Builder setSourceRepresentativeInstanceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceRepresentativeInstanceName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DemoteContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DemoteContext) + private static final com.google.cloud.sql.v1beta4.DemoteContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DemoteContext(); + } + + public static com.google.cloud.sql.v1beta4.DemoteContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DemoteContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteContextOrBuilder.java new file mode 100644 index 000000000000..600a9d73dbed --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteContextOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DemoteContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DemoteContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#demoteContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#demoteContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Required. The name of the instance which acts as an on-premises primary
+   * instance in the replication setup.
+   * 
+ * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sourceRepresentativeInstanceName. + */ + java.lang.String getSourceRepresentativeInstanceName(); + + /** + * + * + *
+   * Required. The name of the instance which acts as an on-premises primary
+   * instance in the replication setup.
+   * 
+ * + * string source_representative_instance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for sourceRepresentativeInstanceName. + */ + com.google.protobuf.ByteString getSourceRepresentativeInstanceNameBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterConfiguration.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterConfiguration.java new file mode 100644 index 000000000000..1e0a4d1572d9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterConfiguration.java @@ -0,0 +1,997 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Read-replica configuration for connecting to the on-premises primary
+ * instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DemoteMasterConfiguration} + */ +@com.google.protobuf.Generated +public final class DemoteMasterConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DemoteMasterConfiguration) + DemoteMasterConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DemoteMasterConfiguration"); + } + + // Use DemoteMasterConfiguration.newBuilder() to construct. + private DemoteMasterConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DemoteMasterConfiguration() { + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.class, + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#demoteMasterConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#demoteMasterConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MYSQL_REPLICA_CONFIGURATION_FIELD_NUMBER = 2; + private com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + mysqlReplicaConfiguration_; + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return Whether the mysqlReplicaConfiguration field is set. + */ + @java.lang.Override + public boolean hasMysqlReplicaConfiguration() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return The mysqlReplicaConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + getMysqlReplicaConfiguration() { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.getDefaultInstance() + : mysqlReplicaConfiguration_; + } + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfigurationOrBuilder + getMysqlReplicaConfigurationOrBuilder() { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.getDefaultInstance() + : mysqlReplicaConfiguration_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getMysqlReplicaConfiguration()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getMysqlReplicaConfiguration()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.DemoteMasterConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration other = + (com.google.cloud.sql.v1beta4.DemoteMasterConfiguration) obj; + + if (!getKind().equals(other.getKind())) return false; + if (hasMysqlReplicaConfiguration() != other.hasMysqlReplicaConfiguration()) return false; + if (hasMysqlReplicaConfiguration()) { + if (!getMysqlReplicaConfiguration().equals(other.getMysqlReplicaConfiguration())) + return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasMysqlReplicaConfiguration()) { + hash = (37 * hash) + MYSQL_REPLICA_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getMysqlReplicaConfiguration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterConfiguration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Read-replica configuration for connecting to the on-premises primary
+   * instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DemoteMasterConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DemoteMasterConfiguration) + com.google.cloud.sql.v1beta4.DemoteMasterConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.class, + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMysqlReplicaConfigurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + mysqlReplicaConfiguration_ = null; + if (mysqlReplicaConfigurationBuilder_ != null) { + mysqlReplicaConfigurationBuilder_.dispose(); + mysqlReplicaConfigurationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterConfiguration getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterConfiguration build() { + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterConfiguration buildPartial() { + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration result = + new com.google.cloud.sql.v1beta4.DemoteMasterConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.DemoteMasterConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mysqlReplicaConfiguration_ = + mysqlReplicaConfigurationBuilder_ == null + ? mysqlReplicaConfiguration_ + : mysqlReplicaConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DemoteMasterConfiguration) { + return mergeFrom((com.google.cloud.sql.v1beta4.DemoteMasterConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.DemoteMasterConfiguration other) { + if (other == com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasMysqlReplicaConfiguration()) { + mergeMysqlReplicaConfiguration(other.getMysqlReplicaConfiguration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetMysqlReplicaConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#demoteMasterConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteMasterConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteMasterConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteMasterConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteMasterConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + mysqlReplicaConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration, + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.Builder, + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfigurationOrBuilder> + mysqlReplicaConfigurationBuilder_; + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return Whether the mysqlReplicaConfiguration field is set. + */ + public boolean hasMysqlReplicaConfiguration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return The mysqlReplicaConfiguration. + */ + public com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + getMysqlReplicaConfiguration() { + if (mysqlReplicaConfigurationBuilder_ == null) { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + .getDefaultInstance() + : mysqlReplicaConfiguration_; + } else { + return mysqlReplicaConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public Builder setMysqlReplicaConfiguration( + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration value) { + if (mysqlReplicaConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mysqlReplicaConfiguration_ = value; + } else { + mysqlReplicaConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public Builder setMysqlReplicaConfiguration( + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.Builder + builderForValue) { + if (mysqlReplicaConfigurationBuilder_ == null) { + mysqlReplicaConfiguration_ = builderForValue.build(); + } else { + mysqlReplicaConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public Builder mergeMysqlReplicaConfiguration( + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration value) { + if (mysqlReplicaConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && mysqlReplicaConfiguration_ != null + && mysqlReplicaConfiguration_ + != com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + .getDefaultInstance()) { + getMysqlReplicaConfigurationBuilder().mergeFrom(value); + } else { + mysqlReplicaConfiguration_ = value; + } + } else { + mysqlReplicaConfigurationBuilder_.mergeFrom(value); + } + if (mysqlReplicaConfiguration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public Builder clearMysqlReplicaConfiguration() { + bitField0_ = (bitField0_ & ~0x00000002); + mysqlReplicaConfiguration_ = null; + if (mysqlReplicaConfigurationBuilder_ != null) { + mysqlReplicaConfigurationBuilder_.dispose(); + mysqlReplicaConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.Builder + getMysqlReplicaConfigurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetMysqlReplicaConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfigurationOrBuilder + getMysqlReplicaConfigurationOrBuilder() { + if (mysqlReplicaConfigurationBuilder_ != null) { + return mysqlReplicaConfigurationBuilder_.getMessageOrBuilder(); + } else { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + .getDefaultInstance() + : mysqlReplicaConfiguration_; + } + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration, + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.Builder, + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfigurationOrBuilder> + internalGetMysqlReplicaConfigurationFieldBuilder() { + if (mysqlReplicaConfigurationBuilder_ == null) { + mysqlReplicaConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration, + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.Builder, + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfigurationOrBuilder>( + getMysqlReplicaConfiguration(), getParentForChildren(), isClean()); + mysqlReplicaConfiguration_ = null; + } + return mysqlReplicaConfigurationBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DemoteMasterConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DemoteMasterConfiguration) + private static final com.google.cloud.sql.v1beta4.DemoteMasterConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DemoteMasterConfiguration(); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DemoteMasterConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterConfigurationOrBuilder.java new file mode 100644 index 000000000000..a3777f0d74b0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterConfigurationOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DemoteMasterConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DemoteMasterConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#demoteMasterConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#demoteMasterConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return Whether the mysqlReplicaConfiguration field is set. + */ + boolean hasMysqlReplicaConfiguration(); + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return The mysqlReplicaConfiguration. + */ + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration getMysqlReplicaConfiguration(); + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfigurationOrBuilder + getMysqlReplicaConfigurationOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterContext.java new file mode 100644 index 000000000000..bc3249c0527e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterContext.java @@ -0,0 +1,1561 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance demote primary instance context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DemoteMasterContext} + */ +@com.google.protobuf.Generated +public final class DemoteMasterContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DemoteMasterContext) + DemoteMasterContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DemoteMasterContext"); + } + + // Use DemoteMasterContext.newBuilder() to construct. + private DemoteMasterContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DemoteMasterContext() { + kind_ = ""; + masterInstanceName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DemoteMasterContext.class, + com.google.cloud.sql.v1beta4.DemoteMasterContext.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#demoteMasterContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#demoteMasterContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERIFY_GTID_CONSISTENCY_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue verifyGtidConsistency_; + + /** + * + * + *
+   * Verify the GTID consistency for demote operation. Default value:
+   * `True`. Setting this flag to `false` enables you to bypass the GTID
+   * consistency check between on-premises primary instance and Cloud SQL
+   * instance during the demotion operation but also exposes you to the risk of
+   * future replication failures. Change the value only if you know the reason
+   * for the GTID divergence and are confident that doing so will not cause any
+   * replication issues.
+   * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + * + * @return Whether the verifyGtidConsistency field is set. + */ + @java.lang.Override + public boolean hasVerifyGtidConsistency() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Verify the GTID consistency for demote operation. Default value:
+   * `True`. Setting this flag to `false` enables you to bypass the GTID
+   * consistency check between on-premises primary instance and Cloud SQL
+   * instance during the demotion operation but also exposes you to the risk of
+   * future replication failures. Change the value only if you know the reason
+   * for the GTID divergence and are confident that doing so will not cause any
+   * replication issues.
+   * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + * + * @return The verifyGtidConsistency. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getVerifyGtidConsistency() { + return verifyGtidConsistency_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyGtidConsistency_; + } + + /** + * + * + *
+   * Verify the GTID consistency for demote operation. Default value:
+   * `True`. Setting this flag to `false` enables you to bypass the GTID
+   * consistency check between on-premises primary instance and Cloud SQL
+   * instance during the demotion operation but also exposes you to the risk of
+   * future replication failures. Change the value only if you know the reason
+   * for the GTID divergence and are confident that doing so will not cause any
+   * replication issues.
+   * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getVerifyGtidConsistencyOrBuilder() { + return verifyGtidConsistency_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyGtidConsistency_; + } + + public static final int MASTER_INSTANCE_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object masterInstanceName_ = ""; + + /** + * + * + *
+   * The name of the instance which will act as on-premises primary instance
+   * in the replication setup.
+   * 
+ * + * string master_instance_name = 3; + * + * @return The masterInstanceName. + */ + @java.lang.Override + public java.lang.String getMasterInstanceName() { + java.lang.Object ref = masterInstanceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + masterInstanceName_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the instance which will act as on-premises primary instance
+   * in the replication setup.
+   * 
+ * + * string master_instance_name = 3; + * + * @return The bytes for masterInstanceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMasterInstanceNameBytes() { + java.lang.Object ref = masterInstanceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + masterInstanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPLICA_CONFIGURATION_FIELD_NUMBER = 4; + private com.google.cloud.sql.v1beta4.DemoteMasterConfiguration replicaConfiguration_; + + /** + * + * + *
+   * Configuration specific to read-replicas replicating from the on-premises
+   * primary instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + * + * @return Whether the replicaConfiguration field is set. + */ + @java.lang.Override + public boolean hasReplicaConfiguration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Configuration specific to read-replicas replicating from the on-premises
+   * primary instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + * + * @return The replicaConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterConfiguration getReplicaConfiguration() { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.getDefaultInstance() + : replicaConfiguration_; + } + + /** + * + * + *
+   * Configuration specific to read-replicas replicating from the on-premises
+   * primary instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterConfigurationOrBuilder + getReplicaConfigurationOrBuilder() { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.getDefaultInstance() + : replicaConfiguration_; + } + + public static final int SKIP_REPLICATION_SETUP_FIELD_NUMBER = 5; + private boolean skipReplicationSetup_ = false; + + /** + * + * + *
+   * Flag to skip replication setup on the instance.
+   * 
+ * + * bool skip_replication_setup = 5; + * + * @return The skipReplicationSetup. + */ + @java.lang.Override + public boolean getSkipReplicationSetup() { + return skipReplicationSetup_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getVerifyGtidConsistency()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(masterInstanceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, masterInstanceName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getReplicaConfiguration()); + } + if (skipReplicationSetup_ != false) { + output.writeBool(5, skipReplicationSetup_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getVerifyGtidConsistency()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(masterInstanceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, masterInstanceName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, getReplicaConfiguration()); + } + if (skipReplicationSetup_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, skipReplicationSetup_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.DemoteMasterContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DemoteMasterContext other = + (com.google.cloud.sql.v1beta4.DemoteMasterContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (hasVerifyGtidConsistency() != other.hasVerifyGtidConsistency()) return false; + if (hasVerifyGtidConsistency()) { + if (!getVerifyGtidConsistency().equals(other.getVerifyGtidConsistency())) return false; + } + if (!getMasterInstanceName().equals(other.getMasterInstanceName())) return false; + if (hasReplicaConfiguration() != other.hasReplicaConfiguration()) return false; + if (hasReplicaConfiguration()) { + if (!getReplicaConfiguration().equals(other.getReplicaConfiguration())) return false; + } + if (getSkipReplicationSetup() != other.getSkipReplicationSetup()) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasVerifyGtidConsistency()) { + hash = (37 * hash) + VERIFY_GTID_CONSISTENCY_FIELD_NUMBER; + hash = (53 * hash) + getVerifyGtidConsistency().hashCode(); + } + hash = (37 * hash) + MASTER_INSTANCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMasterInstanceName().hashCode(); + if (hasReplicaConfiguration()) { + hash = (37 * hash) + REPLICA_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getReplicaConfiguration().hashCode(); + } + hash = (37 * hash) + SKIP_REPLICATION_SETUP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSkipReplicationSetup()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.DemoteMasterContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance demote primary instance context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DemoteMasterContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DemoteMasterContext) + com.google.cloud.sql.v1beta4.DemoteMasterContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DemoteMasterContext.class, + com.google.cloud.sql.v1beta4.DemoteMasterContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.DemoteMasterContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetVerifyGtidConsistencyFieldBuilder(); + internalGetReplicaConfigurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + verifyGtidConsistency_ = null; + if (verifyGtidConsistencyBuilder_ != null) { + verifyGtidConsistencyBuilder_.dispose(); + verifyGtidConsistencyBuilder_ = null; + } + masterInstanceName_ = ""; + replicaConfiguration_ = null; + if (replicaConfigurationBuilder_ != null) { + replicaConfigurationBuilder_.dispose(); + replicaConfigurationBuilder_ = null; + } + skipReplicationSetup_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DemoteMasterContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterContext build() { + com.google.cloud.sql.v1beta4.DemoteMasterContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterContext buildPartial() { + com.google.cloud.sql.v1beta4.DemoteMasterContext result = + new com.google.cloud.sql.v1beta4.DemoteMasterContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.DemoteMasterContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.verifyGtidConsistency_ = + verifyGtidConsistencyBuilder_ == null + ? verifyGtidConsistency_ + : verifyGtidConsistencyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.masterInstanceName_ = masterInstanceName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.replicaConfiguration_ = + replicaConfigurationBuilder_ == null + ? replicaConfiguration_ + : replicaConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.skipReplicationSetup_ = skipReplicationSetup_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DemoteMasterContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.DemoteMasterContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.DemoteMasterContext other) { + if (other == com.google.cloud.sql.v1beta4.DemoteMasterContext.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasVerifyGtidConsistency()) { + mergeVerifyGtidConsistency(other.getVerifyGtidConsistency()); + } + if (!other.getMasterInstanceName().isEmpty()) { + masterInstanceName_ = other.masterInstanceName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasReplicaConfiguration()) { + mergeReplicaConfiguration(other.getReplicaConfiguration()); + } + if (other.getSkipReplicationSetup() != false) { + setSkipReplicationSetup(other.getSkipReplicationSetup()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetVerifyGtidConsistencyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + masterInstanceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetReplicaConfigurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + skipReplicationSetup_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#demoteMasterContext`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteMasterContext`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteMasterContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteMasterContext`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteMasterContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue verifyGtidConsistency_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + verifyGtidConsistencyBuilder_; + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + * + * @return Whether the verifyGtidConsistency field is set. + */ + public boolean hasVerifyGtidConsistency() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + * + * @return The verifyGtidConsistency. + */ + public com.google.protobuf.BoolValue getVerifyGtidConsistency() { + if (verifyGtidConsistencyBuilder_ == null) { + return verifyGtidConsistency_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyGtidConsistency_; + } else { + return verifyGtidConsistencyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + public Builder setVerifyGtidConsistency(com.google.protobuf.BoolValue value) { + if (verifyGtidConsistencyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + verifyGtidConsistency_ = value; + } else { + verifyGtidConsistencyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + public Builder setVerifyGtidConsistency(com.google.protobuf.BoolValue.Builder builderForValue) { + if (verifyGtidConsistencyBuilder_ == null) { + verifyGtidConsistency_ = builderForValue.build(); + } else { + verifyGtidConsistencyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + public Builder mergeVerifyGtidConsistency(com.google.protobuf.BoolValue value) { + if (verifyGtidConsistencyBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && verifyGtidConsistency_ != null + && verifyGtidConsistency_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getVerifyGtidConsistencyBuilder().mergeFrom(value); + } else { + verifyGtidConsistency_ = value; + } + } else { + verifyGtidConsistencyBuilder_.mergeFrom(value); + } + if (verifyGtidConsistency_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + public Builder clearVerifyGtidConsistency() { + bitField0_ = (bitField0_ & ~0x00000002); + verifyGtidConsistency_ = null; + if (verifyGtidConsistencyBuilder_ != null) { + verifyGtidConsistencyBuilder_.dispose(); + verifyGtidConsistencyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + public com.google.protobuf.BoolValue.Builder getVerifyGtidConsistencyBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetVerifyGtidConsistencyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + public com.google.protobuf.BoolValueOrBuilder getVerifyGtidConsistencyOrBuilder() { + if (verifyGtidConsistencyBuilder_ != null) { + return verifyGtidConsistencyBuilder_.getMessageOrBuilder(); + } else { + return verifyGtidConsistency_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyGtidConsistency_; + } + } + + /** + * + * + *
+     * Verify the GTID consistency for demote operation. Default value:
+     * `True`. Setting this flag to `false` enables you to bypass the GTID
+     * consistency check between on-premises primary instance and Cloud SQL
+     * instance during the demotion operation but also exposes you to the risk of
+     * future replication failures. Change the value only if you know the reason
+     * for the GTID divergence and are confident that doing so will not cause any
+     * replication issues.
+     * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetVerifyGtidConsistencyFieldBuilder() { + if (verifyGtidConsistencyBuilder_ == null) { + verifyGtidConsistencyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getVerifyGtidConsistency(), getParentForChildren(), isClean()); + verifyGtidConsistency_ = null; + } + return verifyGtidConsistencyBuilder_; + } + + private java.lang.Object masterInstanceName_ = ""; + + /** + * + * + *
+     * The name of the instance which will act as on-premises primary instance
+     * in the replication setup.
+     * 
+ * + * string master_instance_name = 3; + * + * @return The masterInstanceName. + */ + public java.lang.String getMasterInstanceName() { + java.lang.Object ref = masterInstanceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + masterInstanceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the instance which will act as on-premises primary instance
+     * in the replication setup.
+     * 
+ * + * string master_instance_name = 3; + * + * @return The bytes for masterInstanceName. + */ + public com.google.protobuf.ByteString getMasterInstanceNameBytes() { + java.lang.Object ref = masterInstanceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + masterInstanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the instance which will act as on-premises primary instance
+     * in the replication setup.
+     * 
+ * + * string master_instance_name = 3; + * + * @param value The masterInstanceName to set. + * @return This builder for chaining. + */ + public Builder setMasterInstanceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + masterInstanceName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the instance which will act as on-premises primary instance
+     * in the replication setup.
+     * 
+ * + * string master_instance_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearMasterInstanceName() { + masterInstanceName_ = getDefaultInstance().getMasterInstanceName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the instance which will act as on-premises primary instance
+     * in the replication setup.
+     * 
+ * + * string master_instance_name = 3; + * + * @param value The bytes for masterInstanceName to set. + * @return This builder for chaining. + */ + public Builder setMasterInstanceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + masterInstanceName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.DemoteMasterConfiguration replicaConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration, + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.Builder, + com.google.cloud.sql.v1beta4.DemoteMasterConfigurationOrBuilder> + replicaConfigurationBuilder_; + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + * + * @return Whether the replicaConfiguration field is set. + */ + public boolean hasReplicaConfiguration() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + * + * @return The replicaConfiguration. + */ + public com.google.cloud.sql.v1beta4.DemoteMasterConfiguration getReplicaConfiguration() { + if (replicaConfigurationBuilder_ == null) { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.getDefaultInstance() + : replicaConfiguration_; + } else { + return replicaConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + */ + public Builder setReplicaConfiguration( + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration value) { + if (replicaConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replicaConfiguration_ = value; + } else { + replicaConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + */ + public Builder setReplicaConfiguration( + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.Builder builderForValue) { + if (replicaConfigurationBuilder_ == null) { + replicaConfiguration_ = builderForValue.build(); + } else { + replicaConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + */ + public Builder mergeReplicaConfiguration( + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration value) { + if (replicaConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && replicaConfiguration_ != null + && replicaConfiguration_ + != com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.getDefaultInstance()) { + getReplicaConfigurationBuilder().mergeFrom(value); + } else { + replicaConfiguration_ = value; + } + } else { + replicaConfigurationBuilder_.mergeFrom(value); + } + if (replicaConfiguration_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + */ + public Builder clearReplicaConfiguration() { + bitField0_ = (bitField0_ & ~0x00000008); + replicaConfiguration_ = null; + if (replicaConfigurationBuilder_ != null) { + replicaConfigurationBuilder_.dispose(); + replicaConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + */ + public com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.Builder + getReplicaConfigurationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetReplicaConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + */ + public com.google.cloud.sql.v1beta4.DemoteMasterConfigurationOrBuilder + getReplicaConfigurationOrBuilder() { + if (replicaConfigurationBuilder_ != null) { + return replicaConfigurationBuilder_.getMessageOrBuilder(); + } else { + return replicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.getDefaultInstance() + : replicaConfiguration_; + } + } + + /** + * + * + *
+     * Configuration specific to read-replicas replicating from the on-premises
+     * primary instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration, + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.Builder, + com.google.cloud.sql.v1beta4.DemoteMasterConfigurationOrBuilder> + internalGetReplicaConfigurationFieldBuilder() { + if (replicaConfigurationBuilder_ == null) { + replicaConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration, + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration.Builder, + com.google.cloud.sql.v1beta4.DemoteMasterConfigurationOrBuilder>( + getReplicaConfiguration(), getParentForChildren(), isClean()); + replicaConfiguration_ = null; + } + return replicaConfigurationBuilder_; + } + + private boolean skipReplicationSetup_; + + /** + * + * + *
+     * Flag to skip replication setup on the instance.
+     * 
+ * + * bool skip_replication_setup = 5; + * + * @return The skipReplicationSetup. + */ + @java.lang.Override + public boolean getSkipReplicationSetup() { + return skipReplicationSetup_; + } + + /** + * + * + *
+     * Flag to skip replication setup on the instance.
+     * 
+ * + * bool skip_replication_setup = 5; + * + * @param value The skipReplicationSetup to set. + * @return This builder for chaining. + */ + public Builder setSkipReplicationSetup(boolean value) { + + skipReplicationSetup_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Flag to skip replication setup on the instance.
+     * 
+ * + * bool skip_replication_setup = 5; + * + * @return This builder for chaining. + */ + public Builder clearSkipReplicationSetup() { + bitField0_ = (bitField0_ & ~0x00000010); + skipReplicationSetup_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DemoteMasterContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DemoteMasterContext) + private static final com.google.cloud.sql.v1beta4.DemoteMasterContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DemoteMasterContext(); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DemoteMasterContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterContextOrBuilder.java new file mode 100644 index 000000000000..cf026890d961 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterContextOrBuilder.java @@ -0,0 +1,191 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DemoteMasterContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DemoteMasterContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#demoteMasterContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#demoteMasterContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Verify the GTID consistency for demote operation. Default value:
+   * `True`. Setting this flag to `false` enables you to bypass the GTID
+   * consistency check between on-premises primary instance and Cloud SQL
+   * instance during the demotion operation but also exposes you to the risk of
+   * future replication failures. Change the value only if you know the reason
+   * for the GTID divergence and are confident that doing so will not cause any
+   * replication issues.
+   * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + * + * @return Whether the verifyGtidConsistency field is set. + */ + boolean hasVerifyGtidConsistency(); + + /** + * + * + *
+   * Verify the GTID consistency for demote operation. Default value:
+   * `True`. Setting this flag to `false` enables you to bypass the GTID
+   * consistency check between on-premises primary instance and Cloud SQL
+   * instance during the demotion operation but also exposes you to the risk of
+   * future replication failures. Change the value only if you know the reason
+   * for the GTID divergence and are confident that doing so will not cause any
+   * replication issues.
+   * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + * + * @return The verifyGtidConsistency. + */ + com.google.protobuf.BoolValue getVerifyGtidConsistency(); + + /** + * + * + *
+   * Verify the GTID consistency for demote operation. Default value:
+   * `True`. Setting this flag to `false` enables you to bypass the GTID
+   * consistency check between on-premises primary instance and Cloud SQL
+   * instance during the demotion operation but also exposes you to the risk of
+   * future replication failures. Change the value only if you know the reason
+   * for the GTID divergence and are confident that doing so will not cause any
+   * replication issues.
+   * 
+ * + * .google.protobuf.BoolValue verify_gtid_consistency = 2; + */ + com.google.protobuf.BoolValueOrBuilder getVerifyGtidConsistencyOrBuilder(); + + /** + * + * + *
+   * The name of the instance which will act as on-premises primary instance
+   * in the replication setup.
+   * 
+ * + * string master_instance_name = 3; + * + * @return The masterInstanceName. + */ + java.lang.String getMasterInstanceName(); + + /** + * + * + *
+   * The name of the instance which will act as on-premises primary instance
+   * in the replication setup.
+   * 
+ * + * string master_instance_name = 3; + * + * @return The bytes for masterInstanceName. + */ + com.google.protobuf.ByteString getMasterInstanceNameBytes(); + + /** + * + * + *
+   * Configuration specific to read-replicas replicating from the on-premises
+   * primary instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + * + * @return Whether the replicaConfiguration field is set. + */ + boolean hasReplicaConfiguration(); + + /** + * + * + *
+   * Configuration specific to read-replicas replicating from the on-premises
+   * primary instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + * + * @return The replicaConfiguration. + */ + com.google.cloud.sql.v1beta4.DemoteMasterConfiguration getReplicaConfiguration(); + + /** + * + * + *
+   * Configuration specific to read-replicas replicating from the on-premises
+   * primary instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterConfiguration replica_configuration = 4; + */ + com.google.cloud.sql.v1beta4.DemoteMasterConfigurationOrBuilder + getReplicaConfigurationOrBuilder(); + + /** + * + * + *
+   * Flag to skip replication setup on the instance.
+   * 
+ * + * bool skip_replication_setup = 5; + * + * @return The skipReplicationSetup. + */ + boolean getSkipReplicationSetup(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterMySqlReplicaConfiguration.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterMySqlReplicaConfiguration.java new file mode 100644 index 000000000000..e458616c4329 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterMySqlReplicaConfiguration.java @@ -0,0 +1,1569 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Read-replica configuration specific to MySQL databases.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration} + */ +@com.google.protobuf.Generated +public final class DemoteMasterMySqlReplicaConfiguration + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration) + DemoteMasterMySqlReplicaConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DemoteMasterMySqlReplicaConfiguration"); + } + + // Use DemoteMasterMySqlReplicaConfiguration.newBuilder() to construct. + private DemoteMasterMySqlReplicaConfiguration( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DemoteMasterMySqlReplicaConfiguration() { + kind_ = ""; + username_ = ""; + password_ = ""; + clientKey_ = ""; + clientCertificate_ = ""; + caCertificate_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterMySqlReplicaConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterMySqlReplicaConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.class, + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERNAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object username_ = ""; + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } + } + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_KEY_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object clientKey_ = ""; + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate. The format of the replica's
+   * private key can be either PKCS #1 or PKCS #8.
+   * 
+ * + * string client_key = 4; + * + * @return The clientKey. + */ + @java.lang.Override + public java.lang.String getClientKey() { + java.lang.Object ref = clientKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientKey_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate. The format of the replica's
+   * private key can be either PKCS #1 or PKCS #8.
+   * 
+ * + * string client_key = 4; + * + * @return The bytes for clientKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientKeyBytes() { + java.lang.Object ref = clientKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_CERTIFICATE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object clientCertificate_ = ""; + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 5; + * + * @return The clientCertificate. + */ + @java.lang.Override + public java.lang.String getClientCertificate() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientCertificate_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 5; + * + * @return The bytes for clientCertificate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientCertificateBytes() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CA_CERTIFICATE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object caCertificate_ = ""; + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The caCertificate. + */ + @java.lang.Override + public java.lang.String getCaCertificate() { + java.lang.Object ref = caCertificate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCertificate_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The bytes for caCertificate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCaCertificateBytes() { + java.lang.Object ref = caCertificate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCertificate_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(username_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, username_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, password_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, clientKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientCertificate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, clientCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(caCertificate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, caCertificate_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(username_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, username_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, password_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, clientKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientCertificate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, clientCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(caCertificate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, caCertificate_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration other = + (com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getUsername().equals(other.getUsername())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (!getClientKey().equals(other.getClientKey())) return false; + if (!getClientCertificate().equals(other.getClientCertificate())) return false; + if (!getCaCertificate().equals(other.getCaCertificate())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (37 * hash) + CLIENT_KEY_FIELD_NUMBER; + hash = (53 * hash) + getClientKey().hashCode(); + hash = (37 * hash) + CLIENT_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getClientCertificate().hashCode(); + hash = (37 * hash) + CA_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getCaCertificate().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Read-replica configuration specific to MySQL databases.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration) + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterMySqlReplicaConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterMySqlReplicaConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.class, + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + username_ = ""; + password_ = ""; + clientKey_ = ""; + clientCertificate_ = ""; + caCertificate_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DemoteMasterMySqlReplicaConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration build() { + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration buildPartial() { + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration result = + new com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.username_ = username_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.password_ = password_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.clientKey_ = clientKey_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.clientCertificate_ = clientCertificate_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.caCertificate_ = caCertificate_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration other) { + if (other + == com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + .getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getClientKey().isEmpty()) { + clientKey_ = other.clientKey_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getClientCertificate().isEmpty()) { + clientCertificate_ = other.clientCertificate_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getCaCertificate().isEmpty()) { + caCertificate_ = other.caCertificate_; + bitField0_ |= 0x00000020; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + username_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + clientKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + clientCertificate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + caCertificate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object username_ = ""; + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + username_ = getDefaultInstance().getUsername(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object clientKey_ = ""; + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate. The format of the replica's
+     * private key can be either PKCS #1 or PKCS #8.
+     * 
+ * + * string client_key = 4; + * + * @return The clientKey. + */ + public java.lang.String getClientKey() { + java.lang.Object ref = clientKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate. The format of the replica's
+     * private key can be either PKCS #1 or PKCS #8.
+     * 
+ * + * string client_key = 4; + * + * @return The bytes for clientKey. + */ + public com.google.protobuf.ByteString getClientKeyBytes() { + java.lang.Object ref = clientKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate. The format of the replica's
+     * private key can be either PKCS #1 or PKCS #8.
+     * 
+ * + * string client_key = 4; + * + * @param value The clientKey to set. + * @return This builder for chaining. + */ + public Builder setClientKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clientKey_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate. The format of the replica's
+     * private key can be either PKCS #1 or PKCS #8.
+     * 
+ * + * string client_key = 4; + * + * @return This builder for chaining. + */ + public Builder clearClientKey() { + clientKey_ = getDefaultInstance().getClientKey(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate. The format of the replica's
+     * private key can be either PKCS #1 or PKCS #8.
+     * 
+ * + * string client_key = 4; + * + * @param value The bytes for clientKey to set. + * @return This builder for chaining. + */ + public Builder setClientKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clientKey_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object clientCertificate_ = ""; + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 5; + * + * @return The clientCertificate. + */ + public java.lang.String getClientCertificate() { + java.lang.Object ref = clientCertificate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientCertificate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 5; + * + * @return The bytes for clientCertificate. + */ + public com.google.protobuf.ByteString getClientCertificateBytes() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 5; + * + * @param value The clientCertificate to set. + * @return This builder for chaining. + */ + public Builder setClientCertificate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clientCertificate_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 5; + * + * @return This builder for chaining. + */ + public Builder clearClientCertificate() { + clientCertificate_ = getDefaultInstance().getClientCertificate(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 5; + * + * @param value The bytes for clientCertificate to set. + * @return This builder for chaining. + */ + public Builder setClientCertificateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clientCertificate_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object caCertificate_ = ""; + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @return The caCertificate. + */ + public java.lang.String getCaCertificate() { + java.lang.Object ref = caCertificate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCertificate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @return The bytes for caCertificate. + */ + public com.google.protobuf.ByteString getCaCertificateBytes() { + java.lang.Object ref = caCertificate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @param value The caCertificate to set. + * @return This builder for chaining. + */ + public Builder setCaCertificate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + caCertificate_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @return This builder for chaining. + */ + public Builder clearCaCertificate() { + caCertificate_ = getDefaultInstance().getCaCertificate(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @param value The bytes for caCertificate to set. + * @return This builder for chaining. + */ + public Builder setCaCertificateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + caCertificate_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration) + private static final com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration(); + } + + public static com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DemoteMasterMySqlReplicaConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterMySqlReplicaConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterMySqlReplicaConfigurationOrBuilder.java new file mode 100644 index 000000000000..ab765043dc12 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DemoteMasterMySqlReplicaConfigurationOrBuilder.java @@ -0,0 +1,188 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DemoteMasterMySqlReplicaConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#demoteMasterMysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The username. + */ + java.lang.String getUsername(); + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The password. + */ + java.lang.String getPassword(); + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate. The format of the replica's
+   * private key can be either PKCS #1 or PKCS #8.
+   * 
+ * + * string client_key = 4; + * + * @return The clientKey. + */ + java.lang.String getClientKey(); + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate. The format of the replica's
+   * private key can be either PKCS #1 or PKCS #8.
+   * 
+ * + * string client_key = 4; + * + * @return The bytes for clientKey. + */ + com.google.protobuf.ByteString getClientKeyBytes(); + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 5; + * + * @return The clientCertificate. + */ + java.lang.String getClientCertificate(); + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 5; + * + * @return The bytes for clientCertificate. + */ + com.google.protobuf.ByteString getClientCertificateBytes(); + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The caCertificate. + */ + java.lang.String getCaCertificate(); + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The bytes for caCertificate. + */ + com.google.protobuf.ByteString getCaCertificateBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DenyMaintenancePeriod.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DenyMaintenancePeriod.java new file mode 100644 index 000000000000..d476df75f4a2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DenyMaintenancePeriod.java @@ -0,0 +1,1025 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Deny Maintenance Periods. This specifies a date range during when all CSA
+ * rollout will be denied.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DenyMaintenancePeriod} + */ +@com.google.protobuf.Generated +public final class DenyMaintenancePeriod extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DenyMaintenancePeriod) + DenyMaintenancePeriodOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DenyMaintenancePeriod"); + } + + // Use DenyMaintenancePeriod.newBuilder() to construct. + private DenyMaintenancePeriod(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DenyMaintenancePeriod() { + startDate_ = ""; + endDate_ = ""; + time_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DenyMaintenancePeriod_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DenyMaintenancePeriod_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.class, + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.Builder.class); + } + + public static final int START_DATE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object startDate_ = ""; + + /** + * + * + *
+   * "deny maintenance period" start date. If the year of the start date is
+   * empty, the year of the end date also must be empty. In this case, it means
+   * the deny maintenance period recurs every year. The date is in format
+   * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string start_date = 1; + * + * @return The startDate. + */ + @java.lang.Override + public java.lang.String getStartDate() { + java.lang.Object ref = startDate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startDate_ = s; + return s; + } + } + + /** + * + * + *
+   * "deny maintenance period" start date. If the year of the start date is
+   * empty, the year of the end date also must be empty. In this case, it means
+   * the deny maintenance period recurs every year. The date is in format
+   * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string start_date = 1; + * + * @return The bytes for startDate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStartDateBytes() { + java.lang.Object ref = startDate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + startDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int END_DATE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object endDate_ = ""; + + /** + * + * + *
+   * "deny maintenance period" end date. If the year of the end date is empty,
+   * the year of the start date also must be empty. In this case, it means the
+   * deny maintenance period recurs every year. The date is in format yyyy-mm-dd
+   * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string end_date = 2; + * + * @return The endDate. + */ + @java.lang.Override + public java.lang.String getEndDate() { + java.lang.Object ref = endDate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endDate_ = s; + return s; + } + } + + /** + * + * + *
+   * "deny maintenance period" end date. If the year of the end date is empty,
+   * the year of the start date also must be empty. In this case, it means the
+   * deny maintenance period recurs every year. The date is in format yyyy-mm-dd
+   * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string end_date = 2; + * + * @return The bytes for endDate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndDateBytes() { + java.lang.Object ref = endDate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object time_ = ""; + + /** + * + * + *
+   * Time in UTC when the "deny maintenance period" starts on start_date and
+   * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+   * 
+ * + * string time = 3; + * + * @return The time. + */ + @java.lang.Override + public java.lang.String getTime() { + java.lang.Object ref = time_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + time_ = s; + return s; + } + } + + /** + * + * + *
+   * Time in UTC when the "deny maintenance period" starts on start_date and
+   * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+   * 
+ * + * string time = 3; + * + * @return The bytes for time. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTimeBytes() { + java.lang.Object ref = time_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + time_ = 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.GeneratedMessage.isStringEmpty(startDate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, startDate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(endDate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, endDate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(time_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, time_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(startDate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, startDate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(endDate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, endDate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(time_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, time_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.DenyMaintenancePeriod)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod other = + (com.google.cloud.sql.v1beta4.DenyMaintenancePeriod) obj; + + if (!getStartDate().equals(other.getStartDate())) return false; + if (!getEndDate().equals(other.getEndDate())) return false; + if (!getTime().equals(other.getTime())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + START_DATE_FIELD_NUMBER; + hash = (53 * hash) + getStartDate().hashCode(); + hash = (37 * hash) + END_DATE_FIELD_NUMBER; + hash = (53 * hash) + getEndDate().hashCode(); + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + getTime().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DenyMaintenancePeriod parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DenyMaintenancePeriod parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DenyMaintenancePeriod parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DenyMaintenancePeriod parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DenyMaintenancePeriod parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DenyMaintenancePeriod parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DenyMaintenancePeriod parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DenyMaintenancePeriod parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DenyMaintenancePeriod parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DenyMaintenancePeriod parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DenyMaintenancePeriod parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DenyMaintenancePeriod parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.DenyMaintenancePeriod prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Deny Maintenance Periods. This specifies a date range during when all CSA
+   * rollout will be denied.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DenyMaintenancePeriod} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DenyMaintenancePeriod) + com.google.cloud.sql.v1beta4.DenyMaintenancePeriodOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DenyMaintenancePeriod_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DenyMaintenancePeriod_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.class, + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startDate_ = ""; + endDate_ = ""; + time_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DenyMaintenancePeriod_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DenyMaintenancePeriod getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DenyMaintenancePeriod build() { + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DenyMaintenancePeriod buildPartial() { + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod result = + new com.google.cloud.sql.v1beta4.DenyMaintenancePeriod(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.DenyMaintenancePeriod result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startDate_ = startDate_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endDate_ = endDate_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.time_ = time_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DenyMaintenancePeriod) { + return mergeFrom((com.google.cloud.sql.v1beta4.DenyMaintenancePeriod) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.DenyMaintenancePeriod other) { + if (other == com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.getDefaultInstance()) + return this; + if (!other.getStartDate().isEmpty()) { + startDate_ = other.startDate_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEndDate().isEmpty()) { + endDate_ = other.endDate_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getTime().isEmpty()) { + time_ = other.time_; + 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: + { + startDate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + endDate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + time_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object startDate_ = ""; + + /** + * + * + *
+     * "deny maintenance period" start date. If the year of the start date is
+     * empty, the year of the end date also must be empty. In this case, it means
+     * the deny maintenance period recurs every year. The date is in format
+     * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string start_date = 1; + * + * @return The startDate. + */ + public java.lang.String getStartDate() { + java.lang.Object ref = startDate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startDate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * "deny maintenance period" start date. If the year of the start date is
+     * empty, the year of the end date also must be empty. In this case, it means
+     * the deny maintenance period recurs every year. The date is in format
+     * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string start_date = 1; + * + * @return The bytes for startDate. + */ + public com.google.protobuf.ByteString getStartDateBytes() { + java.lang.Object ref = startDate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + startDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * "deny maintenance period" start date. If the year of the start date is
+     * empty, the year of the end date also must be empty. In this case, it means
+     * the deny maintenance period recurs every year. The date is in format
+     * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string start_date = 1; + * + * @param value The startDate to set. + * @return This builder for chaining. + */ + public Builder setStartDate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + startDate_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * "deny maintenance period" start date. If the year of the start date is
+     * empty, the year of the end date also must be empty. In this case, it means
+     * the deny maintenance period recurs every year. The date is in format
+     * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string start_date = 1; + * + * @return This builder for chaining. + */ + public Builder clearStartDate() { + startDate_ = getDefaultInstance().getStartDate(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * "deny maintenance period" start date. If the year of the start date is
+     * empty, the year of the end date also must be empty. In this case, it means
+     * the deny maintenance period recurs every year. The date is in format
+     * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string start_date = 1; + * + * @param value The bytes for startDate to set. + * @return This builder for chaining. + */ + public Builder setStartDateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + startDate_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object endDate_ = ""; + + /** + * + * + *
+     * "deny maintenance period" end date. If the year of the end date is empty,
+     * the year of the start date also must be empty. In this case, it means the
+     * deny maintenance period recurs every year. The date is in format yyyy-mm-dd
+     * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string end_date = 2; + * + * @return The endDate. + */ + public java.lang.String getEndDate() { + java.lang.Object ref = endDate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endDate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * "deny maintenance period" end date. If the year of the end date is empty,
+     * the year of the start date also must be empty. In this case, it means the
+     * deny maintenance period recurs every year. The date is in format yyyy-mm-dd
+     * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string end_date = 2; + * + * @return The bytes for endDate. + */ + public com.google.protobuf.ByteString getEndDateBytes() { + java.lang.Object ref = endDate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * "deny maintenance period" end date. If the year of the end date is empty,
+     * the year of the start date also must be empty. In this case, it means the
+     * deny maintenance period recurs every year. The date is in format yyyy-mm-dd
+     * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string end_date = 2; + * + * @param value The endDate to set. + * @return This builder for chaining. + */ + public Builder setEndDate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endDate_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * "deny maintenance period" end date. If the year of the end date is empty,
+     * the year of the start date also must be empty. In this case, it means the
+     * deny maintenance period recurs every year. The date is in format yyyy-mm-dd
+     * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string end_date = 2; + * + * @return This builder for chaining. + */ + public Builder clearEndDate() { + endDate_ = getDefaultInstance().getEndDate(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * "deny maintenance period" end date. If the year of the end date is empty,
+     * the year of the start date also must be empty. In this case, it means the
+     * deny maintenance period recurs every year. The date is in format yyyy-mm-dd
+     * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+     * 
+ * + * string end_date = 2; + * + * @param value The bytes for endDate to set. + * @return This builder for chaining. + */ + public Builder setEndDateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endDate_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object time_ = ""; + + /** + * + * + *
+     * Time in UTC when the "deny maintenance period" starts on start_date and
+     * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+     * 
+ * + * string time = 3; + * + * @return The time. + */ + public java.lang.String getTime() { + java.lang.Object ref = time_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + time_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Time in UTC when the "deny maintenance period" starts on start_date and
+     * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+     * 
+ * + * string time = 3; + * + * @return The bytes for time. + */ + public com.google.protobuf.ByteString getTimeBytes() { + java.lang.Object ref = time_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + time_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Time in UTC when the "deny maintenance period" starts on start_date and
+     * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+     * 
+ * + * string time = 3; + * + * @param value The time to set. + * @return This builder for chaining. + */ + public Builder setTime(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + time_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Time in UTC when the "deny maintenance period" starts on start_date and
+     * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+     * 
+ * + * string time = 3; + * + * @return This builder for chaining. + */ + public Builder clearTime() { + time_ = getDefaultInstance().getTime(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Time in UTC when the "deny maintenance period" starts on start_date and
+     * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+     * 
+ * + * string time = 3; + * + * @param value The bytes for time to set. + * @return This builder for chaining. + */ + public Builder setTimeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + time_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DenyMaintenancePeriod) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DenyMaintenancePeriod) + private static final com.google.cloud.sql.v1beta4.DenyMaintenancePeriod DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DenyMaintenancePeriod(); + } + + public static com.google.cloud.sql.v1beta4.DenyMaintenancePeriod getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DenyMaintenancePeriod parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DenyMaintenancePeriod getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DenyMaintenancePeriodOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DenyMaintenancePeriodOrBuilder.java new file mode 100644 index 000000000000..db380d7e9fb4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DenyMaintenancePeriodOrBuilder.java @@ -0,0 +1,120 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DenyMaintenancePeriodOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DenyMaintenancePeriod) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * "deny maintenance period" start date. If the year of the start date is
+   * empty, the year of the end date also must be empty. In this case, it means
+   * the deny maintenance period recurs every year. The date is in format
+   * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string start_date = 1; + * + * @return The startDate. + */ + java.lang.String getStartDate(); + + /** + * + * + *
+   * "deny maintenance period" start date. If the year of the start date is
+   * empty, the year of the end date also must be empty. In this case, it means
+   * the deny maintenance period recurs every year. The date is in format
+   * yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string start_date = 1; + * + * @return The bytes for startDate. + */ + com.google.protobuf.ByteString getStartDateBytes(); + + /** + * + * + *
+   * "deny maintenance period" end date. If the year of the end date is empty,
+   * the year of the start date also must be empty. In this case, it means the
+   * deny maintenance period recurs every year. The date is in format yyyy-mm-dd
+   * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string end_date = 2; + * + * @return The endDate. + */ + java.lang.String getEndDate(); + + /** + * + * + *
+   * "deny maintenance period" end date. If the year of the end date is empty,
+   * the year of the start date also must be empty. In this case, it means the
+   * deny maintenance period recurs every year. The date is in format yyyy-mm-dd
+   * i.e., 2020-11-01, or mm-dd, i.e., 11-01
+   * 
+ * + * string end_date = 2; + * + * @return The bytes for endDate. + */ + com.google.protobuf.ByteString getEndDateBytes(); + + /** + * + * + *
+   * Time in UTC when the "deny maintenance period" starts on start_date and
+   * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+   * 
+ * + * string time = 3; + * + * @return The time. + */ + java.lang.String getTime(); + + /** + * + * + *
+   * Time in UTC when the "deny maintenance period" starts on start_date and
+   * ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
+   * 
+ * + * string time = 3; + * + * @return The bytes for time. + */ + com.google.protobuf.ByteString getTimeBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DiskEncryptionConfiguration.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DiskEncryptionConfiguration.java new file mode 100644 index 000000000000..d986a5e3ef5f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DiskEncryptionConfiguration.java @@ -0,0 +1,786 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Disk encryption configuration for an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DiskEncryptionConfiguration} + */ +@com.google.protobuf.Generated +public final class DiskEncryptionConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DiskEncryptionConfiguration) + DiskEncryptionConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DiskEncryptionConfiguration"); + } + + // Use DiskEncryptionConfiguration.newBuilder() to construct. + private DiskEncryptionConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DiskEncryptionConfiguration() { + kmsKeyName_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DiskEncryptionConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DiskEncryptionConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.class, + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.Builder.class); + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyName_ = ""; + + /** + * + * + *
+   * Resource name of KMS key for disk encryption
+   * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } + } + + /** + * + * + *
+   * Resource name of KMS key for disk encryption
+   * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#diskEncryptionConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#diskEncryptionConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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.GeneratedMessage.isStringEmpty(kmsKeyName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration other = + (com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration) obj; + + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Disk encryption configuration for an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DiskEncryptionConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DiskEncryptionConfiguration) + com.google.cloud.sql.v1beta4.DiskEncryptionConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DiskEncryptionConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DiskEncryptionConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.class, + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kmsKeyName_ = ""; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DiskEncryptionConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration build() { + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration buildPartial() { + com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration result = + new com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kmsKeyName_ = kmsKeyName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration) { + return mergeFrom((com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration other) { + if (other == com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.getDefaultInstance()) + return this; + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + kmsKeyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + kind_ = 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 kmsKeyName_ = ""; + + /** + * + * + *
+     * Resource name of KMS key for disk encryption
+     * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Resource name of KMS key for disk encryption
+     * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Resource name of KMS key for disk encryption
+     * 
+ * + * string kms_key_name = 1; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Resource name of KMS key for disk encryption
+     * 
+ * + * string kms_key_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Resource name of KMS key for disk encryption
+     * 
+ * + * string kms_key_name = 1; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#diskEncryptionConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DiskEncryptionConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DiskEncryptionConfiguration) + private static final com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration(); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DiskEncryptionConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DiskEncryptionConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DiskEncryptionConfigurationOrBuilder.java new file mode 100644 index 000000000000..b951e0b3746d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DiskEncryptionConfigurationOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DiskEncryptionConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DiskEncryptionConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of KMS key for disk encryption
+   * 
+ * + * string kms_key_name = 1; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + + /** + * + * + *
+   * Resource name of KMS key for disk encryption
+   * 
+ * + * string kms_key_name = 1; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); + + /** + * + * + *
+   * This is always `sql#diskEncryptionConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#diskEncryptionConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DiskEncryptionStatus.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DiskEncryptionStatus.java new file mode 100644 index 000000000000..19ba90802a6e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DiskEncryptionStatus.java @@ -0,0 +1,785 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Disk encryption status for an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DiskEncryptionStatus} + */ +@com.google.protobuf.Generated +public final class DiskEncryptionStatus extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DiskEncryptionStatus) + DiskEncryptionStatusOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DiskEncryptionStatus"); + } + + // Use DiskEncryptionStatus.newBuilder() to construct. + private DiskEncryptionStatus(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DiskEncryptionStatus() { + kmsKeyVersionName_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DiskEncryptionStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DiskEncryptionStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DiskEncryptionStatus.class, + com.google.cloud.sql.v1beta4.DiskEncryptionStatus.Builder.class); + } + + public static final int KMS_KEY_VERSION_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyVersionName_ = ""; + + /** + * + * + *
+   * KMS key version used to encrypt the Cloud SQL instance resource
+   * 
+ * + * string kms_key_version_name = 1; + * + * @return The kmsKeyVersionName. + */ + @java.lang.Override + public java.lang.String getKmsKeyVersionName() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersionName_ = s; + return s; + } + } + + /** + * + * + *
+   * KMS key version used to encrypt the Cloud SQL instance resource
+   * 
+ * + * string kms_key_version_name = 1; + * + * @return The bytes for kmsKeyVersionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyVersionNameBytes() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#diskEncryptionStatus`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#diskEncryptionStatus`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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.GeneratedMessage.isStringEmpty(kmsKeyVersionName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kmsKeyVersionName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kmsKeyVersionName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kmsKeyVersionName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.DiskEncryptionStatus)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DiskEncryptionStatus other = + (com.google.cloud.sql.v1beta4.DiskEncryptionStatus) obj; + + if (!getKmsKeyVersionName().equals(other.getKmsKeyVersionName())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KMS_KEY_VERSION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyVersionName().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionStatus parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionStatus parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionStatus parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.DiskEncryptionStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Disk encryption status for an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DiskEncryptionStatus} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DiskEncryptionStatus) + com.google.cloud.sql.v1beta4.DiskEncryptionStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DiskEncryptionStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DiskEncryptionStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DiskEncryptionStatus.class, + com.google.cloud.sql.v1beta4.DiskEncryptionStatus.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.DiskEncryptionStatus.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kmsKeyVersionName_ = ""; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DiskEncryptionStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionStatus getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DiskEncryptionStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionStatus build() { + com.google.cloud.sql.v1beta4.DiskEncryptionStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionStatus buildPartial() { + com.google.cloud.sql.v1beta4.DiskEncryptionStatus result = + new com.google.cloud.sql.v1beta4.DiskEncryptionStatus(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.DiskEncryptionStatus result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kmsKeyVersionName_ = kmsKeyVersionName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DiskEncryptionStatus) { + return mergeFrom((com.google.cloud.sql.v1beta4.DiskEncryptionStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.DiskEncryptionStatus other) { + if (other == com.google.cloud.sql.v1beta4.DiskEncryptionStatus.getDefaultInstance()) + return this; + if (!other.getKmsKeyVersionName().isEmpty()) { + kmsKeyVersionName_ = other.kmsKeyVersionName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + kmsKeyVersionName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + kind_ = 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 kmsKeyVersionName_ = ""; + + /** + * + * + *
+     * KMS key version used to encrypt the Cloud SQL instance resource
+     * 
+ * + * string kms_key_version_name = 1; + * + * @return The kmsKeyVersionName. + */ + public java.lang.String getKmsKeyVersionName() { + java.lang.Object ref = kmsKeyVersionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * KMS key version used to encrypt the Cloud SQL instance resource
+     * 
+ * + * string kms_key_version_name = 1; + * + * @return The bytes for kmsKeyVersionName. + */ + public com.google.protobuf.ByteString getKmsKeyVersionNameBytes() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * KMS key version used to encrypt the Cloud SQL instance resource
+     * 
+ * + * string kms_key_version_name = 1; + * + * @param value The kmsKeyVersionName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyVersionName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * KMS key version used to encrypt the Cloud SQL instance resource
+     * 
+ * + * string kms_key_version_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyVersionName() { + kmsKeyVersionName_ = getDefaultInstance().getKmsKeyVersionName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * KMS key version used to encrypt the Cloud SQL instance resource
+     * 
+ * + * string kms_key_version_name = 1; + * + * @param value The bytes for kmsKeyVersionName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyVersionName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#diskEncryptionStatus`.
+     * 
+ * + * string kind = 2; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionStatus`.
+     * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionStatus`.
+     * 
+ * + * string kind = 2; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionStatus`.
+     * 
+ * + * string kind = 2; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#diskEncryptionStatus`.
+     * 
+ * + * string kind = 2; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DiskEncryptionStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DiskEncryptionStatus) + private static final com.google.cloud.sql.v1beta4.DiskEncryptionStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DiskEncryptionStatus(); + } + + public static com.google.cloud.sql.v1beta4.DiskEncryptionStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DiskEncryptionStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DiskEncryptionStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DiskEncryptionStatusOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DiskEncryptionStatusOrBuilder.java new file mode 100644 index 000000000000..7214d6ffc6d0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DiskEncryptionStatusOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DiskEncryptionStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DiskEncryptionStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * KMS key version used to encrypt the Cloud SQL instance resource
+   * 
+ * + * string kms_key_version_name = 1; + * + * @return The kmsKeyVersionName. + */ + java.lang.String getKmsKeyVersionName(); + + /** + * + * + *
+   * KMS key version used to encrypt the Cloud SQL instance resource
+   * 
+ * + * string kms_key_version_name = 1; + * + * @return The bytes for kmsKeyVersionName. + */ + com.google.protobuf.ByteString getKmsKeyVersionNameBytes(); + + /** + * + * + *
+   * This is always `sql#diskEncryptionStatus`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#diskEncryptionStatus`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DnsNameMapping.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DnsNameMapping.java new file mode 100644 index 000000000000..0858ff066d8c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DnsNameMapping.java @@ -0,0 +1,1662 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * DNS metadata.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DnsNameMapping} + */ +@com.google.protobuf.Generated +public final class DnsNameMapping extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.DnsNameMapping) + DnsNameMappingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DnsNameMapping"); + } + + // Use DnsNameMapping.newBuilder() to construct. + private DnsNameMapping(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DnsNameMapping() { + name_ = ""; + connectionType_ = 0; + dnsScope_ = 0; + recordManager_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DnsNameMapping_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DnsNameMapping_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DnsNameMapping.class, + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder.class); + } + + /** + * + * + *
+   * The connection type of the DNS name.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType} + */ + public enum ConnectionType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown connection type.
+     * 
+ * + * CONNECTION_TYPE_UNSPECIFIED = 0; + */ + CONNECTION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Public IP.
+     * 
+ * + * PUBLIC = 1; + */ + PUBLIC(1), + /** + * + * + *
+     * Private services access (private IP).
+     * 
+ * + * PRIVATE_SERVICES_ACCESS = 2; + */ + PRIVATE_SERVICES_ACCESS(2), + /** + * + * + *
+     * Private Service Connect.
+     * 
+ * + * PRIVATE_SERVICE_CONNECT = 3; + */ + PRIVATE_SERVICE_CONNECT(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ConnectionType"); + } + + /** + * + * + *
+     * Unknown connection type.
+     * 
+ * + * CONNECTION_TYPE_UNSPECIFIED = 0; + */ + public static final int CONNECTION_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Public IP.
+     * 
+ * + * PUBLIC = 1; + */ + public static final int PUBLIC_VALUE = 1; + + /** + * + * + *
+     * Private services access (private IP).
+     * 
+ * + * PRIVATE_SERVICES_ACCESS = 2; + */ + public static final int PRIVATE_SERVICES_ACCESS_VALUE = 2; + + /** + * + * + *
+     * Private Service Connect.
+     * 
+ * + * PRIVATE_SERVICE_CONNECT = 3; + */ + public static final int PRIVATE_SERVICE_CONNECT_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 PUBLIC; + case 2: + return PRIVATE_SERVICES_ACCESS; + case 3: + return PRIVATE_SERVICE_CONNECT; + 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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.DnsNameMapping.getDescriptor().getEnumTypes().get(0); + } + + 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.sql.v1beta4.DnsNameMapping.ConnectionType) + } + + /** + * + * + *
+   * The scope that the DNS name applies to.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.DnsNameMapping.DnsScope} + */ + public enum DnsScope implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * DNS scope not set. This value should not be used.
+     * 
+ * + * DNS_SCOPE_UNSPECIFIED = 0; + */ + DNS_SCOPE_UNSPECIFIED(0), + /** + * + * + *
+     * Indicates an instance-level DNS name.
+     * 
+ * + * INSTANCE = 1; + */ + INSTANCE(1), + /** + * + * + *
+     * Indicates a cluster-level DNS name.
+     * 
+ * + * CLUSTER = 2; + */ + CLUSTER(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DnsScope"); + } + + /** + * + * + *
+     * DNS scope not set. This value should not be used.
+     * 
+ * + * DNS_SCOPE_UNSPECIFIED = 0; + */ + public static final int DNS_SCOPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Indicates an instance-level DNS name.
+     * 
+ * + * INSTANCE = 1; + */ + public static final int INSTANCE_VALUE = 1; + + /** + * + * + *
+     * Indicates a cluster-level DNS name.
+     * 
+ * + * 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 DnsScope 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 DnsScope forNumber(int value) { + switch (value) { + case 0: + return DNS_SCOPE_UNSPECIFIED; + case 1: + return INSTANCE; + 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 DnsScope findValueByNumber(int number) { + return DnsScope.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.DnsNameMapping.getDescriptor().getEnumTypes().get(1); + } + + private static final DnsScope[] VALUES = values(); + + public static DnsScope 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 DnsScope(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.DnsNameMapping.DnsScope) + } + + /** + * + * + *
+   * The system responsible for managing the DNS record.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.DnsNameMapping.RecordManager} + */ + public enum RecordManager implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Record manager not set. This value should not be used.
+     * 
+ * + * RECORD_MANAGER_UNSPECIFIED = 0; + */ + RECORD_MANAGER_UNSPECIFIED(0), + /** + * + * + *
+     * The record may be managed by the customer. It is not automatically
+     * managed by Cloud SQL automation.
+     * 
+ * + * CUSTOMER = 1; + */ + CUSTOMER(1), + /** + * + * + *
+     * The record is managed by Cloud SQL, which will create, update, and delete
+     * the DNS records for the zone automatically when the Cloud SQL database
+     * instance is created or updated.
+     * 
+ * + * CLOUD_SQL_AUTOMATION = 2; + */ + CLOUD_SQL_AUTOMATION(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RecordManager"); + } + + /** + * + * + *
+     * Record manager not set. This value should not be used.
+     * 
+ * + * RECORD_MANAGER_UNSPECIFIED = 0; + */ + public static final int RECORD_MANAGER_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The record may be managed by the customer. It is not automatically
+     * managed by Cloud SQL automation.
+     * 
+ * + * CUSTOMER = 1; + */ + public static final int CUSTOMER_VALUE = 1; + + /** + * + * + *
+     * The record is managed by Cloud SQL, which will create, update, and delete
+     * the DNS records for the zone automatically when the Cloud SQL database
+     * instance is created or updated.
+     * 
+ * + * CLOUD_SQL_AUTOMATION = 2; + */ + public static final int CLOUD_SQL_AUTOMATION_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 RecordManager 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 RecordManager forNumber(int value) { + switch (value) { + case 0: + return RECORD_MANAGER_UNSPECIFIED; + case 1: + return CUSTOMER; + case 2: + return CLOUD_SQL_AUTOMATION; + 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 RecordManager findValueByNumber(int number) { + return RecordManager.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.DnsNameMapping.getDescriptor().getEnumTypes().get(2); + } + + private static final RecordManager[] VALUES = values(); + + public static RecordManager 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 RecordManager(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.DnsNameMapping.RecordManager) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Output only. The DNS name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The DNS name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONNECTION_TYPE_FIELD_NUMBER = 2; + private int connectionType_ = 0; + + /** + * + * + *
+   * Output only. The connection type of the DNS name.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType connection_type = 2 [(.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. The connection type of the DNS name.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType connection_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType getConnectionType() { + com.google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType result = + com.google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType.forNumber(connectionType_); + return result == null + ? com.google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType.UNRECOGNIZED + : result; + } + + public static final int DNS_SCOPE_FIELD_NUMBER = 3; + private int dnsScope_ = 0; + + /** + * + * + *
+   * Output only. The scope that the DNS name applies to.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for dnsScope. + */ + @java.lang.Override + public int getDnsScopeValue() { + return dnsScope_; + } + + /** + * + * + *
+   * Output only. The scope that the DNS name applies to.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The dnsScope. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMapping.DnsScope getDnsScope() { + com.google.cloud.sql.v1beta4.DnsNameMapping.DnsScope result = + com.google.cloud.sql.v1beta4.DnsNameMapping.DnsScope.forNumber(dnsScope_); + return result == null + ? com.google.cloud.sql.v1beta4.DnsNameMapping.DnsScope.UNRECOGNIZED + : result; + } + + public static final int RECORD_MANAGER_FIELD_NUMBER = 4; + private int recordManager_ = 0; + + /** + * + * + *
+   * Output only. The manager for this DNS record.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for recordManager. + */ + @java.lang.Override + public int getRecordManagerValue() { + return recordManager_; + } + + /** + * + * + *
+   * Output only. The manager for this DNS record.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The recordManager. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMapping.RecordManager getRecordManager() { + com.google.cloud.sql.v1beta4.DnsNameMapping.RecordManager result = + com.google.cloud.sql.v1beta4.DnsNameMapping.RecordManager.forNumber(recordManager_); + return result == null + ? com.google.cloud.sql.v1beta4.DnsNameMapping.RecordManager.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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (connectionType_ + != com.google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType.CONNECTION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, connectionType_); + } + if (dnsScope_ + != com.google.cloud.sql.v1beta4.DnsNameMapping.DnsScope.DNS_SCOPE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, dnsScope_); + } + if (recordManager_ + != com.google.cloud.sql.v1beta4.DnsNameMapping.RecordManager.RECORD_MANAGER_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, recordManager_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (connectionType_ + != com.google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType.CONNECTION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, connectionType_); + } + if (dnsScope_ + != com.google.cloud.sql.v1beta4.DnsNameMapping.DnsScope.DNS_SCOPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, dnsScope_); + } + if (recordManager_ + != com.google.cloud.sql.v1beta4.DnsNameMapping.RecordManager.RECORD_MANAGER_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, recordManager_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.DnsNameMapping)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.DnsNameMapping other = + (com.google.cloud.sql.v1beta4.DnsNameMapping) obj; + + if (!getName().equals(other.getName())) return false; + if (connectionType_ != other.connectionType_) return false; + if (dnsScope_ != other.dnsScope_) return false; + if (recordManager_ != other.recordManager_) return false; + if (!getUnknownFields().equals(other.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) + CONNECTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + connectionType_; + hash = (37 * hash) + DNS_SCOPE_FIELD_NUMBER; + hash = (53 * hash) + dnsScope_; + hash = (37 * hash) + RECORD_MANAGER_FIELD_NUMBER; + hash = (53 * hash) + recordManager_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.DnsNameMapping parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DnsNameMapping parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DnsNameMapping parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DnsNameMapping parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DnsNameMapping parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.DnsNameMapping parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DnsNameMapping parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DnsNameMapping parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DnsNameMapping parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DnsNameMapping parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.DnsNameMapping parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.DnsNameMapping parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.DnsNameMapping prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * DNS metadata.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.DnsNameMapping} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.DnsNameMapping) + com.google.cloud.sql.v1beta4.DnsNameMappingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DnsNameMapping_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DnsNameMapping_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.DnsNameMapping.class, + com.google.cloud.sql.v1beta4.DnsNameMapping.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.DnsNameMapping.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + connectionType_ = 0; + dnsScope_ = 0; + recordManager_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_DnsNameMapping_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMapping getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.DnsNameMapping.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMapping build() { + com.google.cloud.sql.v1beta4.DnsNameMapping result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMapping buildPartial() { + com.google.cloud.sql.v1beta4.DnsNameMapping result = + new com.google.cloud.sql.v1beta4.DnsNameMapping(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.DnsNameMapping result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.connectionType_ = connectionType_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dnsScope_ = dnsScope_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.recordManager_ = recordManager_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.DnsNameMapping) { + return mergeFrom((com.google.cloud.sql.v1beta4.DnsNameMapping) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.DnsNameMapping other) { + if (other == com.google.cloud.sql.v1beta4.DnsNameMapping.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.connectionType_ != 0) { + setConnectionTypeValue(other.getConnectionTypeValue()); + } + if (other.dnsScope_ != 0) { + setDnsScopeValue(other.getDnsScopeValue()); + } + if (other.recordManager_ != 0) { + setRecordManagerValue(other.getRecordManagerValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + connectionType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + dnsScope_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + recordManager_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. The DNS name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The DNS name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The DNS name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The DNS name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The DNS name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int connectionType_ = 0; + + /** + * + * + *
+     * Output only. The connection type of the DNS name.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType connection_type = 2 [(.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. The connection type of the DNS name.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType connection_type = 2 [(.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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The connection type of the DNS name.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType connection_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType getConnectionType() { + com.google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType result = + com.google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType.forNumber(connectionType_); + return result == null + ? com.google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. The connection type of the DNS name.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType connection_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The connectionType to set. + * @return This builder for chaining. + */ + public Builder setConnectionType( + com.google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + connectionType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The connection type of the DNS name.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType connection_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearConnectionType() { + bitField0_ = (bitField0_ & ~0x00000002); + connectionType_ = 0; + onChanged(); + return this; + } + + private int dnsScope_ = 0; + + /** + * + * + *
+     * Output only. The scope that the DNS name applies to.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for dnsScope. + */ + @java.lang.Override + public int getDnsScopeValue() { + return dnsScope_; + } + + /** + * + * + *
+     * Output only. The scope that the DNS name applies to.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for dnsScope to set. + * @return This builder for chaining. + */ + public Builder setDnsScopeValue(int value) { + dnsScope_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The scope that the DNS name applies to.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The dnsScope. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMapping.DnsScope getDnsScope() { + com.google.cloud.sql.v1beta4.DnsNameMapping.DnsScope result = + com.google.cloud.sql.v1beta4.DnsNameMapping.DnsScope.forNumber(dnsScope_); + return result == null + ? com.google.cloud.sql.v1beta4.DnsNameMapping.DnsScope.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. The scope that the DNS name applies to.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The dnsScope to set. + * @return This builder for chaining. + */ + public Builder setDnsScope(com.google.cloud.sql.v1beta4.DnsNameMapping.DnsScope value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + dnsScope_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The scope that the DNS name applies to.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDnsScope() { + bitField0_ = (bitField0_ & ~0x00000004); + dnsScope_ = 0; + onChanged(); + return this; + } + + private int recordManager_ = 0; + + /** + * + * + *
+     * Output only. The manager for this DNS record.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for recordManager. + */ + @java.lang.Override + public int getRecordManagerValue() { + return recordManager_; + } + + /** + * + * + *
+     * Output only. The manager for this DNS record.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for recordManager to set. + * @return This builder for chaining. + */ + public Builder setRecordManagerValue(int value) { + recordManager_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The manager for this DNS record.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The recordManager. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMapping.RecordManager getRecordManager() { + com.google.cloud.sql.v1beta4.DnsNameMapping.RecordManager result = + com.google.cloud.sql.v1beta4.DnsNameMapping.RecordManager.forNumber(recordManager_); + return result == null + ? com.google.cloud.sql.v1beta4.DnsNameMapping.RecordManager.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. The manager for this DNS record.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The recordManager to set. + * @return This builder for chaining. + */ + public Builder setRecordManager( + com.google.cloud.sql.v1beta4.DnsNameMapping.RecordManager value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + recordManager_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The manager for this DNS record.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearRecordManager() { + bitField0_ = (bitField0_ & ~0x00000008); + recordManager_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.DnsNameMapping) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.DnsNameMapping) + private static final com.google.cloud.sql.v1beta4.DnsNameMapping DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.DnsNameMapping(); + } + + public static com.google.cloud.sql.v1beta4.DnsNameMapping getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DnsNameMapping parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.DnsNameMapping getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DnsNameMappingOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DnsNameMappingOrBuilder.java new file mode 100644 index 000000000000..aca00d0a5466 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/DnsNameMappingOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface DnsNameMappingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.DnsNameMapping) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The DNS name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Output only. The DNS name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The connection type of the DNS name.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType connection_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionType. + */ + int getConnectionTypeValue(); + + /** + * + * + *
+   * Output only. The connection type of the DNS name.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType connection_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + com.google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType getConnectionType(); + + /** + * + * + *
+   * Output only. The scope that the DNS name applies to.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for dnsScope. + */ + int getDnsScopeValue(); + + /** + * + * + *
+   * Output only. The scope that the DNS name applies to.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.DnsScope dns_scope = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The dnsScope. + */ + com.google.cloud.sql.v1beta4.DnsNameMapping.DnsScope getDnsScope(); + + /** + * + * + *
+   * Output only. The manager for this DNS record.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for recordManager. + */ + int getRecordManagerValue(); + + /** + * + * + *
+   * Output only. The manager for this DNS record.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DnsNameMapping.RecordManager record_manager = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The recordManager. + */ + com.google.cloud.sql.v1beta4.DnsNameMapping.RecordManager getRecordManager(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExecuteSqlPayload.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExecuteSqlPayload.java new file mode 100644 index 000000000000..6e764b429d35 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExecuteSqlPayload.java @@ -0,0 +1,1901 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The request payload used to execute SQL statements.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ExecuteSqlPayload} + */ +@com.google.protobuf.Generated +public final class ExecuteSqlPayload extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ExecuteSqlPayload) + ExecuteSqlPayloadOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExecuteSqlPayload"); + } + + // Use ExecuteSqlPayload.newBuilder() to construct. + private ExecuteSqlPayload(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ExecuteSqlPayload() { + user_ = ""; + sqlStatement_ = ""; + database_ = ""; + partialResultMode_ = 0; + application_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ExecuteSqlPayload_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ExecuteSqlPayload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExecuteSqlPayload.class, + com.google.cloud.sql.v1beta4.ExecuteSqlPayload.Builder.class); + } + + /** + * + * + *
+   * Controls how the API should respond when the SQL execution result exceeds
+   * 10 MB.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode} + */ + public enum PartialResultMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified mode, effectively the same as `FAIL_PARTIAL_RESULT`.
+     * 
+ * + * PARTIAL_RESULT_MODE_UNSPECIFIED = 0; + */ + PARTIAL_RESULT_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Throw an error if the result exceeds 10 MB or if only a partial result
+     * can be retrieved. Don't return the result.
+     * 
+ * + * FAIL_PARTIAL_RESULT = 1; + */ + FAIL_PARTIAL_RESULT(1), + /** + * + * + *
+     * Return a truncated result and set `partial_result` to true if the result
+     * exceeds 10 MB or if only a partial result can be retrieved due to error.
+     * Don't throw an error.
+     * 
+ * + * ALLOW_PARTIAL_RESULT = 2; + */ + ALLOW_PARTIAL_RESULT(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PartialResultMode"); + } + + /** + * + * + *
+     * Unspecified mode, effectively the same as `FAIL_PARTIAL_RESULT`.
+     * 
+ * + * PARTIAL_RESULT_MODE_UNSPECIFIED = 0; + */ + public static final int PARTIAL_RESULT_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Throw an error if the result exceeds 10 MB or if only a partial result
+     * can be retrieved. Don't return the result.
+     * 
+ * + * FAIL_PARTIAL_RESULT = 1; + */ + public static final int FAIL_PARTIAL_RESULT_VALUE = 1; + + /** + * + * + *
+     * Return a truncated result and set `partial_result` to true if the result
+     * exceeds 10 MB or if only a partial result can be retrieved due to error.
+     * Don't throw an error.
+     * 
+ * + * ALLOW_PARTIAL_RESULT = 2; + */ + public static final int ALLOW_PARTIAL_RESULT_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 PartialResultMode 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 PartialResultMode forNumber(int value) { + switch (value) { + case 0: + return PARTIAL_RESULT_MODE_UNSPECIFIED; + case 1: + return FAIL_PARTIAL_RESULT; + case 2: + return ALLOW_PARTIAL_RESULT; + 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 PartialResultMode findValueByNumber(int number) { + return PartialResultMode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.ExecuteSqlPayload.getDescriptor().getEnumTypes().get(0); + } + + private static final PartialResultMode[] VALUES = values(); + + public static PartialResultMode 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 PartialResultMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode) + } + + private int userPasswordCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object userPassword_; + + public enum UserPasswordCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AUTO_IAM_AUTHN(11), + USERPASSWORD_NOT_SET(0); + private final int value; + + private UserPasswordCase(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 UserPasswordCase valueOf(int value) { + return forNumber(value); + } + + public static UserPasswordCase forNumber(int value) { + switch (value) { + case 11: + return AUTO_IAM_AUTHN; + case 0: + return USERPASSWORD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public UserPasswordCase getUserPasswordCase() { + return UserPasswordCase.forNumber(userPasswordCase_); + } + + public static final int USER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object user_ = ""; + + /** + * + * + *
+   * Optional. The name of an existing database user to connect to the database.
+   * When `auto_iam_authn` is set to true, this field is ignored and the API
+   * caller's IAM user is used.
+   * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The user. + */ + @java.lang.Override + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The name of an existing database user to connect to the database.
+   * When `auto_iam_authn` is set to true, this field is ignored and the API
+   * caller's IAM user is used.
+   * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for user. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SQL_STATEMENT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object sqlStatement_ = ""; + + /** + * + * + *
+   * Required. SQL statements to run on the database. It can be a single
+   * statement or a sequence of statements separated by semicolons.
+   * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sqlStatement. + */ + @java.lang.Override + public java.lang.String getSqlStatement() { + java.lang.Object ref = sqlStatement_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sqlStatement_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. SQL statements to run on the database. It can be a single
+   * statement or a sequence of statements separated by semicolons.
+   * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for sqlStatement. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSqlStatementBytes() { + java.lang.Object ref = sqlStatement_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sqlStatement_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * Optional. Name of the database on which the statement will be executed.
+   * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Name of the database on which the statement will be executed.
+   * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTO_IAM_AUTHN_FIELD_NUMBER = 11; + + /** + * + * + *
+   * Optional. When set to true, the API caller identity associated with the
+   * request is used for database authentication. The API caller must be an
+   * IAM user in the database.
+   * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the autoIamAuthn field is set. + */ + @java.lang.Override + public boolean hasAutoIamAuthn() { + return userPasswordCase_ == 11; + } + + /** + * + * + *
+   * Optional. When set to true, the API caller identity associated with the
+   * request is used for database authentication. The API caller must be an
+   * IAM user in the database.
+   * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The autoIamAuthn. + */ + @java.lang.Override + public boolean getAutoIamAuthn() { + if (userPasswordCase_ == 11) { + return (java.lang.Boolean) userPassword_; + } + return false; + } + + public static final int ROW_LIMIT_FIELD_NUMBER = 10; + private long rowLimit_ = 0L; + + /** + * + * + *
+   * Optional. The maximum number of rows returned per SQL statement.
+   * 
+ * + * int64 row_limit = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The rowLimit. + */ + @java.lang.Override + public long getRowLimit() { + return rowLimit_; + } + + public static final int PARTIAL_RESULT_MODE_FIELD_NUMBER = 13; + private int partialResultMode_ = 0; + + /** + * + * + *
+   * Optional. Controls how the API should respond when the SQL execution result
+   * is incomplete due to the size limit or another error. The default mode is
+   * to throw an error.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for partialResultMode. + */ + @java.lang.Override + public int getPartialResultModeValue() { + return partialResultMode_; + } + + /** + * + * + *
+   * Optional. Controls how the API should respond when the SQL execution result
+   * is incomplete due to the size limit or another error. The default mode is
+   * to throw an error.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The partialResultMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode getPartialResultMode() { + com.google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode result = + com.google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode.forNumber( + partialResultMode_); + return result == null + ? com.google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode.UNRECOGNIZED + : result; + } + + public static final int APPLICATION_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private volatile java.lang.Object application_ = ""; + + /** + * + * + *
+   * Optional. Specifies the name of the application that is making the request.
+   * This field is used for telemetry. Only alphanumeric characters, dashes, and
+   * underscores are allowed. The maximum length is 32 characters.
+   * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The application. + */ + @java.lang.Override + public java.lang.String getApplication() { + java.lang.Object ref = application_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + application_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Specifies the name of the application that is making the request.
+   * This field is used for telemetry. Only alphanumeric characters, dashes, and
+   * underscores are allowed. The maximum length is 32 characters.
+   * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for application. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApplicationBytes() { + java.lang.Object ref = application_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + application_ = 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.GeneratedMessage.isStringEmpty(user_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, user_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sqlStatement_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, sqlStatement_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, database_); + } + if (rowLimit_ != 0L) { + output.writeInt64(10, rowLimit_); + } + if (userPasswordCase_ == 11) { + output.writeBool(11, (boolean) ((java.lang.Boolean) userPassword_)); + } + if (partialResultMode_ + != com.google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode + .PARTIAL_RESULT_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(13, partialResultMode_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(application_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 16, application_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(user_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, user_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sqlStatement_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, sqlStatement_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, database_); + } + if (rowLimit_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(10, rowLimit_); + } + if (userPasswordCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 11, (boolean) ((java.lang.Boolean) userPassword_)); + } + if (partialResultMode_ + != com.google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode + .PARTIAL_RESULT_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, partialResultMode_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(application_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(16, application_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ExecuteSqlPayload)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ExecuteSqlPayload other = + (com.google.cloud.sql.v1beta4.ExecuteSqlPayload) obj; + + if (!getUser().equals(other.getUser())) return false; + if (!getSqlStatement().equals(other.getSqlStatement())) return false; + if (!getDatabase().equals(other.getDatabase())) return false; + if (getRowLimit() != other.getRowLimit()) return false; + if (partialResultMode_ != other.partialResultMode_) return false; + if (!getApplication().equals(other.getApplication())) return false; + if (!getUserPasswordCase().equals(other.getUserPasswordCase())) return false; + switch (userPasswordCase_) { + case 11: + if (getAutoIamAuthn() != other.getAutoIamAuthn()) 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) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + hash = (37 * hash) + SQL_STATEMENT_FIELD_NUMBER; + hash = (53 * hash) + getSqlStatement().hashCode(); + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + ROW_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRowLimit()); + hash = (37 * hash) + PARTIAL_RESULT_MODE_FIELD_NUMBER; + hash = (53 * hash) + partialResultMode_; + hash = (37 * hash) + APPLICATION_FIELD_NUMBER; + hash = (53 * hash) + getApplication().hashCode(); + switch (userPasswordCase_) { + case 11: + hash = (37 * hash) + AUTO_IAM_AUTHN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAutoIamAuthn()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ExecuteSqlPayload parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExecuteSqlPayload parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExecuteSqlPayload parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExecuteSqlPayload parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExecuteSqlPayload parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExecuteSqlPayload parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExecuteSqlPayload parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExecuteSqlPayload parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExecuteSqlPayload parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExecuteSqlPayload parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExecuteSqlPayload parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExecuteSqlPayload parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.ExecuteSqlPayload prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request payload used to execute SQL statements.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ExecuteSqlPayload} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ExecuteSqlPayload) + com.google.cloud.sql.v1beta4.ExecuteSqlPayloadOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ExecuteSqlPayload_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ExecuteSqlPayload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExecuteSqlPayload.class, + com.google.cloud.sql.v1beta4.ExecuteSqlPayload.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ExecuteSqlPayload.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + user_ = ""; + sqlStatement_ = ""; + database_ = ""; + rowLimit_ = 0L; + partialResultMode_ = 0; + application_ = ""; + userPasswordCase_ = 0; + userPassword_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ExecuteSqlPayload_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExecuteSqlPayload getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ExecuteSqlPayload.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExecuteSqlPayload build() { + com.google.cloud.sql.v1beta4.ExecuteSqlPayload result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExecuteSqlPayload buildPartial() { + com.google.cloud.sql.v1beta4.ExecuteSqlPayload result = + new com.google.cloud.sql.v1beta4.ExecuteSqlPayload(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ExecuteSqlPayload result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.user_ = user_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sqlStatement_ = sqlStatement_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.database_ = database_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.rowLimit_ = rowLimit_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.partialResultMode_ = partialResultMode_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.application_ = application_; + } + } + + private void buildPartialOneofs(com.google.cloud.sql.v1beta4.ExecuteSqlPayload result) { + result.userPasswordCase_ = userPasswordCase_; + result.userPassword_ = this.userPassword_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ExecuteSqlPayload) { + return mergeFrom((com.google.cloud.sql.v1beta4.ExecuteSqlPayload) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ExecuteSqlPayload other) { + if (other == com.google.cloud.sql.v1beta4.ExecuteSqlPayload.getDefaultInstance()) return this; + if (!other.getUser().isEmpty()) { + user_ = other.user_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getSqlStatement().isEmpty()) { + sqlStatement_ = other.sqlStatement_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getRowLimit() != 0L) { + setRowLimit(other.getRowLimit()); + } + if (other.partialResultMode_ != 0) { + setPartialResultModeValue(other.getPartialResultModeValue()); + } + if (!other.getApplication().isEmpty()) { + application_ = other.application_; + bitField0_ |= 0x00000040; + onChanged(); + } + switch (other.getUserPasswordCase()) { + case AUTO_IAM_AUTHN: + { + setAutoIamAuthn(other.getAutoIamAuthn()); + break; + } + case USERPASSWORD_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: + { + user_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + sqlStatement_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + database_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 80: + { + rowLimit_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 80 + case 88: + { + userPassword_ = input.readBool(); + userPasswordCase_ = 11; + break; + } // case 88 + case 104: + { + partialResultMode_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 104 + case 130: + { + application_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 130 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int userPasswordCase_ = 0; + private java.lang.Object userPassword_; + + public UserPasswordCase getUserPasswordCase() { + return UserPasswordCase.forNumber(userPasswordCase_); + } + + public Builder clearUserPassword() { + userPasswordCase_ = 0; + userPassword_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object user_ = ""; + + /** + * + * + *
+     * Optional. The name of an existing database user to connect to the database.
+     * When `auto_iam_authn` is set to true, this field is ignored and the API
+     * caller's IAM user is used.
+     * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The user. + */ + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The name of an existing database user to connect to the database.
+     * When `auto_iam_authn` is set to true, this field is ignored and the API
+     * caller's IAM user is used.
+     * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for user. + */ + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The name of an existing database user to connect to the database.
+     * When `auto_iam_authn` is set to true, this field is ignored and the API
+     * caller's IAM user is used.
+     * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The user to set. + * @return This builder for chaining. + */ + public Builder setUser(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of an existing database user to connect to the database.
+     * When `auto_iam_authn` is set to true, this field is ignored and the API
+     * caller's IAM user is used.
+     * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearUser() { + user_ = getDefaultInstance().getUser(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of an existing database user to connect to the database.
+     * When `auto_iam_authn` is set to true, this field is ignored and the API
+     * caller's IAM user is used.
+     * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for user to set. + * @return This builder for chaining. + */ + public Builder setUserBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + user_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object sqlStatement_ = ""; + + /** + * + * + *
+     * Required. SQL statements to run on the database. It can be a single
+     * statement or a sequence of statements separated by semicolons.
+     * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sqlStatement. + */ + public java.lang.String getSqlStatement() { + java.lang.Object ref = sqlStatement_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sqlStatement_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. SQL statements to run on the database. It can be a single
+     * statement or a sequence of statements separated by semicolons.
+     * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for sqlStatement. + */ + public com.google.protobuf.ByteString getSqlStatementBytes() { + java.lang.Object ref = sqlStatement_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sqlStatement_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. SQL statements to run on the database. It can be a single
+     * statement or a sequence of statements separated by semicolons.
+     * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The sqlStatement to set. + * @return This builder for chaining. + */ + public Builder setSqlStatement(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sqlStatement_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. SQL statements to run on the database. It can be a single
+     * statement or a sequence of statements separated by semicolons.
+     * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearSqlStatement() { + sqlStatement_ = getDefaultInstance().getSqlStatement(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. SQL statements to run on the database. It can be a single
+     * statement or a sequence of statements separated by semicolons.
+     * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for sqlStatement to set. + * @return This builder for chaining. + */ + public Builder setSqlStatementBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sqlStatement_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object database_ = ""; + + /** + * + * + *
+     * Optional. Name of the database on which the statement will be executed.
+     * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Name of the database on which the statement will be executed.
+     * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Name of the database on which the statement will be executed.
+     * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + database_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Name of the database on which the statement will be executed.
+     * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Name of the database on which the statement will be executed.
+     * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + database_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When set to true, the API caller identity associated with the
+     * request is used for database authentication. The API caller must be an
+     * IAM user in the database.
+     * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the autoIamAuthn field is set. + */ + public boolean hasAutoIamAuthn() { + return userPasswordCase_ == 11; + } + + /** + * + * + *
+     * Optional. When set to true, the API caller identity associated with the
+     * request is used for database authentication. The API caller must be an
+     * IAM user in the database.
+     * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The autoIamAuthn. + */ + public boolean getAutoIamAuthn() { + if (userPasswordCase_ == 11) { + return (java.lang.Boolean) userPassword_; + } + return false; + } + + /** + * + * + *
+     * Optional. When set to true, the API caller identity associated with the
+     * request is used for database authentication. The API caller must be an
+     * IAM user in the database.
+     * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The autoIamAuthn to set. + * @return This builder for chaining. + */ + public Builder setAutoIamAuthn(boolean value) { + + userPasswordCase_ = 11; + userPassword_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When set to true, the API caller identity associated with the
+     * request is used for database authentication. The API caller must be an
+     * IAM user in the database.
+     * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAutoIamAuthn() { + if (userPasswordCase_ == 11) { + userPasswordCase_ = 0; + userPassword_ = null; + onChanged(); + } + return this; + } + + private long rowLimit_; + + /** + * + * + *
+     * Optional. The maximum number of rows returned per SQL statement.
+     * 
+ * + * int64 row_limit = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The rowLimit. + */ + @java.lang.Override + public long getRowLimit() { + return rowLimit_; + } + + /** + * + * + *
+     * Optional. The maximum number of rows returned per SQL statement.
+     * 
+ * + * int64 row_limit = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The rowLimit to set. + * @return This builder for chaining. + */ + public Builder setRowLimit(long value) { + + rowLimit_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of rows returned per SQL statement.
+     * 
+ * + * int64 row_limit = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRowLimit() { + bitField0_ = (bitField0_ & ~0x00000010); + rowLimit_ = 0L; + onChanged(); + return this; + } + + private int partialResultMode_ = 0; + + /** + * + * + *
+     * Optional. Controls how the API should respond when the SQL execution result
+     * is incomplete due to the size limit or another error. The default mode is
+     * to throw an error.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for partialResultMode. + */ + @java.lang.Override + public int getPartialResultModeValue() { + return partialResultMode_; + } + + /** + * + * + *
+     * Optional. Controls how the API should respond when the SQL execution result
+     * is incomplete due to the size limit or another error. The default mode is
+     * to throw an error.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for partialResultMode to set. + * @return This builder for chaining. + */ + public Builder setPartialResultModeValue(int value) { + partialResultMode_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Controls how the API should respond when the SQL execution result
+     * is incomplete due to the size limit or another error. The default mode is
+     * to throw an error.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The partialResultMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode getPartialResultMode() { + com.google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode result = + com.google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode.forNumber( + partialResultMode_); + return result == null + ? com.google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. Controls how the API should respond when the SQL execution result
+     * is incomplete due to the size limit or another error. The default mode is
+     * to throw an error.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The partialResultMode to set. + * @return This builder for chaining. + */ + public Builder setPartialResultMode( + com.google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + partialResultMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Controls how the API should respond when the SQL execution result
+     * is incomplete due to the size limit or another error. The default mode is
+     * to throw an error.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPartialResultMode() { + bitField0_ = (bitField0_ & ~0x00000020); + partialResultMode_ = 0; + onChanged(); + return this; + } + + private java.lang.Object application_ = ""; + + /** + * + * + *
+     * Optional. Specifies the name of the application that is making the request.
+     * This field is used for telemetry. Only alphanumeric characters, dashes, and
+     * underscores are allowed. The maximum length is 32 characters.
+     * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The application. + */ + public java.lang.String getApplication() { + java.lang.Object ref = application_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + application_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Specifies the name of the application that is making the request.
+     * This field is used for telemetry. Only alphanumeric characters, dashes, and
+     * underscores are allowed. The maximum length is 32 characters.
+     * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for application. + */ + public com.google.protobuf.ByteString getApplicationBytes() { + java.lang.Object ref = application_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + application_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Specifies the name of the application that is making the request.
+     * This field is used for telemetry. Only alphanumeric characters, dashes, and
+     * underscores are allowed. The maximum length is 32 characters.
+     * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The application to set. + * @return This builder for chaining. + */ + public Builder setApplication(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + application_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the name of the application that is making the request.
+     * This field is used for telemetry. Only alphanumeric characters, dashes, and
+     * underscores are allowed. The maximum length is 32 characters.
+     * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearApplication() { + application_ = getDefaultInstance().getApplication(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the name of the application that is making the request.
+     * This field is used for telemetry. Only alphanumeric characters, dashes, and
+     * underscores are allowed. The maximum length is 32 characters.
+     * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for application to set. + * @return This builder for chaining. + */ + public Builder setApplicationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + application_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ExecuteSqlPayload) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ExecuteSqlPayload) + private static final com.google.cloud.sql.v1beta4.ExecuteSqlPayload DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ExecuteSqlPayload(); + } + + public static com.google.cloud.sql.v1beta4.ExecuteSqlPayload getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExecuteSqlPayload parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExecuteSqlPayload getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExecuteSqlPayloadOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExecuteSqlPayloadOrBuilder.java new file mode 100644 index 000000000000..aed538955cc7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExecuteSqlPayloadOrBuilder.java @@ -0,0 +1,221 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ExecuteSqlPayloadOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ExecuteSqlPayload) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The name of an existing database user to connect to the database.
+   * When `auto_iam_authn` is set to true, this field is ignored and the API
+   * caller's IAM user is used.
+   * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The user. + */ + java.lang.String getUser(); + + /** + * + * + *
+   * Optional. The name of an existing database user to connect to the database.
+   * When `auto_iam_authn` is set to true, this field is ignored and the API
+   * caller's IAM user is used.
+   * 
+ * + * string user = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for user. + */ + com.google.protobuf.ByteString getUserBytes(); + + /** + * + * + *
+   * Required. SQL statements to run on the database. It can be a single
+   * statement or a sequence of statements separated by semicolons.
+   * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sqlStatement. + */ + java.lang.String getSqlStatement(); + + /** + * + * + *
+   * Required. SQL statements to run on the database. It can be a single
+   * statement or a sequence of statements separated by semicolons.
+   * 
+ * + * string sql_statement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for sqlStatement. + */ + com.google.protobuf.ByteString getSqlStatementBytes(); + + /** + * + * + *
+   * Optional. Name of the database on which the statement will be executed.
+   * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * Optional. Name of the database on which the statement will be executed.
+   * 
+ * + * string database = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * Optional. When set to true, the API caller identity associated with the
+   * request is used for database authentication. The API caller must be an
+   * IAM user in the database.
+   * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the autoIamAuthn field is set. + */ + boolean hasAutoIamAuthn(); + + /** + * + * + *
+   * Optional. When set to true, the API caller identity associated with the
+   * request is used for database authentication. The API caller must be an
+   * IAM user in the database.
+   * 
+ * + * bool auto_iam_authn = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The autoIamAuthn. + */ + boolean getAutoIamAuthn(); + + /** + * + * + *
+   * Optional. The maximum number of rows returned per SQL statement.
+   * 
+ * + * int64 row_limit = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The rowLimit. + */ + long getRowLimit(); + + /** + * + * + *
+   * Optional. Controls how the API should respond when the SQL execution result
+   * is incomplete due to the size limit or another error. The default mode is
+   * to throw an error.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for partialResultMode. + */ + int getPartialResultModeValue(); + + /** + * + * + *
+   * Optional. Controls how the API should respond when the SQL execution result
+   * is incomplete due to the size limit or another error. The default mode is
+   * to throw an error.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode partial_result_mode = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The partialResultMode. + */ + com.google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode getPartialResultMode(); + + /** + * + * + *
+   * Optional. Specifies the name of the application that is making the request.
+   * This field is used for telemetry. Only alphanumeric characters, dashes, and
+   * underscores are allowed. The maximum length is 32 characters.
+   * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The application. + */ + java.lang.String getApplication(); + + /** + * + * + *
+   * Optional. Specifies the name of the application that is making the request.
+   * This field is used for telemetry. Only alphanumeric characters, dashes, and
+   * underscores are allowed. The maximum length is 32 characters.
+   * 
+ * + * string application = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for application. + */ + com.google.protobuf.ByteString getApplicationBytes(); + + com.google.cloud.sql.v1beta4.ExecuteSqlPayload.UserPasswordCase getUserPasswordCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExportContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExportContext.java new file mode 100644 index 000000000000..bc06e0f794bf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExportContext.java @@ -0,0 +1,12877 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance export context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ExportContext} + */ +@com.google.protobuf.Generated +public final class ExportContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ExportContext) + ExportContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExportContext"); + } + + // Use ExportContext.newBuilder() to construct. + private ExportContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ExportContext() { + uri_ = ""; + databases_ = com.google.protobuf.LazyStringArrayList.emptyList(); + kind_ = ""; + fileType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExportContext.class, + com.google.cloud.sql.v1beta4.ExportContext.Builder.class); + } + + public interface SqlCsvExportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The select query used to extract the data.
+     * 
+ * + * string select_query = 1; + * + * @return The selectQuery. + */ + java.lang.String getSelectQuery(); + + /** + * + * + *
+     * The select query used to extract the data.
+     * 
+ * + * string select_query = 1; + * + * @return The bytes for selectQuery. + */ + com.google.protobuf.ByteString getSelectQueryBytes(); + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 2; + * + * @return The escapeCharacter. + */ + java.lang.String getEscapeCharacter(); + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 2; + * + * @return The bytes for escapeCharacter. + */ + com.google.protobuf.ByteString getEscapeCharacterBytes(); + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 3; + * + * @return The quoteCharacter. + */ + java.lang.String getQuoteCharacter(); + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 3; + * + * @return The bytes for quoteCharacter. + */ + com.google.protobuf.ByteString getQuoteCharacterBytes(); + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 4; + * + * @return The fieldsTerminatedBy. + */ + java.lang.String getFieldsTerminatedBy(); + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 4; + * + * @return The bytes for fieldsTerminatedBy. + */ + com.google.protobuf.ByteString getFieldsTerminatedByBytes(); + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 6; + * + * @return The linesTerminatedBy. + */ + java.lang.String getLinesTerminatedBy(); + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 6; + * + * @return The bytes for linesTerminatedBy. + */ + com.google.protobuf.ByteString getLinesTerminatedByBytes(); + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions} */ + public static final class SqlCsvExportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions) + SqlCsvExportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlCsvExportOptions"); + } + + // Use SqlCsvExportOptions.newBuilder() to construct. + private SqlCsvExportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlCsvExportOptions() { + selectQuery_ = ""; + escapeCharacter_ = ""; + quoteCharacter_ = ""; + fieldsTerminatedBy_ = ""; + linesTerminatedBy_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlCsvExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlCsvExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.class, + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.Builder.class); + } + + public static final int SELECT_QUERY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object selectQuery_ = ""; + + /** + * + * + *
+     * The select query used to extract the data.
+     * 
+ * + * string select_query = 1; + * + * @return The selectQuery. + */ + @java.lang.Override + public java.lang.String getSelectQuery() { + java.lang.Object ref = selectQuery_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selectQuery_ = s; + return s; + } + } + + /** + * + * + *
+     * The select query used to extract the data.
+     * 
+ * + * string select_query = 1; + * + * @return The bytes for selectQuery. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelectQueryBytes() { + java.lang.Object ref = selectQuery_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selectQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ESCAPE_CHARACTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object escapeCharacter_ = ""; + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 2; + * + * @return The escapeCharacter. + */ + @java.lang.Override + public java.lang.String getEscapeCharacter() { + java.lang.Object ref = escapeCharacter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + escapeCharacter_ = s; + return s; + } + } + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 2; + * + * @return The bytes for escapeCharacter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEscapeCharacterBytes() { + java.lang.Object ref = escapeCharacter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + escapeCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTE_CHARACTER_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object quoteCharacter_ = ""; + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 3; + * + * @return The quoteCharacter. + */ + @java.lang.Override + public java.lang.String getQuoteCharacter() { + java.lang.Object ref = quoteCharacter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quoteCharacter_ = s; + return s; + } + } + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 3; + * + * @return The bytes for quoteCharacter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQuoteCharacterBytes() { + java.lang.Object ref = quoteCharacter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quoteCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIELDS_TERMINATED_BY_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object fieldsTerminatedBy_ = ""; + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 4; + * + * @return The fieldsTerminatedBy. + */ + @java.lang.Override + public java.lang.String getFieldsTerminatedBy() { + java.lang.Object ref = fieldsTerminatedBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldsTerminatedBy_ = s; + return s; + } + } + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 4; + * + * @return The bytes for fieldsTerminatedBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFieldsTerminatedByBytes() { + java.lang.Object ref = fieldsTerminatedBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldsTerminatedBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINES_TERMINATED_BY_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object linesTerminatedBy_ = ""; + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 6; + * + * @return The linesTerminatedBy. + */ + @java.lang.Override + public java.lang.String getLinesTerminatedBy() { + java.lang.Object ref = linesTerminatedBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + linesTerminatedBy_ = s; + return s; + } + } + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 6; + * + * @return The bytes for linesTerminatedBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLinesTerminatedByBytes() { + java.lang.Object ref = linesTerminatedBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + linesTerminatedBy_ = 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.GeneratedMessage.isStringEmpty(selectQuery_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, selectQuery_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(escapeCharacter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, escapeCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(quoteCharacter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, quoteCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fieldsTerminatedBy_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, fieldsTerminatedBy_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(linesTerminatedBy_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, linesTerminatedBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selectQuery_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, selectQuery_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(escapeCharacter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, escapeCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(quoteCharacter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, quoteCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fieldsTerminatedBy_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, fieldsTerminatedBy_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(linesTerminatedBy_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, linesTerminatedBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions other = + (com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions) obj; + + if (!getSelectQuery().equals(other.getSelectQuery())) return false; + if (!getEscapeCharacter().equals(other.getEscapeCharacter())) return false; + if (!getQuoteCharacter().equals(other.getQuoteCharacter())) return false; + if (!getFieldsTerminatedBy().equals(other.getFieldsTerminatedBy())) return false; + if (!getLinesTerminatedBy().equals(other.getLinesTerminatedBy())) return false; + if (!getUnknownFields().equals(other.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) + SELECT_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getSelectQuery().hashCode(); + hash = (37 * hash) + ESCAPE_CHARACTER_FIELD_NUMBER; + hash = (53 * hash) + getEscapeCharacter().hashCode(); + hash = (37 * hash) + QUOTE_CHARACTER_FIELD_NUMBER; + hash = (53 * hash) + getQuoteCharacter().hashCode(); + hash = (37 * hash) + FIELDS_TERMINATED_BY_FIELD_NUMBER; + hash = (53 * hash) + getFieldsTerminatedBy().hashCode(); + hash = (37 * hash) + LINES_TERMINATED_BY_FIELD_NUMBER; + hash = (53 * hash) + getLinesTerminatedBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions) + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlCsvExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlCsvExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.class, + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + selectQuery_ = ""; + escapeCharacter_ = ""; + quoteCharacter_ = ""; + fieldsTerminatedBy_ = ""; + linesTerminatedBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlCsvExportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions build() { + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions buildPartial() { + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions result = + new com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.selectQuery_ = selectQuery_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.escapeCharacter_ = escapeCharacter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.quoteCharacter_ = quoteCharacter_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.fieldsTerminatedBy_ = fieldsTerminatedBy_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.linesTerminatedBy_ = linesTerminatedBy_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions) { + return mergeFrom((com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions other) { + if (other + == com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.getDefaultInstance()) + return this; + if (!other.getSelectQuery().isEmpty()) { + selectQuery_ = other.selectQuery_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEscapeCharacter().isEmpty()) { + escapeCharacter_ = other.escapeCharacter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getQuoteCharacter().isEmpty()) { + quoteCharacter_ = other.quoteCharacter_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFieldsTerminatedBy().isEmpty()) { + fieldsTerminatedBy_ = other.fieldsTerminatedBy_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getLinesTerminatedBy().isEmpty()) { + linesTerminatedBy_ = other.linesTerminatedBy_; + 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: + { + selectQuery_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + escapeCharacter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + quoteCharacter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + fieldsTerminatedBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 50: + { + linesTerminatedBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object selectQuery_ = ""; + + /** + * + * + *
+       * The select query used to extract the data.
+       * 
+ * + * string select_query = 1; + * + * @return The selectQuery. + */ + public java.lang.String getSelectQuery() { + java.lang.Object ref = selectQuery_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selectQuery_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The select query used to extract the data.
+       * 
+ * + * string select_query = 1; + * + * @return The bytes for selectQuery. + */ + public com.google.protobuf.ByteString getSelectQueryBytes() { + java.lang.Object ref = selectQuery_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selectQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The select query used to extract the data.
+       * 
+ * + * string select_query = 1; + * + * @param value The selectQuery to set. + * @return This builder for chaining. + */ + public Builder setSelectQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selectQuery_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The select query used to extract the data.
+       * 
+ * + * string select_query = 1; + * + * @return This builder for chaining. + */ + public Builder clearSelectQuery() { + selectQuery_ = getDefaultInstance().getSelectQuery(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The select query used to extract the data.
+       * 
+ * + * string select_query = 1; + * + * @param value The bytes for selectQuery to set. + * @return This builder for chaining. + */ + public Builder setSelectQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selectQuery_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object escapeCharacter_ = ""; + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 2; + * + * @return The escapeCharacter. + */ + public java.lang.String getEscapeCharacter() { + java.lang.Object ref = escapeCharacter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + escapeCharacter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 2; + * + * @return The bytes for escapeCharacter. + */ + public com.google.protobuf.ByteString getEscapeCharacterBytes() { + java.lang.Object ref = escapeCharacter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + escapeCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 2; + * + * @param value The escapeCharacter to set. + * @return This builder for chaining. + */ + public Builder setEscapeCharacter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + escapeCharacter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 2; + * + * @return This builder for chaining. + */ + public Builder clearEscapeCharacter() { + escapeCharacter_ = getDefaultInstance().getEscapeCharacter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 2; + * + * @param value The bytes for escapeCharacter to set. + * @return This builder for chaining. + */ + public Builder setEscapeCharacterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + escapeCharacter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object quoteCharacter_ = ""; + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 3; + * + * @return The quoteCharacter. + */ + public java.lang.String getQuoteCharacter() { + java.lang.Object ref = quoteCharacter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quoteCharacter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 3; + * + * @return The bytes for quoteCharacter. + */ + public com.google.protobuf.ByteString getQuoteCharacterBytes() { + java.lang.Object ref = quoteCharacter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quoteCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 3; + * + * @param value The quoteCharacter to set. + * @return This builder for chaining. + */ + public Builder setQuoteCharacter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quoteCharacter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 3; + * + * @return This builder for chaining. + */ + public Builder clearQuoteCharacter() { + quoteCharacter_ = getDefaultInstance().getQuoteCharacter(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 3; + * + * @param value The bytes for quoteCharacter to set. + * @return This builder for chaining. + */ + public Builder setQuoteCharacterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quoteCharacter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object fieldsTerminatedBy_ = ""; + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 4; + * + * @return The fieldsTerminatedBy. + */ + public java.lang.String getFieldsTerminatedBy() { + java.lang.Object ref = fieldsTerminatedBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldsTerminatedBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 4; + * + * @return The bytes for fieldsTerminatedBy. + */ + public com.google.protobuf.ByteString getFieldsTerminatedByBytes() { + java.lang.Object ref = fieldsTerminatedBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldsTerminatedBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 4; + * + * @param value The fieldsTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setFieldsTerminatedBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fieldsTerminatedBy_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 4; + * + * @return This builder for chaining. + */ + public Builder clearFieldsTerminatedBy() { + fieldsTerminatedBy_ = getDefaultInstance().getFieldsTerminatedBy(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 4; + * + * @param value The bytes for fieldsTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setFieldsTerminatedByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fieldsTerminatedBy_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object linesTerminatedBy_ = ""; + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 6; + * + * @return The linesTerminatedBy. + */ + public java.lang.String getLinesTerminatedBy() { + java.lang.Object ref = linesTerminatedBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + linesTerminatedBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 6; + * + * @return The bytes for linesTerminatedBy. + */ + public com.google.protobuf.ByteString getLinesTerminatedByBytes() { + java.lang.Object ref = linesTerminatedBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + linesTerminatedBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 6; + * + * @param value The linesTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setLinesTerminatedBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + linesTerminatedBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 6; + * + * @return This builder for chaining. + */ + public Builder clearLinesTerminatedBy() { + linesTerminatedBy_ = getDefaultInstance().getLinesTerminatedBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 6; + * + * @param value The bytes for linesTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setLinesTerminatedByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + linesTerminatedBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions) + private static final com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions(); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlCsvExportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlExportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @return A list containing the tables. + */ + java.util.List getTablesList(); + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @return The count of tables. + */ + int getTablesCount(); + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @param index The index of the element to return. + * @return The tables at the given index. + */ + java.lang.String getTables(int index); + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @param index The index of the value to return. + * @return The bytes of the tables at the given index. + */ + com.google.protobuf.ByteString getTablesBytes(int index); + + /** + * + * + *
+     * Export only schemas.
+     * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + * + * @return Whether the schemaOnly field is set. + */ + boolean hasSchemaOnly(); + + /** + * + * + *
+     * Export only schemas.
+     * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + * + * @return The schemaOnly. + */ + com.google.protobuf.BoolValue getSchemaOnly(); + + /** + * + * + *
+     * Export only schemas.
+     * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + com.google.protobuf.BoolValueOrBuilder getSchemaOnlyOrBuilder(); + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + * + * @return Whether the mysqlExportOptions field is set. + */ + boolean hasMysqlExportOptions(); + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + * + * @return The mysqlExportOptions. + */ + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + getMysqlExportOptions(); + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptionsOrBuilder + getMysqlExportOptionsOrBuilder(); + + /** + * + * + *
+     * Optional. The number of threads to use for parallel export.
+     * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the threads field is set. + */ + boolean hasThreads(); + + /** + * + * + *
+     * Optional. The number of threads to use for parallel export.
+     * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The threads. + */ + com.google.protobuf.Int32Value getThreads(); + + /** + * + * + *
+     * Optional. The number of threads to use for parallel export.
+     * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.Int32ValueOrBuilder getThreadsOrBuilder(); + + /** + * + * + *
+     * Optional. Whether or not the export should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parallel field is set. + */ + boolean hasParallel(); + + /** + * + * + *
+     * Optional. Whether or not the export should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parallel. + */ + com.google.protobuf.BoolValue getParallel(); + + /** + * + * + *
+     * Optional. Whether or not the export should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getParallelOrBuilder(); + + /** + * + * + *
+     * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the postgresExportOptions field is set. + */ + boolean hasPostgresExportOptions(); + + /** + * + * + *
+     * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The postgresExportOptions. + */ + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + getPostgresExportOptions(); + + /** + * + * + *
+     * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptionsOrBuilder + getPostgresExportOptionsOrBuilder(); + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.ExportContext.SqlExportOptions} */ + public static final class SqlExportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions) + SqlExportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlExportOptions"); + } + + // Use SqlExportOptions.newBuilder() to construct. + private SqlExportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlExportOptions() { + tables_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.class, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.Builder.class); + } + + public interface MysqlExportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Option to include SQL statement required to set up replication. If set
+       * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+       * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+       * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+       * has no effect. If set to any value other than `1`, --set-gtid-purged
+       * is set to OFF.
+       * 
+ * + * .google.protobuf.Int32Value master_data = 1; + * + * @return Whether the masterData field is set. + */ + boolean hasMasterData(); + + /** + * + * + *
+       * Option to include SQL statement required to set up replication. If set
+       * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+       * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+       * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+       * has no effect. If set to any value other than `1`, --set-gtid-purged
+       * is set to OFF.
+       * 
+ * + * .google.protobuf.Int32Value master_data = 1; + * + * @return The masterData. + */ + com.google.protobuf.Int32Value getMasterData(); + + /** + * + * + *
+       * Option to include SQL statement required to set up replication. If set
+       * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+       * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+       * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+       * has no effect. If set to any value other than `1`, --set-gtid-purged
+       * is set to OFF.
+       * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + com.google.protobuf.Int32ValueOrBuilder getMasterDataOrBuilder(); + } + + /** + * + * + *
+     * Options for exporting from MySQL.
+     * 
+ * + * Protobuf type {@code + * google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions} + */ + public static final class MysqlExportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions) + MysqlExportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MysqlExportOptions"); + } + + // Use MysqlExportOptions.newBuilder() to construct. + private MysqlExportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MysqlExportOptions() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_MysqlExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_MysqlExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + .class, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + .Builder.class); + } + + private int bitField0_; + public static final int MASTER_DATA_FIELD_NUMBER = 1; + private com.google.protobuf.Int32Value masterData_; + + /** + * + * + *
+       * Option to include SQL statement required to set up replication. If set
+       * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+       * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+       * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+       * has no effect. If set to any value other than `1`, --set-gtid-purged
+       * is set to OFF.
+       * 
+ * + * .google.protobuf.Int32Value master_data = 1; + * + * @return Whether the masterData field is set. + */ + @java.lang.Override + public boolean hasMasterData() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Option to include SQL statement required to set up replication. If set
+       * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+       * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+       * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+       * has no effect. If set to any value other than `1`, --set-gtid-purged
+       * is set to OFF.
+       * 
+ * + * .google.protobuf.Int32Value master_data = 1; + * + * @return The masterData. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getMasterData() { + return masterData_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : masterData_; + } + + /** + * + * + *
+       * Option to include SQL statement required to set up replication. If set
+       * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+       * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+       * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+       * has no effect. If set to any value other than `1`, --set-gtid-purged
+       * is set to OFF.
+       * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getMasterDataOrBuilder() { + return masterData_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : masterData_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getMasterData()); + } + 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, getMasterData()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions other = + (com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions) obj; + + if (hasMasterData() != other.hasMasterData()) return false; + if (hasMasterData()) { + if (!getMasterData().equals(other.getMasterData())) return false; + } + if (!getUnknownFields().equals(other.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 (hasMasterData()) { + hash = (37 * hash) + MASTER_DATA_FIELD_NUMBER; + hash = (53 * hash) + getMasterData().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Options for exporting from MySQL.
+       * 
+ * + * Protobuf type {@code + * google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions) + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_MysqlExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_MysqlExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + .class, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + .Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMasterDataFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + masterData_ = null; + if (masterDataBuilder_ != null) { + masterDataBuilder_.dispose(); + masterDataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_MysqlExportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + build() { + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + buildPartial() { + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions result = + new com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.masterData_ = + masterDataBuilder_ == null ? masterData_ : masterDataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions other) { + if (other + == com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + .getDefaultInstance()) return this; + if (other.hasMasterData()) { + mergeMasterData(other.getMasterData()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetMasterDataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Int32Value masterData_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + masterDataBuilder_; + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + * + * @return Whether the masterData field is set. + */ + public boolean hasMasterData() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + * + * @return The masterData. + */ + public com.google.protobuf.Int32Value getMasterData() { + if (masterDataBuilder_ == null) { + return masterData_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : masterData_; + } else { + return masterDataBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + public Builder setMasterData(com.google.protobuf.Int32Value value) { + if (masterDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + masterData_ = value; + } else { + masterDataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + public Builder setMasterData(com.google.protobuf.Int32Value.Builder builderForValue) { + if (masterDataBuilder_ == null) { + masterData_ = builderForValue.build(); + } else { + masterDataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + public Builder mergeMasterData(com.google.protobuf.Int32Value value) { + if (masterDataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && masterData_ != null + && masterData_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getMasterDataBuilder().mergeFrom(value); + } else { + masterData_ = value; + } + } else { + masterDataBuilder_.mergeFrom(value); + } + if (masterData_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + public Builder clearMasterData() { + bitField0_ = (bitField0_ & ~0x00000001); + masterData_ = null; + if (masterDataBuilder_ != null) { + masterDataBuilder_.dispose(); + masterDataBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + public com.google.protobuf.Int32Value.Builder getMasterDataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetMasterDataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + public com.google.protobuf.Int32ValueOrBuilder getMasterDataOrBuilder() { + if (masterDataBuilder_ != null) { + return masterDataBuilder_.getMessageOrBuilder(); + } else { + return masterData_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : masterData_; + } + } + + /** + * + * + *
+         * Option to include SQL statement required to set up replication. If set
+         * to `1`, the dump file includes a CHANGE MASTER TO statement with the
+         * binary log coordinates, and --set-gtid-purged is set to ON. If set to
+         * `2`, the CHANGE MASTER TO statement is written as a SQL comment and
+         * has no effect. If set to any value other than `1`, --set-gtid-purged
+         * is set to OFF.
+         * 
+ * + * .google.protobuf.Int32Value master_data = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetMasterDataFieldBuilder() { + if (masterDataBuilder_ == null) { + masterDataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getMasterData(), getParentForChildren(), isClean()); + masterData_ = null; + } + return masterDataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions) + private static final com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .MysqlExportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions(); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MysqlExportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PostgresExportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+       * SQL statements. Use these statements to delete database objects before
+       * running the import operation.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clean field is set. + */ + boolean hasClean(); + + /** + * + * + *
+       * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+       * SQL statements. Use these statements to delete database objects before
+       * running the import operation.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clean. + */ + com.google.protobuf.BoolValue getClean(); + + /** + * + * + *
+       * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+       * SQL statements. Use these statements to delete database objects before
+       * running the import operation.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getCleanOrBuilder(); + + /** + * + * + *
+       * Optional. Option to include an IF EXISTS SQL statement with each DROP
+       * statement produced by clean.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the ifExists field is set. + */ + boolean hasIfExists(); + + /** + * + * + *
+       * Optional. Option to include an IF EXISTS SQL statement with each DROP
+       * statement produced by clean.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The ifExists. + */ + com.google.protobuf.BoolValue getIfExists(); + + /** + * + * + *
+       * Optional. Option to include an IF EXISTS SQL statement with each DROP
+       * statement produced by clean.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getIfExistsOrBuilder(); + } + + /** + * + * + *
+     * Options for exporting from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * Protobuf type {@code + * google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions} + */ + public static final class PostgresExportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions) + PostgresExportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PostgresExportOptions"); + } + + // Use PostgresExportOptions.newBuilder() to construct. + private PostgresExportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PostgresExportOptions() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_PostgresExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_PostgresExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + .class, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + .Builder.class); + } + + private int bitField0_; + public static final int CLEAN_FIELD_NUMBER = 1; + private com.google.protobuf.BoolValue clean_; + + /** + * + * + *
+       * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+       * SQL statements. Use these statements to delete database objects before
+       * running the import operation.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clean field is set. + */ + @java.lang.Override + public boolean hasClean() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+       * SQL statements. Use these statements to delete database objects before
+       * running the import operation.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clean. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getClean() { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } + + /** + * + * + *
+       * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+       * SQL statements. Use these statements to delete database objects before
+       * running the import operation.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getCleanOrBuilder() { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } + + public static final int IF_EXISTS_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue ifExists_; + + /** + * + * + *
+       * Optional. Option to include an IF EXISTS SQL statement with each DROP
+       * statement produced by clean.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the ifExists field is set. + */ + @java.lang.Override + public boolean hasIfExists() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Optional. Option to include an IF EXISTS SQL statement with each DROP
+       * statement produced by clean.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The ifExists. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getIfExists() { + return ifExists_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : ifExists_; + } + + /** + * + * + *
+       * Optional. Option to include an IF EXISTS SQL statement with each DROP
+       * statement produced by clean.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getIfExistsOrBuilder() { + return ifExists_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : ifExists_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getClean()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getIfExists()); + } + 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, getClean()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getIfExists()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions other = + (com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions) obj; + + if (hasClean() != other.hasClean()) return false; + if (hasClean()) { + if (!getClean().equals(other.getClean())) return false; + } + if (hasIfExists() != other.hasIfExists()) return false; + if (hasIfExists()) { + if (!getIfExists().equals(other.getIfExists())) return false; + } + if (!getUnknownFields().equals(other.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 (hasClean()) { + hash = (37 * hash) + CLEAN_FIELD_NUMBER; + hash = (53 * hash) + getClean().hashCode(); + } + if (hasIfExists()) { + hash = (37 * hash) + IF_EXISTS_FIELD_NUMBER; + hash = (53 * hash) + getIfExists().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * Protobuf type {@code + * google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions) + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_PostgresExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_PostgresExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + .class, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + .Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCleanFieldBuilder(); + internalGetIfExistsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + clean_ = null; + if (cleanBuilder_ != null) { + cleanBuilder_.dispose(); + cleanBuilder_ = null; + } + ifExists_ = null; + if (ifExistsBuilder_ != null) { + ifExistsBuilder_.dispose(); + ifExistsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_PostgresExportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + build() { + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + buildPartial() { + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions result = + new com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.clean_ = cleanBuilder_ == null ? clean_ : cleanBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ifExists_ = ifExistsBuilder_ == null ? ifExists_ : ifExistsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + other) { + if (other + == com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + .getDefaultInstance()) return this; + if (other.hasClean()) { + mergeClean(other.getClean()); + } + if (other.hasIfExists()) { + mergeIfExists(other.getIfExists()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetCleanFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetIfExistsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.BoolValue clean_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + cleanBuilder_; + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clean field is set. + */ + public boolean hasClean() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clean. + */ + public com.google.protobuf.BoolValue getClean() { + if (cleanBuilder_ == null) { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } else { + return cleanBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setClean(com.google.protobuf.BoolValue value) { + if (cleanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clean_ = value; + } else { + cleanBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setClean(com.google.protobuf.BoolValue.Builder builderForValue) { + if (cleanBuilder_ == null) { + clean_ = builderForValue.build(); + } else { + cleanBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeClean(com.google.protobuf.BoolValue value) { + if (cleanBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && clean_ != null + && clean_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getCleanBuilder().mergeFrom(value); + } else { + clean_ = value; + } + } else { + cleanBuilder_.mergeFrom(value); + } + if (clean_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearClean() { + bitField0_ = (bitField0_ & ~0x00000001); + clean_ = null; + if (cleanBuilder_ != null) { + cleanBuilder_.dispose(); + cleanBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getCleanBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetCleanFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getCleanOrBuilder() { + if (cleanBuilder_ != null) { + return cleanBuilder_.getMessageOrBuilder(); + } else { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } + } + + /** + * + * + *
+         * Optional. Use this option to include DROP <code>&lt;object&gt;</code>
+         * SQL statements. Use these statements to delete database objects before
+         * running the import operation.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetCleanFieldBuilder() { + if (cleanBuilder_ == null) { + cleanBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getClean(), getParentForChildren(), isClean()); + clean_ = null; + } + return cleanBuilder_; + } + + private com.google.protobuf.BoolValue ifExists_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + ifExistsBuilder_; + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the ifExists field is set. + */ + public boolean hasIfExists() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The ifExists. + */ + public com.google.protobuf.BoolValue getIfExists() { + if (ifExistsBuilder_ == null) { + return ifExists_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : ifExists_; + } else { + return ifExistsBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setIfExists(com.google.protobuf.BoolValue value) { + if (ifExistsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ifExists_ = value; + } else { + ifExistsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setIfExists(com.google.protobuf.BoolValue.Builder builderForValue) { + if (ifExistsBuilder_ == null) { + ifExists_ = builderForValue.build(); + } else { + ifExistsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeIfExists(com.google.protobuf.BoolValue value) { + if (ifExistsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && ifExists_ != null + && ifExists_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getIfExistsBuilder().mergeFrom(value); + } else { + ifExists_ = value; + } + } else { + ifExistsBuilder_.mergeFrom(value); + } + if (ifExists_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearIfExists() { + bitField0_ = (bitField0_ & ~0x00000002); + ifExists_ = null; + if (ifExistsBuilder_ != null) { + ifExistsBuilder_.dispose(); + ifExistsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getIfExistsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetIfExistsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getIfExistsOrBuilder() { + if (ifExistsBuilder_ != null) { + return ifExistsBuilder_.getMessageOrBuilder(); + } else { + return ifExists_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : ifExists_; + } + } + + /** + * + * + *
+         * Optional. Option to include an IF EXISTS SQL statement with each DROP
+         * statement produced by clean.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetIfExistsFieldBuilder() { + if (ifExistsBuilder_ == null) { + ifExistsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getIfExists(), getParentForChildren(), isClean()); + ifExists_ = null; + } + return ifExistsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions) + private static final com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions(); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PostgresExportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int TABLES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList tables_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @return A list containing the tables. + */ + public com.google.protobuf.ProtocolStringList getTablesList() { + return tables_; + } + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @return The count of tables. + */ + public int getTablesCount() { + return tables_.size(); + } + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @param index The index of the element to return. + * @return The tables at the given index. + */ + public java.lang.String getTables(int index) { + return tables_.get(index); + } + + /** + * + * + *
+     * Tables to export, or that were exported, from the specified database. If
+     * you specify tables, specify one and only one database. For PostgreSQL
+     * instances, you can specify only one table.
+     * 
+ * + * repeated string tables = 1; + * + * @param index The index of the value to return. + * @return The bytes of the tables at the given index. + */ + public com.google.protobuf.ByteString getTablesBytes(int index) { + return tables_.getByteString(index); + } + + public static final int SCHEMA_ONLY_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue schemaOnly_; + + /** + * + * + *
+     * Export only schemas.
+     * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + * + * @return Whether the schemaOnly field is set. + */ + @java.lang.Override + public boolean hasSchemaOnly() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Export only schemas.
+     * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + * + * @return The schemaOnly. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSchemaOnly() { + return schemaOnly_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : schemaOnly_; + } + + /** + * + * + *
+     * Export only schemas.
+     * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getSchemaOnlyOrBuilder() { + return schemaOnly_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : schemaOnly_; + } + + public static final int MYSQL_EXPORT_OPTIONS_FIELD_NUMBER = 3; + private com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + mysqlExportOptions_; + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + * + * @return Whether the mysqlExportOptions field is set. + */ + @java.lang.Override + public boolean hasMysqlExportOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + * + * @return The mysqlExportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + getMysqlExportOptions() { + return mysqlExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + .getDefaultInstance() + : mysqlExportOptions_; + } + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptionsOrBuilder + getMysqlExportOptionsOrBuilder() { + return mysqlExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + .getDefaultInstance() + : mysqlExportOptions_; + } + + public static final int THREADS_FIELD_NUMBER = 4; + private com.google.protobuf.Int32Value threads_; + + /** + * + * + *
+     * Optional. The number of threads to use for parallel export.
+     * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the threads field is set. + */ + @java.lang.Override + public boolean hasThreads() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. The number of threads to use for parallel export.
+     * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The threads. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getThreads() { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } + + /** + * + * + *
+     * Optional. The number of threads to use for parallel export.
+     * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getThreadsOrBuilder() { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } + + public static final int PARALLEL_FIELD_NUMBER = 5; + private com.google.protobuf.BoolValue parallel_; + + /** + * + * + *
+     * Optional. Whether or not the export should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parallel field is set. + */ + @java.lang.Override + public boolean hasParallel() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. Whether or not the export should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parallel. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getParallel() { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } + + /** + * + * + *
+     * Optional. Whether or not the export should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getParallelOrBuilder() { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } + + public static final int POSTGRES_EXPORT_OPTIONS_FIELD_NUMBER = 6; + private com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + postgresExportOptions_; + + /** + * + * + *
+     * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the postgresExportOptions field is set. + */ + @java.lang.Override + public boolean hasPostgresExportOptions() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The postgresExportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + getPostgresExportOptions() { + return postgresExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + .getDefaultInstance() + : postgresExportOptions_; + } + + /** + * + * + *
+     * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptionsOrBuilder + getPostgresExportOptionsOrBuilder() { + return postgresExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + .getDefaultInstance() + : postgresExportOptions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 < tables_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tables_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSchemaOnly()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getMysqlExportOptions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getThreads()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(5, getParallel()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(6, getPostgresExportOptions()); + } + 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 < tables_.size(); i++) { + dataSize += computeStringSizeNoTag(tables_.getRaw(i)); + } + size += dataSize; + size += 1 * getTablesList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSchemaOnly()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMysqlExportOptions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getThreads()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getParallel()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(6, getPostgresExportOptions()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions other = + (com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions) obj; + + if (!getTablesList().equals(other.getTablesList())) return false; + if (hasSchemaOnly() != other.hasSchemaOnly()) return false; + if (hasSchemaOnly()) { + if (!getSchemaOnly().equals(other.getSchemaOnly())) return false; + } + if (hasMysqlExportOptions() != other.hasMysqlExportOptions()) return false; + if (hasMysqlExportOptions()) { + if (!getMysqlExportOptions().equals(other.getMysqlExportOptions())) return false; + } + if (hasThreads() != other.hasThreads()) return false; + if (hasThreads()) { + if (!getThreads().equals(other.getThreads())) return false; + } + if (hasParallel() != other.hasParallel()) return false; + if (hasParallel()) { + if (!getParallel().equals(other.getParallel())) return false; + } + if (hasPostgresExportOptions() != other.hasPostgresExportOptions()) return false; + if (hasPostgresExportOptions()) { + if (!getPostgresExportOptions().equals(other.getPostgresExportOptions())) return false; + } + if (!getUnknownFields().equals(other.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 (getTablesCount() > 0) { + hash = (37 * hash) + TABLES_FIELD_NUMBER; + hash = (53 * hash) + getTablesList().hashCode(); + } + if (hasSchemaOnly()) { + hash = (37 * hash) + SCHEMA_ONLY_FIELD_NUMBER; + hash = (53 * hash) + getSchemaOnly().hashCode(); + } + if (hasMysqlExportOptions()) { + hash = (37 * hash) + MYSQL_EXPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getMysqlExportOptions().hashCode(); + } + if (hasThreads()) { + hash = (37 * hash) + THREADS_FIELD_NUMBER; + hash = (53 * hash) + getThreads().hashCode(); + } + if (hasParallel()) { + hash = (37 * hash) + PARALLEL_FIELD_NUMBER; + hash = (53 * hash) + getParallel().hashCode(); + } + if (hasPostgresExportOptions()) { + hash = (37 * hash) + POSTGRES_EXPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPostgresExportOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.ExportContext.SqlExportOptions} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions) + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.class, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSchemaOnlyFieldBuilder(); + internalGetMysqlExportOptionsFieldBuilder(); + internalGetThreadsFieldBuilder(); + internalGetParallelFieldBuilder(); + internalGetPostgresExportOptionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tables_ = com.google.protobuf.LazyStringArrayList.emptyList(); + schemaOnly_ = null; + if (schemaOnlyBuilder_ != null) { + schemaOnlyBuilder_.dispose(); + schemaOnlyBuilder_ = null; + } + mysqlExportOptions_ = null; + if (mysqlExportOptionsBuilder_ != null) { + mysqlExportOptionsBuilder_.dispose(); + mysqlExportOptionsBuilder_ = null; + } + threads_ = null; + if (threadsBuilder_ != null) { + threadsBuilder_.dispose(); + threadsBuilder_ = null; + } + parallel_ = null; + if (parallelBuilder_ != null) { + parallelBuilder_.dispose(); + parallelBuilder_ = null; + } + postgresExportOptions_ = null; + if (postgresExportOptionsBuilder_ != null) { + postgresExportOptionsBuilder_.dispose(); + postgresExportOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlExportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions build() { + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions buildPartial() { + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions result = + new com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + tables_.makeImmutable(); + result.tables_ = tables_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.schemaOnly_ = + schemaOnlyBuilder_ == null ? schemaOnly_ : schemaOnlyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.mysqlExportOptions_ = + mysqlExportOptionsBuilder_ == null + ? mysqlExportOptions_ + : mysqlExportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.threads_ = threadsBuilder_ == null ? threads_ : threadsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.parallel_ = parallelBuilder_ == null ? parallel_ : parallelBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.postgresExportOptions_ = + postgresExportOptionsBuilder_ == null + ? postgresExportOptions_ + : postgresExportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions) { + return mergeFrom((com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions other) { + if (other + == com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.getDefaultInstance()) + return this; + if (!other.tables_.isEmpty()) { + if (tables_.isEmpty()) { + tables_ = other.tables_; + bitField0_ |= 0x00000001; + } else { + ensureTablesIsMutable(); + tables_.addAll(other.tables_); + } + onChanged(); + } + if (other.hasSchemaOnly()) { + mergeSchemaOnly(other.getSchemaOnly()); + } + if (other.hasMysqlExportOptions()) { + mergeMysqlExportOptions(other.getMysqlExportOptions()); + } + if (other.hasThreads()) { + mergeThreads(other.getThreads()); + } + if (other.hasParallel()) { + mergeParallel(other.getParallel()); + } + if (other.hasPostgresExportOptions()) { + mergePostgresExportOptions(other.getPostgresExportOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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(); + ensureTablesIsMutable(); + tables_.add(s); + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetSchemaOnlyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetMysqlExportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetThreadsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetParallelFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetPostgresExportOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList tables_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureTablesIsMutable() { + if (!tables_.isModifiable()) { + tables_ = new com.google.protobuf.LazyStringArrayList(tables_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @return A list containing the tables. + */ + public com.google.protobuf.ProtocolStringList getTablesList() { + tables_.makeImmutable(); + return tables_; + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @return The count of tables. + */ + public int getTablesCount() { + return tables_.size(); + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @param index The index of the element to return. + * @return The tables at the given index. + */ + public java.lang.String getTables(int index) { + return tables_.get(index); + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @param index The index of the value to return. + * @return The bytes of the tables at the given index. + */ + public com.google.protobuf.ByteString getTablesBytes(int index) { + return tables_.getByteString(index); + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @param index The index to set the value at. + * @param value The tables to set. + * @return This builder for chaining. + */ + public Builder setTables(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTablesIsMutable(); + tables_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @param value The tables to add. + * @return This builder for chaining. + */ + public Builder addTables(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTablesIsMutable(); + tables_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @param values The tables to add. + * @return This builder for chaining. + */ + public Builder addAllTables(java.lang.Iterable values) { + ensureTablesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tables_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @return This builder for chaining. + */ + public Builder clearTables() { + tables_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + + /** + * + * + *
+       * Tables to export, or that were exported, from the specified database. If
+       * you specify tables, specify one and only one database. For PostgreSQL
+       * instances, you can specify only one table.
+       * 
+ * + * repeated string tables = 1; + * + * @param value The bytes of the tables to add. + * @return This builder for chaining. + */ + public Builder addTablesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTablesIsMutable(); + tables_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue schemaOnly_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + schemaOnlyBuilder_; + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + * + * @return Whether the schemaOnly field is set. + */ + public boolean hasSchemaOnly() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + * + * @return The schemaOnly. + */ + public com.google.protobuf.BoolValue getSchemaOnly() { + if (schemaOnlyBuilder_ == null) { + return schemaOnly_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : schemaOnly_; + } else { + return schemaOnlyBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + public Builder setSchemaOnly(com.google.protobuf.BoolValue value) { + if (schemaOnlyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schemaOnly_ = value; + } else { + schemaOnlyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + public Builder setSchemaOnly(com.google.protobuf.BoolValue.Builder builderForValue) { + if (schemaOnlyBuilder_ == null) { + schemaOnly_ = builderForValue.build(); + } else { + schemaOnlyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + public Builder mergeSchemaOnly(com.google.protobuf.BoolValue value) { + if (schemaOnlyBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && schemaOnly_ != null + && schemaOnly_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getSchemaOnlyBuilder().mergeFrom(value); + } else { + schemaOnly_ = value; + } + } else { + schemaOnlyBuilder_.mergeFrom(value); + } + if (schemaOnly_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + public Builder clearSchemaOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + schemaOnly_ = null; + if (schemaOnlyBuilder_ != null) { + schemaOnlyBuilder_.dispose(); + schemaOnlyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + public com.google.protobuf.BoolValue.Builder getSchemaOnlyBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetSchemaOnlyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + public com.google.protobuf.BoolValueOrBuilder getSchemaOnlyOrBuilder() { + if (schemaOnlyBuilder_ != null) { + return schemaOnlyBuilder_.getMessageOrBuilder(); + } else { + return schemaOnly_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : schemaOnly_; + } + } + + /** + * + * + *
+       * Export only schemas.
+       * 
+ * + * .google.protobuf.BoolValue schema_only = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetSchemaOnlyFieldBuilder() { + if (schemaOnlyBuilder_ == null) { + schemaOnlyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSchemaOnly(), getParentForChildren(), isClean()); + schemaOnly_ = null; + } + return schemaOnlyBuilder_; + } + + private com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + mysqlExportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + .Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .MysqlExportOptionsOrBuilder> + mysqlExportOptionsBuilder_; + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + * + * @return Whether the mysqlExportOptions field is set. + */ + public boolean hasMysqlExportOptions() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + * + * @return The mysqlExportOptions. + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + getMysqlExportOptions() { + if (mysqlExportOptionsBuilder_ == null) { + return mysqlExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + .getDefaultInstance() + : mysqlExportOptions_; + } else { + return mysqlExportOptionsBuilder_.getMessage(); + } + } + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + public Builder setMysqlExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions value) { + if (mysqlExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mysqlExportOptions_ = value; + } else { + mysqlExportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + public Builder setMysqlExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions.Builder + builderForValue) { + if (mysqlExportOptionsBuilder_ == null) { + mysqlExportOptions_ = builderForValue.build(); + } else { + mysqlExportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + public Builder mergeMysqlExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions value) { + if (mysqlExportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && mysqlExportOptions_ != null + && mysqlExportOptions_ + != com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + .getDefaultInstance()) { + getMysqlExportOptionsBuilder().mergeFrom(value); + } else { + mysqlExportOptions_ = value; + } + } else { + mysqlExportOptionsBuilder_.mergeFrom(value); + } + if (mysqlExportOptions_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + public Builder clearMysqlExportOptions() { + bitField0_ = (bitField0_ & ~0x00000004); + mysqlExportOptions_ = null; + if (mysqlExportOptionsBuilder_ != null) { + mysqlExportOptionsBuilder_.dispose(); + mysqlExportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions.Builder + getMysqlExportOptionsBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetMysqlExportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptionsOrBuilder + getMysqlExportOptionsOrBuilder() { + if (mysqlExportOptionsBuilder_ != null) { + return mysqlExportOptionsBuilder_.getMessageOrBuilder(); + } else { + return mysqlExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + .getDefaultInstance() + : mysqlExportOptions_; + } + } + + /** + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions mysql_export_options = 3; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + .Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .MysqlExportOptionsOrBuilder> + internalGetMysqlExportOptionsFieldBuilder() { + if (mysqlExportOptionsBuilder_ == null) { + mysqlExportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions + .Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .MysqlExportOptionsOrBuilder>( + getMysqlExportOptions(), getParentForChildren(), isClean()); + mysqlExportOptions_ = null; + } + return mysqlExportOptionsBuilder_; + } + + private com.google.protobuf.Int32Value threads_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + threadsBuilder_; + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the threads field is set. + */ + public boolean hasThreads() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The threads. + */ + public com.google.protobuf.Int32Value getThreads() { + if (threadsBuilder_ == null) { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } else { + return threadsBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setThreads(com.google.protobuf.Int32Value value) { + if (threadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + threads_ = value; + } else { + threadsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setThreads(com.google.protobuf.Int32Value.Builder builderForValue) { + if (threadsBuilder_ == null) { + threads_ = builderForValue.build(); + } else { + threadsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeThreads(com.google.protobuf.Int32Value value) { + if (threadsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && threads_ != null + && threads_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getThreadsBuilder().mergeFrom(value); + } else { + threads_ = value; + } + } else { + threadsBuilder_.mergeFrom(value); + } + if (threads_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearThreads() { + bitField0_ = (bitField0_ & ~0x00000008); + threads_ = null; + if (threadsBuilder_ != null) { + threadsBuilder_.dispose(); + threadsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Int32Value.Builder getThreadsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetThreadsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Int32ValueOrBuilder getThreadsOrBuilder() { + if (threadsBuilder_ != null) { + return threadsBuilder_.getMessageOrBuilder(); + } else { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel export.
+       * 
+ * + * .google.protobuf.Int32Value threads = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetThreadsFieldBuilder() { + if (threadsBuilder_ == null) { + threadsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getThreads(), getParentForChildren(), isClean()); + threads_ = null; + } + return threadsBuilder_; + } + + private com.google.protobuf.BoolValue parallel_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + parallelBuilder_; + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parallel field is set. + */ + public boolean hasParallel() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parallel. + */ + public com.google.protobuf.BoolValue getParallel() { + if (parallelBuilder_ == null) { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } else { + return parallelBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setParallel(com.google.protobuf.BoolValue value) { + if (parallelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parallel_ = value; + } else { + parallelBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setParallel(com.google.protobuf.BoolValue.Builder builderForValue) { + if (parallelBuilder_ == null) { + parallel_ = builderForValue.build(); + } else { + parallelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeParallel(com.google.protobuf.BoolValue value) { + if (parallelBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && parallel_ != null + && parallel_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getParallelBuilder().mergeFrom(value); + } else { + parallel_ = value; + } + } else { + parallelBuilder_.mergeFrom(value); + } + if (parallel_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearParallel() { + bitField0_ = (bitField0_ & ~0x00000010); + parallel_ = null; + if (parallelBuilder_ != null) { + parallelBuilder_.dispose(); + parallelBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getParallelBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetParallelFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getParallelOrBuilder() { + if (parallelBuilder_ != null) { + return parallelBuilder_.getMessageOrBuilder(); + } else { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } + } + + /** + * + * + *
+       * Optional. Whether or not the export should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetParallelFieldBuilder() { + if (parallelBuilder_ == null) { + parallelBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getParallel(), getParentForChildren(), isClean()); + parallel_ = null; + } + return parallelBuilder_; + } + + private com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + postgresExportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + .Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptionsOrBuilder> + postgresExportOptionsBuilder_; + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the postgresExportOptions field is set. + */ + public boolean hasPostgresExportOptions() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The postgresExportOptions. + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + getPostgresExportOptions() { + if (postgresExportOptionsBuilder_ == null) { + return postgresExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + .getDefaultInstance() + : postgresExportOptions_; + } else { + return postgresExportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPostgresExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions value) { + if (postgresExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + postgresExportOptions_ = value; + } else { + postgresExportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPostgresExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions.Builder + builderForValue) { + if (postgresExportOptionsBuilder_ == null) { + postgresExportOptions_ = builderForValue.build(); + } else { + postgresExportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergePostgresExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions value) { + if (postgresExportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && postgresExportOptions_ != null + && postgresExportOptions_ + != com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptions.getDefaultInstance()) { + getPostgresExportOptionsBuilder().mergeFrom(value); + } else { + postgresExportOptions_ = value; + } + } else { + postgresExportOptionsBuilder_.mergeFrom(value); + } + if (postgresExportOptions_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPostgresExportOptions() { + bitField0_ = (bitField0_ & ~0x00000020); + postgresExportOptions_ = null; + if (postgresExportOptionsBuilder_ != null) { + postgresExportOptionsBuilder_.dispose(); + postgresExportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + .Builder + getPostgresExportOptionsBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetPostgresExportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptionsOrBuilder + getPostgresExportOptionsOrBuilder() { + if (postgresExportOptionsBuilder_ != null) { + return postgresExportOptionsBuilder_.getMessageOrBuilder(); + } else { + return postgresExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + .getDefaultInstance() + : postgresExportOptions_; + } + } + + /** + * + * + *
+       * Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions postgres_export_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + .Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptionsOrBuilder> + internalGetPostgresExportOptionsFieldBuilder() { + if (postgresExportOptionsBuilder_ == null) { + postgresExportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions + .Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .PostgresExportOptionsOrBuilder>( + getPostgresExportOptions(), getParentForChildren(), isClean()); + postgresExportOptions_ = null; + } + return postgresExportOptionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ExportContext.SqlExportOptions) + private static final com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions(); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlExportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlBakExportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Whether or not the export should be striped.
+     * 
+ * + * .google.protobuf.BoolValue striped = 1; + * + * @return Whether the striped field is set. + */ + boolean hasStriped(); + + /** + * + * + *
+     * Whether or not the export should be striped.
+     * 
+ * + * .google.protobuf.BoolValue striped = 1; + * + * @return The striped. + */ + com.google.protobuf.BoolValue getStriped(); + + /** + * + * + *
+     * Whether or not the export should be striped.
+     * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + com.google.protobuf.BoolValueOrBuilder getStripedOrBuilder(); + + /** + * + * + *
+     * Option for specifying how many stripes to use for the export.
+     * If blank, and the value of the striped field is true,
+     * the number of stripes is automatically chosen.
+     * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + * + * @return Whether the stripeCount field is set. + */ + boolean hasStripeCount(); + + /** + * + * + *
+     * Option for specifying how many stripes to use for the export.
+     * If blank, and the value of the striped field is true,
+     * the number of stripes is automatically chosen.
+     * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + * + * @return The stripeCount. + */ + com.google.protobuf.Int32Value getStripeCount(); + + /** + * + * + *
+     * Option for specifying how many stripes to use for the export.
+     * If blank, and the value of the striped field is true,
+     * the number of stripes is automatically chosen.
+     * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + com.google.protobuf.Int32ValueOrBuilder getStripeCountOrBuilder(); + + /** + * + * + *
+     * Type of this bak file will be export, FULL or DIFF, SQL Server only
+     * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 4; + * + * @return The enum numeric value on the wire for bakType. + */ + int getBakTypeValue(); + + /** + * + * + *
+     * Type of this bak file will be export, FULL or DIFF, SQL Server only
+     * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 4; + * + * @return The bakType. + */ + com.google.cloud.sql.v1beta4.BakType getBakType(); + + /** + * + * + *
+     * Deprecated: copy_only is deprecated. Use differential_base instead
+     * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.copy_only is + * deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=1298 + * @return Whether the copyOnly field is set. + */ + @java.lang.Deprecated + boolean hasCopyOnly(); + + /** + * + * + *
+     * Deprecated: copy_only is deprecated. Use differential_base instead
+     * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.copy_only is + * deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=1298 + * @return The copyOnly. + */ + @java.lang.Deprecated + com.google.protobuf.BoolValue getCopyOnly(); + + /** + * + * + *
+     * Deprecated: copy_only is deprecated. Use differential_base instead
+     * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Deprecated + com.google.protobuf.BoolValueOrBuilder getCopyOnlyOrBuilder(); + + /** + * + * + *
+     * Whether or not the backup can be used as a differential base
+     * copy_only backup can not be served as differential base
+     * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + * + * @return Whether the differentialBase field is set. + */ + boolean hasDifferentialBase(); + + /** + * + * + *
+     * Whether or not the backup can be used as a differential base
+     * copy_only backup can not be served as differential base
+     * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + * + * @return The differentialBase. + */ + com.google.protobuf.BoolValue getDifferentialBase(); + + /** + * + * + *
+     * Whether or not the backup can be used as a differential base
+     * copy_only backup can not be served as differential base
+     * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + com.google.protobuf.BoolValueOrBuilder getDifferentialBaseOrBuilder(); + + /** + * + * + *
+     * Optional. The begin timestamp when transaction log will be included in
+     * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+     * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs from the beginning of retention period will be included.
+     * Only applied to Cloud SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exportLogStartTime field is set. + */ + boolean hasExportLogStartTime(); + + /** + * + * + *
+     * Optional. The begin timestamp when transaction log will be included in
+     * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+     * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs from the beginning of retention period will be included.
+     * Only applied to Cloud SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exportLogStartTime. + */ + com.google.protobuf.Timestamp getExportLogStartTime(); + + /** + * + * + *
+     * Optional. The begin timestamp when transaction log will be included in
+     * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+     * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs from the beginning of retention period will be included.
+     * Only applied to Cloud SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getExportLogStartTimeOrBuilder(); + + /** + * + * + *
+     * Optional. The end timestamp when transaction log will be included in the
+     * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+     * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs until current time will be included. Only applied to Cloud
+     * SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exportLogEndTime field is set. + */ + boolean hasExportLogEndTime(); + + /** + * + * + *
+     * Optional. The end timestamp when transaction log will be included in the
+     * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+     * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs until current time will be included. Only applied to Cloud
+     * SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exportLogEndTime. + */ + com.google.protobuf.Timestamp getExportLogEndTime(); + + /** + * + * + *
+     * Optional. The end timestamp when transaction log will be included in the
+     * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+     * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs until current time will be included. Only applied to Cloud
+     * SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getExportLogEndTimeOrBuilder(); + } + + /** + * + * + *
+   * Options for exporting BAK files (SQL Server-only)
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions} + */ + public static final class SqlBakExportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions) + SqlBakExportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBakExportOptions"); + } + + // Use SqlBakExportOptions.newBuilder() to construct. + private SqlBakExportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlBakExportOptions() { + bakType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlBakExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlBakExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.class, + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.Builder.class); + } + + private int bitField0_; + public static final int STRIPED_FIELD_NUMBER = 1; + private com.google.protobuf.BoolValue striped_; + + /** + * + * + *
+     * Whether or not the export should be striped.
+     * 
+ * + * .google.protobuf.BoolValue striped = 1; + * + * @return Whether the striped field is set. + */ + @java.lang.Override + public boolean hasStriped() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Whether or not the export should be striped.
+     * 
+ * + * .google.protobuf.BoolValue striped = 1; + * + * @return The striped. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getStriped() { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } + + /** + * + * + *
+     * Whether or not the export should be striped.
+     * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getStripedOrBuilder() { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } + + public static final int STRIPE_COUNT_FIELD_NUMBER = 2; + private com.google.protobuf.Int32Value stripeCount_; + + /** + * + * + *
+     * Option for specifying how many stripes to use for the export.
+     * If blank, and the value of the striped field is true,
+     * the number of stripes is automatically chosen.
+     * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + * + * @return Whether the stripeCount field is set. + */ + @java.lang.Override + public boolean hasStripeCount() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Option for specifying how many stripes to use for the export.
+     * If blank, and the value of the striped field is true,
+     * the number of stripes is automatically chosen.
+     * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + * + * @return The stripeCount. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getStripeCount() { + return stripeCount_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : stripeCount_; + } + + /** + * + * + *
+     * Option for specifying how many stripes to use for the export.
+     * If blank, and the value of the striped field is true,
+     * the number of stripes is automatically chosen.
+     * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getStripeCountOrBuilder() { + return stripeCount_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : stripeCount_; + } + + public static final int BAK_TYPE_FIELD_NUMBER = 4; + private int bakType_ = 0; + + /** + * + * + *
+     * Type of this bak file will be export, FULL or DIFF, SQL Server only
+     * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 4; + * + * @return The enum numeric value on the wire for bakType. + */ + @java.lang.Override + public int getBakTypeValue() { + return bakType_; + } + + /** + * + * + *
+     * Type of this bak file will be export, FULL or DIFF, SQL Server only
+     * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 4; + * + * @return The bakType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BakType getBakType() { + com.google.cloud.sql.v1beta4.BakType result = + com.google.cloud.sql.v1beta4.BakType.forNumber(bakType_); + return result == null ? com.google.cloud.sql.v1beta4.BakType.UNRECOGNIZED : result; + } + + public static final int COPY_ONLY_FIELD_NUMBER = 5; + private com.google.protobuf.BoolValue copyOnly_; + + /** + * + * + *
+     * Deprecated: copy_only is deprecated. Use differential_base instead
+     * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.copy_only is + * deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=1298 + * @return Whether the copyOnly field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasCopyOnly() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Deprecated: copy_only is deprecated. Use differential_base instead
+     * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.copy_only is + * deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=1298 + * @return The copyOnly. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.BoolValue getCopyOnly() { + return copyOnly_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : copyOnly_; + } + + /** + * + * + *
+     * Deprecated: copy_only is deprecated. Use differential_base instead
+     * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.BoolValueOrBuilder getCopyOnlyOrBuilder() { + return copyOnly_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : copyOnly_; + } + + public static final int DIFFERENTIAL_BASE_FIELD_NUMBER = 6; + private com.google.protobuf.BoolValue differentialBase_; + + /** + * + * + *
+     * Whether or not the backup can be used as a differential base
+     * copy_only backup can not be served as differential base
+     * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + * + * @return Whether the differentialBase field is set. + */ + @java.lang.Override + public boolean hasDifferentialBase() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Whether or not the backup can be used as a differential base
+     * copy_only backup can not be served as differential base
+     * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + * + * @return The differentialBase. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getDifferentialBase() { + return differentialBase_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : differentialBase_; + } + + /** + * + * + *
+     * Whether or not the backup can be used as a differential base
+     * copy_only backup can not be served as differential base
+     * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getDifferentialBaseOrBuilder() { + return differentialBase_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : differentialBase_; + } + + public static final int EXPORT_LOG_START_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp exportLogStartTime_; + + /** + * + * + *
+     * Optional. The begin timestamp when transaction log will be included in
+     * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+     * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs from the beginning of retention period will be included.
+     * Only applied to Cloud SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exportLogStartTime field is set. + */ + @java.lang.Override + public boolean hasExportLogStartTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. The begin timestamp when transaction log will be included in
+     * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+     * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs from the beginning of retention period will be included.
+     * Only applied to Cloud SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exportLogStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExportLogStartTime() { + return exportLogStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogStartTime_; + } + + /** + * + * + *
+     * Optional. The begin timestamp when transaction log will be included in
+     * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+     * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs from the beginning of retention period will be included.
+     * Only applied to Cloud SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExportLogStartTimeOrBuilder() { + return exportLogStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogStartTime_; + } + + public static final int EXPORT_LOG_END_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp exportLogEndTime_; + + /** + * + * + *
+     * Optional. The end timestamp when transaction log will be included in the
+     * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+     * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs until current time will be included. Only applied to Cloud
+     * SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exportLogEndTime field is set. + */ + @java.lang.Override + public boolean hasExportLogEndTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. The end timestamp when transaction log will be included in the
+     * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+     * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs until current time will be included. Only applied to Cloud
+     * SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exportLogEndTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExportLogEndTime() { + return exportLogEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogEndTime_; + } + + /** + * + * + *
+     * Optional. The end timestamp when transaction log will be included in the
+     * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+     * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+     * available logs until current time will be included. Only applied to Cloud
+     * SQL for SQL Server.
+     * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExportLogEndTimeOrBuilder() { + return exportLogEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogEndTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getStriped()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getStripeCount()); + } + if (bakType_ != com.google.cloud.sql.v1beta4.BakType.BAK_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, bakType_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getCopyOnly()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(6, getDifferentialBase()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(7, getExportLogStartTime()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(8, getExportLogEndTime()); + } + 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, getStriped()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStripeCount()); + } + if (bakType_ != com.google.cloud.sql.v1beta4.BakType.BAK_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, bakType_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCopyOnly()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDifferentialBase()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(7, getExportLogStartTime()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getExportLogEndTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions other = + (com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions) obj; + + if (hasStriped() != other.hasStriped()) return false; + if (hasStriped()) { + if (!getStriped().equals(other.getStriped())) return false; + } + if (hasStripeCount() != other.hasStripeCount()) return false; + if (hasStripeCount()) { + if (!getStripeCount().equals(other.getStripeCount())) return false; + } + if (bakType_ != other.bakType_) return false; + if (hasCopyOnly() != other.hasCopyOnly()) return false; + if (hasCopyOnly()) { + if (!getCopyOnly().equals(other.getCopyOnly())) return false; + } + if (hasDifferentialBase() != other.hasDifferentialBase()) return false; + if (hasDifferentialBase()) { + if (!getDifferentialBase().equals(other.getDifferentialBase())) return false; + } + if (hasExportLogStartTime() != other.hasExportLogStartTime()) return false; + if (hasExportLogStartTime()) { + if (!getExportLogStartTime().equals(other.getExportLogStartTime())) return false; + } + if (hasExportLogEndTime() != other.hasExportLogEndTime()) return false; + if (hasExportLogEndTime()) { + if (!getExportLogEndTime().equals(other.getExportLogEndTime())) return false; + } + if (!getUnknownFields().equals(other.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 (hasStriped()) { + hash = (37 * hash) + STRIPED_FIELD_NUMBER; + hash = (53 * hash) + getStriped().hashCode(); + } + if (hasStripeCount()) { + hash = (37 * hash) + STRIPE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getStripeCount().hashCode(); + } + hash = (37 * hash) + BAK_TYPE_FIELD_NUMBER; + hash = (53 * hash) + bakType_; + if (hasCopyOnly()) { + hash = (37 * hash) + COPY_ONLY_FIELD_NUMBER; + hash = (53 * hash) + getCopyOnly().hashCode(); + } + if (hasDifferentialBase()) { + hash = (37 * hash) + DIFFERENTIAL_BASE_FIELD_NUMBER; + hash = (53 * hash) + getDifferentialBase().hashCode(); + } + if (hasExportLogStartTime()) { + hash = (37 * hash) + EXPORT_LOG_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExportLogStartTime().hashCode(); + } + if (hasExportLogEndTime()) { + hash = (37 * hash) + EXPORT_LOG_END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExportLogEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Options for exporting BAK files (SQL Server-only)
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions) + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlBakExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlBakExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.class, + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStripedFieldBuilder(); + internalGetStripeCountFieldBuilder(); + internalGetCopyOnlyFieldBuilder(); + internalGetDifferentialBaseFieldBuilder(); + internalGetExportLogStartTimeFieldBuilder(); + internalGetExportLogEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + striped_ = null; + if (stripedBuilder_ != null) { + stripedBuilder_.dispose(); + stripedBuilder_ = null; + } + stripeCount_ = null; + if (stripeCountBuilder_ != null) { + stripeCountBuilder_.dispose(); + stripeCountBuilder_ = null; + } + bakType_ = 0; + copyOnly_ = null; + if (copyOnlyBuilder_ != null) { + copyOnlyBuilder_.dispose(); + copyOnlyBuilder_ = null; + } + differentialBase_ = null; + if (differentialBaseBuilder_ != null) { + differentialBaseBuilder_.dispose(); + differentialBaseBuilder_ = null; + } + exportLogStartTime_ = null; + if (exportLogStartTimeBuilder_ != null) { + exportLogStartTimeBuilder_.dispose(); + exportLogStartTimeBuilder_ = null; + } + exportLogEndTime_ = null; + if (exportLogEndTimeBuilder_ != null) { + exportLogEndTimeBuilder_.dispose(); + exportLogEndTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlBakExportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions build() { + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions buildPartial() { + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions result = + new com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.striped_ = stripedBuilder_ == null ? striped_ : stripedBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.stripeCount_ = + stripeCountBuilder_ == null ? stripeCount_ : stripeCountBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.bakType_ = bakType_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.copyOnly_ = copyOnlyBuilder_ == null ? copyOnly_ : copyOnlyBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.differentialBase_ = + differentialBaseBuilder_ == null + ? differentialBase_ + : differentialBaseBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.exportLogStartTime_ = + exportLogStartTimeBuilder_ == null + ? exportLogStartTime_ + : exportLogStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.exportLogEndTime_ = + exportLogEndTimeBuilder_ == null + ? exportLogEndTime_ + : exportLogEndTimeBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions) { + return mergeFrom((com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions other) { + if (other + == com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.getDefaultInstance()) + return this; + if (other.hasStriped()) { + mergeStriped(other.getStriped()); + } + if (other.hasStripeCount()) { + mergeStripeCount(other.getStripeCount()); + } + if (other.bakType_ != 0) { + setBakTypeValue(other.getBakTypeValue()); + } + if (other.hasCopyOnly()) { + mergeCopyOnly(other.getCopyOnly()); + } + if (other.hasDifferentialBase()) { + mergeDifferentialBase(other.getDifferentialBase()); + } + if (other.hasExportLogStartTime()) { + mergeExportLogStartTime(other.getExportLogStartTime()); + } + if (other.hasExportLogEndTime()) { + mergeExportLogEndTime(other.getExportLogEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetStripedFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStripeCountFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 32: + { + bakType_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: + { + input.readMessage( + internalGetCopyOnlyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetDifferentialBaseFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetExportLogStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 66: + { + input.readMessage( + internalGetExportLogEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.BoolValue striped_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + stripedBuilder_; + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + * + * @return Whether the striped field is set. + */ + public boolean hasStriped() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + * + * @return The striped. + */ + public com.google.protobuf.BoolValue getStriped() { + if (stripedBuilder_ == null) { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } else { + return stripedBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + public Builder setStriped(com.google.protobuf.BoolValue value) { + if (stripedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + striped_ = value; + } else { + stripedBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + public Builder setStriped(com.google.protobuf.BoolValue.Builder builderForValue) { + if (stripedBuilder_ == null) { + striped_ = builderForValue.build(); + } else { + stripedBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + public Builder mergeStriped(com.google.protobuf.BoolValue value) { + if (stripedBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && striped_ != null + && striped_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getStripedBuilder().mergeFrom(value); + } else { + striped_ = value; + } + } else { + stripedBuilder_.mergeFrom(value); + } + if (striped_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + public Builder clearStriped() { + bitField0_ = (bitField0_ & ~0x00000001); + striped_ = null; + if (stripedBuilder_ != null) { + stripedBuilder_.dispose(); + stripedBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + public com.google.protobuf.BoolValue.Builder getStripedBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetStripedFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + public com.google.protobuf.BoolValueOrBuilder getStripedOrBuilder() { + if (stripedBuilder_ != null) { + return stripedBuilder_.getMessageOrBuilder(); + } else { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } + } + + /** + * + * + *
+       * Whether or not the export should be striped.
+       * 
+ * + * .google.protobuf.BoolValue striped = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetStripedFieldBuilder() { + if (stripedBuilder_ == null) { + stripedBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getStriped(), getParentForChildren(), isClean()); + striped_ = null; + } + return stripedBuilder_; + } + + private com.google.protobuf.Int32Value stripeCount_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + stripeCountBuilder_; + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + * + * @return Whether the stripeCount field is set. + */ + public boolean hasStripeCount() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + * + * @return The stripeCount. + */ + public com.google.protobuf.Int32Value getStripeCount() { + if (stripeCountBuilder_ == null) { + return stripeCount_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : stripeCount_; + } else { + return stripeCountBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + public Builder setStripeCount(com.google.protobuf.Int32Value value) { + if (stripeCountBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stripeCount_ = value; + } else { + stripeCountBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + public Builder setStripeCount(com.google.protobuf.Int32Value.Builder builderForValue) { + if (stripeCountBuilder_ == null) { + stripeCount_ = builderForValue.build(); + } else { + stripeCountBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + public Builder mergeStripeCount(com.google.protobuf.Int32Value value) { + if (stripeCountBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && stripeCount_ != null + && stripeCount_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getStripeCountBuilder().mergeFrom(value); + } else { + stripeCount_ = value; + } + } else { + stripeCountBuilder_.mergeFrom(value); + } + if (stripeCount_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + public Builder clearStripeCount() { + bitField0_ = (bitField0_ & ~0x00000002); + stripeCount_ = null; + if (stripeCountBuilder_ != null) { + stripeCountBuilder_.dispose(); + stripeCountBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + public com.google.protobuf.Int32Value.Builder getStripeCountBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStripeCountFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + public com.google.protobuf.Int32ValueOrBuilder getStripeCountOrBuilder() { + if (stripeCountBuilder_ != null) { + return stripeCountBuilder_.getMessageOrBuilder(); + } else { + return stripeCount_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : stripeCount_; + } + } + + /** + * + * + *
+       * Option for specifying how many stripes to use for the export.
+       * If blank, and the value of the striped field is true,
+       * the number of stripes is automatically chosen.
+       * 
+ * + * .google.protobuf.Int32Value stripe_count = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetStripeCountFieldBuilder() { + if (stripeCountBuilder_ == null) { + stripeCountBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getStripeCount(), getParentForChildren(), isClean()); + stripeCount_ = null; + } + return stripeCountBuilder_; + } + + private int bakType_ = 0; + + /** + * + * + *
+       * Type of this bak file will be export, FULL or DIFF, SQL Server only
+       * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 4; + * + * @return The enum numeric value on the wire for bakType. + */ + @java.lang.Override + public int getBakTypeValue() { + return bakType_; + } + + /** + * + * + *
+       * Type of this bak file will be export, FULL or DIFF, SQL Server only
+       * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 4; + * + * @param value The enum numeric value on the wire for bakType to set. + * @return This builder for chaining. + */ + public Builder setBakTypeValue(int value) { + bakType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Type of this bak file will be export, FULL or DIFF, SQL Server only
+       * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 4; + * + * @return The bakType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BakType getBakType() { + com.google.cloud.sql.v1beta4.BakType result = + com.google.cloud.sql.v1beta4.BakType.forNumber(bakType_); + return result == null ? com.google.cloud.sql.v1beta4.BakType.UNRECOGNIZED : result; + } + + /** + * + * + *
+       * Type of this bak file will be export, FULL or DIFF, SQL Server only
+       * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 4; + * + * @param value The bakType to set. + * @return This builder for chaining. + */ + public Builder setBakType(com.google.cloud.sql.v1beta4.BakType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + bakType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Type of this bak file will be export, FULL or DIFF, SQL Server only
+       * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 4; + * + * @return This builder for chaining. + */ + public Builder clearBakType() { + bitField0_ = (bitField0_ & ~0x00000004); + bakType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue copyOnly_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + copyOnlyBuilder_; + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.copy_only is + * deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=1298 + * @return Whether the copyOnly field is set. + */ + @java.lang.Deprecated + public boolean hasCopyOnly() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.copy_only is + * deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=1298 + * @return The copyOnly. + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValue getCopyOnly() { + if (copyOnlyBuilder_ == null) { + return copyOnly_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : copyOnly_; + } else { + return copyOnlyBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setCopyOnly(com.google.protobuf.BoolValue value) { + if (copyOnlyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + copyOnly_ = value; + } else { + copyOnlyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setCopyOnly(com.google.protobuf.BoolValue.Builder builderForValue) { + if (copyOnlyBuilder_ == null) { + copyOnly_ = builderForValue.build(); + } else { + copyOnlyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder mergeCopyOnly(com.google.protobuf.BoolValue value) { + if (copyOnlyBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && copyOnly_ != null + && copyOnly_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getCopyOnlyBuilder().mergeFrom(value); + } else { + copyOnly_ = value; + } + } else { + copyOnlyBuilder_.mergeFrom(value); + } + if (copyOnly_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder clearCopyOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + copyOnly_ = null; + if (copyOnlyBuilder_ != null) { + copyOnlyBuilder_.dispose(); + copyOnlyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValue.Builder getCopyOnlyBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetCopyOnlyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValueOrBuilder getCopyOnlyOrBuilder() { + if (copyOnlyBuilder_ != null) { + return copyOnlyBuilder_.getMessageOrBuilder(); + } else { + return copyOnly_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : copyOnly_; + } + } + + /** + * + * + *
+       * Deprecated: copy_only is deprecated. Use differential_base instead
+       * 
+ * + * .google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetCopyOnlyFieldBuilder() { + if (copyOnlyBuilder_ == null) { + copyOnlyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getCopyOnly(), getParentForChildren(), isClean()); + copyOnly_ = null; + } + return copyOnlyBuilder_; + } + + private com.google.protobuf.BoolValue differentialBase_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + differentialBaseBuilder_; + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + * + * @return Whether the differentialBase field is set. + */ + public boolean hasDifferentialBase() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + * + * @return The differentialBase. + */ + public com.google.protobuf.BoolValue getDifferentialBase() { + if (differentialBaseBuilder_ == null) { + return differentialBase_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : differentialBase_; + } else { + return differentialBaseBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + public Builder setDifferentialBase(com.google.protobuf.BoolValue value) { + if (differentialBaseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + differentialBase_ = value; + } else { + differentialBaseBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + public Builder setDifferentialBase(com.google.protobuf.BoolValue.Builder builderForValue) { + if (differentialBaseBuilder_ == null) { + differentialBase_ = builderForValue.build(); + } else { + differentialBaseBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + public Builder mergeDifferentialBase(com.google.protobuf.BoolValue value) { + if (differentialBaseBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && differentialBase_ != null + && differentialBase_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getDifferentialBaseBuilder().mergeFrom(value); + } else { + differentialBase_ = value; + } + } else { + differentialBaseBuilder_.mergeFrom(value); + } + if (differentialBase_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + public Builder clearDifferentialBase() { + bitField0_ = (bitField0_ & ~0x00000010); + differentialBase_ = null; + if (differentialBaseBuilder_ != null) { + differentialBaseBuilder_.dispose(); + differentialBaseBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + public com.google.protobuf.BoolValue.Builder getDifferentialBaseBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetDifferentialBaseFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + public com.google.protobuf.BoolValueOrBuilder getDifferentialBaseOrBuilder() { + if (differentialBaseBuilder_ != null) { + return differentialBaseBuilder_.getMessageOrBuilder(); + } else { + return differentialBase_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : differentialBase_; + } + } + + /** + * + * + *
+       * Whether or not the backup can be used as a differential base
+       * copy_only backup can not be served as differential base
+       * 
+ * + * .google.protobuf.BoolValue differential_base = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetDifferentialBaseFieldBuilder() { + if (differentialBaseBuilder_ == null) { + differentialBaseBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getDifferentialBase(), getParentForChildren(), isClean()); + differentialBase_ = null; + } + return differentialBaseBuilder_; + } + + private com.google.protobuf.Timestamp exportLogStartTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + exportLogStartTimeBuilder_; + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exportLogStartTime field is set. + */ + public boolean hasExportLogStartTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exportLogStartTime. + */ + public com.google.protobuf.Timestamp getExportLogStartTime() { + if (exportLogStartTimeBuilder_ == null) { + return exportLogStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogStartTime_; + } else { + return exportLogStartTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExportLogStartTime(com.google.protobuf.Timestamp value) { + if (exportLogStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + exportLogStartTime_ = value; + } else { + exportLogStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExportLogStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (exportLogStartTimeBuilder_ == null) { + exportLogStartTime_ = builderForValue.build(); + } else { + exportLogStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeExportLogStartTime(com.google.protobuf.Timestamp value) { + if (exportLogStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && exportLogStartTime_ != null + && exportLogStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExportLogStartTimeBuilder().mergeFrom(value); + } else { + exportLogStartTime_ = value; + } + } else { + exportLogStartTimeBuilder_.mergeFrom(value); + } + if (exportLogStartTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearExportLogStartTime() { + bitField0_ = (bitField0_ & ~0x00000020); + exportLogStartTime_ = null; + if (exportLogStartTimeBuilder_ != null) { + exportLogStartTimeBuilder_.dispose(); + exportLogStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getExportLogStartTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetExportLogStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExportLogStartTimeOrBuilder() { + if (exportLogStartTimeBuilder_ != null) { + return exportLogStartTimeBuilder_.getMessageOrBuilder(); + } else { + return exportLogStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogStartTime_; + } + } + + /** + * + * + *
+       * Optional. The begin timestamp when transaction log will be included in
+       * the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
+       * format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs from the beginning of retention period will be included.
+       * Only applied to Cloud SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_start_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExportLogStartTimeFieldBuilder() { + if (exportLogStartTimeBuilder_ == null) { + exportLogStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExportLogStartTime(), getParentForChildren(), isClean()); + exportLogStartTime_ = null; + } + return exportLogStartTimeBuilder_; + } + + private com.google.protobuf.Timestamp exportLogEndTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + exportLogEndTimeBuilder_; + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exportLogEndTime field is set. + */ + public boolean hasExportLogEndTime() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exportLogEndTime. + */ + public com.google.protobuf.Timestamp getExportLogEndTime() { + if (exportLogEndTimeBuilder_ == null) { + return exportLogEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogEndTime_; + } else { + return exportLogEndTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExportLogEndTime(com.google.protobuf.Timestamp value) { + if (exportLogEndTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + exportLogEndTime_ = value; + } else { + exportLogEndTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExportLogEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (exportLogEndTimeBuilder_ == null) { + exportLogEndTime_ = builderForValue.build(); + } else { + exportLogEndTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeExportLogEndTime(com.google.protobuf.Timestamp value) { + if (exportLogEndTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && exportLogEndTime_ != null + && exportLogEndTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExportLogEndTimeBuilder().mergeFrom(value); + } else { + exportLogEndTime_ = value; + } + } else { + exportLogEndTimeBuilder_.mergeFrom(value); + } + if (exportLogEndTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearExportLogEndTime() { + bitField0_ = (bitField0_ & ~0x00000040); + exportLogEndTime_ = null; + if (exportLogEndTimeBuilder_ != null) { + exportLogEndTimeBuilder_.dispose(); + exportLogEndTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getExportLogEndTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetExportLogEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExportLogEndTimeOrBuilder() { + if (exportLogEndTimeBuilder_ != null) { + return exportLogEndTimeBuilder_.getMessageOrBuilder(); + } else { + return exportLogEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : exportLogEndTime_; + } + } + + /** + * + * + *
+       * Optional. The end timestamp when transaction log will be included in the
+       * export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
+       * (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
+       * available logs until current time will be included. Only applied to Cloud
+       * SQL for SQL Server.
+       * 
+ * + * + * .google.protobuf.Timestamp export_log_end_time = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExportLogEndTimeFieldBuilder() { + if (exportLogEndTimeBuilder_ == null) { + exportLogEndTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExportLogEndTime(), getParentForChildren(), isClean()); + exportLogEndTime_ = null; + } + return exportLogEndTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions) + private static final com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions(); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlBakExportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlTdeExportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the location.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The certificatePath. + */ + java.lang.String getCertificatePath(); + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the location.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for certificatePath. + */ + com.google.protobuf.ByteString getCertificatePathBytes(); + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the location.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPath. + */ + java.lang.String getPrivateKeyPath(); + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the location.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPath. + */ + com.google.protobuf.ByteString getPrivateKeyPathBytes(); + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPassword. + */ + java.lang.String getPrivateKeyPassword(); + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPassword. + */ + com.google.protobuf.ByteString getPrivateKeyPasswordBytes(); + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions} */ + public static final class SqlTdeExportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions) + SqlTdeExportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlTdeExportOptions"); + } + + // Use SqlTdeExportOptions.newBuilder() to construct. + private SqlTdeExportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlTdeExportOptions() { + certificatePath_ = ""; + privateKeyPath_ = ""; + privateKeyPassword_ = ""; + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlTdeExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlTdeExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.class, + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.Builder.class); + } + + public static final int CERTIFICATE_PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object certificatePath_ = ""; + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the location.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The certificatePath. + */ + @java.lang.Override + public java.lang.String getCertificatePath() { + java.lang.Object ref = certificatePath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certificatePath_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the location.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for certificatePath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCertificatePathBytes() { + java.lang.Object ref = certificatePath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certificatePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIVATE_KEY_PATH_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object privateKeyPath_ = ""; + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the location.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPath. + */ + @java.lang.Override + public java.lang.String getPrivateKeyPath() { + java.lang.Object ref = privateKeyPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPath_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have write access to the location.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrivateKeyPathBytes() { + java.lang.Object ref = privateKeyPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIVATE_KEY_PASSWORD_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object privateKeyPassword_ = ""; + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPassword. + */ + @java.lang.Override + public java.lang.String getPrivateKeyPassword() { + java.lang.Object ref = privateKeyPassword_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPassword_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPassword. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrivateKeyPasswordBytes() { + java.lang.Object ref = privateKeyPassword_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(certificatePath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, certificatePath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, privateKeyPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPassword_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, privateKeyPassword_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(certificatePath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, certificatePath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, privateKeyPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPassword_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, privateKeyPassword_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, 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.sql.v1beta4.ExportContext.SqlTdeExportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions other = + (com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions) obj; + + if (!getCertificatePath().equals(other.getCertificatePath())) return false; + if (!getPrivateKeyPath().equals(other.getPrivateKeyPath())) return false; + if (!getPrivateKeyPassword().equals(other.getPrivateKeyPassword())) return false; + 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) + CERTIFICATE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getCertificatePath().hashCode(); + hash = (37 * hash) + PRIVATE_KEY_PATH_FIELD_NUMBER; + hash = (53 * hash) + getPrivateKeyPath().hashCode(); + hash = (37 * hash) + PRIVATE_KEY_PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPrivateKeyPassword().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.sql.v1beta4.ExportContext.SqlTdeExportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions) + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlTdeExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlTdeExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.class, + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + certificatePath_ = ""; + privateKeyPath_ = ""; + privateKeyPassword_ = ""; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_SqlTdeExportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions build() { + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions buildPartial() { + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions result = + new com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.certificatePath_ = certificatePath_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.privateKeyPath_ = privateKeyPath_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.privateKeyPassword_ = privateKeyPassword_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions) { + return mergeFrom((com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions other) { + if (other + == com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.getDefaultInstance()) + return this; + if (!other.getCertificatePath().isEmpty()) { + certificatePath_ = other.certificatePath_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPrivateKeyPath().isEmpty()) { + privateKeyPath_ = other.privateKeyPath_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPrivateKeyPassword().isEmpty()) { + privateKeyPassword_ = other.privateKeyPassword_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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: + { + certificatePath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + privateKeyPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + privateKeyPassword_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 certificatePath_ = ""; + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The certificatePath. + */ + public java.lang.String getCertificatePath() { + java.lang.Object ref = certificatePath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certificatePath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for certificatePath. + */ + public com.google.protobuf.ByteString getCertificatePathBytes() { + java.lang.Object ref = certificatePath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certificatePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The certificatePath to set. + * @return This builder for chaining. + */ + public Builder setCertificatePath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + certificatePath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCertificatePath() { + certificatePath_ = getDefaultInstance().getCertificatePath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for certificatePath to set. + * @return This builder for chaining. + */ + public Builder setCertificatePathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + certificatePath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object privateKeyPath_ = ""; + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPath. + */ + public java.lang.String getPrivateKeyPath() { + java.lang.Object ref = privateKeyPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPath. + */ + public com.google.protobuf.ByteString getPrivateKeyPathBytes() { + java.lang.Object ref = privateKeyPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The privateKeyPath to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + privateKeyPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPrivateKeyPath() { + privateKeyPath_ = getDefaultInstance().getPrivateKeyPath(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have write access to the location.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for privateKeyPath to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + privateKeyPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object privateKeyPassword_ = ""; + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPassword. + */ + public java.lang.String getPrivateKeyPassword() { + java.lang.Object ref = privateKeyPassword_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPassword_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPassword. + */ + public com.google.protobuf.ByteString getPrivateKeyPasswordBytes() { + java.lang.Object ref = privateKeyPassword_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The privateKeyPassword to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + privateKeyPassword_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPrivateKeyPassword() { + privateKeyPassword_ = getDefaultInstance().getPrivateKeyPassword(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for privateKeyPassword to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + privateKeyPassword_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions) + private static final com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions(); + } + + public static com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlTdeExportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object uri_ = ""; + + /** + * + * + *
+   * The path to the file in Google Cloud Storage where the export will be
+   * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+   * already exists, the request succeeds, but the operation fails. If
+   * `fileType` is `SQL` and the filename ends with .gz,
+   * the contents are compressed.
+   * 
+ * + * string uri = 1; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + + /** + * + * + *
+   * The path to the file in Google Cloud Storage where the export will be
+   * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+   * already exists, the request succeeds, but the operation fails. If
+   * `fileType` is `SQL` and the filename ends with .gz,
+   * the contents are compressed.
+   * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList databases_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are
+   * exported. This excludes system databases and Cloud SQL databases used to
+   * manage internal operations. Exporting all user databases is only available
+   * for directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @return A list containing the databases. + */ + public com.google.protobuf.ProtocolStringList getDatabasesList() { + return databases_; + } + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are
+   * exported. This excludes system databases and Cloud SQL databases used to
+   * manage internal operations. Exporting all user databases is only available
+   * for directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @return The count of databases. + */ + public int getDatabasesCount() { + return databases_.size(); + } + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are
+   * exported. This excludes system databases and Cloud SQL databases used to
+   * manage internal operations. Exporting all user databases is only available
+   * for directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @param index The index of the element to return. + * @return The databases at the given index. + */ + public java.lang.String getDatabases(int index) { + return databases_.get(index); + } + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are
+   * exported. This excludes system databases and Cloud SQL databases used to
+   * manage internal operations. Exporting all user databases is only available
+   * for directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @param index The index of the value to return. + * @return The bytes of the databases at the given index. + */ + public com.google.protobuf.ByteString getDatabasesBytes(int index) { + return databases_.getByteString(index); + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#exportContext`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#exportContext`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SQL_EXPORT_OPTIONS_FIELD_NUMBER = 4; + private com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sqlExportOptions_; + + /** + * + * + *
+   * Options for exporting data as SQL statements.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + * + * @return Whether the sqlExportOptions field is set. + */ + @java.lang.Override + public boolean hasSqlExportOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Options for exporting data as SQL statements.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + * + * @return The sqlExportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions getSqlExportOptions() { + return sqlExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.getDefaultInstance() + : sqlExportOptions_; + } + + /** + * + * + *
+   * Options for exporting data as SQL statements.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptionsOrBuilder + getSqlExportOptionsOrBuilder() { + return sqlExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.getDefaultInstance() + : sqlExportOptions_; + } + + public static final int CSV_EXPORT_OPTIONS_FIELD_NUMBER = 5; + private com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csvExportOptions_; + + /** + * + * + *
+   * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+   * instances only.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + * + * @return Whether the csvExportOptions field is set. + */ + @java.lang.Override + public boolean hasCsvExportOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+   * instances only.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + * + * @return The csvExportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions getCsvExportOptions() { + return csvExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.getDefaultInstance() + : csvExportOptions_; + } + + /** + * + * + *
+   * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+   * instances only.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptionsOrBuilder + getCsvExportOptionsOrBuilder() { + return csvExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.getDefaultInstance() + : csvExportOptions_; + } + + public static final int FILE_TYPE_FIELD_NUMBER = 6; + private int fileType_ = 0; + + /** + * + * + *
+   * The file type for the specified uri.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 6; + * + * @return The enum numeric value on the wire for fileType. + */ + @java.lang.Override + public int getFileTypeValue() { + return fileType_; + } + + /** + * + * + *
+   * The file type for the specified uri.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 6; + * + * @return The fileType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlFileType getFileType() { + com.google.cloud.sql.v1beta4.SqlFileType result = + com.google.cloud.sql.v1beta4.SqlFileType.forNumber(fileType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlFileType.UNRECOGNIZED : result; + } + + public static final int OFFLOAD_FIELD_NUMBER = 8; + private com.google.protobuf.BoolValue offload_; + + /** + * + * + *
+   * Whether to perform a serverless export.
+   * 
+ * + * .google.protobuf.BoolValue offload = 8; + * + * @return Whether the offload field is set. + */ + @java.lang.Override + public boolean hasOffload() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Whether to perform a serverless export.
+   * 
+ * + * .google.protobuf.BoolValue offload = 8; + * + * @return The offload. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getOffload() { + return offload_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : offload_; + } + + /** + * + * + *
+   * Whether to perform a serverless export.
+   * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getOffloadOrBuilder() { + return offload_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : offload_; + } + + public static final int BAK_EXPORT_OPTIONS_FIELD_NUMBER = 9; + private com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bakExportOptions_; + + /** + * + * + *
+   * Options for exporting data as BAK files.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + * + * @return Whether the bakExportOptions field is set. + */ + @java.lang.Override + public boolean hasBakExportOptions() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Options for exporting data as BAK files.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + * + * @return The bakExportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions getBakExportOptions() { + return bakExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.getDefaultInstance() + : bakExportOptions_; + } + + /** + * + * + *
+   * Options for exporting data as BAK files.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptionsOrBuilder + getBakExportOptionsOrBuilder() { + return bakExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.getDefaultInstance() + : bakExportOptions_; + } + + public static final int TDE_EXPORT_OPTIONS_FIELD_NUMBER = 10; + private com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tdeExportOptions_; + + /** + * + * + *
+   * Optional. Export parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tdeExportOptions field is set. + */ + @java.lang.Override + public boolean hasTdeExportOptions() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Optional. Export parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tdeExportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions getTdeExportOptions() { + return tdeExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.getDefaultInstance() + : tdeExportOptions_; + } + + /** + * + * + *
+   * Optional. Export parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptionsOrBuilder + getTdeExportOptionsOrBuilder() { + return tdeExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.getDefaultInstance() + : tdeExportOptions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, uri_); + } + for (int i = 0; i < databases_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, databases_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getSqlExportOptions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getCsvExportOptions()); + } + if (fileType_ + != com.google.cloud.sql.v1beta4.SqlFileType.SQL_FILE_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, fileType_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(8, getOffload()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(9, getBakExportOptions()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(10, getTdeExportOptions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, uri_); + } + { + int dataSize = 0; + for (int i = 0; i < databases_.size(); i++) { + dataSize += computeStringSizeNoTag(databases_.getRaw(i)); + } + size += dataSize; + size += 1 * getDatabasesList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getSqlExportOptions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCsvExportOptions()); + } + if (fileType_ + != com.google.cloud.sql.v1beta4.SqlFileType.SQL_FILE_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, fileType_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getOffload()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getBakExportOptions()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getTdeExportOptions()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ExportContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ExportContext other = + (com.google.cloud.sql.v1beta4.ExportContext) obj; + + if (!getUri().equals(other.getUri())) return false; + if (!getDatabasesList().equals(other.getDatabasesList())) return false; + if (!getKind().equals(other.getKind())) return false; + if (hasSqlExportOptions() != other.hasSqlExportOptions()) return false; + if (hasSqlExportOptions()) { + if (!getSqlExportOptions().equals(other.getSqlExportOptions())) return false; + } + if (hasCsvExportOptions() != other.hasCsvExportOptions()) return false; + if (hasCsvExportOptions()) { + if (!getCsvExportOptions().equals(other.getCsvExportOptions())) return false; + } + if (fileType_ != other.fileType_) return false; + if (hasOffload() != other.hasOffload()) return false; + if (hasOffload()) { + if (!getOffload().equals(other.getOffload())) return false; + } + if (hasBakExportOptions() != other.hasBakExportOptions()) return false; + if (hasBakExportOptions()) { + if (!getBakExportOptions().equals(other.getBakExportOptions())) return false; + } + if (hasTdeExportOptions() != other.hasTdeExportOptions()) return false; + if (hasTdeExportOptions()) { + if (!getTdeExportOptions().equals(other.getTdeExportOptions())) return false; + } + if (!getUnknownFields().equals(other.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) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + if (getDatabasesCount() > 0) { + hash = (37 * hash) + DATABASES_FIELD_NUMBER; + hash = (53 * hash) + getDatabasesList().hashCode(); + } + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasSqlExportOptions()) { + hash = (37 * hash) + SQL_EXPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getSqlExportOptions().hashCode(); + } + if (hasCsvExportOptions()) { + hash = (37 * hash) + CSV_EXPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getCsvExportOptions().hashCode(); + } + hash = (37 * hash) + FILE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + fileType_; + if (hasOffload()) { + hash = (37 * hash) + OFFLOAD_FIELD_NUMBER; + hash = (53 * hash) + getOffload().hashCode(); + } + if (hasBakExportOptions()) { + hash = (37 * hash) + BAK_EXPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getBakExportOptions().hashCode(); + } + if (hasTdeExportOptions()) { + hash = (37 * hash) + TDE_EXPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getTdeExportOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ExportContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExportContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExportContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExportContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.ExportContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance export context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ExportContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ExportContext) + com.google.cloud.sql.v1beta4.ExportContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExportContext.class, + com.google.cloud.sql.v1beta4.ExportContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ExportContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSqlExportOptionsFieldBuilder(); + internalGetCsvExportOptionsFieldBuilder(); + internalGetOffloadFieldBuilder(); + internalGetBakExportOptionsFieldBuilder(); + internalGetTdeExportOptionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + uri_ = ""; + databases_ = com.google.protobuf.LazyStringArrayList.emptyList(); + kind_ = ""; + sqlExportOptions_ = null; + if (sqlExportOptionsBuilder_ != null) { + sqlExportOptionsBuilder_.dispose(); + sqlExportOptionsBuilder_ = null; + } + csvExportOptions_ = null; + if (csvExportOptionsBuilder_ != null) { + csvExportOptionsBuilder_.dispose(); + csvExportOptionsBuilder_ = null; + } + fileType_ = 0; + offload_ = null; + if (offloadBuilder_ != null) { + offloadBuilder_.dispose(); + offloadBuilder_ = null; + } + bakExportOptions_ = null; + if (bakExportOptionsBuilder_ != null) { + bakExportOptionsBuilder_.dispose(); + bakExportOptionsBuilder_ = null; + } + tdeExportOptions_ = null; + if (tdeExportOptionsBuilder_ != null) { + tdeExportOptionsBuilder_.dispose(); + tdeExportOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ExportContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ExportContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext build() { + com.google.cloud.sql.v1beta4.ExportContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext buildPartial() { + com.google.cloud.sql.v1beta4.ExportContext result = + new com.google.cloud.sql.v1beta4.ExportContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ExportContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.uri_ = uri_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + databases_.makeImmutable(); + result.databases_ = databases_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.sqlExportOptions_ = + sqlExportOptionsBuilder_ == null ? sqlExportOptions_ : sqlExportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.csvExportOptions_ = + csvExportOptionsBuilder_ == null ? csvExportOptions_ : csvExportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.fileType_ = fileType_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.offload_ = offloadBuilder_ == null ? offload_ : offloadBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.bakExportOptions_ = + bakExportOptionsBuilder_ == null ? bakExportOptions_ : bakExportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.tdeExportOptions_ = + tdeExportOptionsBuilder_ == null ? tdeExportOptions_ : tdeExportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ExportContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.ExportContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ExportContext other) { + if (other == com.google.cloud.sql.v1beta4.ExportContext.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.databases_.isEmpty()) { + if (databases_.isEmpty()) { + databases_ = other.databases_; + bitField0_ |= 0x00000002; + } else { + ensureDatabasesIsMutable(); + databases_.addAll(other.databases_); + } + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasSqlExportOptions()) { + mergeSqlExportOptions(other.getSqlExportOptions()); + } + if (other.hasCsvExportOptions()) { + mergeCsvExportOptions(other.getCsvExportOptions()); + } + if (other.fileType_ != 0) { + setFileTypeValue(other.getFileTypeValue()); + } + if (other.hasOffload()) { + mergeOffload(other.getOffload()); + } + if (other.hasBakExportOptions()) { + mergeBakExportOptions(other.getBakExportOptions()); + } + if (other.hasTdeExportOptions()) { + mergeTdeExportOptions(other.getTdeExportOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDatabasesIsMutable(); + databases_.add(s); + break; + } // case 18 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetSqlExportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetCsvExportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + fileType_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 66: + { + input.readMessage(internalGetOffloadFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 66 + case 74: + { + input.readMessage( + internalGetBakExportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 74 + case 82: + { + input.readMessage( + internalGetTdeExportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object uri_ = ""; + + /** + * + * + *
+     * The path to the file in Google Cloud Storage where the export will be
+     * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+     * already exists, the request succeeds, but the operation fails. If
+     * `fileType` is `SQL` and the filename ends with .gz,
+     * the contents are compressed.
+     * 
+ * + * string uri = 1; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The path to the file in Google Cloud Storage where the export will be
+     * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+     * already exists, the request succeeds, but the operation fails. If
+     * `fileType` is `SQL` and the filename ends with .gz,
+     * the contents are compressed.
+     * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The path to the file in Google Cloud Storage where the export will be
+     * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+     * already exists, the request succeeds, but the operation fails. If
+     * `fileType` is `SQL` and the filename ends with .gz,
+     * the contents are compressed.
+     * 
+ * + * string uri = 1; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The path to the file in Google Cloud Storage where the export will be
+     * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+     * already exists, the request succeeds, but the operation fails. If
+     * `fileType` is `SQL` and the filename ends with .gz,
+     * the contents are compressed.
+     * 
+ * + * string uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The path to the file in Google Cloud Storage where the export will be
+     * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+     * already exists, the request succeeds, but the operation fails. If
+     * `fileType` is `SQL` and the filename ends with .gz,
+     * the contents are compressed.
+     * 
+ * + * string uri = 1; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList databases_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDatabasesIsMutable() { + if (!databases_.isModifiable()) { + databases_ = new com.google.protobuf.LazyStringArrayList(databases_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are
+     * exported. This excludes system databases and Cloud SQL databases used to
+     * manage internal operations. Exporting all user databases is only available
+     * for directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @return A list containing the databases. + */ + public com.google.protobuf.ProtocolStringList getDatabasesList() { + databases_.makeImmutable(); + return databases_; + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are
+     * exported. This excludes system databases and Cloud SQL databases used to
+     * manage internal operations. Exporting all user databases is only available
+     * for directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @return The count of databases. + */ + public int getDatabasesCount() { + return databases_.size(); + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are
+     * exported. This excludes system databases and Cloud SQL databases used to
+     * manage internal operations. Exporting all user databases is only available
+     * for directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @param index The index of the element to return. + * @return The databases at the given index. + */ + public java.lang.String getDatabases(int index) { + return databases_.get(index); + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are
+     * exported. This excludes system databases and Cloud SQL databases used to
+     * manage internal operations. Exporting all user databases is only available
+     * for directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @param index The index of the value to return. + * @return The bytes of the databases at the given index. + */ + public com.google.protobuf.ByteString getDatabasesBytes(int index) { + return databases_.getByteString(index); + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are
+     * exported. This excludes system databases and Cloud SQL databases used to
+     * manage internal operations. Exporting all user databases is only available
+     * for directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @param index The index to set the value at. + * @param value The databases to set. + * @return This builder for chaining. + */ + public Builder setDatabases(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabasesIsMutable(); + databases_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are
+     * exported. This excludes system databases and Cloud SQL databases used to
+     * manage internal operations. Exporting all user databases is only available
+     * for directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @param value The databases to add. + * @return This builder for chaining. + */ + public Builder addDatabases(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabasesIsMutable(); + databases_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are
+     * exported. This excludes system databases and Cloud SQL databases used to
+     * manage internal operations. Exporting all user databases is only available
+     * for directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @param values The databases to add. + * @return This builder for chaining. + */ + public Builder addAllDatabases(java.lang.Iterable values) { + ensureDatabasesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, databases_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are
+     * exported. This excludes system databases and Cloud SQL databases used to
+     * manage internal operations. Exporting all user databases is only available
+     * for directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @return This builder for chaining. + */ + public Builder clearDatabases() { + databases_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Databases to be exported. <br /> `MySQL instances:` If
+     * `fileType` is `SQL` and no database is specified, all
+     * databases are exported, except for the `mysql` system database.
+     * If `fileType` is `CSV`, you can specify one database,
+     * either by using this property or by using the
+     * `csvExportOptions.selectQuery` property, which takes precedence
+     * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+     * database by name, all user databases in the instance are
+     * exported. This excludes system databases and Cloud SQL databases used to
+     * manage internal operations. Exporting all user databases is only available
+     * for directory-formatted parallel export. If `fileType` is `CSV`,
+     * this database must match the one specified in the
+     * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+     * instances:` You must specify one database to be exported, and the
+     * `fileType` must be `BAK`.
+     * 
+ * + * repeated string databases = 2; + * + * @param value The bytes of the databases to add. + * @return This builder for chaining. + */ + public Builder addDatabasesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDatabasesIsMutable(); + databases_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#exportContext`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#exportContext`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#exportContext`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#exportContext`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#exportContext`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sqlExportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptionsOrBuilder> + sqlExportOptionsBuilder_; + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + * + * @return Whether the sqlExportOptions field is set. + */ + public boolean hasSqlExportOptions() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + * + * @return The sqlExportOptions. + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions getSqlExportOptions() { + if (sqlExportOptionsBuilder_ == null) { + return sqlExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.getDefaultInstance() + : sqlExportOptions_; + } else { + return sqlExportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + */ + public Builder setSqlExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions value) { + if (sqlExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sqlExportOptions_ = value; + } else { + sqlExportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + */ + public Builder setSqlExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.Builder builderForValue) { + if (sqlExportOptionsBuilder_ == null) { + sqlExportOptions_ = builderForValue.build(); + } else { + sqlExportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + */ + public Builder mergeSqlExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions value) { + if (sqlExportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && sqlExportOptions_ != null + && sqlExportOptions_ + != com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions + .getDefaultInstance()) { + getSqlExportOptionsBuilder().mergeFrom(value); + } else { + sqlExportOptions_ = value; + } + } else { + sqlExportOptionsBuilder_.mergeFrom(value); + } + if (sqlExportOptions_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + */ + public Builder clearSqlExportOptions() { + bitField0_ = (bitField0_ & ~0x00000008); + sqlExportOptions_ = null; + if (sqlExportOptionsBuilder_ != null) { + sqlExportOptionsBuilder_.dispose(); + sqlExportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.Builder + getSqlExportOptionsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetSqlExportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptionsOrBuilder + getSqlExportOptionsOrBuilder() { + if (sqlExportOptionsBuilder_ != null) { + return sqlExportOptionsBuilder_.getMessageOrBuilder(); + } else { + return sqlExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.getDefaultInstance() + : sqlExportOptions_; + } + } + + /** + * + * + *
+     * Options for exporting data as SQL statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptionsOrBuilder> + internalGetSqlExportOptionsFieldBuilder() { + if (sqlExportOptionsBuilder_ == null) { + sqlExportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptionsOrBuilder>( + getSqlExportOptions(), getParentForChildren(), isClean()); + sqlExportOptions_ = null; + } + return sqlExportOptionsBuilder_; + } + + private com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csvExportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptionsOrBuilder> + csvExportOptionsBuilder_; + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + * + * @return Whether the csvExportOptions field is set. + */ + public boolean hasCsvExportOptions() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + * + * @return The csvExportOptions. + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions getCsvExportOptions() { + if (csvExportOptionsBuilder_ == null) { + return csvExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.getDefaultInstance() + : csvExportOptions_; + } else { + return csvExportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + */ + public Builder setCsvExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions value) { + if (csvExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + csvExportOptions_ = value; + } else { + csvExportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + */ + public Builder setCsvExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.Builder builderForValue) { + if (csvExportOptionsBuilder_ == null) { + csvExportOptions_ = builderForValue.build(); + } else { + csvExportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + */ + public Builder mergeCsvExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions value) { + if (csvExportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && csvExportOptions_ != null + && csvExportOptions_ + != com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions + .getDefaultInstance()) { + getCsvExportOptionsBuilder().mergeFrom(value); + } else { + csvExportOptions_ = value; + } + } else { + csvExportOptionsBuilder_.mergeFrom(value); + } + if (csvExportOptions_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + */ + public Builder clearCsvExportOptions() { + bitField0_ = (bitField0_ & ~0x00000010); + csvExportOptions_ = null; + if (csvExportOptionsBuilder_ != null) { + csvExportOptionsBuilder_.dispose(); + csvExportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.Builder + getCsvExportOptionsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetCsvExportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptionsOrBuilder + getCsvExportOptionsOrBuilder() { + if (csvExportOptionsBuilder_ != null) { + return csvExportOptionsBuilder_.getMessageOrBuilder(); + } else { + return csvExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.getDefaultInstance() + : csvExportOptions_; + } + } + + /** + * + * + *
+     * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+     * instances only.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptionsOrBuilder> + internalGetCsvExportOptionsFieldBuilder() { + if (csvExportOptionsBuilder_ == null) { + csvExportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptionsOrBuilder>( + getCsvExportOptions(), getParentForChildren(), isClean()); + csvExportOptions_ = null; + } + return csvExportOptionsBuilder_; + } + + private int fileType_ = 0; + + /** + * + * + *
+     * The file type for the specified uri.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 6; + * + * @return The enum numeric value on the wire for fileType. + */ + @java.lang.Override + public int getFileTypeValue() { + return fileType_; + } + + /** + * + * + *
+     * The file type for the specified uri.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 6; + * + * @param value The enum numeric value on the wire for fileType to set. + * @return This builder for chaining. + */ + public Builder setFileTypeValue(int value) { + fileType_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The file type for the specified uri.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 6; + * + * @return The fileType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlFileType getFileType() { + com.google.cloud.sql.v1beta4.SqlFileType result = + com.google.cloud.sql.v1beta4.SqlFileType.forNumber(fileType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlFileType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The file type for the specified uri.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 6; + * + * @param value The fileType to set. + * @return This builder for chaining. + */ + public Builder setFileType(com.google.cloud.sql.v1beta4.SqlFileType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + fileType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The file type for the specified uri.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 6; + * + * @return This builder for chaining. + */ + public Builder clearFileType() { + bitField0_ = (bitField0_ & ~0x00000020); + fileType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue offload_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + offloadBuilder_; + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + * + * @return Whether the offload field is set. + */ + public boolean hasOffload() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + * + * @return The offload. + */ + public com.google.protobuf.BoolValue getOffload() { + if (offloadBuilder_ == null) { + return offload_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : offload_; + } else { + return offloadBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + public Builder setOffload(com.google.protobuf.BoolValue value) { + if (offloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + offload_ = value; + } else { + offloadBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + public Builder setOffload(com.google.protobuf.BoolValue.Builder builderForValue) { + if (offloadBuilder_ == null) { + offload_ = builderForValue.build(); + } else { + offloadBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + public Builder mergeOffload(com.google.protobuf.BoolValue value) { + if (offloadBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && offload_ != null + && offload_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getOffloadBuilder().mergeFrom(value); + } else { + offload_ = value; + } + } else { + offloadBuilder_.mergeFrom(value); + } + if (offload_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + public Builder clearOffload() { + bitField0_ = (bitField0_ & ~0x00000040); + offload_ = null; + if (offloadBuilder_ != null) { + offloadBuilder_.dispose(); + offloadBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + public com.google.protobuf.BoolValue.Builder getOffloadBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetOffloadFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + public com.google.protobuf.BoolValueOrBuilder getOffloadOrBuilder() { + if (offloadBuilder_ != null) { + return offloadBuilder_.getMessageOrBuilder(); + } else { + return offload_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : offload_; + } + } + + /** + * + * + *
+     * Whether to perform a serverless export.
+     * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetOffloadFieldBuilder() { + if (offloadBuilder_ == null) { + offloadBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getOffload(), getParentForChildren(), isClean()); + offload_ = null; + } + return offloadBuilder_; + } + + private com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bakExportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptionsOrBuilder> + bakExportOptionsBuilder_; + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + * + * @return Whether the bakExportOptions field is set. + */ + public boolean hasBakExportOptions() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + * + * @return The bakExportOptions. + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions getBakExportOptions() { + if (bakExportOptionsBuilder_ == null) { + return bakExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.getDefaultInstance() + : bakExportOptions_; + } else { + return bakExportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + */ + public Builder setBakExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions value) { + if (bakExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bakExportOptions_ = value; + } else { + bakExportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + */ + public Builder setBakExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.Builder builderForValue) { + if (bakExportOptionsBuilder_ == null) { + bakExportOptions_ = builderForValue.build(); + } else { + bakExportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + */ + public Builder mergeBakExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions value) { + if (bakExportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && bakExportOptions_ != null + && bakExportOptions_ + != com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions + .getDefaultInstance()) { + getBakExportOptionsBuilder().mergeFrom(value); + } else { + bakExportOptions_ = value; + } + } else { + bakExportOptionsBuilder_.mergeFrom(value); + } + if (bakExportOptions_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + */ + public Builder clearBakExportOptions() { + bitField0_ = (bitField0_ & ~0x00000080); + bakExportOptions_ = null; + if (bakExportOptionsBuilder_ != null) { + bakExportOptionsBuilder_.dispose(); + bakExportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.Builder + getBakExportOptionsBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetBakExportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptionsOrBuilder + getBakExportOptionsOrBuilder() { + if (bakExportOptionsBuilder_ != null) { + return bakExportOptionsBuilder_.getMessageOrBuilder(); + } else { + return bakExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.getDefaultInstance() + : bakExportOptions_; + } + } + + /** + * + * + *
+     * Options for exporting data as BAK files.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptionsOrBuilder> + internalGetBakExportOptionsFieldBuilder() { + if (bakExportOptionsBuilder_ == null) { + bakExportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptionsOrBuilder>( + getBakExportOptions(), getParentForChildren(), isClean()); + bakExportOptions_ = null; + } + return bakExportOptionsBuilder_; + } + + private com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tdeExportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptionsOrBuilder> + tdeExportOptionsBuilder_; + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tdeExportOptions field is set. + */ + public boolean hasTdeExportOptions() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tdeExportOptions. + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions getTdeExportOptions() { + if (tdeExportOptionsBuilder_ == null) { + return tdeExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.getDefaultInstance() + : tdeExportOptions_; + } else { + return tdeExportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTdeExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions value) { + if (tdeExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tdeExportOptions_ = value; + } else { + tdeExportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTdeExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.Builder builderForValue) { + if (tdeExportOptionsBuilder_ == null) { + tdeExportOptions_ = builderForValue.build(); + } else { + tdeExportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeTdeExportOptions( + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions value) { + if (tdeExportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && tdeExportOptions_ != null + && tdeExportOptions_ + != com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions + .getDefaultInstance()) { + getTdeExportOptionsBuilder().mergeFrom(value); + } else { + tdeExportOptions_ = value; + } + } else { + tdeExportOptionsBuilder_.mergeFrom(value); + } + if (tdeExportOptions_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTdeExportOptions() { + bitField0_ = (bitField0_ & ~0x00000100); + tdeExportOptions_ = null; + if (tdeExportOptionsBuilder_ != null) { + tdeExportOptionsBuilder_.dispose(); + tdeExportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.Builder + getTdeExportOptionsBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetTdeExportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptionsOrBuilder + getTdeExportOptionsOrBuilder() { + if (tdeExportOptionsBuilder_ != null) { + return tdeExportOptionsBuilder_.getMessageOrBuilder(); + } else { + return tdeExportOptions_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.getDefaultInstance() + : tdeExportOptions_; + } + } + + /** + * + * + *
+     * Optional. Export parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptionsOrBuilder> + internalGetTdeExportOptionsFieldBuilder() { + if (tdeExportOptionsBuilder_ == null) { + tdeExportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions, + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.Builder, + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptionsOrBuilder>( + getTdeExportOptions(), getParentForChildren(), isClean()); + tdeExportOptions_ = null; + } + return tdeExportOptionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ExportContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ExportContext) + private static final com.google.cloud.sql.v1beta4.ExportContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ExportContext(); + } + + public static com.google.cloud.sql.v1beta4.ExportContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExportContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExportContextOrBuilder.java new file mode 100644 index 000000000000..86809cbbf232 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExportContextOrBuilder.java @@ -0,0 +1,428 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ExportContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ExportContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The path to the file in Google Cloud Storage where the export will be
+   * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+   * already exists, the request succeeds, but the operation fails. If
+   * `fileType` is `SQL` and the filename ends with .gz,
+   * the contents are compressed.
+   * 
+ * + * string uri = 1; + * + * @return The uri. + */ + java.lang.String getUri(); + + /** + * + * + *
+   * The path to the file in Google Cloud Storage where the export will be
+   * stored. The URI is in the form `gs://bucketName/fileName`. If the file
+   * already exists, the request succeeds, but the operation fails. If
+   * `fileType` is `SQL` and the filename ends with .gz,
+   * the contents are compressed.
+   * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are
+   * exported. This excludes system databases and Cloud SQL databases used to
+   * manage internal operations. Exporting all user databases is only available
+   * for directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @return A list containing the databases. + */ + java.util.List getDatabasesList(); + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are
+   * exported. This excludes system databases and Cloud SQL databases used to
+   * manage internal operations. Exporting all user databases is only available
+   * for directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @return The count of databases. + */ + int getDatabasesCount(); + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are
+   * exported. This excludes system databases and Cloud SQL databases used to
+   * manage internal operations. Exporting all user databases is only available
+   * for directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @param index The index of the element to return. + * @return The databases at the given index. + */ + java.lang.String getDatabases(int index); + + /** + * + * + *
+   * Databases to be exported. <br /> `MySQL instances:` If
+   * `fileType` is `SQL` and no database is specified, all
+   * databases are exported, except for the `mysql` system database.
+   * If `fileType` is `CSV`, you can specify one database,
+   * either by using this property or by using the
+   * `csvExportOptions.selectQuery` property, which takes precedence
+   * over this property. <br /> `PostgreSQL instances:` If you don't specify a
+   * database by name, all user databases in the instance are
+   * exported. This excludes system databases and Cloud SQL databases used to
+   * manage internal operations. Exporting all user databases is only available
+   * for directory-formatted parallel export. If `fileType` is `CSV`,
+   * this database must match the one specified in the
+   * `csvExportOptions.selectQuery` property. <br /> `SQL Server
+   * instances:` You must specify one database to be exported, and the
+   * `fileType` must be `BAK`.
+   * 
+ * + * repeated string databases = 2; + * + * @param index The index of the value to return. + * @return The bytes of the databases at the given index. + */ + com.google.protobuf.ByteString getDatabasesBytes(int index); + + /** + * + * + *
+   * This is always `sql#exportContext`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#exportContext`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Options for exporting data as SQL statements.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + * + * @return Whether the sqlExportOptions field is set. + */ + boolean hasSqlExportOptions(); + + /** + * + * + *
+   * Options for exporting data as SQL statements.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + * + * @return The sqlExportOptions. + */ + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions getSqlExportOptions(); + + /** + * + * + *
+   * Options for exporting data as SQL statements.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlExportOptions sql_export_options = 4; + */ + com.google.cloud.sql.v1beta4.ExportContext.SqlExportOptionsOrBuilder + getSqlExportOptionsOrBuilder(); + + /** + * + * + *
+   * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+   * instances only.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + * + * @return Whether the csvExportOptions field is set. + */ + boolean hasCsvExportOptions(); + + /** + * + * + *
+   * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+   * instances only.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + * + * @return The csvExportOptions. + */ + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions getCsvExportOptions(); + + /** + * + * + *
+   * Options for exporting data as CSV. `MySQL` and `PostgreSQL`
+   * instances only.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions csv_export_options = 5; + * + */ + com.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptionsOrBuilder + getCsvExportOptionsOrBuilder(); + + /** + * + * + *
+   * The file type for the specified uri.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 6; + * + * @return The enum numeric value on the wire for fileType. + */ + int getFileTypeValue(); + + /** + * + * + *
+   * The file type for the specified uri.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 6; + * + * @return The fileType. + */ + com.google.cloud.sql.v1beta4.SqlFileType getFileType(); + + /** + * + * + *
+   * Whether to perform a serverless export.
+   * 
+ * + * .google.protobuf.BoolValue offload = 8; + * + * @return Whether the offload field is set. + */ + boolean hasOffload(); + + /** + * + * + *
+   * Whether to perform a serverless export.
+   * 
+ * + * .google.protobuf.BoolValue offload = 8; + * + * @return The offload. + */ + com.google.protobuf.BoolValue getOffload(); + + /** + * + * + *
+   * Whether to perform a serverless export.
+   * 
+ * + * .google.protobuf.BoolValue offload = 8; + */ + com.google.protobuf.BoolValueOrBuilder getOffloadOrBuilder(); + + /** + * + * + *
+   * Options for exporting data as BAK files.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + * + * @return Whether the bakExportOptions field is set. + */ + boolean hasBakExportOptions(); + + /** + * + * + *
+   * Options for exporting data as BAK files.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + * + * @return The bakExportOptions. + */ + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions getBakExportOptions(); + + /** + * + * + *
+   * Options for exporting data as BAK files.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions bak_export_options = 9; + * + */ + com.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptionsOrBuilder + getBakExportOptionsOrBuilder(); + + /** + * + * + *
+   * Optional. Export parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tdeExportOptions field is set. + */ + boolean hasTdeExportOptions(); + + /** + * + * + *
+   * Optional. Export parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tdeExportOptions. + */ + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions getTdeExportOptions(); + + /** + * + * + *
+   * Optional. Export parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions tde_export_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptionsOrBuilder + getTdeExportOptionsOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExternalSyncParallelLevel.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExternalSyncParallelLevel.java new file mode 100644 index 000000000000..691749db6992 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExternalSyncParallelLevel.java @@ -0,0 +1,217 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * External Sync parallel level.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.ExternalSyncParallelLevel} + */ +@com.google.protobuf.Generated +public enum ExternalSyncParallelLevel implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unknown sync parallel level. Will be defaulted to OPTIMAL.
+   * 
+ * + * EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED = 0; + */ + EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED(0), + /** + * + * + *
+   * Minimal parallel level.
+   * 
+ * + * MIN = 1; + */ + MIN(1), + /** + * + * + *
+   * Optimal parallel level.
+   * 
+ * + * OPTIMAL = 2; + */ + OPTIMAL(2), + /** + * + * + *
+   * Maximum parallel level.
+   * 
+ * + * MAX = 3; + */ + MAX(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExternalSyncParallelLevel"); + } + + /** + * + * + *
+   * Unknown sync parallel level. Will be defaulted to OPTIMAL.
+   * 
+ * + * EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED = 0; + */ + public static final int EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Minimal parallel level.
+   * 
+ * + * MIN = 1; + */ + public static final int MIN_VALUE = 1; + + /** + * + * + *
+   * Optimal parallel level.
+   * 
+ * + * OPTIMAL = 2; + */ + public static final int OPTIMAL_VALUE = 2; + + /** + * + * + *
+   * Maximum parallel level.
+   * 
+ * + * MAX = 3; + */ + public static final int MAX_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 ExternalSyncParallelLevel 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 ExternalSyncParallelLevel forNumber(int value) { + switch (value) { + case 0: + return EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED; + case 1: + return MIN; + case 2: + return OPTIMAL; + case 3: + return MAX; + 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 ExternalSyncParallelLevel findValueByNumber(int number) { + return ExternalSyncParallelLevel.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto.getDescriptor().getEnumTypes().get(0); + } + + private static final ExternalSyncParallelLevel[] VALUES = values(); + + public static ExternalSyncParallelLevel 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 ExternalSyncParallelLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.ExternalSyncParallelLevel) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExternalSyncSelectedObject.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExternalSyncSelectedObject.java new file mode 100644 index 000000000000..b0bf339b7d8f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExternalSyncSelectedObject.java @@ -0,0 +1,597 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The selected object that Cloud SQL migrates.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ExternalSyncSelectedObject} + */ +@com.google.protobuf.Generated +public final class ExternalSyncSelectedObject extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ExternalSyncSelectedObject) + ExternalSyncSelectedObjectOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExternalSyncSelectedObject"); + } + + // Use ExternalSyncSelectedObject.newBuilder() to construct. + private ExternalSyncSelectedObject(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ExternalSyncSelectedObject() { + database_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ExternalSyncSelectedObject_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ExternalSyncSelectedObject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.class, + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.Builder.class); + } + + public static final int DATABASE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * The name of the database that Cloud SQL migrates.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the database that Cloud SQL migrates.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = 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.GeneratedMessage.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, database_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, database_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject other = + (com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject) obj; + + if (!getDatabase().equals(other.getDatabase())) return false; + if (!getUnknownFields().equals(other.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) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The selected object that Cloud SQL migrates.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ExternalSyncSelectedObject} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ExternalSyncSelectedObject) + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObjectOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ExternalSyncSelectedObject_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ExternalSyncSelectedObject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.class, + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + database_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ExternalSyncSelectedObject_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject build() { + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject buildPartial() { + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject result = + new com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.database_ = database_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject) { + return mergeFrom((com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject other) { + if (other == com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.getDefaultInstance()) + return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + 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: + { + database_ = 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 database_ = ""; + + /** + * + * + *
+     * The name of the database that Cloud SQL migrates.
+     * 
+ * + * string database = 1; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the database that Cloud SQL migrates.
+     * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the database that Cloud SQL migrates.
+     * 
+ * + * string database = 1; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the database that Cloud SQL migrates.
+     * 
+ * + * string database = 1; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the database that Cloud SQL migrates.
+     * 
+ * + * string database = 1; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ExternalSyncSelectedObject) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ExternalSyncSelectedObject) + private static final com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject(); + } + + public static com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExternalSyncSelectedObject parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExternalSyncSelectedObjectOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExternalSyncSelectedObjectOrBuilder.java new file mode 100644 index 000000000000..79051efca94a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ExternalSyncSelectedObjectOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ExternalSyncSelectedObjectOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ExternalSyncSelectedObject) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the database that Cloud SQL migrates.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * The name of the database that Cloud SQL migrates.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FailoverContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FailoverContext.java new file mode 100644 index 000000000000..cb5aac4e8923 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FailoverContext.java @@ -0,0 +1,696 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance failover context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.FailoverContext} + */ +@com.google.protobuf.Generated +public final class FailoverContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.FailoverContext) + FailoverContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FailoverContext"); + } + + // Use FailoverContext.newBuilder() to construct. + private FailoverContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FailoverContext() { + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FailoverContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FailoverContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.FailoverContext.class, + com.google.cloud.sql.v1beta4.FailoverContext.Builder.class); + } + + public static final int SETTINGS_VERSION_FIELD_NUMBER = 1; + private long settingsVersion_ = 0L; + + /** + * + * + *
+   * The current settings version of this instance. Request will be rejected if
+   * this version doesn't match the current settings version.
+   * 
+ * + * int64 settings_version = 1; + * + * @return The settingsVersion. + */ + @java.lang.Override + public long getSettingsVersion() { + return settingsVersion_; + } + + public static final int KIND_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#failoverContext`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#failoverContext`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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 (settingsVersion_ != 0L) { + output.writeInt64(1, settingsVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (settingsVersion_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, settingsVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.FailoverContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.FailoverContext other = + (com.google.cloud.sql.v1beta4.FailoverContext) obj; + + if (getSettingsVersion() != other.getSettingsVersion()) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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) + SETTINGS_VERSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSettingsVersion()); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.FailoverContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.FailoverContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FailoverContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.FailoverContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FailoverContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.FailoverContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FailoverContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.FailoverContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FailoverContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.FailoverContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FailoverContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.FailoverContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.FailoverContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance failover context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.FailoverContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.FailoverContext) + com.google.cloud.sql.v1beta4.FailoverContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FailoverContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FailoverContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.FailoverContext.class, + com.google.cloud.sql.v1beta4.FailoverContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.FailoverContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + settingsVersion_ = 0L; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FailoverContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.FailoverContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.FailoverContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.FailoverContext build() { + com.google.cloud.sql.v1beta4.FailoverContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.FailoverContext buildPartial() { + com.google.cloud.sql.v1beta4.FailoverContext result = + new com.google.cloud.sql.v1beta4.FailoverContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.FailoverContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.settingsVersion_ = settingsVersion_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.FailoverContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.FailoverContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.FailoverContext other) { + if (other == com.google.cloud.sql.v1beta4.FailoverContext.getDefaultInstance()) return this; + if (other.getSettingsVersion() != 0L) { + setSettingsVersion(other.getSettingsVersion()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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 8: + { + settingsVersion_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + kind_ = 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 long settingsVersion_; + + /** + * + * + *
+     * The current settings version of this instance. Request will be rejected if
+     * this version doesn't match the current settings version.
+     * 
+ * + * int64 settings_version = 1; + * + * @return The settingsVersion. + */ + @java.lang.Override + public long getSettingsVersion() { + return settingsVersion_; + } + + /** + * + * + *
+     * The current settings version of this instance. Request will be rejected if
+     * this version doesn't match the current settings version.
+     * 
+ * + * int64 settings_version = 1; + * + * @param value The settingsVersion to set. + * @return This builder for chaining. + */ + public Builder setSettingsVersion(long value) { + + settingsVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The current settings version of this instance. Request will be rejected if
+     * this version doesn't match the current settings version.
+     * 
+ * + * int64 settings_version = 1; + * + * @return This builder for chaining. + */ + public Builder clearSettingsVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + settingsVersion_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#failoverContext`.
+     * 
+ * + * string kind = 2; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#failoverContext`.
+     * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#failoverContext`.
+     * 
+ * + * string kind = 2; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#failoverContext`.
+     * 
+ * + * string kind = 2; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#failoverContext`.
+     * 
+ * + * string kind = 2; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.FailoverContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.FailoverContext) + private static final com.google.cloud.sql.v1beta4.FailoverContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.FailoverContext(); + } + + public static com.google.cloud.sql.v1beta4.FailoverContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailoverContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.FailoverContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FailoverContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FailoverContextOrBuilder.java new file mode 100644 index 000000000000..9df4b4c715bd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FailoverContextOrBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface FailoverContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.FailoverContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The current settings version of this instance. Request will be rejected if
+   * this version doesn't match the current settings version.
+   * 
+ * + * int64 settings_version = 1; + * + * @return The settingsVersion. + */ + long getSettingsVersion(); + + /** + * + * + *
+   * This is always `sql#failoverContext`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#failoverContext`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FinalBackupConfig.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FinalBackupConfig.java new file mode 100644 index 000000000000..3a7e07957c21 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FinalBackupConfig.java @@ -0,0 +1,690 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Config used to determine the final backup settings for the instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.FinalBackupConfig} + */ +@com.google.protobuf.Generated +public final class FinalBackupConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.FinalBackupConfig) + FinalBackupConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FinalBackupConfig"); + } + + // Use FinalBackupConfig.newBuilder() to construct. + private FinalBackupConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FinalBackupConfig() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FinalBackupConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FinalBackupConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.FinalBackupConfig.class, + com.google.cloud.sql.v1beta4.FinalBackupConfig.Builder.class); + } + + private int bitField0_; + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + + /** + * + * + *
+   * Whether the final backup is enabled for the instance.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Whether the final backup is enabled for the instance.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + public static final int RETENTION_DAYS_FIELD_NUMBER = 3; + private int retentionDays_ = 0; + + /** + * + * + *
+   * The number of days to retain the final backup after the instance deletion.
+   * The final backup will be purged at (time_of_instance_deletion +
+   * retention_days).
+   * 
+ * + * optional int32 retention_days = 3; + * + * @return Whether the retentionDays field is set. + */ + @java.lang.Override + public boolean hasRetentionDays() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The number of days to retain the final backup after the instance deletion.
+   * The final backup will be purged at (time_of_instance_deletion +
+   * retention_days).
+   * 
+ * + * optional int32 retention_days = 3; + * + * @return The retentionDays. + */ + @java.lang.Override + public int getRetentionDays() { + return retentionDays_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, enabled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(3, retentionDays_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enabled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, retentionDays_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.FinalBackupConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.FinalBackupConfig other = + (com.google.cloud.sql.v1beta4.FinalBackupConfig) obj; + + if (hasEnabled() != other.hasEnabled()) return false; + if (hasEnabled()) { + if (getEnabled() != other.getEnabled()) return false; + } + if (hasRetentionDays() != other.hasRetentionDays()) return false; + if (hasRetentionDays()) { + if (getRetentionDays() != other.getRetentionDays()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); + } + if (hasRetentionDays()) { + hash = (37 * hash) + RETENTION_DAYS_FIELD_NUMBER; + hash = (53 * hash) + getRetentionDays(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.FinalBackupConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.FinalBackupConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FinalBackupConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.FinalBackupConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FinalBackupConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.FinalBackupConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FinalBackupConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.FinalBackupConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FinalBackupConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.FinalBackupConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FinalBackupConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.FinalBackupConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.FinalBackupConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Config used to determine the final backup settings for the instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.FinalBackupConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.FinalBackupConfig) + com.google.cloud.sql.v1beta4.FinalBackupConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FinalBackupConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FinalBackupConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.FinalBackupConfig.class, + com.google.cloud.sql.v1beta4.FinalBackupConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.FinalBackupConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enabled_ = false; + retentionDays_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FinalBackupConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.FinalBackupConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.FinalBackupConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.FinalBackupConfig build() { + com.google.cloud.sql.v1beta4.FinalBackupConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.FinalBackupConfig buildPartial() { + com.google.cloud.sql.v1beta4.FinalBackupConfig result = + new com.google.cloud.sql.v1beta4.FinalBackupConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.FinalBackupConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enabled_ = enabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.retentionDays_ = retentionDays_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.FinalBackupConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.FinalBackupConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.FinalBackupConfig other) { + if (other == com.google.cloud.sql.v1beta4.FinalBackupConfig.getDefaultInstance()) return this; + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); + } + if (other.hasRetentionDays()) { + setRetentionDays(other.getRetentionDays()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 24: + { + retentionDays_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean enabled_; + + /** + * + * + *
+     * Whether the final backup is enabled for the instance.
+     * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Whether the final backup is enabled for the instance.
+     * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + /** + * + * + *
+     * Whether the final backup is enabled for the instance.
+     * 
+ * + * optional bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether the final backup is enabled for the instance.
+     * 
+ * + * optional bool enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + enabled_ = false; + onChanged(); + return this; + } + + private int retentionDays_; + + /** + * + * + *
+     * The number of days to retain the final backup after the instance deletion.
+     * The final backup will be purged at (time_of_instance_deletion +
+     * retention_days).
+     * 
+ * + * optional int32 retention_days = 3; + * + * @return Whether the retentionDays field is set. + */ + @java.lang.Override + public boolean hasRetentionDays() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The number of days to retain the final backup after the instance deletion.
+     * The final backup will be purged at (time_of_instance_deletion +
+     * retention_days).
+     * 
+ * + * optional int32 retention_days = 3; + * + * @return The retentionDays. + */ + @java.lang.Override + public int getRetentionDays() { + return retentionDays_; + } + + /** + * + * + *
+     * The number of days to retain the final backup after the instance deletion.
+     * The final backup will be purged at (time_of_instance_deletion +
+     * retention_days).
+     * 
+ * + * optional int32 retention_days = 3; + * + * @param value The retentionDays to set. + * @return This builder for chaining. + */ + public Builder setRetentionDays(int value) { + + retentionDays_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of days to retain the final backup after the instance deletion.
+     * The final backup will be purged at (time_of_instance_deletion +
+     * retention_days).
+     * 
+ * + * optional int32 retention_days = 3; + * + * @return This builder for chaining. + */ + public Builder clearRetentionDays() { + bitField0_ = (bitField0_ & ~0x00000002); + retentionDays_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.FinalBackupConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.FinalBackupConfig) + private static final com.google.cloud.sql.v1beta4.FinalBackupConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.FinalBackupConfig(); + } + + public static com.google.cloud.sql.v1beta4.FinalBackupConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FinalBackupConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.FinalBackupConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FinalBackupConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FinalBackupConfigOrBuilder.java new file mode 100644 index 000000000000..18835898ce99 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FinalBackupConfigOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface FinalBackupConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.FinalBackupConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether the final backup is enabled for the instance.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + + /** + * + * + *
+   * Whether the final backup is enabled for the instance.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + boolean getEnabled(); + + /** + * + * + *
+   * The number of days to retain the final backup after the instance deletion.
+   * The final backup will be purged at (time_of_instance_deletion +
+   * retention_days).
+   * 
+ * + * optional int32 retention_days = 3; + * + * @return Whether the retentionDays field is set. + */ + boolean hasRetentionDays(); + + /** + * + * + *
+   * The number of days to retain the final backup after the instance deletion.
+   * The final backup will be purged at (time_of_instance_deletion +
+   * retention_days).
+   * 
+ * + * optional int32 retention_days = 3; + * + * @return The retentionDays. + */ + int getRetentionDays(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Flag.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Flag.java new file mode 100644 index 000000000000..84ddbcf48cdc --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Flag.java @@ -0,0 +1,3970 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * A flag resource.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Flag} + */ +@com.google.protobuf.Generated +public final class Flag extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.Flag) + FlagOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Flag"); + } + + // Use Flag.newBuilder() to construct. + private Flag(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Flag() { + name_ = ""; + type_ = 0; + appliesTo_ = emptyIntList(); + allowedStringValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + kind_ = ""; + allowedIntValues_ = emptyLongList(); + flagScope_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Flag_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Flag_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Flag.class, + com.google.cloud.sql.v1beta4.Flag.Builder.class); + } + + private int bitField0_; + private int recommendedValueCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object recommendedValue_; + + public enum RecommendedValueCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + RECOMMENDED_STRING_VALUE(16), + RECOMMENDED_INT_VALUE(17), + RECOMMENDEDVALUE_NOT_SET(0); + private final int value; + + private RecommendedValueCase(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 RecommendedValueCase valueOf(int value) { + return forNumber(value); + } + + public static RecommendedValueCase forNumber(int value) { + switch (value) { + case 16: + return RECOMMENDED_STRING_VALUE; + case 17: + return RECOMMENDED_INT_VALUE; + case 0: + return RECOMMENDEDVALUE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RecommendedValueCase getRecommendedValueCase() { + return RecommendedValueCase.forNumber(recommendedValueCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * This is the name of the flag. Flag names always use underscores, not
+   * hyphens, for example: `max_allowed_packet`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * This is the name of the flag. Flag names always use underscores, not
+   * hyphens, for example: `max_allowed_packet`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private int type_ = 0; + + /** + * + * + *
+   * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+   * `INTEGER` or `NONE`. `NONE` is used for flags which do not take a
+   * value, such as `skip_grant_tables`.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagType type = 2; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+   * `INTEGER` or `NONE`. `NONE` is used for flags which do not take a
+   * value, such as `skip_grant_tables`.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagType type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlFlagType getType() { + com.google.cloud.sql.v1beta4.SqlFlagType result = + com.google.cloud.sql.v1beta4.SqlFlagType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1beta4.SqlFlagType.UNRECOGNIZED : result; + } + + public static final int APPLIES_TO_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList appliesTo_ = emptyIntList(); + + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.cloud.sql.v1beta4.SqlDatabaseVersion> + appliesTo_converter_ = + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.cloud.sql.v1beta4.SqlDatabaseVersion>() { + public com.google.cloud.sql.v1beta4.SqlDatabaseVersion convert(int from) { + com.google.cloud.sql.v1beta4.SqlDatabaseVersion result = + com.google.cloud.sql.v1beta4.SqlDatabaseVersion.forNumber(from); + return result == null + ? com.google.cloud.sql.v1beta4.SqlDatabaseVersion.UNRECOGNIZED + : result; + } + }; + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @return A list containing the appliesTo. + */ + @java.lang.Override + public java.util.List getAppliesToList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.cloud.sql.v1beta4.SqlDatabaseVersion>(appliesTo_, appliesTo_converter_); + } + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @return The count of appliesTo. + */ + @java.lang.Override + public int getAppliesToCount() { + return appliesTo_.size(); + } + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @param index The index of the element to return. + * @return The appliesTo at the given index. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabaseVersion getAppliesTo(int index) { + return appliesTo_converter_.convert(appliesTo_.getInt(index)); + } + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @return A list containing the enum numeric values on the wire for appliesTo. + */ + @java.lang.Override + public java.util.List getAppliesToValueList() { + return appliesTo_; + } + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of appliesTo at the given index. + */ + @java.lang.Override + public int getAppliesToValue(int index) { + return appliesTo_.getInt(index); + } + + private int appliesToMemoizedSerializedSize; + + public static final int ALLOWED_STRING_VALUES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList allowedStringValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @return A list containing the allowedStringValues. + */ + public com.google.protobuf.ProtocolStringList getAllowedStringValuesList() { + return allowedStringValues_; + } + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @return The count of allowedStringValues. + */ + public int getAllowedStringValuesCount() { + return allowedStringValues_.size(); + } + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @param index The index of the element to return. + * @return The allowedStringValues at the given index. + */ + public java.lang.String getAllowedStringValues(int index) { + return allowedStringValues_.get(index); + } + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @param index The index of the value to return. + * @return The bytes of the allowedStringValues at the given index. + */ + public com.google.protobuf.ByteString getAllowedStringValuesBytes(int index) { + return allowedStringValues_.getByteString(index); + } + + public static final int MIN_VALUE_FIELD_NUMBER = 5; + private com.google.protobuf.Int64Value minValue_; + + /** + * + * + *
+   * For `INTEGER` flags, the minimum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value min_value = 5; + * + * @return Whether the minValue field is set. + */ + @java.lang.Override + public boolean hasMinValue() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * For `INTEGER` flags, the minimum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value min_value = 5; + * + * @return The minValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getMinValue() { + return minValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : minValue_; + } + + /** + * + * + *
+   * For `INTEGER` flags, the minimum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder() { + return minValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : minValue_; + } + + public static final int MAX_VALUE_FIELD_NUMBER = 6; + private com.google.protobuf.Int64Value maxValue_; + + /** + * + * + *
+   * For `INTEGER` flags, the maximum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value max_value = 6; + * + * @return Whether the maxValue field is set. + */ + @java.lang.Override + public boolean hasMaxValue() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * For `INTEGER` flags, the maximum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value max_value = 6; + * + * @return The maxValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getMaxValue() { + return maxValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : maxValue_; + } + + /** + * + * + *
+   * For `INTEGER` flags, the maximum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder() { + return maxValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : maxValue_; + } + + public static final int REQUIRES_RESTART_FIELD_NUMBER = 7; + private com.google.protobuf.BoolValue requiresRestart_; + + /** + * + * + *
+   * Indicates whether changing this flag will trigger a database restart. Only
+   * applicable to Second Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + * + * @return Whether the requiresRestart field is set. + */ + @java.lang.Override + public boolean hasRequiresRestart() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Indicates whether changing this flag will trigger a database restart. Only
+   * applicable to Second Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + * + * @return The requiresRestart. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getRequiresRestart() { + return requiresRestart_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : requiresRestart_; + } + + /** + * + * + *
+   * Indicates whether changing this flag will trigger a database restart. Only
+   * applicable to Second Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getRequiresRestartOrBuilder() { + return requiresRestart_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : requiresRestart_; + } + + public static final int KIND_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#flag`.
+   * 
+ * + * string kind = 8; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#flag`.
+   * 
+ * + * string kind = 8; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IN_BETA_FIELD_NUMBER = 9; + private com.google.protobuf.BoolValue inBeta_; + + /** + * + * + *
+   * Whether or not the flag is considered in beta.
+   * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + * + * @return Whether the inBeta field is set. + */ + @java.lang.Override + public boolean hasInBeta() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Whether or not the flag is considered in beta.
+   * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + * + * @return The inBeta. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getInBeta() { + return inBeta_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : inBeta_; + } + + /** + * + * + *
+   * Whether or not the flag is considered in beta.
+   * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getInBetaOrBuilder() { + return inBeta_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : inBeta_; + } + + public static final int ALLOWED_INT_VALUES_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList allowedIntValues_ = emptyLongList(); + + /** + * + * + *
+   * Use this field if only certain integers are accepted. Can be combined
+   * with min_value and max_value to add additional values.
+   * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @return A list containing the allowedIntValues. + */ + @java.lang.Override + public java.util.List getAllowedIntValuesList() { + return allowedIntValues_; + } + + /** + * + * + *
+   * Use this field if only certain integers are accepted. Can be combined
+   * with min_value and max_value to add additional values.
+   * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @return The count of allowedIntValues. + */ + public int getAllowedIntValuesCount() { + return allowedIntValues_.size(); + } + + /** + * + * + *
+   * Use this field if only certain integers are accepted. Can be combined
+   * with min_value and max_value to add additional values.
+   * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @param index The index of the element to return. + * @return The allowedIntValues at the given index. + */ + public long getAllowedIntValues(int index) { + return allowedIntValues_.getLong(index); + } + + private int allowedIntValuesMemoizedSerializedSize = -1; + + public static final int FLAG_SCOPE_FIELD_NUMBER = 15; + private int flagScope_ = 0; + + /** + * + * + *
+   * Scope of flag.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 15; + * + * @return The enum numeric value on the wire for flagScope. + */ + @java.lang.Override + public int getFlagScopeValue() { + return flagScope_; + } + + /** + * + * + *
+   * Scope of flag.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 15; + * + * @return The flagScope. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlFlagScope getFlagScope() { + com.google.cloud.sql.v1beta4.SqlFlagScope result = + com.google.cloud.sql.v1beta4.SqlFlagScope.forNumber(flagScope_); + return result == null ? com.google.cloud.sql.v1beta4.SqlFlagScope.UNRECOGNIZED : result; + } + + public static final int RECOMMENDED_STRING_VALUE_FIELD_NUMBER = 16; + + /** + * + * + *
+   * Recommended flag value in string format for UI display.
+   * 
+ * + * string recommended_string_value = 16; + * + * @return Whether the recommendedStringValue field is set. + */ + public boolean hasRecommendedStringValue() { + return recommendedValueCase_ == 16; + } + + /** + * + * + *
+   * Recommended flag value in string format for UI display.
+   * 
+ * + * string recommended_string_value = 16; + * + * @return The recommendedStringValue. + */ + public java.lang.String getRecommendedStringValue() { + java.lang.Object ref = ""; + if (recommendedValueCase_ == 16) { + ref = recommendedValue_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (recommendedValueCase_ == 16) { + recommendedValue_ = s; + } + return s; + } + } + + /** + * + * + *
+   * Recommended flag value in string format for UI display.
+   * 
+ * + * string recommended_string_value = 16; + * + * @return The bytes for recommendedStringValue. + */ + public com.google.protobuf.ByteString getRecommendedStringValueBytes() { + java.lang.Object ref = ""; + if (recommendedValueCase_ == 16) { + ref = recommendedValue_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (recommendedValueCase_ == 16) { + recommendedValue_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECOMMENDED_INT_VALUE_FIELD_NUMBER = 17; + + /** + * + * + *
+   * Recommended flag value in integer format for UI display.
+   * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + * + * @return Whether the recommendedIntValue field is set. + */ + @java.lang.Override + public boolean hasRecommendedIntValue() { + return recommendedValueCase_ == 17; + } + + /** + * + * + *
+   * Recommended flag value in integer format for UI display.
+   * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + * + * @return The recommendedIntValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getRecommendedIntValue() { + if (recommendedValueCase_ == 17) { + return (com.google.protobuf.Int64Value) recommendedValue_; + } + return com.google.protobuf.Int64Value.getDefaultInstance(); + } + + /** + * + * + *
+   * Recommended flag value in integer format for UI display.
+   * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getRecommendedIntValueOrBuilder() { + if (recommendedValueCase_ == 17) { + return (com.google.protobuf.Int64Value) recommendedValue_; + } + return com.google.protobuf.Int64Value.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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (type_ != com.google.cloud.sql.v1beta4.SqlFlagType.SQL_FLAG_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, type_); + } + if (getAppliesToList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(appliesToMemoizedSerializedSize); + } + for (int i = 0; i < appliesTo_.size(); i++) { + output.writeEnumNoTag(appliesTo_.getInt(i)); + } + for (int i = 0; i < allowedStringValues_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, allowedStringValues_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getMinValue()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getMaxValue()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(7, getRequiresRestart()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, kind_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(9, getInBeta()); + } + if (getAllowedIntValuesList().size() > 0) { + output.writeUInt32NoTag(82); + output.writeUInt32NoTag(allowedIntValuesMemoizedSerializedSize); + } + for (int i = 0; i < allowedIntValues_.size(); i++) { + output.writeInt64NoTag(allowedIntValues_.getLong(i)); + } + if (flagScope_ + != com.google.cloud.sql.v1beta4.SqlFlagScope.SQL_FLAG_SCOPE_UNSPECIFIED.getNumber()) { + output.writeEnum(15, flagScope_); + } + if (recommendedValueCase_ == 16) { + com.google.protobuf.GeneratedMessage.writeString(output, 16, recommendedValue_); + } + if (recommendedValueCase_ == 17) { + output.writeMessage(17, (com.google.protobuf.Int64Value) recommendedValue_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (type_ != com.google.cloud.sql.v1beta4.SqlFlagType.SQL_FLAG_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_); + } + { + int dataSize = 0; + for (int i = 0; i < appliesTo_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(appliesTo_.getInt(i)); + } + size += dataSize; + if (!getAppliesToList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + appliesToMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < allowedStringValues_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedStringValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedStringValuesList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getMinValue()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getMaxValue()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getRequiresRestart()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, kind_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getInBeta()); + } + { + int dataSize = 0; + for (int i = 0; i < allowedIntValues_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag( + allowedIntValues_.getLong(i)); + } + size += dataSize; + if (!getAllowedIntValuesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + allowedIntValuesMemoizedSerializedSize = dataSize; + } + if (flagScope_ + != com.google.cloud.sql.v1beta4.SqlFlagScope.SQL_FLAG_SCOPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(15, flagScope_); + } + if (recommendedValueCase_ == 16) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(16, recommendedValue_); + } + if (recommendedValueCase_ == 17) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 17, (com.google.protobuf.Int64Value) recommendedValue_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.Flag)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.Flag other = (com.google.cloud.sql.v1beta4.Flag) obj; + + if (!getName().equals(other.getName())) return false; + if (type_ != other.type_) return false; + if (!appliesTo_.equals(other.appliesTo_)) return false; + if (!getAllowedStringValuesList().equals(other.getAllowedStringValuesList())) return false; + if (hasMinValue() != other.hasMinValue()) return false; + if (hasMinValue()) { + if (!getMinValue().equals(other.getMinValue())) return false; + } + if (hasMaxValue() != other.hasMaxValue()) return false; + if (hasMaxValue()) { + if (!getMaxValue().equals(other.getMaxValue())) return false; + } + if (hasRequiresRestart() != other.hasRequiresRestart()) return false; + if (hasRequiresRestart()) { + if (!getRequiresRestart().equals(other.getRequiresRestart())) return false; + } + if (!getKind().equals(other.getKind())) return false; + if (hasInBeta() != other.hasInBeta()) return false; + if (hasInBeta()) { + if (!getInBeta().equals(other.getInBeta())) return false; + } + if (!getAllowedIntValuesList().equals(other.getAllowedIntValuesList())) return false; + if (flagScope_ != other.flagScope_) return false; + if (!getRecommendedValueCase().equals(other.getRecommendedValueCase())) return false; + switch (recommendedValueCase_) { + case 16: + if (!getRecommendedStringValue().equals(other.getRecommendedStringValue())) return false; + break; + case 17: + if (!getRecommendedIntValue().equals(other.getRecommendedIntValue())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + if (getAppliesToCount() > 0) { + hash = (37 * hash) + APPLIES_TO_FIELD_NUMBER; + hash = (53 * hash) + appliesTo_.hashCode(); + } + if (getAllowedStringValuesCount() > 0) { + hash = (37 * hash) + ALLOWED_STRING_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedStringValuesList().hashCode(); + } + if (hasMinValue()) { + hash = (37 * hash) + MIN_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getMinValue().hashCode(); + } + if (hasMaxValue()) { + hash = (37 * hash) + MAX_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getMaxValue().hashCode(); + } + if (hasRequiresRestart()) { + hash = (37 * hash) + REQUIRES_RESTART_FIELD_NUMBER; + hash = (53 * hash) + getRequiresRestart().hashCode(); + } + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasInBeta()) { + hash = (37 * hash) + IN_BETA_FIELD_NUMBER; + hash = (53 * hash) + getInBeta().hashCode(); + } + if (getAllowedIntValuesCount() > 0) { + hash = (37 * hash) + ALLOWED_INT_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedIntValuesList().hashCode(); + } + hash = (37 * hash) + FLAG_SCOPE_FIELD_NUMBER; + hash = (53 * hash) + flagScope_; + switch (recommendedValueCase_) { + case 16: + hash = (37 * hash) + RECOMMENDED_STRING_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getRecommendedStringValue().hashCode(); + break; + case 17: + hash = (37 * hash) + RECOMMENDED_INT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getRecommendedIntValue().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.Flag parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Flag parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Flag parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Flag parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Flag parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Flag parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Flag parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Flag parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Flag parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Flag parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Flag parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Flag parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.Flag prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A flag resource.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Flag} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.Flag) + com.google.cloud.sql.v1beta4.FlagOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Flag_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Flag_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Flag.class, + com.google.cloud.sql.v1beta4.Flag.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.Flag.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMinValueFieldBuilder(); + internalGetMaxValueFieldBuilder(); + internalGetRequiresRestartFieldBuilder(); + internalGetInBetaFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + type_ = 0; + appliesTo_ = emptyIntList(); + allowedStringValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + minValue_ = null; + if (minValueBuilder_ != null) { + minValueBuilder_.dispose(); + minValueBuilder_ = null; + } + maxValue_ = null; + if (maxValueBuilder_ != null) { + maxValueBuilder_.dispose(); + maxValueBuilder_ = null; + } + requiresRestart_ = null; + if (requiresRestartBuilder_ != null) { + requiresRestartBuilder_.dispose(); + requiresRestartBuilder_ = null; + } + kind_ = ""; + inBeta_ = null; + if (inBetaBuilder_ != null) { + inBetaBuilder_.dispose(); + inBetaBuilder_ = null; + } + allowedIntValues_ = emptyLongList(); + flagScope_ = 0; + if (recommendedIntValueBuilder_ != null) { + recommendedIntValueBuilder_.clear(); + } + recommendedValueCase_ = 0; + recommendedValue_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Flag_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Flag getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.Flag.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Flag build() { + com.google.cloud.sql.v1beta4.Flag result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Flag buildPartial() { + com.google.cloud.sql.v1beta4.Flag result = new com.google.cloud.sql.v1beta4.Flag(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.Flag result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + appliesTo_.makeImmutable(); + result.appliesTo_ = appliesTo_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + allowedStringValues_.makeImmutable(); + result.allowedStringValues_ = allowedStringValues_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.minValue_ = minValueBuilder_ == null ? minValue_ : minValueBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.maxValue_ = maxValueBuilder_ == null ? maxValue_ : maxValueBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.requiresRestart_ = + requiresRestartBuilder_ == null ? requiresRestart_ : requiresRestartBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.inBeta_ = inBetaBuilder_ == null ? inBeta_ : inBetaBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + allowedIntValues_.makeImmutable(); + result.allowedIntValues_ = allowedIntValues_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.flagScope_ = flagScope_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.sql.v1beta4.Flag result) { + result.recommendedValueCase_ = recommendedValueCase_; + result.recommendedValue_ = this.recommendedValue_; + if (recommendedValueCase_ == 17 && recommendedIntValueBuilder_ != null) { + result.recommendedValue_ = recommendedIntValueBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.Flag) { + return mergeFrom((com.google.cloud.sql.v1beta4.Flag) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.Flag other) { + if (other == com.google.cloud.sql.v1beta4.Flag.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.appliesTo_.isEmpty()) { + if (appliesTo_.isEmpty()) { + appliesTo_ = other.appliesTo_; + appliesTo_.makeImmutable(); + bitField0_ |= 0x00000004; + } else { + ensureAppliesToIsMutable(); + appliesTo_.addAll(other.appliesTo_); + } + onChanged(); + } + if (!other.allowedStringValues_.isEmpty()) { + if (allowedStringValues_.isEmpty()) { + allowedStringValues_ = other.allowedStringValues_; + bitField0_ |= 0x00000008; + } else { + ensureAllowedStringValuesIsMutable(); + allowedStringValues_.addAll(other.allowedStringValues_); + } + onChanged(); + } + if (other.hasMinValue()) { + mergeMinValue(other.getMinValue()); + } + if (other.hasMaxValue()) { + mergeMaxValue(other.getMaxValue()); + } + if (other.hasRequiresRestart()) { + mergeRequiresRestart(other.getRequiresRestart()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.hasInBeta()) { + mergeInBeta(other.getInBeta()); + } + if (!other.allowedIntValues_.isEmpty()) { + if (allowedIntValues_.isEmpty()) { + allowedIntValues_ = other.allowedIntValues_; + allowedIntValues_.makeImmutable(); + bitField0_ |= 0x00000200; + } else { + ensureAllowedIntValuesIsMutable(); + allowedIntValues_.addAll(other.allowedIntValues_); + } + onChanged(); + } + if (other.flagScope_ != 0) { + setFlagScopeValue(other.getFlagScopeValue()); + } + switch (other.getRecommendedValueCase()) { + case RECOMMENDED_STRING_VALUE: + { + recommendedValueCase_ = 16; + recommendedValue_ = other.recommendedValue_; + onChanged(); + break; + } + case RECOMMENDED_INT_VALUE: + { + mergeRecommendedIntValue(other.getRecommendedIntValue()); + break; + } + case RECOMMENDEDVALUE_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_ |= 0x00000001; + break; + } // case 10 + case 16: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + int tmpRaw = input.readEnum(); + ensureAppliesToIsMutable(); + appliesTo_.addInt(tmpRaw); + break; + } // case 24 + case 26: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureAppliesToIsMutable(); + while (input.getBytesUntilLimit() > 0) { + appliesTo_.addInt(input.readEnum()); + } + input.popLimit(limit); + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAllowedStringValuesIsMutable(); + allowedStringValues_.add(s); + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetMinValueFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetMaxValueFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetRequiresRestartFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + input.readMessage(internalGetInBetaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 80: + { + long v = input.readInt64(); + ensureAllowedIntValuesIsMutable(); + allowedIntValues_.addLong(v); + break; + } // case 80 + case 82: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureAllowedIntValuesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + allowedIntValues_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 82 + case 120: + { + flagScope_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 120 + case 130: + { + java.lang.String s = input.readStringRequireUtf8(); + recommendedValueCase_ = 16; + recommendedValue_ = s; + break; + } // case 130 + case 138: + { + input.readMessage( + internalGetRecommendedIntValueFieldBuilder().getBuilder(), extensionRegistry); + recommendedValueCase_ = 17; + break; + } // case 138 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int recommendedValueCase_ = 0; + private java.lang.Object recommendedValue_; + + public RecommendedValueCase getRecommendedValueCase() { + return RecommendedValueCase.forNumber(recommendedValueCase_); + } + + public Builder clearRecommendedValue() { + recommendedValueCase_ = 0; + recommendedValue_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * This is the name of the flag. Flag names always use underscores, not
+     * hyphens, for example: `max_allowed_packet`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is the name of the flag. Flag names always use underscores, not
+     * hyphens, for example: `max_allowed_packet`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is the name of the flag. Flag names always use underscores, not
+     * hyphens, for example: `max_allowed_packet`
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is the name of the flag. Flag names always use underscores, not
+     * hyphens, for example: `max_allowed_packet`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is the name of the flag. Flag names always use underscores, not
+     * hyphens, for example: `max_allowed_packet`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int type_ = 0; + + /** + * + * + *
+     * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+     * `INTEGER` or `NONE`. `NONE` is used for flags which do not take a
+     * value, such as `skip_grant_tables`.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagType type = 2; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+     * `INTEGER` or `NONE`. `NONE` is used for flags which do not take a
+     * value, such as `skip_grant_tables`.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagType type = 2; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+     * `INTEGER` or `NONE`. `NONE` is used for flags which do not take a
+     * value, such as `skip_grant_tables`.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagType type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlFlagType getType() { + com.google.cloud.sql.v1beta4.SqlFlagType result = + com.google.cloud.sql.v1beta4.SqlFlagType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1beta4.SqlFlagType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+     * `INTEGER` or `NONE`. `NONE` is used for flags which do not take a
+     * value, such as `skip_grant_tables`.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagType type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.sql.v1beta4.SqlFlagType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+     * `INTEGER` or `NONE`. `NONE` is used for flags which do not take a
+     * value, such as `skip_grant_tables`.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagType type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000002); + type_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList appliesTo_ = emptyIntList(); + + private void ensureAppliesToIsMutable() { + if (!appliesTo_.isModifiable()) { + appliesTo_ = makeMutableCopy(appliesTo_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @return A list containing the appliesTo. + */ + public java.util.List getAppliesToList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.cloud.sql.v1beta4.SqlDatabaseVersion>(appliesTo_, appliesTo_converter_); + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @return The count of appliesTo. + */ + public int getAppliesToCount() { + return appliesTo_.size(); + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @param index The index of the element to return. + * @return The appliesTo at the given index. + */ + public com.google.cloud.sql.v1beta4.SqlDatabaseVersion getAppliesTo(int index) { + return appliesTo_converter_.convert(appliesTo_.getInt(index)); + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @param index The index to set the value at. + * @param value The appliesTo to set. + * @return This builder for chaining. + */ + public Builder setAppliesTo(int index, com.google.cloud.sql.v1beta4.SqlDatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppliesToIsMutable(); + appliesTo_.setInt(index, value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @param value The appliesTo to add. + * @return This builder for chaining. + */ + public Builder addAppliesTo(com.google.cloud.sql.v1beta4.SqlDatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppliesToIsMutable(); + appliesTo_.addInt(value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @param values The appliesTo to add. + * @return This builder for chaining. + */ + public Builder addAllAppliesTo( + java.lang.Iterable values) { + ensureAppliesToIsMutable(); + for (com.google.cloud.sql.v1beta4.SqlDatabaseVersion value : values) { + appliesTo_.addInt(value.getNumber()); + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @return This builder for chaining. + */ + public Builder clearAppliesTo() { + appliesTo_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @return A list containing the enum numeric values on the wire for appliesTo. + */ + public java.util.List getAppliesToValueList() { + appliesTo_.makeImmutable(); + return appliesTo_; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of appliesTo at the given index. + */ + public int getAppliesToValue(int index) { + return appliesTo_.getInt(index); + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for appliesTo to set. + * @return This builder for chaining. + */ + public Builder setAppliesToValue(int index, int value) { + ensureAppliesToIsMutable(); + appliesTo_.setInt(index, value); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @param value The enum numeric value on the wire for appliesTo to add. + * @return This builder for chaining. + */ + public Builder addAppliesToValue(int value) { + ensureAppliesToIsMutable(); + appliesTo_.addInt(value); + onChanged(); + return this; + } + + /** + * + * + *
+     * The database version this flag applies to. Can be
+     * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+     * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+     * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+     * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+     * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+     * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+     * `SQLSERVER_2019_WEB`.
+     * See [the complete
+     * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @param values The enum numeric values on the wire for appliesTo to add. + * @return This builder for chaining. + */ + public Builder addAllAppliesToValue(java.lang.Iterable values) { + ensureAppliesToIsMutable(); + for (int value : values) { + appliesTo_.addInt(value); + } + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList allowedStringValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAllowedStringValuesIsMutable() { + if (!allowedStringValues_.isModifiable()) { + allowedStringValues_ = new com.google.protobuf.LazyStringArrayList(allowedStringValues_); + } + bitField0_ |= 0x00000008; + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @return A list containing the allowedStringValues. + */ + public com.google.protobuf.ProtocolStringList getAllowedStringValuesList() { + allowedStringValues_.makeImmutable(); + return allowedStringValues_; + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @return The count of allowedStringValues. + */ + public int getAllowedStringValuesCount() { + return allowedStringValues_.size(); + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @param index The index of the element to return. + * @return The allowedStringValues at the given index. + */ + public java.lang.String getAllowedStringValues(int index) { + return allowedStringValues_.get(index); + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @param index The index of the value to return. + * @return The bytes of the allowedStringValues at the given index. + */ + public com.google.protobuf.ByteString getAllowedStringValuesBytes(int index) { + return allowedStringValues_.getByteString(index); + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @param index The index to set the value at. + * @param value The allowedStringValues to set. + * @return This builder for chaining. + */ + public Builder setAllowedStringValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedStringValuesIsMutable(); + allowedStringValues_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @param value The allowedStringValues to add. + * @return This builder for chaining. + */ + public Builder addAllowedStringValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedStringValuesIsMutable(); + allowedStringValues_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @param values The allowedStringValues to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedStringValues(java.lang.Iterable values) { + ensureAllowedStringValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedStringValues_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @return This builder for chaining. + */ + public Builder clearAllowedStringValues() { + allowedStringValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `STRING` flags, a list of strings that the value can be set to.
+     * 
+ * + * repeated string allowed_string_values = 4; + * + * @param value The bytes of the allowedStringValues to add. + * @return This builder for chaining. + */ + public Builder addAllowedStringValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedStringValuesIsMutable(); + allowedStringValues_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.Int64Value minValue_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + minValueBuilder_; + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + * + * @return Whether the minValue field is set. + */ + public boolean hasMinValue() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + * + * @return The minValue. + */ + public com.google.protobuf.Int64Value getMinValue() { + if (minValueBuilder_ == null) { + return minValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : minValue_; + } else { + return minValueBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + public Builder setMinValue(com.google.protobuf.Int64Value value) { + if (minValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minValue_ = value; + } else { + minValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + public Builder setMinValue(com.google.protobuf.Int64Value.Builder builderForValue) { + if (minValueBuilder_ == null) { + minValue_ = builderForValue.build(); + } else { + minValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + public Builder mergeMinValue(com.google.protobuf.Int64Value value) { + if (minValueBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && minValue_ != null + && minValue_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getMinValueBuilder().mergeFrom(value); + } else { + minValue_ = value; + } + } else { + minValueBuilder_.mergeFrom(value); + } + if (minValue_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + public Builder clearMinValue() { + bitField0_ = (bitField0_ & ~0x00000010); + minValue_ = null; + if (minValueBuilder_ != null) { + minValueBuilder_.dispose(); + minValueBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + public com.google.protobuf.Int64Value.Builder getMinValueBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetMinValueFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + public com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder() { + if (minValueBuilder_ != null) { + return minValueBuilder_.getMessageOrBuilder(); + } else { + return minValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : minValue_; + } + } + + /** + * + * + *
+     * For `INTEGER` flags, the minimum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetMinValueFieldBuilder() { + if (minValueBuilder_ == null) { + minValueBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getMinValue(), getParentForChildren(), isClean()); + minValue_ = null; + } + return minValueBuilder_; + } + + private com.google.protobuf.Int64Value maxValue_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + maxValueBuilder_; + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + * + * @return Whether the maxValue field is set. + */ + public boolean hasMaxValue() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + * + * @return The maxValue. + */ + public com.google.protobuf.Int64Value getMaxValue() { + if (maxValueBuilder_ == null) { + return maxValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : maxValue_; + } else { + return maxValueBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + public Builder setMaxValue(com.google.protobuf.Int64Value value) { + if (maxValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxValue_ = value; + } else { + maxValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + public Builder setMaxValue(com.google.protobuf.Int64Value.Builder builderForValue) { + if (maxValueBuilder_ == null) { + maxValue_ = builderForValue.build(); + } else { + maxValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + public Builder mergeMaxValue(com.google.protobuf.Int64Value value) { + if (maxValueBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && maxValue_ != null + && maxValue_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getMaxValueBuilder().mergeFrom(value); + } else { + maxValue_ = value; + } + } else { + maxValueBuilder_.mergeFrom(value); + } + if (maxValue_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + public Builder clearMaxValue() { + bitField0_ = (bitField0_ & ~0x00000020); + maxValue_ = null; + if (maxValueBuilder_ != null) { + maxValueBuilder_.dispose(); + maxValueBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + public com.google.protobuf.Int64Value.Builder getMaxValueBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetMaxValueFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + public com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder() { + if (maxValueBuilder_ != null) { + return maxValueBuilder_.getMessageOrBuilder(); + } else { + return maxValue_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : maxValue_; + } + } + + /** + * + * + *
+     * For `INTEGER` flags, the maximum allowed value.
+     * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetMaxValueFieldBuilder() { + if (maxValueBuilder_ == null) { + maxValueBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getMaxValue(), getParentForChildren(), isClean()); + maxValue_ = null; + } + return maxValueBuilder_; + } + + private com.google.protobuf.BoolValue requiresRestart_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + requiresRestartBuilder_; + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + * + * @return Whether the requiresRestart field is set. + */ + public boolean hasRequiresRestart() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + * + * @return The requiresRestart. + */ + public com.google.protobuf.BoolValue getRequiresRestart() { + if (requiresRestartBuilder_ == null) { + return requiresRestart_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : requiresRestart_; + } else { + return requiresRestartBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + public Builder setRequiresRestart(com.google.protobuf.BoolValue value) { + if (requiresRestartBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requiresRestart_ = value; + } else { + requiresRestartBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + public Builder setRequiresRestart(com.google.protobuf.BoolValue.Builder builderForValue) { + if (requiresRestartBuilder_ == null) { + requiresRestart_ = builderForValue.build(); + } else { + requiresRestartBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + public Builder mergeRequiresRestart(com.google.protobuf.BoolValue value) { + if (requiresRestartBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && requiresRestart_ != null + && requiresRestart_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getRequiresRestartBuilder().mergeFrom(value); + } else { + requiresRestart_ = value; + } + } else { + requiresRestartBuilder_.mergeFrom(value); + } + if (requiresRestart_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + public Builder clearRequiresRestart() { + bitField0_ = (bitField0_ & ~0x00000040); + requiresRestart_ = null; + if (requiresRestartBuilder_ != null) { + requiresRestartBuilder_.dispose(); + requiresRestartBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + public com.google.protobuf.BoolValue.Builder getRequiresRestartBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetRequiresRestartFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + public com.google.protobuf.BoolValueOrBuilder getRequiresRestartOrBuilder() { + if (requiresRestartBuilder_ != null) { + return requiresRestartBuilder_.getMessageOrBuilder(); + } else { + return requiresRestart_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : requiresRestart_; + } + } + + /** + * + * + *
+     * Indicates whether changing this flag will trigger a database restart. Only
+     * applicable to Second Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetRequiresRestartFieldBuilder() { + if (requiresRestartBuilder_ == null) { + requiresRestartBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getRequiresRestart(), getParentForChildren(), isClean()); + requiresRestart_ = null; + } + return requiresRestartBuilder_; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#flag`.
+     * 
+ * + * string kind = 8; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#flag`.
+     * 
+ * + * string kind = 8; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#flag`.
+     * 
+ * + * string kind = 8; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#flag`.
+     * 
+ * + * string kind = 8; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#flag`.
+     * 
+ * + * string kind = 8; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue inBeta_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + inBetaBuilder_; + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + * + * @return Whether the inBeta field is set. + */ + public boolean hasInBeta() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + * + * @return The inBeta. + */ + public com.google.protobuf.BoolValue getInBeta() { + if (inBetaBuilder_ == null) { + return inBeta_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : inBeta_; + } else { + return inBetaBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + public Builder setInBeta(com.google.protobuf.BoolValue value) { + if (inBetaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inBeta_ = value; + } else { + inBetaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + public Builder setInBeta(com.google.protobuf.BoolValue.Builder builderForValue) { + if (inBetaBuilder_ == null) { + inBeta_ = builderForValue.build(); + } else { + inBetaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + public Builder mergeInBeta(com.google.protobuf.BoolValue value) { + if (inBetaBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && inBeta_ != null + && inBeta_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getInBetaBuilder().mergeFrom(value); + } else { + inBeta_ = value; + } + } else { + inBetaBuilder_.mergeFrom(value); + } + if (inBeta_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + public Builder clearInBeta() { + bitField0_ = (bitField0_ & ~0x00000100); + inBeta_ = null; + if (inBetaBuilder_ != null) { + inBetaBuilder_.dispose(); + inBetaBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + public com.google.protobuf.BoolValue.Builder getInBetaBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetInBetaFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + public com.google.protobuf.BoolValueOrBuilder getInBetaOrBuilder() { + if (inBetaBuilder_ != null) { + return inBetaBuilder_.getMessageOrBuilder(); + } else { + return inBeta_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : inBeta_; + } + } + + /** + * + * + *
+     * Whether or not the flag is considered in beta.
+     * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetInBetaFieldBuilder() { + if (inBetaBuilder_ == null) { + inBetaBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getInBeta(), getParentForChildren(), isClean()); + inBeta_ = null; + } + return inBetaBuilder_; + } + + private com.google.protobuf.Internal.LongList allowedIntValues_ = emptyLongList(); + + private void ensureAllowedIntValuesIsMutable() { + if (!allowedIntValues_.isModifiable()) { + allowedIntValues_ = makeMutableCopy(allowedIntValues_); + } + bitField0_ |= 0x00000200; + } + + /** + * + * + *
+     * Use this field if only certain integers are accepted. Can be combined
+     * with min_value and max_value to add additional values.
+     * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @return A list containing the allowedIntValues. + */ + public java.util.List getAllowedIntValuesList() { + allowedIntValues_.makeImmutable(); + return allowedIntValues_; + } + + /** + * + * + *
+     * Use this field if only certain integers are accepted. Can be combined
+     * with min_value and max_value to add additional values.
+     * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @return The count of allowedIntValues. + */ + public int getAllowedIntValuesCount() { + return allowedIntValues_.size(); + } + + /** + * + * + *
+     * Use this field if only certain integers are accepted. Can be combined
+     * with min_value and max_value to add additional values.
+     * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @param index The index of the element to return. + * @return The allowedIntValues at the given index. + */ + public long getAllowedIntValues(int index) { + return allowedIntValues_.getLong(index); + } + + /** + * + * + *
+     * Use this field if only certain integers are accepted. Can be combined
+     * with min_value and max_value to add additional values.
+     * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @param index The index to set the value at. + * @param value The allowedIntValues to set. + * @return This builder for chaining. + */ + public Builder setAllowedIntValues(int index, long value) { + + ensureAllowedIntValuesIsMutable(); + allowedIntValues_.setLong(index, value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Use this field if only certain integers are accepted. Can be combined
+     * with min_value and max_value to add additional values.
+     * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @param value The allowedIntValues to add. + * @return This builder for chaining. + */ + public Builder addAllowedIntValues(long value) { + + ensureAllowedIntValuesIsMutable(); + allowedIntValues_.addLong(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Use this field if only certain integers are accepted. Can be combined
+     * with min_value and max_value to add additional values.
+     * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @param values The allowedIntValues to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedIntValues(java.lang.Iterable values) { + ensureAllowedIntValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedIntValues_); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Use this field if only certain integers are accepted. Can be combined
+     * with min_value and max_value to add additional values.
+     * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @return This builder for chaining. + */ + public Builder clearAllowedIntValues() { + allowedIntValues_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + + private int flagScope_ = 0; + + /** + * + * + *
+     * Scope of flag.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 15; + * + * @return The enum numeric value on the wire for flagScope. + */ + @java.lang.Override + public int getFlagScopeValue() { + return flagScope_; + } + + /** + * + * + *
+     * Scope of flag.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 15; + * + * @param value The enum numeric value on the wire for flagScope to set. + * @return This builder for chaining. + */ + public Builder setFlagScopeValue(int value) { + flagScope_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Scope of flag.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 15; + * + * @return The flagScope. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlFlagScope getFlagScope() { + com.google.cloud.sql.v1beta4.SqlFlagScope result = + com.google.cloud.sql.v1beta4.SqlFlagScope.forNumber(flagScope_); + return result == null ? com.google.cloud.sql.v1beta4.SqlFlagScope.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Scope of flag.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 15; + * + * @param value The flagScope to set. + * @return This builder for chaining. + */ + public Builder setFlagScope(com.google.cloud.sql.v1beta4.SqlFlagScope value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + flagScope_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Scope of flag.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 15; + * + * @return This builder for chaining. + */ + public Builder clearFlagScope() { + bitField0_ = (bitField0_ & ~0x00000400); + flagScope_ = 0; + onChanged(); + return this; + } + + /** + * + * + *
+     * Recommended flag value in string format for UI display.
+     * 
+ * + * string recommended_string_value = 16; + * + * @return Whether the recommendedStringValue field is set. + */ + @java.lang.Override + public boolean hasRecommendedStringValue() { + return recommendedValueCase_ == 16; + } + + /** + * + * + *
+     * Recommended flag value in string format for UI display.
+     * 
+ * + * string recommended_string_value = 16; + * + * @return The recommendedStringValue. + */ + @java.lang.Override + public java.lang.String getRecommendedStringValue() { + java.lang.Object ref = ""; + if (recommendedValueCase_ == 16) { + ref = recommendedValue_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (recommendedValueCase_ == 16) { + recommendedValue_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Recommended flag value in string format for UI display.
+     * 
+ * + * string recommended_string_value = 16; + * + * @return The bytes for recommendedStringValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecommendedStringValueBytes() { + java.lang.Object ref = ""; + if (recommendedValueCase_ == 16) { + ref = recommendedValue_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (recommendedValueCase_ == 16) { + recommendedValue_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Recommended flag value in string format for UI display.
+     * 
+ * + * string recommended_string_value = 16; + * + * @param value The recommendedStringValue to set. + * @return This builder for chaining. + */ + public Builder setRecommendedStringValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + recommendedValueCase_ = 16; + recommendedValue_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Recommended flag value in string format for UI display.
+     * 
+ * + * string recommended_string_value = 16; + * + * @return This builder for chaining. + */ + public Builder clearRecommendedStringValue() { + if (recommendedValueCase_ == 16) { + recommendedValueCase_ = 0; + recommendedValue_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Recommended flag value in string format for UI display.
+     * 
+ * + * string recommended_string_value = 16; + * + * @param value The bytes for recommendedStringValue to set. + * @return This builder for chaining. + */ + public Builder setRecommendedStringValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + recommendedValueCase_ = 16; + recommendedValue_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + recommendedIntValueBuilder_; + + /** + * + * + *
+     * Recommended flag value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + * + * @return Whether the recommendedIntValue field is set. + */ + @java.lang.Override + public boolean hasRecommendedIntValue() { + return recommendedValueCase_ == 17; + } + + /** + * + * + *
+     * Recommended flag value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + * + * @return The recommendedIntValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getRecommendedIntValue() { + if (recommendedIntValueBuilder_ == null) { + if (recommendedValueCase_ == 17) { + return (com.google.protobuf.Int64Value) recommendedValue_; + } + return com.google.protobuf.Int64Value.getDefaultInstance(); + } else { + if (recommendedValueCase_ == 17) { + return recommendedIntValueBuilder_.getMessage(); + } + return com.google.protobuf.Int64Value.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Recommended flag value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + public Builder setRecommendedIntValue(com.google.protobuf.Int64Value value) { + if (recommendedIntValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + recommendedValue_ = value; + onChanged(); + } else { + recommendedIntValueBuilder_.setMessage(value); + } + recommendedValueCase_ = 17; + return this; + } + + /** + * + * + *
+     * Recommended flag value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + public Builder setRecommendedIntValue(com.google.protobuf.Int64Value.Builder builderForValue) { + if (recommendedIntValueBuilder_ == null) { + recommendedValue_ = builderForValue.build(); + onChanged(); + } else { + recommendedIntValueBuilder_.setMessage(builderForValue.build()); + } + recommendedValueCase_ = 17; + return this; + } + + /** + * + * + *
+     * Recommended flag value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + public Builder mergeRecommendedIntValue(com.google.protobuf.Int64Value value) { + if (recommendedIntValueBuilder_ == null) { + if (recommendedValueCase_ == 17 + && recommendedValue_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + recommendedValue_ = + com.google.protobuf.Int64Value.newBuilder( + (com.google.protobuf.Int64Value) recommendedValue_) + .mergeFrom(value) + .buildPartial(); + } else { + recommendedValue_ = value; + } + onChanged(); + } else { + if (recommendedValueCase_ == 17) { + recommendedIntValueBuilder_.mergeFrom(value); + } else { + recommendedIntValueBuilder_.setMessage(value); + } + } + recommendedValueCase_ = 17; + return this; + } + + /** + * + * + *
+     * Recommended flag value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + public Builder clearRecommendedIntValue() { + if (recommendedIntValueBuilder_ == null) { + if (recommendedValueCase_ == 17) { + recommendedValueCase_ = 0; + recommendedValue_ = null; + onChanged(); + } + } else { + if (recommendedValueCase_ == 17) { + recommendedValueCase_ = 0; + recommendedValue_ = null; + } + recommendedIntValueBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Recommended flag value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + public com.google.protobuf.Int64Value.Builder getRecommendedIntValueBuilder() { + return internalGetRecommendedIntValueFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Recommended flag value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getRecommendedIntValueOrBuilder() { + if ((recommendedValueCase_ == 17) && (recommendedIntValueBuilder_ != null)) { + return recommendedIntValueBuilder_.getMessageOrBuilder(); + } else { + if (recommendedValueCase_ == 17) { + return (com.google.protobuf.Int64Value) recommendedValue_; + } + return com.google.protobuf.Int64Value.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Recommended flag value in integer format for UI display.
+     * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetRecommendedIntValueFieldBuilder() { + if (recommendedIntValueBuilder_ == null) { + if (!(recommendedValueCase_ == 17)) { + recommendedValue_ = com.google.protobuf.Int64Value.getDefaultInstance(); + } + recommendedIntValueBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + (com.google.protobuf.Int64Value) recommendedValue_, + getParentForChildren(), + isClean()); + recommendedValue_ = null; + } + recommendedValueCase_ = 17; + onChanged(); + return recommendedIntValueBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.Flag) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.Flag) + private static final com.google.cloud.sql.v1beta4.Flag DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.Flag(); + } + + public static com.google.cloud.sql.v1beta4.Flag getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Flag parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Flag getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FlagOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FlagOrBuilder.java new file mode 100644 index 000000000000..489c95ea7396 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FlagOrBuilder.java @@ -0,0 +1,576 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface FlagOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.Flag) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is the name of the flag. Flag names always use underscores, not
+   * hyphens, for example: `max_allowed_packet`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * This is the name of the flag. Flag names always use underscores, not
+   * hyphens, for example: `max_allowed_packet`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+   * `INTEGER` or `NONE`. `NONE` is used for flags which do not take a
+   * value, such as `skip_grant_tables`.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagType type = 2; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
+   * `INTEGER` or `NONE`. `NONE` is used for flags which do not take a
+   * value, such as `skip_grant_tables`.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagType type = 2; + * + * @return The type. + */ + com.google.cloud.sql.v1beta4.SqlFlagType getType(); + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @return A list containing the appliesTo. + */ + java.util.List getAppliesToList(); + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @return The count of appliesTo. + */ + int getAppliesToCount(); + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @param index The index of the element to return. + * @return The appliesTo at the given index. + */ + com.google.cloud.sql.v1beta4.SqlDatabaseVersion getAppliesTo(int index); + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @return A list containing the enum numeric values on the wire for appliesTo. + */ + java.util.List getAppliesToValueList(); + + /** + * + * + *
+   * The database version this flag applies to. Can be
+   * MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
+   * or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
+   * `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
+   * `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
+   * `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
+   * `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
+   * `SQLSERVER_2019_WEB`.
+   * See [the complete
+   * list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDatabaseVersion applies_to = 3; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of appliesTo at the given index. + */ + int getAppliesToValue(int index); + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @return A list containing the allowedStringValues. + */ + java.util.List getAllowedStringValuesList(); + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @return The count of allowedStringValues. + */ + int getAllowedStringValuesCount(); + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @param index The index of the element to return. + * @return The allowedStringValues at the given index. + */ + java.lang.String getAllowedStringValues(int index); + + /** + * + * + *
+   * For `STRING` flags, a list of strings that the value can be set to.
+   * 
+ * + * repeated string allowed_string_values = 4; + * + * @param index The index of the value to return. + * @return The bytes of the allowedStringValues at the given index. + */ + com.google.protobuf.ByteString getAllowedStringValuesBytes(int index); + + /** + * + * + *
+   * For `INTEGER` flags, the minimum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value min_value = 5; + * + * @return Whether the minValue field is set. + */ + boolean hasMinValue(); + + /** + * + * + *
+   * For `INTEGER` flags, the minimum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value min_value = 5; + * + * @return The minValue. + */ + com.google.protobuf.Int64Value getMinValue(); + + /** + * + * + *
+   * For `INTEGER` flags, the minimum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value min_value = 5; + */ + com.google.protobuf.Int64ValueOrBuilder getMinValueOrBuilder(); + + /** + * + * + *
+   * For `INTEGER` flags, the maximum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value max_value = 6; + * + * @return Whether the maxValue field is set. + */ + boolean hasMaxValue(); + + /** + * + * + *
+   * For `INTEGER` flags, the maximum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value max_value = 6; + * + * @return The maxValue. + */ + com.google.protobuf.Int64Value getMaxValue(); + + /** + * + * + *
+   * For `INTEGER` flags, the maximum allowed value.
+   * 
+ * + * .google.protobuf.Int64Value max_value = 6; + */ + com.google.protobuf.Int64ValueOrBuilder getMaxValueOrBuilder(); + + /** + * + * + *
+   * Indicates whether changing this flag will trigger a database restart. Only
+   * applicable to Second Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + * + * @return Whether the requiresRestart field is set. + */ + boolean hasRequiresRestart(); + + /** + * + * + *
+   * Indicates whether changing this flag will trigger a database restart. Only
+   * applicable to Second Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + * + * @return The requiresRestart. + */ + com.google.protobuf.BoolValue getRequiresRestart(); + + /** + * + * + *
+   * Indicates whether changing this flag will trigger a database restart. Only
+   * applicable to Second Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue requires_restart = 7; + */ + com.google.protobuf.BoolValueOrBuilder getRequiresRestartOrBuilder(); + + /** + * + * + *
+   * This is always `sql#flag`.
+   * 
+ * + * string kind = 8; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#flag`.
+   * 
+ * + * string kind = 8; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Whether or not the flag is considered in beta.
+   * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + * + * @return Whether the inBeta field is set. + */ + boolean hasInBeta(); + + /** + * + * + *
+   * Whether or not the flag is considered in beta.
+   * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + * + * @return The inBeta. + */ + com.google.protobuf.BoolValue getInBeta(); + + /** + * + * + *
+   * Whether or not the flag is considered in beta.
+   * 
+ * + * .google.protobuf.BoolValue in_beta = 9; + */ + com.google.protobuf.BoolValueOrBuilder getInBetaOrBuilder(); + + /** + * + * + *
+   * Use this field if only certain integers are accepted. Can be combined
+   * with min_value and max_value to add additional values.
+   * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @return A list containing the allowedIntValues. + */ + java.util.List getAllowedIntValuesList(); + + /** + * + * + *
+   * Use this field if only certain integers are accepted. Can be combined
+   * with min_value and max_value to add additional values.
+   * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @return The count of allowedIntValues. + */ + int getAllowedIntValuesCount(); + + /** + * + * + *
+   * Use this field if only certain integers are accepted. Can be combined
+   * with min_value and max_value to add additional values.
+   * 
+ * + * repeated int64 allowed_int_values = 10; + * + * @param index The index of the element to return. + * @return The allowedIntValues at the given index. + */ + long getAllowedIntValues(int index); + + /** + * + * + *
+   * Scope of flag.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 15; + * + * @return The enum numeric value on the wire for flagScope. + */ + int getFlagScopeValue(); + + /** + * + * + *
+   * Scope of flag.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 15; + * + * @return The flagScope. + */ + com.google.cloud.sql.v1beta4.SqlFlagScope getFlagScope(); + + /** + * + * + *
+   * Recommended flag value in string format for UI display.
+   * 
+ * + * string recommended_string_value = 16; + * + * @return Whether the recommendedStringValue field is set. + */ + boolean hasRecommendedStringValue(); + + /** + * + * + *
+   * Recommended flag value in string format for UI display.
+   * 
+ * + * string recommended_string_value = 16; + * + * @return The recommendedStringValue. + */ + java.lang.String getRecommendedStringValue(); + + /** + * + * + *
+   * Recommended flag value in string format for UI display.
+   * 
+ * + * string recommended_string_value = 16; + * + * @return The bytes for recommendedStringValue. + */ + com.google.protobuf.ByteString getRecommendedStringValueBytes(); + + /** + * + * + *
+   * Recommended flag value in integer format for UI display.
+   * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + * + * @return Whether the recommendedIntValue field is set. + */ + boolean hasRecommendedIntValue(); + + /** + * + * + *
+   * Recommended flag value in integer format for UI display.
+   * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + * + * @return The recommendedIntValue. + */ + com.google.protobuf.Int64Value getRecommendedIntValue(); + + /** + * + * + *
+   * Recommended flag value in integer format for UI display.
+   * 
+ * + * .google.protobuf.Int64Value recommended_int_value = 17; + */ + com.google.protobuf.Int64ValueOrBuilder getRecommendedIntValueOrBuilder(); + + com.google.cloud.sql.v1beta4.Flag.RecommendedValueCase getRecommendedValueCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FlagsListResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FlagsListResponse.java new file mode 100644 index 000000000000..dcb649dbd12c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FlagsListResponse.java @@ -0,0 +1,1106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Flags list response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.FlagsListResponse} + */ +@com.google.protobuf.Generated +public final class FlagsListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.FlagsListResponse) + FlagsListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FlagsListResponse"); + } + + // Use FlagsListResponse.newBuilder() to construct. + private FlagsListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FlagsListResponse() { + kind_ = ""; + items_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FlagsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FlagsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.FlagsListResponse.class, + com.google.cloud.sql.v1beta4.FlagsListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#flagsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#flagsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Flag getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.FlagOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.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.sql.v1beta4.FlagsListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.FlagsListResponse other = + (com.google.cloud.sql.v1beta4.FlagsListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.FlagsListResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.FlagsListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FlagsListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.FlagsListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FlagsListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.FlagsListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FlagsListResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.FlagsListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FlagsListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.FlagsListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.FlagsListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.FlagsListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.FlagsListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Flags list response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.FlagsListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.FlagsListResponse) + com.google.cloud.sql.v1beta4.FlagsListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FlagsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FlagsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.FlagsListResponse.class, + com.google.cloud.sql.v1beta4.FlagsListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.FlagsListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_FlagsListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.FlagsListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.FlagsListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.FlagsListResponse build() { + com.google.cloud.sql.v1beta4.FlagsListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.FlagsListResponse buildPartial() { + com.google.cloud.sql.v1beta4.FlagsListResponse result = + new com.google.cloud.sql.v1beta4.FlagsListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1beta4.FlagsListResponse result) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.FlagsListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.FlagsListResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.FlagsListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.FlagsListResponse other) { + if (other == com.google.cloud.sql.v1beta4.FlagsListResponse.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1beta4.Flag m = + input.readMessage( + com.google.cloud.sql.v1beta4.Flag.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#flagsList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#flagsList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#flagsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#flagsList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#flagsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Flag, + com.google.cloud.sql.v1beta4.Flag.Builder, + com.google.cloud.sql.v1beta4.FlagOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public com.google.cloud.sql.v1beta4.Flag getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1beta4.Flag value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1beta4.Flag.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.Flag value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1beta4.Flag value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.Flag.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1beta4.Flag.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public com.google.cloud.sql.v1beta4.Flag.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public com.google.cloud.sql.v1beta4.FlagOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public com.google.cloud.sql.v1beta4.Flag.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.Flag.getDefaultInstance()); + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public com.google.cloud.sql.v1beta4.Flag.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.Flag.getDefaultInstance()); + } + + /** + * + * + *
+     * List of flags.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Flag, + com.google.cloud.sql.v1beta4.Flag.Builder, + com.google.cloud.sql.v1beta4.FlagOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Flag, + com.google.cloud.sql.v1beta4.Flag.Builder, + com.google.cloud.sql.v1beta4.FlagOrBuilder>( + items_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.FlagsListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.FlagsListResponse) + private static final com.google.cloud.sql.v1beta4.FlagsListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.FlagsListResponse(); + } + + public static com.google.cloud.sql.v1beta4.FlagsListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FlagsListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.FlagsListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FlagsListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FlagsListResponseOrBuilder.java new file mode 100644 index 000000000000..ff228f833661 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/FlagsListResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface FlagsListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.FlagsListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#flagsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#flagsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + com.google.cloud.sql.v1beta4.Flag getItems(int index); + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + int getItemsCount(); + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + java.util.List getItemsOrBuilderList(); + + /** + * + * + *
+   * List of flags.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Flag items = 2; + */ + com.google.cloud.sql.v1beta4.FlagOrBuilder getItemsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GeminiInstanceConfig.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GeminiInstanceConfig.java new file mode 100644 index 000000000000..fafaee68f4c8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GeminiInstanceConfig.java @@ -0,0 +1,1265 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Gemini instance configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.GeminiInstanceConfig} + */ +@com.google.protobuf.Generated +public final class GeminiInstanceConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.GeminiInstanceConfig) + GeminiInstanceConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GeminiInstanceConfig"); + } + + // Use GeminiInstanceConfig.newBuilder() to construct. + private GeminiInstanceConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GeminiInstanceConfig() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_GeminiInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_GeminiInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.GeminiInstanceConfig.class, + com.google.cloud.sql.v1beta4.GeminiInstanceConfig.Builder.class); + } + + private int bitField0_; + public static final int ENTITLED_FIELD_NUMBER = 1; + private boolean entitled_ = false; + + /** + * + * + *
+   * Output only. Whether Gemini is enabled.
+   * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the entitled field is set. + */ + @java.lang.Override + public boolean hasEntitled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. Whether Gemini is enabled.
+   * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The entitled. + */ + @java.lang.Override + public boolean getEntitled() { + return entitled_; + } + + public static final int GOOGLE_VACUUM_MGMT_ENABLED_FIELD_NUMBER = 2; + private boolean googleVacuumMgmtEnabled_ = false; + + /** + * + * + *
+   * Output only. Whether the vacuum management is enabled.
+   * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the googleVacuumMgmtEnabled field is set. + */ + @java.lang.Override + public boolean hasGoogleVacuumMgmtEnabled() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. Whether the vacuum management is enabled.
+   * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The googleVacuumMgmtEnabled. + */ + @java.lang.Override + public boolean getGoogleVacuumMgmtEnabled() { + return googleVacuumMgmtEnabled_; + } + + public static final int OOM_SESSION_CANCEL_ENABLED_FIELD_NUMBER = 3; + private boolean oomSessionCancelEnabled_ = false; + + /** + * + * + *
+   * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+   * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the oomSessionCancelEnabled field is set. + */ + @java.lang.Override + public boolean hasOomSessionCancelEnabled() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+   * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The oomSessionCancelEnabled. + */ + @java.lang.Override + public boolean getOomSessionCancelEnabled() { + return oomSessionCancelEnabled_; + } + + public static final int ACTIVE_QUERY_ENABLED_FIELD_NUMBER = 4; + private boolean activeQueryEnabled_ = false; + + /** + * + * + *
+   * Output only. Whether the active query is enabled.
+   * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the activeQueryEnabled field is set. + */ + @java.lang.Override + public boolean hasActiveQueryEnabled() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Output only. Whether the active query is enabled.
+   * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The activeQueryEnabled. + */ + @java.lang.Override + public boolean getActiveQueryEnabled() { + return activeQueryEnabled_; + } + + public static final int INDEX_ADVISOR_ENABLED_FIELD_NUMBER = 5; + private boolean indexAdvisorEnabled_ = false; + + /** + * + * + *
+   * Output only. Whether the index advisor is enabled.
+   * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the indexAdvisorEnabled field is set. + */ + @java.lang.Override + public boolean hasIndexAdvisorEnabled() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Output only. Whether the index advisor is enabled.
+   * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The indexAdvisorEnabled. + */ + @java.lang.Override + public boolean getIndexAdvisorEnabled() { + return indexAdvisorEnabled_; + } + + public static final int FLAG_RECOMMENDER_ENABLED_FIELD_NUMBER = 6; + private boolean flagRecommenderEnabled_ = false; + + /** + * + * + *
+   * Output only. Whether the flag recommender is enabled.
+   * 
+ * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the flagRecommenderEnabled field is set. + */ + @java.lang.Override + public boolean hasFlagRecommenderEnabled() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Output only. Whether the flag recommender is enabled.
+   * 
+ * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The flagRecommenderEnabled. + */ + @java.lang.Override + public boolean getFlagRecommenderEnabled() { + return flagRecommenderEnabled_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, entitled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(2, googleVacuumMgmtEnabled_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeBool(3, oomSessionCancelEnabled_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeBool(4, activeQueryEnabled_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeBool(5, indexAdvisorEnabled_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeBool(6, flagRecommenderEnabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, entitled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, googleVacuumMgmtEnabled_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, oomSessionCancelEnabled_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, activeQueryEnabled_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, indexAdvisorEnabled_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, flagRecommenderEnabled_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.GeminiInstanceConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.GeminiInstanceConfig other = + (com.google.cloud.sql.v1beta4.GeminiInstanceConfig) obj; + + if (hasEntitled() != other.hasEntitled()) return false; + if (hasEntitled()) { + if (getEntitled() != other.getEntitled()) return false; + } + if (hasGoogleVacuumMgmtEnabled() != other.hasGoogleVacuumMgmtEnabled()) return false; + if (hasGoogleVacuumMgmtEnabled()) { + if (getGoogleVacuumMgmtEnabled() != other.getGoogleVacuumMgmtEnabled()) return false; + } + if (hasOomSessionCancelEnabled() != other.hasOomSessionCancelEnabled()) return false; + if (hasOomSessionCancelEnabled()) { + if (getOomSessionCancelEnabled() != other.getOomSessionCancelEnabled()) return false; + } + if (hasActiveQueryEnabled() != other.hasActiveQueryEnabled()) return false; + if (hasActiveQueryEnabled()) { + if (getActiveQueryEnabled() != other.getActiveQueryEnabled()) return false; + } + if (hasIndexAdvisorEnabled() != other.hasIndexAdvisorEnabled()) return false; + if (hasIndexAdvisorEnabled()) { + if (getIndexAdvisorEnabled() != other.getIndexAdvisorEnabled()) return false; + } + if (hasFlagRecommenderEnabled() != other.hasFlagRecommenderEnabled()) return false; + if (hasFlagRecommenderEnabled()) { + if (getFlagRecommenderEnabled() != other.getFlagRecommenderEnabled()) return false; + } + if (!getUnknownFields().equals(other.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 (hasEntitled()) { + hash = (37 * hash) + ENTITLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEntitled()); + } + if (hasGoogleVacuumMgmtEnabled()) { + hash = (37 * hash) + GOOGLE_VACUUM_MGMT_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getGoogleVacuumMgmtEnabled()); + } + if (hasOomSessionCancelEnabled()) { + hash = (37 * hash) + OOM_SESSION_CANCEL_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getOomSessionCancelEnabled()); + } + if (hasActiveQueryEnabled()) { + hash = (37 * hash) + ACTIVE_QUERY_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getActiveQueryEnabled()); + } + if (hasIndexAdvisorEnabled()) { + hash = (37 * hash) + INDEX_ADVISOR_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIndexAdvisorEnabled()); + } + if (hasFlagRecommenderEnabled()) { + hash = (37 * hash) + FLAG_RECOMMENDER_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFlagRecommenderEnabled()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.GeminiInstanceConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GeminiInstanceConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GeminiInstanceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GeminiInstanceConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GeminiInstanceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GeminiInstanceConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GeminiInstanceConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GeminiInstanceConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GeminiInstanceConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GeminiInstanceConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GeminiInstanceConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GeminiInstanceConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.GeminiInstanceConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Gemini instance configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.GeminiInstanceConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.GeminiInstanceConfig) + com.google.cloud.sql.v1beta4.GeminiInstanceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_GeminiInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_GeminiInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.GeminiInstanceConfig.class, + com.google.cloud.sql.v1beta4.GeminiInstanceConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.GeminiInstanceConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + entitled_ = false; + googleVacuumMgmtEnabled_ = false; + oomSessionCancelEnabled_ = false; + activeQueryEnabled_ = false; + indexAdvisorEnabled_ = false; + flagRecommenderEnabled_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_GeminiInstanceConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GeminiInstanceConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.GeminiInstanceConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GeminiInstanceConfig build() { + com.google.cloud.sql.v1beta4.GeminiInstanceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GeminiInstanceConfig buildPartial() { + com.google.cloud.sql.v1beta4.GeminiInstanceConfig result = + new com.google.cloud.sql.v1beta4.GeminiInstanceConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.GeminiInstanceConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.entitled_ = entitled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.googleVacuumMgmtEnabled_ = googleVacuumMgmtEnabled_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.oomSessionCancelEnabled_ = oomSessionCancelEnabled_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.activeQueryEnabled_ = activeQueryEnabled_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.indexAdvisorEnabled_ = indexAdvisorEnabled_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.flagRecommenderEnabled_ = flagRecommenderEnabled_; + to_bitField0_ |= 0x00000020; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.GeminiInstanceConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.GeminiInstanceConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.GeminiInstanceConfig other) { + if (other == com.google.cloud.sql.v1beta4.GeminiInstanceConfig.getDefaultInstance()) + return this; + if (other.hasEntitled()) { + setEntitled(other.getEntitled()); + } + if (other.hasGoogleVacuumMgmtEnabled()) { + setGoogleVacuumMgmtEnabled(other.getGoogleVacuumMgmtEnabled()); + } + if (other.hasOomSessionCancelEnabled()) { + setOomSessionCancelEnabled(other.getOomSessionCancelEnabled()); + } + if (other.hasActiveQueryEnabled()) { + setActiveQueryEnabled(other.getActiveQueryEnabled()); + } + if (other.hasIndexAdvisorEnabled()) { + setIndexAdvisorEnabled(other.getIndexAdvisorEnabled()); + } + if (other.hasFlagRecommenderEnabled()) { + setFlagRecommenderEnabled(other.getFlagRecommenderEnabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + entitled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + googleVacuumMgmtEnabled_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + oomSessionCancelEnabled_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + activeQueryEnabled_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + indexAdvisorEnabled_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + flagRecommenderEnabled_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean entitled_; + + /** + * + * + *
+     * Output only. Whether Gemini is enabled.
+     * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the entitled field is set. + */ + @java.lang.Override + public boolean hasEntitled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Output only. Whether Gemini is enabled.
+     * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The entitled. + */ + @java.lang.Override + public boolean getEntitled() { + return entitled_; + } + + /** + * + * + *
+     * Output only. Whether Gemini is enabled.
+     * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The entitled to set. + * @return This builder for chaining. + */ + public Builder setEntitled(boolean value) { + + entitled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Whether Gemini is enabled.
+     * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearEntitled() { + bitField0_ = (bitField0_ & ~0x00000001); + entitled_ = false; + onChanged(); + return this; + } + + private boolean googleVacuumMgmtEnabled_; + + /** + * + * + *
+     * Output only. Whether the vacuum management is enabled.
+     * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the googleVacuumMgmtEnabled field is set. + */ + @java.lang.Override + public boolean hasGoogleVacuumMgmtEnabled() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. Whether the vacuum management is enabled.
+     * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The googleVacuumMgmtEnabled. + */ + @java.lang.Override + public boolean getGoogleVacuumMgmtEnabled() { + return googleVacuumMgmtEnabled_; + } + + /** + * + * + *
+     * Output only. Whether the vacuum management is enabled.
+     * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The googleVacuumMgmtEnabled to set. + * @return This builder for chaining. + */ + public Builder setGoogleVacuumMgmtEnabled(boolean value) { + + googleVacuumMgmtEnabled_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Whether the vacuum management is enabled.
+     * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearGoogleVacuumMgmtEnabled() { + bitField0_ = (bitField0_ & ~0x00000002); + googleVacuumMgmtEnabled_ = false; + onChanged(); + return this; + } + + private boolean oomSessionCancelEnabled_; + + /** + * + * + *
+     * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+     * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the oomSessionCancelEnabled field is set. + */ + @java.lang.Override + public boolean hasOomSessionCancelEnabled() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+     * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The oomSessionCancelEnabled. + */ + @java.lang.Override + public boolean getOomSessionCancelEnabled() { + return oomSessionCancelEnabled_; + } + + /** + * + * + *
+     * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+     * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The oomSessionCancelEnabled to set. + * @return This builder for chaining. + */ + public Builder setOomSessionCancelEnabled(boolean value) { + + oomSessionCancelEnabled_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+     * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearOomSessionCancelEnabled() { + bitField0_ = (bitField0_ & ~0x00000004); + oomSessionCancelEnabled_ = false; + onChanged(); + return this; + } + + private boolean activeQueryEnabled_; + + /** + * + * + *
+     * Output only. Whether the active query is enabled.
+     * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the activeQueryEnabled field is set. + */ + @java.lang.Override + public boolean hasActiveQueryEnabled() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Output only. Whether the active query is enabled.
+     * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The activeQueryEnabled. + */ + @java.lang.Override + public boolean getActiveQueryEnabled() { + return activeQueryEnabled_; + } + + /** + * + * + *
+     * Output only. Whether the active query is enabled.
+     * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The activeQueryEnabled to set. + * @return This builder for chaining. + */ + public Builder setActiveQueryEnabled(boolean value) { + + activeQueryEnabled_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Whether the active query is enabled.
+     * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearActiveQueryEnabled() { + bitField0_ = (bitField0_ & ~0x00000008); + activeQueryEnabled_ = false; + onChanged(); + return this; + } + + private boolean indexAdvisorEnabled_; + + /** + * + * + *
+     * Output only. Whether the index advisor is enabled.
+     * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the indexAdvisorEnabled field is set. + */ + @java.lang.Override + public boolean hasIndexAdvisorEnabled() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Output only. Whether the index advisor is enabled.
+     * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The indexAdvisorEnabled. + */ + @java.lang.Override + public boolean getIndexAdvisorEnabled() { + return indexAdvisorEnabled_; + } + + /** + * + * + *
+     * Output only. Whether the index advisor is enabled.
+     * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The indexAdvisorEnabled to set. + * @return This builder for chaining. + */ + public Builder setIndexAdvisorEnabled(boolean value) { + + indexAdvisorEnabled_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Whether the index advisor is enabled.
+     * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearIndexAdvisorEnabled() { + bitField0_ = (bitField0_ & ~0x00000010); + indexAdvisorEnabled_ = false; + onChanged(); + return this; + } + + private boolean flagRecommenderEnabled_; + + /** + * + * + *
+     * Output only. Whether the flag recommender is enabled.
+     * 
+ * + * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the flagRecommenderEnabled field is set. + */ + @java.lang.Override + public boolean hasFlagRecommenderEnabled() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Output only. Whether the flag recommender is enabled.
+     * 
+ * + * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The flagRecommenderEnabled. + */ + @java.lang.Override + public boolean getFlagRecommenderEnabled() { + return flagRecommenderEnabled_; + } + + /** + * + * + *
+     * Output only. Whether the flag recommender is enabled.
+     * 
+ * + * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The flagRecommenderEnabled to set. + * @return This builder for chaining. + */ + public Builder setFlagRecommenderEnabled(boolean value) { + + flagRecommenderEnabled_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Whether the flag recommender is enabled.
+     * 
+ * + * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearFlagRecommenderEnabled() { + bitField0_ = (bitField0_ & ~0x00000020); + flagRecommenderEnabled_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.GeminiInstanceConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.GeminiInstanceConfig) + private static final com.google.cloud.sql.v1beta4.GeminiInstanceConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.GeminiInstanceConfig(); + } + + public static com.google.cloud.sql.v1beta4.GeminiInstanceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GeminiInstanceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GeminiInstanceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GeminiInstanceConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GeminiInstanceConfigOrBuilder.java new file mode 100644 index 000000000000..b8a67708e569 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GeminiInstanceConfigOrBuilder.java @@ -0,0 +1,198 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface GeminiInstanceConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.GeminiInstanceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Whether Gemini is enabled.
+   * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the entitled field is set. + */ + boolean hasEntitled(); + + /** + * + * + *
+   * Output only. Whether Gemini is enabled.
+   * 
+ * + * optional bool entitled = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The entitled. + */ + boolean getEntitled(); + + /** + * + * + *
+   * Output only. Whether the vacuum management is enabled.
+   * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the googleVacuumMgmtEnabled field is set. + */ + boolean hasGoogleVacuumMgmtEnabled(); + + /** + * + * + *
+   * Output only. Whether the vacuum management is enabled.
+   * 
+ * + * + * optional bool google_vacuum_mgmt_enabled = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The googleVacuumMgmtEnabled. + */ + boolean getGoogleVacuumMgmtEnabled(); + + /** + * + * + *
+   * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+   * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the oomSessionCancelEnabled field is set. + */ + boolean hasOomSessionCancelEnabled(); + + /** + * + * + *
+   * Output only. Whether canceling the out-of-memory (OOM) session is enabled.
+   * 
+ * + * + * optional bool oom_session_cancel_enabled = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The oomSessionCancelEnabled. + */ + boolean getOomSessionCancelEnabled(); + + /** + * + * + *
+   * Output only. Whether the active query is enabled.
+   * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the activeQueryEnabled field is set. + */ + boolean hasActiveQueryEnabled(); + + /** + * + * + *
+   * Output only. Whether the active query is enabled.
+   * 
+ * + * optional bool active_query_enabled = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The activeQueryEnabled. + */ + boolean getActiveQueryEnabled(); + + /** + * + * + *
+   * Output only. Whether the index advisor is enabled.
+   * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the indexAdvisorEnabled field is set. + */ + boolean hasIndexAdvisorEnabled(); + + /** + * + * + *
+   * Output only. Whether the index advisor is enabled.
+   * 
+ * + * optional bool index_advisor_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The indexAdvisorEnabled. + */ + boolean getIndexAdvisorEnabled(); + + /** + * + * + *
+   * Output only. Whether the flag recommender is enabled.
+   * 
+ * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the flagRecommenderEnabled field is set. + */ + boolean hasFlagRecommenderEnabled(); + + /** + * + * + *
+   * Output only. Whether the flag recommender is enabled.
+   * 
+ * + * optional bool flag_recommender_enabled = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The flagRecommenderEnabled. + */ + boolean getFlagRecommenderEnabled(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GenerateEphemeralCertRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GenerateEphemeralCertRequest.java new file mode 100644 index 000000000000..b02864674bca --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GenerateEphemeralCertRequest.java @@ -0,0 +1,1789 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Ephemeral certificate creation request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.GenerateEphemeralCertRequest} + */ +@com.google.protobuf.Generated +public final class GenerateEphemeralCertRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.GenerateEphemeralCertRequest) + GenerateEphemeralCertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GenerateEphemeralCertRequest"); + } + + // Use GenerateEphemeralCertRequest.newBuilder() to construct. + private GenerateEphemeralCertRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GenerateEphemeralCertRequest() { + instance_ = ""; + project_ = ""; + publicKey_ = ""; + accessToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest.class, + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PUBLIC_KEY_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object publicKey_ = ""; + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @return The publicKey. + */ + @java.lang.Override + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @return The bytes for publicKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACCESS_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object accessToken_ = ""; + + /** + * + * + *
+   * Optional. Access token to include in the signed certificate.
+   * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The accessToken. + */ + @java.lang.Override + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Access token to include in the signed certificate.
+   * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for accessToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp readTime_; + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readTime field is set. + */ + @java.lang.Override + public boolean hasReadTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + + public static final int VALID_DURATION_FIELD_NUMBER = 12; + private com.google.protobuf.Duration validDuration_; + + /** + * + * + *
+   * Optional. If set, it will contain the cert valid duration.
+   * 
+ * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the validDuration field is set. + */ + @java.lang.Override + public boolean hasValidDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. If set, it will contain the cert valid duration.
+   * 
+ * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The validDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getValidDuration() { + return validDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validDuration_; + } + + /** + * + * + *
+   * Optional. If set, it will contain the cert valid duration.
+   * 
+ * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getValidDurationOrBuilder() { + return validDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validDuration_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(publicKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, publicKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(accessToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, accessToken_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(7, getReadTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(12, getValidDuration()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(publicKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, publicKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(accessToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, accessToken_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getReadTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getValidDuration()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest other = + (com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getPublicKey().equals(other.getPublicKey())) return false; + if (!getAccessToken().equals(other.getAccessToken())) return false; + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (hasValidDuration() != other.hasValidDuration()) return false; + if (hasValidDuration()) { + if (!getValidDuration().equals(other.getValidDuration())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getPublicKey().hashCode(); + hash = (37 * hash) + ACCESS_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAccessToken().hashCode(); + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + if (hasValidDuration()) { + hash = (37 * hash) + VALID_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getValidDuration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Ephemeral certificate creation request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.GenerateEphemeralCertRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.GenerateEphemeralCertRequest) + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest.class, + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetReadTimeFieldBuilder(); + internalGetValidDurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + publicKey_ = ""; + accessToken_ = ""; + readTime_ = null; + if (readTimeBuilder_ != null) { + readTimeBuilder_.dispose(); + readTimeBuilder_ = null; + } + validDuration_ = null; + if (validDurationBuilder_ != null) { + validDurationBuilder_.dispose(); + validDurationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest build() { + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest buildPartial() { + com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest result = + new com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.publicKey_ = publicKey_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.accessToken_ = accessToken_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.readTime_ = readTimeBuilder_ == null ? readTime_ : readTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.validDuration_ = + validDurationBuilder_ == null ? validDuration_ : validDurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest other) { + if (other == com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPublicKey().isEmpty()) { + publicKey_ = other.publicKey_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getAccessToken().isEmpty()) { + accessToken_ = other.accessToken_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (other.hasValidDuration()) { + mergeValidDuration(other.getValidDuration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + publicKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + accessToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 58: + { + input.readMessage( + internalGetReadTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 58 + case 98: + { + input.readMessage( + internalGetValidDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 98 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object publicKey_ = ""; + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @return The publicKey. + */ + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @return The bytes for publicKey. + */ + public com.google.protobuf.ByteString getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @param value The publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + publicKey_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @return This builder for chaining. + */ + public Builder clearPublicKey() { + publicKey_ = getDefaultInstance().getPublicKey(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @param value The bytes for publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + publicKey_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object accessToken_ = ""; + + /** + * + * + *
+     * Optional. Access token to include in the signed certificate.
+     * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The accessToken. + */ + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Access token to include in the signed certificate.
+     * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for accessToken. + */ + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Access token to include in the signed certificate.
+     * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The accessToken to set. + * @return This builder for chaining. + */ + public Builder setAccessToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + accessToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Access token to include in the signed certificate.
+     * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearAccessToken() { + accessToken_ = getDefaultInstance().getAccessToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Access token to include in the signed certificate.
+     * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for accessToken to set. + * @return This builder for chaining. + */ + public Builder setAccessTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + accessToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + } else { + readTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && readTime_ != null + && readTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getReadTimeBuilder().mergeFrom(value); + } else { + readTime_ = value; + } + } else { + readTimeBuilder_.mergeFrom(value); + } + if (readTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearReadTime() { + bitField0_ = (bitField0_ & ~0x00000010); + readTime_ = null; + if (readTimeBuilder_ != null) { + readTimeBuilder_.dispose(); + readTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetReadTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private com.google.protobuf.Duration validDuration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + validDurationBuilder_; + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the validDuration field is set. + */ + public boolean hasValidDuration() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The validDuration. + */ + public com.google.protobuf.Duration getValidDuration() { + if (validDurationBuilder_ == null) { + return validDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validDuration_; + } else { + return validDurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setValidDuration(com.google.protobuf.Duration value) { + if (validDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + validDuration_ = value; + } else { + validDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setValidDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (validDurationBuilder_ == null) { + validDuration_ = builderForValue.build(); + } else { + validDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeValidDuration(com.google.protobuf.Duration value) { + if (validDurationBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && validDuration_ != null + && validDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getValidDurationBuilder().mergeFrom(value); + } else { + validDuration_ = value; + } + } else { + validDurationBuilder_.mergeFrom(value); + } + if (validDuration_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearValidDuration() { + bitField0_ = (bitField0_ & ~0x00000020); + validDuration_ = null; + if (validDurationBuilder_ != null) { + validDurationBuilder_.dispose(); + validDurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Duration.Builder getValidDurationBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetValidDurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.DurationOrBuilder getValidDurationOrBuilder() { + if (validDurationBuilder_ != null) { + return validDurationBuilder_.getMessageOrBuilder(); + } else { + return validDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validDuration_; + } + } + + /** + * + * + *
+     * Optional. If set, it will contain the cert valid duration.
+     * 
+ * + * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetValidDurationFieldBuilder() { + if (validDurationBuilder_ == null) { + validDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getValidDuration(), getParentForChildren(), isClean()); + validDuration_ = null; + } + return validDurationBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.GenerateEphemeralCertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.GenerateEphemeralCertRequest) + private static final com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest(); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateEphemeralCertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GenerateEphemeralCertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GenerateEphemeralCertRequestOrBuilder.java new file mode 100644 index 000000000000..ec0a8d5778f2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GenerateEphemeralCertRequestOrBuilder.java @@ -0,0 +1,219 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface GenerateEphemeralCertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.GenerateEphemeralCertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @return The publicKey. + */ + java.lang.String getPublicKey(); + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 3 [json_name = "public_key"]; + * + * @return The bytes for publicKey. + */ + com.google.protobuf.ByteString getPublicKeyBytes(); + + /** + * + * + *
+   * Optional. Access token to include in the signed certificate.
+   * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The accessToken. + */ + java.lang.String getAccessToken(); + + /** + * + * + *
+   * Optional. Access token to include in the signed certificate.
+   * 
+ * + * + * string access_token = 4 [json_name = "access_token", (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for accessToken. + */ + com.google.protobuf.ByteString getAccessTokenBytes(); + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Optional. If set, it will contain the cert valid duration.
+   * 
+ * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the validDuration field is set. + */ + boolean hasValidDuration(); + + /** + * + * + *
+   * Optional. If set, it will contain the cert valid duration.
+   * 
+ * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The validDuration. + */ + com.google.protobuf.Duration getValidDuration(); + + /** + * + * + *
+   * Optional. If set, it will contain the cert valid duration.
+   * 
+ * + * .google.protobuf.Duration valid_duration = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.DurationOrBuilder getValidDurationOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GenerateEphemeralCertResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GenerateEphemeralCertResponse.java new file mode 100644 index 000000000000..56489f73dd84 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GenerateEphemeralCertResponse.java @@ -0,0 +1,700 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Ephemeral certificate creation request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.GenerateEphemeralCertResponse} + */ +@com.google.protobuf.Generated +public final class GenerateEphemeralCertResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.GenerateEphemeralCertResponse) + GenerateEphemeralCertResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GenerateEphemeralCertResponse"); + } + + // Use GenerateEphemeralCertResponse.newBuilder() to construct. + private GenerateEphemeralCertResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GenerateEphemeralCertResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse.class, + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse.Builder.class); + } + + private int bitField0_; + public static final int EPHEMERAL_CERT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.SslCert ephemeralCert_; + + /** + * + * + *
+   * Generated cert
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + * + * @return Whether the ephemeralCert field is set. + */ + @java.lang.Override + public boolean hasEphemeralCert() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Generated cert
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + * + * @return The ephemeralCert. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCert getEphemeralCert() { + return ephemeralCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : ephemeralCert_; + } + + /** + * + * + *
+   * Generated cert
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getEphemeralCertOrBuilder() { + return ephemeralCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : ephemeralCert_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getEphemeralCert()); + } + 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, getEphemeralCert()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse other = + (com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse) obj; + + if (hasEphemeralCert() != other.hasEphemeralCert()) return false; + if (hasEphemeralCert()) { + if (!getEphemeralCert().equals(other.getEphemeralCert())) return false; + } + if (!getUnknownFields().equals(other.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 (hasEphemeralCert()) { + hash = (37 * hash) + EPHEMERAL_CERT_FIELD_NUMBER; + hash = (53 * hash) + getEphemeralCert().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Ephemeral certificate creation request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.GenerateEphemeralCertResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.GenerateEphemeralCertResponse) + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse.class, + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEphemeralCertFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + ephemeralCert_ = null; + if (ephemeralCertBuilder_ != null) { + ephemeralCertBuilder_.dispose(); + ephemeralCertBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GenerateEphemeralCertResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse build() { + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse buildPartial() { + com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse result = + new com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ephemeralCert_ = + ephemeralCertBuilder_ == null ? ephemeralCert_ : ephemeralCertBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse other) { + if (other == com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse.getDefaultInstance()) + return this; + if (other.hasEphemeralCert()) { + mergeEphemeralCert(other.getEphemeralCert()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetEphemeralCertFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.SslCert ephemeralCert_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + ephemeralCertBuilder_; + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + * + * @return Whether the ephemeralCert field is set. + */ + public boolean hasEphemeralCert() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + * + * @return The ephemeralCert. + */ + public com.google.cloud.sql.v1beta4.SslCert getEphemeralCert() { + if (ephemeralCertBuilder_ == null) { + return ephemeralCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : ephemeralCert_; + } else { + return ephemeralCertBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + */ + public Builder setEphemeralCert(com.google.cloud.sql.v1beta4.SslCert value) { + if (ephemeralCertBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ephemeralCert_ = value; + } else { + ephemeralCertBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + */ + public Builder setEphemeralCert(com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (ephemeralCertBuilder_ == null) { + ephemeralCert_ = builderForValue.build(); + } else { + ephemeralCertBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + */ + public Builder mergeEphemeralCert(com.google.cloud.sql.v1beta4.SslCert value) { + if (ephemeralCertBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && ephemeralCert_ != null + && ephemeralCert_ != com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()) { + getEphemeralCertBuilder().mergeFrom(value); + } else { + ephemeralCert_ = value; + } + } else { + ephemeralCertBuilder_.mergeFrom(value); + } + if (ephemeralCert_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + */ + public Builder clearEphemeralCert() { + bitField0_ = (bitField0_ & ~0x00000001); + ephemeralCert_ = null; + if (ephemeralCertBuilder_ != null) { + ephemeralCertBuilder_.dispose(); + ephemeralCertBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder getEphemeralCertBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetEphemeralCertFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + */ + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getEphemeralCertOrBuilder() { + if (ephemeralCertBuilder_ != null) { + return ephemeralCertBuilder_.getMessageOrBuilder(); + } else { + return ephemeralCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : ephemeralCert_; + } + } + + /** + * + * + *
+     * Generated cert
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + internalGetEphemeralCertFieldBuilder() { + if (ephemeralCertBuilder_ == null) { + ephemeralCertBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder>( + getEphemeralCert(), getParentForChildren(), isClean()); + ephemeralCert_ = null; + } + return ephemeralCertBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.GenerateEphemeralCertResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.GenerateEphemeralCertResponse) + private static final com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse(); + } + + public static com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateEphemeralCertResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GenerateEphemeralCertResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GenerateEphemeralCertResponseOrBuilder.java new file mode 100644 index 000000000000..5de437cccc5a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GenerateEphemeralCertResponseOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface GenerateEphemeralCertResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.GenerateEphemeralCertResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Generated cert
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + * + * @return Whether the ephemeralCert field is set. + */ + boolean hasEphemeralCert(); + + /** + * + * + *
+   * Generated cert
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + * + * @return The ephemeralCert. + */ + com.google.cloud.sql.v1beta4.SslCert getEphemeralCert(); + + /** + * + * + *
+   * Generated cert
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert ephemeral_cert = 1; + */ + com.google.cloud.sql.v1beta4.SslCertOrBuilder getEphemeralCertOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GetBackupRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GetBackupRequest.java new file mode 100644 index 000000000000..be6ff77a24df --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GetBackupRequest.java @@ -0,0 +1,616 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The request payload to get the backup.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.GetBackupRequest} + */ +@com.google.protobuf.Generated +public final class GetBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.GetBackupRequest) + GetBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetBackupRequest"); + } + + // Use GetBackupRequest.newBuilder() to construct. + private GetBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetBackupRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.GetBackupRequest.class, + com.google.cloud.sql.v1beta4.GetBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The name of the backup to retrieve.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * 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 backup to retrieve.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.sql.v1beta4.GetBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.GetBackupRequest other = + (com.google.cloud.sql.v1beta4.GetBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.GetBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GetBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GetBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GetBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GetBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GetBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GetBackupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GetBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GetBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GetBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GetBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GetBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.GetBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request payload to get the backup.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.GetBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.GetBackupRequest) + com.google.cloud.sql.v1beta4.GetBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.GetBackupRequest.class, + com.google.cloud.sql.v1beta4.GetBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.GetBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_GetBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GetBackupRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.GetBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GetBackupRequest build() { + com.google.cloud.sql.v1beta4.GetBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GetBackupRequest buildPartial() { + com.google.cloud.sql.v1beta4.GetBackupRequest result = + new com.google.cloud.sql.v1beta4.GetBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.GetBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.GetBackupRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.GetBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.GetBackupRequest other) { + if (other == com.google.cloud.sql.v1beta4.GetBackupRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The name of the backup to retrieve.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to retrieve.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to retrieve.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to retrieve.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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 backup to retrieve.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.GetBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.GetBackupRequest) + private static final com.google.cloud.sql.v1beta4.GetBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.GetBackupRequest(); + } + + public static com.google.cloud.sql.v1beta4.GetBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GetBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GetBackupRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GetBackupRequestOrBuilder.java new file mode 100644 index 000000000000..91e25d0b4877 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GetBackupRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface GetBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.GetBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the backup to retrieve.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The name of the backup to retrieve.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * + * 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-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GetConnectSettingsRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GetConnectSettingsRequest.java new file mode 100644 index 000000000000..efa2e24874b5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GetConnectSettingsRequest.java @@ -0,0 +1,1094 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Connect settings retrieval request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.GetConnectSettingsRequest} + */ +@com.google.protobuf.Generated +public final class GetConnectSettingsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.GetConnectSettingsRequest) + GetConnectSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetConnectSettingsRequest"); + } + + // Use GetConnectSettingsRequest.newBuilder() to construct. + private GetConnectSettingsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetConnectSettingsRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GetConnectSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GetConnectSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest.class, + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp readTime_; + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readTime field is set. + */ + @java.lang.Override + public boolean hasReadTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(7, getReadTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getReadTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.GetConnectSettingsRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest other = + (com.google.cloud.sql.v1beta4.GetConnectSettingsRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.GetConnectSettingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GetConnectSettingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GetConnectSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GetConnectSettingsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GetConnectSettingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.GetConnectSettingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GetConnectSettingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GetConnectSettingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GetConnectSettingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GetConnectSettingsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.GetConnectSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.GetConnectSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Connect settings retrieval request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.GetConnectSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.GetConnectSettingsRequest) + com.google.cloud.sql.v1beta4.GetConnectSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GetConnectSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GetConnectSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest.class, + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.GetConnectSettingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetReadTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + readTime_ = null; + if (readTimeBuilder_ != null) { + readTimeBuilder_.dispose(); + readTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_GetConnectSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GetConnectSettingsRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.GetConnectSettingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GetConnectSettingsRequest build() { + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GetConnectSettingsRequest buildPartial() { + com.google.cloud.sql.v1beta4.GetConnectSettingsRequest result = + new com.google.cloud.sql.v1beta4.GetConnectSettingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.GetConnectSettingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.readTime_ = readTimeBuilder_ == null ? readTime_ : readTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.GetConnectSettingsRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.GetConnectSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.GetConnectSettingsRequest other) { + if (other == com.google.cloud.sql.v1beta4.GetConnectSettingsRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 58: + { + input.readMessage( + internalGetReadTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + } else { + readTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && readTime_ != null + && readTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getReadTimeBuilder().mergeFrom(value); + } else { + readTime_ = value; + } + } else { + readTimeBuilder_.mergeFrom(value); + } + if (readTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearReadTime() { + bitField0_ = (bitField0_ & ~0x00000004); + readTime_ = null; + if (readTimeBuilder_ != null) { + readTimeBuilder_.dispose(); + readTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetReadTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + + /** + * + * + *
+     * Optional. Optional snapshot read timestamp to trade freshness for
+     * performance.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.GetConnectSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.GetConnectSettingsRequest) + private static final com.google.cloud.sql.v1beta4.GetConnectSettingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.GetConnectSettingsRequest(); + } + + public static com.google.cloud.sql.v1beta4.GetConnectSettingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetConnectSettingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.GetConnectSettingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GetConnectSettingsRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GetConnectSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..18b97116c7e0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/GetConnectSettingsRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface GetConnectSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.GetConnectSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + + /** + * + * + *
+   * Optional. Optional snapshot read timestamp to trade freshness for
+   * performance.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ImportContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ImportContext.java new file mode 100644 index 000000000000..1f81ea4e7a5c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ImportContext.java @@ -0,0 +1,12320 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance import context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ImportContext} + */ +@com.google.protobuf.Generated +public final class ImportContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ImportContext) + ImportContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ImportContext"); + } + + // Use ImportContext.newBuilder() to construct. + private ImportContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ImportContext() { + uri_ = ""; + database_ = ""; + kind_ = ""; + fileType_ = 0; + importUser_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ImportContext.class, + com.google.cloud.sql.v1beta4.ImportContext.Builder.class); + } + + public interface SqlImportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ImportContext.SqlImportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. The number of threads to use for parallel import.
+     * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the threads field is set. + */ + boolean hasThreads(); + + /** + * + * + *
+     * Optional. The number of threads to use for parallel import.
+     * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The threads. + */ + com.google.protobuf.Int32Value getThreads(); + + /** + * + * + *
+     * Optional. The number of threads to use for parallel import.
+     * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.Int32ValueOrBuilder getThreadsOrBuilder(); + + /** + * + * + *
+     * Optional. Whether or not the import should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parallel field is set. + */ + boolean hasParallel(); + + /** + * + * + *
+     * Optional. Whether or not the import should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parallel. + */ + com.google.protobuf.BoolValue getParallel(); + + /** + * + * + *
+     * Optional. Whether or not the import should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getParallelOrBuilder(); + + /** + * + * + *
+     * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the postgresImportOptions field is set. + */ + boolean hasPostgresImportOptions(); + + /** + * + * + *
+     * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The postgresImportOptions. + */ + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + getPostgresImportOptions(); + + /** + * + * + *
+     * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptionsOrBuilder + getPostgresImportOptionsOrBuilder(); + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.ImportContext.SqlImportOptions} */ + public static final class SqlImportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ImportContext.SqlImportOptions) + SqlImportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlImportOptions"); + } + + // Use SqlImportOptions.newBuilder() to construct. + private SqlImportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlImportOptions() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.class, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.Builder.class); + } + + public interface PostgresImportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Optional. The --clean flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clean field is set. + */ + boolean hasClean(); + + /** + * + * + *
+       * Optional. The --clean flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clean. + */ + com.google.protobuf.BoolValue getClean(); + + /** + * + * + *
+       * Optional. The --clean flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getCleanOrBuilder(); + + /** + * + * + *
+       * Optional. The --if-exists flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the ifExists field is set. + */ + boolean hasIfExists(); + + /** + * + * + *
+       * Optional. The --if-exists flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The ifExists. + */ + com.google.protobuf.BoolValue getIfExists(); + + /** + * + * + *
+       * Optional. The --if-exists flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getIfExistsOrBuilder(); + } + + /** + * Protobuf type {@code + * google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions} + */ + public static final class PostgresImportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions) + PostgresImportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PostgresImportOptions"); + } + + // Use PostgresImportOptions.newBuilder() to construct. + private PostgresImportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PostgresImportOptions() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_PostgresImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_PostgresImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + .class, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + .Builder.class); + } + + private int bitField0_; + public static final int CLEAN_FIELD_NUMBER = 1; + private com.google.protobuf.BoolValue clean_; + + /** + * + * + *
+       * Optional. The --clean flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clean field is set. + */ + @java.lang.Override + public boolean hasClean() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Optional. The --clean flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clean. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getClean() { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } + + /** + * + * + *
+       * Optional. The --clean flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getCleanOrBuilder() { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } + + public static final int IF_EXISTS_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue ifExists_; + + /** + * + * + *
+       * Optional. The --if-exists flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the ifExists field is set. + */ + @java.lang.Override + public boolean hasIfExists() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Optional. The --if-exists flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The ifExists. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getIfExists() { + return ifExists_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : ifExists_; + } + + /** + * + * + *
+       * Optional. The --if-exists flag for the pg_restore utility. This flag
+       * applies only if you enabled Cloud SQL to import files in parallel.
+       * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getIfExistsOrBuilder() { + return ifExists_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : ifExists_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getClean()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getIfExists()); + } + 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, getClean()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getIfExists()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions other = + (com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions) obj; + + if (hasClean() != other.hasClean()) return false; + if (hasClean()) { + if (!getClean().equals(other.getClean())) return false; + } + if (hasIfExists() != other.hasIfExists()) return false; + if (hasIfExists()) { + if (!getIfExists().equals(other.getIfExists())) return false; + } + if (!getUnknownFields().equals(other.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 (hasClean()) { + hash = (37 * hash) + CLEAN_FIELD_NUMBER; + hash = (53 * hash) + getClean().hashCode(); + } + if (hasIfExists()) { + hash = (37 * hash) + IF_EXISTS_FIELD_NUMBER; + hash = (53 * hash) + getIfExists().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code + * google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions) + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_PostgresImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_PostgresImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + .class, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + .Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCleanFieldBuilder(); + internalGetIfExistsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + clean_ = null; + if (cleanBuilder_ != null) { + cleanBuilder_.dispose(); + cleanBuilder_ = null; + } + ifExists_ = null; + if (ifExistsBuilder_ != null) { + ifExistsBuilder_.dispose(); + ifExistsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_PostgresImportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + build() { + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + buildPartial() { + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions result = + new com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.clean_ = cleanBuilder_ == null ? clean_ : cleanBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ifExists_ = ifExistsBuilder_ == null ? ifExists_ : ifExistsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + other) { + if (other + == com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + .getDefaultInstance()) return this; + if (other.hasClean()) { + mergeClean(other.getClean()); + } + if (other.hasIfExists()) { + mergeIfExists(other.getIfExists()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetCleanFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetIfExistsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.BoolValue clean_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + cleanBuilder_; + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clean field is set. + */ + public boolean hasClean() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clean. + */ + public com.google.protobuf.BoolValue getClean() { + if (cleanBuilder_ == null) { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } else { + return cleanBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setClean(com.google.protobuf.BoolValue value) { + if (cleanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clean_ = value; + } else { + cleanBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setClean(com.google.protobuf.BoolValue.Builder builderForValue) { + if (cleanBuilder_ == null) { + clean_ = builderForValue.build(); + } else { + cleanBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeClean(com.google.protobuf.BoolValue value) { + if (cleanBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && clean_ != null + && clean_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getCleanBuilder().mergeFrom(value); + } else { + clean_ = value; + } + } else { + cleanBuilder_.mergeFrom(value); + } + if (clean_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearClean() { + bitField0_ = (bitField0_ & ~0x00000001); + clean_ = null; + if (cleanBuilder_ != null) { + cleanBuilder_.dispose(); + cleanBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getCleanBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetCleanFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getCleanOrBuilder() { + if (cleanBuilder_ != null) { + return cleanBuilder_.getMessageOrBuilder(); + } else { + return clean_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : clean_; + } + } + + /** + * + * + *
+         * Optional. The --clean flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue clean = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetCleanFieldBuilder() { + if (cleanBuilder_ == null) { + cleanBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getClean(), getParentForChildren(), isClean()); + clean_ = null; + } + return cleanBuilder_; + } + + private com.google.protobuf.BoolValue ifExists_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + ifExistsBuilder_; + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the ifExists field is set. + */ + public boolean hasIfExists() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The ifExists. + */ + public com.google.protobuf.BoolValue getIfExists() { + if (ifExistsBuilder_ == null) { + return ifExists_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : ifExists_; + } else { + return ifExistsBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setIfExists(com.google.protobuf.BoolValue value) { + if (ifExistsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ifExists_ = value; + } else { + ifExistsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setIfExists(com.google.protobuf.BoolValue.Builder builderForValue) { + if (ifExistsBuilder_ == null) { + ifExists_ = builderForValue.build(); + } else { + ifExistsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeIfExists(com.google.protobuf.BoolValue value) { + if (ifExistsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && ifExists_ != null + && ifExists_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getIfExistsBuilder().mergeFrom(value); + } else { + ifExists_ = value; + } + } else { + ifExistsBuilder_.mergeFrom(value); + } + if (ifExists_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearIfExists() { + bitField0_ = (bitField0_ & ~0x00000002); + ifExists_ = null; + if (ifExistsBuilder_ != null) { + ifExistsBuilder_.dispose(); + ifExistsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getIfExistsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetIfExistsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getIfExistsOrBuilder() { + if (ifExistsBuilder_ != null) { + return ifExistsBuilder_.getMessageOrBuilder(); + } else { + return ifExists_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : ifExists_; + } + } + + /** + * + * + *
+         * Optional. The --if-exists flag for the pg_restore utility. This flag
+         * applies only if you enabled Cloud SQL to import files in parallel.
+         * 
+ * + * .google.protobuf.BoolValue if_exists = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetIfExistsFieldBuilder() { + if (ifExistsBuilder_ == null) { + ifExistsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getIfExists(), getParentForChildren(), isClean()); + ifExists_ = null; + } + return ifExistsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions) + private static final com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions(); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PostgresImportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int THREADS_FIELD_NUMBER = 1; + private com.google.protobuf.Int32Value threads_; + + /** + * + * + *
+     * Optional. The number of threads to use for parallel import.
+     * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the threads field is set. + */ + @java.lang.Override + public boolean hasThreads() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. The number of threads to use for parallel import.
+     * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The threads. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getThreads() { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } + + /** + * + * + *
+     * Optional. The number of threads to use for parallel import.
+     * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getThreadsOrBuilder() { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } + + public static final int PARALLEL_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue parallel_; + + /** + * + * + *
+     * Optional. Whether or not the import should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parallel field is set. + */ + @java.lang.Override + public boolean hasParallel() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. Whether or not the import should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parallel. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getParallel() { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } + + /** + * + * + *
+     * Optional. Whether or not the import should be parallel.
+     * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getParallelOrBuilder() { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } + + public static final int POSTGRES_IMPORT_OPTIONS_FIELD_NUMBER = 3; + private com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + postgresImportOptions_; + + /** + * + * + *
+     * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the postgresImportOptions field is set. + */ + @java.lang.Override + public boolean hasPostgresImportOptions() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The postgresImportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + getPostgresImportOptions() { + return postgresImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + .getDefaultInstance() + : postgresImportOptions_; + } + + /** + * + * + *
+     * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptionsOrBuilder + getPostgresImportOptionsOrBuilder() { + return postgresImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + .getDefaultInstance() + : postgresImportOptions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getThreads()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getParallel()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getPostgresImportOptions()); + } + 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, getThreads()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getParallel()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPostgresImportOptions()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions other = + (com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions) obj; + + if (hasThreads() != other.hasThreads()) return false; + if (hasThreads()) { + if (!getThreads().equals(other.getThreads())) return false; + } + if (hasParallel() != other.hasParallel()) return false; + if (hasParallel()) { + if (!getParallel().equals(other.getParallel())) return false; + } + if (hasPostgresImportOptions() != other.hasPostgresImportOptions()) return false; + if (hasPostgresImportOptions()) { + if (!getPostgresImportOptions().equals(other.getPostgresImportOptions())) return false; + } + if (!getUnknownFields().equals(other.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 (hasThreads()) { + hash = (37 * hash) + THREADS_FIELD_NUMBER; + hash = (53 * hash) + getThreads().hashCode(); + } + if (hasParallel()) { + hash = (37 * hash) + PARALLEL_FIELD_NUMBER; + hash = (53 * hash) + getParallel().hashCode(); + } + if (hasPostgresImportOptions()) { + hash = (37 * hash) + POSTGRES_IMPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPostgresImportOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.ImportContext.SqlImportOptions} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ImportContext.SqlImportOptions) + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.class, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetThreadsFieldBuilder(); + internalGetParallelFieldBuilder(); + internalGetPostgresImportOptionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + threads_ = null; + if (threadsBuilder_ != null) { + threadsBuilder_.dispose(); + threadsBuilder_ = null; + } + parallel_ = null; + if (parallelBuilder_ != null) { + parallelBuilder_.dispose(); + parallelBuilder_ = null; + } + postgresImportOptions_ = null; + if (postgresImportOptionsBuilder_ != null) { + postgresImportOptionsBuilder_.dispose(); + postgresImportOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlImportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions build() { + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions buildPartial() { + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions result = + new com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.threads_ = threadsBuilder_ == null ? threads_ : threadsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.parallel_ = parallelBuilder_ == null ? parallel_ : parallelBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.postgresImportOptions_ = + postgresImportOptionsBuilder_ == null + ? postgresImportOptions_ + : postgresImportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions) { + return mergeFrom((com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions other) { + if (other + == com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.getDefaultInstance()) + return this; + if (other.hasThreads()) { + mergeThreads(other.getThreads()); + } + if (other.hasParallel()) { + mergeParallel(other.getParallel()); + } + if (other.hasPostgresImportOptions()) { + mergePostgresImportOptions(other.getPostgresImportOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetThreadsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetParallelFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetPostgresImportOptionsFieldBuilder().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 com.google.protobuf.Int32Value threads_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + threadsBuilder_; + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the threads field is set. + */ + public boolean hasThreads() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The threads. + */ + public com.google.protobuf.Int32Value getThreads() { + if (threadsBuilder_ == null) { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } else { + return threadsBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setThreads(com.google.protobuf.Int32Value value) { + if (threadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + threads_ = value; + } else { + threadsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setThreads(com.google.protobuf.Int32Value.Builder builderForValue) { + if (threadsBuilder_ == null) { + threads_ = builderForValue.build(); + } else { + threadsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeThreads(com.google.protobuf.Int32Value value) { + if (threadsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && threads_ != null + && threads_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getThreadsBuilder().mergeFrom(value); + } else { + threads_ = value; + } + } else { + threadsBuilder_.mergeFrom(value); + } + if (threads_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearThreads() { + bitField0_ = (bitField0_ & ~0x00000001); + threads_ = null; + if (threadsBuilder_ != null) { + threadsBuilder_.dispose(); + threadsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Int32Value.Builder getThreadsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetThreadsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Int32ValueOrBuilder getThreadsOrBuilder() { + if (threadsBuilder_ != null) { + return threadsBuilder_.getMessageOrBuilder(); + } else { + return threads_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : threads_; + } + } + + /** + * + * + *
+       * Optional. The number of threads to use for parallel import.
+       * 
+ * + * .google.protobuf.Int32Value threads = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetThreadsFieldBuilder() { + if (threadsBuilder_ == null) { + threadsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getThreads(), getParentForChildren(), isClean()); + threads_ = null; + } + return threadsBuilder_; + } + + private com.google.protobuf.BoolValue parallel_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + parallelBuilder_; + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parallel field is set. + */ + public boolean hasParallel() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parallel. + */ + public com.google.protobuf.BoolValue getParallel() { + if (parallelBuilder_ == null) { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } else { + return parallelBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setParallel(com.google.protobuf.BoolValue value) { + if (parallelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parallel_ = value; + } else { + parallelBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setParallel(com.google.protobuf.BoolValue.Builder builderForValue) { + if (parallelBuilder_ == null) { + parallel_ = builderForValue.build(); + } else { + parallelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeParallel(com.google.protobuf.BoolValue value) { + if (parallelBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && parallel_ != null + && parallel_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getParallelBuilder().mergeFrom(value); + } else { + parallel_ = value; + } + } else { + parallelBuilder_.mergeFrom(value); + } + if (parallel_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearParallel() { + bitField0_ = (bitField0_ & ~0x00000002); + parallel_ = null; + if (parallelBuilder_ != null) { + parallelBuilder_.dispose(); + parallelBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getParallelBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetParallelFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getParallelOrBuilder() { + if (parallelBuilder_ != null) { + return parallelBuilder_.getMessageOrBuilder(); + } else { + return parallel_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : parallel_; + } + } + + /** + * + * + *
+       * Optional. Whether or not the import should be parallel.
+       * 
+ * + * .google.protobuf.BoolValue parallel = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetParallelFieldBuilder() { + if (parallelBuilder_ == null) { + parallelBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getParallel(), getParentForChildren(), isClean()); + parallel_ = null; + } + return parallelBuilder_; + } + + private com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + postgresImportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + .Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptionsOrBuilder> + postgresImportOptionsBuilder_; + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the postgresImportOptions field is set. + */ + public boolean hasPostgresImportOptions() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The postgresImportOptions. + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + getPostgresImportOptions() { + if (postgresImportOptionsBuilder_ == null) { + return postgresImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + .getDefaultInstance() + : postgresImportOptions_; + } else { + return postgresImportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPostgresImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions value) { + if (postgresImportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + postgresImportOptions_ = value; + } else { + postgresImportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPostgresImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions.Builder + builderForValue) { + if (postgresImportOptionsBuilder_ == null) { + postgresImportOptions_ = builderForValue.build(); + } else { + postgresImportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergePostgresImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions value) { + if (postgresImportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && postgresImportOptions_ != null + && postgresImportOptions_ + != com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptions.getDefaultInstance()) { + getPostgresImportOptionsBuilder().mergeFrom(value); + } else { + postgresImportOptions_ = value; + } + } else { + postgresImportOptionsBuilder_.mergeFrom(value); + } + if (postgresImportOptions_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPostgresImportOptions() { + bitField0_ = (bitField0_ & ~0x00000004); + postgresImportOptions_ = null; + if (postgresImportOptionsBuilder_ != null) { + postgresImportOptionsBuilder_.dispose(); + postgresImportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + .Builder + getPostgresImportOptionsBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetPostgresImportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptionsOrBuilder + getPostgresImportOptionsOrBuilder() { + if (postgresImportOptionsBuilder_ != null) { + return postgresImportOptionsBuilder_.getMessageOrBuilder(); + } else { + return postgresImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + .getDefaultInstance() + : postgresImportOptions_; + } + } + + /** + * + * + *
+       * Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions postgres_import_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + .Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptionsOrBuilder> + internalGetPostgresImportOptionsFieldBuilder() { + if (postgresImportOptionsBuilder_ == null) { + postgresImportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions + .Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .PostgresImportOptionsOrBuilder>( + getPostgresImportOptions(), getParentForChildren(), isClean()); + postgresImportOptions_ = null; + } + return postgresImportOptionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ImportContext.SqlImportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ImportContext.SqlImportOptions) + private static final com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions(); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlImportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlCsvImportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The table to which CSV data is imported.
+     * 
+ * + * string table = 1; + * + * @return The table. + */ + java.lang.String getTable(); + + /** + * + * + *
+     * The table to which CSV data is imported.
+     * 
+ * + * string table = 1; + * + * @return The bytes for table. + */ + com.google.protobuf.ByteString getTableBytes(); + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @return A list containing the columns. + */ + java.util.List getColumnsList(); + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @return The count of columns. + */ + int getColumnsCount(); + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @param index The index of the element to return. + * @return The columns at the given index. + */ + java.lang.String getColumns(int index); + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @param index The index of the value to return. + * @return The bytes of the columns at the given index. + */ + com.google.protobuf.ByteString getColumnsBytes(int index); + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 4; + * + * @return The escapeCharacter. + */ + java.lang.String getEscapeCharacter(); + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 4; + * + * @return The bytes for escapeCharacter. + */ + com.google.protobuf.ByteString getEscapeCharacterBytes(); + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 5; + * + * @return The quoteCharacter. + */ + java.lang.String getQuoteCharacter(); + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 5; + * + * @return The bytes for quoteCharacter. + */ + com.google.protobuf.ByteString getQuoteCharacterBytes(); + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 6; + * + * @return The fieldsTerminatedBy. + */ + java.lang.String getFieldsTerminatedBy(); + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 6; + * + * @return The bytes for fieldsTerminatedBy. + */ + com.google.protobuf.ByteString getFieldsTerminatedByBytes(); + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 8; + * + * @return The linesTerminatedBy. + */ + java.lang.String getLinesTerminatedBy(); + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 8; + * + * @return The bytes for linesTerminatedBy. + */ + com.google.protobuf.ByteString getLinesTerminatedByBytes(); + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions} */ + public static final class SqlCsvImportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions) + SqlCsvImportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlCsvImportOptions"); + } + + // Use SqlCsvImportOptions.newBuilder() to construct. + private SqlCsvImportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlCsvImportOptions() { + table_ = ""; + columns_ = com.google.protobuf.LazyStringArrayList.emptyList(); + escapeCharacter_ = ""; + quoteCharacter_ = ""; + fieldsTerminatedBy_ = ""; + linesTerminatedBy_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlCsvImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlCsvImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.class, + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.Builder.class); + } + + public static final int TABLE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object table_ = ""; + + /** + * + * + *
+     * The table to which CSV data is imported.
+     * 
+ * + * string table = 1; + * + * @return The table. + */ + @java.lang.Override + public java.lang.String getTable() { + java.lang.Object ref = table_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + table_ = s; + return s; + } + } + + /** + * + * + *
+     * The table to which CSV data is imported.
+     * 
+ * + * string table = 1; + * + * @return The bytes for table. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableBytes() { + java.lang.Object ref = table_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + table_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLUMNS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList columns_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @return A list containing the columns. + */ + public com.google.protobuf.ProtocolStringList getColumnsList() { + return columns_; + } + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @return The count of columns. + */ + public int getColumnsCount() { + return columns_.size(); + } + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @param index The index of the element to return. + * @return The columns at the given index. + */ + public java.lang.String getColumns(int index) { + return columns_.get(index); + } + + /** + * + * + *
+     * The columns to which CSV data is imported. If not specified, all columns
+     * of the database table are loaded with CSV data.
+     * 
+ * + * repeated string columns = 2; + * + * @param index The index of the value to return. + * @return The bytes of the columns at the given index. + */ + public com.google.protobuf.ByteString getColumnsBytes(int index) { + return columns_.getByteString(index); + } + + public static final int ESCAPE_CHARACTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object escapeCharacter_ = ""; + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 4; + * + * @return The escapeCharacter. + */ + @java.lang.Override + public java.lang.String getEscapeCharacter() { + java.lang.Object ref = escapeCharacter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + escapeCharacter_ = s; + return s; + } + } + + /** + * + * + *
+     * Specifies the character that should appear before a data character that
+     * needs to be escaped.
+     * 
+ * + * string escape_character = 4; + * + * @return The bytes for escapeCharacter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEscapeCharacterBytes() { + java.lang.Object ref = escapeCharacter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + escapeCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTE_CHARACTER_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object quoteCharacter_ = ""; + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 5; + * + * @return The quoteCharacter. + */ + @java.lang.Override + public java.lang.String getQuoteCharacter() { + java.lang.Object ref = quoteCharacter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quoteCharacter_ = s; + return s; + } + } + + /** + * + * + *
+     * Specifies the quoting character to be used when a data value is quoted.
+     * 
+ * + * string quote_character = 5; + * + * @return The bytes for quoteCharacter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQuoteCharacterBytes() { + java.lang.Object ref = quoteCharacter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quoteCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIELDS_TERMINATED_BY_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object fieldsTerminatedBy_ = ""; + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 6; + * + * @return The fieldsTerminatedBy. + */ + @java.lang.Override + public java.lang.String getFieldsTerminatedBy() { + java.lang.Object ref = fieldsTerminatedBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldsTerminatedBy_ = s; + return s; + } + } + + /** + * + * + *
+     * Specifies the character that separates columns within each row (line) of
+     * the file.
+     * 
+ * + * string fields_terminated_by = 6; + * + * @return The bytes for fieldsTerminatedBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFieldsTerminatedByBytes() { + java.lang.Object ref = fieldsTerminatedBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldsTerminatedBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINES_TERMINATED_BY_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object linesTerminatedBy_ = ""; + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 8; + * + * @return The linesTerminatedBy. + */ + @java.lang.Override + public java.lang.String getLinesTerminatedBy() { + java.lang.Object ref = linesTerminatedBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + linesTerminatedBy_ = s; + return s; + } + } + + /** + * + * + *
+     * This is used to separate lines. If a line does not contain all fields,
+     * the rest of the columns are set to their default values.
+     * 
+ * + * string lines_terminated_by = 8; + * + * @return The bytes for linesTerminatedBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLinesTerminatedByBytes() { + java.lang.Object ref = linesTerminatedBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + linesTerminatedBy_ = 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.GeneratedMessage.isStringEmpty(table_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, table_); + } + for (int i = 0; i < columns_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, columns_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(escapeCharacter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, escapeCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(quoteCharacter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, quoteCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fieldsTerminatedBy_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, fieldsTerminatedBy_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(linesTerminatedBy_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, linesTerminatedBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(table_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, table_); + } + { + int dataSize = 0; + for (int i = 0; i < columns_.size(); i++) { + dataSize += computeStringSizeNoTag(columns_.getRaw(i)); + } + size += dataSize; + size += 1 * getColumnsList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(escapeCharacter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, escapeCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(quoteCharacter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, quoteCharacter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fieldsTerminatedBy_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, fieldsTerminatedBy_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(linesTerminatedBy_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, linesTerminatedBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions other = + (com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions) obj; + + if (!getTable().equals(other.getTable())) return false; + if (!getColumnsList().equals(other.getColumnsList())) return false; + if (!getEscapeCharacter().equals(other.getEscapeCharacter())) return false; + if (!getQuoteCharacter().equals(other.getQuoteCharacter())) return false; + if (!getFieldsTerminatedBy().equals(other.getFieldsTerminatedBy())) return false; + if (!getLinesTerminatedBy().equals(other.getLinesTerminatedBy())) return false; + if (!getUnknownFields().equals(other.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) + TABLE_FIELD_NUMBER; + hash = (53 * hash) + getTable().hashCode(); + if (getColumnsCount() > 0) { + hash = (37 * hash) + COLUMNS_FIELD_NUMBER; + hash = (53 * hash) + getColumnsList().hashCode(); + } + hash = (37 * hash) + ESCAPE_CHARACTER_FIELD_NUMBER; + hash = (53 * hash) + getEscapeCharacter().hashCode(); + hash = (37 * hash) + QUOTE_CHARACTER_FIELD_NUMBER; + hash = (53 * hash) + getQuoteCharacter().hashCode(); + hash = (37 * hash) + FIELDS_TERMINATED_BY_FIELD_NUMBER; + hash = (53 * hash) + getFieldsTerminatedBy().hashCode(); + hash = (37 * hash) + LINES_TERMINATED_BY_FIELD_NUMBER; + hash = (53 * hash) + getLinesTerminatedBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions) + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlCsvImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlCsvImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.class, + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + table_ = ""; + columns_ = com.google.protobuf.LazyStringArrayList.emptyList(); + escapeCharacter_ = ""; + quoteCharacter_ = ""; + fieldsTerminatedBy_ = ""; + linesTerminatedBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlCsvImportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions build() { + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions buildPartial() { + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions result = + new com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.table_ = table_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + columns_.makeImmutable(); + result.columns_ = columns_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.escapeCharacter_ = escapeCharacter_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.quoteCharacter_ = quoteCharacter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.fieldsTerminatedBy_ = fieldsTerminatedBy_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.linesTerminatedBy_ = linesTerminatedBy_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions) { + return mergeFrom((com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions other) { + if (other + == com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.getDefaultInstance()) + return this; + if (!other.getTable().isEmpty()) { + table_ = other.table_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.columns_.isEmpty()) { + if (columns_.isEmpty()) { + columns_ = other.columns_; + bitField0_ |= 0x00000002; + } else { + ensureColumnsIsMutable(); + columns_.addAll(other.columns_); + } + onChanged(); + } + if (!other.getEscapeCharacter().isEmpty()) { + escapeCharacter_ = other.escapeCharacter_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getQuoteCharacter().isEmpty()) { + quoteCharacter_ = other.quoteCharacter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getFieldsTerminatedBy().isEmpty()) { + fieldsTerminatedBy_ = other.fieldsTerminatedBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getLinesTerminatedBy().isEmpty()) { + linesTerminatedBy_ = other.linesTerminatedBy_; + bitField0_ |= 0x00000020; + 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: + { + table_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureColumnsIsMutable(); + columns_.add(s); + break; + } // case 18 + case 34: + { + escapeCharacter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + quoteCharacter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 50: + { + fieldsTerminatedBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 66: + { + linesTerminatedBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object table_ = ""; + + /** + * + * + *
+       * The table to which CSV data is imported.
+       * 
+ * + * string table = 1; + * + * @return The table. + */ + public java.lang.String getTable() { + java.lang.Object ref = table_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + table_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The table to which CSV data is imported.
+       * 
+ * + * string table = 1; + * + * @return The bytes for table. + */ + public com.google.protobuf.ByteString getTableBytes() { + java.lang.Object ref = table_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + table_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The table to which CSV data is imported.
+       * 
+ * + * string table = 1; + * + * @param value The table to set. + * @return This builder for chaining. + */ + public Builder setTable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + table_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The table to which CSV data is imported.
+       * 
+ * + * string table = 1; + * + * @return This builder for chaining. + */ + public Builder clearTable() { + table_ = getDefaultInstance().getTable(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The table to which CSV data is imported.
+       * 
+ * + * string table = 1; + * + * @param value The bytes for table to set. + * @return This builder for chaining. + */ + public Builder setTableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + table_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList columns_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureColumnsIsMutable() { + if (!columns_.isModifiable()) { + columns_ = new com.google.protobuf.LazyStringArrayList(columns_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @return A list containing the columns. + */ + public com.google.protobuf.ProtocolStringList getColumnsList() { + columns_.makeImmutable(); + return columns_; + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @return The count of columns. + */ + public int getColumnsCount() { + return columns_.size(); + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @param index The index of the element to return. + * @return The columns at the given index. + */ + public java.lang.String getColumns(int index) { + return columns_.get(index); + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @param index The index of the value to return. + * @return The bytes of the columns at the given index. + */ + public com.google.protobuf.ByteString getColumnsBytes(int index) { + return columns_.getByteString(index); + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @param index The index to set the value at. + * @param value The columns to set. + * @return This builder for chaining. + */ + public Builder setColumns(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @param value The columns to add. + * @return This builder for chaining. + */ + public Builder addColumns(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @param values The columns to add. + * @return This builder for chaining. + */ + public Builder addAllColumns(java.lang.Iterable values) { + ensureColumnsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, columns_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @return This builder for chaining. + */ + public Builder clearColumns() { + columns_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
+       * The columns to which CSV data is imported. If not specified, all columns
+       * of the database table are loaded with CSV data.
+       * 
+ * + * repeated string columns = 2; + * + * @param value The bytes of the columns to add. + * @return This builder for chaining. + */ + public Builder addColumnsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureColumnsIsMutable(); + columns_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object escapeCharacter_ = ""; + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 4; + * + * @return The escapeCharacter. + */ + public java.lang.String getEscapeCharacter() { + java.lang.Object ref = escapeCharacter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + escapeCharacter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 4; + * + * @return The bytes for escapeCharacter. + */ + public com.google.protobuf.ByteString getEscapeCharacterBytes() { + java.lang.Object ref = escapeCharacter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + escapeCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 4; + * + * @param value The escapeCharacter to set. + * @return This builder for chaining. + */ + public Builder setEscapeCharacter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + escapeCharacter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 4; + * + * @return This builder for chaining. + */ + public Builder clearEscapeCharacter() { + escapeCharacter_ = getDefaultInstance().getEscapeCharacter(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that should appear before a data character that
+       * needs to be escaped.
+       * 
+ * + * string escape_character = 4; + * + * @param value The bytes for escapeCharacter to set. + * @return This builder for chaining. + */ + public Builder setEscapeCharacterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + escapeCharacter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object quoteCharacter_ = ""; + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 5; + * + * @return The quoteCharacter. + */ + public java.lang.String getQuoteCharacter() { + java.lang.Object ref = quoteCharacter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quoteCharacter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 5; + * + * @return The bytes for quoteCharacter. + */ + public com.google.protobuf.ByteString getQuoteCharacterBytes() { + java.lang.Object ref = quoteCharacter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quoteCharacter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 5; + * + * @param value The quoteCharacter to set. + * @return This builder for chaining. + */ + public Builder setQuoteCharacter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quoteCharacter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 5; + * + * @return This builder for chaining. + */ + public Builder clearQuoteCharacter() { + quoteCharacter_ = getDefaultInstance().getQuoteCharacter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the quoting character to be used when a data value is quoted.
+       * 
+ * + * string quote_character = 5; + * + * @param value The bytes for quoteCharacter to set. + * @return This builder for chaining. + */ + public Builder setQuoteCharacterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quoteCharacter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object fieldsTerminatedBy_ = ""; + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 6; + * + * @return The fieldsTerminatedBy. + */ + public java.lang.String getFieldsTerminatedBy() { + java.lang.Object ref = fieldsTerminatedBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldsTerminatedBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 6; + * + * @return The bytes for fieldsTerminatedBy. + */ + public com.google.protobuf.ByteString getFieldsTerminatedByBytes() { + java.lang.Object ref = fieldsTerminatedBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldsTerminatedBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 6; + * + * @param value The fieldsTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setFieldsTerminatedBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fieldsTerminatedBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 6; + * + * @return This builder for chaining. + */ + public Builder clearFieldsTerminatedBy() { + fieldsTerminatedBy_ = getDefaultInstance().getFieldsTerminatedBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies the character that separates columns within each row (line) of
+       * the file.
+       * 
+ * + * string fields_terminated_by = 6; + * + * @param value The bytes for fieldsTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setFieldsTerminatedByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fieldsTerminatedBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object linesTerminatedBy_ = ""; + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 8; + * + * @return The linesTerminatedBy. + */ + public java.lang.String getLinesTerminatedBy() { + java.lang.Object ref = linesTerminatedBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + linesTerminatedBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 8; + * + * @return The bytes for linesTerminatedBy. + */ + public com.google.protobuf.ByteString getLinesTerminatedByBytes() { + java.lang.Object ref = linesTerminatedBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + linesTerminatedBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 8; + * + * @param value The linesTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setLinesTerminatedBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + linesTerminatedBy_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 8; + * + * @return This builder for chaining. + */ + public Builder clearLinesTerminatedBy() { + linesTerminatedBy_ = getDefaultInstance().getLinesTerminatedBy(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+       * This is used to separate lines. If a line does not contain all fields,
+       * the rest of the columns are set to their default values.
+       * 
+ * + * string lines_terminated_by = 8; + * + * @param value The bytes for linesTerminatedBy to set. + * @return This builder for chaining. + */ + public Builder setLinesTerminatedByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + linesTerminatedBy_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions) + private static final com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions(); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlCsvImportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlBakImportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + * + * @return Whether the encryptionOptions field is set. + */ + boolean hasEncryptionOptions(); + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + * + * @return The encryptionOptions. + */ + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + getEncryptionOptions(); + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptionsOrBuilder + getEncryptionOptionsOrBuilder(); + + /** + * + * + *
+     * Whether or not the backup set being restored is striped.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue striped = 2; + * + * @return Whether the striped field is set. + */ + boolean hasStriped(); + + /** + * + * + *
+     * Whether or not the backup set being restored is striped.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue striped = 2; + * + * @return The striped. + */ + com.google.protobuf.BoolValue getStriped(); + + /** + * + * + *
+     * Whether or not the backup set being restored is striped.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + com.google.protobuf.BoolValueOrBuilder getStripedOrBuilder(); + + /** + * + * + *
+     * Whether or not the backup importing will restore database
+     * with NORECOVERY option.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + * + * @return Whether the noRecovery field is set. + */ + boolean hasNoRecovery(); + + /** + * + * + *
+     * Whether or not the backup importing will restore database
+     * with NORECOVERY option.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + * + * @return The noRecovery. + */ + com.google.protobuf.BoolValue getNoRecovery(); + + /** + * + * + *
+     * Whether or not the backup importing will restore database
+     * with NORECOVERY option.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + com.google.protobuf.BoolValueOrBuilder getNoRecoveryOrBuilder(); + + /** + * + * + *
+     * Whether or not the backup importing request will just bring database
+     * online without downloading Bak content only one of "no_recovery" and
+     * "recovery_only" can be true otherwise error will return. Applies only to
+     * Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + * + * @return Whether the recoveryOnly field is set. + */ + boolean hasRecoveryOnly(); + + /** + * + * + *
+     * Whether or not the backup importing request will just bring database
+     * online without downloading Bak content only one of "no_recovery" and
+     * "recovery_only" can be true otherwise error will return. Applies only to
+     * Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + * + * @return The recoveryOnly. + */ + com.google.protobuf.BoolValue getRecoveryOnly(); + + /** + * + * + *
+     * Whether or not the backup importing request will just bring database
+     * online without downloading Bak content only one of "no_recovery" and
+     * "recovery_only" can be true otherwise error will return. Applies only to
+     * Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + com.google.protobuf.BoolValueOrBuilder getRecoveryOnlyOrBuilder(); + + /** + * + * + *
+     * Type of the bak content, FULL or DIFF.
+     * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 6; + * + * @return The enum numeric value on the wire for bakType. + */ + int getBakTypeValue(); + + /** + * + * + *
+     * Type of the bak content, FULL or DIFF.
+     * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 6; + * + * @return The bakType. + */ + com.google.cloud.sql.v1beta4.BakType getBakType(); + + /** + * + * + *
+     * Optional. The timestamp when the import should stop. This timestamp is in
+     * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+     * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+     * keyword and applies to Cloud SQL for SQL Server only.
+     * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the stopAt field is set. + */ + boolean hasStopAt(); + + /** + * + * + *
+     * Optional. The timestamp when the import should stop. This timestamp is in
+     * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+     * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+     * keyword and applies to Cloud SQL for SQL Server only.
+     * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The stopAt. + */ + com.google.protobuf.Timestamp getStopAt(); + + /** + * + * + *
+     * Optional. The timestamp when the import should stop. This timestamp is in
+     * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+     * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+     * keyword and applies to Cloud SQL for SQL Server only.
+     * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getStopAtOrBuilder(); + + /** + * + * + *
+     * Optional. The marked transaction where the import should stop. This field
+     * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+     * Server only.
+     * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The stopAtMark. + */ + java.lang.String getStopAtMark(); + + /** + * + * + *
+     * Optional. The marked transaction where the import should stop. This field
+     * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+     * Server only.
+     * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for stopAtMark. + */ + com.google.protobuf.ByteString getStopAtMarkBytes(); + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions} */ + public static final class SqlBakImportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions) + SqlBakImportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBakImportOptions"); + } + + // Use SqlBakImportOptions.newBuilder() to construct. + private SqlBakImportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlBakImportOptions() { + bakType_ = 0; + stopAtMark_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.class, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.Builder.class); + } + + public interface EncryptionOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Path to the Certificate (.cer) in Cloud Storage, in the form
+       * `gs://bucketName/fileName`. The instance must have write permissions
+       * to the bucket and read access to the file.
+       * 
+ * + * string cert_path = 1; + * + * @return The certPath. + */ + java.lang.String getCertPath(); + + /** + * + * + *
+       * Path to the Certificate (.cer) in Cloud Storage, in the form
+       * `gs://bucketName/fileName`. The instance must have write permissions
+       * to the bucket and read access to the file.
+       * 
+ * + * string cert_path = 1; + * + * @return The bytes for certPath. + */ + com.google.protobuf.ByteString getCertPathBytes(); + + /** + * + * + *
+       * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+       * form `gs://bucketName/fileName`. The instance must have write
+       * permissions to the bucket and read access to the file.
+       * 
+ * + * string pvk_path = 2; + * + * @return The pvkPath. + */ + java.lang.String getPvkPath(); + + /** + * + * + *
+       * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+       * form `gs://bucketName/fileName`. The instance must have write
+       * permissions to the bucket and read access to the file.
+       * 
+ * + * string pvk_path = 2; + * + * @return The bytes for pvkPath. + */ + com.google.protobuf.ByteString getPvkPathBytes(); + + /** + * + * + *
+       * Password that encrypts the private key
+       * 
+ * + * string pvk_password = 3; + * + * @return The pvkPassword. + */ + java.lang.String getPvkPassword(); + + /** + * + * + *
+       * Password that encrypts the private key
+       * 
+ * + * string pvk_password = 3; + * + * @return The bytes for pvkPassword. + */ + com.google.protobuf.ByteString getPvkPasswordBytes(); + + /** + * + * + *
+       * Optional. Whether the imported file remains encrypted.
+       * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the keepEncrypted field is set. + */ + boolean hasKeepEncrypted(); + + /** + * + * + *
+       * Optional. Whether the imported file remains encrypted.
+       * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The keepEncrypted. + */ + com.google.protobuf.BoolValue getKeepEncrypted(); + + /** + * + * + *
+       * Optional. Whether the imported file remains encrypted.
+       * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getKeepEncryptedOrBuilder(); + } + + /** + * Protobuf type {@code + * google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions} + */ + public static final class EncryptionOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions) + EncryptionOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EncryptionOptions"); + } + + // Use EncryptionOptions.newBuilder() to construct. + private EncryptionOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private EncryptionOptions() { + certPath_ = ""; + pvkPath_ = ""; + pvkPassword_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_EncryptionOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_EncryptionOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + .class, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + .Builder.class); + } + + private int bitField0_; + public static final int CERT_PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object certPath_ = ""; + + /** + * + * + *
+       * Path to the Certificate (.cer) in Cloud Storage, in the form
+       * `gs://bucketName/fileName`. The instance must have write permissions
+       * to the bucket and read access to the file.
+       * 
+ * + * string cert_path = 1; + * + * @return The certPath. + */ + @java.lang.Override + public java.lang.String getCertPath() { + java.lang.Object ref = certPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certPath_ = s; + return s; + } + } + + /** + * + * + *
+       * Path to the Certificate (.cer) in Cloud Storage, in the form
+       * `gs://bucketName/fileName`. The instance must have write permissions
+       * to the bucket and read access to the file.
+       * 
+ * + * string cert_path = 1; + * + * @return The bytes for certPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCertPathBytes() { + java.lang.Object ref = certPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PVK_PATH_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pvkPath_ = ""; + + /** + * + * + *
+       * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+       * form `gs://bucketName/fileName`. The instance must have write
+       * permissions to the bucket and read access to the file.
+       * 
+ * + * string pvk_path = 2; + * + * @return The pvkPath. + */ + @java.lang.Override + public java.lang.String getPvkPath() { + java.lang.Object ref = pvkPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pvkPath_ = s; + return s; + } + } + + /** + * + * + *
+       * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+       * form `gs://bucketName/fileName`. The instance must have write
+       * permissions to the bucket and read access to the file.
+       * 
+ * + * string pvk_path = 2; + * + * @return The bytes for pvkPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPvkPathBytes() { + java.lang.Object ref = pvkPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pvkPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PVK_PASSWORD_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pvkPassword_ = ""; + + /** + * + * + *
+       * Password that encrypts the private key
+       * 
+ * + * string pvk_password = 3; + * + * @return The pvkPassword. + */ + @java.lang.Override + public java.lang.String getPvkPassword() { + java.lang.Object ref = pvkPassword_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pvkPassword_ = s; + return s; + } + } + + /** + * + * + *
+       * Password that encrypts the private key
+       * 
+ * + * string pvk_password = 3; + * + * @return The bytes for pvkPassword. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPvkPasswordBytes() { + java.lang.Object ref = pvkPassword_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pvkPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEEP_ENCRYPTED_FIELD_NUMBER = 5; + private com.google.protobuf.BoolValue keepEncrypted_; + + /** + * + * + *
+       * Optional. Whether the imported file remains encrypted.
+       * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the keepEncrypted field is set. + */ + @java.lang.Override + public boolean hasKeepEncrypted() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Optional. Whether the imported file remains encrypted.
+       * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The keepEncrypted. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getKeepEncrypted() { + return keepEncrypted_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : keepEncrypted_; + } + + /** + * + * + *
+       * Optional. Whether the imported file remains encrypted.
+       * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getKeepEncryptedOrBuilder() { + return keepEncrypted_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : keepEncrypted_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(certPath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, certPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pvkPath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, pvkPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pvkPassword_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pvkPassword_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getKeepEncrypted()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(certPath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, certPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pvkPath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, pvkPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pvkPassword_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pvkPassword_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getKeepEncrypted()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions other = + (com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions) obj; + + if (!getCertPath().equals(other.getCertPath())) return false; + if (!getPvkPath().equals(other.getPvkPath())) return false; + if (!getPvkPassword().equals(other.getPvkPassword())) return false; + if (hasKeepEncrypted() != other.hasKeepEncrypted()) return false; + if (hasKeepEncrypted()) { + if (!getKeepEncrypted().equals(other.getKeepEncrypted())) return false; + } + if (!getUnknownFields().equals(other.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) + CERT_PATH_FIELD_NUMBER; + hash = (53 * hash) + getCertPath().hashCode(); + hash = (37 * hash) + PVK_PATH_FIELD_NUMBER; + hash = (53 * hash) + getPvkPath().hashCode(); + hash = (37 * hash) + PVK_PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPvkPassword().hashCode(); + if (hasKeepEncrypted()) { + hash = (37 * hash) + KEEP_ENCRYPTED_FIELD_NUMBER; + hash = (53 * hash) + getKeepEncrypted().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code + * google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions) + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions + .EncryptionOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_EncryptionOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_EncryptionOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + .class, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + .Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetKeepEncryptedFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + certPath_ = ""; + pvkPath_ = ""; + pvkPassword_ = ""; + keepEncrypted_ = null; + if (keepEncryptedBuilder_ != null) { + keepEncryptedBuilder_.dispose(); + keepEncryptedBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_EncryptionOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + build() { + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + buildPartial() { + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions result = + new com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.certPath_ = certPath_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pvkPath_ = pvkPath_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pvkPassword_ = pvkPassword_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.keepEncrypted_ = + keepEncryptedBuilder_ == null ? keepEncrypted_ : keepEncryptedBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + other) { + if (other + == com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + .getDefaultInstance()) return this; + if (!other.getCertPath().isEmpty()) { + certPath_ = other.certPath_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPvkPath().isEmpty()) { + pvkPath_ = other.pvkPath_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPvkPassword().isEmpty()) { + pvkPassword_ = other.pvkPassword_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasKeepEncrypted()) { + mergeKeepEncrypted(other.getKeepEncrypted()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + certPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + pvkPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + pvkPassword_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + input.readMessage( + internalGetKeepEncryptedFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + 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 certPath_ = ""; + + /** + * + * + *
+         * Path to the Certificate (.cer) in Cloud Storage, in the form
+         * `gs://bucketName/fileName`. The instance must have write permissions
+         * to the bucket and read access to the file.
+         * 
+ * + * string cert_path = 1; + * + * @return The certPath. + */ + public java.lang.String getCertPath() { + java.lang.Object ref = certPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+         * Path to the Certificate (.cer) in Cloud Storage, in the form
+         * `gs://bucketName/fileName`. The instance must have write permissions
+         * to the bucket and read access to the file.
+         * 
+ * + * string cert_path = 1; + * + * @return The bytes for certPath. + */ + public com.google.protobuf.ByteString getCertPathBytes() { + java.lang.Object ref = certPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+         * Path to the Certificate (.cer) in Cloud Storage, in the form
+         * `gs://bucketName/fileName`. The instance must have write permissions
+         * to the bucket and read access to the file.
+         * 
+ * + * string cert_path = 1; + * + * @param value The certPath to set. + * @return This builder for chaining. + */ + public Builder setCertPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + certPath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Path to the Certificate (.cer) in Cloud Storage, in the form
+         * `gs://bucketName/fileName`. The instance must have write permissions
+         * to the bucket and read access to the file.
+         * 
+ * + * string cert_path = 1; + * + * @return This builder for chaining. + */ + public Builder clearCertPath() { + certPath_ = getDefaultInstance().getCertPath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+         * Path to the Certificate (.cer) in Cloud Storage, in the form
+         * `gs://bucketName/fileName`. The instance must have write permissions
+         * to the bucket and read access to the file.
+         * 
+ * + * string cert_path = 1; + * + * @param value The bytes for certPath to set. + * @return This builder for chaining. + */ + public Builder setCertPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + certPath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object pvkPath_ = ""; + + /** + * + * + *
+         * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+         * form `gs://bucketName/fileName`. The instance must have write
+         * permissions to the bucket and read access to the file.
+         * 
+ * + * string pvk_path = 2; + * + * @return The pvkPath. + */ + public java.lang.String getPvkPath() { + java.lang.Object ref = pvkPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pvkPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+         * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+         * form `gs://bucketName/fileName`. The instance must have write
+         * permissions to the bucket and read access to the file.
+         * 
+ * + * string pvk_path = 2; + * + * @return The bytes for pvkPath. + */ + public com.google.protobuf.ByteString getPvkPathBytes() { + java.lang.Object ref = pvkPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pvkPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+         * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+         * form `gs://bucketName/fileName`. The instance must have write
+         * permissions to the bucket and read access to the file.
+         * 
+ * + * string pvk_path = 2; + * + * @param value The pvkPath to set. + * @return This builder for chaining. + */ + public Builder setPvkPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pvkPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+         * form `gs://bucketName/fileName`. The instance must have write
+         * permissions to the bucket and read access to the file.
+         * 
+ * + * string pvk_path = 2; + * + * @return This builder for chaining. + */ + public Builder clearPvkPath() { + pvkPath_ = getDefaultInstance().getPvkPath(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+         * Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
+         * form `gs://bucketName/fileName`. The instance must have write
+         * permissions to the bucket and read access to the file.
+         * 
+ * + * string pvk_path = 2; + * + * @param value The bytes for pvkPath to set. + * @return This builder for chaining. + */ + public Builder setPvkPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pvkPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object pvkPassword_ = ""; + + /** + * + * + *
+         * Password that encrypts the private key
+         * 
+ * + * string pvk_password = 3; + * + * @return The pvkPassword. + */ + public java.lang.String getPvkPassword() { + java.lang.Object ref = pvkPassword_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pvkPassword_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+         * Password that encrypts the private key
+         * 
+ * + * string pvk_password = 3; + * + * @return The bytes for pvkPassword. + */ + public com.google.protobuf.ByteString getPvkPasswordBytes() { + java.lang.Object ref = pvkPassword_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pvkPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+         * Password that encrypts the private key
+         * 
+ * + * string pvk_password = 3; + * + * @param value The pvkPassword to set. + * @return This builder for chaining. + */ + public Builder setPvkPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pvkPassword_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+         * Password that encrypts the private key
+         * 
+ * + * string pvk_password = 3; + * + * @return This builder for chaining. + */ + public Builder clearPvkPassword() { + pvkPassword_ = getDefaultInstance().getPvkPassword(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+         * Password that encrypts the private key
+         * 
+ * + * string pvk_password = 3; + * + * @param value The bytes for pvkPassword to set. + * @return This builder for chaining. + */ + public Builder setPvkPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pvkPassword_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue keepEncrypted_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + keepEncryptedBuilder_; + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the keepEncrypted field is set. + */ + public boolean hasKeepEncrypted() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The keepEncrypted. + */ + public com.google.protobuf.BoolValue getKeepEncrypted() { + if (keepEncryptedBuilder_ == null) { + return keepEncrypted_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : keepEncrypted_; + } else { + return keepEncryptedBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setKeepEncrypted(com.google.protobuf.BoolValue value) { + if (keepEncryptedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + keepEncrypted_ = value; + } else { + keepEncryptedBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setKeepEncrypted(com.google.protobuf.BoolValue.Builder builderForValue) { + if (keepEncryptedBuilder_ == null) { + keepEncrypted_ = builderForValue.build(); + } else { + keepEncryptedBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeKeepEncrypted(com.google.protobuf.BoolValue value) { + if (keepEncryptedBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && keepEncrypted_ != null + && keepEncrypted_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getKeepEncryptedBuilder().mergeFrom(value); + } else { + keepEncrypted_ = value; + } + } else { + keepEncryptedBuilder_.mergeFrom(value); + } + if (keepEncrypted_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearKeepEncrypted() { + bitField0_ = (bitField0_ & ~0x00000008); + keepEncrypted_ = null; + if (keepEncryptedBuilder_ != null) { + keepEncryptedBuilder_.dispose(); + keepEncryptedBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getKeepEncryptedBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetKeepEncryptedFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getKeepEncryptedOrBuilder() { + if (keepEncryptedBuilder_ != null) { + return keepEncryptedBuilder_.getMessageOrBuilder(); + } else { + return keepEncrypted_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : keepEncrypted_; + } + } + + /** + * + * + *
+         * Optional. Whether the imported file remains encrypted.
+         * 
+ * + * + * .google.protobuf.BoolValue keep_encrypted = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetKeepEncryptedFieldBuilder() { + if (keepEncryptedBuilder_ == null) { + keepEncryptedBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getKeepEncrypted(), getParentForChildren(), isClean()); + keepEncrypted_ = null; + } + return keepEncryptedBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions) + private static final com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions + .EncryptionOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions(); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EncryptionOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ENCRYPTION_OPTIONS_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + encryptionOptions_; + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + * + * @return Whether the encryptionOptions field is set. + */ + @java.lang.Override + public boolean hasEncryptionOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + * + * @return The encryptionOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + getEncryptionOptions() { + return encryptionOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + .getDefaultInstance() + : encryptionOptions_; + } + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptionsOrBuilder + getEncryptionOptionsOrBuilder() { + return encryptionOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + .getDefaultInstance() + : encryptionOptions_; + } + + public static final int STRIPED_FIELD_NUMBER = 2; + private com.google.protobuf.BoolValue striped_; + + /** + * + * + *
+     * Whether or not the backup set being restored is striped.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue striped = 2; + * + * @return Whether the striped field is set. + */ + @java.lang.Override + public boolean hasStriped() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Whether or not the backup set being restored is striped.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue striped = 2; + * + * @return The striped. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getStriped() { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } + + /** + * + * + *
+     * Whether or not the backup set being restored is striped.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getStripedOrBuilder() { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } + + public static final int NO_RECOVERY_FIELD_NUMBER = 4; + private com.google.protobuf.BoolValue noRecovery_; + + /** + * + * + *
+     * Whether or not the backup importing will restore database
+     * with NORECOVERY option.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + * + * @return Whether the noRecovery field is set. + */ + @java.lang.Override + public boolean hasNoRecovery() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Whether or not the backup importing will restore database
+     * with NORECOVERY option.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + * + * @return The noRecovery. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getNoRecovery() { + return noRecovery_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : noRecovery_; + } + + /** + * + * + *
+     * Whether or not the backup importing will restore database
+     * with NORECOVERY option.
+     * Applies only to Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getNoRecoveryOrBuilder() { + return noRecovery_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : noRecovery_; + } + + public static final int RECOVERY_ONLY_FIELD_NUMBER = 5; + private com.google.protobuf.BoolValue recoveryOnly_; + + /** + * + * + *
+     * Whether or not the backup importing request will just bring database
+     * online without downloading Bak content only one of "no_recovery" and
+     * "recovery_only" can be true otherwise error will return. Applies only to
+     * Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + * + * @return Whether the recoveryOnly field is set. + */ + @java.lang.Override + public boolean hasRecoveryOnly() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Whether or not the backup importing request will just bring database
+     * online without downloading Bak content only one of "no_recovery" and
+     * "recovery_only" can be true otherwise error will return. Applies only to
+     * Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + * + * @return The recoveryOnly. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getRecoveryOnly() { + return recoveryOnly_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : recoveryOnly_; + } + + /** + * + * + *
+     * Whether or not the backup importing request will just bring database
+     * online without downloading Bak content only one of "no_recovery" and
+     * "recovery_only" can be true otherwise error will return. Applies only to
+     * Cloud SQL for SQL Server.
+     * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getRecoveryOnlyOrBuilder() { + return recoveryOnly_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : recoveryOnly_; + } + + public static final int BAK_TYPE_FIELD_NUMBER = 6; + private int bakType_ = 0; + + /** + * + * + *
+     * Type of the bak content, FULL or DIFF.
+     * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 6; + * + * @return The enum numeric value on the wire for bakType. + */ + @java.lang.Override + public int getBakTypeValue() { + return bakType_; + } + + /** + * + * + *
+     * Type of the bak content, FULL or DIFF.
+     * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 6; + * + * @return The bakType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BakType getBakType() { + com.google.cloud.sql.v1beta4.BakType result = + com.google.cloud.sql.v1beta4.BakType.forNumber(bakType_); + return result == null ? com.google.cloud.sql.v1beta4.BakType.UNRECOGNIZED : result; + } + + public static final int STOP_AT_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp stopAt_; + + /** + * + * + *
+     * Optional. The timestamp when the import should stop. This timestamp is in
+     * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+     * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+     * keyword and applies to Cloud SQL for SQL Server only.
+     * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the stopAt field is set. + */ + @java.lang.Override + public boolean hasStopAt() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. The timestamp when the import should stop. This timestamp is in
+     * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+     * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+     * keyword and applies to Cloud SQL for SQL Server only.
+     * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The stopAt. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStopAt() { + return stopAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : stopAt_; + } + + /** + * + * + *
+     * Optional. The timestamp when the import should stop. This timestamp is in
+     * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+     * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+     * keyword and applies to Cloud SQL for SQL Server only.
+     * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStopAtOrBuilder() { + return stopAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : stopAt_; + } + + public static final int STOP_AT_MARK_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object stopAtMark_ = ""; + + /** + * + * + *
+     * Optional. The marked transaction where the import should stop. This field
+     * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+     * Server only.
+     * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The stopAtMark. + */ + @java.lang.Override + public java.lang.String getStopAtMark() { + java.lang.Object ref = stopAtMark_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stopAtMark_ = s; + return s; + } + } + + /** + * + * + *
+     * Optional. The marked transaction where the import should stop. This field
+     * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+     * Server only.
+     * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for stopAtMark. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStopAtMarkBytes() { + java.lang.Object ref = stopAtMark_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stopAtMark_ = 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, getEncryptionOptions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getStriped()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getNoRecovery()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(5, getRecoveryOnly()); + } + if (bakType_ != com.google.cloud.sql.v1beta4.BakType.BAK_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, bakType_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(7, getStopAt()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(stopAtMark_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, stopAtMark_); + } + 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, getEncryptionOptions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStriped()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getNoRecovery()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getRecoveryOnly()); + } + if (bakType_ != com.google.cloud.sql.v1beta4.BakType.BAK_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, bakType_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getStopAt()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(stopAtMark_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, stopAtMark_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions other = + (com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions) obj; + + if (hasEncryptionOptions() != other.hasEncryptionOptions()) return false; + if (hasEncryptionOptions()) { + if (!getEncryptionOptions().equals(other.getEncryptionOptions())) return false; + } + if (hasStriped() != other.hasStriped()) return false; + if (hasStriped()) { + if (!getStriped().equals(other.getStriped())) return false; + } + if (hasNoRecovery() != other.hasNoRecovery()) return false; + if (hasNoRecovery()) { + if (!getNoRecovery().equals(other.getNoRecovery())) return false; + } + if (hasRecoveryOnly() != other.hasRecoveryOnly()) return false; + if (hasRecoveryOnly()) { + if (!getRecoveryOnly().equals(other.getRecoveryOnly())) return false; + } + if (bakType_ != other.bakType_) return false; + if (hasStopAt() != other.hasStopAt()) return false; + if (hasStopAt()) { + if (!getStopAt().equals(other.getStopAt())) return false; + } + if (!getStopAtMark().equals(other.getStopAtMark())) return false; + if (!getUnknownFields().equals(other.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 (hasEncryptionOptions()) { + hash = (37 * hash) + ENCRYPTION_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionOptions().hashCode(); + } + if (hasStriped()) { + hash = (37 * hash) + STRIPED_FIELD_NUMBER; + hash = (53 * hash) + getStriped().hashCode(); + } + if (hasNoRecovery()) { + hash = (37 * hash) + NO_RECOVERY_FIELD_NUMBER; + hash = (53 * hash) + getNoRecovery().hashCode(); + } + if (hasRecoveryOnly()) { + hash = (37 * hash) + RECOVERY_ONLY_FIELD_NUMBER; + hash = (53 * hash) + getRecoveryOnly().hashCode(); + } + hash = (37 * hash) + BAK_TYPE_FIELD_NUMBER; + hash = (53 * hash) + bakType_; + if (hasStopAt()) { + hash = (37 * hash) + STOP_AT_FIELD_NUMBER; + hash = (53 * hash) + getStopAt().hashCode(); + } + hash = (37 * hash) + STOP_AT_MARK_FIELD_NUMBER; + hash = (53 * hash) + getStopAtMark().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions) + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.class, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEncryptionOptionsFieldBuilder(); + internalGetStripedFieldBuilder(); + internalGetNoRecoveryFieldBuilder(); + internalGetRecoveryOnlyFieldBuilder(); + internalGetStopAtFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encryptionOptions_ = null; + if (encryptionOptionsBuilder_ != null) { + encryptionOptionsBuilder_.dispose(); + encryptionOptionsBuilder_ = null; + } + striped_ = null; + if (stripedBuilder_ != null) { + stripedBuilder_.dispose(); + stripedBuilder_ = null; + } + noRecovery_ = null; + if (noRecoveryBuilder_ != null) { + noRecoveryBuilder_.dispose(); + noRecoveryBuilder_ = null; + } + recoveryOnly_ = null; + if (recoveryOnlyBuilder_ != null) { + recoveryOnlyBuilder_.dispose(); + recoveryOnlyBuilder_ = null; + } + bakType_ = 0; + stopAt_ = null; + if (stopAtBuilder_ != null) { + stopAtBuilder_.dispose(); + stopAtBuilder_ = null; + } + stopAtMark_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlBakImportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions build() { + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions buildPartial() { + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions result = + new com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encryptionOptions_ = + encryptionOptionsBuilder_ == null + ? encryptionOptions_ + : encryptionOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.striped_ = stripedBuilder_ == null ? striped_ : stripedBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.noRecovery_ = + noRecoveryBuilder_ == null ? noRecovery_ : noRecoveryBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.recoveryOnly_ = + recoveryOnlyBuilder_ == null ? recoveryOnly_ : recoveryOnlyBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.bakType_ = bakType_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.stopAt_ = stopAtBuilder_ == null ? stopAt_ : stopAtBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.stopAtMark_ = stopAtMark_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions) { + return mergeFrom((com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions other) { + if (other + == com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.getDefaultInstance()) + return this; + if (other.hasEncryptionOptions()) { + mergeEncryptionOptions(other.getEncryptionOptions()); + } + if (other.hasStriped()) { + mergeStriped(other.getStriped()); + } + if (other.hasNoRecovery()) { + mergeNoRecovery(other.getNoRecovery()); + } + if (other.hasRecoveryOnly()) { + mergeRecoveryOnly(other.getRecoveryOnly()); + } + if (other.bakType_ != 0) { + setBakTypeValue(other.getBakTypeValue()); + } + if (other.hasStopAt()) { + mergeStopAt(other.getStopAt()); + } + if (!other.getStopAtMark().isEmpty()) { + stopAtMark_ = other.stopAtMark_; + 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( + internalGetEncryptionOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStripedFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + input.readMessage( + internalGetNoRecoveryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetRecoveryOnlyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 48: + { + bakType_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 48 + case 58: + { + input.readMessage( + internalGetStopAtFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 66: + { + stopAtMark_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + encryptionOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + .Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions + .EncryptionOptionsOrBuilder> + encryptionOptionsBuilder_; + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + * + * @return Whether the encryptionOptions field is set. + */ + public boolean hasEncryptionOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + * + * @return The encryptionOptions. + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + getEncryptionOptions() { + if (encryptionOptionsBuilder_ == null) { + return encryptionOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + .getDefaultInstance() + : encryptionOptions_; + } else { + return encryptionOptionsBuilder_.getMessage(); + } + } + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + public Builder setEncryptionOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions value) { + if (encryptionOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionOptions_ = value; + } else { + encryptionOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + public Builder setEncryptionOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions.Builder + builderForValue) { + if (encryptionOptionsBuilder_ == null) { + encryptionOptions_ = builderForValue.build(); + } else { + encryptionOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + public Builder mergeEncryptionOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions value) { + if (encryptionOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && encryptionOptions_ != null + && encryptionOptions_ + != com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions + .EncryptionOptions.getDefaultInstance()) { + getEncryptionOptionsBuilder().mergeFrom(value); + } else { + encryptionOptions_ = value; + } + } else { + encryptionOptionsBuilder_.mergeFrom(value); + } + if (encryptionOptions_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + public Builder clearEncryptionOptions() { + bitField0_ = (bitField0_ & ~0x00000001); + encryptionOptions_ = null; + if (encryptionOptionsBuilder_ != null) { + encryptionOptionsBuilder_.dispose(); + encryptionOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + .Builder + getEncryptionOptionsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetEncryptionOptionsFieldBuilder().getBuilder(); + } + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions + .EncryptionOptionsOrBuilder + getEncryptionOptionsOrBuilder() { + if (encryptionOptionsBuilder_ != null) { + return encryptionOptionsBuilder_.getMessageOrBuilder(); + } else { + return encryptionOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + .getDefaultInstance() + : encryptionOptions_; + } + } + + /** + * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions encryption_options = 1; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + .Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions + .EncryptionOptionsOrBuilder> + internalGetEncryptionOptionsFieldBuilder() { + if (encryptionOptionsBuilder_ == null) { + encryptionOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions + .Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions + .EncryptionOptionsOrBuilder>( + getEncryptionOptions(), getParentForChildren(), isClean()); + encryptionOptions_ = null; + } + return encryptionOptionsBuilder_; + } + + private com.google.protobuf.BoolValue striped_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + stripedBuilder_; + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + * + * @return Whether the striped field is set. + */ + public boolean hasStriped() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + * + * @return The striped. + */ + public com.google.protobuf.BoolValue getStriped() { + if (stripedBuilder_ == null) { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } else { + return stripedBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + public Builder setStriped(com.google.protobuf.BoolValue value) { + if (stripedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + striped_ = value; + } else { + stripedBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + public Builder setStriped(com.google.protobuf.BoolValue.Builder builderForValue) { + if (stripedBuilder_ == null) { + striped_ = builderForValue.build(); + } else { + stripedBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + public Builder mergeStriped(com.google.protobuf.BoolValue value) { + if (stripedBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && striped_ != null + && striped_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getStripedBuilder().mergeFrom(value); + } else { + striped_ = value; + } + } else { + stripedBuilder_.mergeFrom(value); + } + if (striped_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + public Builder clearStriped() { + bitField0_ = (bitField0_ & ~0x00000002); + striped_ = null; + if (stripedBuilder_ != null) { + stripedBuilder_.dispose(); + stripedBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + public com.google.protobuf.BoolValue.Builder getStripedBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStripedFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + public com.google.protobuf.BoolValueOrBuilder getStripedOrBuilder() { + if (stripedBuilder_ != null) { + return stripedBuilder_.getMessageOrBuilder(); + } else { + return striped_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : striped_; + } + } + + /** + * + * + *
+       * Whether or not the backup set being restored is striped.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue striped = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetStripedFieldBuilder() { + if (stripedBuilder_ == null) { + stripedBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getStriped(), getParentForChildren(), isClean()); + striped_ = null; + } + return stripedBuilder_; + } + + private com.google.protobuf.BoolValue noRecovery_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + noRecoveryBuilder_; + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + * + * @return Whether the noRecovery field is set. + */ + public boolean hasNoRecovery() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + * + * @return The noRecovery. + */ + public com.google.protobuf.BoolValue getNoRecovery() { + if (noRecoveryBuilder_ == null) { + return noRecovery_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : noRecovery_; + } else { + return noRecoveryBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + public Builder setNoRecovery(com.google.protobuf.BoolValue value) { + if (noRecoveryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + noRecovery_ = value; + } else { + noRecoveryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + public Builder setNoRecovery(com.google.protobuf.BoolValue.Builder builderForValue) { + if (noRecoveryBuilder_ == null) { + noRecovery_ = builderForValue.build(); + } else { + noRecoveryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + public Builder mergeNoRecovery(com.google.protobuf.BoolValue value) { + if (noRecoveryBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && noRecovery_ != null + && noRecovery_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getNoRecoveryBuilder().mergeFrom(value); + } else { + noRecovery_ = value; + } + } else { + noRecoveryBuilder_.mergeFrom(value); + } + if (noRecovery_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + public Builder clearNoRecovery() { + bitField0_ = (bitField0_ & ~0x00000004); + noRecovery_ = null; + if (noRecoveryBuilder_ != null) { + noRecoveryBuilder_.dispose(); + noRecoveryBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + public com.google.protobuf.BoolValue.Builder getNoRecoveryBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetNoRecoveryFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + public com.google.protobuf.BoolValueOrBuilder getNoRecoveryOrBuilder() { + if (noRecoveryBuilder_ != null) { + return noRecoveryBuilder_.getMessageOrBuilder(); + } else { + return noRecovery_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : noRecovery_; + } + } + + /** + * + * + *
+       * Whether or not the backup importing will restore database
+       * with NORECOVERY option.
+       * Applies only to Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue no_recovery = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetNoRecoveryFieldBuilder() { + if (noRecoveryBuilder_ == null) { + noRecoveryBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getNoRecovery(), getParentForChildren(), isClean()); + noRecovery_ = null; + } + return noRecoveryBuilder_; + } + + private com.google.protobuf.BoolValue recoveryOnly_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + recoveryOnlyBuilder_; + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + * + * @return Whether the recoveryOnly field is set. + */ + public boolean hasRecoveryOnly() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + * + * @return The recoveryOnly. + */ + public com.google.protobuf.BoolValue getRecoveryOnly() { + if (recoveryOnlyBuilder_ == null) { + return recoveryOnly_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : recoveryOnly_; + } else { + return recoveryOnlyBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + public Builder setRecoveryOnly(com.google.protobuf.BoolValue value) { + if (recoveryOnlyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + recoveryOnly_ = value; + } else { + recoveryOnlyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + public Builder setRecoveryOnly(com.google.protobuf.BoolValue.Builder builderForValue) { + if (recoveryOnlyBuilder_ == null) { + recoveryOnly_ = builderForValue.build(); + } else { + recoveryOnlyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + public Builder mergeRecoveryOnly(com.google.protobuf.BoolValue value) { + if (recoveryOnlyBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && recoveryOnly_ != null + && recoveryOnly_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getRecoveryOnlyBuilder().mergeFrom(value); + } else { + recoveryOnly_ = value; + } + } else { + recoveryOnlyBuilder_.mergeFrom(value); + } + if (recoveryOnly_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + public Builder clearRecoveryOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + recoveryOnly_ = null; + if (recoveryOnlyBuilder_ != null) { + recoveryOnlyBuilder_.dispose(); + recoveryOnlyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + public com.google.protobuf.BoolValue.Builder getRecoveryOnlyBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetRecoveryOnlyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + public com.google.protobuf.BoolValueOrBuilder getRecoveryOnlyOrBuilder() { + if (recoveryOnlyBuilder_ != null) { + return recoveryOnlyBuilder_.getMessageOrBuilder(); + } else { + return recoveryOnly_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : recoveryOnly_; + } + } + + /** + * + * + *
+       * Whether or not the backup importing request will just bring database
+       * online without downloading Bak content only one of "no_recovery" and
+       * "recovery_only" can be true otherwise error will return. Applies only to
+       * Cloud SQL for SQL Server.
+       * 
+ * + * .google.protobuf.BoolValue recovery_only = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetRecoveryOnlyFieldBuilder() { + if (recoveryOnlyBuilder_ == null) { + recoveryOnlyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getRecoveryOnly(), getParentForChildren(), isClean()); + recoveryOnly_ = null; + } + return recoveryOnlyBuilder_; + } + + private int bakType_ = 0; + + /** + * + * + *
+       * Type of the bak content, FULL or DIFF.
+       * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 6; + * + * @return The enum numeric value on the wire for bakType. + */ + @java.lang.Override + public int getBakTypeValue() { + return bakType_; + } + + /** + * + * + *
+       * Type of the bak content, FULL or DIFF.
+       * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 6; + * + * @param value The enum numeric value on the wire for bakType to set. + * @return This builder for chaining. + */ + public Builder setBakTypeValue(int value) { + bakType_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Type of the bak content, FULL or DIFF.
+       * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 6; + * + * @return The bakType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BakType getBakType() { + com.google.cloud.sql.v1beta4.BakType result = + com.google.cloud.sql.v1beta4.BakType.forNumber(bakType_); + return result == null ? com.google.cloud.sql.v1beta4.BakType.UNRECOGNIZED : result; + } + + /** + * + * + *
+       * Type of the bak content, FULL or DIFF.
+       * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 6; + * + * @param value The bakType to set. + * @return This builder for chaining. + */ + public Builder setBakType(com.google.cloud.sql.v1beta4.BakType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + bakType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Type of the bak content, FULL or DIFF.
+       * 
+ * + * .google.cloud.sql.v1beta4.BakType bak_type = 6; + * + * @return This builder for chaining. + */ + public Builder clearBakType() { + bitField0_ = (bitField0_ & ~0x00000010); + bakType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp stopAt_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + stopAtBuilder_; + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the stopAt field is set. + */ + public boolean hasStopAt() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The stopAt. + */ + public com.google.protobuf.Timestamp getStopAt() { + if (stopAtBuilder_ == null) { + return stopAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : stopAt_; + } else { + return stopAtBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setStopAt(com.google.protobuf.Timestamp value) { + if (stopAtBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stopAt_ = value; + } else { + stopAtBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setStopAt(com.google.protobuf.Timestamp.Builder builderForValue) { + if (stopAtBuilder_ == null) { + stopAt_ = builderForValue.build(); + } else { + stopAtBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeStopAt(com.google.protobuf.Timestamp value) { + if (stopAtBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && stopAt_ != null + && stopAt_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStopAtBuilder().mergeFrom(value); + } else { + stopAt_ = value; + } + } else { + stopAtBuilder_.mergeFrom(value); + } + if (stopAt_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearStopAt() { + bitField0_ = (bitField0_ & ~0x00000020); + stopAt_ = null; + if (stopAtBuilder_ != null) { + stopAtBuilder_.dispose(); + stopAtBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getStopAtBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetStopAtFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getStopAtOrBuilder() { + if (stopAtBuilder_ != null) { + return stopAtBuilder_.getMessageOrBuilder(); + } else { + return stopAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : stopAt_; + } + } + + /** + * + * + *
+       * Optional. The timestamp when the import should stop. This timestamp is in
+       * the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
+       * `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
+       * keyword and applies to Cloud SQL for SQL Server only.
+       * 
+ * + * .google.protobuf.Timestamp stop_at = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStopAtFieldBuilder() { + if (stopAtBuilder_ == null) { + stopAtBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStopAt(), getParentForChildren(), isClean()); + stopAt_ = null; + } + return stopAtBuilder_; + } + + private java.lang.Object stopAtMark_ = ""; + + /** + * + * + *
+       * Optional. The marked transaction where the import should stop. This field
+       * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+       * Server only.
+       * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The stopAtMark. + */ + public java.lang.String getStopAtMark() { + java.lang.Object ref = stopAtMark_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stopAtMark_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Optional. The marked transaction where the import should stop. This field
+       * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+       * Server only.
+       * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for stopAtMark. + */ + public com.google.protobuf.ByteString getStopAtMarkBytes() { + java.lang.Object ref = stopAtMark_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stopAtMark_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Optional. The marked transaction where the import should stop. This field
+       * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+       * Server only.
+       * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The stopAtMark to set. + * @return This builder for chaining. + */ + public Builder setStopAtMark(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + stopAtMark_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The marked transaction where the import should stop. This field
+       * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+       * Server only.
+       * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearStopAtMark() { + stopAtMark_ = getDefaultInstance().getStopAtMark(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The marked transaction where the import should stop. This field
+       * is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
+       * Server only.
+       * 
+ * + * string stop_at_mark = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for stopAtMark to set. + * @return This builder for chaining. + */ + public Builder setStopAtMarkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + stopAtMark_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions) + private static final com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions(); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlBakImportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SqlTdeImportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The certificatePath. + */ + java.lang.String getCertificatePath(); + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for certificatePath. + */ + com.google.protobuf.ByteString getCertificatePathBytes(); + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPath. + */ + java.lang.String getPrivateKeyPath(); + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPath. + */ + com.google.protobuf.ByteString getPrivateKeyPathBytes(); + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPassword. + */ + java.lang.String getPrivateKeyPassword(); + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPassword. + */ + com.google.protobuf.ByteString getPrivateKeyPasswordBytes(); + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions} */ + public static final class SqlTdeImportOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions) + SqlTdeImportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlTdeImportOptions"); + } + + // Use SqlTdeImportOptions.newBuilder() to construct. + private SqlTdeImportOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlTdeImportOptions() { + certificatePath_ = ""; + privateKeyPath_ = ""; + privateKeyPassword_ = ""; + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlTdeImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlTdeImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.class, + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.Builder.class); + } + + public static final int CERTIFICATE_PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object certificatePath_ = ""; + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The certificatePath. + */ + @java.lang.Override + public java.lang.String getCertificatePath() { + java.lang.Object ref = certificatePath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certificatePath_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Path to the TDE certificate public key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for certificatePath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCertificatePathBytes() { + java.lang.Object ref = certificatePath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certificatePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIVATE_KEY_PATH_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object privateKeyPath_ = ""; + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPath. + */ + @java.lang.Override + public java.lang.String getPrivateKeyPath() { + java.lang.Object ref = privateKeyPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPath_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Path to the TDE certificate private key
+     * in the form gs://bucketName/fileName.
+     * The instance must have read access to the file.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrivateKeyPathBytes() { + java.lang.Object ref = privateKeyPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIVATE_KEY_PASSWORD_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object privateKeyPassword_ = ""; + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPassword. + */ + @java.lang.Override + public java.lang.String getPrivateKeyPassword() { + java.lang.Object ref = privateKeyPassword_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPassword_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Password that encrypts the private key.
+     * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPassword. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrivateKeyPasswordBytes() { + java.lang.Object ref = privateKeyPassword_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. Certificate name.
+     * Applicable only for SQL Server instances.
+     * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(certificatePath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, certificatePath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, privateKeyPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPassword_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, privateKeyPassword_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(certificatePath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, certificatePath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, privateKeyPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateKeyPassword_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, privateKeyPassword_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, 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.sql.v1beta4.ImportContext.SqlTdeImportOptions)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions other = + (com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions) obj; + + if (!getCertificatePath().equals(other.getCertificatePath())) return false; + if (!getPrivateKeyPath().equals(other.getPrivateKeyPath())) return false; + if (!getPrivateKeyPassword().equals(other.getPrivateKeyPassword())) return false; + 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) + CERTIFICATE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getCertificatePath().hashCode(); + hash = (37 * hash) + PRIVATE_KEY_PATH_FIELD_NUMBER; + hash = (53 * hash) + getPrivateKeyPath().hashCode(); + hash = (37 * hash) + PRIVATE_KEY_PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPrivateKeyPassword().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.sql.v1beta4.ImportContext.SqlTdeImportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions) + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlTdeImportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlTdeImportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.class, + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + certificatePath_ = ""; + privateKeyPath_ = ""; + privateKeyPassword_ = ""; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_SqlTdeImportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions build() { + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions buildPartial() { + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions result = + new com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.certificatePath_ = certificatePath_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.privateKeyPath_ = privateKeyPath_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.privateKeyPassword_ = privateKeyPassword_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions) { + return mergeFrom((com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions other) { + if (other + == com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.getDefaultInstance()) + return this; + if (!other.getCertificatePath().isEmpty()) { + certificatePath_ = other.certificatePath_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPrivateKeyPath().isEmpty()) { + privateKeyPath_ = other.privateKeyPath_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPrivateKeyPassword().isEmpty()) { + privateKeyPassword_ = other.privateKeyPassword_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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: + { + certificatePath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + privateKeyPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + privateKeyPassword_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 certificatePath_ = ""; + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The certificatePath. + */ + public java.lang.String getCertificatePath() { + java.lang.Object ref = certificatePath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certificatePath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for certificatePath. + */ + public com.google.protobuf.ByteString getCertificatePathBytes() { + java.lang.Object ref = certificatePath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certificatePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The certificatePath to set. + * @return This builder for chaining. + */ + public Builder setCertificatePath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + certificatePath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCertificatePath() { + certificatePath_ = getDefaultInstance().getCertificatePath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate public key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string certificate_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for certificatePath to set. + * @return This builder for chaining. + */ + public Builder setCertificatePathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + certificatePath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object privateKeyPath_ = ""; + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPath. + */ + public java.lang.String getPrivateKeyPath() { + java.lang.Object ref = privateKeyPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPath. + */ + public com.google.protobuf.ByteString getPrivateKeyPathBytes() { + java.lang.Object ref = privateKeyPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The privateKeyPath to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + privateKeyPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPrivateKeyPath() { + privateKeyPath_ = getDefaultInstance().getPrivateKeyPath(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Path to the TDE certificate private key
+       * in the form gs://bucketName/fileName.
+       * The instance must have read access to the file.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string private_key_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for privateKeyPath to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + privateKeyPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object privateKeyPassword_ = ""; + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The privateKeyPassword. + */ + public java.lang.String getPrivateKeyPassword() { + java.lang.Object ref = privateKeyPassword_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeyPassword_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for privateKeyPassword. + */ + public com.google.protobuf.ByteString getPrivateKeyPasswordBytes() { + java.lang.Object ref = privateKeyPassword_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeyPassword_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The privateKeyPassword to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + privateKeyPassword_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPrivateKeyPassword() { + privateKeyPassword_ = getDefaultInstance().getPrivateKeyPassword(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Password that encrypts the private key.
+       * 
+ * + * string private_key_password = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for privateKeyPassword to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeyPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + privateKeyPassword_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Certificate name.
+       * Applicable only for SQL Server instances.
+       * 
+ * + * string name = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions) + private static final com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions(); + } + + public static com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlTdeImportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object uri_ = ""; + + /** + * + * + *
+   * Path to the import file in Cloud Storage, in the form
+   * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+   * when `fileType` is `SQL`. The instance must have
+   * write permissions to the bucket and read access to the file.
+   * 
+ * + * string uri = 1; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + + /** + * + * + *
+   * Path to the import file in Cloud Storage, in the form
+   * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+   * when `fileType` is `SQL`. The instance must have
+   * write permissions to the bucket and read access to the file.
+   * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * The target database for the import. If `fileType` is `SQL`, this field
+   * is required only if the import file does not specify a database, and is
+   * overridden by any database specification in the import file. For entire
+   * instance parallel import operations, the database is overridden by the
+   * database name stored in subdirectory name. If
+   * `fileType` is `CSV`, one database must be specified.
+   * 
+ * + * string database = 2; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + + /** + * + * + *
+   * The target database for the import. If `fileType` is `SQL`, this field
+   * is required only if the import file does not specify a database, and is
+   * overridden by any database specification in the import file. For entire
+   * instance parallel import operations, the database is overridden by the
+   * database name stored in subdirectory name. If
+   * `fileType` is `CSV`, one database must be specified.
+   * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#importContext`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#importContext`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILE_TYPE_FIELD_NUMBER = 4; + private int fileType_ = 0; + + /** + * + * + *
+   * The file type for the specified uri.
+   * *  `SQL`: The file contains SQL statements.
+   * *  `CSV`: The file contains CSV data.
+   * *  `BAK`: The file contains backup data for a SQL Server instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 4; + * + * @return The enum numeric value on the wire for fileType. + */ + @java.lang.Override + public int getFileTypeValue() { + return fileType_; + } + + /** + * + * + *
+   * The file type for the specified uri.
+   * *  `SQL`: The file contains SQL statements.
+   * *  `CSV`: The file contains CSV data.
+   * *  `BAK`: The file contains backup data for a SQL Server instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 4; + * + * @return The fileType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlFileType getFileType() { + com.google.cloud.sql.v1beta4.SqlFileType result = + com.google.cloud.sql.v1beta4.SqlFileType.forNumber(fileType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlFileType.UNRECOGNIZED : result; + } + + public static final int CSV_IMPORT_OPTIONS_FIELD_NUMBER = 5; + private com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csvImportOptions_; + + /** + * + * + *
+   * Options for importing data as CSV.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + * + * @return Whether the csvImportOptions field is set. + */ + @java.lang.Override + public boolean hasCsvImportOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Options for importing data as CSV.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + * + * @return The csvImportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions getCsvImportOptions() { + return csvImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.getDefaultInstance() + : csvImportOptions_; + } + + /** + * + * + *
+   * Options for importing data as CSV.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptionsOrBuilder + getCsvImportOptionsOrBuilder() { + return csvImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.getDefaultInstance() + : csvImportOptions_; + } + + public static final int IMPORT_USER_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object importUser_ = ""; + + /** + * + * + *
+   * The PostgreSQL user for this import operation. PostgreSQL instances only.
+   * 
+ * + * string import_user = 6; + * + * @return The importUser. + */ + @java.lang.Override + public java.lang.String getImportUser() { + java.lang.Object ref = importUser_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + importUser_ = s; + return s; + } + } + + /** + * + * + *
+   * The PostgreSQL user for this import operation. PostgreSQL instances only.
+   * 
+ * + * string import_user = 6; + * + * @return The bytes for importUser. + */ + @java.lang.Override + public com.google.protobuf.ByteString getImportUserBytes() { + java.lang.Object ref = importUser_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + importUser_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BAK_IMPORT_OPTIONS_FIELD_NUMBER = 7; + private com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bakImportOptions_; + + /** + * + * + *
+   * Import parameters specific to SQL Server .BAK files
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + * + * @return Whether the bakImportOptions field is set. + */ + @java.lang.Override + public boolean hasBakImportOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Import parameters specific to SQL Server .BAK files
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + * + * @return The bakImportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions getBakImportOptions() { + return bakImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.getDefaultInstance() + : bakImportOptions_; + } + + /** + * + * + *
+   * Import parameters specific to SQL Server .BAK files
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptionsOrBuilder + getBakImportOptionsOrBuilder() { + return bakImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.getDefaultInstance() + : bakImportOptions_; + } + + public static final int SQL_IMPORT_OPTIONS_FIELD_NUMBER = 8; + private com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sqlImportOptions_; + + /** + * + * + *
+   * Optional. Options for importing data from SQL statements.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the sqlImportOptions field is set. + */ + @java.lang.Override + public boolean hasSqlImportOptions() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Options for importing data from SQL statements.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sqlImportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions getSqlImportOptions() { + return sqlImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.getDefaultInstance() + : sqlImportOptions_; + } + + /** + * + * + *
+   * Optional. Options for importing data from SQL statements.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptionsOrBuilder + getSqlImportOptionsOrBuilder() { + return sqlImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.getDefaultInstance() + : sqlImportOptions_; + } + + public static final int TDE_IMPORT_OPTIONS_FIELD_NUMBER = 9; + private com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tdeImportOptions_; + + /** + * + * + *
+   * Optional. Import parameters specific to SQL Server .TDE files
+   * Import parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tdeImportOptions field is set. + */ + @java.lang.Override + public boolean hasTdeImportOptions() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. Import parameters specific to SQL Server .TDE files
+   * Import parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tdeImportOptions. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions getTdeImportOptions() { + return tdeImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.getDefaultInstance() + : tdeImportOptions_; + } + + /** + * + * + *
+   * Optional. Import parameters specific to SQL Server .TDE files
+   * Import parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptionsOrBuilder + getTdeImportOptionsOrBuilder() { + return tdeImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.getDefaultInstance() + : tdeImportOptions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, uri_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + if (fileType_ + != com.google.cloud.sql.v1beta4.SqlFileType.SQL_FILE_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, fileType_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getCsvImportOptions()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(importUser_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, importUser_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(7, getBakImportOptions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(8, getSqlImportOptions()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(9, getTdeImportOptions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, uri_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + if (fileType_ + != com.google.cloud.sql.v1beta4.SqlFileType.SQL_FILE_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, fileType_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCsvImportOptions()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(importUser_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, importUser_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getBakImportOptions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSqlImportOptions()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getTdeImportOptions()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ImportContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ImportContext other = + (com.google.cloud.sql.v1beta4.ImportContext) obj; + + if (!getUri().equals(other.getUri())) return false; + if (!getDatabase().equals(other.getDatabase())) return false; + if (!getKind().equals(other.getKind())) return false; + if (fileType_ != other.fileType_) return false; + if (hasCsvImportOptions() != other.hasCsvImportOptions()) return false; + if (hasCsvImportOptions()) { + if (!getCsvImportOptions().equals(other.getCsvImportOptions())) return false; + } + if (!getImportUser().equals(other.getImportUser())) return false; + if (hasBakImportOptions() != other.hasBakImportOptions()) return false; + if (hasBakImportOptions()) { + if (!getBakImportOptions().equals(other.getBakImportOptions())) return false; + } + if (hasSqlImportOptions() != other.hasSqlImportOptions()) return false; + if (hasSqlImportOptions()) { + if (!getSqlImportOptions().equals(other.getSqlImportOptions())) return false; + } + if (hasTdeImportOptions() != other.hasTdeImportOptions()) return false; + if (hasTdeImportOptions()) { + if (!getTdeImportOptions().equals(other.getTdeImportOptions())) return false; + } + if (!getUnknownFields().equals(other.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) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + FILE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + fileType_; + if (hasCsvImportOptions()) { + hash = (37 * hash) + CSV_IMPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getCsvImportOptions().hashCode(); + } + hash = (37 * hash) + IMPORT_USER_FIELD_NUMBER; + hash = (53 * hash) + getImportUser().hashCode(); + if (hasBakImportOptions()) { + hash = (37 * hash) + BAK_IMPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getBakImportOptions().hashCode(); + } + if (hasSqlImportOptions()) { + hash = (37 * hash) + SQL_IMPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getSqlImportOptions().hashCode(); + } + if (hasTdeImportOptions()) { + hash = (37 * hash) + TDE_IMPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getTdeImportOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ImportContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ImportContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ImportContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ImportContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.ImportContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance import context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ImportContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ImportContext) + com.google.cloud.sql.v1beta4.ImportContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ImportContext.class, + com.google.cloud.sql.v1beta4.ImportContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ImportContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCsvImportOptionsFieldBuilder(); + internalGetBakImportOptionsFieldBuilder(); + internalGetSqlImportOptionsFieldBuilder(); + internalGetTdeImportOptionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + uri_ = ""; + database_ = ""; + kind_ = ""; + fileType_ = 0; + csvImportOptions_ = null; + if (csvImportOptionsBuilder_ != null) { + csvImportOptionsBuilder_.dispose(); + csvImportOptionsBuilder_ = null; + } + importUser_ = ""; + bakImportOptions_ = null; + if (bakImportOptionsBuilder_ != null) { + bakImportOptionsBuilder_.dispose(); + bakImportOptionsBuilder_ = null; + } + sqlImportOptions_ = null; + if (sqlImportOptionsBuilder_ != null) { + sqlImportOptionsBuilder_.dispose(); + sqlImportOptionsBuilder_ = null; + } + tdeImportOptions_ = null; + if (tdeImportOptionsBuilder_ != null) { + tdeImportOptionsBuilder_.dispose(); + tdeImportOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ImportContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ImportContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext build() { + com.google.cloud.sql.v1beta4.ImportContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext buildPartial() { + com.google.cloud.sql.v1beta4.ImportContext result = + new com.google.cloud.sql.v1beta4.ImportContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ImportContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.uri_ = uri_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.database_ = database_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.fileType_ = fileType_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.csvImportOptions_ = + csvImportOptionsBuilder_ == null ? csvImportOptions_ : csvImportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.importUser_ = importUser_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.bakImportOptions_ = + bakImportOptionsBuilder_ == null ? bakImportOptions_ : bakImportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.sqlImportOptions_ = + sqlImportOptionsBuilder_ == null ? sqlImportOptions_ : sqlImportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.tdeImportOptions_ = + tdeImportOptionsBuilder_ == null ? tdeImportOptions_ : tdeImportOptionsBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ImportContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.ImportContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ImportContext other) { + if (other == com.google.cloud.sql.v1beta4.ImportContext.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.fileType_ != 0) { + setFileTypeValue(other.getFileTypeValue()); + } + if (other.hasCsvImportOptions()) { + mergeCsvImportOptions(other.getCsvImportOptions()); + } + if (!other.getImportUser().isEmpty()) { + importUser_ = other.importUser_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasBakImportOptions()) { + mergeBakImportOptions(other.getBakImportOptions()); + } + if (other.hasSqlImportOptions()) { + mergeSqlImportOptions(other.getSqlImportOptions()); + } + if (other.hasTdeImportOptions()) { + mergeTdeImportOptions(other.getTdeImportOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + database_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + fileType_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + input.readMessage( + internalGetCsvImportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + importUser_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetBakImportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage( + internalGetSqlImportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + input.readMessage( + internalGetTdeImportOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object uri_ = ""; + + /** + * + * + *
+     * Path to the import file in Cloud Storage, in the form
+     * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+     * when `fileType` is `SQL`. The instance must have
+     * write permissions to the bucket and read access to the file.
+     * 
+ * + * string uri = 1; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Path to the import file in Cloud Storage, in the form
+     * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+     * when `fileType` is `SQL`. The instance must have
+     * write permissions to the bucket and read access to the file.
+     * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Path to the import file in Cloud Storage, in the form
+     * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+     * when `fileType` is `SQL`. The instance must have
+     * write permissions to the bucket and read access to the file.
+     * 
+ * + * string uri = 1; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Path to the import file in Cloud Storage, in the form
+     * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+     * when `fileType` is `SQL`. The instance must have
+     * write permissions to the bucket and read access to the file.
+     * 
+ * + * string uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Path to the import file in Cloud Storage, in the form
+     * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+     * when `fileType` is `SQL`. The instance must have
+     * write permissions to the bucket and read access to the file.
+     * 
+ * + * string uri = 1; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object database_ = ""; + + /** + * + * + *
+     * The target database for the import. If `fileType` is `SQL`, this field
+     * is required only if the import file does not specify a database, and is
+     * overridden by any database specification in the import file. For entire
+     * instance parallel import operations, the database is overridden by the
+     * database name stored in subdirectory name. If
+     * `fileType` is `CSV`, one database must be specified.
+     * 
+ * + * string database = 2; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The target database for the import. If `fileType` is `SQL`, this field
+     * is required only if the import file does not specify a database, and is
+     * overridden by any database specification in the import file. For entire
+     * instance parallel import operations, the database is overridden by the
+     * database name stored in subdirectory name. If
+     * `fileType` is `CSV`, one database must be specified.
+     * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The target database for the import. If `fileType` is `SQL`, this field
+     * is required only if the import file does not specify a database, and is
+     * overridden by any database specification in the import file. For entire
+     * instance parallel import operations, the database is overridden by the
+     * database name stored in subdirectory name. If
+     * `fileType` is `CSV`, one database must be specified.
+     * 
+ * + * string database = 2; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + database_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The target database for the import. If `fileType` is `SQL`, this field
+     * is required only if the import file does not specify a database, and is
+     * overridden by any database specification in the import file. For entire
+     * instance parallel import operations, the database is overridden by the
+     * database name stored in subdirectory name. If
+     * `fileType` is `CSV`, one database must be specified.
+     * 
+ * + * string database = 2; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The target database for the import. If `fileType` is `SQL`, this field
+     * is required only if the import file does not specify a database, and is
+     * overridden by any database specification in the import file. For entire
+     * instance parallel import operations, the database is overridden by the
+     * database name stored in subdirectory name. If
+     * `fileType` is `CSV`, one database must be specified.
+     * 
+ * + * string database = 2; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + database_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#importContext`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#importContext`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#importContext`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#importContext`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#importContext`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int fileType_ = 0; + + /** + * + * + *
+     * The file type for the specified uri.
+     * *  `SQL`: The file contains SQL statements.
+     * *  `CSV`: The file contains CSV data.
+     * *  `BAK`: The file contains backup data for a SQL Server instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 4; + * + * @return The enum numeric value on the wire for fileType. + */ + @java.lang.Override + public int getFileTypeValue() { + return fileType_; + } + + /** + * + * + *
+     * The file type for the specified uri.
+     * *  `SQL`: The file contains SQL statements.
+     * *  `CSV`: The file contains CSV data.
+     * *  `BAK`: The file contains backup data for a SQL Server instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 4; + * + * @param value The enum numeric value on the wire for fileType to set. + * @return This builder for chaining. + */ + public Builder setFileTypeValue(int value) { + fileType_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The file type for the specified uri.
+     * *  `SQL`: The file contains SQL statements.
+     * *  `CSV`: The file contains CSV data.
+     * *  `BAK`: The file contains backup data for a SQL Server instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 4; + * + * @return The fileType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlFileType getFileType() { + com.google.cloud.sql.v1beta4.SqlFileType result = + com.google.cloud.sql.v1beta4.SqlFileType.forNumber(fileType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlFileType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The file type for the specified uri.
+     * *  `SQL`: The file contains SQL statements.
+     * *  `CSV`: The file contains CSV data.
+     * *  `BAK`: The file contains backup data for a SQL Server instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 4; + * + * @param value The fileType to set. + * @return This builder for chaining. + */ + public Builder setFileType(com.google.cloud.sql.v1beta4.SqlFileType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + fileType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The file type for the specified uri.
+     * *  `SQL`: The file contains SQL statements.
+     * *  `CSV`: The file contains CSV data.
+     * *  `BAK`: The file contains backup data for a SQL Server instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 4; + * + * @return This builder for chaining. + */ + public Builder clearFileType() { + bitField0_ = (bitField0_ & ~0x00000008); + fileType_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csvImportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptionsOrBuilder> + csvImportOptionsBuilder_; + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + * + * @return Whether the csvImportOptions field is set. + */ + public boolean hasCsvImportOptions() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + * + * @return The csvImportOptions. + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions getCsvImportOptions() { + if (csvImportOptionsBuilder_ == null) { + return csvImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.getDefaultInstance() + : csvImportOptions_; + } else { + return csvImportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + */ + public Builder setCsvImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions value) { + if (csvImportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + csvImportOptions_ = value; + } else { + csvImportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + */ + public Builder setCsvImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.Builder builderForValue) { + if (csvImportOptionsBuilder_ == null) { + csvImportOptions_ = builderForValue.build(); + } else { + csvImportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + */ + public Builder mergeCsvImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions value) { + if (csvImportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && csvImportOptions_ != null + && csvImportOptions_ + != com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions + .getDefaultInstance()) { + getCsvImportOptionsBuilder().mergeFrom(value); + } else { + csvImportOptions_ = value; + } + } else { + csvImportOptionsBuilder_.mergeFrom(value); + } + if (csvImportOptions_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + */ + public Builder clearCsvImportOptions() { + bitField0_ = (bitField0_ & ~0x00000010); + csvImportOptions_ = null; + if (csvImportOptionsBuilder_ != null) { + csvImportOptionsBuilder_.dispose(); + csvImportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.Builder + getCsvImportOptionsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetCsvImportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptionsOrBuilder + getCsvImportOptionsOrBuilder() { + if (csvImportOptionsBuilder_ != null) { + return csvImportOptionsBuilder_.getMessageOrBuilder(); + } else { + return csvImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.getDefaultInstance() + : csvImportOptions_; + } + } + + /** + * + * + *
+     * Options for importing data as CSV.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptionsOrBuilder> + internalGetCsvImportOptionsFieldBuilder() { + if (csvImportOptionsBuilder_ == null) { + csvImportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptionsOrBuilder>( + getCsvImportOptions(), getParentForChildren(), isClean()); + csvImportOptions_ = null; + } + return csvImportOptionsBuilder_; + } + + private java.lang.Object importUser_ = ""; + + /** + * + * + *
+     * The PostgreSQL user for this import operation. PostgreSQL instances only.
+     * 
+ * + * string import_user = 6; + * + * @return The importUser. + */ + public java.lang.String getImportUser() { + java.lang.Object ref = importUser_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + importUser_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The PostgreSQL user for this import operation. PostgreSQL instances only.
+     * 
+ * + * string import_user = 6; + * + * @return The bytes for importUser. + */ + public com.google.protobuf.ByteString getImportUserBytes() { + java.lang.Object ref = importUser_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + importUser_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The PostgreSQL user for this import operation. PostgreSQL instances only.
+     * 
+ * + * string import_user = 6; + * + * @param value The importUser to set. + * @return This builder for chaining. + */ + public Builder setImportUser(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + importUser_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The PostgreSQL user for this import operation. PostgreSQL instances only.
+     * 
+ * + * string import_user = 6; + * + * @return This builder for chaining. + */ + public Builder clearImportUser() { + importUser_ = getDefaultInstance().getImportUser(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * The PostgreSQL user for this import operation. PostgreSQL instances only.
+     * 
+ * + * string import_user = 6; + * + * @param value The bytes for importUser to set. + * @return This builder for chaining. + */ + public Builder setImportUserBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + importUser_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bakImportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptionsOrBuilder> + bakImportOptionsBuilder_; + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + * + * @return Whether the bakImportOptions field is set. + */ + public boolean hasBakImportOptions() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + * + * @return The bakImportOptions. + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions getBakImportOptions() { + if (bakImportOptionsBuilder_ == null) { + return bakImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.getDefaultInstance() + : bakImportOptions_; + } else { + return bakImportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + */ + public Builder setBakImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions value) { + if (bakImportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bakImportOptions_ = value; + } else { + bakImportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + */ + public Builder setBakImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.Builder builderForValue) { + if (bakImportOptionsBuilder_ == null) { + bakImportOptions_ = builderForValue.build(); + } else { + bakImportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + */ + public Builder mergeBakImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions value) { + if (bakImportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && bakImportOptions_ != null + && bakImportOptions_ + != com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions + .getDefaultInstance()) { + getBakImportOptionsBuilder().mergeFrom(value); + } else { + bakImportOptions_ = value; + } + } else { + bakImportOptionsBuilder_.mergeFrom(value); + } + if (bakImportOptions_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + */ + public Builder clearBakImportOptions() { + bitField0_ = (bitField0_ & ~0x00000040); + bakImportOptions_ = null; + if (bakImportOptionsBuilder_ != null) { + bakImportOptionsBuilder_.dispose(); + bakImportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.Builder + getBakImportOptionsBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetBakImportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptionsOrBuilder + getBakImportOptionsOrBuilder() { + if (bakImportOptionsBuilder_ != null) { + return bakImportOptionsBuilder_.getMessageOrBuilder(); + } else { + return bakImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.getDefaultInstance() + : bakImportOptions_; + } + } + + /** + * + * + *
+     * Import parameters specific to SQL Server .BAK files
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptionsOrBuilder> + internalGetBakImportOptionsFieldBuilder() { + if (bakImportOptionsBuilder_ == null) { + bakImportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptionsOrBuilder>( + getBakImportOptions(), getParentForChildren(), isClean()); + bakImportOptions_ = null; + } + return bakImportOptionsBuilder_; + } + + private com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sqlImportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptionsOrBuilder> + sqlImportOptionsBuilder_; + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the sqlImportOptions field is set. + */ + public boolean hasSqlImportOptions() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sqlImportOptions. + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions getSqlImportOptions() { + if (sqlImportOptionsBuilder_ == null) { + return sqlImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.getDefaultInstance() + : sqlImportOptions_; + } else { + return sqlImportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSqlImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions value) { + if (sqlImportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sqlImportOptions_ = value; + } else { + sqlImportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSqlImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.Builder builderForValue) { + if (sqlImportOptionsBuilder_ == null) { + sqlImportOptions_ = builderForValue.build(); + } else { + sqlImportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeSqlImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions value) { + if (sqlImportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && sqlImportOptions_ != null + && sqlImportOptions_ + != com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions + .getDefaultInstance()) { + getSqlImportOptionsBuilder().mergeFrom(value); + } else { + sqlImportOptions_ = value; + } + } else { + sqlImportOptionsBuilder_.mergeFrom(value); + } + if (sqlImportOptions_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSqlImportOptions() { + bitField0_ = (bitField0_ & ~0x00000080); + sqlImportOptions_ = null; + if (sqlImportOptionsBuilder_ != null) { + sqlImportOptionsBuilder_.dispose(); + sqlImportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.Builder + getSqlImportOptionsBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetSqlImportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptionsOrBuilder + getSqlImportOptionsOrBuilder() { + if (sqlImportOptionsBuilder_ != null) { + return sqlImportOptionsBuilder_.getMessageOrBuilder(); + } else { + return sqlImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.getDefaultInstance() + : sqlImportOptions_; + } + } + + /** + * + * + *
+     * Optional. Options for importing data from SQL statements.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptionsOrBuilder> + internalGetSqlImportOptionsFieldBuilder() { + if (sqlImportOptionsBuilder_ == null) { + sqlImportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptionsOrBuilder>( + getSqlImportOptions(), getParentForChildren(), isClean()); + sqlImportOptions_ = null; + } + return sqlImportOptionsBuilder_; + } + + private com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tdeImportOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptionsOrBuilder> + tdeImportOptionsBuilder_; + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server .TDE files
+     * Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tdeImportOptions field is set. + */ + public boolean hasTdeImportOptions() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server .TDE files
+     * Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tdeImportOptions. + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions getTdeImportOptions() { + if (tdeImportOptionsBuilder_ == null) { + return tdeImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.getDefaultInstance() + : tdeImportOptions_; + } else { + return tdeImportOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server .TDE files
+     * Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTdeImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions value) { + if (tdeImportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tdeImportOptions_ = value; + } else { + tdeImportOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server .TDE files
+     * Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTdeImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.Builder builderForValue) { + if (tdeImportOptionsBuilder_ == null) { + tdeImportOptions_ = builderForValue.build(); + } else { + tdeImportOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server .TDE files
+     * Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeTdeImportOptions( + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions value) { + if (tdeImportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && tdeImportOptions_ != null + && tdeImportOptions_ + != com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions + .getDefaultInstance()) { + getTdeImportOptionsBuilder().mergeFrom(value); + } else { + tdeImportOptions_ = value; + } + } else { + tdeImportOptionsBuilder_.mergeFrom(value); + } + if (tdeImportOptions_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server .TDE files
+     * Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTdeImportOptions() { + bitField0_ = (bitField0_ & ~0x00000100); + tdeImportOptions_ = null; + if (tdeImportOptionsBuilder_ != null) { + tdeImportOptionsBuilder_.dispose(); + tdeImportOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server .TDE files
+     * Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.Builder + getTdeImportOptionsBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetTdeImportOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server .TDE files
+     * Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptionsOrBuilder + getTdeImportOptionsOrBuilder() { + if (tdeImportOptionsBuilder_ != null) { + return tdeImportOptionsBuilder_.getMessageOrBuilder(); + } else { + return tdeImportOptions_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.getDefaultInstance() + : tdeImportOptions_; + } + } + + /** + * + * + *
+     * Optional. Import parameters specific to SQL Server .TDE files
+     * Import parameters specific to SQL Server TDE certificates
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptionsOrBuilder> + internalGetTdeImportOptionsFieldBuilder() { + if (tdeImportOptionsBuilder_ == null) { + tdeImportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions, + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.Builder, + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptionsOrBuilder>( + getTdeImportOptions(), getParentForChildren(), isClean()); + tdeImportOptions_ = null; + } + return tdeImportOptionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ImportContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ImportContext) + private static final com.google.cloud.sql.v1beta4.ImportContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ImportContext(); + } + + public static com.google.cloud.sql.v1beta4.ImportContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ImportContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ImportContextOrBuilder.java new file mode 100644 index 000000000000..5708643ac20a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ImportContextOrBuilder.java @@ -0,0 +1,353 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ImportContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ImportContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Path to the import file in Cloud Storage, in the form
+   * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+   * when `fileType` is `SQL`. The instance must have
+   * write permissions to the bucket and read access to the file.
+   * 
+ * + * string uri = 1; + * + * @return The uri. + */ + java.lang.String getUri(); + + /** + * + * + *
+   * Path to the import file in Cloud Storage, in the form
+   * `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
+   * when `fileType` is `SQL`. The instance must have
+   * write permissions to the bucket and read access to the file.
+   * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * The target database for the import. If `fileType` is `SQL`, this field
+   * is required only if the import file does not specify a database, and is
+   * overridden by any database specification in the import file. For entire
+   * instance parallel import operations, the database is overridden by the
+   * database name stored in subdirectory name. If
+   * `fileType` is `CSV`, one database must be specified.
+   * 
+ * + * string database = 2; + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * The target database for the import. If `fileType` is `SQL`, this field
+   * is required only if the import file does not specify a database, and is
+   * overridden by any database specification in the import file. For entire
+   * instance parallel import operations, the database is overridden by the
+   * database name stored in subdirectory name. If
+   * `fileType` is `CSV`, one database must be specified.
+   * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * This is always `sql#importContext`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#importContext`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The file type for the specified uri.
+   * *  `SQL`: The file contains SQL statements.
+   * *  `CSV`: The file contains CSV data.
+   * *  `BAK`: The file contains backup data for a SQL Server instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 4; + * + * @return The enum numeric value on the wire for fileType. + */ + int getFileTypeValue(); + + /** + * + * + *
+   * The file type for the specified uri.
+   * *  `SQL`: The file contains SQL statements.
+   * *  `CSV`: The file contains CSV data.
+   * *  `BAK`: The file contains backup data for a SQL Server instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlFileType file_type = 4; + * + * @return The fileType. + */ + com.google.cloud.sql.v1beta4.SqlFileType getFileType(); + + /** + * + * + *
+   * Options for importing data as CSV.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + * + * @return Whether the csvImportOptions field is set. + */ + boolean hasCsvImportOptions(); + + /** + * + * + *
+   * Options for importing data as CSV.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + * + * @return The csvImportOptions. + */ + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions getCsvImportOptions(); + + /** + * + * + *
+   * Options for importing data as CSV.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions csv_import_options = 5; + * + */ + com.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptionsOrBuilder + getCsvImportOptionsOrBuilder(); + + /** + * + * + *
+   * The PostgreSQL user for this import operation. PostgreSQL instances only.
+   * 
+ * + * string import_user = 6; + * + * @return The importUser. + */ + java.lang.String getImportUser(); + + /** + * + * + *
+   * The PostgreSQL user for this import operation. PostgreSQL instances only.
+   * 
+ * + * string import_user = 6; + * + * @return The bytes for importUser. + */ + com.google.protobuf.ByteString getImportUserBytes(); + + /** + * + * + *
+   * Import parameters specific to SQL Server .BAK files
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + * + * @return Whether the bakImportOptions field is set. + */ + boolean hasBakImportOptions(); + + /** + * + * + *
+   * Import parameters specific to SQL Server .BAK files
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + * + * @return The bakImportOptions. + */ + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions getBakImportOptions(); + + /** + * + * + *
+   * Import parameters specific to SQL Server .BAK files
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions bak_import_options = 7; + * + */ + com.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptionsOrBuilder + getBakImportOptionsOrBuilder(); + + /** + * + * + *
+   * Optional. Options for importing data from SQL statements.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the sqlImportOptions field is set. + */ + boolean hasSqlImportOptions(); + + /** + * + * + *
+   * Optional. Options for importing data from SQL statements.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sqlImportOptions. + */ + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions getSqlImportOptions(); + + /** + * + * + *
+   * Optional. Options for importing data from SQL statements.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlImportOptions sql_import_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.ImportContext.SqlImportOptionsOrBuilder + getSqlImportOptionsOrBuilder(); + + /** + * + * + *
+   * Optional. Import parameters specific to SQL Server .TDE files
+   * Import parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tdeImportOptions field is set. + */ + boolean hasTdeImportOptions(); + + /** + * + * + *
+   * Optional. Import parameters specific to SQL Server .TDE files
+   * Import parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tdeImportOptions. + */ + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions getTdeImportOptions(); + + /** + * + * + *
+   * Optional. Import parameters specific to SQL Server .TDE files
+   * Import parameters specific to SQL Server TDE certificates
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions tde_import_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptionsOrBuilder + getTdeImportOptionsOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InsightsConfig.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InsightsConfig.java new file mode 100644 index 000000000000..c0c9eda47481 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InsightsConfig.java @@ -0,0 +1,1643 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Insights configuration. This specifies when Cloud SQL Insights feature is
+ * enabled and optional configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InsightsConfig} + */ +@com.google.protobuf.Generated +public final class InsightsConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InsightsConfig) + InsightsConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InsightsConfig"); + } + + // Use InsightsConfig.newBuilder() to construct. + private InsightsConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InsightsConfig() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InsightsConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InsightsConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InsightsConfig.class, + com.google.cloud.sql.v1beta4.InsightsConfig.Builder.class); + } + + private int bitField0_; + public static final int QUERY_INSIGHTS_ENABLED_FIELD_NUMBER = 1; + private boolean queryInsightsEnabled_ = false; + + /** + * + * + *
+   * Whether Query Insights feature is enabled.
+   * 
+ * + * bool query_insights_enabled = 1; + * + * @return The queryInsightsEnabled. + */ + @java.lang.Override + public boolean getQueryInsightsEnabled() { + return queryInsightsEnabled_; + } + + public static final int RECORD_CLIENT_ADDRESS_FIELD_NUMBER = 2; + private boolean recordClientAddress_ = false; + + /** + * + * + *
+   * Whether Query Insights will record client address when enabled.
+   * 
+ * + * bool record_client_address = 2; + * + * @return The recordClientAddress. + */ + @java.lang.Override + public boolean getRecordClientAddress() { + return recordClientAddress_; + } + + public static final int RECORD_APPLICATION_TAGS_FIELD_NUMBER = 3; + private boolean recordApplicationTags_ = false; + + /** + * + * + *
+   * Whether Query Insights will record application tags from query when
+   * enabled.
+   * 
+ * + * bool record_application_tags = 3; + * + * @return The recordApplicationTags. + */ + @java.lang.Override + public boolean getRecordApplicationTags() { + return recordApplicationTags_; + } + + public static final int QUERY_STRING_LENGTH_FIELD_NUMBER = 4; + private com.google.protobuf.Int32Value queryStringLength_; + + /** + * + * + *
+   * Maximum query length stored in bytes. Default value: 1024 bytes.
+   * Range: 256-4500 bytes. Query lengths greater than this field value will be
+   * truncated to this value. When unset, query length will be the default
+   * value. Changing query length will restart the database.
+   * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + * + * @return Whether the queryStringLength field is set. + */ + @java.lang.Override + public boolean hasQueryStringLength() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Maximum query length stored in bytes. Default value: 1024 bytes.
+   * Range: 256-4500 bytes. Query lengths greater than this field value will be
+   * truncated to this value. When unset, query length will be the default
+   * value. Changing query length will restart the database.
+   * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + * + * @return The queryStringLength. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getQueryStringLength() { + return queryStringLength_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryStringLength_; + } + + /** + * + * + *
+   * Maximum query length stored in bytes. Default value: 1024 bytes.
+   * Range: 256-4500 bytes. Query lengths greater than this field value will be
+   * truncated to this value. When unset, query length will be the default
+   * value. Changing query length will restart the database.
+   * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getQueryStringLengthOrBuilder() { + return queryStringLength_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryStringLength_; + } + + public static final int QUERY_PLANS_PER_MINUTE_FIELD_NUMBER = 5; + private com.google.protobuf.Int32Value queryPlansPerMinute_; + + /** + * + * + *
+   * Number of query execution plans captured by Insights per minute
+   * for all queries combined. Default is 5.
+   * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + @java.lang.Override + public boolean hasQueryPlansPerMinute() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Number of query execution plans captured by Insights per minute
+   * for all queries combined. Default is 5.
+   * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getQueryPlansPerMinute() { + return queryPlansPerMinute_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryPlansPerMinute_; + } + + /** + * + * + *
+   * Number of query execution plans captured by Insights per minute
+   * for all queries combined. Default is 5.
+   * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getQueryPlansPerMinuteOrBuilder() { + return queryPlansPerMinute_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryPlansPerMinute_; + } + + public static final int ENHANCED_QUERY_INSIGHTS_ENABLED_FIELD_NUMBER = 8; + private com.google.protobuf.BoolValue enhancedQueryInsightsEnabled_; + + /** + * + * + *
+   * Optional. Whether enhanced query insights feature is enabled.
+   * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enhancedQueryInsightsEnabled field is set. + */ + @java.lang.Override + public boolean hasEnhancedQueryInsightsEnabled() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Whether enhanced query insights feature is enabled.
+   * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enhancedQueryInsightsEnabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnhancedQueryInsightsEnabled() { + return enhancedQueryInsightsEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enhancedQueryInsightsEnabled_; + } + + /** + * + * + *
+   * Optional. Whether enhanced query insights feature is enabled.
+   * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getEnhancedQueryInsightsEnabledOrBuilder() { + return enhancedQueryInsightsEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enhancedQueryInsightsEnabled_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (queryInsightsEnabled_ != false) { + output.writeBool(1, queryInsightsEnabled_); + } + if (recordClientAddress_ != false) { + output.writeBool(2, recordClientAddress_); + } + if (recordApplicationTags_ != false) { + output.writeBool(3, recordApplicationTags_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getQueryStringLength()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getQueryPlansPerMinute()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(8, getEnhancedQueryInsightsEnabled()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (queryInsightsEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, queryInsightsEnabled_); + } + if (recordClientAddress_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, recordClientAddress_); + } + if (recordApplicationTags_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, recordApplicationTags_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getQueryStringLength()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getQueryPlansPerMinute()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, getEnhancedQueryInsightsEnabled()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InsightsConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InsightsConfig other = + (com.google.cloud.sql.v1beta4.InsightsConfig) obj; + + if (getQueryInsightsEnabled() != other.getQueryInsightsEnabled()) return false; + if (getRecordClientAddress() != other.getRecordClientAddress()) return false; + if (getRecordApplicationTags() != other.getRecordApplicationTags()) return false; + if (hasQueryStringLength() != other.hasQueryStringLength()) return false; + if (hasQueryStringLength()) { + if (!getQueryStringLength().equals(other.getQueryStringLength())) return false; + } + if (hasQueryPlansPerMinute() != other.hasQueryPlansPerMinute()) return false; + if (hasQueryPlansPerMinute()) { + if (!getQueryPlansPerMinute().equals(other.getQueryPlansPerMinute())) return false; + } + if (hasEnhancedQueryInsightsEnabled() != other.hasEnhancedQueryInsightsEnabled()) return false; + if (hasEnhancedQueryInsightsEnabled()) { + if (!getEnhancedQueryInsightsEnabled().equals(other.getEnhancedQueryInsightsEnabled())) + return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + QUERY_INSIGHTS_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getQueryInsightsEnabled()); + hash = (37 * hash) + RECORD_CLIENT_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRecordClientAddress()); + hash = (37 * hash) + RECORD_APPLICATION_TAGS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRecordApplicationTags()); + if (hasQueryStringLength()) { + hash = (37 * hash) + QUERY_STRING_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getQueryStringLength().hashCode(); + } + if (hasQueryPlansPerMinute()) { + hash = (37 * hash) + QUERY_PLANS_PER_MINUTE_FIELD_NUMBER; + hash = (53 * hash) + getQueryPlansPerMinute().hashCode(); + } + if (hasEnhancedQueryInsightsEnabled()) { + hash = (37 * hash) + ENHANCED_QUERY_INSIGHTS_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getEnhancedQueryInsightsEnabled().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InsightsConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InsightsConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InsightsConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InsightsConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InsightsConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InsightsConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InsightsConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InsightsConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InsightsConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InsightsConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InsightsConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InsightsConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.InsightsConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Insights configuration. This specifies when Cloud SQL Insights feature is
+   * enabled and optional configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InsightsConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InsightsConfig) + com.google.cloud.sql.v1beta4.InsightsConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InsightsConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InsightsConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InsightsConfig.class, + com.google.cloud.sql.v1beta4.InsightsConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InsightsConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetQueryStringLengthFieldBuilder(); + internalGetQueryPlansPerMinuteFieldBuilder(); + internalGetEnhancedQueryInsightsEnabledFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + queryInsightsEnabled_ = false; + recordClientAddress_ = false; + recordApplicationTags_ = false; + queryStringLength_ = null; + if (queryStringLengthBuilder_ != null) { + queryStringLengthBuilder_.dispose(); + queryStringLengthBuilder_ = null; + } + queryPlansPerMinute_ = null; + if (queryPlansPerMinuteBuilder_ != null) { + queryPlansPerMinuteBuilder_.dispose(); + queryPlansPerMinuteBuilder_ = null; + } + enhancedQueryInsightsEnabled_ = null; + if (enhancedQueryInsightsEnabledBuilder_ != null) { + enhancedQueryInsightsEnabledBuilder_.dispose(); + enhancedQueryInsightsEnabledBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InsightsConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InsightsConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InsightsConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InsightsConfig build() { + com.google.cloud.sql.v1beta4.InsightsConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InsightsConfig buildPartial() { + com.google.cloud.sql.v1beta4.InsightsConfig result = + new com.google.cloud.sql.v1beta4.InsightsConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.InsightsConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.queryInsightsEnabled_ = queryInsightsEnabled_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recordClientAddress_ = recordClientAddress_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.recordApplicationTags_ = recordApplicationTags_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.queryStringLength_ = + queryStringLengthBuilder_ == null + ? queryStringLength_ + : queryStringLengthBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.queryPlansPerMinute_ = + queryPlansPerMinuteBuilder_ == null + ? queryPlansPerMinute_ + : queryPlansPerMinuteBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.enhancedQueryInsightsEnabled_ = + enhancedQueryInsightsEnabledBuilder_ == null + ? enhancedQueryInsightsEnabled_ + : enhancedQueryInsightsEnabledBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InsightsConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.InsightsConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InsightsConfig other) { + if (other == com.google.cloud.sql.v1beta4.InsightsConfig.getDefaultInstance()) return this; + if (other.getQueryInsightsEnabled() != false) { + setQueryInsightsEnabled(other.getQueryInsightsEnabled()); + } + if (other.getRecordClientAddress() != false) { + setRecordClientAddress(other.getRecordClientAddress()); + } + if (other.getRecordApplicationTags() != false) { + setRecordApplicationTags(other.getRecordApplicationTags()); + } + if (other.hasQueryStringLength()) { + mergeQueryStringLength(other.getQueryStringLength()); + } + if (other.hasQueryPlansPerMinute()) { + mergeQueryPlansPerMinute(other.getQueryPlansPerMinute()); + } + if (other.hasEnhancedQueryInsightsEnabled()) { + mergeEnhancedQueryInsightsEnabled(other.getEnhancedQueryInsightsEnabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + queryInsightsEnabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + recordClientAddress_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + recordApplicationTags_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage( + internalGetQueryStringLengthFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetQueryPlansPerMinuteFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 66: + { + input.readMessage( + internalGetEnhancedQueryInsightsEnabledFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean queryInsightsEnabled_; + + /** + * + * + *
+     * Whether Query Insights feature is enabled.
+     * 
+ * + * bool query_insights_enabled = 1; + * + * @return The queryInsightsEnabled. + */ + @java.lang.Override + public boolean getQueryInsightsEnabled() { + return queryInsightsEnabled_; + } + + /** + * + * + *
+     * Whether Query Insights feature is enabled.
+     * 
+ * + * bool query_insights_enabled = 1; + * + * @param value The queryInsightsEnabled to set. + * @return This builder for chaining. + */ + public Builder setQueryInsightsEnabled(boolean value) { + + queryInsightsEnabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether Query Insights feature is enabled.
+     * 
+ * + * bool query_insights_enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearQueryInsightsEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + queryInsightsEnabled_ = false; + onChanged(); + return this; + } + + private boolean recordClientAddress_; + + /** + * + * + *
+     * Whether Query Insights will record client address when enabled.
+     * 
+ * + * bool record_client_address = 2; + * + * @return The recordClientAddress. + */ + @java.lang.Override + public boolean getRecordClientAddress() { + return recordClientAddress_; + } + + /** + * + * + *
+     * Whether Query Insights will record client address when enabled.
+     * 
+ * + * bool record_client_address = 2; + * + * @param value The recordClientAddress to set. + * @return This builder for chaining. + */ + public Builder setRecordClientAddress(boolean value) { + + recordClientAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether Query Insights will record client address when enabled.
+     * 
+ * + * bool record_client_address = 2; + * + * @return This builder for chaining. + */ + public Builder clearRecordClientAddress() { + bitField0_ = (bitField0_ & ~0x00000002); + recordClientAddress_ = false; + onChanged(); + return this; + } + + private boolean recordApplicationTags_; + + /** + * + * + *
+     * Whether Query Insights will record application tags from query when
+     * enabled.
+     * 
+ * + * bool record_application_tags = 3; + * + * @return The recordApplicationTags. + */ + @java.lang.Override + public boolean getRecordApplicationTags() { + return recordApplicationTags_; + } + + /** + * + * + *
+     * Whether Query Insights will record application tags from query when
+     * enabled.
+     * 
+ * + * bool record_application_tags = 3; + * + * @param value The recordApplicationTags to set. + * @return This builder for chaining. + */ + public Builder setRecordApplicationTags(boolean value) { + + recordApplicationTags_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether Query Insights will record application tags from query when
+     * enabled.
+     * 
+ * + * bool record_application_tags = 3; + * + * @return This builder for chaining. + */ + public Builder clearRecordApplicationTags() { + bitField0_ = (bitField0_ & ~0x00000004); + recordApplicationTags_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Int32Value queryStringLength_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + queryStringLengthBuilder_; + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + * + * @return Whether the queryStringLength field is set. + */ + public boolean hasQueryStringLength() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + * + * @return The queryStringLength. + */ + public com.google.protobuf.Int32Value getQueryStringLength() { + if (queryStringLengthBuilder_ == null) { + return queryStringLength_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryStringLength_; + } else { + return queryStringLengthBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + public Builder setQueryStringLength(com.google.protobuf.Int32Value value) { + if (queryStringLengthBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryStringLength_ = value; + } else { + queryStringLengthBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + public Builder setQueryStringLength(com.google.protobuf.Int32Value.Builder builderForValue) { + if (queryStringLengthBuilder_ == null) { + queryStringLength_ = builderForValue.build(); + } else { + queryStringLengthBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + public Builder mergeQueryStringLength(com.google.protobuf.Int32Value value) { + if (queryStringLengthBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && queryStringLength_ != null + && queryStringLength_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getQueryStringLengthBuilder().mergeFrom(value); + } else { + queryStringLength_ = value; + } + } else { + queryStringLengthBuilder_.mergeFrom(value); + } + if (queryStringLength_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + public Builder clearQueryStringLength() { + bitField0_ = (bitField0_ & ~0x00000008); + queryStringLength_ = null; + if (queryStringLengthBuilder_ != null) { + queryStringLengthBuilder_.dispose(); + queryStringLengthBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + public com.google.protobuf.Int32Value.Builder getQueryStringLengthBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetQueryStringLengthFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + public com.google.protobuf.Int32ValueOrBuilder getQueryStringLengthOrBuilder() { + if (queryStringLengthBuilder_ != null) { + return queryStringLengthBuilder_.getMessageOrBuilder(); + } else { + return queryStringLength_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryStringLength_; + } + } + + /** + * + * + *
+     * Maximum query length stored in bytes. Default value: 1024 bytes.
+     * Range: 256-4500 bytes. Query lengths greater than this field value will be
+     * truncated to this value. When unset, query length will be the default
+     * value. Changing query length will restart the database.
+     * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetQueryStringLengthFieldBuilder() { + if (queryStringLengthBuilder_ == null) { + queryStringLengthBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getQueryStringLength(), getParentForChildren(), isClean()); + queryStringLength_ = null; + } + return queryStringLengthBuilder_; + } + + private com.google.protobuf.Int32Value queryPlansPerMinute_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + queryPlansPerMinuteBuilder_; + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + public boolean hasQueryPlansPerMinute() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + public com.google.protobuf.Int32Value getQueryPlansPerMinute() { + if (queryPlansPerMinuteBuilder_ == null) { + return queryPlansPerMinute_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryPlansPerMinute_; + } else { + return queryPlansPerMinuteBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + public Builder setQueryPlansPerMinute(com.google.protobuf.Int32Value value) { + if (queryPlansPerMinuteBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryPlansPerMinute_ = value; + } else { + queryPlansPerMinuteBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + public Builder setQueryPlansPerMinute(com.google.protobuf.Int32Value.Builder builderForValue) { + if (queryPlansPerMinuteBuilder_ == null) { + queryPlansPerMinute_ = builderForValue.build(); + } else { + queryPlansPerMinuteBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + public Builder mergeQueryPlansPerMinute(com.google.protobuf.Int32Value value) { + if (queryPlansPerMinuteBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && queryPlansPerMinute_ != null + && queryPlansPerMinute_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getQueryPlansPerMinuteBuilder().mergeFrom(value); + } else { + queryPlansPerMinute_ = value; + } + } else { + queryPlansPerMinuteBuilder_.mergeFrom(value); + } + if (queryPlansPerMinute_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + public Builder clearQueryPlansPerMinute() { + bitField0_ = (bitField0_ & ~0x00000010); + queryPlansPerMinute_ = null; + if (queryPlansPerMinuteBuilder_ != null) { + queryPlansPerMinuteBuilder_.dispose(); + queryPlansPerMinuteBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + public com.google.protobuf.Int32Value.Builder getQueryPlansPerMinuteBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetQueryPlansPerMinuteFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + public com.google.protobuf.Int32ValueOrBuilder getQueryPlansPerMinuteOrBuilder() { + if (queryPlansPerMinuteBuilder_ != null) { + return queryPlansPerMinuteBuilder_.getMessageOrBuilder(); + } else { + return queryPlansPerMinute_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : queryPlansPerMinute_; + } + } + + /** + * + * + *
+     * Number of query execution plans captured by Insights per minute
+     * for all queries combined. Default is 5.
+     * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetQueryPlansPerMinuteFieldBuilder() { + if (queryPlansPerMinuteBuilder_ == null) { + queryPlansPerMinuteBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getQueryPlansPerMinute(), getParentForChildren(), isClean()); + queryPlansPerMinute_ = null; + } + return queryPlansPerMinuteBuilder_; + } + + private com.google.protobuf.BoolValue enhancedQueryInsightsEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + enhancedQueryInsightsEnabledBuilder_; + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enhancedQueryInsightsEnabled field is set. + */ + public boolean hasEnhancedQueryInsightsEnabled() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enhancedQueryInsightsEnabled. + */ + public com.google.protobuf.BoolValue getEnhancedQueryInsightsEnabled() { + if (enhancedQueryInsightsEnabledBuilder_ == null) { + return enhancedQueryInsightsEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enhancedQueryInsightsEnabled_; + } else { + return enhancedQueryInsightsEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEnhancedQueryInsightsEnabled(com.google.protobuf.BoolValue value) { + if (enhancedQueryInsightsEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enhancedQueryInsightsEnabled_ = value; + } else { + enhancedQueryInsightsEnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEnhancedQueryInsightsEnabled( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (enhancedQueryInsightsEnabledBuilder_ == null) { + enhancedQueryInsightsEnabled_ = builderForValue.build(); + } else { + enhancedQueryInsightsEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEnhancedQueryInsightsEnabled(com.google.protobuf.BoolValue value) { + if (enhancedQueryInsightsEnabledBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && enhancedQueryInsightsEnabled_ != null + && enhancedQueryInsightsEnabled_ + != com.google.protobuf.BoolValue.getDefaultInstance()) { + getEnhancedQueryInsightsEnabledBuilder().mergeFrom(value); + } else { + enhancedQueryInsightsEnabled_ = value; + } + } else { + enhancedQueryInsightsEnabledBuilder_.mergeFrom(value); + } + if (enhancedQueryInsightsEnabled_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEnhancedQueryInsightsEnabled() { + bitField0_ = (bitField0_ & ~0x00000020); + enhancedQueryInsightsEnabled_ = null; + if (enhancedQueryInsightsEnabledBuilder_ != null) { + enhancedQueryInsightsEnabledBuilder_.dispose(); + enhancedQueryInsightsEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getEnhancedQueryInsightsEnabledBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetEnhancedQueryInsightsEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getEnhancedQueryInsightsEnabledOrBuilder() { + if (enhancedQueryInsightsEnabledBuilder_ != null) { + return enhancedQueryInsightsEnabledBuilder_.getMessageOrBuilder(); + } else { + return enhancedQueryInsightsEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enhancedQueryInsightsEnabled_; + } + } + + /** + * + * + *
+     * Optional. Whether enhanced query insights feature is enabled.
+     * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetEnhancedQueryInsightsEnabledFieldBuilder() { + if (enhancedQueryInsightsEnabledBuilder_ == null) { + enhancedQueryInsightsEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getEnhancedQueryInsightsEnabled(), getParentForChildren(), isClean()); + enhancedQueryInsightsEnabled_ = null; + } + return enhancedQueryInsightsEnabledBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InsightsConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InsightsConfig) + private static final com.google.cloud.sql.v1beta4.InsightsConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InsightsConfig(); + } + + public static com.google.cloud.sql.v1beta4.InsightsConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InsightsConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InsightsConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InsightsConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InsightsConfigOrBuilder.java new file mode 100644 index 000000000000..01e2a7af8110 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InsightsConfigOrBuilder.java @@ -0,0 +1,197 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InsightsConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InsightsConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether Query Insights feature is enabled.
+   * 
+ * + * bool query_insights_enabled = 1; + * + * @return The queryInsightsEnabled. + */ + boolean getQueryInsightsEnabled(); + + /** + * + * + *
+   * Whether Query Insights will record client address when enabled.
+   * 
+ * + * bool record_client_address = 2; + * + * @return The recordClientAddress. + */ + boolean getRecordClientAddress(); + + /** + * + * + *
+   * Whether Query Insights will record application tags from query when
+   * enabled.
+   * 
+ * + * bool record_application_tags = 3; + * + * @return The recordApplicationTags. + */ + boolean getRecordApplicationTags(); + + /** + * + * + *
+   * Maximum query length stored in bytes. Default value: 1024 bytes.
+   * Range: 256-4500 bytes. Query lengths greater than this field value will be
+   * truncated to this value. When unset, query length will be the default
+   * value. Changing query length will restart the database.
+   * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + * + * @return Whether the queryStringLength field is set. + */ + boolean hasQueryStringLength(); + + /** + * + * + *
+   * Maximum query length stored in bytes. Default value: 1024 bytes.
+   * Range: 256-4500 bytes. Query lengths greater than this field value will be
+   * truncated to this value. When unset, query length will be the default
+   * value. Changing query length will restart the database.
+   * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + * + * @return The queryStringLength. + */ + com.google.protobuf.Int32Value getQueryStringLength(); + + /** + * + * + *
+   * Maximum query length stored in bytes. Default value: 1024 bytes.
+   * Range: 256-4500 bytes. Query lengths greater than this field value will be
+   * truncated to this value. When unset, query length will be the default
+   * value. Changing query length will restart the database.
+   * 
+ * + * .google.protobuf.Int32Value query_string_length = 4; + */ + com.google.protobuf.Int32ValueOrBuilder getQueryStringLengthOrBuilder(); + + /** + * + * + *
+   * Number of query execution plans captured by Insights per minute
+   * for all queries combined. Default is 5.
+   * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + * + * @return Whether the queryPlansPerMinute field is set. + */ + boolean hasQueryPlansPerMinute(); + + /** + * + * + *
+   * Number of query execution plans captured by Insights per minute
+   * for all queries combined. Default is 5.
+   * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + * + * @return The queryPlansPerMinute. + */ + com.google.protobuf.Int32Value getQueryPlansPerMinute(); + + /** + * + * + *
+   * Number of query execution plans captured by Insights per minute
+   * for all queries combined. Default is 5.
+   * 
+ * + * .google.protobuf.Int32Value query_plans_per_minute = 5; + */ + com.google.protobuf.Int32ValueOrBuilder getQueryPlansPerMinuteOrBuilder(); + + /** + * + * + *
+   * Optional. Whether enhanced query insights feature is enabled.
+   * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enhancedQueryInsightsEnabled field is set. + */ + boolean hasEnhancedQueryInsightsEnabled(); + + /** + * + * + *
+   * Optional. Whether enhanced query insights feature is enabled.
+   * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enhancedQueryInsightsEnabled. + */ + com.google.protobuf.BoolValue getEnhancedQueryInsightsEnabled(); + + /** + * + * + *
+   * Optional. Whether enhanced query insights feature is enabled.
+   * 
+ * + * + * .google.protobuf.BoolValue enhanced_query_insights_enabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getEnhancedQueryInsightsEnabledOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstanceName.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstanceName.java new file mode 100644 index 000000000000..932e39d5d0f2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstanceName.java @@ -0,0 +1,195 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +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; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@NullMarked +@Generated("by gapic-generator-java") +public class InstanceName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/instances/{instance}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + + @Deprecated + protected InstanceName() { + project = null; + instance = null; + } + + private InstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + } + + public String getProject() { + return project; + } + + 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 instance) { + return newBuilder().setProject(project).setInstance(instance).build(); + } + + public static String format(String project, String instance) { + return newBuilder().setProject(project).setInstance(instance).build().toString(); + } + + public static @Nullable InstanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE.validatedMatch( + formattedString, "InstanceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), 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<@Nullable InstanceName> 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_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 (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_INSTANCE.instantiate("project", project, "instance", instance); + } + + @Override + public boolean equals(@Nullable 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.instance, that.instance); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + return h; + } + + /** Builder for projects/{project}/instances/{instance}. */ + public static class Builder { + private String project; + private String instance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + private Builder(InstanceName instanceName) { + this.project = instanceName.project; + this.instance = instanceName.instance; + } + + public InstanceName build() { + return new InstanceName(this); + } + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstanceReference.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstanceReference.java new file mode 100644 index 000000000000..8032b5577156 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstanceReference.java @@ -0,0 +1,987 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Reference to another Cloud SQL instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstanceReference} + */ +@com.google.protobuf.Generated +public final class InstanceReference extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstanceReference) + InstanceReferenceOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstanceReference"); + } + + // Use InstanceReference.newBuilder() to construct. + private InstanceReference(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstanceReference() { + name_ = ""; + region_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstanceReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstanceReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstanceReference.class, + com.google.cloud.sql.v1beta4.InstanceReference.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the Cloud SQL instance being referenced.
+   * This does not include the project ID.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the Cloud SQL instance being referenced.
+   * This does not include the project ID.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REGION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object region_ = ""; + + /** + * + * + *
+   * The region of the Cloud SQL instance being referenced.
+   * 
+ * + * string region = 2; + * + * @return The region. + */ + @java.lang.Override + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } + } + + /** + * + * + *
+   * The region of the Cloud SQL instance being referenced.
+   * 
+ * + * string region = 2; + * + * @return The bytes for region. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * The project ID of the Cloud SQL instance being referenced.
+   * The default is the same project ID as the instance references it.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * The project ID of the Cloud SQL instance being referenced.
+   * The default is the same project ID as the instance references it.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, region_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(region_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, region_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstanceReference)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstanceReference other = + (com.google.cloud.sql.v1beta4.InstanceReference) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRegion().equals(other.getRegion())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegion().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstanceReference parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstanceReference parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstanceReference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstanceReference parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstanceReference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstanceReference parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstanceReference parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstanceReference parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstanceReference parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstanceReference parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstanceReference parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstanceReference parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.InstanceReference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Reference to another Cloud SQL instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstanceReference} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstanceReference) + com.google.cloud.sql.v1beta4.InstanceReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstanceReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstanceReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstanceReference.class, + com.google.cloud.sql.v1beta4.InstanceReference.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InstanceReference.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + region_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstanceReference_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstanceReference getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstanceReference.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstanceReference build() { + com.google.cloud.sql.v1beta4.InstanceReference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstanceReference buildPartial() { + com.google.cloud.sql.v1beta4.InstanceReference result = + new com.google.cloud.sql.v1beta4.InstanceReference(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.InstanceReference result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.region_ = region_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstanceReference) { + return mergeFrom((com.google.cloud.sql.v1beta4.InstanceReference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InstanceReference other) { + if (other == com.google.cloud.sql.v1beta4.InstanceReference.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRegion().isEmpty()) { + region_ = other.region_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + region_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the Cloud SQL instance being referenced.
+     * This does not include the project ID.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the Cloud SQL instance being referenced.
+     * This does not include the project ID.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the Cloud SQL instance being referenced.
+     * This does not include the project ID.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the Cloud SQL instance being referenced.
+     * This does not include the project ID.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the Cloud SQL instance being referenced.
+     * This does not include the project ID.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object region_ = ""; + + /** + * + * + *
+     * The region of the Cloud SQL instance being referenced.
+     * 
+ * + * string region = 2; + * + * @return The region. + */ + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The region of the Cloud SQL instance being referenced.
+     * 
+ * + * string region = 2; + * + * @return The bytes for region. + */ + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The region of the Cloud SQL instance being referenced.
+     * 
+ * + * string region = 2; + * + * @param value The region to set. + * @return This builder for chaining. + */ + public Builder setRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + region_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The region of the Cloud SQL instance being referenced.
+     * 
+ * + * string region = 2; + * + * @return This builder for chaining. + */ + public Builder clearRegion() { + region_ = getDefaultInstance().getRegion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The region of the Cloud SQL instance being referenced.
+     * 
+ * + * string region = 2; + * + * @param value The bytes for region to set. + * @return This builder for chaining. + */ + public Builder setRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + region_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * The project ID of the Cloud SQL instance being referenced.
+     * The default is the same project ID as the instance references it.
+     * 
+ * + * string project = 3; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The project ID of the Cloud SQL instance being referenced.
+     * The default is the same project ID as the instance references it.
+     * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The project ID of the Cloud SQL instance being referenced.
+     * The default is the same project ID as the instance references it.
+     * 
+ * + * string project = 3; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the Cloud SQL instance being referenced.
+     * The default is the same project ID as the instance references it.
+     * 
+ * + * string project = 3; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the Cloud SQL instance being referenced.
+     * The default is the same project ID as the instance references it.
+     * 
+ * + * string project = 3; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstanceReference) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstanceReference) + private static final com.google.cloud.sql.v1beta4.InstanceReference DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstanceReference(); + } + + public static com.google.cloud.sql.v1beta4.InstanceReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstanceReference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstanceReference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstanceReferenceOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstanceReferenceOrBuilder.java new file mode 100644 index 000000000000..002a53ad1f37 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstanceReferenceOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstanceReferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstanceReference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the Cloud SQL instance being referenced.
+   * This does not include the project ID.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the Cloud SQL instance being referenced.
+   * This does not include the project ID.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The region of the Cloud SQL instance being referenced.
+   * 
+ * + * string region = 2; + * + * @return The region. + */ + java.lang.String getRegion(); + + /** + * + * + *
+   * The region of the Cloud SQL instance being referenced.
+   * 
+ * + * string region = 2; + * + * @return The bytes for region. + */ + com.google.protobuf.ByteString getRegionBytes(); + + /** + * + * + *
+   * The project ID of the Cloud SQL instance being referenced.
+   * The default is the same project ID as the instance references it.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * The project ID of the Cloud SQL instance being referenced.
+   * The default is the same project ID as the instance references it.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesAcquireSsrsLeaseRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesAcquireSsrsLeaseRequest.java new file mode 100644 index 000000000000..c470ed68ed0c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesAcquireSsrsLeaseRequest.java @@ -0,0 +1,725 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Request to acquire an SSRS lease for an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest} + */ +@com.google.protobuf.Generated +public final class InstancesAcquireSsrsLeaseRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest) + InstancesAcquireSsrsLeaseRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesAcquireSsrsLeaseRequest"); + } + + // Use InstancesAcquireSsrsLeaseRequest.newBuilder() to construct. + private InstancesAcquireSsrsLeaseRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesAcquireSsrsLeaseRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesAcquireSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesAcquireSsrsLeaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.class, + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.Builder.class); + } + + private int bitField0_; + public static final int ACQUIRE_SSRS_LEASE_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquireSsrsLeaseContext_; + + /** + * + * + *
+   * Contains details about the acquire SSRS lease operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + * @return Whether the acquireSsrsLeaseContext field is set. + */ + @java.lang.Override + public boolean hasAcquireSsrsLeaseContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Contains details about the acquire SSRS lease operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + * @return The acquireSsrsLeaseContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext getAcquireSsrsLeaseContext() { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } + + /** + * + * + *
+   * Contains details about the acquire SSRS lease operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContextOrBuilder + getAcquireSsrsLeaseContextOrBuilder() { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getAcquireSsrsLeaseContext()); + } + 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, getAcquireSsrsLeaseContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest other = + (com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest) obj; + + if (hasAcquireSsrsLeaseContext() != other.hasAcquireSsrsLeaseContext()) return false; + if (hasAcquireSsrsLeaseContext()) { + if (!getAcquireSsrsLeaseContext().equals(other.getAcquireSsrsLeaseContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasAcquireSsrsLeaseContext()) { + hash = (37 * hash) + ACQUIRE_SSRS_LEASE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getAcquireSsrsLeaseContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request to acquire an SSRS lease for an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest) + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesAcquireSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesAcquireSsrsLeaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.class, + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAcquireSsrsLeaseContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + acquireSsrsLeaseContext_ = null; + if (acquireSsrsLeaseContextBuilder_ != null) { + acquireSsrsLeaseContextBuilder_.dispose(); + acquireSsrsLeaseContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesAcquireSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest build() { + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest buildPartial() { + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest result = + new com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.acquireSsrsLeaseContext_ = + acquireSsrsLeaseContextBuilder_ == null + ? acquireSsrsLeaseContext_ + : acquireSsrsLeaseContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest other) { + if (other + == com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.getDefaultInstance()) + return this; + if (other.hasAcquireSsrsLeaseContext()) { + mergeAcquireSsrsLeaseContext(other.getAcquireSsrsLeaseContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetAcquireSsrsLeaseContextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquireSsrsLeaseContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext, + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.Builder, + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContextOrBuilder> + acquireSsrsLeaseContextBuilder_; + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + * + * @return Whether the acquireSsrsLeaseContext field is set. + */ + public boolean hasAcquireSsrsLeaseContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + * + * @return The acquireSsrsLeaseContext. + */ + public com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext getAcquireSsrsLeaseContext() { + if (acquireSsrsLeaseContextBuilder_ == null) { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } else { + return acquireSsrsLeaseContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + */ + public Builder setAcquireSsrsLeaseContext( + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext value) { + if (acquireSsrsLeaseContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + acquireSsrsLeaseContext_ = value; + } else { + acquireSsrsLeaseContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + */ + public Builder setAcquireSsrsLeaseContext( + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.Builder builderForValue) { + if (acquireSsrsLeaseContextBuilder_ == null) { + acquireSsrsLeaseContext_ = builderForValue.build(); + } else { + acquireSsrsLeaseContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + */ + public Builder mergeAcquireSsrsLeaseContext( + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext value) { + if (acquireSsrsLeaseContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && acquireSsrsLeaseContext_ != null + && acquireSsrsLeaseContext_ + != com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.getDefaultInstance()) { + getAcquireSsrsLeaseContextBuilder().mergeFrom(value); + } else { + acquireSsrsLeaseContext_ = value; + } + } else { + acquireSsrsLeaseContextBuilder_.mergeFrom(value); + } + if (acquireSsrsLeaseContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + */ + public Builder clearAcquireSsrsLeaseContext() { + bitField0_ = (bitField0_ & ~0x00000001); + acquireSsrsLeaseContext_ = null; + if (acquireSsrsLeaseContextBuilder_ != null) { + acquireSsrsLeaseContextBuilder_.dispose(); + acquireSsrsLeaseContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + */ + public com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.Builder + getAcquireSsrsLeaseContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetAcquireSsrsLeaseContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + */ + public com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContextOrBuilder + getAcquireSsrsLeaseContextOrBuilder() { + if (acquireSsrsLeaseContextBuilder_ != null) { + return acquireSsrsLeaseContextBuilder_.getMessageOrBuilder(); + } else { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } + } + + /** + * + * + *
+     * Contains details about the acquire SSRS lease operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext, + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.Builder, + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContextOrBuilder> + internalGetAcquireSsrsLeaseContextFieldBuilder() { + if (acquireSsrsLeaseContextBuilder_ == null) { + acquireSsrsLeaseContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext, + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.Builder, + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContextOrBuilder>( + getAcquireSsrsLeaseContext(), getParentForChildren(), isClean()); + acquireSsrsLeaseContext_ = null; + } + return acquireSsrsLeaseContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest) + private static final com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest(); + } + + public static com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesAcquireSsrsLeaseRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesAcquireSsrsLeaseRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesAcquireSsrsLeaseRequestOrBuilder.java new file mode 100644 index 000000000000..47ed5c172bad --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesAcquireSsrsLeaseRequestOrBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesAcquireSsrsLeaseRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Contains details about the acquire SSRS lease operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + * @return Whether the acquireSsrsLeaseContext field is set. + */ + boolean hasAcquireSsrsLeaseContext(); + + /** + * + * + *
+   * Contains details about the acquire SSRS lease operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + * + * @return The acquireSsrsLeaseContext. + */ + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext getAcquireSsrsLeaseContext(); + + /** + * + * + *
+   * Contains details about the acquire SSRS lease operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; + */ + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContextOrBuilder + getAcquireSsrsLeaseContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesCloneRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesCloneRequest.java new file mode 100644 index 000000000000..0d8cee938825 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesCloneRequest.java @@ -0,0 +1,700 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance clone request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesCloneRequest} + */ +@com.google.protobuf.Generated +public final class InstancesCloneRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesCloneRequest) + InstancesCloneRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesCloneRequest"); + } + + // Use InstancesCloneRequest.newBuilder() to construct. + private InstancesCloneRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesCloneRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesCloneRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesCloneRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesCloneRequest.class, + com.google.cloud.sql.v1beta4.InstancesCloneRequest.Builder.class); + } + + private int bitField0_; + public static final int CLONE_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.CloneContext cloneContext_; + + /** + * + * + *
+   * Contains details about the clone operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + * + * @return Whether the cloneContext field is set. + */ + @java.lang.Override + public boolean hasCloneContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Contains details about the clone operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + * + * @return The cloneContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.CloneContext getCloneContext() { + return cloneContext_ == null + ? com.google.cloud.sql.v1beta4.CloneContext.getDefaultInstance() + : cloneContext_; + } + + /** + * + * + *
+   * Contains details about the clone operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.CloneContextOrBuilder getCloneContextOrBuilder() { + return cloneContext_ == null + ? com.google.cloud.sql.v1beta4.CloneContext.getDefaultInstance() + : cloneContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getCloneContext()); + } + 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, getCloneContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesCloneRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesCloneRequest other = + (com.google.cloud.sql.v1beta4.InstancesCloneRequest) obj; + + if (hasCloneContext() != other.hasCloneContext()) return false; + if (hasCloneContext()) { + if (!getCloneContext().equals(other.getCloneContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasCloneContext()) { + hash = (37 * hash) + CLONE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getCloneContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesCloneRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesCloneRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesCloneRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesCloneRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesCloneRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesCloneRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesCloneRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesCloneRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesCloneRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesCloneRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesCloneRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesCloneRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.InstancesCloneRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance clone request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesCloneRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesCloneRequest) + com.google.cloud.sql.v1beta4.InstancesCloneRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesCloneRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesCloneRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesCloneRequest.class, + com.google.cloud.sql.v1beta4.InstancesCloneRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InstancesCloneRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCloneContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cloneContext_ = null; + if (cloneContextBuilder_ != null) { + cloneContextBuilder_.dispose(); + cloneContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesCloneRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesCloneRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesCloneRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesCloneRequest build() { + com.google.cloud.sql.v1beta4.InstancesCloneRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesCloneRequest buildPartial() { + com.google.cloud.sql.v1beta4.InstancesCloneRequest result = + new com.google.cloud.sql.v1beta4.InstancesCloneRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.InstancesCloneRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cloneContext_ = + cloneContextBuilder_ == null ? cloneContext_ : cloneContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesCloneRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.InstancesCloneRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InstancesCloneRequest other) { + if (other == com.google.cloud.sql.v1beta4.InstancesCloneRequest.getDefaultInstance()) + return this; + if (other.hasCloneContext()) { + mergeCloneContext(other.getCloneContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetCloneContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.CloneContext cloneContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.CloneContext, + com.google.cloud.sql.v1beta4.CloneContext.Builder, + com.google.cloud.sql.v1beta4.CloneContextOrBuilder> + cloneContextBuilder_; + + /** + * + * + *
+     * Contains details about the clone operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + * + * @return Whether the cloneContext field is set. + */ + public boolean hasCloneContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Contains details about the clone operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + * + * @return The cloneContext. + */ + public com.google.cloud.sql.v1beta4.CloneContext getCloneContext() { + if (cloneContextBuilder_ == null) { + return cloneContext_ == null + ? com.google.cloud.sql.v1beta4.CloneContext.getDefaultInstance() + : cloneContext_; + } else { + return cloneContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains details about the clone operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + */ + public Builder setCloneContext(com.google.cloud.sql.v1beta4.CloneContext value) { + if (cloneContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cloneContext_ = value; + } else { + cloneContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the clone operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + */ + public Builder setCloneContext( + com.google.cloud.sql.v1beta4.CloneContext.Builder builderForValue) { + if (cloneContextBuilder_ == null) { + cloneContext_ = builderForValue.build(); + } else { + cloneContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the clone operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + */ + public Builder mergeCloneContext(com.google.cloud.sql.v1beta4.CloneContext value) { + if (cloneContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && cloneContext_ != null + && cloneContext_ != com.google.cloud.sql.v1beta4.CloneContext.getDefaultInstance()) { + getCloneContextBuilder().mergeFrom(value); + } else { + cloneContext_ = value; + } + } else { + cloneContextBuilder_.mergeFrom(value); + } + if (cloneContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains details about the clone operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + */ + public Builder clearCloneContext() { + bitField0_ = (bitField0_ & ~0x00000001); + cloneContext_ = null; + if (cloneContextBuilder_ != null) { + cloneContextBuilder_.dispose(); + cloneContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the clone operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + */ + public com.google.cloud.sql.v1beta4.CloneContext.Builder getCloneContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetCloneContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains details about the clone operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + */ + public com.google.cloud.sql.v1beta4.CloneContextOrBuilder getCloneContextOrBuilder() { + if (cloneContextBuilder_ != null) { + return cloneContextBuilder_.getMessageOrBuilder(); + } else { + return cloneContext_ == null + ? com.google.cloud.sql.v1beta4.CloneContext.getDefaultInstance() + : cloneContext_; + } + } + + /** + * + * + *
+     * Contains details about the clone operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.CloneContext, + com.google.cloud.sql.v1beta4.CloneContext.Builder, + com.google.cloud.sql.v1beta4.CloneContextOrBuilder> + internalGetCloneContextFieldBuilder() { + if (cloneContextBuilder_ == null) { + cloneContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.CloneContext, + com.google.cloud.sql.v1beta4.CloneContext.Builder, + com.google.cloud.sql.v1beta4.CloneContextOrBuilder>( + getCloneContext(), getParentForChildren(), isClean()); + cloneContext_ = null; + } + return cloneContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesCloneRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesCloneRequest) + private static final com.google.cloud.sql.v1beta4.InstancesCloneRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesCloneRequest(); + } + + public static com.google.cloud.sql.v1beta4.InstancesCloneRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesCloneRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesCloneRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesCloneRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesCloneRequestOrBuilder.java new file mode 100644 index 000000000000..118e4f94dcd3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesCloneRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesCloneRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesCloneRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Contains details about the clone operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + * + * @return Whether the cloneContext field is set. + */ + boolean hasCloneContext(); + + /** + * + * + *
+   * Contains details about the clone operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + * + * @return The cloneContext. + */ + com.google.cloud.sql.v1beta4.CloneContext getCloneContext(); + + /** + * + * + *
+   * Contains details about the clone operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.CloneContext clone_context = 1; + */ + com.google.cloud.sql.v1beta4.CloneContextOrBuilder getCloneContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesDemoteMasterRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesDemoteMasterRequest.java new file mode 100644 index 000000000000..59334d2c933d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesDemoteMasterRequest.java @@ -0,0 +1,708 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database demote primary instance request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesDemoteMasterRequest} + */ +@com.google.protobuf.Generated +public final class InstancesDemoteMasterRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesDemoteMasterRequest) + InstancesDemoteMasterRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesDemoteMasterRequest"); + } + + // Use InstancesDemoteMasterRequest.newBuilder() to construct. + private InstancesDemoteMasterRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesDemoteMasterRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesDemoteMasterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesDemoteMasterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.class, + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.Builder.class); + } + + private int bitField0_; + public static final int DEMOTE_MASTER_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.DemoteMasterContext demoteMasterContext_; + + /** + * + * + *
+   * Contains details about the demoteMaster operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + * + * @return Whether the demoteMasterContext field is set. + */ + @java.lang.Override + public boolean hasDemoteMasterContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Contains details about the demoteMaster operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + * + * @return The demoteMasterContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterContext getDemoteMasterContext() { + return demoteMasterContext_ == null + ? com.google.cloud.sql.v1beta4.DemoteMasterContext.getDefaultInstance() + : demoteMasterContext_; + } + + /** + * + * + *
+   * Contains details about the demoteMaster operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteMasterContextOrBuilder + getDemoteMasterContextOrBuilder() { + return demoteMasterContext_ == null + ? com.google.cloud.sql.v1beta4.DemoteMasterContext.getDefaultInstance() + : demoteMasterContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getDemoteMasterContext()); + } + 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, getDemoteMasterContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest other = + (com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest) obj; + + if (hasDemoteMasterContext() != other.hasDemoteMasterContext()) return false; + if (hasDemoteMasterContext()) { + if (!getDemoteMasterContext().equals(other.getDemoteMasterContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasDemoteMasterContext()) { + hash = (37 * hash) + DEMOTE_MASTER_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getDemoteMasterContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database demote primary instance request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesDemoteMasterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesDemoteMasterRequest) + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesDemoteMasterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesDemoteMasterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.class, + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetDemoteMasterContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + demoteMasterContext_ = null; + if (demoteMasterContextBuilder_ != null) { + demoteMasterContextBuilder_.dispose(); + demoteMasterContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesDemoteMasterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest build() { + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest buildPartial() { + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest result = + new com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.demoteMasterContext_ = + demoteMasterContextBuilder_ == null + ? demoteMasterContext_ + : demoteMasterContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest other) { + if (other == com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.getDefaultInstance()) + return this; + if (other.hasDemoteMasterContext()) { + mergeDemoteMasterContext(other.getDemoteMasterContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetDemoteMasterContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.DemoteMasterContext demoteMasterContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DemoteMasterContext, + com.google.cloud.sql.v1beta4.DemoteMasterContext.Builder, + com.google.cloud.sql.v1beta4.DemoteMasterContextOrBuilder> + demoteMasterContextBuilder_; + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + * + * @return Whether the demoteMasterContext field is set. + */ + public boolean hasDemoteMasterContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + * + * @return The demoteMasterContext. + */ + public com.google.cloud.sql.v1beta4.DemoteMasterContext getDemoteMasterContext() { + if (demoteMasterContextBuilder_ == null) { + return demoteMasterContext_ == null + ? com.google.cloud.sql.v1beta4.DemoteMasterContext.getDefaultInstance() + : demoteMasterContext_; + } else { + return demoteMasterContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + */ + public Builder setDemoteMasterContext(com.google.cloud.sql.v1beta4.DemoteMasterContext value) { + if (demoteMasterContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + demoteMasterContext_ = value; + } else { + demoteMasterContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + */ + public Builder setDemoteMasterContext( + com.google.cloud.sql.v1beta4.DemoteMasterContext.Builder builderForValue) { + if (demoteMasterContextBuilder_ == null) { + demoteMasterContext_ = builderForValue.build(); + } else { + demoteMasterContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + */ + public Builder mergeDemoteMasterContext( + com.google.cloud.sql.v1beta4.DemoteMasterContext value) { + if (demoteMasterContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && demoteMasterContext_ != null + && demoteMasterContext_ + != com.google.cloud.sql.v1beta4.DemoteMasterContext.getDefaultInstance()) { + getDemoteMasterContextBuilder().mergeFrom(value); + } else { + demoteMasterContext_ = value; + } + } else { + demoteMasterContextBuilder_.mergeFrom(value); + } + if (demoteMasterContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + */ + public Builder clearDemoteMasterContext() { + bitField0_ = (bitField0_ & ~0x00000001); + demoteMasterContext_ = null; + if (demoteMasterContextBuilder_ != null) { + demoteMasterContextBuilder_.dispose(); + demoteMasterContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + */ + public com.google.cloud.sql.v1beta4.DemoteMasterContext.Builder + getDemoteMasterContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetDemoteMasterContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + */ + public com.google.cloud.sql.v1beta4.DemoteMasterContextOrBuilder + getDemoteMasterContextOrBuilder() { + if (demoteMasterContextBuilder_ != null) { + return demoteMasterContextBuilder_.getMessageOrBuilder(); + } else { + return demoteMasterContext_ == null + ? com.google.cloud.sql.v1beta4.DemoteMasterContext.getDefaultInstance() + : demoteMasterContext_; + } + } + + /** + * + * + *
+     * Contains details about the demoteMaster operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DemoteMasterContext, + com.google.cloud.sql.v1beta4.DemoteMasterContext.Builder, + com.google.cloud.sql.v1beta4.DemoteMasterContextOrBuilder> + internalGetDemoteMasterContextFieldBuilder() { + if (demoteMasterContextBuilder_ == null) { + demoteMasterContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DemoteMasterContext, + com.google.cloud.sql.v1beta4.DemoteMasterContext.Builder, + com.google.cloud.sql.v1beta4.DemoteMasterContextOrBuilder>( + getDemoteMasterContext(), getParentForChildren(), isClean()); + demoteMasterContext_ = null; + } + return demoteMasterContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesDemoteMasterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesDemoteMasterRequest) + private static final com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest(); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesDemoteMasterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesDemoteMasterRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesDemoteMasterRequestOrBuilder.java new file mode 100644 index 000000000000..067e8f182fd7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesDemoteMasterRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesDemoteMasterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesDemoteMasterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Contains details about the demoteMaster operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + * + * @return Whether the demoteMasterContext field is set. + */ + boolean hasDemoteMasterContext(); + + /** + * + * + *
+   * Contains details about the demoteMaster operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + * + * @return The demoteMasterContext. + */ + com.google.cloud.sql.v1beta4.DemoteMasterContext getDemoteMasterContext(); + + /** + * + * + *
+   * Contains details about the demoteMaster operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.DemoteMasterContext demote_master_context = 1; + */ + com.google.cloud.sql.v1beta4.DemoteMasterContextOrBuilder getDemoteMasterContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesDemoteRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesDemoteRequest.java new file mode 100644 index 000000000000..698dc88dfeb6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesDemoteRequest.java @@ -0,0 +1,738 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * This request is used to demote an existing standalone instance to be a
+ * Cloud SQL read replica for an external database server.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesDemoteRequest} + */ +@com.google.protobuf.Generated +public final class InstancesDemoteRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesDemoteRequest) + InstancesDemoteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesDemoteRequest"); + } + + // Use InstancesDemoteRequest.newBuilder() to construct. + private InstancesDemoteRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesDemoteRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesDemoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesDemoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesDemoteRequest.class, + com.google.cloud.sql.v1beta4.InstancesDemoteRequest.Builder.class); + } + + private int bitField0_; + public static final int DEMOTE_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.DemoteContext demoteContext_; + + /** + * + * + *
+   * Required. This context is used to demote an existing standalone instance to
+   * be a Cloud SQL read replica for an external database server.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the demoteContext field is set. + */ + @java.lang.Override + public boolean hasDemoteContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. This context is used to demote an existing standalone instance to
+   * be a Cloud SQL read replica for an external database server.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The demoteContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteContext getDemoteContext() { + return demoteContext_ == null + ? com.google.cloud.sql.v1beta4.DemoteContext.getDefaultInstance() + : demoteContext_; + } + + /** + * + * + *
+   * Required. This context is used to demote an existing standalone instance to
+   * be a Cloud SQL read replica for an external database server.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DemoteContextOrBuilder getDemoteContextOrBuilder() { + return demoteContext_ == null + ? com.google.cloud.sql.v1beta4.DemoteContext.getDefaultInstance() + : demoteContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getDemoteContext()); + } + 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, getDemoteContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesDemoteRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesDemoteRequest other = + (com.google.cloud.sql.v1beta4.InstancesDemoteRequest) obj; + + if (hasDemoteContext() != other.hasDemoteContext()) return false; + if (hasDemoteContext()) { + if (!getDemoteContext().equals(other.getDemoteContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasDemoteContext()) { + hash = (37 * hash) + DEMOTE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getDemoteContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.InstancesDemoteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * This request is used to demote an existing standalone instance to be a
+   * Cloud SQL read replica for an external database server.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesDemoteRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesDemoteRequest) + com.google.cloud.sql.v1beta4.InstancesDemoteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesDemoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesDemoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesDemoteRequest.class, + com.google.cloud.sql.v1beta4.InstancesDemoteRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InstancesDemoteRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetDemoteContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + demoteContext_ = null; + if (demoteContextBuilder_ != null) { + demoteContextBuilder_.dispose(); + demoteContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesDemoteRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesDemoteRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesDemoteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesDemoteRequest build() { + com.google.cloud.sql.v1beta4.InstancesDemoteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesDemoteRequest buildPartial() { + com.google.cloud.sql.v1beta4.InstancesDemoteRequest result = + new com.google.cloud.sql.v1beta4.InstancesDemoteRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.InstancesDemoteRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.demoteContext_ = + demoteContextBuilder_ == null ? demoteContext_ : demoteContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesDemoteRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.InstancesDemoteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InstancesDemoteRequest other) { + if (other == com.google.cloud.sql.v1beta4.InstancesDemoteRequest.getDefaultInstance()) + return this; + if (other.hasDemoteContext()) { + mergeDemoteContext(other.getDemoteContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetDemoteContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.DemoteContext demoteContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DemoteContext, + com.google.cloud.sql.v1beta4.DemoteContext.Builder, + com.google.cloud.sql.v1beta4.DemoteContextOrBuilder> + demoteContextBuilder_; + + /** + * + * + *
+     * Required. This context is used to demote an existing standalone instance to
+     * be a Cloud SQL read replica for an external database server.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the demoteContext field is set. + */ + public boolean hasDemoteContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. This context is used to demote an existing standalone instance to
+     * be a Cloud SQL read replica for an external database server.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The demoteContext. + */ + public com.google.cloud.sql.v1beta4.DemoteContext getDemoteContext() { + if (demoteContextBuilder_ == null) { + return demoteContext_ == null + ? com.google.cloud.sql.v1beta4.DemoteContext.getDefaultInstance() + : demoteContext_; + } else { + return demoteContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. This context is used to demote an existing standalone instance to
+     * be a Cloud SQL read replica for an external database server.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDemoteContext(com.google.cloud.sql.v1beta4.DemoteContext value) { + if (demoteContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + demoteContext_ = value; + } else { + demoteContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. This context is used to demote an existing standalone instance to
+     * be a Cloud SQL read replica for an external database server.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDemoteContext( + com.google.cloud.sql.v1beta4.DemoteContext.Builder builderForValue) { + if (demoteContextBuilder_ == null) { + demoteContext_ = builderForValue.build(); + } else { + demoteContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. This context is used to demote an existing standalone instance to
+     * be a Cloud SQL read replica for an external database server.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDemoteContext(com.google.cloud.sql.v1beta4.DemoteContext value) { + if (demoteContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && demoteContext_ != null + && demoteContext_ != com.google.cloud.sql.v1beta4.DemoteContext.getDefaultInstance()) { + getDemoteContextBuilder().mergeFrom(value); + } else { + demoteContext_ = value; + } + } else { + demoteContextBuilder_.mergeFrom(value); + } + if (demoteContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. This context is used to demote an existing standalone instance to
+     * be a Cloud SQL read replica for an external database server.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDemoteContext() { + bitField0_ = (bitField0_ & ~0x00000001); + demoteContext_ = null; + if (demoteContextBuilder_ != null) { + demoteContextBuilder_.dispose(); + demoteContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. This context is used to demote an existing standalone instance to
+     * be a Cloud SQL read replica for an external database server.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.DemoteContext.Builder getDemoteContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetDemoteContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. This context is used to demote an existing standalone instance to
+     * be a Cloud SQL read replica for an external database server.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.DemoteContextOrBuilder getDemoteContextOrBuilder() { + if (demoteContextBuilder_ != null) { + return demoteContextBuilder_.getMessageOrBuilder(); + } else { + return demoteContext_ == null + ? com.google.cloud.sql.v1beta4.DemoteContext.getDefaultInstance() + : demoteContext_; + } + } + + /** + * + * + *
+     * Required. This context is used to demote an existing standalone instance to
+     * be a Cloud SQL read replica for an external database server.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DemoteContext, + com.google.cloud.sql.v1beta4.DemoteContext.Builder, + com.google.cloud.sql.v1beta4.DemoteContextOrBuilder> + internalGetDemoteContextFieldBuilder() { + if (demoteContextBuilder_ == null) { + demoteContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DemoteContext, + com.google.cloud.sql.v1beta4.DemoteContext.Builder, + com.google.cloud.sql.v1beta4.DemoteContextOrBuilder>( + getDemoteContext(), getParentForChildren(), isClean()); + demoteContext_ = null; + } + return demoteContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesDemoteRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesDemoteRequest) + private static final com.google.cloud.sql.v1beta4.InstancesDemoteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesDemoteRequest(); + } + + public static com.google.cloud.sql.v1beta4.InstancesDemoteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesDemoteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesDemoteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesDemoteRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesDemoteRequestOrBuilder.java new file mode 100644 index 000000000000..2499f1986631 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesDemoteRequestOrBuilder.java @@ -0,0 +1,74 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesDemoteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesDemoteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. This context is used to demote an existing standalone instance to
+   * be a Cloud SQL read replica for an external database server.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the demoteContext field is set. + */ + boolean hasDemoteContext(); + + /** + * + * + *
+   * Required. This context is used to demote an existing standalone instance to
+   * be a Cloud SQL read replica for an external database server.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The demoteContext. + */ + com.google.cloud.sql.v1beta4.DemoteContext getDemoteContext(); + + /** + * + * + *
+   * Required. This context is used to demote an existing standalone instance to
+   * be a Cloud SQL read replica for an external database server.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DemoteContext demote_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1beta4.DemoteContextOrBuilder getDemoteContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesExportRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesExportRequest.java new file mode 100644 index 000000000000..cebebaa618c9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesExportRequest.java @@ -0,0 +1,700 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance export request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesExportRequest} + */ +@com.google.protobuf.Generated +public final class InstancesExportRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesExportRequest) + InstancesExportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesExportRequest"); + } + + // Use InstancesExportRequest.newBuilder() to construct. + private InstancesExportRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesExportRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesExportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesExportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesExportRequest.class, + com.google.cloud.sql.v1beta4.InstancesExportRequest.Builder.class); + } + + private int bitField0_; + public static final int EXPORT_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.ExportContext exportContext_; + + /** + * + * + *
+   * Contains details about the export operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + * + * @return Whether the exportContext field is set. + */ + @java.lang.Override + public boolean hasExportContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Contains details about the export operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + * + * @return The exportContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext getExportContext() { + return exportContext_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.getDefaultInstance() + : exportContext_; + } + + /** + * + * + *
+   * Contains details about the export operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContextOrBuilder getExportContextOrBuilder() { + return exportContext_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.getDefaultInstance() + : exportContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getExportContext()); + } + 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, getExportContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesExportRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesExportRequest other = + (com.google.cloud.sql.v1beta4.InstancesExportRequest) obj; + + if (hasExportContext() != other.hasExportContext()) return false; + if (hasExportContext()) { + if (!getExportContext().equals(other.getExportContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasExportContext()) { + hash = (37 * hash) + EXPORT_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getExportContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesExportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesExportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesExportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesExportRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesExportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesExportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesExportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesExportRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesExportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesExportRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesExportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesExportRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.InstancesExportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance export request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesExportRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesExportRequest) + com.google.cloud.sql.v1beta4.InstancesExportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesExportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesExportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesExportRequest.class, + com.google.cloud.sql.v1beta4.InstancesExportRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InstancesExportRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetExportContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + exportContext_ = null; + if (exportContextBuilder_ != null) { + exportContextBuilder_.dispose(); + exportContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesExportRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesExportRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesExportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesExportRequest build() { + com.google.cloud.sql.v1beta4.InstancesExportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesExportRequest buildPartial() { + com.google.cloud.sql.v1beta4.InstancesExportRequest result = + new com.google.cloud.sql.v1beta4.InstancesExportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.InstancesExportRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.exportContext_ = + exportContextBuilder_ == null ? exportContext_ : exportContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesExportRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.InstancesExportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InstancesExportRequest other) { + if (other == com.google.cloud.sql.v1beta4.InstancesExportRequest.getDefaultInstance()) + return this; + if (other.hasExportContext()) { + mergeExportContext(other.getExportContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetExportContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.ExportContext exportContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext, + com.google.cloud.sql.v1beta4.ExportContext.Builder, + com.google.cloud.sql.v1beta4.ExportContextOrBuilder> + exportContextBuilder_; + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + * + * @return Whether the exportContext field is set. + */ + public boolean hasExportContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + * + * @return The exportContext. + */ + public com.google.cloud.sql.v1beta4.ExportContext getExportContext() { + if (exportContextBuilder_ == null) { + return exportContext_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.getDefaultInstance() + : exportContext_; + } else { + return exportContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + */ + public Builder setExportContext(com.google.cloud.sql.v1beta4.ExportContext value) { + if (exportContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + exportContext_ = value; + } else { + exportContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + */ + public Builder setExportContext( + com.google.cloud.sql.v1beta4.ExportContext.Builder builderForValue) { + if (exportContextBuilder_ == null) { + exportContext_ = builderForValue.build(); + } else { + exportContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + */ + public Builder mergeExportContext(com.google.cloud.sql.v1beta4.ExportContext value) { + if (exportContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && exportContext_ != null + && exportContext_ != com.google.cloud.sql.v1beta4.ExportContext.getDefaultInstance()) { + getExportContextBuilder().mergeFrom(value); + } else { + exportContext_ = value; + } + } else { + exportContextBuilder_.mergeFrom(value); + } + if (exportContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + */ + public Builder clearExportContext() { + bitField0_ = (bitField0_ & ~0x00000001); + exportContext_ = null; + if (exportContextBuilder_ != null) { + exportContextBuilder_.dispose(); + exportContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + */ + public com.google.cloud.sql.v1beta4.ExportContext.Builder getExportContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetExportContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + */ + public com.google.cloud.sql.v1beta4.ExportContextOrBuilder getExportContextOrBuilder() { + if (exportContextBuilder_ != null) { + return exportContextBuilder_.getMessageOrBuilder(); + } else { + return exportContext_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.getDefaultInstance() + : exportContext_; + } + } + + /** + * + * + *
+     * Contains details about the export operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext, + com.google.cloud.sql.v1beta4.ExportContext.Builder, + com.google.cloud.sql.v1beta4.ExportContextOrBuilder> + internalGetExportContextFieldBuilder() { + if (exportContextBuilder_ == null) { + exportContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext, + com.google.cloud.sql.v1beta4.ExportContext.Builder, + com.google.cloud.sql.v1beta4.ExportContextOrBuilder>( + getExportContext(), getParentForChildren(), isClean()); + exportContext_ = null; + } + return exportContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesExportRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesExportRequest) + private static final com.google.cloud.sql.v1beta4.InstancesExportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesExportRequest(); + } + + public static com.google.cloud.sql.v1beta4.InstancesExportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesExportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesExportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesExportRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesExportRequestOrBuilder.java new file mode 100644 index 000000000000..4910a89c006d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesExportRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesExportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesExportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Contains details about the export operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + * + * @return Whether the exportContext field is set. + */ + boolean hasExportContext(); + + /** + * + * + *
+   * Contains details about the export operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + * + * @return The exportContext. + */ + com.google.cloud.sql.v1beta4.ExportContext getExportContext(); + + /** + * + * + *
+   * Contains details about the export operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 1; + */ + com.google.cloud.sql.v1beta4.ExportContextOrBuilder getExportContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesFailoverRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesFailoverRequest.java new file mode 100644 index 000000000000..df5446b9443f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesFailoverRequest.java @@ -0,0 +1,702 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance failover request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesFailoverRequest} + */ +@com.google.protobuf.Generated +public final class InstancesFailoverRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesFailoverRequest) + InstancesFailoverRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesFailoverRequest"); + } + + // Use InstancesFailoverRequest.newBuilder() to construct. + private InstancesFailoverRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesFailoverRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesFailoverRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesFailoverRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesFailoverRequest.class, + com.google.cloud.sql.v1beta4.InstancesFailoverRequest.Builder.class); + } + + private int bitField0_; + public static final int FAILOVER_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.FailoverContext failoverContext_; + + /** + * + * + *
+   * Failover Context.
+   * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + * + * @return Whether the failoverContext field is set. + */ + @java.lang.Override + public boolean hasFailoverContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Failover Context.
+   * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + * + * @return The failoverContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.FailoverContext getFailoverContext() { + return failoverContext_ == null + ? com.google.cloud.sql.v1beta4.FailoverContext.getDefaultInstance() + : failoverContext_; + } + + /** + * + * + *
+   * Failover Context.
+   * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.FailoverContextOrBuilder getFailoverContextOrBuilder() { + return failoverContext_ == null + ? com.google.cloud.sql.v1beta4.FailoverContext.getDefaultInstance() + : failoverContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getFailoverContext()); + } + 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, getFailoverContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesFailoverRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesFailoverRequest other = + (com.google.cloud.sql.v1beta4.InstancesFailoverRequest) obj; + + if (hasFailoverContext() != other.hasFailoverContext()) return false; + if (hasFailoverContext()) { + if (!getFailoverContext().equals(other.getFailoverContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasFailoverContext()) { + hash = (37 * hash) + FAILOVER_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getFailoverContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesFailoverRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesFailoverRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesFailoverRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesFailoverRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesFailoverRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesFailoverRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesFailoverRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesFailoverRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesFailoverRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesFailoverRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesFailoverRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesFailoverRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.InstancesFailoverRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance failover request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesFailoverRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesFailoverRequest) + com.google.cloud.sql.v1beta4.InstancesFailoverRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesFailoverRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesFailoverRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesFailoverRequest.class, + com.google.cloud.sql.v1beta4.InstancesFailoverRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InstancesFailoverRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetFailoverContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + failoverContext_ = null; + if (failoverContextBuilder_ != null) { + failoverContextBuilder_.dispose(); + failoverContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesFailoverRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesFailoverRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesFailoverRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesFailoverRequest build() { + com.google.cloud.sql.v1beta4.InstancesFailoverRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesFailoverRequest buildPartial() { + com.google.cloud.sql.v1beta4.InstancesFailoverRequest result = + new com.google.cloud.sql.v1beta4.InstancesFailoverRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.InstancesFailoverRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.failoverContext_ = + failoverContextBuilder_ == null ? failoverContext_ : failoverContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesFailoverRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.InstancesFailoverRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InstancesFailoverRequest other) { + if (other == com.google.cloud.sql.v1beta4.InstancesFailoverRequest.getDefaultInstance()) + return this; + if (other.hasFailoverContext()) { + mergeFailoverContext(other.getFailoverContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetFailoverContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.FailoverContext failoverContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.FailoverContext, + com.google.cloud.sql.v1beta4.FailoverContext.Builder, + com.google.cloud.sql.v1beta4.FailoverContextOrBuilder> + failoverContextBuilder_; + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + * + * @return Whether the failoverContext field is set. + */ + public boolean hasFailoverContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + * + * @return The failoverContext. + */ + public com.google.cloud.sql.v1beta4.FailoverContext getFailoverContext() { + if (failoverContextBuilder_ == null) { + return failoverContext_ == null + ? com.google.cloud.sql.v1beta4.FailoverContext.getDefaultInstance() + : failoverContext_; + } else { + return failoverContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + */ + public Builder setFailoverContext(com.google.cloud.sql.v1beta4.FailoverContext value) { + if (failoverContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + failoverContext_ = value; + } else { + failoverContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + */ + public Builder setFailoverContext( + com.google.cloud.sql.v1beta4.FailoverContext.Builder builderForValue) { + if (failoverContextBuilder_ == null) { + failoverContext_ = builderForValue.build(); + } else { + failoverContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + */ + public Builder mergeFailoverContext(com.google.cloud.sql.v1beta4.FailoverContext value) { + if (failoverContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && failoverContext_ != null + && failoverContext_ + != com.google.cloud.sql.v1beta4.FailoverContext.getDefaultInstance()) { + getFailoverContextBuilder().mergeFrom(value); + } else { + failoverContext_ = value; + } + } else { + failoverContextBuilder_.mergeFrom(value); + } + if (failoverContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + */ + public Builder clearFailoverContext() { + bitField0_ = (bitField0_ & ~0x00000001); + failoverContext_ = null; + if (failoverContextBuilder_ != null) { + failoverContextBuilder_.dispose(); + failoverContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + */ + public com.google.cloud.sql.v1beta4.FailoverContext.Builder getFailoverContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetFailoverContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + */ + public com.google.cloud.sql.v1beta4.FailoverContextOrBuilder getFailoverContextOrBuilder() { + if (failoverContextBuilder_ != null) { + return failoverContextBuilder_.getMessageOrBuilder(); + } else { + return failoverContext_ == null + ? com.google.cloud.sql.v1beta4.FailoverContext.getDefaultInstance() + : failoverContext_; + } + } + + /** + * + * + *
+     * Failover Context.
+     * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.FailoverContext, + com.google.cloud.sql.v1beta4.FailoverContext.Builder, + com.google.cloud.sql.v1beta4.FailoverContextOrBuilder> + internalGetFailoverContextFieldBuilder() { + if (failoverContextBuilder_ == null) { + failoverContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.FailoverContext, + com.google.cloud.sql.v1beta4.FailoverContext.Builder, + com.google.cloud.sql.v1beta4.FailoverContextOrBuilder>( + getFailoverContext(), getParentForChildren(), isClean()); + failoverContext_ = null; + } + return failoverContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesFailoverRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesFailoverRequest) + private static final com.google.cloud.sql.v1beta4.InstancesFailoverRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesFailoverRequest(); + } + + public static com.google.cloud.sql.v1beta4.InstancesFailoverRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesFailoverRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesFailoverRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesFailoverRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesFailoverRequestOrBuilder.java new file mode 100644 index 000000000000..01a127e7df5f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesFailoverRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesFailoverRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesFailoverRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Failover Context.
+   * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + * + * @return Whether the failoverContext field is set. + */ + boolean hasFailoverContext(); + + /** + * + * + *
+   * Failover Context.
+   * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + * + * @return The failoverContext. + */ + com.google.cloud.sql.v1beta4.FailoverContext getFailoverContext(); + + /** + * + * + *
+   * Failover Context.
+   * 
+ * + * .google.cloud.sql.v1beta4.FailoverContext failover_context = 1; + */ + com.google.cloud.sql.v1beta4.FailoverContextOrBuilder getFailoverContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesImportRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesImportRequest.java new file mode 100644 index 000000000000..f1f6ab6e1df3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesImportRequest.java @@ -0,0 +1,700 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance import request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesImportRequest} + */ +@com.google.protobuf.Generated +public final class InstancesImportRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesImportRequest) + InstancesImportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesImportRequest"); + } + + // Use InstancesImportRequest.newBuilder() to construct. + private InstancesImportRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesImportRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesImportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesImportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesImportRequest.class, + com.google.cloud.sql.v1beta4.InstancesImportRequest.Builder.class); + } + + private int bitField0_; + public static final int IMPORT_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.ImportContext importContext_; + + /** + * + * + *
+   * Contains details about the import operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + * + * @return Whether the importContext field is set. + */ + @java.lang.Override + public boolean hasImportContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Contains details about the import operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + * + * @return The importContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext getImportContext() { + return importContext_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.getDefaultInstance() + : importContext_; + } + + /** + * + * + *
+   * Contains details about the import operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContextOrBuilder getImportContextOrBuilder() { + return importContext_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.getDefaultInstance() + : importContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getImportContext()); + } + 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, getImportContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesImportRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesImportRequest other = + (com.google.cloud.sql.v1beta4.InstancesImportRequest) obj; + + if (hasImportContext() != other.hasImportContext()) return false; + if (hasImportContext()) { + if (!getImportContext().equals(other.getImportContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasImportContext()) { + hash = (37 * hash) + IMPORT_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getImportContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesImportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesImportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesImportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesImportRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesImportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesImportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesImportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesImportRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesImportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesImportRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesImportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesImportRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.InstancesImportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance import request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesImportRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesImportRequest) + com.google.cloud.sql.v1beta4.InstancesImportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesImportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesImportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesImportRequest.class, + com.google.cloud.sql.v1beta4.InstancesImportRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InstancesImportRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetImportContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + importContext_ = null; + if (importContextBuilder_ != null) { + importContextBuilder_.dispose(); + importContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesImportRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesImportRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesImportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesImportRequest build() { + com.google.cloud.sql.v1beta4.InstancesImportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesImportRequest buildPartial() { + com.google.cloud.sql.v1beta4.InstancesImportRequest result = + new com.google.cloud.sql.v1beta4.InstancesImportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.InstancesImportRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.importContext_ = + importContextBuilder_ == null ? importContext_ : importContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesImportRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.InstancesImportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InstancesImportRequest other) { + if (other == com.google.cloud.sql.v1beta4.InstancesImportRequest.getDefaultInstance()) + return this; + if (other.hasImportContext()) { + mergeImportContext(other.getImportContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetImportContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.ImportContext importContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext, + com.google.cloud.sql.v1beta4.ImportContext.Builder, + com.google.cloud.sql.v1beta4.ImportContextOrBuilder> + importContextBuilder_; + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + * + * @return Whether the importContext field is set. + */ + public boolean hasImportContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + * + * @return The importContext. + */ + public com.google.cloud.sql.v1beta4.ImportContext getImportContext() { + if (importContextBuilder_ == null) { + return importContext_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.getDefaultInstance() + : importContext_; + } else { + return importContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + */ + public Builder setImportContext(com.google.cloud.sql.v1beta4.ImportContext value) { + if (importContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + importContext_ = value; + } else { + importContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + */ + public Builder setImportContext( + com.google.cloud.sql.v1beta4.ImportContext.Builder builderForValue) { + if (importContextBuilder_ == null) { + importContext_ = builderForValue.build(); + } else { + importContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + */ + public Builder mergeImportContext(com.google.cloud.sql.v1beta4.ImportContext value) { + if (importContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && importContext_ != null + && importContext_ != com.google.cloud.sql.v1beta4.ImportContext.getDefaultInstance()) { + getImportContextBuilder().mergeFrom(value); + } else { + importContext_ = value; + } + } else { + importContextBuilder_.mergeFrom(value); + } + if (importContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + */ + public Builder clearImportContext() { + bitField0_ = (bitField0_ & ~0x00000001); + importContext_ = null; + if (importContextBuilder_ != null) { + importContextBuilder_.dispose(); + importContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + */ + public com.google.cloud.sql.v1beta4.ImportContext.Builder getImportContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetImportContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + */ + public com.google.cloud.sql.v1beta4.ImportContextOrBuilder getImportContextOrBuilder() { + if (importContextBuilder_ != null) { + return importContextBuilder_.getMessageOrBuilder(); + } else { + return importContext_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.getDefaultInstance() + : importContext_; + } + } + + /** + * + * + *
+     * Contains details about the import operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext, + com.google.cloud.sql.v1beta4.ImportContext.Builder, + com.google.cloud.sql.v1beta4.ImportContextOrBuilder> + internalGetImportContextFieldBuilder() { + if (importContextBuilder_ == null) { + importContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext, + com.google.cloud.sql.v1beta4.ImportContext.Builder, + com.google.cloud.sql.v1beta4.ImportContextOrBuilder>( + getImportContext(), getParentForChildren(), isClean()); + importContext_ = null; + } + return importContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesImportRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesImportRequest) + private static final com.google.cloud.sql.v1beta4.InstancesImportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesImportRequest(); + } + + public static com.google.cloud.sql.v1beta4.InstancesImportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesImportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesImportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesImportRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesImportRequestOrBuilder.java new file mode 100644 index 000000000000..7491bc3b1258 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesImportRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesImportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesImportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Contains details about the import operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + * + * @return Whether the importContext field is set. + */ + boolean hasImportContext(); + + /** + * + * + *
+   * Contains details about the import operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + * + * @return The importContext. + */ + com.google.cloud.sql.v1beta4.ImportContext getImportContext(); + + /** + * + * + *
+   * Contains details about the import operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 1; + */ + com.google.cloud.sql.v1beta4.ImportContextOrBuilder getImportContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListEntraIdCertificatesResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListEntraIdCertificatesResponse.java new file mode 100644 index 000000000000..54badf218873 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListEntraIdCertificatesResponse.java @@ -0,0 +1,1313 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instances ListEntraIdCertificates response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse} + */ +@com.google.protobuf.Generated +public final class InstancesListEntraIdCertificatesResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse) + InstancesListEntraIdCertificatesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesListEntraIdCertificatesResponse"); + } + + // Use InstancesListEntraIdCertificatesResponse.newBuilder() to construct. + private InstancesListEntraIdCertificatesResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesListEntraIdCertificatesResponse() { + certs_ = java.util.Collections.emptyList(); + activeVersion_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListEntraIdCertificatesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListEntraIdCertificatesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse.class, + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse.Builder.class); + } + + public static final int CERTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List certs_; + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + @java.lang.Override + public java.util.List getCertsList() { + return certs_; + } + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + @java.lang.Override + public java.util.List + getCertsOrBuilderList() { + return certs_; + } + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + @java.lang.Override + public int getCertsCount() { + return certs_.size(); + } + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCert getCerts(int index) { + return certs_.get(index); + } + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getCertsOrBuilder(int index) { + return certs_.get(index); + } + + public static final int ACTIVE_VERSION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object activeVersion_ = ""; + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `certs`.
+   * 
+ * + * string active_version = 2; + * + * @return The activeVersion. + */ + @java.lang.Override + public java.lang.String getActiveVersion() { + java.lang.Object ref = activeVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `certs`.
+   * 
+ * + * string active_version = 2; + * + * @return The bytes for activeVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getActiveVersionBytes() { + java.lang.Object ref = activeVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#instancesListEntraIdCertificates`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#instancesListEntraIdCertificates`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < certs_.size(); i++) { + output.writeMessage(1, certs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(activeVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, activeVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < certs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, certs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(activeVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, activeVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse other = + (com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse) obj; + + if (!getCertsList().equals(other.getCertsList())) return false; + if (!getActiveVersion().equals(other.getActiveVersion())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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 (getCertsCount() > 0) { + hash = (37 * hash) + CERTS_FIELD_NUMBER; + hash = (53 * hash) + getCertsList().hashCode(); + } + hash = (37 * hash) + ACTIVE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getActiveVersion().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instances ListEntraIdCertificates response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse) + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListEntraIdCertificatesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListEntraIdCertificatesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse.class, + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (certsBuilder_ == null) { + certs_ = java.util.Collections.emptyList(); + } else { + certs_ = null; + certsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + activeVersion_ = ""; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListEntraIdCertificatesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse build() { + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse buildPartial() { + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse result = + new com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse result) { + if (certsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + certs_ = java.util.Collections.unmodifiableList(certs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.certs_ = certs_; + } else { + result.certs_ = certsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.activeVersion_ = activeVersion_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse other) { + if (other + == com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse + .getDefaultInstance()) return this; + if (certsBuilder_ == null) { + if (!other.certs_.isEmpty()) { + if (certs_.isEmpty()) { + certs_ = other.certs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCertsIsMutable(); + certs_.addAll(other.certs_); + } + onChanged(); + } + } else { + if (!other.certs_.isEmpty()) { + if (certsBuilder_.isEmpty()) { + certsBuilder_.dispose(); + certsBuilder_ = null; + certs_ = other.certs_; + bitField0_ = (bitField0_ & ~0x00000001); + certsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetCertsFieldBuilder() + : null; + } else { + certsBuilder_.addAllMessages(other.certs_); + } + } + } + if (!other.getActiveVersion().isEmpty()) { + activeVersion_ = other.activeVersion_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + com.google.cloud.sql.v1beta4.SslCert m = + input.readMessage( + com.google.cloud.sql.v1beta4.SslCert.parser(), extensionRegistry); + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.add(m); + } else { + certsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + activeVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List certs_ = + java.util.Collections.emptyList(); + + private void ensureCertsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + certs_ = new java.util.ArrayList(certs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + certsBuilder_; + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public java.util.List getCertsList() { + if (certsBuilder_ == null) { + return java.util.Collections.unmodifiableList(certs_); + } else { + return certsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public int getCertsCount() { + if (certsBuilder_ == null) { + return certs_.size(); + } else { + return certsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCert getCerts(int index) { + if (certsBuilder_ == null) { + return certs_.get(index); + } else { + return certsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder setCerts(int index, com.google.cloud.sql.v1beta4.SslCert value) { + if (certsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertsIsMutable(); + certs_.set(index, value); + onChanged(); + } else { + certsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder setCerts( + int index, com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.set(index, builderForValue.build()); + onChanged(); + } else { + certsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder addCerts(com.google.cloud.sql.v1beta4.SslCert value) { + if (certsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertsIsMutable(); + certs_.add(value); + onChanged(); + } else { + certsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder addCerts(int index, com.google.cloud.sql.v1beta4.SslCert value) { + if (certsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertsIsMutable(); + certs_.add(index, value); + onChanged(); + } else { + certsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder addCerts(com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.add(builderForValue.build()); + onChanged(); + } else { + certsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder addCerts( + int index, com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.add(index, builderForValue.build()); + onChanged(); + } else { + certsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder addAllCerts( + java.lang.Iterable values) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, certs_); + onChanged(); + } else { + certsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder clearCerts() { + if (certsBuilder_ == null) { + certs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + certsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder removeCerts(int index) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.remove(index); + onChanged(); + } else { + certsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder getCertsBuilder(int index) { + return internalGetCertsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getCertsOrBuilder(int index) { + if (certsBuilder_ == null) { + return certs_.get(index); + } else { + return certsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public java.util.List + getCertsOrBuilderList() { + if (certsBuilder_ != null) { + return certsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(certs_); + } + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder addCertsBuilder() { + return internalGetCertsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder addCertsBuilder(int index) { + return internalGetCertsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of Entra ID certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public java.util.List getCertsBuilderList() { + return internalGetCertsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + internalGetCertsFieldBuilder() { + if (certsBuilder_ == null) { + certsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder>( + certs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + certs_ = null; + } + return certsBuilder_; + } + + private java.lang.Object activeVersion_ = ""; + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `certs`.
+     * 
+ * + * string active_version = 2; + * + * @return The activeVersion. + */ + public java.lang.String getActiveVersion() { + java.lang.Object ref = activeVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `certs`.
+     * 
+ * + * string active_version = 2; + * + * @return The bytes for activeVersion. + */ + public com.google.protobuf.ByteString getActiveVersionBytes() { + java.lang.Object ref = activeVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `certs`.
+     * 
+ * + * string active_version = 2; + * + * @param value The activeVersion to set. + * @return This builder for chaining. + */ + public Builder setActiveVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + activeVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `certs`.
+     * 
+ * + * string active_version = 2; + * + * @return This builder for chaining. + */ + public Builder clearActiveVersion() { + activeVersion_ = getDefaultInstance().getActiveVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `certs`.
+     * 
+ * + * string active_version = 2; + * + * @param value The bytes for activeVersion to set. + * @return This builder for chaining. + */ + public Builder setActiveVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + activeVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#instancesListEntraIdCertificates`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesListEntraIdCertificates`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesListEntraIdCertificates`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesListEntraIdCertificates`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesListEntraIdCertificates`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse) + private static final com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse(); + } + + public static com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesListEntraIdCertificatesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListEntraIdCertificatesResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListEntraIdCertificatesResponseOrBuilder.java new file mode 100644 index 000000000000..d37aea455627 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListEntraIdCertificatesResponseOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesListEntraIdCertificatesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + java.util.List getCertsList(); + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + com.google.cloud.sql.v1beta4.SslCert getCerts(int index); + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + int getCertsCount(); + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + java.util.List getCertsOrBuilderList(); + + /** + * + * + *
+   * List of Entra ID certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + com.google.cloud.sql.v1beta4.SslCertOrBuilder getCertsOrBuilder(int index); + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `certs`.
+   * 
+ * + * string active_version = 2; + * + * @return The activeVersion. + */ + java.lang.String getActiveVersion(); + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `certs`.
+   * 
+ * + * string active_version = 2; + * + * @return The bytes for activeVersion. + */ + com.google.protobuf.ByteString getActiveVersionBytes(); + + /** + * + * + *
+   * This is always `sql#instancesListEntraIdCertificates`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#instancesListEntraIdCertificates`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListResponse.java new file mode 100644 index 000000000000..b120a081b8a5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListResponse.java @@ -0,0 +1,1817 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instances list response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesListResponse} + */ +@com.google.protobuf.Generated +public final class InstancesListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesListResponse) + InstancesListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesListResponse"); + } + + // Use InstancesListResponse.newBuilder() to construct. + private InstancesListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesListResponse() { + kind_ = ""; + warnings_ = java.util.Collections.emptyList(); + items_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesListResponse.class, + com.google.cloud.sql.v1beta4.InstancesListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#instancesList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#instancesList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WARNINGS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List warnings_; + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + @java.lang.Override + public java.util.List getWarningsList() { + return warnings_; + } + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + @java.lang.Override + public java.util.List + getWarningsOrBuilderList() { + return warnings_; + } + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + @java.lang.Override + public int getWarningsCount() { + return warnings_.size(); + } + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ApiWarning getWarnings(int index) { + return warnings_.get(index); + } + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ApiWarningOrBuilder getWarningsOrBuilder(int index) { + return warnings_.get(index); + } + + public static final int ITEMS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 4; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 4; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < warnings_.size(); i++) { + output.writeMessage(2, warnings_.get(i)); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(3, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < warnings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, warnings_.get(i)); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesListResponse other = + (com.google.cloud.sql.v1beta4.InstancesListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getWarningsList().equals(other.getWarningsList())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getWarningsCount() > 0) { + hash = (37 * hash) + WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + getWarningsList().hashCode(); + } + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesListResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.InstancesListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instances list response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesListResponse) + com.google.cloud.sql.v1beta4.InstancesListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesListResponse.class, + com.google.cloud.sql.v1beta4.InstancesListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InstancesListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (warningsBuilder_ == null) { + warnings_ = java.util.Collections.emptyList(); + } else { + warnings_ = null; + warningsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListResponse build() { + com.google.cloud.sql.v1beta4.InstancesListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListResponse buildPartial() { + com.google.cloud.sql.v1beta4.InstancesListResponse result = + new com.google.cloud.sql.v1beta4.InstancesListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.InstancesListResponse result) { + if (warningsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + warnings_ = java.util.Collections.unmodifiableList(warnings_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.warnings_ = warnings_; + } else { + result.warnings_ = warningsBuilder_.build(); + } + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.InstancesListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesListResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.InstancesListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InstancesListResponse other) { + if (other == com.google.cloud.sql.v1beta4.InstancesListResponse.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (warningsBuilder_ == null) { + if (!other.warnings_.isEmpty()) { + if (warnings_.isEmpty()) { + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureWarningsIsMutable(); + warnings_.addAll(other.warnings_); + } + onChanged(); + } + } else { + if (!other.warnings_.isEmpty()) { + if (warningsBuilder_.isEmpty()) { + warningsBuilder_.dispose(); + warningsBuilder_ = null; + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000002); + warningsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetWarningsFieldBuilder() + : null; + } else { + warningsBuilder_.addAllMessages(other.warnings_); + } + } + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000004); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1beta4.ApiWarning m = + input.readMessage( + com.google.cloud.sql.v1beta4.ApiWarning.parser(), extensionRegistry); + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(m); + } else { + warningsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + com.google.cloud.sql.v1beta4.DatabaseInstance m = + input.readMessage( + com.google.cloud.sql.v1beta4.DatabaseInstance.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + nextPageToken_ = 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#instancesList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List warnings_ = + java.util.Collections.emptyList(); + + private void ensureWarningsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + warnings_ = new java.util.ArrayList(warnings_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ApiWarning, + com.google.cloud.sql.v1beta4.ApiWarning.Builder, + com.google.cloud.sql.v1beta4.ApiWarningOrBuilder> + warningsBuilder_; + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public java.util.List getWarningsList() { + if (warningsBuilder_ == null) { + return java.util.Collections.unmodifiableList(warnings_); + } else { + return warningsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public int getWarningsCount() { + if (warningsBuilder_ == null) { + return warnings_.size(); + } else { + return warningsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public com.google.cloud.sql.v1beta4.ApiWarning getWarnings(int index) { + if (warningsBuilder_ == null) { + return warnings_.get(index); + } else { + return warningsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public Builder setWarnings(int index, com.google.cloud.sql.v1beta4.ApiWarning value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.set(index, value); + onChanged(); + } else { + warningsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public Builder setWarnings( + int index, com.google.cloud.sql.v1beta4.ApiWarning.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.set(index, builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public Builder addWarnings(com.google.cloud.sql.v1beta4.ApiWarning value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(value); + onChanged(); + } else { + warningsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public Builder addWarnings(int index, com.google.cloud.sql.v1beta4.ApiWarning value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(index, value); + onChanged(); + } else { + warningsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public Builder addWarnings(com.google.cloud.sql.v1beta4.ApiWarning.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public Builder addWarnings( + int index, com.google.cloud.sql.v1beta4.ApiWarning.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(index, builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public Builder addAllWarnings( + java.lang.Iterable values) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, warnings_); + onChanged(); + } else { + warningsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public Builder clearWarnings() { + if (warningsBuilder_ == null) { + warnings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + warningsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public Builder removeWarnings(int index) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.remove(index); + onChanged(); + } else { + warningsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public com.google.cloud.sql.v1beta4.ApiWarning.Builder getWarningsBuilder(int index) { + return internalGetWarningsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public com.google.cloud.sql.v1beta4.ApiWarningOrBuilder getWarningsOrBuilder(int index) { + if (warningsBuilder_ == null) { + return warnings_.get(index); + } else { + return warningsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public java.util.List + getWarningsOrBuilderList() { + if (warningsBuilder_ != null) { + return warningsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(warnings_); + } + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public com.google.cloud.sql.v1beta4.ApiWarning.Builder addWarningsBuilder() { + return internalGetWarningsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.ApiWarning.getDefaultInstance()); + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public com.google.cloud.sql.v1beta4.ApiWarning.Builder addWarningsBuilder(int index) { + return internalGetWarningsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.ApiWarning.getDefaultInstance()); + } + + /** + * + * + *
+     * List of warnings that occurred while handling the request.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + public java.util.List + getWarningsBuilderList() { + return internalGetWarningsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ApiWarning, + com.google.cloud.sql.v1beta4.ApiWarning.Builder, + com.google.cloud.sql.v1beta4.ApiWarningOrBuilder> + internalGetWarningsFieldBuilder() { + if (warningsBuilder_ == null) { + warningsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ApiWarning, + com.google.cloud.sql.v1beta4.ApiWarning.Builder, + com.google.cloud.sql.v1beta4.ApiWarningOrBuilder>( + warnings_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + warnings_ = null; + } + return warningsBuilder_; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public Builder setItems(int index, com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public Builder setItems( + int index, com.google.cloud.sql.v1beta4.DatabaseInstance.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public Builder addItems(int index, com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.DatabaseInstance.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public Builder addItems( + int index, com.google.cloud.sql.v1beta4.DatabaseInstance.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance()); + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance()); + } + + /** + * + * + *
+     * List of database instance resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + public java.util.List + getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder>( + items_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 4; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 4; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 4; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 4; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesListResponse) + private static final com.google.cloud.sql.v1beta4.InstancesListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesListResponse(); + } + + public static com.google.cloud.sql.v1beta4.InstancesListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListResponseOrBuilder.java new file mode 100644 index 000000000000..b8b1c7aaf135 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListResponseOrBuilder.java @@ -0,0 +1,194 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#instancesList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#instancesList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + java.util.List getWarningsList(); + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + com.google.cloud.sql.v1beta4.ApiWarning getWarnings(int index); + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + int getWarningsCount(); + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + java.util.List + getWarningsOrBuilderList(); + + /** + * + * + *
+   * List of warnings that occurred while handling the request.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 2; + */ + com.google.cloud.sql.v1beta4.ApiWarningOrBuilder getWarningsOrBuilder(int index); + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + com.google.cloud.sql.v1beta4.DatabaseInstance getItems(int index); + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + int getItemsCount(); + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + java.util.List + getItemsOrBuilderList(); + + /** + * + * + *
+   * List of database instance resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseInstance items = 3; + */ + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getItemsOrBuilder(int index); + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 4; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 4; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListServerCasResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListServerCasResponse.java new file mode 100644 index 000000000000..84e1d5fead0a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListServerCasResponse.java @@ -0,0 +1,1258 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instances ListServerCas response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesListServerCasResponse} + */ +@com.google.protobuf.Generated +public final class InstancesListServerCasResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesListServerCasResponse) + InstancesListServerCasResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesListServerCasResponse"); + } + + // Use InstancesListServerCasResponse.newBuilder() to construct. + private InstancesListServerCasResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesListServerCasResponse() { + certs_ = java.util.Collections.emptyList(); + activeVersion_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListServerCasResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListServerCasResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse.class, + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse.Builder.class); + } + + public static final int CERTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List certs_; + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + @java.lang.Override + public java.util.List getCertsList() { + return certs_; + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + @java.lang.Override + public java.util.List + getCertsOrBuilderList() { + return certs_; + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + @java.lang.Override + public int getCertsCount() { + return certs_.size(); + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCert getCerts(int index) { + return certs_.get(index); + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getCertsOrBuilder(int index) { + return certs_.get(index); + } + + public static final int ACTIVE_VERSION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object activeVersion_ = ""; + + /** + * string active_version = 2; + * + * @return The activeVersion. + */ + @java.lang.Override + public java.lang.String getActiveVersion() { + java.lang.Object ref = activeVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeVersion_ = s; + return s; + } + } + + /** + * string active_version = 2; + * + * @return The bytes for activeVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getActiveVersionBytes() { + java.lang.Object ref = activeVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#instancesListServerCas`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#instancesListServerCas`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < certs_.size(); i++) { + output.writeMessage(1, certs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(activeVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, activeVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < certs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, certs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(activeVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, activeVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesListServerCasResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse other = + (com.google.cloud.sql.v1beta4.InstancesListServerCasResponse) obj; + + if (!getCertsList().equals(other.getCertsList())) return false; + if (!getActiveVersion().equals(other.getActiveVersion())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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 (getCertsCount() > 0) { + hash = (37 * hash) + CERTS_FIELD_NUMBER; + hash = (53 * hash) + getCertsList().hashCode(); + } + hash = (37 * hash) + ACTIVE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getActiveVersion().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCasResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCasResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCasResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCasResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCasResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCasResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCasResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCasResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCasResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCasResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCasResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCasResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instances ListServerCas response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesListServerCasResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesListServerCasResponse) + com.google.cloud.sql.v1beta4.InstancesListServerCasResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListServerCasResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListServerCasResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse.class, + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InstancesListServerCasResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (certsBuilder_ == null) { + certs_ = java.util.Collections.emptyList(); + } else { + certs_ = null; + certsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + activeVersion_ = ""; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListServerCasResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListServerCasResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesListServerCasResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListServerCasResponse build() { + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListServerCasResponse buildPartial() { + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse result = + new com.google.cloud.sql.v1beta4.InstancesListServerCasResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.InstancesListServerCasResponse result) { + if (certsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + certs_ = java.util.Collections.unmodifiableList(certs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.certs_ = certs_; + } else { + result.certs_ = certsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.InstancesListServerCasResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.activeVersion_ = activeVersion_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesListServerCasResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.InstancesListServerCasResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InstancesListServerCasResponse other) { + if (other == com.google.cloud.sql.v1beta4.InstancesListServerCasResponse.getDefaultInstance()) + return this; + if (certsBuilder_ == null) { + if (!other.certs_.isEmpty()) { + if (certs_.isEmpty()) { + certs_ = other.certs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCertsIsMutable(); + certs_.addAll(other.certs_); + } + onChanged(); + } + } else { + if (!other.certs_.isEmpty()) { + if (certsBuilder_.isEmpty()) { + certsBuilder_.dispose(); + certsBuilder_ = null; + certs_ = other.certs_; + bitField0_ = (bitField0_ & ~0x00000001); + certsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetCertsFieldBuilder() + : null; + } else { + certsBuilder_.addAllMessages(other.certs_); + } + } + } + if (!other.getActiveVersion().isEmpty()) { + activeVersion_ = other.activeVersion_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + com.google.cloud.sql.v1beta4.SslCert m = + input.readMessage( + com.google.cloud.sql.v1beta4.SslCert.parser(), extensionRegistry); + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.add(m); + } else { + certsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + activeVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List certs_ = + java.util.Collections.emptyList(); + + private void ensureCertsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + certs_ = new java.util.ArrayList(certs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + certsBuilder_; + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public java.util.List getCertsList() { + if (certsBuilder_ == null) { + return java.util.Collections.unmodifiableList(certs_); + } else { + return certsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public int getCertsCount() { + if (certsBuilder_ == null) { + return certs_.size(); + } else { + return certsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCert getCerts(int index) { + if (certsBuilder_ == null) { + return certs_.get(index); + } else { + return certsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder setCerts(int index, com.google.cloud.sql.v1beta4.SslCert value) { + if (certsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertsIsMutable(); + certs_.set(index, value); + onChanged(); + } else { + certsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder setCerts( + int index, com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.set(index, builderForValue.build()); + onChanged(); + } else { + certsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder addCerts(com.google.cloud.sql.v1beta4.SslCert value) { + if (certsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertsIsMutable(); + certs_.add(value); + onChanged(); + } else { + certsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder addCerts(int index, com.google.cloud.sql.v1beta4.SslCert value) { + if (certsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertsIsMutable(); + certs_.add(index, value); + onChanged(); + } else { + certsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder addCerts(com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.add(builderForValue.build()); + onChanged(); + } else { + certsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder addCerts( + int index, com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.add(index, builderForValue.build()); + onChanged(); + } else { + certsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder addAllCerts( + java.lang.Iterable values) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, certs_); + onChanged(); + } else { + certsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder clearCerts() { + if (certsBuilder_ == null) { + certs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + certsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public Builder removeCerts(int index) { + if (certsBuilder_ == null) { + ensureCertsIsMutable(); + certs_.remove(index); + onChanged(); + } else { + certsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder getCertsBuilder(int index) { + return internalGetCertsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getCertsOrBuilder(int index) { + if (certsBuilder_ == null) { + return certs_.get(index); + } else { + return certsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public java.util.List + getCertsOrBuilderList() { + if (certsBuilder_ != null) { + return certsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(certs_); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder addCertsBuilder() { + return internalGetCertsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder addCertsBuilder(int index) { + return internalGetCertsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + public java.util.List getCertsBuilderList() { + return internalGetCertsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + internalGetCertsFieldBuilder() { + if (certsBuilder_ == null) { + certsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder>( + certs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + certs_ = null; + } + return certsBuilder_; + } + + private java.lang.Object activeVersion_ = ""; + + /** + * string active_version = 2; + * + * @return The activeVersion. + */ + public java.lang.String getActiveVersion() { + java.lang.Object ref = activeVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string active_version = 2; + * + * @return The bytes for activeVersion. + */ + public com.google.protobuf.ByteString getActiveVersionBytes() { + java.lang.Object ref = activeVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string active_version = 2; + * + * @param value The activeVersion to set. + * @return This builder for chaining. + */ + public Builder setActiveVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + activeVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string active_version = 2; + * + * @return This builder for chaining. + */ + public Builder clearActiveVersion() { + activeVersion_ = getDefaultInstance().getActiveVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string active_version = 2; + * + * @param value The bytes for activeVersion to set. + * @return This builder for chaining. + */ + public Builder setActiveVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + activeVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#instancesListServerCas`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCas`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCas`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCas`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCas`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesListServerCasResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesListServerCasResponse) + private static final com.google.cloud.sql.v1beta4.InstancesListServerCasResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesListServerCasResponse(); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCasResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesListServerCasResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListServerCasResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListServerCasResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListServerCasResponseOrBuilder.java new file mode 100644 index 000000000000..8f022c43ad6d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListServerCasResponseOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesListServerCasResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesListServerCasResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + java.util.List getCertsList(); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + com.google.cloud.sql.v1beta4.SslCert getCerts(int index); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + int getCertsCount(); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + java.util.List getCertsOrBuilderList(); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert certs = 1; + */ + com.google.cloud.sql.v1beta4.SslCertOrBuilder getCertsOrBuilder(int index); + + /** + * string active_version = 2; + * + * @return The activeVersion. + */ + java.lang.String getActiveVersion(); + + /** + * string active_version = 2; + * + * @return The bytes for activeVersion. + */ + com.google.protobuf.ByteString getActiveVersionBytes(); + + /** + * + * + *
+   * This is always `sql#instancesListServerCas`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#instancesListServerCas`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListServerCertificatesResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListServerCertificatesResponse.java new file mode 100644 index 000000000000..4d1a7b48c094 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListServerCertificatesResponse.java @@ -0,0 +1,1846 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instances ListServerCertificatess response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse} + */ +@com.google.protobuf.Generated +public final class InstancesListServerCertificatesResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse) + InstancesListServerCertificatesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesListServerCertificatesResponse"); + } + + // Use InstancesListServerCertificatesResponse.newBuilder() to construct. + private InstancesListServerCertificatesResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesListServerCertificatesResponse() { + caCerts_ = java.util.Collections.emptyList(); + serverCerts_ = java.util.Collections.emptyList(); + activeVersion_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListServerCertificatesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListServerCertificatesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse.class, + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse.Builder.class); + } + + public static final int CA_CERTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List caCerts_; + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + @java.lang.Override + public java.util.List getCaCertsList() { + return caCerts_; + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + @java.lang.Override + public java.util.List + getCaCertsOrBuilderList() { + return caCerts_; + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + @java.lang.Override + public int getCaCertsCount() { + return caCerts_.size(); + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCert getCaCerts(int index) { + return caCerts_.get(index); + } + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getCaCertsOrBuilder(int index) { + return caCerts_.get(index); + } + + public static final int SERVER_CERTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List serverCerts_; + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + @java.lang.Override + public java.util.List getServerCertsList() { + return serverCerts_; + } + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + @java.lang.Override + public java.util.List + getServerCertsOrBuilderList() { + return serverCerts_; + } + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + @java.lang.Override + public int getServerCertsCount() { + return serverCerts_.size(); + } + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCert getServerCerts(int index) { + return serverCerts_.get(index); + } + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getServerCertsOrBuilder(int index) { + return serverCerts_.get(index); + } + + public static final int ACTIVE_VERSION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object activeVersion_ = ""; + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `server_certs`.
+   * 
+ * + * string active_version = 3; + * + * @return The activeVersion. + */ + @java.lang.Override + public java.lang.String getActiveVersion() { + java.lang.Object ref = activeVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `server_certs`.
+   * 
+ * + * string active_version = 3; + * + * @return The bytes for activeVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getActiveVersionBytes() { + java.lang.Object ref = activeVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#instancesListServerCertificates`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#instancesListServerCertificates`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < caCerts_.size(); i++) { + output.writeMessage(1, caCerts_.get(i)); + } + for (int i = 0; i < serverCerts_.size(); i++) { + output.writeMessage(2, serverCerts_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(activeVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, activeVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, kind_); + } + 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)); + } + for (int i = 0; i < serverCerts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, serverCerts_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(activeVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, activeVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse other = + (com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse) obj; + + if (!getCaCertsList().equals(other.getCaCertsList())) return false; + if (!getServerCertsList().equals(other.getServerCertsList())) return false; + if (!getActiveVersion().equals(other.getActiveVersion())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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(); + } + if (getServerCertsCount() > 0) { + hash = (37 * hash) + SERVER_CERTS_FIELD_NUMBER; + hash = (53 * hash) + getServerCertsList().hashCode(); + } + hash = (37 * hash) + ACTIVE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getActiveVersion().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instances ListServerCertificatess response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse) + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListServerCertificatesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListServerCertificatesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse.class, + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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); + if (serverCertsBuilder_ == null) { + serverCerts_ = java.util.Collections.emptyList(); + } else { + serverCerts_ = null; + serverCertsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + activeVersion_ = ""; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesListServerCertificatesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse build() { + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse buildPartial() { + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse result = + new com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse 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(); + } + if (serverCertsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + serverCerts_ = java.util.Collections.unmodifiableList(serverCerts_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.serverCerts_ = serverCerts_; + } else { + result.serverCerts_ = serverCertsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.activeVersion_ = activeVersion_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse other) { + if (other + == com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse + .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.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetCaCertsFieldBuilder() + : null; + } else { + caCertsBuilder_.addAllMessages(other.caCerts_); + } + } + } + if (serverCertsBuilder_ == null) { + if (!other.serverCerts_.isEmpty()) { + if (serverCerts_.isEmpty()) { + serverCerts_ = other.serverCerts_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureServerCertsIsMutable(); + serverCerts_.addAll(other.serverCerts_); + } + onChanged(); + } + } else { + if (!other.serverCerts_.isEmpty()) { + if (serverCertsBuilder_.isEmpty()) { + serverCertsBuilder_.dispose(); + serverCertsBuilder_ = null; + serverCerts_ = other.serverCerts_; + bitField0_ = (bitField0_ & ~0x00000002); + serverCertsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetServerCertsFieldBuilder() + : null; + } else { + serverCertsBuilder_.addAllMessages(other.serverCerts_); + } + } + } + if (!other.getActiveVersion().isEmpty()) { + activeVersion_ = other.activeVersion_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + com.google.cloud.sql.v1beta4.SslCert m = + input.readMessage( + com.google.cloud.sql.v1beta4.SslCert.parser(), extensionRegistry); + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.add(m); + } else { + caCertsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1beta4.SslCert m = + input.readMessage( + com.google.cloud.sql.v1beta4.SslCert.parser(), extensionRegistry); + if (serverCertsBuilder_ == null) { + ensureServerCertsIsMutable(); + serverCerts_.add(m); + } else { + serverCertsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + activeVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + kind_ = 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.util.List caCerts_ = + java.util.Collections.emptyList(); + + private void ensureCaCertsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + caCerts_ = new java.util.ArrayList(caCerts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + caCertsBuilder_; + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public java.util.List getCaCertsList() { + if (caCertsBuilder_ == null) { + return java.util.Collections.unmodifiableList(caCerts_); + } else { + return caCertsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public int getCaCertsCount() { + if (caCertsBuilder_ == null) { + return caCerts_.size(); + } else { + return caCertsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCert getCaCerts(int index) { + if (caCertsBuilder_ == null) { + return caCerts_.get(index); + } else { + return caCertsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public Builder setCaCerts(int index, com.google.cloud.sql.v1beta4.SslCert value) { + if (caCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaCertsIsMutable(); + caCerts_.set(index, value); + onChanged(); + } else { + caCertsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public Builder setCaCerts( + int index, com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.set(index, builderForValue.build()); + onChanged(); + } else { + caCertsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public Builder addCaCerts(com.google.cloud.sql.v1beta4.SslCert value) { + if (caCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaCertsIsMutable(); + caCerts_.add(value); + onChanged(); + } else { + caCertsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public Builder addCaCerts(int index, com.google.cloud.sql.v1beta4.SslCert value) { + if (caCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaCertsIsMutable(); + caCerts_.add(index, value); + onChanged(); + } else { + caCertsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public Builder addCaCerts(com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.add(builderForValue.build()); + onChanged(); + } else { + caCertsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public Builder addCaCerts( + int index, com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.add(index, builderForValue.build()); + onChanged(); + } else { + caCertsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public Builder addAllCaCerts( + java.lang.Iterable values) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, caCerts_); + onChanged(); + } else { + caCertsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public Builder clearCaCerts() { + if (caCertsBuilder_ == null) { + caCerts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + caCertsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public Builder removeCaCerts(int index) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.remove(index); + onChanged(); + } else { + caCertsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder getCaCertsBuilder(int index) { + return internalGetCaCertsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getCaCertsOrBuilder(int index) { + if (caCertsBuilder_ == null) { + return caCerts_.get(index); + } else { + return caCertsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public java.util.List + getCaCertsOrBuilderList() { + if (caCertsBuilder_ != null) { + return caCertsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(caCerts_); + } + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder addCaCertsBuilder() { + return internalGetCaCertsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder addCaCertsBuilder(int index) { + return internalGetCaCertsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of server CA certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + public java.util.List getCaCertsBuilderList() { + return internalGetCaCertsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + internalGetCaCertsFieldBuilder() { + if (caCertsBuilder_ == null) { + caCertsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder>( + caCerts_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + caCerts_ = null; + } + return caCertsBuilder_; + } + + private java.util.List serverCerts_ = + java.util.Collections.emptyList(); + + private void ensureServerCertsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + serverCerts_ = new java.util.ArrayList(serverCerts_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + serverCertsBuilder_; + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public java.util.List getServerCertsList() { + if (serverCertsBuilder_ == null) { + return java.util.Collections.unmodifiableList(serverCerts_); + } else { + return serverCertsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public int getServerCertsCount() { + if (serverCertsBuilder_ == null) { + return serverCerts_.size(); + } else { + return serverCertsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public com.google.cloud.sql.v1beta4.SslCert getServerCerts(int index) { + if (serverCertsBuilder_ == null) { + return serverCerts_.get(index); + } else { + return serverCertsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public Builder setServerCerts(int index, com.google.cloud.sql.v1beta4.SslCert value) { + if (serverCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerCertsIsMutable(); + serverCerts_.set(index, value); + onChanged(); + } else { + serverCertsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public Builder setServerCerts( + int index, com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (serverCertsBuilder_ == null) { + ensureServerCertsIsMutable(); + serverCerts_.set(index, builderForValue.build()); + onChanged(); + } else { + serverCertsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public Builder addServerCerts(com.google.cloud.sql.v1beta4.SslCert value) { + if (serverCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerCertsIsMutable(); + serverCerts_.add(value); + onChanged(); + } else { + serverCertsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public Builder addServerCerts(int index, com.google.cloud.sql.v1beta4.SslCert value) { + if (serverCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerCertsIsMutable(); + serverCerts_.add(index, value); + onChanged(); + } else { + serverCertsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public Builder addServerCerts(com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (serverCertsBuilder_ == null) { + ensureServerCertsIsMutable(); + serverCerts_.add(builderForValue.build()); + onChanged(); + } else { + serverCertsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public Builder addServerCerts( + int index, com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (serverCertsBuilder_ == null) { + ensureServerCertsIsMutable(); + serverCerts_.add(index, builderForValue.build()); + onChanged(); + } else { + serverCertsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public Builder addAllServerCerts( + java.lang.Iterable values) { + if (serverCertsBuilder_ == null) { + ensureServerCertsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, serverCerts_); + onChanged(); + } else { + serverCertsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public Builder clearServerCerts() { + if (serverCertsBuilder_ == null) { + serverCerts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + serverCertsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public Builder removeServerCerts(int index) { + if (serverCertsBuilder_ == null) { + ensureServerCertsIsMutable(); + serverCerts_.remove(index); + onChanged(); + } else { + serverCertsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder getServerCertsBuilder(int index) { + return internalGetServerCertsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getServerCertsOrBuilder(int index) { + if (serverCertsBuilder_ == null) { + return serverCerts_.get(index); + } else { + return serverCertsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public java.util.List + getServerCertsOrBuilderList() { + if (serverCertsBuilder_ != null) { + return serverCertsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serverCerts_); + } + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder addServerCertsBuilder() { + return internalGetServerCertsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder addServerCertsBuilder(int index) { + return internalGetServerCertsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of server certificates for the instance, signed by the corresponding
+     * CA from the `ca_certs` list.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + public java.util.List + getServerCertsBuilderList() { + return internalGetServerCertsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + internalGetServerCertsFieldBuilder() { + if (serverCertsBuilder_ == null) { + serverCertsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder>( + serverCerts_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + serverCerts_ = null; + } + return serverCertsBuilder_; + } + + private java.lang.Object activeVersion_ = ""; + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `server_certs`.
+     * 
+ * + * string active_version = 3; + * + * @return The activeVersion. + */ + public java.lang.String getActiveVersion() { + java.lang.Object ref = activeVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `server_certs`.
+     * 
+ * + * string active_version = 3; + * + * @return The bytes for activeVersion. + */ + public com.google.protobuf.ByteString getActiveVersionBytes() { + java.lang.Object ref = activeVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `server_certs`.
+     * 
+ * + * string active_version = 3; + * + * @param value The activeVersion to set. + * @return This builder for chaining. + */ + public Builder setActiveVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + activeVersion_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `server_certs`.
+     * 
+ * + * string active_version = 3; + * + * @return This builder for chaining. + */ + public Builder clearActiveVersion() { + activeVersion_ = getDefaultInstance().getActiveVersion(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The `sha1_fingerprint` of the active certificate from `server_certs`.
+     * 
+ * + * string active_version = 3; + * + * @param value The bytes for activeVersion to set. + * @return This builder for chaining. + */ + public Builder setActiveVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + activeVersion_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#instancesListServerCertificates`.
+     * 
+ * + * string kind = 4; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCertificates`.
+     * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCertificates`.
+     * 
+ * + * string kind = 4; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCertificates`.
+     * 
+ * + * string kind = 4; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#instancesListServerCertificates`.
+     * 
+ * + * string kind = 4; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse) + private static final com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse(); + } + + public static com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesListServerCertificatesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListServerCertificatesResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListServerCertificatesResponseOrBuilder.java new file mode 100644 index 000000000000..243ccf6f874b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesListServerCertificatesResponseOrBuilder.java @@ -0,0 +1,196 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesListServerCertificatesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + java.util.List getCaCertsList(); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + com.google.cloud.sql.v1beta4.SslCert getCaCerts(int index); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + int getCaCertsCount(); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + java.util.List getCaCertsOrBuilderList(); + + /** + * + * + *
+   * List of server CA certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert ca_certs = 1; + */ + com.google.cloud.sql.v1beta4.SslCertOrBuilder getCaCertsOrBuilder(int index); + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + java.util.List getServerCertsList(); + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + com.google.cloud.sql.v1beta4.SslCert getServerCerts(int index); + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + int getServerCertsCount(); + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + java.util.List + getServerCertsOrBuilderList(); + + /** + * + * + *
+   * List of server certificates for the instance, signed by the corresponding
+   * CA from the `ca_certs` list.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert server_certs = 2; + */ + com.google.cloud.sql.v1beta4.SslCertOrBuilder getServerCertsOrBuilder(int index); + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `server_certs`.
+   * 
+ * + * string active_version = 3; + * + * @return The activeVersion. + */ + java.lang.String getActiveVersion(); + + /** + * + * + *
+   * The `sha1_fingerprint` of the active certificate from `server_certs`.
+   * 
+ * + * string active_version = 3; + * + * @return The bytes for activeVersion. + */ + com.google.protobuf.ByteString getActiveVersionBytes(); + + /** + * + * + *
+   * This is always `sql#instancesListServerCertificates`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#instancesListServerCertificates`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesPreCheckMajorVersionUpgradeRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesPreCheckMajorVersionUpgradeRequest.java new file mode 100644 index 000000000000..e250772b2a0d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesPreCheckMajorVersionUpgradeRequest.java @@ -0,0 +1,776 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Request for Pre-checks for MVU
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest} + */ +@com.google.protobuf.Generated +public final class InstancesPreCheckMajorVersionUpgradeRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest) + InstancesPreCheckMajorVersionUpgradeRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesPreCheckMajorVersionUpgradeRequest"); + } + + // Use InstancesPreCheckMajorVersionUpgradeRequest.newBuilder() to construct. + private InstancesPreCheckMajorVersionUpgradeRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesPreCheckMajorVersionUpgradeRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesPreCheckMajorVersionUpgradeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesPreCheckMajorVersionUpgradeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.class, + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.Builder.class); + } + + private int bitField0_; + public static final int PRE_CHECK_MAJOR_VERSION_UPGRADE_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + preCheckMajorVersionUpgradeContext_; + + /** + * + * + *
+   * Required. Contains details about the pre-check major version upgrade
+   * operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the preCheckMajorVersionUpgradeContext field is set. + */ + @java.lang.Override + public boolean hasPreCheckMajorVersionUpgradeContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. Contains details about the pre-check major version upgrade
+   * operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The preCheckMajorVersionUpgradeContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + getPreCheckMajorVersionUpgradeContext() { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } + + /** + * + * + *
+   * Required. Contains details about the pre-check major version upgrade
+   * operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContextOrBuilder + getPreCheckMajorVersionUpgradeContextOrBuilder() { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getPreCheckMajorVersionUpgradeContext()); + } + 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, getPreCheckMajorVersionUpgradeContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest other = + (com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest) obj; + + if (hasPreCheckMajorVersionUpgradeContext() != other.hasPreCheckMajorVersionUpgradeContext()) + return false; + if (hasPreCheckMajorVersionUpgradeContext()) { + if (!getPreCheckMajorVersionUpgradeContext() + .equals(other.getPreCheckMajorVersionUpgradeContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasPreCheckMajorVersionUpgradeContext()) { + hash = (37 * hash) + PRE_CHECK_MAJOR_VERSION_UPGRADE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getPreCheckMajorVersionUpgradeContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request for Pre-checks for MVU
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest) + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesPreCheckMajorVersionUpgradeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesPreCheckMajorVersionUpgradeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.class, + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPreCheckMajorVersionUpgradeContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + preCheckMajorVersionUpgradeContext_ = null; + if (preCheckMajorVersionUpgradeContextBuilder_ != null) { + preCheckMajorVersionUpgradeContextBuilder_.dispose(); + preCheckMajorVersionUpgradeContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesPreCheckMajorVersionUpgradeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest build() { + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest buildPartial() { + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest result = + new com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.preCheckMajorVersionUpgradeContext_ = + preCheckMajorVersionUpgradeContextBuilder_ == null + ? preCheckMajorVersionUpgradeContext_ + : preCheckMajorVersionUpgradeContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest other) { + if (other + == com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance()) return this; + if (other.hasPreCheckMajorVersionUpgradeContext()) { + mergePreCheckMajorVersionUpgradeContext(other.getPreCheckMajorVersionUpgradeContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetPreCheckMajorVersionUpgradeContextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + preCheckMajorVersionUpgradeContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext, + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.Builder, + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContextOrBuilder> + preCheckMajorVersionUpgradeContextBuilder_; + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the preCheckMajorVersionUpgradeContext field is set. + */ + public boolean hasPreCheckMajorVersionUpgradeContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The preCheckMajorVersionUpgradeContext. + */ + public com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + getPreCheckMajorVersionUpgradeContext() { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } else { + return preCheckMajorVersionUpgradeContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPreCheckMajorVersionUpgradeContext( + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext value) { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + preCheckMajorVersionUpgradeContext_ = value; + } else { + preCheckMajorVersionUpgradeContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPreCheckMajorVersionUpgradeContext( + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.Builder builderForValue) { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + preCheckMajorVersionUpgradeContext_ = builderForValue.build(); + } else { + preCheckMajorVersionUpgradeContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePreCheckMajorVersionUpgradeContext( + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext value) { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && preCheckMajorVersionUpgradeContext_ != null + && preCheckMajorVersionUpgradeContext_ + != com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + .getDefaultInstance()) { + getPreCheckMajorVersionUpgradeContextBuilder().mergeFrom(value); + } else { + preCheckMajorVersionUpgradeContext_ = value; + } + } else { + preCheckMajorVersionUpgradeContextBuilder_.mergeFrom(value); + } + if (preCheckMajorVersionUpgradeContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPreCheckMajorVersionUpgradeContext() { + bitField0_ = (bitField0_ & ~0x00000001); + preCheckMajorVersionUpgradeContext_ = null; + if (preCheckMajorVersionUpgradeContextBuilder_ != null) { + preCheckMajorVersionUpgradeContextBuilder_.dispose(); + preCheckMajorVersionUpgradeContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.Builder + getPreCheckMajorVersionUpgradeContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetPreCheckMajorVersionUpgradeContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContextOrBuilder + getPreCheckMajorVersionUpgradeContextOrBuilder() { + if (preCheckMajorVersionUpgradeContextBuilder_ != null) { + return preCheckMajorVersionUpgradeContextBuilder_.getMessageOrBuilder(); + } else { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } + } + + /** + * + * + *
+     * Required. Contains details about the pre-check major version upgrade
+     * operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext, + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.Builder, + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContextOrBuilder> + internalGetPreCheckMajorVersionUpgradeContextFieldBuilder() { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + preCheckMajorVersionUpgradeContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext, + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.Builder, + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContextOrBuilder>( + getPreCheckMajorVersionUpgradeContext(), getParentForChildren(), isClean()); + preCheckMajorVersionUpgradeContext_ = null; + } + return preCheckMajorVersionUpgradeContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest) + private static final com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest(); + } + + public static com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesPreCheckMajorVersionUpgradeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser + getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesPreCheckMajorVersionUpgradeRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesPreCheckMajorVersionUpgradeRequestOrBuilder.java new file mode 100644 index 000000000000..f5a2a5c0f6a5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesPreCheckMajorVersionUpgradeRequestOrBuilder.java @@ -0,0 +1,76 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesPreCheckMajorVersionUpgradeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Contains details about the pre-check major version upgrade
+   * operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the preCheckMajorVersionUpgradeContext field is set. + */ + boolean hasPreCheckMajorVersionUpgradeContext(); + + /** + * + * + *
+   * Required. Contains details about the pre-check major version upgrade
+   * operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The preCheckMajorVersionUpgradeContext. + */ + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + getPreCheckMajorVersionUpgradeContext(); + + /** + * + * + *
+   * Required. Contains details about the pre-check major version upgrade
+   * operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContextOrBuilder + getPreCheckMajorVersionUpgradeContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesReencryptRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesReencryptRequest.java new file mode 100644 index 000000000000..ac970a113faf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesReencryptRequest.java @@ -0,0 +1,736 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database Instance reencrypt request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesReencryptRequest} + */ +@com.google.protobuf.Generated +public final class InstancesReencryptRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesReencryptRequest) + InstancesReencryptRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesReencryptRequest"); + } + + // Use InstancesReencryptRequest.newBuilder() to construct. + private InstancesReencryptRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesReencryptRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_InstancesReencryptRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_InstancesReencryptRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesReencryptRequest.class, + com.google.cloud.sql.v1beta4.InstancesReencryptRequest.Builder.class); + } + + private int bitField0_; + public static final int BACKUP_REENCRYPTION_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.BackupReencryptionConfig backupReencryptionConfig_; + + /** + * + * + *
+   * Configuration specific to backup re-encryption
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + * + * @return Whether the backupReencryptionConfig field is set. + */ + @java.lang.Override + public boolean hasBackupReencryptionConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Configuration specific to backup re-encryption
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + * + * @return The backupReencryptionConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupReencryptionConfig getBackupReencryptionConfig() { + return backupReencryptionConfig_ == null + ? com.google.cloud.sql.v1beta4.BackupReencryptionConfig.getDefaultInstance() + : backupReencryptionConfig_; + } + + /** + * + * + *
+   * Configuration specific to backup re-encryption
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupReencryptionConfigOrBuilder + getBackupReencryptionConfigOrBuilder() { + return backupReencryptionConfig_ == null + ? com.google.cloud.sql.v1beta4.BackupReencryptionConfig.getDefaultInstance() + : backupReencryptionConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getBackupReencryptionConfig()); + } + 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, getBackupReencryptionConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesReencryptRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesReencryptRequest other = + (com.google.cloud.sql.v1beta4.InstancesReencryptRequest) obj; + + if (hasBackupReencryptionConfig() != other.hasBackupReencryptionConfig()) return false; + if (hasBackupReencryptionConfig()) { + if (!getBackupReencryptionConfig().equals(other.getBackupReencryptionConfig())) return false; + } + if (!getUnknownFields().equals(other.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 (hasBackupReencryptionConfig()) { + hash = (37 * hash) + BACKUP_REENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getBackupReencryptionConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesReencryptRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesReencryptRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesReencryptRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesReencryptRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesReencryptRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesReencryptRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesReencryptRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesReencryptRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesReencryptRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesReencryptRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesReencryptRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesReencryptRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.InstancesReencryptRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database Instance reencrypt request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesReencryptRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesReencryptRequest) + com.google.cloud.sql.v1beta4.InstancesReencryptRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_InstancesReencryptRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_InstancesReencryptRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesReencryptRequest.class, + com.google.cloud.sql.v1beta4.InstancesReencryptRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InstancesReencryptRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackupReencryptionConfigFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backupReencryptionConfig_ = null; + if (backupReencryptionConfigBuilder_ != null) { + backupReencryptionConfigBuilder_.dispose(); + backupReencryptionConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_InstancesReencryptRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesReencryptRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesReencryptRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesReencryptRequest build() { + com.google.cloud.sql.v1beta4.InstancesReencryptRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesReencryptRequest buildPartial() { + com.google.cloud.sql.v1beta4.InstancesReencryptRequest result = + new com.google.cloud.sql.v1beta4.InstancesReencryptRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.InstancesReencryptRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backupReencryptionConfig_ = + backupReencryptionConfigBuilder_ == null + ? backupReencryptionConfig_ + : backupReencryptionConfigBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesReencryptRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.InstancesReencryptRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InstancesReencryptRequest other) { + if (other == com.google.cloud.sql.v1beta4.InstancesReencryptRequest.getDefaultInstance()) + return this; + if (other.hasBackupReencryptionConfig()) { + mergeBackupReencryptionConfig(other.getBackupReencryptionConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetBackupReencryptionConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.BackupReencryptionConfig backupReencryptionConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupReencryptionConfig, + com.google.cloud.sql.v1beta4.BackupReencryptionConfig.Builder, + com.google.cloud.sql.v1beta4.BackupReencryptionConfigOrBuilder> + backupReencryptionConfigBuilder_; + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + * + * @return Whether the backupReencryptionConfig field is set. + */ + public boolean hasBackupReencryptionConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + * + * @return The backupReencryptionConfig. + */ + public com.google.cloud.sql.v1beta4.BackupReencryptionConfig getBackupReencryptionConfig() { + if (backupReencryptionConfigBuilder_ == null) { + return backupReencryptionConfig_ == null + ? com.google.cloud.sql.v1beta4.BackupReencryptionConfig.getDefaultInstance() + : backupReencryptionConfig_; + } else { + return backupReencryptionConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + public Builder setBackupReencryptionConfig( + com.google.cloud.sql.v1beta4.BackupReencryptionConfig value) { + if (backupReencryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupReencryptionConfig_ = value; + } else { + backupReencryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + public Builder setBackupReencryptionConfig( + com.google.cloud.sql.v1beta4.BackupReencryptionConfig.Builder builderForValue) { + if (backupReencryptionConfigBuilder_ == null) { + backupReencryptionConfig_ = builderForValue.build(); + } else { + backupReencryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + public Builder mergeBackupReencryptionConfig( + com.google.cloud.sql.v1beta4.BackupReencryptionConfig value) { + if (backupReencryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && backupReencryptionConfig_ != null + && backupReencryptionConfig_ + != com.google.cloud.sql.v1beta4.BackupReencryptionConfig.getDefaultInstance()) { + getBackupReencryptionConfigBuilder().mergeFrom(value); + } else { + backupReencryptionConfig_ = value; + } + } else { + backupReencryptionConfigBuilder_.mergeFrom(value); + } + if (backupReencryptionConfig_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + public Builder clearBackupReencryptionConfig() { + bitField0_ = (bitField0_ & ~0x00000001); + backupReencryptionConfig_ = null; + if (backupReencryptionConfigBuilder_ != null) { + backupReencryptionConfigBuilder_.dispose(); + backupReencryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + public com.google.cloud.sql.v1beta4.BackupReencryptionConfig.Builder + getBackupReencryptionConfigBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetBackupReencryptionConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + public com.google.cloud.sql.v1beta4.BackupReencryptionConfigOrBuilder + getBackupReencryptionConfigOrBuilder() { + if (backupReencryptionConfigBuilder_ != null) { + return backupReencryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return backupReencryptionConfig_ == null + ? com.google.cloud.sql.v1beta4.BackupReencryptionConfig.getDefaultInstance() + : backupReencryptionConfig_; + } + } + + /** + * + * + *
+     * Configuration specific to backup re-encryption
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupReencryptionConfig, + com.google.cloud.sql.v1beta4.BackupReencryptionConfig.Builder, + com.google.cloud.sql.v1beta4.BackupReencryptionConfigOrBuilder> + internalGetBackupReencryptionConfigFieldBuilder() { + if (backupReencryptionConfigBuilder_ == null) { + backupReencryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupReencryptionConfig, + com.google.cloud.sql.v1beta4.BackupReencryptionConfig.Builder, + com.google.cloud.sql.v1beta4.BackupReencryptionConfigOrBuilder>( + getBackupReencryptionConfig(), getParentForChildren(), isClean()); + backupReencryptionConfig_ = null; + } + return backupReencryptionConfigBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesReencryptRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesReencryptRequest) + private static final com.google.cloud.sql.v1beta4.InstancesReencryptRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesReencryptRequest(); + } + + public static com.google.cloud.sql.v1beta4.InstancesReencryptRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesReencryptRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesReencryptRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesReencryptRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesReencryptRequestOrBuilder.java new file mode 100644 index 000000000000..8095fc11287d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesReencryptRequestOrBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesReencryptRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesReencryptRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Configuration specific to backup re-encryption
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + * + * @return Whether the backupReencryptionConfig field is set. + */ + boolean hasBackupReencryptionConfig(); + + /** + * + * + *
+   * Configuration specific to backup re-encryption
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + * + * @return The backupReencryptionConfig. + */ + com.google.cloud.sql.v1beta4.BackupReencryptionConfig getBackupReencryptionConfig(); + + /** + * + * + *
+   * Configuration specific to backup re-encryption
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.BackupReencryptionConfig backup_reencryption_config = 1; + * + */ + com.google.cloud.sql.v1beta4.BackupReencryptionConfigOrBuilder + getBackupReencryptionConfigOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRestoreBackupRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRestoreBackupRequest.java new file mode 100644 index 000000000000..b212201f8a56 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRestoreBackupRequest.java @@ -0,0 +1,1847 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance restore backup request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesRestoreBackupRequest} + */ +@com.google.protobuf.Generated +public final class InstancesRestoreBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesRestoreBackupRequest) + InstancesRestoreBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesRestoreBackupRequest"); + } + + // Use InstancesRestoreBackupRequest.newBuilder() to construct. + private InstancesRestoreBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesRestoreBackupRequest() { + backup_ = ""; + backupdrBackup_ = ""; + restoreInstanceClearOverridesFieldNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRestoreBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRestoreBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.class, + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.Builder.class); + } + + private int bitField0_; + public static final int RESTORE_BACKUP_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.RestoreBackupContext restoreBackupContext_; + + /** + * + * + *
+   * Parameters required to perform the restore backup operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + * + * @return Whether the restoreBackupContext field is set. + */ + @java.lang.Override + public boolean hasRestoreBackupContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Parameters required to perform the restore backup operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + * + * @return The restoreBackupContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.RestoreBackupContext getRestoreBackupContext() { + return restoreBackupContext_ == null + ? com.google.cloud.sql.v1beta4.RestoreBackupContext.getDefaultInstance() + : restoreBackupContext_; + } + + /** + * + * + *
+   * Parameters required to perform the restore backup operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.RestoreBackupContextOrBuilder + getRestoreBackupContextOrBuilder() { + return restoreBackupContext_ == null + ? com.google.cloud.sql.v1beta4.RestoreBackupContext.getDefaultInstance() + : restoreBackupContext_; + } + + public static final int BACKUP_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object backup_ = ""; + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+   * restore_backup_context, backup, backupdr_backup can be passed to the input.
+   * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @return The backup. + */ + @java.lang.Override + public java.lang.String getBackup() { + java.lang.Object ref = backup_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backup_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+   * restore_backup_context, backup, backupdr_backup can be passed to the input.
+   * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backup. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupBytes() { + java.lang.Object ref = backup_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUPDR_BACKUP_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupdrBackup_ = ""; + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:
+   * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+   * Only one of restore_backup_context, backup, backupdr_backup can be
+   * passed to the input.
+   * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The backupdrBackup. + */ + @java.lang.Override + public java.lang.String getBackupdrBackup() { + java.lang.Object ref = backupdrBackup_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupdrBackup_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:
+   * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+   * Only one of restore_backup_context, backup, backupdr_backup can be
+   * passed to the input.
+   * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backupdrBackup. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupdrBackupBytes() { + java.lang.Object ref = backupdrBackup_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupdrBackup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESTORE_INSTANCE_SETTINGS_FIELD_NUMBER = 3; + private com.google.cloud.sql.v1beta4.DatabaseInstance restoreInstanceSettings_; + + /** + * + * + *
+   * Optional. By using this parameter, Cloud SQL overrides any instance
+   * settings stored in the backup you are restoring from. You can't change the
+   * instance's major database version and you can only increase the disk size.
+   * You can use this field to restore new instances only. This field is not
+   * applicable for restore to existing instances.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the restoreInstanceSettings field is set. + */ + @java.lang.Override + public boolean hasRestoreInstanceSettings() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. By using this parameter, Cloud SQL overrides any instance
+   * settings stored in the backup you are restoring from. You can't change the
+   * instance's major database version and you can only increase the disk size.
+   * You can use this field to restore new instances only. This field is not
+   * applicable for restore to existing instances.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The restoreInstanceSettings. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance getRestoreInstanceSettings() { + return restoreInstanceSettings_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : restoreInstanceSettings_; + } + + /** + * + * + *
+   * Optional. By using this parameter, Cloud SQL overrides any instance
+   * settings stored in the backup you are restoring from. You can't change the
+   * instance's major database version and you can only increase the disk size.
+   * You can use this field to restore new instances only. This field is not
+   * applicable for restore to existing instances.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder + getRestoreInstanceSettingsOrBuilder() { + return restoreInstanceSettings_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : restoreInstanceSettings_; + } + + public static final int RESTORE_INSTANCE_CLEAR_OVERRIDES_FIELD_NAMES_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList restoreInstanceClearOverridesFieldNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the restoreInstanceClearOverridesFieldNames. + */ + public com.google.protobuf.ProtocolStringList getRestoreInstanceClearOverridesFieldNamesList() { + return restoreInstanceClearOverridesFieldNames_; + } + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of restoreInstanceClearOverridesFieldNames. + */ + public int getRestoreInstanceClearOverridesFieldNamesCount() { + return restoreInstanceClearOverridesFieldNames_.size(); + } + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The restoreInstanceClearOverridesFieldNames at the given index. + */ + public java.lang.String getRestoreInstanceClearOverridesFieldNames(int index) { + return restoreInstanceClearOverridesFieldNames_.get(index); + } + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the restoreInstanceClearOverridesFieldNames at the given index. + */ + public com.google.protobuf.ByteString getRestoreInstanceClearOverridesFieldNamesBytes(int index) { + return restoreInstanceClearOverridesFieldNames_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRestoreBackupContext()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backup_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, backup_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getRestoreInstanceSettings()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backupdrBackup_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, backupdrBackup_); + } + for (int i = 0; i < restoreInstanceClearOverridesFieldNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 5, restoreInstanceClearOverridesFieldNames_.getRaw(i)); + } + 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, getRestoreBackupContext()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backup_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, backup_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRestoreInstanceSettings()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backupdrBackup_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, backupdrBackup_); + } + { + int dataSize = 0; + for (int i = 0; i < restoreInstanceClearOverridesFieldNames_.size(); i++) { + dataSize += computeStringSizeNoTag(restoreInstanceClearOverridesFieldNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getRestoreInstanceClearOverridesFieldNamesList().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.sql.v1beta4.InstancesRestoreBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest other = + (com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest) obj; + + if (hasRestoreBackupContext() != other.hasRestoreBackupContext()) return false; + if (hasRestoreBackupContext()) { + if (!getRestoreBackupContext().equals(other.getRestoreBackupContext())) return false; + } + if (!getBackup().equals(other.getBackup())) return false; + if (!getBackupdrBackup().equals(other.getBackupdrBackup())) return false; + if (hasRestoreInstanceSettings() != other.hasRestoreInstanceSettings()) return false; + if (hasRestoreInstanceSettings()) { + if (!getRestoreInstanceSettings().equals(other.getRestoreInstanceSettings())) return false; + } + if (!getRestoreInstanceClearOverridesFieldNamesList() + .equals(other.getRestoreInstanceClearOverridesFieldNamesList())) return false; + if (!getUnknownFields().equals(other.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 (hasRestoreBackupContext()) { + hash = (37 * hash) + RESTORE_BACKUP_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getRestoreBackupContext().hashCode(); + } + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + hash = (37 * hash) + BACKUPDR_BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackupdrBackup().hashCode(); + if (hasRestoreInstanceSettings()) { + hash = (37 * hash) + RESTORE_INSTANCE_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getRestoreInstanceSettings().hashCode(); + } + if (getRestoreInstanceClearOverridesFieldNamesCount() > 0) { + hash = (37 * hash) + RESTORE_INSTANCE_CLEAR_OVERRIDES_FIELD_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getRestoreInstanceClearOverridesFieldNamesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance restore backup request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesRestoreBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesRestoreBackupRequest) + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRestoreBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRestoreBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.class, + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRestoreBackupContextFieldBuilder(); + internalGetRestoreInstanceSettingsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + restoreBackupContext_ = null; + if (restoreBackupContextBuilder_ != null) { + restoreBackupContextBuilder_.dispose(); + restoreBackupContextBuilder_ = null; + } + backup_ = ""; + backupdrBackup_ = ""; + restoreInstanceSettings_ = null; + if (restoreInstanceSettingsBuilder_ != null) { + restoreInstanceSettingsBuilder_.dispose(); + restoreInstanceSettingsBuilder_ = null; + } + restoreInstanceClearOverridesFieldNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRestoreBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest build() { + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest buildPartial() { + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest result = + new com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.restoreBackupContext_ = + restoreBackupContextBuilder_ == null + ? restoreBackupContext_ + : restoreBackupContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backup_ = backup_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.backupdrBackup_ = backupdrBackup_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.restoreInstanceSettings_ = + restoreInstanceSettingsBuilder_ == null + ? restoreInstanceSettings_ + : restoreInstanceSettingsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + restoreInstanceClearOverridesFieldNames_.makeImmutable(); + result.restoreInstanceClearOverridesFieldNames_ = restoreInstanceClearOverridesFieldNames_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest other) { + if (other == com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.getDefaultInstance()) + return this; + if (other.hasRestoreBackupContext()) { + mergeRestoreBackupContext(other.getRestoreBackupContext()); + } + if (!other.getBackup().isEmpty()) { + backup_ = other.backup_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getBackupdrBackup().isEmpty()) { + backupdrBackup_ = other.backupdrBackup_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasRestoreInstanceSettings()) { + mergeRestoreInstanceSettings(other.getRestoreInstanceSettings()); + } + if (!other.restoreInstanceClearOverridesFieldNames_.isEmpty()) { + if (restoreInstanceClearOverridesFieldNames_.isEmpty()) { + restoreInstanceClearOverridesFieldNames_ = other.restoreInstanceClearOverridesFieldNames_; + bitField0_ |= 0x00000010; + } else { + ensureRestoreInstanceClearOverridesFieldNamesIsMutable(); + restoreInstanceClearOverridesFieldNames_.addAll( + other.restoreInstanceClearOverridesFieldNames_); + } + 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( + internalGetRestoreBackupContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + backup_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetRestoreInstanceSettingsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + backupdrBackup_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRestoreInstanceClearOverridesFieldNamesIsMutable(); + restoreInstanceClearOverridesFieldNames_.add(s); + 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 com.google.cloud.sql.v1beta4.RestoreBackupContext restoreBackupContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.RestoreBackupContext, + com.google.cloud.sql.v1beta4.RestoreBackupContext.Builder, + com.google.cloud.sql.v1beta4.RestoreBackupContextOrBuilder> + restoreBackupContextBuilder_; + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + * + * @return Whether the restoreBackupContext field is set. + */ + public boolean hasRestoreBackupContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + * + * @return The restoreBackupContext. + */ + public com.google.cloud.sql.v1beta4.RestoreBackupContext getRestoreBackupContext() { + if (restoreBackupContextBuilder_ == null) { + return restoreBackupContext_ == null + ? com.google.cloud.sql.v1beta4.RestoreBackupContext.getDefaultInstance() + : restoreBackupContext_; + } else { + return restoreBackupContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + */ + public Builder setRestoreBackupContext( + com.google.cloud.sql.v1beta4.RestoreBackupContext value) { + if (restoreBackupContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + restoreBackupContext_ = value; + } else { + restoreBackupContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + */ + public Builder setRestoreBackupContext( + com.google.cloud.sql.v1beta4.RestoreBackupContext.Builder builderForValue) { + if (restoreBackupContextBuilder_ == null) { + restoreBackupContext_ = builderForValue.build(); + } else { + restoreBackupContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + */ + public Builder mergeRestoreBackupContext( + com.google.cloud.sql.v1beta4.RestoreBackupContext value) { + if (restoreBackupContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && restoreBackupContext_ != null + && restoreBackupContext_ + != com.google.cloud.sql.v1beta4.RestoreBackupContext.getDefaultInstance()) { + getRestoreBackupContextBuilder().mergeFrom(value); + } else { + restoreBackupContext_ = value; + } + } else { + restoreBackupContextBuilder_.mergeFrom(value); + } + if (restoreBackupContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + */ + public Builder clearRestoreBackupContext() { + bitField0_ = (bitField0_ & ~0x00000001); + restoreBackupContext_ = null; + if (restoreBackupContextBuilder_ != null) { + restoreBackupContextBuilder_.dispose(); + restoreBackupContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + */ + public com.google.cloud.sql.v1beta4.RestoreBackupContext.Builder + getRestoreBackupContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRestoreBackupContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + */ + public com.google.cloud.sql.v1beta4.RestoreBackupContextOrBuilder + getRestoreBackupContextOrBuilder() { + if (restoreBackupContextBuilder_ != null) { + return restoreBackupContextBuilder_.getMessageOrBuilder(); + } else { + return restoreBackupContext_ == null + ? com.google.cloud.sql.v1beta4.RestoreBackupContext.getDefaultInstance() + : restoreBackupContext_; + } + } + + /** + * + * + *
+     * Parameters required to perform the restore backup operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.RestoreBackupContext, + com.google.cloud.sql.v1beta4.RestoreBackupContext.Builder, + com.google.cloud.sql.v1beta4.RestoreBackupContextOrBuilder> + internalGetRestoreBackupContextFieldBuilder() { + if (restoreBackupContextBuilder_ == null) { + restoreBackupContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.RestoreBackupContext, + com.google.cloud.sql.v1beta4.RestoreBackupContext.Builder, + com.google.cloud.sql.v1beta4.RestoreBackupContextOrBuilder>( + getRestoreBackupContext(), getParentForChildren(), isClean()); + restoreBackupContext_ = null; + } + return restoreBackupContextBuilder_; + } + + private java.lang.Object backup_ = ""; + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+     * restore_backup_context, backup, backupdr_backup can be passed to the input.
+     * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @return The backup. + */ + public java.lang.String getBackup() { + java.lang.Object ref = backup_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backup_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+     * restore_backup_context, backup, backupdr_backup can be passed to the input.
+     * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backup. + */ + public com.google.protobuf.ByteString getBackupBytes() { + java.lang.Object ref = backup_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+     * restore_backup_context, backup, backupdr_backup can be passed to the input.
+     * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The backup to set. + * @return This builder for chaining. + */ + public Builder setBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+     * restore_backup_context, backup, backupdr_backup can be passed to the input.
+     * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBackup() { + backup_ = getDefaultInstance().getBackup(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+     * restore_backup_context, backup, backupdr_backup can be passed to the input.
+     * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for backup to set. + * @return This builder for chaining. + */ + public Builder setBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backup_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object backupdrBackup_ = ""; + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:
+     * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+     * Only one of restore_backup_context, backup, backupdr_backup can be
+     * passed to the input.
+     * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The backupdrBackup. + */ + public java.lang.String getBackupdrBackup() { + java.lang.Object ref = backupdrBackup_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupdrBackup_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:
+     * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+     * Only one of restore_backup_context, backup, backupdr_backup can be
+     * passed to the input.
+     * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backupdrBackup. + */ + public com.google.protobuf.ByteString getBackupdrBackupBytes() { + java.lang.Object ref = backupdrBackup_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupdrBackup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:
+     * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+     * Only one of restore_backup_context, backup, backupdr_backup can be
+     * passed to the input.
+     * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @param value The backupdrBackup to set. + * @return This builder for chaining. + */ + public Builder setBackupdrBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupdrBackup_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:
+     * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+     * Only one of restore_backup_context, backup, backupdr_backup can be
+     * passed to the input.
+     * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBackupdrBackup() { + backupdrBackup_ = getDefaultInstance().getBackupdrBackup(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup that's used to restore a Cloud SQL instance:
+     * Format:
+     * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+     * Only one of restore_backup_context, backup, backupdr_backup can be
+     * passed to the input.
+     * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for backupdrBackup to set. + * @return This builder for chaining. + */ + public Builder setBackupdrBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupdrBackup_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.DatabaseInstance restoreInstanceSettings_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder> + restoreInstanceSettingsBuilder_; + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the restoreInstanceSettings field is set. + */ + public boolean hasRestoreInstanceSettings() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The restoreInstanceSettings. + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance getRestoreInstanceSettings() { + if (restoreInstanceSettingsBuilder_ == null) { + return restoreInstanceSettings_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : restoreInstanceSettings_; + } else { + return restoreInstanceSettingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRestoreInstanceSettings(com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (restoreInstanceSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + restoreInstanceSettings_ = value; + } else { + restoreInstanceSettingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRestoreInstanceSettings( + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder builderForValue) { + if (restoreInstanceSettingsBuilder_ == null) { + restoreInstanceSettings_ = builderForValue.build(); + } else { + restoreInstanceSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRestoreInstanceSettings( + com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (restoreInstanceSettingsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && restoreInstanceSettings_ != null + && restoreInstanceSettings_ + != com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance()) { + getRestoreInstanceSettingsBuilder().mergeFrom(value); + } else { + restoreInstanceSettings_ = value; + } + } else { + restoreInstanceSettingsBuilder_.mergeFrom(value); + } + if (restoreInstanceSettings_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRestoreInstanceSettings() { + bitField0_ = (bitField0_ & ~0x00000008); + restoreInstanceSettings_ = null; + if (restoreInstanceSettingsBuilder_ != null) { + restoreInstanceSettingsBuilder_.dispose(); + restoreInstanceSettingsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.Builder + getRestoreInstanceSettingsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetRestoreInstanceSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder + getRestoreInstanceSettingsOrBuilder() { + if (restoreInstanceSettingsBuilder_ != null) { + return restoreInstanceSettingsBuilder_.getMessageOrBuilder(); + } else { + return restoreInstanceSettings_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : restoreInstanceSettings_; + } + } + + /** + * + * + *
+     * Optional. By using this parameter, Cloud SQL overrides any instance
+     * settings stored in the backup you are restoring from. You can't change the
+     * instance's major database version and you can only increase the disk size.
+     * You can use this field to restore new instances only. This field is not
+     * applicable for restore to existing instances.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder> + internalGetRestoreInstanceSettingsFieldBuilder() { + if (restoreInstanceSettingsBuilder_ == null) { + restoreInstanceSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder>( + getRestoreInstanceSettings(), getParentForChildren(), isClean()); + restoreInstanceSettings_ = null; + } + return restoreInstanceSettingsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList restoreInstanceClearOverridesFieldNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureRestoreInstanceClearOverridesFieldNamesIsMutable() { + if (!restoreInstanceClearOverridesFieldNames_.isModifiable()) { + restoreInstanceClearOverridesFieldNames_ = + new com.google.protobuf.LazyStringArrayList(restoreInstanceClearOverridesFieldNames_); + } + bitField0_ |= 0x00000010; + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the restoreInstanceClearOverridesFieldNames. + */ + public com.google.protobuf.ProtocolStringList getRestoreInstanceClearOverridesFieldNamesList() { + restoreInstanceClearOverridesFieldNames_.makeImmutable(); + return restoreInstanceClearOverridesFieldNames_; + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of restoreInstanceClearOverridesFieldNames. + */ + public int getRestoreInstanceClearOverridesFieldNamesCount() { + return restoreInstanceClearOverridesFieldNames_.size(); + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The restoreInstanceClearOverridesFieldNames at the given index. + */ + public java.lang.String getRestoreInstanceClearOverridesFieldNames(int index) { + return restoreInstanceClearOverridesFieldNames_.get(index); + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the restoreInstanceClearOverridesFieldNames at the given index. + */ + public com.google.protobuf.ByteString getRestoreInstanceClearOverridesFieldNamesBytes( + int index) { + return restoreInstanceClearOverridesFieldNames_.getByteString(index); + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The restoreInstanceClearOverridesFieldNames to set. + * @return This builder for chaining. + */ + public Builder setRestoreInstanceClearOverridesFieldNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestoreInstanceClearOverridesFieldNamesIsMutable(); + restoreInstanceClearOverridesFieldNames_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The restoreInstanceClearOverridesFieldNames to add. + * @return This builder for chaining. + */ + public Builder addRestoreInstanceClearOverridesFieldNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestoreInstanceClearOverridesFieldNamesIsMutable(); + restoreInstanceClearOverridesFieldNames_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The restoreInstanceClearOverridesFieldNames to add. + * @return This builder for chaining. + */ + public Builder addAllRestoreInstanceClearOverridesFieldNames( + java.lang.Iterable values) { + ensureRestoreInstanceClearOverridesFieldNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, restoreInstanceClearOverridesFieldNames_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRestoreInstanceClearOverridesFieldNames() { + restoreInstanceClearOverridesFieldNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This field has the same purpose as restore_instance_settings,
+     * changes any instance settings stored in the backup you are restoring from.
+     * With the difference that these fields are cleared in the settings.
+     * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes of the restoreInstanceClearOverridesFieldNames to add. + * @return This builder for chaining. + */ + public Builder addRestoreInstanceClearOverridesFieldNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRestoreInstanceClearOverridesFieldNamesIsMutable(); + restoreInstanceClearOverridesFieldNames_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesRestoreBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesRestoreBackupRequest) + private static final com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest(); + } + + public static com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesRestoreBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRestoreBackupRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRestoreBackupRequestOrBuilder.java new file mode 100644 index 000000000000..a7742d40caeb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRestoreBackupRequestOrBuilder.java @@ -0,0 +1,254 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesRestoreBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesRestoreBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Parameters required to perform the restore backup operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + * + * @return Whether the restoreBackupContext field is set. + */ + boolean hasRestoreBackupContext(); + + /** + * + * + *
+   * Parameters required to perform the restore backup operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + * + * @return The restoreBackupContext. + */ + com.google.cloud.sql.v1beta4.RestoreBackupContext getRestoreBackupContext(); + + /** + * + * + *
+   * Parameters required to perform the restore backup operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.RestoreBackupContext restore_backup_context = 1; + */ + com.google.cloud.sql.v1beta4.RestoreBackupContextOrBuilder getRestoreBackupContextOrBuilder(); + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+   * restore_backup_context, backup, backupdr_backup can be passed to the input.
+   * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @return The backup. + */ + java.lang.String getBackup(); + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:  projects/{project-id}/backups/{backup-uid}. Only one of
+   * restore_backup_context, backup, backupdr_backup can be passed to the input.
+   * 
+ * + * string backup = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backup. + */ + com.google.protobuf.ByteString getBackupBytes(); + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:
+   * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+   * Only one of restore_backup_context, backup, backupdr_backup can be
+   * passed to the input.
+   * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The backupdrBackup. + */ + java.lang.String getBackupdrBackup(); + + /** + * + * + *
+   * The name of the backup that's used to restore a Cloud SQL instance:
+   * Format:
+   * "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
+   * Only one of restore_backup_context, backup, backupdr_backup can be
+   * passed to the input.
+   * 
+ * + * string backupdr_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backupdrBackup. + */ + com.google.protobuf.ByteString getBackupdrBackupBytes(); + + /** + * + * + *
+   * Optional. By using this parameter, Cloud SQL overrides any instance
+   * settings stored in the backup you are restoring from. You can't change the
+   * instance's major database version and you can only increase the disk size.
+   * You can use this field to restore new instances only. This field is not
+   * applicable for restore to existing instances.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the restoreInstanceSettings field is set. + */ + boolean hasRestoreInstanceSettings(); + + /** + * + * + *
+   * Optional. By using this parameter, Cloud SQL overrides any instance
+   * settings stored in the backup you are restoring from. You can't change the
+   * instance's major database version and you can only increase the disk size.
+   * You can use this field to restore new instances only. This field is not
+   * applicable for restore to existing instances.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The restoreInstanceSettings. + */ + com.google.cloud.sql.v1beta4.DatabaseInstance getRestoreInstanceSettings(); + + /** + * + * + *
+   * Optional. By using this parameter, Cloud SQL overrides any instance
+   * settings stored in the backup you are restoring from. You can't change the
+   * instance's major database version and you can only increase the disk size.
+   * You can use this field to restore new instances only. This field is not
+   * applicable for restore to existing instances.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance restore_instance_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getRestoreInstanceSettingsOrBuilder(); + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the restoreInstanceClearOverridesFieldNames. + */ + java.util.List getRestoreInstanceClearOverridesFieldNamesList(); + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of restoreInstanceClearOverridesFieldNames. + */ + int getRestoreInstanceClearOverridesFieldNamesCount(); + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The restoreInstanceClearOverridesFieldNames at the given index. + */ + java.lang.String getRestoreInstanceClearOverridesFieldNames(int index); + + /** + * + * + *
+   * Optional. This field has the same purpose as restore_instance_settings,
+   * changes any instance settings stored in the backup you are restoring from.
+   * With the difference that these fields are cleared in the settings.
+   * 
+ * + * + * repeated string restore_instance_clear_overrides_field_names = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the restoreInstanceClearOverridesFieldNames at the given index. + */ + com.google.protobuf.ByteString getRestoreInstanceClearOverridesFieldNamesBytes(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateEntraIdCertificateRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateEntraIdCertificateRequest.java new file mode 100644 index 000000000000..2ad944a8e77f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateEntraIdCertificateRequest.java @@ -0,0 +1,756 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Rotate Entra ID Certificate request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest} + */ +@com.google.protobuf.Generated +public final class InstancesRotateEntraIdCertificateRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest) + InstancesRotateEntraIdCertificateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesRotateEntraIdCertificateRequest"); + } + + // Use InstancesRotateEntraIdCertificateRequest.newBuilder() to construct. + private InstancesRotateEntraIdCertificateRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesRotateEntraIdCertificateRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateEntraIdCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.class, + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.Builder.class); + } + + private int bitField0_; + public static final int ROTATE_ENTRA_ID_CERTIFICATE_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext + rotateEntraIdCertificateContext_; + + /** + * + * + *
+   * Optional. Contains details about the rotate Entra ID certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rotateEntraIdCertificateContext field is set. + */ + @java.lang.Override + public boolean hasRotateEntraIdCertificateContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Contains details about the rotate Entra ID certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rotateEntraIdCertificateContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext + getRotateEntraIdCertificateContext() { + return rotateEntraIdCertificateContext_ == null + ? com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.getDefaultInstance() + : rotateEntraIdCertificateContext_; + } + + /** + * + * + *
+   * Optional. Contains details about the rotate Entra ID certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContextOrBuilder + getRotateEntraIdCertificateContextOrBuilder() { + return rotateEntraIdCertificateContext_ == null + ? com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.getDefaultInstance() + : rotateEntraIdCertificateContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getRotateEntraIdCertificateContext()); + } + 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, getRotateEntraIdCertificateContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest other = + (com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest) obj; + + if (hasRotateEntraIdCertificateContext() != other.hasRotateEntraIdCertificateContext()) + return false; + if (hasRotateEntraIdCertificateContext()) { + if (!getRotateEntraIdCertificateContext().equals(other.getRotateEntraIdCertificateContext())) + return false; + } + if (!getUnknownFields().equals(other.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 (hasRotateEntraIdCertificateContext()) { + hash = (37 * hash) + ROTATE_ENTRA_ID_CERTIFICATE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getRotateEntraIdCertificateContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Rotate Entra ID Certificate request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest) + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateEntraIdCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.class, + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRotateEntraIdCertificateContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rotateEntraIdCertificateContext_ = null; + if (rotateEntraIdCertificateContextBuilder_ != null) { + rotateEntraIdCertificateContextBuilder_.dispose(); + rotateEntraIdCertificateContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest build() { + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest buildPartial() { + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest result = + new com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rotateEntraIdCertificateContext_ = + rotateEntraIdCertificateContextBuilder_ == null + ? rotateEntraIdCertificateContext_ + : rotateEntraIdCertificateContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest other) { + if (other + == com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest + .getDefaultInstance()) return this; + if (other.hasRotateEntraIdCertificateContext()) { + mergeRotateEntraIdCertificateContext(other.getRotateEntraIdCertificateContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetRotateEntraIdCertificateContextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext + rotateEntraIdCertificateContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext, + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.Builder, + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContextOrBuilder> + rotateEntraIdCertificateContextBuilder_; + + /** + * + * + *
+     * Optional. Contains details about the rotate Entra ID certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rotateEntraIdCertificateContext field is set. + */ + public boolean hasRotateEntraIdCertificateContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. Contains details about the rotate Entra ID certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rotateEntraIdCertificateContext. + */ + public com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext + getRotateEntraIdCertificateContext() { + if (rotateEntraIdCertificateContextBuilder_ == null) { + return rotateEntraIdCertificateContext_ == null + ? com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.getDefaultInstance() + : rotateEntraIdCertificateContext_; + } else { + return rotateEntraIdCertificateContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Contains details about the rotate Entra ID certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRotateEntraIdCertificateContext( + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext value) { + if (rotateEntraIdCertificateContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rotateEntraIdCertificateContext_ = value; + } else { + rotateEntraIdCertificateContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate Entra ID certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRotateEntraIdCertificateContext( + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.Builder builderForValue) { + if (rotateEntraIdCertificateContextBuilder_ == null) { + rotateEntraIdCertificateContext_ = builderForValue.build(); + } else { + rotateEntraIdCertificateContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate Entra ID certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRotateEntraIdCertificateContext( + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext value) { + if (rotateEntraIdCertificateContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && rotateEntraIdCertificateContext_ != null + && rotateEntraIdCertificateContext_ + != com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext + .getDefaultInstance()) { + getRotateEntraIdCertificateContextBuilder().mergeFrom(value); + } else { + rotateEntraIdCertificateContext_ = value; + } + } else { + rotateEntraIdCertificateContextBuilder_.mergeFrom(value); + } + if (rotateEntraIdCertificateContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate Entra ID certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRotateEntraIdCertificateContext() { + bitField0_ = (bitField0_ & ~0x00000001); + rotateEntraIdCertificateContext_ = null; + if (rotateEntraIdCertificateContextBuilder_ != null) { + rotateEntraIdCertificateContextBuilder_.dispose(); + rotateEntraIdCertificateContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate Entra ID certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.Builder + getRotateEntraIdCertificateContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRotateEntraIdCertificateContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Contains details about the rotate Entra ID certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContextOrBuilder + getRotateEntraIdCertificateContextOrBuilder() { + if (rotateEntraIdCertificateContextBuilder_ != null) { + return rotateEntraIdCertificateContextBuilder_.getMessageOrBuilder(); + } else { + return rotateEntraIdCertificateContext_ == null + ? com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.getDefaultInstance() + : rotateEntraIdCertificateContext_; + } + } + + /** + * + * + *
+     * Optional. Contains details about the rotate Entra ID certificate operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext, + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.Builder, + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContextOrBuilder> + internalGetRotateEntraIdCertificateContextFieldBuilder() { + if (rotateEntraIdCertificateContextBuilder_ == null) { + rotateEntraIdCertificateContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext, + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.Builder, + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContextOrBuilder>( + getRotateEntraIdCertificateContext(), getParentForChildren(), isClean()); + rotateEntraIdCertificateContext_ = null; + } + return rotateEntraIdCertificateContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest) + private static final com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest(); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesRotateEntraIdCertificateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateEntraIdCertificateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateEntraIdCertificateRequestOrBuilder.java new file mode 100644 index 000000000000..b44eab21384b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateEntraIdCertificateRequestOrBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesRotateEntraIdCertificateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Contains details about the rotate Entra ID certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rotateEntraIdCertificateContext field is set. + */ + boolean hasRotateEntraIdCertificateContext(); + + /** + * + * + *
+   * Optional. Contains details about the rotate Entra ID certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rotateEntraIdCertificateContext. + */ + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext getRotateEntraIdCertificateContext(); + + /** + * + * + *
+   * Optional. Contains details about the rotate Entra ID certificate operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContextOrBuilder + getRotateEntraIdCertificateContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateServerCaRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateServerCaRequest.java new file mode 100644 index 000000000000..0d2e3ed407c1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateServerCaRequest.java @@ -0,0 +1,710 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Rotate Server CA request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesRotateServerCaRequest} + */ +@com.google.protobuf.Generated +public final class InstancesRotateServerCaRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesRotateServerCaRequest) + InstancesRotateServerCaRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesRotateServerCaRequest"); + } + + // Use InstancesRotateServerCaRequest.newBuilder() to construct. + private InstancesRotateServerCaRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesRotateServerCaRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.class, + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.Builder.class); + } + + private int bitField0_; + public static final int ROTATE_SERVER_CA_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.RotateServerCaContext rotateServerCaContext_; + + /** + * + * + *
+   * Contains details about the rotate server CA operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + * + * @return Whether the rotateServerCaContext field is set. + */ + @java.lang.Override + public boolean hasRotateServerCaContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Contains details about the rotate server CA operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + * + * @return The rotateServerCaContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateServerCaContext getRotateServerCaContext() { + return rotateServerCaContext_ == null + ? com.google.cloud.sql.v1beta4.RotateServerCaContext.getDefaultInstance() + : rotateServerCaContext_; + } + + /** + * + * + *
+   * Contains details about the rotate server CA operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateServerCaContextOrBuilder + getRotateServerCaContextOrBuilder() { + return rotateServerCaContext_ == null + ? com.google.cloud.sql.v1beta4.RotateServerCaContext.getDefaultInstance() + : rotateServerCaContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getRotateServerCaContext()); + } + 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, getRotateServerCaContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest other = + (com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest) obj; + + if (hasRotateServerCaContext() != other.hasRotateServerCaContext()) return false; + if (hasRotateServerCaContext()) { + if (!getRotateServerCaContext().equals(other.getRotateServerCaContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasRotateServerCaContext()) { + hash = (37 * hash) + ROTATE_SERVER_CA_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getRotateServerCaContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Rotate Server CA request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesRotateServerCaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesRotateServerCaRequest) + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.class, + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRotateServerCaContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rotateServerCaContext_ = null; + if (rotateServerCaContextBuilder_ != null) { + rotateServerCaContextBuilder_.dispose(); + rotateServerCaContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest build() { + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest buildPartial() { + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest result = + new com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rotateServerCaContext_ = + rotateServerCaContextBuilder_ == null + ? rotateServerCaContext_ + : rotateServerCaContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest other) { + if (other == com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.getDefaultInstance()) + return this; + if (other.hasRotateServerCaContext()) { + mergeRotateServerCaContext(other.getRotateServerCaContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetRotateServerCaContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.RotateServerCaContext rotateServerCaContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.RotateServerCaContext, + com.google.cloud.sql.v1beta4.RotateServerCaContext.Builder, + com.google.cloud.sql.v1beta4.RotateServerCaContextOrBuilder> + rotateServerCaContextBuilder_; + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + * + * @return Whether the rotateServerCaContext field is set. + */ + public boolean hasRotateServerCaContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + * + * @return The rotateServerCaContext. + */ + public com.google.cloud.sql.v1beta4.RotateServerCaContext getRotateServerCaContext() { + if (rotateServerCaContextBuilder_ == null) { + return rotateServerCaContext_ == null + ? com.google.cloud.sql.v1beta4.RotateServerCaContext.getDefaultInstance() + : rotateServerCaContext_; + } else { + return rotateServerCaContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + */ + public Builder setRotateServerCaContext( + com.google.cloud.sql.v1beta4.RotateServerCaContext value) { + if (rotateServerCaContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rotateServerCaContext_ = value; + } else { + rotateServerCaContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + */ + public Builder setRotateServerCaContext( + com.google.cloud.sql.v1beta4.RotateServerCaContext.Builder builderForValue) { + if (rotateServerCaContextBuilder_ == null) { + rotateServerCaContext_ = builderForValue.build(); + } else { + rotateServerCaContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + */ + public Builder mergeRotateServerCaContext( + com.google.cloud.sql.v1beta4.RotateServerCaContext value) { + if (rotateServerCaContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && rotateServerCaContext_ != null + && rotateServerCaContext_ + != com.google.cloud.sql.v1beta4.RotateServerCaContext.getDefaultInstance()) { + getRotateServerCaContextBuilder().mergeFrom(value); + } else { + rotateServerCaContext_ = value; + } + } else { + rotateServerCaContextBuilder_.mergeFrom(value); + } + if (rotateServerCaContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + */ + public Builder clearRotateServerCaContext() { + bitField0_ = (bitField0_ & ~0x00000001); + rotateServerCaContext_ = null; + if (rotateServerCaContextBuilder_ != null) { + rotateServerCaContextBuilder_.dispose(); + rotateServerCaContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + */ + public com.google.cloud.sql.v1beta4.RotateServerCaContext.Builder + getRotateServerCaContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRotateServerCaContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + */ + public com.google.cloud.sql.v1beta4.RotateServerCaContextOrBuilder + getRotateServerCaContextOrBuilder() { + if (rotateServerCaContextBuilder_ != null) { + return rotateServerCaContextBuilder_.getMessageOrBuilder(); + } else { + return rotateServerCaContext_ == null + ? com.google.cloud.sql.v1beta4.RotateServerCaContext.getDefaultInstance() + : rotateServerCaContext_; + } + } + + /** + * + * + *
+     * Contains details about the rotate server CA operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.RotateServerCaContext, + com.google.cloud.sql.v1beta4.RotateServerCaContext.Builder, + com.google.cloud.sql.v1beta4.RotateServerCaContextOrBuilder> + internalGetRotateServerCaContextFieldBuilder() { + if (rotateServerCaContextBuilder_ == null) { + rotateServerCaContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.RotateServerCaContext, + com.google.cloud.sql.v1beta4.RotateServerCaContext.Builder, + com.google.cloud.sql.v1beta4.RotateServerCaContextOrBuilder>( + getRotateServerCaContext(), getParentForChildren(), isClean()); + rotateServerCaContext_ = null; + } + return rotateServerCaContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesRotateServerCaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesRotateServerCaRequest) + private static final com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest(); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesRotateServerCaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateServerCaRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateServerCaRequestOrBuilder.java new file mode 100644 index 000000000000..77724fe2d791 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateServerCaRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesRotateServerCaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesRotateServerCaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Contains details about the rotate server CA operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + * + * @return Whether the rotateServerCaContext field is set. + */ + boolean hasRotateServerCaContext(); + + /** + * + * + *
+   * Contains details about the rotate server CA operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + * + * @return The rotateServerCaContext. + */ + com.google.cloud.sql.v1beta4.RotateServerCaContext getRotateServerCaContext(); + + /** + * + * + *
+   * Contains details about the rotate server CA operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.RotateServerCaContext rotate_server_ca_context = 1; + */ + com.google.cloud.sql.v1beta4.RotateServerCaContextOrBuilder getRotateServerCaContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateServerCertificateRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateServerCertificateRequest.java new file mode 100644 index 000000000000..0c0d5a0da8f0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateServerCertificateRequest.java @@ -0,0 +1,756 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Rotate Server Certificate request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest} + */ +@com.google.protobuf.Generated +public final class InstancesRotateServerCertificateRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest) + InstancesRotateServerCertificateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesRotateServerCertificateRequest"); + } + + // Use InstancesRotateServerCertificateRequest.newBuilder() to construct. + private InstancesRotateServerCertificateRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesRotateServerCertificateRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.class, + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.Builder.class); + } + + private int bitField0_; + public static final int ROTATE_SERVER_CERTIFICATE_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.RotateServerCertificateContext + rotateServerCertificateContext_; + + /** + * + * + *
+   * Optional. Contains details about the rotate server CA operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rotateServerCertificateContext field is set. + */ + @java.lang.Override + public boolean hasRotateServerCertificateContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Contains details about the rotate server CA operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rotateServerCertificateContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateServerCertificateContext + getRotateServerCertificateContext() { + return rotateServerCertificateContext_ == null + ? com.google.cloud.sql.v1beta4.RotateServerCertificateContext.getDefaultInstance() + : rotateServerCertificateContext_; + } + + /** + * + * + *
+   * Optional. Contains details about the rotate server CA operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateServerCertificateContextOrBuilder + getRotateServerCertificateContextOrBuilder() { + return rotateServerCertificateContext_ == null + ? com.google.cloud.sql.v1beta4.RotateServerCertificateContext.getDefaultInstance() + : rotateServerCertificateContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getRotateServerCertificateContext()); + } + 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, getRotateServerCertificateContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest other = + (com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest) obj; + + if (hasRotateServerCertificateContext() != other.hasRotateServerCertificateContext()) + return false; + if (hasRotateServerCertificateContext()) { + if (!getRotateServerCertificateContext().equals(other.getRotateServerCertificateContext())) + return false; + } + if (!getUnknownFields().equals(other.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 (hasRotateServerCertificateContext()) { + hash = (37 * hash) + ROTATE_SERVER_CERTIFICATE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getRotateServerCertificateContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Rotate Server Certificate request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest) + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.class, + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRotateServerCertificateContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rotateServerCertificateContext_ = null; + if (rotateServerCertificateContextBuilder_ != null) { + rotateServerCertificateContextBuilder_.dispose(); + rotateServerCertificateContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesRotateServerCertificateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest build() { + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest buildPartial() { + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest result = + new com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rotateServerCertificateContext_ = + rotateServerCertificateContextBuilder_ == null + ? rotateServerCertificateContext_ + : rotateServerCertificateContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest other) { + if (other + == com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest + .getDefaultInstance()) return this; + if (other.hasRotateServerCertificateContext()) { + mergeRotateServerCertificateContext(other.getRotateServerCertificateContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetRotateServerCertificateContextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.RotateServerCertificateContext + rotateServerCertificateContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.RotateServerCertificateContext, + com.google.cloud.sql.v1beta4.RotateServerCertificateContext.Builder, + com.google.cloud.sql.v1beta4.RotateServerCertificateContextOrBuilder> + rotateServerCertificateContextBuilder_; + + /** + * + * + *
+     * Optional. Contains details about the rotate server CA operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rotateServerCertificateContext field is set. + */ + public boolean hasRotateServerCertificateContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server CA operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rotateServerCertificateContext. + */ + public com.google.cloud.sql.v1beta4.RotateServerCertificateContext + getRotateServerCertificateContext() { + if (rotateServerCertificateContextBuilder_ == null) { + return rotateServerCertificateContext_ == null + ? com.google.cloud.sql.v1beta4.RotateServerCertificateContext.getDefaultInstance() + : rotateServerCertificateContext_; + } else { + return rotateServerCertificateContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server CA operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRotateServerCertificateContext( + com.google.cloud.sql.v1beta4.RotateServerCertificateContext value) { + if (rotateServerCertificateContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rotateServerCertificateContext_ = value; + } else { + rotateServerCertificateContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server CA operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRotateServerCertificateContext( + com.google.cloud.sql.v1beta4.RotateServerCertificateContext.Builder builderForValue) { + if (rotateServerCertificateContextBuilder_ == null) { + rotateServerCertificateContext_ = builderForValue.build(); + } else { + rotateServerCertificateContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server CA operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRotateServerCertificateContext( + com.google.cloud.sql.v1beta4.RotateServerCertificateContext value) { + if (rotateServerCertificateContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && rotateServerCertificateContext_ != null + && rotateServerCertificateContext_ + != com.google.cloud.sql.v1beta4.RotateServerCertificateContext + .getDefaultInstance()) { + getRotateServerCertificateContextBuilder().mergeFrom(value); + } else { + rotateServerCertificateContext_ = value; + } + } else { + rotateServerCertificateContextBuilder_.mergeFrom(value); + } + if (rotateServerCertificateContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server CA operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRotateServerCertificateContext() { + bitField0_ = (bitField0_ & ~0x00000001); + rotateServerCertificateContext_ = null; + if (rotateServerCertificateContextBuilder_ != null) { + rotateServerCertificateContextBuilder_.dispose(); + rotateServerCertificateContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server CA operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.RotateServerCertificateContext.Builder + getRotateServerCertificateContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRotateServerCertificateContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server CA operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.RotateServerCertificateContextOrBuilder + getRotateServerCertificateContextOrBuilder() { + if (rotateServerCertificateContextBuilder_ != null) { + return rotateServerCertificateContextBuilder_.getMessageOrBuilder(); + } else { + return rotateServerCertificateContext_ == null + ? com.google.cloud.sql.v1beta4.RotateServerCertificateContext.getDefaultInstance() + : rotateServerCertificateContext_; + } + } + + /** + * + * + *
+     * Optional. Contains details about the rotate server CA operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.RotateServerCertificateContext, + com.google.cloud.sql.v1beta4.RotateServerCertificateContext.Builder, + com.google.cloud.sql.v1beta4.RotateServerCertificateContextOrBuilder> + internalGetRotateServerCertificateContextFieldBuilder() { + if (rotateServerCertificateContextBuilder_ == null) { + rotateServerCertificateContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.RotateServerCertificateContext, + com.google.cloud.sql.v1beta4.RotateServerCertificateContext.Builder, + com.google.cloud.sql.v1beta4.RotateServerCertificateContextOrBuilder>( + getRotateServerCertificateContext(), getParentForChildren(), isClean()); + rotateServerCertificateContext_ = null; + } + return rotateServerCertificateContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest) + private static final com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest(); + } + + public static com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesRotateServerCertificateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateServerCertificateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateServerCertificateRequestOrBuilder.java new file mode 100644 index 000000000000..43dae02882d3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesRotateServerCertificateRequestOrBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesRotateServerCertificateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Contains details about the rotate server CA operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rotateServerCertificateContext field is set. + */ + boolean hasRotateServerCertificateContext(); + + /** + * + * + *
+   * Optional. Contains details about the rotate server CA operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rotateServerCertificateContext. + */ + com.google.cloud.sql.v1beta4.RotateServerCertificateContext getRotateServerCertificateContext(); + + /** + * + * + *
+   * Optional. Contains details about the rotate server CA operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.RotateServerCertificateContext rotate_server_certificate_context = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.RotateServerCertificateContextOrBuilder + getRotateServerCertificateContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesTruncateLogRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesTruncateLogRequest.java new file mode 100644 index 000000000000..eda46ca39725 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesTruncateLogRequest.java @@ -0,0 +1,705 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance truncate log request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesTruncateLogRequest} + */ +@com.google.protobuf.Generated +public final class InstancesTruncateLogRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.InstancesTruncateLogRequest) + InstancesTruncateLogRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstancesTruncateLogRequest"); + } + + // Use InstancesTruncateLogRequest.newBuilder() to construct. + private InstancesTruncateLogRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private InstancesTruncateLogRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesTruncateLogRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesTruncateLogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.class, + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.Builder.class); + } + + private int bitField0_; + public static final int TRUNCATE_LOG_CONTEXT_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.TruncateLogContext truncateLogContext_; + + /** + * + * + *
+   * Contains details about the truncate log operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + * + * @return Whether the truncateLogContext field is set. + */ + @java.lang.Override + public boolean hasTruncateLogContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Contains details about the truncate log operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + * + * @return The truncateLogContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.TruncateLogContext getTruncateLogContext() { + return truncateLogContext_ == null + ? com.google.cloud.sql.v1beta4.TruncateLogContext.getDefaultInstance() + : truncateLogContext_; + } + + /** + * + * + *
+   * Contains details about the truncate log operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.TruncateLogContextOrBuilder getTruncateLogContextOrBuilder() { + return truncateLogContext_ == null + ? com.google.cloud.sql.v1beta4.TruncateLogContext.getDefaultInstance() + : truncateLogContext_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getTruncateLogContext()); + } + 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, getTruncateLogContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest other = + (com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest) obj; + + if (hasTruncateLogContext() != other.hasTruncateLogContext()) return false; + if (hasTruncateLogContext()) { + if (!getTruncateLogContext().equals(other.getTruncateLogContext())) return false; + } + if (!getUnknownFields().equals(other.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 (hasTruncateLogContext()) { + hash = (37 * hash) + TRUNCATE_LOG_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getTruncateLogContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance truncate log request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.InstancesTruncateLogRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.InstancesTruncateLogRequest) + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesTruncateLogRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesTruncateLogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.class, + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTruncateLogContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + truncateLogContext_ = null; + if (truncateLogContextBuilder_ != null) { + truncateLogContextBuilder_.dispose(); + truncateLogContextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_InstancesTruncateLogRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest build() { + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest buildPartial() { + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest result = + new com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.truncateLogContext_ = + truncateLogContextBuilder_ == null + ? truncateLogContext_ + : truncateLogContextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest other) { + if (other == com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.getDefaultInstance()) + return this; + if (other.hasTruncateLogContext()) { + mergeTruncateLogContext(other.getTruncateLogContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetTruncateLogContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.TruncateLogContext truncateLogContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.TruncateLogContext, + com.google.cloud.sql.v1beta4.TruncateLogContext.Builder, + com.google.cloud.sql.v1beta4.TruncateLogContextOrBuilder> + truncateLogContextBuilder_; + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + * + * @return Whether the truncateLogContext field is set. + */ + public boolean hasTruncateLogContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + * + * @return The truncateLogContext. + */ + public com.google.cloud.sql.v1beta4.TruncateLogContext getTruncateLogContext() { + if (truncateLogContextBuilder_ == null) { + return truncateLogContext_ == null + ? com.google.cloud.sql.v1beta4.TruncateLogContext.getDefaultInstance() + : truncateLogContext_; + } else { + return truncateLogContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + */ + public Builder setTruncateLogContext(com.google.cloud.sql.v1beta4.TruncateLogContext value) { + if (truncateLogContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + truncateLogContext_ = value; + } else { + truncateLogContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + */ + public Builder setTruncateLogContext( + com.google.cloud.sql.v1beta4.TruncateLogContext.Builder builderForValue) { + if (truncateLogContextBuilder_ == null) { + truncateLogContext_ = builderForValue.build(); + } else { + truncateLogContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + */ + public Builder mergeTruncateLogContext(com.google.cloud.sql.v1beta4.TruncateLogContext value) { + if (truncateLogContextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && truncateLogContext_ != null + && truncateLogContext_ + != com.google.cloud.sql.v1beta4.TruncateLogContext.getDefaultInstance()) { + getTruncateLogContextBuilder().mergeFrom(value); + } else { + truncateLogContext_ = value; + } + } else { + truncateLogContextBuilder_.mergeFrom(value); + } + if (truncateLogContext_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + */ + public Builder clearTruncateLogContext() { + bitField0_ = (bitField0_ & ~0x00000001); + truncateLogContext_ = null; + if (truncateLogContextBuilder_ != null) { + truncateLogContextBuilder_.dispose(); + truncateLogContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + */ + public com.google.cloud.sql.v1beta4.TruncateLogContext.Builder getTruncateLogContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetTruncateLogContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + */ + public com.google.cloud.sql.v1beta4.TruncateLogContextOrBuilder + getTruncateLogContextOrBuilder() { + if (truncateLogContextBuilder_ != null) { + return truncateLogContextBuilder_.getMessageOrBuilder(); + } else { + return truncateLogContext_ == null + ? com.google.cloud.sql.v1beta4.TruncateLogContext.getDefaultInstance() + : truncateLogContext_; + } + } + + /** + * + * + *
+     * Contains details about the truncate log operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.TruncateLogContext, + com.google.cloud.sql.v1beta4.TruncateLogContext.Builder, + com.google.cloud.sql.v1beta4.TruncateLogContextOrBuilder> + internalGetTruncateLogContextFieldBuilder() { + if (truncateLogContextBuilder_ == null) { + truncateLogContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.TruncateLogContext, + com.google.cloud.sql.v1beta4.TruncateLogContext.Builder, + com.google.cloud.sql.v1beta4.TruncateLogContextOrBuilder>( + getTruncateLogContext(), getParentForChildren(), isClean()); + truncateLogContext_ = null; + } + return truncateLogContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.InstancesTruncateLogRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.InstancesTruncateLogRequest) + private static final com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest(); + } + + public static com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancesTruncateLogRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesTruncateLogRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesTruncateLogRequestOrBuilder.java new file mode 100644 index 000000000000..2990c95f99d0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/InstancesTruncateLogRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface InstancesTruncateLogRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.InstancesTruncateLogRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Contains details about the truncate log operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + * + * @return Whether the truncateLogContext field is set. + */ + boolean hasTruncateLogContext(); + + /** + * + * + *
+   * Contains details about the truncate log operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + * + * @return The truncateLogContext. + */ + com.google.cloud.sql.v1beta4.TruncateLogContext getTruncateLogContext(); + + /** + * + * + *
+   * Contains details about the truncate log operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.TruncateLogContext truncate_log_context = 1; + */ + com.google.cloud.sql.v1beta4.TruncateLogContextOrBuilder getTruncateLogContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/IpConfiguration.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/IpConfiguration.java new file mode 100644 index 000000000000..255c72b0d73b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/IpConfiguration.java @@ -0,0 +1,4616 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * IP Management configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.IpConfiguration} + */ +@com.google.protobuf.Generated +public final class IpConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.IpConfiguration) + IpConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "IpConfiguration"); + } + + // Use IpConfiguration.newBuilder() to construct. + private IpConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private IpConfiguration() { + privateNetwork_ = ""; + authorizedNetworks_ = java.util.Collections.emptyList(); + allocatedIpRange_ = ""; + sslMode_ = 0; + serverCaMode_ = 0; + customSubjectAlternativeNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + serverCaPool_ = ""; + serverCertificateRotationMode_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_IpConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_IpConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.IpConfiguration.class, + com.google.cloud.sql.v1beta4.IpConfiguration.Builder.class); + } + + /** + * + * + *
+   * The SSL options for database connections.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.IpConfiguration.SslMode} + */ + public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The SSL mode is unknown.
+     * 
+ * + * SSL_MODE_UNSPECIFIED = 0; + */ + SSL_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Allow non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL connections to MySQL and PostgreSQL, the client certificate
+     * isn't verified.
+     *
+     * When this value is used, the legacy `require_ssl` flag must be false or
+     * cleared to avoid a conflict between the values of the two flags.
+     * 
+ * + * ALLOW_UNENCRYPTED_AND_ENCRYPTED = 1; + */ + ALLOW_UNENCRYPTED_AND_ENCRYPTED(1), + /** + * + * + *
+     * Only allow connections encrypted with SSL/TLS.
+     * For SSL connections to MySQL and PostgreSQL, the client certificate
+     * isn't verified.
+     *
+     * When this value is used, the legacy `require_ssl` flag must be false or
+     * cleared to avoid a conflict between the values of the two flags.
+     * 
+ * + * ENCRYPTED_ONLY = 2; + */ + ENCRYPTED_ONLY(2), + /** + * + * + *
+     * Only allow connections encrypted with SSL/TLS and with valid
+     * client certificates.
+     *
+     * When this value is used, the legacy `require_ssl` flag must be true or
+     * cleared to avoid the conflict between values of two flags.
+     * PostgreSQL clients or users that connect using IAM database
+     * authentication must use either the
+     * [Cloud SQL Auth
+     * Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
+     * [Cloud SQL
+     * Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
+     * to enforce client identity verification.
+     *
+     * Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
+     * 
+ * + * TRUSTED_CLIENT_CERTIFICATE_REQUIRED = 3; + */ + TRUSTED_CLIENT_CERTIFICATE_REQUIRED(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslMode"); + } + + /** + * + * + *
+     * The SSL mode is unknown.
+     * 
+ * + * SSL_MODE_UNSPECIFIED = 0; + */ + public static final int SSL_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Allow non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL connections to MySQL and PostgreSQL, the client certificate
+     * isn't verified.
+     *
+     * When this value is used, the legacy `require_ssl` flag must be false or
+     * cleared to avoid a conflict between the values of the two flags.
+     * 
+ * + * ALLOW_UNENCRYPTED_AND_ENCRYPTED = 1; + */ + public static final int ALLOW_UNENCRYPTED_AND_ENCRYPTED_VALUE = 1; + + /** + * + * + *
+     * Only allow connections encrypted with SSL/TLS.
+     * For SSL connections to MySQL and PostgreSQL, the client certificate
+     * isn't verified.
+     *
+     * When this value is used, the legacy `require_ssl` flag must be false or
+     * cleared to avoid a conflict between the values of the two flags.
+     * 
+ * + * ENCRYPTED_ONLY = 2; + */ + public static final int ENCRYPTED_ONLY_VALUE = 2; + + /** + * + * + *
+     * Only allow connections encrypted with SSL/TLS and with valid
+     * client certificates.
+     *
+     * When this value is used, the legacy `require_ssl` flag must be true or
+     * cleared to avoid the conflict between values of two flags.
+     * PostgreSQL clients or users that connect using IAM database
+     * authentication must use either the
+     * [Cloud SQL Auth
+     * Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
+     * [Cloud SQL
+     * Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
+     * to enforce client identity verification.
+     *
+     * Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
+     * 
+ * + * TRUSTED_CLIENT_CERTIFICATE_REQUIRED = 3; + */ + public static final int TRUSTED_CLIENT_CERTIFICATE_REQUIRED_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SslMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SslMode forNumber(int value) { + switch (value) { + case 0: + return SSL_MODE_UNSPECIFIED; + case 1: + return ALLOW_UNENCRYPTED_AND_ENCRYPTED; + case 2: + return ENCRYPTED_ONLY; + case 3: + return TRUSTED_CLIENT_CERTIFICATE_REQUIRED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SslMode findValueByNumber(int number) { + return SslMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.IpConfiguration.getDescriptor().getEnumTypes().get(0); + } + + private static final SslMode[] VALUES = values(); + + public static SslMode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SslMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.IpConfiguration.SslMode) + } + + /** + * + * + *
+   * Various Certificate Authority (CA) modes for certificate signing.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.IpConfiguration.CaMode} + */ + public enum CaMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * CA mode is unspecified. It is effectively the same as
+     * `GOOGLE_MANAGED_INTERNAL_CA`.
+     * 
+ * + * CA_MODE_UNSPECIFIED = 0; + */ + CA_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Google-managed self-signed internal CA.
+     * 
+ * + * GOOGLE_MANAGED_INTERNAL_CA = 1; + */ + GOOGLE_MANAGED_INTERNAL_CA(1), + /** + * + * + *
+     * Google-managed regional CA part of root CA hierarchy hosted on Google
+     * Cloud's Certificate Authority Service (CAS).
+     * 
+ * + * GOOGLE_MANAGED_CAS_CA = 2; + */ + GOOGLE_MANAGED_CAS_CA(2), + /** + * + * + *
+     * Customer-managed CA hosted on Google Cloud's Certificate Authority
+     * Service (CAS).
+     * 
+ * + * CUSTOMER_MANAGED_CAS_CA = 3; + */ + CUSTOMER_MANAGED_CAS_CA(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CaMode"); + } + + /** + * + * + *
+     * CA mode is unspecified. It is effectively the same as
+     * `GOOGLE_MANAGED_INTERNAL_CA`.
+     * 
+ * + * CA_MODE_UNSPECIFIED = 0; + */ + public static final int CA_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Google-managed self-signed internal CA.
+     * 
+ * + * GOOGLE_MANAGED_INTERNAL_CA = 1; + */ + public static final int GOOGLE_MANAGED_INTERNAL_CA_VALUE = 1; + + /** + * + * + *
+     * Google-managed regional CA part of root CA hierarchy hosted on Google
+     * Cloud's Certificate Authority Service (CAS).
+     * 
+ * + * GOOGLE_MANAGED_CAS_CA = 2; + */ + public static final int GOOGLE_MANAGED_CAS_CA_VALUE = 2; + + /** + * + * + *
+     * Customer-managed CA hosted on Google Cloud's Certificate Authority
+     * Service (CAS).
+     * 
+ * + * CUSTOMER_MANAGED_CAS_CA = 3; + */ + public static final int CUSTOMER_MANAGED_CAS_CA_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CaMode 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 CaMode forNumber(int value) { + switch (value) { + case 0: + return CA_MODE_UNSPECIFIED; + case 1: + return GOOGLE_MANAGED_INTERNAL_CA; + case 2: + return GOOGLE_MANAGED_CAS_CA; + case 3: + return CUSTOMER_MANAGED_CAS_CA; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CaMode findValueByNumber(int number) { + return CaMode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.IpConfiguration.getDescriptor().getEnumTypes().get(1); + } + + private static final CaMode[] VALUES = values(); + + public static CaMode 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 CaMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.IpConfiguration.CaMode) + } + + /** + * + * + *
+   * Settings for automatic server certificate rotation.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode} + */ + public enum ServerCertificateRotationMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified: no automatic server certificate rotation.
+     * 
+ * + * SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED = 0; + */ + SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * No automatic server certificate rotation. The user must [manage server
+     * certificate
+     * rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas)
+     * on their side.
+     * 
+ * + * NO_AUTOMATIC_ROTATION = 1; + */ + NO_AUTOMATIC_ROTATION(1), + /** + * + * + *
+     * Automatic server certificate rotation during Cloud SQL scheduled
+     * maintenance or self-service maintenance updates. Requires
+     * `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or
+     * `CUSTOMER_MANAGED_CAS_CA`.
+     * 
+ * + * AUTOMATIC_ROTATION_DURING_MAINTENANCE = 2; + */ + AUTOMATIC_ROTATION_DURING_MAINTENANCE(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ServerCertificateRotationMode"); + } + + /** + * + * + *
+     * Unspecified: no automatic server certificate rotation.
+     * 
+ * + * SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED = 0; + */ + public static final int SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * No automatic server certificate rotation. The user must [manage server
+     * certificate
+     * rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas)
+     * on their side.
+     * 
+ * + * NO_AUTOMATIC_ROTATION = 1; + */ + public static final int NO_AUTOMATIC_ROTATION_VALUE = 1; + + /** + * + * + *
+     * Automatic server certificate rotation during Cloud SQL scheduled
+     * maintenance or self-service maintenance updates. Requires
+     * `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or
+     * `CUSTOMER_MANAGED_CAS_CA`.
+     * 
+ * + * AUTOMATIC_ROTATION_DURING_MAINTENANCE = 2; + */ + public static final int AUTOMATIC_ROTATION_DURING_MAINTENANCE_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 ServerCertificateRotationMode 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 ServerCertificateRotationMode forNumber(int value) { + switch (value) { + case 0: + return SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED; + case 1: + return NO_AUTOMATIC_ROTATION; + case 2: + return AUTOMATIC_ROTATION_DURING_MAINTENANCE; + 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 ServerCertificateRotationMode findValueByNumber(int number) { + return ServerCertificateRotationMode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.IpConfiguration.getDescriptor().getEnumTypes().get(2); + } + + private static final ServerCertificateRotationMode[] VALUES = values(); + + public static ServerCertificateRotationMode 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 ServerCertificateRotationMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode) + } + + private int bitField0_; + public static final int IPV4_ENABLED_FIELD_NUMBER = 1; + private com.google.protobuf.BoolValue ipv4Enabled_; + + /** + * + * + *
+   * Whether the instance is assigned a public IP address or not.
+   * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + * + * @return Whether the ipv4Enabled field is set. + */ + @java.lang.Override + public boolean hasIpv4Enabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Whether the instance is assigned a public IP address or not.
+   * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + * + * @return The ipv4Enabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getIpv4Enabled() { + return ipv4Enabled_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : ipv4Enabled_; + } + + /** + * + * + *
+   * Whether the instance is assigned a public IP address or not.
+   * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getIpv4EnabledOrBuilder() { + return ipv4Enabled_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : ipv4Enabled_; + } + + public static final int PRIVATE_NETWORK_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object privateNetwork_ = ""; + + /** + * + * + *
+   * The resource link for the VPC network from which the Cloud SQL instance is
+   * accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`. This setting can
+   * be updated, but it cannot be removed after it is set.
+   * 
+ * + * string private_network = 2; + * + * @return The privateNetwork. + */ + @java.lang.Override + public java.lang.String getPrivateNetwork() { + java.lang.Object ref = privateNetwork_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateNetwork_ = s; + return s; + } + } + + /** + * + * + *
+   * The resource link for the VPC network from which the Cloud SQL instance is
+   * accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`. This setting can
+   * be updated, but it cannot be removed after it is set.
+   * 
+ * + * string private_network = 2; + * + * @return The bytes for privateNetwork. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrivateNetworkBytes() { + java.lang.Object ref = privateNetwork_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUIRE_SSL_FIELD_NUMBER = 3; + private com.google.protobuf.BoolValue requireSsl_; + + /** + * + * + *
+   * Use `ssl_mode` instead.
+   *
+   * Whether SSL/TLS connections over IP are enforced.
+   * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+   * For SSL/TLS connections, the client certificate won't be verified. If
+   * set to true, then only allow connections encrypted with SSL/TLS and with
+   * valid client certificates. If you want to enforce SSL/TLS without enforcing
+   * the requirement for valid client certificates, then use the `ssl_mode` flag
+   * instead of the legacy `require_ssl` flag.
+   * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + * + * @return Whether the requireSsl field is set. + */ + @java.lang.Override + public boolean hasRequireSsl() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Use `ssl_mode` instead.
+   *
+   * Whether SSL/TLS connections over IP are enforced.
+   * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+   * For SSL/TLS connections, the client certificate won't be verified. If
+   * set to true, then only allow connections encrypted with SSL/TLS and with
+   * valid client certificates. If you want to enforce SSL/TLS without enforcing
+   * the requirement for valid client certificates, then use the `ssl_mode` flag
+   * instead of the legacy `require_ssl` flag.
+   * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + * + * @return The requireSsl. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getRequireSsl() { + return requireSsl_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : requireSsl_; + } + + /** + * + * + *
+   * Use `ssl_mode` instead.
+   *
+   * Whether SSL/TLS connections over IP are enforced.
+   * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+   * For SSL/TLS connections, the client certificate won't be verified. If
+   * set to true, then only allow connections encrypted with SSL/TLS and with
+   * valid client certificates. If you want to enforce SSL/TLS without enforcing
+   * the requirement for valid client certificates, then use the `ssl_mode` flag
+   * instead of the legacy `require_ssl` flag.
+   * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getRequireSslOrBuilder() { + return requireSsl_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : requireSsl_; + } + + public static final int AUTHORIZED_NETWORKS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List authorizedNetworks_; + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + @java.lang.Override + public java.util.List getAuthorizedNetworksList() { + return authorizedNetworks_; + } + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + @java.lang.Override + public java.util.List + getAuthorizedNetworksOrBuilderList() { + return authorizedNetworks_; + } + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + @java.lang.Override + public int getAuthorizedNetworksCount() { + return authorizedNetworks_.size(); + } + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AclEntry getAuthorizedNetworks(int index) { + return authorizedNetworks_.get(index); + } + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AclEntryOrBuilder getAuthorizedNetworksOrBuilder(int index) { + return authorizedNetworks_.get(index); + } + + public static final int ALLOCATED_IP_RANGE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object allocatedIpRange_ = ""; + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the instance ip
+   * will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The allocatedIpRange. + */ + @java.lang.Override + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the instance ip
+   * will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The bytes for allocatedIpRange. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLE_PRIVATE_PATH_FOR_GOOGLE_CLOUD_SERVICES_FIELD_NUMBER = 7; + private com.google.protobuf.BoolValue enablePrivatePathForGoogleCloudServices_; + + /** + * + * + *
+   * Controls connectivity to private IP instances from Google services,
+   * such as BigQuery.
+   * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + * + * @return Whether the enablePrivatePathForGoogleCloudServices field is set. + */ + @java.lang.Override + public boolean hasEnablePrivatePathForGoogleCloudServices() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Controls connectivity to private IP instances from Google services,
+   * such as BigQuery.
+   * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + * + * @return The enablePrivatePathForGoogleCloudServices. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnablePrivatePathForGoogleCloudServices() { + return enablePrivatePathForGoogleCloudServices_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePrivatePathForGoogleCloudServices_; + } + + /** + * + * + *
+   * Controls connectivity to private IP instances from Google services,
+   * such as BigQuery.
+   * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder + getEnablePrivatePathForGoogleCloudServicesOrBuilder() { + return enablePrivatePathForGoogleCloudServices_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePrivatePathForGoogleCloudServices_; + } + + public static final int SSL_MODE_FIELD_NUMBER = 8; + private int sslMode_ = 0; + + /** + * + * + *
+   * Specify how SSL/TLS is enforced in database connections. If you must use
+   * the `require_ssl` flag for backward compatibility, then only the following
+   * value pairs are valid:
+   *
+   * For PostgreSQL and MySQL:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+   * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+   *
+   * For SQL Server:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+   *
+   * The value of `ssl_mode` has priority over the value of `require_ssl`.
+   *
+   * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+   * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+   * connections, while `require_ssl=false` means accept both non-SSL
+   * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+   * `ssl_mode` and accepts only SSL connections.
+   * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration.SslMode ssl_mode = 8; + * + * @return The enum numeric value on the wire for sslMode. + */ + @java.lang.Override + public int getSslModeValue() { + return sslMode_; + } + + /** + * + * + *
+   * Specify how SSL/TLS is enforced in database connections. If you must use
+   * the `require_ssl` flag for backward compatibility, then only the following
+   * value pairs are valid:
+   *
+   * For PostgreSQL and MySQL:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+   * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+   *
+   * For SQL Server:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+   *
+   * The value of `ssl_mode` has priority over the value of `require_ssl`.
+   *
+   * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+   * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+   * connections, while `require_ssl=false` means accept both non-SSL
+   * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+   * `ssl_mode` and accepts only SSL connections.
+   * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration.SslMode ssl_mode = 8; + * + * @return The sslMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpConfiguration.SslMode getSslMode() { + com.google.cloud.sql.v1beta4.IpConfiguration.SslMode result = + com.google.cloud.sql.v1beta4.IpConfiguration.SslMode.forNumber(sslMode_); + return result == null + ? com.google.cloud.sql.v1beta4.IpConfiguration.SslMode.UNRECOGNIZED + : result; + } + + public static final int PSC_CONFIG_FIELD_NUMBER = 9; + private com.google.cloud.sql.v1beta4.PscConfig pscConfig_; + + /** + * + * + *
+   * PSC settings for this instance.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + * + * @return Whether the pscConfig field is set. + */ + @java.lang.Override + public boolean hasPscConfig() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * PSC settings for this instance.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + * + * @return The pscConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PscConfig getPscConfig() { + return pscConfig_ == null + ? com.google.cloud.sql.v1beta4.PscConfig.getDefaultInstance() + : pscConfig_; + } + + /** + * + * + *
+   * PSC settings for this instance.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PscConfigOrBuilder getPscConfigOrBuilder() { + return pscConfig_ == null + ? com.google.cloud.sql.v1beta4.PscConfig.getDefaultInstance() + : pscConfig_; + } + + public static final int SERVER_CA_MODE_FIELD_NUMBER = 10; + private int serverCaMode_ = 0; + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return Whether the serverCaMode field is set. + */ + @java.lang.Override + public boolean hasServerCaMode() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return The enum numeric value on the wire for serverCaMode. + */ + @java.lang.Override + public int getServerCaModeValue() { + return serverCaMode_; + } + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return The serverCaMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpConfiguration.CaMode getServerCaMode() { + com.google.cloud.sql.v1beta4.IpConfiguration.CaMode result = + com.google.cloud.sql.v1beta4.IpConfiguration.CaMode.forNumber(serverCaMode_); + return result == null + ? com.google.cloud.sql.v1beta4.IpConfiguration.CaMode.UNRECOGNIZED + : result; + } + + public static final int CUSTOM_SUBJECT_ALTERNATIVE_NAMES_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList customSubjectAlternativeNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the customSubjectAlternativeNames. + */ + public com.google.protobuf.ProtocolStringList getCustomSubjectAlternativeNamesList() { + return customSubjectAlternativeNames_; + } + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of customSubjectAlternativeNames. + */ + public int getCustomSubjectAlternativeNamesCount() { + return customSubjectAlternativeNames_.size(); + } + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The customSubjectAlternativeNames at the given index. + */ + public java.lang.String getCustomSubjectAlternativeNames(int index) { + return customSubjectAlternativeNames_.get(index); + } + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the customSubjectAlternativeNames at the given index. + */ + public com.google.protobuf.ByteString getCustomSubjectAlternativeNamesBytes(int index) { + return customSubjectAlternativeNames_.getByteString(index); + } + + public static final int SERVER_CA_POOL_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object serverCaPool_ = ""; + + /** + * + * + *
+   * Optional. The resource name of the server CA pool for an instance with
+   * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+   * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+   * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the serverCaPool field is set. + */ + @java.lang.Override + public boolean hasServerCaPool() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Optional. The resource name of the server CA pool for an instance with
+   * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+   * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+   * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The serverCaPool. + */ + @java.lang.Override + public java.lang.String getServerCaPool() { + java.lang.Object ref = serverCaPool_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serverCaPool_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The resource name of the server CA pool for an instance with
+   * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+   * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+   * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for serverCaPool. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServerCaPoolBytes() { + java.lang.Object ref = serverCaPool_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverCaPool_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVER_CERTIFICATE_ROTATION_MODE_FIELD_NUMBER = 16; + private int serverCertificateRotationMode_ = 0; + + /** + * + * + *
+   * Optional. Controls the automatic server certificate rotation feature. This
+   * feature is disabled by default. When enabled, the server certificate will
+   * be automatically rotated during Cloud SQL scheduled maintenance or
+   * self-service maintenance updates up to six months before it expires. This
+   * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+   * or CUSTOMER_MANAGED_CAS_CA.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the serverCertificateRotationMode field is set. + */ + @java.lang.Override + public boolean hasServerCertificateRotationMode() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Optional. Controls the automatic server certificate rotation feature. This
+   * feature is disabled by default. When enabled, the server certificate will
+   * be automatically rotated during Cloud SQL scheduled maintenance or
+   * self-service maintenance updates up to six months before it expires. This
+   * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+   * or CUSTOMER_MANAGED_CAS_CA.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for serverCertificateRotationMode. + */ + @java.lang.Override + public int getServerCertificateRotationModeValue() { + return serverCertificateRotationMode_; + } + + /** + * + * + *
+   * Optional. Controls the automatic server certificate rotation feature. This
+   * feature is disabled by default. When enabled, the server certificate will
+   * be automatically rotated during Cloud SQL scheduled maintenance or
+   * self-service maintenance updates up to six months before it expires. This
+   * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+   * or CUSTOMER_MANAGED_CAS_CA.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The serverCertificateRotationMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode + getServerCertificateRotationMode() { + com.google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode result = + com.google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode.forNumber( + serverCertificateRotationMode_); + return result == null + ? com.google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getIpv4Enabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateNetwork_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, privateNetwork_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getRequireSsl()); + } + for (int i = 0; i < authorizedNetworks_.size(); i++) { + output.writeMessage(4, authorizedNetworks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatedIpRange_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, allocatedIpRange_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(7, getEnablePrivatePathForGoogleCloudServices()); + } + if (sslMode_ + != com.google.cloud.sql.v1beta4.IpConfiguration.SslMode.SSL_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, sslMode_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(9, getPscConfig()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeEnum(10, serverCaMode_); + } + for (int i = 0; i < customSubjectAlternativeNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 11, customSubjectAlternativeNames_.getRaw(i)); + } + if (((bitField0_ & 0x00000020) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, serverCaPool_); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeEnum(16, serverCertificateRotationMode_); + } + 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, getIpv4Enabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(privateNetwork_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, privateNetwork_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequireSsl()); + } + for (int i = 0; i < authorizedNetworks_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, authorizedNetworks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatedIpRange_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, allocatedIpRange_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, getEnablePrivatePathForGoogleCloudServices()); + } + if (sslMode_ + != com.google.cloud.sql.v1beta4.IpConfiguration.SslMode.SSL_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, sslMode_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getPscConfig()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, serverCaMode_); + } + { + int dataSize = 0; + for (int i = 0; i < customSubjectAlternativeNames_.size(); i++) { + dataSize += computeStringSizeNoTag(customSubjectAlternativeNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getCustomSubjectAlternativeNamesList().size(); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, serverCaPool_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize(16, serverCertificateRotationMode_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.IpConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.IpConfiguration other = + (com.google.cloud.sql.v1beta4.IpConfiguration) obj; + + if (hasIpv4Enabled() != other.hasIpv4Enabled()) return false; + if (hasIpv4Enabled()) { + if (!getIpv4Enabled().equals(other.getIpv4Enabled())) return false; + } + if (!getPrivateNetwork().equals(other.getPrivateNetwork())) return false; + if (hasRequireSsl() != other.hasRequireSsl()) return false; + if (hasRequireSsl()) { + if (!getRequireSsl().equals(other.getRequireSsl())) return false; + } + if (!getAuthorizedNetworksList().equals(other.getAuthorizedNetworksList())) return false; + if (!getAllocatedIpRange().equals(other.getAllocatedIpRange())) return false; + if (hasEnablePrivatePathForGoogleCloudServices() + != other.hasEnablePrivatePathForGoogleCloudServices()) return false; + if (hasEnablePrivatePathForGoogleCloudServices()) { + if (!getEnablePrivatePathForGoogleCloudServices() + .equals(other.getEnablePrivatePathForGoogleCloudServices())) return false; + } + if (sslMode_ != other.sslMode_) return false; + if (hasPscConfig() != other.hasPscConfig()) return false; + if (hasPscConfig()) { + if (!getPscConfig().equals(other.getPscConfig())) return false; + } + if (hasServerCaMode() != other.hasServerCaMode()) return false; + if (hasServerCaMode()) { + if (serverCaMode_ != other.serverCaMode_) return false; + } + if (!getCustomSubjectAlternativeNamesList() + .equals(other.getCustomSubjectAlternativeNamesList())) return false; + if (hasServerCaPool() != other.hasServerCaPool()) return false; + if (hasServerCaPool()) { + if (!getServerCaPool().equals(other.getServerCaPool())) return false; + } + if (hasServerCertificateRotationMode() != other.hasServerCertificateRotationMode()) + return false; + if (hasServerCertificateRotationMode()) { + if (serverCertificateRotationMode_ != other.serverCertificateRotationMode_) return false; + } + if (!getUnknownFields().equals(other.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 (hasIpv4Enabled()) { + hash = (37 * hash) + IPV4_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getIpv4Enabled().hashCode(); + } + hash = (37 * hash) + PRIVATE_NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getPrivateNetwork().hashCode(); + if (hasRequireSsl()) { + hash = (37 * hash) + REQUIRE_SSL_FIELD_NUMBER; + hash = (53 * hash) + getRequireSsl().hashCode(); + } + if (getAuthorizedNetworksCount() > 0) { + hash = (37 * hash) + AUTHORIZED_NETWORKS_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedNetworksList().hashCode(); + } + hash = (37 * hash) + ALLOCATED_IP_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getAllocatedIpRange().hashCode(); + if (hasEnablePrivatePathForGoogleCloudServices()) { + hash = (37 * hash) + ENABLE_PRIVATE_PATH_FOR_GOOGLE_CLOUD_SERVICES_FIELD_NUMBER; + hash = (53 * hash) + getEnablePrivatePathForGoogleCloudServices().hashCode(); + } + hash = (37 * hash) + SSL_MODE_FIELD_NUMBER; + hash = (53 * hash) + sslMode_; + if (hasPscConfig()) { + hash = (37 * hash) + PSC_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPscConfig().hashCode(); + } + if (hasServerCaMode()) { + hash = (37 * hash) + SERVER_CA_MODE_FIELD_NUMBER; + hash = (53 * hash) + serverCaMode_; + } + if (getCustomSubjectAlternativeNamesCount() > 0) { + hash = (37 * hash) + CUSTOM_SUBJECT_ALTERNATIVE_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getCustomSubjectAlternativeNamesList().hashCode(); + } + if (hasServerCaPool()) { + hash = (37 * hash) + SERVER_CA_POOL_FIELD_NUMBER; + hash = (53 * hash) + getServerCaPool().hashCode(); + } + if (hasServerCertificateRotationMode()) { + hash = (37 * hash) + SERVER_CERTIFICATE_ROTATION_MODE_FIELD_NUMBER; + hash = (53 * hash) + serverCertificateRotationMode_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.IpConfiguration parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.IpConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.IpConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.IpConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.IpConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.IpConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.IpConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.IpConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.IpConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.IpConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.IpConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.IpConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.IpConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * IP Management configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.IpConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.IpConfiguration) + com.google.cloud.sql.v1beta4.IpConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_IpConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_IpConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.IpConfiguration.class, + com.google.cloud.sql.v1beta4.IpConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.IpConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetIpv4EnabledFieldBuilder(); + internalGetRequireSslFieldBuilder(); + internalGetAuthorizedNetworksFieldBuilder(); + internalGetEnablePrivatePathForGoogleCloudServicesFieldBuilder(); + internalGetPscConfigFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + ipv4Enabled_ = null; + if (ipv4EnabledBuilder_ != null) { + ipv4EnabledBuilder_.dispose(); + ipv4EnabledBuilder_ = null; + } + privateNetwork_ = ""; + requireSsl_ = null; + if (requireSslBuilder_ != null) { + requireSslBuilder_.dispose(); + requireSslBuilder_ = null; + } + if (authorizedNetworksBuilder_ == null) { + authorizedNetworks_ = java.util.Collections.emptyList(); + } else { + authorizedNetworks_ = null; + authorizedNetworksBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + allocatedIpRange_ = ""; + enablePrivatePathForGoogleCloudServices_ = null; + if (enablePrivatePathForGoogleCloudServicesBuilder_ != null) { + enablePrivatePathForGoogleCloudServicesBuilder_.dispose(); + enablePrivatePathForGoogleCloudServicesBuilder_ = null; + } + sslMode_ = 0; + pscConfig_ = null; + if (pscConfigBuilder_ != null) { + pscConfigBuilder_.dispose(); + pscConfigBuilder_ = null; + } + serverCaMode_ = 0; + customSubjectAlternativeNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + serverCaPool_ = ""; + serverCertificateRotationMode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_IpConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpConfiguration getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.IpConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpConfiguration build() { + com.google.cloud.sql.v1beta4.IpConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpConfiguration buildPartial() { + com.google.cloud.sql.v1beta4.IpConfiguration result = + new com.google.cloud.sql.v1beta4.IpConfiguration(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1beta4.IpConfiguration result) { + if (authorizedNetworksBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + authorizedNetworks_ = java.util.Collections.unmodifiableList(authorizedNetworks_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.authorizedNetworks_ = authorizedNetworks_; + } else { + result.authorizedNetworks_ = authorizedNetworksBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.IpConfiguration result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ipv4Enabled_ = + ipv4EnabledBuilder_ == null ? ipv4Enabled_ : ipv4EnabledBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.privateNetwork_ = privateNetwork_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requireSsl_ = requireSslBuilder_ == null ? requireSsl_ : requireSslBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allocatedIpRange_ = allocatedIpRange_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.enablePrivatePathForGoogleCloudServices_ = + enablePrivatePathForGoogleCloudServicesBuilder_ == null + ? enablePrivatePathForGoogleCloudServices_ + : enablePrivatePathForGoogleCloudServicesBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.sslMode_ = sslMode_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.pscConfig_ = pscConfigBuilder_ == null ? pscConfig_ : pscConfigBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.serverCaMode_ = serverCaMode_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + customSubjectAlternativeNames_.makeImmutable(); + result.customSubjectAlternativeNames_ = customSubjectAlternativeNames_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.serverCaPool_ = serverCaPool_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.serverCertificateRotationMode_ = serverCertificateRotationMode_; + to_bitField0_ |= 0x00000040; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.IpConfiguration) { + return mergeFrom((com.google.cloud.sql.v1beta4.IpConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.IpConfiguration other) { + if (other == com.google.cloud.sql.v1beta4.IpConfiguration.getDefaultInstance()) return this; + if (other.hasIpv4Enabled()) { + mergeIpv4Enabled(other.getIpv4Enabled()); + } + if (!other.getPrivateNetwork().isEmpty()) { + privateNetwork_ = other.privateNetwork_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasRequireSsl()) { + mergeRequireSsl(other.getRequireSsl()); + } + if (authorizedNetworksBuilder_ == null) { + if (!other.authorizedNetworks_.isEmpty()) { + if (authorizedNetworks_.isEmpty()) { + authorizedNetworks_ = other.authorizedNetworks_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.addAll(other.authorizedNetworks_); + } + onChanged(); + } + } else { + if (!other.authorizedNetworks_.isEmpty()) { + if (authorizedNetworksBuilder_.isEmpty()) { + authorizedNetworksBuilder_.dispose(); + authorizedNetworksBuilder_ = null; + authorizedNetworks_ = other.authorizedNetworks_; + bitField0_ = (bitField0_ & ~0x00000008); + authorizedNetworksBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetAuthorizedNetworksFieldBuilder() + : null; + } else { + authorizedNetworksBuilder_.addAllMessages(other.authorizedNetworks_); + } + } + } + if (!other.getAllocatedIpRange().isEmpty()) { + allocatedIpRange_ = other.allocatedIpRange_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasEnablePrivatePathForGoogleCloudServices()) { + mergeEnablePrivatePathForGoogleCloudServices( + other.getEnablePrivatePathForGoogleCloudServices()); + } + if (other.sslMode_ != 0) { + setSslModeValue(other.getSslModeValue()); + } + if (other.hasPscConfig()) { + mergePscConfig(other.getPscConfig()); + } + if (other.hasServerCaMode()) { + setServerCaModeValue(other.getServerCaModeValue()); + } + if (!other.customSubjectAlternativeNames_.isEmpty()) { + if (customSubjectAlternativeNames_.isEmpty()) { + customSubjectAlternativeNames_ = other.customSubjectAlternativeNames_; + bitField0_ |= 0x00000200; + } else { + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.addAll(other.customSubjectAlternativeNames_); + } + onChanged(); + } + if (other.hasServerCaPool()) { + serverCaPool_ = other.serverCaPool_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (other.hasServerCertificateRotationMode()) { + setServerCertificateRotationModeValue(other.getServerCertificateRotationModeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetIpv4EnabledFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + privateNetwork_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetRequireSslFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.cloud.sql.v1beta4.AclEntry m = + input.readMessage( + com.google.cloud.sql.v1beta4.AclEntry.parser(), extensionRegistry); + if (authorizedNetworksBuilder_ == null) { + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.add(m); + } else { + authorizedNetworksBuilder_.addMessage(m); + } + break; + } // case 34 + case 50: + { + allocatedIpRange_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetEnablePrivatePathForGoogleCloudServicesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 64: + { + sslMode_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 64 + case 74: + { + input.readMessage( + internalGetPscConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 74 + case 80: + { + serverCaMode_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 80 + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.add(s); + break; + } // case 90 + case 98: + { + serverCaPool_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 98 + case 128: + { + serverCertificateRotationMode_ = input.readEnum(); + bitField0_ |= 0x00000800; + break; + } // case 128 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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.BoolValue ipv4Enabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + ipv4EnabledBuilder_; + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + * + * @return Whether the ipv4Enabled field is set. + */ + public boolean hasIpv4Enabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + * + * @return The ipv4Enabled. + */ + public com.google.protobuf.BoolValue getIpv4Enabled() { + if (ipv4EnabledBuilder_ == null) { + return ipv4Enabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : ipv4Enabled_; + } else { + return ipv4EnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + public Builder setIpv4Enabled(com.google.protobuf.BoolValue value) { + if (ipv4EnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ipv4Enabled_ = value; + } else { + ipv4EnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + public Builder setIpv4Enabled(com.google.protobuf.BoolValue.Builder builderForValue) { + if (ipv4EnabledBuilder_ == null) { + ipv4Enabled_ = builderForValue.build(); + } else { + ipv4EnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + public Builder mergeIpv4Enabled(com.google.protobuf.BoolValue value) { + if (ipv4EnabledBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && ipv4Enabled_ != null + && ipv4Enabled_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getIpv4EnabledBuilder().mergeFrom(value); + } else { + ipv4Enabled_ = value; + } + } else { + ipv4EnabledBuilder_.mergeFrom(value); + } + if (ipv4Enabled_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + public Builder clearIpv4Enabled() { + bitField0_ = (bitField0_ & ~0x00000001); + ipv4Enabled_ = null; + if (ipv4EnabledBuilder_ != null) { + ipv4EnabledBuilder_.dispose(); + ipv4EnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + public com.google.protobuf.BoolValue.Builder getIpv4EnabledBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetIpv4EnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + public com.google.protobuf.BoolValueOrBuilder getIpv4EnabledOrBuilder() { + if (ipv4EnabledBuilder_ != null) { + return ipv4EnabledBuilder_.getMessageOrBuilder(); + } else { + return ipv4Enabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : ipv4Enabled_; + } + } + + /** + * + * + *
+     * Whether the instance is assigned a public IP address or not.
+     * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetIpv4EnabledFieldBuilder() { + if (ipv4EnabledBuilder_ == null) { + ipv4EnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getIpv4Enabled(), getParentForChildren(), isClean()); + ipv4Enabled_ = null; + } + return ipv4EnabledBuilder_; + } + + private java.lang.Object privateNetwork_ = ""; + + /** + * + * + *
+     * The resource link for the VPC network from which the Cloud SQL instance is
+     * accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`. This setting can
+     * be updated, but it cannot be removed after it is set.
+     * 
+ * + * string private_network = 2; + * + * @return The privateNetwork. + */ + public java.lang.String getPrivateNetwork() { + java.lang.Object ref = privateNetwork_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateNetwork_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The resource link for the VPC network from which the Cloud SQL instance is
+     * accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`. This setting can
+     * be updated, but it cannot be removed after it is set.
+     * 
+ * + * string private_network = 2; + * + * @return The bytes for privateNetwork. + */ + public com.google.protobuf.ByteString getPrivateNetworkBytes() { + java.lang.Object ref = privateNetwork_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The resource link for the VPC network from which the Cloud SQL instance is
+     * accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`. This setting can
+     * be updated, but it cannot be removed after it is set.
+     * 
+ * + * string private_network = 2; + * + * @param value The privateNetwork to set. + * @return This builder for chaining. + */ + public Builder setPrivateNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + privateNetwork_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource link for the VPC network from which the Cloud SQL instance is
+     * accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`. This setting can
+     * be updated, but it cannot be removed after it is set.
+     * 
+ * + * string private_network = 2; + * + * @return This builder for chaining. + */ + public Builder clearPrivateNetwork() { + privateNetwork_ = getDefaultInstance().getPrivateNetwork(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource link for the VPC network from which the Cloud SQL instance is
+     * accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`. This setting can
+     * be updated, but it cannot be removed after it is set.
+     * 
+ * + * string private_network = 2; + * + * @param value The bytes for privateNetwork to set. + * @return This builder for chaining. + */ + public Builder setPrivateNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + privateNetwork_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue requireSsl_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + requireSslBuilder_; + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the legacy `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + * + * @return Whether the requireSsl field is set. + */ + public boolean hasRequireSsl() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the legacy `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + * + * @return The requireSsl. + */ + public com.google.protobuf.BoolValue getRequireSsl() { + if (requireSslBuilder_ == null) { + return requireSsl_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : requireSsl_; + } else { + return requireSslBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the legacy `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + public Builder setRequireSsl(com.google.protobuf.BoolValue value) { + if (requireSslBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requireSsl_ = value; + } else { + requireSslBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the legacy `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + public Builder setRequireSsl(com.google.protobuf.BoolValue.Builder builderForValue) { + if (requireSslBuilder_ == null) { + requireSsl_ = builderForValue.build(); + } else { + requireSslBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the legacy `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + public Builder mergeRequireSsl(com.google.protobuf.BoolValue value) { + if (requireSslBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && requireSsl_ != null + && requireSsl_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getRequireSslBuilder().mergeFrom(value); + } else { + requireSsl_ = value; + } + } else { + requireSslBuilder_.mergeFrom(value); + } + if (requireSsl_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the legacy `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + public Builder clearRequireSsl() { + bitField0_ = (bitField0_ & ~0x00000004); + requireSsl_ = null; + if (requireSslBuilder_ != null) { + requireSslBuilder_.dispose(); + requireSslBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the legacy `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + public com.google.protobuf.BoolValue.Builder getRequireSslBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetRequireSslFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the legacy `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + public com.google.protobuf.BoolValueOrBuilder getRequireSslOrBuilder() { + if (requireSslBuilder_ != null) { + return requireSslBuilder_.getMessageOrBuilder(); + } else { + return requireSsl_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : requireSsl_; + } + } + + /** + * + * + *
+     * Use `ssl_mode` instead.
+     *
+     * Whether SSL/TLS connections over IP are enforced.
+     * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+     * For SSL/TLS connections, the client certificate won't be verified. If
+     * set to true, then only allow connections encrypted with SSL/TLS and with
+     * valid client certificates. If you want to enforce SSL/TLS without enforcing
+     * the requirement for valid client certificates, then use the `ssl_mode` flag
+     * instead of the legacy `require_ssl` flag.
+     * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetRequireSslFieldBuilder() { + if (requireSslBuilder_ == null) { + requireSslBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getRequireSsl(), getParentForChildren(), isClean()); + requireSsl_ = null; + } + return requireSslBuilder_; + } + + private java.util.List authorizedNetworks_ = + java.util.Collections.emptyList(); + + private void ensureAuthorizedNetworksIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + authorizedNetworks_ = + new java.util.ArrayList(authorizedNetworks_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.AclEntry, + com.google.cloud.sql.v1beta4.AclEntry.Builder, + com.google.cloud.sql.v1beta4.AclEntryOrBuilder> + authorizedNetworksBuilder_; + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public java.util.List getAuthorizedNetworksList() { + if (authorizedNetworksBuilder_ == null) { + return java.util.Collections.unmodifiableList(authorizedNetworks_); + } else { + return authorizedNetworksBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public int getAuthorizedNetworksCount() { + if (authorizedNetworksBuilder_ == null) { + return authorizedNetworks_.size(); + } else { + return authorizedNetworksBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public com.google.cloud.sql.v1beta4.AclEntry getAuthorizedNetworks(int index) { + if (authorizedNetworksBuilder_ == null) { + return authorizedNetworks_.get(index); + } else { + return authorizedNetworksBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public Builder setAuthorizedNetworks(int index, com.google.cloud.sql.v1beta4.AclEntry value) { + if (authorizedNetworksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.set(index, value); + onChanged(); + } else { + authorizedNetworksBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public Builder setAuthorizedNetworks( + int index, com.google.cloud.sql.v1beta4.AclEntry.Builder builderForValue) { + if (authorizedNetworksBuilder_ == null) { + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.set(index, builderForValue.build()); + onChanged(); + } else { + authorizedNetworksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public Builder addAuthorizedNetworks(com.google.cloud.sql.v1beta4.AclEntry value) { + if (authorizedNetworksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.add(value); + onChanged(); + } else { + authorizedNetworksBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public Builder addAuthorizedNetworks(int index, com.google.cloud.sql.v1beta4.AclEntry value) { + if (authorizedNetworksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.add(index, value); + onChanged(); + } else { + authorizedNetworksBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public Builder addAuthorizedNetworks( + com.google.cloud.sql.v1beta4.AclEntry.Builder builderForValue) { + if (authorizedNetworksBuilder_ == null) { + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.add(builderForValue.build()); + onChanged(); + } else { + authorizedNetworksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public Builder addAuthorizedNetworks( + int index, com.google.cloud.sql.v1beta4.AclEntry.Builder builderForValue) { + if (authorizedNetworksBuilder_ == null) { + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.add(index, builderForValue.build()); + onChanged(); + } else { + authorizedNetworksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public Builder addAllAuthorizedNetworks( + java.lang.Iterable values) { + if (authorizedNetworksBuilder_ == null) { + ensureAuthorizedNetworksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, authorizedNetworks_); + onChanged(); + } else { + authorizedNetworksBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public Builder clearAuthorizedNetworks() { + if (authorizedNetworksBuilder_ == null) { + authorizedNetworks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + authorizedNetworksBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public Builder removeAuthorizedNetworks(int index) { + if (authorizedNetworksBuilder_ == null) { + ensureAuthorizedNetworksIsMutable(); + authorizedNetworks_.remove(index); + onChanged(); + } else { + authorizedNetworksBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public com.google.cloud.sql.v1beta4.AclEntry.Builder getAuthorizedNetworksBuilder(int index) { + return internalGetAuthorizedNetworksFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public com.google.cloud.sql.v1beta4.AclEntryOrBuilder getAuthorizedNetworksOrBuilder( + int index) { + if (authorizedNetworksBuilder_ == null) { + return authorizedNetworks_.get(index); + } else { + return authorizedNetworksBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public java.util.List + getAuthorizedNetworksOrBuilderList() { + if (authorizedNetworksBuilder_ != null) { + return authorizedNetworksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(authorizedNetworks_); + } + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public com.google.cloud.sql.v1beta4.AclEntry.Builder addAuthorizedNetworksBuilder() { + return internalGetAuthorizedNetworksFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.AclEntry.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public com.google.cloud.sql.v1beta4.AclEntry.Builder addAuthorizedNetworksBuilder(int index) { + return internalGetAuthorizedNetworksFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.AclEntry.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of external networks that are allowed to connect to the instance
+     * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+     * example: `157.197.200.0/24`).
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + public java.util.List + getAuthorizedNetworksBuilderList() { + return internalGetAuthorizedNetworksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.AclEntry, + com.google.cloud.sql.v1beta4.AclEntry.Builder, + com.google.cloud.sql.v1beta4.AclEntryOrBuilder> + internalGetAuthorizedNetworksFieldBuilder() { + if (authorizedNetworksBuilder_ == null) { + authorizedNetworksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.AclEntry, + com.google.cloud.sql.v1beta4.AclEntry.Builder, + com.google.cloud.sql.v1beta4.AclEntryOrBuilder>( + authorizedNetworks_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + authorizedNetworks_ = null; + } + return authorizedNetworksBuilder_; + } + + private java.lang.Object allocatedIpRange_ = ""; + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the instance ip
+     * will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+     * 
+ * + * string allocated_ip_range = 6; + * + * @return The allocatedIpRange. + */ + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the instance ip
+     * will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+     * 
+ * + * string allocated_ip_range = 6; + * + * @return The bytes for allocatedIpRange. + */ + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the instance ip
+     * will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+     * 
+ * + * string allocated_ip_range = 6; + * + * @param value The allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRange(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + allocatedIpRange_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the instance ip
+     * will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+     * 
+ * + * string allocated_ip_range = 6; + * + * @return This builder for chaining. + */ + public Builder clearAllocatedIpRange() { + allocatedIpRange_ = getDefaultInstance().getAllocatedIpRange(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the allocated ip range for the private ip Cloud SQL instance.
+     * For example: "google-managed-services-default". If set, the instance ip
+     * will be created in the allocated range. The range name must comply with
+     * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+     * must be 1-63 characters long and match the regular expression
+     * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+     * 
+ * + * string allocated_ip_range = 6; + * + * @param value The bytes for allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRangeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + allocatedIpRange_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue enablePrivatePathForGoogleCloudServices_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + enablePrivatePathForGoogleCloudServicesBuilder_; + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + * + * @return Whether the enablePrivatePathForGoogleCloudServices field is set. + */ + public boolean hasEnablePrivatePathForGoogleCloudServices() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + * + * @return The enablePrivatePathForGoogleCloudServices. + */ + public com.google.protobuf.BoolValue getEnablePrivatePathForGoogleCloudServices() { + if (enablePrivatePathForGoogleCloudServicesBuilder_ == null) { + return enablePrivatePathForGoogleCloudServices_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePrivatePathForGoogleCloudServices_; + } else { + return enablePrivatePathForGoogleCloudServicesBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + public Builder setEnablePrivatePathForGoogleCloudServices(com.google.protobuf.BoolValue value) { + if (enablePrivatePathForGoogleCloudServicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enablePrivatePathForGoogleCloudServices_ = value; + } else { + enablePrivatePathForGoogleCloudServicesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + public Builder setEnablePrivatePathForGoogleCloudServices( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (enablePrivatePathForGoogleCloudServicesBuilder_ == null) { + enablePrivatePathForGoogleCloudServices_ = builderForValue.build(); + } else { + enablePrivatePathForGoogleCloudServicesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + public Builder mergeEnablePrivatePathForGoogleCloudServices( + com.google.protobuf.BoolValue value) { + if (enablePrivatePathForGoogleCloudServicesBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && enablePrivatePathForGoogleCloudServices_ != null + && enablePrivatePathForGoogleCloudServices_ + != com.google.protobuf.BoolValue.getDefaultInstance()) { + getEnablePrivatePathForGoogleCloudServicesBuilder().mergeFrom(value); + } else { + enablePrivatePathForGoogleCloudServices_ = value; + } + } else { + enablePrivatePathForGoogleCloudServicesBuilder_.mergeFrom(value); + } + if (enablePrivatePathForGoogleCloudServices_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + public Builder clearEnablePrivatePathForGoogleCloudServices() { + bitField0_ = (bitField0_ & ~0x00000020); + enablePrivatePathForGoogleCloudServices_ = null; + if (enablePrivatePathForGoogleCloudServicesBuilder_ != null) { + enablePrivatePathForGoogleCloudServicesBuilder_.dispose(); + enablePrivatePathForGoogleCloudServicesBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + public com.google.protobuf.BoolValue.Builder + getEnablePrivatePathForGoogleCloudServicesBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetEnablePrivatePathForGoogleCloudServicesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + public com.google.protobuf.BoolValueOrBuilder + getEnablePrivatePathForGoogleCloudServicesOrBuilder() { + if (enablePrivatePathForGoogleCloudServicesBuilder_ != null) { + return enablePrivatePathForGoogleCloudServicesBuilder_.getMessageOrBuilder(); + } else { + return enablePrivatePathForGoogleCloudServices_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePrivatePathForGoogleCloudServices_; + } + } + + /** + * + * + *
+     * Controls connectivity to private IP instances from Google services,
+     * such as BigQuery.
+     * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetEnablePrivatePathForGoogleCloudServicesFieldBuilder() { + if (enablePrivatePathForGoogleCloudServicesBuilder_ == null) { + enablePrivatePathForGoogleCloudServicesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getEnablePrivatePathForGoogleCloudServices(), getParentForChildren(), isClean()); + enablePrivatePathForGoogleCloudServices_ = null; + } + return enablePrivatePathForGoogleCloudServicesBuilder_; + } + + private int sslMode_ = 0; + + /** + * + * + *
+     * Specify how SSL/TLS is enforced in database connections. If you must use
+     * the `require_ssl` flag for backward compatibility, then only the following
+     * value pairs are valid:
+     *
+     * For PostgreSQL and MySQL:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+     * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+     *
+     * For SQL Server:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+     *
+     * The value of `ssl_mode` has priority over the value of `require_ssl`.
+     *
+     * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+     * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+     * connections, while `require_ssl=false` means accept both non-SSL
+     * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+     * `ssl_mode` and accepts only SSL connections.
+     * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration.SslMode ssl_mode = 8; + * + * @return The enum numeric value on the wire for sslMode. + */ + @java.lang.Override + public int getSslModeValue() { + return sslMode_; + } + + /** + * + * + *
+     * Specify how SSL/TLS is enforced in database connections. If you must use
+     * the `require_ssl` flag for backward compatibility, then only the following
+     * value pairs are valid:
+     *
+     * For PostgreSQL and MySQL:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+     * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+     *
+     * For SQL Server:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+     *
+     * The value of `ssl_mode` has priority over the value of `require_ssl`.
+     *
+     * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+     * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+     * connections, while `require_ssl=false` means accept both non-SSL
+     * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+     * `ssl_mode` and accepts only SSL connections.
+     * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration.SslMode ssl_mode = 8; + * + * @param value The enum numeric value on the wire for sslMode to set. + * @return This builder for chaining. + */ + public Builder setSslModeValue(int value) { + sslMode_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specify how SSL/TLS is enforced in database connections. If you must use
+     * the `require_ssl` flag for backward compatibility, then only the following
+     * value pairs are valid:
+     *
+     * For PostgreSQL and MySQL:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+     * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+     *
+     * For SQL Server:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+     *
+     * The value of `ssl_mode` has priority over the value of `require_ssl`.
+     *
+     * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+     * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+     * connections, while `require_ssl=false` means accept both non-SSL
+     * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+     * `ssl_mode` and accepts only SSL connections.
+     * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration.SslMode ssl_mode = 8; + * + * @return The sslMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpConfiguration.SslMode getSslMode() { + com.google.cloud.sql.v1beta4.IpConfiguration.SslMode result = + com.google.cloud.sql.v1beta4.IpConfiguration.SslMode.forNumber(sslMode_); + return result == null + ? com.google.cloud.sql.v1beta4.IpConfiguration.SslMode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Specify how SSL/TLS is enforced in database connections. If you must use
+     * the `require_ssl` flag for backward compatibility, then only the following
+     * value pairs are valid:
+     *
+     * For PostgreSQL and MySQL:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+     * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+     *
+     * For SQL Server:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+     *
+     * The value of `ssl_mode` has priority over the value of `require_ssl`.
+     *
+     * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+     * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+     * connections, while `require_ssl=false` means accept both non-SSL
+     * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+     * `ssl_mode` and accepts only SSL connections.
+     * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration.SslMode ssl_mode = 8; + * + * @param value The sslMode to set. + * @return This builder for chaining. + */ + public Builder setSslMode(com.google.cloud.sql.v1beta4.IpConfiguration.SslMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + sslMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Specify how SSL/TLS is enforced in database connections. If you must use
+     * the `require_ssl` flag for backward compatibility, then only the following
+     * value pairs are valid:
+     *
+     * For PostgreSQL and MySQL:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+     * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+     *
+     * For SQL Server:
+     *
+     * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+     * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+     *
+     * The value of `ssl_mode` has priority over the value of `require_ssl`.
+     *
+     * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+     * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+     * connections, while `require_ssl=false` means accept both non-SSL
+     * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+     * `ssl_mode` and accepts only SSL connections.
+     * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration.SslMode ssl_mode = 8; + * + * @return This builder for chaining. + */ + public Builder clearSslMode() { + bitField0_ = (bitField0_ & ~0x00000040); + sslMode_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.PscConfig pscConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PscConfig, + com.google.cloud.sql.v1beta4.PscConfig.Builder, + com.google.cloud.sql.v1beta4.PscConfigOrBuilder> + pscConfigBuilder_; + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + * + * @return Whether the pscConfig field is set. + */ + public boolean hasPscConfig() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + * + * @return The pscConfig. + */ + public com.google.cloud.sql.v1beta4.PscConfig getPscConfig() { + if (pscConfigBuilder_ == null) { + return pscConfig_ == null + ? com.google.cloud.sql.v1beta4.PscConfig.getDefaultInstance() + : pscConfig_; + } else { + return pscConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + */ + public Builder setPscConfig(com.google.cloud.sql.v1beta4.PscConfig value) { + if (pscConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pscConfig_ = value; + } else { + pscConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + */ + public Builder setPscConfig(com.google.cloud.sql.v1beta4.PscConfig.Builder builderForValue) { + if (pscConfigBuilder_ == null) { + pscConfig_ = builderForValue.build(); + } else { + pscConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + */ + public Builder mergePscConfig(com.google.cloud.sql.v1beta4.PscConfig value) { + if (pscConfigBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && pscConfig_ != null + && pscConfig_ != com.google.cloud.sql.v1beta4.PscConfig.getDefaultInstance()) { + getPscConfigBuilder().mergeFrom(value); + } else { + pscConfig_ = value; + } + } else { + pscConfigBuilder_.mergeFrom(value); + } + if (pscConfig_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + */ + public Builder clearPscConfig() { + bitField0_ = (bitField0_ & ~0x00000080); + pscConfig_ = null; + if (pscConfigBuilder_ != null) { + pscConfigBuilder_.dispose(); + pscConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + */ + public com.google.cloud.sql.v1beta4.PscConfig.Builder getPscConfigBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetPscConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + */ + public com.google.cloud.sql.v1beta4.PscConfigOrBuilder getPscConfigOrBuilder() { + if (pscConfigBuilder_ != null) { + return pscConfigBuilder_.getMessageOrBuilder(); + } else { + return pscConfig_ == null + ? com.google.cloud.sql.v1beta4.PscConfig.getDefaultInstance() + : pscConfig_; + } + } + + /** + * + * + *
+     * PSC settings for this instance.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PscConfig, + com.google.cloud.sql.v1beta4.PscConfig.Builder, + com.google.cloud.sql.v1beta4.PscConfigOrBuilder> + internalGetPscConfigFieldBuilder() { + if (pscConfigBuilder_ == null) { + pscConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PscConfig, + com.google.cloud.sql.v1beta4.PscConfig.Builder, + com.google.cloud.sql.v1beta4.PscConfigOrBuilder>( + getPscConfig(), getParentForChildren(), isClean()); + pscConfig_ = null; + } + return pscConfigBuilder_; + } + + private int serverCaMode_ = 0; + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return Whether the serverCaMode field is set. + */ + @java.lang.Override + public boolean hasServerCaMode() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return The enum numeric value on the wire for serverCaMode. + */ + @java.lang.Override + public int getServerCaModeValue() { + return serverCaMode_; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.IpConfiguration.CaMode server_ca_mode = 10; + * + * @param value The enum numeric value on the wire for serverCaMode to set. + * @return This builder for chaining. + */ + public Builder setServerCaModeValue(int value) { + serverCaMode_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return The serverCaMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpConfiguration.CaMode getServerCaMode() { + com.google.cloud.sql.v1beta4.IpConfiguration.CaMode result = + com.google.cloud.sql.v1beta4.IpConfiguration.CaMode.forNumber(serverCaMode_); + return result == null + ? com.google.cloud.sql.v1beta4.IpConfiguration.CaMode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.IpConfiguration.CaMode server_ca_mode = 10; + * + * @param value The serverCaMode to set. + * @return This builder for chaining. + */ + public Builder setServerCaMode(com.google.cloud.sql.v1beta4.IpConfiguration.CaMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + serverCaMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Specify what type of CA is used for the server certificate.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return This builder for chaining. + */ + public Builder clearServerCaMode() { + bitField0_ = (bitField0_ & ~0x00000100); + serverCaMode_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList customSubjectAlternativeNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureCustomSubjectAlternativeNamesIsMutable() { + if (!customSubjectAlternativeNames_.isModifiable()) { + customSubjectAlternativeNames_ = + new com.google.protobuf.LazyStringArrayList(customSubjectAlternativeNames_); + } + bitField0_ |= 0x00000200; + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the customSubjectAlternativeNames. + */ + public com.google.protobuf.ProtocolStringList getCustomSubjectAlternativeNamesList() { + customSubjectAlternativeNames_.makeImmutable(); + return customSubjectAlternativeNames_; + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of customSubjectAlternativeNames. + */ + public int getCustomSubjectAlternativeNamesCount() { + return customSubjectAlternativeNames_.size(); + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The customSubjectAlternativeNames at the given index. + */ + public java.lang.String getCustomSubjectAlternativeNames(int index) { + return customSubjectAlternativeNames_.get(index); + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the customSubjectAlternativeNames at the given index. + */ + public com.google.protobuf.ByteString getCustomSubjectAlternativeNamesBytes(int index) { + return customSubjectAlternativeNames_.getByteString(index); + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The customSubjectAlternativeNames to set. + * @return This builder for chaining. + */ + public Builder setCustomSubjectAlternativeNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.set(index, value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The customSubjectAlternativeNames to add. + * @return This builder for chaining. + */ + public Builder addCustomSubjectAlternativeNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.add(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The customSubjectAlternativeNames to add. + * @return This builder for chaining. + */ + public Builder addAllCustomSubjectAlternativeNames( + java.lang.Iterable values) { + ensureCustomSubjectAlternativeNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, customSubjectAlternativeNames_); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearCustomSubjectAlternativeNames() { + customSubjectAlternativeNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+     * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes of the customSubjectAlternativeNames to add. + * @return This builder for chaining. + */ + public Builder addCustomSubjectAlternativeNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCustomSubjectAlternativeNamesIsMutable(); + customSubjectAlternativeNames_.add(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object serverCaPool_ = ""; + + /** + * + * + *
+     * Optional. The resource name of the server CA pool for an instance with
+     * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+     * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+     * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the serverCaPool field is set. + */ + public boolean hasServerCaPool() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Optional. The resource name of the server CA pool for an instance with
+     * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+     * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+     * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The serverCaPool. + */ + public java.lang.String getServerCaPool() { + java.lang.Object ref = serverCaPool_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serverCaPool_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The resource name of the server CA pool for an instance with
+     * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+     * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+     * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for serverCaPool. + */ + public com.google.protobuf.ByteString getServerCaPoolBytes() { + java.lang.Object ref = serverCaPool_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverCaPool_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The resource name of the server CA pool for an instance with
+     * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+     * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+     * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The serverCaPool to set. + * @return This builder for chaining. + */ + public Builder setServerCaPool(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serverCaPool_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource name of the server CA pool for an instance with
+     * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+     * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+     * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearServerCaPool() { + serverCaPool_ = getDefaultInstance().getServerCaPool(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource name of the server CA pool for an instance with
+     * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+     * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+     * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for serverCaPool to set. + * @return This builder for chaining. + */ + public Builder setServerCaPoolBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serverCaPool_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private int serverCertificateRotationMode_ = 0; + + /** + * + * + *
+     * Optional. Controls the automatic server certificate rotation feature. This
+     * feature is disabled by default. When enabled, the server certificate will
+     * be automatically rotated during Cloud SQL scheduled maintenance or
+     * self-service maintenance updates up to six months before it expires. This
+     * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+     * or CUSTOMER_MANAGED_CAS_CA.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the serverCertificateRotationMode field is set. + */ + @java.lang.Override + public boolean hasServerCertificateRotationMode() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Optional. Controls the automatic server certificate rotation feature. This
+     * feature is disabled by default. When enabled, the server certificate will
+     * be automatically rotated during Cloud SQL scheduled maintenance or
+     * self-service maintenance updates up to six months before it expires. This
+     * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+     * or CUSTOMER_MANAGED_CAS_CA.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for serverCertificateRotationMode. + */ + @java.lang.Override + public int getServerCertificateRotationModeValue() { + return serverCertificateRotationMode_; + } + + /** + * + * + *
+     * Optional. Controls the automatic server certificate rotation feature. This
+     * feature is disabled by default. When enabled, the server certificate will
+     * be automatically rotated during Cloud SQL scheduled maintenance or
+     * self-service maintenance updates up to six months before it expires. This
+     * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+     * or CUSTOMER_MANAGED_CAS_CA.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for serverCertificateRotationMode to set. + * @return This builder for chaining. + */ + public Builder setServerCertificateRotationModeValue(int value) { + serverCertificateRotationMode_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Controls the automatic server certificate rotation feature. This
+     * feature is disabled by default. When enabled, the server certificate will
+     * be automatically rotated during Cloud SQL scheduled maintenance or
+     * self-service maintenance updates up to six months before it expires. This
+     * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+     * or CUSTOMER_MANAGED_CAS_CA.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The serverCertificateRotationMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode + getServerCertificateRotationMode() { + com.google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode result = + com.google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode.forNumber( + serverCertificateRotationMode_); + return result == null + ? com.google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. Controls the automatic server certificate rotation feature. This
+     * feature is disabled by default. When enabled, the server certificate will
+     * be automatically rotated during Cloud SQL scheduled maintenance or
+     * self-service maintenance updates up to six months before it expires. This
+     * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+     * or CUSTOMER_MANAGED_CAS_CA.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The serverCertificateRotationMode to set. + * @return This builder for chaining. + */ + public Builder setServerCertificateRotationMode( + com.google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000800; + serverCertificateRotationMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Controls the automatic server certificate rotation feature. This
+     * feature is disabled by default. When enabled, the server certificate will
+     * be automatically rotated during Cloud SQL scheduled maintenance or
+     * self-service maintenance updates up to six months before it expires. This
+     * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+     * or CUSTOMER_MANAGED_CAS_CA.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearServerCertificateRotationMode() { + bitField0_ = (bitField0_ & ~0x00000800); + serverCertificateRotationMode_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.IpConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.IpConfiguration) + private static final com.google.cloud.sql.v1beta4.IpConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.IpConfiguration(); + } + + public static com.google.cloud.sql.v1beta4.IpConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IpConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/IpConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/IpConfigurationOrBuilder.java new file mode 100644 index 000000000000..0937e62acfb8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/IpConfigurationOrBuilder.java @@ -0,0 +1,612 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface IpConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.IpConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether the instance is assigned a public IP address or not.
+   * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + * + * @return Whether the ipv4Enabled field is set. + */ + boolean hasIpv4Enabled(); + + /** + * + * + *
+   * Whether the instance is assigned a public IP address or not.
+   * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + * + * @return The ipv4Enabled. + */ + com.google.protobuf.BoolValue getIpv4Enabled(); + + /** + * + * + *
+   * Whether the instance is assigned a public IP address or not.
+   * 
+ * + * .google.protobuf.BoolValue ipv4_enabled = 1; + */ + com.google.protobuf.BoolValueOrBuilder getIpv4EnabledOrBuilder(); + + /** + * + * + *
+   * The resource link for the VPC network from which the Cloud SQL instance is
+   * accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`. This setting can
+   * be updated, but it cannot be removed after it is set.
+   * 
+ * + * string private_network = 2; + * + * @return The privateNetwork. + */ + java.lang.String getPrivateNetwork(); + + /** + * + * + *
+   * The resource link for the VPC network from which the Cloud SQL instance is
+   * accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`. This setting can
+   * be updated, but it cannot be removed after it is set.
+   * 
+ * + * string private_network = 2; + * + * @return The bytes for privateNetwork. + */ + com.google.protobuf.ByteString getPrivateNetworkBytes(); + + /** + * + * + *
+   * Use `ssl_mode` instead.
+   *
+   * Whether SSL/TLS connections over IP are enforced.
+   * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+   * For SSL/TLS connections, the client certificate won't be verified. If
+   * set to true, then only allow connections encrypted with SSL/TLS and with
+   * valid client certificates. If you want to enforce SSL/TLS without enforcing
+   * the requirement for valid client certificates, then use the `ssl_mode` flag
+   * instead of the legacy `require_ssl` flag.
+   * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + * + * @return Whether the requireSsl field is set. + */ + boolean hasRequireSsl(); + + /** + * + * + *
+   * Use `ssl_mode` instead.
+   *
+   * Whether SSL/TLS connections over IP are enforced.
+   * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+   * For SSL/TLS connections, the client certificate won't be verified. If
+   * set to true, then only allow connections encrypted with SSL/TLS and with
+   * valid client certificates. If you want to enforce SSL/TLS without enforcing
+   * the requirement for valid client certificates, then use the `ssl_mode` flag
+   * instead of the legacy `require_ssl` flag.
+   * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + * + * @return The requireSsl. + */ + com.google.protobuf.BoolValue getRequireSsl(); + + /** + * + * + *
+   * Use `ssl_mode` instead.
+   *
+   * Whether SSL/TLS connections over IP are enforced.
+   * If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
+   * For SSL/TLS connections, the client certificate won't be verified. If
+   * set to true, then only allow connections encrypted with SSL/TLS and with
+   * valid client certificates. If you want to enforce SSL/TLS without enforcing
+   * the requirement for valid client certificates, then use the `ssl_mode` flag
+   * instead of the legacy `require_ssl` flag.
+   * 
+ * + * .google.protobuf.BoolValue require_ssl = 3; + */ + com.google.protobuf.BoolValueOrBuilder getRequireSslOrBuilder(); + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + java.util.List getAuthorizedNetworksList(); + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + com.google.cloud.sql.v1beta4.AclEntry getAuthorizedNetworks(int index); + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + int getAuthorizedNetworksCount(); + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + java.util.List + getAuthorizedNetworksOrBuilderList(); + + /** + * + * + *
+   * The list of external networks that are allowed to connect to the instance
+   * using the IP. In 'CIDR' notation, also known as 'slash' notation (for
+   * example: `157.197.200.0/24`).
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.AclEntry authorized_networks = 4; + */ + com.google.cloud.sql.v1beta4.AclEntryOrBuilder getAuthorizedNetworksOrBuilder(int index); + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the instance ip
+   * will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The allocatedIpRange. + */ + java.lang.String getAllocatedIpRange(); + + /** + * + * + *
+   * The name of the allocated ip range for the private ip Cloud SQL instance.
+   * For example: "google-managed-services-default". If set, the instance ip
+   * will be created in the allocated range. The range name must comply with
+   * [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
+   * must be 1-63 characters long and match the regular expression
+   * `[a-z]([-a-z0-9]*[a-z0-9])?.`
+   * 
+ * + * string allocated_ip_range = 6; + * + * @return The bytes for allocatedIpRange. + */ + com.google.protobuf.ByteString getAllocatedIpRangeBytes(); + + /** + * + * + *
+   * Controls connectivity to private IP instances from Google services,
+   * such as BigQuery.
+   * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + * + * @return Whether the enablePrivatePathForGoogleCloudServices field is set. + */ + boolean hasEnablePrivatePathForGoogleCloudServices(); + + /** + * + * + *
+   * Controls connectivity to private IP instances from Google services,
+   * such as BigQuery.
+   * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + * + * @return The enablePrivatePathForGoogleCloudServices. + */ + com.google.protobuf.BoolValue getEnablePrivatePathForGoogleCloudServices(); + + /** + * + * + *
+   * Controls connectivity to private IP instances from Google services,
+   * such as BigQuery.
+   * 
+ * + * .google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + */ + com.google.protobuf.BoolValueOrBuilder getEnablePrivatePathForGoogleCloudServicesOrBuilder(); + + /** + * + * + *
+   * Specify how SSL/TLS is enforced in database connections. If you must use
+   * the `require_ssl` flag for backward compatibility, then only the following
+   * value pairs are valid:
+   *
+   * For PostgreSQL and MySQL:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+   * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+   *
+   * For SQL Server:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+   *
+   * The value of `ssl_mode` has priority over the value of `require_ssl`.
+   *
+   * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+   * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+   * connections, while `require_ssl=false` means accept both non-SSL
+   * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+   * `ssl_mode` and accepts only SSL connections.
+   * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration.SslMode ssl_mode = 8; + * + * @return The enum numeric value on the wire for sslMode. + */ + int getSslModeValue(); + + /** + * + * + *
+   * Specify how SSL/TLS is enforced in database connections. If you must use
+   * the `require_ssl` flag for backward compatibility, then only the following
+   * value pairs are valid:
+   *
+   * For PostgreSQL and MySQL:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
+   * * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
+   *
+   * For SQL Server:
+   *
+   * * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
+   * * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
+   *
+   * The value of `ssl_mode` has priority over the value of `require_ssl`.
+   *
+   * For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
+   * `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
+   * connections, while `require_ssl=false` means accept both non-SSL
+   * and SSL connections. In this case, MySQL and PostgreSQL databases respect
+   * `ssl_mode` and accepts only SSL connections.
+   * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration.SslMode ssl_mode = 8; + * + * @return The sslMode. + */ + com.google.cloud.sql.v1beta4.IpConfiguration.SslMode getSslMode(); + + /** + * + * + *
+   * PSC settings for this instance.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + * + * @return Whether the pscConfig field is set. + */ + boolean hasPscConfig(); + + /** + * + * + *
+   * PSC settings for this instance.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + * + * @return The pscConfig. + */ + com.google.cloud.sql.v1beta4.PscConfig getPscConfig(); + + /** + * + * + *
+   * PSC settings for this instance.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.PscConfig psc_config = 9; + */ + com.google.cloud.sql.v1beta4.PscConfigOrBuilder getPscConfigOrBuilder(); + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return Whether the serverCaMode field is set. + */ + boolean hasServerCaMode(); + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return The enum numeric value on the wire for serverCaMode. + */ + int getServerCaModeValue(); + + /** + * + * + *
+   * Specify what type of CA is used for the server certificate.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.IpConfiguration.CaMode server_ca_mode = 10; + * + * @return The serverCaMode. + */ + com.google.cloud.sql.v1beta4.IpConfiguration.CaMode getServerCaMode(); + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the customSubjectAlternativeNames. + */ + java.util.List getCustomSubjectAlternativeNamesList(); + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of customSubjectAlternativeNames. + */ + int getCustomSubjectAlternativeNamesCount(); + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The customSubjectAlternativeNames at the given index. + */ + java.lang.String getCustomSubjectAlternativeNames(int index); + + /** + * + * + *
+   * Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
+   * 
+ * + * + * repeated string custom_subject_alternative_names = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the customSubjectAlternativeNames at the given index. + */ + com.google.protobuf.ByteString getCustomSubjectAlternativeNamesBytes(int index); + + /** + * + * + *
+   * Optional. The resource name of the server CA pool for an instance with
+   * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+   * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+   * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the serverCaPool field is set. + */ + boolean hasServerCaPool(); + + /** + * + * + *
+   * Optional. The resource name of the server CA pool for an instance with
+   * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+   * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+   * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The serverCaPool. + */ + java.lang.String getServerCaPool(); + + /** + * + * + *
+   * Optional. The resource name of the server CA pool for an instance with
+   * `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
+   * Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
+   * 
+ * + * optional string server_ca_pool = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for serverCaPool. + */ + com.google.protobuf.ByteString getServerCaPoolBytes(); + + /** + * + * + *
+   * Optional. Controls the automatic server certificate rotation feature. This
+   * feature is disabled by default. When enabled, the server certificate will
+   * be automatically rotated during Cloud SQL scheduled maintenance or
+   * self-service maintenance updates up to six months before it expires. This
+   * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+   * or CUSTOMER_MANAGED_CAS_CA.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the serverCertificateRotationMode field is set. + */ + boolean hasServerCertificateRotationMode(); + + /** + * + * + *
+   * Optional. Controls the automatic server certificate rotation feature. This
+   * feature is disabled by default. When enabled, the server certificate will
+   * be automatically rotated during Cloud SQL scheduled maintenance or
+   * self-service maintenance updates up to six months before it expires. This
+   * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+   * or CUSTOMER_MANAGED_CAS_CA.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for serverCertificateRotationMode. + */ + int getServerCertificateRotationModeValue(); + + /** + * + * + *
+   * Optional. Controls the automatic server certificate rotation feature. This
+   * feature is disabled by default. When enabled, the server certificate will
+   * be automatically rotated during Cloud SQL scheduled maintenance or
+   * self-service maintenance updates up to six months before it expires. This
+   * setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
+   * or CUSTOMER_MANAGED_CAS_CA.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode server_certificate_rotation_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The serverCertificateRotationMode. + */ + com.google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode + getServerCertificateRotationMode(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/IpMapping.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/IpMapping.java new file mode 100644 index 000000000000..efea5c2464ff --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/IpMapping.java @@ -0,0 +1,1103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance IP mapping
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.IpMapping} + */ +@com.google.protobuf.Generated +public final class IpMapping extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.IpMapping) + IpMappingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "IpMapping"); + } + + // Use IpMapping.newBuilder() to construct. + private IpMapping(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private IpMapping() { + type_ = 0; + ipAddress_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_IpMapping_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_IpMapping_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.IpMapping.class, + com.google.cloud.sql.v1beta4.IpMapping.Builder.class); + } + + private int bitField0_; + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + + /** + * + * + *
+   * The type of this IP address. A `PRIMARY` address is a public address that
+   * can accept incoming connections. A `PRIVATE` address is a private address
+   * that can accept incoming connections. An `OUTGOING` address is the source
+   * address of connections originating from the instance, if supported.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlIpAddressType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * The type of this IP address. A `PRIMARY` address is a public address that
+   * can accept incoming connections. A `PRIVATE` address is a private address
+   * that can accept incoming connections. An `OUTGOING` address is the source
+   * address of connections originating from the instance, if supported.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlIpAddressType type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlIpAddressType getType() { + com.google.cloud.sql.v1beta4.SqlIpAddressType result = + com.google.cloud.sql.v1beta4.SqlIpAddressType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1beta4.SqlIpAddressType.UNRECOGNIZED : result; + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipAddress_ = ""; + + /** + * + * + *
+   * The IP address assigned.
+   * 
+ * + * string ip_address = 2; + * + * @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; + } + } + + /** + * + * + *
+   * The IP address assigned.
+   * 
+ * + * string ip_address = 2; + * + * @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 TIME_TO_RETIRE_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp timeToRetire_; + + /** + * + * + *
+   * The due time for this IP to be retired in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`. This field is only available when
+   * the IP is scheduled to be retired.
+   * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + * + * @return Whether the timeToRetire field is set. + */ + @java.lang.Override + public boolean hasTimeToRetire() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The due time for this IP to be retired in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`. This field is only available when
+   * the IP is scheduled to be retired.
+   * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + * + * @return The timeToRetire. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimeToRetire() { + return timeToRetire_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : timeToRetire_; + } + + /** + * + * + *
+   * The due time for this IP to be retired in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`. This field is only available when
+   * the IP is scheduled to be retired.
+   * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getTimeToRetireOrBuilder() { + return timeToRetire_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : timeToRetire_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (type_ + != com.google.cloud.sql.v1beta4.SqlIpAddressType.SQL_IP_ADDRESS_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(ipAddress_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, ipAddress_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getTimeToRetire()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.cloud.sql.v1beta4.SqlIpAddressType.SQL_IP_ADDRESS_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(ipAddress_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, ipAddress_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTimeToRetire()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.IpMapping)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.IpMapping other = (com.google.cloud.sql.v1beta4.IpMapping) obj; + + if (type_ != other.type_) return false; + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (hasTimeToRetire() != other.hasTimeToRetire()) return false; + if (hasTimeToRetire()) { + if (!getTimeToRetire().equals(other.getTimeToRetire())) return false; + } + if (!getUnknownFields().equals(other.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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + if (hasTimeToRetire()) { + hash = (37 * hash) + TIME_TO_RETIRE_FIELD_NUMBER; + hash = (53 * hash) + getTimeToRetire().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.IpMapping parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.IpMapping parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.IpMapping parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.IpMapping parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.IpMapping parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.IpMapping parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.IpMapping parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.IpMapping parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.IpMapping parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.IpMapping parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.IpMapping parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.IpMapping parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.IpMapping prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance IP mapping
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.IpMapping} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.IpMapping) + com.google.cloud.sql.v1beta4.IpMappingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_IpMapping_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_IpMapping_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.IpMapping.class, + com.google.cloud.sql.v1beta4.IpMapping.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.IpMapping.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTimeToRetireFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + ipAddress_ = ""; + timeToRetire_ = null; + if (timeToRetireBuilder_ != null) { + timeToRetireBuilder_.dispose(); + timeToRetireBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_IpMapping_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpMapping getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.IpMapping.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpMapping build() { + com.google.cloud.sql.v1beta4.IpMapping result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpMapping buildPartial() { + com.google.cloud.sql.v1beta4.IpMapping result = + new com.google.cloud.sql.v1beta4.IpMapping(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.IpMapping result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ipAddress_ = ipAddress_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.timeToRetire_ = + timeToRetireBuilder_ == null ? timeToRetire_ : timeToRetireBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.IpMapping) { + return mergeFrom((com.google.cloud.sql.v1beta4.IpMapping) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.IpMapping other) { + if (other == com.google.cloud.sql.v1beta4.IpMapping.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasTimeToRetire()) { + mergeTimeToRetire(other.getTimeToRetire()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + ipAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetTimeToRetireFieldBuilder().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 type_ = 0; + + /** + * + * + *
+     * The type of this IP address. A `PRIMARY` address is a public address that
+     * can accept incoming connections. A `PRIVATE` address is a private address
+     * that can accept incoming connections. An `OUTGOING` address is the source
+     * address of connections originating from the instance, if supported.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlIpAddressType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * The type of this IP address. A `PRIMARY` address is a public address that
+     * can accept incoming connections. A `PRIVATE` address is a private address
+     * that can accept incoming connections. An `OUTGOING` address is the source
+     * address of connections originating from the instance, if supported.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlIpAddressType type = 1; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of this IP address. A `PRIMARY` address is a public address that
+     * can accept incoming connections. A `PRIVATE` address is a private address
+     * that can accept incoming connections. An `OUTGOING` address is the source
+     * address of connections originating from the instance, if supported.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlIpAddressType type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlIpAddressType getType() { + com.google.cloud.sql.v1beta4.SqlIpAddressType result = + com.google.cloud.sql.v1beta4.SqlIpAddressType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1beta4.SqlIpAddressType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The type of this IP address. A `PRIMARY` address is a public address that
+     * can accept incoming connections. A `PRIVATE` address is a private address
+     * that can accept incoming connections. An `OUTGOING` address is the source
+     * address of connections originating from the instance, if supported.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlIpAddressType type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.sql.v1beta4.SqlIpAddressType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of this IP address. A `PRIMARY` address is a public address that
+     * can accept incoming connections. A `PRIVATE` address is a private address
+     * that can accept incoming connections. An `OUTGOING` address is the source
+     * address of connections originating from the instance, if supported.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlIpAddressType type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + + /** + * + * + *
+     * The IP address assigned.
+     * 
+ * + * string ip_address = 2; + * + * @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; + } + } + + /** + * + * + *
+     * The IP address assigned.
+     * 
+ * + * string ip_address = 2; + * + * @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; + } + } + + /** + * + * + *
+     * The IP address assigned.
+     * 
+ * + * string ip_address = 2; + * + * @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; + } + + /** + * + * + *
+     * The IP address assigned.
+     * 
+ * + * string ip_address = 2; + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + ipAddress_ = getDefaultInstance().getIpAddress(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The IP address assigned.
+     * 
+ * + * string ip_address = 2; + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ipAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp timeToRetire_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + timeToRetireBuilder_; + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + * + * @return Whether the timeToRetire field is set. + */ + public boolean hasTimeToRetire() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + * + * @return The timeToRetire. + */ + public com.google.protobuf.Timestamp getTimeToRetire() { + if (timeToRetireBuilder_ == null) { + return timeToRetire_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : timeToRetire_; + } else { + return timeToRetireBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + public Builder setTimeToRetire(com.google.protobuf.Timestamp value) { + if (timeToRetireBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeToRetire_ = value; + } else { + timeToRetireBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + public Builder setTimeToRetire(com.google.protobuf.Timestamp.Builder builderForValue) { + if (timeToRetireBuilder_ == null) { + timeToRetire_ = builderForValue.build(); + } else { + timeToRetireBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + public Builder mergeTimeToRetire(com.google.protobuf.Timestamp value) { + if (timeToRetireBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && timeToRetire_ != null + && timeToRetire_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getTimeToRetireBuilder().mergeFrom(value); + } else { + timeToRetire_ = value; + } + } else { + timeToRetireBuilder_.mergeFrom(value); + } + if (timeToRetire_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + public Builder clearTimeToRetire() { + bitField0_ = (bitField0_ & ~0x00000004); + timeToRetire_ = null; + if (timeToRetireBuilder_ != null) { + timeToRetireBuilder_.dispose(); + timeToRetireBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + public com.google.protobuf.Timestamp.Builder getTimeToRetireBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetTimeToRetireFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + public com.google.protobuf.TimestampOrBuilder getTimeToRetireOrBuilder() { + if (timeToRetireBuilder_ != null) { + return timeToRetireBuilder_.getMessageOrBuilder(); + } else { + return timeToRetire_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : timeToRetire_; + } + } + + /** + * + * + *
+     * The due time for this IP to be retired in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`. This field is only available when
+     * the IP is scheduled to be retired.
+     * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetTimeToRetireFieldBuilder() { + if (timeToRetireBuilder_ == null) { + timeToRetireBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getTimeToRetire(), getParentForChildren(), isClean()); + timeToRetire_ = null; + } + return timeToRetireBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.IpMapping) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.IpMapping) + private static final com.google.cloud.sql.v1beta4.IpMapping DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.IpMapping(); + } + + public static com.google.cloud.sql.v1beta4.IpMapping getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IpMapping parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpMapping getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/IpMappingOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/IpMappingOrBuilder.java new file mode 100644 index 000000000000..a1890c9c5daf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/IpMappingOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface IpMappingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.IpMapping) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The type of this IP address. A `PRIMARY` address is a public address that
+   * can accept incoming connections. A `PRIVATE` address is a private address
+   * that can accept incoming connections. An `OUTGOING` address is the source
+   * address of connections originating from the instance, if supported.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlIpAddressType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * The type of this IP address. A `PRIMARY` address is a public address that
+   * can accept incoming connections. A `PRIVATE` address is a private address
+   * that can accept incoming connections. An `OUTGOING` address is the source
+   * address of connections originating from the instance, if supported.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlIpAddressType type = 1; + * + * @return The type. + */ + com.google.cloud.sql.v1beta4.SqlIpAddressType getType(); + + /** + * + * + *
+   * The IP address assigned.
+   * 
+ * + * string ip_address = 2; + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + + /** + * + * + *
+   * The IP address assigned.
+   * 
+ * + * string ip_address = 2; + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * The due time for this IP to be retired in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`. This field is only available when
+   * the IP is scheduled to be retired.
+   * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + * + * @return Whether the timeToRetire field is set. + */ + boolean hasTimeToRetire(); + + /** + * + * + *
+   * The due time for this IP to be retired in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`. This field is only available when
+   * the IP is scheduled to be retired.
+   * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + * + * @return The timeToRetire. + */ + com.google.protobuf.Timestamp getTimeToRetire(); + + /** + * + * + *
+   * The due time for this IP to be retired in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`. This field is only available when
+   * the IP is scheduled to be retired.
+   * 
+ * + * .google.protobuf.Timestamp time_to_retire = 3; + */ + com.google.protobuf.TimestampOrBuilder getTimeToRetireOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ListBackupsRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ListBackupsRequest.java new file mode 100644 index 000000000000..5a13e5925312 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ListBackupsRequest.java @@ -0,0 +1,1157 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The request payload to list the backups.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ListBackupsRequest} + */ +@com.google.protobuf.Generated +public final class ListBackupsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ListBackupsRequest) + ListBackupsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListBackupsRequest"); + } + + // Use ListBackupsRequest.newBuilder() to construct. + private ListBackupsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListBackupsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ListBackupsRequest.class, + com.google.cloud.sql.v1beta4.ListBackupsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The parent that owns this collection of backups.
+   * Format: projects/{project}
+   * 
+ * + * + * 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 that owns this collection of backups.
+   * Format: projects/{project}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
+   * The maximum number of backups to return per response. The service might
+   * return fewer backups than this value. If a value for this parameter isn't
+   * specified, then, at most, 500 backups are returned. The maximum value is
+   * 2,000. Any values that you set, which are greater than 2,000, are changed
+   * to 2,000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * A page token, received from a previous `ListBackups` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListBackups` must match
+   * the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A page token, received from a previous `ListBackups` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListBackups` must match
+   * the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Multiple filter queries are separated by spaces. For example,
+   * 'instance:abc AND type:FINAL, 'location:us',
+   * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+   * type, instance, backupInterval.startTime (creation time), or location.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Multiple filter queries are separated by spaces. For example,
+   * 'instance:abc AND type:FINAL, 'location:us',
+   * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+   * type, instance, backupInterval.startTime (creation time), or location.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, filter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, filter_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ListBackupsRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ListBackupsRequest other = + (com.google.cloud.sql.v1beta4.ListBackupsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getUnknownFields().equals(other.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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ListBackupsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.ListBackupsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request payload to list the backups.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ListBackupsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ListBackupsRequest) + com.google.cloud.sql.v1beta4.ListBackupsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ListBackupsRequest.class, + com.google.cloud.sql.v1beta4.ListBackupsRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ListBackupsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ListBackupsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ListBackupsRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ListBackupsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ListBackupsRequest build() { + com.google.cloud.sql.v1beta4.ListBackupsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ListBackupsRequest buildPartial() { + com.google.cloud.sql.v1beta4.ListBackupsRequest result = + new com.google.cloud.sql.v1beta4.ListBackupsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ListBackupsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ListBackupsRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.ListBackupsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ListBackupsRequest other) { + if (other == com.google.cloud.sql.v1beta4.ListBackupsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 that owns this collection of backups.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 that owns this collection of backups.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 that owns this collection of backups.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 that owns this collection of backups.
+     * Format: projects/{project}
+     * 
+ * + * + * 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 that owns this collection of backups.
+     * Format: projects/{project}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * The maximum number of backups to return per response. The service might
+     * return fewer backups than this value. If a value for this parameter isn't
+     * specified, then, at most, 500 backups are returned. The maximum value is
+     * 2,000. Any values that you set, which are greater than 2,000, are changed
+     * to 2,000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * The maximum number of backups to return per response. The service might
+     * return fewer backups than this value. If a value for this parameter isn't
+     * specified, then, at most, 500 backups are returned. The maximum value is
+     * 2,000. Any values that you set, which are greater than 2,000, are changed
+     * to 2,000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum number of backups to return per response. The service might
+     * return fewer backups than this value. If a value for this parameter isn't
+     * specified, then, at most, 500 backups are returned. The maximum value is
+     * 2,000. Any values that you set, which are greater than 2,000, are changed
+     * to 2,000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * A page token, received from a previous `ListBackups` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListBackups` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A page token, received from a previous `ListBackups` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListBackups` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A page token, received from a previous `ListBackups` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListBackups` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * A page token, received from a previous `ListBackups` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListBackups` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * A page token, received from a previous `ListBackups` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListBackups` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Multiple filter queries are separated by spaces. For example,
+     * 'instance:abc AND type:FINAL, 'location:us',
+     * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+     * type, instance, backupInterval.startTime (creation time), or location.
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Multiple filter queries are separated by spaces. For example,
+     * 'instance:abc AND type:FINAL, 'location:us',
+     * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+     * type, instance, backupInterval.startTime (creation time), or location.
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Multiple filter queries are separated by spaces. For example,
+     * 'instance:abc AND type:FINAL, 'location:us',
+     * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+     * type, instance, backupInterval.startTime (creation time), or location.
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Multiple filter queries are separated by spaces. For example,
+     * 'instance:abc AND type:FINAL, 'location:us',
+     * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+     * type, instance, backupInterval.startTime (creation time), or location.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Multiple filter queries are separated by spaces. For example,
+     * 'instance:abc AND type:FINAL, 'location:us',
+     * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+     * type, instance, backupInterval.startTime (creation time), or location.
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ListBackupsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ListBackupsRequest) + private static final com.google.cloud.sql.v1beta4.ListBackupsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ListBackupsRequest(); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ListBackupsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ListBackupsRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ListBackupsRequestOrBuilder.java new file mode 100644 index 000000000000..5a7d83ac9e67 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ListBackupsRequestOrBuilder.java @@ -0,0 +1,143 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ListBackupsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ListBackupsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent that owns this collection of backups.
+   * Format: projects/{project}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent that owns this collection of backups.
+   * Format: projects/{project}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of backups to return per response. The service might
+   * return fewer backups than this value. If a value for this parameter isn't
+   * specified, then, at most, 500 backups are returned. The maximum value is
+   * 2,000. Any values that you set, which are greater than 2,000, are changed
+   * to 2,000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListBackups` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListBackups` must match
+   * the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * A page token, received from a previous `ListBackups` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListBackups` must match
+   * the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Multiple filter queries are separated by spaces. For example,
+   * 'instance:abc AND type:FINAL, 'location:us',
+   * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+   * type, instance, backupInterval.startTime (creation time), or location.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Multiple filter queries are separated by spaces. For example,
+   * 'instance:abc AND type:FINAL, 'location:us',
+   * 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
+   * type, instance, backupInterval.startTime (creation time), or location.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ListBackupsResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ListBackupsResponse.java new file mode 100644 index 000000000000..bbb67786c8de --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ListBackupsResponse.java @@ -0,0 +1,1650 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The response payload containing a list of the backups.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ListBackupsResponse} + */ +@com.google.protobuf.Generated +public final class ListBackupsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ListBackupsResponse) + ListBackupsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListBackupsResponse"); + } + + // Use ListBackupsResponse.newBuilder() to construct. + private ListBackupsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListBackupsResponse() { + backups_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + warnings_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ListBackupsResponse.class, + com.google.cloud.sql.v1beta4.ListBackupsResponse.Builder.class); + } + + public static final int BACKUPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List backups_; + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + @java.lang.Override + public java.util.List getBackupsList() { + return backups_; + } + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + @java.lang.Override + public java.util.List + getBackupsOrBuilderList() { + return backups_; + } + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + @java.lang.Override + public int getBackupsCount() { + return backups_.size(); + } + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Backup getBackups(int index) { + return backups_.get(index); + } + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupOrBuilder getBackupsOrBuilder(int index) { + return backups_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, then there aren't 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, then there aren't 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 WARNINGS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List warnings_; + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + @java.lang.Override + public java.util.List getWarningsList() { + return warnings_; + } + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + @java.lang.Override + public java.util.List + getWarningsOrBuilderList() { + return warnings_; + } + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + @java.lang.Override + public int getWarningsCount() { + return warnings_.size(); + } + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ApiWarning getWarnings(int index) { + return warnings_.get(index); + } + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ApiWarningOrBuilder getWarningsOrBuilder(int index) { + return warnings_.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 < backups_.size(); i++) { + output.writeMessage(1, backups_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < warnings_.size(); i++) { + output.writeMessage(3, warnings_.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 < backups_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, backups_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + for (int i = 0; i < warnings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, warnings_.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.sql.v1beta4.ListBackupsResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ListBackupsResponse other = + (com.google.cloud.sql.v1beta4.ListBackupsResponse) obj; + + if (!getBackupsList().equals(other.getBackupsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getWarningsList().equals(other.getWarningsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBackupsCount() > 0) { + hash = (37 * hash) + BACKUPS_FIELD_NUMBER; + hash = (53 * hash) + getBackupsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getWarningsCount() > 0) { + hash = (37 * hash) + WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + getWarningsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ListBackupsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.ListBackupsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The response payload containing a list of the backups.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ListBackupsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ListBackupsResponse) + com.google.cloud.sql.v1beta4.ListBackupsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ListBackupsResponse.class, + com.google.cloud.sql.v1beta4.ListBackupsResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ListBackupsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + } else { + backups_ = null; + backupsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + if (warningsBuilder_ == null) { + warnings_ = java.util.Collections.emptyList(); + } else { + warnings_ = null; + warningsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_ListBackupsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ListBackupsResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ListBackupsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ListBackupsResponse build() { + com.google.cloud.sql.v1beta4.ListBackupsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ListBackupsResponse buildPartial() { + com.google.cloud.sql.v1beta4.ListBackupsResponse result = + new com.google.cloud.sql.v1beta4.ListBackupsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.ListBackupsResponse result) { + if (backupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + backups_ = java.util.Collections.unmodifiableList(backups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.backups_ = backups_; + } else { + result.backups_ = backupsBuilder_.build(); + } + if (warningsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + warnings_ = java.util.Collections.unmodifiableList(warnings_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.warnings_ = warnings_; + } else { + result.warnings_ = warningsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ListBackupsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ListBackupsResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.ListBackupsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ListBackupsResponse other) { + if (other == com.google.cloud.sql.v1beta4.ListBackupsResponse.getDefaultInstance()) + return this; + if (backupsBuilder_ == null) { + if (!other.backups_.isEmpty()) { + if (backups_.isEmpty()) { + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBackupsIsMutable(); + backups_.addAll(other.backups_); + } + onChanged(); + } + } else { + if (!other.backups_.isEmpty()) { + if (backupsBuilder_.isEmpty()) { + backupsBuilder_.dispose(); + backupsBuilder_ = null; + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + backupsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetBackupsFieldBuilder() + : null; + } else { + backupsBuilder_.addAllMessages(other.backups_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (warningsBuilder_ == null) { + if (!other.warnings_.isEmpty()) { + if (warnings_.isEmpty()) { + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureWarningsIsMutable(); + warnings_.addAll(other.warnings_); + } + onChanged(); + } + } else { + if (!other.warnings_.isEmpty()) { + if (warningsBuilder_.isEmpty()) { + warningsBuilder_.dispose(); + warningsBuilder_ = null; + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000004); + warningsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetWarningsFieldBuilder() + : null; + } else { + warningsBuilder_.addAllMessages(other.warnings_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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.sql.v1beta4.Backup m = + input.readMessage( + com.google.cloud.sql.v1beta4.Backup.parser(), extensionRegistry); + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(m); + } else { + backupsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.cloud.sql.v1beta4.ApiWarning m = + input.readMessage( + com.google.cloud.sql.v1beta4.ApiWarning.parser(), extensionRegistry); + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(m); + } else { + warningsBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List backups_ = + java.util.Collections.emptyList(); + + private void ensureBackupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + backups_ = new java.util.ArrayList(backups_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Backup, + com.google.cloud.sql.v1beta4.Backup.Builder, + com.google.cloud.sql.v1beta4.BackupOrBuilder> + backupsBuilder_; + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public java.util.List getBackupsList() { + if (backupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(backups_); + } else { + return backupsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public int getBackupsCount() { + if (backupsBuilder_ == null) { + return backups_.size(); + } else { + return backupsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public com.google.cloud.sql.v1beta4.Backup getBackups(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public Builder setBackups(int index, com.google.cloud.sql.v1beta4.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.set(index, value); + onChanged(); + } else { + backupsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public Builder setBackups( + int index, com.google.cloud.sql.v1beta4.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.set(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public Builder addBackups(com.google.cloud.sql.v1beta4.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(value); + onChanged(); + } else { + backupsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public Builder addBackups(int index, com.google.cloud.sql.v1beta4.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(index, value); + onChanged(); + } else { + backupsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public Builder addBackups(com.google.cloud.sql.v1beta4.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public Builder addBackups( + int index, com.google.cloud.sql.v1beta4.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public Builder addAllBackups( + java.lang.Iterable values) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, backups_); + onChanged(); + } else { + backupsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public Builder clearBackups() { + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + backupsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public Builder removeBackups(int index) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.remove(index); + onChanged(); + } else { + backupsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public com.google.cloud.sql.v1beta4.Backup.Builder getBackupsBuilder(int index) { + return internalGetBackupsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public com.google.cloud.sql.v1beta4.BackupOrBuilder getBackupsOrBuilder(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public java.util.List + getBackupsOrBuilderList() { + if (backupsBuilder_ != null) { + return backupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(backups_); + } + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public com.google.cloud.sql.v1beta4.Backup.Builder addBackupsBuilder() { + return internalGetBackupsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.Backup.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public com.google.cloud.sql.v1beta4.Backup.Builder addBackupsBuilder(int index) { + return internalGetBackupsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.Backup.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of backups.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + public java.util.List getBackupsBuilderList() { + return internalGetBackupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Backup, + com.google.cloud.sql.v1beta4.Backup.Builder, + com.google.cloud.sql.v1beta4.BackupOrBuilder> + internalGetBackupsFieldBuilder() { + if (backupsBuilder_ == null) { + backupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Backup, + com.google.cloud.sql.v1beta4.Backup.Builder, + com.google.cloud.sql.v1beta4.BackupOrBuilder>( + backups_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + backups_ = null; + } + return backupsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, then there aren't 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, then there aren't 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, then there aren't 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, then there aren't 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, then there aren't 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 java.util.List warnings_ = + java.util.Collections.emptyList(); + + private void ensureWarningsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + warnings_ = new java.util.ArrayList(warnings_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ApiWarning, + com.google.cloud.sql.v1beta4.ApiWarning.Builder, + com.google.cloud.sql.v1beta4.ApiWarningOrBuilder> + warningsBuilder_; + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public java.util.List getWarningsList() { + if (warningsBuilder_ == null) { + return java.util.Collections.unmodifiableList(warnings_); + } else { + return warningsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public int getWarningsCount() { + if (warningsBuilder_ == null) { + return warnings_.size(); + } else { + return warningsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public com.google.cloud.sql.v1beta4.ApiWarning getWarnings(int index) { + if (warningsBuilder_ == null) { + return warnings_.get(index); + } else { + return warningsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public Builder setWarnings(int index, com.google.cloud.sql.v1beta4.ApiWarning value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.set(index, value); + onChanged(); + } else { + warningsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public Builder setWarnings( + int index, com.google.cloud.sql.v1beta4.ApiWarning.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.set(index, builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public Builder addWarnings(com.google.cloud.sql.v1beta4.ApiWarning value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(value); + onChanged(); + } else { + warningsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public Builder addWarnings(int index, com.google.cloud.sql.v1beta4.ApiWarning value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(index, value); + onChanged(); + } else { + warningsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public Builder addWarnings(com.google.cloud.sql.v1beta4.ApiWarning.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public Builder addWarnings( + int index, com.google.cloud.sql.v1beta4.ApiWarning.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(index, builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public Builder addAllWarnings( + java.lang.Iterable values) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, warnings_); + onChanged(); + } else { + warningsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public Builder clearWarnings() { + if (warningsBuilder_ == null) { + warnings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + warningsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public Builder removeWarnings(int index) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.remove(index); + onChanged(); + } else { + warningsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public com.google.cloud.sql.v1beta4.ApiWarning.Builder getWarningsBuilder(int index) { + return internalGetWarningsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public com.google.cloud.sql.v1beta4.ApiWarningOrBuilder getWarningsOrBuilder(int index) { + if (warningsBuilder_ == null) { + return warnings_.get(index); + } else { + return warningsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public java.util.List + getWarningsOrBuilderList() { + if (warningsBuilder_ != null) { + return warningsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(warnings_); + } + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public com.google.cloud.sql.v1beta4.ApiWarning.Builder addWarningsBuilder() { + return internalGetWarningsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.ApiWarning.getDefaultInstance()); + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public com.google.cloud.sql.v1beta4.ApiWarning.Builder addWarningsBuilder(int index) { + return internalGetWarningsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.ApiWarning.getDefaultInstance()); + } + + /** + * + * + *
+     * If a region isn't unavailable or if an unknown error occurs, then a warning
+     * message is returned.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + public java.util.List + getWarningsBuilderList() { + return internalGetWarningsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ApiWarning, + com.google.cloud.sql.v1beta4.ApiWarning.Builder, + com.google.cloud.sql.v1beta4.ApiWarningOrBuilder> + internalGetWarningsFieldBuilder() { + if (warningsBuilder_ == null) { + warningsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ApiWarning, + com.google.cloud.sql.v1beta4.ApiWarning.Builder, + com.google.cloud.sql.v1beta4.ApiWarningOrBuilder>( + warnings_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + warnings_ = null; + } + return warningsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ListBackupsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ListBackupsResponse) + private static final com.google.cloud.sql.v1beta4.ListBackupsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ListBackupsResponse(); + } + + public static com.google.cloud.sql.v1beta4.ListBackupsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ListBackupsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ListBackupsResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ListBackupsResponseOrBuilder.java new file mode 100644 index 000000000000..a2c3ce88db78 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ListBackupsResponseOrBuilder.java @@ -0,0 +1,172 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ListBackupsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ListBackupsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + java.util.List getBackupsList(); + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + com.google.cloud.sql.v1beta4.Backup getBackups(int index); + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + int getBackupsCount(); + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + java.util.List getBackupsOrBuilderList(); + + /** + * + * + *
+   * A list of backups.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Backup backups = 1; + */ + com.google.cloud.sql.v1beta4.BackupOrBuilder getBackupsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, then there aren't 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, then there aren't subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + java.util.List getWarningsList(); + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + com.google.cloud.sql.v1beta4.ApiWarning getWarnings(int index); + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + int getWarningsCount(); + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + java.util.List + getWarningsOrBuilderList(); + + /** + * + * + *
+   * If a region isn't unavailable or if an unknown error occurs, then a warning
+   * message is returned.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.ApiWarning warnings = 3; + */ + com.google.cloud.sql.v1beta4.ApiWarningOrBuilder getWarningsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/LocationPreference.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/LocationPreference.java new file mode 100644 index 000000000000..753d8914ad52 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/LocationPreference.java @@ -0,0 +1,1218 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Preferred location. This specifies where a Cloud SQL instance is located.
+ * Note that if the preferred location is not available, the instance will be
+ * located as close as possible within the region. Only one location may be
+ * specified.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.LocationPreference} + */ +@com.google.protobuf.Generated +public final class LocationPreference extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.LocationPreference) + LocationPreferenceOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LocationPreference"); + } + + // Use LocationPreference.newBuilder() to construct. + private LocationPreference(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private LocationPreference() { + followGaeApplication_ = ""; + zone_ = ""; + secondaryZone_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_LocationPreference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_LocationPreference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.LocationPreference.class, + com.google.cloud.sql.v1beta4.LocationPreference.Builder.class); + } + + public static final int FOLLOW_GAE_APPLICATION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object followGaeApplication_ = ""; + + /** + * + * + *
+   * The App Engine application to follow, it must be in the same region as the
+   * Cloud SQL instance. WARNING: Changing this might restart the instance.
+   * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.LocationPreference.follow_gae_application is deprecated. + * See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=2484 + * @return The followGaeApplication. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getFollowGaeApplication() { + java.lang.Object ref = followGaeApplication_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + followGaeApplication_ = s; + return s; + } + } + + /** + * + * + *
+   * The App Engine application to follow, it must be in the same region as the
+   * Cloud SQL instance. WARNING: Changing this might restart the instance.
+   * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.LocationPreference.follow_gae_application is deprecated. + * See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=2484 + * @return The bytes for followGaeApplication. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getFollowGaeApplicationBytes() { + java.lang.Object ref = followGaeApplication_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + followGaeApplication_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ZONE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object zone_ = ""; + + /** + * + * + *
+   * The preferred Compute Engine zone (for example: us-central1-a,
+   * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+   * 
+ * + * string zone = 2; + * + * @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; + } + } + + /** + * + * + *
+   * The preferred Compute Engine zone (for example: us-central1-a,
+   * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+   * 
+ * + * string zone = 2; + * + * @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 SECONDARY_ZONE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object secondaryZone_ = ""; + + /** + * + * + *
+   * The preferred Compute Engine zone for the secondary/failover
+   * (for example: us-central1-a, us-central1-b, etc.).
+   * To disable this field, set it to 'no_secondary_zone'.
+   * 
+ * + * string secondary_zone = 4; + * + * @return The secondaryZone. + */ + @java.lang.Override + public java.lang.String getSecondaryZone() { + java.lang.Object ref = secondaryZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secondaryZone_ = s; + return s; + } + } + + /** + * + * + *
+   * The preferred Compute Engine zone for the secondary/failover
+   * (for example: us-central1-a, us-central1-b, etc.).
+   * To disable this field, set it to 'no_secondary_zone'.
+   * 
+ * + * string secondary_zone = 4; + * + * @return The bytes for secondaryZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSecondaryZoneBytes() { + java.lang.Object ref = secondaryZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secondaryZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#locationPreference`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#locationPreference`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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.GeneratedMessage.isStringEmpty(followGaeApplication_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, followGaeApplication_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(zone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, zone_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(secondaryZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, secondaryZone_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(followGaeApplication_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, followGaeApplication_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(zone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, zone_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(secondaryZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, secondaryZone_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.LocationPreference)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.LocationPreference other = + (com.google.cloud.sql.v1beta4.LocationPreference) obj; + + if (!getFollowGaeApplication().equals(other.getFollowGaeApplication())) return false; + if (!getZone().equals(other.getZone())) return false; + if (!getSecondaryZone().equals(other.getSecondaryZone())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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) + FOLLOW_GAE_APPLICATION_FIELD_NUMBER; + hash = (53 * hash) + getFollowGaeApplication().hashCode(); + hash = (37 * hash) + ZONE_FIELD_NUMBER; + hash = (53 * hash) + getZone().hashCode(); + hash = (37 * hash) + SECONDARY_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getSecondaryZone().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.LocationPreference parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.LocationPreference parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.LocationPreference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.LocationPreference parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.LocationPreference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.LocationPreference parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.LocationPreference parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.LocationPreference parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.LocationPreference parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.LocationPreference parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.LocationPreference parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.LocationPreference parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.LocationPreference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Preferred location. This specifies where a Cloud SQL instance is located.
+   * Note that if the preferred location is not available, the instance will be
+   * located as close as possible within the region. Only one location may be
+   * specified.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.LocationPreference} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.LocationPreference) + com.google.cloud.sql.v1beta4.LocationPreferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_LocationPreference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_LocationPreference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.LocationPreference.class, + com.google.cloud.sql.v1beta4.LocationPreference.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.LocationPreference.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + followGaeApplication_ = ""; + zone_ = ""; + secondaryZone_ = ""; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_LocationPreference_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.LocationPreference getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.LocationPreference.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.LocationPreference build() { + com.google.cloud.sql.v1beta4.LocationPreference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.LocationPreference buildPartial() { + com.google.cloud.sql.v1beta4.LocationPreference result = + new com.google.cloud.sql.v1beta4.LocationPreference(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.LocationPreference result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.followGaeApplication_ = followGaeApplication_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.zone_ = zone_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.secondaryZone_ = secondaryZone_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.LocationPreference) { + return mergeFrom((com.google.cloud.sql.v1beta4.LocationPreference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.LocationPreference other) { + if (other == com.google.cloud.sql.v1beta4.LocationPreference.getDefaultInstance()) + return this; + if (!other.getFollowGaeApplication().isEmpty()) { + followGaeApplication_ = other.followGaeApplication_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getZone().isEmpty()) { + zone_ = other.zone_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSecondaryZone().isEmpty()) { + secondaryZone_ = other.secondaryZone_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + followGaeApplication_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + zone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + secondaryZone_ = 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 followGaeApplication_ = ""; + + /** + * + * + *
+     * The App Engine application to follow, it must be in the same region as the
+     * Cloud SQL instance. WARNING: Changing this might restart the instance.
+     * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.LocationPreference.follow_gae_application is deprecated. + * See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=2484 + * @return The followGaeApplication. + */ + @java.lang.Deprecated + public java.lang.String getFollowGaeApplication() { + java.lang.Object ref = followGaeApplication_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + followGaeApplication_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The App Engine application to follow, it must be in the same region as the
+     * Cloud SQL instance. WARNING: Changing this might restart the instance.
+     * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.LocationPreference.follow_gae_application is deprecated. + * See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=2484 + * @return The bytes for followGaeApplication. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getFollowGaeApplicationBytes() { + java.lang.Object ref = followGaeApplication_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + followGaeApplication_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The App Engine application to follow, it must be in the same region as the
+     * Cloud SQL instance. WARNING: Changing this might restart the instance.
+     * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.LocationPreference.follow_gae_application is deprecated. + * See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=2484 + * @param value The followGaeApplication to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setFollowGaeApplication(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + followGaeApplication_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The App Engine application to follow, it must be in the same region as the
+     * Cloud SQL instance. WARNING: Changing this might restart the instance.
+     * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.LocationPreference.follow_gae_application is deprecated. + * See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=2484 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearFollowGaeApplication() { + followGaeApplication_ = getDefaultInstance().getFollowGaeApplication(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The App Engine application to follow, it must be in the same region as the
+     * Cloud SQL instance. WARNING: Changing this might restart the instance.
+     * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.LocationPreference.follow_gae_application is deprecated. + * See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=2484 + * @param value The bytes for followGaeApplication to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setFollowGaeApplicationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + followGaeApplication_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object zone_ = ""; + + /** + * + * + *
+     * The preferred Compute Engine zone (for example: us-central1-a,
+     * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+     * 
+ * + * string zone = 2; + * + * @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; + } + } + + /** + * + * + *
+     * The preferred Compute Engine zone (for example: us-central1-a,
+     * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+     * 
+ * + * string zone = 2; + * + * @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; + } + } + + /** + * + * + *
+     * The preferred Compute Engine zone (for example: us-central1-a,
+     * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+     * 
+ * + * string zone = 2; + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The preferred Compute Engine zone (for example: us-central1-a,
+     * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+     * 
+ * + * string zone = 2; + * + * @return This builder for chaining. + */ + public Builder clearZone() { + zone_ = getDefaultInstance().getZone(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The preferred Compute Engine zone (for example: us-central1-a,
+     * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+     * 
+ * + * string zone = 2; + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object secondaryZone_ = ""; + + /** + * + * + *
+     * The preferred Compute Engine zone for the secondary/failover
+     * (for example: us-central1-a, us-central1-b, etc.).
+     * To disable this field, set it to 'no_secondary_zone'.
+     * 
+ * + * string secondary_zone = 4; + * + * @return The secondaryZone. + */ + public java.lang.String getSecondaryZone() { + java.lang.Object ref = secondaryZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secondaryZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The preferred Compute Engine zone for the secondary/failover
+     * (for example: us-central1-a, us-central1-b, etc.).
+     * To disable this field, set it to 'no_secondary_zone'.
+     * 
+ * + * string secondary_zone = 4; + * + * @return The bytes for secondaryZone. + */ + public com.google.protobuf.ByteString getSecondaryZoneBytes() { + java.lang.Object ref = secondaryZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secondaryZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The preferred Compute Engine zone for the secondary/failover
+     * (for example: us-central1-a, us-central1-b, etc.).
+     * To disable this field, set it to 'no_secondary_zone'.
+     * 
+ * + * string secondary_zone = 4; + * + * @param value The secondaryZone to set. + * @return This builder for chaining. + */ + public Builder setSecondaryZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + secondaryZone_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The preferred Compute Engine zone for the secondary/failover
+     * (for example: us-central1-a, us-central1-b, etc.).
+     * To disable this field, set it to 'no_secondary_zone'.
+     * 
+ * + * string secondary_zone = 4; + * + * @return This builder for chaining. + */ + public Builder clearSecondaryZone() { + secondaryZone_ = getDefaultInstance().getSecondaryZone(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The preferred Compute Engine zone for the secondary/failover
+     * (for example: us-central1-a, us-central1-b, etc.).
+     * To disable this field, set it to 'no_secondary_zone'.
+     * 
+ * + * string secondary_zone = 4; + * + * @param value The bytes for secondaryZone to set. + * @return This builder for chaining. + */ + public Builder setSecondaryZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + secondaryZone_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#locationPreference`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#locationPreference`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#locationPreference`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#locationPreference`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#locationPreference`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.LocationPreference) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.LocationPreference) + private static final com.google.cloud.sql.v1beta4.LocationPreference DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.LocationPreference(); + } + + public static com.google.cloud.sql.v1beta4.LocationPreference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocationPreference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.LocationPreference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/LocationPreferenceOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/LocationPreferenceOrBuilder.java new file mode 100644 index 000000000000..78876347a11c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/LocationPreferenceOrBuilder.java @@ -0,0 +1,146 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface LocationPreferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.LocationPreference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The App Engine application to follow, it must be in the same region as the
+   * Cloud SQL instance. WARNING: Changing this might restart the instance.
+   * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.LocationPreference.follow_gae_application is deprecated. + * See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=2484 + * @return The followGaeApplication. + */ + @java.lang.Deprecated + java.lang.String getFollowGaeApplication(); + + /** + * + * + *
+   * The App Engine application to follow, it must be in the same region as the
+   * Cloud SQL instance. WARNING: Changing this might restart the instance.
+   * 
+ * + * string follow_gae_application = 1 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.LocationPreference.follow_gae_application is deprecated. + * See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=2484 + * @return The bytes for followGaeApplication. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getFollowGaeApplicationBytes(); + + /** + * + * + *
+   * The preferred Compute Engine zone (for example: us-central1-a,
+   * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+   * 
+ * + * string zone = 2; + * + * @return The zone. + */ + java.lang.String getZone(); + + /** + * + * + *
+   * The preferred Compute Engine zone (for example: us-central1-a,
+   * us-central1-b, etc.). WARNING: Changing this might restart the instance.
+   * 
+ * + * string zone = 2; + * + * @return The bytes for zone. + */ + com.google.protobuf.ByteString getZoneBytes(); + + /** + * + * + *
+   * The preferred Compute Engine zone for the secondary/failover
+   * (for example: us-central1-a, us-central1-b, etc.).
+   * To disable this field, set it to 'no_secondary_zone'.
+   * 
+ * + * string secondary_zone = 4; + * + * @return The secondaryZone. + */ + java.lang.String getSecondaryZone(); + + /** + * + * + *
+   * The preferred Compute Engine zone for the secondary/failover
+   * (for example: us-central1-a, us-central1-b, etc.).
+   * To disable this field, set it to 'no_secondary_zone'.
+   * 
+ * + * string secondary_zone = 4; + * + * @return The bytes for secondaryZone. + */ + com.google.protobuf.ByteString getSecondaryZoneBytes(); + + /** + * + * + *
+   * This is always `sql#locationPreference`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#locationPreference`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MaintenanceWindow.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MaintenanceWindow.java new file mode 100644 index 000000000000..d84b611d5760 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MaintenanceWindow.java @@ -0,0 +1,1347 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Maintenance window. This specifies when a Cloud SQL instance
+ * is restarted for system maintenance purposes.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.MaintenanceWindow} + */ +@com.google.protobuf.Generated +public final class MaintenanceWindow extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.MaintenanceWindow) + MaintenanceWindowOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MaintenanceWindow"); + } + + // Use MaintenanceWindow.newBuilder() to construct. + private MaintenanceWindow(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MaintenanceWindow() { + updateTrack_ = 0; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MaintenanceWindow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MaintenanceWindow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.MaintenanceWindow.class, + com.google.cloud.sql.v1beta4.MaintenanceWindow.Builder.class); + } + + private int bitField0_; + public static final int HOUR_FIELD_NUMBER = 1; + private com.google.protobuf.Int32Value hour_; + + /** + * + * + *
+   * Hour of day - 0 to 23. Specify in the UTC time zone.
+   * 
+ * + * .google.protobuf.Int32Value hour = 1; + * + * @return Whether the hour field is set. + */ + @java.lang.Override + public boolean hasHour() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Hour of day - 0 to 23. Specify in the UTC time zone.
+   * 
+ * + * .google.protobuf.Int32Value hour = 1; + * + * @return The hour. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getHour() { + return hour_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : hour_; + } + + /** + * + * + *
+   * Hour of day - 0 to 23. Specify in the UTC time zone.
+   * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getHourOrBuilder() { + return hour_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : hour_; + } + + public static final int DAY_FIELD_NUMBER = 2; + private com.google.protobuf.Int32Value day_; + + /** + * + * + *
+   * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+   * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+   * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+   * 
+ * + * .google.protobuf.Int32Value day = 2; + * + * @return Whether the day field is set. + */ + @java.lang.Override + public boolean hasDay() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+   * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+   * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+   * 
+ * + * .google.protobuf.Int32Value day = 2; + * + * @return The day. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getDay() { + return day_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : day_; + } + + /** + * + * + *
+   * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+   * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+   * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+   * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getDayOrBuilder() { + return day_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : day_; + } + + public static final int UPDATE_TRACK_FIELD_NUMBER = 3; + private int updateTrack_ = 0; + + /** + * + * + *
+   * Maintenance timing settings: `canary`, `stable`, or `week5`.
+   * For more information, see [About maintenance on Cloud SQL
+   * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlUpdateTrack update_track = 3; + * + * @return The enum numeric value on the wire for updateTrack. + */ + @java.lang.Override + public int getUpdateTrackValue() { + return updateTrack_; + } + + /** + * + * + *
+   * Maintenance timing settings: `canary`, `stable`, or `week5`.
+   * For more information, see [About maintenance on Cloud SQL
+   * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlUpdateTrack update_track = 3; + * + * @return The updateTrack. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUpdateTrack getUpdateTrack() { + com.google.cloud.sql.v1beta4.SqlUpdateTrack result = + com.google.cloud.sql.v1beta4.SqlUpdateTrack.forNumber(updateTrack_); + return result == null ? com.google.cloud.sql.v1beta4.SqlUpdateTrack.UNRECOGNIZED : result; + } + + public static final int KIND_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#maintenanceWindow`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#maintenanceWindow`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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, getHour()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getDay()); + } + if (updateTrack_ + != com.google.cloud.sql.v1beta4.SqlUpdateTrack.SQL_UPDATE_TRACK_UNSPECIFIED.getNumber()) { + output.writeEnum(3, updateTrack_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, kind_); + } + 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, getHour()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDay()); + } + if (updateTrack_ + != com.google.cloud.sql.v1beta4.SqlUpdateTrack.SQL_UPDATE_TRACK_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, updateTrack_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.MaintenanceWindow)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.MaintenanceWindow other = + (com.google.cloud.sql.v1beta4.MaintenanceWindow) obj; + + if (hasHour() != other.hasHour()) return false; + if (hasHour()) { + if (!getHour().equals(other.getHour())) return false; + } + if (hasDay() != other.hasDay()) return false; + if (hasDay()) { + if (!getDay().equals(other.getDay())) return false; + } + if (updateTrack_ != other.updateTrack_) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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 (hasHour()) { + hash = (37 * hash) + HOUR_FIELD_NUMBER; + hash = (53 * hash) + getHour().hashCode(); + } + if (hasDay()) { + hash = (37 * hash) + DAY_FIELD_NUMBER; + hash = (53 * hash) + getDay().hashCode(); + } + hash = (37 * hash) + UPDATE_TRACK_FIELD_NUMBER; + hash = (53 * hash) + updateTrack_; + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.MaintenanceWindow parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.MaintenanceWindow parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MaintenanceWindow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.MaintenanceWindow parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MaintenanceWindow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.MaintenanceWindow parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MaintenanceWindow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.MaintenanceWindow parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MaintenanceWindow parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.MaintenanceWindow parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MaintenanceWindow parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.MaintenanceWindow parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.MaintenanceWindow prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Maintenance window. This specifies when a Cloud SQL instance
+   * is restarted for system maintenance purposes.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.MaintenanceWindow} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.MaintenanceWindow) + com.google.cloud.sql.v1beta4.MaintenanceWindowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MaintenanceWindow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MaintenanceWindow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.MaintenanceWindow.class, + com.google.cloud.sql.v1beta4.MaintenanceWindow.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.MaintenanceWindow.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetHourFieldBuilder(); + internalGetDayFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + hour_ = null; + if (hourBuilder_ != null) { + hourBuilder_.dispose(); + hourBuilder_ = null; + } + day_ = null; + if (dayBuilder_ != null) { + dayBuilder_.dispose(); + dayBuilder_ = null; + } + updateTrack_ = 0; + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MaintenanceWindow_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.MaintenanceWindow getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.MaintenanceWindow.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.MaintenanceWindow build() { + com.google.cloud.sql.v1beta4.MaintenanceWindow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.MaintenanceWindow buildPartial() { + com.google.cloud.sql.v1beta4.MaintenanceWindow result = + new com.google.cloud.sql.v1beta4.MaintenanceWindow(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.MaintenanceWindow result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.hour_ = hourBuilder_ == null ? hour_ : hourBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.day_ = dayBuilder_ == null ? day_ : dayBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateTrack_ = updateTrack_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.kind_ = kind_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.MaintenanceWindow) { + return mergeFrom((com.google.cloud.sql.v1beta4.MaintenanceWindow) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.MaintenanceWindow other) { + if (other == com.google.cloud.sql.v1beta4.MaintenanceWindow.getDefaultInstance()) return this; + if (other.hasHour()) { + mergeHour(other.getHour()); + } + if (other.hasDay()) { + mergeDay(other.getDay()); + } + if (other.updateTrack_ != 0) { + setUpdateTrackValue(other.getUpdateTrackValue()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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: + { + input.readMessage(internalGetHourFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetDayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + updateTrack_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + kind_ = 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 com.google.protobuf.Int32Value hour_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + hourBuilder_; + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + * + * @return Whether the hour field is set. + */ + public boolean hasHour() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + * + * @return The hour. + */ + public com.google.protobuf.Int32Value getHour() { + if (hourBuilder_ == null) { + return hour_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : hour_; + } else { + return hourBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + public Builder setHour(com.google.protobuf.Int32Value value) { + if (hourBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hour_ = value; + } else { + hourBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + public Builder setHour(com.google.protobuf.Int32Value.Builder builderForValue) { + if (hourBuilder_ == null) { + hour_ = builderForValue.build(); + } else { + hourBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + public Builder mergeHour(com.google.protobuf.Int32Value value) { + if (hourBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && hour_ != null + && hour_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getHourBuilder().mergeFrom(value); + } else { + hour_ = value; + } + } else { + hourBuilder_.mergeFrom(value); + } + if (hour_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + public Builder clearHour() { + bitField0_ = (bitField0_ & ~0x00000001); + hour_ = null; + if (hourBuilder_ != null) { + hourBuilder_.dispose(); + hourBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + public com.google.protobuf.Int32Value.Builder getHourBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetHourFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + public com.google.protobuf.Int32ValueOrBuilder getHourOrBuilder() { + if (hourBuilder_ != null) { + return hourBuilder_.getMessageOrBuilder(); + } else { + return hour_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : hour_; + } + } + + /** + * + * + *
+     * Hour of day - 0 to 23. Specify in the UTC time zone.
+     * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetHourFieldBuilder() { + if (hourBuilder_ == null) { + hourBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getHour(), getParentForChildren(), isClean()); + hour_ = null; + } + return hourBuilder_; + } + + private com.google.protobuf.Int32Value day_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + dayBuilder_; + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + * + * @return Whether the day field is set. + */ + public boolean hasDay() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + * + * @return The day. + */ + public com.google.protobuf.Int32Value getDay() { + if (dayBuilder_ == null) { + return day_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : day_; + } else { + return dayBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + public Builder setDay(com.google.protobuf.Int32Value value) { + if (dayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + day_ = value; + } else { + dayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + public Builder setDay(com.google.protobuf.Int32Value.Builder builderForValue) { + if (dayBuilder_ == null) { + day_ = builderForValue.build(); + } else { + dayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + public Builder mergeDay(com.google.protobuf.Int32Value value) { + if (dayBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && day_ != null + && day_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getDayBuilder().mergeFrom(value); + } else { + day_ = value; + } + } else { + dayBuilder_.mergeFrom(value); + } + if (day_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + public Builder clearDay() { + bitField0_ = (bitField0_ & ~0x00000002); + day_ = null; + if (dayBuilder_ != null) { + dayBuilder_.dispose(); + dayBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + public com.google.protobuf.Int32Value.Builder getDayBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetDayFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + public com.google.protobuf.Int32ValueOrBuilder getDayOrBuilder() { + if (dayBuilder_ != null) { + return dayBuilder_.getMessageOrBuilder(); + } else { + return day_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : day_; + } + } + + /** + * + * + *
+     * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+     * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+     * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+     * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetDayFieldBuilder() { + if (dayBuilder_ == null) { + dayBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getDay(), getParentForChildren(), isClean()); + day_ = null; + } + return dayBuilder_; + } + + private int updateTrack_ = 0; + + /** + * + * + *
+     * Maintenance timing settings: `canary`, `stable`, or `week5`.
+     * For more information, see [About maintenance on Cloud SQL
+     * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlUpdateTrack update_track = 3; + * + * @return The enum numeric value on the wire for updateTrack. + */ + @java.lang.Override + public int getUpdateTrackValue() { + return updateTrack_; + } + + /** + * + * + *
+     * Maintenance timing settings: `canary`, `stable`, or `week5`.
+     * For more information, see [About maintenance on Cloud SQL
+     * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlUpdateTrack update_track = 3; + * + * @param value The enum numeric value on the wire for updateTrack to set. + * @return This builder for chaining. + */ + public Builder setUpdateTrackValue(int value) { + updateTrack_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maintenance timing settings: `canary`, `stable`, or `week5`.
+     * For more information, see [About maintenance on Cloud SQL
+     * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlUpdateTrack update_track = 3; + * + * @return The updateTrack. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUpdateTrack getUpdateTrack() { + com.google.cloud.sql.v1beta4.SqlUpdateTrack result = + com.google.cloud.sql.v1beta4.SqlUpdateTrack.forNumber(updateTrack_); + return result == null ? com.google.cloud.sql.v1beta4.SqlUpdateTrack.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Maintenance timing settings: `canary`, `stable`, or `week5`.
+     * For more information, see [About maintenance on Cloud SQL
+     * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlUpdateTrack update_track = 3; + * + * @param value The updateTrack to set. + * @return This builder for chaining. + */ + public Builder setUpdateTrack(com.google.cloud.sql.v1beta4.SqlUpdateTrack value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + updateTrack_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Maintenance timing settings: `canary`, `stable`, or `week5`.
+     * For more information, see [About maintenance on Cloud SQL
+     * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlUpdateTrack update_track = 3; + * + * @return This builder for chaining. + */ + public Builder clearUpdateTrack() { + bitField0_ = (bitField0_ & ~0x00000004); + updateTrack_ = 0; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#maintenanceWindow`.
+     * 
+ * + * string kind = 4; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#maintenanceWindow`.
+     * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#maintenanceWindow`.
+     * 
+ * + * string kind = 4; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#maintenanceWindow`.
+     * 
+ * + * string kind = 4; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#maintenanceWindow`.
+     * 
+ * + * string kind = 4; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.MaintenanceWindow) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.MaintenanceWindow) + private static final com.google.cloud.sql.v1beta4.MaintenanceWindow DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.MaintenanceWindow(); + } + + public static com.google.cloud.sql.v1beta4.MaintenanceWindow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MaintenanceWindow parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.MaintenanceWindow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MaintenanceWindowOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MaintenanceWindowOrBuilder.java new file mode 100644 index 000000000000..7864782191eb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MaintenanceWindowOrBuilder.java @@ -0,0 +1,164 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface MaintenanceWindowOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.MaintenanceWindow) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Hour of day - 0 to 23. Specify in the UTC time zone.
+   * 
+ * + * .google.protobuf.Int32Value hour = 1; + * + * @return Whether the hour field is set. + */ + boolean hasHour(); + + /** + * + * + *
+   * Hour of day - 0 to 23. Specify in the UTC time zone.
+   * 
+ * + * .google.protobuf.Int32Value hour = 1; + * + * @return The hour. + */ + com.google.protobuf.Int32Value getHour(); + + /** + * + * + *
+   * Hour of day - 0 to 23. Specify in the UTC time zone.
+   * 
+ * + * .google.protobuf.Int32Value hour = 1; + */ + com.google.protobuf.Int32ValueOrBuilder getHourOrBuilder(); + + /** + * + * + *
+   * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+   * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+   * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+   * 
+ * + * .google.protobuf.Int32Value day = 2; + * + * @return Whether the day field is set. + */ + boolean hasDay(); + + /** + * + * + *
+   * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+   * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+   * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+   * 
+ * + * .google.protobuf.Int32Value day = 2; + * + * @return The day. + */ + com.google.protobuf.Int32Value getDay(); + + /** + * + * + *
+   * Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
+   * `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
+   * Returned in output as an integer, 1 to 7, where `1` equals Monday.
+   * 
+ * + * .google.protobuf.Int32Value day = 2; + */ + com.google.protobuf.Int32ValueOrBuilder getDayOrBuilder(); + + /** + * + * + *
+   * Maintenance timing settings: `canary`, `stable`, or `week5`.
+   * For more information, see [About maintenance on Cloud SQL
+   * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlUpdateTrack update_track = 3; + * + * @return The enum numeric value on the wire for updateTrack. + */ + int getUpdateTrackValue(); + + /** + * + * + *
+   * Maintenance timing settings: `canary`, `stable`, or `week5`.
+   * For more information, see [About maintenance on Cloud SQL
+   * instances](https://cloud.google.com/sql/docs/mysql/maintenance).
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlUpdateTrack update_track = 3; + * + * @return The updateTrack. + */ + com.google.cloud.sql.v1beta4.SqlUpdateTrack getUpdateTrack(); + + /** + * + * + *
+   * This is always `sql#maintenanceWindow`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#maintenanceWindow`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Metadata.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Metadata.java new file mode 100644 index 000000000000..287511c966e3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Metadata.java @@ -0,0 +1,705 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The additional metadata information regarding the execution of the SQL
+ * statements.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Metadata} + */ +@com.google.protobuf.Generated +public final class Metadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.Metadata) + MetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Metadata"); + } + + // Use Metadata.newBuilder() to construct. + private Metadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Metadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Metadata.class, + com.google.cloud.sql.v1beta4.Metadata.Builder.class); + } + + private int bitField0_; + public static final int SQL_STATEMENT_EXECUTION_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Duration sqlStatementExecutionTime_; + + /** + * + * + *
+   * The time taken to execute the SQL statements.
+   * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + * + * @return Whether the sqlStatementExecutionTime field is set. + */ + @java.lang.Override + public boolean hasSqlStatementExecutionTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time taken to execute the SQL statements.
+   * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + * + * @return The sqlStatementExecutionTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getSqlStatementExecutionTime() { + return sqlStatementExecutionTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : sqlStatementExecutionTime_; + } + + /** + * + * + *
+   * The time taken to execute the SQL statements.
+   * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getSqlStatementExecutionTimeOrBuilder() { + return sqlStatementExecutionTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : sqlStatementExecutionTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getSqlStatementExecutionTime()); + } + 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, getSqlStatementExecutionTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.Metadata)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.Metadata other = (com.google.cloud.sql.v1beta4.Metadata) obj; + + if (hasSqlStatementExecutionTime() != other.hasSqlStatementExecutionTime()) return false; + if (hasSqlStatementExecutionTime()) { + if (!getSqlStatementExecutionTime().equals(other.getSqlStatementExecutionTime())) + return false; + } + if (!getUnknownFields().equals(other.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 (hasSqlStatementExecutionTime()) { + hash = (37 * hash) + SQL_STATEMENT_EXECUTION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSqlStatementExecutionTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.Metadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Metadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Metadata parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Metadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Metadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Metadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Metadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Metadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Metadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Metadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Metadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Metadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.Metadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The additional metadata information regarding the execution of the SQL
+   * statements.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Metadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.Metadata) + com.google.cloud.sql.v1beta4.MetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Metadata.class, + com.google.cloud.sql.v1beta4.Metadata.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.Metadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSqlStatementExecutionTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sqlStatementExecutionTime_ = null; + if (sqlStatementExecutionTimeBuilder_ != null) { + sqlStatementExecutionTimeBuilder_.dispose(); + sqlStatementExecutionTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Metadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Metadata getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.Metadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Metadata build() { + com.google.cloud.sql.v1beta4.Metadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Metadata buildPartial() { + com.google.cloud.sql.v1beta4.Metadata result = + new com.google.cloud.sql.v1beta4.Metadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.Metadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sqlStatementExecutionTime_ = + sqlStatementExecutionTimeBuilder_ == null + ? sqlStatementExecutionTime_ + : sqlStatementExecutionTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.Metadata) { + return mergeFrom((com.google.cloud.sql.v1beta4.Metadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.Metadata other) { + if (other == com.google.cloud.sql.v1beta4.Metadata.getDefaultInstance()) return this; + if (other.hasSqlStatementExecutionTime()) { + mergeSqlStatementExecutionTime(other.getSqlStatementExecutionTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetSqlStatementExecutionTimeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration sqlStatementExecutionTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + sqlStatementExecutionTimeBuilder_; + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + * + * @return Whether the sqlStatementExecutionTime field is set. + */ + public boolean hasSqlStatementExecutionTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + * + * @return The sqlStatementExecutionTime. + */ + public com.google.protobuf.Duration getSqlStatementExecutionTime() { + if (sqlStatementExecutionTimeBuilder_ == null) { + return sqlStatementExecutionTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : sqlStatementExecutionTime_; + } else { + return sqlStatementExecutionTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + public Builder setSqlStatementExecutionTime(com.google.protobuf.Duration value) { + if (sqlStatementExecutionTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sqlStatementExecutionTime_ = value; + } else { + sqlStatementExecutionTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + public Builder setSqlStatementExecutionTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (sqlStatementExecutionTimeBuilder_ == null) { + sqlStatementExecutionTime_ = builderForValue.build(); + } else { + sqlStatementExecutionTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + public Builder mergeSqlStatementExecutionTime(com.google.protobuf.Duration value) { + if (sqlStatementExecutionTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && sqlStatementExecutionTime_ != null + && sqlStatementExecutionTime_ != com.google.protobuf.Duration.getDefaultInstance()) { + getSqlStatementExecutionTimeBuilder().mergeFrom(value); + } else { + sqlStatementExecutionTime_ = value; + } + } else { + sqlStatementExecutionTimeBuilder_.mergeFrom(value); + } + if (sqlStatementExecutionTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + public Builder clearSqlStatementExecutionTime() { + bitField0_ = (bitField0_ & ~0x00000001); + sqlStatementExecutionTime_ = null; + if (sqlStatementExecutionTimeBuilder_ != null) { + sqlStatementExecutionTimeBuilder_.dispose(); + sqlStatementExecutionTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + public com.google.protobuf.Duration.Builder getSqlStatementExecutionTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetSqlStatementExecutionTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + public com.google.protobuf.DurationOrBuilder getSqlStatementExecutionTimeOrBuilder() { + if (sqlStatementExecutionTimeBuilder_ != null) { + return sqlStatementExecutionTimeBuilder_.getMessageOrBuilder(); + } else { + return sqlStatementExecutionTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : sqlStatementExecutionTime_; + } + } + + /** + * + * + *
+     * The time taken to execute the SQL statements.
+     * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetSqlStatementExecutionTimeFieldBuilder() { + if (sqlStatementExecutionTimeBuilder_ == null) { + sqlStatementExecutionTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getSqlStatementExecutionTime(), getParentForChildren(), isClean()); + sqlStatementExecutionTime_ = null; + } + return sqlStatementExecutionTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.Metadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.Metadata) + private static final com.google.cloud.sql.v1beta4.Metadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.Metadata(); + } + + public static com.google.cloud.sql.v1beta4.Metadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Metadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MetadataOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MetadataOrBuilder.java new file mode 100644 index 000000000000..dd9656a445c3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MetadataOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface MetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.Metadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time taken to execute the SQL statements.
+   * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + * + * @return Whether the sqlStatementExecutionTime field is set. + */ + boolean hasSqlStatementExecutionTime(); + + /** + * + * + *
+   * The time taken to execute the SQL statements.
+   * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + * + * @return The sqlStatementExecutionTime. + */ + com.google.protobuf.Duration getSqlStatementExecutionTime(); + + /** + * + * + *
+   * The time taken to execute the SQL statements.
+   * 
+ * + * .google.protobuf.Duration sql_statement_execution_time = 1; + */ + com.google.protobuf.DurationOrBuilder getSqlStatementExecutionTimeOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MySqlReplicaConfiguration.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MySqlReplicaConfiguration.java new file mode 100644 index 000000000000..959b282d2804 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MySqlReplicaConfiguration.java @@ -0,0 +1,2844 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Read-replica configuration specific to MySQL databases.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.MySqlReplicaConfiguration} + */ +@com.google.protobuf.Generated +public final class MySqlReplicaConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.MySqlReplicaConfiguration) + MySqlReplicaConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MySqlReplicaConfiguration"); + } + + // Use MySqlReplicaConfiguration.newBuilder() to construct. + private MySqlReplicaConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MySqlReplicaConfiguration() { + dumpFilePath_ = ""; + username_ = ""; + password_ = ""; + caCertificate_ = ""; + clientCertificate_ = ""; + clientKey_ = ""; + sslCipher_ = ""; + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MySqlReplicaConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MySqlReplicaConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.class, + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.Builder.class); + } + + private int bitField0_; + public static final int DUMP_FILE_PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object dumpFilePath_ = ""; + + /** + * + * + *
+   * Path to a SQL dump file in Google Cloud Storage from which the replica
+   * instance is to be created. The URI is in the form gs://bucketName/fileName.
+   * Compressed gzip files (.gz) are also supported.
+   * Dumps have the binlog co-ordinates from which replication
+   * begins. This can be accomplished by setting --master-data to 1 when using
+   * mysqldump.
+   * 
+ * + * string dump_file_path = 1; + * + * @return The dumpFilePath. + */ + @java.lang.Override + public java.lang.String getDumpFilePath() { + java.lang.Object ref = dumpFilePath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dumpFilePath_ = s; + return s; + } + } + + /** + * + * + *
+   * Path to a SQL dump file in Google Cloud Storage from which the replica
+   * instance is to be created. The URI is in the form gs://bucketName/fileName.
+   * Compressed gzip files (.gz) are also supported.
+   * Dumps have the binlog co-ordinates from which replication
+   * begins. This can be accomplished by setting --master-data to 1 when using
+   * mysqldump.
+   * 
+ * + * string dump_file_path = 1; + * + * @return The bytes for dumpFilePath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDumpFilePathBytes() { + java.lang.Object ref = dumpFilePath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dumpFilePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERNAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object username_ = ""; + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } + } + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONNECT_RETRY_INTERVAL_FIELD_NUMBER = 4; + private com.google.protobuf.Int32Value connectRetryInterval_; + + /** + * + * + *
+   * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+   * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + * + * @return Whether the connectRetryInterval field is set. + */ + @java.lang.Override + public boolean hasConnectRetryInterval() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+   * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + * + * @return The connectRetryInterval. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getConnectRetryInterval() { + return connectRetryInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : connectRetryInterval_; + } + + /** + * + * + *
+   * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+   * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getConnectRetryIntervalOrBuilder() { + return connectRetryInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : connectRetryInterval_; + } + + public static final int MASTER_HEARTBEAT_PERIOD_FIELD_NUMBER = 5; + private com.google.protobuf.Int64Value masterHeartbeatPeriod_; + + /** + * + * + *
+   * Interval in milliseconds between replication heartbeats.
+   * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + * + * @return Whether the masterHeartbeatPeriod field is set. + */ + @java.lang.Override + public boolean hasMasterHeartbeatPeriod() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Interval in milliseconds between replication heartbeats.
+   * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + * + * @return The masterHeartbeatPeriod. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getMasterHeartbeatPeriod() { + return masterHeartbeatPeriod_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : masterHeartbeatPeriod_; + } + + /** + * + * + *
+   * Interval in milliseconds between replication heartbeats.
+   * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getMasterHeartbeatPeriodOrBuilder() { + return masterHeartbeatPeriod_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : masterHeartbeatPeriod_; + } + + public static final int CA_CERTIFICATE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object caCertificate_ = ""; + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The caCertificate. + */ + @java.lang.Override + public java.lang.String getCaCertificate() { + java.lang.Object ref = caCertificate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCertificate_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The bytes for caCertificate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCaCertificateBytes() { + java.lang.Object ref = caCertificate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_CERTIFICATE_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object clientCertificate_ = ""; + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 7; + * + * @return The clientCertificate. + */ + @java.lang.Override + public java.lang.String getClientCertificate() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientCertificate_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 7; + * + * @return The bytes for clientCertificate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientCertificateBytes() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_KEY_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object clientKey_ = ""; + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 8; + * + * @return The clientKey. + */ + @java.lang.Override + public java.lang.String getClientKey() { + java.lang.Object ref = clientKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientKey_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 8; + * + * @return The bytes for clientKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientKeyBytes() { + java.lang.Object ref = clientKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SSL_CIPHER_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object sslCipher_ = ""; + + /** + * + * + *
+   * A list of permissible ciphers to use for SSL encryption.
+   * 
+ * + * string ssl_cipher = 9; + * + * @return The sslCipher. + */ + @java.lang.Override + public java.lang.String getSslCipher() { + java.lang.Object ref = sslCipher_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sslCipher_ = s; + return s; + } + } + + /** + * + * + *
+   * A list of permissible ciphers to use for SSL encryption.
+   * 
+ * + * string ssl_cipher = 9; + * + * @return The bytes for sslCipher. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSslCipherBytes() { + java.lang.Object ref = sslCipher_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sslCipher_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERIFY_SERVER_CERTIFICATE_FIELD_NUMBER = 10; + private com.google.protobuf.BoolValue verifyServerCertificate_; + + /** + * + * + *
+   * Whether or not to check the primary instance's Common Name value in the
+   * certificate that it sends during the SSL handshake.
+   * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + * + * @return Whether the verifyServerCertificate field is set. + */ + @java.lang.Override + public boolean hasVerifyServerCertificate() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Whether or not to check the primary instance's Common Name value in the
+   * certificate that it sends during the SSL handshake.
+   * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + * + * @return The verifyServerCertificate. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getVerifyServerCertificate() { + return verifyServerCertificate_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyServerCertificate_; + } + + /** + * + * + *
+   * Whether or not to check the primary instance's Common Name value in the
+   * certificate that it sends during the SSL handshake.
+   * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getVerifyServerCertificateOrBuilder() { + return verifyServerCertificate_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyServerCertificate_; + } + + public static final int KIND_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#mysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 11; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#mysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 11; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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.GeneratedMessage.isStringEmpty(dumpFilePath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, dumpFilePath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(username_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, username_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, password_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getConnectRetryInterval()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getMasterHeartbeatPeriod()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(caCertificate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, caCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientCertificate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, clientCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, clientKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sslCipher_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, sslCipher_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(10, getVerifyServerCertificate()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dumpFilePath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, dumpFilePath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(username_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, username_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, password_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, getConnectRetryInterval()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getMasterHeartbeatPeriod()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(caCertificate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, caCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientCertificate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, clientCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, clientKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sslCipher_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, sslCipher_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, getVerifyServerCertificate()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration other = + (com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration) obj; + + if (!getDumpFilePath().equals(other.getDumpFilePath())) return false; + if (!getUsername().equals(other.getUsername())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (hasConnectRetryInterval() != other.hasConnectRetryInterval()) return false; + if (hasConnectRetryInterval()) { + if (!getConnectRetryInterval().equals(other.getConnectRetryInterval())) return false; + } + if (hasMasterHeartbeatPeriod() != other.hasMasterHeartbeatPeriod()) return false; + if (hasMasterHeartbeatPeriod()) { + if (!getMasterHeartbeatPeriod().equals(other.getMasterHeartbeatPeriod())) return false; + } + if (!getCaCertificate().equals(other.getCaCertificate())) return false; + if (!getClientCertificate().equals(other.getClientCertificate())) return false; + if (!getClientKey().equals(other.getClientKey())) return false; + if (!getSslCipher().equals(other.getSslCipher())) return false; + if (hasVerifyServerCertificate() != other.hasVerifyServerCertificate()) return false; + if (hasVerifyServerCertificate()) { + if (!getVerifyServerCertificate().equals(other.getVerifyServerCertificate())) return false; + } + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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) + DUMP_FILE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getDumpFilePath().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + if (hasConnectRetryInterval()) { + hash = (37 * hash) + CONNECT_RETRY_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getConnectRetryInterval().hashCode(); + } + if (hasMasterHeartbeatPeriod()) { + hash = (37 * hash) + MASTER_HEARTBEAT_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getMasterHeartbeatPeriod().hashCode(); + } + hash = (37 * hash) + CA_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getCaCertificate().hashCode(); + hash = (37 * hash) + CLIENT_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getClientCertificate().hashCode(); + hash = (37 * hash) + CLIENT_KEY_FIELD_NUMBER; + hash = (53 * hash) + getClientKey().hashCode(); + hash = (37 * hash) + SSL_CIPHER_FIELD_NUMBER; + hash = (53 * hash) + getSslCipher().hashCode(); + if (hasVerifyServerCertificate()) { + hash = (37 * hash) + VERIFY_SERVER_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getVerifyServerCertificate().hashCode(); + } + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Read-replica configuration specific to MySQL databases.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.MySqlReplicaConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.MySqlReplicaConfiguration) + com.google.cloud.sql.v1beta4.MySqlReplicaConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MySqlReplicaConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MySqlReplicaConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.class, + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetConnectRetryIntervalFieldBuilder(); + internalGetMasterHeartbeatPeriodFieldBuilder(); + internalGetVerifyServerCertificateFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dumpFilePath_ = ""; + username_ = ""; + password_ = ""; + connectRetryInterval_ = null; + if (connectRetryIntervalBuilder_ != null) { + connectRetryIntervalBuilder_.dispose(); + connectRetryIntervalBuilder_ = null; + } + masterHeartbeatPeriod_ = null; + if (masterHeartbeatPeriodBuilder_ != null) { + masterHeartbeatPeriodBuilder_.dispose(); + masterHeartbeatPeriodBuilder_ = null; + } + caCertificate_ = ""; + clientCertificate_ = ""; + clientKey_ = ""; + sslCipher_ = ""; + verifyServerCertificate_ = null; + if (verifyServerCertificateBuilder_ != null) { + verifyServerCertificateBuilder_.dispose(); + verifyServerCertificateBuilder_ = null; + } + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MySqlReplicaConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration build() { + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration buildPartial() { + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration result = + new com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dumpFilePath_ = dumpFilePath_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.username_ = username_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.password_ = password_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.connectRetryInterval_ = + connectRetryIntervalBuilder_ == null + ? connectRetryInterval_ + : connectRetryIntervalBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.masterHeartbeatPeriod_ = + masterHeartbeatPeriodBuilder_ == null + ? masterHeartbeatPeriod_ + : masterHeartbeatPeriodBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.caCertificate_ = caCertificate_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.clientCertificate_ = clientCertificate_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.clientKey_ = clientKey_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.sslCipher_ = sslCipher_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.verifyServerCertificate_ = + verifyServerCertificateBuilder_ == null + ? verifyServerCertificate_ + : verifyServerCertificateBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.kind_ = kind_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration) { + return mergeFrom((com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration other) { + if (other == com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.getDefaultInstance()) + return this; + if (!other.getDumpFilePath().isEmpty()) { + dumpFilePath_ = other.dumpFilePath_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasConnectRetryInterval()) { + mergeConnectRetryInterval(other.getConnectRetryInterval()); + } + if (other.hasMasterHeartbeatPeriod()) { + mergeMasterHeartbeatPeriod(other.getMasterHeartbeatPeriod()); + } + if (!other.getCaCertificate().isEmpty()) { + caCertificate_ = other.caCertificate_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getClientCertificate().isEmpty()) { + clientCertificate_ = other.clientCertificate_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getClientKey().isEmpty()) { + clientKey_ = other.clientKey_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (!other.getSslCipher().isEmpty()) { + sslCipher_ = other.sslCipher_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.hasVerifyServerCertificate()) { + mergeVerifyServerCertificate(other.getVerifyServerCertificate()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000400; + 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: + { + dumpFilePath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + username_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetConnectRetryIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetMasterHeartbeatPeriodFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + caCertificate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + clientCertificate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + clientKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + sslCipher_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + input.readMessage( + internalGetVerifyServerCertificateFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 dumpFilePath_ = ""; + + /** + * + * + *
+     * Path to a SQL dump file in Google Cloud Storage from which the replica
+     * instance is to be created. The URI is in the form gs://bucketName/fileName.
+     * Compressed gzip files (.gz) are also supported.
+     * Dumps have the binlog co-ordinates from which replication
+     * begins. This can be accomplished by setting --master-data to 1 when using
+     * mysqldump.
+     * 
+ * + * string dump_file_path = 1; + * + * @return The dumpFilePath. + */ + public java.lang.String getDumpFilePath() { + java.lang.Object ref = dumpFilePath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dumpFilePath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Path to a SQL dump file in Google Cloud Storage from which the replica
+     * instance is to be created. The URI is in the form gs://bucketName/fileName.
+     * Compressed gzip files (.gz) are also supported.
+     * Dumps have the binlog co-ordinates from which replication
+     * begins. This can be accomplished by setting --master-data to 1 when using
+     * mysqldump.
+     * 
+ * + * string dump_file_path = 1; + * + * @return The bytes for dumpFilePath. + */ + public com.google.protobuf.ByteString getDumpFilePathBytes() { + java.lang.Object ref = dumpFilePath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dumpFilePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Path to a SQL dump file in Google Cloud Storage from which the replica
+     * instance is to be created. The URI is in the form gs://bucketName/fileName.
+     * Compressed gzip files (.gz) are also supported.
+     * Dumps have the binlog co-ordinates from which replication
+     * begins. This can be accomplished by setting --master-data to 1 when using
+     * mysqldump.
+     * 
+ * + * string dump_file_path = 1; + * + * @param value The dumpFilePath to set. + * @return This builder for chaining. + */ + public Builder setDumpFilePath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dumpFilePath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Path to a SQL dump file in Google Cloud Storage from which the replica
+     * instance is to be created. The URI is in the form gs://bucketName/fileName.
+     * Compressed gzip files (.gz) are also supported.
+     * Dumps have the binlog co-ordinates from which replication
+     * begins. This can be accomplished by setting --master-data to 1 when using
+     * mysqldump.
+     * 
+ * + * string dump_file_path = 1; + * + * @return This builder for chaining. + */ + public Builder clearDumpFilePath() { + dumpFilePath_ = getDefaultInstance().getDumpFilePath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Path to a SQL dump file in Google Cloud Storage from which the replica
+     * instance is to be created. The URI is in the form gs://bucketName/fileName.
+     * Compressed gzip files (.gz) are also supported.
+     * Dumps have the binlog co-ordinates from which replication
+     * begins. This can be accomplished by setting --master-data to 1 when using
+     * mysqldump.
+     * 
+ * + * string dump_file_path = 1; + * + * @param value The bytes for dumpFilePath to set. + * @return This builder for chaining. + */ + public Builder setDumpFilePathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dumpFilePath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object username_ = ""; + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + username_ = getDefaultInstance().getUsername(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The username for the replication connection.
+     * 
+ * + * string username = 2; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for the replication connection.
+     * 
+ * + * string password = 3; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Int32Value connectRetryInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + connectRetryIntervalBuilder_; + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + * + * @return Whether the connectRetryInterval field is set. + */ + public boolean hasConnectRetryInterval() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + * + * @return The connectRetryInterval. + */ + public com.google.protobuf.Int32Value getConnectRetryInterval() { + if (connectRetryIntervalBuilder_ == null) { + return connectRetryInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : connectRetryInterval_; + } else { + return connectRetryIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + public Builder setConnectRetryInterval(com.google.protobuf.Int32Value value) { + if (connectRetryIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connectRetryInterval_ = value; + } else { + connectRetryIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + public Builder setConnectRetryInterval(com.google.protobuf.Int32Value.Builder builderForValue) { + if (connectRetryIntervalBuilder_ == null) { + connectRetryInterval_ = builderForValue.build(); + } else { + connectRetryIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + public Builder mergeConnectRetryInterval(com.google.protobuf.Int32Value value) { + if (connectRetryIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && connectRetryInterval_ != null + && connectRetryInterval_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getConnectRetryIntervalBuilder().mergeFrom(value); + } else { + connectRetryInterval_ = value; + } + } else { + connectRetryIntervalBuilder_.mergeFrom(value); + } + if (connectRetryInterval_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + public Builder clearConnectRetryInterval() { + bitField0_ = (bitField0_ & ~0x00000008); + connectRetryInterval_ = null; + if (connectRetryIntervalBuilder_ != null) { + connectRetryIntervalBuilder_.dispose(); + connectRetryIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + public com.google.protobuf.Int32Value.Builder getConnectRetryIntervalBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetConnectRetryIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + public com.google.protobuf.Int32ValueOrBuilder getConnectRetryIntervalOrBuilder() { + if (connectRetryIntervalBuilder_ != null) { + return connectRetryIntervalBuilder_.getMessageOrBuilder(); + } else { + return connectRetryInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : connectRetryInterval_; + } + } + + /** + * + * + *
+     * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+     * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetConnectRetryIntervalFieldBuilder() { + if (connectRetryIntervalBuilder_ == null) { + connectRetryIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getConnectRetryInterval(), getParentForChildren(), isClean()); + connectRetryInterval_ = null; + } + return connectRetryIntervalBuilder_; + } + + private com.google.protobuf.Int64Value masterHeartbeatPeriod_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + masterHeartbeatPeriodBuilder_; + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + * + * @return Whether the masterHeartbeatPeriod field is set. + */ + public boolean hasMasterHeartbeatPeriod() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + * + * @return The masterHeartbeatPeriod. + */ + public com.google.protobuf.Int64Value getMasterHeartbeatPeriod() { + if (masterHeartbeatPeriodBuilder_ == null) { + return masterHeartbeatPeriod_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : masterHeartbeatPeriod_; + } else { + return masterHeartbeatPeriodBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + public Builder setMasterHeartbeatPeriod(com.google.protobuf.Int64Value value) { + if (masterHeartbeatPeriodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + masterHeartbeatPeriod_ = value; + } else { + masterHeartbeatPeriodBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + public Builder setMasterHeartbeatPeriod( + com.google.protobuf.Int64Value.Builder builderForValue) { + if (masterHeartbeatPeriodBuilder_ == null) { + masterHeartbeatPeriod_ = builderForValue.build(); + } else { + masterHeartbeatPeriodBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + public Builder mergeMasterHeartbeatPeriod(com.google.protobuf.Int64Value value) { + if (masterHeartbeatPeriodBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && masterHeartbeatPeriod_ != null + && masterHeartbeatPeriod_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getMasterHeartbeatPeriodBuilder().mergeFrom(value); + } else { + masterHeartbeatPeriod_ = value; + } + } else { + masterHeartbeatPeriodBuilder_.mergeFrom(value); + } + if (masterHeartbeatPeriod_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + public Builder clearMasterHeartbeatPeriod() { + bitField0_ = (bitField0_ & ~0x00000010); + masterHeartbeatPeriod_ = null; + if (masterHeartbeatPeriodBuilder_ != null) { + masterHeartbeatPeriodBuilder_.dispose(); + masterHeartbeatPeriodBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + public com.google.protobuf.Int64Value.Builder getMasterHeartbeatPeriodBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetMasterHeartbeatPeriodFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + public com.google.protobuf.Int64ValueOrBuilder getMasterHeartbeatPeriodOrBuilder() { + if (masterHeartbeatPeriodBuilder_ != null) { + return masterHeartbeatPeriodBuilder_.getMessageOrBuilder(); + } else { + return masterHeartbeatPeriod_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : masterHeartbeatPeriod_; + } + } + + /** + * + * + *
+     * Interval in milliseconds between replication heartbeats.
+     * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetMasterHeartbeatPeriodFieldBuilder() { + if (masterHeartbeatPeriodBuilder_ == null) { + masterHeartbeatPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getMasterHeartbeatPeriod(), getParentForChildren(), isClean()); + masterHeartbeatPeriod_ = null; + } + return masterHeartbeatPeriodBuilder_; + } + + private java.lang.Object caCertificate_ = ""; + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @return The caCertificate. + */ + public java.lang.String getCaCertificate() { + java.lang.Object ref = caCertificate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCertificate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @return The bytes for caCertificate. + */ + public com.google.protobuf.ByteString getCaCertificateBytes() { + java.lang.Object ref = caCertificate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @param value The caCertificate to set. + * @return This builder for chaining. + */ + public Builder setCaCertificate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + caCertificate_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @return This builder for chaining. + */ + public Builder clearCaCertificate() { + caCertificate_ = getDefaultInstance().getCaCertificate(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 6; + * + * @param value The bytes for caCertificate to set. + * @return This builder for chaining. + */ + public Builder setCaCertificateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + caCertificate_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object clientCertificate_ = ""; + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 7; + * + * @return The clientCertificate. + */ + public java.lang.String getClientCertificate() { + java.lang.Object ref = clientCertificate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientCertificate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 7; + * + * @return The bytes for clientCertificate. + */ + public com.google.protobuf.ByteString getClientCertificateBytes() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 7; + * + * @param value The clientCertificate to set. + * @return This builder for chaining. + */ + public Builder setClientCertificate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clientCertificate_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 7; + * + * @return This builder for chaining. + */ + public Builder clearClientCertificate() { + clientCertificate_ = getDefaultInstance().getClientCertificate(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 7; + * + * @param value The bytes for clientCertificate to set. + * @return This builder for chaining. + */ + public Builder setClientCertificateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clientCertificate_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object clientKey_ = ""; + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 8; + * + * @return The clientKey. + */ + public java.lang.String getClientKey() { + java.lang.Object ref = clientKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 8; + * + * @return The bytes for clientKey. + */ + public com.google.protobuf.ByteString getClientKeyBytes() { + java.lang.Object ref = clientKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 8; + * + * @param value The clientKey to set. + * @return This builder for chaining. + */ + public Builder setClientKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clientKey_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 8; + * + * @return This builder for chaining. + */ + public Builder clearClientKey() { + clientKey_ = getDefaultInstance().getClientKey(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 8; + * + * @param value The bytes for clientKey to set. + * @return This builder for chaining. + */ + public Builder setClientKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clientKey_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object sslCipher_ = ""; + + /** + * + * + *
+     * A list of permissible ciphers to use for SSL encryption.
+     * 
+ * + * string ssl_cipher = 9; + * + * @return The sslCipher. + */ + public java.lang.String getSslCipher() { + java.lang.Object ref = sslCipher_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sslCipher_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A list of permissible ciphers to use for SSL encryption.
+     * 
+ * + * string ssl_cipher = 9; + * + * @return The bytes for sslCipher. + */ + public com.google.protobuf.ByteString getSslCipherBytes() { + java.lang.Object ref = sslCipher_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sslCipher_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A list of permissible ciphers to use for SSL encryption.
+     * 
+ * + * string ssl_cipher = 9; + * + * @param value The sslCipher to set. + * @return This builder for chaining. + */ + public Builder setSslCipher(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sslCipher_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * A list of permissible ciphers to use for SSL encryption.
+     * 
+ * + * string ssl_cipher = 9; + * + * @return This builder for chaining. + */ + public Builder clearSslCipher() { + sslCipher_ = getDefaultInstance().getSslCipher(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
+     * A list of permissible ciphers to use for SSL encryption.
+     * 
+ * + * string ssl_cipher = 9; + * + * @param value The bytes for sslCipher to set. + * @return This builder for chaining. + */ + public Builder setSslCipherBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sslCipher_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue verifyServerCertificate_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + verifyServerCertificateBuilder_; + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + * + * @return Whether the verifyServerCertificate field is set. + */ + public boolean hasVerifyServerCertificate() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + * + * @return The verifyServerCertificate. + */ + public com.google.protobuf.BoolValue getVerifyServerCertificate() { + if (verifyServerCertificateBuilder_ == null) { + return verifyServerCertificate_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyServerCertificate_; + } else { + return verifyServerCertificateBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + public Builder setVerifyServerCertificate(com.google.protobuf.BoolValue value) { + if (verifyServerCertificateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + verifyServerCertificate_ = value; + } else { + verifyServerCertificateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + public Builder setVerifyServerCertificate( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (verifyServerCertificateBuilder_ == null) { + verifyServerCertificate_ = builderForValue.build(); + } else { + verifyServerCertificateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + public Builder mergeVerifyServerCertificate(com.google.protobuf.BoolValue value) { + if (verifyServerCertificateBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && verifyServerCertificate_ != null + && verifyServerCertificate_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getVerifyServerCertificateBuilder().mergeFrom(value); + } else { + verifyServerCertificate_ = value; + } + } else { + verifyServerCertificateBuilder_.mergeFrom(value); + } + if (verifyServerCertificate_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + public Builder clearVerifyServerCertificate() { + bitField0_ = (bitField0_ & ~0x00000200); + verifyServerCertificate_ = null; + if (verifyServerCertificateBuilder_ != null) { + verifyServerCertificateBuilder_.dispose(); + verifyServerCertificateBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + public com.google.protobuf.BoolValue.Builder getVerifyServerCertificateBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetVerifyServerCertificateFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + public com.google.protobuf.BoolValueOrBuilder getVerifyServerCertificateOrBuilder() { + if (verifyServerCertificateBuilder_ != null) { + return verifyServerCertificateBuilder_.getMessageOrBuilder(); + } else { + return verifyServerCertificate_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : verifyServerCertificate_; + } + } + + /** + * + * + *
+     * Whether or not to check the primary instance's Common Name value in the
+     * certificate that it sends during the SSL handshake.
+     * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetVerifyServerCertificateFieldBuilder() { + if (verifyServerCertificateBuilder_ == null) { + verifyServerCertificateBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getVerifyServerCertificate(), getParentForChildren(), isClean()); + verifyServerCertificate_ = null; + } + return verifyServerCertificateBuilder_; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#mysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 11; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#mysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 11; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#mysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 11; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#mysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 11; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#mysqlReplicaConfiguration`.
+     * 
+ * + * string kind = 11; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.MySqlReplicaConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.MySqlReplicaConfiguration) + private static final com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration(); + } + + public static com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MySqlReplicaConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MySqlReplicaConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MySqlReplicaConfigurationOrBuilder.java new file mode 100644 index 000000000000..bacaa5241107 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MySqlReplicaConfigurationOrBuilder.java @@ -0,0 +1,362 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface MySqlReplicaConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.MySqlReplicaConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Path to a SQL dump file in Google Cloud Storage from which the replica
+   * instance is to be created. The URI is in the form gs://bucketName/fileName.
+   * Compressed gzip files (.gz) are also supported.
+   * Dumps have the binlog co-ordinates from which replication
+   * begins. This can be accomplished by setting --master-data to 1 when using
+   * mysqldump.
+   * 
+ * + * string dump_file_path = 1; + * + * @return The dumpFilePath. + */ + java.lang.String getDumpFilePath(); + + /** + * + * + *
+   * Path to a SQL dump file in Google Cloud Storage from which the replica
+   * instance is to be created. The URI is in the form gs://bucketName/fileName.
+   * Compressed gzip files (.gz) are also supported.
+   * Dumps have the binlog co-ordinates from which replication
+   * begins. This can be accomplished by setting --master-data to 1 when using
+   * mysqldump.
+   * 
+ * + * string dump_file_path = 1; + * + * @return The bytes for dumpFilePath. + */ + com.google.protobuf.ByteString getDumpFilePathBytes(); + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The username. + */ + java.lang.String getUsername(); + + /** + * + * + *
+   * The username for the replication connection.
+   * 
+ * + * string username = 2; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The password. + */ + java.lang.String getPassword(); + + /** + * + * + *
+   * The password for the replication connection.
+   * 
+ * + * string password = 3; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * + * + *
+   * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+   * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + * + * @return Whether the connectRetryInterval field is set. + */ + boolean hasConnectRetryInterval(); + + /** + * + * + *
+   * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+   * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + * + * @return The connectRetryInterval. + */ + com.google.protobuf.Int32Value getConnectRetryInterval(); + + /** + * + * + *
+   * Seconds to wait between connect retries. MySQL's default is 60 seconds.
+   * 
+ * + * .google.protobuf.Int32Value connect_retry_interval = 4; + */ + com.google.protobuf.Int32ValueOrBuilder getConnectRetryIntervalOrBuilder(); + + /** + * + * + *
+   * Interval in milliseconds between replication heartbeats.
+   * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + * + * @return Whether the masterHeartbeatPeriod field is set. + */ + boolean hasMasterHeartbeatPeriod(); + + /** + * + * + *
+   * Interval in milliseconds between replication heartbeats.
+   * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + * + * @return The masterHeartbeatPeriod. + */ + com.google.protobuf.Int64Value getMasterHeartbeatPeriod(); + + /** + * + * + *
+   * Interval in milliseconds between replication heartbeats.
+   * 
+ * + * .google.protobuf.Int64Value master_heartbeat_period = 5; + */ + com.google.protobuf.Int64ValueOrBuilder getMasterHeartbeatPeriodOrBuilder(); + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The caCertificate. + */ + java.lang.String getCaCertificate(); + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 6; + * + * @return The bytes for caCertificate. + */ + com.google.protobuf.ByteString getCaCertificateBytes(); + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 7; + * + * @return The clientCertificate. + */ + java.lang.String getClientCertificate(); + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 7; + * + * @return The bytes for clientCertificate. + */ + com.google.protobuf.ByteString getClientCertificateBytes(); + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 8; + * + * @return The clientKey. + */ + java.lang.String getClientKey(); + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 8; + * + * @return The bytes for clientKey. + */ + com.google.protobuf.ByteString getClientKeyBytes(); + + /** + * + * + *
+   * A list of permissible ciphers to use for SSL encryption.
+   * 
+ * + * string ssl_cipher = 9; + * + * @return The sslCipher. + */ + java.lang.String getSslCipher(); + + /** + * + * + *
+   * A list of permissible ciphers to use for SSL encryption.
+   * 
+ * + * string ssl_cipher = 9; + * + * @return The bytes for sslCipher. + */ + com.google.protobuf.ByteString getSslCipherBytes(); + + /** + * + * + *
+   * Whether or not to check the primary instance's Common Name value in the
+   * certificate that it sends during the SSL handshake.
+   * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + * + * @return Whether the verifyServerCertificate field is set. + */ + boolean hasVerifyServerCertificate(); + + /** + * + * + *
+   * Whether or not to check the primary instance's Common Name value in the
+   * certificate that it sends during the SSL handshake.
+   * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + * + * @return The verifyServerCertificate. + */ + com.google.protobuf.BoolValue getVerifyServerCertificate(); + + /** + * + * + *
+   * Whether or not to check the primary instance's Common Name value in the
+   * certificate that it sends during the SSL handshake.
+   * 
+ * + * .google.protobuf.BoolValue verify_server_certificate = 10; + */ + com.google.protobuf.BoolValueOrBuilder getVerifyServerCertificateOrBuilder(); + + /** + * + * + *
+   * This is always `sql#mysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 11; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#mysqlReplicaConfiguration`.
+   * 
+ * + * string kind = 11; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MySqlSyncConfig.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MySqlSyncConfig.java new file mode 100644 index 000000000000..74bedd30735c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MySqlSyncConfig.java @@ -0,0 +1,925 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * MySQL-specific external server sync settings.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.MySqlSyncConfig} + */ +@com.google.protobuf.Generated +public final class MySqlSyncConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.MySqlSyncConfig) + MySqlSyncConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MySqlSyncConfig"); + } + + // Use MySqlSyncConfig.newBuilder() to construct. + private MySqlSyncConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MySqlSyncConfig() { + initialSyncFlags_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MySqlSyncConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MySqlSyncConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.MySqlSyncConfig.class, + com.google.cloud.sql.v1beta4.MySqlSyncConfig.Builder.class); + } + + public static final int INITIAL_SYNC_FLAGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List initialSyncFlags_; + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + @java.lang.Override + public java.util.List getInitialSyncFlagsList() { + return initialSyncFlags_; + } + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + @java.lang.Override + public java.util.List + getInitialSyncFlagsOrBuilderList() { + return initialSyncFlags_; + } + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + @java.lang.Override + public int getInitialSyncFlagsCount() { + return initialSyncFlags_.size(); + } + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SyncFlags getInitialSyncFlags(int index) { + return initialSyncFlags_.get(index); + } + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SyncFlagsOrBuilder getInitialSyncFlagsOrBuilder(int index) { + return initialSyncFlags_.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 < initialSyncFlags_.size(); i++) { + output.writeMessage(1, initialSyncFlags_.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 < initialSyncFlags_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, initialSyncFlags_.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.sql.v1beta4.MySqlSyncConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.MySqlSyncConfig other = + (com.google.cloud.sql.v1beta4.MySqlSyncConfig) obj; + + if (!getInitialSyncFlagsList().equals(other.getInitialSyncFlagsList())) return false; + if (!getUnknownFields().equals(other.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 (getInitialSyncFlagsCount() > 0) { + hash = (37 * hash) + INITIAL_SYNC_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getInitialSyncFlagsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.MySqlSyncConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.MySqlSyncConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MySqlSyncConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.MySqlSyncConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MySqlSyncConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.MySqlSyncConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MySqlSyncConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.MySqlSyncConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MySqlSyncConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.MySqlSyncConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.MySqlSyncConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.MySqlSyncConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.MySqlSyncConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * MySQL-specific external server sync settings.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.MySqlSyncConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.MySqlSyncConfig) + com.google.cloud.sql.v1beta4.MySqlSyncConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MySqlSyncConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MySqlSyncConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.MySqlSyncConfig.class, + com.google.cloud.sql.v1beta4.MySqlSyncConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.MySqlSyncConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (initialSyncFlagsBuilder_ == null) { + initialSyncFlags_ = java.util.Collections.emptyList(); + } else { + initialSyncFlags_ = null; + initialSyncFlagsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_MySqlSyncConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlSyncConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlSyncConfig build() { + com.google.cloud.sql.v1beta4.MySqlSyncConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlSyncConfig buildPartial() { + com.google.cloud.sql.v1beta4.MySqlSyncConfig result = + new com.google.cloud.sql.v1beta4.MySqlSyncConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1beta4.MySqlSyncConfig result) { + if (initialSyncFlagsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + initialSyncFlags_ = java.util.Collections.unmodifiableList(initialSyncFlags_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.initialSyncFlags_ = initialSyncFlags_; + } else { + result.initialSyncFlags_ = initialSyncFlagsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.MySqlSyncConfig result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.MySqlSyncConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.MySqlSyncConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.MySqlSyncConfig other) { + if (other == com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance()) return this; + if (initialSyncFlagsBuilder_ == null) { + if (!other.initialSyncFlags_.isEmpty()) { + if (initialSyncFlags_.isEmpty()) { + initialSyncFlags_ = other.initialSyncFlags_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.addAll(other.initialSyncFlags_); + } + onChanged(); + } + } else { + if (!other.initialSyncFlags_.isEmpty()) { + if (initialSyncFlagsBuilder_.isEmpty()) { + initialSyncFlagsBuilder_.dispose(); + initialSyncFlagsBuilder_ = null; + initialSyncFlags_ = other.initialSyncFlags_; + bitField0_ = (bitField0_ & ~0x00000001); + initialSyncFlagsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetInitialSyncFlagsFieldBuilder() + : null; + } else { + initialSyncFlagsBuilder_.addAllMessages(other.initialSyncFlags_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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.sql.v1beta4.SyncFlags m = + input.readMessage( + com.google.cloud.sql.v1beta4.SyncFlags.parser(), extensionRegistry); + if (initialSyncFlagsBuilder_ == null) { + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.add(m); + } else { + initialSyncFlagsBuilder_.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 initialSyncFlags_ = + java.util.Collections.emptyList(); + + private void ensureInitialSyncFlagsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + initialSyncFlags_ = + new java.util.ArrayList(initialSyncFlags_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SyncFlags, + com.google.cloud.sql.v1beta4.SyncFlags.Builder, + com.google.cloud.sql.v1beta4.SyncFlagsOrBuilder> + initialSyncFlagsBuilder_; + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public java.util.List getInitialSyncFlagsList() { + if (initialSyncFlagsBuilder_ == null) { + return java.util.Collections.unmodifiableList(initialSyncFlags_); + } else { + return initialSyncFlagsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public int getInitialSyncFlagsCount() { + if (initialSyncFlagsBuilder_ == null) { + return initialSyncFlags_.size(); + } else { + return initialSyncFlagsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public com.google.cloud.sql.v1beta4.SyncFlags getInitialSyncFlags(int index) { + if (initialSyncFlagsBuilder_ == null) { + return initialSyncFlags_.get(index); + } else { + return initialSyncFlagsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public Builder setInitialSyncFlags(int index, com.google.cloud.sql.v1beta4.SyncFlags value) { + if (initialSyncFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.set(index, value); + onChanged(); + } else { + initialSyncFlagsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public Builder setInitialSyncFlags( + int index, com.google.cloud.sql.v1beta4.SyncFlags.Builder builderForValue) { + if (initialSyncFlagsBuilder_ == null) { + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.set(index, builderForValue.build()); + onChanged(); + } else { + initialSyncFlagsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public Builder addInitialSyncFlags(com.google.cloud.sql.v1beta4.SyncFlags value) { + if (initialSyncFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.add(value); + onChanged(); + } else { + initialSyncFlagsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public Builder addInitialSyncFlags(int index, com.google.cloud.sql.v1beta4.SyncFlags value) { + if (initialSyncFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.add(index, value); + onChanged(); + } else { + initialSyncFlagsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public Builder addInitialSyncFlags( + com.google.cloud.sql.v1beta4.SyncFlags.Builder builderForValue) { + if (initialSyncFlagsBuilder_ == null) { + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.add(builderForValue.build()); + onChanged(); + } else { + initialSyncFlagsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public Builder addInitialSyncFlags( + int index, com.google.cloud.sql.v1beta4.SyncFlags.Builder builderForValue) { + if (initialSyncFlagsBuilder_ == null) { + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.add(index, builderForValue.build()); + onChanged(); + } else { + initialSyncFlagsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public Builder addAllInitialSyncFlags( + java.lang.Iterable values) { + if (initialSyncFlagsBuilder_ == null) { + ensureInitialSyncFlagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, initialSyncFlags_); + onChanged(); + } else { + initialSyncFlagsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public Builder clearInitialSyncFlags() { + if (initialSyncFlagsBuilder_ == null) { + initialSyncFlags_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + initialSyncFlagsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public Builder removeInitialSyncFlags(int index) { + if (initialSyncFlagsBuilder_ == null) { + ensureInitialSyncFlagsIsMutable(); + initialSyncFlags_.remove(index); + onChanged(); + } else { + initialSyncFlagsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public com.google.cloud.sql.v1beta4.SyncFlags.Builder getInitialSyncFlagsBuilder(int index) { + return internalGetInitialSyncFlagsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public com.google.cloud.sql.v1beta4.SyncFlagsOrBuilder getInitialSyncFlagsOrBuilder(int index) { + if (initialSyncFlagsBuilder_ == null) { + return initialSyncFlags_.get(index); + } else { + return initialSyncFlagsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public java.util.List + getInitialSyncFlagsOrBuilderList() { + if (initialSyncFlagsBuilder_ != null) { + return initialSyncFlagsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(initialSyncFlags_); + } + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public com.google.cloud.sql.v1beta4.SyncFlags.Builder addInitialSyncFlagsBuilder() { + return internalGetInitialSyncFlagsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.SyncFlags.getDefaultInstance()); + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public com.google.cloud.sql.v1beta4.SyncFlags.Builder addInitialSyncFlagsBuilder(int index) { + return internalGetInitialSyncFlagsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.SyncFlags.getDefaultInstance()); + } + + /** + * + * + *
+     * Flags to use for the initial dump.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + public java.util.List + getInitialSyncFlagsBuilderList() { + return internalGetInitialSyncFlagsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SyncFlags, + com.google.cloud.sql.v1beta4.SyncFlags.Builder, + com.google.cloud.sql.v1beta4.SyncFlagsOrBuilder> + internalGetInitialSyncFlagsFieldBuilder() { + if (initialSyncFlagsBuilder_ == null) { + initialSyncFlagsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SyncFlags, + com.google.cloud.sql.v1beta4.SyncFlags.Builder, + com.google.cloud.sql.v1beta4.SyncFlagsOrBuilder>( + initialSyncFlags_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + initialSyncFlags_ = null; + } + return initialSyncFlagsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.MySqlSyncConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.MySqlSyncConfig) + private static final com.google.cloud.sql.v1beta4.MySqlSyncConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.MySqlSyncConfig(); + } + + public static com.google.cloud.sql.v1beta4.MySqlSyncConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MySqlSyncConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlSyncConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MySqlSyncConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MySqlSyncConfigOrBuilder.java new file mode 100644 index 000000000000..8222c1de709a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/MySqlSyncConfigOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface MySqlSyncConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.MySqlSyncConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + java.util.List getInitialSyncFlagsList(); + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + com.google.cloud.sql.v1beta4.SyncFlags getInitialSyncFlags(int index); + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + int getInitialSyncFlagsCount(); + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + java.util.List + getInitialSyncFlagsOrBuilderList(); + + /** + * + * + *
+   * Flags to use for the initial dump.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SyncFlags initial_sync_flags = 1; + */ + com.google.cloud.sql.v1beta4.SyncFlagsOrBuilder getInitialSyncFlagsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OnPremisesConfiguration.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OnPremisesConfiguration.java new file mode 100644 index 000000000000..4dcdc17cf057 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OnPremisesConfiguration.java @@ -0,0 +1,3190 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * On-premises instance configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.OnPremisesConfiguration} + */ +@com.google.protobuf.Generated +public final class OnPremisesConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.OnPremisesConfiguration) + OnPremisesConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OnPremisesConfiguration"); + } + + // Use OnPremisesConfiguration.newBuilder() to construct. + private OnPremisesConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OnPremisesConfiguration() { + hostPort_ = ""; + kind_ = ""; + username_ = ""; + password_ = ""; + caCertificate_ = ""; + clientCertificate_ = ""; + clientKey_ = ""; + dumpFilePath_ = ""; + selectedObjects_ = java.util.Collections.emptyList(); + sslOption_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OnPremisesConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OnPremisesConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.OnPremisesConfiguration.class, + com.google.cloud.sql.v1beta4.OnPremisesConfiguration.Builder.class); + } + + /** + * + * + *
+   * SslOption defines the SSL mode to be used for replica connection to the
+   * on-premises source.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption} + */ + public enum SslOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown SSL option i.e. SSL option not specified by user.
+     * 
+ * + * SSL_OPTION_UNSPECIFIED = 0; + */ + SSL_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * SSL is disabled for replica connection to the on-premises source.
+     * 
+ * + * DISABLE = 1; + */ + DISABLE(1), + /** + * + * + *
+     * SSL is required for replica connection to the on-premises source.
+     * 
+ * + * REQUIRE = 2; + */ + REQUIRE(2), + /** + * + * + *
+     * Verify CA is required for replica connection to the on-premises source.
+     * 
+ * + * VERIFY_CA = 3; + */ + VERIFY_CA(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslOption"); + } + + /** + * + * + *
+     * Unknown SSL option i.e. SSL option not specified by user.
+     * 
+ * + * SSL_OPTION_UNSPECIFIED = 0; + */ + public static final int SSL_OPTION_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * SSL is disabled for replica connection to the on-premises source.
+     * 
+ * + * DISABLE = 1; + */ + public static final int DISABLE_VALUE = 1; + + /** + * + * + *
+     * SSL is required for replica connection to the on-premises source.
+     * 
+ * + * REQUIRE = 2; + */ + public static final int REQUIRE_VALUE = 2; + + /** + * + * + *
+     * Verify CA is required for replica connection to the on-premises source.
+     * 
+ * + * VERIFY_CA = 3; + */ + public static final int VERIFY_CA_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SslOption 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 SslOption forNumber(int value) { + switch (value) { + case 0: + return SSL_OPTION_UNSPECIFIED; + case 1: + return DISABLE; + case 2: + return REQUIRE; + case 3: + return VERIFY_CA; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SslOption findValueByNumber(int number) { + return SslOption.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.OnPremisesConfiguration.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final SslOption[] VALUES = values(); + + public static SslOption 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 SslOption(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption) + } + + private int bitField0_; + public static final int HOST_PORT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object hostPort_ = ""; + + /** + * + * + *
+   * The host and port of the on-premises instance in host:port format
+   * 
+ * + * string host_port = 1; + * + * @return The hostPort. + */ + @java.lang.Override + public java.lang.String getHostPort() { + java.lang.Object ref = hostPort_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostPort_ = s; + return s; + } + } + + /** + * + * + *
+   * The host and port of the on-premises instance in host:port format
+   * 
+ * + * string host_port = 1; + * + * @return The bytes for hostPort. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostPortBytes() { + java.lang.Object ref = hostPort_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostPort_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#onPremisesConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#onPremisesConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERNAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object username_ = ""; + + /** + * + * + *
+   * The username for connecting to on-premises instance.
+   * 
+ * + * string username = 3; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } + } + + /** + * + * + *
+   * The username for connecting to on-premises instance.
+   * 
+ * + * string username = 3; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + + /** + * + * + *
+   * The password for connecting to on-premises instance.
+   * 
+ * + * string password = 4; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + + /** + * + * + *
+   * The password for connecting to on-premises instance.
+   * 
+ * + * string password = 4; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CA_CERTIFICATE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object caCertificate_ = ""; + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 5; + * + * @return The caCertificate. + */ + @java.lang.Override + public java.lang.String getCaCertificate() { + java.lang.Object ref = caCertificate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCertificate_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 5; + * + * @return The bytes for caCertificate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCaCertificateBytes() { + java.lang.Object ref = caCertificate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_CERTIFICATE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object clientCertificate_ = ""; + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 6; + * + * @return The clientCertificate. + */ + @java.lang.Override + public java.lang.String getClientCertificate() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientCertificate_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 6; + * + * @return The bytes for clientCertificate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientCertificateBytes() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_KEY_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object clientKey_ = ""; + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 7; + * + * @return The clientKey. + */ + @java.lang.Override + public java.lang.String getClientKey() { + java.lang.Object ref = clientKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientKey_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 7; + * + * @return The bytes for clientKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientKeyBytes() { + java.lang.Object ref = clientKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DUMP_FILE_PATH_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object dumpFilePath_ = ""; + + /** + * + * + *
+   * The dump file to create the Cloud SQL replica.
+   * 
+ * + * string dump_file_path = 8; + * + * @return The dumpFilePath. + */ + @java.lang.Override + public java.lang.String getDumpFilePath() { + java.lang.Object ref = dumpFilePath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dumpFilePath_ = s; + return s; + } + } + + /** + * + * + *
+   * The dump file to create the Cloud SQL replica.
+   * 
+ * + * string dump_file_path = 8; + * + * @return The bytes for dumpFilePath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDumpFilePathBytes() { + java.lang.Object ref = dumpFilePath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dumpFilePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_INSTANCE_FIELD_NUMBER = 15; + private com.google.cloud.sql.v1beta4.InstanceReference sourceInstance_; + + /** + * + * + *
+   * The reference to Cloud SQL instance if the source is Cloud SQL.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + * + * @return Whether the sourceInstance field is set. + */ + @java.lang.Override + public boolean hasSourceInstance() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The reference to Cloud SQL instance if the source is Cloud SQL.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + * + * @return The sourceInstance. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstanceReference getSourceInstance() { + return sourceInstance_ == null + ? com.google.cloud.sql.v1beta4.InstanceReference.getDefaultInstance() + : sourceInstance_; + } + + /** + * + * + *
+   * The reference to Cloud SQL instance if the source is Cloud SQL.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstanceReferenceOrBuilder getSourceInstanceOrBuilder() { + return sourceInstance_ == null + ? com.google.cloud.sql.v1beta4.InstanceReference.getDefaultInstance() + : sourceInstance_; + } + + public static final int SELECTED_OBJECTS_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private java.util.List selectedObjects_; + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getSelectedObjectsList() { + return selectedObjects_; + } + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getSelectedObjectsOrBuilderList() { + return selectedObjects_; + } + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getSelectedObjectsCount() { + return selectedObjects_.size(); + } + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SelectedObjects getSelectedObjects(int index) { + return selectedObjects_.get(index); + } + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SelectedObjectsOrBuilder getSelectedObjectsOrBuilder( + int index) { + return selectedObjects_.get(index); + } + + public static final int SSL_OPTION_FIELD_NUMBER = 18; + private int sslOption_ = 0; + + /** + * + * + *
+   * Optional. SslOption for replica connection to the on-premises source.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslOption. + */ + @java.lang.Override + public int getSslOptionValue() { + return sslOption_; + } + + /** + * + * + *
+   * Optional. SslOption for replica connection to the on-premises source.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslOption. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption getSslOption() { + com.google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption result = + com.google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption.forNumber(sslOption_); + return result == null + ? com.google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption.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.GeneratedMessage.isStringEmpty(hostPort_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, hostPort_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(username_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, username_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, password_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(caCertificate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, caCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientCertificate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, clientCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, clientKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dumpFilePath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, dumpFilePath_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(15, getSourceInstance()); + } + for (int i = 0; i < selectedObjects_.size(); i++) { + output.writeMessage(16, selectedObjects_.get(i)); + } + if (sslOption_ + != com.google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption.SSL_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(18, sslOption_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(hostPort_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, hostPort_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(username_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, username_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, password_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(caCertificate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, caCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientCertificate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, clientCertificate_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clientKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, clientKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dumpFilePath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, dumpFilePath_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getSourceInstance()); + } + for (int i = 0; i < selectedObjects_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, selectedObjects_.get(i)); + } + if (sslOption_ + != com.google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption.SSL_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(18, sslOption_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.OnPremisesConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.OnPremisesConfiguration other = + (com.google.cloud.sql.v1beta4.OnPremisesConfiguration) obj; + + if (!getHostPort().equals(other.getHostPort())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUsername().equals(other.getUsername())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (!getCaCertificate().equals(other.getCaCertificate())) return false; + if (!getClientCertificate().equals(other.getClientCertificate())) return false; + if (!getClientKey().equals(other.getClientKey())) return false; + if (!getDumpFilePath().equals(other.getDumpFilePath())) return false; + if (hasSourceInstance() != other.hasSourceInstance()) return false; + if (hasSourceInstance()) { + if (!getSourceInstance().equals(other.getSourceInstance())) return false; + } + if (!getSelectedObjectsList().equals(other.getSelectedObjectsList())) return false; + if (sslOption_ != other.sslOption_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HOST_PORT_FIELD_NUMBER; + hash = (53 * hash) + getHostPort().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (37 * hash) + CA_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getCaCertificate().hashCode(); + hash = (37 * hash) + CLIENT_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getClientCertificate().hashCode(); + hash = (37 * hash) + CLIENT_KEY_FIELD_NUMBER; + hash = (53 * hash) + getClientKey().hashCode(); + hash = (37 * hash) + DUMP_FILE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getDumpFilePath().hashCode(); + if (hasSourceInstance()) { + hash = (37 * hash) + SOURCE_INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getSourceInstance().hashCode(); + } + if (getSelectedObjectsCount() > 0) { + hash = (37 * hash) + SELECTED_OBJECTS_FIELD_NUMBER; + hash = (53 * hash) + getSelectedObjectsList().hashCode(); + } + hash = (37 * hash) + SSL_OPTION_FIELD_NUMBER; + hash = (53 * hash) + sslOption_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.OnPremisesConfiguration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.OnPremisesConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OnPremisesConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.OnPremisesConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OnPremisesConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.OnPremisesConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OnPremisesConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.OnPremisesConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OnPremisesConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.OnPremisesConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OnPremisesConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.OnPremisesConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.OnPremisesConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * On-premises instance configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.OnPremisesConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.OnPremisesConfiguration) + com.google.cloud.sql.v1beta4.OnPremisesConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OnPremisesConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OnPremisesConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.OnPremisesConfiguration.class, + com.google.cloud.sql.v1beta4.OnPremisesConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.OnPremisesConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSourceInstanceFieldBuilder(); + internalGetSelectedObjectsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + hostPort_ = ""; + kind_ = ""; + username_ = ""; + password_ = ""; + caCertificate_ = ""; + clientCertificate_ = ""; + clientKey_ = ""; + dumpFilePath_ = ""; + sourceInstance_ = null; + if (sourceInstanceBuilder_ != null) { + sourceInstanceBuilder_.dispose(); + sourceInstanceBuilder_ = null; + } + if (selectedObjectsBuilder_ == null) { + selectedObjects_ = java.util.Collections.emptyList(); + } else { + selectedObjects_ = null; + selectedObjectsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + sslOption_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OnPremisesConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OnPremisesConfiguration getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.OnPremisesConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OnPremisesConfiguration build() { + com.google.cloud.sql.v1beta4.OnPremisesConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OnPremisesConfiguration buildPartial() { + com.google.cloud.sql.v1beta4.OnPremisesConfiguration result = + new com.google.cloud.sql.v1beta4.OnPremisesConfiguration(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.OnPremisesConfiguration result) { + if (selectedObjectsBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0)) { + selectedObjects_ = java.util.Collections.unmodifiableList(selectedObjects_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.selectedObjects_ = selectedObjects_; + } else { + result.selectedObjects_ = selectedObjectsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.OnPremisesConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.hostPort_ = hostPort_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.username_ = username_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.password_ = password_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.caCertificate_ = caCertificate_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.clientCertificate_ = clientCertificate_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.clientKey_ = clientKey_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.dumpFilePath_ = dumpFilePath_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000100) != 0)) { + result.sourceInstance_ = + sourceInstanceBuilder_ == null ? sourceInstance_ : sourceInstanceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.sslOption_ = sslOption_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.OnPremisesConfiguration) { + return mergeFrom((com.google.cloud.sql.v1beta4.OnPremisesConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.OnPremisesConfiguration other) { + if (other == com.google.cloud.sql.v1beta4.OnPremisesConfiguration.getDefaultInstance()) + return this; + if (!other.getHostPort().isEmpty()) { + hostPort_ = other.hostPort_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getCaCertificate().isEmpty()) { + caCertificate_ = other.caCertificate_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getClientCertificate().isEmpty()) { + clientCertificate_ = other.clientCertificate_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getClientKey().isEmpty()) { + clientKey_ = other.clientKey_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getDumpFilePath().isEmpty()) { + dumpFilePath_ = other.dumpFilePath_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.hasSourceInstance()) { + mergeSourceInstance(other.getSourceInstance()); + } + if (selectedObjectsBuilder_ == null) { + if (!other.selectedObjects_.isEmpty()) { + if (selectedObjects_.isEmpty()) { + selectedObjects_ = other.selectedObjects_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureSelectedObjectsIsMutable(); + selectedObjects_.addAll(other.selectedObjects_); + } + onChanged(); + } + } else { + if (!other.selectedObjects_.isEmpty()) { + if (selectedObjectsBuilder_.isEmpty()) { + selectedObjectsBuilder_.dispose(); + selectedObjectsBuilder_ = null; + selectedObjects_ = other.selectedObjects_; + bitField0_ = (bitField0_ & ~0x00000200); + selectedObjectsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetSelectedObjectsFieldBuilder() + : null; + } else { + selectedObjectsBuilder_.addAllMessages(other.selectedObjects_); + } + } + } + if (other.sslOption_ != 0) { + setSslOptionValue(other.getSslOptionValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + hostPort_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + username_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + caCertificate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + clientCertificate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + clientKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + dumpFilePath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 122: + { + input.readMessage( + internalGetSourceInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 122 + case 130: + { + com.google.cloud.sql.v1beta4.SelectedObjects m = + input.readMessage( + com.google.cloud.sql.v1beta4.SelectedObjects.parser(), extensionRegistry); + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(m); + } else { + selectedObjectsBuilder_.addMessage(m); + } + break; + } // case 130 + case 144: + { + sslOption_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 144 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object hostPort_ = ""; + + /** + * + * + *
+     * The host and port of the on-premises instance in host:port format
+     * 
+ * + * string host_port = 1; + * + * @return The hostPort. + */ + public java.lang.String getHostPort() { + java.lang.Object ref = hostPort_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostPort_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The host and port of the on-premises instance in host:port format
+     * 
+ * + * string host_port = 1; + * + * @return The bytes for hostPort. + */ + public com.google.protobuf.ByteString getHostPortBytes() { + java.lang.Object ref = hostPort_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostPort_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The host and port of the on-premises instance in host:port format
+     * 
+ * + * string host_port = 1; + * + * @param value The hostPort to set. + * @return This builder for chaining. + */ + public Builder setHostPort(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + hostPort_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The host and port of the on-premises instance in host:port format
+     * 
+ * + * string host_port = 1; + * + * @return This builder for chaining. + */ + public Builder clearHostPort() { + hostPort_ = getDefaultInstance().getHostPort(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The host and port of the on-premises instance in host:port format
+     * 
+ * + * string host_port = 1; + * + * @param value The bytes for hostPort to set. + * @return This builder for chaining. + */ + public Builder setHostPortBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + hostPort_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#onPremisesConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#onPremisesConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#onPremisesConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#onPremisesConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#onPremisesConfiguration`.
+     * 
+ * + * string kind = 2; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object username_ = ""; + + /** + * + * + *
+     * The username for connecting to on-premises instance.
+     * 
+ * + * string username = 3; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The username for connecting to on-premises instance.
+     * 
+ * + * string username = 3; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The username for connecting to on-premises instance.
+     * 
+ * + * string username = 3; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + username_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The username for connecting to on-premises instance.
+     * 
+ * + * string username = 3; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + username_ = getDefaultInstance().getUsername(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The username for connecting to on-premises instance.
+     * 
+ * + * string username = 3; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + username_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + + /** + * + * + *
+     * The password for connecting to on-premises instance.
+     * 
+ * + * string password = 4; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The password for connecting to on-premises instance.
+     * 
+ * + * string password = 4; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The password for connecting to on-premises instance.
+     * 
+ * + * string password = 4; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for connecting to on-premises instance.
+     * 
+ * + * string password = 4; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for connecting to on-premises instance.
+     * 
+ * + * string password = 4; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object caCertificate_ = ""; + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 5; + * + * @return The caCertificate. + */ + public java.lang.String getCaCertificate() { + java.lang.Object ref = caCertificate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCertificate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 5; + * + * @return The bytes for caCertificate. + */ + public com.google.protobuf.ByteString getCaCertificateBytes() { + java.lang.Object ref = caCertificate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 5; + * + * @param value The caCertificate to set. + * @return This builder for chaining. + */ + public Builder setCaCertificate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + caCertificate_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 5; + * + * @return This builder for chaining. + */ + public Builder clearCaCertificate() { + caCertificate_ = getDefaultInstance().getCaCertificate(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the trusted CA's x509 certificate.
+     * 
+ * + * string ca_certificate = 5; + * + * @param value The bytes for caCertificate to set. + * @return This builder for chaining. + */ + public Builder setCaCertificateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + caCertificate_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object clientCertificate_ = ""; + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 6; + * + * @return The clientCertificate. + */ + public java.lang.String getClientCertificate() { + java.lang.Object ref = clientCertificate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientCertificate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 6; + * + * @return The bytes for clientCertificate. + */ + public com.google.protobuf.ByteString getClientCertificateBytes() { + java.lang.Object ref = clientCertificate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientCertificate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 6; + * + * @param value The clientCertificate to set. + * @return This builder for chaining. + */ + public Builder setClientCertificate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clientCertificate_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 6; + * + * @return This builder for chaining. + */ + public Builder clearClientCertificate() { + clientCertificate_ = getDefaultInstance().getClientCertificate(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's x509 certificate.
+     * 
+ * + * string client_certificate = 6; + * + * @param value The bytes for clientCertificate to set. + * @return This builder for chaining. + */ + public Builder setClientCertificateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clientCertificate_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object clientKey_ = ""; + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 7; + * + * @return The clientKey. + */ + public java.lang.String getClientKey() { + java.lang.Object ref = clientKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 7; + * + * @return The bytes for clientKey. + */ + public com.google.protobuf.ByteString getClientKeyBytes() { + java.lang.Object ref = clientKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 7; + * + * @param value The clientKey to set. + * @return This builder for chaining. + */ + public Builder setClientKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clientKey_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 7; + * + * @return This builder for chaining. + */ + public Builder clearClientKey() { + clientKey_ = getDefaultInstance().getClientKey(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation of the replica's private key. The corresponding public
+     * key is encoded in the client's certificate.
+     * 
+ * + * string client_key = 7; + * + * @param value The bytes for clientKey to set. + * @return This builder for chaining. + */ + public Builder setClientKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clientKey_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object dumpFilePath_ = ""; + + /** + * + * + *
+     * The dump file to create the Cloud SQL replica.
+     * 
+ * + * string dump_file_path = 8; + * + * @return The dumpFilePath. + */ + public java.lang.String getDumpFilePath() { + java.lang.Object ref = dumpFilePath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dumpFilePath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The dump file to create the Cloud SQL replica.
+     * 
+ * + * string dump_file_path = 8; + * + * @return The bytes for dumpFilePath. + */ + public com.google.protobuf.ByteString getDumpFilePathBytes() { + java.lang.Object ref = dumpFilePath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dumpFilePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The dump file to create the Cloud SQL replica.
+     * 
+ * + * string dump_file_path = 8; + * + * @param value The dumpFilePath to set. + * @return This builder for chaining. + */ + public Builder setDumpFilePath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dumpFilePath_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The dump file to create the Cloud SQL replica.
+     * 
+ * + * string dump_file_path = 8; + * + * @return This builder for chaining. + */ + public Builder clearDumpFilePath() { + dumpFilePath_ = getDefaultInstance().getDumpFilePath(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * The dump file to create the Cloud SQL replica.
+     * 
+ * + * string dump_file_path = 8; + * + * @param value The bytes for dumpFilePath to set. + * @return This builder for chaining. + */ + public Builder setDumpFilePathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dumpFilePath_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstanceReference sourceInstance_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstanceReference, + com.google.cloud.sql.v1beta4.InstanceReference.Builder, + com.google.cloud.sql.v1beta4.InstanceReferenceOrBuilder> + sourceInstanceBuilder_; + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + * + * @return Whether the sourceInstance field is set. + */ + public boolean hasSourceInstance() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + * + * @return The sourceInstance. + */ + public com.google.cloud.sql.v1beta4.InstanceReference getSourceInstance() { + if (sourceInstanceBuilder_ == null) { + return sourceInstance_ == null + ? com.google.cloud.sql.v1beta4.InstanceReference.getDefaultInstance() + : sourceInstance_; + } else { + return sourceInstanceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + */ + public Builder setSourceInstance(com.google.cloud.sql.v1beta4.InstanceReference value) { + if (sourceInstanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceInstance_ = value; + } else { + sourceInstanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + */ + public Builder setSourceInstance( + com.google.cloud.sql.v1beta4.InstanceReference.Builder builderForValue) { + if (sourceInstanceBuilder_ == null) { + sourceInstance_ = builderForValue.build(); + } else { + sourceInstanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + */ + public Builder mergeSourceInstance(com.google.cloud.sql.v1beta4.InstanceReference value) { + if (sourceInstanceBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && sourceInstance_ != null + && sourceInstance_ + != com.google.cloud.sql.v1beta4.InstanceReference.getDefaultInstance()) { + getSourceInstanceBuilder().mergeFrom(value); + } else { + sourceInstance_ = value; + } + } else { + sourceInstanceBuilder_.mergeFrom(value); + } + if (sourceInstance_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + */ + public Builder clearSourceInstance() { + bitField0_ = (bitField0_ & ~0x00000100); + sourceInstance_ = null; + if (sourceInstanceBuilder_ != null) { + sourceInstanceBuilder_.dispose(); + sourceInstanceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + */ + public com.google.cloud.sql.v1beta4.InstanceReference.Builder getSourceInstanceBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetSourceInstanceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + */ + public com.google.cloud.sql.v1beta4.InstanceReferenceOrBuilder getSourceInstanceOrBuilder() { + if (sourceInstanceBuilder_ != null) { + return sourceInstanceBuilder_.getMessageOrBuilder(); + } else { + return sourceInstance_ == null + ? com.google.cloud.sql.v1beta4.InstanceReference.getDefaultInstance() + : sourceInstance_; + } + } + + /** + * + * + *
+     * The reference to Cloud SQL instance if the source is Cloud SQL.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstanceReference, + com.google.cloud.sql.v1beta4.InstanceReference.Builder, + com.google.cloud.sql.v1beta4.InstanceReferenceOrBuilder> + internalGetSourceInstanceFieldBuilder() { + if (sourceInstanceBuilder_ == null) { + sourceInstanceBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstanceReference, + com.google.cloud.sql.v1beta4.InstanceReference.Builder, + com.google.cloud.sql.v1beta4.InstanceReferenceOrBuilder>( + getSourceInstance(), getParentForChildren(), isClean()); + sourceInstance_ = null; + } + return sourceInstanceBuilder_; + } + + private java.util.List selectedObjects_ = + java.util.Collections.emptyList(); + + private void ensureSelectedObjectsIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + selectedObjects_ = + new java.util.ArrayList(selectedObjects_); + bitField0_ |= 0x00000200; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SelectedObjects, + com.google.cloud.sql.v1beta4.SelectedObjects.Builder, + com.google.cloud.sql.v1beta4.SelectedObjectsOrBuilder> + selectedObjectsBuilder_; + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getSelectedObjectsList() { + if (selectedObjectsBuilder_ == null) { + return java.util.Collections.unmodifiableList(selectedObjects_); + } else { + return selectedObjectsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getSelectedObjectsCount() { + if (selectedObjectsBuilder_ == null) { + return selectedObjects_.size(); + } else { + return selectedObjectsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.SelectedObjects getSelectedObjects(int index) { + if (selectedObjectsBuilder_ == null) { + return selectedObjects_.get(index); + } else { + return selectedObjectsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSelectedObjects( + int index, com.google.cloud.sql.v1beta4.SelectedObjects value) { + if (selectedObjectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSelectedObjectsIsMutable(); + selectedObjects_.set(index, value); + onChanged(); + } else { + selectedObjectsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSelectedObjects( + int index, com.google.cloud.sql.v1beta4.SelectedObjects.Builder builderForValue) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.set(index, builderForValue.build()); + onChanged(); + } else { + selectedObjectsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects(com.google.cloud.sql.v1beta4.SelectedObjects value) { + if (selectedObjectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(value); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects( + int index, com.google.cloud.sql.v1beta4.SelectedObjects value) { + if (selectedObjectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(index, value); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects( + com.google.cloud.sql.v1beta4.SelectedObjects.Builder builderForValue) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(builderForValue.build()); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects( + int index, com.google.cloud.sql.v1beta4.SelectedObjects.Builder builderForValue) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(index, builderForValue.build()); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllSelectedObjects( + java.lang.Iterable values) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, selectedObjects_); + onChanged(); + } else { + selectedObjectsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSelectedObjects() { + if (selectedObjectsBuilder_ == null) { + selectedObjects_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + } else { + selectedObjectsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeSelectedObjects(int index) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.remove(index); + onChanged(); + } else { + selectedObjectsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.SelectedObjects.Builder getSelectedObjectsBuilder( + int index) { + return internalGetSelectedObjectsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.SelectedObjectsOrBuilder getSelectedObjectsOrBuilder( + int index) { + if (selectedObjectsBuilder_ == null) { + return selectedObjects_.get(index); + } else { + return selectedObjectsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSelectedObjectsOrBuilderList() { + if (selectedObjectsBuilder_ != null) { + return selectedObjectsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(selectedObjects_); + } + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.SelectedObjects.Builder addSelectedObjectsBuilder() { + return internalGetSelectedObjectsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.SelectedObjects.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.SelectedObjects.Builder addSelectedObjectsBuilder( + int index) { + return internalGetSelectedObjectsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.SelectedObjects.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. A list of objects that the user selects for replication from an
+     * external source instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSelectedObjectsBuilderList() { + return internalGetSelectedObjectsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SelectedObjects, + com.google.cloud.sql.v1beta4.SelectedObjects.Builder, + com.google.cloud.sql.v1beta4.SelectedObjectsOrBuilder> + internalGetSelectedObjectsFieldBuilder() { + if (selectedObjectsBuilder_ == null) { + selectedObjectsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SelectedObjects, + com.google.cloud.sql.v1beta4.SelectedObjects.Builder, + com.google.cloud.sql.v1beta4.SelectedObjectsOrBuilder>( + selectedObjects_, + ((bitField0_ & 0x00000200) != 0), + getParentForChildren(), + isClean()); + selectedObjects_ = null; + } + return selectedObjectsBuilder_; + } + + private int sslOption_ = 0; + + /** + * + * + *
+     * Optional. SslOption for replica connection to the on-premises source.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslOption. + */ + @java.lang.Override + public int getSslOptionValue() { + return sslOption_; + } + + /** + * + * + *
+     * Optional. SslOption for replica connection to the on-premises source.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for sslOption to set. + * @return This builder for chaining. + */ + public Builder setSslOptionValue(int value) { + sslOption_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. SslOption for replica connection to the on-premises source.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslOption. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption getSslOption() { + com.google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption result = + com.google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption.forNumber(sslOption_); + return result == null + ? com.google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. SslOption for replica connection to the on-premises source.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The sslOption to set. + * @return This builder for chaining. + */ + public Builder setSslOption( + com.google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + sslOption_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. SslOption for replica connection to the on-premises source.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSslOption() { + bitField0_ = (bitField0_ & ~0x00000400); + sslOption_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.OnPremisesConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.OnPremisesConfiguration) + private static final com.google.cloud.sql.v1beta4.OnPremisesConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.OnPremisesConfiguration(); + } + + public static com.google.cloud.sql.v1beta4.OnPremisesConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OnPremisesConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OnPremisesConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OnPremisesConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OnPremisesConfigurationOrBuilder.java new file mode 100644 index 000000000000..956517737ad4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OnPremisesConfigurationOrBuilder.java @@ -0,0 +1,376 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface OnPremisesConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.OnPremisesConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The host and port of the on-premises instance in host:port format
+   * 
+ * + * string host_port = 1; + * + * @return The hostPort. + */ + java.lang.String getHostPort(); + + /** + * + * + *
+   * The host and port of the on-premises instance in host:port format
+   * 
+ * + * string host_port = 1; + * + * @return The bytes for hostPort. + */ + com.google.protobuf.ByteString getHostPortBytes(); + + /** + * + * + *
+   * This is always `sql#onPremisesConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#onPremisesConfiguration`.
+   * 
+ * + * string kind = 2; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The username for connecting to on-premises instance.
+   * 
+ * + * string username = 3; + * + * @return The username. + */ + java.lang.String getUsername(); + + /** + * + * + *
+   * The username for connecting to on-premises instance.
+   * 
+ * + * string username = 3; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * + * + *
+   * The password for connecting to on-premises instance.
+   * 
+ * + * string password = 4; + * + * @return The password. + */ + java.lang.String getPassword(); + + /** + * + * + *
+   * The password for connecting to on-premises instance.
+   * 
+ * + * string password = 4; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 5; + * + * @return The caCertificate. + */ + java.lang.String getCaCertificate(); + + /** + * + * + *
+   * PEM representation of the trusted CA's x509 certificate.
+   * 
+ * + * string ca_certificate = 5; + * + * @return The bytes for caCertificate. + */ + com.google.protobuf.ByteString getCaCertificateBytes(); + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 6; + * + * @return The clientCertificate. + */ + java.lang.String getClientCertificate(); + + /** + * + * + *
+   * PEM representation of the replica's x509 certificate.
+   * 
+ * + * string client_certificate = 6; + * + * @return The bytes for clientCertificate. + */ + com.google.protobuf.ByteString getClientCertificateBytes(); + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 7; + * + * @return The clientKey. + */ + java.lang.String getClientKey(); + + /** + * + * + *
+   * PEM representation of the replica's private key. The corresponding public
+   * key is encoded in the client's certificate.
+   * 
+ * + * string client_key = 7; + * + * @return The bytes for clientKey. + */ + com.google.protobuf.ByteString getClientKeyBytes(); + + /** + * + * + *
+   * The dump file to create the Cloud SQL replica.
+   * 
+ * + * string dump_file_path = 8; + * + * @return The dumpFilePath. + */ + java.lang.String getDumpFilePath(); + + /** + * + * + *
+   * The dump file to create the Cloud SQL replica.
+   * 
+ * + * string dump_file_path = 8; + * + * @return The bytes for dumpFilePath. + */ + com.google.protobuf.ByteString getDumpFilePathBytes(); + + /** + * + * + *
+   * The reference to Cloud SQL instance if the source is Cloud SQL.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + * + * @return Whether the sourceInstance field is set. + */ + boolean hasSourceInstance(); + + /** + * + * + *
+   * The reference to Cloud SQL instance if the source is Cloud SQL.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + * + * @return The sourceInstance. + */ + com.google.cloud.sql.v1beta4.InstanceReference getSourceInstance(); + + /** + * + * + *
+   * The reference to Cloud SQL instance if the source is Cloud SQL.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstanceReference source_instance = 15; + */ + com.google.cloud.sql.v1beta4.InstanceReferenceOrBuilder getSourceInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getSelectedObjectsList(); + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.SelectedObjects getSelectedObjects(int index); + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getSelectedObjectsCount(); + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getSelectedObjectsOrBuilderList(); + + /** + * + * + *
+   * Optional. A list of objects that the user selects for replication from an
+   * external source instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.SelectedObjects selected_objects = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.SelectedObjectsOrBuilder getSelectedObjectsOrBuilder(int index); + + /** + * + * + *
+   * Optional. SslOption for replica connection to the on-premises source.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for sslOption. + */ + int getSslOptionValue(); + + /** + * + * + *
+   * Optional. SslOption for replica connection to the on-premises source.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption ssl_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sslOption. + */ + com.google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption getSslOption(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Operation.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Operation.java new file mode 100644 index 000000000000..d4477d2c950a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Operation.java @@ -0,0 +1,6988 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * An Operation resource.&nbsp;For successful operations that return an
+ * Operation resource, only the fields relevant to the operation are populated
+ * in the resource.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Operation} + */ +@com.google.protobuf.Generated +public final class Operation extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.Operation) + OperationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Operation"); + } + + // Use Operation.newBuilder() to construct. + private Operation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Operation() { + kind_ = ""; + targetLink_ = ""; + status_ = 0; + user_ = ""; + operationType_ = 0; + name_ = ""; + targetId_ = ""; + selfLink_ = ""; + targetProject_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Operation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Operation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Operation.class, + com.google.cloud.sql.v1beta4.Operation.Builder.class); + } + + /** + * + * + *
+   * The type of Cloud SQL operation.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.Operation.SqlOperationType} + */ + public enum SqlOperationType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown operation type.
+     * 
+ * + * SQL_OPERATION_TYPE_UNSPECIFIED = 0; + */ + SQL_OPERATION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Imports data into a Cloud SQL instance.
+     * 
+ * + * IMPORT = 1; + */ + IMPORT(1), + /** + * + * + *
+     * Exports data from a Cloud SQL instance to a Cloud Storage
+     * bucket.
+     * 
+ * + * EXPORT = 2; + */ + EXPORT(2), + /** + * + * + *
+     * Creates a new Cloud SQL instance.
+     * 
+ * + * CREATE = 3; + */ + CREATE(3), + /** + * + * + *
+     * Updates the settings of a Cloud SQL instance.
+     * 
+ * + * UPDATE = 4; + */ + UPDATE(4), + /** + * + * + *
+     * Deletes a Cloud SQL instance.
+     * 
+ * + * DELETE = 5; + */ + DELETE(5), + /** + * + * + *
+     * Restarts the Cloud SQL instance.
+     * 
+ * + * RESTART = 6; + */ + RESTART(6), + /** BACKUP = 7 [deprecated = true]; */ + @java.lang.Deprecated + BACKUP(7), + /** SNAPSHOT = 8 [deprecated = true]; */ + @java.lang.Deprecated + SNAPSHOT(8), + /** + * + * + *
+     * Performs instance backup.
+     * 
+ * + * BACKUP_VOLUME = 9; + */ + BACKUP_VOLUME(9), + /** + * + * + *
+     * Deletes an instance backup.
+     * 
+ * + * DELETE_VOLUME = 10; + */ + DELETE_VOLUME(10), + /** + * + * + *
+     * Restores an instance backup.
+     * 
+ * + * RESTORE_VOLUME = 11; + */ + RESTORE_VOLUME(11), + /** + * + * + *
+     * Injects a privileged user in mysql for MOB instances.
+     * 
+ * + * INJECT_USER = 12; + */ + INJECT_USER(12), + /** + * + * + *
+     * Clones a Cloud SQL instance.
+     * 
+ * + * CLONE = 14; + */ + CLONE(14), + /** + * + * + *
+     * Stops replication on a Cloud SQL read replica instance.
+     * 
+ * + * STOP_REPLICA = 15; + */ + STOP_REPLICA(15), + /** + * + * + *
+     * Starts replication on a Cloud SQL read replica instance.
+     * 
+ * + * START_REPLICA = 16; + */ + START_REPLICA(16), + /** + * + * + *
+     * Promotes a Cloud SQL replica instance.
+     * 
+ * + * PROMOTE_REPLICA = 17; + */ + PROMOTE_REPLICA(17), + /** + * + * + *
+     * Creates a Cloud SQL replica instance.
+     * 
+ * + * CREATE_REPLICA = 18; + */ + CREATE_REPLICA(18), + /** + * + * + *
+     * Creates a new user in a Cloud SQL instance.
+     * 
+ * + * CREATE_USER = 19; + */ + CREATE_USER(19), + /** + * + * + *
+     * Deletes a user from a Cloud SQL instance.
+     * 
+ * + * DELETE_USER = 20; + */ + DELETE_USER(20), + /** + * + * + *
+     * Updates an existing user in a Cloud SQL instance. If a user with the
+     * specified username doesn't exist, a new user is created.
+     * 
+ * + * UPDATE_USER = 21; + */ + UPDATE_USER(21), + /** + * + * + *
+     * Creates a database in the Cloud SQL instance.
+     * 
+ * + * CREATE_DATABASE = 22; + */ + CREATE_DATABASE(22), + /** + * + * + *
+     * Deletes a database in the Cloud SQL instance.
+     * 
+ * + * DELETE_DATABASE = 23; + */ + DELETE_DATABASE(23), + /** + * + * + *
+     * Updates a database in the Cloud SQL instance.
+     * 
+ * + * UPDATE_DATABASE = 24; + */ + UPDATE_DATABASE(24), + /** + * + * + *
+     * Performs failover of an HA-enabled Cloud SQL
+     * failover replica.
+     * 
+ * + * FAILOVER = 25; + */ + FAILOVER(25), + /** + * + * + *
+     * Deletes the backup taken by a backup run.
+     * 
+ * + * DELETE_BACKUP = 26; + */ + DELETE_BACKUP(26), + /** RECREATE_REPLICA = 27; */ + RECREATE_REPLICA(27), + /** + * + * + *
+     * Truncates a general or slow log table in MySQL.
+     * 
+ * + * TRUNCATE_LOG = 28; + */ + TRUNCATE_LOG(28), + /** + * + * + *
+     * Demotes the stand-alone instance to be a Cloud SQL
+     * read replica for an external database server.
+     * 
+ * + * DEMOTE_MASTER = 29; + */ + DEMOTE_MASTER(29), + /** + * + * + *
+     * Indicates that the instance is currently in maintenance. Maintenance
+     * typically causes the instance to be unavailable for 1-3 minutes.
+     * 
+ * + * MAINTENANCE = 30; + */ + MAINTENANCE(30), + /** + * + * + *
+     * This field is deprecated, and will be removed in future version of API.
+     * 
+ * + * ENABLE_PRIVATE_IP = 31 [deprecated = true]; + */ + @java.lang.Deprecated + ENABLE_PRIVATE_IP(31), + /** DEFER_MAINTENANCE = 32 [deprecated = true]; */ + @java.lang.Deprecated + DEFER_MAINTENANCE(32), + /** + * + * + *
+     * Creates clone instance.
+     * 
+ * + * CREATE_CLONE = 33 [deprecated = true]; + */ + @java.lang.Deprecated + CREATE_CLONE(33), + /** + * + * + *
+     * Reschedule maintenance to another time.
+     * 
+ * + * RESCHEDULE_MAINTENANCE = 34; + */ + RESCHEDULE_MAINTENANCE(34), + /** + * + * + *
+     * Starts external sync of a Cloud SQL EM replica to an external primary
+     * instance.
+     * 
+ * + * START_EXTERNAL_SYNC = 35; + */ + START_EXTERNAL_SYNC(35), + /** + * + * + *
+     * Recovers logs from an instance's old data disk.
+     * 
+ * + * LOG_CLEANUP = 36; + */ + LOG_CLEANUP(36), + /** + * + * + *
+     * Performs auto-restart of an HA-enabled Cloud SQL database for auto
+     * recovery.
+     * 
+ * + * AUTO_RESTART = 37; + */ + AUTO_RESTART(37), + /** + * + * + *
+     * Re-encrypts CMEK instances with latest key version.
+     * 
+ * + * REENCRYPT = 38; + */ + REENCRYPT(38), + /** + * + * + *
+     * Switches the roles of the primary and replica pair. The target instance
+     * should be the replica.
+     * 
+ * + * SWITCHOVER = 39; + */ + SWITCHOVER(39), + /** + * + * + *
+     * Update a backup.
+     * 
+ * + * UPDATE_BACKUP = 40; + */ + UPDATE_BACKUP(40), + /** + * + * + *
+     * Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ * + * ACQUIRE_SSRS_LEASE = 42; + */ + ACQUIRE_SSRS_LEASE(42), + /** + * + * + *
+     * Release a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ * + * RELEASE_SSRS_LEASE = 43; + */ + RELEASE_SSRS_LEASE(43), + /** + * + * + *
+     * Reconfigures old primary after a promote replica operation. Effect of a
+     * promote operation to the old primary is executed in this operation,
+     * asynchronously from the promote replica operation executed to the
+     * replica.
+     * 
+ * + * RECONFIGURE_OLD_PRIMARY = 44; + */ + RECONFIGURE_OLD_PRIMARY(44), + /** + * + * + *
+     * Indicates that the instance, its read replicas, and its cascading
+     * replicas are in maintenance. Maintenance typically gets initiated on
+     * groups of replicas first, followed by the primary instance. For each
+     * instance, maintenance typically causes the instance to be unavailable for
+     * 1-3 minutes.
+     * 
+ * + * CLUSTER_MAINTENANCE = 45 [deprecated = true]; + */ + @java.lang.Deprecated + CLUSTER_MAINTENANCE(45), + /** + * + * + *
+     * Indicates that the instance (and any of its replicas) are currently in
+     * maintenance. This is initiated as a self-service request by using SSM.
+     * Maintenance typically causes the instance to be unavailable for 1-3
+     * minutes.
+     * 
+ * + * SELF_SERVICE_MAINTENANCE = 46 [deprecated = true]; + */ + @java.lang.Deprecated + SELF_SERVICE_MAINTENANCE(46), + /** + * + * + *
+     * Switches a primary instance to a replica. This operation runs as part of
+     * a switchover operation to the original primary instance.
+     * 
+ * + * SWITCHOVER_TO_REPLICA = 47; + */ + SWITCHOVER_TO_REPLICA(47), + /** + * + * + *
+     * Updates the major version of a Cloud SQL instance.
+     * 
+ * + * MAJOR_VERSION_UPGRADE = 48; + */ + MAJOR_VERSION_UPGRADE(48), + /** + * + * + *
+     * Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead.
+     * 
+ * + * ADVANCED_BACKUP = 49 [deprecated = true]; + */ + @java.lang.Deprecated + ADVANCED_BACKUP(49), + /** + * + * + *
+     * Changes the BackupTier of a Cloud SQL instance.
+     * 
+ * + * MANAGE_BACKUP = 50; + */ + MANAGE_BACKUP(50), + /** + * + * + *
+     * Creates a backup for an Enhanced BackupTier Cloud SQL instance.
+     * 
+ * + * ENHANCED_BACKUP = 51; + */ + ENHANCED_BACKUP(51), + /** + * + * + *
+     * Repairs entire read pool or specified read pool nodes in the read pool.
+     * 
+ * + * REPAIR_READ_POOL = 52; + */ + REPAIR_READ_POOL(52), + /** + * + * + *
+     * Creates a Cloud SQL read pool instance.
+     * 
+ * + * CREATE_READ_POOL = 53; + */ + CREATE_READ_POOL(53), + /** + * + * + *
+     * Pre-checks for major version upgrade.
+     * 
+ * + * PRE_CHECK_MAJOR_VERSION_UPGRADE = 54; + */ + PRE_CHECK_MAJOR_VERSION_UPGRADE(54), + /** + * + * + *
+     * This operation type represents individual steps in a multi-step setup
+     * migration workflow: including configuration, replication,
+     * switchover/back, and data reseeding, as defined by operation's intent.
+     * 
+ * + * SETUP_MIGRATION = 58; + */ + SETUP_MIGRATION(58), + /** + * + * + *
+     * Sends a message to a Cloud SQL agent.
+     * 
+ * + * AGENT_SEND_MESSAGE = 59; + */ + AGENT_SEND_MESSAGE(59), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlOperationType"); + } + + /** + * + * + *
+     * Unknown operation type.
+     * 
+ * + * SQL_OPERATION_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_OPERATION_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Imports data into a Cloud SQL instance.
+     * 
+ * + * IMPORT = 1; + */ + public static final int IMPORT_VALUE = 1; + + /** + * + * + *
+     * Exports data from a Cloud SQL instance to a Cloud Storage
+     * bucket.
+     * 
+ * + * EXPORT = 2; + */ + public static final int EXPORT_VALUE = 2; + + /** + * + * + *
+     * Creates a new Cloud SQL instance.
+     * 
+ * + * CREATE = 3; + */ + public static final int CREATE_VALUE = 3; + + /** + * + * + *
+     * Updates the settings of a Cloud SQL instance.
+     * 
+ * + * UPDATE = 4; + */ + public static final int UPDATE_VALUE = 4; + + /** + * + * + *
+     * Deletes a Cloud SQL instance.
+     * 
+ * + * DELETE = 5; + */ + public static final int DELETE_VALUE = 5; + + /** + * + * + *
+     * Restarts the Cloud SQL instance.
+     * 
+ * + * RESTART = 6; + */ + public static final int RESTART_VALUE = 6; + + /** BACKUP = 7 [deprecated = true]; */ + @java.lang.Deprecated public static final int BACKUP_VALUE = 7; + + /** SNAPSHOT = 8 [deprecated = true]; */ + @java.lang.Deprecated public static final int SNAPSHOT_VALUE = 8; + + /** + * + * + *
+     * Performs instance backup.
+     * 
+ * + * BACKUP_VOLUME = 9; + */ + public static final int BACKUP_VOLUME_VALUE = 9; + + /** + * + * + *
+     * Deletes an instance backup.
+     * 
+ * + * DELETE_VOLUME = 10; + */ + public static final int DELETE_VOLUME_VALUE = 10; + + /** + * + * + *
+     * Restores an instance backup.
+     * 
+ * + * RESTORE_VOLUME = 11; + */ + public static final int RESTORE_VOLUME_VALUE = 11; + + /** + * + * + *
+     * Injects a privileged user in mysql for MOB instances.
+     * 
+ * + * INJECT_USER = 12; + */ + public static final int INJECT_USER_VALUE = 12; + + /** + * + * + *
+     * Clones a Cloud SQL instance.
+     * 
+ * + * CLONE = 14; + */ + public static final int CLONE_VALUE = 14; + + /** + * + * + *
+     * Stops replication on a Cloud SQL read replica instance.
+     * 
+ * + * STOP_REPLICA = 15; + */ + public static final int STOP_REPLICA_VALUE = 15; + + /** + * + * + *
+     * Starts replication on a Cloud SQL read replica instance.
+     * 
+ * + * START_REPLICA = 16; + */ + public static final int START_REPLICA_VALUE = 16; + + /** + * + * + *
+     * Promotes a Cloud SQL replica instance.
+     * 
+ * + * PROMOTE_REPLICA = 17; + */ + public static final int PROMOTE_REPLICA_VALUE = 17; + + /** + * + * + *
+     * Creates a Cloud SQL replica instance.
+     * 
+ * + * CREATE_REPLICA = 18; + */ + public static final int CREATE_REPLICA_VALUE = 18; + + /** + * + * + *
+     * Creates a new user in a Cloud SQL instance.
+     * 
+ * + * CREATE_USER = 19; + */ + public static final int CREATE_USER_VALUE = 19; + + /** + * + * + *
+     * Deletes a user from a Cloud SQL instance.
+     * 
+ * + * DELETE_USER = 20; + */ + public static final int DELETE_USER_VALUE = 20; + + /** + * + * + *
+     * Updates an existing user in a Cloud SQL instance. If a user with the
+     * specified username doesn't exist, a new user is created.
+     * 
+ * + * UPDATE_USER = 21; + */ + public static final int UPDATE_USER_VALUE = 21; + + /** + * + * + *
+     * Creates a database in the Cloud SQL instance.
+     * 
+ * + * CREATE_DATABASE = 22; + */ + public static final int CREATE_DATABASE_VALUE = 22; + + /** + * + * + *
+     * Deletes a database in the Cloud SQL instance.
+     * 
+ * + * DELETE_DATABASE = 23; + */ + public static final int DELETE_DATABASE_VALUE = 23; + + /** + * + * + *
+     * Updates a database in the Cloud SQL instance.
+     * 
+ * + * UPDATE_DATABASE = 24; + */ + public static final int UPDATE_DATABASE_VALUE = 24; + + /** + * + * + *
+     * Performs failover of an HA-enabled Cloud SQL
+     * failover replica.
+     * 
+ * + * FAILOVER = 25; + */ + public static final int FAILOVER_VALUE = 25; + + /** + * + * + *
+     * Deletes the backup taken by a backup run.
+     * 
+ * + * DELETE_BACKUP = 26; + */ + public static final int DELETE_BACKUP_VALUE = 26; + + /** RECREATE_REPLICA = 27; */ + public static final int RECREATE_REPLICA_VALUE = 27; + + /** + * + * + *
+     * Truncates a general or slow log table in MySQL.
+     * 
+ * + * TRUNCATE_LOG = 28; + */ + public static final int TRUNCATE_LOG_VALUE = 28; + + /** + * + * + *
+     * Demotes the stand-alone instance to be a Cloud SQL
+     * read replica for an external database server.
+     * 
+ * + * DEMOTE_MASTER = 29; + */ + public static final int DEMOTE_MASTER_VALUE = 29; + + /** + * + * + *
+     * Indicates that the instance is currently in maintenance. Maintenance
+     * typically causes the instance to be unavailable for 1-3 minutes.
+     * 
+ * + * MAINTENANCE = 30; + */ + public static final int MAINTENANCE_VALUE = 30; + + /** + * + * + *
+     * This field is deprecated, and will be removed in future version of API.
+     * 
+ * + * ENABLE_PRIVATE_IP = 31 [deprecated = true]; + */ + @java.lang.Deprecated public static final int ENABLE_PRIVATE_IP_VALUE = 31; + + /** DEFER_MAINTENANCE = 32 [deprecated = true]; */ + @java.lang.Deprecated public static final int DEFER_MAINTENANCE_VALUE = 32; + + /** + * + * + *
+     * Creates clone instance.
+     * 
+ * + * CREATE_CLONE = 33 [deprecated = true]; + */ + @java.lang.Deprecated public static final int CREATE_CLONE_VALUE = 33; + + /** + * + * + *
+     * Reschedule maintenance to another time.
+     * 
+ * + * RESCHEDULE_MAINTENANCE = 34; + */ + public static final int RESCHEDULE_MAINTENANCE_VALUE = 34; + + /** + * + * + *
+     * Starts external sync of a Cloud SQL EM replica to an external primary
+     * instance.
+     * 
+ * + * START_EXTERNAL_SYNC = 35; + */ + public static final int START_EXTERNAL_SYNC_VALUE = 35; + + /** + * + * + *
+     * Recovers logs from an instance's old data disk.
+     * 
+ * + * LOG_CLEANUP = 36; + */ + public static final int LOG_CLEANUP_VALUE = 36; + + /** + * + * + *
+     * Performs auto-restart of an HA-enabled Cloud SQL database for auto
+     * recovery.
+     * 
+ * + * AUTO_RESTART = 37; + */ + public static final int AUTO_RESTART_VALUE = 37; + + /** + * + * + *
+     * Re-encrypts CMEK instances with latest key version.
+     * 
+ * + * REENCRYPT = 38; + */ + public static final int REENCRYPT_VALUE = 38; + + /** + * + * + *
+     * Switches the roles of the primary and replica pair. The target instance
+     * should be the replica.
+     * 
+ * + * SWITCHOVER = 39; + */ + public static final int SWITCHOVER_VALUE = 39; + + /** + * + * + *
+     * Update a backup.
+     * 
+ * + * UPDATE_BACKUP = 40; + */ + public static final int UPDATE_BACKUP_VALUE = 40; + + /** + * + * + *
+     * Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ * + * ACQUIRE_SSRS_LEASE = 42; + */ + public static final int ACQUIRE_SSRS_LEASE_VALUE = 42; + + /** + * + * + *
+     * Release a lease for the setup of SQL Server Reporting Services (SSRS).
+     * 
+ * + * RELEASE_SSRS_LEASE = 43; + */ + public static final int RELEASE_SSRS_LEASE_VALUE = 43; + + /** + * + * + *
+     * Reconfigures old primary after a promote replica operation. Effect of a
+     * promote operation to the old primary is executed in this operation,
+     * asynchronously from the promote replica operation executed to the
+     * replica.
+     * 
+ * + * RECONFIGURE_OLD_PRIMARY = 44; + */ + public static final int RECONFIGURE_OLD_PRIMARY_VALUE = 44; + + /** + * + * + *
+     * Indicates that the instance, its read replicas, and its cascading
+     * replicas are in maintenance. Maintenance typically gets initiated on
+     * groups of replicas first, followed by the primary instance. For each
+     * instance, maintenance typically causes the instance to be unavailable for
+     * 1-3 minutes.
+     * 
+ * + * CLUSTER_MAINTENANCE = 45 [deprecated = true]; + */ + @java.lang.Deprecated public static final int CLUSTER_MAINTENANCE_VALUE = 45; + + /** + * + * + *
+     * Indicates that the instance (and any of its replicas) are currently in
+     * maintenance. This is initiated as a self-service request by using SSM.
+     * Maintenance typically causes the instance to be unavailable for 1-3
+     * minutes.
+     * 
+ * + * SELF_SERVICE_MAINTENANCE = 46 [deprecated = true]; + */ + @java.lang.Deprecated public static final int SELF_SERVICE_MAINTENANCE_VALUE = 46; + + /** + * + * + *
+     * Switches a primary instance to a replica. This operation runs as part of
+     * a switchover operation to the original primary instance.
+     * 
+ * + * SWITCHOVER_TO_REPLICA = 47; + */ + public static final int SWITCHOVER_TO_REPLICA_VALUE = 47; + + /** + * + * + *
+     * Updates the major version of a Cloud SQL instance.
+     * 
+ * + * MAJOR_VERSION_UPGRADE = 48; + */ + public static final int MAJOR_VERSION_UPGRADE_VALUE = 48; + + /** + * + * + *
+     * Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead.
+     * 
+ * + * ADVANCED_BACKUP = 49 [deprecated = true]; + */ + @java.lang.Deprecated public static final int ADVANCED_BACKUP_VALUE = 49; + + /** + * + * + *
+     * Changes the BackupTier of a Cloud SQL instance.
+     * 
+ * + * MANAGE_BACKUP = 50; + */ + public static final int MANAGE_BACKUP_VALUE = 50; + + /** + * + * + *
+     * Creates a backup for an Enhanced BackupTier Cloud SQL instance.
+     * 
+ * + * ENHANCED_BACKUP = 51; + */ + public static final int ENHANCED_BACKUP_VALUE = 51; + + /** + * + * + *
+     * Repairs entire read pool or specified read pool nodes in the read pool.
+     * 
+ * + * REPAIR_READ_POOL = 52; + */ + public static final int REPAIR_READ_POOL_VALUE = 52; + + /** + * + * + *
+     * Creates a Cloud SQL read pool instance.
+     * 
+ * + * CREATE_READ_POOL = 53; + */ + public static final int CREATE_READ_POOL_VALUE = 53; + + /** + * + * + *
+     * Pre-checks for major version upgrade.
+     * 
+ * + * PRE_CHECK_MAJOR_VERSION_UPGRADE = 54; + */ + public static final int PRE_CHECK_MAJOR_VERSION_UPGRADE_VALUE = 54; + + /** + * + * + *
+     * This operation type represents individual steps in a multi-step setup
+     * migration workflow: including configuration, replication,
+     * switchover/back, and data reseeding, as defined by operation's intent.
+     * 
+ * + * SETUP_MIGRATION = 58; + */ + public static final int SETUP_MIGRATION_VALUE = 58; + + /** + * + * + *
+     * Sends a message to a Cloud SQL agent.
+     * 
+ * + * AGENT_SEND_MESSAGE = 59; + */ + public static final int AGENT_SEND_MESSAGE_VALUE = 59; + + 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 SqlOperationType 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 SqlOperationType forNumber(int value) { + switch (value) { + case 0: + return SQL_OPERATION_TYPE_UNSPECIFIED; + case 1: + return IMPORT; + case 2: + return EXPORT; + case 3: + return CREATE; + case 4: + return UPDATE; + case 5: + return DELETE; + case 6: + return RESTART; + case 7: + return BACKUP; + case 8: + return SNAPSHOT; + case 9: + return BACKUP_VOLUME; + case 10: + return DELETE_VOLUME; + case 11: + return RESTORE_VOLUME; + case 12: + return INJECT_USER; + case 14: + return CLONE; + case 15: + return STOP_REPLICA; + case 16: + return START_REPLICA; + case 17: + return PROMOTE_REPLICA; + case 18: + return CREATE_REPLICA; + case 19: + return CREATE_USER; + case 20: + return DELETE_USER; + case 21: + return UPDATE_USER; + case 22: + return CREATE_DATABASE; + case 23: + return DELETE_DATABASE; + case 24: + return UPDATE_DATABASE; + case 25: + return FAILOVER; + case 26: + return DELETE_BACKUP; + case 27: + return RECREATE_REPLICA; + case 28: + return TRUNCATE_LOG; + case 29: + return DEMOTE_MASTER; + case 30: + return MAINTENANCE; + case 31: + return ENABLE_PRIVATE_IP; + case 32: + return DEFER_MAINTENANCE; + case 33: + return CREATE_CLONE; + case 34: + return RESCHEDULE_MAINTENANCE; + case 35: + return START_EXTERNAL_SYNC; + case 36: + return LOG_CLEANUP; + case 37: + return AUTO_RESTART; + case 38: + return REENCRYPT; + case 39: + return SWITCHOVER; + case 40: + return UPDATE_BACKUP; + case 42: + return ACQUIRE_SSRS_LEASE; + case 43: + return RELEASE_SSRS_LEASE; + case 44: + return RECONFIGURE_OLD_PRIMARY; + case 45: + return CLUSTER_MAINTENANCE; + case 46: + return SELF_SERVICE_MAINTENANCE; + case 47: + return SWITCHOVER_TO_REPLICA; + case 48: + return MAJOR_VERSION_UPGRADE; + case 49: + return ADVANCED_BACKUP; + case 50: + return MANAGE_BACKUP; + case 51: + return ENHANCED_BACKUP; + case 52: + return REPAIR_READ_POOL; + case 53: + return CREATE_READ_POOL; + case 54: + return PRE_CHECK_MAJOR_VERSION_UPGRADE; + case 58: + return SETUP_MIGRATION; + case 59: + return AGENT_SEND_MESSAGE; + 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 SqlOperationType findValueByNumber(int number) { + return SqlOperationType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.Operation.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlOperationType[] VALUES = values(); + + public static SqlOperationType 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 SqlOperationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.Operation.SqlOperationType) + } + + /** + * + * + *
+   * The status of an operation.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.Operation.SqlOperationStatus} + */ + public enum SqlOperationStatus implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the operation is unknown.
+     * 
+ * + * SQL_OPERATION_STATUS_UNSPECIFIED = 0; + */ + SQL_OPERATION_STATUS_UNSPECIFIED(0), + /** + * + * + *
+     * The operation has been queued, but has not started yet.
+     * 
+ * + * PENDING = 1; + */ + PENDING(1), + /** + * + * + *
+     * The operation is running.
+     * 
+ * + * RUNNING = 2; + */ + RUNNING(2), + /** + * + * + *
+     * The operation completed.
+     * 
+ * + * DONE = 3; + */ + DONE(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlOperationStatus"); + } + + /** + * + * + *
+     * The state of the operation is unknown.
+     * 
+ * + * SQL_OPERATION_STATUS_UNSPECIFIED = 0; + */ + public static final int SQL_OPERATION_STATUS_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The operation has been queued, but has not started yet.
+     * 
+ * + * PENDING = 1; + */ + public static final int PENDING_VALUE = 1; + + /** + * + * + *
+     * The operation is running.
+     * 
+ * + * RUNNING = 2; + */ + public static final int RUNNING_VALUE = 2; + + /** + * + * + *
+     * The operation completed.
+     * 
+ * + * DONE = 3; + */ + public static final int DONE_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 SqlOperationStatus 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 SqlOperationStatus forNumber(int value) { + switch (value) { + case 0: + return SQL_OPERATION_STATUS_UNSPECIFIED; + case 1: + return PENDING; + case 2: + return RUNNING; + case 3: + return DONE; + 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 SqlOperationStatus findValueByNumber(int number) { + return SqlOperationStatus.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.Operation.getDescriptor().getEnumTypes().get(1); + } + + private static final SqlOperationStatus[] VALUES = values(); + + public static SqlOperationStatus 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 SqlOperationStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.Operation.SqlOperationStatus) + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#operation`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#operation`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_LINK_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object targetLink_ = ""; + + /** + * string target_link = 2; + * + * @return The targetLink. + */ + @java.lang.Override + public java.lang.String getTargetLink() { + java.lang.Object ref = targetLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetLink_ = s; + return s; + } + } + + /** + * string target_link = 2; + * + * @return The bytes for targetLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetLinkBytes() { + java.lang.Object ref = targetLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 3; + private int status_ = 0; + + /** + * + * + *
+   * The status of an operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationStatus status = 3; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
+   * The status of an operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationStatus status = 3; + * + * @return The status. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Operation.SqlOperationStatus getStatus() { + com.google.cloud.sql.v1beta4.Operation.SqlOperationStatus result = + com.google.cloud.sql.v1beta4.Operation.SqlOperationStatus.forNumber(status_); + return result == null + ? com.google.cloud.sql.v1beta4.Operation.SqlOperationStatus.UNRECOGNIZED + : result; + } + + public static final int USER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object user_ = ""; + + /** + * + * + *
+   * The email address of the user who initiated this operation.
+   * 
+ * + * string user = 4; + * + * @return The user. + */ + @java.lang.Override + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } + } + + /** + * + * + *
+   * The email address of the user who initiated this operation.
+   * 
+ * + * string user = 4; + * + * @return The bytes for user. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSERT_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp insertTime_; + + /** + * + * + *
+   * The time this operation was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + * + * @return Whether the insertTime field is set. + */ + @java.lang.Override + public boolean hasInsertTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time this operation was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + * + * @return The insertTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getInsertTime() { + return insertTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : insertTime_; + } + + /** + * + * + *
+   * The time this operation was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getInsertTimeOrBuilder() { + return insertTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : insertTime_; + } + + public static final int START_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The time this operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time this operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The time this operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * The time this operation finished in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The time this operation finished in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * The time this operation finished in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int ERROR_FIELD_NUMBER = 8; + private com.google.cloud.sql.v1beta4.OperationErrors error_; + + /** + * + * + *
+   * If errors occurred during processing of this operation, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * If errors occurred during processing of this operation, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + * + * @return The error. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationErrors getError() { + return error_ == null + ? com.google.cloud.sql.v1beta4.OperationErrors.getDefaultInstance() + : error_; + } + + /** + * + * + *
+   * If errors occurred during processing of this operation, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationErrorsOrBuilder getErrorOrBuilder() { + return error_ == null + ? com.google.cloud.sql.v1beta4.OperationErrors.getDefaultInstance() + : error_; + } + + public static final int API_WARNING_FIELD_NUMBER = 19; + private com.google.cloud.sql.v1beta4.ApiWarning apiWarning_; + + /** + * + * + *
+   * An Admin API warning message.
+   * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + * + * @return Whether the apiWarning field is set. + */ + @java.lang.Override + public boolean hasApiWarning() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * An Admin API warning message.
+   * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + * + * @return The apiWarning. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ApiWarning getApiWarning() { + return apiWarning_ == null + ? com.google.cloud.sql.v1beta4.ApiWarning.getDefaultInstance() + : apiWarning_; + } + + /** + * + * + *
+   * An Admin API warning message.
+   * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ApiWarningOrBuilder getApiWarningOrBuilder() { + return apiWarning_ == null + ? com.google.cloud.sql.v1beta4.ApiWarning.getDefaultInstance() + : apiWarning_; + } + + public static final int OPERATION_TYPE_FIELD_NUMBER = 9; + private int operationType_ = 0; + + /** + * + * + *
+   * The type of the operation. Valid values are:
+   * *  `CREATE`
+   * *  `DELETE`
+   * *  `UPDATE`
+   * *  `RESTART`
+   * *  `IMPORT`
+   * *  `EXPORT`
+   * *  `BACKUP_VOLUME`
+   * *  `RESTORE_VOLUME`
+   * *  `CREATE_USER`
+   * *  `DELETE_USER`
+   * *  `CREATE_DATABASE`
+   * *  `DELETE_DATABASE`
+   * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationType operation_type = 9; + * + * @return The enum numeric value on the wire for operationType. + */ + @java.lang.Override + public int getOperationTypeValue() { + return operationType_; + } + + /** + * + * + *
+   * The type of the operation. Valid values are:
+   * *  `CREATE`
+   * *  `DELETE`
+   * *  `UPDATE`
+   * *  `RESTART`
+   * *  `IMPORT`
+   * *  `EXPORT`
+   * *  `BACKUP_VOLUME`
+   * *  `RESTORE_VOLUME`
+   * *  `CREATE_USER`
+   * *  `DELETE_USER`
+   * *  `CREATE_DATABASE`
+   * *  `DELETE_DATABASE`
+   * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationType operation_type = 9; + * + * @return The operationType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Operation.SqlOperationType getOperationType() { + com.google.cloud.sql.v1beta4.Operation.SqlOperationType result = + com.google.cloud.sql.v1beta4.Operation.SqlOperationType.forNumber(operationType_); + return result == null + ? com.google.cloud.sql.v1beta4.Operation.SqlOperationType.UNRECOGNIZED + : result; + } + + public static final int IMPORT_CONTEXT_FIELD_NUMBER = 10; + private com.google.cloud.sql.v1beta4.ImportContext importContext_; + + /** + * + * + *
+   * The context for import operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + * + * @return Whether the importContext field is set. + */ + @java.lang.Override + public boolean hasImportContext() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * The context for import operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + * + * @return The importContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContext getImportContext() { + return importContext_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.getDefaultInstance() + : importContext_; + } + + /** + * + * + *
+   * The context for import operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ImportContextOrBuilder getImportContextOrBuilder() { + return importContext_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.getDefaultInstance() + : importContext_; + } + + public static final int EXPORT_CONTEXT_FIELD_NUMBER = 11; + private com.google.cloud.sql.v1beta4.ExportContext exportContext_; + + /** + * + * + *
+   * The context for export operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + * + * @return Whether the exportContext field is set. + */ + @java.lang.Override + public boolean hasExportContext() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * The context for export operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + * + * @return The exportContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContext getExportContext() { + return exportContext_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.getDefaultInstance() + : exportContext_; + } + + /** + * + * + *
+   * The context for export operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExportContextOrBuilder getExportContextOrBuilder() { + return exportContext_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.getDefaultInstance() + : exportContext_; + } + + public static final int BACKUP_CONTEXT_FIELD_NUMBER = 17; + private com.google.cloud.sql.v1beta4.BackupContext backupContext_; + + /** + * + * + *
+   * The context for backup operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + * + * @return Whether the backupContext field is set. + */ + @java.lang.Override + public boolean hasBackupContext() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * The context for backup operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + * + * @return The backupContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupContext getBackupContext() { + return backupContext_ == null + ? com.google.cloud.sql.v1beta4.BackupContext.getDefaultInstance() + : backupContext_; + } + + /** + * + * + *
+   * The context for backup operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupContextOrBuilder getBackupContextOrBuilder() { + return backupContext_ == null + ? com.google.cloud.sql.v1beta4.BackupContext.getDefaultInstance() + : backupContext_; + } + + public static final int PRE_CHECK_MAJOR_VERSION_UPGRADE_CONTEXT_FIELD_NUMBER = 50; + private com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + preCheckMajorVersionUpgradeContext_; + + /** + * + * + *
+   * The context for pre-check major version upgrade operation, if applicable.
+   * This field is only populated when the operation_type is
+   * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+   * The PreCheckMajorVersionUpgradeContext message itself contains the details
+   * for that pre-check, such as the target database version for the upgrade
+   * and the results of the check (including any warnings or errors found).
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + * + * @return Whether the preCheckMajorVersionUpgradeContext field is set. + */ + @java.lang.Override + public boolean hasPreCheckMajorVersionUpgradeContext() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+   * The context for pre-check major version upgrade operation, if applicable.
+   * This field is only populated when the operation_type is
+   * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+   * The PreCheckMajorVersionUpgradeContext message itself contains the details
+   * for that pre-check, such as the target database version for the upgrade
+   * and the results of the check (including any warnings or errors found).
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + * + * @return The preCheckMajorVersionUpgradeContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + getPreCheckMajorVersionUpgradeContext() { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } + + /** + * + * + *
+   * The context for pre-check major version upgrade operation, if applicable.
+   * This field is only populated when the operation_type is
+   * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+   * The PreCheckMajorVersionUpgradeContext message itself contains the details
+   * for that pre-check, such as the target database version for the upgrade
+   * and the results of the check (including any warnings or errors found).
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContextOrBuilder + getPreCheckMajorVersionUpgradeContextOrBuilder() { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } + + public static final int NAME_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * An identifier that uniquely identifies the operation. You can use this
+   * identifier to retrieve the Operations resource that has information about
+   * the operation.
+   * 
+ * + * string name = 12; + * + * @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; + } + } + + /** + * + * + *
+   * An identifier that uniquely identifies the operation. You can use this
+   * identifier to retrieve the Operations resource that has information about
+   * the operation.
+   * 
+ * + * string name = 12; + * + * @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 TARGET_ID_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private volatile java.lang.Object targetId_ = ""; + + /** + * + * + *
+   * Name of the resource on which this operation runs.
+   * 
+ * + * string target_id = 13; + * + * @return The targetId. + */ + @java.lang.Override + public java.lang.String getTargetId() { + java.lang.Object ref = targetId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetId_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the resource on which this operation runs.
+   * 
+ * + * string target_id = 13; + * + * @return The bytes for targetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetIdBytes() { + java.lang.Object ref = targetId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELF_LINK_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object selfLink_ = ""; + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 14; + * + * @return The selfLink. + */ + @java.lang.Override + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } + } + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 14; + * + * @return The bytes for selfLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_PROJECT_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object targetProject_ = ""; + + /** + * + * + *
+   * The project ID of the target instance related to this operation.
+   * 
+ * + * string target_project = 15; + * + * @return The targetProject. + */ + @java.lang.Override + public java.lang.String getTargetProject() { + java.lang.Object ref = targetProject_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetProject_ = s; + return s; + } + } + + /** + * + * + *
+   * The project ID of the target instance related to this operation.
+   * 
+ * + * string target_project = 15; + * + * @return The bytes for targetProject. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetProjectBytes() { + java.lang.Object ref = targetProject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACQUIRE_SSRS_LEASE_CONTEXT_FIELD_NUMBER = 20; + private com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquireSsrsLeaseContext_; + + /** + * + * + *
+   * The context for acquire SSRS lease operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + * @return Whether the acquireSsrsLeaseContext field is set. + */ + @java.lang.Override + public boolean hasAcquireSsrsLeaseContext() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+   * The context for acquire SSRS lease operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + * @return The acquireSsrsLeaseContext. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext getAcquireSsrsLeaseContext() { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } + + /** + * + * + *
+   * The context for acquire SSRS lease operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContextOrBuilder + getAcquireSsrsLeaseContextOrBuilder() { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } + + public static final int SUB_OPERATION_TYPE_FIELD_NUMBER = 48; + private com.google.cloud.sql.v1beta4.SqlSubOperationType subOperationType_; + + /** + * + * + *
+   * Optional. The sub operation based on the operation type.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the subOperationType field is set. + */ + @java.lang.Override + public boolean hasSubOperationType() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+   * Optional. The sub operation based on the operation type.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The subOperationType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSubOperationType getSubOperationType() { + return subOperationType_ == null + ? com.google.cloud.sql.v1beta4.SqlSubOperationType.getDefaultInstance() + : subOperationType_; + } + + /** + * + * + *
+   * Optional. The sub operation based on the operation type.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSubOperationTypeOrBuilder getSubOperationTypeOrBuilder() { + return subOperationType_ == null + ? com.google.cloud.sql.v1beta4.SqlSubOperationType.getDefaultInstance() + : subOperationType_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(targetLink_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, targetLink_); + } + if (status_ + != com.google.cloud.sql.v1beta4.Operation.SqlOperationStatus + .SQL_OPERATION_STATUS_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, status_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(user_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, user_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getInsertTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(7, getEndTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(8, getError()); + } + if (operationType_ + != com.google.cloud.sql.v1beta4.Operation.SqlOperationType.SQL_OPERATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, operationType_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(10, getImportContext()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(11, getExportContext()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(targetId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 13, targetId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 14, selfLink_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(targetProject_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 15, targetProject_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(17, getBackupContext()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(19, getApiWarning()); + } + if (((bitField0_ & 0x00000200) != 0)) { + output.writeMessage(20, getAcquireSsrsLeaseContext()); + } + if (((bitField0_ & 0x00000400) != 0)) { + output.writeMessage(48, getSubOperationType()); + } + if (((bitField0_ & 0x00000100) != 0)) { + output.writeMessage(50, getPreCheckMajorVersionUpgradeContext()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(targetLink_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, targetLink_); + } + if (status_ + != com.google.cloud.sql.v1beta4.Operation.SqlOperationStatus + .SQL_OPERATION_STATUS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, status_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(user_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, user_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getInsertTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getEndTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getError()); + } + if (operationType_ + != com.google.cloud.sql.v1beta4.Operation.SqlOperationType.SQL_OPERATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, operationType_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getImportContext()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getExportContext()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(targetId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(13, targetId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(14, selfLink_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(targetProject_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(15, targetProject_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getBackupContext()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getApiWarning()); + } + if (((bitField0_ & 0x00000200) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 20, getAcquireSsrsLeaseContext()); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(48, getSubOperationType()); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 50, getPreCheckMajorVersionUpgradeContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.Operation)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.Operation other = (com.google.cloud.sql.v1beta4.Operation) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getTargetLink().equals(other.getTargetLink())) return false; + if (status_ != other.status_) return false; + if (!getUser().equals(other.getUser())) return false; + if (hasInsertTime() != other.hasInsertTime()) return false; + if (hasInsertTime()) { + if (!getInsertTime().equals(other.getInsertTime())) return false; + } + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (hasApiWarning() != other.hasApiWarning()) return false; + if (hasApiWarning()) { + if (!getApiWarning().equals(other.getApiWarning())) return false; + } + if (operationType_ != other.operationType_) return false; + if (hasImportContext() != other.hasImportContext()) return false; + if (hasImportContext()) { + if (!getImportContext().equals(other.getImportContext())) return false; + } + if (hasExportContext() != other.hasExportContext()) return false; + if (hasExportContext()) { + if (!getExportContext().equals(other.getExportContext())) return false; + } + if (hasBackupContext() != other.hasBackupContext()) return false; + if (hasBackupContext()) { + if (!getBackupContext().equals(other.getBackupContext())) return false; + } + if (hasPreCheckMajorVersionUpgradeContext() != other.hasPreCheckMajorVersionUpgradeContext()) + return false; + if (hasPreCheckMajorVersionUpgradeContext()) { + if (!getPreCheckMajorVersionUpgradeContext() + .equals(other.getPreCheckMajorVersionUpgradeContext())) return false; + } + if (!getName().equals(other.getName())) return false; + if (!getTargetId().equals(other.getTargetId())) return false; + if (!getSelfLink().equals(other.getSelfLink())) return false; + if (!getTargetProject().equals(other.getTargetProject())) return false; + if (hasAcquireSsrsLeaseContext() != other.hasAcquireSsrsLeaseContext()) return false; + if (hasAcquireSsrsLeaseContext()) { + if (!getAcquireSsrsLeaseContext().equals(other.getAcquireSsrsLeaseContext())) return false; + } + if (hasSubOperationType() != other.hasSubOperationType()) return false; + if (hasSubOperationType()) { + if (!getSubOperationType().equals(other.getSubOperationType())) return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + TARGET_LINK_FIELD_NUMBER; + hash = (53 * hash) + getTargetLink().hashCode(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + if (hasInsertTime()) { + hash = (37 * hash) + INSERT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getInsertTime().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + if (hasApiWarning()) { + hash = (37 * hash) + API_WARNING_FIELD_NUMBER; + hash = (53 * hash) + getApiWarning().hashCode(); + } + hash = (37 * hash) + OPERATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + operationType_; + if (hasImportContext()) { + hash = (37 * hash) + IMPORT_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getImportContext().hashCode(); + } + if (hasExportContext()) { + hash = (37 * hash) + EXPORT_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getExportContext().hashCode(); + } + if (hasBackupContext()) { + hash = (37 * hash) + BACKUP_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getBackupContext().hashCode(); + } + if (hasPreCheckMajorVersionUpgradeContext()) { + hash = (37 * hash) + PRE_CHECK_MAJOR_VERSION_UPGRADE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getPreCheckMajorVersionUpgradeContext().hashCode(); + } + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TARGET_ID_FIELD_NUMBER; + hash = (53 * hash) + getTargetId().hashCode(); + hash = (37 * hash) + SELF_LINK_FIELD_NUMBER; + hash = (53 * hash) + getSelfLink().hashCode(); + hash = (37 * hash) + TARGET_PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getTargetProject().hashCode(); + if (hasAcquireSsrsLeaseContext()) { + hash = (37 * hash) + ACQUIRE_SSRS_LEASE_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getAcquireSsrsLeaseContext().hashCode(); + } + if (hasSubOperationType()) { + hash = (37 * hash) + SUB_OPERATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getSubOperationType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.Operation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Operation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Operation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Operation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Operation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Operation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Operation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Operation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Operation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Operation parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Operation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Operation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.Operation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * An Operation resource.&nbsp;For successful operations that return an
+   * Operation resource, only the fields relevant to the operation are populated
+   * in the resource.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Operation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.Operation) + com.google.cloud.sql.v1beta4.OperationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Operation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Operation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Operation.class, + com.google.cloud.sql.v1beta4.Operation.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.Operation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetInsertTimeFieldBuilder(); + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + internalGetErrorFieldBuilder(); + internalGetApiWarningFieldBuilder(); + internalGetImportContextFieldBuilder(); + internalGetExportContextFieldBuilder(); + internalGetBackupContextFieldBuilder(); + internalGetPreCheckMajorVersionUpgradeContextFieldBuilder(); + internalGetAcquireSsrsLeaseContextFieldBuilder(); + internalGetSubOperationTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + targetLink_ = ""; + status_ = 0; + user_ = ""; + insertTime_ = null; + if (insertTimeBuilder_ != null) { + insertTimeBuilder_.dispose(); + insertTimeBuilder_ = null; + } + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + apiWarning_ = null; + if (apiWarningBuilder_ != null) { + apiWarningBuilder_.dispose(); + apiWarningBuilder_ = null; + } + operationType_ = 0; + importContext_ = null; + if (importContextBuilder_ != null) { + importContextBuilder_.dispose(); + importContextBuilder_ = null; + } + exportContext_ = null; + if (exportContextBuilder_ != null) { + exportContextBuilder_.dispose(); + exportContextBuilder_ = null; + } + backupContext_ = null; + if (backupContextBuilder_ != null) { + backupContextBuilder_.dispose(); + backupContextBuilder_ = null; + } + preCheckMajorVersionUpgradeContext_ = null; + if (preCheckMajorVersionUpgradeContextBuilder_ != null) { + preCheckMajorVersionUpgradeContextBuilder_.dispose(); + preCheckMajorVersionUpgradeContextBuilder_ = null; + } + name_ = ""; + targetId_ = ""; + selfLink_ = ""; + targetProject_ = ""; + acquireSsrsLeaseContext_ = null; + if (acquireSsrsLeaseContextBuilder_ != null) { + acquireSsrsLeaseContextBuilder_.dispose(); + acquireSsrsLeaseContextBuilder_ = null; + } + subOperationType_ = null; + if (subOperationTypeBuilder_ != null) { + subOperationTypeBuilder_.dispose(); + subOperationTypeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Operation_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Operation getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.Operation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Operation build() { + com.google.cloud.sql.v1beta4.Operation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Operation buildPartial() { + com.google.cloud.sql.v1beta4.Operation result = + new com.google.cloud.sql.v1beta4.Operation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.Operation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.targetLink_ = targetLink_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.status_ = status_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.user_ = user_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.insertTime_ = insertTimeBuilder_ == null ? insertTime_ : insertTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.apiWarning_ = apiWarningBuilder_ == null ? apiWarning_ : apiWarningBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.operationType_ = operationType_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.importContext_ = + importContextBuilder_ == null ? importContext_ : importContextBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.exportContext_ = + exportContextBuilder_ == null ? exportContext_ : exportContextBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.backupContext_ = + backupContextBuilder_ == null ? backupContext_ : backupContextBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.preCheckMajorVersionUpgradeContext_ = + preCheckMajorVersionUpgradeContextBuilder_ == null + ? preCheckMajorVersionUpgradeContext_ + : preCheckMajorVersionUpgradeContextBuilder_.build(); + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.targetId_ = targetId_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.selfLink_ = selfLink_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.targetProject_ = targetProject_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.acquireSsrsLeaseContext_ = + acquireSsrsLeaseContextBuilder_ == null + ? acquireSsrsLeaseContext_ + : acquireSsrsLeaseContextBuilder_.build(); + to_bitField0_ |= 0x00000200; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.subOperationType_ = + subOperationTypeBuilder_ == null ? subOperationType_ : subOperationTypeBuilder_.build(); + to_bitField0_ |= 0x00000400; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.Operation) { + return mergeFrom((com.google.cloud.sql.v1beta4.Operation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.Operation other) { + if (other == com.google.cloud.sql.v1beta4.Operation.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTargetLink().isEmpty()) { + targetLink_ = other.targetLink_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + if (!other.getUser().isEmpty()) { + user_ = other.user_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasInsertTime()) { + mergeInsertTime(other.getInsertTime()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (other.hasApiWarning()) { + mergeApiWarning(other.getApiWarning()); + } + if (other.operationType_ != 0) { + setOperationTypeValue(other.getOperationTypeValue()); + } + if (other.hasImportContext()) { + mergeImportContext(other.getImportContext()); + } + if (other.hasExportContext()) { + mergeExportContext(other.getExportContext()); + } + if (other.hasBackupContext()) { + mergeBackupContext(other.getBackupContext()); + } + if (other.hasPreCheckMajorVersionUpgradeContext()) { + mergePreCheckMajorVersionUpgradeContext(other.getPreCheckMajorVersionUpgradeContext()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00004000; + onChanged(); + } + if (!other.getTargetId().isEmpty()) { + targetId_ = other.targetId_; + bitField0_ |= 0x00008000; + onChanged(); + } + if (!other.getSelfLink().isEmpty()) { + selfLink_ = other.selfLink_; + bitField0_ |= 0x00010000; + onChanged(); + } + if (!other.getTargetProject().isEmpty()) { + targetProject_ = other.targetProject_; + bitField0_ |= 0x00020000; + onChanged(); + } + if (other.hasAcquireSsrsLeaseContext()) { + mergeAcquireSsrsLeaseContext(other.getAcquireSsrsLeaseContext()); + } + if (other.hasSubOperationType()) { + mergeSubOperationType(other.getSubOperationType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + targetLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + status_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + user_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetInsertTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: + { + operationType_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 72 + case 82: + { + input.readMessage( + internalGetImportContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 82 + case 90: + { + input.readMessage( + internalGetExportContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 90 + case 98: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 98 + case 106: + { + targetId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 106 + case 114: + { + selfLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00010000; + break; + } // case 114 + case 122: + { + targetProject_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00020000; + break; + } // case 122 + case 138: + { + input.readMessage( + internalGetBackupContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 138 + case 154: + { + input.readMessage( + internalGetApiWarningFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 154 + case 162: + { + input.readMessage( + internalGetAcquireSsrsLeaseContextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 162 + case 386: + { + input.readMessage( + internalGetSubOperationTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 386 + case 402: + { + input.readMessage( + internalGetPreCheckMajorVersionUpgradeContextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 402 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#operation`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operation`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operation`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operation`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operation`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object targetLink_ = ""; + + /** + * string target_link = 2; + * + * @return The targetLink. + */ + public java.lang.String getTargetLink() { + java.lang.Object ref = targetLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string target_link = 2; + * + * @return The bytes for targetLink. + */ + public com.google.protobuf.ByteString getTargetLinkBytes() { + java.lang.Object ref = targetLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string target_link = 2; + * + * @param value The targetLink to set. + * @return This builder for chaining. + */ + public Builder setTargetLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetLink_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string target_link = 2; + * + * @return This builder for chaining. + */ + public Builder clearTargetLink() { + targetLink_ = getDefaultInstance().getTargetLink(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string target_link = 2; + * + * @param value The bytes for targetLink to set. + * @return This builder for chaining. + */ + public Builder setTargetLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetLink_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int status_ = 0; + + /** + * + * + *
+     * The status of an operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationStatus status = 3; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
+     * The status of an operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationStatus status = 3; + * + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + status_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The status of an operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationStatus status = 3; + * + * @return The status. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Operation.SqlOperationStatus getStatus() { + com.google.cloud.sql.v1beta4.Operation.SqlOperationStatus result = + com.google.cloud.sql.v1beta4.Operation.SqlOperationStatus.forNumber(status_); + return result == null + ? com.google.cloud.sql.v1beta4.Operation.SqlOperationStatus.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The status of an operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationStatus status = 3; + * + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(com.google.cloud.sql.v1beta4.Operation.SqlOperationStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + status_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The status of an operation.
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationStatus status = 3; + * + * @return This builder for chaining. + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + status_ = 0; + onChanged(); + return this; + } + + private java.lang.Object user_ = ""; + + /** + * + * + *
+     * The email address of the user who initiated this operation.
+     * 
+ * + * string user = 4; + * + * @return The user. + */ + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The email address of the user who initiated this operation.
+     * 
+ * + * string user = 4; + * + * @return The bytes for user. + */ + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The email address of the user who initiated this operation.
+     * 
+ * + * string user = 4; + * + * @param value The user to set. + * @return This builder for chaining. + */ + public Builder setUser(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The email address of the user who initiated this operation.
+     * 
+ * + * string user = 4; + * + * @return This builder for chaining. + */ + public Builder clearUser() { + user_ = getDefaultInstance().getUser(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The email address of the user who initiated this operation.
+     * 
+ * + * string user = 4; + * + * @param value The bytes for user to set. + * @return This builder for chaining. + */ + public Builder setUserBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + user_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp insertTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + insertTimeBuilder_; + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + * + * @return Whether the insertTime field is set. + */ + public boolean hasInsertTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + * + * @return The insertTime. + */ + public com.google.protobuf.Timestamp getInsertTime() { + if (insertTimeBuilder_ == null) { + return insertTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : insertTime_; + } else { + return insertTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + public Builder setInsertTime(com.google.protobuf.Timestamp value) { + if (insertTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + insertTime_ = value; + } else { + insertTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + public Builder setInsertTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (insertTimeBuilder_ == null) { + insertTime_ = builderForValue.build(); + } else { + insertTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + public Builder mergeInsertTime(com.google.protobuf.Timestamp value) { + if (insertTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && insertTime_ != null + && insertTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getInsertTimeBuilder().mergeFrom(value); + } else { + insertTime_ = value; + } + } else { + insertTimeBuilder_.mergeFrom(value); + } + if (insertTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + public Builder clearInsertTime() { + bitField0_ = (bitField0_ & ~0x00000010); + insertTime_ = null; + if (insertTimeBuilder_ != null) { + insertTimeBuilder_.dispose(); + insertTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getInsertTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetInsertTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getInsertTimeOrBuilder() { + if (insertTimeBuilder_ != null) { + return insertTimeBuilder_.getMessageOrBuilder(); + } else { + return insertTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : insertTime_; + } + } + + /** + * + * + *
+     * The time this operation was enqueued in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetInsertTimeFieldBuilder() { + if (insertTimeBuilder_ == null) { + insertTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getInsertTime(), getParentForChildren(), isClean()); + insertTime_ = null; + } + return insertTimeBuilder_; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000020); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The time this operation actually started in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * The time this operation finished in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + * + * @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(); + } + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000040); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * The time this operation finished in UTC timezone in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private com.google.cloud.sql.v1beta4.OperationErrors error_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.OperationErrors, + com.google.cloud.sql.v1beta4.OperationErrors.Builder, + com.google.cloud.sql.v1beta4.OperationErrorsOrBuilder> + errorBuilder_; + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + * + * @return The error. + */ + public com.google.cloud.sql.v1beta4.OperationErrors getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.cloud.sql.v1beta4.OperationErrors.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + */ + public Builder setError(com.google.cloud.sql.v1beta4.OperationErrors value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + */ + public Builder setError(com.google.cloud.sql.v1beta4.OperationErrors.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + */ + public Builder mergeError(com.google.cloud.sql.v1beta4.OperationErrors value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && error_ != null + && error_ != com.google.cloud.sql.v1beta4.OperationErrors.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000080); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + */ + public com.google.cloud.sql.v1beta4.OperationErrors.Builder getErrorBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + */ + public com.google.cloud.sql.v1beta4.OperationErrorsOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.cloud.sql.v1beta4.OperationErrors.getDefaultInstance() + : error_; + } + } + + /** + * + * + *
+     * If errors occurred during processing of this operation, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.OperationErrors, + com.google.cloud.sql.v1beta4.OperationErrors.Builder, + com.google.cloud.sql.v1beta4.OperationErrorsOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.OperationErrors, + com.google.cloud.sql.v1beta4.OperationErrors.Builder, + com.google.cloud.sql.v1beta4.OperationErrorsOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + private com.google.cloud.sql.v1beta4.ApiWarning apiWarning_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ApiWarning, + com.google.cloud.sql.v1beta4.ApiWarning.Builder, + com.google.cloud.sql.v1beta4.ApiWarningOrBuilder> + apiWarningBuilder_; + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + * + * @return Whether the apiWarning field is set. + */ + public boolean hasApiWarning() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + * + * @return The apiWarning. + */ + public com.google.cloud.sql.v1beta4.ApiWarning getApiWarning() { + if (apiWarningBuilder_ == null) { + return apiWarning_ == null + ? com.google.cloud.sql.v1beta4.ApiWarning.getDefaultInstance() + : apiWarning_; + } else { + return apiWarningBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + */ + public Builder setApiWarning(com.google.cloud.sql.v1beta4.ApiWarning value) { + if (apiWarningBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + apiWarning_ = value; + } else { + apiWarningBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + */ + public Builder setApiWarning(com.google.cloud.sql.v1beta4.ApiWarning.Builder builderForValue) { + if (apiWarningBuilder_ == null) { + apiWarning_ = builderForValue.build(); + } else { + apiWarningBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + */ + public Builder mergeApiWarning(com.google.cloud.sql.v1beta4.ApiWarning value) { + if (apiWarningBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && apiWarning_ != null + && apiWarning_ != com.google.cloud.sql.v1beta4.ApiWarning.getDefaultInstance()) { + getApiWarningBuilder().mergeFrom(value); + } else { + apiWarning_ = value; + } + } else { + apiWarningBuilder_.mergeFrom(value); + } + if (apiWarning_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + */ + public Builder clearApiWarning() { + bitField0_ = (bitField0_ & ~0x00000100); + apiWarning_ = null; + if (apiWarningBuilder_ != null) { + apiWarningBuilder_.dispose(); + apiWarningBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + */ + public com.google.cloud.sql.v1beta4.ApiWarning.Builder getApiWarningBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetApiWarningFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + */ + public com.google.cloud.sql.v1beta4.ApiWarningOrBuilder getApiWarningOrBuilder() { + if (apiWarningBuilder_ != null) { + return apiWarningBuilder_.getMessageOrBuilder(); + } else { + return apiWarning_ == null + ? com.google.cloud.sql.v1beta4.ApiWarning.getDefaultInstance() + : apiWarning_; + } + } + + /** + * + * + *
+     * An Admin API warning message.
+     * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ApiWarning, + com.google.cloud.sql.v1beta4.ApiWarning.Builder, + com.google.cloud.sql.v1beta4.ApiWarningOrBuilder> + internalGetApiWarningFieldBuilder() { + if (apiWarningBuilder_ == null) { + apiWarningBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ApiWarning, + com.google.cloud.sql.v1beta4.ApiWarning.Builder, + com.google.cloud.sql.v1beta4.ApiWarningOrBuilder>( + getApiWarning(), getParentForChildren(), isClean()); + apiWarning_ = null; + } + return apiWarningBuilder_; + } + + private int operationType_ = 0; + + /** + * + * + *
+     * The type of the operation. Valid values are:
+     * *  `CREATE`
+     * *  `DELETE`
+     * *  `UPDATE`
+     * *  `RESTART`
+     * *  `IMPORT`
+     * *  `EXPORT`
+     * *  `BACKUP_VOLUME`
+     * *  `RESTORE_VOLUME`
+     * *  `CREATE_USER`
+     * *  `DELETE_USER`
+     * *  `CREATE_DATABASE`
+     * *  `DELETE_DATABASE`
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationType operation_type = 9; + * + * @return The enum numeric value on the wire for operationType. + */ + @java.lang.Override + public int getOperationTypeValue() { + return operationType_; + } + + /** + * + * + *
+     * The type of the operation. Valid values are:
+     * *  `CREATE`
+     * *  `DELETE`
+     * *  `UPDATE`
+     * *  `RESTART`
+     * *  `IMPORT`
+     * *  `EXPORT`
+     * *  `BACKUP_VOLUME`
+     * *  `RESTORE_VOLUME`
+     * *  `CREATE_USER`
+     * *  `DELETE_USER`
+     * *  `CREATE_DATABASE`
+     * *  `DELETE_DATABASE`
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationType operation_type = 9; + * + * @param value The enum numeric value on the wire for operationType to set. + * @return This builder for chaining. + */ + public Builder setOperationTypeValue(int value) { + operationType_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the operation. Valid values are:
+     * *  `CREATE`
+     * *  `DELETE`
+     * *  `UPDATE`
+     * *  `RESTART`
+     * *  `IMPORT`
+     * *  `EXPORT`
+     * *  `BACKUP_VOLUME`
+     * *  `RESTORE_VOLUME`
+     * *  `CREATE_USER`
+     * *  `DELETE_USER`
+     * *  `CREATE_DATABASE`
+     * *  `DELETE_DATABASE`
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationType operation_type = 9; + * + * @return The operationType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Operation.SqlOperationType getOperationType() { + com.google.cloud.sql.v1beta4.Operation.SqlOperationType result = + com.google.cloud.sql.v1beta4.Operation.SqlOperationType.forNumber(operationType_); + return result == null + ? com.google.cloud.sql.v1beta4.Operation.SqlOperationType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The type of the operation. Valid values are:
+     * *  `CREATE`
+     * *  `DELETE`
+     * *  `UPDATE`
+     * *  `RESTART`
+     * *  `IMPORT`
+     * *  `EXPORT`
+     * *  `BACKUP_VOLUME`
+     * *  `RESTORE_VOLUME`
+     * *  `CREATE_USER`
+     * *  `DELETE_USER`
+     * *  `CREATE_DATABASE`
+     * *  `DELETE_DATABASE`
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationType operation_type = 9; + * + * @param value The operationType to set. + * @return This builder for chaining. + */ + public Builder setOperationType(com.google.cloud.sql.v1beta4.Operation.SqlOperationType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + operationType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the operation. Valid values are:
+     * *  `CREATE`
+     * *  `DELETE`
+     * *  `UPDATE`
+     * *  `RESTART`
+     * *  `IMPORT`
+     * *  `EXPORT`
+     * *  `BACKUP_VOLUME`
+     * *  `RESTORE_VOLUME`
+     * *  `CREATE_USER`
+     * *  `DELETE_USER`
+     * *  `CREATE_DATABASE`
+     * *  `DELETE_DATABASE`
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationType operation_type = 9; + * + * @return This builder for chaining. + */ + public Builder clearOperationType() { + bitField0_ = (bitField0_ & ~0x00000200); + operationType_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.ImportContext importContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext, + com.google.cloud.sql.v1beta4.ImportContext.Builder, + com.google.cloud.sql.v1beta4.ImportContextOrBuilder> + importContextBuilder_; + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + * + * @return Whether the importContext field is set. + */ + public boolean hasImportContext() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + * + * @return The importContext. + */ + public com.google.cloud.sql.v1beta4.ImportContext getImportContext() { + if (importContextBuilder_ == null) { + return importContext_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.getDefaultInstance() + : importContext_; + } else { + return importContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + */ + public Builder setImportContext(com.google.cloud.sql.v1beta4.ImportContext value) { + if (importContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + importContext_ = value; + } else { + importContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + */ + public Builder setImportContext( + com.google.cloud.sql.v1beta4.ImportContext.Builder builderForValue) { + if (importContextBuilder_ == null) { + importContext_ = builderForValue.build(); + } else { + importContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + */ + public Builder mergeImportContext(com.google.cloud.sql.v1beta4.ImportContext value) { + if (importContextBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && importContext_ != null + && importContext_ != com.google.cloud.sql.v1beta4.ImportContext.getDefaultInstance()) { + getImportContextBuilder().mergeFrom(value); + } else { + importContext_ = value; + } + } else { + importContextBuilder_.mergeFrom(value); + } + if (importContext_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + */ + public Builder clearImportContext() { + bitField0_ = (bitField0_ & ~0x00000400); + importContext_ = null; + if (importContextBuilder_ != null) { + importContextBuilder_.dispose(); + importContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + */ + public com.google.cloud.sql.v1beta4.ImportContext.Builder getImportContextBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return internalGetImportContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + */ + public com.google.cloud.sql.v1beta4.ImportContextOrBuilder getImportContextOrBuilder() { + if (importContextBuilder_ != null) { + return importContextBuilder_.getMessageOrBuilder(); + } else { + return importContext_ == null + ? com.google.cloud.sql.v1beta4.ImportContext.getDefaultInstance() + : importContext_; + } + } + + /** + * + * + *
+     * The context for import operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext, + com.google.cloud.sql.v1beta4.ImportContext.Builder, + com.google.cloud.sql.v1beta4.ImportContextOrBuilder> + internalGetImportContextFieldBuilder() { + if (importContextBuilder_ == null) { + importContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ImportContext, + com.google.cloud.sql.v1beta4.ImportContext.Builder, + com.google.cloud.sql.v1beta4.ImportContextOrBuilder>( + getImportContext(), getParentForChildren(), isClean()); + importContext_ = null; + } + return importContextBuilder_; + } + + private com.google.cloud.sql.v1beta4.ExportContext exportContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext, + com.google.cloud.sql.v1beta4.ExportContext.Builder, + com.google.cloud.sql.v1beta4.ExportContextOrBuilder> + exportContextBuilder_; + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + * + * @return Whether the exportContext field is set. + */ + public boolean hasExportContext() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + * + * @return The exportContext. + */ + public com.google.cloud.sql.v1beta4.ExportContext getExportContext() { + if (exportContextBuilder_ == null) { + return exportContext_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.getDefaultInstance() + : exportContext_; + } else { + return exportContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + */ + public Builder setExportContext(com.google.cloud.sql.v1beta4.ExportContext value) { + if (exportContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + exportContext_ = value; + } else { + exportContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + */ + public Builder setExportContext( + com.google.cloud.sql.v1beta4.ExportContext.Builder builderForValue) { + if (exportContextBuilder_ == null) { + exportContext_ = builderForValue.build(); + } else { + exportContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + */ + public Builder mergeExportContext(com.google.cloud.sql.v1beta4.ExportContext value) { + if (exportContextBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && exportContext_ != null + && exportContext_ != com.google.cloud.sql.v1beta4.ExportContext.getDefaultInstance()) { + getExportContextBuilder().mergeFrom(value); + } else { + exportContext_ = value; + } + } else { + exportContextBuilder_.mergeFrom(value); + } + if (exportContext_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + */ + public Builder clearExportContext() { + bitField0_ = (bitField0_ & ~0x00000800); + exportContext_ = null; + if (exportContextBuilder_ != null) { + exportContextBuilder_.dispose(); + exportContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + */ + public com.google.cloud.sql.v1beta4.ExportContext.Builder getExportContextBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return internalGetExportContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + */ + public com.google.cloud.sql.v1beta4.ExportContextOrBuilder getExportContextOrBuilder() { + if (exportContextBuilder_ != null) { + return exportContextBuilder_.getMessageOrBuilder(); + } else { + return exportContext_ == null + ? com.google.cloud.sql.v1beta4.ExportContext.getDefaultInstance() + : exportContext_; + } + } + + /** + * + * + *
+     * The context for export operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext, + com.google.cloud.sql.v1beta4.ExportContext.Builder, + com.google.cloud.sql.v1beta4.ExportContextOrBuilder> + internalGetExportContextFieldBuilder() { + if (exportContextBuilder_ == null) { + exportContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExportContext, + com.google.cloud.sql.v1beta4.ExportContext.Builder, + com.google.cloud.sql.v1beta4.ExportContextOrBuilder>( + getExportContext(), getParentForChildren(), isClean()); + exportContext_ = null; + } + return exportContextBuilder_; + } + + private com.google.cloud.sql.v1beta4.BackupContext backupContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupContext, + com.google.cloud.sql.v1beta4.BackupContext.Builder, + com.google.cloud.sql.v1beta4.BackupContextOrBuilder> + backupContextBuilder_; + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + * + * @return Whether the backupContext field is set. + */ + public boolean hasBackupContext() { + return ((bitField0_ & 0x00001000) != 0); + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + * + * @return The backupContext. + */ + public com.google.cloud.sql.v1beta4.BackupContext getBackupContext() { + if (backupContextBuilder_ == null) { + return backupContext_ == null + ? com.google.cloud.sql.v1beta4.BackupContext.getDefaultInstance() + : backupContext_; + } else { + return backupContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + */ + public Builder setBackupContext(com.google.cloud.sql.v1beta4.BackupContext value) { + if (backupContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupContext_ = value; + } else { + backupContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + */ + public Builder setBackupContext( + com.google.cloud.sql.v1beta4.BackupContext.Builder builderForValue) { + if (backupContextBuilder_ == null) { + backupContext_ = builderForValue.build(); + } else { + backupContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + */ + public Builder mergeBackupContext(com.google.cloud.sql.v1beta4.BackupContext value) { + if (backupContextBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && backupContext_ != null + && backupContext_ != com.google.cloud.sql.v1beta4.BackupContext.getDefaultInstance()) { + getBackupContextBuilder().mergeFrom(value); + } else { + backupContext_ = value; + } + } else { + backupContextBuilder_.mergeFrom(value); + } + if (backupContext_ != null) { + bitField0_ |= 0x00001000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + */ + public Builder clearBackupContext() { + bitField0_ = (bitField0_ & ~0x00001000); + backupContext_ = null; + if (backupContextBuilder_ != null) { + backupContextBuilder_.dispose(); + backupContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + */ + public com.google.cloud.sql.v1beta4.BackupContext.Builder getBackupContextBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return internalGetBackupContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + */ + public com.google.cloud.sql.v1beta4.BackupContextOrBuilder getBackupContextOrBuilder() { + if (backupContextBuilder_ != null) { + return backupContextBuilder_.getMessageOrBuilder(); + } else { + return backupContext_ == null + ? com.google.cloud.sql.v1beta4.BackupContext.getDefaultInstance() + : backupContext_; + } + } + + /** + * + * + *
+     * The context for backup operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupContext, + com.google.cloud.sql.v1beta4.BackupContext.Builder, + com.google.cloud.sql.v1beta4.BackupContextOrBuilder> + internalGetBackupContextFieldBuilder() { + if (backupContextBuilder_ == null) { + backupContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupContext, + com.google.cloud.sql.v1beta4.BackupContext.Builder, + com.google.cloud.sql.v1beta4.BackupContextOrBuilder>( + getBackupContext(), getParentForChildren(), isClean()); + backupContext_ = null; + } + return backupContextBuilder_; + } + + private com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + preCheckMajorVersionUpgradeContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext, + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.Builder, + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContextOrBuilder> + preCheckMajorVersionUpgradeContextBuilder_; + + /** + * + * + *
+     * The context for pre-check major version upgrade operation, if applicable.
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + * + * @return Whether the preCheckMajorVersionUpgradeContext field is set. + */ + public boolean hasPreCheckMajorVersionUpgradeContext() { + return ((bitField0_ & 0x00002000) != 0); + } + + /** + * + * + *
+     * The context for pre-check major version upgrade operation, if applicable.
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + * + * @return The preCheckMajorVersionUpgradeContext. + */ + public com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + getPreCheckMajorVersionUpgradeContext() { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } else { + return preCheckMajorVersionUpgradeContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The context for pre-check major version upgrade operation, if applicable.
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + public Builder setPreCheckMajorVersionUpgradeContext( + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext value) { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + preCheckMajorVersionUpgradeContext_ = value; + } else { + preCheckMajorVersionUpgradeContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for pre-check major version upgrade operation, if applicable.
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + public Builder setPreCheckMajorVersionUpgradeContext( + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.Builder builderForValue) { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + preCheckMajorVersionUpgradeContext_ = builderForValue.build(); + } else { + preCheckMajorVersionUpgradeContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for pre-check major version upgrade operation, if applicable.
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + public Builder mergePreCheckMajorVersionUpgradeContext( + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext value) { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && preCheckMajorVersionUpgradeContext_ != null + && preCheckMajorVersionUpgradeContext_ + != com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + .getDefaultInstance()) { + getPreCheckMajorVersionUpgradeContextBuilder().mergeFrom(value); + } else { + preCheckMajorVersionUpgradeContext_ = value; + } + } else { + preCheckMajorVersionUpgradeContextBuilder_.mergeFrom(value); + } + if (preCheckMajorVersionUpgradeContext_ != null) { + bitField0_ |= 0x00002000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The context for pre-check major version upgrade operation, if applicable.
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + public Builder clearPreCheckMajorVersionUpgradeContext() { + bitField0_ = (bitField0_ & ~0x00002000); + preCheckMajorVersionUpgradeContext_ = null; + if (preCheckMajorVersionUpgradeContextBuilder_ != null) { + preCheckMajorVersionUpgradeContextBuilder_.dispose(); + preCheckMajorVersionUpgradeContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for pre-check major version upgrade operation, if applicable.
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + public com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.Builder + getPreCheckMajorVersionUpgradeContextBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return internalGetPreCheckMajorVersionUpgradeContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The context for pre-check major version upgrade operation, if applicable.
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + public com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContextOrBuilder + getPreCheckMajorVersionUpgradeContextOrBuilder() { + if (preCheckMajorVersionUpgradeContextBuilder_ != null) { + return preCheckMajorVersionUpgradeContextBuilder_.getMessageOrBuilder(); + } else { + return preCheckMajorVersionUpgradeContext_ == null + ? com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.getDefaultInstance() + : preCheckMajorVersionUpgradeContext_; + } + } + + /** + * + * + *
+     * The context for pre-check major version upgrade operation, if applicable.
+     * This field is only populated when the operation_type is
+     * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+     * The PreCheckMajorVersionUpgradeContext message itself contains the details
+     * for that pre-check, such as the target database version for the upgrade
+     * and the results of the check (including any warnings or errors found).
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext, + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.Builder, + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContextOrBuilder> + internalGetPreCheckMajorVersionUpgradeContextFieldBuilder() { + if (preCheckMajorVersionUpgradeContextBuilder_ == null) { + preCheckMajorVersionUpgradeContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext, + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.Builder, + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContextOrBuilder>( + getPreCheckMajorVersionUpgradeContext(), getParentForChildren(), isClean()); + preCheckMajorVersionUpgradeContext_ = null; + } + return preCheckMajorVersionUpgradeContextBuilder_; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * An identifier that uniquely identifies the operation. You can use this
+     * identifier to retrieve the Operations resource that has information about
+     * the operation.
+     * 
+ * + * string name = 12; + * + * @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; + } + } + + /** + * + * + *
+     * An identifier that uniquely identifies the operation. You can use this
+     * identifier to retrieve the Operations resource that has information about
+     * the operation.
+     * 
+ * + * string name = 12; + * + * @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; + } + } + + /** + * + * + *
+     * An identifier that uniquely identifies the operation. You can use this
+     * identifier to retrieve the Operations resource that has information about
+     * the operation.
+     * 
+ * + * string name = 12; + * + * @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_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * An identifier that uniquely identifies the operation. You can use this
+     * identifier to retrieve the Operations resource that has information about
+     * the operation.
+     * 
+ * + * string name = 12; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + + /** + * + * + *
+     * An identifier that uniquely identifies the operation. You can use this
+     * identifier to retrieve the Operations resource that has information about
+     * the operation.
+     * 
+ * + * string name = 12; + * + * @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_ |= 0x00004000; + onChanged(); + return this; + } + + private java.lang.Object targetId_ = ""; + + /** + * + * + *
+     * Name of the resource on which this operation runs.
+     * 
+ * + * string target_id = 13; + * + * @return The targetId. + */ + public java.lang.String getTargetId() { + java.lang.Object ref = targetId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the resource on which this operation runs.
+     * 
+ * + * string target_id = 13; + * + * @return The bytes for targetId. + */ + public com.google.protobuf.ByteString getTargetIdBytes() { + java.lang.Object ref = targetId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the resource on which this operation runs.
+     * 
+ * + * string target_id = 13; + * + * @param value The targetId to set. + * @return This builder for chaining. + */ + public Builder setTargetId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetId_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the resource on which this operation runs.
+     * 
+ * + * string target_id = 13; + * + * @return This builder for chaining. + */ + public Builder clearTargetId() { + targetId_ = getDefaultInstance().getTargetId(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the resource on which this operation runs.
+     * 
+ * + * string target_id = 13; + * + * @param value The bytes for targetId to set. + * @return This builder for chaining. + */ + public Builder setTargetIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetId_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private java.lang.Object selfLink_ = ""; + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 14; + * + * @return The selfLink. + */ + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 14; + * + * @return The bytes for selfLink. + */ + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 14; + * + * @param value The selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selfLink_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 14; + * + * @return This builder for chaining. + */ + public Builder clearSelfLink() { + selfLink_ = getDefaultInstance().getSelfLink(); + bitField0_ = (bitField0_ & ~0x00010000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 14; + * + * @param value The bytes for selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selfLink_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + private java.lang.Object targetProject_ = ""; + + /** + * + * + *
+     * The project ID of the target instance related to this operation.
+     * 
+ * + * string target_project = 15; + * + * @return The targetProject. + */ + public java.lang.String getTargetProject() { + java.lang.Object ref = targetProject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetProject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The project ID of the target instance related to this operation.
+     * 
+ * + * string target_project = 15; + * + * @return The bytes for targetProject. + */ + public com.google.protobuf.ByteString getTargetProjectBytes() { + java.lang.Object ref = targetProject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The project ID of the target instance related to this operation.
+     * 
+ * + * string target_project = 15; + * + * @param value The targetProject to set. + * @return This builder for chaining. + */ + public Builder setTargetProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetProject_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the target instance related to this operation.
+     * 
+ * + * string target_project = 15; + * + * @return This builder for chaining. + */ + public Builder clearTargetProject() { + targetProject_ = getDefaultInstance().getTargetProject(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the target instance related to this operation.
+     * 
+ * + * string target_project = 15; + * + * @param value The bytes for targetProject to set. + * @return This builder for chaining. + */ + public Builder setTargetProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetProject_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquireSsrsLeaseContext_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext, + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.Builder, + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContextOrBuilder> + acquireSsrsLeaseContextBuilder_; + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + * + * @return Whether the acquireSsrsLeaseContext field is set. + */ + public boolean hasAcquireSsrsLeaseContext() { + return ((bitField0_ & 0x00040000) != 0); + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + * + * @return The acquireSsrsLeaseContext. + */ + public com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext getAcquireSsrsLeaseContext() { + if (acquireSsrsLeaseContextBuilder_ == null) { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } else { + return acquireSsrsLeaseContextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + */ + public Builder setAcquireSsrsLeaseContext( + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext value) { + if (acquireSsrsLeaseContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + acquireSsrsLeaseContext_ = value; + } else { + acquireSsrsLeaseContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + */ + public Builder setAcquireSsrsLeaseContext( + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.Builder builderForValue) { + if (acquireSsrsLeaseContextBuilder_ == null) { + acquireSsrsLeaseContext_ = builderForValue.build(); + } else { + acquireSsrsLeaseContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + */ + public Builder mergeAcquireSsrsLeaseContext( + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext value) { + if (acquireSsrsLeaseContextBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) + && acquireSsrsLeaseContext_ != null + && acquireSsrsLeaseContext_ + != com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.getDefaultInstance()) { + getAcquireSsrsLeaseContextBuilder().mergeFrom(value); + } else { + acquireSsrsLeaseContext_ = value; + } + } else { + acquireSsrsLeaseContextBuilder_.mergeFrom(value); + } + if (acquireSsrsLeaseContext_ != null) { + bitField0_ |= 0x00040000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + */ + public Builder clearAcquireSsrsLeaseContext() { + bitField0_ = (bitField0_ & ~0x00040000); + acquireSsrsLeaseContext_ = null; + if (acquireSsrsLeaseContextBuilder_ != null) { + acquireSsrsLeaseContextBuilder_.dispose(); + acquireSsrsLeaseContextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + */ + public com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.Builder + getAcquireSsrsLeaseContextBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return internalGetAcquireSsrsLeaseContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + */ + public com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContextOrBuilder + getAcquireSsrsLeaseContextOrBuilder() { + if (acquireSsrsLeaseContextBuilder_ != null) { + return acquireSsrsLeaseContextBuilder_.getMessageOrBuilder(); + } else { + return acquireSsrsLeaseContext_ == null + ? com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.getDefaultInstance() + : acquireSsrsLeaseContext_; + } + } + + /** + * + * + *
+     * The context for acquire SSRS lease operation, if applicable.
+     * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext, + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.Builder, + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContextOrBuilder> + internalGetAcquireSsrsLeaseContextFieldBuilder() { + if (acquireSsrsLeaseContextBuilder_ == null) { + acquireSsrsLeaseContextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext, + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.Builder, + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContextOrBuilder>( + getAcquireSsrsLeaseContext(), getParentForChildren(), isClean()); + acquireSsrsLeaseContext_ = null; + } + return acquireSsrsLeaseContextBuilder_; + } + + private com.google.cloud.sql.v1beta4.SqlSubOperationType subOperationType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlSubOperationType, + com.google.cloud.sql.v1beta4.SqlSubOperationType.Builder, + com.google.cloud.sql.v1beta4.SqlSubOperationTypeOrBuilder> + subOperationTypeBuilder_; + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the subOperationType field is set. + */ + public boolean hasSubOperationType() { + return ((bitField0_ & 0x00080000) != 0); + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The subOperationType. + */ + public com.google.cloud.sql.v1beta4.SqlSubOperationType getSubOperationType() { + if (subOperationTypeBuilder_ == null) { + return subOperationType_ == null + ? com.google.cloud.sql.v1beta4.SqlSubOperationType.getDefaultInstance() + : subOperationType_; + } else { + return subOperationTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSubOperationType(com.google.cloud.sql.v1beta4.SqlSubOperationType value) { + if (subOperationTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + subOperationType_ = value; + } else { + subOperationTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSubOperationType( + com.google.cloud.sql.v1beta4.SqlSubOperationType.Builder builderForValue) { + if (subOperationTypeBuilder_ == null) { + subOperationType_ = builderForValue.build(); + } else { + subOperationTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeSubOperationType(com.google.cloud.sql.v1beta4.SqlSubOperationType value) { + if (subOperationTypeBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0) + && subOperationType_ != null + && subOperationType_ + != com.google.cloud.sql.v1beta4.SqlSubOperationType.getDefaultInstance()) { + getSubOperationTypeBuilder().mergeFrom(value); + } else { + subOperationType_ = value; + } + } else { + subOperationTypeBuilder_.mergeFrom(value); + } + if (subOperationType_ != null) { + bitField0_ |= 0x00080000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSubOperationType() { + bitField0_ = (bitField0_ & ~0x00080000); + subOperationType_ = null; + if (subOperationTypeBuilder_ != null) { + subOperationTypeBuilder_.dispose(); + subOperationTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.SqlSubOperationType.Builder getSubOperationTypeBuilder() { + bitField0_ |= 0x00080000; + onChanged(); + return internalGetSubOperationTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.SqlSubOperationTypeOrBuilder + getSubOperationTypeOrBuilder() { + if (subOperationTypeBuilder_ != null) { + return subOperationTypeBuilder_.getMessageOrBuilder(); + } else { + return subOperationType_ == null + ? com.google.cloud.sql.v1beta4.SqlSubOperationType.getDefaultInstance() + : subOperationType_; + } + } + + /** + * + * + *
+     * Optional. The sub operation based on the operation type.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlSubOperationType, + com.google.cloud.sql.v1beta4.SqlSubOperationType.Builder, + com.google.cloud.sql.v1beta4.SqlSubOperationTypeOrBuilder> + internalGetSubOperationTypeFieldBuilder() { + if (subOperationTypeBuilder_ == null) { + subOperationTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlSubOperationType, + com.google.cloud.sql.v1beta4.SqlSubOperationType.Builder, + com.google.cloud.sql.v1beta4.SqlSubOperationTypeOrBuilder>( + getSubOperationType(), getParentForChildren(), isClean()); + subOperationType_ = null; + } + return subOperationTypeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.Operation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.Operation) + private static final com.google.cloud.sql.v1beta4.Operation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.Operation(); + } + + public static com.google.cloud.sql.v1beta4.Operation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Operation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Operation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationError.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationError.java new file mode 100644 index 000000000000..ef1cd7be6a1b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationError.java @@ -0,0 +1,973 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance operation error.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.OperationError} + */ +@com.google.protobuf.Generated +public final class OperationError extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.OperationError) + OperationErrorOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperationError"); + } + + // Use OperationError.newBuilder() to construct. + private OperationError(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OperationError() { + kind_ = ""; + code_ = ""; + message_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.OperationError.class, + com.google.cloud.sql.v1beta4.OperationError.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#operationError`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#operationError`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CODE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object code_ = ""; + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * string code = 2; + * + * @return The code. + */ + @java.lang.Override + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } + } + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * string code = 2; + * + * @return The bytes for code. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(code_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, code_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, message_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(code_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, code_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, message_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.OperationError)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.OperationError other = + (com.google.cloud.sql.v1beta4.OperationError) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getCode().equals(other.getCode())) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.OperationError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.OperationError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.OperationError parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.OperationError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.OperationError parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.OperationError parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.OperationError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.OperationError prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance operation error.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.OperationError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.OperationError) + com.google.cloud.sql.v1beta4.OperationErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.OperationError.class, + com.google.cloud.sql.v1beta4.OperationError.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.OperationError.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + code_ = ""; + message_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationError_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationError getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.OperationError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationError build() { + com.google.cloud.sql.v1beta4.OperationError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationError buildPartial() { + com.google.cloud.sql.v1beta4.OperationError result = + new com.google.cloud.sql.v1beta4.OperationError(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.OperationError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.message_ = message_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.OperationError) { + return mergeFrom((com.google.cloud.sql.v1beta4.OperationError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.OperationError other) { + if (other == com.google.cloud.sql.v1beta4.OperationError.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getCode().isEmpty()) { + code_ = other.code_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + code_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#operationError`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operationError`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operationError`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operationError`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operationError`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object code_ = ""; + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * string code = 2; + * + * @return The code. + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * string code = 2; + * + * @return The bytes for code. + */ + public com.google.protobuf.ByteString getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * string code = 2; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + code_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * string code = 2; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + code_ = getDefaultInstance().getCode(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * string code = 2; + * + * @param value The bytes for code to set. + * @return This builder for chaining. + */ + public Builder setCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + code_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string message = 3; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string message = 3; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string message = 3; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string message = 3; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.OperationError) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.OperationError) + private static final com.google.cloud.sql.v1beta4.OperationError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.OperationError(); + } + + public static com.google.cloud.sql.v1beta4.OperationError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationErrorOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationErrorOrBuilder.java new file mode 100644 index 000000000000..2c44d891f9d6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationErrorOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface OperationErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.OperationError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#operationError`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#operationError`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * string code = 2; + * + * @return The code. + */ + java.lang.String getCode(); + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * string code = 2; + * + * @return The bytes for code. + */ + com.google.protobuf.ByteString getCodeBytes(); + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationErrors.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationErrors.java new file mode 100644 index 000000000000..0fd08221c86f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationErrors.java @@ -0,0 +1,1109 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance operation errors list wrapper.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.OperationErrors} + */ +@com.google.protobuf.Generated +public final class OperationErrors extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.OperationErrors) + OperationErrorsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperationErrors"); + } + + // Use OperationErrors.newBuilder() to construct. + private OperationErrors(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OperationErrors() { + kind_ = ""; + errors_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationErrors_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationErrors_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.OperationErrors.class, + com.google.cloud.sql.v1beta4.OperationErrors.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#operationErrors`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#operationErrors`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERRORS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List errors_; + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + @java.lang.Override + public java.util.List getErrorsList() { + return errors_; + } + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + @java.lang.Override + public java.util.List + getErrorsOrBuilderList() { + return errors_; + } + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + @java.lang.Override + public int getErrorsCount() { + return errors_.size(); + } + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationError getErrors(int index) { + return errors_.get(index); + } + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationErrorOrBuilder getErrorsOrBuilder(int index) { + return errors_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < errors_.size(); i++) { + output.writeMessage(2, errors_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < errors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, errors_.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.sql.v1beta4.OperationErrors)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.OperationErrors other = + (com.google.cloud.sql.v1beta4.OperationErrors) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getErrorsList().equals(other.getErrorsList())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getErrorsCount() > 0) { + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrorsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.OperationErrors parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.OperationErrors parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationErrors parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.OperationErrors parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationErrors parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.OperationErrors parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationErrors parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.OperationErrors parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationErrors parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.OperationErrors parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationErrors parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.OperationErrors parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.OperationErrors prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance operation errors list wrapper.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.OperationErrors} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.OperationErrors) + com.google.cloud.sql.v1beta4.OperationErrorsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationErrors_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationErrors_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.OperationErrors.class, + com.google.cloud.sql.v1beta4.OperationErrors.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.OperationErrors.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (errorsBuilder_ == null) { + errors_ = java.util.Collections.emptyList(); + } else { + errors_ = null; + errorsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationErrors_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationErrors getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.OperationErrors.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationErrors build() { + com.google.cloud.sql.v1beta4.OperationErrors result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationErrors buildPartial() { + com.google.cloud.sql.v1beta4.OperationErrors result = + new com.google.cloud.sql.v1beta4.OperationErrors(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1beta4.OperationErrors result) { + if (errorsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + errors_ = java.util.Collections.unmodifiableList(errors_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.errors_ = errors_; + } else { + result.errors_ = errorsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.OperationErrors result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.OperationErrors) { + return mergeFrom((com.google.cloud.sql.v1beta4.OperationErrors) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.OperationErrors other) { + if (other == com.google.cloud.sql.v1beta4.OperationErrors.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (errorsBuilder_ == null) { + if (!other.errors_.isEmpty()) { + if (errors_.isEmpty()) { + errors_ = other.errors_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureErrorsIsMutable(); + errors_.addAll(other.errors_); + } + onChanged(); + } + } else { + if (!other.errors_.isEmpty()) { + if (errorsBuilder_.isEmpty()) { + errorsBuilder_.dispose(); + errorsBuilder_ = null; + errors_ = other.errors_; + bitField0_ = (bitField0_ & ~0x00000002); + errorsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetErrorsFieldBuilder() + : null; + } else { + errorsBuilder_.addAllMessages(other.errors_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1beta4.OperationError m = + input.readMessage( + com.google.cloud.sql.v1beta4.OperationError.parser(), extensionRegistry); + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(m); + } else { + errorsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#operationErrors`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operationErrors`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operationErrors`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operationErrors`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operationErrors`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List errors_ = + java.util.Collections.emptyList(); + + private void ensureErrorsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + errors_ = new java.util.ArrayList(errors_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.OperationError, + com.google.cloud.sql.v1beta4.OperationError.Builder, + com.google.cloud.sql.v1beta4.OperationErrorOrBuilder> + errorsBuilder_; + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public java.util.List getErrorsList() { + if (errorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(errors_); + } else { + return errorsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public int getErrorsCount() { + if (errorsBuilder_ == null) { + return errors_.size(); + } else { + return errorsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public com.google.cloud.sql.v1beta4.OperationError getErrors(int index) { + if (errorsBuilder_ == null) { + return errors_.get(index); + } else { + return errorsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public Builder setErrors(int index, com.google.cloud.sql.v1beta4.OperationError value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.set(index, value); + onChanged(); + } else { + errorsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public Builder setErrors( + int index, com.google.cloud.sql.v1beta4.OperationError.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.set(index, builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public Builder addErrors(com.google.cloud.sql.v1beta4.OperationError value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.add(value); + onChanged(); + } else { + errorsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public Builder addErrors(int index, com.google.cloud.sql.v1beta4.OperationError value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.add(index, value); + onChanged(); + } else { + errorsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public Builder addErrors(com.google.cloud.sql.v1beta4.OperationError.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public Builder addErrors( + int index, com.google.cloud.sql.v1beta4.OperationError.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(index, builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public Builder addAllErrors( + java.lang.Iterable values) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errors_); + onChanged(); + } else { + errorsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public Builder clearErrors() { + if (errorsBuilder_ == null) { + errors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + errorsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public Builder removeErrors(int index) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.remove(index); + onChanged(); + } else { + errorsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public com.google.cloud.sql.v1beta4.OperationError.Builder getErrorsBuilder(int index) { + return internalGetErrorsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public com.google.cloud.sql.v1beta4.OperationErrorOrBuilder getErrorsOrBuilder(int index) { + if (errorsBuilder_ == null) { + return errors_.get(index); + } else { + return errorsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public java.util.List + getErrorsOrBuilderList() { + if (errorsBuilder_ != null) { + return errorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errors_); + } + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public com.google.cloud.sql.v1beta4.OperationError.Builder addErrorsBuilder() { + return internalGetErrorsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.OperationError.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public com.google.cloud.sql.v1beta4.OperationError.Builder addErrorsBuilder(int index) { + return internalGetErrorsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.OperationError.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of errors encountered while processing this operation.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + public java.util.List + getErrorsBuilderList() { + return internalGetErrorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.OperationError, + com.google.cloud.sql.v1beta4.OperationError.Builder, + com.google.cloud.sql.v1beta4.OperationErrorOrBuilder> + internalGetErrorsFieldBuilder() { + if (errorsBuilder_ == null) { + errorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.OperationError, + com.google.cloud.sql.v1beta4.OperationError.Builder, + com.google.cloud.sql.v1beta4.OperationErrorOrBuilder>( + errors_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + errors_ = null; + } + return errorsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.OperationErrors) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.OperationErrors) + private static final com.google.cloud.sql.v1beta4.OperationErrors DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.OperationErrors(); + } + + public static com.google.cloud.sql.v1beta4.OperationErrors getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationErrors parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationErrors getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationErrorsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationErrorsOrBuilder.java new file mode 100644 index 000000000000..d81cbfac4a42 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationErrorsOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface OperationErrorsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.OperationErrors) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#operationErrors`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#operationErrors`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + java.util.List getErrorsList(); + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + com.google.cloud.sql.v1beta4.OperationError getErrors(int index); + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + int getErrorsCount(); + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + java.util.List + getErrorsOrBuilderList(); + + /** + * + * + *
+   * The list of errors encountered while processing this operation.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.OperationError errors = 2; + */ + com.google.cloud.sql.v1beta4.OperationErrorOrBuilder getErrorsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationOrBuilder.java new file mode 100644 index 000000000000..e91a2bd1ca2b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationOrBuilder.java @@ -0,0 +1,736 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface OperationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.Operation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#operation`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#operation`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * string target_link = 2; + * + * @return The targetLink. + */ + java.lang.String getTargetLink(); + + /** + * string target_link = 2; + * + * @return The bytes for targetLink. + */ + com.google.protobuf.ByteString getTargetLinkBytes(); + + /** + * + * + *
+   * The status of an operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationStatus status = 3; + * + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + + /** + * + * + *
+   * The status of an operation.
+   * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationStatus status = 3; + * + * @return The status. + */ + com.google.cloud.sql.v1beta4.Operation.SqlOperationStatus getStatus(); + + /** + * + * + *
+   * The email address of the user who initiated this operation.
+   * 
+ * + * string user = 4; + * + * @return The user. + */ + java.lang.String getUser(); + + /** + * + * + *
+   * The email address of the user who initiated this operation.
+   * 
+ * + * string user = 4; + * + * @return The bytes for user. + */ + com.google.protobuf.ByteString getUserBytes(); + + /** + * + * + *
+   * The time this operation was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + * + * @return Whether the insertTime field is set. + */ + boolean hasInsertTime(); + + /** + * + * + *
+   * The time this operation was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + * + * @return The insertTime. + */ + com.google.protobuf.Timestamp getInsertTime(); + + /** + * + * + *
+   * The time this operation was enqueued in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp insert_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getInsertTimeOrBuilder(); + + /** + * + * + *
+   * The time this operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The time this operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The time this operation actually started in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The time this operation finished in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * The time this operation finished in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * The time this operation finished in UTC timezone in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * If errors occurred during processing of this operation, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
+   * If errors occurred during processing of this operation, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + * + * @return The error. + */ + com.google.cloud.sql.v1beta4.OperationErrors getError(); + + /** + * + * + *
+   * If errors occurred during processing of this operation, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.sql.v1beta4.OperationErrors error = 8; + */ + com.google.cloud.sql.v1beta4.OperationErrorsOrBuilder getErrorOrBuilder(); + + /** + * + * + *
+   * An Admin API warning message.
+   * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + * + * @return Whether the apiWarning field is set. + */ + boolean hasApiWarning(); + + /** + * + * + *
+   * An Admin API warning message.
+   * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + * + * @return The apiWarning. + */ + com.google.cloud.sql.v1beta4.ApiWarning getApiWarning(); + + /** + * + * + *
+   * An Admin API warning message.
+   * 
+ * + * .google.cloud.sql.v1beta4.ApiWarning api_warning = 19; + */ + com.google.cloud.sql.v1beta4.ApiWarningOrBuilder getApiWarningOrBuilder(); + + /** + * + * + *
+   * The type of the operation. Valid values are:
+   * *  `CREATE`
+   * *  `DELETE`
+   * *  `UPDATE`
+   * *  `RESTART`
+   * *  `IMPORT`
+   * *  `EXPORT`
+   * *  `BACKUP_VOLUME`
+   * *  `RESTORE_VOLUME`
+   * *  `CREATE_USER`
+   * *  `DELETE_USER`
+   * *  `CREATE_DATABASE`
+   * *  `DELETE_DATABASE`
+   * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationType operation_type = 9; + * + * @return The enum numeric value on the wire for operationType. + */ + int getOperationTypeValue(); + + /** + * + * + *
+   * The type of the operation. Valid values are:
+   * *  `CREATE`
+   * *  `DELETE`
+   * *  `UPDATE`
+   * *  `RESTART`
+   * *  `IMPORT`
+   * *  `EXPORT`
+   * *  `BACKUP_VOLUME`
+   * *  `RESTORE_VOLUME`
+   * *  `CREATE_USER`
+   * *  `DELETE_USER`
+   * *  `CREATE_DATABASE`
+   * *  `DELETE_DATABASE`
+   * 
+ * + * .google.cloud.sql.v1beta4.Operation.SqlOperationType operation_type = 9; + * + * @return The operationType. + */ + com.google.cloud.sql.v1beta4.Operation.SqlOperationType getOperationType(); + + /** + * + * + *
+   * The context for import operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + * + * @return Whether the importContext field is set. + */ + boolean hasImportContext(); + + /** + * + * + *
+   * The context for import operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + * + * @return The importContext. + */ + com.google.cloud.sql.v1beta4.ImportContext getImportContext(); + + /** + * + * + *
+   * The context for import operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.ImportContext import_context = 10; + */ + com.google.cloud.sql.v1beta4.ImportContextOrBuilder getImportContextOrBuilder(); + + /** + * + * + *
+   * The context for export operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + * + * @return Whether the exportContext field is set. + */ + boolean hasExportContext(); + + /** + * + * + *
+   * The context for export operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + * + * @return The exportContext. + */ + com.google.cloud.sql.v1beta4.ExportContext getExportContext(); + + /** + * + * + *
+   * The context for export operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExportContext export_context = 11; + */ + com.google.cloud.sql.v1beta4.ExportContextOrBuilder getExportContextOrBuilder(); + + /** + * + * + *
+   * The context for backup operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + * + * @return Whether the backupContext field is set. + */ + boolean hasBackupContext(); + + /** + * + * + *
+   * The context for backup operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + * + * @return The backupContext. + */ + com.google.cloud.sql.v1beta4.BackupContext getBackupContext(); + + /** + * + * + *
+   * The context for backup operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupContext backup_context = 17; + */ + com.google.cloud.sql.v1beta4.BackupContextOrBuilder getBackupContextOrBuilder(); + + /** + * + * + *
+   * The context for pre-check major version upgrade operation, if applicable.
+   * This field is only populated when the operation_type is
+   * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+   * The PreCheckMajorVersionUpgradeContext message itself contains the details
+   * for that pre-check, such as the target database version for the upgrade
+   * and the results of the check (including any warnings or errors found).
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + * + * @return Whether the preCheckMajorVersionUpgradeContext field is set. + */ + boolean hasPreCheckMajorVersionUpgradeContext(); + + /** + * + * + *
+   * The context for pre-check major version upgrade operation, if applicable.
+   * This field is only populated when the operation_type is
+   * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+   * The PreCheckMajorVersionUpgradeContext message itself contains the details
+   * for that pre-check, such as the target database version for the upgrade
+   * and the results of the check (including any warnings or errors found).
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + * + * @return The preCheckMajorVersionUpgradeContext. + */ + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + getPreCheckMajorVersionUpgradeContext(); + + /** + * + * + *
+   * The context for pre-check major version upgrade operation, if applicable.
+   * This field is only populated when the operation_type is
+   * PRE_CHECK_MAJOR_VERSION_UPGRADE.
+   * The PreCheckMajorVersionUpgradeContext message itself contains the details
+   * for that pre-check, such as the target database version for the upgrade
+   * and the results of the check (including any warnings or errors found).
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 50; + * + */ + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContextOrBuilder + getPreCheckMajorVersionUpgradeContextOrBuilder(); + + /** + * + * + *
+   * An identifier that uniquely identifies the operation. You can use this
+   * identifier to retrieve the Operations resource that has information about
+   * the operation.
+   * 
+ * + * string name = 12; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * An identifier that uniquely identifies the operation. You can use this
+   * identifier to retrieve the Operations resource that has information about
+   * the operation.
+   * 
+ * + * string name = 12; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Name of the resource on which this operation runs.
+   * 
+ * + * string target_id = 13; + * + * @return The targetId. + */ + java.lang.String getTargetId(); + + /** + * + * + *
+   * Name of the resource on which this operation runs.
+   * 
+ * + * string target_id = 13; + * + * @return The bytes for targetId. + */ + com.google.protobuf.ByteString getTargetIdBytes(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 14; + * + * @return The selfLink. + */ + java.lang.String getSelfLink(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 14; + * + * @return The bytes for selfLink. + */ + com.google.protobuf.ByteString getSelfLinkBytes(); + + /** + * + * + *
+   * The project ID of the target instance related to this operation.
+   * 
+ * + * string target_project = 15; + * + * @return The targetProject. + */ + java.lang.String getTargetProject(); + + /** + * + * + *
+   * The project ID of the target instance related to this operation.
+   * 
+ * + * string target_project = 15; + * + * @return The bytes for targetProject. + */ + com.google.protobuf.ByteString getTargetProjectBytes(); + + /** + * + * + *
+   * The context for acquire SSRS lease operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + * @return Whether the acquireSsrsLeaseContext field is set. + */ + boolean hasAcquireSsrsLeaseContext(); + + /** + * + * + *
+   * The context for acquire SSRS lease operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + * + * @return The acquireSsrsLeaseContext. + */ + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext getAcquireSsrsLeaseContext(); + + /** + * + * + *
+   * The context for acquire SSRS lease operation, if applicable.
+   * 
+ * + * .google.cloud.sql.v1beta4.AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + */ + com.google.cloud.sql.v1beta4.AcquireSsrsLeaseContextOrBuilder + getAcquireSsrsLeaseContextOrBuilder(); + + /** + * + * + *
+   * Optional. The sub operation based on the operation type.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the subOperationType field is set. + */ + boolean hasSubOperationType(); + + /** + * + * + *
+   * Optional. The sub operation based on the operation type.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The subOperationType. + */ + com.google.cloud.sql.v1beta4.SqlSubOperationType getSubOperationType(); + + /** + * + * + *
+   * Optional. The sub operation based on the operation type.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlSubOperationType sub_operation_type = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.SqlSubOperationTypeOrBuilder getSubOperationTypeOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationsListResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationsListResponse.java new file mode 100644 index 000000000000..33b6aab50858 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationsListResponse.java @@ -0,0 +1,1306 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Operations list response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.OperationsListResponse} + */ +@com.google.protobuf.Generated +public final class OperationsListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.OperationsListResponse) + OperationsListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperationsListResponse"); + } + + // Use OperationsListResponse.newBuilder() to construct. + private OperationsListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OperationsListResponse() { + kind_ = ""; + items_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.OperationsListResponse.class, + com.google.cloud.sql.v1beta4.OperationsListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#operationsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#operationsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Operation getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.OperationsListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.OperationsListResponse other = + (com.google.cloud.sql.v1beta4.OperationsListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.OperationsListResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.OperationsListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationsListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.OperationsListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationsListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.OperationsListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationsListResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.OperationsListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationsListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.OperationsListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.OperationsListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.OperationsListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.OperationsListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Operations list response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.OperationsListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.OperationsListResponse) + com.google.cloud.sql.v1beta4.OperationsListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.OperationsListResponse.class, + com.google.cloud.sql.v1beta4.OperationsListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.OperationsListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_OperationsListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationsListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.OperationsListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationsListResponse build() { + com.google.cloud.sql.v1beta4.OperationsListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationsListResponse buildPartial() { + com.google.cloud.sql.v1beta4.OperationsListResponse result = + new com.google.cloud.sql.v1beta4.OperationsListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.OperationsListResponse result) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.OperationsListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.OperationsListResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.OperationsListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.OperationsListResponse other) { + if (other == com.google.cloud.sql.v1beta4.OperationsListResponse.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1beta4.Operation m = + input.readMessage( + com.google.cloud.sql.v1beta4.Operation.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#operationsList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operationsList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#operationsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operationsList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#operationsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Operation, + com.google.cloud.sql.v1beta4.Operation.Builder, + com.google.cloud.sql.v1beta4.OperationOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public com.google.cloud.sql.v1beta4.Operation getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1beta4.Operation value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public Builder setItems( + int index, com.google.cloud.sql.v1beta4.Operation.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.Operation value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1beta4.Operation value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.Operation.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public Builder addItems( + int index, com.google.cloud.sql.v1beta4.Operation.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public com.google.cloud.sql.v1beta4.Operation.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public com.google.cloud.sql.v1beta4.OperationOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public com.google.cloud.sql.v1beta4.Operation.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.Operation.getDefaultInstance()); + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public com.google.cloud.sql.v1beta4.Operation.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.Operation.getDefaultInstance()); + } + + /** + * + * + *
+     * List of operation resources.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Operation, + com.google.cloud.sql.v1beta4.Operation.Builder, + com.google.cloud.sql.v1beta4.OperationOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Operation, + com.google.cloud.sql.v1beta4.Operation.Builder, + com.google.cloud.sql.v1beta4.OperationOrBuilder>( + items_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 3; + * + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.OperationsListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.OperationsListResponse) + private static final com.google.cloud.sql.v1beta4.OperationsListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.OperationsListResponse(); + } + + public static com.google.cloud.sql.v1beta4.OperationsListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationsListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationsListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationsListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationsListResponseOrBuilder.java new file mode 100644 index 000000000000..70f6f3826192 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/OperationsListResponseOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface OperationsListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.OperationsListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#operationsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#operationsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + com.google.cloud.sql.v1beta4.Operation getItems(int index); + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + int getItemsCount(); + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + java.util.List getItemsOrBuilderList(); + + /** + * + * + *
+   * List of operation resources.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Operation items = 2; + */ + com.google.cloud.sql.v1beta4.OperationOrBuilder getItemsOrBuilder(int index); + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PasswordStatus.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PasswordStatus.java new file mode 100644 index 000000000000..fa744e813ba9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PasswordStatus.java @@ -0,0 +1,800 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Read-only password status.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PasswordStatus} + */ +@com.google.protobuf.Generated +public final class PasswordStatus extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.PasswordStatus) + PasswordStatusOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PasswordStatus"); + } + + // Use PasswordStatus.newBuilder() to construct. + private PasswordStatus(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PasswordStatus() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_PasswordStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_PasswordStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PasswordStatus.class, + com.google.cloud.sql.v1beta4.PasswordStatus.Builder.class); + } + + private int bitField0_; + public static final int LOCKED_FIELD_NUMBER = 1; + private boolean locked_ = false; + + /** + * + * + *
+   * If true, user does not have login privileges.
+   * 
+ * + * bool locked = 1; + * + * @return The locked. + */ + @java.lang.Override + public boolean getLocked() { + return locked_; + } + + public static final int PASSWORD_EXPIRATION_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp passwordExpirationTime_; + + /** + * + * + *
+   * The expiration time of the current password.
+   * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + * + * @return Whether the passwordExpirationTime field is set. + */ + @java.lang.Override + public boolean hasPasswordExpirationTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The expiration time of the current password.
+   * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + * + * @return The passwordExpirationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPasswordExpirationTime() { + return passwordExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : passwordExpirationTime_; + } + + /** + * + * + *
+   * The expiration time of the current password.
+   * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPasswordExpirationTimeOrBuilder() { + return passwordExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : passwordExpirationTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (locked_ != false) { + output.writeBool(1, locked_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getPasswordExpirationTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (locked_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, locked_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPasswordExpirationTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.PasswordStatus)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.PasswordStatus other = + (com.google.cloud.sql.v1beta4.PasswordStatus) obj; + + if (getLocked() != other.getLocked()) return false; + if (hasPasswordExpirationTime() != other.hasPasswordExpirationTime()) return false; + if (hasPasswordExpirationTime()) { + if (!getPasswordExpirationTime().equals(other.getPasswordExpirationTime())) return false; + } + if (!getUnknownFields().equals(other.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) + LOCKED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getLocked()); + if (hasPasswordExpirationTime()) { + hash = (37 * hash) + PASSWORD_EXPIRATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPasswordExpirationTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.PasswordStatus parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PasswordStatus parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PasswordStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PasswordStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PasswordStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PasswordStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PasswordStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PasswordStatus parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PasswordStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PasswordStatus parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PasswordStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PasswordStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.PasswordStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Read-only password status.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PasswordStatus} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.PasswordStatus) + com.google.cloud.sql.v1beta4.PasswordStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_PasswordStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_PasswordStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PasswordStatus.class, + com.google.cloud.sql.v1beta4.PasswordStatus.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.PasswordStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPasswordExpirationTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + locked_ = false; + passwordExpirationTime_ = null; + if (passwordExpirationTimeBuilder_ != null) { + passwordExpirationTimeBuilder_.dispose(); + passwordExpirationTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_PasswordStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PasswordStatus getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.PasswordStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PasswordStatus build() { + com.google.cloud.sql.v1beta4.PasswordStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PasswordStatus buildPartial() { + com.google.cloud.sql.v1beta4.PasswordStatus result = + new com.google.cloud.sql.v1beta4.PasswordStatus(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.PasswordStatus result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.locked_ = locked_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.passwordExpirationTime_ = + passwordExpirationTimeBuilder_ == null + ? passwordExpirationTime_ + : passwordExpirationTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.PasswordStatus) { + return mergeFrom((com.google.cloud.sql.v1beta4.PasswordStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.PasswordStatus other) { + if (other == com.google.cloud.sql.v1beta4.PasswordStatus.getDefaultInstance()) return this; + if (other.getLocked() != false) { + setLocked(other.getLocked()); + } + if (other.hasPasswordExpirationTime()) { + mergePasswordExpirationTime(other.getPasswordExpirationTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + locked_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetPasswordExpirationTimeFieldBuilder().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 boolean locked_; + + /** + * + * + *
+     * If true, user does not have login privileges.
+     * 
+ * + * bool locked = 1; + * + * @return The locked. + */ + @java.lang.Override + public boolean getLocked() { + return locked_; + } + + /** + * + * + *
+     * If true, user does not have login privileges.
+     * 
+ * + * bool locked = 1; + * + * @param value The locked to set. + * @return This builder for chaining. + */ + public Builder setLocked(boolean value) { + + locked_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * If true, user does not have login privileges.
+     * 
+ * + * bool locked = 1; + * + * @return This builder for chaining. + */ + public Builder clearLocked() { + bitField0_ = (bitField0_ & ~0x00000001); + locked_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp passwordExpirationTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + passwordExpirationTimeBuilder_; + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + * + * @return Whether the passwordExpirationTime field is set. + */ + public boolean hasPasswordExpirationTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + * + * @return The passwordExpirationTime. + */ + public com.google.protobuf.Timestamp getPasswordExpirationTime() { + if (passwordExpirationTimeBuilder_ == null) { + return passwordExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : passwordExpirationTime_; + } else { + return passwordExpirationTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + public Builder setPasswordExpirationTime(com.google.protobuf.Timestamp value) { + if (passwordExpirationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + passwordExpirationTime_ = value; + } else { + passwordExpirationTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + public Builder setPasswordExpirationTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (passwordExpirationTimeBuilder_ == null) { + passwordExpirationTime_ = builderForValue.build(); + } else { + passwordExpirationTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + public Builder mergePasswordExpirationTime(com.google.protobuf.Timestamp value) { + if (passwordExpirationTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && passwordExpirationTime_ != null + && passwordExpirationTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getPasswordExpirationTimeBuilder().mergeFrom(value); + } else { + passwordExpirationTime_ = value; + } + } else { + passwordExpirationTimeBuilder_.mergeFrom(value); + } + if (passwordExpirationTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + public Builder clearPasswordExpirationTime() { + bitField0_ = (bitField0_ & ~0x00000002); + passwordExpirationTime_ = null; + if (passwordExpirationTimeBuilder_ != null) { + passwordExpirationTimeBuilder_.dispose(); + passwordExpirationTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getPasswordExpirationTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetPasswordExpirationTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getPasswordExpirationTimeOrBuilder() { + if (passwordExpirationTimeBuilder_ != null) { + return passwordExpirationTimeBuilder_.getMessageOrBuilder(); + } else { + return passwordExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : passwordExpirationTime_; + } + } + + /** + * + * + *
+     * The expiration time of the current password.
+     * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetPasswordExpirationTimeFieldBuilder() { + if (passwordExpirationTimeBuilder_ == null) { + passwordExpirationTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPasswordExpirationTime(), getParentForChildren(), isClean()); + passwordExpirationTime_ = null; + } + return passwordExpirationTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.PasswordStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.PasswordStatus) + private static final com.google.cloud.sql.v1beta4.PasswordStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.PasswordStatus(); + } + + public static com.google.cloud.sql.v1beta4.PasswordStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PasswordStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PasswordStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PasswordStatusOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PasswordStatusOrBuilder.java new file mode 100644 index 000000000000..739b6eeafa95 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PasswordStatusOrBuilder.java @@ -0,0 +1,78 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface PasswordStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.PasswordStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If true, user does not have login privileges.
+   * 
+ * + * bool locked = 1; + * + * @return The locked. + */ + boolean getLocked(); + + /** + * + * + *
+   * The expiration time of the current password.
+   * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + * + * @return Whether the passwordExpirationTime field is set. + */ + boolean hasPasswordExpirationTime(); + + /** + * + * + *
+   * The expiration time of the current password.
+   * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + * + * @return The passwordExpirationTime. + */ + com.google.protobuf.Timestamp getPasswordExpirationTime(); + + /** + * + * + *
+   * The expiration time of the current password.
+   * 
+ * + * .google.protobuf.Timestamp password_expiration_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getPasswordExpirationTimeOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PasswordValidationPolicy.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PasswordValidationPolicy.java new file mode 100644 index 000000000000..b890c47d58b3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PasswordValidationPolicy.java @@ -0,0 +1,2530 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance local user password validation policy.
+ * This message defines the password policy for local database users.
+ * When enabled, it enforces constraints on password complexity, length,
+ * and reuse. Keep this policy enabled to help prevent unauthorized access.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PasswordValidationPolicy} + */ +@com.google.protobuf.Generated +public final class PasswordValidationPolicy extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.PasswordValidationPolicy) + PasswordValidationPolicyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PasswordValidationPolicy"); + } + + // Use PasswordValidationPolicy.newBuilder() to construct. + private PasswordValidationPolicy(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PasswordValidationPolicy() { + complexity_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PasswordValidationPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PasswordValidationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PasswordValidationPolicy.class, + com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Builder.class); + } + + /** + * + * + *
+   * The complexity choices of the password.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity} + */ + public enum Complexity implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Complexity check is not specified.
+     * 
+ * + * COMPLEXITY_UNSPECIFIED = 0; + */ + COMPLEXITY_UNSPECIFIED(0), + /** + * + * + *
+     * A combination of lowercase, uppercase, numeric, and non-alphanumeric
+     * characters.
+     * 
+ * + * COMPLEXITY_DEFAULT = 1; + */ + COMPLEXITY_DEFAULT(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Complexity"); + } + + /** + * + * + *
+     * Complexity check is not specified.
+     * 
+ * + * COMPLEXITY_UNSPECIFIED = 0; + */ + public static final int COMPLEXITY_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * A combination of lowercase, uppercase, numeric, and non-alphanumeric
+     * characters.
+     * 
+ * + * COMPLEXITY_DEFAULT = 1; + */ + public static final int COMPLEXITY_DEFAULT_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Complexity 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 Complexity forNumber(int value) { + switch (value) { + case 0: + return COMPLEXITY_UNSPECIFIED; + case 1: + return COMPLEXITY_DEFAULT; + 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 Complexity findValueByNumber(int number) { + return Complexity.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.PasswordValidationPolicy.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Complexity[] VALUES = values(); + + public static Complexity 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 Complexity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity) + } + + private int bitField0_; + public static final int MIN_LENGTH_FIELD_NUMBER = 1; + private com.google.protobuf.Int32Value minLength_; + + /** + * + * + *
+   * Minimum number of characters allowed.
+   * 
+ * + * .google.protobuf.Int32Value min_length = 1; + * + * @return Whether the minLength field is set. + */ + @java.lang.Override + public boolean hasMinLength() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Minimum number of characters allowed.
+   * 
+ * + * .google.protobuf.Int32Value min_length = 1; + * + * @return The minLength. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getMinLength() { + return minLength_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : minLength_; + } + + /** + * + * + *
+   * Minimum number of characters allowed.
+   * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getMinLengthOrBuilder() { + return minLength_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : minLength_; + } + + public static final int COMPLEXITY_FIELD_NUMBER = 2; + private int complexity_ = 0; + + /** + * + * + *
+   * The complexity of the password.
+   * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity complexity = 2; + * + * @return The enum numeric value on the wire for complexity. + */ + @java.lang.Override + public int getComplexityValue() { + return complexity_; + } + + /** + * + * + *
+   * The complexity of the password.
+   * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity complexity = 2; + * + * @return The complexity. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity getComplexity() { + com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity result = + com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity.forNumber(complexity_); + return result == null + ? com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity.UNRECOGNIZED + : result; + } + + public static final int REUSE_INTERVAL_FIELD_NUMBER = 3; + private com.google.protobuf.Int32Value reuseInterval_; + + /** + * + * + *
+   * Number of previous passwords that cannot be reused.
+   * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + * + * @return Whether the reuseInterval field is set. + */ + @java.lang.Override + public boolean hasReuseInterval() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Number of previous passwords that cannot be reused.
+   * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + * + * @return The reuseInterval. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getReuseInterval() { + return reuseInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : reuseInterval_; + } + + /** + * + * + *
+   * Number of previous passwords that cannot be reused.
+   * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getReuseIntervalOrBuilder() { + return reuseInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : reuseInterval_; + } + + public static final int DISALLOW_USERNAME_SUBSTRING_FIELD_NUMBER = 4; + private com.google.protobuf.BoolValue disallowUsernameSubstring_; + + /** + * + * + *
+   * Disallow username as a part of the password.
+   * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + * + * @return Whether the disallowUsernameSubstring field is set. + */ + @java.lang.Override + public boolean hasDisallowUsernameSubstring() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Disallow username as a part of the password.
+   * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + * + * @return The disallowUsernameSubstring. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getDisallowUsernameSubstring() { + return disallowUsernameSubstring_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowUsernameSubstring_; + } + + /** + * + * + *
+   * Disallow username as a part of the password.
+   * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getDisallowUsernameSubstringOrBuilder() { + return disallowUsernameSubstring_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowUsernameSubstring_; + } + + public static final int PASSWORD_CHANGE_INTERVAL_FIELD_NUMBER = 5; + private com.google.protobuf.Duration passwordChangeInterval_; + + /** + * + * + *
+   * Minimum interval after which the password can be changed. This flag is only
+   * supported for PostgreSQL.
+   * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + * + * @return Whether the passwordChangeInterval field is set. + */ + @java.lang.Override + public boolean hasPasswordChangeInterval() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Minimum interval after which the password can be changed. This flag is only
+   * supported for PostgreSQL.
+   * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + * + * @return The passwordChangeInterval. + */ + @java.lang.Override + public com.google.protobuf.Duration getPasswordChangeInterval() { + return passwordChangeInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordChangeInterval_; + } + + /** + * + * + *
+   * Minimum interval after which the password can be changed. This flag is only
+   * supported for PostgreSQL.
+   * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getPasswordChangeIntervalOrBuilder() { + return passwordChangeInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordChangeInterval_; + } + + public static final int ENABLE_PASSWORD_POLICY_FIELD_NUMBER = 6; + private com.google.protobuf.BoolValue enablePasswordPolicy_; + + /** + * + * + *
+   * Whether to enable the password policy or not. When enabled, passwords must
+   * meet complexity requirements. Keep this policy enabled to help prevent
+   * unauthorized access. Disabling this policy allows weak passwords.
+   * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + * + * @return Whether the enablePasswordPolicy field is set. + */ + @java.lang.Override + public boolean hasEnablePasswordPolicy() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Whether to enable the password policy or not. When enabled, passwords must
+   * meet complexity requirements. Keep this policy enabled to help prevent
+   * unauthorized access. Disabling this policy allows weak passwords.
+   * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + * + * @return The enablePasswordPolicy. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnablePasswordPolicy() { + return enablePasswordPolicy_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePasswordPolicy_; + } + + /** + * + * + *
+   * Whether to enable the password policy or not. When enabled, passwords must
+   * meet complexity requirements. Keep this policy enabled to help prevent
+   * unauthorized access. Disabling this policy allows weak passwords.
+   * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getEnablePasswordPolicyOrBuilder() { + return enablePasswordPolicy_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePasswordPolicy_; + } + + public static final int DISALLOW_COMPROMISED_CREDENTIALS_FIELD_NUMBER = 7; + private com.google.protobuf.BoolValue disallowCompromisedCredentials_; + + /** + * + * + *
+   * This field is deprecated and will be removed in a future version of the
+   * API.
+   * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.PasswordValidationPolicy.disallow_compromised_credentials + * is deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3075 + * @return Whether the disallowCompromisedCredentials field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasDisallowCompromisedCredentials() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * This field is deprecated and will be removed in a future version of the
+   * API.
+   * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.PasswordValidationPolicy.disallow_compromised_credentials + * is deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3075 + * @return The disallowCompromisedCredentials. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.BoolValue getDisallowCompromisedCredentials() { + return disallowCompromisedCredentials_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowCompromisedCredentials_; + } + + /** + * + * + *
+   * This field is deprecated and will be removed in a future version of the
+   * API.
+   * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.BoolValueOrBuilder getDisallowCompromisedCredentialsOrBuilder() { + return disallowCompromisedCredentials_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowCompromisedCredentials_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getMinLength()); + } + if (complexity_ + != com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity.COMPLEXITY_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, complexity_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getReuseInterval()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getDisallowUsernameSubstring()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(5, getPasswordChangeInterval()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(6, getEnablePasswordPolicy()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(7, getDisallowCompromisedCredentials()); + } + 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, getMinLength()); + } + if (complexity_ + != com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity.COMPLEXITY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, complexity_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getReuseInterval()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, getDisallowUsernameSubstring()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getPasswordChangeInterval()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(6, getEnablePasswordPolicy()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, getDisallowCompromisedCredentials()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.PasswordValidationPolicy)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.PasswordValidationPolicy other = + (com.google.cloud.sql.v1beta4.PasswordValidationPolicy) obj; + + if (hasMinLength() != other.hasMinLength()) return false; + if (hasMinLength()) { + if (!getMinLength().equals(other.getMinLength())) return false; + } + if (complexity_ != other.complexity_) return false; + if (hasReuseInterval() != other.hasReuseInterval()) return false; + if (hasReuseInterval()) { + if (!getReuseInterval().equals(other.getReuseInterval())) return false; + } + if (hasDisallowUsernameSubstring() != other.hasDisallowUsernameSubstring()) return false; + if (hasDisallowUsernameSubstring()) { + if (!getDisallowUsernameSubstring().equals(other.getDisallowUsernameSubstring())) + return false; + } + if (hasPasswordChangeInterval() != other.hasPasswordChangeInterval()) return false; + if (hasPasswordChangeInterval()) { + if (!getPasswordChangeInterval().equals(other.getPasswordChangeInterval())) return false; + } + if (hasEnablePasswordPolicy() != other.hasEnablePasswordPolicy()) return false; + if (hasEnablePasswordPolicy()) { + if (!getEnablePasswordPolicy().equals(other.getEnablePasswordPolicy())) return false; + } + if (hasDisallowCompromisedCredentials() != other.hasDisallowCompromisedCredentials()) + return false; + if (hasDisallowCompromisedCredentials()) { + if (!getDisallowCompromisedCredentials().equals(other.getDisallowCompromisedCredentials())) + return false; + } + if (!getUnknownFields().equals(other.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 (hasMinLength()) { + hash = (37 * hash) + MIN_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getMinLength().hashCode(); + } + hash = (37 * hash) + COMPLEXITY_FIELD_NUMBER; + hash = (53 * hash) + complexity_; + if (hasReuseInterval()) { + hash = (37 * hash) + REUSE_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getReuseInterval().hashCode(); + } + if (hasDisallowUsernameSubstring()) { + hash = (37 * hash) + DISALLOW_USERNAME_SUBSTRING_FIELD_NUMBER; + hash = (53 * hash) + getDisallowUsernameSubstring().hashCode(); + } + if (hasPasswordChangeInterval()) { + hash = (37 * hash) + PASSWORD_CHANGE_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getPasswordChangeInterval().hashCode(); + } + if (hasEnablePasswordPolicy()) { + hash = (37 * hash) + ENABLE_PASSWORD_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getEnablePasswordPolicy().hashCode(); + } + if (hasDisallowCompromisedCredentials()) { + hash = (37 * hash) + DISALLOW_COMPROMISED_CREDENTIALS_FIELD_NUMBER; + hash = (53 * hash) + getDisallowCompromisedCredentials().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.PasswordValidationPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PasswordValidationPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PasswordValidationPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PasswordValidationPolicy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PasswordValidationPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PasswordValidationPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PasswordValidationPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PasswordValidationPolicy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PasswordValidationPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PasswordValidationPolicy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PasswordValidationPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PasswordValidationPolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.PasswordValidationPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance local user password validation policy.
+   * This message defines the password policy for local database users.
+   * When enabled, it enforces constraints on password complexity, length,
+   * and reuse. Keep this policy enabled to help prevent unauthorized access.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PasswordValidationPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.PasswordValidationPolicy) + com.google.cloud.sql.v1beta4.PasswordValidationPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PasswordValidationPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PasswordValidationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PasswordValidationPolicy.class, + com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.PasswordValidationPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMinLengthFieldBuilder(); + internalGetReuseIntervalFieldBuilder(); + internalGetDisallowUsernameSubstringFieldBuilder(); + internalGetPasswordChangeIntervalFieldBuilder(); + internalGetEnablePasswordPolicyFieldBuilder(); + internalGetDisallowCompromisedCredentialsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minLength_ = null; + if (minLengthBuilder_ != null) { + minLengthBuilder_.dispose(); + minLengthBuilder_ = null; + } + complexity_ = 0; + reuseInterval_ = null; + if (reuseIntervalBuilder_ != null) { + reuseIntervalBuilder_.dispose(); + reuseIntervalBuilder_ = null; + } + disallowUsernameSubstring_ = null; + if (disallowUsernameSubstringBuilder_ != null) { + disallowUsernameSubstringBuilder_.dispose(); + disallowUsernameSubstringBuilder_ = null; + } + passwordChangeInterval_ = null; + if (passwordChangeIntervalBuilder_ != null) { + passwordChangeIntervalBuilder_.dispose(); + passwordChangeIntervalBuilder_ = null; + } + enablePasswordPolicy_ = null; + if (enablePasswordPolicyBuilder_ != null) { + enablePasswordPolicyBuilder_.dispose(); + enablePasswordPolicyBuilder_ = null; + } + disallowCompromisedCredentials_ = null; + if (disallowCompromisedCredentialsBuilder_ != null) { + disallowCompromisedCredentialsBuilder_.dispose(); + disallowCompromisedCredentialsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PasswordValidationPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PasswordValidationPolicy getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.PasswordValidationPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PasswordValidationPolicy build() { + com.google.cloud.sql.v1beta4.PasswordValidationPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PasswordValidationPolicy buildPartial() { + com.google.cloud.sql.v1beta4.PasswordValidationPolicy result = + new com.google.cloud.sql.v1beta4.PasswordValidationPolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.PasswordValidationPolicy result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.minLength_ = minLengthBuilder_ == null ? minLength_ : minLengthBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.complexity_ = complexity_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.reuseInterval_ = + reuseIntervalBuilder_ == null ? reuseInterval_ : reuseIntervalBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.disallowUsernameSubstring_ = + disallowUsernameSubstringBuilder_ == null + ? disallowUsernameSubstring_ + : disallowUsernameSubstringBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.passwordChangeInterval_ = + passwordChangeIntervalBuilder_ == null + ? passwordChangeInterval_ + : passwordChangeIntervalBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.enablePasswordPolicy_ = + enablePasswordPolicyBuilder_ == null + ? enablePasswordPolicy_ + : enablePasswordPolicyBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.disallowCompromisedCredentials_ = + disallowCompromisedCredentialsBuilder_ == null + ? disallowCompromisedCredentials_ + : disallowCompromisedCredentialsBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.PasswordValidationPolicy) { + return mergeFrom((com.google.cloud.sql.v1beta4.PasswordValidationPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.PasswordValidationPolicy other) { + if (other == com.google.cloud.sql.v1beta4.PasswordValidationPolicy.getDefaultInstance()) + return this; + if (other.hasMinLength()) { + mergeMinLength(other.getMinLength()); + } + if (other.complexity_ != 0) { + setComplexityValue(other.getComplexityValue()); + } + if (other.hasReuseInterval()) { + mergeReuseInterval(other.getReuseInterval()); + } + if (other.hasDisallowUsernameSubstring()) { + mergeDisallowUsernameSubstring(other.getDisallowUsernameSubstring()); + } + if (other.hasPasswordChangeInterval()) { + mergePasswordChangeInterval(other.getPasswordChangeInterval()); + } + if (other.hasEnablePasswordPolicy()) { + mergeEnablePasswordPolicy(other.getEnablePasswordPolicy()); + } + if (other.hasDisallowCompromisedCredentials()) { + mergeDisallowCompromisedCredentials(other.getDisallowCompromisedCredentials()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetMinLengthFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + complexity_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage( + internalGetReuseIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetDisallowUsernameSubstringFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetPasswordChangeIntervalFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetEnablePasswordPolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetDisallowCompromisedCredentialsFieldBuilder().getBuilder(), + extensionRegistry); + 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.Int32Value minLength_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + minLengthBuilder_; + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + * + * @return Whether the minLength field is set. + */ + public boolean hasMinLength() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + * + * @return The minLength. + */ + public com.google.protobuf.Int32Value getMinLength() { + if (minLengthBuilder_ == null) { + return minLength_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : minLength_; + } else { + return minLengthBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + public Builder setMinLength(com.google.protobuf.Int32Value value) { + if (minLengthBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minLength_ = value; + } else { + minLengthBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + public Builder setMinLength(com.google.protobuf.Int32Value.Builder builderForValue) { + if (minLengthBuilder_ == null) { + minLength_ = builderForValue.build(); + } else { + minLengthBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + public Builder mergeMinLength(com.google.protobuf.Int32Value value) { + if (minLengthBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && minLength_ != null + && minLength_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getMinLengthBuilder().mergeFrom(value); + } else { + minLength_ = value; + } + } else { + minLengthBuilder_.mergeFrom(value); + } + if (minLength_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + public Builder clearMinLength() { + bitField0_ = (bitField0_ & ~0x00000001); + minLength_ = null; + if (minLengthBuilder_ != null) { + minLengthBuilder_.dispose(); + minLengthBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + public com.google.protobuf.Int32Value.Builder getMinLengthBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetMinLengthFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + public com.google.protobuf.Int32ValueOrBuilder getMinLengthOrBuilder() { + if (minLengthBuilder_ != null) { + return minLengthBuilder_.getMessageOrBuilder(); + } else { + return minLength_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : minLength_; + } + } + + /** + * + * + *
+     * Minimum number of characters allowed.
+     * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetMinLengthFieldBuilder() { + if (minLengthBuilder_ == null) { + minLengthBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getMinLength(), getParentForChildren(), isClean()); + minLength_ = null; + } + return minLengthBuilder_; + } + + private int complexity_ = 0; + + /** + * + * + *
+     * The complexity of the password.
+     * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity complexity = 2; + * + * @return The enum numeric value on the wire for complexity. + */ + @java.lang.Override + public int getComplexityValue() { + return complexity_; + } + + /** + * + * + *
+     * The complexity of the password.
+     * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity complexity = 2; + * + * @param value The enum numeric value on the wire for complexity to set. + * @return This builder for chaining. + */ + public Builder setComplexityValue(int value) { + complexity_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The complexity of the password.
+     * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity complexity = 2; + * + * @return The complexity. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity getComplexity() { + com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity result = + com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity.forNumber(complexity_); + return result == null + ? com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The complexity of the password.
+     * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity complexity = 2; + * + * @param value The complexity to set. + * @return This builder for chaining. + */ + public Builder setComplexity( + com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + complexity_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The complexity of the password.
+     * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity complexity = 2; + * + * @return This builder for chaining. + */ + public Builder clearComplexity() { + bitField0_ = (bitField0_ & ~0x00000002); + complexity_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Int32Value reuseInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + reuseIntervalBuilder_; + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + * + * @return Whether the reuseInterval field is set. + */ + public boolean hasReuseInterval() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + * + * @return The reuseInterval. + */ + public com.google.protobuf.Int32Value getReuseInterval() { + if (reuseIntervalBuilder_ == null) { + return reuseInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : reuseInterval_; + } else { + return reuseIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + public Builder setReuseInterval(com.google.protobuf.Int32Value value) { + if (reuseIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reuseInterval_ = value; + } else { + reuseIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + public Builder setReuseInterval(com.google.protobuf.Int32Value.Builder builderForValue) { + if (reuseIntervalBuilder_ == null) { + reuseInterval_ = builderForValue.build(); + } else { + reuseIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + public Builder mergeReuseInterval(com.google.protobuf.Int32Value value) { + if (reuseIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && reuseInterval_ != null + && reuseInterval_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getReuseIntervalBuilder().mergeFrom(value); + } else { + reuseInterval_ = value; + } + } else { + reuseIntervalBuilder_.mergeFrom(value); + } + if (reuseInterval_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + public Builder clearReuseInterval() { + bitField0_ = (bitField0_ & ~0x00000004); + reuseInterval_ = null; + if (reuseIntervalBuilder_ != null) { + reuseIntervalBuilder_.dispose(); + reuseIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + public com.google.protobuf.Int32Value.Builder getReuseIntervalBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetReuseIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + public com.google.protobuf.Int32ValueOrBuilder getReuseIntervalOrBuilder() { + if (reuseIntervalBuilder_ != null) { + return reuseIntervalBuilder_.getMessageOrBuilder(); + } else { + return reuseInterval_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : reuseInterval_; + } + } + + /** + * + * + *
+     * Number of previous passwords that cannot be reused.
+     * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetReuseIntervalFieldBuilder() { + if (reuseIntervalBuilder_ == null) { + reuseIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getReuseInterval(), getParentForChildren(), isClean()); + reuseInterval_ = null; + } + return reuseIntervalBuilder_; + } + + private com.google.protobuf.BoolValue disallowUsernameSubstring_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + disallowUsernameSubstringBuilder_; + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + * + * @return Whether the disallowUsernameSubstring field is set. + */ + public boolean hasDisallowUsernameSubstring() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + * + * @return The disallowUsernameSubstring. + */ + public com.google.protobuf.BoolValue getDisallowUsernameSubstring() { + if (disallowUsernameSubstringBuilder_ == null) { + return disallowUsernameSubstring_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowUsernameSubstring_; + } else { + return disallowUsernameSubstringBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + public Builder setDisallowUsernameSubstring(com.google.protobuf.BoolValue value) { + if (disallowUsernameSubstringBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + disallowUsernameSubstring_ = value; + } else { + disallowUsernameSubstringBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + public Builder setDisallowUsernameSubstring( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (disallowUsernameSubstringBuilder_ == null) { + disallowUsernameSubstring_ = builderForValue.build(); + } else { + disallowUsernameSubstringBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + public Builder mergeDisallowUsernameSubstring(com.google.protobuf.BoolValue value) { + if (disallowUsernameSubstringBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && disallowUsernameSubstring_ != null + && disallowUsernameSubstring_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getDisallowUsernameSubstringBuilder().mergeFrom(value); + } else { + disallowUsernameSubstring_ = value; + } + } else { + disallowUsernameSubstringBuilder_.mergeFrom(value); + } + if (disallowUsernameSubstring_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + public Builder clearDisallowUsernameSubstring() { + bitField0_ = (bitField0_ & ~0x00000008); + disallowUsernameSubstring_ = null; + if (disallowUsernameSubstringBuilder_ != null) { + disallowUsernameSubstringBuilder_.dispose(); + disallowUsernameSubstringBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + public com.google.protobuf.BoolValue.Builder getDisallowUsernameSubstringBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetDisallowUsernameSubstringFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + public com.google.protobuf.BoolValueOrBuilder getDisallowUsernameSubstringOrBuilder() { + if (disallowUsernameSubstringBuilder_ != null) { + return disallowUsernameSubstringBuilder_.getMessageOrBuilder(); + } else { + return disallowUsernameSubstring_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowUsernameSubstring_; + } + } + + /** + * + * + *
+     * Disallow username as a part of the password.
+     * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetDisallowUsernameSubstringFieldBuilder() { + if (disallowUsernameSubstringBuilder_ == null) { + disallowUsernameSubstringBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getDisallowUsernameSubstring(), getParentForChildren(), isClean()); + disallowUsernameSubstring_ = null; + } + return disallowUsernameSubstringBuilder_; + } + + private com.google.protobuf.Duration passwordChangeInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + passwordChangeIntervalBuilder_; + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + * + * @return Whether the passwordChangeInterval field is set. + */ + public boolean hasPasswordChangeInterval() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + * + * @return The passwordChangeInterval. + */ + public com.google.protobuf.Duration getPasswordChangeInterval() { + if (passwordChangeIntervalBuilder_ == null) { + return passwordChangeInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordChangeInterval_; + } else { + return passwordChangeIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + public Builder setPasswordChangeInterval(com.google.protobuf.Duration value) { + if (passwordChangeIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + passwordChangeInterval_ = value; + } else { + passwordChangeIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + public Builder setPasswordChangeInterval(com.google.protobuf.Duration.Builder builderForValue) { + if (passwordChangeIntervalBuilder_ == null) { + passwordChangeInterval_ = builderForValue.build(); + } else { + passwordChangeIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + public Builder mergePasswordChangeInterval(com.google.protobuf.Duration value) { + if (passwordChangeIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && passwordChangeInterval_ != null + && passwordChangeInterval_ != com.google.protobuf.Duration.getDefaultInstance()) { + getPasswordChangeIntervalBuilder().mergeFrom(value); + } else { + passwordChangeInterval_ = value; + } + } else { + passwordChangeIntervalBuilder_.mergeFrom(value); + } + if (passwordChangeInterval_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + public Builder clearPasswordChangeInterval() { + bitField0_ = (bitField0_ & ~0x00000010); + passwordChangeInterval_ = null; + if (passwordChangeIntervalBuilder_ != null) { + passwordChangeIntervalBuilder_.dispose(); + passwordChangeIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + public com.google.protobuf.Duration.Builder getPasswordChangeIntervalBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetPasswordChangeIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + public com.google.protobuf.DurationOrBuilder getPasswordChangeIntervalOrBuilder() { + if (passwordChangeIntervalBuilder_ != null) { + return passwordChangeIntervalBuilder_.getMessageOrBuilder(); + } else { + return passwordChangeInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordChangeInterval_; + } + } + + /** + * + * + *
+     * Minimum interval after which the password can be changed. This flag is only
+     * supported for PostgreSQL.
+     * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetPasswordChangeIntervalFieldBuilder() { + if (passwordChangeIntervalBuilder_ == null) { + passwordChangeIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getPasswordChangeInterval(), getParentForChildren(), isClean()); + passwordChangeInterval_ = null; + } + return passwordChangeIntervalBuilder_; + } + + private com.google.protobuf.BoolValue enablePasswordPolicy_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + enablePasswordPolicyBuilder_; + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + * + * @return Whether the enablePasswordPolicy field is set. + */ + public boolean hasEnablePasswordPolicy() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + * + * @return The enablePasswordPolicy. + */ + public com.google.protobuf.BoolValue getEnablePasswordPolicy() { + if (enablePasswordPolicyBuilder_ == null) { + return enablePasswordPolicy_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePasswordPolicy_; + } else { + return enablePasswordPolicyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + public Builder setEnablePasswordPolicy(com.google.protobuf.BoolValue value) { + if (enablePasswordPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enablePasswordPolicy_ = value; + } else { + enablePasswordPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + public Builder setEnablePasswordPolicy(com.google.protobuf.BoolValue.Builder builderForValue) { + if (enablePasswordPolicyBuilder_ == null) { + enablePasswordPolicy_ = builderForValue.build(); + } else { + enablePasswordPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + public Builder mergeEnablePasswordPolicy(com.google.protobuf.BoolValue value) { + if (enablePasswordPolicyBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && enablePasswordPolicy_ != null + && enablePasswordPolicy_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getEnablePasswordPolicyBuilder().mergeFrom(value); + } else { + enablePasswordPolicy_ = value; + } + } else { + enablePasswordPolicyBuilder_.mergeFrom(value); + } + if (enablePasswordPolicy_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + public Builder clearEnablePasswordPolicy() { + bitField0_ = (bitField0_ & ~0x00000020); + enablePasswordPolicy_ = null; + if (enablePasswordPolicyBuilder_ != null) { + enablePasswordPolicyBuilder_.dispose(); + enablePasswordPolicyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + public com.google.protobuf.BoolValue.Builder getEnablePasswordPolicyBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetEnablePasswordPolicyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + public com.google.protobuf.BoolValueOrBuilder getEnablePasswordPolicyOrBuilder() { + if (enablePasswordPolicyBuilder_ != null) { + return enablePasswordPolicyBuilder_.getMessageOrBuilder(); + } else { + return enablePasswordPolicy_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enablePasswordPolicy_; + } + } + + /** + * + * + *
+     * Whether to enable the password policy or not. When enabled, passwords must
+     * meet complexity requirements. Keep this policy enabled to help prevent
+     * unauthorized access. Disabling this policy allows weak passwords.
+     * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetEnablePasswordPolicyFieldBuilder() { + if (enablePasswordPolicyBuilder_ == null) { + enablePasswordPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getEnablePasswordPolicy(), getParentForChildren(), isClean()); + enablePasswordPolicy_ = null; + } + return enablePasswordPolicyBuilder_; + } + + private com.google.protobuf.BoolValue disallowCompromisedCredentials_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + disallowCompromisedCredentialsBuilder_; + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + * + * @deprecated + * google.cloud.sql.v1beta4.PasswordValidationPolicy.disallow_compromised_credentials is + * deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3075 + * @return Whether the disallowCompromisedCredentials field is set. + */ + @java.lang.Deprecated + public boolean hasDisallowCompromisedCredentials() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + * + * @deprecated + * google.cloud.sql.v1beta4.PasswordValidationPolicy.disallow_compromised_credentials is + * deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3075 + * @return The disallowCompromisedCredentials. + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValue getDisallowCompromisedCredentials() { + if (disallowCompromisedCredentialsBuilder_ == null) { + return disallowCompromisedCredentials_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowCompromisedCredentials_; + } else { + return disallowCompromisedCredentialsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setDisallowCompromisedCredentials(com.google.protobuf.BoolValue value) { + if (disallowCompromisedCredentialsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + disallowCompromisedCredentials_ = value; + } else { + disallowCompromisedCredentialsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setDisallowCompromisedCredentials( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (disallowCompromisedCredentialsBuilder_ == null) { + disallowCompromisedCredentials_ = builderForValue.build(); + } else { + disallowCompromisedCredentialsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder mergeDisallowCompromisedCredentials(com.google.protobuf.BoolValue value) { + if (disallowCompromisedCredentialsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && disallowCompromisedCredentials_ != null + && disallowCompromisedCredentials_ + != com.google.protobuf.BoolValue.getDefaultInstance()) { + getDisallowCompromisedCredentialsBuilder().mergeFrom(value); + } else { + disallowCompromisedCredentials_ = value; + } + } else { + disallowCompromisedCredentialsBuilder_.mergeFrom(value); + } + if (disallowCompromisedCredentials_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder clearDisallowCompromisedCredentials() { + bitField0_ = (bitField0_ & ~0x00000040); + disallowCompromisedCredentials_ = null; + if (disallowCompromisedCredentialsBuilder_ != null) { + disallowCompromisedCredentialsBuilder_.dispose(); + disallowCompromisedCredentialsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValue.Builder getDisallowCompromisedCredentialsBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetDisallowCompromisedCredentialsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValueOrBuilder getDisallowCompromisedCredentialsOrBuilder() { + if (disallowCompromisedCredentialsBuilder_ != null) { + return disallowCompromisedCredentialsBuilder_.getMessageOrBuilder(); + } else { + return disallowCompromisedCredentials_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : disallowCompromisedCredentials_; + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed in a future version of the
+     * API.
+     * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetDisallowCompromisedCredentialsFieldBuilder() { + if (disallowCompromisedCredentialsBuilder_ == null) { + disallowCompromisedCredentialsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getDisallowCompromisedCredentials(), getParentForChildren(), isClean()); + disallowCompromisedCredentials_ = null; + } + return disallowCompromisedCredentialsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.PasswordValidationPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.PasswordValidationPolicy) + private static final com.google.cloud.sql.v1beta4.PasswordValidationPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.PasswordValidationPolicy(); + } + + public static com.google.cloud.sql.v1beta4.PasswordValidationPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PasswordValidationPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PasswordValidationPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PasswordValidationPolicyOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PasswordValidationPolicyOrBuilder.java new file mode 100644 index 000000000000..c4c01be0ad1a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PasswordValidationPolicyOrBuilder.java @@ -0,0 +1,298 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface PasswordValidationPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.PasswordValidationPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Minimum number of characters allowed.
+   * 
+ * + * .google.protobuf.Int32Value min_length = 1; + * + * @return Whether the minLength field is set. + */ + boolean hasMinLength(); + + /** + * + * + *
+   * Minimum number of characters allowed.
+   * 
+ * + * .google.protobuf.Int32Value min_length = 1; + * + * @return The minLength. + */ + com.google.protobuf.Int32Value getMinLength(); + + /** + * + * + *
+   * Minimum number of characters allowed.
+   * 
+ * + * .google.protobuf.Int32Value min_length = 1; + */ + com.google.protobuf.Int32ValueOrBuilder getMinLengthOrBuilder(); + + /** + * + * + *
+   * The complexity of the password.
+   * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity complexity = 2; + * + * @return The enum numeric value on the wire for complexity. + */ + int getComplexityValue(); + + /** + * + * + *
+   * The complexity of the password.
+   * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity complexity = 2; + * + * @return The complexity. + */ + com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity getComplexity(); + + /** + * + * + *
+   * Number of previous passwords that cannot be reused.
+   * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + * + * @return Whether the reuseInterval field is set. + */ + boolean hasReuseInterval(); + + /** + * + * + *
+   * Number of previous passwords that cannot be reused.
+   * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + * + * @return The reuseInterval. + */ + com.google.protobuf.Int32Value getReuseInterval(); + + /** + * + * + *
+   * Number of previous passwords that cannot be reused.
+   * 
+ * + * .google.protobuf.Int32Value reuse_interval = 3; + */ + com.google.protobuf.Int32ValueOrBuilder getReuseIntervalOrBuilder(); + + /** + * + * + *
+   * Disallow username as a part of the password.
+   * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + * + * @return Whether the disallowUsernameSubstring field is set. + */ + boolean hasDisallowUsernameSubstring(); + + /** + * + * + *
+   * Disallow username as a part of the password.
+   * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + * + * @return The disallowUsernameSubstring. + */ + com.google.protobuf.BoolValue getDisallowUsernameSubstring(); + + /** + * + * + *
+   * Disallow username as a part of the password.
+   * 
+ * + * .google.protobuf.BoolValue disallow_username_substring = 4; + */ + com.google.protobuf.BoolValueOrBuilder getDisallowUsernameSubstringOrBuilder(); + + /** + * + * + *
+   * Minimum interval after which the password can be changed. This flag is only
+   * supported for PostgreSQL.
+   * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + * + * @return Whether the passwordChangeInterval field is set. + */ + boolean hasPasswordChangeInterval(); + + /** + * + * + *
+   * Minimum interval after which the password can be changed. This flag is only
+   * supported for PostgreSQL.
+   * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + * + * @return The passwordChangeInterval. + */ + com.google.protobuf.Duration getPasswordChangeInterval(); + + /** + * + * + *
+   * Minimum interval after which the password can be changed. This flag is only
+   * supported for PostgreSQL.
+   * 
+ * + * .google.protobuf.Duration password_change_interval = 5; + */ + com.google.protobuf.DurationOrBuilder getPasswordChangeIntervalOrBuilder(); + + /** + * + * + *
+   * Whether to enable the password policy or not. When enabled, passwords must
+   * meet complexity requirements. Keep this policy enabled to help prevent
+   * unauthorized access. Disabling this policy allows weak passwords.
+   * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + * + * @return Whether the enablePasswordPolicy field is set. + */ + boolean hasEnablePasswordPolicy(); + + /** + * + * + *
+   * Whether to enable the password policy or not. When enabled, passwords must
+   * meet complexity requirements. Keep this policy enabled to help prevent
+   * unauthorized access. Disabling this policy allows weak passwords.
+   * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + * + * @return The enablePasswordPolicy. + */ + com.google.protobuf.BoolValue getEnablePasswordPolicy(); + + /** + * + * + *
+   * Whether to enable the password policy or not. When enabled, passwords must
+   * meet complexity requirements. Keep this policy enabled to help prevent
+   * unauthorized access. Disabling this policy allows weak passwords.
+   * 
+ * + * .google.protobuf.BoolValue enable_password_policy = 6; + */ + com.google.protobuf.BoolValueOrBuilder getEnablePasswordPolicyOrBuilder(); + + /** + * + * + *
+   * This field is deprecated and will be removed in a future version of the
+   * API.
+   * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.PasswordValidationPolicy.disallow_compromised_credentials + * is deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3075 + * @return Whether the disallowCompromisedCredentials field is set. + */ + @java.lang.Deprecated + boolean hasDisallowCompromisedCredentials(); + + /** + * + * + *
+   * This field is deprecated and will be removed in a future version of the
+   * API.
+   * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.PasswordValidationPolicy.disallow_compromised_credentials + * is deprecated. See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3075 + * @return The disallowCompromisedCredentials. + */ + @java.lang.Deprecated + com.google.protobuf.BoolValue getDisallowCompromisedCredentials(); + + /** + * + * + *
+   * This field is deprecated and will be removed in a future version of the
+   * API.
+   * 
+ * + * .google.protobuf.BoolValue disallow_compromised_credentials = 7 [deprecated = true]; + * + */ + @java.lang.Deprecated + com.google.protobuf.BoolValueOrBuilder getDisallowCompromisedCredentialsOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PerformDiskShrinkContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PerformDiskShrinkContext.java new file mode 100644 index 000000000000..e20cf561ce36 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PerformDiskShrinkContext.java @@ -0,0 +1,504 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Perform disk shrink context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PerformDiskShrinkContext} + */ +@com.google.protobuf.Generated +public final class PerformDiskShrinkContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.PerformDiskShrinkContext) + PerformDiskShrinkContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PerformDiskShrinkContext"); + } + + // Use PerformDiskShrinkContext.newBuilder() to construct. + private PerformDiskShrinkContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PerformDiskShrinkContext() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PerformDiskShrinkContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PerformDiskShrinkContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.class, + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.Builder.class); + } + + public static final int TARGET_SIZE_GB_FIELD_NUMBER = 1; + private long targetSizeGb_ = 0L; + + /** + * + * + *
+   * The target disk shrink size in GigaBytes.
+   * 
+ * + * int64 target_size_gb = 1; + * + * @return The targetSizeGb. + */ + @java.lang.Override + public long getTargetSizeGb() { + return targetSizeGb_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (targetSizeGb_ != 0L) { + output.writeInt64(1, targetSizeGb_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (targetSizeGb_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, targetSizeGb_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.PerformDiskShrinkContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext other = + (com.google.cloud.sql.v1beta4.PerformDiskShrinkContext) obj; + + if (getTargetSizeGb() != other.getTargetSizeGb()) return false; + if (!getUnknownFields().equals(other.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) + TARGET_SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTargetSizeGb()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.PerformDiskShrinkContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PerformDiskShrinkContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PerformDiskShrinkContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PerformDiskShrinkContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PerformDiskShrinkContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PerformDiskShrinkContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PerformDiskShrinkContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PerformDiskShrinkContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PerformDiskShrinkContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PerformDiskShrinkContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PerformDiskShrinkContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PerformDiskShrinkContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Perform disk shrink context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PerformDiskShrinkContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.PerformDiskShrinkContext) + com.google.cloud.sql.v1beta4.PerformDiskShrinkContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PerformDiskShrinkContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PerformDiskShrinkContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.class, + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + targetSizeGb_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PerformDiskShrinkContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PerformDiskShrinkContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PerformDiskShrinkContext build() { + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PerformDiskShrinkContext buildPartial() { + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext result = + new com.google.cloud.sql.v1beta4.PerformDiskShrinkContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.PerformDiskShrinkContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.targetSizeGb_ = targetSizeGb_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.PerformDiskShrinkContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.PerformDiskShrinkContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.PerformDiskShrinkContext other) { + if (other == com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.getDefaultInstance()) + return this; + if (other.getTargetSizeGb() != 0L) { + setTargetSizeGb(other.getTargetSizeGb()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + targetSizeGb_ = input.readInt64(); + 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 long targetSizeGb_; + + /** + * + * + *
+     * The target disk shrink size in GigaBytes.
+     * 
+ * + * int64 target_size_gb = 1; + * + * @return The targetSizeGb. + */ + @java.lang.Override + public long getTargetSizeGb() { + return targetSizeGb_; + } + + /** + * + * + *
+     * The target disk shrink size in GigaBytes.
+     * 
+ * + * int64 target_size_gb = 1; + * + * @param value The targetSizeGb to set. + * @return This builder for chaining. + */ + public Builder setTargetSizeGb(long value) { + + targetSizeGb_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The target disk shrink size in GigaBytes.
+     * 
+ * + * int64 target_size_gb = 1; + * + * @return This builder for chaining. + */ + public Builder clearTargetSizeGb() { + bitField0_ = (bitField0_ & ~0x00000001); + targetSizeGb_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.PerformDiskShrinkContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.PerformDiskShrinkContext) + private static final com.google.cloud.sql.v1beta4.PerformDiskShrinkContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.PerformDiskShrinkContext(); + } + + public static com.google.cloud.sql.v1beta4.PerformDiskShrinkContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PerformDiskShrinkContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PerformDiskShrinkContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PerformDiskShrinkContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PerformDiskShrinkContextOrBuilder.java new file mode 100644 index 000000000000..2e66db48feea --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PerformDiskShrinkContextOrBuilder.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface PerformDiskShrinkContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.PerformDiskShrinkContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The target disk shrink size in GigaBytes.
+   * 
+ * + * int64 target_size_gb = 1; + * + * @return The targetSizeGb. + */ + long getTargetSizeGb(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PerformanceCaptureConfig.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PerformanceCaptureConfig.java new file mode 100644 index 000000000000..b84dc996150d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PerformanceCaptureConfig.java @@ -0,0 +1,3084 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Performance capture configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PerformanceCaptureConfig} + */ +@com.google.protobuf.Generated +public final class PerformanceCaptureConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.PerformanceCaptureConfig) + PerformanceCaptureConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PerformanceCaptureConfig"); + } + + // Use PerformanceCaptureConfig.newBuilder() to construct. + private PerformanceCaptureConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PerformanceCaptureConfig() { + transactionKillExcludedUserHosts_ = com.google.protobuf.LazyStringArrayList.emptyList(); + transactionKillType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PerformanceCaptureConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PerformanceCaptureConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.class, + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.Builder.class); + } + + /** + * + * + *
+   * Defines the categories of long-running transactions eligible for automatic
+   * termination by the Performance Capture.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType} + */ + public enum TransactionKillType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * TRANSACTION_KILL_TYPE_UNSPECIFIED = 0; + */ + TRANSACTION_KILL_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Only read-only transactions are eligible for termination.
+     * 
+ * + * READ_ONLY_TRANSACTIONS = 1; + */ + READ_ONLY_TRANSACTIONS(1), + /** + * + * + *
+     * All transactions are eligible for termination, including those with write
+     * operations (such as INSERT, UPDATE, DELETE, or DDL).
+     * 
+ * + * ALL_TRANSACTIONS = 2; + */ + ALL_TRANSACTIONS(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TransactionKillType"); + } + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * TRANSACTION_KILL_TYPE_UNSPECIFIED = 0; + */ + public static final int TRANSACTION_KILL_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Only read-only transactions are eligible for termination.
+     * 
+ * + * READ_ONLY_TRANSACTIONS = 1; + */ + public static final int READ_ONLY_TRANSACTIONS_VALUE = 1; + + /** + * + * + *
+     * All transactions are eligible for termination, including those with write
+     * operations (such as INSERT, UPDATE, DELETE, or DDL).
+     * 
+ * + * ALL_TRANSACTIONS = 2; + */ + public static final int ALL_TRANSACTIONS_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 TransactionKillType 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 TransactionKillType forNumber(int value) { + switch (value) { + case 0: + return TRANSACTION_KILL_TYPE_UNSPECIFIED; + case 1: + return READ_ONLY_TRANSACTIONS; + case 2: + return ALL_TRANSACTIONS; + 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 TransactionKillType findValueByNumber(int number) { + return TransactionKillType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final TransactionKillType[] VALUES = values(); + + public static TransactionKillType 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 TransactionKillType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType) + } + + private int bitField0_; + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + + /** + * + * + *
+   * Optional. Enables or disables the performance capture feature.
+   * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Enables or disables the performance capture feature.
+   * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + public static final int PROBING_INTERVAL_SECONDS_FIELD_NUMBER = 2; + private int probingIntervalSeconds_ = 0; + + /** + * + * + *
+   * Optional. Specifies the interval in seconds between consecutive probes that
+   * check if any trigger condition thresholds have been reached.
+   * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the probingIntervalSeconds field is set. + */ + @java.lang.Override + public boolean hasProbingIntervalSeconds() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the interval in seconds between consecutive probes that
+   * check if any trigger condition thresholds have been reached.
+   * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The probingIntervalSeconds. + */ + @java.lang.Override + public int getProbingIntervalSeconds() { + return probingIntervalSeconds_; + } + + public static final int PROBE_THRESHOLD_FIELD_NUMBER = 3; + private int probeThreshold_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum number of consecutive probe threshold that
+   * triggers performance capture.
+   * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the probeThreshold field is set. + */ + @java.lang.Override + public boolean hasProbeThreshold() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum number of consecutive probe threshold that
+   * triggers performance capture.
+   * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The probeThreshold. + */ + @java.lang.Override + public int getProbeThreshold() { + return probeThreshold_; + } + + public static final int RUNNING_THREADS_THRESHOLD_FIELD_NUMBER = 4; + private int runningThreadsThreshold_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum number of MySQL `Threads_running` to
+   * trigger the performance capture on the primary instance.
+   * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the runningThreadsThreshold field is set. + */ + @java.lang.Override + public boolean hasRunningThreadsThreshold() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum number of MySQL `Threads_running` to
+   * trigger the performance capture on the primary instance.
+   * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The runningThreadsThreshold. + */ + @java.lang.Override + public int getRunningThreadsThreshold() { + return runningThreadsThreshold_; + } + + public static final int SECONDS_BEHIND_SOURCE_THRESHOLD_FIELD_NUMBER = 5; + private int secondsBehindSourceThreshold_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum number of seconds replica must be lagging
+   * behind primary instance to trigger the performance capture on replica.
+   * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the secondsBehindSourceThreshold field is set. + */ + @java.lang.Override + public boolean hasSecondsBehindSourceThreshold() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum number of seconds replica must be lagging
+   * behind primary instance to trigger the performance capture on replica.
+   * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The secondsBehindSourceThreshold. + */ + @java.lang.Override + public int getSecondsBehindSourceThreshold() { + return secondsBehindSourceThreshold_; + } + + public static final int TRANSACTION_DURATION_THRESHOLD_FIELD_NUMBER = 8; + private int transactionDurationThreshold_ = 0; + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts recording it.
+   * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionDurationThreshold field is set. + */ + @java.lang.Override + public boolean hasTransactionDurationThreshold() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts recording it.
+   * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionDurationThreshold. + */ + @java.lang.Override + public int getTransactionDurationThreshold() { + return transactionDurationThreshold_; + } + + public static final int CPU_UTILIZATION_THRESHOLD_PERCENT_FIELD_NUMBER = 9; + private int cpuUtilizationThresholdPercent_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of CPU utilization to trigger
+   * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+   * to disable the check.
+   * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cpuUtilizationThresholdPercent field is set. + */ + @java.lang.Override + public boolean hasCpuUtilizationThresholdPercent() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of CPU utilization to trigger
+   * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+   * to disable the check.
+   * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cpuUtilizationThresholdPercent. + */ + @java.lang.Override + public int getCpuUtilizationThresholdPercent() { + return cpuUtilizationThresholdPercent_; + } + + public static final int MEMORY_USAGE_THRESHOLD_PERCENT_FIELD_NUMBER = 10; + private int memoryUsageThresholdPercent_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of memory usage to trigger the
+   * performance capture.
+   * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the memoryUsageThresholdPercent field is set. + */ + @java.lang.Override + public boolean hasMemoryUsageThresholdPercent() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of memory usage to trigger the
+   * performance capture.
+   * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The memoryUsageThresholdPercent. + */ + @java.lang.Override + public int getMemoryUsageThresholdPercent() { + return memoryUsageThresholdPercent_; + } + + public static final int TRANSACTION_LOCK_WAIT_THRESHOLD_COUNT_FIELD_NUMBER = 11; + private int transactionLockWaitThresholdCount_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of transactions in lock wait
+   * state to trigger the performance capture. Valid integers range from `10` to
+   * `10000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionLockWaitThresholdCount field is set. + */ + @java.lang.Override + public boolean hasTransactionLockWaitThresholdCount() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of transactions in lock wait
+   * state to trigger the performance capture. Valid integers range from `10` to
+   * `10000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionLockWaitThresholdCount. + */ + @java.lang.Override + public int getTransactionLockWaitThresholdCount() { + return transactionLockWaitThresholdCount_; + } + + public static final int SEMAPHORE_WAIT_THRESHOLD_COUNT_FIELD_NUMBER = 12; + private int semaphoreWaitThresholdCount_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of semaphore waits to
+   * trigger the performance capture. Valid integers range from `10` to `10000`.
+   * Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the semaphoreWaitThresholdCount field is set. + */ + @java.lang.Override + public boolean hasSemaphoreWaitThresholdCount() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of semaphore waits to
+   * trigger the performance capture. Valid integers range from `10` to `10000`.
+   * Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The semaphoreWaitThresholdCount. + */ + @java.lang.Override + public int getSemaphoreWaitThresholdCount() { + return semaphoreWaitThresholdCount_; + } + + public static final int HISTORY_LIST_LENGTH_THRESHOLD_COUNT_FIELD_NUMBER = 13; + private int historyListLengthThresholdCount_ = 0; + + /** + * + * + *
+   * Optional. Specifies the minimum number of undo log entries in the history
+   * list length to trigger the performance capture. Valid integers range from
+   * `10000` to `10000000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the historyListLengthThresholdCount field is set. + */ + @java.lang.Override + public boolean hasHistoryListLengthThresholdCount() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the minimum number of undo log entries in the history
+   * list length to trigger the performance capture. Valid integers range from
+   * `10000` to `10000000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The historyListLengthThresholdCount. + */ + @java.lang.Override + public int getHistoryListLengthThresholdCount() { + return historyListLengthThresholdCount_; + } + + public static final int TRANSACTION_KILL_THRESHOLD_SECONDS_FIELD_NUMBER = 14; + private int transactionKillThresholdSeconds_ = 0; + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts terminating it. Valid integers
+   * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+   * (i.e., > 0), this value must be greater than or equal to
+   * `transaction_duration_threshold`. Configurations where
+   * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+   * will be rejected.
+   * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionKillThresholdSeconds field is set. + */ + @java.lang.Override + public boolean hasTransactionKillThresholdSeconds() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts terminating it. Valid integers
+   * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+   * (i.e., > 0), this value must be greater than or equal to
+   * `transaction_duration_threshold`. Configurations where
+   * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+   * will be rejected.
+   * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionKillThresholdSeconds. + */ + @java.lang.Override + public int getTransactionKillThresholdSeconds() { + return transactionKillThresholdSeconds_; + } + + public static final int TRANSACTION_KILL_EXCLUDED_USER_HOSTS_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList transactionKillExcludedUserHosts_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the transactionKillExcludedUserHosts. + */ + public com.google.protobuf.ProtocolStringList getTransactionKillExcludedUserHostsList() { + return transactionKillExcludedUserHosts_; + } + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of transactionKillExcludedUserHosts. + */ + public int getTransactionKillExcludedUserHostsCount() { + return transactionKillExcludedUserHosts_.size(); + } + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The transactionKillExcludedUserHosts at the given index. + */ + public java.lang.String getTransactionKillExcludedUserHosts(int index) { + return transactionKillExcludedUserHosts_.get(index); + } + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the transactionKillExcludedUserHosts at the given index. + */ + public com.google.protobuf.ByteString getTransactionKillExcludedUserHostsBytes(int index) { + return transactionKillExcludedUserHosts_.getByteString(index); + } + + public static final int TRANSACTION_KILL_TYPE_FIELD_NUMBER = 17; + private int transactionKillType_ = 0; + + /** + * + * + *
+   * Optional. Determines which transactions are allowed to be terminated when
+   * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+   * write-heavy transactions from auto-termination if desired. Defaults to
+   * `READ_ONLY_TRANSACTIONS` if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionKillType field is set. + */ + @java.lang.Override + public boolean hasTransactionKillType() { + return ((bitField0_ & 0x00001000) != 0); + } + + /** + * + * + *
+   * Optional. Determines which transactions are allowed to be terminated when
+   * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+   * write-heavy transactions from auto-termination if desired. Defaults to
+   * `READ_ONLY_TRANSACTIONS` if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for transactionKillType. + */ + @java.lang.Override + public int getTransactionKillTypeValue() { + return transactionKillType_; + } + + /** + * + * + *
+   * Optional. Determines which transactions are allowed to be terminated when
+   * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+   * write-heavy transactions from auto-termination if desired. Defaults to
+   * `READ_ONLY_TRANSACTIONS` if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionKillType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType + getTransactionKillType() { + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType result = + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType.forNumber( + transactionKillType_); + return result == null + ? com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, enabled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(2, probingIntervalSeconds_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(3, probeThreshold_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeInt32(4, runningThreadsThreshold_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeInt32(5, secondsBehindSourceThreshold_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeInt32(8, transactionDurationThreshold_); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeInt32(9, cpuUtilizationThresholdPercent_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeInt32(10, memoryUsageThresholdPercent_); + } + if (((bitField0_ & 0x00000100) != 0)) { + output.writeInt32(11, transactionLockWaitThresholdCount_); + } + if (((bitField0_ & 0x00000200) != 0)) { + output.writeInt32(12, semaphoreWaitThresholdCount_); + } + if (((bitField0_ & 0x00000400) != 0)) { + output.writeInt32(13, historyListLengthThresholdCount_); + } + if (((bitField0_ & 0x00000800) != 0)) { + output.writeInt32(14, transactionKillThresholdSeconds_); + } + for (int i = 0; i < transactionKillExcludedUserHosts_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 16, transactionKillExcludedUserHosts_.getRaw(i)); + } + if (((bitField0_ & 0x00001000) != 0)) { + output.writeEnum(17, transactionKillType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enabled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, probingIntervalSeconds_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, probeThreshold_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, runningThreadsThreshold_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(5, secondsBehindSourceThreshold_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(8, transactionDurationThreshold_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 9, cpuUtilizationThresholdPercent_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(10, memoryUsageThresholdPercent_); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 11, transactionLockWaitThresholdCount_); + } + if (((bitField0_ & 0x00000200) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(12, semaphoreWaitThresholdCount_); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 13, historyListLengthThresholdCount_); + } + if (((bitField0_ & 0x00000800) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 14, transactionKillThresholdSeconds_); + } + { + int dataSize = 0; + for (int i = 0; i < transactionKillExcludedUserHosts_.size(); i++) { + dataSize += computeStringSizeNoTag(transactionKillExcludedUserHosts_.getRaw(i)); + } + size += dataSize; + size += 2 * getTransactionKillExcludedUserHostsList().size(); + } + if (((bitField0_ & 0x00001000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(17, transactionKillType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.PerformanceCaptureConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig other = + (com.google.cloud.sql.v1beta4.PerformanceCaptureConfig) obj; + + if (hasEnabled() != other.hasEnabled()) return false; + if (hasEnabled()) { + if (getEnabled() != other.getEnabled()) return false; + } + if (hasProbingIntervalSeconds() != other.hasProbingIntervalSeconds()) return false; + if (hasProbingIntervalSeconds()) { + if (getProbingIntervalSeconds() != other.getProbingIntervalSeconds()) return false; + } + if (hasProbeThreshold() != other.hasProbeThreshold()) return false; + if (hasProbeThreshold()) { + if (getProbeThreshold() != other.getProbeThreshold()) return false; + } + if (hasRunningThreadsThreshold() != other.hasRunningThreadsThreshold()) return false; + if (hasRunningThreadsThreshold()) { + if (getRunningThreadsThreshold() != other.getRunningThreadsThreshold()) return false; + } + if (hasSecondsBehindSourceThreshold() != other.hasSecondsBehindSourceThreshold()) return false; + if (hasSecondsBehindSourceThreshold()) { + if (getSecondsBehindSourceThreshold() != other.getSecondsBehindSourceThreshold()) + return false; + } + if (hasTransactionDurationThreshold() != other.hasTransactionDurationThreshold()) return false; + if (hasTransactionDurationThreshold()) { + if (getTransactionDurationThreshold() != other.getTransactionDurationThreshold()) + return false; + } + if (hasCpuUtilizationThresholdPercent() != other.hasCpuUtilizationThresholdPercent()) + return false; + if (hasCpuUtilizationThresholdPercent()) { + if (getCpuUtilizationThresholdPercent() != other.getCpuUtilizationThresholdPercent()) + return false; + } + if (hasMemoryUsageThresholdPercent() != other.hasMemoryUsageThresholdPercent()) return false; + if (hasMemoryUsageThresholdPercent()) { + if (getMemoryUsageThresholdPercent() != other.getMemoryUsageThresholdPercent()) return false; + } + if (hasTransactionLockWaitThresholdCount() != other.hasTransactionLockWaitThresholdCount()) + return false; + if (hasTransactionLockWaitThresholdCount()) { + if (getTransactionLockWaitThresholdCount() != other.getTransactionLockWaitThresholdCount()) + return false; + } + if (hasSemaphoreWaitThresholdCount() != other.hasSemaphoreWaitThresholdCount()) return false; + if (hasSemaphoreWaitThresholdCount()) { + if (getSemaphoreWaitThresholdCount() != other.getSemaphoreWaitThresholdCount()) return false; + } + if (hasHistoryListLengthThresholdCount() != other.hasHistoryListLengthThresholdCount()) + return false; + if (hasHistoryListLengthThresholdCount()) { + if (getHistoryListLengthThresholdCount() != other.getHistoryListLengthThresholdCount()) + return false; + } + if (hasTransactionKillThresholdSeconds() != other.hasTransactionKillThresholdSeconds()) + return false; + if (hasTransactionKillThresholdSeconds()) { + if (getTransactionKillThresholdSeconds() != other.getTransactionKillThresholdSeconds()) + return false; + } + if (!getTransactionKillExcludedUserHostsList() + .equals(other.getTransactionKillExcludedUserHostsList())) return false; + if (hasTransactionKillType() != other.hasTransactionKillType()) return false; + if (hasTransactionKillType()) { + if (transactionKillType_ != other.transactionKillType_) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); + } + if (hasProbingIntervalSeconds()) { + hash = (37 * hash) + PROBING_INTERVAL_SECONDS_FIELD_NUMBER; + hash = (53 * hash) + getProbingIntervalSeconds(); + } + if (hasProbeThreshold()) { + hash = (37 * hash) + PROBE_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getProbeThreshold(); + } + if (hasRunningThreadsThreshold()) { + hash = (37 * hash) + RUNNING_THREADS_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getRunningThreadsThreshold(); + } + if (hasSecondsBehindSourceThreshold()) { + hash = (37 * hash) + SECONDS_BEHIND_SOURCE_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getSecondsBehindSourceThreshold(); + } + if (hasTransactionDurationThreshold()) { + hash = (37 * hash) + TRANSACTION_DURATION_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getTransactionDurationThreshold(); + } + if (hasCpuUtilizationThresholdPercent()) { + hash = (37 * hash) + CPU_UTILIZATION_THRESHOLD_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getCpuUtilizationThresholdPercent(); + } + if (hasMemoryUsageThresholdPercent()) { + hash = (37 * hash) + MEMORY_USAGE_THRESHOLD_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getMemoryUsageThresholdPercent(); + } + if (hasTransactionLockWaitThresholdCount()) { + hash = (37 * hash) + TRANSACTION_LOCK_WAIT_THRESHOLD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getTransactionLockWaitThresholdCount(); + } + if (hasSemaphoreWaitThresholdCount()) { + hash = (37 * hash) + SEMAPHORE_WAIT_THRESHOLD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getSemaphoreWaitThresholdCount(); + } + if (hasHistoryListLengthThresholdCount()) { + hash = (37 * hash) + HISTORY_LIST_LENGTH_THRESHOLD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getHistoryListLengthThresholdCount(); + } + if (hasTransactionKillThresholdSeconds()) { + hash = (37 * hash) + TRANSACTION_KILL_THRESHOLD_SECONDS_FIELD_NUMBER; + hash = (53 * hash) + getTransactionKillThresholdSeconds(); + } + if (getTransactionKillExcludedUserHostsCount() > 0) { + hash = (37 * hash) + TRANSACTION_KILL_EXCLUDED_USER_HOSTS_FIELD_NUMBER; + hash = (53 * hash) + getTransactionKillExcludedUserHostsList().hashCode(); + } + if (hasTransactionKillType()) { + hash = (37 * hash) + TRANSACTION_KILL_TYPE_FIELD_NUMBER; + hash = (53 * hash) + transactionKillType_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.PerformanceCaptureConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PerformanceCaptureConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PerformanceCaptureConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PerformanceCaptureConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PerformanceCaptureConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PerformanceCaptureConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PerformanceCaptureConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PerformanceCaptureConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PerformanceCaptureConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PerformanceCaptureConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PerformanceCaptureConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PerformanceCaptureConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Performance capture configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PerformanceCaptureConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.PerformanceCaptureConfig) + com.google.cloud.sql.v1beta4.PerformanceCaptureConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PerformanceCaptureConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PerformanceCaptureConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.class, + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enabled_ = false; + probingIntervalSeconds_ = 0; + probeThreshold_ = 0; + runningThreadsThreshold_ = 0; + secondsBehindSourceThreshold_ = 0; + transactionDurationThreshold_ = 0; + cpuUtilizationThresholdPercent_ = 0; + memoryUsageThresholdPercent_ = 0; + transactionLockWaitThresholdCount_ = 0; + semaphoreWaitThresholdCount_ = 0; + historyListLengthThresholdCount_ = 0; + transactionKillThresholdSeconds_ = 0; + transactionKillExcludedUserHosts_ = com.google.protobuf.LazyStringArrayList.emptyList(); + transactionKillType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PerformanceCaptureConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PerformanceCaptureConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PerformanceCaptureConfig build() { + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PerformanceCaptureConfig buildPartial() { + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig result = + new com.google.cloud.sql.v1beta4.PerformanceCaptureConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.PerformanceCaptureConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enabled_ = enabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.probingIntervalSeconds_ = probingIntervalSeconds_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.probeThreshold_ = probeThreshold_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.runningThreadsThreshold_ = runningThreadsThreshold_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.secondsBehindSourceThreshold_ = secondsBehindSourceThreshold_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.transactionDurationThreshold_ = transactionDurationThreshold_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.cpuUtilizationThresholdPercent_ = cpuUtilizationThresholdPercent_; + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.memoryUsageThresholdPercent_ = memoryUsageThresholdPercent_; + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.transactionLockWaitThresholdCount_ = transactionLockWaitThresholdCount_; + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.semaphoreWaitThresholdCount_ = semaphoreWaitThresholdCount_; + to_bitField0_ |= 0x00000200; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.historyListLengthThresholdCount_ = historyListLengthThresholdCount_; + to_bitField0_ |= 0x00000400; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.transactionKillThresholdSeconds_ = transactionKillThresholdSeconds_; + to_bitField0_ |= 0x00000800; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + transactionKillExcludedUserHosts_.makeImmutable(); + result.transactionKillExcludedUserHosts_ = transactionKillExcludedUserHosts_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.transactionKillType_ = transactionKillType_; + to_bitField0_ |= 0x00001000; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.PerformanceCaptureConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.PerformanceCaptureConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.PerformanceCaptureConfig other) { + if (other == com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.getDefaultInstance()) + return this; + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); + } + if (other.hasProbingIntervalSeconds()) { + setProbingIntervalSeconds(other.getProbingIntervalSeconds()); + } + if (other.hasProbeThreshold()) { + setProbeThreshold(other.getProbeThreshold()); + } + if (other.hasRunningThreadsThreshold()) { + setRunningThreadsThreshold(other.getRunningThreadsThreshold()); + } + if (other.hasSecondsBehindSourceThreshold()) { + setSecondsBehindSourceThreshold(other.getSecondsBehindSourceThreshold()); + } + if (other.hasTransactionDurationThreshold()) { + setTransactionDurationThreshold(other.getTransactionDurationThreshold()); + } + if (other.hasCpuUtilizationThresholdPercent()) { + setCpuUtilizationThresholdPercent(other.getCpuUtilizationThresholdPercent()); + } + if (other.hasMemoryUsageThresholdPercent()) { + setMemoryUsageThresholdPercent(other.getMemoryUsageThresholdPercent()); + } + if (other.hasTransactionLockWaitThresholdCount()) { + setTransactionLockWaitThresholdCount(other.getTransactionLockWaitThresholdCount()); + } + if (other.hasSemaphoreWaitThresholdCount()) { + setSemaphoreWaitThresholdCount(other.getSemaphoreWaitThresholdCount()); + } + if (other.hasHistoryListLengthThresholdCount()) { + setHistoryListLengthThresholdCount(other.getHistoryListLengthThresholdCount()); + } + if (other.hasTransactionKillThresholdSeconds()) { + setTransactionKillThresholdSeconds(other.getTransactionKillThresholdSeconds()); + } + if (!other.transactionKillExcludedUserHosts_.isEmpty()) { + if (transactionKillExcludedUserHosts_.isEmpty()) { + transactionKillExcludedUserHosts_ = other.transactionKillExcludedUserHosts_; + bitField0_ |= 0x00001000; + } else { + ensureTransactionKillExcludedUserHostsIsMutable(); + transactionKillExcludedUserHosts_.addAll(other.transactionKillExcludedUserHosts_); + } + onChanged(); + } + if (other.hasTransactionKillType()) { + setTransactionKillTypeValue(other.getTransactionKillTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + probingIntervalSeconds_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + probeThreshold_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + runningThreadsThreshold_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + secondsBehindSourceThreshold_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 64: + { + transactionDurationThreshold_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 64 + case 72: + { + cpuUtilizationThresholdPercent_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 72 + case 80: + { + memoryUsageThresholdPercent_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 80 + case 88: + { + transactionLockWaitThresholdCount_ = input.readInt32(); + bitField0_ |= 0x00000100; + break; + } // case 88 + case 96: + { + semaphoreWaitThresholdCount_ = input.readInt32(); + bitField0_ |= 0x00000200; + break; + } // case 96 + case 104: + { + historyListLengthThresholdCount_ = input.readInt32(); + bitField0_ |= 0x00000400; + break; + } // case 104 + case 112: + { + transactionKillThresholdSeconds_ = input.readInt32(); + bitField0_ |= 0x00000800; + break; + } // case 112 + case 130: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureTransactionKillExcludedUserHostsIsMutable(); + transactionKillExcludedUserHosts_.add(s); + break; + } // case 130 + case 136: + { + transactionKillType_ = input.readEnum(); + bitField0_ |= 0x00002000; + break; + } // case 136 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean enabled_; + + /** + * + * + *
+     * Optional. Enables or disables the performance capture feature.
+     * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. Enables or disables the performance capture feature.
+     * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + /** + * + * + *
+     * Optional. Enables or disables the performance capture feature.
+     * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Enables or disables the performance capture feature.
+     * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + enabled_ = false; + onChanged(); + return this; + } + + private int probingIntervalSeconds_; + + /** + * + * + *
+     * Optional. Specifies the interval in seconds between consecutive probes that
+     * check if any trigger condition thresholds have been reached.
+     * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the probingIntervalSeconds field is set. + */ + @java.lang.Override + public boolean hasProbingIntervalSeconds() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the interval in seconds between consecutive probes that
+     * check if any trigger condition thresholds have been reached.
+     * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The probingIntervalSeconds. + */ + @java.lang.Override + public int getProbingIntervalSeconds() { + return probingIntervalSeconds_; + } + + /** + * + * + *
+     * Optional. Specifies the interval in seconds between consecutive probes that
+     * check if any trigger condition thresholds have been reached.
+     * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The probingIntervalSeconds to set. + * @return This builder for chaining. + */ + public Builder setProbingIntervalSeconds(int value) { + + probingIntervalSeconds_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the interval in seconds between consecutive probes that
+     * check if any trigger condition thresholds have been reached.
+     * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearProbingIntervalSeconds() { + bitField0_ = (bitField0_ & ~0x00000002); + probingIntervalSeconds_ = 0; + onChanged(); + return this; + } + + private int probeThreshold_; + + /** + * + * + *
+     * Optional. Specifies the minimum number of consecutive probe threshold that
+     * triggers performance capture.
+     * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the probeThreshold field is set. + */ + @java.lang.Override + public boolean hasProbeThreshold() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of consecutive probe threshold that
+     * triggers performance capture.
+     * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The probeThreshold. + */ + @java.lang.Override + public int getProbeThreshold() { + return probeThreshold_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of consecutive probe threshold that
+     * triggers performance capture.
+     * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The probeThreshold to set. + * @return This builder for chaining. + */ + public Builder setProbeThreshold(int value) { + + probeThreshold_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of consecutive probe threshold that
+     * triggers performance capture.
+     * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearProbeThreshold() { + bitField0_ = (bitField0_ & ~0x00000004); + probeThreshold_ = 0; + onChanged(); + return this; + } + + private int runningThreadsThreshold_; + + /** + * + * + *
+     * Optional. Specifies the minimum number of MySQL `Threads_running` to
+     * trigger the performance capture on the primary instance.
+     * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the runningThreadsThreshold field is set. + */ + @java.lang.Override + public boolean hasRunningThreadsThreshold() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of MySQL `Threads_running` to
+     * trigger the performance capture on the primary instance.
+     * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The runningThreadsThreshold. + */ + @java.lang.Override + public int getRunningThreadsThreshold() { + return runningThreadsThreshold_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of MySQL `Threads_running` to
+     * trigger the performance capture on the primary instance.
+     * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The runningThreadsThreshold to set. + * @return This builder for chaining. + */ + public Builder setRunningThreadsThreshold(int value) { + + runningThreadsThreshold_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of MySQL `Threads_running` to
+     * trigger the performance capture on the primary instance.
+     * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRunningThreadsThreshold() { + bitField0_ = (bitField0_ & ~0x00000008); + runningThreadsThreshold_ = 0; + onChanged(); + return this; + } + + private int secondsBehindSourceThreshold_; + + /** + * + * + *
+     * Optional. Specifies the minimum number of seconds replica must be lagging
+     * behind primary instance to trigger the performance capture on replica.
+     * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the secondsBehindSourceThreshold field is set. + */ + @java.lang.Override + public boolean hasSecondsBehindSourceThreshold() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of seconds replica must be lagging
+     * behind primary instance to trigger the performance capture on replica.
+     * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The secondsBehindSourceThreshold. + */ + @java.lang.Override + public int getSecondsBehindSourceThreshold() { + return secondsBehindSourceThreshold_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of seconds replica must be lagging
+     * behind primary instance to trigger the performance capture on replica.
+     * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The secondsBehindSourceThreshold to set. + * @return This builder for chaining. + */ + public Builder setSecondsBehindSourceThreshold(int value) { + + secondsBehindSourceThreshold_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of seconds replica must be lagging
+     * behind primary instance to trigger the performance capture on replica.
+     * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSecondsBehindSourceThreshold() { + bitField0_ = (bitField0_ & ~0x00000010); + secondsBehindSourceThreshold_ = 0; + onChanged(); + return this; + } + + private int transactionDurationThreshold_; + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts recording it.
+     * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionDurationThreshold field is set. + */ + @java.lang.Override + public boolean hasTransactionDurationThreshold() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts recording it.
+     * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionDurationThreshold. + */ + @java.lang.Override + public int getTransactionDurationThreshold() { + return transactionDurationThreshold_; + } + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts recording it.
+     * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The transactionDurationThreshold to set. + * @return This builder for chaining. + */ + public Builder setTransactionDurationThreshold(int value) { + + transactionDurationThreshold_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts recording it.
+     * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransactionDurationThreshold() { + bitField0_ = (bitField0_ & ~0x00000020); + transactionDurationThreshold_ = 0; + onChanged(); + return this; + } + + private int cpuUtilizationThresholdPercent_; + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of CPU utilization to trigger
+     * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+     * to disable the check.
+     * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cpuUtilizationThresholdPercent field is set. + */ + @java.lang.Override + public boolean hasCpuUtilizationThresholdPercent() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of CPU utilization to trigger
+     * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+     * to disable the check.
+     * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cpuUtilizationThresholdPercent. + */ + @java.lang.Override + public int getCpuUtilizationThresholdPercent() { + return cpuUtilizationThresholdPercent_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of CPU utilization to trigger
+     * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+     * to disable the check.
+     * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The cpuUtilizationThresholdPercent to set. + * @return This builder for chaining. + */ + public Builder setCpuUtilizationThresholdPercent(int value) { + + cpuUtilizationThresholdPercent_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of CPU utilization to trigger
+     * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+     * to disable the check.
+     * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearCpuUtilizationThresholdPercent() { + bitField0_ = (bitField0_ & ~0x00000040); + cpuUtilizationThresholdPercent_ = 0; + onChanged(); + return this; + } + + private int memoryUsageThresholdPercent_; + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of memory usage to trigger the
+     * performance capture.
+     * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the memoryUsageThresholdPercent field is set. + */ + @java.lang.Override + public boolean hasMemoryUsageThresholdPercent() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of memory usage to trigger the
+     * performance capture.
+     * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The memoryUsageThresholdPercent. + */ + @java.lang.Override + public int getMemoryUsageThresholdPercent() { + return memoryUsageThresholdPercent_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of memory usage to trigger the
+     * performance capture.
+     * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The memoryUsageThresholdPercent to set. + * @return This builder for chaining. + */ + public Builder setMemoryUsageThresholdPercent(int value) { + + memoryUsageThresholdPercent_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum percentage of memory usage to trigger the
+     * performance capture.
+     * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMemoryUsageThresholdPercent() { + bitField0_ = (bitField0_ & ~0x00000080); + memoryUsageThresholdPercent_ = 0; + onChanged(); + return this; + } + + private int transactionLockWaitThresholdCount_; + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of transactions in lock wait
+     * state to trigger the performance capture. Valid integers range from `10` to
+     * `10000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionLockWaitThresholdCount field is set. + */ + @java.lang.Override + public boolean hasTransactionLockWaitThresholdCount() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of transactions in lock wait
+     * state to trigger the performance capture. Valid integers range from `10` to
+     * `10000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionLockWaitThresholdCount. + */ + @java.lang.Override + public int getTransactionLockWaitThresholdCount() { + return transactionLockWaitThresholdCount_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of transactions in lock wait
+     * state to trigger the performance capture. Valid integers range from `10` to
+     * `10000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The transactionLockWaitThresholdCount to set. + * @return This builder for chaining. + */ + public Builder setTransactionLockWaitThresholdCount(int value) { + + transactionLockWaitThresholdCount_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of transactions in lock wait
+     * state to trigger the performance capture. Valid integers range from `10` to
+     * `10000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransactionLockWaitThresholdCount() { + bitField0_ = (bitField0_ & ~0x00000100); + transactionLockWaitThresholdCount_ = 0; + onChanged(); + return this; + } + + private int semaphoreWaitThresholdCount_; + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of semaphore waits to
+     * trigger the performance capture. Valid integers range from `10` to `10000`.
+     * Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the semaphoreWaitThresholdCount field is set. + */ + @java.lang.Override + public boolean hasSemaphoreWaitThresholdCount() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of semaphore waits to
+     * trigger the performance capture. Valid integers range from `10` to `10000`.
+     * Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The semaphoreWaitThresholdCount. + */ + @java.lang.Override + public int getSemaphoreWaitThresholdCount() { + return semaphoreWaitThresholdCount_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of semaphore waits to
+     * trigger the performance capture. Valid integers range from `10` to `10000`.
+     * Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The semaphoreWaitThresholdCount to set. + * @return This builder for chaining. + */ + public Builder setSemaphoreWaitThresholdCount(int value) { + + semaphoreWaitThresholdCount_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum allowed number of semaphore waits to
+     * trigger the performance capture. Valid integers range from `10` to `10000`.
+     * Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSemaphoreWaitThresholdCount() { + bitField0_ = (bitField0_ & ~0x00000200); + semaphoreWaitThresholdCount_ = 0; + onChanged(); + return this; + } + + private int historyListLengthThresholdCount_; + + /** + * + * + *
+     * Optional. Specifies the minimum number of undo log entries in the history
+     * list length to trigger the performance capture. Valid integers range from
+     * `10000` to `10000000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the historyListLengthThresholdCount field is set. + */ + @java.lang.Override + public boolean hasHistoryListLengthThresholdCount() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of undo log entries in the history
+     * list length to trigger the performance capture. Valid integers range from
+     * `10000` to `10000000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The historyListLengthThresholdCount. + */ + @java.lang.Override + public int getHistoryListLengthThresholdCount() { + return historyListLengthThresholdCount_; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of undo log entries in the history
+     * list length to trigger the performance capture. Valid integers range from
+     * `10000` to `10000000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The historyListLengthThresholdCount to set. + * @return This builder for chaining. + */ + public Builder setHistoryListLengthThresholdCount(int value) { + + historyListLengthThresholdCount_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the minimum number of undo log entries in the history
+     * list length to trigger the performance capture. Valid integers range from
+     * `10000` to `10000000`. Enter `0` to disable the check.
+     * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearHistoryListLengthThresholdCount() { + bitField0_ = (bitField0_ & ~0x00000400); + historyListLengthThresholdCount_ = 0; + onChanged(); + return this; + } + + private int transactionKillThresholdSeconds_; + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts terminating it. Valid integers
+     * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+     * (i.e., > 0), this value must be greater than or equal to
+     * `transaction_duration_threshold`. Configurations where
+     * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+     * will be rejected.
+     * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionKillThresholdSeconds field is set. + */ + @java.lang.Override + public boolean hasTransactionKillThresholdSeconds() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts terminating it. Valid integers
+     * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+     * (i.e., > 0), this value must be greater than or equal to
+     * `transaction_duration_threshold`. Configurations where
+     * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+     * will be rejected.
+     * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionKillThresholdSeconds. + */ + @java.lang.Override + public int getTransactionKillThresholdSeconds() { + return transactionKillThresholdSeconds_; + } + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts terminating it. Valid integers
+     * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+     * (i.e., > 0), this value must be greater than or equal to
+     * `transaction_duration_threshold`. Configurations where
+     * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+     * will be rejected.
+     * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The transactionKillThresholdSeconds to set. + * @return This builder for chaining. + */ + public Builder setTransactionKillThresholdSeconds(int value) { + + transactionKillThresholdSeconds_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the amount of time in seconds that a transaction needs
+     * to have been open before the watcher starts terminating it. Valid integers
+     * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+     * (i.e., > 0), this value must be greater than or equal to
+     * `transaction_duration_threshold`. Configurations where
+     * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+     * will be rejected.
+     * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransactionKillThresholdSeconds() { + bitField0_ = (bitField0_ & ~0x00000800); + transactionKillThresholdSeconds_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList transactionKillExcludedUserHosts_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureTransactionKillExcludedUserHostsIsMutable() { + if (!transactionKillExcludedUserHosts_.isModifiable()) { + transactionKillExcludedUserHosts_ = + new com.google.protobuf.LazyStringArrayList(transactionKillExcludedUserHosts_); + } + bitField0_ |= 0x00001000; + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the transactionKillExcludedUserHosts. + */ + public com.google.protobuf.ProtocolStringList getTransactionKillExcludedUserHostsList() { + transactionKillExcludedUserHosts_.makeImmutable(); + return transactionKillExcludedUserHosts_; + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of transactionKillExcludedUserHosts. + */ + public int getTransactionKillExcludedUserHostsCount() { + return transactionKillExcludedUserHosts_.size(); + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The transactionKillExcludedUserHosts at the given index. + */ + public java.lang.String getTransactionKillExcludedUserHosts(int index) { + return transactionKillExcludedUserHosts_.get(index); + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the transactionKillExcludedUserHosts at the given index. + */ + public com.google.protobuf.ByteString getTransactionKillExcludedUserHostsBytes(int index) { + return transactionKillExcludedUserHosts_.getByteString(index); + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The transactionKillExcludedUserHosts to set. + * @return This builder for chaining. + */ + public Builder setTransactionKillExcludedUserHosts(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionKillExcludedUserHostsIsMutable(); + transactionKillExcludedUserHosts_.set(index, value); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The transactionKillExcludedUserHosts to add. + * @return This builder for chaining. + */ + public Builder addTransactionKillExcludedUserHosts(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionKillExcludedUserHostsIsMutable(); + transactionKillExcludedUserHosts_.add(value); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The transactionKillExcludedUserHosts to add. + * @return This builder for chaining. + */ + public Builder addAllTransactionKillExcludedUserHosts( + java.lang.Iterable values) { + ensureTransactionKillExcludedUserHostsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, transactionKillExcludedUserHosts_); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransactionKillExcludedUserHosts() { + transactionKillExcludedUserHosts_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies a customer-defined list of users to exclude from
+     * transaction termination. Entries can be in the format 'user@host' or just
+     * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+     * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+     * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+     * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes of the transactionKillExcludedUserHosts to add. + * @return This builder for chaining. + */ + public Builder addTransactionKillExcludedUserHostsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTransactionKillExcludedUserHostsIsMutable(); + transactionKillExcludedUserHosts_.add(value); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private int transactionKillType_ = 0; + + /** + * + * + *
+     * Optional. Determines which transactions are allowed to be terminated when
+     * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+     * write-heavy transactions from auto-termination if desired. Defaults to
+     * `READ_ONLY_TRANSACTIONS` if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionKillType field is set. + */ + @java.lang.Override + public boolean hasTransactionKillType() { + return ((bitField0_ & 0x00002000) != 0); + } + + /** + * + * + *
+     * Optional. Determines which transactions are allowed to be terminated when
+     * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+     * write-heavy transactions from auto-termination if desired. Defaults to
+     * `READ_ONLY_TRANSACTIONS` if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for transactionKillType. + */ + @java.lang.Override + public int getTransactionKillTypeValue() { + return transactionKillType_; + } + + /** + * + * + *
+     * Optional. Determines which transactions are allowed to be terminated when
+     * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+     * write-heavy transactions from auto-termination if desired. Defaults to
+     * `READ_ONLY_TRANSACTIONS` if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for transactionKillType to set. + * @return This builder for chaining. + */ + public Builder setTransactionKillTypeValue(int value) { + transactionKillType_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Determines which transactions are allowed to be terminated when
+     * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+     * write-heavy transactions from auto-termination if desired. Defaults to
+     * `READ_ONLY_TRANSACTIONS` if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionKillType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType + getTransactionKillType() { + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType result = + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType.forNumber( + transactionKillType_); + return result == null + ? com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. Determines which transactions are allowed to be terminated when
+     * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+     * write-heavy transactions from auto-termination if desired. Defaults to
+     * `READ_ONLY_TRANSACTIONS` if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The transactionKillType to set. + * @return This builder for chaining. + */ + public Builder setTransactionKillType( + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00002000; + transactionKillType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Determines which transactions are allowed to be terminated when
+     * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+     * write-heavy transactions from auto-termination if desired. Defaults to
+     * `READ_ONLY_TRANSACTIONS` if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransactionKillType() { + bitField0_ = (bitField0_ & ~0x00002000); + transactionKillType_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.PerformanceCaptureConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.PerformanceCaptureConfig) + private static final com.google.cloud.sql.v1beta4.PerformanceCaptureConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.PerformanceCaptureConfig(); + } + + public static com.google.cloud.sql.v1beta4.PerformanceCaptureConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PerformanceCaptureConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PerformanceCaptureConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PerformanceCaptureConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PerformanceCaptureConfigOrBuilder.java new file mode 100644 index 000000000000..365935f5defc --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PerformanceCaptureConfigOrBuilder.java @@ -0,0 +1,551 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface PerformanceCaptureConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.PerformanceCaptureConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Enables or disables the performance capture feature.
+   * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + + /** + * + * + *
+   * Optional. Enables or disables the performance capture feature.
+   * 
+ * + * optional bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enabled. + */ + boolean getEnabled(); + + /** + * + * + *
+   * Optional. Specifies the interval in seconds between consecutive probes that
+   * check if any trigger condition thresholds have been reached.
+   * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the probingIntervalSeconds field is set. + */ + boolean hasProbingIntervalSeconds(); + + /** + * + * + *
+   * Optional. Specifies the interval in seconds between consecutive probes that
+   * check if any trigger condition thresholds have been reached.
+   * 
+ * + * optional int32 probing_interval_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The probingIntervalSeconds. + */ + int getProbingIntervalSeconds(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of consecutive probe threshold that
+   * triggers performance capture.
+   * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the probeThreshold field is set. + */ + boolean hasProbeThreshold(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of consecutive probe threshold that
+   * triggers performance capture.
+   * 
+ * + * optional int32 probe_threshold = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The probeThreshold. + */ + int getProbeThreshold(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of MySQL `Threads_running` to
+   * trigger the performance capture on the primary instance.
+   * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the runningThreadsThreshold field is set. + */ + boolean hasRunningThreadsThreshold(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of MySQL `Threads_running` to
+   * trigger the performance capture on the primary instance.
+   * 
+ * + * optional int32 running_threads_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The runningThreadsThreshold. + */ + int getRunningThreadsThreshold(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of seconds replica must be lagging
+   * behind primary instance to trigger the performance capture on replica.
+   * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the secondsBehindSourceThreshold field is set. + */ + boolean hasSecondsBehindSourceThreshold(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of seconds replica must be lagging
+   * behind primary instance to trigger the performance capture on replica.
+   * 
+ * + * + * optional int32 seconds_behind_source_threshold = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The secondsBehindSourceThreshold. + */ + int getSecondsBehindSourceThreshold(); + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts recording it.
+   * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionDurationThreshold field is set. + */ + boolean hasTransactionDurationThreshold(); + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts recording it.
+   * 
+ * + * + * optional int32 transaction_duration_threshold = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionDurationThreshold. + */ + int getTransactionDurationThreshold(); + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of CPU utilization to trigger
+   * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+   * to disable the check.
+   * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cpuUtilizationThresholdPercent field is set. + */ + boolean hasCpuUtilizationThresholdPercent(); + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of CPU utilization to trigger
+   * the performance capture. Valid integers range from `10` to `99`. Enter `0`
+   * to disable the check.
+   * 
+ * + * + * optional int32 cpu_utilization_threshold_percent = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cpuUtilizationThresholdPercent. + */ + int getCpuUtilizationThresholdPercent(); + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of memory usage to trigger the
+   * performance capture.
+   * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the memoryUsageThresholdPercent field is set. + */ + boolean hasMemoryUsageThresholdPercent(); + + /** + * + * + *
+   * Optional. Specifies the minimum percentage of memory usage to trigger the
+   * performance capture.
+   * Valid integers range from `10` to `99`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 memory_usage_threshold_percent = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The memoryUsageThresholdPercent. + */ + int getMemoryUsageThresholdPercent(); + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of transactions in lock wait
+   * state to trigger the performance capture. Valid integers range from `10` to
+   * `10000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionLockWaitThresholdCount field is set. + */ + boolean hasTransactionLockWaitThresholdCount(); + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of transactions in lock wait
+   * state to trigger the performance capture. Valid integers range from `10` to
+   * `10000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 transaction_lock_wait_threshold_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionLockWaitThresholdCount. + */ + int getTransactionLockWaitThresholdCount(); + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of semaphore waits to
+   * trigger the performance capture. Valid integers range from `10` to `10000`.
+   * Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the semaphoreWaitThresholdCount field is set. + */ + boolean hasSemaphoreWaitThresholdCount(); + + /** + * + * + *
+   * Optional. Specifies the minimum allowed number of semaphore waits to
+   * trigger the performance capture. Valid integers range from `10` to `10000`.
+   * Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 semaphore_wait_threshold_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The semaphoreWaitThresholdCount. + */ + int getSemaphoreWaitThresholdCount(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of undo log entries in the history
+   * list length to trigger the performance capture. Valid integers range from
+   * `10000` to `10000000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the historyListLengthThresholdCount field is set. + */ + boolean hasHistoryListLengthThresholdCount(); + + /** + * + * + *
+   * Optional. Specifies the minimum number of undo log entries in the history
+   * list length to trigger the performance capture. Valid integers range from
+   * `10000` to `10000000`. Enter `0` to disable the check.
+   * 
+ * + * + * optional int32 history_list_length_threshold_count = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The historyListLengthThresholdCount. + */ + int getHistoryListLengthThresholdCount(); + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts terminating it. Valid integers
+   * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+   * (i.e., > 0), this value must be greater than or equal to
+   * `transaction_duration_threshold`. Configurations where
+   * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+   * will be rejected.
+   * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionKillThresholdSeconds field is set. + */ + boolean hasTransactionKillThresholdSeconds(); + + /** + * + * + *
+   * Optional. Specifies the amount of time in seconds that a transaction needs
+   * to have been open before the watcher starts terminating it. Valid integers
+   * range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
+   * (i.e., > 0), this value must be greater than or equal to
+   * `transaction_duration_threshold`. Configurations where
+   * `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
+   * will be rejected.
+   * 
+ * + * + * optional int32 transaction_kill_threshold_seconds = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionKillThresholdSeconds. + */ + int getTransactionKillThresholdSeconds(); + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the transactionKillExcludedUserHosts. + */ + java.util.List getTransactionKillExcludedUserHostsList(); + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of transactionKillExcludedUserHosts. + */ + int getTransactionKillExcludedUserHostsCount(); + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The transactionKillExcludedUserHosts at the given index. + */ + java.lang.String getTransactionKillExcludedUserHosts(int index); + + /** + * + * + *
+   * Optional. Specifies a customer-defined list of users to exclude from
+   * transaction termination. Entries can be in the format 'user@host' or just
+   * 'user'. A standalone 'user' implies 'user@%', excluding the user from any
+   * host. Wildcard '%' is allowed in the host part of the 'user@host' format.
+   * Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
+   * 
+ * + * + * repeated string transaction_kill_excluded_user_hosts = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the transactionKillExcludedUserHosts at the given index. + */ + com.google.protobuf.ByteString getTransactionKillExcludedUserHostsBytes(int index); + + /** + * + * + *
+   * Optional. Determines which transactions are allowed to be terminated when
+   * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+   * write-heavy transactions from auto-termination if desired. Defaults to
+   * `READ_ONLY_TRANSACTIONS` if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the transactionKillType field is set. + */ + boolean hasTransactionKillType(); + + /** + * + * + *
+   * Optional. Determines which transactions are allowed to be terminated when
+   * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+   * write-heavy transactions from auto-termination if desired. Defaults to
+   * `READ_ONLY_TRANSACTIONS` if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for transactionKillType. + */ + int getTransactionKillTypeValue(); + + /** + * + * + *
+   * Optional. Determines which transactions are allowed to be terminated when
+   * they exceed `transaction_kill_threshold_seconds`. This allows protecting
+   * write-heavy transactions from auto-termination if desired. Defaults to
+   * `READ_ONLY_TRANSACTIONS` if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType transaction_kill_type = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transactionKillType. + */ + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType + getTransactionKillType(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PointInTimeRestoreContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PointInTimeRestoreContext.java new file mode 100644 index 000000000000..de3a4b65ec90 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PointInTimeRestoreContext.java @@ -0,0 +1,3107 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Context to perform a point-in-time restore of an instance managed by
+ * Backup and Disaster Recovery (DR) Service.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PointInTimeRestoreContext} + */ +@com.google.protobuf.Generated +public final class PointInTimeRestoreContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.PointInTimeRestoreContext) + PointInTimeRestoreContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PointInTimeRestoreContext"); + } + + // Use PointInTimeRestoreContext.newBuilder() to construct. + private PointInTimeRestoreContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PointInTimeRestoreContext() { + datasource_ = ""; + targetInstance_ = ""; + privateNetwork_ = ""; + allocatedIpRange_ = ""; + preferredZone_ = ""; + preferredSecondaryZone_ = ""; + targetInstanceClearSettingsFieldNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + region_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PointInTimeRestoreContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PointInTimeRestoreContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.class, + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.Builder.class); + } + + private int bitField0_; + public static final int DATASOURCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object datasource_ = ""; + + /** + * + * + *
+   * The Backup and Disaster Recovery (DR) Service Datasource URI.
+   * Format:
+   * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+   * 
+ * + * optional string datasource = 1; + * + * @return Whether the datasource field is set. + */ + @java.lang.Override + public boolean hasDatasource() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The Backup and Disaster Recovery (DR) Service Datasource URI.
+   * Format:
+   * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+   * 
+ * + * optional string datasource = 1; + * + * @return The datasource. + */ + @java.lang.Override + public java.lang.String getDatasource() { + java.lang.Object ref = datasource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasource_ = s; + return s; + } + } + + /** + * + * + *
+   * The Backup and Disaster Recovery (DR) Service Datasource URI.
+   * Format:
+   * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+   * 
+ * + * optional string datasource = 1; + * + * @return The bytes for datasource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatasourceBytes() { + java.lang.Object ref = datasource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POINT_IN_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp pointInTime_; + + /** + * + * + *
+   * Required. The date and time to which you want to restore the instance.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + @java.lang.Override + public boolean hasPointInTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Required. The date and time to which you want to restore the instance.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPointInTime() { + return pointInTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : pointInTime_; + } + + /** + * + * + *
+   * Required. The date and time to which you want to restore the instance.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder() { + return pointInTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : pointInTime_; + } + + public static final int TARGET_INSTANCE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object targetInstance_ = ""; + + /** + * + * + *
+   * Target instance name.
+   * 
+ * + * optional string target_instance = 3; + * + * @return Whether the targetInstance field is set. + */ + @java.lang.Override + public boolean hasTargetInstance() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Target instance name.
+   * 
+ * + * optional string target_instance = 3; + * + * @return The targetInstance. + */ + @java.lang.Override + public java.lang.String getTargetInstance() { + java.lang.Object ref = targetInstance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetInstance_ = s; + return s; + } + } + + /** + * + * + *
+   * Target instance name.
+   * 
+ * + * optional string target_instance = 3; + * + * @return The bytes for targetInstance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetInstanceBytes() { + java.lang.Object ref = targetInstance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetInstance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIVATE_NETWORK_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object privateNetwork_ = ""; + + /** + * + * + *
+   * Optional. The resource link for the VPC network from which the Cloud SQL
+   * instance is accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`.
+   * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the privateNetwork field is set. + */ + @java.lang.Override + public boolean hasPrivateNetwork() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. The resource link for the VPC network from which the Cloud SQL
+   * instance is accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`.
+   * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The privateNetwork. + */ + @java.lang.Override + public java.lang.String getPrivateNetwork() { + java.lang.Object ref = privateNetwork_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateNetwork_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The resource link for the VPC network from which the Cloud SQL
+   * instance is accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`.
+   * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for privateNetwork. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrivateNetworkBytes() { + java.lang.Object ref = privateNetwork_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOCATED_IP_RANGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object allocatedIpRange_ = ""; + + /** + * + * + *
+   * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+   * instance. For example: "google-managed-services-default". If you set this,
+   * then Cloud SQL creates the IP address for the cloned instance in the
+   * allocated range. This range must comply with [RFC
+   * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+   * name must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+   * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the allocatedIpRange field is set. + */ + @java.lang.Override + public boolean hasAllocatedIpRange() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+   * instance. For example: "google-managed-services-default". If you set this,
+   * then Cloud SQL creates the IP address for the cloned instance in the
+   * allocated range. This range must comply with [RFC
+   * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+   * name must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+   * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allocatedIpRange. + */ + @java.lang.Override + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+   * instance. For example: "google-managed-services-default". If you set this,
+   * then Cloud SQL creates the IP address for the cloned instance in the
+   * allocated range. This range must comply with [RFC
+   * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+   * name must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+   * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for allocatedIpRange. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PREFERRED_ZONE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object preferredZone_ = ""; + + /** + * + * + *
+   * Optional. Point-in-time recovery of an instance to the specified zone. If
+   * no zone is specified, then clone to the same primary zone as the source
+   * instance.
+   * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the preferredZone field is set. + */ + @java.lang.Override + public boolean hasPreferredZone() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Optional. Point-in-time recovery of an instance to the specified zone. If
+   * no zone is specified, then clone to the same primary zone as the source
+   * instance.
+   * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The preferredZone. + */ + @java.lang.Override + public java.lang.String getPreferredZone() { + java.lang.Object ref = preferredZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredZone_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Point-in-time recovery of an instance to the specified zone. If
+   * no zone is specified, then clone to the same primary zone as the source
+   * instance.
+   * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for preferredZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPreferredZoneBytes() { + java.lang.Object ref = preferredZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PREFERRED_SECONDARY_ZONE_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object preferredSecondaryZone_ = ""; + + /** + * + * + *
+   * Optional. Point-in-time recovery of a regional instance in the specified
+   * zones. If not specified, clone to the same secondary zone as the source
+   * instance. This value cannot be the same as the preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the preferredSecondaryZone field is set. + */ + @java.lang.Override + public boolean hasPreferredSecondaryZone() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Optional. Point-in-time recovery of a regional instance in the specified
+   * zones. If not specified, clone to the same secondary zone as the source
+   * instance. This value cannot be the same as the preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The preferredSecondaryZone. + */ + @java.lang.Override + public java.lang.String getPreferredSecondaryZone() { + java.lang.Object ref = preferredSecondaryZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredSecondaryZone_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Point-in-time recovery of a regional instance in the specified
+   * zones. If not specified, clone to the same secondary zone as the source
+   * instance. This value cannot be the same as the preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for preferredSecondaryZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPreferredSecondaryZoneBytes() { + java.lang.Object ref = preferredSecondaryZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredSecondaryZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_INSTANCE_SETTINGS_FIELD_NUMBER = 11; + private com.google.cloud.sql.v1beta4.DatabaseInstance targetInstanceSettings_; + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be overridden from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the targetInstanceSettings field is set. + */ + @java.lang.Override + public boolean hasTargetInstanceSettings() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be overridden from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The targetInstanceSettings. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance getTargetInstanceSettings() { + return targetInstanceSettings_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : targetInstanceSettings_; + } + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be overridden from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder + getTargetInstanceSettingsOrBuilder() { + return targetInstanceSettings_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : targetInstanceSettings_; + } + + public static final int TARGET_INSTANCE_CLEAR_SETTINGS_FIELD_NAMES_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList targetInstanceClearSettingsFieldNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the targetInstanceClearSettingsFieldNames. + */ + public com.google.protobuf.ProtocolStringList getTargetInstanceClearSettingsFieldNamesList() { + return targetInstanceClearSettingsFieldNames_; + } + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of targetInstanceClearSettingsFieldNames. + */ + public int getTargetInstanceClearSettingsFieldNamesCount() { + return targetInstanceClearSettingsFieldNames_.size(); + } + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The targetInstanceClearSettingsFieldNames at the given index. + */ + public java.lang.String getTargetInstanceClearSettingsFieldNames(int index) { + return targetInstanceClearSettingsFieldNames_.get(index); + } + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the targetInstanceClearSettingsFieldNames at the given index. + */ + public com.google.protobuf.ByteString getTargetInstanceClearSettingsFieldNamesBytes(int index) { + return targetInstanceClearSettingsFieldNames_.getByteString(index); + } + + public static final int REGION_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private volatile java.lang.Object region_ = ""; + + /** + * + * + *
+   * Optional. The region of the target instance where the datasource will be
+   * restored. For example: "us-central1".
+   * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the region field is set. + */ + @java.lang.Override + public boolean hasRegion() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+   * Optional. The region of the target instance where the datasource will be
+   * restored. For example: "us-central1".
+   * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The region. + */ + @java.lang.Override + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The region of the target instance where the datasource will be
+   * restored. For example: "us-central1".
+   * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for region. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = 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)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, datasource_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getPointInTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, targetInstance_); + } + if (((bitField0_ & 0x00000008) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, privateNetwork_); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, allocatedIpRange_); + } + if (((bitField0_ & 0x00000020) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, preferredZone_); + } + if (((bitField0_ & 0x00000040) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, preferredSecondaryZone_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(11, getTargetInstanceSettings()); + } + for (int i = 0; i < targetInstanceClearSettingsFieldNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 12, targetInstanceClearSettingsFieldNames_.getRaw(i)); + } + if (((bitField0_ & 0x00000100) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 13, region_); + } + 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.GeneratedMessage.computeStringSize(1, datasource_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPointInTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, targetInstance_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, privateNetwork_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, allocatedIpRange_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, preferredZone_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, preferredSecondaryZone_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(11, getTargetInstanceSettings()); + } + { + int dataSize = 0; + for (int i = 0; i < targetInstanceClearSettingsFieldNames_.size(); i++) { + dataSize += computeStringSizeNoTag(targetInstanceClearSettingsFieldNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getTargetInstanceClearSettingsFieldNamesList().size(); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(13, region_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.PointInTimeRestoreContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext other = + (com.google.cloud.sql.v1beta4.PointInTimeRestoreContext) obj; + + if (hasDatasource() != other.hasDatasource()) return false; + if (hasDatasource()) { + if (!getDatasource().equals(other.getDatasource())) return false; + } + if (hasPointInTime() != other.hasPointInTime()) return false; + if (hasPointInTime()) { + if (!getPointInTime().equals(other.getPointInTime())) return false; + } + if (hasTargetInstance() != other.hasTargetInstance()) return false; + if (hasTargetInstance()) { + if (!getTargetInstance().equals(other.getTargetInstance())) return false; + } + if (hasPrivateNetwork() != other.hasPrivateNetwork()) return false; + if (hasPrivateNetwork()) { + if (!getPrivateNetwork().equals(other.getPrivateNetwork())) return false; + } + if (hasAllocatedIpRange() != other.hasAllocatedIpRange()) return false; + if (hasAllocatedIpRange()) { + if (!getAllocatedIpRange().equals(other.getAllocatedIpRange())) return false; + } + if (hasPreferredZone() != other.hasPreferredZone()) return false; + if (hasPreferredZone()) { + if (!getPreferredZone().equals(other.getPreferredZone())) return false; + } + if (hasPreferredSecondaryZone() != other.hasPreferredSecondaryZone()) return false; + if (hasPreferredSecondaryZone()) { + if (!getPreferredSecondaryZone().equals(other.getPreferredSecondaryZone())) return false; + } + if (hasTargetInstanceSettings() != other.hasTargetInstanceSettings()) return false; + if (hasTargetInstanceSettings()) { + if (!getTargetInstanceSettings().equals(other.getTargetInstanceSettings())) return false; + } + if (!getTargetInstanceClearSettingsFieldNamesList() + .equals(other.getTargetInstanceClearSettingsFieldNamesList())) return false; + if (hasRegion() != other.hasRegion()) return false; + if (hasRegion()) { + if (!getRegion().equals(other.getRegion())) return false; + } + if (!getUnknownFields().equals(other.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 (hasDatasource()) { + hash = (37 * hash) + DATASOURCE_FIELD_NUMBER; + hash = (53 * hash) + getDatasource().hashCode(); + } + if (hasPointInTime()) { + hash = (37 * hash) + POINT_IN_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPointInTime().hashCode(); + } + if (hasTargetInstance()) { + hash = (37 * hash) + TARGET_INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getTargetInstance().hashCode(); + } + if (hasPrivateNetwork()) { + hash = (37 * hash) + PRIVATE_NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getPrivateNetwork().hashCode(); + } + if (hasAllocatedIpRange()) { + hash = (37 * hash) + ALLOCATED_IP_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getAllocatedIpRange().hashCode(); + } + if (hasPreferredZone()) { + hash = (37 * hash) + PREFERRED_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getPreferredZone().hashCode(); + } + if (hasPreferredSecondaryZone()) { + hash = (37 * hash) + PREFERRED_SECONDARY_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getPreferredSecondaryZone().hashCode(); + } + if (hasTargetInstanceSettings()) { + hash = (37 * hash) + TARGET_INSTANCE_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getTargetInstanceSettings().hashCode(); + } + if (getTargetInstanceClearSettingsFieldNamesCount() > 0) { + hash = (37 * hash) + TARGET_INSTANCE_CLEAR_SETTINGS_FIELD_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getTargetInstanceClearSettingsFieldNamesList().hashCode(); + } + if (hasRegion()) { + hash = (37 * hash) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegion().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.PointInTimeRestoreContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PointInTimeRestoreContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PointInTimeRestoreContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PointInTimeRestoreContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PointInTimeRestoreContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PointInTimeRestoreContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PointInTimeRestoreContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PointInTimeRestoreContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PointInTimeRestoreContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PointInTimeRestoreContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PointInTimeRestoreContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PointInTimeRestoreContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Context to perform a point-in-time restore of an instance managed by
+   * Backup and Disaster Recovery (DR) Service.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PointInTimeRestoreContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.PointInTimeRestoreContext) + com.google.cloud.sql.v1beta4.PointInTimeRestoreContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PointInTimeRestoreContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PointInTimeRestoreContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.class, + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPointInTimeFieldBuilder(); + internalGetTargetInstanceSettingsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + datasource_ = ""; + pointInTime_ = null; + if (pointInTimeBuilder_ != null) { + pointInTimeBuilder_.dispose(); + pointInTimeBuilder_ = null; + } + targetInstance_ = ""; + privateNetwork_ = ""; + allocatedIpRange_ = ""; + preferredZone_ = ""; + preferredSecondaryZone_ = ""; + targetInstanceSettings_ = null; + if (targetInstanceSettingsBuilder_ != null) { + targetInstanceSettingsBuilder_.dispose(); + targetInstanceSettingsBuilder_ = null; + } + targetInstanceClearSettingsFieldNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + region_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PointInTimeRestoreContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PointInTimeRestoreContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PointInTimeRestoreContext build() { + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PointInTimeRestoreContext buildPartial() { + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext result = + new com.google.cloud.sql.v1beta4.PointInTimeRestoreContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.PointInTimeRestoreContext result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.datasource_ = datasource_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pointInTime_ = + pointInTimeBuilder_ == null ? pointInTime_ : pointInTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.targetInstance_ = targetInstance_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.privateNetwork_ = privateNetwork_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allocatedIpRange_ = allocatedIpRange_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.preferredZone_ = preferredZone_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.preferredSecondaryZone_ = preferredSecondaryZone_; + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.targetInstanceSettings_ = + targetInstanceSettingsBuilder_ == null + ? targetInstanceSettings_ + : targetInstanceSettingsBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + targetInstanceClearSettingsFieldNames_.makeImmutable(); + result.targetInstanceClearSettingsFieldNames_ = targetInstanceClearSettingsFieldNames_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.region_ = region_; + to_bitField0_ |= 0x00000100; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.PointInTimeRestoreContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.PointInTimeRestoreContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.PointInTimeRestoreContext other) { + if (other == com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.getDefaultInstance()) + return this; + if (other.hasDatasource()) { + datasource_ = other.datasource_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasPointInTime()) { + mergePointInTime(other.getPointInTime()); + } + if (other.hasTargetInstance()) { + targetInstance_ = other.targetInstance_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasPrivateNetwork()) { + privateNetwork_ = other.privateNetwork_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasAllocatedIpRange()) { + allocatedIpRange_ = other.allocatedIpRange_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasPreferredZone()) { + preferredZone_ = other.preferredZone_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasPreferredSecondaryZone()) { + preferredSecondaryZone_ = other.preferredSecondaryZone_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasTargetInstanceSettings()) { + mergeTargetInstanceSettings(other.getTargetInstanceSettings()); + } + if (!other.targetInstanceClearSettingsFieldNames_.isEmpty()) { + if (targetInstanceClearSettingsFieldNames_.isEmpty()) { + targetInstanceClearSettingsFieldNames_ = other.targetInstanceClearSettingsFieldNames_; + bitField0_ |= 0x00000100; + } else { + ensureTargetInstanceClearSettingsFieldNamesIsMutable(); + targetInstanceClearSettingsFieldNames_.addAll( + other.targetInstanceClearSettingsFieldNames_); + } + onChanged(); + } + if (other.hasRegion()) { + region_ = other.region_; + bitField0_ |= 0x00000200; + 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: + { + datasource_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetPointInTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + targetInstance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + privateNetwork_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + allocatedIpRange_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + preferredZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 74: + { + preferredSecondaryZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 74 + case 90: + { + input.readMessage( + internalGetTargetInstanceSettingsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 90 + case 98: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureTargetInstanceClearSettingsFieldNamesIsMutable(); + targetInstanceClearSettingsFieldNames_.add(s); + break; + } // case 98 + case 106: + { + region_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 106 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 datasource_ = ""; + + /** + * + * + *
+     * The Backup and Disaster Recovery (DR) Service Datasource URI.
+     * Format:
+     * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+     * 
+ * + * optional string datasource = 1; + * + * @return Whether the datasource field is set. + */ + public boolean hasDatasource() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The Backup and Disaster Recovery (DR) Service Datasource URI.
+     * Format:
+     * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+     * 
+ * + * optional string datasource = 1; + * + * @return The datasource. + */ + public java.lang.String getDatasource() { + java.lang.Object ref = datasource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Backup and Disaster Recovery (DR) Service Datasource URI.
+     * Format:
+     * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+     * 
+ * + * optional string datasource = 1; + * + * @return The bytes for datasource. + */ + public com.google.protobuf.ByteString getDatasourceBytes() { + java.lang.Object ref = datasource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Backup and Disaster Recovery (DR) Service Datasource URI.
+     * Format:
+     * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+     * 
+ * + * optional string datasource = 1; + * + * @param value The datasource to set. + * @return This builder for chaining. + */ + public Builder setDatasource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + datasource_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Backup and Disaster Recovery (DR) Service Datasource URI.
+     * Format:
+     * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+     * 
+ * + * optional string datasource = 1; + * + * @return This builder for chaining. + */ + public Builder clearDatasource() { + datasource_ = getDefaultInstance().getDatasource(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Backup and Disaster Recovery (DR) Service Datasource URI.
+     * Format:
+     * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+     * 
+ * + * optional string datasource = 1; + * + * @param value The bytes for datasource to set. + * @return This builder for chaining. + */ + public Builder setDatasourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + datasource_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp pointInTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + pointInTimeBuilder_; + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + public boolean hasPointInTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + public com.google.protobuf.Timestamp getPointInTime() { + if (pointInTimeBuilder_ == null) { + return pointInTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : pointInTime_; + } else { + return pointInTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPointInTime(com.google.protobuf.Timestamp value) { + if (pointInTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pointInTime_ = value; + } else { + pointInTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPointInTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (pointInTimeBuilder_ == null) { + pointInTime_ = builderForValue.build(); + } else { + pointInTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePointInTime(com.google.protobuf.Timestamp value) { + if (pointInTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && pointInTime_ != null + && pointInTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getPointInTimeBuilder().mergeFrom(value); + } else { + pointInTime_ = value; + } + } else { + pointInTimeBuilder_.mergeFrom(value); + } + if (pointInTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPointInTime() { + bitField0_ = (bitField0_ & ~0x00000002); + pointInTime_ = null; + if (pointInTimeBuilder_ != null) { + pointInTimeBuilder_.dispose(); + pointInTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getPointInTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetPointInTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder() { + if (pointInTimeBuilder_ != null) { + return pointInTimeBuilder_.getMessageOrBuilder(); + } else { + return pointInTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : pointInTime_; + } + } + + /** + * + * + *
+     * Required. The date and time to which you want to restore the instance.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetPointInTimeFieldBuilder() { + if (pointInTimeBuilder_ == null) { + pointInTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPointInTime(), getParentForChildren(), isClean()); + pointInTime_ = null; + } + return pointInTimeBuilder_; + } + + private java.lang.Object targetInstance_ = ""; + + /** + * + * + *
+     * Target instance name.
+     * 
+ * + * optional string target_instance = 3; + * + * @return Whether the targetInstance field is set. + */ + public boolean hasTargetInstance() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Target instance name.
+     * 
+ * + * optional string target_instance = 3; + * + * @return The targetInstance. + */ + public java.lang.String getTargetInstance() { + java.lang.Object ref = targetInstance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetInstance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Target instance name.
+     * 
+ * + * optional string target_instance = 3; + * + * @return The bytes for targetInstance. + */ + public com.google.protobuf.ByteString getTargetInstanceBytes() { + java.lang.Object ref = targetInstance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetInstance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Target instance name.
+     * 
+ * + * optional string target_instance = 3; + * + * @param value The targetInstance to set. + * @return This builder for chaining. + */ + public Builder setTargetInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetInstance_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Target instance name.
+     * 
+ * + * optional string target_instance = 3; + * + * @return This builder for chaining. + */ + public Builder clearTargetInstance() { + targetInstance_ = getDefaultInstance().getTargetInstance(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Target instance name.
+     * 
+ * + * optional string target_instance = 3; + * + * @param value The bytes for targetInstance to set. + * @return This builder for chaining. + */ + public Builder setTargetInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetInstance_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object privateNetwork_ = ""; + + /** + * + * + *
+     * Optional. The resource link for the VPC network from which the Cloud SQL
+     * instance is accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`.
+     * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the privateNetwork field is set. + */ + public boolean hasPrivateNetwork() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. The resource link for the VPC network from which the Cloud SQL
+     * instance is accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`.
+     * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The privateNetwork. + */ + public java.lang.String getPrivateNetwork() { + java.lang.Object ref = privateNetwork_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateNetwork_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The resource link for the VPC network from which the Cloud SQL
+     * instance is accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`.
+     * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for privateNetwork. + */ + public com.google.protobuf.ByteString getPrivateNetworkBytes() { + java.lang.Object ref = privateNetwork_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The resource link for the VPC network from which the Cloud SQL
+     * instance is accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`.
+     * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The privateNetwork to set. + * @return This builder for chaining. + */ + public Builder setPrivateNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + privateNetwork_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource link for the VPC network from which the Cloud SQL
+     * instance is accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`.
+     * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPrivateNetwork() { + privateNetwork_ = getDefaultInstance().getPrivateNetwork(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource link for the VPC network from which the Cloud SQL
+     * instance is accessible for private IP. For example,
+     * `/projects/myProject/global/networks/default`.
+     * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for privateNetwork to set. + * @return This builder for chaining. + */ + public Builder setPrivateNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + privateNetwork_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object allocatedIpRange_ = ""; + + /** + * + * + *
+     * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+     * instance. For example: "google-managed-services-default". If you set this,
+     * then Cloud SQL creates the IP address for the cloned instance in the
+     * allocated range. This range must comply with [RFC
+     * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+     * name must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+     * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the allocatedIpRange field is set. + */ + public boolean hasAllocatedIpRange() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+     * instance. For example: "google-managed-services-default". If you set this,
+     * then Cloud SQL creates the IP address for the cloned instance in the
+     * allocated range. This range must comply with [RFC
+     * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+     * name must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+     * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The allocatedIpRange. + */ + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+     * instance. For example: "google-managed-services-default". If you set this,
+     * then Cloud SQL creates the IP address for the cloned instance in the
+     * allocated range. This range must comply with [RFC
+     * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+     * name must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+     * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for allocatedIpRange. + */ + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+     * instance. For example: "google-managed-services-default". If you set this,
+     * then Cloud SQL creates the IP address for the cloned instance in the
+     * allocated range. This range must comply with [RFC
+     * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+     * name must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+     * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRange(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + allocatedIpRange_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+     * instance. For example: "google-managed-services-default". If you set this,
+     * then Cloud SQL creates the IP address for the cloned instance in the
+     * allocated range. This range must comply with [RFC
+     * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+     * name must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+     * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearAllocatedIpRange() { + allocatedIpRange_ = getDefaultInstance().getAllocatedIpRange(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+     * instance. For example: "google-managed-services-default". If you set this,
+     * then Cloud SQL creates the IP address for the cloned instance in the
+     * allocated range. This range must comply with [RFC
+     * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+     * name must be 1-63 characters long and match the regular expression
+     * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+     * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRangeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + allocatedIpRange_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object preferredZone_ = ""; + + /** + * + * + *
+     * Optional. Point-in-time recovery of an instance to the specified zone. If
+     * no zone is specified, then clone to the same primary zone as the source
+     * instance.
+     * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the preferredZone field is set. + */ + public boolean hasPreferredZone() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of an instance to the specified zone. If
+     * no zone is specified, then clone to the same primary zone as the source
+     * instance.
+     * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The preferredZone. + */ + public java.lang.String getPreferredZone() { + java.lang.Object ref = preferredZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of an instance to the specified zone. If
+     * no zone is specified, then clone to the same primary zone as the source
+     * instance.
+     * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for preferredZone. + */ + public com.google.protobuf.ByteString getPreferredZoneBytes() { + java.lang.Object ref = preferredZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of an instance to the specified zone. If
+     * no zone is specified, then clone to the same primary zone as the source
+     * instance.
+     * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The preferredZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + preferredZone_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of an instance to the specified zone. If
+     * no zone is specified, then clone to the same primary zone as the source
+     * instance.
+     * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPreferredZone() { + preferredZone_ = getDefaultInstance().getPreferredZone(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of an instance to the specified zone. If
+     * no zone is specified, then clone to the same primary zone as the source
+     * instance.
+     * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for preferredZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + preferredZone_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object preferredSecondaryZone_ = ""; + + /** + * + * + *
+     * Optional. Point-in-time recovery of a regional instance in the specified
+     * zones. If not specified, clone to the same secondary zone as the source
+     * instance. This value cannot be the same as the preferred_zone field.
+     * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the preferredSecondaryZone field is set. + */ + public boolean hasPreferredSecondaryZone() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of a regional instance in the specified
+     * zones. If not specified, clone to the same secondary zone as the source
+     * instance. This value cannot be the same as the preferred_zone field.
+     * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The preferredSecondaryZone. + */ + public java.lang.String getPreferredSecondaryZone() { + java.lang.Object ref = preferredSecondaryZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredSecondaryZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of a regional instance in the specified
+     * zones. If not specified, clone to the same secondary zone as the source
+     * instance. This value cannot be the same as the preferred_zone field.
+     * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for preferredSecondaryZone. + */ + public com.google.protobuf.ByteString getPreferredSecondaryZoneBytes() { + java.lang.Object ref = preferredSecondaryZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + preferredSecondaryZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of a regional instance in the specified
+     * zones. If not specified, clone to the same secondary zone as the source
+     * instance. This value cannot be the same as the preferred_zone field.
+     * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The preferredSecondaryZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredSecondaryZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + preferredSecondaryZone_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of a regional instance in the specified
+     * zones. If not specified, clone to the same secondary zone as the source
+     * instance. This value cannot be the same as the preferred_zone field.
+     * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPreferredSecondaryZone() { + preferredSecondaryZone_ = getDefaultInstance().getPreferredSecondaryZone(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Point-in-time recovery of a regional instance in the specified
+     * zones. If not specified, clone to the same secondary zone as the source
+     * instance. This value cannot be the same as the preferred_zone field.
+     * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for preferredSecondaryZone to set. + * @return This builder for chaining. + */ + public Builder setPreferredSecondaryZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + preferredSecondaryZone_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.DatabaseInstance targetInstanceSettings_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder> + targetInstanceSettingsBuilder_; + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the targetInstanceSettings field is set. + */ + public boolean hasTargetInstanceSettings() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The targetInstanceSettings. + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance getTargetInstanceSettings() { + if (targetInstanceSettingsBuilder_ == null) { + return targetInstanceSettings_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : targetInstanceSettings_; + } else { + return targetInstanceSettingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTargetInstanceSettings(com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (targetInstanceSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + targetInstanceSettings_ = value; + } else { + targetInstanceSettingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTargetInstanceSettings( + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder builderForValue) { + if (targetInstanceSettingsBuilder_ == null) { + targetInstanceSettings_ = builderForValue.build(); + } else { + targetInstanceSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeTargetInstanceSettings( + com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (targetInstanceSettingsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && targetInstanceSettings_ != null + && targetInstanceSettings_ + != com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance()) { + getTargetInstanceSettingsBuilder().mergeFrom(value); + } else { + targetInstanceSettings_ = value; + } + } else { + targetInstanceSettingsBuilder_.mergeFrom(value); + } + if (targetInstanceSettings_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTargetInstanceSettings() { + bitField0_ = (bitField0_ & ~0x00000080); + targetInstanceSettings_ = null; + if (targetInstanceSettingsBuilder_ != null) { + targetInstanceSettingsBuilder_.dispose(); + targetInstanceSettingsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.Builder + getTargetInstanceSettingsBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetTargetInstanceSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder + getTargetInstanceSettingsOrBuilder() { + if (targetInstanceSettingsBuilder_ != null) { + return targetInstanceSettingsBuilder_.getMessageOrBuilder(); + } else { + return targetInstanceSettings_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : targetInstanceSettings_; + } + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be overridden from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder> + internalGetTargetInstanceSettingsFieldBuilder() { + if (targetInstanceSettingsBuilder_ == null) { + targetInstanceSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder>( + getTargetInstanceSettings(), getParentForChildren(), isClean()); + targetInstanceSettings_ = null; + } + return targetInstanceSettingsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList targetInstanceClearSettingsFieldNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureTargetInstanceClearSettingsFieldNamesIsMutable() { + if (!targetInstanceClearSettingsFieldNames_.isModifiable()) { + targetInstanceClearSettingsFieldNames_ = + new com.google.protobuf.LazyStringArrayList(targetInstanceClearSettingsFieldNames_); + } + bitField0_ |= 0x00000100; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the targetInstanceClearSettingsFieldNames. + */ + public com.google.protobuf.ProtocolStringList getTargetInstanceClearSettingsFieldNamesList() { + targetInstanceClearSettingsFieldNames_.makeImmutable(); + return targetInstanceClearSettingsFieldNames_; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of targetInstanceClearSettingsFieldNames. + */ + public int getTargetInstanceClearSettingsFieldNamesCount() { + return targetInstanceClearSettingsFieldNames_.size(); + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The targetInstanceClearSettingsFieldNames at the given index. + */ + public java.lang.String getTargetInstanceClearSettingsFieldNames(int index) { + return targetInstanceClearSettingsFieldNames_.get(index); + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the targetInstanceClearSettingsFieldNames at the given index. + */ + public com.google.protobuf.ByteString getTargetInstanceClearSettingsFieldNamesBytes(int index) { + return targetInstanceClearSettingsFieldNames_.getByteString(index); + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The targetInstanceClearSettingsFieldNames to set. + * @return This builder for chaining. + */ + public Builder setTargetInstanceClearSettingsFieldNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetInstanceClearSettingsFieldNamesIsMutable(); + targetInstanceClearSettingsFieldNames_.set(index, value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The targetInstanceClearSettingsFieldNames to add. + * @return This builder for chaining. + */ + public Builder addTargetInstanceClearSettingsFieldNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetInstanceClearSettingsFieldNamesIsMutable(); + targetInstanceClearSettingsFieldNames_.add(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The targetInstanceClearSettingsFieldNames to add. + * @return This builder for chaining. + */ + public Builder addAllTargetInstanceClearSettingsFieldNames( + java.lang.Iterable values) { + ensureTargetInstanceClearSettingsFieldNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, targetInstanceClearSettingsFieldNames_); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTargetInstanceClearSettingsFieldNames() { + targetInstanceClearSettingsFieldNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies the instance settings that will be cleared from the
+     * source instance. This field is only applicable for cross project PITRs.
+     * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes of the targetInstanceClearSettingsFieldNames to add. + * @return This builder for chaining. + */ + public Builder addTargetInstanceClearSettingsFieldNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTargetInstanceClearSettingsFieldNamesIsMutable(); + targetInstanceClearSettingsFieldNames_.add(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private java.lang.Object region_ = ""; + + /** + * + * + *
+     * Optional. The region of the target instance where the datasource will be
+     * restored. For example: "us-central1".
+     * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the region field is set. + */ + public boolean hasRegion() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Optional. The region of the target instance where the datasource will be
+     * restored. For example: "us-central1".
+     * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The region. + */ + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The region of the target instance where the datasource will be
+     * restored. For example: "us-central1".
+     * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for region. + */ + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The region of the target instance where the datasource will be
+     * restored. For example: "us-central1".
+     * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The region to set. + * @return This builder for chaining. + */ + public Builder setRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + region_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The region of the target instance where the datasource will be
+     * restored. For example: "us-central1".
+     * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRegion() { + region_ = getDefaultInstance().getRegion(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The region of the target instance where the datasource will be
+     * restored. For example: "us-central1".
+     * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for region to set. + * @return This builder for chaining. + */ + public Builder setRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + region_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.PointInTimeRestoreContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.PointInTimeRestoreContext) + private static final com.google.cloud.sql.v1beta4.PointInTimeRestoreContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.PointInTimeRestoreContext(); + } + + public static com.google.cloud.sql.v1beta4.PointInTimeRestoreContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PointInTimeRestoreContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PointInTimeRestoreContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PointInTimeRestoreContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PointInTimeRestoreContextOrBuilder.java new file mode 100644 index 000000000000..f5c73f0df37c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PointInTimeRestoreContextOrBuilder.java @@ -0,0 +1,501 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface PointInTimeRestoreContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.PointInTimeRestoreContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Backup and Disaster Recovery (DR) Service Datasource URI.
+   * Format:
+   * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+   * 
+ * + * optional string datasource = 1; + * + * @return Whether the datasource field is set. + */ + boolean hasDatasource(); + + /** + * + * + *
+   * The Backup and Disaster Recovery (DR) Service Datasource URI.
+   * Format:
+   * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+   * 
+ * + * optional string datasource = 1; + * + * @return The datasource. + */ + java.lang.String getDatasource(); + + /** + * + * + *
+   * The Backup and Disaster Recovery (DR) Service Datasource URI.
+   * Format:
+   * projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
+   * 
+ * + * optional string datasource = 1; + * + * @return The bytes for datasource. + */ + com.google.protobuf.ByteString getDatasourceBytes(); + + /** + * + * + *
+   * Required. The date and time to which you want to restore the instance.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + boolean hasPointInTime(); + + /** + * + * + *
+   * Required. The date and time to which you want to restore the instance.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + com.google.protobuf.Timestamp getPointInTime(); + + /** + * + * + *
+   * Required. The date and time to which you want to restore the instance.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder(); + + /** + * + * + *
+   * Target instance name.
+   * 
+ * + * optional string target_instance = 3; + * + * @return Whether the targetInstance field is set. + */ + boolean hasTargetInstance(); + + /** + * + * + *
+   * Target instance name.
+   * 
+ * + * optional string target_instance = 3; + * + * @return The targetInstance. + */ + java.lang.String getTargetInstance(); + + /** + * + * + *
+   * Target instance name.
+   * 
+ * + * optional string target_instance = 3; + * + * @return The bytes for targetInstance. + */ + com.google.protobuf.ByteString getTargetInstanceBytes(); + + /** + * + * + *
+   * Optional. The resource link for the VPC network from which the Cloud SQL
+   * instance is accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`.
+   * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the privateNetwork field is set. + */ + boolean hasPrivateNetwork(); + + /** + * + * + *
+   * Optional. The resource link for the VPC network from which the Cloud SQL
+   * instance is accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`.
+   * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The privateNetwork. + */ + java.lang.String getPrivateNetwork(); + + /** + * + * + *
+   * Optional. The resource link for the VPC network from which the Cloud SQL
+   * instance is accessible for private IP. For example,
+   * `/projects/myProject/global/networks/default`.
+   * 
+ * + * optional string private_network = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for privateNetwork. + */ + com.google.protobuf.ByteString getPrivateNetworkBytes(); + + /** + * + * + *
+   * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+   * instance. For example: "google-managed-services-default". If you set this,
+   * then Cloud SQL creates the IP address for the cloned instance in the
+   * allocated range. This range must comply with [RFC
+   * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+   * name must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+   * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the allocatedIpRange field is set. + */ + boolean hasAllocatedIpRange(); + + /** + * + * + *
+   * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+   * instance. For example: "google-managed-services-default". If you set this,
+   * then Cloud SQL creates the IP address for the cloned instance in the
+   * allocated range. This range must comply with [RFC
+   * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+   * name must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+   * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allocatedIpRange. + */ + java.lang.String getAllocatedIpRange(); + + /** + * + * + *
+   * Optional. The name of the allocated IP range for the internal IP Cloud SQL
+   * instance. For example: "google-managed-services-default". If you set this,
+   * then Cloud SQL creates the IP address for the cloned instance in the
+   * allocated range. This range must comply with [RFC
+   * 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
+   * name must be 1-63 characters long and match the regular expression
+   * [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
+   * 
+ * + * optional string allocated_ip_range = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for allocatedIpRange. + */ + com.google.protobuf.ByteString getAllocatedIpRangeBytes(); + + /** + * + * + *
+   * Optional. Point-in-time recovery of an instance to the specified zone. If
+   * no zone is specified, then clone to the same primary zone as the source
+   * instance.
+   * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the preferredZone field is set. + */ + boolean hasPreferredZone(); + + /** + * + * + *
+   * Optional. Point-in-time recovery of an instance to the specified zone. If
+   * no zone is specified, then clone to the same primary zone as the source
+   * instance.
+   * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The preferredZone. + */ + java.lang.String getPreferredZone(); + + /** + * + * + *
+   * Optional. Point-in-time recovery of an instance to the specified zone. If
+   * no zone is specified, then clone to the same primary zone as the source
+   * instance.
+   * 
+ * + * optional string preferred_zone = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for preferredZone. + */ + com.google.protobuf.ByteString getPreferredZoneBytes(); + + /** + * + * + *
+   * Optional. Point-in-time recovery of a regional instance in the specified
+   * zones. If not specified, clone to the same secondary zone as the source
+   * instance. This value cannot be the same as the preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the preferredSecondaryZone field is set. + */ + boolean hasPreferredSecondaryZone(); + + /** + * + * + *
+   * Optional. Point-in-time recovery of a regional instance in the specified
+   * zones. If not specified, clone to the same secondary zone as the source
+   * instance. This value cannot be the same as the preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The preferredSecondaryZone. + */ + java.lang.String getPreferredSecondaryZone(); + + /** + * + * + *
+   * Optional. Point-in-time recovery of a regional instance in the specified
+   * zones. If not specified, clone to the same secondary zone as the source
+   * instance. This value cannot be the same as the preferred_zone field.
+   * 
+ * + * optional string preferred_secondary_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for preferredSecondaryZone. + */ + com.google.protobuf.ByteString getPreferredSecondaryZoneBytes(); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be overridden from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the targetInstanceSettings field is set. + */ + boolean hasTargetInstanceSettings(); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be overridden from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The targetInstanceSettings. + */ + com.google.cloud.sql.v1beta4.DatabaseInstance getTargetInstanceSettings(); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be overridden from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.DatabaseInstance target_instance_settings = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getTargetInstanceSettingsOrBuilder(); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the targetInstanceClearSettingsFieldNames. + */ + java.util.List getTargetInstanceClearSettingsFieldNamesList(); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of targetInstanceClearSettingsFieldNames. + */ + int getTargetInstanceClearSettingsFieldNamesCount(); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The targetInstanceClearSettingsFieldNames at the given index. + */ + java.lang.String getTargetInstanceClearSettingsFieldNames(int index); + + /** + * + * + *
+   * Optional. Specifies the instance settings that will be cleared from the
+   * source instance. This field is only applicable for cross project PITRs.
+   * 
+ * + * + * repeated string target_instance_clear_settings_field_names = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the targetInstanceClearSettingsFieldNames at the given index. + */ + com.google.protobuf.ByteString getTargetInstanceClearSettingsFieldNamesBytes(int index); + + /** + * + * + *
+   * Optional. The region of the target instance where the datasource will be
+   * restored. For example: "us-central1".
+   * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the region field is set. + */ + boolean hasRegion(); + + /** + * + * + *
+   * Optional. The region of the target instance where the datasource will be
+   * restored. For example: "us-central1".
+   * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The region. + */ + java.lang.String getRegion(); + + /** + * + * + *
+   * Optional. The region of the target instance where the datasource will be
+   * restored. For example: "us-central1".
+   * 
+ * + * optional string region = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for region. + */ + com.google.protobuf.ByteString getRegionBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PreCheckMajorVersionUpgradeContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PreCheckMajorVersionUpgradeContext.java new file mode 100644 index 000000000000..47e90c68c41f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PreCheckMajorVersionUpgradeContext.java @@ -0,0 +1,1351 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Pre-check major version upgrade context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext} + */ +@com.google.protobuf.Generated +public final class PreCheckMajorVersionUpgradeContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext) + PreCheckMajorVersionUpgradeContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PreCheckMajorVersionUpgradeContext"); + } + + // Use PreCheckMajorVersionUpgradeContext.newBuilder() to construct. + private PreCheckMajorVersionUpgradeContext( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PreCheckMajorVersionUpgradeContext() { + targetDatabaseVersion_ = 0; + preCheckResponse_ = java.util.Collections.emptyList(); + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PreCheckMajorVersionUpgradeContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PreCheckMajorVersionUpgradeContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.class, + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.Builder.class); + } + + public static final int TARGET_DATABASE_VERSION_FIELD_NUMBER = 1; + private int targetDatabaseVersion_ = 0; + + /** + * + * + *
+   * Required. The target database version to upgrade to.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for targetDatabaseVersion. + */ + @java.lang.Override + public int getTargetDatabaseVersionValue() { + return targetDatabaseVersion_; + } + + /** + * + * + *
+   * Required. The target database version to upgrade to.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The targetDatabaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabaseVersion getTargetDatabaseVersion() { + com.google.cloud.sql.v1beta4.SqlDatabaseVersion result = + com.google.cloud.sql.v1beta4.SqlDatabaseVersion.forNumber(targetDatabaseVersion_); + return result == null ? com.google.cloud.sql.v1beta4.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + public static final int PRE_CHECK_RESPONSE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List preCheckResponse_; + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getPreCheckResponseList() { + return preCheckResponse_; + } + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getPreCheckResponseOrBuilderList() { + return preCheckResponse_; + } + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getPreCheckResponseCount() { + return preCheckResponse_.size(); + } + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckResponse getPreCheckResponse(int index) { + return preCheckResponse_.get(index); + } + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckResponseOrBuilder getPreCheckResponseOrBuilder( + int index) { + return preCheckResponse_.get(index); + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+   * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+   * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = 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 (targetDatabaseVersion_ + != com.google.cloud.sql.v1beta4.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, targetDatabaseVersion_); + } + for (int i = 0; i < preCheckResponse_.size(); i++) { + output.writeMessage(2, preCheckResponse_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (targetDatabaseVersion_ + != com.google.cloud.sql.v1beta4.SqlDatabaseVersion.SQL_DATABASE_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, targetDatabaseVersion_); + } + for (int i = 0; i < preCheckResponse_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, preCheckResponse_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext other = + (com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext) obj; + + if (targetDatabaseVersion_ != other.targetDatabaseVersion_) return false; + if (!getPreCheckResponseList().equals(other.getPreCheckResponseList())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getUnknownFields().equals(other.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) + TARGET_DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + targetDatabaseVersion_; + if (getPreCheckResponseCount() > 0) { + hash = (37 * hash) + PRE_CHECK_RESPONSE_FIELD_NUMBER; + hash = (53 * hash) + getPreCheckResponseList().hashCode(); + } + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Pre-check major version upgrade context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext) + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PreCheckMajorVersionUpgradeContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PreCheckMajorVersionUpgradeContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.class, + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + targetDatabaseVersion_ = 0; + if (preCheckResponseBuilder_ == null) { + preCheckResponse_ = java.util.Collections.emptyList(); + } else { + preCheckResponse_ = null; + preCheckResponseBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + kind_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PreCheckMajorVersionUpgradeContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext build() { + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext buildPartial() { + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext result = + new com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext result) { + if (preCheckResponseBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + preCheckResponse_ = java.util.Collections.unmodifiableList(preCheckResponse_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.preCheckResponse_ = preCheckResponse_; + } else { + result.preCheckResponse_ = preCheckResponseBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.targetDatabaseVersion_ = targetDatabaseVersion_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext other) { + if (other + == com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.getDefaultInstance()) + return this; + if (other.targetDatabaseVersion_ != 0) { + setTargetDatabaseVersionValue(other.getTargetDatabaseVersionValue()); + } + if (preCheckResponseBuilder_ == null) { + if (!other.preCheckResponse_.isEmpty()) { + if (preCheckResponse_.isEmpty()) { + preCheckResponse_ = other.preCheckResponse_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePreCheckResponseIsMutable(); + preCheckResponse_.addAll(other.preCheckResponse_); + } + onChanged(); + } + } else { + if (!other.preCheckResponse_.isEmpty()) { + if (preCheckResponseBuilder_.isEmpty()) { + preCheckResponseBuilder_.dispose(); + preCheckResponseBuilder_ = null; + preCheckResponse_ = other.preCheckResponse_; + bitField0_ = (bitField0_ & ~0x00000002); + preCheckResponseBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPreCheckResponseFieldBuilder() + : null; + } else { + preCheckResponseBuilder_.addAllMessages(other.preCheckResponse_); + } + } + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + 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 8: + { + targetDatabaseVersion_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + com.google.cloud.sql.v1beta4.PreCheckResponse m = + input.readMessage( + com.google.cloud.sql.v1beta4.PreCheckResponse.parser(), extensionRegistry); + if (preCheckResponseBuilder_ == null) { + ensurePreCheckResponseIsMutable(); + preCheckResponse_.add(m); + } else { + preCheckResponseBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + kind_ = 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 int targetDatabaseVersion_ = 0; + + /** + * + * + *
+     * Required. The target database version to upgrade to.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for targetDatabaseVersion. + */ + @java.lang.Override + public int getTargetDatabaseVersionValue() { + return targetDatabaseVersion_; + } + + /** + * + * + *
+     * Required. The target database version to upgrade to.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for targetDatabaseVersion to set. + * @return This builder for chaining. + */ + public Builder setTargetDatabaseVersionValue(int value) { + targetDatabaseVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The target database version to upgrade to.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The targetDatabaseVersion. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabaseVersion getTargetDatabaseVersion() { + com.google.cloud.sql.v1beta4.SqlDatabaseVersion result = + com.google.cloud.sql.v1beta4.SqlDatabaseVersion.forNumber(targetDatabaseVersion_); + return result == null ? com.google.cloud.sql.v1beta4.SqlDatabaseVersion.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Required. The target database version to upgrade to.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The targetDatabaseVersion to set. + * @return This builder for chaining. + */ + public Builder setTargetDatabaseVersion(com.google.cloud.sql.v1beta4.SqlDatabaseVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + targetDatabaseVersion_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The target database version to upgrade to.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearTargetDatabaseVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + targetDatabaseVersion_ = 0; + onChanged(); + return this; + } + + private java.util.List preCheckResponse_ = + java.util.Collections.emptyList(); + + private void ensurePreCheckResponseIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + preCheckResponse_ = + new java.util.ArrayList( + preCheckResponse_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.PreCheckResponse, + com.google.cloud.sql.v1beta4.PreCheckResponse.Builder, + com.google.cloud.sql.v1beta4.PreCheckResponseOrBuilder> + preCheckResponseBuilder_; + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getPreCheckResponseList() { + if (preCheckResponseBuilder_ == null) { + return java.util.Collections.unmodifiableList(preCheckResponse_); + } else { + return preCheckResponseBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getPreCheckResponseCount() { + if (preCheckResponseBuilder_ == null) { + return preCheckResponse_.size(); + } else { + return preCheckResponseBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.PreCheckResponse getPreCheckResponse(int index) { + if (preCheckResponseBuilder_ == null) { + return preCheckResponse_.get(index); + } else { + return preCheckResponseBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPreCheckResponse( + int index, com.google.cloud.sql.v1beta4.PreCheckResponse value) { + if (preCheckResponseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePreCheckResponseIsMutable(); + preCheckResponse_.set(index, value); + onChanged(); + } else { + preCheckResponseBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPreCheckResponse( + int index, com.google.cloud.sql.v1beta4.PreCheckResponse.Builder builderForValue) { + if (preCheckResponseBuilder_ == null) { + ensurePreCheckResponseIsMutable(); + preCheckResponse_.set(index, builderForValue.build()); + onChanged(); + } else { + preCheckResponseBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPreCheckResponse(com.google.cloud.sql.v1beta4.PreCheckResponse value) { + if (preCheckResponseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePreCheckResponseIsMutable(); + preCheckResponse_.add(value); + onChanged(); + } else { + preCheckResponseBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPreCheckResponse( + int index, com.google.cloud.sql.v1beta4.PreCheckResponse value) { + if (preCheckResponseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePreCheckResponseIsMutable(); + preCheckResponse_.add(index, value); + onChanged(); + } else { + preCheckResponseBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPreCheckResponse( + com.google.cloud.sql.v1beta4.PreCheckResponse.Builder builderForValue) { + if (preCheckResponseBuilder_ == null) { + ensurePreCheckResponseIsMutable(); + preCheckResponse_.add(builderForValue.build()); + onChanged(); + } else { + preCheckResponseBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPreCheckResponse( + int index, com.google.cloud.sql.v1beta4.PreCheckResponse.Builder builderForValue) { + if (preCheckResponseBuilder_ == null) { + ensurePreCheckResponseIsMutable(); + preCheckResponse_.add(index, builderForValue.build()); + onChanged(); + } else { + preCheckResponseBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllPreCheckResponse( + java.lang.Iterable values) { + if (preCheckResponseBuilder_ == null) { + ensurePreCheckResponseIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, preCheckResponse_); + onChanged(); + } else { + preCheckResponseBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPreCheckResponse() { + if (preCheckResponseBuilder_ == null) { + preCheckResponse_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + preCheckResponseBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removePreCheckResponse(int index) { + if (preCheckResponseBuilder_ == null) { + ensurePreCheckResponseIsMutable(); + preCheckResponse_.remove(index); + onChanged(); + } else { + preCheckResponseBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.PreCheckResponse.Builder getPreCheckResponseBuilder( + int index) { + return internalGetPreCheckResponseFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.PreCheckResponseOrBuilder getPreCheckResponseOrBuilder( + int index) { + if (preCheckResponseBuilder_ == null) { + return preCheckResponse_.get(index); + } else { + return preCheckResponseBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPreCheckResponseOrBuilderList() { + if (preCheckResponseBuilder_ != null) { + return preCheckResponseBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(preCheckResponse_); + } + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.PreCheckResponse.Builder addPreCheckResponseBuilder() { + return internalGetPreCheckResponseFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.PreCheckResponse.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.PreCheckResponse.Builder addPreCheckResponseBuilder( + int index) { + return internalGetPreCheckResponseFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.PreCheckResponse.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The responses from the precheck operation.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPreCheckResponseBuilderList() { + return internalGetPreCheckResponseFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.PreCheckResponse, + com.google.cloud.sql.v1beta4.PreCheckResponse.Builder, + com.google.cloud.sql.v1beta4.PreCheckResponseOrBuilder> + internalGetPreCheckResponseFieldBuilder() { + if (preCheckResponseBuilder_ == null) { + preCheckResponseBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.PreCheckResponse, + com.google.cloud.sql.v1beta4.PreCheckResponse.Builder, + com.google.cloud.sql.v1beta4.PreCheckResponseOrBuilder>( + preCheckResponse_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + preCheckResponse_ = null; + } + return preCheckResponseBuilder_; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext) + private static final com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext(); + } + + public static com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PreCheckMajorVersionUpgradeContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PreCheckMajorVersionUpgradeContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PreCheckMajorVersionUpgradeContextOrBuilder.java new file mode 100644 index 000000000000..dca0ce8b30d4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PreCheckMajorVersionUpgradeContextOrBuilder.java @@ -0,0 +1,150 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface PreCheckMajorVersionUpgradeContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The target database version to upgrade to.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for targetDatabaseVersion. + */ + int getTargetDatabaseVersionValue(); + + /** + * + * + *
+   * Required. The target database version to upgrade to.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlDatabaseVersion target_database_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The targetDatabaseVersion. + */ + com.google.cloud.sql.v1beta4.SqlDatabaseVersion getTargetDatabaseVersion(); + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getPreCheckResponseList(); + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.PreCheckResponse getPreCheckResponse(int index); + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getPreCheckResponseCount(); + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getPreCheckResponseOrBuilderList(); + + /** + * + * + *
+   * Output only. The responses from the precheck operation.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PreCheckResponse pre_check_response = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.PreCheckResponseOrBuilder getPreCheckResponseOrBuilder(int index); + + /** + * + * + *
+   * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+   * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
+   * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PreCheckResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PreCheckResponse.java new file mode 100644 index 000000000000..8a6d7f3779cf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PreCheckResponse.java @@ -0,0 +1,1336 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Structured PreCheckResponse containing message, type, and required
+ * actions.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PreCheckResponse} + */ +@com.google.protobuf.Generated +public final class PreCheckResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.PreCheckResponse) + PreCheckResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PreCheckResponse"); + } + + // Use PreCheckResponse.newBuilder() to construct. + private PreCheckResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PreCheckResponse() { + message_ = ""; + messageType_ = 0; + actionsRequired_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PreCheckResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PreCheckResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PreCheckResponse.class, + com.google.cloud.sql.v1beta4.PreCheckResponse.Builder.class); + } + + /** + * + * + *
+   * The type of message which can be an info, a warning, or an error that
+   * requires user intervention.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.PreCheckResponse.MessageType} + */ + public enum MessageType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default unspecified value to prevent unintended behavior changes.
+     * 
+ * + * MESSAGE_TYPE_UNSPECIFIED = 0; + */ + MESSAGE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * General informational messages that don't require action.
+     * 
+ * + * INFO = 1; + */ + INFO(1), + /** + * + * + *
+     * Warnings that might impact the upgrade but don't block it.
+     * 
+ * + * WARNING = 2; + */ + WARNING(2), + /** + * + * + *
+     * Errors that a user must resolve before proceeding with the upgrade.
+     * 
+ * + * ERROR = 3; + */ + ERROR(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MessageType"); + } + + /** + * + * + *
+     * Default unspecified value to prevent unintended behavior changes.
+     * 
+ * + * MESSAGE_TYPE_UNSPECIFIED = 0; + */ + public static final int MESSAGE_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * General informational messages that don't require action.
+     * 
+ * + * INFO = 1; + */ + public static final int INFO_VALUE = 1; + + /** + * + * + *
+     * Warnings that might impact the upgrade but don't block it.
+     * 
+ * + * WARNING = 2; + */ + public static final int WARNING_VALUE = 2; + + /** + * + * + *
+     * Errors that a user must resolve before proceeding with the upgrade.
+     * 
+ * + * ERROR = 3; + */ + public static final int ERROR_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 MessageType 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 MessageType forNumber(int value) { + switch (value) { + case 0: + return MESSAGE_TYPE_UNSPECIFIED; + case 1: + return INFO; + case 2: + return WARNING; + case 3: + return ERROR; + 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 MessageType findValueByNumber(int number) { + return MessageType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.PreCheckResponse.getDescriptor().getEnumTypes().get(0); + } + + private static final MessageType[] VALUES = values(); + + public static MessageType 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 MessageType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.PreCheckResponse.MessageType) + } + + private int bitField0_; + public static final int MESSAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
+   * The message to be displayed to the user.
+   * 
+ * + * optional string message = 2; + * + * @return Whether the message field is set. + */ + @java.lang.Override + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The message to be displayed to the user.
+   * 
+ * + * optional string message = 2; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + + /** + * + * + *
+   * The message to be displayed to the user.
+   * 
+ * + * optional string message = 2; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_TYPE_FIELD_NUMBER = 3; + private int messageType_ = 0; + + /** + * + * + *
+   * The type of message whether it is an info, warning, or error.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.PreCheckResponse.MessageType message_type = 3; + * + * @return Whether the messageType field is set. + */ + @java.lang.Override + public boolean hasMessageType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The type of message whether it is an info, warning, or error.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.PreCheckResponse.MessageType message_type = 3; + * + * @return The enum numeric value on the wire for messageType. + */ + @java.lang.Override + public int getMessageTypeValue() { + return messageType_; + } + + /** + * + * + *
+   * The type of message whether it is an info, warning, or error.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.PreCheckResponse.MessageType message_type = 3; + * + * @return The messageType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckResponse.MessageType getMessageType() { + com.google.cloud.sql.v1beta4.PreCheckResponse.MessageType result = + com.google.cloud.sql.v1beta4.PreCheckResponse.MessageType.forNumber(messageType_); + return result == null + ? com.google.cloud.sql.v1beta4.PreCheckResponse.MessageType.UNRECOGNIZED + : result; + } + + public static final int ACTIONS_REQUIRED_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList actionsRequired_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @return A list containing the actionsRequired. + */ + public com.google.protobuf.ProtocolStringList getActionsRequiredList() { + return actionsRequired_; + } + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @return The count of actionsRequired. + */ + public int getActionsRequiredCount() { + return actionsRequired_.size(); + } + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @param index The index of the element to return. + * @return The actionsRequired at the given index. + */ + public java.lang.String getActionsRequired(int index) { + return actionsRequired_.get(index); + } + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @param index The index of the value to return. + * @return The bytes of the actionsRequired at the given index. + */ + public com.google.protobuf.ByteString getActionsRequiredBytes(int index) { + return actionsRequired_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, message_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeEnum(3, messageType_); + } + for (int i = 0; i < actionsRequired_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, actionsRequired_.getRaw(i)); + } + 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.GeneratedMessage.computeStringSize(2, message_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, messageType_); + } + { + int dataSize = 0; + for (int i = 0; i < actionsRequired_.size(); i++) { + dataSize += computeStringSizeNoTag(actionsRequired_.getRaw(i)); + } + size += dataSize; + size += 1 * getActionsRequiredList().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.sql.v1beta4.PreCheckResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.PreCheckResponse other = + (com.google.cloud.sql.v1beta4.PreCheckResponse) obj; + + if (hasMessage() != other.hasMessage()) return false; + if (hasMessage()) { + if (!getMessage().equals(other.getMessage())) return false; + } + if (hasMessageType() != other.hasMessageType()) return false; + if (hasMessageType()) { + if (messageType_ != other.messageType_) return false; + } + if (!getActionsRequiredList().equals(other.getActionsRequiredList())) return false; + if (!getUnknownFields().equals(other.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 (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + if (hasMessageType()) { + hash = (37 * hash) + MESSAGE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + messageType_; + } + if (getActionsRequiredCount() > 0) { + hash = (37 * hash) + ACTIONS_REQUIRED_FIELD_NUMBER; + hash = (53 * hash) + getActionsRequiredList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.PreCheckResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PreCheckResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PreCheckResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PreCheckResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PreCheckResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PreCheckResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PreCheckResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PreCheckResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PreCheckResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PreCheckResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PreCheckResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PreCheckResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.PreCheckResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Structured PreCheckResponse containing message, type, and required
+   * actions.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PreCheckResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.PreCheckResponse) + com.google.cloud.sql.v1beta4.PreCheckResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PreCheckResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PreCheckResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PreCheckResponse.class, + com.google.cloud.sql.v1beta4.PreCheckResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.PreCheckResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + message_ = ""; + messageType_ = 0; + actionsRequired_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PreCheckResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.PreCheckResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckResponse build() { + com.google.cloud.sql.v1beta4.PreCheckResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckResponse buildPartial() { + com.google.cloud.sql.v1beta4.PreCheckResponse result = + new com.google.cloud.sql.v1beta4.PreCheckResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.PreCheckResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.message_ = message_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.messageType_ = messageType_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + actionsRequired_.makeImmutable(); + result.actionsRequired_ = actionsRequired_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.PreCheckResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.PreCheckResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.PreCheckResponse other) { + if (other == com.google.cloud.sql.v1beta4.PreCheckResponse.getDefaultInstance()) return this; + if (other.hasMessage()) { + message_ = other.message_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasMessageType()) { + setMessageTypeValue(other.getMessageTypeValue()); + } + if (!other.actionsRequired_.isEmpty()) { + if (actionsRequired_.isEmpty()) { + actionsRequired_ = other.actionsRequired_; + bitField0_ |= 0x00000004; + } else { + ensureActionsRequiredIsMutable(); + actionsRequired_.addAll(other.actionsRequired_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 18 + case 24: + { + messageType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 24 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureActionsRequiredIsMutable(); + actionsRequired_.add(s); + 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 message_ = ""; + + /** + * + * + *
+     * The message to be displayed to the user.
+     * 
+ * + * optional string message = 2; + * + * @return Whether the message field is set. + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The message to be displayed to the user.
+     * 
+ * + * optional string message = 2; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The message to be displayed to the user.
+     * 
+ * + * optional string message = 2; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The message to be displayed to the user.
+     * 
+ * + * optional string message = 2; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The message to be displayed to the user.
+     * 
+ * + * optional string message = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The message to be displayed to the user.
+     * 
+ * + * optional string message = 2; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int messageType_ = 0; + + /** + * + * + *
+     * The type of message whether it is an info, warning, or error.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PreCheckResponse.MessageType message_type = 3; + * + * + * @return Whether the messageType field is set. + */ + @java.lang.Override + public boolean hasMessageType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The type of message whether it is an info, warning, or error.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PreCheckResponse.MessageType message_type = 3; + * + * + * @return The enum numeric value on the wire for messageType. + */ + @java.lang.Override + public int getMessageTypeValue() { + return messageType_; + } + + /** + * + * + *
+     * The type of message whether it is an info, warning, or error.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PreCheckResponse.MessageType message_type = 3; + * + * + * @param value The enum numeric value on the wire for messageType to set. + * @return This builder for chaining. + */ + public Builder setMessageTypeValue(int value) { + messageType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of message whether it is an info, warning, or error.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PreCheckResponse.MessageType message_type = 3; + * + * + * @return The messageType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckResponse.MessageType getMessageType() { + com.google.cloud.sql.v1beta4.PreCheckResponse.MessageType result = + com.google.cloud.sql.v1beta4.PreCheckResponse.MessageType.forNumber(messageType_); + return result == null + ? com.google.cloud.sql.v1beta4.PreCheckResponse.MessageType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The type of message whether it is an info, warning, or error.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PreCheckResponse.MessageType message_type = 3; + * + * + * @param value The messageType to set. + * @return This builder for chaining. + */ + public Builder setMessageType(com.google.cloud.sql.v1beta4.PreCheckResponse.MessageType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + messageType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of message whether it is an info, warning, or error.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.PreCheckResponse.MessageType message_type = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearMessageType() { + bitField0_ = (bitField0_ & ~0x00000002); + messageType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList actionsRequired_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureActionsRequiredIsMutable() { + if (!actionsRequired_.isModifiable()) { + actionsRequired_ = new com.google.protobuf.LazyStringArrayList(actionsRequired_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @return A list containing the actionsRequired. + */ + public com.google.protobuf.ProtocolStringList getActionsRequiredList() { + actionsRequired_.makeImmutable(); + return actionsRequired_; + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @return The count of actionsRequired. + */ + public int getActionsRequiredCount() { + return actionsRequired_.size(); + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @param index The index of the element to return. + * @return The actionsRequired at the given index. + */ + public java.lang.String getActionsRequired(int index) { + return actionsRequired_.get(index); + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @param index The index of the value to return. + * @return The bytes of the actionsRequired at the given index. + */ + public com.google.protobuf.ByteString getActionsRequiredBytes(int index) { + return actionsRequired_.getByteString(index); + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @param index The index to set the value at. + * @param value The actionsRequired to set. + * @return This builder for chaining. + */ + public Builder setActionsRequired(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionsRequiredIsMutable(); + actionsRequired_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @param value The actionsRequired to add. + * @return This builder for chaining. + */ + public Builder addActionsRequired(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionsRequiredIsMutable(); + actionsRequired_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @param values The actionsRequired to add. + * @return This builder for chaining. + */ + public Builder addAllActionsRequired(java.lang.Iterable values) { + ensureActionsRequiredIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, actionsRequired_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @return This builder for chaining. + */ + public Builder clearActionsRequired() { + actionsRequired_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * The actions that the user needs to take. Use repeated for multiple
+     * actions.
+     * 
+ * + * repeated string actions_required = 4; + * + * @param value The bytes of the actionsRequired to add. + * @return This builder for chaining. + */ + public Builder addActionsRequiredBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureActionsRequiredIsMutable(); + actionsRequired_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.PreCheckResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.PreCheckResponse) + private static final com.google.cloud.sql.v1beta4.PreCheckResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.PreCheckResponse(); + } + + public static com.google.cloud.sql.v1beta4.PreCheckResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PreCheckResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PreCheckResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PreCheckResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PreCheckResponseOrBuilder.java new file mode 100644 index 000000000000..b1e9d8054bc9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PreCheckResponseOrBuilder.java @@ -0,0 +1,164 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface PreCheckResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.PreCheckResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The message to be displayed to the user.
+   * 
+ * + * optional string message = 2; + * + * @return Whether the message field is set. + */ + boolean hasMessage(); + + /** + * + * + *
+   * The message to be displayed to the user.
+   * 
+ * + * optional string message = 2; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
+   * The message to be displayed to the user.
+   * 
+ * + * optional string message = 2; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
+   * The type of message whether it is an info, warning, or error.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.PreCheckResponse.MessageType message_type = 3; + * + * @return Whether the messageType field is set. + */ + boolean hasMessageType(); + + /** + * + * + *
+   * The type of message whether it is an info, warning, or error.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.PreCheckResponse.MessageType message_type = 3; + * + * @return The enum numeric value on the wire for messageType. + */ + int getMessageTypeValue(); + + /** + * + * + *
+   * The type of message whether it is an info, warning, or error.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.PreCheckResponse.MessageType message_type = 3; + * + * @return The messageType. + */ + com.google.cloud.sql.v1beta4.PreCheckResponse.MessageType getMessageType(); + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @return A list containing the actionsRequired. + */ + java.util.List getActionsRequiredList(); + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @return The count of actionsRequired. + */ + int getActionsRequiredCount(); + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @param index The index of the element to return. + * @return The actionsRequired at the given index. + */ + java.lang.String getActionsRequired(int index); + + /** + * + * + *
+   * The actions that the user needs to take. Use repeated for multiple
+   * actions.
+   * 
+ * + * repeated string actions_required = 4; + * + * @param index The index of the value to return. + * @return The bytes of the actionsRequired at the given index. + */ + com.google.protobuf.ByteString getActionsRequiredBytes(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ProjectName.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ProjectName.java new file mode 100644 index 000000000000..2aa0c9b0672a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ProjectName.java @@ -0,0 +1,171 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4; + +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; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@NullMarked +@Generated("by gapic-generator-java") +public class ProjectName implements ResourceName { + private static final PathTemplate PROJECT = + PathTemplate.createWithoutUrlEncoding("projects/{project}"); + private volatile Map fieldValuesMap; + private final String project; + + @Deprecated + protected ProjectName() { + project = null; + } + + private ProjectName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + } + + public String getProject() { + return project; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProjectName of(String project) { + return newBuilder().setProject(project).build(); + } + + public static String format(String project) { + return newBuilder().setProject(project).build().toString(); + } + + public static @Nullable ProjectName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT.validatedMatch( + formattedString, "ProjectName.parse: formattedString not in valid format"); + return of(matchMap.get("project")); + } + + 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<@Nullable ProjectName> values) { + List list = new ArrayList<>(values.size()); + for (ProjectName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT.instantiate("project", project); + } + + @Override + public boolean equals(@Nullable Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ProjectName that = ((ProjectName) o); + return Objects.equals(this.project, that.project); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + return h; + } + + /** Builder for projects/{project}. */ + public static class Builder { + private String project; + + protected Builder() {} + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder(ProjectName projectName) { + this.project = projectName.project; + } + + public ProjectName build() { + return new ProjectName(this); + } + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PscAutoConnectionConfig.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PscAutoConnectionConfig.java new file mode 100644 index 000000000000..21badc87e057 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PscAutoConnectionConfig.java @@ -0,0 +1,2500 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Settings for an automatically-setup Private Service Connect consumer endpoint
+ * that is used to connect to a Cloud SQL instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PscAutoConnectionConfig} + */ +@com.google.protobuf.Generated +public final class PscAutoConnectionConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.PscAutoConnectionConfig) + PscAutoConnectionConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PscAutoConnectionConfig"); + } + + // Use PscAutoConnectionConfig.newBuilder() to construct. + private PscAutoConnectionConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PscAutoConnectionConfig() { + consumerProject_ = ""; + consumerNetwork_ = ""; + ipAddress_ = ""; + status_ = ""; + consumerNetworkStatus_ = ""; + serviceConnectionPolicy_ = ""; + serviceConnectionPolicyCreationResult_ = ""; + instanceAutoDnsStatus_ = 0; + writeEndpointAutoDnsStatus_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PscAutoConnectionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PscAutoConnectionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.class, + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder.class); + } + + private int bitField0_; + public static final int CONSUMER_PROJECT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object consumerProject_ = ""; + + /** + * + * + *
+   * Optional. This is the project ID of consumer service project of this
+   * consumer endpoint.
+   *
+   * Optional. This is only applicable if consumer_network is a shared vpc
+   * network.
+   * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The consumerProject. + */ + @java.lang.Override + public java.lang.String getConsumerProject() { + java.lang.Object ref = consumerProject_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerProject_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. This is the project ID of consumer service project of this
+   * consumer endpoint.
+   *
+   * Optional. This is only applicable if consumer_network is a shared vpc
+   * network.
+   * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for consumerProject. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConsumerProjectBytes() { + java.lang.Object ref = consumerProject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONSUMER_NETWORK_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object consumerNetwork_ = ""; + + /** + * + * + *
+   * Optional. The consumer network of this consumer endpoint. This must be a
+   * resource path that includes both the host project and the network name.
+   *
+   * For example, `projects/project1/global/networks/network1`.
+   *
+   * The consumer host project of this network might be different from the
+   * consumer service project.
+   * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The consumerNetwork. + */ + @java.lang.Override + public java.lang.String getConsumerNetwork() { + java.lang.Object ref = consumerNetwork_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerNetwork_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The consumer network of this consumer endpoint. This must be a
+   * resource path that includes both the host project and the network name.
+   *
+   * For example, `projects/project1/global/networks/network1`.
+   *
+   * The consumer host project of this network might be different from the
+   * consumer service project.
+   * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for consumerNetwork. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConsumerNetworkBytes() { + java.lang.Object ref = consumerNetwork_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipAddress_ = ""; + + /** + * + * + *
+   * The IP address of the consumer endpoint.
+   * 
+ * + * optional string ip_address = 3 [(.google.api.field_info) = { ... } + * + * @return Whether the ipAddress field is set. + */ + @java.lang.Override + public boolean hasIpAddress() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The IP address of the consumer endpoint.
+   * 
+ * + * optional string ip_address = 3 [(.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; + } + } + + /** + * + * + *
+   * The IP address of the consumer endpoint.
+   * 
+ * + * optional string ip_address = 3 [(.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 STATUS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object status_ = ""; + + /** + * + * + *
+   * The connection status of the consumer endpoint.
+   * 
+ * + * optional string status = 4; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The connection status of the consumer endpoint.
+   * 
+ * + * optional string status = 4; + * + * @return The status. + */ + @java.lang.Override + public java.lang.String getStatus() { + java.lang.Object ref = status_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + status_ = s; + return s; + } + } + + /** + * + * + *
+   * The connection status of the consumer endpoint.
+   * 
+ * + * optional string status = 4; + * + * @return The bytes for status. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusBytes() { + java.lang.Object ref = status_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + status_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONSUMER_NETWORK_STATUS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object consumerNetworkStatus_ = ""; + + /** + * + * + *
+   * The connection policy status of the consumer network.
+   * 
+ * + * optional string consumer_network_status = 5; + * + * @return Whether the consumerNetworkStatus field is set. + */ + @java.lang.Override + public boolean hasConsumerNetworkStatus() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The connection policy status of the consumer network.
+   * 
+ * + * optional string consumer_network_status = 5; + * + * @return The consumerNetworkStatus. + */ + @java.lang.Override + public java.lang.String getConsumerNetworkStatus() { + java.lang.Object ref = consumerNetworkStatus_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerNetworkStatus_ = s; + return s; + } + } + + /** + * + * + *
+   * The connection policy status of the consumer network.
+   * 
+ * + * optional string consumer_network_status = 5; + * + * @return The bytes for consumerNetworkStatus. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConsumerNetworkStatusBytes() { + java.lang.Object ref = consumerNetworkStatus_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerNetworkStatus_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_CONNECTION_POLICY_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceConnectionPolicy_ = ""; + + /** + * + * + *
+   * Output only. The service connection policy created automatically for the
+   * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+   * in the format of:
+   * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+   * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+   * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the serviceConnectionPolicy field is set. + */ + @java.lang.Override + public boolean hasServiceConnectionPolicy() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Output only. The service connection policy created automatically for the
+   * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+   * in the format of:
+   * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+   * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+   * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceConnectionPolicy. + */ + @java.lang.Override + public java.lang.String getServiceConnectionPolicy() { + java.lang.Object ref = serviceConnectionPolicy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceConnectionPolicy_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The service connection policy created automatically for the
+   * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+   * in the format of:
+   * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+   * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+   * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceConnectionPolicy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceConnectionPolicyBytes() { + java.lang.Object ref = serviceConnectionPolicy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConnectionPolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_CONNECTION_POLICY_CREATION_RESULT_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceConnectionPolicyCreationResult_ = ""; + + /** + * + * + *
+   * Output only. The status of service connection policy creation.
+   * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the serviceConnectionPolicyCreationResult field is set. + */ + @java.lang.Override + public boolean hasServiceConnectionPolicyCreationResult() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Output only. The status of service connection policy creation.
+   * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The serviceConnectionPolicyCreationResult. + */ + @java.lang.Override + public java.lang.String getServiceConnectionPolicyCreationResult() { + java.lang.Object ref = serviceConnectionPolicyCreationResult_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceConnectionPolicyCreationResult_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The status of service connection policy creation.
+   * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for serviceConnectionPolicyCreationResult. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceConnectionPolicyCreationResultBytes() { + java.lang.Object ref = serviceConnectionPolicyCreationResult_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConnectionPolicyCreationResult_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_AUTO_DNS_STATUS_FIELD_NUMBER = 8; + private int instanceAutoDnsStatus_ = 0; + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceAutoDnsStatus field is set. + */ + @java.lang.Override + public boolean hasInstanceAutoDnsStatus() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for instanceAutoDnsStatus. + */ + @java.lang.Override + public int getInstanceAutoDnsStatusValue() { + return instanceAutoDnsStatus_; + } + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceAutoDnsStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AutoDnsStatus getInstanceAutoDnsStatus() { + com.google.cloud.sql.v1beta4.AutoDnsStatus result = + com.google.cloud.sql.v1beta4.AutoDnsStatus.forNumber(instanceAutoDnsStatus_); + return result == null ? com.google.cloud.sql.v1beta4.AutoDnsStatus.UNRECOGNIZED : result; + } + + public static final int WRITE_ENDPOINT_AUTO_DNS_STATUS_FIELD_NUMBER = 9; + private int writeEndpointAutoDnsStatus_ = 0; + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning for the write
+   * endpoint.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writeEndpointAutoDnsStatus field is set. + */ + @java.lang.Override + public boolean hasWriteEndpointAutoDnsStatus() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning for the write
+   * endpoint.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for writeEndpointAutoDnsStatus. + */ + @java.lang.Override + public int getWriteEndpointAutoDnsStatusValue() { + return writeEndpointAutoDnsStatus_; + } + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning for the write
+   * endpoint.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writeEndpointAutoDnsStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AutoDnsStatus getWriteEndpointAutoDnsStatus() { + com.google.cloud.sql.v1beta4.AutoDnsStatus result = + com.google.cloud.sql.v1beta4.AutoDnsStatus.forNumber(writeEndpointAutoDnsStatus_); + return result == null ? com.google.cloud.sql.v1beta4.AutoDnsStatus.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.GeneratedMessage.isStringEmpty(consumerProject_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, consumerProject_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(consumerNetwork_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, consumerNetwork_); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, ipAddress_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, status_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, consumerNetworkStatus_); + } + if (((bitField0_ & 0x00000008) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, serviceConnectionPolicy_); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessage.writeString( + output, 7, serviceConnectionPolicyCreationResult_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeEnum(8, instanceAutoDnsStatus_); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeEnum(9, writeEndpointAutoDnsStatus_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(consumerProject_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, consumerProject_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(consumerNetwork_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, consumerNetwork_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, ipAddress_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, status_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, consumerNetworkStatus_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, serviceConnectionPolicy_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.GeneratedMessage.computeStringSize( + 7, serviceConnectionPolicyCreationResult_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, instanceAutoDnsStatus_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, writeEndpointAutoDnsStatus_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.PscAutoConnectionConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig other = + (com.google.cloud.sql.v1beta4.PscAutoConnectionConfig) obj; + + if (!getConsumerProject().equals(other.getConsumerProject())) return false; + if (!getConsumerNetwork().equals(other.getConsumerNetwork())) return false; + if (hasIpAddress() != other.hasIpAddress()) return false; + if (hasIpAddress()) { + if (!getIpAddress().equals(other.getIpAddress())) return false; + } + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (hasConsumerNetworkStatus() != other.hasConsumerNetworkStatus()) return false; + if (hasConsumerNetworkStatus()) { + if (!getConsumerNetworkStatus().equals(other.getConsumerNetworkStatus())) return false; + } + if (hasServiceConnectionPolicy() != other.hasServiceConnectionPolicy()) return false; + if (hasServiceConnectionPolicy()) { + if (!getServiceConnectionPolicy().equals(other.getServiceConnectionPolicy())) return false; + } + if (hasServiceConnectionPolicyCreationResult() + != other.hasServiceConnectionPolicyCreationResult()) return false; + if (hasServiceConnectionPolicyCreationResult()) { + if (!getServiceConnectionPolicyCreationResult() + .equals(other.getServiceConnectionPolicyCreationResult())) return false; + } + if (hasInstanceAutoDnsStatus() != other.hasInstanceAutoDnsStatus()) return false; + if (hasInstanceAutoDnsStatus()) { + if (instanceAutoDnsStatus_ != other.instanceAutoDnsStatus_) return false; + } + if (hasWriteEndpointAutoDnsStatus() != other.hasWriteEndpointAutoDnsStatus()) return false; + if (hasWriteEndpointAutoDnsStatus()) { + if (writeEndpointAutoDnsStatus_ != other.writeEndpointAutoDnsStatus_) return false; + } + if (!getUnknownFields().equals(other.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) + CONSUMER_PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getConsumerProject().hashCode(); + hash = (37 * hash) + CONSUMER_NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getConsumerNetwork().hashCode(); + if (hasIpAddress()) { + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (hasConsumerNetworkStatus()) { + hash = (37 * hash) + CONSUMER_NETWORK_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getConsumerNetworkStatus().hashCode(); + } + if (hasServiceConnectionPolicy()) { + hash = (37 * hash) + SERVICE_CONNECTION_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getServiceConnectionPolicy().hashCode(); + } + if (hasServiceConnectionPolicyCreationResult()) { + hash = (37 * hash) + SERVICE_CONNECTION_POLICY_CREATION_RESULT_FIELD_NUMBER; + hash = (53 * hash) + getServiceConnectionPolicyCreationResult().hashCode(); + } + if (hasInstanceAutoDnsStatus()) { + hash = (37 * hash) + INSTANCE_AUTO_DNS_STATUS_FIELD_NUMBER; + hash = (53 * hash) + instanceAutoDnsStatus_; + } + if (hasWriteEndpointAutoDnsStatus()) { + hash = (37 * hash) + WRITE_ENDPOINT_AUTO_DNS_STATUS_FIELD_NUMBER; + hash = (53 * hash) + writeEndpointAutoDnsStatus_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.PscAutoConnectionConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PscAutoConnectionConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PscAutoConnectionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PscAutoConnectionConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PscAutoConnectionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PscAutoConnectionConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PscAutoConnectionConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PscAutoConnectionConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PscAutoConnectionConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PscAutoConnectionConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PscAutoConnectionConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PscAutoConnectionConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.PscAutoConnectionConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Settings for an automatically-setup Private Service Connect consumer endpoint
+   * that is used to connect to a Cloud SQL instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PscAutoConnectionConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.PscAutoConnectionConfig) + com.google.cloud.sql.v1beta4.PscAutoConnectionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PscAutoConnectionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PscAutoConnectionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.class, + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + consumerProject_ = ""; + consumerNetwork_ = ""; + ipAddress_ = ""; + status_ = ""; + consumerNetworkStatus_ = ""; + serviceConnectionPolicy_ = ""; + serviceConnectionPolicyCreationResult_ = ""; + instanceAutoDnsStatus_ = 0; + writeEndpointAutoDnsStatus_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PscAutoConnectionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfig build() { + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfig buildPartial() { + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig result = + new com.google.cloud.sql.v1beta4.PscAutoConnectionConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.PscAutoConnectionConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.consumerProject_ = consumerProject_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.consumerNetwork_ = consumerNetwork_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ipAddress_ = ipAddress_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.status_ = status_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.consumerNetworkStatus_ = consumerNetworkStatus_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.serviceConnectionPolicy_ = serviceConnectionPolicy_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.serviceConnectionPolicyCreationResult_ = serviceConnectionPolicyCreationResult_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.instanceAutoDnsStatus_ = instanceAutoDnsStatus_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.writeEndpointAutoDnsStatus_ = writeEndpointAutoDnsStatus_; + to_bitField0_ |= 0x00000040; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.PscAutoConnectionConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.PscAutoConnectionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.PscAutoConnectionConfig other) { + if (other == com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.getDefaultInstance()) + return this; + if (!other.getConsumerProject().isEmpty()) { + consumerProject_ = other.consumerProject_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getConsumerNetwork().isEmpty()) { + consumerNetwork_ = other.consumerNetwork_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasIpAddress()) { + ipAddress_ = other.ipAddress_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasStatus()) { + status_ = other.status_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasConsumerNetworkStatus()) { + consumerNetworkStatus_ = other.consumerNetworkStatus_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasServiceConnectionPolicy()) { + serviceConnectionPolicy_ = other.serviceConnectionPolicy_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasServiceConnectionPolicyCreationResult()) { + serviceConnectionPolicyCreationResult_ = other.serviceConnectionPolicyCreationResult_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasInstanceAutoDnsStatus()) { + setInstanceAutoDnsStatusValue(other.getInstanceAutoDnsStatusValue()); + } + if (other.hasWriteEndpointAutoDnsStatus()) { + setWriteEndpointAutoDnsStatusValue(other.getWriteEndpointAutoDnsStatusValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + consumerProject_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + consumerNetwork_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + ipAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + status_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + consumerNetworkStatus_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + serviceConnectionPolicy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + serviceConnectionPolicyCreationResult_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: + { + instanceAutoDnsStatus_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: + { + writeEndpointAutoDnsStatus_ = input.readEnum(); + bitField0_ |= 0x00000100; + 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 bitField0_; + + private java.lang.Object consumerProject_ = ""; + + /** + * + * + *
+     * Optional. This is the project ID of consumer service project of this
+     * consumer endpoint.
+     *
+     * Optional. This is only applicable if consumer_network is a shared vpc
+     * network.
+     * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The consumerProject. + */ + public java.lang.String getConsumerProject() { + java.lang.Object ref = consumerProject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerProject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. This is the project ID of consumer service project of this
+     * consumer endpoint.
+     *
+     * Optional. This is only applicable if consumer_network is a shared vpc
+     * network.
+     * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for consumerProject. + */ + public com.google.protobuf.ByteString getConsumerProjectBytes() { + java.lang.Object ref = consumerProject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. This is the project ID of consumer service project of this
+     * consumer endpoint.
+     *
+     * Optional. This is only applicable if consumer_network is a shared vpc
+     * network.
+     * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The consumerProject to set. + * @return This builder for chaining. + */ + public Builder setConsumerProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + consumerProject_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is the project ID of consumer service project of this
+     * consumer endpoint.
+     *
+     * Optional. This is only applicable if consumer_network is a shared vpc
+     * network.
+     * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearConsumerProject() { + consumerProject_ = getDefaultInstance().getConsumerProject(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is the project ID of consumer service project of this
+     * consumer endpoint.
+     *
+     * Optional. This is only applicable if consumer_network is a shared vpc
+     * network.
+     * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for consumerProject to set. + * @return This builder for chaining. + */ + public Builder setConsumerProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + consumerProject_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object consumerNetwork_ = ""; + + /** + * + * + *
+     * Optional. The consumer network of this consumer endpoint. This must be a
+     * resource path that includes both the host project and the network name.
+     *
+     * For example, `projects/project1/global/networks/network1`.
+     *
+     * The consumer host project of this network might be different from the
+     * consumer service project.
+     * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The consumerNetwork. + */ + public java.lang.String getConsumerNetwork() { + java.lang.Object ref = consumerNetwork_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerNetwork_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The consumer network of this consumer endpoint. This must be a
+     * resource path that includes both the host project and the network name.
+     *
+     * For example, `projects/project1/global/networks/network1`.
+     *
+     * The consumer host project of this network might be different from the
+     * consumer service project.
+     * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for consumerNetwork. + */ + public com.google.protobuf.ByteString getConsumerNetworkBytes() { + java.lang.Object ref = consumerNetwork_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The consumer network of this consumer endpoint. This must be a
+     * resource path that includes both the host project and the network name.
+     *
+     * For example, `projects/project1/global/networks/network1`.
+     *
+     * The consumer host project of this network might be different from the
+     * consumer service project.
+     * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The consumerNetwork to set. + * @return This builder for chaining. + */ + public Builder setConsumerNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + consumerNetwork_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The consumer network of this consumer endpoint. This must be a
+     * resource path that includes both the host project and the network name.
+     *
+     * For example, `projects/project1/global/networks/network1`.
+     *
+     * The consumer host project of this network might be different from the
+     * consumer service project.
+     * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearConsumerNetwork() { + consumerNetwork_ = getDefaultInstance().getConsumerNetwork(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The consumer network of this consumer endpoint. This must be a
+     * resource path that includes both the host project and the network name.
+     *
+     * For example, `projects/project1/global/networks/network1`.
+     *
+     * The consumer host project of this network might be different from the
+     * consumer service project.
+     * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for consumerNetwork to set. + * @return This builder for chaining. + */ + public Builder setConsumerNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + consumerNetwork_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + + /** + * + * + *
+     * The IP address of the consumer endpoint.
+     * 
+ * + * optional string ip_address = 3 [(.google.api.field_info) = { ... } + * + * @return Whether the ipAddress field is set. + */ + public boolean hasIpAddress() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The IP address of the consumer endpoint.
+     * 
+ * + * optional string ip_address = 3 [(.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; + } + } + + /** + * + * + *
+     * The IP address of the consumer endpoint.
+     * 
+ * + * optional string ip_address = 3 [(.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; + } + } + + /** + * + * + *
+     * The IP address of the consumer endpoint.
+     * 
+ * + * optional string ip_address = 3 [(.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; + } + + /** + * + * + *
+     * The IP address of the consumer endpoint.
+     * 
+ * + * optional string ip_address = 3 [(.google.api.field_info) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + ipAddress_ = getDefaultInstance().getIpAddress(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The IP address of the consumer endpoint.
+     * 
+ * + * optional string ip_address = 3 [(.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 status_ = ""; + + /** + * + * + *
+     * The connection status of the consumer endpoint.
+     * 
+ * + * optional string status = 4; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * The connection status of the consumer endpoint.
+     * 
+ * + * optional string status = 4; + * + * @return The status. + */ + public java.lang.String getStatus() { + java.lang.Object ref = status_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + status_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The connection status of the consumer endpoint.
+     * 
+ * + * optional string status = 4; + * + * @return The bytes for status. + */ + public com.google.protobuf.ByteString getStatusBytes() { + java.lang.Object ref = status_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + status_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The connection status of the consumer endpoint.
+     * 
+ * + * optional string status = 4; + * + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The connection status of the consumer endpoint.
+     * 
+ * + * optional string status = 4; + * + * @return This builder for chaining. + */ + public Builder clearStatus() { + status_ = getDefaultInstance().getStatus(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The connection status of the consumer endpoint.
+     * 
+ * + * optional string status = 4; + * + * @param value The bytes for status to set. + * @return This builder for chaining. + */ + public Builder setStatusBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + status_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object consumerNetworkStatus_ = ""; + + /** + * + * + *
+     * The connection policy status of the consumer network.
+     * 
+ * + * optional string consumer_network_status = 5; + * + * @return Whether the consumerNetworkStatus field is set. + */ + public boolean hasConsumerNetworkStatus() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The connection policy status of the consumer network.
+     * 
+ * + * optional string consumer_network_status = 5; + * + * @return The consumerNetworkStatus. + */ + public java.lang.String getConsumerNetworkStatus() { + java.lang.Object ref = consumerNetworkStatus_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerNetworkStatus_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The connection policy status of the consumer network.
+     * 
+ * + * optional string consumer_network_status = 5; + * + * @return The bytes for consumerNetworkStatus. + */ + public com.google.protobuf.ByteString getConsumerNetworkStatusBytes() { + java.lang.Object ref = consumerNetworkStatus_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerNetworkStatus_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The connection policy status of the consumer network.
+     * 
+ * + * optional string consumer_network_status = 5; + * + * @param value The consumerNetworkStatus to set. + * @return This builder for chaining. + */ + public Builder setConsumerNetworkStatus(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + consumerNetworkStatus_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The connection policy status of the consumer network.
+     * 
+ * + * optional string consumer_network_status = 5; + * + * @return This builder for chaining. + */ + public Builder clearConsumerNetworkStatus() { + consumerNetworkStatus_ = getDefaultInstance().getConsumerNetworkStatus(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * The connection policy status of the consumer network.
+     * 
+ * + * optional string consumer_network_status = 5; + * + * @param value The bytes for consumerNetworkStatus to set. + * @return This builder for chaining. + */ + public Builder setConsumerNetworkStatusBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + consumerNetworkStatus_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object serviceConnectionPolicy_ = ""; + + /** + * + * + *
+     * Output only. The service connection policy created automatically for the
+     * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+     * in the format of:
+     * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+     * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+     * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the serviceConnectionPolicy field is set. + */ + public boolean hasServiceConnectionPolicy() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Output only. The service connection policy created automatically for the
+     * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+     * in the format of:
+     * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+     * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+     * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceConnectionPolicy. + */ + public java.lang.String getServiceConnectionPolicy() { + java.lang.Object ref = serviceConnectionPolicy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceConnectionPolicy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The service connection policy created automatically for the
+     * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+     * in the format of:
+     * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+     * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+     * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceConnectionPolicy. + */ + public com.google.protobuf.ByteString getServiceConnectionPolicyBytes() { + java.lang.Object ref = serviceConnectionPolicy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConnectionPolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The service connection policy created automatically for the
+     * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+     * in the format of:
+     * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+     * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+     * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The serviceConnectionPolicy to set. + * @return This builder for chaining. + */ + public Builder setServiceConnectionPolicy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceConnectionPolicy_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The service connection policy created automatically for the
+     * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+     * in the format of:
+     * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+     * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+     * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearServiceConnectionPolicy() { + serviceConnectionPolicy_ = getDefaultInstance().getServiceConnectionPolicy(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The service connection policy created automatically for the
+     * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+     * in the format of:
+     * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+     * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+     * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for serviceConnectionPolicy to set. + * @return This builder for chaining. + */ + public Builder setServiceConnectionPolicyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceConnectionPolicy_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object serviceConnectionPolicyCreationResult_ = ""; + + /** + * + * + *
+     * Output only. The status of service connection policy creation.
+     * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the serviceConnectionPolicyCreationResult field is set. + */ + public boolean hasServiceConnectionPolicyCreationResult() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Output only. The status of service connection policy creation.
+     * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The serviceConnectionPolicyCreationResult. + */ + public java.lang.String getServiceConnectionPolicyCreationResult() { + java.lang.Object ref = serviceConnectionPolicyCreationResult_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceConnectionPolicyCreationResult_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The status of service connection policy creation.
+     * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for serviceConnectionPolicyCreationResult. + */ + public com.google.protobuf.ByteString getServiceConnectionPolicyCreationResultBytes() { + java.lang.Object ref = serviceConnectionPolicyCreationResult_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConnectionPolicyCreationResult_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The status of service connection policy creation.
+     * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The serviceConnectionPolicyCreationResult to set. + * @return This builder for chaining. + */ + public Builder setServiceConnectionPolicyCreationResult(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceConnectionPolicyCreationResult_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of service connection policy creation.
+     * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearServiceConnectionPolicyCreationResult() { + serviceConnectionPolicyCreationResult_ = + getDefaultInstance().getServiceConnectionPolicyCreationResult(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of service connection policy creation.
+     * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for serviceConnectionPolicyCreationResult to set. + * @return This builder for chaining. + */ + public Builder setServiceConnectionPolicyCreationResultBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceConnectionPolicyCreationResult_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private int instanceAutoDnsStatus_ = 0; + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceAutoDnsStatus field is set. + */ + @java.lang.Override + public boolean hasInstanceAutoDnsStatus() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for instanceAutoDnsStatus. + */ + @java.lang.Override + public int getInstanceAutoDnsStatusValue() { + return instanceAutoDnsStatus_; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for instanceAutoDnsStatus to set. + * @return This builder for chaining. + */ + public Builder setInstanceAutoDnsStatusValue(int value) { + instanceAutoDnsStatus_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceAutoDnsStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AutoDnsStatus getInstanceAutoDnsStatus() { + com.google.cloud.sql.v1beta4.AutoDnsStatus result = + com.google.cloud.sql.v1beta4.AutoDnsStatus.forNumber(instanceAutoDnsStatus_); + return result == null ? com.google.cloud.sql.v1beta4.AutoDnsStatus.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The instanceAutoDnsStatus to set. + * @return This builder for chaining. + */ + public Builder setInstanceAutoDnsStatus(com.google.cloud.sql.v1beta4.AutoDnsStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + instanceAutoDnsStatus_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearInstanceAutoDnsStatus() { + bitField0_ = (bitField0_ & ~0x00000080); + instanceAutoDnsStatus_ = 0; + onChanged(); + return this; + } + + private int writeEndpointAutoDnsStatus_ = 0; + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning for the write
+     * endpoint.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writeEndpointAutoDnsStatus field is set. + */ + @java.lang.Override + public boolean hasWriteEndpointAutoDnsStatus() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning for the write
+     * endpoint.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for writeEndpointAutoDnsStatus. + */ + @java.lang.Override + public int getWriteEndpointAutoDnsStatusValue() { + return writeEndpointAutoDnsStatus_; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning for the write
+     * endpoint.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for writeEndpointAutoDnsStatus to set. + * @return This builder for chaining. + */ + public Builder setWriteEndpointAutoDnsStatusValue(int value) { + writeEndpointAutoDnsStatus_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning for the write
+     * endpoint.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writeEndpointAutoDnsStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AutoDnsStatus getWriteEndpointAutoDnsStatus() { + com.google.cloud.sql.v1beta4.AutoDnsStatus result = + com.google.cloud.sql.v1beta4.AutoDnsStatus.forNumber(writeEndpointAutoDnsStatus_); + return result == null ? com.google.cloud.sql.v1beta4.AutoDnsStatus.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning for the write
+     * endpoint.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The writeEndpointAutoDnsStatus to set. + * @return This builder for chaining. + */ + public Builder setWriteEndpointAutoDnsStatus(com.google.cloud.sql.v1beta4.AutoDnsStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + writeEndpointAutoDnsStatus_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of automated DNS provisioning for the write
+     * endpoint.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearWriteEndpointAutoDnsStatus() { + bitField0_ = (bitField0_ & ~0x00000100); + writeEndpointAutoDnsStatus_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.PscAutoConnectionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.PscAutoConnectionConfig) + private static final com.google.cloud.sql.v1beta4.PscAutoConnectionConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.PscAutoConnectionConfig(); + } + + public static com.google.cloud.sql.v1beta4.PscAutoConnectionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PscAutoConnectionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PscAutoConnectionConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PscAutoConnectionConfigOrBuilder.java new file mode 100644 index 000000000000..08ad1066685f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PscAutoConnectionConfigOrBuilder.java @@ -0,0 +1,412 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface PscAutoConnectionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.PscAutoConnectionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. This is the project ID of consumer service project of this
+   * consumer endpoint.
+   *
+   * Optional. This is only applicable if consumer_network is a shared vpc
+   * network.
+   * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The consumerProject. + */ + java.lang.String getConsumerProject(); + + /** + * + * + *
+   * Optional. This is the project ID of consumer service project of this
+   * consumer endpoint.
+   *
+   * Optional. This is only applicable if consumer_network is a shared vpc
+   * network.
+   * 
+ * + * string consumer_project = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for consumerProject. + */ + com.google.protobuf.ByteString getConsumerProjectBytes(); + + /** + * + * + *
+   * Optional. The consumer network of this consumer endpoint. This must be a
+   * resource path that includes both the host project and the network name.
+   *
+   * For example, `projects/project1/global/networks/network1`.
+   *
+   * The consumer host project of this network might be different from the
+   * consumer service project.
+   * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The consumerNetwork. + */ + java.lang.String getConsumerNetwork(); + + /** + * + * + *
+   * Optional. The consumer network of this consumer endpoint. This must be a
+   * resource path that includes both the host project and the network name.
+   *
+   * For example, `projects/project1/global/networks/network1`.
+   *
+   * The consumer host project of this network might be different from the
+   * consumer service project.
+   * 
+ * + * string consumer_network = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for consumerNetwork. + */ + com.google.protobuf.ByteString getConsumerNetworkBytes(); + + /** + * + * + *
+   * The IP address of the consumer endpoint.
+   * 
+ * + * optional string ip_address = 3 [(.google.api.field_info) = { ... } + * + * @return Whether the ipAddress field is set. + */ + boolean hasIpAddress(); + + /** + * + * + *
+   * The IP address of the consumer endpoint.
+   * 
+ * + * optional string ip_address = 3 [(.google.api.field_info) = { ... } + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + + /** + * + * + *
+   * The IP address of the consumer endpoint.
+   * 
+ * + * optional string ip_address = 3 [(.google.api.field_info) = { ... } + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * The connection status of the consumer endpoint.
+   * 
+ * + * optional string status = 4; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+   * The connection status of the consumer endpoint.
+   * 
+ * + * optional string status = 4; + * + * @return The status. + */ + java.lang.String getStatus(); + + /** + * + * + *
+   * The connection status of the consumer endpoint.
+   * 
+ * + * optional string status = 4; + * + * @return The bytes for status. + */ + com.google.protobuf.ByteString getStatusBytes(); + + /** + * + * + *
+   * The connection policy status of the consumer network.
+   * 
+ * + * optional string consumer_network_status = 5; + * + * @return Whether the consumerNetworkStatus field is set. + */ + boolean hasConsumerNetworkStatus(); + + /** + * + * + *
+   * The connection policy status of the consumer network.
+   * 
+ * + * optional string consumer_network_status = 5; + * + * @return The consumerNetworkStatus. + */ + java.lang.String getConsumerNetworkStatus(); + + /** + * + * + *
+   * The connection policy status of the consumer network.
+   * 
+ * + * optional string consumer_network_status = 5; + * + * @return The bytes for consumerNetworkStatus. + */ + com.google.protobuf.ByteString getConsumerNetworkStatusBytes(); + + /** + * + * + *
+   * Output only. The service connection policy created automatically for the
+   * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+   * in the format of:
+   * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+   * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+   * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the serviceConnectionPolicy field is set. + */ + boolean hasServiceConnectionPolicy(); + + /** + * + * + *
+   * Output only. The service connection policy created automatically for the
+   * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+   * in the format of:
+   * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+   * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+   * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceConnectionPolicy. + */ + java.lang.String getServiceConnectionPolicy(); + + /** + * + * + *
+   * Output only. The service connection policy created automatically for the
+   * consumer network when `psc_auto_connection_policy_enabled` is true. It is
+   * in the format of:
+   * `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
+   * The `policy_id` is in format of `$NETWORK-$RANDOM`.
+   * 
+ * + * + * optional string service_connection_policy = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceConnectionPolicy. + */ + com.google.protobuf.ByteString getServiceConnectionPolicyBytes(); + + /** + * + * + *
+   * Output only. The status of service connection policy creation.
+   * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the serviceConnectionPolicyCreationResult field is set. + */ + boolean hasServiceConnectionPolicyCreationResult(); + + /** + * + * + *
+   * Output only. The status of service connection policy creation.
+   * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The serviceConnectionPolicyCreationResult. + */ + java.lang.String getServiceConnectionPolicyCreationResult(); + + /** + * + * + *
+   * Output only. The status of service connection policy creation.
+   * 
+ * + * + * optional string service_connection_policy_creation_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for serviceConnectionPolicyCreationResult. + */ + com.google.protobuf.ByteString getServiceConnectionPolicyCreationResultBytes(); + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the instanceAutoDnsStatus field is set. + */ + boolean hasInstanceAutoDnsStatus(); + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for instanceAutoDnsStatus. + */ + int getInstanceAutoDnsStatusValue(); + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus instance_auto_dns_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The instanceAutoDnsStatus. + */ + com.google.cloud.sql.v1beta4.AutoDnsStatus getInstanceAutoDnsStatus(); + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning for the write
+   * endpoint.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the writeEndpointAutoDnsStatus field is set. + */ + boolean hasWriteEndpointAutoDnsStatus(); + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning for the write
+   * endpoint.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for writeEndpointAutoDnsStatus. + */ + int getWriteEndpointAutoDnsStatusValue(); + + /** + * + * + *
+   * Output only. The status of automated DNS provisioning for the write
+   * endpoint.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.AutoDnsStatus write_endpoint_auto_dns_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The writeEndpointAutoDnsStatus. + */ + com.google.cloud.sql.v1beta4.AutoDnsStatus getWriteEndpointAutoDnsStatus(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PscConfig.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PscConfig.java new file mode 100644 index 000000000000..d4912dfb4c8d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PscConfig.java @@ -0,0 +1,2240 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * PSC settings for a Cloud SQL instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PscConfig} + */ +@com.google.protobuf.Generated +public final class PscConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.PscConfig) + PscConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PscConfig"); + } + + // Use PscConfig.newBuilder() to construct. + private PscConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PscConfig() { + allowedConsumerProjects_ = com.google.protobuf.LazyStringArrayList.emptyList(); + pscAutoConnections_ = java.util.Collections.emptyList(); + networkAttachmentUri_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PscConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PscConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PscConfig.class, + com.google.cloud.sql.v1beta4.PscConfig.Builder.class); + } + + private int bitField0_; + public static final int PSC_ENABLED_FIELD_NUMBER = 1; + private boolean pscEnabled_ = false; + + /** + * + * + *
+   * Whether PSC connectivity is enabled for this instance.
+   * 
+ * + * optional bool psc_enabled = 1; + * + * @return Whether the pscEnabled field is set. + */ + @java.lang.Override + public boolean hasPscEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Whether PSC connectivity is enabled for this instance.
+   * 
+ * + * optional bool psc_enabled = 1; + * + * @return The pscEnabled. + */ + @java.lang.Override + public boolean getPscEnabled() { + return pscEnabled_; + } + + public static final int ALLOWED_CONSUMER_PROJECTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList allowedConsumerProjects_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the allowedConsumerProjects. + */ + public com.google.protobuf.ProtocolStringList getAllowedConsumerProjectsList() { + return allowedConsumerProjects_; + } + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of allowedConsumerProjects. + */ + public int getAllowedConsumerProjectsCount() { + return allowedConsumerProjects_.size(); + } + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The allowedConsumerProjects at the given index. + */ + public java.lang.String getAllowedConsumerProjects(int index) { + return allowedConsumerProjects_.get(index); + } + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the allowedConsumerProjects at the given index. + */ + public com.google.protobuf.ByteString getAllowedConsumerProjectsBytes(int index) { + return allowedConsumerProjects_.getByteString(index); + } + + public static final int PSC_AUTO_CONNECTIONS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List pscAutoConnections_; + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getPscAutoConnectionsList() { + return pscAutoConnections_; + } + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getPscAutoConnectionsOrBuilderList() { + return pscAutoConnections_; + } + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getPscAutoConnectionsCount() { + return pscAutoConnections_.size(); + } + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfig getPscAutoConnections(int index) { + return pscAutoConnections_.get(index); + } + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfigOrBuilder + getPscAutoConnectionsOrBuilder(int index) { + return pscAutoConnections_.get(index); + } + + public static final int NETWORK_ATTACHMENT_URI_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object networkAttachmentUri_ = ""; + + /** + * + * + *
+   * Optional. The network attachment of the consumer network that the
+   * Private Service Connect enabled Cloud SQL instance is
+   * authorized to connect via PSC interface.
+   * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+   * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The networkAttachmentUri. + */ + @java.lang.Override + public java.lang.String getNetworkAttachmentUri() { + java.lang.Object ref = networkAttachmentUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + networkAttachmentUri_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The network attachment of the consumer network that the
+   * Private Service Connect enabled Cloud SQL instance is
+   * authorized to connect via PSC interface.
+   * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+   * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for networkAttachmentUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkAttachmentUriBytes() { + java.lang.Object ref = networkAttachmentUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + networkAttachmentUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PSC_AUTO_DNS_ENABLED_FIELD_NUMBER = 5; + private boolean pscAutoDnsEnabled_ = false; + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect DNS automation is
+   * enabled for this instance. When enabled, Cloud SQL provisions a universal
+   * DNS record across all networks configured with Private Service Connect
+   * auto-connections. This will default to true for new instances when
+   * Private Service Connect is enabled.
+   * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the pscAutoDnsEnabled field is set. + */ + @java.lang.Override + public boolean hasPscAutoDnsEnabled() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect DNS automation is
+   * enabled for this instance. When enabled, Cloud SQL provisions a universal
+   * DNS record across all networks configured with Private Service Connect
+   * auto-connections. This will default to true for new instances when
+   * Private Service Connect is enabled.
+   * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pscAutoDnsEnabled. + */ + @java.lang.Override + public boolean getPscAutoDnsEnabled() { + return pscAutoDnsEnabled_; + } + + public static final int PSC_WRITE_ENDPOINT_DNS_ENABLED_FIELD_NUMBER = 6; + private boolean pscWriteEndpointDnsEnabled_ = false; + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect write endpoint DNS
+   * automation is enabled for this instance. When enabled, Cloud SQL provisions
+   * a universal global DNS record across all networks configured with Private
+   * Service Connect auto-connections that points to the cluster primary
+   * instance. This feature is only supported for Enterprise Plus edition. This
+   * will default to true for new enterprise plus instances when
+   * `psc_auto_dns_enabled` is enabled.
+   * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pscWriteEndpointDnsEnabled field is set. + */ + @java.lang.Override + public boolean hasPscWriteEndpointDnsEnabled() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect write endpoint DNS
+   * automation is enabled for this instance. When enabled, Cloud SQL provisions
+   * a universal global DNS record across all networks configured with Private
+   * Service Connect auto-connections that points to the cluster primary
+   * instance. This feature is only supported for Enterprise Plus edition. This
+   * will default to true for new enterprise plus instances when
+   * `psc_auto_dns_enabled` is enabled.
+   * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pscWriteEndpointDnsEnabled. + */ + @java.lang.Override + public boolean getPscWriteEndpointDnsEnabled() { + return pscWriteEndpointDnsEnabled_; + } + + public static final int PSC_AUTO_CONNECTION_POLICY_ENABLED_FIELD_NUMBER = 7; + private boolean pscAutoConnectionPolicyEnabled_ = false; + + /** + * + * + *
+   * Optional. Whether to set up the PSC service connection policy
+   * automatically.
+   * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pscAutoConnectionPolicyEnabled field is set. + */ + @java.lang.Override + public boolean hasPscAutoConnectionPolicyEnabled() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. Whether to set up the PSC service connection policy
+   * automatically.
+   * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pscAutoConnectionPolicyEnabled. + */ + @java.lang.Override + public boolean getPscAutoConnectionPolicyEnabled() { + return pscAutoConnectionPolicyEnabled_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, pscEnabled_); + } + for (int i = 0; i < allowedConsumerProjects_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 2, allowedConsumerProjects_.getRaw(i)); + } + for (int i = 0; i < pscAutoConnections_.size(); i++) { + output.writeMessage(3, pscAutoConnections_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(networkAttachmentUri_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, networkAttachmentUri_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(5, pscAutoDnsEnabled_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeBool(6, pscWriteEndpointDnsEnabled_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeBool(7, pscAutoConnectionPolicyEnabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, pscEnabled_); + } + { + int dataSize = 0; + for (int i = 0; i < allowedConsumerProjects_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedConsumerProjects_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedConsumerProjectsList().size(); + } + for (int i = 0; i < pscAutoConnections_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, pscAutoConnections_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(networkAttachmentUri_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, networkAttachmentUri_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, pscAutoDnsEnabled_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, pscWriteEndpointDnsEnabled_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(7, pscAutoConnectionPolicyEnabled_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.PscConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.PscConfig other = (com.google.cloud.sql.v1beta4.PscConfig) obj; + + if (hasPscEnabled() != other.hasPscEnabled()) return false; + if (hasPscEnabled()) { + if (getPscEnabled() != other.getPscEnabled()) return false; + } + if (!getAllowedConsumerProjectsList().equals(other.getAllowedConsumerProjectsList())) + return false; + if (!getPscAutoConnectionsList().equals(other.getPscAutoConnectionsList())) return false; + if (!getNetworkAttachmentUri().equals(other.getNetworkAttachmentUri())) return false; + if (hasPscAutoDnsEnabled() != other.hasPscAutoDnsEnabled()) return false; + if (hasPscAutoDnsEnabled()) { + if (getPscAutoDnsEnabled() != other.getPscAutoDnsEnabled()) return false; + } + if (hasPscWriteEndpointDnsEnabled() != other.hasPscWriteEndpointDnsEnabled()) return false; + if (hasPscWriteEndpointDnsEnabled()) { + if (getPscWriteEndpointDnsEnabled() != other.getPscWriteEndpointDnsEnabled()) return false; + } + if (hasPscAutoConnectionPolicyEnabled() != other.hasPscAutoConnectionPolicyEnabled()) + return false; + if (hasPscAutoConnectionPolicyEnabled()) { + if (getPscAutoConnectionPolicyEnabled() != other.getPscAutoConnectionPolicyEnabled()) + return false; + } + if (!getUnknownFields().equals(other.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 (hasPscEnabled()) { + hash = (37 * hash) + PSC_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPscEnabled()); + } + if (getAllowedConsumerProjectsCount() > 0) { + hash = (37 * hash) + ALLOWED_CONSUMER_PROJECTS_FIELD_NUMBER; + hash = (53 * hash) + getAllowedConsumerProjectsList().hashCode(); + } + if (getPscAutoConnectionsCount() > 0) { + hash = (37 * hash) + PSC_AUTO_CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPscAutoConnectionsList().hashCode(); + } + hash = (37 * hash) + NETWORK_ATTACHMENT_URI_FIELD_NUMBER; + hash = (53 * hash) + getNetworkAttachmentUri().hashCode(); + if (hasPscAutoDnsEnabled()) { + hash = (37 * hash) + PSC_AUTO_DNS_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPscAutoDnsEnabled()); + } + if (hasPscWriteEndpointDnsEnabled()) { + hash = (37 * hash) + PSC_WRITE_ENDPOINT_DNS_ENABLED_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPscWriteEndpointDnsEnabled()); + } + if (hasPscAutoConnectionPolicyEnabled()) { + hash = (37 * hash) + PSC_AUTO_CONNECTION_POLICY_ENABLED_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getPscAutoConnectionPolicyEnabled()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.PscConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PscConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PscConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PscConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PscConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.PscConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PscConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PscConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PscConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PscConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.PscConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.PscConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.PscConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * PSC settings for a Cloud SQL instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.PscConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.PscConfig) + com.google.cloud.sql.v1beta4.PscConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PscConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PscConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.PscConfig.class, + com.google.cloud.sql.v1beta4.PscConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.PscConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pscEnabled_ = false; + allowedConsumerProjects_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnections_ = java.util.Collections.emptyList(); + } else { + pscAutoConnections_ = null; + pscAutoConnectionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + networkAttachmentUri_ = ""; + pscAutoDnsEnabled_ = false; + pscWriteEndpointDnsEnabled_ = false; + pscAutoConnectionPolicyEnabled_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_PscConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PscConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.PscConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PscConfig build() { + com.google.cloud.sql.v1beta4.PscConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PscConfig buildPartial() { + com.google.cloud.sql.v1beta4.PscConfig result = + new com.google.cloud.sql.v1beta4.PscConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1beta4.PscConfig result) { + if (pscAutoConnectionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + pscAutoConnections_ = java.util.Collections.unmodifiableList(pscAutoConnections_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.pscAutoConnections_ = pscAutoConnections_; + } else { + result.pscAutoConnections_ = pscAutoConnectionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.PscConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pscEnabled_ = pscEnabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + allowedConsumerProjects_.makeImmutable(); + result.allowedConsumerProjects_ = allowedConsumerProjects_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.networkAttachmentUri_ = networkAttachmentUri_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pscAutoDnsEnabled_ = pscAutoDnsEnabled_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.pscWriteEndpointDnsEnabled_ = pscWriteEndpointDnsEnabled_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pscAutoConnectionPolicyEnabled_ = pscAutoConnectionPolicyEnabled_; + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.PscConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.PscConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.PscConfig other) { + if (other == com.google.cloud.sql.v1beta4.PscConfig.getDefaultInstance()) return this; + if (other.hasPscEnabled()) { + setPscEnabled(other.getPscEnabled()); + } + if (!other.allowedConsumerProjects_.isEmpty()) { + if (allowedConsumerProjects_.isEmpty()) { + allowedConsumerProjects_ = other.allowedConsumerProjects_; + bitField0_ |= 0x00000002; + } else { + ensureAllowedConsumerProjectsIsMutable(); + allowedConsumerProjects_.addAll(other.allowedConsumerProjects_); + } + onChanged(); + } + if (pscAutoConnectionsBuilder_ == null) { + if (!other.pscAutoConnections_.isEmpty()) { + if (pscAutoConnections_.isEmpty()) { + pscAutoConnections_ = other.pscAutoConnections_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.addAll(other.pscAutoConnections_); + } + onChanged(); + } + } else { + if (!other.pscAutoConnections_.isEmpty()) { + if (pscAutoConnectionsBuilder_.isEmpty()) { + pscAutoConnectionsBuilder_.dispose(); + pscAutoConnectionsBuilder_ = null; + pscAutoConnections_ = other.pscAutoConnections_; + bitField0_ = (bitField0_ & ~0x00000004); + pscAutoConnectionsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPscAutoConnectionsFieldBuilder() + : null; + } else { + pscAutoConnectionsBuilder_.addAllMessages(other.pscAutoConnections_); + } + } + } + if (!other.getNetworkAttachmentUri().isEmpty()) { + networkAttachmentUri_ = other.networkAttachmentUri_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasPscAutoDnsEnabled()) { + setPscAutoDnsEnabled(other.getPscAutoDnsEnabled()); + } + if (other.hasPscWriteEndpointDnsEnabled()) { + setPscWriteEndpointDnsEnabled(other.getPscWriteEndpointDnsEnabled()); + } + if (other.hasPscAutoConnectionPolicyEnabled()) { + setPscAutoConnectionPolicyEnabled(other.getPscAutoConnectionPolicyEnabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + pscEnabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAllowedConsumerProjectsIsMutable(); + allowedConsumerProjects_.add(s); + break; + } // case 18 + case 26: + { + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig m = + input.readMessage( + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.parser(), + extensionRegistry); + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(m); + } else { + pscAutoConnectionsBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + networkAttachmentUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + pscAutoDnsEnabled_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + pscWriteEndpointDnsEnabled_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: + { + pscAutoConnectionPolicyEnabled_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 56 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean pscEnabled_; + + /** + * + * + *
+     * Whether PSC connectivity is enabled for this instance.
+     * 
+ * + * optional bool psc_enabled = 1; + * + * @return Whether the pscEnabled field is set. + */ + @java.lang.Override + public boolean hasPscEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Whether PSC connectivity is enabled for this instance.
+     * 
+ * + * optional bool psc_enabled = 1; + * + * @return The pscEnabled. + */ + @java.lang.Override + public boolean getPscEnabled() { + return pscEnabled_; + } + + /** + * + * + *
+     * Whether PSC connectivity is enabled for this instance.
+     * 
+ * + * optional bool psc_enabled = 1; + * + * @param value The pscEnabled to set. + * @return This builder for chaining. + */ + public Builder setPscEnabled(boolean value) { + + pscEnabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether PSC connectivity is enabled for this instance.
+     * 
+ * + * optional bool psc_enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearPscEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + pscEnabled_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList allowedConsumerProjects_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAllowedConsumerProjectsIsMutable() { + if (!allowedConsumerProjects_.isModifiable()) { + allowedConsumerProjects_ = + new com.google.protobuf.LazyStringArrayList(allowedConsumerProjects_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the allowedConsumerProjects. + */ + public com.google.protobuf.ProtocolStringList getAllowedConsumerProjectsList() { + allowedConsumerProjects_.makeImmutable(); + return allowedConsumerProjects_; + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of allowedConsumerProjects. + */ + public int getAllowedConsumerProjectsCount() { + return allowedConsumerProjects_.size(); + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The allowedConsumerProjects at the given index. + */ + public java.lang.String getAllowedConsumerProjects(int index) { + return allowedConsumerProjects_.get(index); + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the allowedConsumerProjects at the given index. + */ + public com.google.protobuf.ByteString getAllowedConsumerProjectsBytes(int index) { + return allowedConsumerProjects_.getByteString(index); + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The allowedConsumerProjects to set. + * @return This builder for chaining. + */ + public Builder setAllowedConsumerProjects(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedConsumerProjectsIsMutable(); + allowedConsumerProjects_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The allowedConsumerProjects to add. + * @return This builder for chaining. + */ + public Builder addAllowedConsumerProjects(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedConsumerProjectsIsMutable(); + allowedConsumerProjects_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The allowedConsumerProjects to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedConsumerProjects(java.lang.Iterable values) { + ensureAllowedConsumerProjectsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedConsumerProjects_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearAllowedConsumerProjects() { + allowedConsumerProjects_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of consumer projects that are allow-listed for PSC
+     * connections to this instance. This instance can be connected to with PSC
+     * from any network in these projects.
+     *
+     * Each consumer project in this list may be represented by a project number
+     * (numeric) or by a project id (alphanumeric).
+     * 
+ * + * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes of the allowedConsumerProjects to add. + * @return This builder for chaining. + */ + public Builder addAllowedConsumerProjectsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedConsumerProjectsIsMutable(); + allowedConsumerProjects_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List + pscAutoConnections_ = java.util.Collections.emptyList(); + + private void ensurePscAutoConnectionsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + pscAutoConnections_ = + new java.util.ArrayList( + pscAutoConnections_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig, + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder, + com.google.cloud.sql.v1beta4.PscAutoConnectionConfigOrBuilder> + pscAutoConnectionsBuilder_; + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getPscAutoConnectionsList() { + if (pscAutoConnectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pscAutoConnections_); + } else { + return pscAutoConnectionsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getPscAutoConnectionsCount() { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.size(); + } else { + return pscAutoConnectionsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfig getPscAutoConnections(int index) { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.get(index); + } else { + return pscAutoConnectionsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPscAutoConnections( + int index, com.google.cloud.sql.v1beta4.PscAutoConnectionConfig value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.set(index, value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPscAutoConnections( + int index, com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.set(index, builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addPscAutoConnections( + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addPscAutoConnections( + int index, com.google.cloud.sql.v1beta4.PscAutoConnectionConfig value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(index, value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addPscAutoConnections( + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addPscAutoConnections( + int index, com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(index, builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPscAutoConnections() { + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + pscAutoConnectionsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removePscAutoConnections(int index) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.remove(index); + onChanged(); + } else { + pscAutoConnectionsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder + getPscAutoConnectionsBuilder(int index) { + return internalGetPscAutoConnectionsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfigOrBuilder + getPscAutoConnectionsOrBuilder(int index) { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.get(index); + } else { + return pscAutoConnectionsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getPscAutoConnectionsOrBuilderList() { + if (pscAutoConnectionsBuilder_ != null) { + return pscAutoConnectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pscAutoConnections_); + } + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder + addPscAutoConnectionsBuilder() { + return internalGetPscAutoConnectionsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder + addPscAutoConnectionsBuilder(int index) { + return internalGetPscAutoConnectionsFieldBuilder() + .addBuilder( + index, com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. The list of settings for requested Private Service Connect
+     * consumer endpoints that can be used to connect to this Cloud SQL instance.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getPscAutoConnectionsBuilderList() { + return internalGetPscAutoConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig, + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder, + com.google.cloud.sql.v1beta4.PscAutoConnectionConfigOrBuilder> + internalGetPscAutoConnectionsFieldBuilder() { + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig, + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig.Builder, + com.google.cloud.sql.v1beta4.PscAutoConnectionConfigOrBuilder>( + pscAutoConnections_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + pscAutoConnections_ = null; + } + return pscAutoConnectionsBuilder_; + } + + private java.lang.Object networkAttachmentUri_ = ""; + + /** + * + * + *
+     * Optional. The network attachment of the consumer network that the
+     * Private Service Connect enabled Cloud SQL instance is
+     * authorized to connect via PSC interface.
+     * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+     * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The networkAttachmentUri. + */ + public java.lang.String getNetworkAttachmentUri() { + java.lang.Object ref = networkAttachmentUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + networkAttachmentUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The network attachment of the consumer network that the
+     * Private Service Connect enabled Cloud SQL instance is
+     * authorized to connect via PSC interface.
+     * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+     * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for networkAttachmentUri. + */ + public com.google.protobuf.ByteString getNetworkAttachmentUriBytes() { + java.lang.Object ref = networkAttachmentUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + networkAttachmentUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The network attachment of the consumer network that the
+     * Private Service Connect enabled Cloud SQL instance is
+     * authorized to connect via PSC interface.
+     * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+     * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The networkAttachmentUri to set. + * @return This builder for chaining. + */ + public Builder setNetworkAttachmentUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + networkAttachmentUri_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The network attachment of the consumer network that the
+     * Private Service Connect enabled Cloud SQL instance is
+     * authorized to connect via PSC interface.
+     * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+     * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNetworkAttachmentUri() { + networkAttachmentUri_ = getDefaultInstance().getNetworkAttachmentUri(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The network attachment of the consumer network that the
+     * Private Service Connect enabled Cloud SQL instance is
+     * authorized to connect via PSC interface.
+     * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+     * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for networkAttachmentUri to set. + * @return This builder for chaining. + */ + public Builder setNetworkAttachmentUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + networkAttachmentUri_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean pscAutoDnsEnabled_; + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect DNS automation is
+     * enabled for this instance. When enabled, Cloud SQL provisions a universal
+     * DNS record across all networks configured with Private Service Connect
+     * auto-connections. This will default to true for new instances when
+     * Private Service Connect is enabled.
+     * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pscAutoDnsEnabled field is set. + */ + @java.lang.Override + public boolean hasPscAutoDnsEnabled() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect DNS automation is
+     * enabled for this instance. When enabled, Cloud SQL provisions a universal
+     * DNS record across all networks configured with Private Service Connect
+     * auto-connections. This will default to true for new instances when
+     * Private Service Connect is enabled.
+     * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pscAutoDnsEnabled. + */ + @java.lang.Override + public boolean getPscAutoDnsEnabled() { + return pscAutoDnsEnabled_; + } + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect DNS automation is
+     * enabled for this instance. When enabled, Cloud SQL provisions a universal
+     * DNS record across all networks configured with Private Service Connect
+     * auto-connections. This will default to true for new instances when
+     * Private Service Connect is enabled.
+     * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The pscAutoDnsEnabled to set. + * @return This builder for chaining. + */ + public Builder setPscAutoDnsEnabled(boolean value) { + + pscAutoDnsEnabled_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect DNS automation is
+     * enabled for this instance. When enabled, Cloud SQL provisions a universal
+     * DNS record across all networks configured with Private Service Connect
+     * auto-connections. This will default to true for new instances when
+     * Private Service Connect is enabled.
+     * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPscAutoDnsEnabled() { + bitField0_ = (bitField0_ & ~0x00000010); + pscAutoDnsEnabled_ = false; + onChanged(); + return this; + } + + private boolean pscWriteEndpointDnsEnabled_; + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect write endpoint DNS
+     * automation is enabled for this instance. When enabled, Cloud SQL provisions
+     * a universal global DNS record across all networks configured with Private
+     * Service Connect auto-connections that points to the cluster primary
+     * instance. This feature is only supported for Enterprise Plus edition. This
+     * will default to true for new enterprise plus instances when
+     * `psc_auto_dns_enabled` is enabled.
+     * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pscWriteEndpointDnsEnabled field is set. + */ + @java.lang.Override + public boolean hasPscWriteEndpointDnsEnabled() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect write endpoint DNS
+     * automation is enabled for this instance. When enabled, Cloud SQL provisions
+     * a universal global DNS record across all networks configured with Private
+     * Service Connect auto-connections that points to the cluster primary
+     * instance. This feature is only supported for Enterprise Plus edition. This
+     * will default to true for new enterprise plus instances when
+     * `psc_auto_dns_enabled` is enabled.
+     * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pscWriteEndpointDnsEnabled. + */ + @java.lang.Override + public boolean getPscWriteEndpointDnsEnabled() { + return pscWriteEndpointDnsEnabled_; + } + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect write endpoint DNS
+     * automation is enabled for this instance. When enabled, Cloud SQL provisions
+     * a universal global DNS record across all networks configured with Private
+     * Service Connect auto-connections that points to the cluster primary
+     * instance. This feature is only supported for Enterprise Plus edition. This
+     * will default to true for new enterprise plus instances when
+     * `psc_auto_dns_enabled` is enabled.
+     * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The pscWriteEndpointDnsEnabled to set. + * @return This builder for chaining. + */ + public Builder setPscWriteEndpointDnsEnabled(boolean value) { + + pscWriteEndpointDnsEnabled_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Indicates whether Private Service Connect write endpoint DNS
+     * automation is enabled for this instance. When enabled, Cloud SQL provisions
+     * a universal global DNS record across all networks configured with Private
+     * Service Connect auto-connections that points to the cluster primary
+     * instance. This feature is only supported for Enterprise Plus edition. This
+     * will default to true for new enterprise plus instances when
+     * `psc_auto_dns_enabled` is enabled.
+     * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPscWriteEndpointDnsEnabled() { + bitField0_ = (bitField0_ & ~0x00000020); + pscWriteEndpointDnsEnabled_ = false; + onChanged(); + return this; + } + + private boolean pscAutoConnectionPolicyEnabled_; + + /** + * + * + *
+     * Optional. Whether to set up the PSC service connection policy
+     * automatically.
+     * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pscAutoConnectionPolicyEnabled field is set. + */ + @java.lang.Override + public boolean hasPscAutoConnectionPolicyEnabled() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Optional. Whether to set up the PSC service connection policy
+     * automatically.
+     * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pscAutoConnectionPolicyEnabled. + */ + @java.lang.Override + public boolean getPscAutoConnectionPolicyEnabled() { + return pscAutoConnectionPolicyEnabled_; + } + + /** + * + * + *
+     * Optional. Whether to set up the PSC service connection policy
+     * automatically.
+     * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The pscAutoConnectionPolicyEnabled to set. + * @return This builder for chaining. + */ + public Builder setPscAutoConnectionPolicyEnabled(boolean value) { + + pscAutoConnectionPolicyEnabled_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Whether to set up the PSC service connection policy
+     * automatically.
+     * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPscAutoConnectionPolicyEnabled() { + bitField0_ = (bitField0_ & ~0x00000040); + pscAutoConnectionPolicyEnabled_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.PscConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.PscConfig) + private static final com.google.cloud.sql.v1beta4.PscConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.PscConfig(); + } + + public static com.google.cloud.sql.v1beta4.PscConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PscConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.PscConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PscConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PscConfigOrBuilder.java new file mode 100644 index 000000000000..800336bdeb0a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/PscConfigOrBuilder.java @@ -0,0 +1,344 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface PscConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.PscConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether PSC connectivity is enabled for this instance.
+   * 
+ * + * optional bool psc_enabled = 1; + * + * @return Whether the pscEnabled field is set. + */ + boolean hasPscEnabled(); + + /** + * + * + *
+   * Whether PSC connectivity is enabled for this instance.
+   * 
+ * + * optional bool psc_enabled = 1; + * + * @return The pscEnabled. + */ + boolean getPscEnabled(); + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the allowedConsumerProjects. + */ + java.util.List getAllowedConsumerProjectsList(); + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of allowedConsumerProjects. + */ + int getAllowedConsumerProjectsCount(); + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The allowedConsumerProjects at the given index. + */ + java.lang.String getAllowedConsumerProjects(int index); + + /** + * + * + *
+   * Optional. The list of consumer projects that are allow-listed for PSC
+   * connections to this instance. This instance can be connected to with PSC
+   * from any network in these projects.
+   *
+   * Each consumer project in this list may be represented by a project number
+   * (numeric) or by a project id (alphanumeric).
+   * 
+ * + * repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the allowedConsumerProjects at the given index. + */ + com.google.protobuf.ByteString getAllowedConsumerProjectsBytes(int index); + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getPscAutoConnectionsList(); + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.PscAutoConnectionConfig getPscAutoConnections(int index); + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getPscAutoConnectionsCount(); + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getPscAutoConnectionsOrBuilderList(); + + /** + * + * + *
+   * Optional. The list of settings for requested Private Service Connect
+   * consumer endpoints that can be used to connect to this Cloud SQL instance.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.PscAutoConnectionConfig psc_auto_connections = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.PscAutoConnectionConfigOrBuilder getPscAutoConnectionsOrBuilder( + int index); + + /** + * + * + *
+   * Optional. The network attachment of the consumer network that the
+   * Private Service Connect enabled Cloud SQL instance is
+   * authorized to connect via PSC interface.
+   * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+   * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The networkAttachmentUri. + */ + java.lang.String getNetworkAttachmentUri(); + + /** + * + * + *
+   * Optional. The network attachment of the consumer network that the
+   * Private Service Connect enabled Cloud SQL instance is
+   * authorized to connect via PSC interface.
+   * format: projects/PROJECT/regions/REGION/networkAttachments/ID
+   * 
+ * + * string network_attachment_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for networkAttachmentUri. + */ + com.google.protobuf.ByteString getNetworkAttachmentUriBytes(); + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect DNS automation is
+   * enabled for this instance. When enabled, Cloud SQL provisions a universal
+   * DNS record across all networks configured with Private Service Connect
+   * auto-connections. This will default to true for new instances when
+   * Private Service Connect is enabled.
+   * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the pscAutoDnsEnabled field is set. + */ + boolean hasPscAutoDnsEnabled(); + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect DNS automation is
+   * enabled for this instance. When enabled, Cloud SQL provisions a universal
+   * DNS record across all networks configured with Private Service Connect
+   * auto-connections. This will default to true for new instances when
+   * Private Service Connect is enabled.
+   * 
+ * + * optional bool psc_auto_dns_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pscAutoDnsEnabled. + */ + boolean getPscAutoDnsEnabled(); + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect write endpoint DNS
+   * automation is enabled for this instance. When enabled, Cloud SQL provisions
+   * a universal global DNS record across all networks configured with Private
+   * Service Connect auto-connections that points to the cluster primary
+   * instance. This feature is only supported for Enterprise Plus edition. This
+   * will default to true for new enterprise plus instances when
+   * `psc_auto_dns_enabled` is enabled.
+   * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pscWriteEndpointDnsEnabled field is set. + */ + boolean hasPscWriteEndpointDnsEnabled(); + + /** + * + * + *
+   * Optional. Indicates whether Private Service Connect write endpoint DNS
+   * automation is enabled for this instance. When enabled, Cloud SQL provisions
+   * a universal global DNS record across all networks configured with Private
+   * Service Connect auto-connections that points to the cluster primary
+   * instance. This feature is only supported for Enterprise Plus edition. This
+   * will default to true for new enterprise plus instances when
+   * `psc_auto_dns_enabled` is enabled.
+   * 
+ * + * + * optional bool psc_write_endpoint_dns_enabled = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pscWriteEndpointDnsEnabled. + */ + boolean getPscWriteEndpointDnsEnabled(); + + /** + * + * + *
+   * Optional. Whether to set up the PSC service connection policy
+   * automatically.
+   * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pscAutoConnectionPolicyEnabled field is set. + */ + boolean hasPscAutoConnectionPolicyEnabled(); + + /** + * + * + *
+   * Optional. Whether to set up the PSC service connection policy
+   * automatically.
+   * 
+ * + * + * optional bool psc_auto_connection_policy_enabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pscAutoConnectionPolicyEnabled. + */ + boolean getPscAutoConnectionPolicyEnabled(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/QueryResult.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/QueryResult.java new file mode 100644 index 000000000000..2b0c2d5ac706 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/QueryResult.java @@ -0,0 +1,2017 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * QueryResult contains the result of executing a single SQL statement.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.QueryResult} + */ +@com.google.protobuf.Generated +public final class QueryResult extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.QueryResult) + QueryResultOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "QueryResult"); + } + + // Use QueryResult.newBuilder() to construct. + private QueryResult(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private QueryResult() { + columns_ = java.util.Collections.emptyList(); + rows_ = java.util.Collections.emptyList(); + message_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_QueryResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_QueryResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.QueryResult.class, + com.google.cloud.sql.v1beta4.QueryResult.Builder.class); + } + + private int bitField0_; + public static final int COLUMNS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List columns_; + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + @java.lang.Override + public java.util.List getColumnsList() { + return columns_; + } + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + @java.lang.Override + public java.util.List + getColumnsOrBuilderList() { + return columns_; + } + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + @java.lang.Override + public int getColumnsCount() { + return columns_.size(); + } + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Column getColumns(int index) { + return columns_.get(index); + } + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ColumnOrBuilder getColumnsOrBuilder(int index) { + return columns_.get(index); + } + + public static final int ROWS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List rows_; + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + @java.lang.Override + public java.util.List getRowsList() { + return rows_; + } + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + @java.lang.Override + public java.util.List + getRowsOrBuilderList() { + return rows_; + } + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + @java.lang.Override + public int getRowsCount() { + return rows_.size(); + } + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Row getRows(int index) { + return rows_.get(index); + } + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.RowOrBuilder getRowsOrBuilder(int index) { + return rows_.get(index); + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
+   * Message related to the SQL execution result.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + + /** + * + * + *
+   * Message related to the SQL execution result.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARTIAL_RESULT_FIELD_NUMBER = 4; + private boolean partialResult_ = false; + + /** + * + * + *
+   * Set to true if the SQL execution's result is truncated due to size limits
+   * or an error retrieving results.
+   * 
+ * + * bool partial_result = 4; + * + * @return The partialResult. + */ + @java.lang.Override + public boolean getPartialResult() { + return partialResult_; + } + + public static final int STATUS_FIELD_NUMBER = 8; + private com.google.rpc.Status status_; + + /** + * + * + *
+   * If results were truncated due to an error, details of that error.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * If results were truncated due to an error, details of that error.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
+   * If results were truncated due to an error, details of that error.
+   * 
+ * + * .google.rpc.Status status = 8; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 < columns_.size(); i++) { + output.writeMessage(1, columns_.get(i)); + } + for (int i = 0; i < rows_.size(); i++) { + output.writeMessage(2, rows_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, message_); + } + if (partialResult_ != false) { + output.writeBool(4, partialResult_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(8, getStatus()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < columns_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, columns_.get(i)); + } + for (int i = 0; i < rows_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, rows_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, message_); + } + if (partialResult_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, partialResult_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getStatus()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.QueryResult)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.QueryResult other = (com.google.cloud.sql.v1beta4.QueryResult) obj; + + if (!getColumnsList().equals(other.getColumnsList())) return false; + if (!getRowsList().equals(other.getRowsList())) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (getPartialResult() != other.getPartialResult()) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (!getUnknownFields().equals(other.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 (getColumnsCount() > 0) { + hash = (37 * hash) + COLUMNS_FIELD_NUMBER; + hash = (53 * hash) + getColumnsList().hashCode(); + } + if (getRowsCount() > 0) { + hash = (37 * hash) + ROWS_FIELD_NUMBER; + hash = (53 * hash) + getRowsList().hashCode(); + } + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + PARTIAL_RESULT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPartialResult()); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.QueryResult parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.QueryResult parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.QueryResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.QueryResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.QueryResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.QueryResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.QueryResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.QueryResult parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.QueryResult parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.QueryResult parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.QueryResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.QueryResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.QueryResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * QueryResult contains the result of executing a single SQL statement.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.QueryResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.QueryResult) + com.google.cloud.sql.v1beta4.QueryResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_QueryResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_QueryResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.QueryResult.class, + com.google.cloud.sql.v1beta4.QueryResult.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.QueryResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetColumnsFieldBuilder(); + internalGetRowsFieldBuilder(); + internalGetStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (columnsBuilder_ == null) { + columns_ = java.util.Collections.emptyList(); + } else { + columns_ = null; + columnsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (rowsBuilder_ == null) { + rows_ = java.util.Collections.emptyList(); + } else { + rows_ = null; + rowsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + message_ = ""; + partialResult_ = false; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_QueryResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.QueryResult getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.QueryResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.QueryResult build() { + com.google.cloud.sql.v1beta4.QueryResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.QueryResult buildPartial() { + com.google.cloud.sql.v1beta4.QueryResult result = + new com.google.cloud.sql.v1beta4.QueryResult(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1beta4.QueryResult result) { + if (columnsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + columns_ = java.util.Collections.unmodifiableList(columns_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.columns_ = columns_; + } else { + result.columns_ = columnsBuilder_.build(); + } + if (rowsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + rows_ = java.util.Collections.unmodifiableList(rows_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.rows_ = rows_; + } else { + result.rows_ = rowsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.QueryResult result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.message_ = message_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.partialResult_ = partialResult_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.QueryResult) { + return mergeFrom((com.google.cloud.sql.v1beta4.QueryResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.QueryResult other) { + if (other == com.google.cloud.sql.v1beta4.QueryResult.getDefaultInstance()) return this; + if (columnsBuilder_ == null) { + if (!other.columns_.isEmpty()) { + if (columns_.isEmpty()) { + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureColumnsIsMutable(); + columns_.addAll(other.columns_); + } + onChanged(); + } + } else { + if (!other.columns_.isEmpty()) { + if (columnsBuilder_.isEmpty()) { + columnsBuilder_.dispose(); + columnsBuilder_ = null; + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000001); + columnsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetColumnsFieldBuilder() + : null; + } else { + columnsBuilder_.addAllMessages(other.columns_); + } + } + } + if (rowsBuilder_ == null) { + if (!other.rows_.isEmpty()) { + if (rows_.isEmpty()) { + rows_ = other.rows_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRowsIsMutable(); + rows_.addAll(other.rows_); + } + onChanged(); + } + } else { + if (!other.rows_.isEmpty()) { + if (rowsBuilder_.isEmpty()) { + rowsBuilder_.dispose(); + rowsBuilder_ = null; + rows_ = other.rows_; + bitField0_ = (bitField0_ & ~0x00000002); + rowsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRowsFieldBuilder() + : null; + } else { + rowsBuilder_.addAllMessages(other.rows_); + } + } + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getPartialResult() != false) { + setPartialResult(other.getPartialResult()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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.sql.v1beta4.Column m = + input.readMessage( + com.google.cloud.sql.v1beta4.Column.parser(), extensionRegistry); + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(m); + } else { + columnsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1beta4.Row m = + input.readMessage(com.google.cloud.sql.v1beta4.Row.parser(), extensionRegistry); + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.add(m); + } else { + rowsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + partialResult_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 66: + { + input.readMessage(internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List columns_ = + java.util.Collections.emptyList(); + + private void ensureColumnsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + columns_ = new java.util.ArrayList(columns_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Column, + com.google.cloud.sql.v1beta4.Column.Builder, + com.google.cloud.sql.v1beta4.ColumnOrBuilder> + columnsBuilder_; + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public java.util.List getColumnsList() { + if (columnsBuilder_ == null) { + return java.util.Collections.unmodifiableList(columns_); + } else { + return columnsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public int getColumnsCount() { + if (columnsBuilder_ == null) { + return columns_.size(); + } else { + return columnsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public com.google.cloud.sql.v1beta4.Column getColumns(int index) { + if (columnsBuilder_ == null) { + return columns_.get(index); + } else { + return columnsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public Builder setColumns(int index, com.google.cloud.sql.v1beta4.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.set(index, value); + onChanged(); + } else { + columnsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public Builder setColumns( + int index, com.google.cloud.sql.v1beta4.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.set(index, builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public Builder addColumns(com.google.cloud.sql.v1beta4.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(value); + onChanged(); + } else { + columnsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public Builder addColumns(int index, com.google.cloud.sql.v1beta4.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(index, value); + onChanged(); + } else { + columnsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public Builder addColumns(com.google.cloud.sql.v1beta4.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public Builder addColumns( + int index, com.google.cloud.sql.v1beta4.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(index, builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public Builder addAllColumns( + java.lang.Iterable values) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, columns_); + onChanged(); + } else { + columnsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public Builder clearColumns() { + if (columnsBuilder_ == null) { + columns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + columnsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public Builder removeColumns(int index) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.remove(index); + onChanged(); + } else { + columnsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public com.google.cloud.sql.v1beta4.Column.Builder getColumnsBuilder(int index) { + return internalGetColumnsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public com.google.cloud.sql.v1beta4.ColumnOrBuilder getColumnsOrBuilder(int index) { + if (columnsBuilder_ == null) { + return columns_.get(index); + } else { + return columnsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public java.util.List + getColumnsOrBuilderList() { + if (columnsBuilder_ != null) { + return columnsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(columns_); + } + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public com.google.cloud.sql.v1beta4.Column.Builder addColumnsBuilder() { + return internalGetColumnsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.Column.getDefaultInstance()); + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public com.google.cloud.sql.v1beta4.Column.Builder addColumnsBuilder(int index) { + return internalGetColumnsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.Column.getDefaultInstance()); + } + + /** + * + * + *
+     * List of columns included in the result. This also includes the data type
+     * of the column.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + public java.util.List getColumnsBuilderList() { + return internalGetColumnsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Column, + com.google.cloud.sql.v1beta4.Column.Builder, + com.google.cloud.sql.v1beta4.ColumnOrBuilder> + internalGetColumnsFieldBuilder() { + if (columnsBuilder_ == null) { + columnsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Column, + com.google.cloud.sql.v1beta4.Column.Builder, + com.google.cloud.sql.v1beta4.ColumnOrBuilder>( + columns_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + columns_ = null; + } + return columnsBuilder_; + } + + private java.util.List rows_ = + java.util.Collections.emptyList(); + + private void ensureRowsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + rows_ = new java.util.ArrayList(rows_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Row, + com.google.cloud.sql.v1beta4.Row.Builder, + com.google.cloud.sql.v1beta4.RowOrBuilder> + rowsBuilder_; + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public java.util.List getRowsList() { + if (rowsBuilder_ == null) { + return java.util.Collections.unmodifiableList(rows_); + } else { + return rowsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public int getRowsCount() { + if (rowsBuilder_ == null) { + return rows_.size(); + } else { + return rowsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public com.google.cloud.sql.v1beta4.Row getRows(int index) { + if (rowsBuilder_ == null) { + return rows_.get(index); + } else { + return rowsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public Builder setRows(int index, com.google.cloud.sql.v1beta4.Row value) { + if (rowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowsIsMutable(); + rows_.set(index, value); + onChanged(); + } else { + rowsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public Builder setRows(int index, com.google.cloud.sql.v1beta4.Row.Builder builderForValue) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.set(index, builderForValue.build()); + onChanged(); + } else { + rowsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public Builder addRows(com.google.cloud.sql.v1beta4.Row value) { + if (rowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowsIsMutable(); + rows_.add(value); + onChanged(); + } else { + rowsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public Builder addRows(int index, com.google.cloud.sql.v1beta4.Row value) { + if (rowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowsIsMutable(); + rows_.add(index, value); + onChanged(); + } else { + rowsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public Builder addRows(com.google.cloud.sql.v1beta4.Row.Builder builderForValue) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.add(builderForValue.build()); + onChanged(); + } else { + rowsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public Builder addRows(int index, com.google.cloud.sql.v1beta4.Row.Builder builderForValue) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.add(index, builderForValue.build()); + onChanged(); + } else { + rowsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public Builder addAllRows( + java.lang.Iterable values) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rows_); + onChanged(); + } else { + rowsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public Builder clearRows() { + if (rowsBuilder_ == null) { + rows_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + rowsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public Builder removeRows(int index) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.remove(index); + onChanged(); + } else { + rowsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public com.google.cloud.sql.v1beta4.Row.Builder getRowsBuilder(int index) { + return internalGetRowsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public com.google.cloud.sql.v1beta4.RowOrBuilder getRowsOrBuilder(int index) { + if (rowsBuilder_ == null) { + return rows_.get(index); + } else { + return rowsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public java.util.List + getRowsOrBuilderList() { + if (rowsBuilder_ != null) { + return rowsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rows_); + } + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public com.google.cloud.sql.v1beta4.Row.Builder addRowsBuilder() { + return internalGetRowsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.Row.getDefaultInstance()); + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public com.google.cloud.sql.v1beta4.Row.Builder addRowsBuilder(int index) { + return internalGetRowsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.Row.getDefaultInstance()); + } + + /** + * + * + *
+     * Rows returned by the SQL statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + public java.util.List getRowsBuilderList() { + return internalGetRowsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Row, + com.google.cloud.sql.v1beta4.Row.Builder, + com.google.cloud.sql.v1beta4.RowOrBuilder> + internalGetRowsFieldBuilder() { + if (rowsBuilder_ == null) { + rowsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Row, + com.google.cloud.sql.v1beta4.Row.Builder, + com.google.cloud.sql.v1beta4.RowOrBuilder>( + rows_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + rows_ = null; + } + return rowsBuilder_; + } + + private java.lang.Object message_ = ""; + + /** + * + * + *
+     * Message related to the SQL execution result.
+     * 
+ * + * string message = 3; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Message related to the SQL execution result.
+     * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Message related to the SQL execution result.
+     * 
+ * + * string message = 3; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Message related to the SQL execution result.
+     * 
+ * + * string message = 3; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Message related to the SQL execution result.
+     * 
+ * + * string message = 3; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean partialResult_; + + /** + * + * + *
+     * Set to true if the SQL execution's result is truncated due to size limits
+     * or an error retrieving results.
+     * 
+ * + * bool partial_result = 4; + * + * @return The partialResult. + */ + @java.lang.Override + public boolean getPartialResult() { + return partialResult_; + } + + /** + * + * + *
+     * Set to true if the SQL execution's result is truncated due to size limits
+     * or an error retrieving results.
+     * 
+ * + * bool partial_result = 4; + * + * @param value The partialResult to set. + * @return This builder for chaining. + */ + public Builder setPartialResult(boolean value) { + + partialResult_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Set to true if the SQL execution's result is truncated due to size limits
+     * or an error retrieving results.
+     * 
+ * + * bool partial_result = 4; + * + * @return This builder for chaining. + */ + public Builder clearPartialResult() { + bitField0_ = (bitField0_ & ~0x00000008); + partialResult_ = false; + onChanged(); + return this; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000010); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
+     * If results were truncated due to an error, details of that error.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.QueryResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.QueryResult) + private static final com.google.cloud.sql.v1beta4.QueryResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.QueryResult(); + } + + public static com.google.cloud.sql.v1beta4.QueryResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.QueryResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/QueryResultOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/QueryResultOrBuilder.java new file mode 100644 index 000000000000..713376e9f9ab --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/QueryResultOrBuilder.java @@ -0,0 +1,220 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface QueryResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.QueryResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + java.util.List getColumnsList(); + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + com.google.cloud.sql.v1beta4.Column getColumns(int index); + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + int getColumnsCount(); + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + java.util.List getColumnsOrBuilderList(); + + /** + * + * + *
+   * List of columns included in the result. This also includes the data type
+   * of the column.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Column columns = 1; + */ + com.google.cloud.sql.v1beta4.ColumnOrBuilder getColumnsOrBuilder(int index); + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + java.util.List getRowsList(); + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + com.google.cloud.sql.v1beta4.Row getRows(int index); + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + int getRowsCount(); + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + java.util.List getRowsOrBuilderList(); + + /** + * + * + *
+   * Rows returned by the SQL statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Row rows = 2; + */ + com.google.cloud.sql.v1beta4.RowOrBuilder getRowsOrBuilder(int index); + + /** + * + * + *
+   * Message related to the SQL execution result.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
+   * Message related to the SQL execution result.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
+   * Set to true if the SQL execution's result is truncated due to size limits
+   * or an error retrieving results.
+   * 
+ * + * bool partial_result = 4; + * + * @return The partialResult. + */ + boolean getPartialResult(); + + /** + * + * + *
+   * If results were truncated due to an error, details of that error.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+   * If results were truncated due to an error, details of that error.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
+   * If results were truncated due to an error, details of that error.
+   * 
+ * + * .google.rpc.Status status = 8; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReadPoolAutoScaleConfig.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReadPoolAutoScaleConfig.java new file mode 100644 index 000000000000..fb370d0a8050 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReadPoolAutoScaleConfig.java @@ -0,0 +1,2652 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The read pool auto-scale configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig} + */ +@com.google.protobuf.Generated +public final class ReadPoolAutoScaleConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig) + ReadPoolAutoScaleConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReadPoolAutoScaleConfig"); + } + + // Use ReadPoolAutoScaleConfig.newBuilder() to construct. + private ReadPoolAutoScaleConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReadPoolAutoScaleConfig() { + targetMetrics_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.class, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.Builder.class); + } + + public interface TargetMetricOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The metric name to be used for auto scaling.
+     * 
+ * + * optional string metric = 1; + * + * @return Whether the metric field is set. + */ + boolean hasMetric(); + + /** + * + * + *
+     * The metric name to be used for auto scaling.
+     * 
+ * + * optional string metric = 1; + * + * @return The metric. + */ + java.lang.String getMetric(); + + /** + * + * + *
+     * The metric name to be used for auto scaling.
+     * 
+ * + * optional string metric = 1; + * + * @return The bytes for metric. + */ + com.google.protobuf.ByteString getMetricBytes(); + + /** + * + * + *
+     * The target value for the metric.
+     * 
+ * + * optional float target_value = 2; + * + * @return Whether the targetValue field is set. + */ + boolean hasTargetValue(); + + /** + * + * + *
+     * The target value for the metric.
+     * 
+ * + * optional float target_value = 2; + * + * @return The targetValue. + */ + float getTargetValue(); + } + + /** + * + * + *
+   * Target metric for read pool auto scaling.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric} + */ + public static final class TargetMetric extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric) + TargetMetricOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TargetMetric"); + } + + // Use TargetMetric.newBuilder() to construct. + private TargetMetric(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TargetMetric() { + metric_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_TargetMetric_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_TargetMetric_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.class, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.Builder.class); + } + + private int bitField0_; + public static final int METRIC_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object metric_ = ""; + + /** + * + * + *
+     * The metric name to be used for auto scaling.
+     * 
+ * + * optional string metric = 1; + * + * @return Whether the metric field is set. + */ + @java.lang.Override + public boolean hasMetric() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The metric name to be used for auto scaling.
+     * 
+ * + * optional string metric = 1; + * + * @return The metric. + */ + @java.lang.Override + public java.lang.String getMetric() { + java.lang.Object ref = metric_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metric_ = s; + return s; + } + } + + /** + * + * + *
+     * The metric name to be used for auto scaling.
+     * 
+ * + * optional string metric = 1; + * + * @return The bytes for metric. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetricBytes() { + java.lang.Object ref = metric_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metric_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_VALUE_FIELD_NUMBER = 2; + private float targetValue_ = 0F; + + /** + * + * + *
+     * The target value for the metric.
+     * 
+ * + * optional float target_value = 2; + * + * @return Whether the targetValue field is set. + */ + @java.lang.Override + public boolean hasTargetValue() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The target value for the metric.
+     * 
+ * + * optional float target_value = 2; + * + * @return The targetValue. + */ + @java.lang.Override + public float getTargetValue() { + return targetValue_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, metric_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeFloat(2, targetValue_); + } + 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.GeneratedMessage.computeStringSize(1, metric_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, targetValue_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric other = + (com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric) obj; + + if (hasMetric() != other.hasMetric()) return false; + if (hasMetric()) { + if (!getMetric().equals(other.getMetric())) return false; + } + if (hasTargetValue() != other.hasTargetValue()) return false; + if (hasTargetValue()) { + if (java.lang.Float.floatToIntBits(getTargetValue()) + != java.lang.Float.floatToIntBits(other.getTargetValue())) return false; + } + if (!getUnknownFields().equals(other.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 (hasMetric()) { + hash = (37 * hash) + METRIC_FIELD_NUMBER; + hash = (53 * hash) + getMetric().hashCode(); + } + if (hasTargetValue()) { + hash = (37 * hash) + TARGET_VALUE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getTargetValue()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Target metric for read pool auto scaling.
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric) + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetricOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_TargetMetric_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_TargetMetric_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.class, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + metric_ = ""; + targetValue_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_TargetMetric_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric build() { + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric buildPartial() { + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric result = + new com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.metric_ = metric_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.targetValue_ = targetValue_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric other) { + if (other + == com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric + .getDefaultInstance()) return this; + if (other.hasMetric()) { + metric_ = other.metric_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasTargetValue()) { + setTargetValue(other.getTargetValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + metric_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: + { + targetValue_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object metric_ = ""; + + /** + * + * + *
+       * The metric name to be used for auto scaling.
+       * 
+ * + * optional string metric = 1; + * + * @return Whether the metric field is set. + */ + public boolean hasMetric() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The metric name to be used for auto scaling.
+       * 
+ * + * optional string metric = 1; + * + * @return The metric. + */ + public java.lang.String getMetric() { + java.lang.Object ref = metric_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metric_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The metric name to be used for auto scaling.
+       * 
+ * + * optional string metric = 1; + * + * @return The bytes for metric. + */ + public com.google.protobuf.ByteString getMetricBytes() { + java.lang.Object ref = metric_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metric_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The metric name to be used for auto scaling.
+       * 
+ * + * optional string metric = 1; + * + * @param value The metric to set. + * @return This builder for chaining. + */ + public Builder setMetric(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + metric_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The metric name to be used for auto scaling.
+       * 
+ * + * optional string metric = 1; + * + * @return This builder for chaining. + */ + public Builder clearMetric() { + metric_ = getDefaultInstance().getMetric(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The metric name to be used for auto scaling.
+       * 
+ * + * optional string metric = 1; + * + * @param value The bytes for metric to set. + * @return This builder for chaining. + */ + public Builder setMetricBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + metric_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private float targetValue_; + + /** + * + * + *
+       * The target value for the metric.
+       * 
+ * + * optional float target_value = 2; + * + * @return Whether the targetValue field is set. + */ + @java.lang.Override + public boolean hasTargetValue() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The target value for the metric.
+       * 
+ * + * optional float target_value = 2; + * + * @return The targetValue. + */ + @java.lang.Override + public float getTargetValue() { + return targetValue_; + } + + /** + * + * + *
+       * The target value for the metric.
+       * 
+ * + * optional float target_value = 2; + * + * @param value The targetValue to set. + * @return This builder for chaining. + */ + public Builder setTargetValue(float value) { + + targetValue_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The target value for the metric.
+       * 
+ * + * optional float target_value = 2; + * + * @return This builder for chaining. + */ + public Builder clearTargetValue() { + bitField0_ = (bitField0_ & ~0x00000002); + targetValue_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric) + private static final com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric(); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TargetMetric parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + + /** + * + * + *
+   * Indicates whether read pool auto scaling is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Indicates whether read pool auto scaling is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + public static final int MIN_NODE_COUNT_FIELD_NUMBER = 2; + private int minNodeCount_ = 0; + + /** + * + * + *
+   * Minimum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 min_node_count = 2; + * + * @return Whether the minNodeCount field is set. + */ + @java.lang.Override + public boolean hasMinNodeCount() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Minimum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 min_node_count = 2; + * + * @return The minNodeCount. + */ + @java.lang.Override + public int getMinNodeCount() { + return minNodeCount_; + } + + public static final int MAX_NODE_COUNT_FIELD_NUMBER = 3; + private int maxNodeCount_ = 0; + + /** + * + * + *
+   * Maximum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 max_node_count = 3; + * + * @return Whether the maxNodeCount field is set. + */ + @java.lang.Override + public boolean hasMaxNodeCount() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Maximum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 max_node_count = 3; + * + * @return The maxNodeCount. + */ + @java.lang.Override + public int getMaxNodeCount() { + return maxNodeCount_; + } + + public static final int TARGET_METRICS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List + targetMetrics_; + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getTargetMetricsList() { + return targetMetrics_; + } + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetricOrBuilder> + getTargetMetricsOrBuilderList() { + return targetMetrics_; + } + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getTargetMetricsCount() { + return targetMetrics_.size(); + } + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric getTargetMetrics( + int index) { + return targetMetrics_.get(index); + } + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetricOrBuilder + getTargetMetricsOrBuilder(int index) { + return targetMetrics_.get(index); + } + + public static final int DISABLE_SCALE_IN_FIELD_NUMBER = 5; + private boolean disableScaleIn_ = false; + + /** + * + * + *
+   * Indicates whether read pool auto scaling supports scale in operations
+   * (removing nodes).
+   * 
+ * + * optional bool disable_scale_in = 5; + * + * @return Whether the disableScaleIn field is set. + */ + @java.lang.Override + public boolean hasDisableScaleIn() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Indicates whether read pool auto scaling supports scale in operations
+   * (removing nodes).
+   * 
+ * + * optional bool disable_scale_in = 5; + * + * @return The disableScaleIn. + */ + @java.lang.Override + public boolean getDisableScaleIn() { + return disableScaleIn_; + } + + public static final int SCALE_IN_COOLDOWN_SECONDS_FIELD_NUMBER = 6; + private int scaleInCooldownSeconds_ = 0; + + /** + * + * + *
+   * The cooldown period for scale in operations.
+   * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @return Whether the scaleInCooldownSeconds field is set. + */ + @java.lang.Override + public boolean hasScaleInCooldownSeconds() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * The cooldown period for scale in operations.
+   * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @return The scaleInCooldownSeconds. + */ + @java.lang.Override + public int getScaleInCooldownSeconds() { + return scaleInCooldownSeconds_; + } + + public static final int SCALE_OUT_COOLDOWN_SECONDS_FIELD_NUMBER = 7; + private int scaleOutCooldownSeconds_ = 0; + + /** + * + * + *
+   * The cooldown period for scale out operations.
+   * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @return Whether the scaleOutCooldownSeconds field is set. + */ + @java.lang.Override + public boolean hasScaleOutCooldownSeconds() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * The cooldown period for scale out operations.
+   * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @return The scaleOutCooldownSeconds. + */ + @java.lang.Override + public int getScaleOutCooldownSeconds() { + return scaleOutCooldownSeconds_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, enabled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(2, minNodeCount_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(3, maxNodeCount_); + } + for (int i = 0; i < targetMetrics_.size(); i++) { + output.writeMessage(4, targetMetrics_.get(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeBool(5, disableScaleIn_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeInt32(6, scaleInCooldownSeconds_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeInt32(7, scaleOutCooldownSeconds_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enabled_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, minNodeCount_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxNodeCount_); + } + for (int i = 0; i < targetMetrics_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, targetMetrics_.get(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, disableScaleIn_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, scaleInCooldownSeconds_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, scaleOutCooldownSeconds_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig other = + (com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig) obj; + + if (hasEnabled() != other.hasEnabled()) return false; + if (hasEnabled()) { + if (getEnabled() != other.getEnabled()) return false; + } + if (hasMinNodeCount() != other.hasMinNodeCount()) return false; + if (hasMinNodeCount()) { + if (getMinNodeCount() != other.getMinNodeCount()) return false; + } + if (hasMaxNodeCount() != other.hasMaxNodeCount()) return false; + if (hasMaxNodeCount()) { + if (getMaxNodeCount() != other.getMaxNodeCount()) return false; + } + if (!getTargetMetricsList().equals(other.getTargetMetricsList())) return false; + if (hasDisableScaleIn() != other.hasDisableScaleIn()) return false; + if (hasDisableScaleIn()) { + if (getDisableScaleIn() != other.getDisableScaleIn()) return false; + } + if (hasScaleInCooldownSeconds() != other.hasScaleInCooldownSeconds()) return false; + if (hasScaleInCooldownSeconds()) { + if (getScaleInCooldownSeconds() != other.getScaleInCooldownSeconds()) return false; + } + if (hasScaleOutCooldownSeconds() != other.hasScaleOutCooldownSeconds()) return false; + if (hasScaleOutCooldownSeconds()) { + if (getScaleOutCooldownSeconds() != other.getScaleOutCooldownSeconds()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); + } + if (hasMinNodeCount()) { + hash = (37 * hash) + MIN_NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMinNodeCount(); + } + if (hasMaxNodeCount()) { + hash = (37 * hash) + MAX_NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxNodeCount(); + } + if (getTargetMetricsCount() > 0) { + hash = (37 * hash) + TARGET_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getTargetMetricsList().hashCode(); + } + if (hasDisableScaleIn()) { + hash = (37 * hash) + DISABLE_SCALE_IN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisableScaleIn()); + } + if (hasScaleInCooldownSeconds()) { + hash = (37 * hash) + SCALE_IN_COOLDOWN_SECONDS_FIELD_NUMBER; + hash = (53 * hash) + getScaleInCooldownSeconds(); + } + if (hasScaleOutCooldownSeconds()) { + hash = (37 * hash) + SCALE_OUT_COOLDOWN_SECONDS_FIELD_NUMBER; + hash = (53 * hash) + getScaleOutCooldownSeconds(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The read pool auto-scale configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig) + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.class, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enabled_ = false; + minNodeCount_ = 0; + maxNodeCount_ = 0; + if (targetMetricsBuilder_ == null) { + targetMetrics_ = java.util.Collections.emptyList(); + } else { + targetMetrics_ = null; + targetMetricsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + disableScaleIn_ = false; + scaleInCooldownSeconds_ = 0; + scaleOutCooldownSeconds_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReadPoolAutoScaleConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig build() { + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig buildPartial() { + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig result = + new com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig result) { + if (targetMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + targetMetrics_ = java.util.Collections.unmodifiableList(targetMetrics_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.targetMetrics_ = targetMetrics_; + } else { + result.targetMetrics_ = targetMetricsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enabled_ = enabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.minNodeCount_ = minNodeCount_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.maxNodeCount_ = maxNodeCount_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.disableScaleIn_ = disableScaleIn_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.scaleInCooldownSeconds_ = scaleInCooldownSeconds_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.scaleOutCooldownSeconds_ = scaleOutCooldownSeconds_; + to_bitField0_ |= 0x00000020; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig other) { + if (other == com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.getDefaultInstance()) + return this; + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); + } + if (other.hasMinNodeCount()) { + setMinNodeCount(other.getMinNodeCount()); + } + if (other.hasMaxNodeCount()) { + setMaxNodeCount(other.getMaxNodeCount()); + } + if (targetMetricsBuilder_ == null) { + if (!other.targetMetrics_.isEmpty()) { + if (targetMetrics_.isEmpty()) { + targetMetrics_ = other.targetMetrics_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureTargetMetricsIsMutable(); + targetMetrics_.addAll(other.targetMetrics_); + } + onChanged(); + } + } else { + if (!other.targetMetrics_.isEmpty()) { + if (targetMetricsBuilder_.isEmpty()) { + targetMetricsBuilder_.dispose(); + targetMetricsBuilder_ = null; + targetMetrics_ = other.targetMetrics_; + bitField0_ = (bitField0_ & ~0x00000008); + targetMetricsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetTargetMetricsFieldBuilder() + : null; + } else { + targetMetricsBuilder_.addAllMessages(other.targetMetrics_); + } + } + } + if (other.hasDisableScaleIn()) { + setDisableScaleIn(other.getDisableScaleIn()); + } + if (other.hasScaleInCooldownSeconds()) { + setScaleInCooldownSeconds(other.getScaleInCooldownSeconds()); + } + if (other.hasScaleOutCooldownSeconds()) { + setScaleOutCooldownSeconds(other.getScaleOutCooldownSeconds()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + minNodeCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + maxNodeCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric m = + input.readMessage( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.parser(), + extensionRegistry); + if (targetMetricsBuilder_ == null) { + ensureTargetMetricsIsMutable(); + targetMetrics_.add(m); + } else { + targetMetricsBuilder_.addMessage(m); + } + break; + } // case 34 + case 40: + { + disableScaleIn_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + scaleInCooldownSeconds_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: + { + scaleOutCooldownSeconds_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean enabled_; + + /** + * + * + *
+     * Indicates whether read pool auto scaling is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Indicates whether read pool auto scaling is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + /** + * + * + *
+     * Indicates whether read pool auto scaling is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates whether read pool auto scaling is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + enabled_ = false; + onChanged(); + return this; + } + + private int minNodeCount_; + + /** + * + * + *
+     * Minimum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 min_node_count = 2; + * + * @return Whether the minNodeCount field is set. + */ + @java.lang.Override + public boolean hasMinNodeCount() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Minimum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 min_node_count = 2; + * + * @return The minNodeCount. + */ + @java.lang.Override + public int getMinNodeCount() { + return minNodeCount_; + } + + /** + * + * + *
+     * Minimum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 min_node_count = 2; + * + * @param value The minNodeCount to set. + * @return This builder for chaining. + */ + public Builder setMinNodeCount(int value) { + + minNodeCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Minimum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 min_node_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearMinNodeCount() { + bitField0_ = (bitField0_ & ~0x00000002); + minNodeCount_ = 0; + onChanged(); + return this; + } + + private int maxNodeCount_; + + /** + * + * + *
+     * Maximum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 max_node_count = 3; + * + * @return Whether the maxNodeCount field is set. + */ + @java.lang.Override + public boolean hasMaxNodeCount() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Maximum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 max_node_count = 3; + * + * @return The maxNodeCount. + */ + @java.lang.Override + public int getMaxNodeCount() { + return maxNodeCount_; + } + + /** + * + * + *
+     * Maximum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 max_node_count = 3; + * + * @param value The maxNodeCount to set. + * @return This builder for chaining. + */ + public Builder setMaxNodeCount(int value) { + + maxNodeCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum number of read pool nodes to be maintained.
+     * 
+ * + * optional int32 max_node_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearMaxNodeCount() { + bitField0_ = (bitField0_ & ~0x00000004); + maxNodeCount_ = 0; + onChanged(); + return this; + } + + private java.util.List + targetMetrics_ = java.util.Collections.emptyList(); + + private void ensureTargetMetricsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + targetMetrics_ = + new java.util.ArrayList< + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric>(targetMetrics_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.Builder, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetricOrBuilder> + targetMetricsBuilder_; + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getTargetMetricsList() { + if (targetMetricsBuilder_ == null) { + return java.util.Collections.unmodifiableList(targetMetrics_); + } else { + return targetMetricsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getTargetMetricsCount() { + if (targetMetricsBuilder_ == null) { + return targetMetrics_.size(); + } else { + return targetMetricsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric getTargetMetrics( + int index) { + if (targetMetricsBuilder_ == null) { + return targetMetrics_.get(index); + } else { + return targetMetricsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTargetMetrics( + int index, com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric value) { + if (targetMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetMetricsIsMutable(); + targetMetrics_.set(index, value); + onChanged(); + } else { + targetMetricsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTargetMetrics( + int index, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.Builder builderForValue) { + if (targetMetricsBuilder_ == null) { + ensureTargetMetricsIsMutable(); + targetMetrics_.set(index, builderForValue.build()); + onChanged(); + } else { + targetMetricsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTargetMetrics( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric value) { + if (targetMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetMetricsIsMutable(); + targetMetrics_.add(value); + onChanged(); + } else { + targetMetricsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTargetMetrics( + int index, com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric value) { + if (targetMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetMetricsIsMutable(); + targetMetrics_.add(index, value); + onChanged(); + } else { + targetMetricsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTargetMetrics( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.Builder builderForValue) { + if (targetMetricsBuilder_ == null) { + ensureTargetMetricsIsMutable(); + targetMetrics_.add(builderForValue.build()); + onChanged(); + } else { + targetMetricsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTargetMetrics( + int index, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.Builder builderForValue) { + if (targetMetricsBuilder_ == null) { + ensureTargetMetricsIsMutable(); + targetMetrics_.add(index, builderForValue.build()); + onChanged(); + } else { + targetMetricsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllTargetMetrics( + java.lang.Iterable< + ? extends com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric> + values) { + if (targetMetricsBuilder_ == null) { + ensureTargetMetricsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, targetMetrics_); + onChanged(); + } else { + targetMetricsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTargetMetrics() { + if (targetMetricsBuilder_ == null) { + targetMetrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + targetMetricsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeTargetMetrics(int index) { + if (targetMetricsBuilder_ == null) { + ensureTargetMetricsIsMutable(); + targetMetrics_.remove(index); + onChanged(); + } else { + targetMetricsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.Builder + getTargetMetricsBuilder(int index) { + return internalGetTargetMetricsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetricOrBuilder + getTargetMetricsOrBuilder(int index) { + if (targetMetricsBuilder_ == null) { + return targetMetrics_.get(index); + } else { + return targetMetricsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetricOrBuilder> + getTargetMetricsOrBuilderList() { + if (targetMetricsBuilder_ != null) { + return targetMetricsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(targetMetrics_); + } + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.Builder + addTargetMetricsBuilder() { + return internalGetTargetMetricsFieldBuilder() + .addBuilder( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric + .getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.Builder + addTargetMetricsBuilder(int index) { + return internalGetTargetMetricsFieldBuilder() + .addBuilder( + index, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric + .getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. Target metrics for read pool auto scaling.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getTargetMetricsBuilderList() { + return internalGetTargetMetricsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.Builder, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetricOrBuilder> + internalGetTargetMetricsFieldBuilder() { + if (targetMetricsBuilder_ == null) { + targetMetricsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.Builder, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetricOrBuilder>( + targetMetrics_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + targetMetrics_ = null; + } + return targetMetricsBuilder_; + } + + private boolean disableScaleIn_; + + /** + * + * + *
+     * Indicates whether read pool auto scaling supports scale in operations
+     * (removing nodes).
+     * 
+ * + * optional bool disable_scale_in = 5; + * + * @return Whether the disableScaleIn field is set. + */ + @java.lang.Override + public boolean hasDisableScaleIn() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Indicates whether read pool auto scaling supports scale in operations
+     * (removing nodes).
+     * 
+ * + * optional bool disable_scale_in = 5; + * + * @return The disableScaleIn. + */ + @java.lang.Override + public boolean getDisableScaleIn() { + return disableScaleIn_; + } + + /** + * + * + *
+     * Indicates whether read pool auto scaling supports scale in operations
+     * (removing nodes).
+     * 
+ * + * optional bool disable_scale_in = 5; + * + * @param value The disableScaleIn to set. + * @return This builder for chaining. + */ + public Builder setDisableScaleIn(boolean value) { + + disableScaleIn_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates whether read pool auto scaling supports scale in operations
+     * (removing nodes).
+     * 
+ * + * optional bool disable_scale_in = 5; + * + * @return This builder for chaining. + */ + public Builder clearDisableScaleIn() { + bitField0_ = (bitField0_ & ~0x00000010); + disableScaleIn_ = false; + onChanged(); + return this; + } + + private int scaleInCooldownSeconds_; + + /** + * + * + *
+     * The cooldown period for scale in operations.
+     * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @return Whether the scaleInCooldownSeconds field is set. + */ + @java.lang.Override + public boolean hasScaleInCooldownSeconds() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * The cooldown period for scale in operations.
+     * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @return The scaleInCooldownSeconds. + */ + @java.lang.Override + public int getScaleInCooldownSeconds() { + return scaleInCooldownSeconds_; + } + + /** + * + * + *
+     * The cooldown period for scale in operations.
+     * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @param value The scaleInCooldownSeconds to set. + * @return This builder for chaining. + */ + public Builder setScaleInCooldownSeconds(int value) { + + scaleInCooldownSeconds_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The cooldown period for scale in operations.
+     * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @return This builder for chaining. + */ + public Builder clearScaleInCooldownSeconds() { + bitField0_ = (bitField0_ & ~0x00000020); + scaleInCooldownSeconds_ = 0; + onChanged(); + return this; + } + + private int scaleOutCooldownSeconds_; + + /** + * + * + *
+     * The cooldown period for scale out operations.
+     * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @return Whether the scaleOutCooldownSeconds field is set. + */ + @java.lang.Override + public boolean hasScaleOutCooldownSeconds() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * The cooldown period for scale out operations.
+     * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @return The scaleOutCooldownSeconds. + */ + @java.lang.Override + public int getScaleOutCooldownSeconds() { + return scaleOutCooldownSeconds_; + } + + /** + * + * + *
+     * The cooldown period for scale out operations.
+     * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @param value The scaleOutCooldownSeconds to set. + * @return This builder for chaining. + */ + public Builder setScaleOutCooldownSeconds(int value) { + + scaleOutCooldownSeconds_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The cooldown period for scale out operations.
+     * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @return This builder for chaining. + */ + public Builder clearScaleOutCooldownSeconds() { + bitField0_ = (bitField0_ & ~0x00000040); + scaleOutCooldownSeconds_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig) + private static final com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig(); + } + + public static com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadPoolAutoScaleConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReadPoolAutoScaleConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReadPoolAutoScaleConfigOrBuilder.java new file mode 100644 index 000000000000..42bb6d505c2c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReadPoolAutoScaleConfigOrBuilder.java @@ -0,0 +1,255 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ReadPoolAutoScaleConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Indicates whether read pool auto scaling is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + + /** + * + * + *
+   * Indicates whether read pool auto scaling is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + boolean getEnabled(); + + /** + * + * + *
+   * Minimum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 min_node_count = 2; + * + * @return Whether the minNodeCount field is set. + */ + boolean hasMinNodeCount(); + + /** + * + * + *
+   * Minimum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 min_node_count = 2; + * + * @return The minNodeCount. + */ + int getMinNodeCount(); + + /** + * + * + *
+   * Maximum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 max_node_count = 3; + * + * @return Whether the maxNodeCount field is set. + */ + boolean hasMaxNodeCount(); + + /** + * + * + *
+   * Maximum number of read pool nodes to be maintained.
+   * 
+ * + * optional int32 max_node_count = 3; + * + * @return The maxNodeCount. + */ + int getMaxNodeCount(); + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getTargetMetricsList(); + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric getTargetMetrics(int index); + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getTargetMetricsCount(); + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List< + ? extends com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetricOrBuilder> + getTargetMetricsOrBuilderList(); + + /** + * + * + *
+   * Optional. Target metrics for read pool auto scaling.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric target_metrics = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetricOrBuilder + getTargetMetricsOrBuilder(int index); + + /** + * + * + *
+   * Indicates whether read pool auto scaling supports scale in operations
+   * (removing nodes).
+   * 
+ * + * optional bool disable_scale_in = 5; + * + * @return Whether the disableScaleIn field is set. + */ + boolean hasDisableScaleIn(); + + /** + * + * + *
+   * Indicates whether read pool auto scaling supports scale in operations
+   * (removing nodes).
+   * 
+ * + * optional bool disable_scale_in = 5; + * + * @return The disableScaleIn. + */ + boolean getDisableScaleIn(); + + /** + * + * + *
+   * The cooldown period for scale in operations.
+   * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @return Whether the scaleInCooldownSeconds field is set. + */ + boolean hasScaleInCooldownSeconds(); + + /** + * + * + *
+   * The cooldown period for scale in operations.
+   * 
+ * + * optional int32 scale_in_cooldown_seconds = 6; + * + * @return The scaleInCooldownSeconds. + */ + int getScaleInCooldownSeconds(); + + /** + * + * + *
+   * The cooldown period for scale out operations.
+   * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @return Whether the scaleOutCooldownSeconds field is set. + */ + boolean hasScaleOutCooldownSeconds(); + + /** + * + * + *
+   * The cooldown period for scale out operations.
+   * 
+ * + * optional int32 scale_out_cooldown_seconds = 7; + * + * @return The scaleOutCooldownSeconds. + */ + int getScaleOutCooldownSeconds(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReplicaConfiguration.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReplicaConfiguration.java new file mode 100644 index 000000000000..34f7dfd8e9ef --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReplicaConfiguration.java @@ -0,0 +1,1636 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Read-replica configuration for connecting to the primary instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ReplicaConfiguration} + */ +@com.google.protobuf.Generated +public final class ReplicaConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ReplicaConfiguration) + ReplicaConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReplicaConfiguration"); + } + + // Use ReplicaConfiguration.newBuilder() to construct. + private ReplicaConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReplicaConfiguration() { + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReplicaConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReplicaConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ReplicaConfiguration.class, + com.google.cloud.sql.v1beta4.ReplicaConfiguration.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#replicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#replicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MYSQL_REPLICA_CONFIGURATION_FIELD_NUMBER = 2; + private com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysqlReplicaConfiguration_; + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return Whether the mysqlReplicaConfiguration field is set. + */ + @java.lang.Override + public boolean hasMysqlReplicaConfiguration() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return The mysqlReplicaConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration getMysqlReplicaConfiguration() { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.getDefaultInstance() + : mysqlReplicaConfiguration_; + } + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlReplicaConfigurationOrBuilder + getMysqlReplicaConfigurationOrBuilder() { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.getDefaultInstance() + : mysqlReplicaConfiguration_; + } + + public static final int FAILOVER_TARGET_FIELD_NUMBER = 3; + private com.google.protobuf.BoolValue failoverTarget_; + + /** + * + * + *
+   * Specifies if the replica is the failover target. If the field is set to
+   * `true` the replica will be designated as a failover replica. In case the
+   * primary instance fails, the replica instance will be promoted as the new
+   * primary instance. Only one replica can be specified as failover target, and
+   * the replica has to be in different zone with the primary instance.
+   * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + * + * @return Whether the failoverTarget field is set. + */ + @java.lang.Override + public boolean hasFailoverTarget() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Specifies if the replica is the failover target. If the field is set to
+   * `true` the replica will be designated as a failover replica. In case the
+   * primary instance fails, the replica instance will be promoted as the new
+   * primary instance. Only one replica can be specified as failover target, and
+   * the replica has to be in different zone with the primary instance.
+   * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + * + * @return The failoverTarget. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getFailoverTarget() { + return failoverTarget_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : failoverTarget_; + } + + /** + * + * + *
+   * Specifies if the replica is the failover target. If the field is set to
+   * `true` the replica will be designated as a failover replica. In case the
+   * primary instance fails, the replica instance will be promoted as the new
+   * primary instance. Only one replica can be specified as failover target, and
+   * the replica has to be in different zone with the primary instance.
+   * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getFailoverTargetOrBuilder() { + return failoverTarget_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : failoverTarget_; + } + + public static final int CASCADABLE_REPLICA_FIELD_NUMBER = 5; + private com.google.protobuf.BoolValue cascadableReplica_; + + /** + * + * + *
+   * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+   * cascadable replica is a SQL Server cross region replica that supports
+   * replica(s) under it.
+   * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cascadableReplica field is set. + */ + @java.lang.Override + public boolean hasCascadableReplica() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+   * cascadable replica is a SQL Server cross region replica that supports
+   * replica(s) under it.
+   * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cascadableReplica. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getCascadableReplica() { + return cascadableReplica_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : cascadableReplica_; + } + + /** + * + * + *
+   * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+   * cascadable replica is a SQL Server cross region replica that supports
+   * replica(s) under it.
+   * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getCascadableReplicaOrBuilder() { + return cascadableReplica_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : cascadableReplica_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getMysqlReplicaConfiguration()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getFailoverTarget()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getCascadableReplica()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getMysqlReplicaConfiguration()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFailoverTarget()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCascadableReplica()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ReplicaConfiguration)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ReplicaConfiguration other = + (com.google.cloud.sql.v1beta4.ReplicaConfiguration) obj; + + if (!getKind().equals(other.getKind())) return false; + if (hasMysqlReplicaConfiguration() != other.hasMysqlReplicaConfiguration()) return false; + if (hasMysqlReplicaConfiguration()) { + if (!getMysqlReplicaConfiguration().equals(other.getMysqlReplicaConfiguration())) + return false; + } + if (hasFailoverTarget() != other.hasFailoverTarget()) return false; + if (hasFailoverTarget()) { + if (!getFailoverTarget().equals(other.getFailoverTarget())) return false; + } + if (hasCascadableReplica() != other.hasCascadableReplica()) return false; + if (hasCascadableReplica()) { + if (!getCascadableReplica().equals(other.getCascadableReplica())) return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasMysqlReplicaConfiguration()) { + hash = (37 * hash) + MYSQL_REPLICA_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getMysqlReplicaConfiguration().hashCode(); + } + if (hasFailoverTarget()) { + hash = (37 * hash) + FAILOVER_TARGET_FIELD_NUMBER; + hash = (53 * hash) + getFailoverTarget().hashCode(); + } + if (hasCascadableReplica()) { + hash = (37 * hash) + CASCADABLE_REPLICA_FIELD_NUMBER; + hash = (53 * hash) + getCascadableReplica().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ReplicaConfiguration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ReplicaConfiguration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReplicaConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ReplicaConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReplicaConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ReplicaConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReplicaConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ReplicaConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReplicaConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ReplicaConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReplicaConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ReplicaConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.ReplicaConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Read-replica configuration for connecting to the primary instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ReplicaConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ReplicaConfiguration) + com.google.cloud.sql.v1beta4.ReplicaConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReplicaConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReplicaConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ReplicaConfiguration.class, + com.google.cloud.sql.v1beta4.ReplicaConfiguration.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ReplicaConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMysqlReplicaConfigurationFieldBuilder(); + internalGetFailoverTargetFieldBuilder(); + internalGetCascadableReplicaFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + mysqlReplicaConfiguration_ = null; + if (mysqlReplicaConfigurationBuilder_ != null) { + mysqlReplicaConfigurationBuilder_.dispose(); + mysqlReplicaConfigurationBuilder_ = null; + } + failoverTarget_ = null; + if (failoverTargetBuilder_ != null) { + failoverTargetBuilder_.dispose(); + failoverTargetBuilder_ = null; + } + cascadableReplica_ = null; + if (cascadableReplicaBuilder_ != null) { + cascadableReplicaBuilder_.dispose(); + cascadableReplicaBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReplicaConfiguration_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReplicaConfiguration getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ReplicaConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReplicaConfiguration build() { + com.google.cloud.sql.v1beta4.ReplicaConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReplicaConfiguration buildPartial() { + com.google.cloud.sql.v1beta4.ReplicaConfiguration result = + new com.google.cloud.sql.v1beta4.ReplicaConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ReplicaConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mysqlReplicaConfiguration_ = + mysqlReplicaConfigurationBuilder_ == null + ? mysqlReplicaConfiguration_ + : mysqlReplicaConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.failoverTarget_ = + failoverTargetBuilder_ == null ? failoverTarget_ : failoverTargetBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.cascadableReplica_ = + cascadableReplicaBuilder_ == null + ? cascadableReplica_ + : cascadableReplicaBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ReplicaConfiguration) { + return mergeFrom((com.google.cloud.sql.v1beta4.ReplicaConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ReplicaConfiguration other) { + if (other == com.google.cloud.sql.v1beta4.ReplicaConfiguration.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasMysqlReplicaConfiguration()) { + mergeMysqlReplicaConfiguration(other.getMysqlReplicaConfiguration()); + } + if (other.hasFailoverTarget()) { + mergeFailoverTarget(other.getFailoverTarget()); + } + if (other.hasCascadableReplica()) { + mergeCascadableReplica(other.getCascadableReplica()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetMysqlReplicaConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetFailoverTargetFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + input.readMessage( + internalGetCascadableReplicaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#replicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#replicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#replicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#replicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#replicaConfiguration`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysqlReplicaConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration, + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.Builder, + com.google.cloud.sql.v1beta4.MySqlReplicaConfigurationOrBuilder> + mysqlReplicaConfigurationBuilder_; + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return Whether the mysqlReplicaConfiguration field is set. + */ + public boolean hasMysqlReplicaConfiguration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return The mysqlReplicaConfiguration. + */ + public com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration getMysqlReplicaConfiguration() { + if (mysqlReplicaConfigurationBuilder_ == null) { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.getDefaultInstance() + : mysqlReplicaConfiguration_; + } else { + return mysqlReplicaConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public Builder setMysqlReplicaConfiguration( + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration value) { + if (mysqlReplicaConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mysqlReplicaConfiguration_ = value; + } else { + mysqlReplicaConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public Builder setMysqlReplicaConfiguration( + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.Builder builderForValue) { + if (mysqlReplicaConfigurationBuilder_ == null) { + mysqlReplicaConfiguration_ = builderForValue.build(); + } else { + mysqlReplicaConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public Builder mergeMysqlReplicaConfiguration( + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration value) { + if (mysqlReplicaConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && mysqlReplicaConfiguration_ != null + && mysqlReplicaConfiguration_ + != com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.getDefaultInstance()) { + getMysqlReplicaConfigurationBuilder().mergeFrom(value); + } else { + mysqlReplicaConfiguration_ = value; + } + } else { + mysqlReplicaConfigurationBuilder_.mergeFrom(value); + } + if (mysqlReplicaConfiguration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public Builder clearMysqlReplicaConfiguration() { + bitField0_ = (bitField0_ & ~0x00000002); + mysqlReplicaConfiguration_ = null; + if (mysqlReplicaConfigurationBuilder_ != null) { + mysqlReplicaConfigurationBuilder_.dispose(); + mysqlReplicaConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.Builder + getMysqlReplicaConfigurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetMysqlReplicaConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + public com.google.cloud.sql.v1beta4.MySqlReplicaConfigurationOrBuilder + getMysqlReplicaConfigurationOrBuilder() { + if (mysqlReplicaConfigurationBuilder_ != null) { + return mysqlReplicaConfigurationBuilder_.getMessageOrBuilder(); + } else { + return mysqlReplicaConfiguration_ == null + ? com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.getDefaultInstance() + : mysqlReplicaConfiguration_; + } + } + + /** + * + * + *
+     * MySQL specific configuration when replicating from a MySQL on-premises
+     * primary instance. Replication configuration information such as the
+     * username, password, certificates, and keys are not stored in the instance
+     * metadata. The configuration information is used only to set up the
+     * replication connection and is stored by MySQL in a file named
+     * `master.info` in the data directory.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration, + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.Builder, + com.google.cloud.sql.v1beta4.MySqlReplicaConfigurationOrBuilder> + internalGetMysqlReplicaConfigurationFieldBuilder() { + if (mysqlReplicaConfigurationBuilder_ == null) { + mysqlReplicaConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration, + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.Builder, + com.google.cloud.sql.v1beta4.MySqlReplicaConfigurationOrBuilder>( + getMysqlReplicaConfiguration(), getParentForChildren(), isClean()); + mysqlReplicaConfiguration_ = null; + } + return mysqlReplicaConfigurationBuilder_; + } + + private com.google.protobuf.BoolValue failoverTarget_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + failoverTargetBuilder_; + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true` the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + * + * @return Whether the failoverTarget field is set. + */ + public boolean hasFailoverTarget() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true` the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + * + * @return The failoverTarget. + */ + public com.google.protobuf.BoolValue getFailoverTarget() { + if (failoverTargetBuilder_ == null) { + return failoverTarget_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : failoverTarget_; + } else { + return failoverTargetBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true` the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + public Builder setFailoverTarget(com.google.protobuf.BoolValue value) { + if (failoverTargetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + failoverTarget_ = value; + } else { + failoverTargetBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true` the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + public Builder setFailoverTarget(com.google.protobuf.BoolValue.Builder builderForValue) { + if (failoverTargetBuilder_ == null) { + failoverTarget_ = builderForValue.build(); + } else { + failoverTargetBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true` the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + public Builder mergeFailoverTarget(com.google.protobuf.BoolValue value) { + if (failoverTargetBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && failoverTarget_ != null + && failoverTarget_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getFailoverTargetBuilder().mergeFrom(value); + } else { + failoverTarget_ = value; + } + } else { + failoverTargetBuilder_.mergeFrom(value); + } + if (failoverTarget_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true` the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + public Builder clearFailoverTarget() { + bitField0_ = (bitField0_ & ~0x00000004); + failoverTarget_ = null; + if (failoverTargetBuilder_ != null) { + failoverTargetBuilder_.dispose(); + failoverTargetBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true` the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + public com.google.protobuf.BoolValue.Builder getFailoverTargetBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetFailoverTargetFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true` the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + public com.google.protobuf.BoolValueOrBuilder getFailoverTargetOrBuilder() { + if (failoverTargetBuilder_ != null) { + return failoverTargetBuilder_.getMessageOrBuilder(); + } else { + return failoverTarget_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : failoverTarget_; + } + } + + /** + * + * + *
+     * Specifies if the replica is the failover target. If the field is set to
+     * `true` the replica will be designated as a failover replica. In case the
+     * primary instance fails, the replica instance will be promoted as the new
+     * primary instance. Only one replica can be specified as failover target, and
+     * the replica has to be in different zone with the primary instance.
+     * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetFailoverTargetFieldBuilder() { + if (failoverTargetBuilder_ == null) { + failoverTargetBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getFailoverTarget(), getParentForChildren(), isClean()); + failoverTarget_ = null; + } + return failoverTargetBuilder_; + } + + private com.google.protobuf.BoolValue cascadableReplica_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + cascadableReplicaBuilder_; + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cascadableReplica field is set. + */ + public boolean hasCascadableReplica() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cascadableReplica. + */ + public com.google.protobuf.BoolValue getCascadableReplica() { + if (cascadableReplicaBuilder_ == null) { + return cascadableReplica_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : cascadableReplica_; + } else { + return cascadableReplicaBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCascadableReplica(com.google.protobuf.BoolValue value) { + if (cascadableReplicaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cascadableReplica_ = value; + } else { + cascadableReplicaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCascadableReplica(com.google.protobuf.BoolValue.Builder builderForValue) { + if (cascadableReplicaBuilder_ == null) { + cascadableReplica_ = builderForValue.build(); + } else { + cascadableReplicaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeCascadableReplica(com.google.protobuf.BoolValue value) { + if (cascadableReplicaBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && cascadableReplica_ != null + && cascadableReplica_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getCascadableReplicaBuilder().mergeFrom(value); + } else { + cascadableReplica_ = value; + } + } else { + cascadableReplicaBuilder_.mergeFrom(value); + } + if (cascadableReplica_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearCascadableReplica() { + bitField0_ = (bitField0_ & ~0x00000008); + cascadableReplica_ = null; + if (cascadableReplicaBuilder_ != null) { + cascadableReplicaBuilder_.dispose(); + cascadableReplicaBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getCascadableReplicaBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetCascadableReplicaFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getCascadableReplicaOrBuilder() { + if (cascadableReplicaBuilder_ != null) { + return cascadableReplicaBuilder_.getMessageOrBuilder(); + } else { + return cascadableReplica_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : cascadableReplica_; + } + } + + /** + * + * + *
+     * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+     * cascadable replica is a SQL Server cross region replica that supports
+     * replica(s) under it.
+     * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetCascadableReplicaFieldBuilder() { + if (cascadableReplicaBuilder_ == null) { + cascadableReplicaBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getCascadableReplica(), getParentForChildren(), isClean()); + cascadableReplica_ = null; + } + return cascadableReplicaBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ReplicaConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ReplicaConfiguration) + private static final com.google.cloud.sql.v1beta4.ReplicaConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ReplicaConfiguration(); + } + + public static com.google.cloud.sql.v1beta4.ReplicaConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReplicaConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReplicaConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReplicaConfigurationOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReplicaConfigurationOrBuilder.java new file mode 100644 index 000000000000..d2347389e618 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReplicaConfigurationOrBuilder.java @@ -0,0 +1,208 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ReplicaConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ReplicaConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#replicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#replicaConfiguration`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return Whether the mysqlReplicaConfiguration field is set. + */ + boolean hasMysqlReplicaConfiguration(); + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + * + * @return The mysqlReplicaConfiguration. + */ + com.google.cloud.sql.v1beta4.MySqlReplicaConfiguration getMysqlReplicaConfiguration(); + + /** + * + * + *
+   * MySQL specific configuration when replicating from a MySQL on-premises
+   * primary instance. Replication configuration information such as the
+   * username, password, certificates, and keys are not stored in the instance
+   * metadata. The configuration information is used only to set up the
+   * replication connection and is stored by MySQL in a file named
+   * `master.info` in the data directory.
+   * 
+ * + * .google.cloud.sql.v1beta4.MySqlReplicaConfiguration mysql_replica_configuration = 2; + * + */ + com.google.cloud.sql.v1beta4.MySqlReplicaConfigurationOrBuilder + getMysqlReplicaConfigurationOrBuilder(); + + /** + * + * + *
+   * Specifies if the replica is the failover target. If the field is set to
+   * `true` the replica will be designated as a failover replica. In case the
+   * primary instance fails, the replica instance will be promoted as the new
+   * primary instance. Only one replica can be specified as failover target, and
+   * the replica has to be in different zone with the primary instance.
+   * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + * + * @return Whether the failoverTarget field is set. + */ + boolean hasFailoverTarget(); + + /** + * + * + *
+   * Specifies if the replica is the failover target. If the field is set to
+   * `true` the replica will be designated as a failover replica. In case the
+   * primary instance fails, the replica instance will be promoted as the new
+   * primary instance. Only one replica can be specified as failover target, and
+   * the replica has to be in different zone with the primary instance.
+   * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + * + * @return The failoverTarget. + */ + com.google.protobuf.BoolValue getFailoverTarget(); + + /** + * + * + *
+   * Specifies if the replica is the failover target. If the field is set to
+   * `true` the replica will be designated as a failover replica. In case the
+   * primary instance fails, the replica instance will be promoted as the new
+   * primary instance. Only one replica can be specified as failover target, and
+   * the replica has to be in different zone with the primary instance.
+   * 
+ * + * .google.protobuf.BoolValue failover_target = 3; + */ + com.google.protobuf.BoolValueOrBuilder getFailoverTargetOrBuilder(); + + /** + * + * + *
+   * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+   * cascadable replica is a SQL Server cross region replica that supports
+   * replica(s) under it.
+   * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cascadableReplica field is set. + */ + boolean hasCascadableReplica(); + + /** + * + * + *
+   * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+   * cascadable replica is a SQL Server cross region replica that supports
+   * replica(s) under it.
+   * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cascadableReplica. + */ + com.google.protobuf.BoolValue getCascadableReplica(); + + /** + * + * + *
+   * Optional. Specifies if a SQL Server replica is a cascadable replica. A
+   * cascadable replica is a SQL Server cross region replica that supports
+   * replica(s) under it.
+   * 
+ * + * + * .google.protobuf.BoolValue cascadable_replica = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getCascadableReplicaOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReplicationCluster.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReplicationCluster.java new file mode 100644 index 000000000000..924383ec1627 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReplicationCluster.java @@ -0,0 +1,1135 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * A primary instance and disaster recovery (DR) replica pair.
+ * A DR replica is a cross-region replica that you designate for failover
+ * in the event that the primary instance has regional failure.
+ * Applicable to MySQL and PostgreSQL.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ReplicationCluster} + */ +@com.google.protobuf.Generated +public final class ReplicationCluster extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ReplicationCluster) + ReplicationClusterOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReplicationCluster"); + } + + // Use ReplicationCluster.newBuilder() to construct. + private ReplicationCluster(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReplicationCluster() { + psaWriteEndpoint_ = ""; + failoverDrReplicaName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReplicationCluster_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReplicationCluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ReplicationCluster.class, + com.google.cloud.sql.v1beta4.ReplicationCluster.Builder.class); + } + + private int bitField0_; + public static final int PSA_WRITE_ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object psaWriteEndpoint_ = ""; + + /** + * + * + *
+   * Output only. If set, this field indicates this instance has a private
+   * service access (PSA) DNS endpoint that is pointing to the primary instance
+   * of the cluster. If this instance is the primary, then the DNS endpoint
+   * points to this instance. After a switchover or replica failover operation,
+   * this DNS endpoint points to the promoted instance. This is a read-only
+   * field, returned to the user as information. This field can exist even if a
+   * standalone instance doesn't have a DR replica yet or the DR replica is
+   * deleted.
+   * 
+ * + * optional string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the psaWriteEndpoint field is set. + */ + @java.lang.Override + public boolean hasPsaWriteEndpoint() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. If set, this field indicates this instance has a private
+   * service access (PSA) DNS endpoint that is pointing to the primary instance
+   * of the cluster. If this instance is the primary, then the DNS endpoint
+   * points to this instance. After a switchover or replica failover operation,
+   * this DNS endpoint points to the promoted instance. This is a read-only
+   * field, returned to the user as information. This field can exist even if a
+   * standalone instance doesn't have a DR replica yet or the DR replica is
+   * deleted.
+   * 
+ * + * optional string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The psaWriteEndpoint. + */ + @java.lang.Override + public java.lang.String getPsaWriteEndpoint() { + java.lang.Object ref = psaWriteEndpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + psaWriteEndpoint_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. If set, this field indicates this instance has a private
+   * service access (PSA) DNS endpoint that is pointing to the primary instance
+   * of the cluster. If this instance is the primary, then the DNS endpoint
+   * points to this instance. After a switchover or replica failover operation,
+   * this DNS endpoint points to the promoted instance. This is a read-only
+   * field, returned to the user as information. This field can exist even if a
+   * standalone instance doesn't have a DR replica yet or the DR replica is
+   * deleted.
+   * 
+ * + * optional string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for psaWriteEndpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPsaWriteEndpointBytes() { + java.lang.Object ref = psaWriteEndpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + psaWriteEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FAILOVER_DR_REPLICA_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object failoverDrReplicaName_ = ""; + + /** + * + * + *
+   * Optional. If the instance is a primary instance, then this field identifies
+   * the disaster recovery (DR) replica. A DR replica is an optional
+   * configuration for Enterprise Plus edition instances. If the instance is a
+   * read replica, then the field is not set. Set this field to a replica name
+   * to designate a DR replica for a primary instance. Remove the replica name
+   * to remove the DR replica designation.
+   * 
+ * + * optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the failoverDrReplicaName field is set. + */ + @java.lang.Override + public boolean hasFailoverDrReplicaName() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. If the instance is a primary instance, then this field identifies
+   * the disaster recovery (DR) replica. A DR replica is an optional
+   * configuration for Enterprise Plus edition instances. If the instance is a
+   * read replica, then the field is not set. Set this field to a replica name
+   * to designate a DR replica for a primary instance. Remove the replica name
+   * to remove the DR replica designation.
+   * 
+ * + * optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The failoverDrReplicaName. + */ + @java.lang.Override + public java.lang.String getFailoverDrReplicaName() { + java.lang.Object ref = failoverDrReplicaName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + failoverDrReplicaName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. If the instance is a primary instance, then this field identifies
+   * the disaster recovery (DR) replica. A DR replica is an optional
+   * configuration for Enterprise Plus edition instances. If the instance is a
+   * read replica, then the field is not set. Set this field to a replica name
+   * to designate a DR replica for a primary instance. Remove the replica name
+   * to remove the DR replica designation.
+   * 
+ * + * optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for failoverDrReplicaName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFailoverDrReplicaNameBytes() { + java.lang.Object ref = failoverDrReplicaName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + failoverDrReplicaName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DR_REPLICA_FIELD_NUMBER = 4; + private boolean drReplica_ = false; + + /** + * + * + *
+   * Output only. Read-only field that indicates whether the replica is a DR
+   * replica. This field is not set if the instance is a primary instance.
+   * 
+ * + * optional bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the drReplica field is set. + */ + @java.lang.Override + public boolean hasDrReplica() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Output only. Read-only field that indicates whether the replica is a DR
+   * replica. This field is not set if the instance is a primary instance.
+   * 
+ * + * optional bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The drReplica. + */ + @java.lang.Override + public boolean getDrReplica() { + return drReplica_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, psaWriteEndpoint_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, failoverDrReplicaName_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeBool(4, drReplica_); + } + 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.GeneratedMessage.computeStringSize(1, psaWriteEndpoint_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, failoverDrReplicaName_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, drReplica_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ReplicationCluster)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ReplicationCluster other = + (com.google.cloud.sql.v1beta4.ReplicationCluster) obj; + + if (hasPsaWriteEndpoint() != other.hasPsaWriteEndpoint()) return false; + if (hasPsaWriteEndpoint()) { + if (!getPsaWriteEndpoint().equals(other.getPsaWriteEndpoint())) return false; + } + if (hasFailoverDrReplicaName() != other.hasFailoverDrReplicaName()) return false; + if (hasFailoverDrReplicaName()) { + if (!getFailoverDrReplicaName().equals(other.getFailoverDrReplicaName())) return false; + } + if (hasDrReplica() != other.hasDrReplica()) return false; + if (hasDrReplica()) { + if (getDrReplica() != other.getDrReplica()) return false; + } + if (!getUnknownFields().equals(other.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 (hasPsaWriteEndpoint()) { + hash = (37 * hash) + PSA_WRITE_ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getPsaWriteEndpoint().hashCode(); + } + if (hasFailoverDrReplicaName()) { + hash = (37 * hash) + FAILOVER_DR_REPLICA_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFailoverDrReplicaName().hashCode(); + } + if (hasDrReplica()) { + hash = (37 * hash) + DR_REPLICA_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDrReplica()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ReplicationCluster parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ReplicationCluster parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReplicationCluster parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ReplicationCluster parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReplicationCluster parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ReplicationCluster parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReplicationCluster parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ReplicationCluster parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReplicationCluster parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ReplicationCluster parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ReplicationCluster parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ReplicationCluster parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.ReplicationCluster prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A primary instance and disaster recovery (DR) replica pair.
+   * A DR replica is a cross-region replica that you designate for failover
+   * in the event that the primary instance has regional failure.
+   * Applicable to MySQL and PostgreSQL.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ReplicationCluster} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ReplicationCluster) + com.google.cloud.sql.v1beta4.ReplicationClusterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReplicationCluster_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReplicationCluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ReplicationCluster.class, + com.google.cloud.sql.v1beta4.ReplicationCluster.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ReplicationCluster.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + psaWriteEndpoint_ = ""; + failoverDrReplicaName_ = ""; + drReplica_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_ReplicationCluster_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReplicationCluster getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ReplicationCluster.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReplicationCluster build() { + com.google.cloud.sql.v1beta4.ReplicationCluster result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReplicationCluster buildPartial() { + com.google.cloud.sql.v1beta4.ReplicationCluster result = + new com.google.cloud.sql.v1beta4.ReplicationCluster(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ReplicationCluster result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.psaWriteEndpoint_ = psaWriteEndpoint_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.failoverDrReplicaName_ = failoverDrReplicaName_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.drReplica_ = drReplica_; + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ReplicationCluster) { + return mergeFrom((com.google.cloud.sql.v1beta4.ReplicationCluster) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ReplicationCluster other) { + if (other == com.google.cloud.sql.v1beta4.ReplicationCluster.getDefaultInstance()) + return this; + if (other.hasPsaWriteEndpoint()) { + psaWriteEndpoint_ = other.psaWriteEndpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasFailoverDrReplicaName()) { + failoverDrReplicaName_ = other.failoverDrReplicaName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasDrReplica()) { + setDrReplica(other.getDrReplica()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + psaWriteEndpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + failoverDrReplicaName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 32: + { + drReplica_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object psaWriteEndpoint_ = ""; + + /** + * + * + *
+     * Output only. If set, this field indicates this instance has a private
+     * service access (PSA) DNS endpoint that is pointing to the primary instance
+     * of the cluster. If this instance is the primary, then the DNS endpoint
+     * points to this instance. After a switchover or replica failover operation,
+     * this DNS endpoint points to the promoted instance. This is a read-only
+     * field, returned to the user as information. This field can exist even if a
+     * standalone instance doesn't have a DR replica yet or the DR replica is
+     * deleted.
+     * 
+ * + * optional string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the psaWriteEndpoint field is set. + */ + public boolean hasPsaWriteEndpoint() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Output only. If set, this field indicates this instance has a private
+     * service access (PSA) DNS endpoint that is pointing to the primary instance
+     * of the cluster. If this instance is the primary, then the DNS endpoint
+     * points to this instance. After a switchover or replica failover operation,
+     * this DNS endpoint points to the promoted instance. This is a read-only
+     * field, returned to the user as information. This field can exist even if a
+     * standalone instance doesn't have a DR replica yet or the DR replica is
+     * deleted.
+     * 
+ * + * optional string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The psaWriteEndpoint. + */ + public java.lang.String getPsaWriteEndpoint() { + java.lang.Object ref = psaWriteEndpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + psaWriteEndpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. If set, this field indicates this instance has a private
+     * service access (PSA) DNS endpoint that is pointing to the primary instance
+     * of the cluster. If this instance is the primary, then the DNS endpoint
+     * points to this instance. After a switchover or replica failover operation,
+     * this DNS endpoint points to the promoted instance. This is a read-only
+     * field, returned to the user as information. This field can exist even if a
+     * standalone instance doesn't have a DR replica yet or the DR replica is
+     * deleted.
+     * 
+ * + * optional string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for psaWriteEndpoint. + */ + public com.google.protobuf.ByteString getPsaWriteEndpointBytes() { + java.lang.Object ref = psaWriteEndpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + psaWriteEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. If set, this field indicates this instance has a private
+     * service access (PSA) DNS endpoint that is pointing to the primary instance
+     * of the cluster. If this instance is the primary, then the DNS endpoint
+     * points to this instance. After a switchover or replica failover operation,
+     * this DNS endpoint points to the promoted instance. This is a read-only
+     * field, returned to the user as information. This field can exist even if a
+     * standalone instance doesn't have a DR replica yet or the DR replica is
+     * deleted.
+     * 
+ * + * optional string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The psaWriteEndpoint to set. + * @return This builder for chaining. + */ + public Builder setPsaWriteEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + psaWriteEndpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. If set, this field indicates this instance has a private
+     * service access (PSA) DNS endpoint that is pointing to the primary instance
+     * of the cluster. If this instance is the primary, then the DNS endpoint
+     * points to this instance. After a switchover or replica failover operation,
+     * this DNS endpoint points to the promoted instance. This is a read-only
+     * field, returned to the user as information. This field can exist even if a
+     * standalone instance doesn't have a DR replica yet or the DR replica is
+     * deleted.
+     * 
+ * + * optional string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearPsaWriteEndpoint() { + psaWriteEndpoint_ = getDefaultInstance().getPsaWriteEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. If set, this field indicates this instance has a private
+     * service access (PSA) DNS endpoint that is pointing to the primary instance
+     * of the cluster. If this instance is the primary, then the DNS endpoint
+     * points to this instance. After a switchover or replica failover operation,
+     * this DNS endpoint points to the promoted instance. This is a read-only
+     * field, returned to the user as information. This field can exist even if a
+     * standalone instance doesn't have a DR replica yet or the DR replica is
+     * deleted.
+     * 
+ * + * optional string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for psaWriteEndpoint to set. + * @return This builder for chaining. + */ + public Builder setPsaWriteEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + psaWriteEndpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object failoverDrReplicaName_ = ""; + + /** + * + * + *
+     * Optional. If the instance is a primary instance, then this field identifies
+     * the disaster recovery (DR) replica. A DR replica is an optional
+     * configuration for Enterprise Plus edition instances. If the instance is a
+     * read replica, then the field is not set. Set this field to a replica name
+     * to designate a DR replica for a primary instance. Remove the replica name
+     * to remove the DR replica designation.
+     * 
+ * + * optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the failoverDrReplicaName field is set. + */ + public boolean hasFailoverDrReplicaName() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. If the instance is a primary instance, then this field identifies
+     * the disaster recovery (DR) replica. A DR replica is an optional
+     * configuration for Enterprise Plus edition instances. If the instance is a
+     * read replica, then the field is not set. Set this field to a replica name
+     * to designate a DR replica for a primary instance. Remove the replica name
+     * to remove the DR replica designation.
+     * 
+ * + * optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The failoverDrReplicaName. + */ + public java.lang.String getFailoverDrReplicaName() { + java.lang.Object ref = failoverDrReplicaName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + failoverDrReplicaName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. If the instance is a primary instance, then this field identifies
+     * the disaster recovery (DR) replica. A DR replica is an optional
+     * configuration for Enterprise Plus edition instances. If the instance is a
+     * read replica, then the field is not set. Set this field to a replica name
+     * to designate a DR replica for a primary instance. Remove the replica name
+     * to remove the DR replica designation.
+     * 
+ * + * optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for failoverDrReplicaName. + */ + public com.google.protobuf.ByteString getFailoverDrReplicaNameBytes() { + java.lang.Object ref = failoverDrReplicaName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + failoverDrReplicaName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. If the instance is a primary instance, then this field identifies
+     * the disaster recovery (DR) replica. A DR replica is an optional
+     * configuration for Enterprise Plus edition instances. If the instance is a
+     * read replica, then the field is not set. Set this field to a replica name
+     * to designate a DR replica for a primary instance. Remove the replica name
+     * to remove the DR replica designation.
+     * 
+ * + * optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The failoverDrReplicaName to set. + * @return This builder for chaining. + */ + public Builder setFailoverDrReplicaName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + failoverDrReplicaName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If the instance is a primary instance, then this field identifies
+     * the disaster recovery (DR) replica. A DR replica is an optional
+     * configuration for Enterprise Plus edition instances. If the instance is a
+     * read replica, then the field is not set. Set this field to a replica name
+     * to designate a DR replica for a primary instance. Remove the replica name
+     * to remove the DR replica designation.
+     * 
+ * + * optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearFailoverDrReplicaName() { + failoverDrReplicaName_ = getDefaultInstance().getFailoverDrReplicaName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If the instance is a primary instance, then this field identifies
+     * the disaster recovery (DR) replica. A DR replica is an optional
+     * configuration for Enterprise Plus edition instances. If the instance is a
+     * read replica, then the field is not set. Set this field to a replica name
+     * to designate a DR replica for a primary instance. Remove the replica name
+     * to remove the DR replica designation.
+     * 
+ * + * optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for failoverDrReplicaName to set. + * @return This builder for chaining. + */ + public Builder setFailoverDrReplicaNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + failoverDrReplicaName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean drReplica_; + + /** + * + * + *
+     * Output only. Read-only field that indicates whether the replica is a DR
+     * replica. This field is not set if the instance is a primary instance.
+     * 
+ * + * optional bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the drReplica field is set. + */ + @java.lang.Override + public boolean hasDrReplica() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Output only. Read-only field that indicates whether the replica is a DR
+     * replica. This field is not set if the instance is a primary instance.
+     * 
+ * + * optional bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The drReplica. + */ + @java.lang.Override + public boolean getDrReplica() { + return drReplica_; + } + + /** + * + * + *
+     * Output only. Read-only field that indicates whether the replica is a DR
+     * replica. This field is not set if the instance is a primary instance.
+     * 
+ * + * optional bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The drReplica to set. + * @return This builder for chaining. + */ + public Builder setDrReplica(boolean value) { + + drReplica_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Read-only field that indicates whether the replica is a DR
+     * replica. This field is not set if the instance is a primary instance.
+     * 
+ * + * optional bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDrReplica() { + bitField0_ = (bitField0_ & ~0x00000004); + drReplica_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ReplicationCluster) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ReplicationCluster) + private static final com.google.cloud.sql.v1beta4.ReplicationCluster DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ReplicationCluster(); + } + + public static com.google.cloud.sql.v1beta4.ReplicationCluster getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReplicationCluster parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReplicationCluster getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReplicationClusterOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReplicationClusterOrBuilder.java new file mode 100644 index 000000000000..7b92ef7d52c5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ReplicationClusterOrBuilder.java @@ -0,0 +1,176 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ReplicationClusterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ReplicationCluster) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. If set, this field indicates this instance has a private
+   * service access (PSA) DNS endpoint that is pointing to the primary instance
+   * of the cluster. If this instance is the primary, then the DNS endpoint
+   * points to this instance. After a switchover or replica failover operation,
+   * this DNS endpoint points to the promoted instance. This is a read-only
+   * field, returned to the user as information. This field can exist even if a
+   * standalone instance doesn't have a DR replica yet or the DR replica is
+   * deleted.
+   * 
+ * + * optional string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the psaWriteEndpoint field is set. + */ + boolean hasPsaWriteEndpoint(); + + /** + * + * + *
+   * Output only. If set, this field indicates this instance has a private
+   * service access (PSA) DNS endpoint that is pointing to the primary instance
+   * of the cluster. If this instance is the primary, then the DNS endpoint
+   * points to this instance. After a switchover or replica failover operation,
+   * this DNS endpoint points to the promoted instance. This is a read-only
+   * field, returned to the user as information. This field can exist even if a
+   * standalone instance doesn't have a DR replica yet or the DR replica is
+   * deleted.
+   * 
+ * + * optional string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The psaWriteEndpoint. + */ + java.lang.String getPsaWriteEndpoint(); + + /** + * + * + *
+   * Output only. If set, this field indicates this instance has a private
+   * service access (PSA) DNS endpoint that is pointing to the primary instance
+   * of the cluster. If this instance is the primary, then the DNS endpoint
+   * points to this instance. After a switchover or replica failover operation,
+   * this DNS endpoint points to the promoted instance. This is a read-only
+   * field, returned to the user as information. This field can exist even if a
+   * standalone instance doesn't have a DR replica yet or the DR replica is
+   * deleted.
+   * 
+ * + * optional string psa_write_endpoint = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for psaWriteEndpoint. + */ + com.google.protobuf.ByteString getPsaWriteEndpointBytes(); + + /** + * + * + *
+   * Optional. If the instance is a primary instance, then this field identifies
+   * the disaster recovery (DR) replica. A DR replica is an optional
+   * configuration for Enterprise Plus edition instances. If the instance is a
+   * read replica, then the field is not set. Set this field to a replica name
+   * to designate a DR replica for a primary instance. Remove the replica name
+   * to remove the DR replica designation.
+   * 
+ * + * optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the failoverDrReplicaName field is set. + */ + boolean hasFailoverDrReplicaName(); + + /** + * + * + *
+   * Optional. If the instance is a primary instance, then this field identifies
+   * the disaster recovery (DR) replica. A DR replica is an optional
+   * configuration for Enterprise Plus edition instances. If the instance is a
+   * read replica, then the field is not set. Set this field to a replica name
+   * to designate a DR replica for a primary instance. Remove the replica name
+   * to remove the DR replica designation.
+   * 
+ * + * optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The failoverDrReplicaName. + */ + java.lang.String getFailoverDrReplicaName(); + + /** + * + * + *
+   * Optional. If the instance is a primary instance, then this field identifies
+   * the disaster recovery (DR) replica. A DR replica is an optional
+   * configuration for Enterprise Plus edition instances. If the instance is a
+   * read replica, then the field is not set. Set this field to a replica name
+   * to designate a DR replica for a primary instance. Remove the replica name
+   * to remove the DR replica designation.
+   * 
+ * + * optional string failover_dr_replica_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for failoverDrReplicaName. + */ + com.google.protobuf.ByteString getFailoverDrReplicaNameBytes(); + + /** + * + * + *
+   * Output only. Read-only field that indicates whether the replica is a DR
+   * replica. This field is not set if the instance is a primary instance.
+   * 
+ * + * optional bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the drReplica field is set. + */ + boolean hasDrReplica(); + + /** + * + * + *
+   * Output only. Read-only field that indicates whether the replica is a DR
+   * replica. This field is not set if the instance is a primary instance.
+   * 
+ * + * optional bool dr_replica = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The drReplica. + */ + boolean getDrReplica(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ResolveConnectSettingsRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ResolveConnectSettingsRequest.java new file mode 100644 index 000000000000..53997bec6e56 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ResolveConnectSettingsRequest.java @@ -0,0 +1,786 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Connect settings retrieval request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ResolveConnectSettingsRequest} + */ +@com.google.protobuf.Generated +public final class ResolveConnectSettingsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.ResolveConnectSettingsRequest) + ResolveConnectSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResolveConnectSettingsRequest"); + } + + // Use ResolveConnectSettingsRequest.newBuilder() to construct. + private ResolveConnectSettingsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ResolveConnectSettingsRequest() { + dnsName_ = ""; + location_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ResolveConnectSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ResolveConnectSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest.class, + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest.Builder.class); + } + + public static final int DNS_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object dnsName_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The dnsName. + */ + @java.lang.Override + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for dnsName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + + /** + * + * + *
+   * Required. The region of the instance.
+   * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The region of the instance.
+   * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(dnsName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, dnsName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, location_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dnsName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, dnsName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, location_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest other = + (com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest) obj; + + if (!getDnsName().equals(other.getDnsName())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (!getUnknownFields().equals(other.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) + DNS_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDnsName().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Connect settings retrieval request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.ResolveConnectSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.ResolveConnectSettingsRequest) + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ResolveConnectSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ResolveConnectSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest.class, + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dnsName_ = ""; + location_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlConnectProto + .internal_static_google_cloud_sql_v1beta4_ResolveConnectSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest build() { + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest buildPartial() { + com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest result = + new com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dnsName_ = dnsName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.location_ = location_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest other) { + if (other == com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest.getDefaultInstance()) + return this; + if (!other.getDnsName().isEmpty()) { + dnsName_ = other.dnsName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + 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: + { + dnsName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + location_ = 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 dnsName_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The dnsName. + */ + public java.lang.String getDnsName() { + java.lang.Object ref = dnsName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dnsName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for dnsName. + */ + public com.google.protobuf.ByteString getDnsNameBytes() { + java.lang.Object ref = dnsName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dnsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dnsName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDnsName() { + dnsName_ = getDefaultInstance().getDnsName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for dnsName to set. + * @return This builder for chaining. + */ + public Builder setDnsNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dnsName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object location_ = ""; + + /** + * + * + *
+     * Required. The region of the instance.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The region of the instance.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The region of the instance.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The region of the instance.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The region of the instance.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.ResolveConnectSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.ResolveConnectSettingsRequest) + private static final com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest(); + } + + public static com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResolveConnectSettingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ResolveConnectSettingsRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ResolveConnectSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..183680644568 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ResolveConnectSettingsRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_connect.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ResolveConnectSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.ResolveConnectSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The dnsName. + */ + java.lang.String getDnsName(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string dns_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for dnsName. + */ + com.google.protobuf.ByteString getDnsNameBytes(); + + /** + * + * + *
+   * Required. The region of the instance.
+   * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The location. + */ + java.lang.String getLocation(); + + /** + * + * + *
+   * Required. The region of the instance.
+   * 
+ * + * string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RestoreBackupContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RestoreBackupContext.java new file mode 100644 index 000000000000..d3c6623ba048 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RestoreBackupContext.java @@ -0,0 +1,1073 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance restore from backup context.
+ * Backup context contains source instance id and project id.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.RestoreBackupContext} + */ +@com.google.protobuf.Generated +public final class RestoreBackupContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.RestoreBackupContext) + RestoreBackupContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RestoreBackupContext"); + } + + // Use RestoreBackupContext.newBuilder() to construct. + private RestoreBackupContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RestoreBackupContext() { + kind_ = ""; + instanceId_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RestoreBackupContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RestoreBackupContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.RestoreBackupContext.class, + com.google.cloud.sql.v1beta4.RestoreBackupContext.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#restoreBackupContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#restoreBackupContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_RUN_ID_FIELD_NUMBER = 2; + private long backupRunId_ = 0L; + + /** + * + * + *
+   * The ID of the backup run to restore from.
+   * 
+ * + * int64 backup_run_id = 2; + * + * @return The backupRunId. + */ + @java.lang.Override + public long getBackupRunId() { + return backupRunId_; + } + + public static final int INSTANCE_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceId_ = ""; + + /** + * + * + *
+   * The ID of the instance that the backup was taken from.
+   * 
+ * + * string instance_id = 3; + * + * @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; + } + } + + /** + * + * + *
+   * The ID of the instance that the backup was taken from.
+   * 
+ * + * string instance_id = 3; + * + * @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 PROJECT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * The full project ID of the source instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * The full project ID of the source instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (backupRunId_ != 0L) { + output.writeInt64(2, backupRunId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, instanceId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (backupRunId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, backupRunId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, instanceId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.RestoreBackupContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.RestoreBackupContext other = + (com.google.cloud.sql.v1beta4.RestoreBackupContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (getBackupRunId() != other.getBackupRunId()) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + BACKUP_RUN_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getBackupRunId()); + hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.RestoreBackupContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.RestoreBackupContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RestoreBackupContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.RestoreBackupContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RestoreBackupContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.RestoreBackupContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RestoreBackupContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.RestoreBackupContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RestoreBackupContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.RestoreBackupContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RestoreBackupContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.RestoreBackupContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.RestoreBackupContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance restore from backup context.
+   * Backup context contains source instance id and project id.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.RestoreBackupContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.RestoreBackupContext) + com.google.cloud.sql.v1beta4.RestoreBackupContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RestoreBackupContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RestoreBackupContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.RestoreBackupContext.class, + com.google.cloud.sql.v1beta4.RestoreBackupContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.RestoreBackupContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + backupRunId_ = 0L; + instanceId_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RestoreBackupContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RestoreBackupContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.RestoreBackupContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RestoreBackupContext build() { + com.google.cloud.sql.v1beta4.RestoreBackupContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RestoreBackupContext buildPartial() { + com.google.cloud.sql.v1beta4.RestoreBackupContext result = + new com.google.cloud.sql.v1beta4.RestoreBackupContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.RestoreBackupContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupRunId_ = backupRunId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.instanceId_ = instanceId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.RestoreBackupContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.RestoreBackupContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.RestoreBackupContext other) { + if (other == com.google.cloud.sql.v1beta4.RestoreBackupContext.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getBackupRunId() != 0L) { + setBackupRunId(other.getBackupRunId()); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + backupRunId_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + instanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + project_ = 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#restoreBackupContext`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#restoreBackupContext`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#restoreBackupContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#restoreBackupContext`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#restoreBackupContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long backupRunId_; + + /** + * + * + *
+     * The ID of the backup run to restore from.
+     * 
+ * + * int64 backup_run_id = 2; + * + * @return The backupRunId. + */ + @java.lang.Override + public long getBackupRunId() { + return backupRunId_; + } + + /** + * + * + *
+     * The ID of the backup run to restore from.
+     * 
+ * + * int64 backup_run_id = 2; + * + * @param value The backupRunId to set. + * @return This builder for chaining. + */ + public Builder setBackupRunId(long value) { + + backupRunId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The ID of the backup run to restore from.
+     * 
+ * + * int64 backup_run_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearBackupRunId() { + bitField0_ = (bitField0_ & ~0x00000002); + backupRunId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + + /** + * + * + *
+     * The ID of the instance that the backup was taken from.
+     * 
+ * + * string instance_id = 3; + * + * @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; + } + } + + /** + * + * + *
+     * The ID of the instance that the backup was taken from.
+     * 
+ * + * string instance_id = 3; + * + * @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; + } + } + + /** + * + * + *
+     * The ID of the instance that the backup was taken from.
+     * 
+ * + * string instance_id = 3; + * + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The ID of the instance that the backup was taken from.
+     * 
+ * + * string instance_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The ID of the instance that the backup was taken from.
+     * 
+ * + * string instance_id = 3; + * + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * The full project ID of the source instance.
+     * 
+ * + * string project = 4; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The full project ID of the source instance.
+     * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The full project ID of the source instance.
+     * 
+ * + * string project = 4; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The full project ID of the source instance.
+     * 
+ * + * string project = 4; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The full project ID of the source instance.
+     * 
+ * + * string project = 4; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.RestoreBackupContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.RestoreBackupContext) + private static final com.google.cloud.sql.v1beta4.RestoreBackupContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.RestoreBackupContext(); + } + + public static com.google.cloud.sql.v1beta4.RestoreBackupContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestoreBackupContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RestoreBackupContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RestoreBackupContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RestoreBackupContextOrBuilder.java new file mode 100644 index 000000000000..68cae8c9633c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RestoreBackupContextOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface RestoreBackupContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.RestoreBackupContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#restoreBackupContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#restoreBackupContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The ID of the backup run to restore from.
+   * 
+ * + * int64 backup_run_id = 2; + * + * @return The backupRunId. + */ + long getBackupRunId(); + + /** + * + * + *
+   * The ID of the instance that the backup was taken from.
+   * 
+ * + * string instance_id = 3; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + + /** + * + * + *
+   * The ID of the instance that the backup was taken from.
+   * 
+ * + * string instance_id = 3; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * The full project ID of the source instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * The full project ID of the source instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateEntraIdCertificateContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateEntraIdCertificateContext.java new file mode 100644 index 000000000000..eb410fe80bda --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateEntraIdCertificateContext.java @@ -0,0 +1,804 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance rotate Entra ID certificate context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.RotateEntraIdCertificateContext} + */ +@com.google.protobuf.Generated +public final class RotateEntraIdCertificateContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.RotateEntraIdCertificateContext) + RotateEntraIdCertificateContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RotateEntraIdCertificateContext"); + } + + // Use RotateEntraIdCertificateContext.newBuilder() to construct. + private RotateEntraIdCertificateContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RotateEntraIdCertificateContext() { + kind_ = ""; + nextVersion_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateEntraIdCertificateContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateEntraIdCertificateContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.class, + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEXT_VERSION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextVersion_ = ""; + + /** + * + * + *
+   * Optional. The fingerprint of the next version to be rotated to. If left
+   * unspecified, will be rotated to the most recently added Entra ID
+   * certificate version.
+   * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextVersion. + */ + @java.lang.Override + public java.lang.String getNextVersion() { + java.lang.Object ref = nextVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The fingerprint of the next version to be rotated to. If left
+   * unspecified, will be rotated to the most recently added Entra ID
+   * certificate version.
+   * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextVersionBytes() { + java.lang.Object ref = nextVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextVersion_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextVersion_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext other = + (com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getNextVersion().equals(other.getNextVersion())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + NEXT_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getNextVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance rotate Entra ID certificate context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.RotateEntraIdCertificateContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.RotateEntraIdCertificateContext) + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateEntraIdCertificateContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateEntraIdCertificateContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.class, + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + nextVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateEntraIdCertificateContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext build() { + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext buildPartial() { + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext result = + new com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextVersion_ = nextVersion_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext other) { + if (other + == com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getNextVersion().isEmpty()) { + nextVersion_ = other.nextVersion_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + nextVersion_ = 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 kind_ = ""; + + /** + * + * + *
+     * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object nextVersion_ = ""; + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added Entra ID
+     * certificate version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextVersion. + */ + public java.lang.String getNextVersion() { + java.lang.Object ref = nextVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added Entra ID
+     * certificate version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextVersion. + */ + public com.google.protobuf.ByteString getNextVersionBytes() { + java.lang.Object ref = nextVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added Entra ID
+     * certificate version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The nextVersion to set. + * @return This builder for chaining. + */ + public Builder setNextVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added Entra ID
+     * certificate version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNextVersion() { + nextVersion_ = getDefaultInstance().getNextVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added Entra ID
+     * certificate version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for nextVersion to set. + * @return This builder for chaining. + */ + public Builder setNextVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.RotateEntraIdCertificateContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.RotateEntraIdCertificateContext) + private static final com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext(); + } + + public static com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RotateEntraIdCertificateContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateEntraIdCertificateContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateEntraIdCertificateContextOrBuilder.java new file mode 100644 index 000000000000..ee83dd2c0c55 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateEntraIdCertificateContextOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface RotateEntraIdCertificateContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.RotateEntraIdCertificateContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * Optional. This is always `sql#rotateEntraIdCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Optional. The fingerprint of the next version to be rotated to. If left
+   * unspecified, will be rotated to the most recently added Entra ID
+   * certificate version.
+   * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextVersion. + */ + java.lang.String getNextVersion(); + + /** + * + * + *
+   * Optional. The fingerprint of the next version to be rotated to. If left
+   * unspecified, will be rotated to the most recently added Entra ID
+   * certificate version.
+   * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextVersion. + */ + com.google.protobuf.ByteString getNextVersionBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateServerCaContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateServerCaContext.java new file mode 100644 index 000000000000..78117b817ecf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateServerCaContext.java @@ -0,0 +1,792 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance rotate server CA context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.RotateServerCaContext} + */ +@com.google.protobuf.Generated +public final class RotateServerCaContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.RotateServerCaContext) + RotateServerCaContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RotateServerCaContext"); + } + + // Use RotateServerCaContext.newBuilder() to construct. + private RotateServerCaContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RotateServerCaContext() { + kind_ = ""; + nextVersion_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateServerCaContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateServerCaContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.RotateServerCaContext.class, + com.google.cloud.sql.v1beta4.RotateServerCaContext.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#rotateServerCaContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#rotateServerCaContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEXT_VERSION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextVersion_ = ""; + + /** + * + * + *
+   * The fingerprint of the next version to be rotated to. If left unspecified,
+   * will be rotated to the most recently added server CA version.
+   * 
+ * + * string next_version = 2; + * + * @return The nextVersion. + */ + @java.lang.Override + public java.lang.String getNextVersion() { + java.lang.Object ref = nextVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * The fingerprint of the next version to be rotated to. If left unspecified,
+   * will be rotated to the most recently added server CA version.
+   * 
+ * + * string next_version = 2; + * + * @return The bytes for nextVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextVersionBytes() { + java.lang.Object ref = nextVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextVersion_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextVersion_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.RotateServerCaContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.RotateServerCaContext other = + (com.google.cloud.sql.v1beta4.RotateServerCaContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getNextVersion().equals(other.getNextVersion())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + NEXT_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getNextVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.RotateServerCaContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCaContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCaContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCaContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCaContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCaContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCaContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCaContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCaContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCaContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCaContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCaContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.RotateServerCaContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance rotate server CA context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.RotateServerCaContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.RotateServerCaContext) + com.google.cloud.sql.v1beta4.RotateServerCaContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateServerCaContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateServerCaContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.RotateServerCaContext.class, + com.google.cloud.sql.v1beta4.RotateServerCaContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.RotateServerCaContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + nextVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateServerCaContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateServerCaContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.RotateServerCaContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateServerCaContext build() { + com.google.cloud.sql.v1beta4.RotateServerCaContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateServerCaContext buildPartial() { + com.google.cloud.sql.v1beta4.RotateServerCaContext result = + new com.google.cloud.sql.v1beta4.RotateServerCaContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.RotateServerCaContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextVersion_ = nextVersion_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.RotateServerCaContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.RotateServerCaContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.RotateServerCaContext other) { + if (other == com.google.cloud.sql.v1beta4.RotateServerCaContext.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getNextVersion().isEmpty()) { + nextVersion_ = other.nextVersion_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + nextVersion_ = 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#rotateServerCaContext`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#rotateServerCaContext`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#rotateServerCaContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#rotateServerCaContext`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#rotateServerCaContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object nextVersion_ = ""; + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server CA version.
+     * 
+ * + * string next_version = 2; + * + * @return The nextVersion. + */ + public java.lang.String getNextVersion() { + java.lang.Object ref = nextVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server CA version.
+     * 
+ * + * string next_version = 2; + * + * @return The bytes for nextVersion. + */ + public com.google.protobuf.ByteString getNextVersionBytes() { + java.lang.Object ref = nextVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server CA version.
+     * 
+ * + * string next_version = 2; + * + * @param value The nextVersion to set. + * @return This builder for chaining. + */ + public Builder setNextVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server CA version.
+     * 
+ * + * string next_version = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextVersion() { + nextVersion_ = getDefaultInstance().getNextVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The fingerprint of the next version to be rotated to. If left unspecified,
+     * will be rotated to the most recently added server CA version.
+     * 
+ * + * string next_version = 2; + * + * @param value The bytes for nextVersion to set. + * @return This builder for chaining. + */ + public Builder setNextVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.RotateServerCaContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.RotateServerCaContext) + private static final com.google.cloud.sql.v1beta4.RotateServerCaContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.RotateServerCaContext(); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCaContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RotateServerCaContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateServerCaContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateServerCaContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateServerCaContextOrBuilder.java new file mode 100644 index 000000000000..73579cd6b7dd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateServerCaContextOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface RotateServerCaContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.RotateServerCaContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#rotateServerCaContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#rotateServerCaContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The fingerprint of the next version to be rotated to. If left unspecified,
+   * will be rotated to the most recently added server CA version.
+   * 
+ * + * string next_version = 2; + * + * @return The nextVersion. + */ + java.lang.String getNextVersion(); + + /** + * + * + *
+   * The fingerprint of the next version to be rotated to. If left unspecified,
+   * will be rotated to the most recently added server CA version.
+   * 
+ * + * string next_version = 2; + * + * @return The bytes for nextVersion. + */ + com.google.protobuf.ByteString getNextVersionBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateServerCertificateContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateServerCertificateContext.java new file mode 100644 index 000000000000..9c91c31826a7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateServerCertificateContext.java @@ -0,0 +1,800 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance rotate server certificate context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.RotateServerCertificateContext} + */ +@com.google.protobuf.Generated +public final class RotateServerCertificateContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.RotateServerCertificateContext) + RotateServerCertificateContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RotateServerCertificateContext"); + } + + // Use RotateServerCertificateContext.newBuilder() to construct. + private RotateServerCertificateContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RotateServerCertificateContext() { + kind_ = ""; + nextVersion_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateServerCertificateContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateServerCertificateContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.RotateServerCertificateContext.class, + com.google.cloud.sql.v1beta4.RotateServerCertificateContext.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * Optional. This is always `sql#rotateServerCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. This is always `sql#rotateServerCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEXT_VERSION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextVersion_ = ""; + + /** + * + * + *
+   * Optional. The fingerprint of the next version to be rotated to. If left
+   * unspecified, will be rotated to the most recently added server certificate
+   * version.
+   * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextVersion. + */ + @java.lang.Override + public java.lang.String getNextVersion() { + java.lang.Object ref = nextVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The fingerprint of the next version to be rotated to. If left
+   * unspecified, will be rotated to the most recently added server certificate
+   * version.
+   * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextVersionBytes() { + java.lang.Object ref = nextVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextVersion_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextVersion_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.RotateServerCertificateContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.RotateServerCertificateContext other = + (com.google.cloud.sql.v1beta4.RotateServerCertificateContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getNextVersion().equals(other.getNextVersion())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + NEXT_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getNextVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.RotateServerCertificateContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCertificateContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCertificateContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCertificateContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCertificateContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCertificateContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCertificateContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCertificateContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCertificateContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCertificateContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCertificateContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCertificateContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.RotateServerCertificateContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance rotate server certificate context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.RotateServerCertificateContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.RotateServerCertificateContext) + com.google.cloud.sql.v1beta4.RotateServerCertificateContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateServerCertificateContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateServerCertificateContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.RotateServerCertificateContext.class, + com.google.cloud.sql.v1beta4.RotateServerCertificateContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.RotateServerCertificateContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + nextVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_RotateServerCertificateContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateServerCertificateContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.RotateServerCertificateContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateServerCertificateContext build() { + com.google.cloud.sql.v1beta4.RotateServerCertificateContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateServerCertificateContext buildPartial() { + com.google.cloud.sql.v1beta4.RotateServerCertificateContext result = + new com.google.cloud.sql.v1beta4.RotateServerCertificateContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.RotateServerCertificateContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextVersion_ = nextVersion_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.RotateServerCertificateContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.RotateServerCertificateContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.RotateServerCertificateContext other) { + if (other == com.google.cloud.sql.v1beta4.RotateServerCertificateContext.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getNextVersion().isEmpty()) { + nextVersion_ = other.nextVersion_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + nextVersion_ = 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 kind_ = ""; + + /** + * + * + *
+     * Optional. This is always `sql#rotateServerCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateServerCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateServerCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateServerCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This is always `sql#rotateServerCertificateContext`.
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object nextVersion_ = ""; + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added server certificate
+     * version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextVersion. + */ + public java.lang.String getNextVersion() { + java.lang.Object ref = nextVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added server certificate
+     * version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextVersion. + */ + public com.google.protobuf.ByteString getNextVersionBytes() { + java.lang.Object ref = nextVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added server certificate
+     * version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The nextVersion to set. + * @return This builder for chaining. + */ + public Builder setNextVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added server certificate
+     * version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNextVersion() { + nextVersion_ = getDefaultInstance().getNextVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The fingerprint of the next version to be rotated to. If left
+     * unspecified, will be rotated to the most recently added server certificate
+     * version.
+     * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for nextVersion to set. + * @return This builder for chaining. + */ + public Builder setNextVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.RotateServerCertificateContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.RotateServerCertificateContext) + private static final com.google.cloud.sql.v1beta4.RotateServerCertificateContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.RotateServerCertificateContext(); + } + + public static com.google.cloud.sql.v1beta4.RotateServerCertificateContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RotateServerCertificateContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.RotateServerCertificateContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateServerCertificateContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateServerCertificateContextOrBuilder.java new file mode 100644 index 000000000000..906aae6ea48b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RotateServerCertificateContextOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface RotateServerCertificateContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.RotateServerCertificateContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. This is always `sql#rotateServerCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * Optional. This is always `sql#rotateServerCertificateContext`.
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Optional. The fingerprint of the next version to be rotated to. If left
+   * unspecified, will be rotated to the most recently added server certificate
+   * version.
+   * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextVersion. + */ + java.lang.String getNextVersion(); + + /** + * + * + *
+   * Optional. The fingerprint of the next version to be rotated to. If left
+   * unspecified, will be rotated to the most recently added server certificate
+   * version.
+   * 
+ * + * string next_version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextVersion. + */ + com.google.protobuf.ByteString getNextVersionBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Row.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Row.java new file mode 100644 index 000000000000..afc4f5317871 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Row.java @@ -0,0 +1,915 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Contains the values for a row.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Row} + */ +@com.google.protobuf.Generated +public final class Row extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.Row) + RowOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Row"); + } + + // Use Row.newBuilder() to construct. + private Row(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Row() { + values_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Row_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Row_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Row.class, com.google.cloud.sql.v1beta4.Row.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List values_; + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + @java.lang.Override + public java.util.List + getValuesOrBuilderList() { + return values_; + } + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Value getValues(int index) { + return values_.get(index); + } + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ValueOrBuilder getValuesOrBuilder(int index) { + return values_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(1, values_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, values_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.Row)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.Row other = (com.google.cloud.sql.v1beta4.Row) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.Row parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Row parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Row parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Row parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Row parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Row parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Row parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Row parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Row parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Row parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Row parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Row parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.Row prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Contains the values for a row.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Row} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.Row) + com.google.cloud.sql.v1beta4.RowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Row_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Row_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Row.class, + com.google.cloud.sql.v1beta4.Row.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.Row.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + } else { + values_ = null; + valuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Row_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Row getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.Row.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Row build() { + com.google.cloud.sql.v1beta4.Row result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Row buildPartial() { + com.google.cloud.sql.v1beta4.Row result = new com.google.cloud.sql.v1beta4.Row(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1beta4.Row result) { + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.Row result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.Row) { + return mergeFrom((com.google.cloud.sql.v1beta4.Row) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.Row other) { + if (other == com.google.cloud.sql.v1beta4.Row.getDefaultInstance()) return this; + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + valuesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetValuesFieldBuilder() + : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.sql.v1beta4.Value m = + input.readMessage( + com.google.cloud.sql.v1beta4.Value.parser(), extensionRegistry); + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(m); + } else { + valuesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List values_ = + java.util.Collections.emptyList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = new java.util.ArrayList(values_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Value, + com.google.cloud.sql.v1beta4.Value.Builder, + com.google.cloud.sql.v1beta4.ValueOrBuilder> + valuesBuilder_; + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public java.util.List getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public com.google.cloud.sql.v1beta4.Value getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public Builder setValues(int index, com.google.cloud.sql.v1beta4.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public Builder setValues( + int index, com.google.cloud.sql.v1beta4.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public Builder addValues(com.google.cloud.sql.v1beta4.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public Builder addValues(int index, com.google.cloud.sql.v1beta4.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public Builder addValues(com.google.cloud.sql.v1beta4.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public Builder addValues( + int index, com.google.cloud.sql.v1beta4.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public Builder addAllValues( + java.lang.Iterable values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public com.google.cloud.sql.v1beta4.Value.Builder getValuesBuilder(int index) { + return internalGetValuesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public com.google.cloud.sql.v1beta4.ValueOrBuilder getValuesOrBuilder(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public java.util.List + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public com.google.cloud.sql.v1beta4.Value.Builder addValuesBuilder() { + return internalGetValuesFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.Value.getDefaultInstance()); + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public com.google.cloud.sql.v1beta4.Value.Builder addValuesBuilder(int index) { + return internalGetValuesFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.Value.getDefaultInstance()); + } + + /** + * + * + *
+     * The values for the row.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + public java.util.List getValuesBuilderList() { + return internalGetValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Value, + com.google.cloud.sql.v1beta4.Value.Builder, + com.google.cloud.sql.v1beta4.ValueOrBuilder> + internalGetValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Value, + com.google.cloud.sql.v1beta4.Value.Builder, + com.google.cloud.sql.v1beta4.ValueOrBuilder>( + values_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + values_ = null; + } + return valuesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.Row) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.Row) + private static final com.google.cloud.sql.v1beta4.Row DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.Row(); + } + + public static com.google.cloud.sql.v1beta4.Row getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Row parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Row getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RowOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RowOrBuilder.java new file mode 100644 index 000000000000..9736c049797e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/RowOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface RowOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.Row) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + java.util.List getValuesList(); + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + com.google.cloud.sql.v1beta4.Value getValues(int index); + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + int getValuesCount(); + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + java.util.List getValuesOrBuilderList(); + + /** + * + * + *
+   * The values for the row.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Value values = 1; + */ + com.google.cloud.sql.v1beta4.ValueOrBuilder getValuesOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SelectedObjects.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SelectedObjects.java new file mode 100644 index 000000000000..3814cf6e395f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SelectedObjects.java @@ -0,0 +1,597 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * A list of objects that the user selects for replication from an external
+ * source instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SelectedObjects} + */ +@com.google.protobuf.Generated +public final class SelectedObjects extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SelectedObjects) + SelectedObjectsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SelectedObjects"); + } + + // Use SelectedObjects.newBuilder() to construct. + private SelectedObjects(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SelectedObjects() { + database_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SelectedObjects_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SelectedObjects_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SelectedObjects.class, + com.google.cloud.sql.v1beta4.SelectedObjects.Builder.class); + } + + public static final int DATABASE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * Required. The name of the database to migrate.
+   * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name of the database to migrate.
+   * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = 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.GeneratedMessage.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, database_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, database_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SelectedObjects)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SelectedObjects other = + (com.google.cloud.sql.v1beta4.SelectedObjects) obj; + + if (!getDatabase().equals(other.getDatabase())) return false; + if (!getUnknownFields().equals(other.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) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SelectedObjects parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SelectedObjects parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SelectedObjects parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SelectedObjects parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SelectedObjects parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SelectedObjects parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SelectedObjects parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SelectedObjects parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SelectedObjects parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SelectedObjects parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SelectedObjects parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SelectedObjects parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SelectedObjects prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A list of objects that the user selects for replication from an external
+   * source instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SelectedObjects} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SelectedObjects) + com.google.cloud.sql.v1beta4.SelectedObjectsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SelectedObjects_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SelectedObjects_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SelectedObjects.class, + com.google.cloud.sql.v1beta4.SelectedObjects.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SelectedObjects.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + database_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SelectedObjects_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SelectedObjects getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SelectedObjects.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SelectedObjects build() { + com.google.cloud.sql.v1beta4.SelectedObjects result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SelectedObjects buildPartial() { + com.google.cloud.sql.v1beta4.SelectedObjects result = + new com.google.cloud.sql.v1beta4.SelectedObjects(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SelectedObjects result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.database_ = database_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SelectedObjects) { + return mergeFrom((com.google.cloud.sql.v1beta4.SelectedObjects) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SelectedObjects other) { + if (other == com.google.cloud.sql.v1beta4.SelectedObjects.getDefaultInstance()) return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + 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: + { + database_ = 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 database_ = ""; + + /** + * + * + *
+     * Required. The name of the database to migrate.
+     * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name of the database to migrate.
+     * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name of the database to migrate.
+     * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the database to migrate.
+     * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the database to migrate.
+     * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SelectedObjects) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SelectedObjects) + private static final com.google.cloud.sql.v1beta4.SelectedObjects DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SelectedObjects(); + } + + public static com.google.cloud.sql.v1beta4.SelectedObjects getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SelectedObjects parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SelectedObjects getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SelectedObjectsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SelectedObjectsOrBuilder.java new file mode 100644 index 000000000000..6fdac65d4848 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SelectedObjectsOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SelectedObjectsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SelectedObjects) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the database to migrate.
+   * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * Required. The name of the database to migrate.
+   * 
+ * + * string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SessionMetadata.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SessionMetadata.java new file mode 100644 index 000000000000..2f0b80f21b23 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SessionMetadata.java @@ -0,0 +1,844 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Metadata from the server to the client about the session. The server will
+ * always send this as the first message
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SessionMetadata} + */ +@com.google.protobuf.Generated +public final class SessionMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SessionMetadata) + SessionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionMetadata"); + } + + // Use SessionMetadata.newBuilder() to construct. + private SessionMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionMetadata() { + supportedFeatures_ = emptyIntList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_SessionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_SessionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SessionMetadata.class, + com.google.cloud.sql.v1beta4.SessionMetadata.Builder.class); + } + + public static final int SUPPORTED_FEATURES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList supportedFeatures_ = emptyIntList(); + + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.cloud.sql.v1beta4.SqlDataFeature> + supportedFeatures_converter_ = + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.cloud.sql.v1beta4.SqlDataFeature>() { + public com.google.cloud.sql.v1beta4.SqlDataFeature convert(int from) { + com.google.cloud.sql.v1beta4.SqlDataFeature result = + com.google.cloud.sql.v1beta4.SqlDataFeature.forNumber(from); + return result == null + ? com.google.cloud.sql.v1beta4.SqlDataFeature.UNRECOGNIZED + : result; + } + }; + + /** + * + * + *
+   * The features supported by the server for this session. This field is used
+   * by the client to determine which features are available on the server.
+   * The features supported by the server for this session.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @return A list containing the supportedFeatures. + */ + @java.lang.Override + public java.util.List getSupportedFeaturesList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.cloud.sql.v1beta4.SqlDataFeature>( + supportedFeatures_, supportedFeatures_converter_); + } + + /** + * + * + *
+   * The features supported by the server for this session. This field is used
+   * by the client to determine which features are available on the server.
+   * The features supported by the server for this session.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @return The count of supportedFeatures. + */ + @java.lang.Override + public int getSupportedFeaturesCount() { + return supportedFeatures_.size(); + } + + /** + * + * + *
+   * The features supported by the server for this session. This field is used
+   * by the client to determine which features are available on the server.
+   * The features supported by the server for this session.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @param index The index of the element to return. + * @return The supportedFeatures at the given index. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDataFeature getSupportedFeatures(int index) { + return supportedFeatures_converter_.convert(supportedFeatures_.getInt(index)); + } + + /** + * + * + *
+   * The features supported by the server for this session. This field is used
+   * by the client to determine which features are available on the server.
+   * The features supported by the server for this session.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @return A list containing the enum numeric values on the wire for supportedFeatures. + */ + @java.lang.Override + public java.util.List getSupportedFeaturesValueList() { + return supportedFeatures_; + } + + /** + * + * + *
+   * The features supported by the server for this session. This field is used
+   * by the client to determine which features are available on the server.
+   * The features supported by the server for this session.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of supportedFeatures at the given index. + */ + @java.lang.Override + public int getSupportedFeaturesValue(int index) { + return supportedFeatures_.getInt(index); + } + + private int supportedFeaturesMemoizedSerializedSize; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (getSupportedFeaturesList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(supportedFeaturesMemoizedSerializedSize); + } + for (int i = 0; i < supportedFeatures_.size(); i++) { + output.writeEnumNoTag(supportedFeatures_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < supportedFeatures_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag( + supportedFeatures_.getInt(i)); + } + size += dataSize; + if (!getSupportedFeaturesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + supportedFeaturesMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SessionMetadata)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SessionMetadata other = + (com.google.cloud.sql.v1beta4.SessionMetadata) obj; + + if (!supportedFeatures_.equals(other.supportedFeatures_)) return false; + if (!getUnknownFields().equals(other.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 (getSupportedFeaturesCount() > 0) { + hash = (37 * hash) + SUPPORTED_FEATURES_FIELD_NUMBER; + hash = (53 * hash) + supportedFeatures_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SessionMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SessionMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SessionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SessionMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SessionMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SessionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SessionMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SessionMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SessionMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SessionMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SessionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SessionMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SessionMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Metadata from the server to the client about the session. The server will
+   * always send this as the first message
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SessionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SessionMetadata) + com.google.cloud.sql.v1beta4.SessionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_SessionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_SessionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SessionMetadata.class, + com.google.cloud.sql.v1beta4.SessionMetadata.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SessionMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + supportedFeatures_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_SessionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SessionMetadata getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SessionMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SessionMetadata build() { + com.google.cloud.sql.v1beta4.SessionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SessionMetadata buildPartial() { + com.google.cloud.sql.v1beta4.SessionMetadata result = + new com.google.cloud.sql.v1beta4.SessionMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SessionMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + supportedFeatures_.makeImmutable(); + result.supportedFeatures_ = supportedFeatures_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SessionMetadata) { + return mergeFrom((com.google.cloud.sql.v1beta4.SessionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SessionMetadata other) { + if (other == com.google.cloud.sql.v1beta4.SessionMetadata.getDefaultInstance()) return this; + if (!other.supportedFeatures_.isEmpty()) { + if (supportedFeatures_.isEmpty()) { + supportedFeatures_ = other.supportedFeatures_; + supportedFeatures_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureSupportedFeaturesIsMutable(); + supportedFeatures_.addAll(other.supportedFeatures_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int tmpRaw = input.readEnum(); + ensureSupportedFeaturesIsMutable(); + supportedFeatures_.addInt(tmpRaw); + break; + } // case 8 + case 10: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureSupportedFeaturesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + supportedFeatures_.addInt(input.readEnum()); + } + input.popLimit(limit); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.IntList supportedFeatures_ = emptyIntList(); + + private void ensureSupportedFeaturesIsMutable() { + if (!supportedFeatures_.isModifiable()) { + supportedFeatures_ = makeMutableCopy(supportedFeatures_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
+     * The features supported by the server for this session. This field is used
+     * by the client to determine which features are available on the server.
+     * The features supported by the server for this session.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @return A list containing the supportedFeatures. + */ + public java.util.List getSupportedFeaturesList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.cloud.sql.v1beta4.SqlDataFeature>( + supportedFeatures_, supportedFeatures_converter_); + } + + /** + * + * + *
+     * The features supported by the server for this session. This field is used
+     * by the client to determine which features are available on the server.
+     * The features supported by the server for this session.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @return The count of supportedFeatures. + */ + public int getSupportedFeaturesCount() { + return supportedFeatures_.size(); + } + + /** + * + * + *
+     * The features supported by the server for this session. This field is used
+     * by the client to determine which features are available on the server.
+     * The features supported by the server for this session.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @param index The index of the element to return. + * @return The supportedFeatures at the given index. + */ + public com.google.cloud.sql.v1beta4.SqlDataFeature getSupportedFeatures(int index) { + return supportedFeatures_converter_.convert(supportedFeatures_.getInt(index)); + } + + /** + * + * + *
+     * The features supported by the server for this session. This field is used
+     * by the client to determine which features are available on the server.
+     * The features supported by the server for this session.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @param index The index to set the value at. + * @param value The supportedFeatures to set. + * @return This builder for chaining. + */ + public Builder setSupportedFeatures( + int index, com.google.cloud.sql.v1beta4.SqlDataFeature value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedFeaturesIsMutable(); + supportedFeatures_.setInt(index, value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+     * The features supported by the server for this session. This field is used
+     * by the client to determine which features are available on the server.
+     * The features supported by the server for this session.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @param value The supportedFeatures to add. + * @return This builder for chaining. + */ + public Builder addSupportedFeatures(com.google.cloud.sql.v1beta4.SqlDataFeature value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedFeaturesIsMutable(); + supportedFeatures_.addInt(value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+     * The features supported by the server for this session. This field is used
+     * by the client to determine which features are available on the server.
+     * The features supported by the server for this session.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @param values The supportedFeatures to add. + * @return This builder for chaining. + */ + public Builder addAllSupportedFeatures( + java.lang.Iterable values) { + ensureSupportedFeaturesIsMutable(); + for (com.google.cloud.sql.v1beta4.SqlDataFeature value : values) { + supportedFeatures_.addInt(value.getNumber()); + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The features supported by the server for this session. This field is used
+     * by the client to determine which features are available on the server.
+     * The features supported by the server for this session.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @return This builder for chaining. + */ + public Builder clearSupportedFeatures() { + supportedFeatures_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The features supported by the server for this session. This field is used
+     * by the client to determine which features are available on the server.
+     * The features supported by the server for this session.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @return A list containing the enum numeric values on the wire for supportedFeatures. + */ + public java.util.List getSupportedFeaturesValueList() { + supportedFeatures_.makeImmutable(); + return supportedFeatures_; + } + + /** + * + * + *
+     * The features supported by the server for this session. This field is used
+     * by the client to determine which features are available on the server.
+     * The features supported by the server for this session.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of supportedFeatures at the given index. + */ + public int getSupportedFeaturesValue(int index) { + return supportedFeatures_.getInt(index); + } + + /** + * + * + *
+     * The features supported by the server for this session. This field is used
+     * by the client to determine which features are available on the server.
+     * The features supported by the server for this session.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for supportedFeatures to set. + * @return This builder for chaining. + */ + public Builder setSupportedFeaturesValue(int index, int value) { + ensureSupportedFeaturesIsMutable(); + supportedFeatures_.setInt(index, value); + onChanged(); + return this; + } + + /** + * + * + *
+     * The features supported by the server for this session. This field is used
+     * by the client to determine which features are available on the server.
+     * The features supported by the server for this session.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @param value The enum numeric value on the wire for supportedFeatures to add. + * @return This builder for chaining. + */ + public Builder addSupportedFeaturesValue(int value) { + ensureSupportedFeaturesIsMutable(); + supportedFeatures_.addInt(value); + onChanged(); + return this; + } + + /** + * + * + *
+     * The features supported by the server for this session. This field is used
+     * by the client to determine which features are available on the server.
+     * The features supported by the server for this session.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @param values The enum numeric values on the wire for supportedFeatures to add. + * @return This builder for chaining. + */ + public Builder addAllSupportedFeaturesValue(java.lang.Iterable values) { + ensureSupportedFeaturesIsMutable(); + for (int value : values) { + supportedFeatures_.addInt(value); + } + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SessionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SessionMetadata) + private static final com.google.cloud.sql.v1beta4.SessionMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SessionMetadata(); + } + + public static com.google.cloud.sql.v1beta4.SessionMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SessionMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SessionMetadataOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SessionMetadataOrBuilder.java new file mode 100644 index 000000000000..5aabb98cd9ad --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SessionMetadataOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SessionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SessionMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The features supported by the server for this session. This field is used
+   * by the client to determine which features are available on the server.
+   * The features supported by the server for this session.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @return A list containing the supportedFeatures. + */ + java.util.List getSupportedFeaturesList(); + + /** + * + * + *
+   * The features supported by the server for this session. This field is used
+   * by the client to determine which features are available on the server.
+   * The features supported by the server for this session.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @return The count of supportedFeatures. + */ + int getSupportedFeaturesCount(); + + /** + * + * + *
+   * The features supported by the server for this session. This field is used
+   * by the client to determine which features are available on the server.
+   * The features supported by the server for this session.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @param index The index of the element to return. + * @return The supportedFeatures at the given index. + */ + com.google.cloud.sql.v1beta4.SqlDataFeature getSupportedFeatures(int index); + + /** + * + * + *
+   * The features supported by the server for this session. This field is used
+   * by the client to determine which features are available on the server.
+   * The features supported by the server for this session.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @return A list containing the enum numeric values on the wire for supportedFeatures. + */ + java.util.List getSupportedFeaturesValueList(); + + /** + * + * + *
+   * The features supported by the server for this session. This field is used
+   * by the client to determine which features are available on the server.
+   * The features supported by the server for this session.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlDataFeature supported_features = 1; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of supportedFeatures at the given index. + */ + int getSupportedFeaturesValue(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Settings.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Settings.java new file mode 100644 index 000000000000..f123afdc8f41 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Settings.java @@ -0,0 +1,14120 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database instance settings.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Settings} + */ +@com.google.protobuf.Generated +public final class Settings extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.Settings) + SettingsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Settings"); + } + + // Use Settings.newBuilder() to construct. + private Settings(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Settings() { + authorizedGaeApplications_ = com.google.protobuf.LazyStringArrayList.emptyList(); + tier_ = ""; + kind_ = ""; + availabilityType_ = 0; + pricingPlan_ = 0; + replicationType_ = 0; + activationPolicy_ = 0; + databaseFlags_ = java.util.Collections.emptyList(); + dataDiskType_ = 0; + collation_ = ""; + denyMaintenancePeriods_ = java.util.Collections.emptyList(); + edition_ = 0; + connectorEnforcement_ = 0; + timeZone_ = ""; + dataApiAccess_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Settings_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Settings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Settings.class, + com.google.cloud.sql.v1beta4.Settings.Builder.class); + } + + /** + * + * + *
+   * Specifies when the instance is activated.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.Settings.SqlActivationPolicy} + */ + public enum SqlActivationPolicy implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown activation plan.
+     * 
+ * + * SQL_ACTIVATION_POLICY_UNSPECIFIED = 0; + */ + SQL_ACTIVATION_POLICY_UNSPECIFIED(0), + /** + * + * + *
+     * The instance is always up and running.
+     * 
+ * + * ALWAYS = 1; + */ + ALWAYS(1), + /** + * + * + *
+     * The instance never starts.
+     * 
+ * + * NEVER = 2; + */ + NEVER(2), + /** + * + * + *
+     * The instance starts upon receiving requests.
+     * 
+ * + * ON_DEMAND = 3 [deprecated = true]; + */ + @java.lang.Deprecated + ON_DEMAND(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlActivationPolicy"); + } + + /** + * + * + *
+     * Unknown activation plan.
+     * 
+ * + * SQL_ACTIVATION_POLICY_UNSPECIFIED = 0; + */ + public static final int SQL_ACTIVATION_POLICY_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The instance is always up and running.
+     * 
+ * + * ALWAYS = 1; + */ + public static final int ALWAYS_VALUE = 1; + + /** + * + * + *
+     * The instance never starts.
+     * 
+ * + * NEVER = 2; + */ + public static final int NEVER_VALUE = 2; + + /** + * + * + *
+     * The instance starts upon receiving requests.
+     * 
+ * + * ON_DEMAND = 3 [deprecated = true]; + */ + @java.lang.Deprecated public static final int ON_DEMAND_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 SqlActivationPolicy 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 SqlActivationPolicy forNumber(int value) { + switch (value) { + case 0: + return SQL_ACTIVATION_POLICY_UNSPECIFIED; + case 1: + return ALWAYS; + case 2: + return NEVER; + case 3: + return ON_DEMAND; + 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 SqlActivationPolicy findValueByNumber(int number) { + return SqlActivationPolicy.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.Settings.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlActivationPolicy[] VALUES = values(); + + public static SqlActivationPolicy 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 SqlActivationPolicy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.Settings.SqlActivationPolicy) + } + + /** + * + * + *
+   * The list of Cloud SQL editions available to users.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.Settings.Edition} + */ + public enum Edition implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The instance did not specify the edition.
+     * 
+ * + * EDITION_UNSPECIFIED = 0; + */ + EDITION_UNSPECIFIED(0), + /** + * + * + *
+     * The instance is an enterprise edition.
+     * 
+ * + * ENTERPRISE = 2; + */ + ENTERPRISE(2), + /** + * + * + *
+     * The instance is an Enterprise Plus edition.
+     * 
+ * + * ENTERPRISE_PLUS = 3; + */ + ENTERPRISE_PLUS(3), + /** + * + * + *
+     * This instance is a Cloud SQL developer edition instance.
+     * 
+ * + * DEVELOPER = 5; + */ + DEVELOPER(5), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Edition"); + } + + /** + * + * + *
+     * The instance did not specify the edition.
+     * 
+ * + * EDITION_UNSPECIFIED = 0; + */ + public static final int EDITION_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The instance is an enterprise edition.
+     * 
+ * + * ENTERPRISE = 2; + */ + public static final int ENTERPRISE_VALUE = 2; + + /** + * + * + *
+     * The instance is an Enterprise Plus edition.
+     * 
+ * + * ENTERPRISE_PLUS = 3; + */ + public static final int ENTERPRISE_PLUS_VALUE = 3; + + /** + * + * + *
+     * This instance is a Cloud SQL developer edition instance.
+     * 
+ * + * DEVELOPER = 5; + */ + public static final int DEVELOPER_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Edition 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 Edition forNumber(int value) { + switch (value) { + case 0: + return EDITION_UNSPECIFIED; + case 2: + return ENTERPRISE; + case 3: + return ENTERPRISE_PLUS; + case 5: + return DEVELOPER; + 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 Edition findValueByNumber(int number) { + return Edition.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.Settings.getDescriptor().getEnumTypes().get(1); + } + + private static final Edition[] VALUES = values(); + + public static Edition 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 Edition(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.Settings.Edition) + } + + /** + * + * + *
+   * The options for enforcing Cloud SQL connectors in the instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.Settings.ConnectorEnforcement} + */ + public enum ConnectorEnforcement implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The requirement for Cloud SQL connectors is unknown.
+     * 
+ * + * CONNECTOR_ENFORCEMENT_UNSPECIFIED = 0; + */ + CONNECTOR_ENFORCEMENT_UNSPECIFIED(0), + /** + * + * + *
+     * Do not require Cloud SQL connectors.
+     * 
+ * + * NOT_REQUIRED = 1; + */ + NOT_REQUIRED(1), + /** + * + * + *
+     * Require all connections to use Cloud SQL connectors, including the
+     * Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
+     * Note: This disables all existing authorized networks.
+     * 
+ * + * REQUIRED = 2; + */ + REQUIRED(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ConnectorEnforcement"); + } + + /** + * + * + *
+     * The requirement for Cloud SQL connectors is unknown.
+     * 
+ * + * CONNECTOR_ENFORCEMENT_UNSPECIFIED = 0; + */ + public static final int CONNECTOR_ENFORCEMENT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Do not require Cloud SQL connectors.
+     * 
+ * + * NOT_REQUIRED = 1; + */ + public static final int NOT_REQUIRED_VALUE = 1; + + /** + * + * + *
+     * Require all connections to use Cloud SQL connectors, including the
+     * Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
+     * Note: This disables all existing authorized networks.
+     * 
+ * + * REQUIRED = 2; + */ + public static final int REQUIRED_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 ConnectorEnforcement 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 ConnectorEnforcement forNumber(int value) { + switch (value) { + case 0: + return CONNECTOR_ENFORCEMENT_UNSPECIFIED; + case 1: + return NOT_REQUIRED; + case 2: + return REQUIRED; + 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 ConnectorEnforcement findValueByNumber(int number) { + return ConnectorEnforcement.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.Settings.getDescriptor().getEnumTypes().get(2); + } + + private static final ConnectorEnforcement[] VALUES = values(); + + public static ConnectorEnforcement 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 ConnectorEnforcement(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.Settings.ConnectorEnforcement) + } + + /** + * + * + *
+   * ExecuteSql API's access to the instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.Settings.DataApiAccess} + */ + public enum DataApiAccess implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified, effectively the same as `DISALLOW_DATA_API`.
+     * 
+ * + * DATA_API_ACCESS_UNSPECIFIED = 0; + */ + DATA_API_ACCESS_UNSPECIFIED(0), + /** + * + * + *
+     * Disallow using ExecuteSql API to connect to the instance.
+     * 
+ * + * DISALLOW_DATA_API = 1; + */ + DISALLOW_DATA_API(1), + /** + * + * + *
+     * Allow using ExecuteSql API to connect to the instance. For private IP
+     * instances, this allows authorized users to access the instance from
+     * the public internet using ExecuteSql API.
+     * 
+ * + * ALLOW_DATA_API = 2; + */ + ALLOW_DATA_API(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DataApiAccess"); + } + + /** + * + * + *
+     * Unspecified, effectively the same as `DISALLOW_DATA_API`.
+     * 
+ * + * DATA_API_ACCESS_UNSPECIFIED = 0; + */ + public static final int DATA_API_ACCESS_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Disallow using ExecuteSql API to connect to the instance.
+     * 
+ * + * DISALLOW_DATA_API = 1; + */ + public static final int DISALLOW_DATA_API_VALUE = 1; + + /** + * + * + *
+     * Allow using ExecuteSql API to connect to the instance. For private IP
+     * instances, this allows authorized users to access the instance from
+     * the public internet using ExecuteSql API.
+     * 
+ * + * ALLOW_DATA_API = 2; + */ + public static final int ALLOW_DATA_API_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 DataApiAccess 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 DataApiAccess forNumber(int value) { + switch (value) { + case 0: + return DATA_API_ACCESS_UNSPECIFIED; + case 1: + return DISALLOW_DATA_API; + case 2: + return ALLOW_DATA_API; + 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 DataApiAccess findValueByNumber(int number) { + return DataApiAccess.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.Settings.getDescriptor().getEnumTypes().get(3); + } + + private static final DataApiAccess[] VALUES = values(); + + public static DataApiAccess 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 DataApiAccess(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.Settings.DataApiAccess) + } + + private int bitField0_; + public static final int SETTINGS_VERSION_FIELD_NUMBER = 1; + private com.google.protobuf.Int64Value settingsVersion_; + + /** + * + * + *
+   * The version of instance settings. This is a required field for update
+   * method to make sure concurrent updates are handled properly. During update,
+   * use the most recent settingsVersion value for this instance and do not try
+   * to update this value.
+   * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + * + * @return Whether the settingsVersion field is set. + */ + @java.lang.Override + public boolean hasSettingsVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The version of instance settings. This is a required field for update
+   * method to make sure concurrent updates are handled properly. During update,
+   * use the most recent settingsVersion value for this instance and do not try
+   * to update this value.
+   * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + * + * @return The settingsVersion. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getSettingsVersion() { + return settingsVersion_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : settingsVersion_; + } + + /** + * + * + *
+   * The version of instance settings. This is a required field for update
+   * method to make sure concurrent updates are handled properly. During update,
+   * use the most recent settingsVersion value for this instance and do not try
+   * to update this value.
+   * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getSettingsVersionOrBuilder() { + return settingsVersion_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : settingsVersion_; + } + + public static final int AUTHORIZED_GAE_APPLICATIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList authorizedGaeApplications_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @return A list containing the authorizedGaeApplications. + */ + @java.lang.Deprecated + public com.google.protobuf.ProtocolStringList getAuthorizedGaeApplicationsList() { + return authorizedGaeApplications_; + } + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @return The count of authorizedGaeApplications. + */ + @java.lang.Deprecated + public int getAuthorizedGaeApplicationsCount() { + return authorizedGaeApplications_.size(); + } + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @param index The index of the element to return. + * @return The authorizedGaeApplications at the given index. + */ + @java.lang.Deprecated + public java.lang.String getAuthorizedGaeApplications(int index) { + return authorizedGaeApplications_.get(index); + } + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @param index The index of the value to return. + * @return The bytes of the authorizedGaeApplications at the given index. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getAuthorizedGaeApplicationsBytes(int index) { + return authorizedGaeApplications_.getByteString(index); + } + + public static final int TIER_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object tier_ = ""; + + /** + * + * + *
+   * The tier (or machine type) for this instance, for example
+   * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+   * 
+ * + * string tier = 3; + * + * @return The tier. + */ + @java.lang.Override + public java.lang.String getTier() { + java.lang.Object ref = tier_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tier_ = s; + return s; + } + } + + /** + * + * + *
+   * The tier (or machine type) for this instance, for example
+   * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+   * 
+ * + * string tier = 3; + * + * @return The bytes for tier. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTierBytes() { + java.lang.Object ref = tier_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#settings`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#settings`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_LABELS_FIELD_NUMBER = 5; + + private static final class UserLabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Settings_UserLabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField userLabels_; + + private com.google.protobuf.MapField internalGetUserLabels() { + if (userLabels_ == null) { + return com.google.protobuf.MapField.emptyMapField(UserLabelsDefaultEntryHolder.defaultEntry); + } + return userLabels_; + } + + public int getUserLabelsCount() { + return internalGetUserLabels().getMap().size(); + } + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); + } + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); + } + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int AVAILABILITY_TYPE_FIELD_NUMBER = 6; + private int availabilityType_ = 0; + + /** + * + * + *
+   * Availability type. Potential values:
+   * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+   * zone affect data accessibility.
+   * *  `REGIONAL`: The instance can serve data from more than one zone in a
+   * region (it is highly available)./
+   *
+   * For more information, see [Overview of the High Availability
+   * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlAvailabilityType availability_type = 6; + * + * @return The enum numeric value on the wire for availabilityType. + */ + @java.lang.Override + public int getAvailabilityTypeValue() { + return availabilityType_; + } + + /** + * + * + *
+   * Availability type. Potential values:
+   * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+   * zone affect data accessibility.
+   * *  `REGIONAL`: The instance can serve data from more than one zone in a
+   * region (it is highly available)./
+   *
+   * For more information, see [Overview of the High Availability
+   * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlAvailabilityType availability_type = 6; + * + * @return The availabilityType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlAvailabilityType getAvailabilityType() { + com.google.cloud.sql.v1beta4.SqlAvailabilityType result = + com.google.cloud.sql.v1beta4.SqlAvailabilityType.forNumber(availabilityType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlAvailabilityType.UNRECOGNIZED : result; + } + + public static final int PRICING_PLAN_FIELD_NUMBER = 7; + private int pricingPlan_ = 0; + + /** + * + * + *
+   * The pricing plan for this instance. This can be either `PER_USE` or
+   * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlPricingPlan pricing_plan = 7; + * + * @return The enum numeric value on the wire for pricingPlan. + */ + @java.lang.Override + public int getPricingPlanValue() { + return pricingPlan_; + } + + /** + * + * + *
+   * The pricing plan for this instance. This can be either `PER_USE` or
+   * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlPricingPlan pricing_plan = 7; + * + * @return The pricingPlan. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlPricingPlan getPricingPlan() { + com.google.cloud.sql.v1beta4.SqlPricingPlan result = + com.google.cloud.sql.v1beta4.SqlPricingPlan.forNumber(pricingPlan_); + return result == null ? com.google.cloud.sql.v1beta4.SqlPricingPlan.UNRECOGNIZED : result; + } + + public static final int REPLICATION_TYPE_FIELD_NUMBER = 8; + private int replicationType_ = 0; + + /** + * + * + *
+   * The type of replication this instance uses. This can be either
+   * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+   * applicable to First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.replication_type is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3282 + * @return The enum numeric value on the wire for replicationType. + */ + @java.lang.Override + @java.lang.Deprecated + public int getReplicationTypeValue() { + return replicationType_; + } + + /** + * + * + *
+   * The type of replication this instance uses. This can be either
+   * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+   * applicable to First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.replication_type is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3282 + * @return The replicationType. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.sql.v1beta4.SqlReplicationType getReplicationType() { + com.google.cloud.sql.v1beta4.SqlReplicationType result = + com.google.cloud.sql.v1beta4.SqlReplicationType.forNumber(replicationType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlReplicationType.UNRECOGNIZED : result; + } + + public static final int STORAGE_AUTO_RESIZE_LIMIT_FIELD_NUMBER = 9; + private com.google.protobuf.Int64Value storageAutoResizeLimit_; + + /** + * + * + *
+   * The maximum size to which storage capacity can be automatically increased.
+   * The default value is 0, which specifies that there is no limit.
+   * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + * + * @return Whether the storageAutoResizeLimit field is set. + */ + @java.lang.Override + public boolean hasStorageAutoResizeLimit() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The maximum size to which storage capacity can be automatically increased.
+   * The default value is 0, which specifies that there is no limit.
+   * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + * + * @return The storageAutoResizeLimit. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getStorageAutoResizeLimit() { + return storageAutoResizeLimit_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : storageAutoResizeLimit_; + } + + /** + * + * + *
+   * The maximum size to which storage capacity can be automatically increased.
+   * The default value is 0, which specifies that there is no limit.
+   * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getStorageAutoResizeLimitOrBuilder() { + return storageAutoResizeLimit_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : storageAutoResizeLimit_; + } + + public static final int ACTIVATION_POLICY_FIELD_NUMBER = 10; + private int activationPolicy_ = 0; + + /** + * + * + *
+   * The activation policy specifies when the instance is activated; it is
+   * applicable only when the instance state is RUNNABLE. Valid values:
+   * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+   * connection requests.
+   * *  `NEVER`: The instance is off; it is not activated, even if a
+   * connection request arrives.
+   * 
+ * + * .google.cloud.sql.v1beta4.Settings.SqlActivationPolicy activation_policy = 10; + * + * @return The enum numeric value on the wire for activationPolicy. + */ + @java.lang.Override + public int getActivationPolicyValue() { + return activationPolicy_; + } + + /** + * + * + *
+   * The activation policy specifies when the instance is activated; it is
+   * applicable only when the instance state is RUNNABLE. Valid values:
+   * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+   * connection requests.
+   * *  `NEVER`: The instance is off; it is not activated, even if a
+   * connection request arrives.
+   * 
+ * + * .google.cloud.sql.v1beta4.Settings.SqlActivationPolicy activation_policy = 10; + * + * @return The activationPolicy. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy getActivationPolicy() { + com.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy result = + com.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy.forNumber(activationPolicy_); + return result == null + ? com.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy.UNRECOGNIZED + : result; + } + + public static final int IP_CONFIGURATION_FIELD_NUMBER = 11; + private com.google.cloud.sql.v1beta4.IpConfiguration ipConfiguration_; + + /** + * + * + *
+   * The settings for IP Management. This allows to enable or disable the
+   * instance IP and manage which external networks can connect to the instance.
+   * The IPv4 address cannot be disabled for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + * + * @return Whether the ipConfiguration field is set. + */ + @java.lang.Override + public boolean hasIpConfiguration() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The settings for IP Management. This allows to enable or disable the
+   * instance IP and manage which external networks can connect to the instance.
+   * The IPv4 address cannot be disabled for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + * + * @return The ipConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpConfiguration getIpConfiguration() { + return ipConfiguration_ == null + ? com.google.cloud.sql.v1beta4.IpConfiguration.getDefaultInstance() + : ipConfiguration_; + } + + /** + * + * + *
+   * The settings for IP Management. This allows to enable or disable the
+   * instance IP and manage which external networks can connect to the instance.
+   * The IPv4 address cannot be disabled for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.IpConfigurationOrBuilder getIpConfigurationOrBuilder() { + return ipConfiguration_ == null + ? com.google.cloud.sql.v1beta4.IpConfiguration.getDefaultInstance() + : ipConfiguration_; + } + + public static final int STORAGE_AUTO_RESIZE_FIELD_NUMBER = 12; + private com.google.protobuf.BoolValue storageAutoResize_; + + /** + * + * + *
+   * Configuration to increase storage size automatically. The default value is
+   * true.
+   * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + * + * @return Whether the storageAutoResize field is set. + */ + @java.lang.Override + public boolean hasStorageAutoResize() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Configuration to increase storage size automatically. The default value is
+   * true.
+   * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + * + * @return The storageAutoResize. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getStorageAutoResize() { + return storageAutoResize_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : storageAutoResize_; + } + + /** + * + * + *
+   * Configuration to increase storage size automatically. The default value is
+   * true.
+   * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getStorageAutoResizeOrBuilder() { + return storageAutoResize_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : storageAutoResize_; + } + + public static final int LOCATION_PREFERENCE_FIELD_NUMBER = 13; + private com.google.cloud.sql.v1beta4.LocationPreference locationPreference_; + + /** + * + * + *
+   * The location preference settings. This allows the instance to be located as
+   * near as possible to either an App Engine app or Compute Engine zone for
+   * better performance. App Engine co-location was only applicable to First
+   * Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + * + * @return Whether the locationPreference field is set. + */ + @java.lang.Override + public boolean hasLocationPreference() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * The location preference settings. This allows the instance to be located as
+   * near as possible to either an App Engine app or Compute Engine zone for
+   * better performance. App Engine co-location was only applicable to First
+   * Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + * + * @return The locationPreference. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.LocationPreference getLocationPreference() { + return locationPreference_ == null + ? com.google.cloud.sql.v1beta4.LocationPreference.getDefaultInstance() + : locationPreference_; + } + + /** + * + * + *
+   * The location preference settings. This allows the instance to be located as
+   * near as possible to either an App Engine app or Compute Engine zone for
+   * better performance. App Engine co-location was only applicable to First
+   * Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.LocationPreferenceOrBuilder getLocationPreferenceOrBuilder() { + return locationPreference_ == null + ? com.google.cloud.sql.v1beta4.LocationPreference.getDefaultInstance() + : locationPreference_; + } + + public static final int DATABASE_FLAGS_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private java.util.List databaseFlags_; + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + @java.lang.Override + public java.util.List getDatabaseFlagsList() { + return databaseFlags_; + } + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + @java.lang.Override + public java.util.List + getDatabaseFlagsOrBuilderList() { + return databaseFlags_; + } + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + @java.lang.Override + public int getDatabaseFlagsCount() { + return databaseFlags_.size(); + } + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseFlags getDatabaseFlags(int index) { + return databaseFlags_.get(index); + } + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseFlagsOrBuilder getDatabaseFlagsOrBuilder(int index) { + return databaseFlags_.get(index); + } + + public static final int DATA_DISK_TYPE_FIELD_NUMBER = 15; + private int dataDiskType_ = 0; + + /** + * + * + *
+   * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+   * First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlDataDiskType data_disk_type = 15; + * + * @return The enum numeric value on the wire for dataDiskType. + */ + @java.lang.Override + public int getDataDiskTypeValue() { + return dataDiskType_; + } + + /** + * + * + *
+   * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+   * First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlDataDiskType data_disk_type = 15; + * + * @return The dataDiskType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDataDiskType getDataDiskType() { + com.google.cloud.sql.v1beta4.SqlDataDiskType result = + com.google.cloud.sql.v1beta4.SqlDataDiskType.forNumber(dataDiskType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlDataDiskType.UNRECOGNIZED : result; + } + + public static final int MAINTENANCE_WINDOW_FIELD_NUMBER = 16; + private com.google.cloud.sql.v1beta4.MaintenanceWindow maintenanceWindow_; + + /** + * + * + *
+   * The maintenance window for this instance. This specifies when the instance
+   * can be restarted for maintenance purposes.
+   * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + * + * @return Whether the maintenanceWindow field is set. + */ + @java.lang.Override + public boolean hasMaintenanceWindow() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * The maintenance window for this instance. This specifies when the instance
+   * can be restarted for maintenance purposes.
+   * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + * + * @return The maintenanceWindow. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.MaintenanceWindow getMaintenanceWindow() { + return maintenanceWindow_ == null + ? com.google.cloud.sql.v1beta4.MaintenanceWindow.getDefaultInstance() + : maintenanceWindow_; + } + + /** + * + * + *
+   * The maintenance window for this instance. This specifies when the instance
+   * can be restarted for maintenance purposes.
+   * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.MaintenanceWindowOrBuilder getMaintenanceWindowOrBuilder() { + return maintenanceWindow_ == null + ? com.google.cloud.sql.v1beta4.MaintenanceWindow.getDefaultInstance() + : maintenanceWindow_; + } + + public static final int BACKUP_CONFIGURATION_FIELD_NUMBER = 17; + private com.google.cloud.sql.v1beta4.BackupConfiguration backupConfiguration_; + + /** + * + * + *
+   * The daily backup configuration for the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + * + * @return Whether the backupConfiguration field is set. + */ + @java.lang.Override + public boolean hasBackupConfiguration() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * The daily backup configuration for the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + * + * @return The backupConfiguration. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupConfiguration getBackupConfiguration() { + return backupConfiguration_ == null + ? com.google.cloud.sql.v1beta4.BackupConfiguration.getDefaultInstance() + : backupConfiguration_; + } + + /** + * + * + *
+   * The daily backup configuration for the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupConfigurationOrBuilder + getBackupConfigurationOrBuilder() { + return backupConfiguration_ == null + ? com.google.cloud.sql.v1beta4.BackupConfiguration.getDefaultInstance() + : backupConfiguration_; + } + + public static final int DATABASE_REPLICATION_ENABLED_FIELD_NUMBER = 18; + private com.google.protobuf.BoolValue databaseReplicationEnabled_; + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * replication is enabled or not. WARNING: Changing this restarts the
+   * instance.
+   * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + * + * @return Whether the databaseReplicationEnabled field is set. + */ + @java.lang.Override + public boolean hasDatabaseReplicationEnabled() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * replication is enabled or not. WARNING: Changing this restarts the
+   * instance.
+   * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + * + * @return The databaseReplicationEnabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getDatabaseReplicationEnabled() { + return databaseReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : databaseReplicationEnabled_; + } + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * replication is enabled or not. WARNING: Changing this restarts the
+   * instance.
+   * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getDatabaseReplicationEnabledOrBuilder() { + return databaseReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : databaseReplicationEnabled_; + } + + public static final int CRASH_SAFE_REPLICATION_ENABLED_FIELD_NUMBER = 19; + private com.google.protobuf.BoolValue crashSafeReplicationEnabled_; + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * database flags for crash-safe replication are enabled. This property was
+   * only applicable to First Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.crash_safe_replication_enabled is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3333 + * @return Whether the crashSafeReplicationEnabled field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasCrashSafeReplicationEnabled() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * database flags for crash-safe replication are enabled. This property was
+   * only applicable to First Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.crash_safe_replication_enabled is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3333 + * @return The crashSafeReplicationEnabled. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.BoolValue getCrashSafeReplicationEnabled() { + return crashSafeReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : crashSafeReplicationEnabled_; + } + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * database flags for crash-safe replication are enabled. This property was
+   * only applicable to First Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.BoolValueOrBuilder getCrashSafeReplicationEnabledOrBuilder() { + return crashSafeReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : crashSafeReplicationEnabled_; + } + + public static final int DATA_DISK_SIZE_GB_FIELD_NUMBER = 20; + private com.google.protobuf.Int64Value dataDiskSizeGb_; + + /** + * + * + *
+   * The size of data disk, in GB. The data disk size minimum is 10GB.
+   * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + * + * @return Whether the dataDiskSizeGb field is set. + */ + @java.lang.Override + public boolean hasDataDiskSizeGb() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+   * The size of data disk, in GB. The data disk size minimum is 10GB.
+   * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + * + * @return The dataDiskSizeGb. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getDataDiskSizeGb() { + return dataDiskSizeGb_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : dataDiskSizeGb_; + } + + /** + * + * + *
+   * The size of data disk, in GB. The data disk size minimum is 10GB.
+   * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getDataDiskSizeGbOrBuilder() { + return dataDiskSizeGb_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : dataDiskSizeGb_; + } + + public static final int ACTIVE_DIRECTORY_CONFIG_FIELD_NUMBER = 22; + private com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig activeDirectoryConfig_; + + /** + * + * + *
+   * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + * + * @return Whether the activeDirectoryConfig field is set. + */ + @java.lang.Override + public boolean hasActiveDirectoryConfig() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+   * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + * + * @return The activeDirectoryConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig getActiveDirectoryConfig() { + return activeDirectoryConfig_ == null + ? com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.getDefaultInstance() + : activeDirectoryConfig_; + } + + /** + * + * + *
+   * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfigOrBuilder + getActiveDirectoryConfigOrBuilder() { + return activeDirectoryConfig_ == null + ? com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.getDefaultInstance() + : activeDirectoryConfig_; + } + + public static final int COLLATION_FIELD_NUMBER = 23; + + @SuppressWarnings("serial") + private volatile java.lang.Object collation_ = ""; + + /** + * + * + *
+   * The name of server Instance collation.
+   * 
+ * + * string collation = 23; + * + * @return The collation. + */ + @java.lang.Override + public java.lang.String getCollation() { + java.lang.Object ref = collation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collation_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of server Instance collation.
+   * 
+ * + * string collation = 23; + * + * @return The bytes for collation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCollationBytes() { + java.lang.Object ref = collation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DENY_MAINTENANCE_PERIODS_FIELD_NUMBER = 24; + + @SuppressWarnings("serial") + private java.util.List + denyMaintenancePeriods_; + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + @java.lang.Override + public java.util.List + getDenyMaintenancePeriodsList() { + return denyMaintenancePeriods_; + } + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + @java.lang.Override + public java.util.List + getDenyMaintenancePeriodsOrBuilderList() { + return denyMaintenancePeriods_; + } + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + @java.lang.Override + public int getDenyMaintenancePeriodsCount() { + return denyMaintenancePeriods_.size(); + } + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DenyMaintenancePeriod getDenyMaintenancePeriods(int index) { + return denyMaintenancePeriods_.get(index); + } + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DenyMaintenancePeriodOrBuilder + getDenyMaintenancePeriodsOrBuilder(int index) { + return denyMaintenancePeriods_.get(index); + } + + public static final int INSIGHTS_CONFIG_FIELD_NUMBER = 25; + private com.google.cloud.sql.v1beta4.InsightsConfig insightsConfig_; + + /** + * + * + *
+   * Insights configuration, for now relevant only for Postgres.
+   * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + * + * @return Whether the insightsConfig field is set. + */ + @java.lang.Override + public boolean hasInsightsConfig() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+   * Insights configuration, for now relevant only for Postgres.
+   * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + * + * @return The insightsConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InsightsConfig getInsightsConfig() { + return insightsConfig_ == null + ? com.google.cloud.sql.v1beta4.InsightsConfig.getDefaultInstance() + : insightsConfig_; + } + + /** + * + * + *
+   * Insights configuration, for now relevant only for Postgres.
+   * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InsightsConfigOrBuilder getInsightsConfigOrBuilder() { + return insightsConfig_ == null + ? com.google.cloud.sql.v1beta4.InsightsConfig.getDefaultInstance() + : insightsConfig_; + } + + public static final int PASSWORD_VALIDATION_POLICY_FIELD_NUMBER = 27; + private com.google.cloud.sql.v1beta4.PasswordValidationPolicy passwordValidationPolicy_; + + /** + * + * + *
+   * The local user password validation policy of the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + * + * @return Whether the passwordValidationPolicy field is set. + */ + @java.lang.Override + public boolean hasPasswordValidationPolicy() { + return ((bitField0_ & 0x00001000) != 0); + } + + /** + * + * + *
+   * The local user password validation policy of the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + * + * @return The passwordValidationPolicy. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PasswordValidationPolicy getPasswordValidationPolicy() { + return passwordValidationPolicy_ == null + ? com.google.cloud.sql.v1beta4.PasswordValidationPolicy.getDefaultInstance() + : passwordValidationPolicy_; + } + + /** + * + * + *
+   * The local user password validation policy of the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PasswordValidationPolicyOrBuilder + getPasswordValidationPolicyOrBuilder() { + return passwordValidationPolicy_ == null + ? com.google.cloud.sql.v1beta4.PasswordValidationPolicy.getDefaultInstance() + : passwordValidationPolicy_; + } + + public static final int SQL_SERVER_AUDIT_CONFIG_FIELD_NUMBER = 29; + private com.google.cloud.sql.v1beta4.SqlServerAuditConfig sqlServerAuditConfig_; + + /** + * + * + *
+   * SQL Server specific audit configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + * + * @return Whether the sqlServerAuditConfig field is set. + */ + @java.lang.Override + public boolean hasSqlServerAuditConfig() { + return ((bitField0_ & 0x00002000) != 0); + } + + /** + * + * + *
+   * SQL Server specific audit configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + * + * @return The sqlServerAuditConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerAuditConfig getSqlServerAuditConfig() { + return sqlServerAuditConfig_ == null + ? com.google.cloud.sql.v1beta4.SqlServerAuditConfig.getDefaultInstance() + : sqlServerAuditConfig_; + } + + /** + * + * + *
+   * SQL Server specific audit configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerAuditConfigOrBuilder + getSqlServerAuditConfigOrBuilder() { + return sqlServerAuditConfig_ == null + ? com.google.cloud.sql.v1beta4.SqlServerAuditConfig.getDefaultInstance() + : sqlServerAuditConfig_; + } + + public static final int EDITION_FIELD_NUMBER = 38; + private int edition_ = 0; + + /** + * + * + *
+   * Optional. The edition type of the Cloud SQL instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for edition. + */ + @java.lang.Override + public int getEditionValue() { + return edition_; + } + + /** + * + * + *
+   * Optional. The edition type of the Cloud SQL instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The edition. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Settings.Edition getEdition() { + com.google.cloud.sql.v1beta4.Settings.Edition result = + com.google.cloud.sql.v1beta4.Settings.Edition.forNumber(edition_); + return result == null ? com.google.cloud.sql.v1beta4.Settings.Edition.UNRECOGNIZED : result; + } + + public static final int CONNECTOR_ENFORCEMENT_FIELD_NUMBER = 32; + private int connectorEnforcement_ = 0; + + /** + * + * + *
+   * Specifies if connections must use Cloud SQL connectors.
+   * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+   * can be connected without Cloud SQL
+   * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+   * Connectors)
+   *
+   * Note that using REQUIRED disables all existing authorized networks. If
+   * this field is not specified when creating a new instance, NOT_REQUIRED is
+   * used. If this field is not specified when patching or updating an existing
+   * instance, it is left unchanged in the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * + * @return The enum numeric value on the wire for connectorEnforcement. + */ + @java.lang.Override + public int getConnectorEnforcementValue() { + return connectorEnforcement_; + } + + /** + * + * + *
+   * Specifies if connections must use Cloud SQL connectors.
+   * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+   * can be connected without Cloud SQL
+   * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+   * Connectors)
+   *
+   * Note that using REQUIRED disables all existing authorized networks. If
+   * this field is not specified when creating a new instance, NOT_REQUIRED is
+   * used. If this field is not specified when patching or updating an existing
+   * instance, it is left unchanged in the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * + * @return The connectorEnforcement. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Settings.ConnectorEnforcement getConnectorEnforcement() { + com.google.cloud.sql.v1beta4.Settings.ConnectorEnforcement result = + com.google.cloud.sql.v1beta4.Settings.ConnectorEnforcement.forNumber(connectorEnforcement_); + return result == null + ? com.google.cloud.sql.v1beta4.Settings.ConnectorEnforcement.UNRECOGNIZED + : result; + } + + public static final int DELETION_PROTECTION_ENABLED_FIELD_NUMBER = 33; + private com.google.protobuf.BoolValue deletionProtectionEnabled_; + + /** + * + * + *
+   * Configuration to protect against accidental instance deletion.
+   * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + * + * @return Whether the deletionProtectionEnabled field is set. + */ + @java.lang.Override + public boolean hasDeletionProtectionEnabled() { + return ((bitField0_ & 0x00004000) != 0); + } + + /** + * + * + *
+   * Configuration to protect against accidental instance deletion.
+   * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + * + * @return The deletionProtectionEnabled. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getDeletionProtectionEnabled() { + return deletionProtectionEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : deletionProtectionEnabled_; + } + + /** + * + * + *
+   * Configuration to protect against accidental instance deletion.
+   * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getDeletionProtectionEnabledOrBuilder() { + return deletionProtectionEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : deletionProtectionEnabled_; + } + + public static final int TIME_ZONE_FIELD_NUMBER = 34; + + @SuppressWarnings("serial") + private volatile java.lang.Object timeZone_ = ""; + + /** + * + * + *
+   * Server timezone, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * string time_zone = 34; + * + * @return The timeZone. + */ + @java.lang.Override + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } + } + + /** + * + * + *
+   * Server timezone, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * string time_zone = 34; + * + * @return The bytes for timeZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ADVANCED_MACHINE_FEATURES_FIELD_NUMBER = 35; + private com.google.cloud.sql.v1beta4.AdvancedMachineFeatures advancedMachineFeatures_; + + /** + * + * + *
+   * Specifies advanced machine configuration for the instances relevant only
+   * for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + * + * @return Whether the advancedMachineFeatures field is set. + */ + @java.lang.Override + public boolean hasAdvancedMachineFeatures() { + return ((bitField0_ & 0x00008000) != 0); + } + + /** + * + * + *
+   * Specifies advanced machine configuration for the instances relevant only
+   * for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + * + * @return The advancedMachineFeatures. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AdvancedMachineFeatures getAdvancedMachineFeatures() { + return advancedMachineFeatures_ == null + ? com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.getDefaultInstance() + : advancedMachineFeatures_; + } + + /** + * + * + *
+   * Specifies advanced machine configuration for the instances relevant only
+   * for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AdvancedMachineFeaturesOrBuilder + getAdvancedMachineFeaturesOrBuilder() { + return advancedMachineFeatures_ == null + ? com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.getDefaultInstance() + : advancedMachineFeatures_; + } + + public static final int DATA_CACHE_CONFIG_FIELD_NUMBER = 37; + private com.google.cloud.sql.v1beta4.DataCacheConfig dataCacheConfig_; + + /** + * + * + *
+   * Configuration for data cache.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + * + * @return Whether the dataCacheConfig field is set. + */ + @java.lang.Override + public boolean hasDataCacheConfig() { + return ((bitField0_ & 0x00010000) != 0); + } + + /** + * + * + *
+   * Configuration for data cache.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + * + * @return The dataCacheConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataCacheConfig getDataCacheConfig() { + return dataCacheConfig_ == null + ? com.google.cloud.sql.v1beta4.DataCacheConfig.getDefaultInstance() + : dataCacheConfig_; + } + + /** + * + * + *
+   * Configuration for data cache.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataCacheConfigOrBuilder getDataCacheConfigOrBuilder() { + return dataCacheConfig_ == null + ? com.google.cloud.sql.v1beta4.DataCacheConfig.getDefaultInstance() + : dataCacheConfig_; + } + + public static final int REPLICATION_LAG_MAX_SECONDS_FIELD_NUMBER = 39; + private com.google.protobuf.Int32Value replicationLagMaxSeconds_; + + /** + * + * + *
+   * Optional. Configuration value for recreation of replica after certain
+   * replication lag.
+   * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the replicationLagMaxSeconds field is set. + */ + @java.lang.Override + public boolean hasReplicationLagMaxSeconds() { + return ((bitField0_ & 0x00020000) != 0); + } + + /** + * + * + *
+   * Optional. Configuration value for recreation of replica after certain
+   * replication lag.
+   * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The replicationLagMaxSeconds. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getReplicationLagMaxSeconds() { + return replicationLagMaxSeconds_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : replicationLagMaxSeconds_; + } + + /** + * + * + *
+   * Optional. Configuration value for recreation of replica after certain
+   * replication lag.
+   * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getReplicationLagMaxSecondsOrBuilder() { + return replicationLagMaxSeconds_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : replicationLagMaxSeconds_; + } + + public static final int ENABLE_GOOGLE_ML_INTEGRATION_FIELD_NUMBER = 40; + private com.google.protobuf.BoolValue enableGoogleMlIntegration_; + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL instances can
+   * connect to Vertex AI to pass requests for real-time predictions and
+   * insights to the AI. The default value is false. This applies only to Cloud
+   * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enableGoogleMlIntegration field is set. + */ + @java.lang.Override + public boolean hasEnableGoogleMlIntegration() { + return ((bitField0_ & 0x00040000) != 0); + } + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL instances can
+   * connect to Vertex AI to pass requests for real-time predictions and
+   * insights to the AI. The default value is false. This applies only to Cloud
+   * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enableGoogleMlIntegration. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnableGoogleMlIntegration() { + return enableGoogleMlIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableGoogleMlIntegration_; + } + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL instances can
+   * connect to Vertex AI to pass requests for real-time predictions and
+   * insights to the AI. The default value is false. This applies only to Cloud
+   * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getEnableGoogleMlIntegrationOrBuilder() { + return enableGoogleMlIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableGoogleMlIntegration_; + } + + public static final int ENABLE_DATAPLEX_INTEGRATION_FIELD_NUMBER = 41; + private com.google.protobuf.BoolValue enableDataplexIntegration_; + + /** + * + * + *
+   * Optional. By default, Cloud SQL instances have schema extraction disabled
+   * for Dataplex. When this parameter is set to true, schema extraction for
+   * Dataplex on Cloud SQL instances is activated.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enableDataplexIntegration field is set. + */ + @java.lang.Override + public boolean hasEnableDataplexIntegration() { + return ((bitField0_ & 0x00080000) != 0); + } + + /** + * + * + *
+   * Optional. By default, Cloud SQL instances have schema extraction disabled
+   * for Dataplex. When this parameter is set to true, schema extraction for
+   * Dataplex on Cloud SQL instances is activated.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enableDataplexIntegration. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnableDataplexIntegration() { + return enableDataplexIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableDataplexIntegration_; + } + + /** + * + * + *
+   * Optional. By default, Cloud SQL instances have schema extraction disabled
+   * for Dataplex. When this parameter is set to true, schema extraction for
+   * Dataplex on Cloud SQL instances is activated.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getEnableDataplexIntegrationOrBuilder() { + return enableDataplexIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableDataplexIntegration_; + } + + public static final int RETAIN_BACKUPS_ON_DELETE_FIELD_NUMBER = 42; + private com.google.protobuf.BoolValue retainBackupsOnDelete_; + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL retains backups of
+   * the instance even after the instance is deleted. The ON_DEMAND backup will
+   * be retained until customer deletes the backup or the project. The AUTOMATED
+   * backup will be retained based on the backups retention setting.
+   * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the retainBackupsOnDelete field is set. + */ + @java.lang.Override + public boolean hasRetainBackupsOnDelete() { + return ((bitField0_ & 0x00100000) != 0); + } + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL retains backups of
+   * the instance even after the instance is deleted. The ON_DEMAND backup will
+   * be retained until customer deletes the backup or the project. The AUTOMATED
+   * backup will be retained based on the backups retention setting.
+   * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retainBackupsOnDelete. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getRetainBackupsOnDelete() { + return retainBackupsOnDelete_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : retainBackupsOnDelete_; + } + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL retains backups of
+   * the instance even after the instance is deleted. The ON_DEMAND backup will
+   * be retained until customer deletes the backup or the project. The AUTOMATED
+   * backup will be retained based on the backups retention setting.
+   * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getRetainBackupsOnDeleteOrBuilder() { + return retainBackupsOnDelete_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : retainBackupsOnDelete_; + } + + public static final int DATA_DISK_PROVISIONED_IOPS_FIELD_NUMBER = 43; + private long dataDiskProvisionedIops_ = 0L; + + /** + * + * + *
+   * Optional. Provisioned number of I/O operations per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataDiskProvisionedIops field is set. + */ + @java.lang.Override + public boolean hasDataDiskProvisionedIops() { + return ((bitField0_ & 0x00200000) != 0); + } + + /** + * + * + *
+   * Optional. Provisioned number of I/O operations per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataDiskProvisionedIops. + */ + @java.lang.Override + public long getDataDiskProvisionedIops() { + return dataDiskProvisionedIops_; + } + + public static final int DATA_DISK_PROVISIONED_THROUGHPUT_FIELD_NUMBER = 44; + private long dataDiskProvisionedThroughput_ = 0L; + + /** + * + * + *
+   * Optional. Provisioned throughput measured in MiB per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataDiskProvisionedThroughput field is set. + */ + @java.lang.Override + public boolean hasDataDiskProvisionedThroughput() { + return ((bitField0_ & 0x00400000) != 0); + } + + /** + * + * + *
+   * Optional. Provisioned throughput measured in MiB per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataDiskProvisionedThroughput. + */ + @java.lang.Override + public long getDataDiskProvisionedThroughput() { + return dataDiskProvisionedThroughput_; + } + + public static final int CONNECTION_POOL_CONFIG_FIELD_NUMBER = 45; + private com.google.cloud.sql.v1beta4.ConnectionPoolConfig connectionPoolConfig_; + + /** + * + * + *
+   * Optional. The managed connection pooling configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the connectionPoolConfig field is set. + */ + @java.lang.Override + public boolean hasConnectionPoolConfig() { + return ((bitField0_ & 0x00800000) != 0); + } + + /** + * + * + *
+   * Optional. The managed connection pooling configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The connectionPoolConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectionPoolConfig getConnectionPoolConfig() { + return connectionPoolConfig_ == null + ? com.google.cloud.sql.v1beta4.ConnectionPoolConfig.getDefaultInstance() + : connectionPoolConfig_; + } + + /** + * + * + *
+   * Optional. The managed connection pooling configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ConnectionPoolConfigOrBuilder + getConnectionPoolConfigOrBuilder() { + return connectionPoolConfig_ == null + ? com.google.cloud.sql.v1beta4.ConnectionPoolConfig.getDefaultInstance() + : connectionPoolConfig_; + } + + public static final int FINAL_BACKUP_CONFIG_FIELD_NUMBER = 47; + private com.google.cloud.sql.v1beta4.FinalBackupConfig finalBackupConfig_; + + /** + * + * + *
+   * Optional. The final backup configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the finalBackupConfig field is set. + */ + @java.lang.Override + public boolean hasFinalBackupConfig() { + return ((bitField0_ & 0x01000000) != 0); + } + + /** + * + * + *
+   * Optional. The final backup configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The finalBackupConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.FinalBackupConfig getFinalBackupConfig() { + return finalBackupConfig_ == null + ? com.google.cloud.sql.v1beta4.FinalBackupConfig.getDefaultInstance() + : finalBackupConfig_; + } + + /** + * + * + *
+   * Optional. The final backup configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.FinalBackupConfigOrBuilder getFinalBackupConfigOrBuilder() { + return finalBackupConfig_ == null + ? com.google.cloud.sql.v1beta4.FinalBackupConfig.getDefaultInstance() + : finalBackupConfig_; + } + + public static final int READ_POOL_AUTO_SCALE_CONFIG_FIELD_NUMBER = 48; + private com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig readPoolAutoScaleConfig_; + + /** + * + * + *
+   * Optional. The read pool auto-scale configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readPoolAutoScaleConfig field is set. + */ + @java.lang.Override + public boolean hasReadPoolAutoScaleConfig() { + return ((bitField0_ & 0x02000000) != 0); + } + + /** + * + * + *
+   * Optional. The read pool auto-scale configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readPoolAutoScaleConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig getReadPoolAutoScaleConfig() { + return readPoolAutoScaleConfig_ == null + ? com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.getDefaultInstance() + : readPoolAutoScaleConfig_; + } + + /** + * + * + *
+   * Optional. The read pool auto-scale configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfigOrBuilder + getReadPoolAutoScaleConfigOrBuilder() { + return readPoolAutoScaleConfig_ == null + ? com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.getDefaultInstance() + : readPoolAutoScaleConfig_; + } + + public static final int ACCELERATED_REPLICA_MODE_FIELD_NUMBER = 49; + private com.google.protobuf.BoolValue acceleratedReplicaMode_; + + /** + * + * + *
+   * Optional. Configures whether the replica is in accelerated mode. This
+   * feature is in private preview and requires allowlisting to take effect.
+   * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the acceleratedReplicaMode field is set. + */ + @java.lang.Override + public boolean hasAcceleratedReplicaMode() { + return ((bitField0_ & 0x04000000) != 0); + } + + /** + * + * + *
+   * Optional. Configures whether the replica is in accelerated mode. This
+   * feature is in private preview and requires allowlisting to take effect.
+   * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The acceleratedReplicaMode. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getAcceleratedReplicaMode() { + return acceleratedReplicaMode_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : acceleratedReplicaMode_; + } + + /** + * + * + *
+   * Optional. Configures whether the replica is in accelerated mode. This
+   * feature is in private preview and requires allowlisting to take effect.
+   * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getAcceleratedReplicaModeOrBuilder() { + return acceleratedReplicaMode_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : acceleratedReplicaMode_; + } + + public static final int AUTO_UPGRADE_ENABLED_FIELD_NUMBER = 50; + private boolean autoUpgradeEnabled_ = false; + + /** + * + * + *
+   * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+   * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+   * versions. The MySQL version must be 8.0.35 or higher.
+   * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the autoUpgradeEnabled field is set. + */ + @java.lang.Override + public boolean hasAutoUpgradeEnabled() { + return ((bitField0_ & 0x08000000) != 0); + } + + /** + * + * + *
+   * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+   * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+   * versions. The MySQL version must be 8.0.35 or higher.
+   * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The autoUpgradeEnabled. + */ + @java.lang.Override + public boolean getAutoUpgradeEnabled() { + return autoUpgradeEnabled_; + } + + public static final int ENTRAID_CONFIG_FIELD_NUMBER = 52; + private com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraidConfig_; + + /** + * + * + *
+   * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the entraidConfig field is set. + */ + @java.lang.Override + public boolean hasEntraidConfig() { + return ((bitField0_ & 0x10000000) != 0); + } + + /** + * + * + *
+   * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The entraidConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig getEntraidConfig() { + return entraidConfig_ == null + ? com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.getDefaultInstance() + : entraidConfig_; + } + + /** + * + * + *
+   * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerEntraIdConfigOrBuilder getEntraidConfigOrBuilder() { + return entraidConfig_ == null + ? com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.getDefaultInstance() + : entraidConfig_; + } + + public static final int DATA_API_ACCESS_FIELD_NUMBER = 53; + private int dataApiAccess_ = 0; + + /** + * + * + *
+   * This parameter controls whether to allow using ExecuteSql API to connect to
+   * the instance. Not allowed by default.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.Settings.DataApiAccess data_api_access = 53; + * + * @return Whether the dataApiAccess field is set. + */ + @java.lang.Override + public boolean hasDataApiAccess() { + return ((bitField0_ & 0x20000000) != 0); + } + + /** + * + * + *
+   * This parameter controls whether to allow using ExecuteSql API to connect to
+   * the instance. Not allowed by default.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.Settings.DataApiAccess data_api_access = 53; + * + * @return The enum numeric value on the wire for dataApiAccess. + */ + @java.lang.Override + public int getDataApiAccessValue() { + return dataApiAccess_; + } + + /** + * + * + *
+   * This parameter controls whether to allow using ExecuteSql API to connect to
+   * the instance. Not allowed by default.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.Settings.DataApiAccess data_api_access = 53; + * + * @return The dataApiAccess. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Settings.DataApiAccess getDataApiAccess() { + com.google.cloud.sql.v1beta4.Settings.DataApiAccess result = + com.google.cloud.sql.v1beta4.Settings.DataApiAccess.forNumber(dataApiAccess_); + return result == null + ? com.google.cloud.sql.v1beta4.Settings.DataApiAccess.UNRECOGNIZED + : result; + } + + public static final int PERFORMANCE_CAPTURE_CONFIG_FIELD_NUMBER = 54; + private com.google.cloud.sql.v1beta4.PerformanceCaptureConfig performanceCaptureConfig_; + + /** + * + * + *
+   * Optional. Configuration for Performance Capture, provides diagnostic
+   * metrics during high load situations.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the performanceCaptureConfig field is set. + */ + @java.lang.Override + public boolean hasPerformanceCaptureConfig() { + return ((bitField0_ & 0x40000000) != 0); + } + + /** + * + * + *
+   * Optional. Configuration for Performance Capture, provides diagnostic
+   * metrics during high load situations.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The performanceCaptureConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PerformanceCaptureConfig getPerformanceCaptureConfig() { + return performanceCaptureConfig_ == null + ? com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.getDefaultInstance() + : performanceCaptureConfig_; + } + + /** + * + * + *
+   * Optional. Configuration for Performance Capture, provides diagnostic
+   * metrics during high load situations.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PerformanceCaptureConfigOrBuilder + getPerformanceCaptureConfigOrBuilder() { + return performanceCaptureConfig_ == null + ? com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.getDefaultInstance() + : performanceCaptureConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getSettingsVersion()); + } + for (int i = 0; i < authorizedGaeApplications_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 2, authorizedGaeApplications_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tier_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, tier_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, kind_); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetUserLabels(), UserLabelsDefaultEntryHolder.defaultEntry, 5); + if (availabilityType_ + != com.google.cloud.sql.v1beta4.SqlAvailabilityType.SQL_AVAILABILITY_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, availabilityType_); + } + if (pricingPlan_ + != com.google.cloud.sql.v1beta4.SqlPricingPlan.SQL_PRICING_PLAN_UNSPECIFIED.getNumber()) { + output.writeEnum(7, pricingPlan_); + } + if (replicationType_ + != com.google.cloud.sql.v1beta4.SqlReplicationType.SQL_REPLICATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, replicationType_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(9, getStorageAutoResizeLimit()); + } + if (activationPolicy_ + != com.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy + .SQL_ACTIVATION_POLICY_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, activationPolicy_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(11, getIpConfiguration()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(12, getStorageAutoResize()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(13, getLocationPreference()); + } + for (int i = 0; i < databaseFlags_.size(); i++) { + output.writeMessage(14, databaseFlags_.get(i)); + } + if (dataDiskType_ + != com.google.cloud.sql.v1beta4.SqlDataDiskType.SQL_DATA_DISK_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(15, dataDiskType_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(16, getMaintenanceWindow()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(17, getBackupConfiguration()); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(18, getDatabaseReplicationEnabled()); + } + if (((bitField0_ & 0x00000100) != 0)) { + output.writeMessage(19, getCrashSafeReplicationEnabled()); + } + if (((bitField0_ & 0x00000200) != 0)) { + output.writeMessage(20, getDataDiskSizeGb()); + } + if (((bitField0_ & 0x00000400) != 0)) { + output.writeMessage(22, getActiveDirectoryConfig()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(collation_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 23, collation_); + } + for (int i = 0; i < denyMaintenancePeriods_.size(); i++) { + output.writeMessage(24, denyMaintenancePeriods_.get(i)); + } + if (((bitField0_ & 0x00000800) != 0)) { + output.writeMessage(25, getInsightsConfig()); + } + if (((bitField0_ & 0x00001000) != 0)) { + output.writeMessage(27, getPasswordValidationPolicy()); + } + if (((bitField0_ & 0x00002000) != 0)) { + output.writeMessage(29, getSqlServerAuditConfig()); + } + if (connectorEnforcement_ + != com.google.cloud.sql.v1beta4.Settings.ConnectorEnforcement + .CONNECTOR_ENFORCEMENT_UNSPECIFIED + .getNumber()) { + output.writeEnum(32, connectorEnforcement_); + } + if (((bitField0_ & 0x00004000) != 0)) { + output.writeMessage(33, getDeletionProtectionEnabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(timeZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 34, timeZone_); + } + if (((bitField0_ & 0x00008000) != 0)) { + output.writeMessage(35, getAdvancedMachineFeatures()); + } + if (((bitField0_ & 0x00010000) != 0)) { + output.writeMessage(37, getDataCacheConfig()); + } + if (edition_ != com.google.cloud.sql.v1beta4.Settings.Edition.EDITION_UNSPECIFIED.getNumber()) { + output.writeEnum(38, edition_); + } + if (((bitField0_ & 0x00020000) != 0)) { + output.writeMessage(39, getReplicationLagMaxSeconds()); + } + if (((bitField0_ & 0x00040000) != 0)) { + output.writeMessage(40, getEnableGoogleMlIntegration()); + } + if (((bitField0_ & 0x00080000) != 0)) { + output.writeMessage(41, getEnableDataplexIntegration()); + } + if (((bitField0_ & 0x00100000) != 0)) { + output.writeMessage(42, getRetainBackupsOnDelete()); + } + if (((bitField0_ & 0x00200000) != 0)) { + output.writeInt64(43, dataDiskProvisionedIops_); + } + if (((bitField0_ & 0x00400000) != 0)) { + output.writeInt64(44, dataDiskProvisionedThroughput_); + } + if (((bitField0_ & 0x00800000) != 0)) { + output.writeMessage(45, getConnectionPoolConfig()); + } + if (((bitField0_ & 0x01000000) != 0)) { + output.writeMessage(47, getFinalBackupConfig()); + } + if (((bitField0_ & 0x02000000) != 0)) { + output.writeMessage(48, getReadPoolAutoScaleConfig()); + } + if (((bitField0_ & 0x04000000) != 0)) { + output.writeMessage(49, getAcceleratedReplicaMode()); + } + if (((bitField0_ & 0x08000000) != 0)) { + output.writeBool(50, autoUpgradeEnabled_); + } + if (((bitField0_ & 0x10000000) != 0)) { + output.writeMessage(52, getEntraidConfig()); + } + if (((bitField0_ & 0x20000000) != 0)) { + output.writeEnum(53, dataApiAccess_); + } + if (((bitField0_ & 0x40000000) != 0)) { + output.writeMessage(54, getPerformanceCaptureConfig()); + } + 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, getSettingsVersion()); + } + { + int dataSize = 0; + for (int i = 0; i < authorizedGaeApplications_.size(); i++) { + dataSize += computeStringSizeNoTag(authorizedGaeApplications_.getRaw(i)); + } + size += dataSize; + size += 1 * getAuthorizedGaeApplicationsList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tier_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, tier_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, kind_); + } + for (java.util.Map.Entry entry : + internalGetUserLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry userLabels__ = + UserLabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, userLabels__); + } + if (availabilityType_ + != com.google.cloud.sql.v1beta4.SqlAvailabilityType.SQL_AVAILABILITY_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, availabilityType_); + } + if (pricingPlan_ + != com.google.cloud.sql.v1beta4.SqlPricingPlan.SQL_PRICING_PLAN_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, pricingPlan_); + } + if (replicationType_ + != com.google.cloud.sql.v1beta4.SqlReplicationType.SQL_REPLICATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, replicationType_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(9, getStorageAutoResizeLimit()); + } + if (activationPolicy_ + != com.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy + .SQL_ACTIVATION_POLICY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, activationPolicy_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getIpConfiguration()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getStorageAutoResize()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getLocationPreference()); + } + for (int i = 0; i < databaseFlags_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, databaseFlags_.get(i)); + } + if (dataDiskType_ + != com.google.cloud.sql.v1beta4.SqlDataDiskType.SQL_DATA_DISK_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(15, dataDiskType_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getMaintenanceWindow()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(17, getBackupConfiguration()); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 18, getDatabaseReplicationEnabled()); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 19, getCrashSafeReplicationEnabled()); + } + if (((bitField0_ & 0x00000200) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getDataDiskSizeGb()); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(22, getActiveDirectoryConfig()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(collation_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(23, collation_); + } + for (int i = 0; i < denyMaintenancePeriods_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 24, denyMaintenancePeriods_.get(i)); + } + if (((bitField0_ & 0x00000800) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, getInsightsConfig()); + } + if (((bitField0_ & 0x00001000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 27, getPasswordValidationPolicy()); + } + if (((bitField0_ & 0x00002000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(29, getSqlServerAuditConfig()); + } + if (connectorEnforcement_ + != com.google.cloud.sql.v1beta4.Settings.ConnectorEnforcement + .CONNECTOR_ENFORCEMENT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(32, connectorEnforcement_); + } + if (((bitField0_ & 0x00004000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 33, getDeletionProtectionEnabled()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(timeZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(34, timeZone_); + } + if (((bitField0_ & 0x00008000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 35, getAdvancedMachineFeatures()); + } + if (((bitField0_ & 0x00010000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(37, getDataCacheConfig()); + } + if (edition_ != com.google.cloud.sql.v1beta4.Settings.Edition.EDITION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(38, edition_); + } + if (((bitField0_ & 0x00020000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 39, getReplicationLagMaxSeconds()); + } + if (((bitField0_ & 0x00040000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 40, getEnableGoogleMlIntegration()); + } + if (((bitField0_ & 0x00080000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 41, getEnableDataplexIntegration()); + } + if (((bitField0_ & 0x00100000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(42, getRetainBackupsOnDelete()); + } + if (((bitField0_ & 0x00200000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(43, dataDiskProvisionedIops_); + } + if (((bitField0_ & 0x00400000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 44, dataDiskProvisionedThroughput_); + } + if (((bitField0_ & 0x00800000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(45, getConnectionPoolConfig()); + } + if (((bitField0_ & 0x01000000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(47, getFinalBackupConfig()); + } + if (((bitField0_ & 0x02000000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 48, getReadPoolAutoScaleConfig()); + } + if (((bitField0_ & 0x04000000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(49, getAcceleratedReplicaMode()); + } + if (((bitField0_ & 0x08000000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(50, autoUpgradeEnabled_); + } + if (((bitField0_ & 0x10000000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(52, getEntraidConfig()); + } + if (((bitField0_ & 0x20000000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(53, dataApiAccess_); + } + if (((bitField0_ & 0x40000000) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 54, getPerformanceCaptureConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.Settings)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.Settings other = (com.google.cloud.sql.v1beta4.Settings) obj; + + if (hasSettingsVersion() != other.hasSettingsVersion()) return false; + if (hasSettingsVersion()) { + if (!getSettingsVersion().equals(other.getSettingsVersion())) return false; + } + if (!getAuthorizedGaeApplicationsList().equals(other.getAuthorizedGaeApplicationsList())) + return false; + if (!getTier().equals(other.getTier())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!internalGetUserLabels().equals(other.internalGetUserLabels())) return false; + if (availabilityType_ != other.availabilityType_) return false; + if (pricingPlan_ != other.pricingPlan_) return false; + if (replicationType_ != other.replicationType_) return false; + if (hasStorageAutoResizeLimit() != other.hasStorageAutoResizeLimit()) return false; + if (hasStorageAutoResizeLimit()) { + if (!getStorageAutoResizeLimit().equals(other.getStorageAutoResizeLimit())) return false; + } + if (activationPolicy_ != other.activationPolicy_) return false; + if (hasIpConfiguration() != other.hasIpConfiguration()) return false; + if (hasIpConfiguration()) { + if (!getIpConfiguration().equals(other.getIpConfiguration())) return false; + } + if (hasStorageAutoResize() != other.hasStorageAutoResize()) return false; + if (hasStorageAutoResize()) { + if (!getStorageAutoResize().equals(other.getStorageAutoResize())) return false; + } + if (hasLocationPreference() != other.hasLocationPreference()) return false; + if (hasLocationPreference()) { + if (!getLocationPreference().equals(other.getLocationPreference())) return false; + } + if (!getDatabaseFlagsList().equals(other.getDatabaseFlagsList())) return false; + if (dataDiskType_ != other.dataDiskType_) return false; + if (hasMaintenanceWindow() != other.hasMaintenanceWindow()) return false; + if (hasMaintenanceWindow()) { + if (!getMaintenanceWindow().equals(other.getMaintenanceWindow())) return false; + } + if (hasBackupConfiguration() != other.hasBackupConfiguration()) return false; + if (hasBackupConfiguration()) { + if (!getBackupConfiguration().equals(other.getBackupConfiguration())) return false; + } + if (hasDatabaseReplicationEnabled() != other.hasDatabaseReplicationEnabled()) return false; + if (hasDatabaseReplicationEnabled()) { + if (!getDatabaseReplicationEnabled().equals(other.getDatabaseReplicationEnabled())) + return false; + } + if (hasCrashSafeReplicationEnabled() != other.hasCrashSafeReplicationEnabled()) return false; + if (hasCrashSafeReplicationEnabled()) { + if (!getCrashSafeReplicationEnabled().equals(other.getCrashSafeReplicationEnabled())) + return false; + } + if (hasDataDiskSizeGb() != other.hasDataDiskSizeGb()) return false; + if (hasDataDiskSizeGb()) { + if (!getDataDiskSizeGb().equals(other.getDataDiskSizeGb())) return false; + } + if (hasActiveDirectoryConfig() != other.hasActiveDirectoryConfig()) return false; + if (hasActiveDirectoryConfig()) { + if (!getActiveDirectoryConfig().equals(other.getActiveDirectoryConfig())) return false; + } + if (!getCollation().equals(other.getCollation())) return false; + if (!getDenyMaintenancePeriodsList().equals(other.getDenyMaintenancePeriodsList())) + return false; + if (hasInsightsConfig() != other.hasInsightsConfig()) return false; + if (hasInsightsConfig()) { + if (!getInsightsConfig().equals(other.getInsightsConfig())) return false; + } + if (hasPasswordValidationPolicy() != other.hasPasswordValidationPolicy()) return false; + if (hasPasswordValidationPolicy()) { + if (!getPasswordValidationPolicy().equals(other.getPasswordValidationPolicy())) return false; + } + if (hasSqlServerAuditConfig() != other.hasSqlServerAuditConfig()) return false; + if (hasSqlServerAuditConfig()) { + if (!getSqlServerAuditConfig().equals(other.getSqlServerAuditConfig())) return false; + } + if (edition_ != other.edition_) return false; + if (connectorEnforcement_ != other.connectorEnforcement_) return false; + if (hasDeletionProtectionEnabled() != other.hasDeletionProtectionEnabled()) return false; + if (hasDeletionProtectionEnabled()) { + if (!getDeletionProtectionEnabled().equals(other.getDeletionProtectionEnabled())) + return false; + } + if (!getTimeZone().equals(other.getTimeZone())) return false; + if (hasAdvancedMachineFeatures() != other.hasAdvancedMachineFeatures()) return false; + if (hasAdvancedMachineFeatures()) { + if (!getAdvancedMachineFeatures().equals(other.getAdvancedMachineFeatures())) return false; + } + if (hasDataCacheConfig() != other.hasDataCacheConfig()) return false; + if (hasDataCacheConfig()) { + if (!getDataCacheConfig().equals(other.getDataCacheConfig())) return false; + } + if (hasReplicationLagMaxSeconds() != other.hasReplicationLagMaxSeconds()) return false; + if (hasReplicationLagMaxSeconds()) { + if (!getReplicationLagMaxSeconds().equals(other.getReplicationLagMaxSeconds())) return false; + } + if (hasEnableGoogleMlIntegration() != other.hasEnableGoogleMlIntegration()) return false; + if (hasEnableGoogleMlIntegration()) { + if (!getEnableGoogleMlIntegration().equals(other.getEnableGoogleMlIntegration())) + return false; + } + if (hasEnableDataplexIntegration() != other.hasEnableDataplexIntegration()) return false; + if (hasEnableDataplexIntegration()) { + if (!getEnableDataplexIntegration().equals(other.getEnableDataplexIntegration())) + return false; + } + if (hasRetainBackupsOnDelete() != other.hasRetainBackupsOnDelete()) return false; + if (hasRetainBackupsOnDelete()) { + if (!getRetainBackupsOnDelete().equals(other.getRetainBackupsOnDelete())) return false; + } + if (hasDataDiskProvisionedIops() != other.hasDataDiskProvisionedIops()) return false; + if (hasDataDiskProvisionedIops()) { + if (getDataDiskProvisionedIops() != other.getDataDiskProvisionedIops()) return false; + } + if (hasDataDiskProvisionedThroughput() != other.hasDataDiskProvisionedThroughput()) + return false; + if (hasDataDiskProvisionedThroughput()) { + if (getDataDiskProvisionedThroughput() != other.getDataDiskProvisionedThroughput()) + return false; + } + if (hasConnectionPoolConfig() != other.hasConnectionPoolConfig()) return false; + if (hasConnectionPoolConfig()) { + if (!getConnectionPoolConfig().equals(other.getConnectionPoolConfig())) return false; + } + if (hasFinalBackupConfig() != other.hasFinalBackupConfig()) return false; + if (hasFinalBackupConfig()) { + if (!getFinalBackupConfig().equals(other.getFinalBackupConfig())) return false; + } + if (hasReadPoolAutoScaleConfig() != other.hasReadPoolAutoScaleConfig()) return false; + if (hasReadPoolAutoScaleConfig()) { + if (!getReadPoolAutoScaleConfig().equals(other.getReadPoolAutoScaleConfig())) return false; + } + if (hasAcceleratedReplicaMode() != other.hasAcceleratedReplicaMode()) return false; + if (hasAcceleratedReplicaMode()) { + if (!getAcceleratedReplicaMode().equals(other.getAcceleratedReplicaMode())) return false; + } + if (hasAutoUpgradeEnabled() != other.hasAutoUpgradeEnabled()) return false; + if (hasAutoUpgradeEnabled()) { + if (getAutoUpgradeEnabled() != other.getAutoUpgradeEnabled()) return false; + } + if (hasEntraidConfig() != other.hasEntraidConfig()) return false; + if (hasEntraidConfig()) { + if (!getEntraidConfig().equals(other.getEntraidConfig())) return false; + } + if (hasDataApiAccess() != other.hasDataApiAccess()) return false; + if (hasDataApiAccess()) { + if (dataApiAccess_ != other.dataApiAccess_) return false; + } + if (hasPerformanceCaptureConfig() != other.hasPerformanceCaptureConfig()) return false; + if (hasPerformanceCaptureConfig()) { + if (!getPerformanceCaptureConfig().equals(other.getPerformanceCaptureConfig())) return false; + } + if (!getUnknownFields().equals(other.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 (hasSettingsVersion()) { + hash = (37 * hash) + SETTINGS_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getSettingsVersion().hashCode(); + } + if (getAuthorizedGaeApplicationsCount() > 0) { + hash = (37 * hash) + AUTHORIZED_GAE_APPLICATIONS_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedGaeApplicationsList().hashCode(); + } + hash = (37 * hash) + TIER_FIELD_NUMBER; + hash = (53 * hash) + getTier().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (!internalGetUserLabels().getMap().isEmpty()) { + hash = (37 * hash) + USER_LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetUserLabels().hashCode(); + } + hash = (37 * hash) + AVAILABILITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + availabilityType_; + hash = (37 * hash) + PRICING_PLAN_FIELD_NUMBER; + hash = (53 * hash) + pricingPlan_; + hash = (37 * hash) + REPLICATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + replicationType_; + if (hasStorageAutoResizeLimit()) { + hash = (37 * hash) + STORAGE_AUTO_RESIZE_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getStorageAutoResizeLimit().hashCode(); + } + hash = (37 * hash) + ACTIVATION_POLICY_FIELD_NUMBER; + hash = (53 * hash) + activationPolicy_; + if (hasIpConfiguration()) { + hash = (37 * hash) + IP_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getIpConfiguration().hashCode(); + } + if (hasStorageAutoResize()) { + hash = (37 * hash) + STORAGE_AUTO_RESIZE_FIELD_NUMBER; + hash = (53 * hash) + getStorageAutoResize().hashCode(); + } + if (hasLocationPreference()) { + hash = (37 * hash) + LOCATION_PREFERENCE_FIELD_NUMBER; + hash = (53 * hash) + getLocationPreference().hashCode(); + } + if (getDatabaseFlagsCount() > 0) { + hash = (37 * hash) + DATABASE_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseFlagsList().hashCode(); + } + hash = (37 * hash) + DATA_DISK_TYPE_FIELD_NUMBER; + hash = (53 * hash) + dataDiskType_; + if (hasMaintenanceWindow()) { + hash = (37 * hash) + MAINTENANCE_WINDOW_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceWindow().hashCode(); + } + if (hasBackupConfiguration()) { + hash = (37 * hash) + BACKUP_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getBackupConfiguration().hashCode(); + } + if (hasDatabaseReplicationEnabled()) { + hash = (37 * hash) + DATABASE_REPLICATION_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseReplicationEnabled().hashCode(); + } + if (hasCrashSafeReplicationEnabled()) { + hash = (37 * hash) + CRASH_SAFE_REPLICATION_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getCrashSafeReplicationEnabled().hashCode(); + } + if (hasDataDiskSizeGb()) { + hash = (37 * hash) + DATA_DISK_SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + getDataDiskSizeGb().hashCode(); + } + if (hasActiveDirectoryConfig()) { + hash = (37 * hash) + ACTIVE_DIRECTORY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getActiveDirectoryConfig().hashCode(); + } + hash = (37 * hash) + COLLATION_FIELD_NUMBER; + hash = (53 * hash) + getCollation().hashCode(); + if (getDenyMaintenancePeriodsCount() > 0) { + hash = (37 * hash) + DENY_MAINTENANCE_PERIODS_FIELD_NUMBER; + hash = (53 * hash) + getDenyMaintenancePeriodsList().hashCode(); + } + if (hasInsightsConfig()) { + hash = (37 * hash) + INSIGHTS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInsightsConfig().hashCode(); + } + if (hasPasswordValidationPolicy()) { + hash = (37 * hash) + PASSWORD_VALIDATION_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPasswordValidationPolicy().hashCode(); + } + if (hasSqlServerAuditConfig()) { + hash = (37 * hash) + SQL_SERVER_AUDIT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSqlServerAuditConfig().hashCode(); + } + hash = (37 * hash) + EDITION_FIELD_NUMBER; + hash = (53 * hash) + edition_; + hash = (37 * hash) + CONNECTOR_ENFORCEMENT_FIELD_NUMBER; + hash = (53 * hash) + connectorEnforcement_; + if (hasDeletionProtectionEnabled()) { + hash = (37 * hash) + DELETION_PROTECTION_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + getDeletionProtectionEnabled().hashCode(); + } + hash = (37 * hash) + TIME_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getTimeZone().hashCode(); + if (hasAdvancedMachineFeatures()) { + hash = (37 * hash) + ADVANCED_MACHINE_FEATURES_FIELD_NUMBER; + hash = (53 * hash) + getAdvancedMachineFeatures().hashCode(); + } + if (hasDataCacheConfig()) { + hash = (37 * hash) + DATA_CACHE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getDataCacheConfig().hashCode(); + } + if (hasReplicationLagMaxSeconds()) { + hash = (37 * hash) + REPLICATION_LAG_MAX_SECONDS_FIELD_NUMBER; + hash = (53 * hash) + getReplicationLagMaxSeconds().hashCode(); + } + if (hasEnableGoogleMlIntegration()) { + hash = (37 * hash) + ENABLE_GOOGLE_ML_INTEGRATION_FIELD_NUMBER; + hash = (53 * hash) + getEnableGoogleMlIntegration().hashCode(); + } + if (hasEnableDataplexIntegration()) { + hash = (37 * hash) + ENABLE_DATAPLEX_INTEGRATION_FIELD_NUMBER; + hash = (53 * hash) + getEnableDataplexIntegration().hashCode(); + } + if (hasRetainBackupsOnDelete()) { + hash = (37 * hash) + RETAIN_BACKUPS_ON_DELETE_FIELD_NUMBER; + hash = (53 * hash) + getRetainBackupsOnDelete().hashCode(); + } + if (hasDataDiskProvisionedIops()) { + hash = (37 * hash) + DATA_DISK_PROVISIONED_IOPS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDataDiskProvisionedIops()); + } + if (hasDataDiskProvisionedThroughput()) { + hash = (37 * hash) + DATA_DISK_PROVISIONED_THROUGHPUT_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashLong(getDataDiskProvisionedThroughput()); + } + if (hasConnectionPoolConfig()) { + hash = (37 * hash) + CONNECTION_POOL_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConnectionPoolConfig().hashCode(); + } + if (hasFinalBackupConfig()) { + hash = (37 * hash) + FINAL_BACKUP_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getFinalBackupConfig().hashCode(); + } + if (hasReadPoolAutoScaleConfig()) { + hash = (37 * hash) + READ_POOL_AUTO_SCALE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getReadPoolAutoScaleConfig().hashCode(); + } + if (hasAcceleratedReplicaMode()) { + hash = (37 * hash) + ACCELERATED_REPLICA_MODE_FIELD_NUMBER; + hash = (53 * hash) + getAcceleratedReplicaMode().hashCode(); + } + if (hasAutoUpgradeEnabled()) { + hash = (37 * hash) + AUTO_UPGRADE_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAutoUpgradeEnabled()); + } + if (hasEntraidConfig()) { + hash = (37 * hash) + ENTRAID_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEntraidConfig().hashCode(); + } + if (hasDataApiAccess()) { + hash = (37 * hash) + DATA_API_ACCESS_FIELD_NUMBER; + hash = (53 * hash) + dataApiAccess_; + } + if (hasPerformanceCaptureConfig()) { + hash = (37 * hash) + PERFORMANCE_CAPTURE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPerformanceCaptureConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.Settings parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Settings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Settings parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Settings parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Settings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Settings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Settings parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Settings parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Settings parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Settings parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Settings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Settings parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.Settings prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database instance settings.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Settings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.Settings) + com.google.cloud.sql.v1beta4.SettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Settings_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetMutableUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Settings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Settings.class, + com.google.cloud.sql.v1beta4.Settings.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.Settings.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSettingsVersionFieldBuilder(); + internalGetStorageAutoResizeLimitFieldBuilder(); + internalGetIpConfigurationFieldBuilder(); + internalGetStorageAutoResizeFieldBuilder(); + internalGetLocationPreferenceFieldBuilder(); + internalGetDatabaseFlagsFieldBuilder(); + internalGetMaintenanceWindowFieldBuilder(); + internalGetBackupConfigurationFieldBuilder(); + internalGetDatabaseReplicationEnabledFieldBuilder(); + internalGetCrashSafeReplicationEnabledFieldBuilder(); + internalGetDataDiskSizeGbFieldBuilder(); + internalGetActiveDirectoryConfigFieldBuilder(); + internalGetDenyMaintenancePeriodsFieldBuilder(); + internalGetInsightsConfigFieldBuilder(); + internalGetPasswordValidationPolicyFieldBuilder(); + internalGetSqlServerAuditConfigFieldBuilder(); + internalGetDeletionProtectionEnabledFieldBuilder(); + internalGetAdvancedMachineFeaturesFieldBuilder(); + internalGetDataCacheConfigFieldBuilder(); + internalGetReplicationLagMaxSecondsFieldBuilder(); + internalGetEnableGoogleMlIntegrationFieldBuilder(); + internalGetEnableDataplexIntegrationFieldBuilder(); + internalGetRetainBackupsOnDeleteFieldBuilder(); + internalGetConnectionPoolConfigFieldBuilder(); + internalGetFinalBackupConfigFieldBuilder(); + internalGetReadPoolAutoScaleConfigFieldBuilder(); + internalGetAcceleratedReplicaModeFieldBuilder(); + internalGetEntraidConfigFieldBuilder(); + internalGetPerformanceCaptureConfigFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bitField1_ = 0; + settingsVersion_ = null; + if (settingsVersionBuilder_ != null) { + settingsVersionBuilder_.dispose(); + settingsVersionBuilder_ = null; + } + authorizedGaeApplications_ = com.google.protobuf.LazyStringArrayList.emptyList(); + tier_ = ""; + kind_ = ""; + internalGetMutableUserLabels().clear(); + availabilityType_ = 0; + pricingPlan_ = 0; + replicationType_ = 0; + storageAutoResizeLimit_ = null; + if (storageAutoResizeLimitBuilder_ != null) { + storageAutoResizeLimitBuilder_.dispose(); + storageAutoResizeLimitBuilder_ = null; + } + activationPolicy_ = 0; + ipConfiguration_ = null; + if (ipConfigurationBuilder_ != null) { + ipConfigurationBuilder_.dispose(); + ipConfigurationBuilder_ = null; + } + storageAutoResize_ = null; + if (storageAutoResizeBuilder_ != null) { + storageAutoResizeBuilder_.dispose(); + storageAutoResizeBuilder_ = null; + } + locationPreference_ = null; + if (locationPreferenceBuilder_ != null) { + locationPreferenceBuilder_.dispose(); + locationPreferenceBuilder_ = null; + } + if (databaseFlagsBuilder_ == null) { + databaseFlags_ = java.util.Collections.emptyList(); + } else { + databaseFlags_ = null; + databaseFlagsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00002000); + dataDiskType_ = 0; + maintenanceWindow_ = null; + if (maintenanceWindowBuilder_ != null) { + maintenanceWindowBuilder_.dispose(); + maintenanceWindowBuilder_ = null; + } + backupConfiguration_ = null; + if (backupConfigurationBuilder_ != null) { + backupConfigurationBuilder_.dispose(); + backupConfigurationBuilder_ = null; + } + databaseReplicationEnabled_ = null; + if (databaseReplicationEnabledBuilder_ != null) { + databaseReplicationEnabledBuilder_.dispose(); + databaseReplicationEnabledBuilder_ = null; + } + crashSafeReplicationEnabled_ = null; + if (crashSafeReplicationEnabledBuilder_ != null) { + crashSafeReplicationEnabledBuilder_.dispose(); + crashSafeReplicationEnabledBuilder_ = null; + } + dataDiskSizeGb_ = null; + if (dataDiskSizeGbBuilder_ != null) { + dataDiskSizeGbBuilder_.dispose(); + dataDiskSizeGbBuilder_ = null; + } + activeDirectoryConfig_ = null; + if (activeDirectoryConfigBuilder_ != null) { + activeDirectoryConfigBuilder_.dispose(); + activeDirectoryConfigBuilder_ = null; + } + collation_ = ""; + if (denyMaintenancePeriodsBuilder_ == null) { + denyMaintenancePeriods_ = java.util.Collections.emptyList(); + } else { + denyMaintenancePeriods_ = null; + denyMaintenancePeriodsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00400000); + insightsConfig_ = null; + if (insightsConfigBuilder_ != null) { + insightsConfigBuilder_.dispose(); + insightsConfigBuilder_ = null; + } + passwordValidationPolicy_ = null; + if (passwordValidationPolicyBuilder_ != null) { + passwordValidationPolicyBuilder_.dispose(); + passwordValidationPolicyBuilder_ = null; + } + sqlServerAuditConfig_ = null; + if (sqlServerAuditConfigBuilder_ != null) { + sqlServerAuditConfigBuilder_.dispose(); + sqlServerAuditConfigBuilder_ = null; + } + edition_ = 0; + connectorEnforcement_ = 0; + deletionProtectionEnabled_ = null; + if (deletionProtectionEnabledBuilder_ != null) { + deletionProtectionEnabledBuilder_.dispose(); + deletionProtectionEnabledBuilder_ = null; + } + timeZone_ = ""; + advancedMachineFeatures_ = null; + if (advancedMachineFeaturesBuilder_ != null) { + advancedMachineFeaturesBuilder_.dispose(); + advancedMachineFeaturesBuilder_ = null; + } + dataCacheConfig_ = null; + if (dataCacheConfigBuilder_ != null) { + dataCacheConfigBuilder_.dispose(); + dataCacheConfigBuilder_ = null; + } + replicationLagMaxSeconds_ = null; + if (replicationLagMaxSecondsBuilder_ != null) { + replicationLagMaxSecondsBuilder_.dispose(); + replicationLagMaxSecondsBuilder_ = null; + } + enableGoogleMlIntegration_ = null; + if (enableGoogleMlIntegrationBuilder_ != null) { + enableGoogleMlIntegrationBuilder_.dispose(); + enableGoogleMlIntegrationBuilder_ = null; + } + enableDataplexIntegration_ = null; + if (enableDataplexIntegrationBuilder_ != null) { + enableDataplexIntegrationBuilder_.dispose(); + enableDataplexIntegrationBuilder_ = null; + } + retainBackupsOnDelete_ = null; + if (retainBackupsOnDeleteBuilder_ != null) { + retainBackupsOnDeleteBuilder_.dispose(); + retainBackupsOnDeleteBuilder_ = null; + } + dataDiskProvisionedIops_ = 0L; + dataDiskProvisionedThroughput_ = 0L; + connectionPoolConfig_ = null; + if (connectionPoolConfigBuilder_ != null) { + connectionPoolConfigBuilder_.dispose(); + connectionPoolConfigBuilder_ = null; + } + finalBackupConfig_ = null; + if (finalBackupConfigBuilder_ != null) { + finalBackupConfigBuilder_.dispose(); + finalBackupConfigBuilder_ = null; + } + readPoolAutoScaleConfig_ = null; + if (readPoolAutoScaleConfigBuilder_ != null) { + readPoolAutoScaleConfigBuilder_.dispose(); + readPoolAutoScaleConfigBuilder_ = null; + } + acceleratedReplicaMode_ = null; + if (acceleratedReplicaModeBuilder_ != null) { + acceleratedReplicaModeBuilder_.dispose(); + acceleratedReplicaModeBuilder_ = null; + } + autoUpgradeEnabled_ = false; + entraidConfig_ = null; + if (entraidConfigBuilder_ != null) { + entraidConfigBuilder_.dispose(); + entraidConfigBuilder_ = null; + } + dataApiAccess_ = 0; + performanceCaptureConfig_ = null; + if (performanceCaptureConfigBuilder_ != null) { + performanceCaptureConfigBuilder_.dispose(); + performanceCaptureConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_Settings_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Settings getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.Settings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Settings build() { + com.google.cloud.sql.v1beta4.Settings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Settings buildPartial() { + com.google.cloud.sql.v1beta4.Settings result = + new com.google.cloud.sql.v1beta4.Settings(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + if (bitField1_ != 0) { + buildPartial1(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1beta4.Settings result) { + if (databaseFlagsBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0)) { + databaseFlags_ = java.util.Collections.unmodifiableList(databaseFlags_); + bitField0_ = (bitField0_ & ~0x00002000); + } + result.databaseFlags_ = databaseFlags_; + } else { + result.databaseFlags_ = databaseFlagsBuilder_.build(); + } + if (denyMaintenancePeriodsBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0)) { + denyMaintenancePeriods_ = java.util.Collections.unmodifiableList(denyMaintenancePeriods_); + bitField0_ = (bitField0_ & ~0x00400000); + } + result.denyMaintenancePeriods_ = denyMaintenancePeriods_; + } else { + result.denyMaintenancePeriods_ = denyMaintenancePeriodsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.Settings result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.settingsVersion_ = + settingsVersionBuilder_ == null ? settingsVersion_ : settingsVersionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + authorizedGaeApplications_.makeImmutable(); + result.authorizedGaeApplications_ = authorizedGaeApplications_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.tier_ = tier_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.userLabels_ = internalGetUserLabels(); + result.userLabels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.availabilityType_ = availabilityType_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pricingPlan_ = pricingPlan_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.replicationType_ = replicationType_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.storageAutoResizeLimit_ = + storageAutoResizeLimitBuilder_ == null + ? storageAutoResizeLimit_ + : storageAutoResizeLimitBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.activationPolicy_ = activationPolicy_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.ipConfiguration_ = + ipConfigurationBuilder_ == null ? ipConfiguration_ : ipConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.storageAutoResize_ = + storageAutoResizeBuilder_ == null + ? storageAutoResize_ + : storageAutoResizeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.locationPreference_ = + locationPreferenceBuilder_ == null + ? locationPreference_ + : locationPreferenceBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.dataDiskType_ = dataDiskType_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.maintenanceWindow_ = + maintenanceWindowBuilder_ == null + ? maintenanceWindow_ + : maintenanceWindowBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.backupConfiguration_ = + backupConfigurationBuilder_ == null + ? backupConfiguration_ + : backupConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.databaseReplicationEnabled_ = + databaseReplicationEnabledBuilder_ == null + ? databaseReplicationEnabled_ + : databaseReplicationEnabledBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.crashSafeReplicationEnabled_ = + crashSafeReplicationEnabledBuilder_ == null + ? crashSafeReplicationEnabled_ + : crashSafeReplicationEnabledBuilder_.build(); + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.dataDiskSizeGb_ = + dataDiskSizeGbBuilder_ == null ? dataDiskSizeGb_ : dataDiskSizeGbBuilder_.build(); + to_bitField0_ |= 0x00000200; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.activeDirectoryConfig_ = + activeDirectoryConfigBuilder_ == null + ? activeDirectoryConfig_ + : activeDirectoryConfigBuilder_.build(); + to_bitField0_ |= 0x00000400; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.collation_ = collation_; + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.insightsConfig_ = + insightsConfigBuilder_ == null ? insightsConfig_ : insightsConfigBuilder_.build(); + to_bitField0_ |= 0x00000800; + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.passwordValidationPolicy_ = + passwordValidationPolicyBuilder_ == null + ? passwordValidationPolicy_ + : passwordValidationPolicyBuilder_.build(); + to_bitField0_ |= 0x00001000; + } + if (((from_bitField0_ & 0x02000000) != 0)) { + result.sqlServerAuditConfig_ = + sqlServerAuditConfigBuilder_ == null + ? sqlServerAuditConfig_ + : sqlServerAuditConfigBuilder_.build(); + to_bitField0_ |= 0x00002000; + } + if (((from_bitField0_ & 0x04000000) != 0)) { + result.edition_ = edition_; + } + if (((from_bitField0_ & 0x08000000) != 0)) { + result.connectorEnforcement_ = connectorEnforcement_; + } + if (((from_bitField0_ & 0x10000000) != 0)) { + result.deletionProtectionEnabled_ = + deletionProtectionEnabledBuilder_ == null + ? deletionProtectionEnabled_ + : deletionProtectionEnabledBuilder_.build(); + to_bitField0_ |= 0x00004000; + } + if (((from_bitField0_ & 0x20000000) != 0)) { + result.timeZone_ = timeZone_; + } + if (((from_bitField0_ & 0x40000000) != 0)) { + result.advancedMachineFeatures_ = + advancedMachineFeaturesBuilder_ == null + ? advancedMachineFeatures_ + : advancedMachineFeaturesBuilder_.build(); + to_bitField0_ |= 0x00008000; + } + if (((from_bitField0_ & 0x80000000) != 0)) { + result.dataCacheConfig_ = + dataCacheConfigBuilder_ == null ? dataCacheConfig_ : dataCacheConfigBuilder_.build(); + to_bitField0_ |= 0x00010000; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartial1(com.google.cloud.sql.v1beta4.Settings result) { + int from_bitField1_ = bitField1_; + int to_bitField0_ = 0; + if (((from_bitField1_ & 0x00000001) != 0)) { + result.replicationLagMaxSeconds_ = + replicationLagMaxSecondsBuilder_ == null + ? replicationLagMaxSeconds_ + : replicationLagMaxSecondsBuilder_.build(); + to_bitField0_ |= 0x00020000; + } + if (((from_bitField1_ & 0x00000002) != 0)) { + result.enableGoogleMlIntegration_ = + enableGoogleMlIntegrationBuilder_ == null + ? enableGoogleMlIntegration_ + : enableGoogleMlIntegrationBuilder_.build(); + to_bitField0_ |= 0x00040000; + } + if (((from_bitField1_ & 0x00000004) != 0)) { + result.enableDataplexIntegration_ = + enableDataplexIntegrationBuilder_ == null + ? enableDataplexIntegration_ + : enableDataplexIntegrationBuilder_.build(); + to_bitField0_ |= 0x00080000; + } + if (((from_bitField1_ & 0x00000008) != 0)) { + result.retainBackupsOnDelete_ = + retainBackupsOnDeleteBuilder_ == null + ? retainBackupsOnDelete_ + : retainBackupsOnDeleteBuilder_.build(); + to_bitField0_ |= 0x00100000; + } + if (((from_bitField1_ & 0x00000010) != 0)) { + result.dataDiskProvisionedIops_ = dataDiskProvisionedIops_; + to_bitField0_ |= 0x00200000; + } + if (((from_bitField1_ & 0x00000020) != 0)) { + result.dataDiskProvisionedThroughput_ = dataDiskProvisionedThroughput_; + to_bitField0_ |= 0x00400000; + } + if (((from_bitField1_ & 0x00000040) != 0)) { + result.connectionPoolConfig_ = + connectionPoolConfigBuilder_ == null + ? connectionPoolConfig_ + : connectionPoolConfigBuilder_.build(); + to_bitField0_ |= 0x00800000; + } + if (((from_bitField1_ & 0x00000080) != 0)) { + result.finalBackupConfig_ = + finalBackupConfigBuilder_ == null + ? finalBackupConfig_ + : finalBackupConfigBuilder_.build(); + to_bitField0_ |= 0x01000000; + } + if (((from_bitField1_ & 0x00000100) != 0)) { + result.readPoolAutoScaleConfig_ = + readPoolAutoScaleConfigBuilder_ == null + ? readPoolAutoScaleConfig_ + : readPoolAutoScaleConfigBuilder_.build(); + to_bitField0_ |= 0x02000000; + } + if (((from_bitField1_ & 0x00000200) != 0)) { + result.acceleratedReplicaMode_ = + acceleratedReplicaModeBuilder_ == null + ? acceleratedReplicaMode_ + : acceleratedReplicaModeBuilder_.build(); + to_bitField0_ |= 0x04000000; + } + if (((from_bitField1_ & 0x00000400) != 0)) { + result.autoUpgradeEnabled_ = autoUpgradeEnabled_; + to_bitField0_ |= 0x08000000; + } + if (((from_bitField1_ & 0x00000800) != 0)) { + result.entraidConfig_ = + entraidConfigBuilder_ == null ? entraidConfig_ : entraidConfigBuilder_.build(); + to_bitField0_ |= 0x10000000; + } + if (((from_bitField1_ & 0x00001000) != 0)) { + result.dataApiAccess_ = dataApiAccess_; + to_bitField0_ |= 0x20000000; + } + if (((from_bitField1_ & 0x00002000) != 0)) { + result.performanceCaptureConfig_ = + performanceCaptureConfigBuilder_ == null + ? performanceCaptureConfig_ + : performanceCaptureConfigBuilder_.build(); + to_bitField0_ |= 0x40000000; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.Settings) { + return mergeFrom((com.google.cloud.sql.v1beta4.Settings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.Settings other) { + if (other == com.google.cloud.sql.v1beta4.Settings.getDefaultInstance()) return this; + if (other.hasSettingsVersion()) { + mergeSettingsVersion(other.getSettingsVersion()); + } + if (!other.authorizedGaeApplications_.isEmpty()) { + if (authorizedGaeApplications_.isEmpty()) { + authorizedGaeApplications_ = other.authorizedGaeApplications_; + bitField0_ |= 0x00000002; + } else { + ensureAuthorizedGaeApplicationsIsMutable(); + authorizedGaeApplications_.addAll(other.authorizedGaeApplications_); + } + onChanged(); + } + if (!other.getTier().isEmpty()) { + tier_ = other.tier_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000008; + onChanged(); + } + internalGetMutableUserLabels().mergeFrom(other.internalGetUserLabels()); + bitField0_ |= 0x00000010; + if (other.availabilityType_ != 0) { + setAvailabilityTypeValue(other.getAvailabilityTypeValue()); + } + if (other.pricingPlan_ != 0) { + setPricingPlanValue(other.getPricingPlanValue()); + } + if (other.replicationType_ != 0) { + setReplicationTypeValue(other.getReplicationTypeValue()); + } + if (other.hasStorageAutoResizeLimit()) { + mergeStorageAutoResizeLimit(other.getStorageAutoResizeLimit()); + } + if (other.activationPolicy_ != 0) { + setActivationPolicyValue(other.getActivationPolicyValue()); + } + if (other.hasIpConfiguration()) { + mergeIpConfiguration(other.getIpConfiguration()); + } + if (other.hasStorageAutoResize()) { + mergeStorageAutoResize(other.getStorageAutoResize()); + } + if (other.hasLocationPreference()) { + mergeLocationPreference(other.getLocationPreference()); + } + if (databaseFlagsBuilder_ == null) { + if (!other.databaseFlags_.isEmpty()) { + if (databaseFlags_.isEmpty()) { + databaseFlags_ = other.databaseFlags_; + bitField0_ = (bitField0_ & ~0x00002000); + } else { + ensureDatabaseFlagsIsMutable(); + databaseFlags_.addAll(other.databaseFlags_); + } + onChanged(); + } + } else { + if (!other.databaseFlags_.isEmpty()) { + if (databaseFlagsBuilder_.isEmpty()) { + databaseFlagsBuilder_.dispose(); + databaseFlagsBuilder_ = null; + databaseFlags_ = other.databaseFlags_; + bitField0_ = (bitField0_ & ~0x00002000); + databaseFlagsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDatabaseFlagsFieldBuilder() + : null; + } else { + databaseFlagsBuilder_.addAllMessages(other.databaseFlags_); + } + } + } + if (other.dataDiskType_ != 0) { + setDataDiskTypeValue(other.getDataDiskTypeValue()); + } + if (other.hasMaintenanceWindow()) { + mergeMaintenanceWindow(other.getMaintenanceWindow()); + } + if (other.hasBackupConfiguration()) { + mergeBackupConfiguration(other.getBackupConfiguration()); + } + if (other.hasDatabaseReplicationEnabled()) { + mergeDatabaseReplicationEnabled(other.getDatabaseReplicationEnabled()); + } + if (other.hasCrashSafeReplicationEnabled()) { + mergeCrashSafeReplicationEnabled(other.getCrashSafeReplicationEnabled()); + } + if (other.hasDataDiskSizeGb()) { + mergeDataDiskSizeGb(other.getDataDiskSizeGb()); + } + if (other.hasActiveDirectoryConfig()) { + mergeActiveDirectoryConfig(other.getActiveDirectoryConfig()); + } + if (!other.getCollation().isEmpty()) { + collation_ = other.collation_; + bitField0_ |= 0x00200000; + onChanged(); + } + if (denyMaintenancePeriodsBuilder_ == null) { + if (!other.denyMaintenancePeriods_.isEmpty()) { + if (denyMaintenancePeriods_.isEmpty()) { + denyMaintenancePeriods_ = other.denyMaintenancePeriods_; + bitField0_ = (bitField0_ & ~0x00400000); + } else { + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.addAll(other.denyMaintenancePeriods_); + } + onChanged(); + } + } else { + if (!other.denyMaintenancePeriods_.isEmpty()) { + if (denyMaintenancePeriodsBuilder_.isEmpty()) { + denyMaintenancePeriodsBuilder_.dispose(); + denyMaintenancePeriodsBuilder_ = null; + denyMaintenancePeriods_ = other.denyMaintenancePeriods_; + bitField0_ = (bitField0_ & ~0x00400000); + denyMaintenancePeriodsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDenyMaintenancePeriodsFieldBuilder() + : null; + } else { + denyMaintenancePeriodsBuilder_.addAllMessages(other.denyMaintenancePeriods_); + } + } + } + if (other.hasInsightsConfig()) { + mergeInsightsConfig(other.getInsightsConfig()); + } + if (other.hasPasswordValidationPolicy()) { + mergePasswordValidationPolicy(other.getPasswordValidationPolicy()); + } + if (other.hasSqlServerAuditConfig()) { + mergeSqlServerAuditConfig(other.getSqlServerAuditConfig()); + } + if (other.edition_ != 0) { + setEditionValue(other.getEditionValue()); + } + if (other.connectorEnforcement_ != 0) { + setConnectorEnforcementValue(other.getConnectorEnforcementValue()); + } + if (other.hasDeletionProtectionEnabled()) { + mergeDeletionProtectionEnabled(other.getDeletionProtectionEnabled()); + } + if (!other.getTimeZone().isEmpty()) { + timeZone_ = other.timeZone_; + bitField0_ |= 0x20000000; + onChanged(); + } + if (other.hasAdvancedMachineFeatures()) { + mergeAdvancedMachineFeatures(other.getAdvancedMachineFeatures()); + } + if (other.hasDataCacheConfig()) { + mergeDataCacheConfig(other.getDataCacheConfig()); + } + if (other.hasReplicationLagMaxSeconds()) { + mergeReplicationLagMaxSeconds(other.getReplicationLagMaxSeconds()); + } + if (other.hasEnableGoogleMlIntegration()) { + mergeEnableGoogleMlIntegration(other.getEnableGoogleMlIntegration()); + } + if (other.hasEnableDataplexIntegration()) { + mergeEnableDataplexIntegration(other.getEnableDataplexIntegration()); + } + if (other.hasRetainBackupsOnDelete()) { + mergeRetainBackupsOnDelete(other.getRetainBackupsOnDelete()); + } + if (other.hasDataDiskProvisionedIops()) { + setDataDiskProvisionedIops(other.getDataDiskProvisionedIops()); + } + if (other.hasDataDiskProvisionedThroughput()) { + setDataDiskProvisionedThroughput(other.getDataDiskProvisionedThroughput()); + } + if (other.hasConnectionPoolConfig()) { + mergeConnectionPoolConfig(other.getConnectionPoolConfig()); + } + if (other.hasFinalBackupConfig()) { + mergeFinalBackupConfig(other.getFinalBackupConfig()); + } + if (other.hasReadPoolAutoScaleConfig()) { + mergeReadPoolAutoScaleConfig(other.getReadPoolAutoScaleConfig()); + } + if (other.hasAcceleratedReplicaMode()) { + mergeAcceleratedReplicaMode(other.getAcceleratedReplicaMode()); + } + if (other.hasAutoUpgradeEnabled()) { + setAutoUpgradeEnabled(other.getAutoUpgradeEnabled()); + } + if (other.hasEntraidConfig()) { + mergeEntraidConfig(other.getEntraidConfig()); + } + if (other.hasDataApiAccess()) { + setDataApiAccessValue(other.getDataApiAccessValue()); + } + if (other.hasPerformanceCaptureConfig()) { + mergePerformanceCaptureConfig(other.getPerformanceCaptureConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + internalGetSettingsVersionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAuthorizedGaeApplicationsIsMutable(); + authorizedGaeApplications_.add(s); + break; + } // case 18 + case 26: + { + tier_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + com.google.protobuf.MapEntry userLabels__ = + input.readMessage( + UserLabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableUserLabels() + .getMutableMap() + .put(userLabels__.getKey(), userLabels__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + availabilityType_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: + { + pricingPlan_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: + { + replicationType_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 74: + { + input.readMessage( + internalGetStorageAutoResizeLimitFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 80: + { + activationPolicy_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 90: + { + input.readMessage( + internalGetIpConfigurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + input.readMessage( + internalGetStorageAutoResizeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 106: + { + input.readMessage( + internalGetLocationPreferenceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 114: + { + com.google.cloud.sql.v1beta4.DatabaseFlags m = + input.readMessage( + com.google.cloud.sql.v1beta4.DatabaseFlags.parser(), extensionRegistry); + if (databaseFlagsBuilder_ == null) { + ensureDatabaseFlagsIsMutable(); + databaseFlags_.add(m); + } else { + databaseFlagsBuilder_.addMessage(m); + } + break; + } // case 114 + case 120: + { + dataDiskType_ = input.readEnum(); + bitField0_ |= 0x00004000; + break; + } // case 120 + case 130: + { + input.readMessage( + internalGetMaintenanceWindowFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00008000; + break; + } // case 130 + case 138: + { + input.readMessage( + internalGetBackupConfigurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 138 + case 146: + { + input.readMessage( + internalGetDatabaseReplicationEnabledFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 146 + case 154: + { + input.readMessage( + internalGetCrashSafeReplicationEnabledFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 154 + case 162: + { + input.readMessage( + internalGetDataDiskSizeGbFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 162 + case 178: + { + input.readMessage( + internalGetActiveDirectoryConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00100000; + break; + } // case 178 + case 186: + { + collation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00200000; + break; + } // case 186 + case 194: + { + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod m = + input.readMessage( + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.parser(), + extensionRegistry); + if (denyMaintenancePeriodsBuilder_ == null) { + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.add(m); + } else { + denyMaintenancePeriodsBuilder_.addMessage(m); + } + break; + } // case 194 + case 202: + { + input.readMessage( + internalGetInsightsConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00800000; + break; + } // case 202 + case 218: + { + input.readMessage( + internalGetPasswordValidationPolicyFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x01000000; + break; + } // case 218 + case 234: + { + input.readMessage( + internalGetSqlServerAuditConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x02000000; + break; + } // case 234 + case 256: + { + connectorEnforcement_ = input.readEnum(); + bitField0_ |= 0x08000000; + break; + } // case 256 + case 266: + { + input.readMessage( + internalGetDeletionProtectionEnabledFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x10000000; + break; + } // case 266 + case 274: + { + timeZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x20000000; + break; + } // case 274 + case 282: + { + input.readMessage( + internalGetAdvancedMachineFeaturesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x40000000; + break; + } // case 282 + case 298: + { + input.readMessage( + internalGetDataCacheConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x80000000; + break; + } // case 298 + case 304: + { + edition_ = input.readEnum(); + bitField0_ |= 0x04000000; + break; + } // case 304 + case 314: + { + input.readMessage( + internalGetReplicationLagMaxSecondsFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000001; + break; + } // case 314 + case 322: + { + input.readMessage( + internalGetEnableGoogleMlIntegrationFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000002; + break; + } // case 322 + case 330: + { + input.readMessage( + internalGetEnableDataplexIntegrationFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000004; + break; + } // case 330 + case 338: + { + input.readMessage( + internalGetRetainBackupsOnDeleteFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000008; + break; + } // case 338 + case 344: + { + dataDiskProvisionedIops_ = input.readInt64(); + bitField1_ |= 0x00000010; + break; + } // case 344 + case 352: + { + dataDiskProvisionedThroughput_ = input.readInt64(); + bitField1_ |= 0x00000020; + break; + } // case 352 + case 362: + { + input.readMessage( + internalGetConnectionPoolConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000040; + break; + } // case 362 + case 378: + { + input.readMessage( + internalGetFinalBackupConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000080; + break; + } // case 378 + case 386: + { + input.readMessage( + internalGetReadPoolAutoScaleConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000100; + break; + } // case 386 + case 394: + { + input.readMessage( + internalGetAcceleratedReplicaModeFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000200; + break; + } // case 394 + case 400: + { + autoUpgradeEnabled_ = input.readBool(); + bitField1_ |= 0x00000400; + break; + } // case 400 + case 418: + { + input.readMessage( + internalGetEntraidConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000800; + break; + } // case 418 + case 424: + { + dataApiAccess_ = input.readEnum(); + bitField1_ |= 0x00001000; + break; + } // case 424 + case 434: + { + input.readMessage( + internalGetPerformanceCaptureConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00002000; + break; + } // case 434 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 bitField1_; + + private com.google.protobuf.Int64Value settingsVersion_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + settingsVersionBuilder_; + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + * + * @return Whether the settingsVersion field is set. + */ + public boolean hasSettingsVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + * + * @return The settingsVersion. + */ + public com.google.protobuf.Int64Value getSettingsVersion() { + if (settingsVersionBuilder_ == null) { + return settingsVersion_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : settingsVersion_; + } else { + return settingsVersionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + public Builder setSettingsVersion(com.google.protobuf.Int64Value value) { + if (settingsVersionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + settingsVersion_ = value; + } else { + settingsVersionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + public Builder setSettingsVersion(com.google.protobuf.Int64Value.Builder builderForValue) { + if (settingsVersionBuilder_ == null) { + settingsVersion_ = builderForValue.build(); + } else { + settingsVersionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + public Builder mergeSettingsVersion(com.google.protobuf.Int64Value value) { + if (settingsVersionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && settingsVersion_ != null + && settingsVersion_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getSettingsVersionBuilder().mergeFrom(value); + } else { + settingsVersion_ = value; + } + } else { + settingsVersionBuilder_.mergeFrom(value); + } + if (settingsVersion_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + public Builder clearSettingsVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + settingsVersion_ = null; + if (settingsVersionBuilder_ != null) { + settingsVersionBuilder_.dispose(); + settingsVersionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + public com.google.protobuf.Int64Value.Builder getSettingsVersionBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetSettingsVersionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + public com.google.protobuf.Int64ValueOrBuilder getSettingsVersionOrBuilder() { + if (settingsVersionBuilder_ != null) { + return settingsVersionBuilder_.getMessageOrBuilder(); + } else { + return settingsVersion_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : settingsVersion_; + } + } + + /** + * + * + *
+     * The version of instance settings. This is a required field for update
+     * method to make sure concurrent updates are handled properly. During update,
+     * use the most recent settingsVersion value for this instance and do not try
+     * to update this value.
+     * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetSettingsVersionFieldBuilder() { + if (settingsVersionBuilder_ == null) { + settingsVersionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getSettingsVersion(), getParentForChildren(), isClean()); + settingsVersion_ = null; + } + return settingsVersionBuilder_; + } + + private com.google.protobuf.LazyStringArrayList authorizedGaeApplications_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAuthorizedGaeApplicationsIsMutable() { + if (!authorizedGaeApplications_.isModifiable()) { + authorizedGaeApplications_ = + new com.google.protobuf.LazyStringArrayList(authorizedGaeApplications_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @return A list containing the authorizedGaeApplications. + */ + @java.lang.Deprecated + public com.google.protobuf.ProtocolStringList getAuthorizedGaeApplicationsList() { + authorizedGaeApplications_.makeImmutable(); + return authorizedGaeApplications_; + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @return The count of authorizedGaeApplications. + */ + @java.lang.Deprecated + public int getAuthorizedGaeApplicationsCount() { + return authorizedGaeApplications_.size(); + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @param index The index of the element to return. + * @return The authorizedGaeApplications at the given index. + */ + @java.lang.Deprecated + public java.lang.String getAuthorizedGaeApplications(int index) { + return authorizedGaeApplications_.get(index); + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @param index The index of the value to return. + * @return The bytes of the authorizedGaeApplications at the given index. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getAuthorizedGaeApplicationsBytes(int index) { + return authorizedGaeApplications_.getByteString(index); + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @param index The index to set the value at. + * @param value The authorizedGaeApplications to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setAuthorizedGaeApplications(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizedGaeApplicationsIsMutable(); + authorizedGaeApplications_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @param value The authorizedGaeApplications to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addAuthorizedGaeApplications(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizedGaeApplicationsIsMutable(); + authorizedGaeApplications_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @param values The authorizedGaeApplications to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addAllAuthorizedGaeApplications(java.lang.Iterable values) { + ensureAuthorizedGaeApplicationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, authorizedGaeApplications_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearAuthorizedGaeApplications() { + authorizedGaeApplications_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * The App Engine app IDs that can access this instance.
+     * (Deprecated) Applied to First Generation instances only.
+     * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @param value The bytes of the authorizedGaeApplications to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addAuthorizedGaeApplicationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAuthorizedGaeApplicationsIsMutable(); + authorizedGaeApplications_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object tier_ = ""; + + /** + * + * + *
+     * The tier (or machine type) for this instance, for example
+     * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+     * 
+ * + * string tier = 3; + * + * @return The tier. + */ + public java.lang.String getTier() { + java.lang.Object ref = tier_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tier_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The tier (or machine type) for this instance, for example
+     * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+     * 
+ * + * string tier = 3; + * + * @return The bytes for tier. + */ + public com.google.protobuf.ByteString getTierBytes() { + java.lang.Object ref = tier_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The tier (or machine type) for this instance, for example
+     * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+     * 
+ * + * string tier = 3; + * + * @param value The tier to set. + * @return This builder for chaining. + */ + public Builder setTier(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tier_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The tier (or machine type) for this instance, for example
+     * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+     * 
+ * + * string tier = 3; + * + * @return This builder for chaining. + */ + public Builder clearTier() { + tier_ = getDefaultInstance().getTier(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The tier (or machine type) for this instance, for example
+     * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+     * 
+ * + * string tier = 3; + * + * @param value The bytes for tier to set. + * @return This builder for chaining. + */ + public Builder setTierBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tier_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#settings`.
+     * 
+ * + * string kind = 4; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#settings`.
+     * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#settings`.
+     * 
+ * + * string kind = 4; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#settings`.
+     * 
+ * + * string kind = 4; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#settings`.
+     * 
+ * + * string kind = 4; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.MapField userLabels_; + + private com.google.protobuf.MapField + internalGetUserLabels() { + if (userLabels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + UserLabelsDefaultEntryHolder.defaultEntry); + } + return userLabels_; + } + + private com.google.protobuf.MapField + internalGetMutableUserLabels() { + if (userLabels_ == null) { + userLabels_ = + com.google.protobuf.MapField.newMapField(UserLabelsDefaultEntryHolder.defaultEntry); + } + if (!userLabels_.isMutable()) { + userLabels_ = userLabels_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return userLabels_; + } + + public int getUserLabelsCount() { + return internalGetUserLabels().getMap().size(); + } + + /** + * + * + *
+     * User-provided labels, represented as a dictionary where each label is a
+     * single key value pair.
+     * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); + } + + /** + * + * + *
+     * User-provided labels, represented as a dictionary where each label is a
+     * single key value pair.
+     * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); + } + + /** + * + * + *
+     * User-provided labels, represented as a dictionary where each label is a
+     * single key value pair.
+     * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * User-provided labels, represented as a dictionary where each label is a
+     * single key value pair.
+     * 
+ * + * map<string, string> user_labels = 5; + */ + @java.lang.Override + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearUserLabels() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableUserLabels().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * User-provided labels, represented as a dictionary where each label is a
+     * single key value pair.
+     * 
+ * + * map<string, string> user_labels = 5; + */ + public Builder removeUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableUserLabels().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableUserLabels() { + bitField0_ |= 0x00000010; + return internalGetMutableUserLabels().getMutableMap(); + } + + /** + * + * + *
+     * User-provided labels, represented as a dictionary where each label is a
+     * single key value pair.
+     * 
+ * + * map<string, string> user_labels = 5; + */ + public Builder putUserLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableUserLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + + /** + * + * + *
+     * User-provided labels, represented as a dictionary where each label is a
+     * single key value pair.
+     * 
+ * + * map<string, string> user_labels = 5; + */ + public Builder putAllUserLabels(java.util.Map values) { + internalGetMutableUserLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private int availabilityType_ = 0; + + /** + * + * + *
+     * Availability type. Potential values:
+     * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+     * zone affect data accessibility.
+     * *  `REGIONAL`: The instance can serve data from more than one zone in a
+     * region (it is highly available)./
+     *
+     * For more information, see [Overview of the High Availability
+     * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlAvailabilityType availability_type = 6; + * + * @return The enum numeric value on the wire for availabilityType. + */ + @java.lang.Override + public int getAvailabilityTypeValue() { + return availabilityType_; + } + + /** + * + * + *
+     * Availability type. Potential values:
+     * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+     * zone affect data accessibility.
+     * *  `REGIONAL`: The instance can serve data from more than one zone in a
+     * region (it is highly available)./
+     *
+     * For more information, see [Overview of the High Availability
+     * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlAvailabilityType availability_type = 6; + * + * @param value The enum numeric value on the wire for availabilityType to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityTypeValue(int value) { + availabilityType_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Availability type. Potential values:
+     * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+     * zone affect data accessibility.
+     * *  `REGIONAL`: The instance can serve data from more than one zone in a
+     * region (it is highly available)./
+     *
+     * For more information, see [Overview of the High Availability
+     * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlAvailabilityType availability_type = 6; + * + * @return The availabilityType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlAvailabilityType getAvailabilityType() { + com.google.cloud.sql.v1beta4.SqlAvailabilityType result = + com.google.cloud.sql.v1beta4.SqlAvailabilityType.forNumber(availabilityType_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlAvailabilityType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Availability type. Potential values:
+     * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+     * zone affect data accessibility.
+     * *  `REGIONAL`: The instance can serve data from more than one zone in a
+     * region (it is highly available)./
+     *
+     * For more information, see [Overview of the High Availability
+     * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlAvailabilityType availability_type = 6; + * + * @param value The availabilityType to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityType(com.google.cloud.sql.v1beta4.SqlAvailabilityType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + availabilityType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Availability type. Potential values:
+     * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+     * zone affect data accessibility.
+     * *  `REGIONAL`: The instance can serve data from more than one zone in a
+     * region (it is highly available)./
+     *
+     * For more information, see [Overview of the High Availability
+     * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlAvailabilityType availability_type = 6; + * + * @return This builder for chaining. + */ + public Builder clearAvailabilityType() { + bitField0_ = (bitField0_ & ~0x00000020); + availabilityType_ = 0; + onChanged(); + return this; + } + + private int pricingPlan_ = 0; + + /** + * + * + *
+     * The pricing plan for this instance. This can be either `PER_USE` or
+     * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlPricingPlan pricing_plan = 7; + * + * @return The enum numeric value on the wire for pricingPlan. + */ + @java.lang.Override + public int getPricingPlanValue() { + return pricingPlan_; + } + + /** + * + * + *
+     * The pricing plan for this instance. This can be either `PER_USE` or
+     * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlPricingPlan pricing_plan = 7; + * + * @param value The enum numeric value on the wire for pricingPlan to set. + * @return This builder for chaining. + */ + public Builder setPricingPlanValue(int value) { + pricingPlan_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The pricing plan for this instance. This can be either `PER_USE` or
+     * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlPricingPlan pricing_plan = 7; + * + * @return The pricingPlan. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlPricingPlan getPricingPlan() { + com.google.cloud.sql.v1beta4.SqlPricingPlan result = + com.google.cloud.sql.v1beta4.SqlPricingPlan.forNumber(pricingPlan_); + return result == null ? com.google.cloud.sql.v1beta4.SqlPricingPlan.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The pricing plan for this instance. This can be either `PER_USE` or
+     * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlPricingPlan pricing_plan = 7; + * + * @param value The pricingPlan to set. + * @return This builder for chaining. + */ + public Builder setPricingPlan(com.google.cloud.sql.v1beta4.SqlPricingPlan value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + pricingPlan_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The pricing plan for this instance. This can be either `PER_USE` or
+     * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlPricingPlan pricing_plan = 7; + * + * @return This builder for chaining. + */ + public Builder clearPricingPlan() { + bitField0_ = (bitField0_ & ~0x00000040); + pricingPlan_ = 0; + onChanged(); + return this; + } + + private int replicationType_ = 0; + + /** + * + * + *
+     * The type of replication this instance uses. This can be either
+     * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+     * applicable to First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.replication_type is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3282 + * @return The enum numeric value on the wire for replicationType. + */ + @java.lang.Override + @java.lang.Deprecated + public int getReplicationTypeValue() { + return replicationType_; + } + + /** + * + * + *
+     * The type of replication this instance uses. This can be either
+     * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+     * applicable to First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.replication_type is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3282 + * @param value The enum numeric value on the wire for replicationType to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setReplicationTypeValue(int value) { + replicationType_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of replication this instance uses. This can be either
+     * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+     * applicable to First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.replication_type is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3282 + * @return The replicationType. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.sql.v1beta4.SqlReplicationType getReplicationType() { + com.google.cloud.sql.v1beta4.SqlReplicationType result = + com.google.cloud.sql.v1beta4.SqlReplicationType.forNumber(replicationType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlReplicationType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The type of replication this instance uses. This can be either
+     * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+     * applicable to First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.replication_type is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3282 + * @param value The replicationType to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setReplicationType(com.google.cloud.sql.v1beta4.SqlReplicationType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + replicationType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of replication this instance uses. This can be either
+     * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+     * applicable to First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.replication_type is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3282 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearReplicationType() { + bitField0_ = (bitField0_ & ~0x00000080); + replicationType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Int64Value storageAutoResizeLimit_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + storageAutoResizeLimitBuilder_; + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + * + * @return Whether the storageAutoResizeLimit field is set. + */ + public boolean hasStorageAutoResizeLimit() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + * + * @return The storageAutoResizeLimit. + */ + public com.google.protobuf.Int64Value getStorageAutoResizeLimit() { + if (storageAutoResizeLimitBuilder_ == null) { + return storageAutoResizeLimit_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : storageAutoResizeLimit_; + } else { + return storageAutoResizeLimitBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + public Builder setStorageAutoResizeLimit(com.google.protobuf.Int64Value value) { + if (storageAutoResizeLimitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + storageAutoResizeLimit_ = value; + } else { + storageAutoResizeLimitBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + public Builder setStorageAutoResizeLimit( + com.google.protobuf.Int64Value.Builder builderForValue) { + if (storageAutoResizeLimitBuilder_ == null) { + storageAutoResizeLimit_ = builderForValue.build(); + } else { + storageAutoResizeLimitBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + public Builder mergeStorageAutoResizeLimit(com.google.protobuf.Int64Value value) { + if (storageAutoResizeLimitBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && storageAutoResizeLimit_ != null + && storageAutoResizeLimit_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getStorageAutoResizeLimitBuilder().mergeFrom(value); + } else { + storageAutoResizeLimit_ = value; + } + } else { + storageAutoResizeLimitBuilder_.mergeFrom(value); + } + if (storageAutoResizeLimit_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + public Builder clearStorageAutoResizeLimit() { + bitField0_ = (bitField0_ & ~0x00000100); + storageAutoResizeLimit_ = null; + if (storageAutoResizeLimitBuilder_ != null) { + storageAutoResizeLimitBuilder_.dispose(); + storageAutoResizeLimitBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + public com.google.protobuf.Int64Value.Builder getStorageAutoResizeLimitBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetStorageAutoResizeLimitFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + public com.google.protobuf.Int64ValueOrBuilder getStorageAutoResizeLimitOrBuilder() { + if (storageAutoResizeLimitBuilder_ != null) { + return storageAutoResizeLimitBuilder_.getMessageOrBuilder(); + } else { + return storageAutoResizeLimit_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : storageAutoResizeLimit_; + } + } + + /** + * + * + *
+     * The maximum size to which storage capacity can be automatically increased.
+     * The default value is 0, which specifies that there is no limit.
+     * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetStorageAutoResizeLimitFieldBuilder() { + if (storageAutoResizeLimitBuilder_ == null) { + storageAutoResizeLimitBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getStorageAutoResizeLimit(), getParentForChildren(), isClean()); + storageAutoResizeLimit_ = null; + } + return storageAutoResizeLimitBuilder_; + } + + private int activationPolicy_ = 0; + + /** + * + * + *
+     * The activation policy specifies when the instance is activated; it is
+     * applicable only when the instance state is RUNNABLE. Valid values:
+     * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+     * connection requests.
+     * *  `NEVER`: The instance is off; it is not activated, even if a
+     * connection request arrives.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings.SqlActivationPolicy activation_policy = 10; + * + * @return The enum numeric value on the wire for activationPolicy. + */ + @java.lang.Override + public int getActivationPolicyValue() { + return activationPolicy_; + } + + /** + * + * + *
+     * The activation policy specifies when the instance is activated; it is
+     * applicable only when the instance state is RUNNABLE. Valid values:
+     * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+     * connection requests.
+     * *  `NEVER`: The instance is off; it is not activated, even if a
+     * connection request arrives.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings.SqlActivationPolicy activation_policy = 10; + * + * @param value The enum numeric value on the wire for activationPolicy to set. + * @return This builder for chaining. + */ + public Builder setActivationPolicyValue(int value) { + activationPolicy_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The activation policy specifies when the instance is activated; it is
+     * applicable only when the instance state is RUNNABLE. Valid values:
+     * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+     * connection requests.
+     * *  `NEVER`: The instance is off; it is not activated, even if a
+     * connection request arrives.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings.SqlActivationPolicy activation_policy = 10; + * + * @return The activationPolicy. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy getActivationPolicy() { + com.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy result = + com.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy.forNumber(activationPolicy_); + return result == null + ? com.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The activation policy specifies when the instance is activated; it is
+     * applicable only when the instance state is RUNNABLE. Valid values:
+     * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+     * connection requests.
+     * *  `NEVER`: The instance is off; it is not activated, even if a
+     * connection request arrives.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings.SqlActivationPolicy activation_policy = 10; + * + * @param value The activationPolicy to set. + * @return This builder for chaining. + */ + public Builder setActivationPolicy( + com.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + activationPolicy_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The activation policy specifies when the instance is activated; it is
+     * applicable only when the instance state is RUNNABLE. Valid values:
+     * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+     * connection requests.
+     * *  `NEVER`: The instance is off; it is not activated, even if a
+     * connection request arrives.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings.SqlActivationPolicy activation_policy = 10; + * + * @return This builder for chaining. + */ + public Builder clearActivationPolicy() { + bitField0_ = (bitField0_ & ~0x00000200); + activationPolicy_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.IpConfiguration ipConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.IpConfiguration, + com.google.cloud.sql.v1beta4.IpConfiguration.Builder, + com.google.cloud.sql.v1beta4.IpConfigurationOrBuilder> + ipConfigurationBuilder_; + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + * + * @return Whether the ipConfiguration field is set. + */ + public boolean hasIpConfiguration() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + * + * @return The ipConfiguration. + */ + public com.google.cloud.sql.v1beta4.IpConfiguration getIpConfiguration() { + if (ipConfigurationBuilder_ == null) { + return ipConfiguration_ == null + ? com.google.cloud.sql.v1beta4.IpConfiguration.getDefaultInstance() + : ipConfiguration_; + } else { + return ipConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + */ + public Builder setIpConfiguration(com.google.cloud.sql.v1beta4.IpConfiguration value) { + if (ipConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ipConfiguration_ = value; + } else { + ipConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + */ + public Builder setIpConfiguration( + com.google.cloud.sql.v1beta4.IpConfiguration.Builder builderForValue) { + if (ipConfigurationBuilder_ == null) { + ipConfiguration_ = builderForValue.build(); + } else { + ipConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + */ + public Builder mergeIpConfiguration(com.google.cloud.sql.v1beta4.IpConfiguration value) { + if (ipConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && ipConfiguration_ != null + && ipConfiguration_ + != com.google.cloud.sql.v1beta4.IpConfiguration.getDefaultInstance()) { + getIpConfigurationBuilder().mergeFrom(value); + } else { + ipConfiguration_ = value; + } + } else { + ipConfigurationBuilder_.mergeFrom(value); + } + if (ipConfiguration_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + */ + public Builder clearIpConfiguration() { + bitField0_ = (bitField0_ & ~0x00000400); + ipConfiguration_ = null; + if (ipConfigurationBuilder_ != null) { + ipConfigurationBuilder_.dispose(); + ipConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + */ + public com.google.cloud.sql.v1beta4.IpConfiguration.Builder getIpConfigurationBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return internalGetIpConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + */ + public com.google.cloud.sql.v1beta4.IpConfigurationOrBuilder getIpConfigurationOrBuilder() { + if (ipConfigurationBuilder_ != null) { + return ipConfigurationBuilder_.getMessageOrBuilder(); + } else { + return ipConfiguration_ == null + ? com.google.cloud.sql.v1beta4.IpConfiguration.getDefaultInstance() + : ipConfiguration_; + } + } + + /** + * + * + *
+     * The settings for IP Management. This allows to enable or disable the
+     * instance IP and manage which external networks can connect to the instance.
+     * The IPv4 address cannot be disabled for Second Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.IpConfiguration, + com.google.cloud.sql.v1beta4.IpConfiguration.Builder, + com.google.cloud.sql.v1beta4.IpConfigurationOrBuilder> + internalGetIpConfigurationFieldBuilder() { + if (ipConfigurationBuilder_ == null) { + ipConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.IpConfiguration, + com.google.cloud.sql.v1beta4.IpConfiguration.Builder, + com.google.cloud.sql.v1beta4.IpConfigurationOrBuilder>( + getIpConfiguration(), getParentForChildren(), isClean()); + ipConfiguration_ = null; + } + return ipConfigurationBuilder_; + } + + private com.google.protobuf.BoolValue storageAutoResize_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + storageAutoResizeBuilder_; + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + * + * @return Whether the storageAutoResize field is set. + */ + public boolean hasStorageAutoResize() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + * + * @return The storageAutoResize. + */ + public com.google.protobuf.BoolValue getStorageAutoResize() { + if (storageAutoResizeBuilder_ == null) { + return storageAutoResize_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : storageAutoResize_; + } else { + return storageAutoResizeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + public Builder setStorageAutoResize(com.google.protobuf.BoolValue value) { + if (storageAutoResizeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + storageAutoResize_ = value; + } else { + storageAutoResizeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + public Builder setStorageAutoResize(com.google.protobuf.BoolValue.Builder builderForValue) { + if (storageAutoResizeBuilder_ == null) { + storageAutoResize_ = builderForValue.build(); + } else { + storageAutoResizeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + public Builder mergeStorageAutoResize(com.google.protobuf.BoolValue value) { + if (storageAutoResizeBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && storageAutoResize_ != null + && storageAutoResize_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getStorageAutoResizeBuilder().mergeFrom(value); + } else { + storageAutoResize_ = value; + } + } else { + storageAutoResizeBuilder_.mergeFrom(value); + } + if (storageAutoResize_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + public Builder clearStorageAutoResize() { + bitField0_ = (bitField0_ & ~0x00000800); + storageAutoResize_ = null; + if (storageAutoResizeBuilder_ != null) { + storageAutoResizeBuilder_.dispose(); + storageAutoResizeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + public com.google.protobuf.BoolValue.Builder getStorageAutoResizeBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return internalGetStorageAutoResizeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + public com.google.protobuf.BoolValueOrBuilder getStorageAutoResizeOrBuilder() { + if (storageAutoResizeBuilder_ != null) { + return storageAutoResizeBuilder_.getMessageOrBuilder(); + } else { + return storageAutoResize_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : storageAutoResize_; + } + } + + /** + * + * + *
+     * Configuration to increase storage size automatically. The default value is
+     * true.
+     * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetStorageAutoResizeFieldBuilder() { + if (storageAutoResizeBuilder_ == null) { + storageAutoResizeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getStorageAutoResize(), getParentForChildren(), isClean()); + storageAutoResize_ = null; + } + return storageAutoResizeBuilder_; + } + + private com.google.cloud.sql.v1beta4.LocationPreference locationPreference_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.LocationPreference, + com.google.cloud.sql.v1beta4.LocationPreference.Builder, + com.google.cloud.sql.v1beta4.LocationPreferenceOrBuilder> + locationPreferenceBuilder_; + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + * + * @return Whether the locationPreference field is set. + */ + public boolean hasLocationPreference() { + return ((bitField0_ & 0x00001000) != 0); + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + * + * @return The locationPreference. + */ + public com.google.cloud.sql.v1beta4.LocationPreference getLocationPreference() { + if (locationPreferenceBuilder_ == null) { + return locationPreference_ == null + ? com.google.cloud.sql.v1beta4.LocationPreference.getDefaultInstance() + : locationPreference_; + } else { + return locationPreferenceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + */ + public Builder setLocationPreference(com.google.cloud.sql.v1beta4.LocationPreference value) { + if (locationPreferenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + locationPreference_ = value; + } else { + locationPreferenceBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + */ + public Builder setLocationPreference( + com.google.cloud.sql.v1beta4.LocationPreference.Builder builderForValue) { + if (locationPreferenceBuilder_ == null) { + locationPreference_ = builderForValue.build(); + } else { + locationPreferenceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + */ + public Builder mergeLocationPreference(com.google.cloud.sql.v1beta4.LocationPreference value) { + if (locationPreferenceBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && locationPreference_ != null + && locationPreference_ + != com.google.cloud.sql.v1beta4.LocationPreference.getDefaultInstance()) { + getLocationPreferenceBuilder().mergeFrom(value); + } else { + locationPreference_ = value; + } + } else { + locationPreferenceBuilder_.mergeFrom(value); + } + if (locationPreference_ != null) { + bitField0_ |= 0x00001000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + */ + public Builder clearLocationPreference() { + bitField0_ = (bitField0_ & ~0x00001000); + locationPreference_ = null; + if (locationPreferenceBuilder_ != null) { + locationPreferenceBuilder_.dispose(); + locationPreferenceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + */ + public com.google.cloud.sql.v1beta4.LocationPreference.Builder getLocationPreferenceBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return internalGetLocationPreferenceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + */ + public com.google.cloud.sql.v1beta4.LocationPreferenceOrBuilder + getLocationPreferenceOrBuilder() { + if (locationPreferenceBuilder_ != null) { + return locationPreferenceBuilder_.getMessageOrBuilder(); + } else { + return locationPreference_ == null + ? com.google.cloud.sql.v1beta4.LocationPreference.getDefaultInstance() + : locationPreference_; + } + } + + /** + * + * + *
+     * The location preference settings. This allows the instance to be located as
+     * near as possible to either an App Engine app or Compute Engine zone for
+     * better performance. App Engine co-location was only applicable to First
+     * Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.LocationPreference, + com.google.cloud.sql.v1beta4.LocationPreference.Builder, + com.google.cloud.sql.v1beta4.LocationPreferenceOrBuilder> + internalGetLocationPreferenceFieldBuilder() { + if (locationPreferenceBuilder_ == null) { + locationPreferenceBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.LocationPreference, + com.google.cloud.sql.v1beta4.LocationPreference.Builder, + com.google.cloud.sql.v1beta4.LocationPreferenceOrBuilder>( + getLocationPreference(), getParentForChildren(), isClean()); + locationPreference_ = null; + } + return locationPreferenceBuilder_; + } + + private java.util.List databaseFlags_ = + java.util.Collections.emptyList(); + + private void ensureDatabaseFlagsIsMutable() { + if (!((bitField0_ & 0x00002000) != 0)) { + databaseFlags_ = + new java.util.ArrayList(databaseFlags_); + bitField0_ |= 0x00002000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseFlags, + com.google.cloud.sql.v1beta4.DatabaseFlags.Builder, + com.google.cloud.sql.v1beta4.DatabaseFlagsOrBuilder> + databaseFlagsBuilder_; + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public java.util.List getDatabaseFlagsList() { + if (databaseFlagsBuilder_ == null) { + return java.util.Collections.unmodifiableList(databaseFlags_); + } else { + return databaseFlagsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public int getDatabaseFlagsCount() { + if (databaseFlagsBuilder_ == null) { + return databaseFlags_.size(); + } else { + return databaseFlagsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public com.google.cloud.sql.v1beta4.DatabaseFlags getDatabaseFlags(int index) { + if (databaseFlagsBuilder_ == null) { + return databaseFlags_.get(index); + } else { + return databaseFlagsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public Builder setDatabaseFlags(int index, com.google.cloud.sql.v1beta4.DatabaseFlags value) { + if (databaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseFlagsIsMutable(); + databaseFlags_.set(index, value); + onChanged(); + } else { + databaseFlagsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public Builder setDatabaseFlags( + int index, com.google.cloud.sql.v1beta4.DatabaseFlags.Builder builderForValue) { + if (databaseFlagsBuilder_ == null) { + ensureDatabaseFlagsIsMutable(); + databaseFlags_.set(index, builderForValue.build()); + onChanged(); + } else { + databaseFlagsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public Builder addDatabaseFlags(com.google.cloud.sql.v1beta4.DatabaseFlags value) { + if (databaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseFlagsIsMutable(); + databaseFlags_.add(value); + onChanged(); + } else { + databaseFlagsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public Builder addDatabaseFlags(int index, com.google.cloud.sql.v1beta4.DatabaseFlags value) { + if (databaseFlagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseFlagsIsMutable(); + databaseFlags_.add(index, value); + onChanged(); + } else { + databaseFlagsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public Builder addDatabaseFlags( + com.google.cloud.sql.v1beta4.DatabaseFlags.Builder builderForValue) { + if (databaseFlagsBuilder_ == null) { + ensureDatabaseFlagsIsMutable(); + databaseFlags_.add(builderForValue.build()); + onChanged(); + } else { + databaseFlagsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public Builder addDatabaseFlags( + int index, com.google.cloud.sql.v1beta4.DatabaseFlags.Builder builderForValue) { + if (databaseFlagsBuilder_ == null) { + ensureDatabaseFlagsIsMutable(); + databaseFlags_.add(index, builderForValue.build()); + onChanged(); + } else { + databaseFlagsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public Builder addAllDatabaseFlags( + java.lang.Iterable values) { + if (databaseFlagsBuilder_ == null) { + ensureDatabaseFlagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, databaseFlags_); + onChanged(); + } else { + databaseFlagsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public Builder clearDatabaseFlags() { + if (databaseFlagsBuilder_ == null) { + databaseFlags_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + } else { + databaseFlagsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public Builder removeDatabaseFlags(int index) { + if (databaseFlagsBuilder_ == null) { + ensureDatabaseFlagsIsMutable(); + databaseFlags_.remove(index); + onChanged(); + } else { + databaseFlagsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public com.google.cloud.sql.v1beta4.DatabaseFlags.Builder getDatabaseFlagsBuilder(int index) { + return internalGetDatabaseFlagsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public com.google.cloud.sql.v1beta4.DatabaseFlagsOrBuilder getDatabaseFlagsOrBuilder( + int index) { + if (databaseFlagsBuilder_ == null) { + return databaseFlags_.get(index); + } else { + return databaseFlagsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public java.util.List + getDatabaseFlagsOrBuilderList() { + if (databaseFlagsBuilder_ != null) { + return databaseFlagsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(databaseFlags_); + } + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public com.google.cloud.sql.v1beta4.DatabaseFlags.Builder addDatabaseFlagsBuilder() { + return internalGetDatabaseFlagsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.DatabaseFlags.getDefaultInstance()); + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public com.google.cloud.sql.v1beta4.DatabaseFlags.Builder addDatabaseFlagsBuilder(int index) { + return internalGetDatabaseFlagsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.DatabaseFlags.getDefaultInstance()); + } + + /** + * + * + *
+     * The database flags passed to the instance at startup.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + public java.util.List + getDatabaseFlagsBuilderList() { + return internalGetDatabaseFlagsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseFlags, + com.google.cloud.sql.v1beta4.DatabaseFlags.Builder, + com.google.cloud.sql.v1beta4.DatabaseFlagsOrBuilder> + internalGetDatabaseFlagsFieldBuilder() { + if (databaseFlagsBuilder_ == null) { + databaseFlagsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseFlags, + com.google.cloud.sql.v1beta4.DatabaseFlags.Builder, + com.google.cloud.sql.v1beta4.DatabaseFlagsOrBuilder>( + databaseFlags_, + ((bitField0_ & 0x00002000) != 0), + getParentForChildren(), + isClean()); + databaseFlags_ = null; + } + return databaseFlagsBuilder_; + } + + private int dataDiskType_ = 0; + + /** + * + * + *
+     * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+     * First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDataDiskType data_disk_type = 15; + * + * @return The enum numeric value on the wire for dataDiskType. + */ + @java.lang.Override + public int getDataDiskTypeValue() { + return dataDiskType_; + } + + /** + * + * + *
+     * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+     * First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDataDiskType data_disk_type = 15; + * + * @param value The enum numeric value on the wire for dataDiskType to set. + * @return This builder for chaining. + */ + public Builder setDataDiskTypeValue(int value) { + dataDiskType_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+     * First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDataDiskType data_disk_type = 15; + * + * @return The dataDiskType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDataDiskType getDataDiskType() { + com.google.cloud.sql.v1beta4.SqlDataDiskType result = + com.google.cloud.sql.v1beta4.SqlDataDiskType.forNumber(dataDiskType_); + return result == null ? com.google.cloud.sql.v1beta4.SqlDataDiskType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+     * First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDataDiskType data_disk_type = 15; + * + * @param value The dataDiskType to set. + * @return This builder for chaining. + */ + public Builder setDataDiskType(com.google.cloud.sql.v1beta4.SqlDataDiskType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00004000; + dataDiskType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+     * First Generation instances.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlDataDiskType data_disk_type = 15; + * + * @return This builder for chaining. + */ + public Builder clearDataDiskType() { + bitField0_ = (bitField0_ & ~0x00004000); + dataDiskType_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.MaintenanceWindow maintenanceWindow_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.MaintenanceWindow, + com.google.cloud.sql.v1beta4.MaintenanceWindow.Builder, + com.google.cloud.sql.v1beta4.MaintenanceWindowOrBuilder> + maintenanceWindowBuilder_; + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + * + * @return Whether the maintenanceWindow field is set. + */ + public boolean hasMaintenanceWindow() { + return ((bitField0_ & 0x00008000) != 0); + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + * + * @return The maintenanceWindow. + */ + public com.google.cloud.sql.v1beta4.MaintenanceWindow getMaintenanceWindow() { + if (maintenanceWindowBuilder_ == null) { + return maintenanceWindow_ == null + ? com.google.cloud.sql.v1beta4.MaintenanceWindow.getDefaultInstance() + : maintenanceWindow_; + } else { + return maintenanceWindowBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + */ + public Builder setMaintenanceWindow(com.google.cloud.sql.v1beta4.MaintenanceWindow value) { + if (maintenanceWindowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceWindow_ = value; + } else { + maintenanceWindowBuilder_.setMessage(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + */ + public Builder setMaintenanceWindow( + com.google.cloud.sql.v1beta4.MaintenanceWindow.Builder builderForValue) { + if (maintenanceWindowBuilder_ == null) { + maintenanceWindow_ = builderForValue.build(); + } else { + maintenanceWindowBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + */ + public Builder mergeMaintenanceWindow(com.google.cloud.sql.v1beta4.MaintenanceWindow value) { + if (maintenanceWindowBuilder_ == null) { + if (((bitField0_ & 0x00008000) != 0) + && maintenanceWindow_ != null + && maintenanceWindow_ + != com.google.cloud.sql.v1beta4.MaintenanceWindow.getDefaultInstance()) { + getMaintenanceWindowBuilder().mergeFrom(value); + } else { + maintenanceWindow_ = value; + } + } else { + maintenanceWindowBuilder_.mergeFrom(value); + } + if (maintenanceWindow_ != null) { + bitField0_ |= 0x00008000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + */ + public Builder clearMaintenanceWindow() { + bitField0_ = (bitField0_ & ~0x00008000); + maintenanceWindow_ = null; + if (maintenanceWindowBuilder_ != null) { + maintenanceWindowBuilder_.dispose(); + maintenanceWindowBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + */ + public com.google.cloud.sql.v1beta4.MaintenanceWindow.Builder getMaintenanceWindowBuilder() { + bitField0_ |= 0x00008000; + onChanged(); + return internalGetMaintenanceWindowFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + */ + public com.google.cloud.sql.v1beta4.MaintenanceWindowOrBuilder getMaintenanceWindowOrBuilder() { + if (maintenanceWindowBuilder_ != null) { + return maintenanceWindowBuilder_.getMessageOrBuilder(); + } else { + return maintenanceWindow_ == null + ? com.google.cloud.sql.v1beta4.MaintenanceWindow.getDefaultInstance() + : maintenanceWindow_; + } + } + + /** + * + * + *
+     * The maintenance window for this instance. This specifies when the instance
+     * can be restarted for maintenance purposes.
+     * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.MaintenanceWindow, + com.google.cloud.sql.v1beta4.MaintenanceWindow.Builder, + com.google.cloud.sql.v1beta4.MaintenanceWindowOrBuilder> + internalGetMaintenanceWindowFieldBuilder() { + if (maintenanceWindowBuilder_ == null) { + maintenanceWindowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.MaintenanceWindow, + com.google.cloud.sql.v1beta4.MaintenanceWindow.Builder, + com.google.cloud.sql.v1beta4.MaintenanceWindowOrBuilder>( + getMaintenanceWindow(), getParentForChildren(), isClean()); + maintenanceWindow_ = null; + } + return maintenanceWindowBuilder_; + } + + private com.google.cloud.sql.v1beta4.BackupConfiguration backupConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupConfiguration, + com.google.cloud.sql.v1beta4.BackupConfiguration.Builder, + com.google.cloud.sql.v1beta4.BackupConfigurationOrBuilder> + backupConfigurationBuilder_; + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + * + * @return Whether the backupConfiguration field is set. + */ + public boolean hasBackupConfiguration() { + return ((bitField0_ & 0x00010000) != 0); + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + * + * @return The backupConfiguration. + */ + public com.google.cloud.sql.v1beta4.BackupConfiguration getBackupConfiguration() { + if (backupConfigurationBuilder_ == null) { + return backupConfiguration_ == null + ? com.google.cloud.sql.v1beta4.BackupConfiguration.getDefaultInstance() + : backupConfiguration_; + } else { + return backupConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + */ + public Builder setBackupConfiguration(com.google.cloud.sql.v1beta4.BackupConfiguration value) { + if (backupConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupConfiguration_ = value; + } else { + backupConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + */ + public Builder setBackupConfiguration( + com.google.cloud.sql.v1beta4.BackupConfiguration.Builder builderForValue) { + if (backupConfigurationBuilder_ == null) { + backupConfiguration_ = builderForValue.build(); + } else { + backupConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + */ + public Builder mergeBackupConfiguration( + com.google.cloud.sql.v1beta4.BackupConfiguration value) { + if (backupConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && backupConfiguration_ != null + && backupConfiguration_ + != com.google.cloud.sql.v1beta4.BackupConfiguration.getDefaultInstance()) { + getBackupConfigurationBuilder().mergeFrom(value); + } else { + backupConfiguration_ = value; + } + } else { + backupConfigurationBuilder_.mergeFrom(value); + } + if (backupConfiguration_ != null) { + bitField0_ |= 0x00010000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + */ + public Builder clearBackupConfiguration() { + bitField0_ = (bitField0_ & ~0x00010000); + backupConfiguration_ = null; + if (backupConfigurationBuilder_ != null) { + backupConfigurationBuilder_.dispose(); + backupConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + */ + public com.google.cloud.sql.v1beta4.BackupConfiguration.Builder + getBackupConfigurationBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return internalGetBackupConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + */ + public com.google.cloud.sql.v1beta4.BackupConfigurationOrBuilder + getBackupConfigurationOrBuilder() { + if (backupConfigurationBuilder_ != null) { + return backupConfigurationBuilder_.getMessageOrBuilder(); + } else { + return backupConfiguration_ == null + ? com.google.cloud.sql.v1beta4.BackupConfiguration.getDefaultInstance() + : backupConfiguration_; + } + } + + /** + * + * + *
+     * The daily backup configuration for the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupConfiguration, + com.google.cloud.sql.v1beta4.BackupConfiguration.Builder, + com.google.cloud.sql.v1beta4.BackupConfigurationOrBuilder> + internalGetBackupConfigurationFieldBuilder() { + if (backupConfigurationBuilder_ == null) { + backupConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupConfiguration, + com.google.cloud.sql.v1beta4.BackupConfiguration.Builder, + com.google.cloud.sql.v1beta4.BackupConfigurationOrBuilder>( + getBackupConfiguration(), getParentForChildren(), isClean()); + backupConfiguration_ = null; + } + return backupConfigurationBuilder_; + } + + private com.google.protobuf.BoolValue databaseReplicationEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + databaseReplicationEnabledBuilder_; + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + * + * @return Whether the databaseReplicationEnabled field is set. + */ + public boolean hasDatabaseReplicationEnabled() { + return ((bitField0_ & 0x00020000) != 0); + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + * + * @return The databaseReplicationEnabled. + */ + public com.google.protobuf.BoolValue getDatabaseReplicationEnabled() { + if (databaseReplicationEnabledBuilder_ == null) { + return databaseReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : databaseReplicationEnabled_; + } else { + return databaseReplicationEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + public Builder setDatabaseReplicationEnabled(com.google.protobuf.BoolValue value) { + if (databaseReplicationEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + databaseReplicationEnabled_ = value; + } else { + databaseReplicationEnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + public Builder setDatabaseReplicationEnabled( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (databaseReplicationEnabledBuilder_ == null) { + databaseReplicationEnabled_ = builderForValue.build(); + } else { + databaseReplicationEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + public Builder mergeDatabaseReplicationEnabled(com.google.protobuf.BoolValue value) { + if (databaseReplicationEnabledBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) + && databaseReplicationEnabled_ != null + && databaseReplicationEnabled_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getDatabaseReplicationEnabledBuilder().mergeFrom(value); + } else { + databaseReplicationEnabled_ = value; + } + } else { + databaseReplicationEnabledBuilder_.mergeFrom(value); + } + if (databaseReplicationEnabled_ != null) { + bitField0_ |= 0x00020000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + public Builder clearDatabaseReplicationEnabled() { + bitField0_ = (bitField0_ & ~0x00020000); + databaseReplicationEnabled_ = null; + if (databaseReplicationEnabledBuilder_ != null) { + databaseReplicationEnabledBuilder_.dispose(); + databaseReplicationEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + public com.google.protobuf.BoolValue.Builder getDatabaseReplicationEnabledBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return internalGetDatabaseReplicationEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + public com.google.protobuf.BoolValueOrBuilder getDatabaseReplicationEnabledOrBuilder() { + if (databaseReplicationEnabledBuilder_ != null) { + return databaseReplicationEnabledBuilder_.getMessageOrBuilder(); + } else { + return databaseReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : databaseReplicationEnabled_; + } + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * replication is enabled or not. WARNING: Changing this restarts the
+     * instance.
+     * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetDatabaseReplicationEnabledFieldBuilder() { + if (databaseReplicationEnabledBuilder_ == null) { + databaseReplicationEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getDatabaseReplicationEnabled(), getParentForChildren(), isClean()); + databaseReplicationEnabled_ = null; + } + return databaseReplicationEnabledBuilder_; + } + + private com.google.protobuf.BoolValue crashSafeReplicationEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + crashSafeReplicationEnabledBuilder_; + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.crash_safe_replication_enabled is deprecated. + * See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3333 + * @return Whether the crashSafeReplicationEnabled field is set. + */ + @java.lang.Deprecated + public boolean hasCrashSafeReplicationEnabled() { + return ((bitField0_ & 0x00040000) != 0); + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.crash_safe_replication_enabled is deprecated. + * See google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3333 + * @return The crashSafeReplicationEnabled. + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValue getCrashSafeReplicationEnabled() { + if (crashSafeReplicationEnabledBuilder_ == null) { + return crashSafeReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : crashSafeReplicationEnabled_; + } else { + return crashSafeReplicationEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setCrashSafeReplicationEnabled(com.google.protobuf.BoolValue value) { + if (crashSafeReplicationEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + crashSafeReplicationEnabled_ = value; + } else { + crashSafeReplicationEnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setCrashSafeReplicationEnabled( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (crashSafeReplicationEnabledBuilder_ == null) { + crashSafeReplicationEnabled_ = builderForValue.build(); + } else { + crashSafeReplicationEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder mergeCrashSafeReplicationEnabled(com.google.protobuf.BoolValue value) { + if (crashSafeReplicationEnabledBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) + && crashSafeReplicationEnabled_ != null + && crashSafeReplicationEnabled_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getCrashSafeReplicationEnabledBuilder().mergeFrom(value); + } else { + crashSafeReplicationEnabled_ = value; + } + } else { + crashSafeReplicationEnabledBuilder_.mergeFrom(value); + } + if (crashSafeReplicationEnabled_ != null) { + bitField0_ |= 0x00040000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder clearCrashSafeReplicationEnabled() { + bitField0_ = (bitField0_ & ~0x00040000); + crashSafeReplicationEnabled_ = null; + if (crashSafeReplicationEnabledBuilder_ != null) { + crashSafeReplicationEnabledBuilder_.dispose(); + crashSafeReplicationEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValue.Builder getCrashSafeReplicationEnabledBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return internalGetCrashSafeReplicationEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.protobuf.BoolValueOrBuilder getCrashSafeReplicationEnabledOrBuilder() { + if (crashSafeReplicationEnabledBuilder_ != null) { + return crashSafeReplicationEnabledBuilder_.getMessageOrBuilder(); + } else { + return crashSafeReplicationEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : crashSafeReplicationEnabled_; + } + } + + /** + * + * + *
+     * Configuration specific to read replica instances. Indicates whether
+     * database flags for crash-safe replication are enabled. This property was
+     * only applicable to First Generation instances.
+     * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetCrashSafeReplicationEnabledFieldBuilder() { + if (crashSafeReplicationEnabledBuilder_ == null) { + crashSafeReplicationEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getCrashSafeReplicationEnabled(), getParentForChildren(), isClean()); + crashSafeReplicationEnabled_ = null; + } + return crashSafeReplicationEnabledBuilder_; + } + + private com.google.protobuf.Int64Value dataDiskSizeGb_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + dataDiskSizeGbBuilder_; + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + * + * @return Whether the dataDiskSizeGb field is set. + */ + public boolean hasDataDiskSizeGb() { + return ((bitField0_ & 0x00080000) != 0); + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + * + * @return The dataDiskSizeGb. + */ + public com.google.protobuf.Int64Value getDataDiskSizeGb() { + if (dataDiskSizeGbBuilder_ == null) { + return dataDiskSizeGb_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : dataDiskSizeGb_; + } else { + return dataDiskSizeGbBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + public Builder setDataDiskSizeGb(com.google.protobuf.Int64Value value) { + if (dataDiskSizeGbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataDiskSizeGb_ = value; + } else { + dataDiskSizeGbBuilder_.setMessage(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + public Builder setDataDiskSizeGb(com.google.protobuf.Int64Value.Builder builderForValue) { + if (dataDiskSizeGbBuilder_ == null) { + dataDiskSizeGb_ = builderForValue.build(); + } else { + dataDiskSizeGbBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + public Builder mergeDataDiskSizeGb(com.google.protobuf.Int64Value value) { + if (dataDiskSizeGbBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0) + && dataDiskSizeGb_ != null + && dataDiskSizeGb_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getDataDiskSizeGbBuilder().mergeFrom(value); + } else { + dataDiskSizeGb_ = value; + } + } else { + dataDiskSizeGbBuilder_.mergeFrom(value); + } + if (dataDiskSizeGb_ != null) { + bitField0_ |= 0x00080000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + public Builder clearDataDiskSizeGb() { + bitField0_ = (bitField0_ & ~0x00080000); + dataDiskSizeGb_ = null; + if (dataDiskSizeGbBuilder_ != null) { + dataDiskSizeGbBuilder_.dispose(); + dataDiskSizeGbBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + public com.google.protobuf.Int64Value.Builder getDataDiskSizeGbBuilder() { + bitField0_ |= 0x00080000; + onChanged(); + return internalGetDataDiskSizeGbFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + public com.google.protobuf.Int64ValueOrBuilder getDataDiskSizeGbOrBuilder() { + if (dataDiskSizeGbBuilder_ != null) { + return dataDiskSizeGbBuilder_.getMessageOrBuilder(); + } else { + return dataDiskSizeGb_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : dataDiskSizeGb_; + } + } + + /** + * + * + *
+     * The size of data disk, in GB. The data disk size minimum is 10GB.
+     * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + internalGetDataDiskSizeGbFieldBuilder() { + if (dataDiskSizeGbBuilder_ == null) { + dataDiskSizeGbBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getDataDiskSizeGb(), getParentForChildren(), isClean()); + dataDiskSizeGb_ = null; + } + return dataDiskSizeGbBuilder_; + } + + private com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig activeDirectoryConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig, + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.Builder, + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfigOrBuilder> + activeDirectoryConfigBuilder_; + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + * + * @return Whether the activeDirectoryConfig field is set. + */ + public boolean hasActiveDirectoryConfig() { + return ((bitField0_ & 0x00100000) != 0); + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + * + * @return The activeDirectoryConfig. + */ + public com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig getActiveDirectoryConfig() { + if (activeDirectoryConfigBuilder_ == null) { + return activeDirectoryConfig_ == null + ? com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.getDefaultInstance() + : activeDirectoryConfig_; + } else { + return activeDirectoryConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + */ + public Builder setActiveDirectoryConfig( + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig value) { + if (activeDirectoryConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + activeDirectoryConfig_ = value; + } else { + activeDirectoryConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + */ + public Builder setActiveDirectoryConfig( + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.Builder builderForValue) { + if (activeDirectoryConfigBuilder_ == null) { + activeDirectoryConfig_ = builderForValue.build(); + } else { + activeDirectoryConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + */ + public Builder mergeActiveDirectoryConfig( + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig value) { + if (activeDirectoryConfigBuilder_ == null) { + if (((bitField0_ & 0x00100000) != 0) + && activeDirectoryConfig_ != null + && activeDirectoryConfig_ + != com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.getDefaultInstance()) { + getActiveDirectoryConfigBuilder().mergeFrom(value); + } else { + activeDirectoryConfig_ = value; + } + } else { + activeDirectoryConfigBuilder_.mergeFrom(value); + } + if (activeDirectoryConfig_ != null) { + bitField0_ |= 0x00100000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + */ + public Builder clearActiveDirectoryConfig() { + bitField0_ = (bitField0_ & ~0x00100000); + activeDirectoryConfig_ = null; + if (activeDirectoryConfigBuilder_ != null) { + activeDirectoryConfigBuilder_.dispose(); + activeDirectoryConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + */ + public com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.Builder + getActiveDirectoryConfigBuilder() { + bitField0_ |= 0x00100000; + onChanged(); + return internalGetActiveDirectoryConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + */ + public com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfigOrBuilder + getActiveDirectoryConfigOrBuilder() { + if (activeDirectoryConfigBuilder_ != null) { + return activeDirectoryConfigBuilder_.getMessageOrBuilder(); + } else { + return activeDirectoryConfig_ == null + ? com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.getDefaultInstance() + : activeDirectoryConfig_; + } + } + + /** + * + * + *
+     * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig, + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.Builder, + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfigOrBuilder> + internalGetActiveDirectoryConfigFieldBuilder() { + if (activeDirectoryConfigBuilder_ == null) { + activeDirectoryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig, + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.Builder, + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfigOrBuilder>( + getActiveDirectoryConfig(), getParentForChildren(), isClean()); + activeDirectoryConfig_ = null; + } + return activeDirectoryConfigBuilder_; + } + + private java.lang.Object collation_ = ""; + + /** + * + * + *
+     * The name of server Instance collation.
+     * 
+ * + * string collation = 23; + * + * @return The collation. + */ + public java.lang.String getCollation() { + java.lang.Object ref = collation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of server Instance collation.
+     * 
+ * + * string collation = 23; + * + * @return The bytes for collation. + */ + public com.google.protobuf.ByteString getCollationBytes() { + java.lang.Object ref = collation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of server Instance collation.
+     * 
+ * + * string collation = 23; + * + * @param value The collation to set. + * @return This builder for chaining. + */ + public Builder setCollation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + collation_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of server Instance collation.
+     * 
+ * + * string collation = 23; + * + * @return This builder for chaining. + */ + public Builder clearCollation() { + collation_ = getDefaultInstance().getCollation(); + bitField0_ = (bitField0_ & ~0x00200000); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of server Instance collation.
+     * 
+ * + * string collation = 23; + * + * @param value The bytes for collation to set. + * @return This builder for chaining. + */ + public Builder setCollationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + collation_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + private java.util.List + denyMaintenancePeriods_ = java.util.Collections.emptyList(); + + private void ensureDenyMaintenancePeriodsIsMutable() { + if (!((bitField0_ & 0x00400000) != 0)) { + denyMaintenancePeriods_ = + new java.util.ArrayList( + denyMaintenancePeriods_); + bitField0_ |= 0x00400000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod, + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.Builder, + com.google.cloud.sql.v1beta4.DenyMaintenancePeriodOrBuilder> + denyMaintenancePeriodsBuilder_; + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public java.util.List + getDenyMaintenancePeriodsList() { + if (denyMaintenancePeriodsBuilder_ == null) { + return java.util.Collections.unmodifiableList(denyMaintenancePeriods_); + } else { + return denyMaintenancePeriodsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public int getDenyMaintenancePeriodsCount() { + if (denyMaintenancePeriodsBuilder_ == null) { + return denyMaintenancePeriods_.size(); + } else { + return denyMaintenancePeriodsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public com.google.cloud.sql.v1beta4.DenyMaintenancePeriod getDenyMaintenancePeriods(int index) { + if (denyMaintenancePeriodsBuilder_ == null) { + return denyMaintenancePeriods_.get(index); + } else { + return denyMaintenancePeriodsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder setDenyMaintenancePeriods( + int index, com.google.cloud.sql.v1beta4.DenyMaintenancePeriod value) { + if (denyMaintenancePeriodsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.set(index, value); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder setDenyMaintenancePeriods( + int index, com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.Builder builderForValue) { + if (denyMaintenancePeriodsBuilder_ == null) { + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.set(index, builderForValue.build()); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder addDenyMaintenancePeriods( + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod value) { + if (denyMaintenancePeriodsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.add(value); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder addDenyMaintenancePeriods( + int index, com.google.cloud.sql.v1beta4.DenyMaintenancePeriod value) { + if (denyMaintenancePeriodsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.add(index, value); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder addDenyMaintenancePeriods( + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.Builder builderForValue) { + if (denyMaintenancePeriodsBuilder_ == null) { + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.add(builderForValue.build()); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder addDenyMaintenancePeriods( + int index, com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.Builder builderForValue) { + if (denyMaintenancePeriodsBuilder_ == null) { + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.add(index, builderForValue.build()); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder addAllDenyMaintenancePeriods( + java.lang.Iterable values) { + if (denyMaintenancePeriodsBuilder_ == null) { + ensureDenyMaintenancePeriodsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, denyMaintenancePeriods_); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder clearDenyMaintenancePeriods() { + if (denyMaintenancePeriodsBuilder_ == null) { + denyMaintenancePeriods_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00400000); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public Builder removeDenyMaintenancePeriods(int index) { + if (denyMaintenancePeriodsBuilder_ == null) { + ensureDenyMaintenancePeriodsIsMutable(); + denyMaintenancePeriods_.remove(index); + onChanged(); + } else { + denyMaintenancePeriodsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.Builder + getDenyMaintenancePeriodsBuilder(int index) { + return internalGetDenyMaintenancePeriodsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public com.google.cloud.sql.v1beta4.DenyMaintenancePeriodOrBuilder + getDenyMaintenancePeriodsOrBuilder(int index) { + if (denyMaintenancePeriodsBuilder_ == null) { + return denyMaintenancePeriods_.get(index); + } else { + return denyMaintenancePeriodsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public java.util.List + getDenyMaintenancePeriodsOrBuilderList() { + if (denyMaintenancePeriodsBuilder_ != null) { + return denyMaintenancePeriodsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(denyMaintenancePeriods_); + } + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.Builder + addDenyMaintenancePeriodsBuilder() { + return internalGetDenyMaintenancePeriodsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.getDefaultInstance()); + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.Builder + addDenyMaintenancePeriodsBuilder(int index) { + return internalGetDenyMaintenancePeriodsFieldBuilder() + .addBuilder( + index, com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.getDefaultInstance()); + } + + /** + * + * + *
+     * Deny maintenance periods
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + public java.util.List + getDenyMaintenancePeriodsBuilderList() { + return internalGetDenyMaintenancePeriodsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod, + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.Builder, + com.google.cloud.sql.v1beta4.DenyMaintenancePeriodOrBuilder> + internalGetDenyMaintenancePeriodsFieldBuilder() { + if (denyMaintenancePeriodsBuilder_ == null) { + denyMaintenancePeriodsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod, + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod.Builder, + com.google.cloud.sql.v1beta4.DenyMaintenancePeriodOrBuilder>( + denyMaintenancePeriods_, + ((bitField0_ & 0x00400000) != 0), + getParentForChildren(), + isClean()); + denyMaintenancePeriods_ = null; + } + return denyMaintenancePeriodsBuilder_; + } + + private com.google.cloud.sql.v1beta4.InsightsConfig insightsConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InsightsConfig, + com.google.cloud.sql.v1beta4.InsightsConfig.Builder, + com.google.cloud.sql.v1beta4.InsightsConfigOrBuilder> + insightsConfigBuilder_; + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + * + * @return Whether the insightsConfig field is set. + */ + public boolean hasInsightsConfig() { + return ((bitField0_ & 0x00800000) != 0); + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + * + * @return The insightsConfig. + */ + public com.google.cloud.sql.v1beta4.InsightsConfig getInsightsConfig() { + if (insightsConfigBuilder_ == null) { + return insightsConfig_ == null + ? com.google.cloud.sql.v1beta4.InsightsConfig.getDefaultInstance() + : insightsConfig_; + } else { + return insightsConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + */ + public Builder setInsightsConfig(com.google.cloud.sql.v1beta4.InsightsConfig value) { + if (insightsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + insightsConfig_ = value; + } else { + insightsConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + */ + public Builder setInsightsConfig( + com.google.cloud.sql.v1beta4.InsightsConfig.Builder builderForValue) { + if (insightsConfigBuilder_ == null) { + insightsConfig_ = builderForValue.build(); + } else { + insightsConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + */ + public Builder mergeInsightsConfig(com.google.cloud.sql.v1beta4.InsightsConfig value) { + if (insightsConfigBuilder_ == null) { + if (((bitField0_ & 0x00800000) != 0) + && insightsConfig_ != null + && insightsConfig_ + != com.google.cloud.sql.v1beta4.InsightsConfig.getDefaultInstance()) { + getInsightsConfigBuilder().mergeFrom(value); + } else { + insightsConfig_ = value; + } + } else { + insightsConfigBuilder_.mergeFrom(value); + } + if (insightsConfig_ != null) { + bitField0_ |= 0x00800000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + */ + public Builder clearInsightsConfig() { + bitField0_ = (bitField0_ & ~0x00800000); + insightsConfig_ = null; + if (insightsConfigBuilder_ != null) { + insightsConfigBuilder_.dispose(); + insightsConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + */ + public com.google.cloud.sql.v1beta4.InsightsConfig.Builder getInsightsConfigBuilder() { + bitField0_ |= 0x00800000; + onChanged(); + return internalGetInsightsConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + */ + public com.google.cloud.sql.v1beta4.InsightsConfigOrBuilder getInsightsConfigOrBuilder() { + if (insightsConfigBuilder_ != null) { + return insightsConfigBuilder_.getMessageOrBuilder(); + } else { + return insightsConfig_ == null + ? com.google.cloud.sql.v1beta4.InsightsConfig.getDefaultInstance() + : insightsConfig_; + } + } + + /** + * + * + *
+     * Insights configuration, for now relevant only for Postgres.
+     * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InsightsConfig, + com.google.cloud.sql.v1beta4.InsightsConfig.Builder, + com.google.cloud.sql.v1beta4.InsightsConfigOrBuilder> + internalGetInsightsConfigFieldBuilder() { + if (insightsConfigBuilder_ == null) { + insightsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InsightsConfig, + com.google.cloud.sql.v1beta4.InsightsConfig.Builder, + com.google.cloud.sql.v1beta4.InsightsConfigOrBuilder>( + getInsightsConfig(), getParentForChildren(), isClean()); + insightsConfig_ = null; + } + return insightsConfigBuilder_; + } + + private com.google.cloud.sql.v1beta4.PasswordValidationPolicy passwordValidationPolicy_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PasswordValidationPolicy, + com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Builder, + com.google.cloud.sql.v1beta4.PasswordValidationPolicyOrBuilder> + passwordValidationPolicyBuilder_; + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + * + * @return Whether the passwordValidationPolicy field is set. + */ + public boolean hasPasswordValidationPolicy() { + return ((bitField0_ & 0x01000000) != 0); + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + * + * @return The passwordValidationPolicy. + */ + public com.google.cloud.sql.v1beta4.PasswordValidationPolicy getPasswordValidationPolicy() { + if (passwordValidationPolicyBuilder_ == null) { + return passwordValidationPolicy_ == null + ? com.google.cloud.sql.v1beta4.PasswordValidationPolicy.getDefaultInstance() + : passwordValidationPolicy_; + } else { + return passwordValidationPolicyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + */ + public Builder setPasswordValidationPolicy( + com.google.cloud.sql.v1beta4.PasswordValidationPolicy value) { + if (passwordValidationPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + passwordValidationPolicy_ = value; + } else { + passwordValidationPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + */ + public Builder setPasswordValidationPolicy( + com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Builder builderForValue) { + if (passwordValidationPolicyBuilder_ == null) { + passwordValidationPolicy_ = builderForValue.build(); + } else { + passwordValidationPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + */ + public Builder mergePasswordValidationPolicy( + com.google.cloud.sql.v1beta4.PasswordValidationPolicy value) { + if (passwordValidationPolicyBuilder_ == null) { + if (((bitField0_ & 0x01000000) != 0) + && passwordValidationPolicy_ != null + && passwordValidationPolicy_ + != com.google.cloud.sql.v1beta4.PasswordValidationPolicy.getDefaultInstance()) { + getPasswordValidationPolicyBuilder().mergeFrom(value); + } else { + passwordValidationPolicy_ = value; + } + } else { + passwordValidationPolicyBuilder_.mergeFrom(value); + } + if (passwordValidationPolicy_ != null) { + bitField0_ |= 0x01000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + */ + public Builder clearPasswordValidationPolicy() { + bitField0_ = (bitField0_ & ~0x01000000); + passwordValidationPolicy_ = null; + if (passwordValidationPolicyBuilder_ != null) { + passwordValidationPolicyBuilder_.dispose(); + passwordValidationPolicyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + */ + public com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Builder + getPasswordValidationPolicyBuilder() { + bitField0_ |= 0x01000000; + onChanged(); + return internalGetPasswordValidationPolicyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + */ + public com.google.cloud.sql.v1beta4.PasswordValidationPolicyOrBuilder + getPasswordValidationPolicyOrBuilder() { + if (passwordValidationPolicyBuilder_ != null) { + return passwordValidationPolicyBuilder_.getMessageOrBuilder(); + } else { + return passwordValidationPolicy_ == null + ? com.google.cloud.sql.v1beta4.PasswordValidationPolicy.getDefaultInstance() + : passwordValidationPolicy_; + } + } + + /** + * + * + *
+     * The local user password validation policy of the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PasswordValidationPolicy, + com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Builder, + com.google.cloud.sql.v1beta4.PasswordValidationPolicyOrBuilder> + internalGetPasswordValidationPolicyFieldBuilder() { + if (passwordValidationPolicyBuilder_ == null) { + passwordValidationPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PasswordValidationPolicy, + com.google.cloud.sql.v1beta4.PasswordValidationPolicy.Builder, + com.google.cloud.sql.v1beta4.PasswordValidationPolicyOrBuilder>( + getPasswordValidationPolicy(), getParentForChildren(), isClean()); + passwordValidationPolicy_ = null; + } + return passwordValidationPolicyBuilder_; + } + + private com.google.cloud.sql.v1beta4.SqlServerAuditConfig sqlServerAuditConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlServerAuditConfig, + com.google.cloud.sql.v1beta4.SqlServerAuditConfig.Builder, + com.google.cloud.sql.v1beta4.SqlServerAuditConfigOrBuilder> + sqlServerAuditConfigBuilder_; + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + * + * @return Whether the sqlServerAuditConfig field is set. + */ + public boolean hasSqlServerAuditConfig() { + return ((bitField0_ & 0x02000000) != 0); + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + * + * @return The sqlServerAuditConfig. + */ + public com.google.cloud.sql.v1beta4.SqlServerAuditConfig getSqlServerAuditConfig() { + if (sqlServerAuditConfigBuilder_ == null) { + return sqlServerAuditConfig_ == null + ? com.google.cloud.sql.v1beta4.SqlServerAuditConfig.getDefaultInstance() + : sqlServerAuditConfig_; + } else { + return sqlServerAuditConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + */ + public Builder setSqlServerAuditConfig( + com.google.cloud.sql.v1beta4.SqlServerAuditConfig value) { + if (sqlServerAuditConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sqlServerAuditConfig_ = value; + } else { + sqlServerAuditConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + */ + public Builder setSqlServerAuditConfig( + com.google.cloud.sql.v1beta4.SqlServerAuditConfig.Builder builderForValue) { + if (sqlServerAuditConfigBuilder_ == null) { + sqlServerAuditConfig_ = builderForValue.build(); + } else { + sqlServerAuditConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + */ + public Builder mergeSqlServerAuditConfig( + com.google.cloud.sql.v1beta4.SqlServerAuditConfig value) { + if (sqlServerAuditConfigBuilder_ == null) { + if (((bitField0_ & 0x02000000) != 0) + && sqlServerAuditConfig_ != null + && sqlServerAuditConfig_ + != com.google.cloud.sql.v1beta4.SqlServerAuditConfig.getDefaultInstance()) { + getSqlServerAuditConfigBuilder().mergeFrom(value); + } else { + sqlServerAuditConfig_ = value; + } + } else { + sqlServerAuditConfigBuilder_.mergeFrom(value); + } + if (sqlServerAuditConfig_ != null) { + bitField0_ |= 0x02000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + */ + public Builder clearSqlServerAuditConfig() { + bitField0_ = (bitField0_ & ~0x02000000); + sqlServerAuditConfig_ = null; + if (sqlServerAuditConfigBuilder_ != null) { + sqlServerAuditConfigBuilder_.dispose(); + sqlServerAuditConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + */ + public com.google.cloud.sql.v1beta4.SqlServerAuditConfig.Builder + getSqlServerAuditConfigBuilder() { + bitField0_ |= 0x02000000; + onChanged(); + return internalGetSqlServerAuditConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + */ + public com.google.cloud.sql.v1beta4.SqlServerAuditConfigOrBuilder + getSqlServerAuditConfigOrBuilder() { + if (sqlServerAuditConfigBuilder_ != null) { + return sqlServerAuditConfigBuilder_.getMessageOrBuilder(); + } else { + return sqlServerAuditConfig_ == null + ? com.google.cloud.sql.v1beta4.SqlServerAuditConfig.getDefaultInstance() + : sqlServerAuditConfig_; + } + } + + /** + * + * + *
+     * SQL Server specific audit configuration.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlServerAuditConfig, + com.google.cloud.sql.v1beta4.SqlServerAuditConfig.Builder, + com.google.cloud.sql.v1beta4.SqlServerAuditConfigOrBuilder> + internalGetSqlServerAuditConfigFieldBuilder() { + if (sqlServerAuditConfigBuilder_ == null) { + sqlServerAuditConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlServerAuditConfig, + com.google.cloud.sql.v1beta4.SqlServerAuditConfig.Builder, + com.google.cloud.sql.v1beta4.SqlServerAuditConfigOrBuilder>( + getSqlServerAuditConfig(), getParentForChildren(), isClean()); + sqlServerAuditConfig_ = null; + } + return sqlServerAuditConfigBuilder_; + } + + private int edition_ = 0; + + /** + * + * + *
+     * Optional. The edition type of the Cloud SQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for edition. + */ + @java.lang.Override + public int getEditionValue() { + return edition_; + } + + /** + * + * + *
+     * Optional. The edition type of the Cloud SQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for edition to set. + * @return This builder for chaining. + */ + public Builder setEditionValue(int value) { + edition_ = value; + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The edition type of the Cloud SQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The edition. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Settings.Edition getEdition() { + com.google.cloud.sql.v1beta4.Settings.Edition result = + com.google.cloud.sql.v1beta4.Settings.Edition.forNumber(edition_); + return result == null ? com.google.cloud.sql.v1beta4.Settings.Edition.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Optional. The edition type of the Cloud SQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The edition to set. + * @return This builder for chaining. + */ + public Builder setEdition(com.google.cloud.sql.v1beta4.Settings.Edition value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x04000000; + edition_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The edition type of the Cloud SQL instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearEdition() { + bitField0_ = (bitField0_ & ~0x04000000); + edition_ = 0; + onChanged(); + return this; + } + + private int connectorEnforcement_ = 0; + + /** + * + * + *
+     * Specifies if connections must use Cloud SQL connectors.
+     * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+     * can be connected without Cloud SQL
+     * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+     * Connectors)
+     *
+     * Note that using REQUIRED disables all existing authorized networks. If
+     * this field is not specified when creating a new instance, NOT_REQUIRED is
+     * used. If this field is not specified when patching or updating an existing
+     * instance, it is left unchanged in the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * + * @return The enum numeric value on the wire for connectorEnforcement. + */ + @java.lang.Override + public int getConnectorEnforcementValue() { + return connectorEnforcement_; + } + + /** + * + * + *
+     * Specifies if connections must use Cloud SQL connectors.
+     * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+     * can be connected without Cloud SQL
+     * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+     * Connectors)
+     *
+     * Note that using REQUIRED disables all existing authorized networks. If
+     * this field is not specified when creating a new instance, NOT_REQUIRED is
+     * used. If this field is not specified when patching or updating an existing
+     * instance, it is left unchanged in the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * + * @param value The enum numeric value on the wire for connectorEnforcement to set. + * @return This builder for chaining. + */ + public Builder setConnectorEnforcementValue(int value) { + connectorEnforcement_ = value; + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies if connections must use Cloud SQL connectors.
+     * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+     * can be connected without Cloud SQL
+     * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+     * Connectors)
+     *
+     * Note that using REQUIRED disables all existing authorized networks. If
+     * this field is not specified when creating a new instance, NOT_REQUIRED is
+     * used. If this field is not specified when patching or updating an existing
+     * instance, it is left unchanged in the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * + * @return The connectorEnforcement. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Settings.ConnectorEnforcement getConnectorEnforcement() { + com.google.cloud.sql.v1beta4.Settings.ConnectorEnforcement result = + com.google.cloud.sql.v1beta4.Settings.ConnectorEnforcement.forNumber( + connectorEnforcement_); + return result == null + ? com.google.cloud.sql.v1beta4.Settings.ConnectorEnforcement.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Specifies if connections must use Cloud SQL connectors.
+     * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+     * can be connected without Cloud SQL
+     * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+     * Connectors)
+     *
+     * Note that using REQUIRED disables all existing authorized networks. If
+     * this field is not specified when creating a new instance, NOT_REQUIRED is
+     * used. If this field is not specified when patching or updating an existing
+     * instance, it is left unchanged in the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * + * @param value The connectorEnforcement to set. + * @return This builder for chaining. + */ + public Builder setConnectorEnforcement( + com.google.cloud.sql.v1beta4.Settings.ConnectorEnforcement value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x08000000; + connectorEnforcement_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies if connections must use Cloud SQL connectors.
+     * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+     * can be connected without Cloud SQL
+     * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+     * Connectors)
+     *
+     * Note that using REQUIRED disables all existing authorized networks. If
+     * this field is not specified when creating a new instance, NOT_REQUIRED is
+     * used. If this field is not specified when patching or updating an existing
+     * instance, it is left unchanged in the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * + * @return This builder for chaining. + */ + public Builder clearConnectorEnforcement() { + bitField0_ = (bitField0_ & ~0x08000000); + connectorEnforcement_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue deletionProtectionEnabled_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + deletionProtectionEnabledBuilder_; + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + * + * @return Whether the deletionProtectionEnabled field is set. + */ + public boolean hasDeletionProtectionEnabled() { + return ((bitField0_ & 0x10000000) != 0); + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + * + * @return The deletionProtectionEnabled. + */ + public com.google.protobuf.BoolValue getDeletionProtectionEnabled() { + if (deletionProtectionEnabledBuilder_ == null) { + return deletionProtectionEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : deletionProtectionEnabled_; + } else { + return deletionProtectionEnabledBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + public Builder setDeletionProtectionEnabled(com.google.protobuf.BoolValue value) { + if (deletionProtectionEnabledBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deletionProtectionEnabled_ = value; + } else { + deletionProtectionEnabledBuilder_.setMessage(value); + } + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + public Builder setDeletionProtectionEnabled( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (deletionProtectionEnabledBuilder_ == null) { + deletionProtectionEnabled_ = builderForValue.build(); + } else { + deletionProtectionEnabledBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + public Builder mergeDeletionProtectionEnabled(com.google.protobuf.BoolValue value) { + if (deletionProtectionEnabledBuilder_ == null) { + if (((bitField0_ & 0x10000000) != 0) + && deletionProtectionEnabled_ != null + && deletionProtectionEnabled_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getDeletionProtectionEnabledBuilder().mergeFrom(value); + } else { + deletionProtectionEnabled_ = value; + } + } else { + deletionProtectionEnabledBuilder_.mergeFrom(value); + } + if (deletionProtectionEnabled_ != null) { + bitField0_ |= 0x10000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + public Builder clearDeletionProtectionEnabled() { + bitField0_ = (bitField0_ & ~0x10000000); + deletionProtectionEnabled_ = null; + if (deletionProtectionEnabledBuilder_ != null) { + deletionProtectionEnabledBuilder_.dispose(); + deletionProtectionEnabledBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + public com.google.protobuf.BoolValue.Builder getDeletionProtectionEnabledBuilder() { + bitField0_ |= 0x10000000; + onChanged(); + return internalGetDeletionProtectionEnabledFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + public com.google.protobuf.BoolValueOrBuilder getDeletionProtectionEnabledOrBuilder() { + if (deletionProtectionEnabledBuilder_ != null) { + return deletionProtectionEnabledBuilder_.getMessageOrBuilder(); + } else { + return deletionProtectionEnabled_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : deletionProtectionEnabled_; + } + } + + /** + * + * + *
+     * Configuration to protect against accidental instance deletion.
+     * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetDeletionProtectionEnabledFieldBuilder() { + if (deletionProtectionEnabledBuilder_ == null) { + deletionProtectionEnabledBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getDeletionProtectionEnabled(), getParentForChildren(), isClean()); + deletionProtectionEnabled_ = null; + } + return deletionProtectionEnabledBuilder_; + } + + private java.lang.Object timeZone_ = ""; + + /** + * + * + *
+     * Server timezone, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * string time_zone = 34; + * + * @return The timeZone. + */ + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Server timezone, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * string time_zone = 34; + * + * @return The bytes for timeZone. + */ + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Server timezone, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * string time_zone = 34; + * + * @param value The timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + timeZone_ = value; + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Server timezone, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * string time_zone = 34; + * + * @return This builder for chaining. + */ + public Builder clearTimeZone() { + timeZone_ = getDefaultInstance().getTimeZone(); + bitField0_ = (bitField0_ & ~0x20000000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Server timezone, relevant only for Cloud SQL for SQL Server.
+     * 
+ * + * string time_zone = 34; + * + * @param value The bytes for timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + timeZone_ = value; + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.AdvancedMachineFeatures advancedMachineFeatures_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures, + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.Builder, + com.google.cloud.sql.v1beta4.AdvancedMachineFeaturesOrBuilder> + advancedMachineFeaturesBuilder_; + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + * + * + * @return Whether the advancedMachineFeatures field is set. + */ + public boolean hasAdvancedMachineFeatures() { + return ((bitField0_ & 0x40000000) != 0); + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + * + * + * @return The advancedMachineFeatures. + */ + public com.google.cloud.sql.v1beta4.AdvancedMachineFeatures getAdvancedMachineFeatures() { + if (advancedMachineFeaturesBuilder_ == null) { + return advancedMachineFeatures_ == null + ? com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.getDefaultInstance() + : advancedMachineFeatures_; + } else { + return advancedMachineFeaturesBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + * + */ + public Builder setAdvancedMachineFeatures( + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures value) { + if (advancedMachineFeaturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + advancedMachineFeatures_ = value; + } else { + advancedMachineFeaturesBuilder_.setMessage(value); + } + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + * + */ + public Builder setAdvancedMachineFeatures( + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.Builder builderForValue) { + if (advancedMachineFeaturesBuilder_ == null) { + advancedMachineFeatures_ = builderForValue.build(); + } else { + advancedMachineFeaturesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + * + */ + public Builder mergeAdvancedMachineFeatures( + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures value) { + if (advancedMachineFeaturesBuilder_ == null) { + if (((bitField0_ & 0x40000000) != 0) + && advancedMachineFeatures_ != null + && advancedMachineFeatures_ + != com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.getDefaultInstance()) { + getAdvancedMachineFeaturesBuilder().mergeFrom(value); + } else { + advancedMachineFeatures_ = value; + } + } else { + advancedMachineFeaturesBuilder_.mergeFrom(value); + } + if (advancedMachineFeatures_ != null) { + bitField0_ |= 0x40000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + * + */ + public Builder clearAdvancedMachineFeatures() { + bitField0_ = (bitField0_ & ~0x40000000); + advancedMachineFeatures_ = null; + if (advancedMachineFeaturesBuilder_ != null) { + advancedMachineFeaturesBuilder_.dispose(); + advancedMachineFeaturesBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + * + */ + public com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.Builder + getAdvancedMachineFeaturesBuilder() { + bitField0_ |= 0x40000000; + onChanged(); + return internalGetAdvancedMachineFeaturesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + * + */ + public com.google.cloud.sql.v1beta4.AdvancedMachineFeaturesOrBuilder + getAdvancedMachineFeaturesOrBuilder() { + if (advancedMachineFeaturesBuilder_ != null) { + return advancedMachineFeaturesBuilder_.getMessageOrBuilder(); + } else { + return advancedMachineFeatures_ == null + ? com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.getDefaultInstance() + : advancedMachineFeatures_; + } + } + + /** + * + * + *
+     * Specifies advanced machine configuration for the instances relevant only
+     * for SQL Server.
+     * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures, + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.Builder, + com.google.cloud.sql.v1beta4.AdvancedMachineFeaturesOrBuilder> + internalGetAdvancedMachineFeaturesFieldBuilder() { + if (advancedMachineFeaturesBuilder_ == null) { + advancedMachineFeaturesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures, + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures.Builder, + com.google.cloud.sql.v1beta4.AdvancedMachineFeaturesOrBuilder>( + getAdvancedMachineFeatures(), getParentForChildren(), isClean()); + advancedMachineFeatures_ = null; + } + return advancedMachineFeaturesBuilder_; + } + + private com.google.cloud.sql.v1beta4.DataCacheConfig dataCacheConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DataCacheConfig, + com.google.cloud.sql.v1beta4.DataCacheConfig.Builder, + com.google.cloud.sql.v1beta4.DataCacheConfigOrBuilder> + dataCacheConfigBuilder_; + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + * + * @return Whether the dataCacheConfig field is set. + */ + public boolean hasDataCacheConfig() { + return ((bitField0_ & 0x80000000) != 0); + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + * + * @return The dataCacheConfig. + */ + public com.google.cloud.sql.v1beta4.DataCacheConfig getDataCacheConfig() { + if (dataCacheConfigBuilder_ == null) { + return dataCacheConfig_ == null + ? com.google.cloud.sql.v1beta4.DataCacheConfig.getDefaultInstance() + : dataCacheConfig_; + } else { + return dataCacheConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + */ + public Builder setDataCacheConfig(com.google.cloud.sql.v1beta4.DataCacheConfig value) { + if (dataCacheConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataCacheConfig_ = value; + } else { + dataCacheConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + */ + public Builder setDataCacheConfig( + com.google.cloud.sql.v1beta4.DataCacheConfig.Builder builderForValue) { + if (dataCacheConfigBuilder_ == null) { + dataCacheConfig_ = builderForValue.build(); + } else { + dataCacheConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + */ + public Builder mergeDataCacheConfig(com.google.cloud.sql.v1beta4.DataCacheConfig value) { + if (dataCacheConfigBuilder_ == null) { + if (((bitField0_ & 0x80000000) != 0) + && dataCacheConfig_ != null + && dataCacheConfig_ + != com.google.cloud.sql.v1beta4.DataCacheConfig.getDefaultInstance()) { + getDataCacheConfigBuilder().mergeFrom(value); + } else { + dataCacheConfig_ = value; + } + } else { + dataCacheConfigBuilder_.mergeFrom(value); + } + if (dataCacheConfig_ != null) { + bitField0_ |= 0x80000000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + */ + public Builder clearDataCacheConfig() { + bitField0_ = (bitField0_ & ~0x80000000); + dataCacheConfig_ = null; + if (dataCacheConfigBuilder_ != null) { + dataCacheConfigBuilder_.dispose(); + dataCacheConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + */ + public com.google.cloud.sql.v1beta4.DataCacheConfig.Builder getDataCacheConfigBuilder() { + bitField0_ |= 0x80000000; + onChanged(); + return internalGetDataCacheConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + */ + public com.google.cloud.sql.v1beta4.DataCacheConfigOrBuilder getDataCacheConfigOrBuilder() { + if (dataCacheConfigBuilder_ != null) { + return dataCacheConfigBuilder_.getMessageOrBuilder(); + } else { + return dataCacheConfig_ == null + ? com.google.cloud.sql.v1beta4.DataCacheConfig.getDefaultInstance() + : dataCacheConfig_; + } + } + + /** + * + * + *
+     * Configuration for data cache.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DataCacheConfig, + com.google.cloud.sql.v1beta4.DataCacheConfig.Builder, + com.google.cloud.sql.v1beta4.DataCacheConfigOrBuilder> + internalGetDataCacheConfigFieldBuilder() { + if (dataCacheConfigBuilder_ == null) { + dataCacheConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DataCacheConfig, + com.google.cloud.sql.v1beta4.DataCacheConfig.Builder, + com.google.cloud.sql.v1beta4.DataCacheConfigOrBuilder>( + getDataCacheConfig(), getParentForChildren(), isClean()); + dataCacheConfig_ = null; + } + return dataCacheConfigBuilder_; + } + + private com.google.protobuf.Int32Value replicationLagMaxSeconds_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + replicationLagMaxSecondsBuilder_; + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag.
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the replicationLagMaxSeconds field is set. + */ + public boolean hasReplicationLagMaxSeconds() { + return ((bitField1_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag.
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The replicationLagMaxSeconds. + */ + public com.google.protobuf.Int32Value getReplicationLagMaxSeconds() { + if (replicationLagMaxSecondsBuilder_ == null) { + return replicationLagMaxSeconds_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : replicationLagMaxSeconds_; + } else { + return replicationLagMaxSecondsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag.
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReplicationLagMaxSeconds(com.google.protobuf.Int32Value value) { + if (replicationLagMaxSecondsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replicationLagMaxSeconds_ = value; + } else { + replicationLagMaxSecondsBuilder_.setMessage(value); + } + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag.
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReplicationLagMaxSeconds( + com.google.protobuf.Int32Value.Builder builderForValue) { + if (replicationLagMaxSecondsBuilder_ == null) { + replicationLagMaxSeconds_ = builderForValue.build(); + } else { + replicationLagMaxSecondsBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag.
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeReplicationLagMaxSeconds(com.google.protobuf.Int32Value value) { + if (replicationLagMaxSecondsBuilder_ == null) { + if (((bitField1_ & 0x00000001) != 0) + && replicationLagMaxSeconds_ != null + && replicationLagMaxSeconds_ != com.google.protobuf.Int32Value.getDefaultInstance()) { + getReplicationLagMaxSecondsBuilder().mergeFrom(value); + } else { + replicationLagMaxSeconds_ = value; + } + } else { + replicationLagMaxSecondsBuilder_.mergeFrom(value); + } + if (replicationLagMaxSeconds_ != null) { + bitField1_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag.
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearReplicationLagMaxSeconds() { + bitField1_ = (bitField1_ & ~0x00000001); + replicationLagMaxSeconds_ = null; + if (replicationLagMaxSecondsBuilder_ != null) { + replicationLagMaxSecondsBuilder_.dispose(); + replicationLagMaxSecondsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag.
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Int32Value.Builder getReplicationLagMaxSecondsBuilder() { + bitField1_ |= 0x00000001; + onChanged(); + return internalGetReplicationLagMaxSecondsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag.
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Int32ValueOrBuilder getReplicationLagMaxSecondsOrBuilder() { + if (replicationLagMaxSecondsBuilder_ != null) { + return replicationLagMaxSecondsBuilder_.getMessageOrBuilder(); + } else { + return replicationLagMaxSeconds_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : replicationLagMaxSeconds_; + } + } + + /** + * + * + *
+     * Optional. Configuration value for recreation of replica after certain
+     * replication lag.
+     * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + internalGetReplicationLagMaxSecondsFieldBuilder() { + if (replicationLagMaxSecondsBuilder_ == null) { + replicationLagMaxSecondsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getReplicationLagMaxSeconds(), getParentForChildren(), isClean()); + replicationLagMaxSeconds_ = null; + } + return replicationLagMaxSecondsBuilder_; + } + + private com.google.protobuf.BoolValue enableGoogleMlIntegration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + enableGoogleMlIntegrationBuilder_; + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enableGoogleMlIntegration field is set. + */ + public boolean hasEnableGoogleMlIntegration() { + return ((bitField1_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enableGoogleMlIntegration. + */ + public com.google.protobuf.BoolValue getEnableGoogleMlIntegration() { + if (enableGoogleMlIntegrationBuilder_ == null) { + return enableGoogleMlIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableGoogleMlIntegration_; + } else { + return enableGoogleMlIntegrationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEnableGoogleMlIntegration(com.google.protobuf.BoolValue value) { + if (enableGoogleMlIntegrationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enableGoogleMlIntegration_ = value; + } else { + enableGoogleMlIntegrationBuilder_.setMessage(value); + } + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEnableGoogleMlIntegration( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (enableGoogleMlIntegrationBuilder_ == null) { + enableGoogleMlIntegration_ = builderForValue.build(); + } else { + enableGoogleMlIntegrationBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEnableGoogleMlIntegration(com.google.protobuf.BoolValue value) { + if (enableGoogleMlIntegrationBuilder_ == null) { + if (((bitField1_ & 0x00000002) != 0) + && enableGoogleMlIntegration_ != null + && enableGoogleMlIntegration_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getEnableGoogleMlIntegrationBuilder().mergeFrom(value); + } else { + enableGoogleMlIntegration_ = value; + } + } else { + enableGoogleMlIntegrationBuilder_.mergeFrom(value); + } + if (enableGoogleMlIntegration_ != null) { + bitField1_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEnableGoogleMlIntegration() { + bitField1_ = (bitField1_ & ~0x00000002); + enableGoogleMlIntegration_ = null; + if (enableGoogleMlIntegrationBuilder_ != null) { + enableGoogleMlIntegrationBuilder_.dispose(); + enableGoogleMlIntegrationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getEnableGoogleMlIntegrationBuilder() { + bitField1_ |= 0x00000002; + onChanged(); + return internalGetEnableGoogleMlIntegrationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getEnableGoogleMlIntegrationOrBuilder() { + if (enableGoogleMlIntegrationBuilder_ != null) { + return enableGoogleMlIntegrationBuilder_.getMessageOrBuilder(); + } else { + return enableGoogleMlIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableGoogleMlIntegration_; + } + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL instances can
+     * connect to Vertex AI to pass requests for real-time predictions and
+     * insights to the AI. The default value is false. This applies only to Cloud
+     * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetEnableGoogleMlIntegrationFieldBuilder() { + if (enableGoogleMlIntegrationBuilder_ == null) { + enableGoogleMlIntegrationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getEnableGoogleMlIntegration(), getParentForChildren(), isClean()); + enableGoogleMlIntegration_ = null; + } + return enableGoogleMlIntegrationBuilder_; + } + + private com.google.protobuf.BoolValue enableDataplexIntegration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + enableDataplexIntegrationBuilder_; + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enableDataplexIntegration field is set. + */ + public boolean hasEnableDataplexIntegration() { + return ((bitField1_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enableDataplexIntegration. + */ + public com.google.protobuf.BoolValue getEnableDataplexIntegration() { + if (enableDataplexIntegrationBuilder_ == null) { + return enableDataplexIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableDataplexIntegration_; + } else { + return enableDataplexIntegrationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEnableDataplexIntegration(com.google.protobuf.BoolValue value) { + if (enableDataplexIntegrationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enableDataplexIntegration_ = value; + } else { + enableDataplexIntegrationBuilder_.setMessage(value); + } + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEnableDataplexIntegration( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (enableDataplexIntegrationBuilder_ == null) { + enableDataplexIntegration_ = builderForValue.build(); + } else { + enableDataplexIntegrationBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEnableDataplexIntegration(com.google.protobuf.BoolValue value) { + if (enableDataplexIntegrationBuilder_ == null) { + if (((bitField1_ & 0x00000004) != 0) + && enableDataplexIntegration_ != null + && enableDataplexIntegration_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getEnableDataplexIntegrationBuilder().mergeFrom(value); + } else { + enableDataplexIntegration_ = value; + } + } else { + enableDataplexIntegrationBuilder_.mergeFrom(value); + } + if (enableDataplexIntegration_ != null) { + bitField1_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEnableDataplexIntegration() { + bitField1_ = (bitField1_ & ~0x00000004); + enableDataplexIntegration_ = null; + if (enableDataplexIntegrationBuilder_ != null) { + enableDataplexIntegrationBuilder_.dispose(); + enableDataplexIntegrationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getEnableDataplexIntegrationBuilder() { + bitField1_ |= 0x00000004; + onChanged(); + return internalGetEnableDataplexIntegrationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getEnableDataplexIntegrationOrBuilder() { + if (enableDataplexIntegrationBuilder_ != null) { + return enableDataplexIntegrationBuilder_.getMessageOrBuilder(); + } else { + return enableDataplexIntegration_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : enableDataplexIntegration_; + } + } + + /** + * + * + *
+     * Optional. By default, Cloud SQL instances have schema extraction disabled
+     * for Dataplex. When this parameter is set to true, schema extraction for
+     * Dataplex on Cloud SQL instances is activated.
+     * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetEnableDataplexIntegrationFieldBuilder() { + if (enableDataplexIntegrationBuilder_ == null) { + enableDataplexIntegrationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getEnableDataplexIntegration(), getParentForChildren(), isClean()); + enableDataplexIntegration_ = null; + } + return enableDataplexIntegrationBuilder_; + } + + private com.google.protobuf.BoolValue retainBackupsOnDelete_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + retainBackupsOnDeleteBuilder_; + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the retainBackupsOnDelete field is set. + */ + public boolean hasRetainBackupsOnDelete() { + return ((bitField1_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retainBackupsOnDelete. + */ + public com.google.protobuf.BoolValue getRetainBackupsOnDelete() { + if (retainBackupsOnDeleteBuilder_ == null) { + return retainBackupsOnDelete_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : retainBackupsOnDelete_; + } else { + return retainBackupsOnDeleteBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRetainBackupsOnDelete(com.google.protobuf.BoolValue value) { + if (retainBackupsOnDeleteBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retainBackupsOnDelete_ = value; + } else { + retainBackupsOnDeleteBuilder_.setMessage(value); + } + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRetainBackupsOnDelete(com.google.protobuf.BoolValue.Builder builderForValue) { + if (retainBackupsOnDeleteBuilder_ == null) { + retainBackupsOnDelete_ = builderForValue.build(); + } else { + retainBackupsOnDeleteBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRetainBackupsOnDelete(com.google.protobuf.BoolValue value) { + if (retainBackupsOnDeleteBuilder_ == null) { + if (((bitField1_ & 0x00000008) != 0) + && retainBackupsOnDelete_ != null + && retainBackupsOnDelete_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getRetainBackupsOnDeleteBuilder().mergeFrom(value); + } else { + retainBackupsOnDelete_ = value; + } + } else { + retainBackupsOnDeleteBuilder_.mergeFrom(value); + } + if (retainBackupsOnDelete_ != null) { + bitField1_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRetainBackupsOnDelete() { + bitField1_ = (bitField1_ & ~0x00000008); + retainBackupsOnDelete_ = null; + if (retainBackupsOnDeleteBuilder_ != null) { + retainBackupsOnDeleteBuilder_.dispose(); + retainBackupsOnDeleteBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getRetainBackupsOnDeleteBuilder() { + bitField1_ |= 0x00000008; + onChanged(); + return internalGetRetainBackupsOnDeleteFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getRetainBackupsOnDeleteOrBuilder() { + if (retainBackupsOnDeleteBuilder_ != null) { + return retainBackupsOnDeleteBuilder_.getMessageOrBuilder(); + } else { + return retainBackupsOnDelete_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : retainBackupsOnDelete_; + } + } + + /** + * + * + *
+     * Optional. When this parameter is set to true, Cloud SQL retains backups of
+     * the instance even after the instance is deleted. The ON_DEMAND backup will
+     * be retained until customer deletes the backup or the project. The AUTOMATED
+     * backup will be retained based on the backups retention setting.
+     * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetRetainBackupsOnDeleteFieldBuilder() { + if (retainBackupsOnDeleteBuilder_ == null) { + retainBackupsOnDeleteBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getRetainBackupsOnDelete(), getParentForChildren(), isClean()); + retainBackupsOnDelete_ = null; + } + return retainBackupsOnDeleteBuilder_; + } + + private long dataDiskProvisionedIops_; + + /** + * + * + *
+     * Optional. Provisioned number of I/O operations per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataDiskProvisionedIops field is set. + */ + @java.lang.Override + public boolean hasDataDiskProvisionedIops() { + return ((bitField1_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. Provisioned number of I/O operations per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataDiskProvisionedIops. + */ + @java.lang.Override + public long getDataDiskProvisionedIops() { + return dataDiskProvisionedIops_; + } + + /** + * + * + *
+     * Optional. Provisioned number of I/O operations per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The dataDiskProvisionedIops to set. + * @return This builder for chaining. + */ + public Builder setDataDiskProvisionedIops(long value) { + + dataDiskProvisionedIops_ = value; + bitField1_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Provisioned number of I/O operations per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearDataDiskProvisionedIops() { + bitField1_ = (bitField1_ & ~0x00000010); + dataDiskProvisionedIops_ = 0L; + onChanged(); + return this; + } + + private long dataDiskProvisionedThroughput_; + + /** + * + * + *
+     * Optional. Provisioned throughput measured in MiB per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataDiskProvisionedThroughput field is set. + */ + @java.lang.Override + public boolean hasDataDiskProvisionedThroughput() { + return ((bitField1_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. Provisioned throughput measured in MiB per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataDiskProvisionedThroughput. + */ + @java.lang.Override + public long getDataDiskProvisionedThroughput() { + return dataDiskProvisionedThroughput_; + } + + /** + * + * + *
+     * Optional. Provisioned throughput measured in MiB per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The dataDiskProvisionedThroughput to set. + * @return This builder for chaining. + */ + public Builder setDataDiskProvisionedThroughput(long value) { + + dataDiskProvisionedThroughput_ = value; + bitField1_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Provisioned throughput measured in MiB per second for the data
+     * disk. This field is only used for hyperdisk-balanced disk types.
+     * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearDataDiskProvisionedThroughput() { + bitField1_ = (bitField1_ & ~0x00000020); + dataDiskProvisionedThroughput_ = 0L; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.ConnectionPoolConfig connectionPoolConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ConnectionPoolConfig, + com.google.cloud.sql.v1beta4.ConnectionPoolConfig.Builder, + com.google.cloud.sql.v1beta4.ConnectionPoolConfigOrBuilder> + connectionPoolConfigBuilder_; + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the connectionPoolConfig field is set. + */ + public boolean hasConnectionPoolConfig() { + return ((bitField1_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The connectionPoolConfig. + */ + public com.google.cloud.sql.v1beta4.ConnectionPoolConfig getConnectionPoolConfig() { + if (connectionPoolConfigBuilder_ == null) { + return connectionPoolConfig_ == null + ? com.google.cloud.sql.v1beta4.ConnectionPoolConfig.getDefaultInstance() + : connectionPoolConfig_; + } else { + return connectionPoolConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setConnectionPoolConfig( + com.google.cloud.sql.v1beta4.ConnectionPoolConfig value) { + if (connectionPoolConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connectionPoolConfig_ = value; + } else { + connectionPoolConfigBuilder_.setMessage(value); + } + bitField1_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setConnectionPoolConfig( + com.google.cloud.sql.v1beta4.ConnectionPoolConfig.Builder builderForValue) { + if (connectionPoolConfigBuilder_ == null) { + connectionPoolConfig_ = builderForValue.build(); + } else { + connectionPoolConfigBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeConnectionPoolConfig( + com.google.cloud.sql.v1beta4.ConnectionPoolConfig value) { + if (connectionPoolConfigBuilder_ == null) { + if (((bitField1_ & 0x00000040) != 0) + && connectionPoolConfig_ != null + && connectionPoolConfig_ + != com.google.cloud.sql.v1beta4.ConnectionPoolConfig.getDefaultInstance()) { + getConnectionPoolConfigBuilder().mergeFrom(value); + } else { + connectionPoolConfig_ = value; + } + } else { + connectionPoolConfigBuilder_.mergeFrom(value); + } + if (connectionPoolConfig_ != null) { + bitField1_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearConnectionPoolConfig() { + bitField1_ = (bitField1_ & ~0x00000040); + connectionPoolConfig_ = null; + if (connectionPoolConfigBuilder_ != null) { + connectionPoolConfigBuilder_.dispose(); + connectionPoolConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ConnectionPoolConfig.Builder + getConnectionPoolConfigBuilder() { + bitField1_ |= 0x00000040; + onChanged(); + return internalGetConnectionPoolConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ConnectionPoolConfigOrBuilder + getConnectionPoolConfigOrBuilder() { + if (connectionPoolConfigBuilder_ != null) { + return connectionPoolConfigBuilder_.getMessageOrBuilder(); + } else { + return connectionPoolConfig_ == null + ? com.google.cloud.sql.v1beta4.ConnectionPoolConfig.getDefaultInstance() + : connectionPoolConfig_; + } + } + + /** + * + * + *
+     * Optional. The managed connection pooling configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ConnectionPoolConfig, + com.google.cloud.sql.v1beta4.ConnectionPoolConfig.Builder, + com.google.cloud.sql.v1beta4.ConnectionPoolConfigOrBuilder> + internalGetConnectionPoolConfigFieldBuilder() { + if (connectionPoolConfigBuilder_ == null) { + connectionPoolConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ConnectionPoolConfig, + com.google.cloud.sql.v1beta4.ConnectionPoolConfig.Builder, + com.google.cloud.sql.v1beta4.ConnectionPoolConfigOrBuilder>( + getConnectionPoolConfig(), getParentForChildren(), isClean()); + connectionPoolConfig_ = null; + } + return connectionPoolConfigBuilder_; + } + + private com.google.cloud.sql.v1beta4.FinalBackupConfig finalBackupConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.FinalBackupConfig, + com.google.cloud.sql.v1beta4.FinalBackupConfig.Builder, + com.google.cloud.sql.v1beta4.FinalBackupConfigOrBuilder> + finalBackupConfigBuilder_; + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the finalBackupConfig field is set. + */ + public boolean hasFinalBackupConfig() { + return ((bitField1_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The finalBackupConfig. + */ + public com.google.cloud.sql.v1beta4.FinalBackupConfig getFinalBackupConfig() { + if (finalBackupConfigBuilder_ == null) { + return finalBackupConfig_ == null + ? com.google.cloud.sql.v1beta4.FinalBackupConfig.getDefaultInstance() + : finalBackupConfig_; + } else { + return finalBackupConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFinalBackupConfig(com.google.cloud.sql.v1beta4.FinalBackupConfig value) { + if (finalBackupConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finalBackupConfig_ = value; + } else { + finalBackupConfigBuilder_.setMessage(value); + } + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFinalBackupConfig( + com.google.cloud.sql.v1beta4.FinalBackupConfig.Builder builderForValue) { + if (finalBackupConfigBuilder_ == null) { + finalBackupConfig_ = builderForValue.build(); + } else { + finalBackupConfigBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFinalBackupConfig(com.google.cloud.sql.v1beta4.FinalBackupConfig value) { + if (finalBackupConfigBuilder_ == null) { + if (((bitField1_ & 0x00000080) != 0) + && finalBackupConfig_ != null + && finalBackupConfig_ + != com.google.cloud.sql.v1beta4.FinalBackupConfig.getDefaultInstance()) { + getFinalBackupConfigBuilder().mergeFrom(value); + } else { + finalBackupConfig_ = value; + } + } else { + finalBackupConfigBuilder_.mergeFrom(value); + } + if (finalBackupConfig_ != null) { + bitField1_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFinalBackupConfig() { + bitField1_ = (bitField1_ & ~0x00000080); + finalBackupConfig_ = null; + if (finalBackupConfigBuilder_ != null) { + finalBackupConfigBuilder_.dispose(); + finalBackupConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.FinalBackupConfig.Builder getFinalBackupConfigBuilder() { + bitField1_ |= 0x00000080; + onChanged(); + return internalGetFinalBackupConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.FinalBackupConfigOrBuilder getFinalBackupConfigOrBuilder() { + if (finalBackupConfigBuilder_ != null) { + return finalBackupConfigBuilder_.getMessageOrBuilder(); + } else { + return finalBackupConfig_ == null + ? com.google.cloud.sql.v1beta4.FinalBackupConfig.getDefaultInstance() + : finalBackupConfig_; + } + } + + /** + * + * + *
+     * Optional. The final backup configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.FinalBackupConfig, + com.google.cloud.sql.v1beta4.FinalBackupConfig.Builder, + com.google.cloud.sql.v1beta4.FinalBackupConfigOrBuilder> + internalGetFinalBackupConfigFieldBuilder() { + if (finalBackupConfigBuilder_ == null) { + finalBackupConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.FinalBackupConfig, + com.google.cloud.sql.v1beta4.FinalBackupConfig.Builder, + com.google.cloud.sql.v1beta4.FinalBackupConfigOrBuilder>( + getFinalBackupConfig(), getParentForChildren(), isClean()); + finalBackupConfig_ = null; + } + return finalBackupConfigBuilder_; + } + + private com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig readPoolAutoScaleConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.Builder, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfigOrBuilder> + readPoolAutoScaleConfigBuilder_; + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readPoolAutoScaleConfig field is set. + */ + public boolean hasReadPoolAutoScaleConfig() { + return ((bitField1_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readPoolAutoScaleConfig. + */ + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig getReadPoolAutoScaleConfig() { + if (readPoolAutoScaleConfigBuilder_ == null) { + return readPoolAutoScaleConfig_ == null + ? com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.getDefaultInstance() + : readPoolAutoScaleConfig_; + } else { + return readPoolAutoScaleConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadPoolAutoScaleConfig( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig value) { + if (readPoolAutoScaleConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readPoolAutoScaleConfig_ = value; + } else { + readPoolAutoScaleConfigBuilder_.setMessage(value); + } + bitField1_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadPoolAutoScaleConfig( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.Builder builderForValue) { + if (readPoolAutoScaleConfigBuilder_ == null) { + readPoolAutoScaleConfig_ = builderForValue.build(); + } else { + readPoolAutoScaleConfigBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeReadPoolAutoScaleConfig( + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig value) { + if (readPoolAutoScaleConfigBuilder_ == null) { + if (((bitField1_ & 0x00000100) != 0) + && readPoolAutoScaleConfig_ != null + && readPoolAutoScaleConfig_ + != com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.getDefaultInstance()) { + getReadPoolAutoScaleConfigBuilder().mergeFrom(value); + } else { + readPoolAutoScaleConfig_ = value; + } + } else { + readPoolAutoScaleConfigBuilder_.mergeFrom(value); + } + if (readPoolAutoScaleConfig_ != null) { + bitField1_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearReadPoolAutoScaleConfig() { + bitField1_ = (bitField1_ & ~0x00000100); + readPoolAutoScaleConfig_ = null; + if (readPoolAutoScaleConfigBuilder_ != null) { + readPoolAutoScaleConfigBuilder_.dispose(); + readPoolAutoScaleConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.Builder + getReadPoolAutoScaleConfigBuilder() { + bitField1_ |= 0x00000100; + onChanged(); + return internalGetReadPoolAutoScaleConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfigOrBuilder + getReadPoolAutoScaleConfigOrBuilder() { + if (readPoolAutoScaleConfigBuilder_ != null) { + return readPoolAutoScaleConfigBuilder_.getMessageOrBuilder(); + } else { + return readPoolAutoScaleConfig_ == null + ? com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.getDefaultInstance() + : readPoolAutoScaleConfig_; + } + } + + /** + * + * + *
+     * Optional. The read pool auto-scale configuration for the instance.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.Builder, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfigOrBuilder> + internalGetReadPoolAutoScaleConfigFieldBuilder() { + if (readPoolAutoScaleConfigBuilder_ == null) { + readPoolAutoScaleConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.Builder, + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfigOrBuilder>( + getReadPoolAutoScaleConfig(), getParentForChildren(), isClean()); + readPoolAutoScaleConfig_ = null; + } + return readPoolAutoScaleConfigBuilder_; + } + + private com.google.protobuf.BoolValue acceleratedReplicaMode_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + acceleratedReplicaModeBuilder_; + + /** + * + * + *
+     * Optional. Configures whether the replica is in accelerated mode. This
+     * feature is in private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the acceleratedReplicaMode field is set. + */ + public boolean hasAcceleratedReplicaMode() { + return ((bitField1_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Optional. Configures whether the replica is in accelerated mode. This
+     * feature is in private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The acceleratedReplicaMode. + */ + public com.google.protobuf.BoolValue getAcceleratedReplicaMode() { + if (acceleratedReplicaModeBuilder_ == null) { + return acceleratedReplicaMode_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : acceleratedReplicaMode_; + } else { + return acceleratedReplicaModeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Configures whether the replica is in accelerated mode. This
+     * feature is in private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setAcceleratedReplicaMode(com.google.protobuf.BoolValue value) { + if (acceleratedReplicaModeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + acceleratedReplicaMode_ = value; + } else { + acceleratedReplicaModeBuilder_.setMessage(value); + } + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configures whether the replica is in accelerated mode. This
+     * feature is in private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setAcceleratedReplicaMode( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (acceleratedReplicaModeBuilder_ == null) { + acceleratedReplicaMode_ = builderForValue.build(); + } else { + acceleratedReplicaModeBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configures whether the replica is in accelerated mode. This
+     * feature is in private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeAcceleratedReplicaMode(com.google.protobuf.BoolValue value) { + if (acceleratedReplicaModeBuilder_ == null) { + if (((bitField1_ & 0x00000200) != 0) + && acceleratedReplicaMode_ != null + && acceleratedReplicaMode_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getAcceleratedReplicaModeBuilder().mergeFrom(value); + } else { + acceleratedReplicaMode_ = value; + } + } else { + acceleratedReplicaModeBuilder_.mergeFrom(value); + } + if (acceleratedReplicaMode_ != null) { + bitField1_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Configures whether the replica is in accelerated mode. This
+     * feature is in private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearAcceleratedReplicaMode() { + bitField1_ = (bitField1_ & ~0x00000200); + acceleratedReplicaMode_ = null; + if (acceleratedReplicaModeBuilder_ != null) { + acceleratedReplicaModeBuilder_.dispose(); + acceleratedReplicaModeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configures whether the replica is in accelerated mode. This
+     * feature is in private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValue.Builder getAcceleratedReplicaModeBuilder() { + bitField1_ |= 0x00000200; + onChanged(); + return internalGetAcceleratedReplicaModeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Configures whether the replica is in accelerated mode. This
+     * feature is in private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getAcceleratedReplicaModeOrBuilder() { + if (acceleratedReplicaModeBuilder_ != null) { + return acceleratedReplicaModeBuilder_.getMessageOrBuilder(); + } else { + return acceleratedReplicaMode_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : acceleratedReplicaMode_; + } + } + + /** + * + * + *
+     * Optional. Configures whether the replica is in accelerated mode. This
+     * feature is in private preview and requires allowlisting to take effect.
+     * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + internalGetAcceleratedReplicaModeFieldBuilder() { + if (acceleratedReplicaModeBuilder_ == null) { + acceleratedReplicaModeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getAcceleratedReplicaMode(), getParentForChildren(), isClean()); + acceleratedReplicaMode_ = null; + } + return acceleratedReplicaModeBuilder_; + } + + private boolean autoUpgradeEnabled_; + + /** + * + * + *
+     * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+     * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+     * versions. The MySQL version must be 8.0.35 or higher.
+     * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the autoUpgradeEnabled field is set. + */ + @java.lang.Override + public boolean hasAutoUpgradeEnabled() { + return ((bitField1_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+     * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+     * versions. The MySQL version must be 8.0.35 or higher.
+     * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The autoUpgradeEnabled. + */ + @java.lang.Override + public boolean getAutoUpgradeEnabled() { + return autoUpgradeEnabled_; + } + + /** + * + * + *
+     * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+     * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+     * versions. The MySQL version must be 8.0.35 or higher.
+     * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The autoUpgradeEnabled to set. + * @return This builder for chaining. + */ + public Builder setAutoUpgradeEnabled(boolean value) { + + autoUpgradeEnabled_ = value; + bitField1_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+     * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+     * versions. The MySQL version must be 8.0.35 or higher.
+     * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearAutoUpgradeEnabled() { + bitField1_ = (bitField1_ & ~0x00000400); + autoUpgradeEnabled_ = false; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraidConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig, + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.Builder, + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfigOrBuilder> + entraidConfigBuilder_; + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the entraidConfig field is set. + */ + public boolean hasEntraidConfig() { + return ((bitField1_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The entraidConfig. + */ + public com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig getEntraidConfig() { + if (entraidConfigBuilder_ == null) { + return entraidConfig_ == null + ? com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.getDefaultInstance() + : entraidConfig_; + } else { + return entraidConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEntraidConfig(com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig value) { + if (entraidConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + entraidConfig_ = value; + } else { + entraidConfigBuilder_.setMessage(value); + } + bitField1_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEntraidConfig( + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.Builder builderForValue) { + if (entraidConfigBuilder_ == null) { + entraidConfig_ = builderForValue.build(); + } else { + entraidConfigBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEntraidConfig(com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig value) { + if (entraidConfigBuilder_ == null) { + if (((bitField1_ & 0x00000800) != 0) + && entraidConfig_ != null + && entraidConfig_ + != com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.getDefaultInstance()) { + getEntraidConfigBuilder().mergeFrom(value); + } else { + entraidConfig_ = value; + } + } else { + entraidConfigBuilder_.mergeFrom(value); + } + if (entraidConfig_ != null) { + bitField1_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEntraidConfig() { + bitField1_ = (bitField1_ & ~0x00000800); + entraidConfig_ = null; + if (entraidConfigBuilder_ != null) { + entraidConfigBuilder_.dispose(); + entraidConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.Builder getEntraidConfigBuilder() { + bitField1_ |= 0x00000800; + onChanged(); + return internalGetEntraidConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.SqlServerEntraIdConfigOrBuilder + getEntraidConfigOrBuilder() { + if (entraidConfigBuilder_ != null) { + return entraidConfigBuilder_.getMessageOrBuilder(); + } else { + return entraidConfig_ == null + ? com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.getDefaultInstance() + : entraidConfig_; + } + } + + /** + * + * + *
+     * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig, + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.Builder, + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfigOrBuilder> + internalGetEntraidConfigFieldBuilder() { + if (entraidConfigBuilder_ == null) { + entraidConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig, + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.Builder, + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfigOrBuilder>( + getEntraidConfig(), getParentForChildren(), isClean()); + entraidConfig_ = null; + } + return entraidConfigBuilder_; + } + + private int dataApiAccess_ = 0; + + /** + * + * + *
+     * This parameter controls whether to allow using ExecuteSql API to connect to
+     * the instance. Not allowed by default.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.Settings.DataApiAccess data_api_access = 53; + * + * @return Whether the dataApiAccess field is set. + */ + @java.lang.Override + public boolean hasDataApiAccess() { + return ((bitField1_ & 0x00001000) != 0); + } + + /** + * + * + *
+     * This parameter controls whether to allow using ExecuteSql API to connect to
+     * the instance. Not allowed by default.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.Settings.DataApiAccess data_api_access = 53; + * + * @return The enum numeric value on the wire for dataApiAccess. + */ + @java.lang.Override + public int getDataApiAccessValue() { + return dataApiAccess_; + } + + /** + * + * + *
+     * This parameter controls whether to allow using ExecuteSql API to connect to
+     * the instance. Not allowed by default.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.Settings.DataApiAccess data_api_access = 53; + * + * @param value The enum numeric value on the wire for dataApiAccess to set. + * @return This builder for chaining. + */ + public Builder setDataApiAccessValue(int value) { + dataApiAccess_ = value; + bitField1_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * This parameter controls whether to allow using ExecuteSql API to connect to
+     * the instance. Not allowed by default.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.Settings.DataApiAccess data_api_access = 53; + * + * @return The dataApiAccess. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Settings.DataApiAccess getDataApiAccess() { + com.google.cloud.sql.v1beta4.Settings.DataApiAccess result = + com.google.cloud.sql.v1beta4.Settings.DataApiAccess.forNumber(dataApiAccess_); + return result == null + ? com.google.cloud.sql.v1beta4.Settings.DataApiAccess.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * This parameter controls whether to allow using ExecuteSql API to connect to
+     * the instance. Not allowed by default.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.Settings.DataApiAccess data_api_access = 53; + * + * @param value The dataApiAccess to set. + * @return This builder for chaining. + */ + public Builder setDataApiAccess(com.google.cloud.sql.v1beta4.Settings.DataApiAccess value) { + if (value == null) { + throw new NullPointerException(); + } + bitField1_ |= 0x00001000; + dataApiAccess_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * This parameter controls whether to allow using ExecuteSql API to connect to
+     * the instance. Not allowed by default.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.Settings.DataApiAccess data_api_access = 53; + * + * @return This builder for chaining. + */ + public Builder clearDataApiAccess() { + bitField1_ = (bitField1_ & ~0x00001000); + dataApiAccess_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.PerformanceCaptureConfig performanceCaptureConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig, + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.Builder, + com.google.cloud.sql.v1beta4.PerformanceCaptureConfigOrBuilder> + performanceCaptureConfigBuilder_; + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the performanceCaptureConfig field is set. + */ + public boolean hasPerformanceCaptureConfig() { + return ((bitField1_ & 0x00002000) != 0); + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The performanceCaptureConfig. + */ + public com.google.cloud.sql.v1beta4.PerformanceCaptureConfig getPerformanceCaptureConfig() { + if (performanceCaptureConfigBuilder_ == null) { + return performanceCaptureConfig_ == null + ? com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.getDefaultInstance() + : performanceCaptureConfig_; + } else { + return performanceCaptureConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPerformanceCaptureConfig( + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig value) { + if (performanceCaptureConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + performanceCaptureConfig_ = value; + } else { + performanceCaptureConfigBuilder_.setMessage(value); + } + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPerformanceCaptureConfig( + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.Builder builderForValue) { + if (performanceCaptureConfigBuilder_ == null) { + performanceCaptureConfig_ = builderForValue.build(); + } else { + performanceCaptureConfigBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergePerformanceCaptureConfig( + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig value) { + if (performanceCaptureConfigBuilder_ == null) { + if (((bitField1_ & 0x00002000) != 0) + && performanceCaptureConfig_ != null + && performanceCaptureConfig_ + != com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.getDefaultInstance()) { + getPerformanceCaptureConfigBuilder().mergeFrom(value); + } else { + performanceCaptureConfig_ = value; + } + } else { + performanceCaptureConfigBuilder_.mergeFrom(value); + } + if (performanceCaptureConfig_ != null) { + bitField1_ |= 0x00002000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPerformanceCaptureConfig() { + bitField1_ = (bitField1_ & ~0x00002000); + performanceCaptureConfig_ = null; + if (performanceCaptureConfigBuilder_ != null) { + performanceCaptureConfigBuilder_.dispose(); + performanceCaptureConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.Builder + getPerformanceCaptureConfigBuilder() { + bitField1_ |= 0x00002000; + onChanged(); + return internalGetPerformanceCaptureConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.PerformanceCaptureConfigOrBuilder + getPerformanceCaptureConfigOrBuilder() { + if (performanceCaptureConfigBuilder_ != null) { + return performanceCaptureConfigBuilder_.getMessageOrBuilder(); + } else { + return performanceCaptureConfig_ == null + ? com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.getDefaultInstance() + : performanceCaptureConfig_; + } + } + + /** + * + * + *
+     * Optional. Configuration for Performance Capture, provides diagnostic
+     * metrics during high load situations.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig, + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.Builder, + com.google.cloud.sql.v1beta4.PerformanceCaptureConfigOrBuilder> + internalGetPerformanceCaptureConfigFieldBuilder() { + if (performanceCaptureConfigBuilder_ == null) { + performanceCaptureConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig, + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig.Builder, + com.google.cloud.sql.v1beta4.PerformanceCaptureConfigOrBuilder>( + getPerformanceCaptureConfig(), getParentForChildren(), isClean()); + performanceCaptureConfig_ = null; + } + return performanceCaptureConfigBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.Settings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.Settings) + private static final com.google.cloud.sql.v1beta4.Settings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.Settings(); + } + + public static com.google.cloud.sql.v1beta4.Settings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Settings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Settings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SettingsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SettingsOrBuilder.java new file mode 100644 index 000000000000..20c0fb7ef196 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SettingsOrBuilder.java @@ -0,0 +1,1929 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.Settings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The version of instance settings. This is a required field for update
+   * method to make sure concurrent updates are handled properly. During update,
+   * use the most recent settingsVersion value for this instance and do not try
+   * to update this value.
+   * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + * + * @return Whether the settingsVersion field is set. + */ + boolean hasSettingsVersion(); + + /** + * + * + *
+   * The version of instance settings. This is a required field for update
+   * method to make sure concurrent updates are handled properly. During update,
+   * use the most recent settingsVersion value for this instance and do not try
+   * to update this value.
+   * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + * + * @return The settingsVersion. + */ + com.google.protobuf.Int64Value getSettingsVersion(); + + /** + * + * + *
+   * The version of instance settings. This is a required field for update
+   * method to make sure concurrent updates are handled properly. During update,
+   * use the most recent settingsVersion value for this instance and do not try
+   * to update this value.
+   * 
+ * + * .google.protobuf.Int64Value settings_version = 1; + */ + com.google.protobuf.Int64ValueOrBuilder getSettingsVersionOrBuilder(); + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @return A list containing the authorizedGaeApplications. + */ + @java.lang.Deprecated + java.util.List getAuthorizedGaeApplicationsList(); + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @return The count of authorizedGaeApplications. + */ + @java.lang.Deprecated + int getAuthorizedGaeApplicationsCount(); + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @param index The index of the element to return. + * @return The authorizedGaeApplications at the given index. + */ + @java.lang.Deprecated + java.lang.String getAuthorizedGaeApplications(int index); + + /** + * + * + *
+   * The App Engine app IDs that can access this instance.
+   * (Deprecated) Applied to First Generation instances only.
+   * 
+ * + * repeated string authorized_gae_applications = 2 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.Settings.authorized_gae_applications is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3252 + * @param index The index of the value to return. + * @return The bytes of the authorizedGaeApplications at the given index. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getAuthorizedGaeApplicationsBytes(int index); + + /** + * + * + *
+   * The tier (or machine type) for this instance, for example
+   * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+   * 
+ * + * string tier = 3; + * + * @return The tier. + */ + java.lang.String getTier(); + + /** + * + * + *
+   * The tier (or machine type) for this instance, for example
+   * `db-custom-1-3840`. WARNING: Changing this restarts the instance.
+   * 
+ * + * string tier = 3; + * + * @return The bytes for tier. + */ + com.google.protobuf.ByteString getTierBytes(); + + /** + * + * + *
+   * This is always `sql#settings`.
+   * 
+ * + * string kind = 4; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#settings`.
+   * 
+ * + * string kind = 4; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + int getUserLabelsCount(); + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + boolean containsUserLabels(java.lang.String key); + + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getUserLabels(); + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + java.util.Map getUserLabelsMap(); + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + /* nullable */ + java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * User-provided labels, represented as a dictionary where each label is a
+   * single key value pair.
+   * 
+ * + * map<string, string> user_labels = 5; + */ + java.lang.String getUserLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Availability type. Potential values:
+   * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+   * zone affect data accessibility.
+   * *  `REGIONAL`: The instance can serve data from more than one zone in a
+   * region (it is highly available)./
+   *
+   * For more information, see [Overview of the High Availability
+   * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlAvailabilityType availability_type = 6; + * + * @return The enum numeric value on the wire for availabilityType. + */ + int getAvailabilityTypeValue(); + + /** + * + * + *
+   * Availability type. Potential values:
+   * *  `ZONAL`: The instance serves data from only one zone. Outages in that
+   * zone affect data accessibility.
+   * *  `REGIONAL`: The instance can serve data from more than one zone in a
+   * region (it is highly available)./
+   *
+   * For more information, see [Overview of the High Availability
+   * Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlAvailabilityType availability_type = 6; + * + * @return The availabilityType. + */ + com.google.cloud.sql.v1beta4.SqlAvailabilityType getAvailabilityType(); + + /** + * + * + *
+   * The pricing plan for this instance. This can be either `PER_USE` or
+   * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlPricingPlan pricing_plan = 7; + * + * @return The enum numeric value on the wire for pricingPlan. + */ + int getPricingPlanValue(); + + /** + * + * + *
+   * The pricing plan for this instance. This can be either `PER_USE` or
+   * `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlPricingPlan pricing_plan = 7; + * + * @return The pricingPlan. + */ + com.google.cloud.sql.v1beta4.SqlPricingPlan getPricingPlan(); + + /** + * + * + *
+   * The type of replication this instance uses. This can be either
+   * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+   * applicable to First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.replication_type is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3282 + * @return The enum numeric value on the wire for replicationType. + */ + @java.lang.Deprecated + int getReplicationTypeValue(); + + /** + * + * + *
+   * The type of replication this instance uses. This can be either
+   * `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
+   * applicable to First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlReplicationType replication_type = 8 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.replication_type is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3282 + * @return The replicationType. + */ + @java.lang.Deprecated + com.google.cloud.sql.v1beta4.SqlReplicationType getReplicationType(); + + /** + * + * + *
+   * The maximum size to which storage capacity can be automatically increased.
+   * The default value is 0, which specifies that there is no limit.
+   * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + * + * @return Whether the storageAutoResizeLimit field is set. + */ + boolean hasStorageAutoResizeLimit(); + + /** + * + * + *
+   * The maximum size to which storage capacity can be automatically increased.
+   * The default value is 0, which specifies that there is no limit.
+   * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + * + * @return The storageAutoResizeLimit. + */ + com.google.protobuf.Int64Value getStorageAutoResizeLimit(); + + /** + * + * + *
+   * The maximum size to which storage capacity can be automatically increased.
+   * The default value is 0, which specifies that there is no limit.
+   * 
+ * + * .google.protobuf.Int64Value storage_auto_resize_limit = 9; + */ + com.google.protobuf.Int64ValueOrBuilder getStorageAutoResizeLimitOrBuilder(); + + /** + * + * + *
+   * The activation policy specifies when the instance is activated; it is
+   * applicable only when the instance state is RUNNABLE. Valid values:
+   * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+   * connection requests.
+   * *  `NEVER`: The instance is off; it is not activated, even if a
+   * connection request arrives.
+   * 
+ * + * .google.cloud.sql.v1beta4.Settings.SqlActivationPolicy activation_policy = 10; + * + * @return The enum numeric value on the wire for activationPolicy. + */ + int getActivationPolicyValue(); + + /** + * + * + *
+   * The activation policy specifies when the instance is activated; it is
+   * applicable only when the instance state is RUNNABLE. Valid values:
+   * *  `ALWAYS`: The instance is on, and remains so even in the absence of
+   * connection requests.
+   * *  `NEVER`: The instance is off; it is not activated, even if a
+   * connection request arrives.
+   * 
+ * + * .google.cloud.sql.v1beta4.Settings.SqlActivationPolicy activation_policy = 10; + * + * @return The activationPolicy. + */ + com.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy getActivationPolicy(); + + /** + * + * + *
+   * The settings for IP Management. This allows to enable or disable the
+   * instance IP and manage which external networks can connect to the instance.
+   * The IPv4 address cannot be disabled for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + * + * @return Whether the ipConfiguration field is set. + */ + boolean hasIpConfiguration(); + + /** + * + * + *
+   * The settings for IP Management. This allows to enable or disable the
+   * instance IP and manage which external networks can connect to the instance.
+   * The IPv4 address cannot be disabled for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + * + * @return The ipConfiguration. + */ + com.google.cloud.sql.v1beta4.IpConfiguration getIpConfiguration(); + + /** + * + * + *
+   * The settings for IP Management. This allows to enable or disable the
+   * instance IP and manage which external networks can connect to the instance.
+   * The IPv4 address cannot be disabled for Second Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.IpConfiguration ip_configuration = 11; + */ + com.google.cloud.sql.v1beta4.IpConfigurationOrBuilder getIpConfigurationOrBuilder(); + + /** + * + * + *
+   * Configuration to increase storage size automatically. The default value is
+   * true.
+   * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + * + * @return Whether the storageAutoResize field is set. + */ + boolean hasStorageAutoResize(); + + /** + * + * + *
+   * Configuration to increase storage size automatically. The default value is
+   * true.
+   * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + * + * @return The storageAutoResize. + */ + com.google.protobuf.BoolValue getStorageAutoResize(); + + /** + * + * + *
+   * Configuration to increase storage size automatically. The default value is
+   * true.
+   * 
+ * + * .google.protobuf.BoolValue storage_auto_resize = 12; + */ + com.google.protobuf.BoolValueOrBuilder getStorageAutoResizeOrBuilder(); + + /** + * + * + *
+   * The location preference settings. This allows the instance to be located as
+   * near as possible to either an App Engine app or Compute Engine zone for
+   * better performance. App Engine co-location was only applicable to First
+   * Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + * + * @return Whether the locationPreference field is set. + */ + boolean hasLocationPreference(); + + /** + * + * + *
+   * The location preference settings. This allows the instance to be located as
+   * near as possible to either an App Engine app or Compute Engine zone for
+   * better performance. App Engine co-location was only applicable to First
+   * Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + * + * @return The locationPreference. + */ + com.google.cloud.sql.v1beta4.LocationPreference getLocationPreference(); + + /** + * + * + *
+   * The location preference settings. This allows the instance to be located as
+   * near as possible to either an App Engine app or Compute Engine zone for
+   * better performance. App Engine co-location was only applicable to First
+   * Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.LocationPreference location_preference = 13; + */ + com.google.cloud.sql.v1beta4.LocationPreferenceOrBuilder getLocationPreferenceOrBuilder(); + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + java.util.List getDatabaseFlagsList(); + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + com.google.cloud.sql.v1beta4.DatabaseFlags getDatabaseFlags(int index); + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + int getDatabaseFlagsCount(); + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + java.util.List + getDatabaseFlagsOrBuilderList(); + + /** + * + * + *
+   * The database flags passed to the instance at startup.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DatabaseFlags database_flags = 14; + */ + com.google.cloud.sql.v1beta4.DatabaseFlagsOrBuilder getDatabaseFlagsOrBuilder(int index); + + /** + * + * + *
+   * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+   * First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlDataDiskType data_disk_type = 15; + * + * @return The enum numeric value on the wire for dataDiskType. + */ + int getDataDiskTypeValue(); + + /** + * + * + *
+   * The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
+   * First Generation instances.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlDataDiskType data_disk_type = 15; + * + * @return The dataDiskType. + */ + com.google.cloud.sql.v1beta4.SqlDataDiskType getDataDiskType(); + + /** + * + * + *
+   * The maintenance window for this instance. This specifies when the instance
+   * can be restarted for maintenance purposes.
+   * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + * + * @return Whether the maintenanceWindow field is set. + */ + boolean hasMaintenanceWindow(); + + /** + * + * + *
+   * The maintenance window for this instance. This specifies when the instance
+   * can be restarted for maintenance purposes.
+   * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + * + * @return The maintenanceWindow. + */ + com.google.cloud.sql.v1beta4.MaintenanceWindow getMaintenanceWindow(); + + /** + * + * + *
+   * The maintenance window for this instance. This specifies when the instance
+   * can be restarted for maintenance purposes.
+   * 
+ * + * .google.cloud.sql.v1beta4.MaintenanceWindow maintenance_window = 16; + */ + com.google.cloud.sql.v1beta4.MaintenanceWindowOrBuilder getMaintenanceWindowOrBuilder(); + + /** + * + * + *
+   * The daily backup configuration for the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + * + * @return Whether the backupConfiguration field is set. + */ + boolean hasBackupConfiguration(); + + /** + * + * + *
+   * The daily backup configuration for the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + * + * @return The backupConfiguration. + */ + com.google.cloud.sql.v1beta4.BackupConfiguration getBackupConfiguration(); + + /** + * + * + *
+   * The daily backup configuration for the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.BackupConfiguration backup_configuration = 17; + */ + com.google.cloud.sql.v1beta4.BackupConfigurationOrBuilder getBackupConfigurationOrBuilder(); + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * replication is enabled or not. WARNING: Changing this restarts the
+   * instance.
+   * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + * + * @return Whether the databaseReplicationEnabled field is set. + */ + boolean hasDatabaseReplicationEnabled(); + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * replication is enabled or not. WARNING: Changing this restarts the
+   * instance.
+   * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + * + * @return The databaseReplicationEnabled. + */ + com.google.protobuf.BoolValue getDatabaseReplicationEnabled(); + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * replication is enabled or not. WARNING: Changing this restarts the
+   * instance.
+   * 
+ * + * .google.protobuf.BoolValue database_replication_enabled = 18; + */ + com.google.protobuf.BoolValueOrBuilder getDatabaseReplicationEnabledOrBuilder(); + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * database flags for crash-safe replication are enabled. This property was
+   * only applicable to First Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.crash_safe_replication_enabled is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3333 + * @return Whether the crashSafeReplicationEnabled field is set. + */ + @java.lang.Deprecated + boolean hasCrashSafeReplicationEnabled(); + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * database flags for crash-safe replication are enabled. This property was
+   * only applicable to First Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + * + * @deprecated google.cloud.sql.v1beta4.Settings.crash_safe_replication_enabled is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_resources.proto;l=3333 + * @return The crashSafeReplicationEnabled. + */ + @java.lang.Deprecated + com.google.protobuf.BoolValue getCrashSafeReplicationEnabled(); + + /** + * + * + *
+   * Configuration specific to read replica instances. Indicates whether
+   * database flags for crash-safe replication are enabled. This property was
+   * only applicable to First Generation instances.
+   * 
+ * + * .google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true]; + * + */ + @java.lang.Deprecated + com.google.protobuf.BoolValueOrBuilder getCrashSafeReplicationEnabledOrBuilder(); + + /** + * + * + *
+   * The size of data disk, in GB. The data disk size minimum is 10GB.
+   * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + * + * @return Whether the dataDiskSizeGb field is set. + */ + boolean hasDataDiskSizeGb(); + + /** + * + * + *
+   * The size of data disk, in GB. The data disk size minimum is 10GB.
+   * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + * + * @return The dataDiskSizeGb. + */ + com.google.protobuf.Int64Value getDataDiskSizeGb(); + + /** + * + * + *
+   * The size of data disk, in GB. The data disk size minimum is 10GB.
+   * 
+ * + * .google.protobuf.Int64Value data_disk_size_gb = 20; + */ + com.google.protobuf.Int64ValueOrBuilder getDataDiskSizeGbOrBuilder(); + + /** + * + * + *
+   * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + * + * @return Whether the activeDirectoryConfig field is set. + */ + boolean hasActiveDirectoryConfig(); + + /** + * + * + *
+   * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + * + * @return The activeDirectoryConfig. + */ + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig getActiveDirectoryConfig(); + + /** + * + * + *
+   * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig active_directory_config = 22; + */ + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfigOrBuilder + getActiveDirectoryConfigOrBuilder(); + + /** + * + * + *
+   * The name of server Instance collation.
+   * 
+ * + * string collation = 23; + * + * @return The collation. + */ + java.lang.String getCollation(); + + /** + * + * + *
+   * The name of server Instance collation.
+   * 
+ * + * string collation = 23; + * + * @return The bytes for collation. + */ + com.google.protobuf.ByteString getCollationBytes(); + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + java.util.List + getDenyMaintenancePeriodsList(); + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + com.google.cloud.sql.v1beta4.DenyMaintenancePeriod getDenyMaintenancePeriods(int index); + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + int getDenyMaintenancePeriodsCount(); + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + java.util.List + getDenyMaintenancePeriodsOrBuilderList(); + + /** + * + * + *
+   * Deny maintenance periods
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.DenyMaintenancePeriod deny_maintenance_periods = 24; + * + */ + com.google.cloud.sql.v1beta4.DenyMaintenancePeriodOrBuilder getDenyMaintenancePeriodsOrBuilder( + int index); + + /** + * + * + *
+   * Insights configuration, for now relevant only for Postgres.
+   * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + * + * @return Whether the insightsConfig field is set. + */ + boolean hasInsightsConfig(); + + /** + * + * + *
+   * Insights configuration, for now relevant only for Postgres.
+   * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + * + * @return The insightsConfig. + */ + com.google.cloud.sql.v1beta4.InsightsConfig getInsightsConfig(); + + /** + * + * + *
+   * Insights configuration, for now relevant only for Postgres.
+   * 
+ * + * .google.cloud.sql.v1beta4.InsightsConfig insights_config = 25; + */ + com.google.cloud.sql.v1beta4.InsightsConfigOrBuilder getInsightsConfigOrBuilder(); + + /** + * + * + *
+   * The local user password validation policy of the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + * + * @return Whether the passwordValidationPolicy field is set. + */ + boolean hasPasswordValidationPolicy(); + + /** + * + * + *
+   * The local user password validation policy of the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + * + * @return The passwordValidationPolicy. + */ + com.google.cloud.sql.v1beta4.PasswordValidationPolicy getPasswordValidationPolicy(); + + /** + * + * + *
+   * The local user password validation policy of the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.PasswordValidationPolicy password_validation_policy = 27; + * + */ + com.google.cloud.sql.v1beta4.PasswordValidationPolicyOrBuilder + getPasswordValidationPolicyOrBuilder(); + + /** + * + * + *
+   * SQL Server specific audit configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + * + * @return Whether the sqlServerAuditConfig field is set. + */ + boolean hasSqlServerAuditConfig(); + + /** + * + * + *
+   * SQL Server specific audit configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + * + * @return The sqlServerAuditConfig. + */ + com.google.cloud.sql.v1beta4.SqlServerAuditConfig getSqlServerAuditConfig(); + + /** + * + * + *
+   * SQL Server specific audit configuration.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlServerAuditConfig sql_server_audit_config = 29; + */ + com.google.cloud.sql.v1beta4.SqlServerAuditConfigOrBuilder getSqlServerAuditConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The edition type of the Cloud SQL instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for edition. + */ + int getEditionValue(); + + /** + * + * + *
+   * Optional. The edition type of the Cloud SQL instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.Settings.Edition edition = 38 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The edition. + */ + com.google.cloud.sql.v1beta4.Settings.Edition getEdition(); + + /** + * + * + *
+   * Specifies if connections must use Cloud SQL connectors.
+   * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+   * can be connected without Cloud SQL
+   * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+   * Connectors)
+   *
+   * Note that using REQUIRED disables all existing authorized networks. If
+   * this field is not specified when creating a new instance, NOT_REQUIRED is
+   * used. If this field is not specified when patching or updating an existing
+   * instance, it is left unchanged in the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * + * @return The enum numeric value on the wire for connectorEnforcement. + */ + int getConnectorEnforcementValue(); + + /** + * + * + *
+   * Specifies if connections must use Cloud SQL connectors.
+   * Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
+   * can be connected without Cloud SQL
+   * Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
+   * Connectors)
+   *
+   * Note that using REQUIRED disables all existing authorized networks. If
+   * this field is not specified when creating a new instance, NOT_REQUIRED is
+   * used. If this field is not specified when patching or updating an existing
+   * instance, it is left unchanged in the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.Settings.ConnectorEnforcement connector_enforcement = 32; + * + * + * @return The connectorEnforcement. + */ + com.google.cloud.sql.v1beta4.Settings.ConnectorEnforcement getConnectorEnforcement(); + + /** + * + * + *
+   * Configuration to protect against accidental instance deletion.
+   * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + * + * @return Whether the deletionProtectionEnabled field is set. + */ + boolean hasDeletionProtectionEnabled(); + + /** + * + * + *
+   * Configuration to protect against accidental instance deletion.
+   * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + * + * @return The deletionProtectionEnabled. + */ + com.google.protobuf.BoolValue getDeletionProtectionEnabled(); + + /** + * + * + *
+   * Configuration to protect against accidental instance deletion.
+   * 
+ * + * .google.protobuf.BoolValue deletion_protection_enabled = 33; + */ + com.google.protobuf.BoolValueOrBuilder getDeletionProtectionEnabledOrBuilder(); + + /** + * + * + *
+   * Server timezone, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * string time_zone = 34; + * + * @return The timeZone. + */ + java.lang.String getTimeZone(); + + /** + * + * + *
+   * Server timezone, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * string time_zone = 34; + * + * @return The bytes for timeZone. + */ + com.google.protobuf.ByteString getTimeZoneBytes(); + + /** + * + * + *
+   * Specifies advanced machine configuration for the instances relevant only
+   * for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + * + * @return Whether the advancedMachineFeatures field is set. + */ + boolean hasAdvancedMachineFeatures(); + + /** + * + * + *
+   * Specifies advanced machine configuration for the instances relevant only
+   * for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + * + * @return The advancedMachineFeatures. + */ + com.google.cloud.sql.v1beta4.AdvancedMachineFeatures getAdvancedMachineFeatures(); + + /** + * + * + *
+   * Specifies advanced machine configuration for the instances relevant only
+   * for SQL Server.
+   * 
+ * + * .google.cloud.sql.v1beta4.AdvancedMachineFeatures advanced_machine_features = 35; + */ + com.google.cloud.sql.v1beta4.AdvancedMachineFeaturesOrBuilder + getAdvancedMachineFeaturesOrBuilder(); + + /** + * + * + *
+   * Configuration for data cache.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + * + * @return Whether the dataCacheConfig field is set. + */ + boolean hasDataCacheConfig(); + + /** + * + * + *
+   * Configuration for data cache.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + * + * @return The dataCacheConfig. + */ + com.google.cloud.sql.v1beta4.DataCacheConfig getDataCacheConfig(); + + /** + * + * + *
+   * Configuration for data cache.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataCacheConfig data_cache_config = 37; + */ + com.google.cloud.sql.v1beta4.DataCacheConfigOrBuilder getDataCacheConfigOrBuilder(); + + /** + * + * + *
+   * Optional. Configuration value for recreation of replica after certain
+   * replication lag.
+   * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the replicationLagMaxSeconds field is set. + */ + boolean hasReplicationLagMaxSeconds(); + + /** + * + * + *
+   * Optional. Configuration value for recreation of replica after certain
+   * replication lag.
+   * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The replicationLagMaxSeconds. + */ + com.google.protobuf.Int32Value getReplicationLagMaxSeconds(); + + /** + * + * + *
+   * Optional. Configuration value for recreation of replica after certain
+   * replication lag.
+   * 
+ * + * + * .google.protobuf.Int32Value replication_lag_max_seconds = 39 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.Int32ValueOrBuilder getReplicationLagMaxSecondsOrBuilder(); + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL instances can
+   * connect to Vertex AI to pass requests for real-time predictions and
+   * insights to the AI. The default value is false. This applies only to Cloud
+   * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enableGoogleMlIntegration field is set. + */ + boolean hasEnableGoogleMlIntegration(); + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL instances can
+   * connect to Vertex AI to pass requests for real-time predictions and
+   * insights to the AI. The default value is false. This applies only to Cloud
+   * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enableGoogleMlIntegration. + */ + com.google.protobuf.BoolValue getEnableGoogleMlIntegration(); + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL instances can
+   * connect to Vertex AI to pass requests for real-time predictions and
+   * insights to the AI. The default value is false. This applies only to Cloud
+   * SQL for MySQL and Cloud SQL for PostgreSQL instances.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_google_ml_integration = 40 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getEnableGoogleMlIntegrationOrBuilder(); + + /** + * + * + *
+   * Optional. By default, Cloud SQL instances have schema extraction disabled
+   * for Dataplex. When this parameter is set to true, schema extraction for
+   * Dataplex on Cloud SQL instances is activated.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the enableDataplexIntegration field is set. + */ + boolean hasEnableDataplexIntegration(); + + /** + * + * + *
+   * Optional. By default, Cloud SQL instances have schema extraction disabled
+   * for Dataplex. When this parameter is set to true, schema extraction for
+   * Dataplex on Cloud SQL instances is activated.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enableDataplexIntegration. + */ + com.google.protobuf.BoolValue getEnableDataplexIntegration(); + + /** + * + * + *
+   * Optional. By default, Cloud SQL instances have schema extraction disabled
+   * for Dataplex. When this parameter is set to true, schema extraction for
+   * Dataplex on Cloud SQL instances is activated.
+   * 
+ * + * + * .google.protobuf.BoolValue enable_dataplex_integration = 41 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getEnableDataplexIntegrationOrBuilder(); + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL retains backups of
+   * the instance even after the instance is deleted. The ON_DEMAND backup will
+   * be retained until customer deletes the backup or the project. The AUTOMATED
+   * backup will be retained based on the backups retention setting.
+   * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the retainBackupsOnDelete field is set. + */ + boolean hasRetainBackupsOnDelete(); + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL retains backups of
+   * the instance even after the instance is deleted. The ON_DEMAND backup will
+   * be retained until customer deletes the backup or the project. The AUTOMATED
+   * backup will be retained based on the backups retention setting.
+   * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retainBackupsOnDelete. + */ + com.google.protobuf.BoolValue getRetainBackupsOnDelete(); + + /** + * + * + *
+   * Optional. When this parameter is set to true, Cloud SQL retains backups of
+   * the instance even after the instance is deleted. The ON_DEMAND backup will
+   * be retained until customer deletes the backup or the project. The AUTOMATED
+   * backup will be retained based on the backups retention setting.
+   * 
+ * + * + * .google.protobuf.BoolValue retain_backups_on_delete = 42 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getRetainBackupsOnDeleteOrBuilder(); + + /** + * + * + *
+   * Optional. Provisioned number of I/O operations per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataDiskProvisionedIops field is set. + */ + boolean hasDataDiskProvisionedIops(); + + /** + * + * + *
+   * Optional. Provisioned number of I/O operations per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * optional int64 data_disk_provisioned_iops = 43 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataDiskProvisionedIops. + */ + long getDataDiskProvisionedIops(); + + /** + * + * + *
+   * Optional. Provisioned throughput measured in MiB per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataDiskProvisionedThroughput field is set. + */ + boolean hasDataDiskProvisionedThroughput(); + + /** + * + * + *
+   * Optional. Provisioned throughput measured in MiB per second for the data
+   * disk. This field is only used for hyperdisk-balanced disk types.
+   * 
+ * + * + * optional int64 data_disk_provisioned_throughput = 44 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataDiskProvisionedThroughput. + */ + long getDataDiskProvisionedThroughput(); + + /** + * + * + *
+   * Optional. The managed connection pooling configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the connectionPoolConfig field is set. + */ + boolean hasConnectionPoolConfig(); + + /** + * + * + *
+   * Optional. The managed connection pooling configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The connectionPoolConfig. + */ + com.google.cloud.sql.v1beta4.ConnectionPoolConfig getConnectionPoolConfig(); + + /** + * + * + *
+   * Optional. The managed connection pooling configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.ConnectionPoolConfig connection_pool_config = 45 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.ConnectionPoolConfigOrBuilder getConnectionPoolConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The final backup configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the finalBackupConfig field is set. + */ + boolean hasFinalBackupConfig(); + + /** + * + * + *
+   * Optional. The final backup configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The finalBackupConfig. + */ + com.google.cloud.sql.v1beta4.FinalBackupConfig getFinalBackupConfig(); + + /** + * + * + *
+   * Optional. The final backup configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.FinalBackupConfig final_backup_config = 47 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.FinalBackupConfigOrBuilder getFinalBackupConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The read pool auto-scale configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readPoolAutoScaleConfig field is set. + */ + boolean hasReadPoolAutoScaleConfig(); + + /** + * + * + *
+   * Optional. The read pool auto-scale configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readPoolAutoScaleConfig. + */ + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig getReadPoolAutoScaleConfig(); + + /** + * + * + *
+   * Optional. The read pool auto-scale configuration for the instance.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfigOrBuilder + getReadPoolAutoScaleConfigOrBuilder(); + + /** + * + * + *
+   * Optional. Configures whether the replica is in accelerated mode. This
+   * feature is in private preview and requires allowlisting to take effect.
+   * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the acceleratedReplicaMode field is set. + */ + boolean hasAcceleratedReplicaMode(); + + /** + * + * + *
+   * Optional. Configures whether the replica is in accelerated mode. This
+   * feature is in private preview and requires allowlisting to take effect.
+   * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The acceleratedReplicaMode. + */ + com.google.protobuf.BoolValue getAcceleratedReplicaMode(); + + /** + * + * + *
+   * Optional. Configures whether the replica is in accelerated mode. This
+   * feature is in private preview and requires allowlisting to take effect.
+   * 
+ * + * + * .google.protobuf.BoolValue accelerated_replica_mode = 49 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.BoolValueOrBuilder getAcceleratedReplicaModeOrBuilder(); + + /** + * + * + *
+   * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+   * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+   * versions. The MySQL version must be 8.0.35 or higher.
+   * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the autoUpgradeEnabled field is set. + */ + boolean hasAutoUpgradeEnabled(); + + /** + * + * + *
+   * Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
+   * parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
+   * versions. The MySQL version must be 8.0.35 or higher.
+   * 
+ * + * optional bool auto_upgrade_enabled = 50 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The autoUpgradeEnabled. + */ + boolean getAutoUpgradeEnabled(); + + /** + * + * + *
+   * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the entraidConfig field is set. + */ + boolean hasEntraidConfig(); + + /** + * + * + *
+   * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The entraidConfig. + */ + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig getEntraidConfig(); + + /** + * + * + *
+   * Optional. The Microsoft Entra ID configuration for the SQL Server instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlServerEntraIdConfig entraid_config = 52 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfigOrBuilder getEntraidConfigOrBuilder(); + + /** + * + * + *
+   * This parameter controls whether to allow using ExecuteSql API to connect to
+   * the instance. Not allowed by default.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.Settings.DataApiAccess data_api_access = 53; + * + * @return Whether the dataApiAccess field is set. + */ + boolean hasDataApiAccess(); + + /** + * + * + *
+   * This parameter controls whether to allow using ExecuteSql API to connect to
+   * the instance. Not allowed by default.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.Settings.DataApiAccess data_api_access = 53; + * + * @return The enum numeric value on the wire for dataApiAccess. + */ + int getDataApiAccessValue(); + + /** + * + * + *
+   * This parameter controls whether to allow using ExecuteSql API to connect to
+   * the instance. Not allowed by default.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.Settings.DataApiAccess data_api_access = 53; + * + * @return The dataApiAccess. + */ + com.google.cloud.sql.v1beta4.Settings.DataApiAccess getDataApiAccess(); + + /** + * + * + *
+   * Optional. Configuration for Performance Capture, provides diagnostic
+   * metrics during high load situations.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the performanceCaptureConfig field is set. + */ + boolean hasPerformanceCaptureConfig(); + + /** + * + * + *
+   * Optional. Configuration for Performance Capture, provides diagnostic
+   * metrics during high load situations.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The performanceCaptureConfig. + */ + com.google.cloud.sql.v1beta4.PerformanceCaptureConfig getPerformanceCaptureConfig(); + + /** + * + * + *
+   * Optional. Configuration for Performance Capture, provides diagnostic
+   * metrics during high load situations.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PerformanceCaptureConfig performance_capture_config = 54 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.PerformanceCaptureConfigOrBuilder + getPerformanceCaptureConfigOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlActiveDirectoryConfig.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlActiveDirectoryConfig.java new file mode 100644 index 000000000000..073e1e7672e0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlActiveDirectoryConfig.java @@ -0,0 +1,1893 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlActiveDirectoryConfig} + */ +@com.google.protobuf.Generated +public final class SqlActiveDirectoryConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlActiveDirectoryConfig) + SqlActiveDirectoryConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlActiveDirectoryConfig"); + } + + // Use SqlActiveDirectoryConfig.newBuilder() to construct. + private SqlActiveDirectoryConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlActiveDirectoryConfig() { + kind_ = ""; + domain_ = ""; + mode_ = 0; + dnsServers_ = com.google.protobuf.LazyStringArrayList.emptyList(); + adminCredentialSecretName_ = ""; + organizationalUnit_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlActiveDirectoryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlActiveDirectoryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.class, + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.Builder.class); + } + + /** + * + * + *
+   * The modes of Active Directory configuration.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode} + */ + public enum ActiveDirectoryMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified mode.
+     * 
+ * + * ACTIVE_DIRECTORY_MODE_UNSPECIFIED = 0; + */ + ACTIVE_DIRECTORY_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Managed Active Directory mode. This is the fallback option to maintain
+     * backward compatibility.
+     * 
+ * + * MANAGED_ACTIVE_DIRECTORY = 1; + */ + MANAGED_ACTIVE_DIRECTORY(1), + /** + * + * + *
+     * Deprecated: Use CUSTOMER_MANAGED_ACTIVE_DIRECTORY instead.
+     * 
+ * + * SELF_MANAGED_ACTIVE_DIRECTORY = 2 [deprecated = true]; + */ + @java.lang.Deprecated + SELF_MANAGED_ACTIVE_DIRECTORY(2), + /** + * + * + *
+     * Customer-managed Active Directory mode.
+     * 
+ * + * CUSTOMER_MANAGED_ACTIVE_DIRECTORY = 3; + */ + CUSTOMER_MANAGED_ACTIVE_DIRECTORY(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ActiveDirectoryMode"); + } + + /** + * + * + *
+     * Unspecified mode.
+     * 
+ * + * ACTIVE_DIRECTORY_MODE_UNSPECIFIED = 0; + */ + public static final int ACTIVE_DIRECTORY_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Managed Active Directory mode. This is the fallback option to maintain
+     * backward compatibility.
+     * 
+ * + * MANAGED_ACTIVE_DIRECTORY = 1; + */ + public static final int MANAGED_ACTIVE_DIRECTORY_VALUE = 1; + + /** + * + * + *
+     * Deprecated: Use CUSTOMER_MANAGED_ACTIVE_DIRECTORY instead.
+     * 
+ * + * SELF_MANAGED_ACTIVE_DIRECTORY = 2 [deprecated = true]; + */ + @java.lang.Deprecated public static final int SELF_MANAGED_ACTIVE_DIRECTORY_VALUE = 2; + + /** + * + * + *
+     * Customer-managed Active Directory mode.
+     * 
+ * + * CUSTOMER_MANAGED_ACTIVE_DIRECTORY = 3; + */ + public static final int CUSTOMER_MANAGED_ACTIVE_DIRECTORY_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 ActiveDirectoryMode 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 ActiveDirectoryMode forNumber(int value) { + switch (value) { + case 0: + return ACTIVE_DIRECTORY_MODE_UNSPECIFIED; + case 1: + return MANAGED_ACTIVE_DIRECTORY; + case 2: + return SELF_MANAGED_ACTIVE_DIRECTORY; + case 3: + return CUSTOMER_MANAGED_ACTIVE_DIRECTORY; + 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 ActiveDirectoryMode findValueByNumber(int number) { + return ActiveDirectoryMode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ActiveDirectoryMode[] VALUES = values(); + + public static ActiveDirectoryMode 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 ActiveDirectoryMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode) + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always sql#activeDirectoryConfig.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always sql#activeDirectoryConfig.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOMAIN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object domain_ = ""; + + /** + * + * + *
+   * The name of the domain (e.g., mydomain.com).
+   * 
+ * + * string domain = 2; + * + * @return The domain. + */ + @java.lang.Override + public java.lang.String getDomain() { + java.lang.Object ref = domain_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + domain_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the domain (e.g., mydomain.com).
+   * 
+ * + * string domain = 2; + * + * @return The bytes for domain. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDomainBytes() { + java.lang.Object ref = domain_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + domain_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODE_FIELD_NUMBER = 3; + private int mode_ = 0; + + /** + * + * + *
+   * Optional. The mode of the Active Directory configuration.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.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 of the Active Directory configuration.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode getMode() { + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode result = + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode.forNumber(mode_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode.UNRECOGNIZED + : result; + } + + public static final int DNS_SERVERS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList dnsServers_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return A list containing the dnsServers. + */ + public com.google.protobuf.ProtocolStringList getDnsServersList() { + return dnsServers_; + } + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The count of dnsServers. + */ + public int getDnsServersCount() { + return dnsServers_.size(); + } + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param index The index of the element to return. + * @return The dnsServers at the given index. + */ + public java.lang.String getDnsServers(int index) { + return dnsServers_.get(index); + } + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the dnsServers at the given index. + */ + public com.google.protobuf.ByteString getDnsServersBytes(int index) { + return dnsServers_.getByteString(index); + } + + public static final int ADMIN_CREDENTIAL_SECRET_NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object adminCredentialSecretName_ = ""; + + /** + * + * + *
+   * Optional. The secret manager key storing the administrator credential.
+   * (e.g., projects/{project}/secrets/{secret}).
+   * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The adminCredentialSecretName. + */ + @java.lang.Override + public java.lang.String getAdminCredentialSecretName() { + java.lang.Object ref = adminCredentialSecretName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + adminCredentialSecretName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The secret manager key storing the administrator credential.
+   * (e.g., projects/{project}/secrets/{secret}).
+   * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for adminCredentialSecretName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAdminCredentialSecretNameBytes() { + java.lang.Object ref = adminCredentialSecretName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + adminCredentialSecretName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORGANIZATIONAL_UNIT_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object organizationalUnit_ = ""; + + /** + * + * + *
+   * Optional. The organizational unit distinguished name. This is the full
+   * hierarchical path to the organizational unit.
+   * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The organizationalUnit. + */ + @java.lang.Override + public java.lang.String getOrganizationalUnit() { + java.lang.Object ref = organizationalUnit_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + organizationalUnit_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The organizational unit distinguished name. This is the full
+   * hierarchical path to the organizational unit.
+   * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for organizationalUnit. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrganizationalUnitBytes() { + java.lang.Object ref = organizationalUnit_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + organizationalUnit_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(domain_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, domain_); + } + if (mode_ + != com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode + .ACTIVE_DIRECTORY_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, mode_); + } + for (int i = 0; i < dnsServers_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, dnsServers_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(adminCredentialSecretName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, adminCredentialSecretName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(organizationalUnit_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, organizationalUnit_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(domain_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, domain_); + } + if (mode_ + != com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode + .ACTIVE_DIRECTORY_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, mode_); + } + { + int dataSize = 0; + for (int i = 0; i < dnsServers_.size(); i++) { + dataSize += computeStringSizeNoTag(dnsServers_.getRaw(i)); + } + size += dataSize; + size += 1 * getDnsServersList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(adminCredentialSecretName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, adminCredentialSecretName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(organizationalUnit_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, organizationalUnit_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig other = + (com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getDomain().equals(other.getDomain())) return false; + if (mode_ != other.mode_) return false; + if (!getDnsServersList().equals(other.getDnsServersList())) return false; + if (!getAdminCredentialSecretName().equals(other.getAdminCredentialSecretName())) return false; + if (!getOrganizationalUnit().equals(other.getOrganizationalUnit())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + DOMAIN_FIELD_NUMBER; + hash = (53 * hash) + getDomain().hashCode(); + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + if (getDnsServersCount() > 0) { + hash = (37 * hash) + DNS_SERVERS_FIELD_NUMBER; + hash = (53 * hash) + getDnsServersList().hashCode(); + } + hash = (37 * hash) + ADMIN_CREDENTIAL_SECRET_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAdminCredentialSecretName().hashCode(); + hash = (37 * hash) + ORGANIZATIONAL_UNIT_FIELD_NUMBER; + hash = (53 * hash) + getOrganizationalUnit().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Active Directory configuration, relevant only for Cloud SQL for SQL Server.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlActiveDirectoryConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlActiveDirectoryConfig) + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlActiveDirectoryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlActiveDirectoryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.class, + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + domain_ = ""; + mode_ = 0; + dnsServers_ = com.google.protobuf.LazyStringArrayList.emptyList(); + adminCredentialSecretName_ = ""; + organizationalUnit_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlActiveDirectoryConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig build() { + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig buildPartial() { + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig result = + new com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.domain_ = domain_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.mode_ = mode_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + dnsServers_.makeImmutable(); + result.dnsServers_ = dnsServers_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.adminCredentialSecretName_ = adminCredentialSecretName_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.organizationalUnit_ = organizationalUnit_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig other) { + if (other == com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDomain().isEmpty()) { + domain_ = other.domain_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + if (!other.dnsServers_.isEmpty()) { + if (dnsServers_.isEmpty()) { + dnsServers_ = other.dnsServers_; + bitField0_ |= 0x00000008; + } else { + ensureDnsServersIsMutable(); + dnsServers_.addAll(other.dnsServers_); + } + onChanged(); + } + if (!other.getAdminCredentialSecretName().isEmpty()) { + adminCredentialSecretName_ = other.adminCredentialSecretName_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getOrganizationalUnit().isEmpty()) { + organizationalUnit_ = other.organizationalUnit_; + bitField0_ |= 0x00000020; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + domain_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDnsServersIsMutable(); + dnsServers_.add(s); + break; + } // case 34 + case 42: + { + adminCredentialSecretName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + organizationalUnit_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always sql#activeDirectoryConfig.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always sql#activeDirectoryConfig.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always sql#activeDirectoryConfig.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always sql#activeDirectoryConfig.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always sql#activeDirectoryConfig.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object domain_ = ""; + + /** + * + * + *
+     * The name of the domain (e.g., mydomain.com).
+     * 
+ * + * string domain = 2; + * + * @return The domain. + */ + public java.lang.String getDomain() { + java.lang.Object ref = domain_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + domain_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the domain (e.g., mydomain.com).
+     * 
+ * + * string domain = 2; + * + * @return The bytes for domain. + */ + public com.google.protobuf.ByteString getDomainBytes() { + java.lang.Object ref = domain_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + domain_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the domain (e.g., mydomain.com).
+     * 
+ * + * string domain = 2; + * + * @param value The domain to set. + * @return This builder for chaining. + */ + public Builder setDomain(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + domain_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the domain (e.g., mydomain.com).
+     * 
+ * + * string domain = 2; + * + * @return This builder for chaining. + */ + public Builder clearDomain() { + domain_ = getDefaultInstance().getDomain(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the domain (e.g., mydomain.com).
+     * 
+ * + * string domain = 2; + * + * @param value The bytes for domain to set. + * @return This builder for chaining. + */ + public Builder setDomainBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + domain_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int mode_ = 0; + + /** + * + * + *
+     * Optional. The mode of the Active Directory configuration.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.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 of the Active Directory configuration.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The mode of the Active Directory configuration.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode getMode() { + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode result = + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode.forNumber( + mode_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. The mode of the Active Directory configuration.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + mode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The mode of the Active Directory configuration.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00000004); + mode_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList dnsServers_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDnsServersIsMutable() { + if (!dnsServers_.isModifiable()) { + dnsServers_ = new com.google.protobuf.LazyStringArrayList(dnsServers_); + } + bitField0_ |= 0x00000008; + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return A list containing the dnsServers. + */ + public com.google.protobuf.ProtocolStringList getDnsServersList() { + dnsServers_.makeImmutable(); + return dnsServers_; + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The count of dnsServers. + */ + public int getDnsServersCount() { + return dnsServers_.size(); + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param index The index of the element to return. + * @return The dnsServers at the given index. + */ + public java.lang.String getDnsServers(int index) { + return dnsServers_.get(index); + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the dnsServers at the given index. + */ + public com.google.protobuf.ByteString getDnsServersBytes(int index) { + return dnsServers_.getByteString(index); + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param index The index to set the value at. + * @param value The dnsServers to set. + * @return This builder for chaining. + */ + public Builder setDnsServers(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsServersIsMutable(); + dnsServers_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The dnsServers to add. + * @return This builder for chaining. + */ + public Builder addDnsServers(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDnsServersIsMutable(); + dnsServers_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param values The dnsServers to add. + * @return This builder for chaining. + */ + public Builder addAllDnsServers(java.lang.Iterable values) { + ensureDnsServersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dnsServers_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDnsServers() { + dnsServers_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Domain controller IPv4 addresses used to bootstrap Active
+     * Directory.
+     * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The bytes of the dnsServers to add. + * @return This builder for chaining. + */ + public Builder addDnsServersBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDnsServersIsMutable(); + dnsServers_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object adminCredentialSecretName_ = ""; + + /** + * + * + *
+     * Optional. The secret manager key storing the administrator credential.
+     * (e.g., projects/{project}/secrets/{secret}).
+     * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The adminCredentialSecretName. + */ + public java.lang.String getAdminCredentialSecretName() { + java.lang.Object ref = adminCredentialSecretName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + adminCredentialSecretName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The secret manager key storing the administrator credential.
+     * (e.g., projects/{project}/secrets/{secret}).
+     * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for adminCredentialSecretName. + */ + public com.google.protobuf.ByteString getAdminCredentialSecretNameBytes() { + java.lang.Object ref = adminCredentialSecretName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + adminCredentialSecretName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The secret manager key storing the administrator credential.
+     * (e.g., projects/{project}/secrets/{secret}).
+     * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The adminCredentialSecretName to set. + * @return This builder for chaining. + */ + public Builder setAdminCredentialSecretName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + adminCredentialSecretName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The secret manager key storing the administrator credential.
+     * (e.g., projects/{project}/secrets/{secret}).
+     * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearAdminCredentialSecretName() { + adminCredentialSecretName_ = getDefaultInstance().getAdminCredentialSecretName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The secret manager key storing the administrator credential.
+     * (e.g., projects/{project}/secrets/{secret}).
+     * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for adminCredentialSecretName to set. + * @return This builder for chaining. + */ + public Builder setAdminCredentialSecretNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + adminCredentialSecretName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object organizationalUnit_ = ""; + + /** + * + * + *
+     * Optional. The organizational unit distinguished name. This is the full
+     * hierarchical path to the organizational unit.
+     * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The organizationalUnit. + */ + public java.lang.String getOrganizationalUnit() { + java.lang.Object ref = organizationalUnit_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + organizationalUnit_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The organizational unit distinguished name. This is the full
+     * hierarchical path to the organizational unit.
+     * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for organizationalUnit. + */ + public com.google.protobuf.ByteString getOrganizationalUnitBytes() { + java.lang.Object ref = organizationalUnit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + organizationalUnit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The organizational unit distinguished name. This is the full
+     * hierarchical path to the organizational unit.
+     * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The organizationalUnit to set. + * @return This builder for chaining. + */ + public Builder setOrganizationalUnit(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + organizationalUnit_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The organizational unit distinguished name. This is the full
+     * hierarchical path to the organizational unit.
+     * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrganizationalUnit() { + organizationalUnit_ = getDefaultInstance().getOrganizationalUnit(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The organizational unit distinguished name. This is the full
+     * hierarchical path to the organizational unit.
+     * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for organizationalUnit to set. + * @return This builder for chaining. + */ + public Builder setOrganizationalUnitBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + organizationalUnit_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlActiveDirectoryConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlActiveDirectoryConfig) + private static final com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig(); + } + + public static com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlActiveDirectoryConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlActiveDirectoryConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlActiveDirectoryConfigOrBuilder.java new file mode 100644 index 000000000000..8ccaf2c46b19 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlActiveDirectoryConfigOrBuilder.java @@ -0,0 +1,232 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlActiveDirectoryConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlActiveDirectoryConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always sql#activeDirectoryConfig.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always sql#activeDirectoryConfig.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The name of the domain (e.g., mydomain.com).
+   * 
+ * + * string domain = 2; + * + * @return The domain. + */ + java.lang.String getDomain(); + + /** + * + * + *
+   * The name of the domain (e.g., mydomain.com).
+   * 
+ * + * string domain = 2; + * + * @return The bytes for domain. + */ + com.google.protobuf.ByteString getDomainBytes(); + + /** + * + * + *
+   * Optional. The mode of the Active Directory configuration.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + + /** + * + * + *
+   * Optional. The mode of the Active Directory configuration.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + com.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode getMode(); + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return A list containing the dnsServers. + */ + java.util.List getDnsServersList(); + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The count of dnsServers. + */ + int getDnsServersCount(); + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param index The index of the element to return. + * @return The dnsServers at the given index. + */ + java.lang.String getDnsServers(int index); + + /** + * + * + *
+   * Optional. Domain controller IPv4 addresses used to bootstrap Active
+   * Directory.
+   * 
+ * + * + * repeated string dns_servers = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the dnsServers at the given index. + */ + com.google.protobuf.ByteString getDnsServersBytes(int index); + + /** + * + * + *
+   * Optional. The secret manager key storing the administrator credential.
+   * (e.g., projects/{project}/secrets/{secret}).
+   * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The adminCredentialSecretName. + */ + java.lang.String getAdminCredentialSecretName(); + + /** + * + * + *
+   * Optional. The secret manager key storing the administrator credential.
+   * (e.g., projects/{project}/secrets/{secret}).
+   * 
+ * + * string admin_credential_secret_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for adminCredentialSecretName. + */ + com.google.protobuf.ByteString getAdminCredentialSecretNameBytes(); + + /** + * + * + *
+   * Optional. The organizational unit distinguished name. This is the full
+   * hierarchical path to the organizational unit.
+   * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The organizationalUnit. + */ + java.lang.String getOrganizationalUnit(); + + /** + * + * + *
+   * Optional. The organizational unit distinguished name. This is the full
+   * hierarchical path to the organizational unit.
+   * 
+ * + * string organizational_unit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for organizationalUnit. + */ + com.google.protobuf.ByteString getOrganizationalUnitBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlAvailabilityType.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlAvailabilityType.java new file mode 100644 index 000000000000..0a1a9e2d7d07 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlAvailabilityType.java @@ -0,0 +1,196 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The availability type of the given Cloud SQL instance.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.SqlAvailabilityType} + */ +@com.google.protobuf.Generated +public enum SqlAvailabilityType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown Availability type.
+   * 
+ * + * SQL_AVAILABILITY_TYPE_UNSPECIFIED = 0; + */ + SQL_AVAILABILITY_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Zonal available instance.
+   * 
+ * + * ZONAL = 1; + */ + ZONAL(1), + /** + * + * + *
+   * Regional available instance.
+   * 
+ * + * REGIONAL = 2; + */ + REGIONAL(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlAvailabilityType"); + } + + /** + * + * + *
+   * This is an unknown Availability type.
+   * 
+ * + * SQL_AVAILABILITY_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_AVAILABILITY_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Zonal available instance.
+   * 
+ * + * ZONAL = 1; + */ + public static final int ZONAL_VALUE = 1; + + /** + * + * + *
+   * Regional available instance.
+   * 
+ * + * REGIONAL = 2; + */ + public static final int REGIONAL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SqlAvailabilityType 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 SqlAvailabilityType forNumber(int value) { + switch (value) { + case 0: + return SQL_AVAILABILITY_TYPE_UNSPECIFIED; + case 1: + return ZONAL; + case 2: + return REGIONAL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SqlAvailabilityType findValueByNumber(int number) { + return SqlAvailabilityType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(15); + } + + private static final SqlAvailabilityType[] VALUES = values(); + + public static SqlAvailabilityType 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 SqlAvailabilityType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlAvailabilityType) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackendType.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackendType.java new file mode 100644 index 000000000000..0514e154a05e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackendType.java @@ -0,0 +1,209 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf enum {@code google.cloud.sql.v1beta4.SqlBackendType} */ +@com.google.protobuf.Generated +public enum SqlBackendType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown backend type for instance.
+   * 
+ * + * SQL_BACKEND_TYPE_UNSPECIFIED = 0; + */ + SQL_BACKEND_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * V1 speckle instance.
+   * 
+ * + * FIRST_GEN = 1 [deprecated = true]; + */ + @java.lang.Deprecated + FIRST_GEN(1), + /** + * + * + *
+   * V2 speckle instance.
+   * 
+ * + * SECOND_GEN = 2; + */ + SECOND_GEN(2), + /** + * + * + *
+   * On premises instance.
+   * 
+ * + * EXTERNAL = 3; + */ + EXTERNAL(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackendType"); + } + + /** + * + * + *
+   * This is an unknown backend type for instance.
+   * 
+ * + * SQL_BACKEND_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_BACKEND_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * V1 speckle instance.
+   * 
+ * + * FIRST_GEN = 1 [deprecated = true]; + */ + @java.lang.Deprecated public static final int FIRST_GEN_VALUE = 1; + + /** + * + * + *
+   * V2 speckle instance.
+   * 
+ * + * SECOND_GEN = 2; + */ + public static final int SECOND_GEN_VALUE = 2; + + /** + * + * + *
+   * On premises instance.
+   * 
+ * + * EXTERNAL = 3; + */ + public static final int EXTERNAL_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 SqlBackendType 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 SqlBackendType forNumber(int value) { + switch (value) { + case 0: + return SQL_BACKEND_TYPE_UNSPECIFIED; + case 1: + return FIRST_GEN; + case 2: + return SECOND_GEN; + case 3: + return EXTERNAL; + 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 SqlBackendType findValueByNumber(int number) { + return SqlBackendType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(7); + } + + private static final SqlBackendType[] VALUES = values(); + + public static SqlBackendType 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 SqlBackendType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlBackendType) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupKind.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupKind.java new file mode 100644 index 000000000000..07b8631a9914 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupKind.java @@ -0,0 +1,193 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Defines the supported backup kinds
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.SqlBackupKind} + */ +@com.google.protobuf.Generated +public enum SqlBackupKind implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown BackupKind.
+   * 
+ * + * SQL_BACKUP_KIND_UNSPECIFIED = 0; + */ + SQL_BACKUP_KIND_UNSPECIFIED(0), + /** + * + * + *
+   * Snapshot-based backups.
+   * 
+ * + * SNAPSHOT = 1; + */ + SNAPSHOT(1), + /** + * + * + *
+   * Physical backups.
+   * 
+ * + * PHYSICAL = 2; + */ + PHYSICAL(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupKind"); + } + + /** + * + * + *
+   * This is an unknown BackupKind.
+   * 
+ * + * SQL_BACKUP_KIND_UNSPECIFIED = 0; + */ + public static final int SQL_BACKUP_KIND_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Snapshot-based backups.
+   * 
+ * + * SNAPSHOT = 1; + */ + public static final int SNAPSHOT_VALUE = 1; + + /** + * + * + *
+   * Physical backups.
+   * 
+ * + * PHYSICAL = 2; + */ + public static final int PHYSICAL_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 SqlBackupKind 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 SqlBackupKind forNumber(int value) { + switch (value) { + case 0: + return SQL_BACKUP_KIND_UNSPECIFIED; + case 1: + return SNAPSHOT; + case 2: + return PHYSICAL; + 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 SqlBackupKind findValueByNumber(int number) { + return SqlBackupKind.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(6); + } + + private static final SqlBackupKind[] VALUES = values(); + + public static SqlBackupKind 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 SqlBackupKind(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlBackupKind) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunStatus.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunStatus.java new file mode 100644 index 000000000000..571b24ef06b9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunStatus.java @@ -0,0 +1,362 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The status of a backup run.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.SqlBackupRunStatus} + */ +@com.google.protobuf.Generated +public enum SqlBackupRunStatus implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The status of the run is unknown.
+   * 
+ * + * SQL_BACKUP_RUN_STATUS_UNSPECIFIED = 0; + */ + SQL_BACKUP_RUN_STATUS_UNSPECIFIED(0), + /** + * + * + *
+   * The backup operation was enqueued.
+   * 
+ * + * ENQUEUED = 1; + */ + ENQUEUED(1), + /** + * + * + *
+   * The backup is overdue across a given backup window. Indicates a
+   * problem. Example: Long-running operation in progress during
+   * the whole window.
+   * 
+ * + * OVERDUE = 2; + */ + OVERDUE(2), + /** + * + * + *
+   * The backup is in progress.
+   * 
+ * + * RUNNING = 3; + */ + RUNNING(3), + /** + * + * + *
+   * The backup failed.
+   * 
+ * + * FAILED = 4; + */ + FAILED(4), + /** + * + * + *
+   * The backup was successful.
+   * 
+ * + * SUCCESSFUL = 5; + */ + SUCCESSFUL(5), + /** + * + * + *
+   * The backup was skipped (without problems) for a given backup
+   * window. Example: Instance was idle.
+   * 
+ * + * SKIPPED = 6; + */ + SKIPPED(6), + /** + * + * + *
+   * The backup is about to be deleted.
+   * 
+ * + * DELETION_PENDING = 7; + */ + DELETION_PENDING(7), + /** + * + * + *
+   * The backup deletion failed.
+   * 
+ * + * DELETION_FAILED = 8; + */ + DELETION_FAILED(8), + /** + * + * + *
+   * The backup has been deleted.
+   * 
+ * + * DELETED = 9; + */ + DELETED(9), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupRunStatus"); + } + + /** + * + * + *
+   * The status of the run is unknown.
+   * 
+ * + * SQL_BACKUP_RUN_STATUS_UNSPECIFIED = 0; + */ + public static final int SQL_BACKUP_RUN_STATUS_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The backup operation was enqueued.
+   * 
+ * + * ENQUEUED = 1; + */ + public static final int ENQUEUED_VALUE = 1; + + /** + * + * + *
+   * The backup is overdue across a given backup window. Indicates a
+   * problem. Example: Long-running operation in progress during
+   * the whole window.
+   * 
+ * + * OVERDUE = 2; + */ + public static final int OVERDUE_VALUE = 2; + + /** + * + * + *
+   * The backup is in progress.
+   * 
+ * + * RUNNING = 3; + */ + public static final int RUNNING_VALUE = 3; + + /** + * + * + *
+   * The backup failed.
+   * 
+ * + * FAILED = 4; + */ + public static final int FAILED_VALUE = 4; + + /** + * + * + *
+   * The backup was successful.
+   * 
+ * + * SUCCESSFUL = 5; + */ + public static final int SUCCESSFUL_VALUE = 5; + + /** + * + * + *
+   * The backup was skipped (without problems) for a given backup
+   * window. Example: Instance was idle.
+   * 
+ * + * SKIPPED = 6; + */ + public static final int SKIPPED_VALUE = 6; + + /** + * + * + *
+   * The backup is about to be deleted.
+   * 
+ * + * DELETION_PENDING = 7; + */ + public static final int DELETION_PENDING_VALUE = 7; + + /** + * + * + *
+   * The backup deletion failed.
+   * 
+ * + * DELETION_FAILED = 8; + */ + public static final int DELETION_FAILED_VALUE = 8; + + /** + * + * + *
+   * The backup has been deleted.
+   * 
+ * + * DELETED = 9; + */ + public static final int DELETED_VALUE = 9; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SqlBackupRunStatus 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 SqlBackupRunStatus forNumber(int value) { + switch (value) { + case 0: + return SQL_BACKUP_RUN_STATUS_UNSPECIFIED; + case 1: + return ENQUEUED; + case 2: + return OVERDUE; + case 3: + return RUNNING; + case 4: + return FAILED; + case 5: + return SUCCESSFUL; + case 6: + return SKIPPED; + case 7: + return DELETION_PENDING; + case 8: + return DELETION_FAILED; + case 9: + return DELETED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SqlBackupRunStatus findValueByNumber(int number) { + return SqlBackupRunStatus.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(4); + } + + private static final SqlBackupRunStatus[] VALUES = values(); + + public static SqlBackupRunStatus 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 SqlBackupRunStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlBackupRunStatus) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunType.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunType.java new file mode 100644 index 000000000000..cdc353e1d90e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunType.java @@ -0,0 +1,185 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf enum {@code google.cloud.sql.v1beta4.SqlBackupRunType} */ +@com.google.protobuf.Generated +public enum SqlBackupRunType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown BackupRun type.
+   * 
+ * + * SQL_BACKUP_RUN_TYPE_UNSPECIFIED = 0; + */ + SQL_BACKUP_RUN_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * The backup schedule automatically triggers a backup.
+   * 
+ * + * AUTOMATED = 1; + */ + AUTOMATED(1), + /** + * + * + *
+   * The user manually triggers a backup.
+   * 
+ * + * ON_DEMAND = 2; + */ + ON_DEMAND(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupRunType"); + } + + /** + * + * + *
+   * This is an unknown BackupRun type.
+   * 
+ * + * SQL_BACKUP_RUN_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_BACKUP_RUN_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The backup schedule automatically triggers a backup.
+   * 
+ * + * AUTOMATED = 1; + */ + public static final int AUTOMATED_VALUE = 1; + + /** + * + * + *
+   * The user manually triggers a backup.
+   * 
+ * + * ON_DEMAND = 2; + */ + public static final int ON_DEMAND_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 SqlBackupRunType 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 SqlBackupRunType forNumber(int value) { + switch (value) { + case 0: + return SQL_BACKUP_RUN_TYPE_UNSPECIFIED; + case 1: + return AUTOMATED; + case 2: + return ON_DEMAND; + 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 SqlBackupRunType findValueByNumber(int number) { + return SqlBackupRunType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(5); + } + + private static final SqlBackupRunType[] VALUES = values(); + + public static SqlBackupRunType 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 SqlBackupRunType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlBackupRunType) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsDeleteRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsDeleteRequest.java new file mode 100644 index 000000000000..4347bbcb8a0c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsDeleteRequest.java @@ -0,0 +1,875 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest} */ +@com.google.protobuf.Generated +public final class SqlBackupRunsDeleteRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest) + SqlBackupRunsDeleteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupRunsDeleteRequest"); + } + + // Use SqlBackupRunsDeleteRequest.newBuilder() to construct. + private SqlBackupRunsDeleteRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlBackupRunsDeleteRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest.class, + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_ = 0L; + + /** + * + * + *
+   * The ID of the backup run to delete. To find a backup run ID, use the
+   * [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/backupRuns/list)
+   * method.
+   * 
+ * + * int64 id = 1; + * + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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 (id_ != 0L) { + output.writeInt64(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest other = + (com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest) obj; + + if (getId() != other.getId()) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getId()); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest) + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest.class, + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = 0L; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsDeleteRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest build() { + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest result = + new com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest.getDefaultInstance()) + return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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 8: + { + id_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + project_ = 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 long id_; + + /** + * + * + *
+     * The ID of the backup run to delete. To find a backup run ID, use the
+     * [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/backupRuns/list)
+     * method.
+     * 
+ * + * int64 id = 1; + * + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + /** + * + * + *
+     * The ID of the backup run to delete. To find a backup run ID, use the
+     * [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/backupRuns/list)
+     * method.
+     * 
+ * + * int64 id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The ID of the backup run to delete. To find a backup run ID, use the
+     * [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/backupRuns/list)
+     * method.
+     * 
+ * + * int64 id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest) + private static final com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlBackupRunsDeleteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsDeleteRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsDeleteRequestOrBuilder.java new file mode 100644 index 000000000000..4d09690ee52a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsDeleteRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlBackupRunsDeleteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The ID of the backup run to delete. To find a backup run ID, use the
+   * [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/backupRuns/list)
+   * method.
+   * 
+ * + * int64 id = 1; + * + * @return The id. + */ + long getId(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsGetRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsGetRequest.java new file mode 100644 index 000000000000..136e3a78e96d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsGetRequest.java @@ -0,0 +1,866 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlBackupRunsGetRequest} */ +@com.google.protobuf.Generated +public final class SqlBackupRunsGetRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlBackupRunsGetRequest) + SqlBackupRunsGetRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupRunsGetRequest"); + } + + // Use SqlBackupRunsGetRequest.newBuilder() to construct. + private SqlBackupRunsGetRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlBackupRunsGetRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest.class, + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_ = 0L; + + /** + * + * + *
+   * The ID of this backup run.
+   * 
+ * + * int64 id = 1; + * + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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 (id_ != 0L) { + output.writeInt64(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest other = + (com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest) obj; + + if (getId() != other.getId()) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getId()); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlBackupRunsGetRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlBackupRunsGetRequest) + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest.class, + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = 0L; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsGetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest build() { + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest result = + new com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest.getDefaultInstance()) + return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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 8: + { + id_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + project_ = 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 long id_; + + /** + * + * + *
+     * The ID of this backup run.
+     * 
+ * + * int64 id = 1; + * + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + /** + * + * + *
+     * The ID of this backup run.
+     * 
+ * + * int64 id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The ID of this backup run.
+     * 
+ * + * int64 id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlBackupRunsGetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlBackupRunsGetRequest) + private static final com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlBackupRunsGetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsGetRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsGetRequestOrBuilder.java new file mode 100644 index 000000000000..814606ac8320 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsGetRequestOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlBackupRunsGetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlBackupRunsGetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The ID of this backup run.
+   * 
+ * + * int64 id = 1; + * + * @return The id. + */ + long getId(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsInsertRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsInsertRequest.java new file mode 100644 index 000000000000..5360bb4c0ff1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsInsertRequest.java @@ -0,0 +1,965 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest} */ +@com.google.protobuf.Generated +public final class SqlBackupRunsInsertRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest) + SqlBackupRunsInsertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupRunsInsertRequest"); + } + + // Use SqlBackupRunsInsertRequest.newBuilder() to construct. + private SqlBackupRunsInsertRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlBackupRunsInsertRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest.class, + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.BackupRun body_; + + /** + * .google.cloud.sql.v1beta4.BackupRun body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.BackupRun body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRun getBody() { + return body_ == null ? com.google.cloud.sql.v1beta4.BackupRun.getDefaultInstance() : body_; + } + + /** .google.cloud.sql.v1beta4.BackupRun body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupRunOrBuilder getBodyOrBuilder() { + return body_ == null ? com.google.cloud.sql.v1beta4.BackupRun.getDefaultInstance() : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest other = + (com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest) + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest.class, + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsInsertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest build() { + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest result = + new com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.BackupRun body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupRun, + com.google.cloud.sql.v1beta4.BackupRun.Builder, + com.google.cloud.sql.v1beta4.BackupRunOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.BackupRun body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.BackupRun body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.BackupRun getBody() { + if (bodyBuilder_ == null) { + return body_ == null ? com.google.cloud.sql.v1beta4.BackupRun.getDefaultInstance() : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.BackupRun body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.BackupRun value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.BackupRun body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.BackupRun.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.BackupRun body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.BackupRun value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1beta4.BackupRun.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.BackupRun body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.BackupRun body = 100; */ + public com.google.cloud.sql.v1beta4.BackupRun.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.BackupRun body = 100; */ + public com.google.cloud.sql.v1beta4.BackupRunOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null ? com.google.cloud.sql.v1beta4.BackupRun.getDefaultInstance() : body_; + } + } + + /** .google.cloud.sql.v1beta4.BackupRun body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupRun, + com.google.cloud.sql.v1beta4.BackupRun.Builder, + com.google.cloud.sql.v1beta4.BackupRunOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.BackupRun, + com.google.cloud.sql.v1beta4.BackupRun.Builder, + com.google.cloud.sql.v1beta4.BackupRunOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest) + private static final com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlBackupRunsInsertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsInsertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsInsertRequestOrBuilder.java new file mode 100644 index 000000000000..496c38e8b4f2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsInsertRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlBackupRunsInsertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.BackupRun body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.BackupRun body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.BackupRun getBody(); + + /** .google.cloud.sql.v1beta4.BackupRun body = 100; */ + com.google.cloud.sql.v1beta4.BackupRunOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsListRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsListRequest.java new file mode 100644 index 000000000000..130e6d179571 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsListRequest.java @@ -0,0 +1,1070 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlBackupRunsListRequest} */ +@com.google.protobuf.Generated +public final class SqlBackupRunsListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlBackupRunsListRequest) + SqlBackupRunsListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlBackupRunsListRequest"); + } + + // Use SqlBackupRunsListRequest.newBuilder() to construct. + private SqlBackupRunsListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlBackupRunsListRequest() { + instance_ = ""; + pageToken_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest.class, + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID, or "-" for all instances. This does not include
+   * the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID, or "-" for all instances. This does not include
+   * the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_RESULTS_FIELD_NUMBER = 2; + private int maxResults_ = 0; + + /** + * + * + *
+   * Maximum number of backup runs per response.
+   * 
+ * + * int32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (maxResults_ != 0) { + output.writeInt32(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (maxResults_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest other = + (com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (getMaxResults() != other.getMaxResults()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + MAX_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getMaxResults(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlBackupRunsListRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlBackupRunsListRequest) + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest.class, + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + maxResults_ = 0; + pageToken_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlBackupRunsListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest build() { + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest result = + new com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxResults_ = maxResults_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getMaxResults() != 0) { + setMaxResults(other.getMaxResults()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + maxResults_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID, or "-" for all instances. This does not include
+     * the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID, or "-" for all instances. This does not include
+     * the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID, or "-" for all instances. This does not include
+     * the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID, or "-" for all instances. This does not include
+     * the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID, or "-" for all instances. This does not include
+     * the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int maxResults_; + + /** + * + * + *
+     * Maximum number of backup runs per response.
+     * 
+ * + * int32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + /** + * + * + *
+     * Maximum number of backup runs per response.
+     * 
+ * + * int32 max_results = 2; + * + * @param value The maxResults to set. + * @return This builder for chaining. + */ + public Builder setMaxResults(int value) { + + maxResults_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum number of backup runs per response.
+     * 
+ * + * int32 max_results = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxResults() { + bitField0_ = (bitField0_ & ~0x00000002); + maxResults_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlBackupRunsListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlBackupRunsListRequest) + private static final com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlBackupRunsListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsListRequestOrBuilder.java new file mode 100644 index 000000000000..a9d686a3f449 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsListRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlBackupRunsListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlBackupRunsListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID, or "-" for all instances. This does not include
+   * the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID, or "-" for all instances. This does not include
+   * the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Maximum number of backup runs per response.
+   * 
+ * + * int32 max_results = 2; + * + * @return The maxResults. + */ + int getMaxResults(); + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDataDiskType.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDataDiskType.java new file mode 100644 index 000000000000..f860759e62f3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDataDiskType.java @@ -0,0 +1,242 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The type of disk that is used for a v2 instance to use.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.SqlDataDiskType} + */ +@com.google.protobuf.Generated +public enum SqlDataDiskType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown data disk type.
+   * 
+ * + * SQL_DATA_DISK_TYPE_UNSPECIFIED = 0; + */ + SQL_DATA_DISK_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * An SSD data disk.
+   * 
+ * + * PD_SSD = 1; + */ + PD_SSD(1), + /** + * + * + *
+   * An HDD data disk.
+   * 
+ * + * PD_HDD = 2; + */ + PD_HDD(2), + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * OBSOLETE_LOCAL_SSD = 3 [deprecated = true]; + */ + @java.lang.Deprecated + OBSOLETE_LOCAL_SSD(3), + /** + * + * + *
+   * A Hyperdisk Balanced data disk.
+   * 
+ * + * HYPERDISK_BALANCED = 4; + */ + HYPERDISK_BALANCED(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDataDiskType"); + } + + /** + * + * + *
+   * This is an unknown data disk type.
+   * 
+ * + * SQL_DATA_DISK_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_DATA_DISK_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * An SSD data disk.
+   * 
+ * + * PD_SSD = 1; + */ + public static final int PD_SSD_VALUE = 1; + + /** + * + * + *
+   * An HDD data disk.
+   * 
+ * + * PD_HDD = 2; + */ + public static final int PD_HDD_VALUE = 2; + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * OBSOLETE_LOCAL_SSD = 3 [deprecated = true]; + */ + @java.lang.Deprecated public static final int OBSOLETE_LOCAL_SSD_VALUE = 3; + + /** + * + * + *
+   * A Hyperdisk Balanced data disk.
+   * 
+ * + * HYPERDISK_BALANCED = 4; + */ + public static final int HYPERDISK_BALANCED_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 SqlDataDiskType 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 SqlDataDiskType forNumber(int value) { + switch (value) { + case 0: + return SQL_DATA_DISK_TYPE_UNSPECIFIED; + case 1: + return PD_SSD; + case 2: + return PD_HDD; + case 3: + return OBSOLETE_LOCAL_SSD; + case 4: + return HYPERDISK_BALANCED; + 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 SqlDataDiskType findValueByNumber(int number) { + return SqlDataDiskType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(14); + } + + private static final SqlDataDiskType[] VALUES = values(); + + public static SqlDataDiskType 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 SqlDataDiskType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlDataDiskType) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDataFeature.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDataFeature.java new file mode 100644 index 000000000000..10cd97b9f9b2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDataFeature.java @@ -0,0 +1,171 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The session features. The server must send the supported features in its
+ * first message to the client.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.SqlDataFeature} + */ +@com.google.protobuf.Generated +public enum SqlDataFeature implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The feature is not specified. This value should not be used.
+   * 
+ * + * SQL_DATA_FEATURE_UNSPECIFIED = 0; + */ + SQL_DATA_FEATURE_UNSPECIFIED(0), + /** + * + * + *
+   * The server supports reconnecting to the session. If this feature is not
+   * present, the client should not attempt to reconnect to the session.
+   * 
+ * + * SQL_DATA_FEATURE_RECONNECT = 1; + */ + SQL_DATA_FEATURE_RECONNECT(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDataFeature"); + } + + /** + * + * + *
+   * The feature is not specified. This value should not be used.
+   * 
+ * + * SQL_DATA_FEATURE_UNSPECIFIED = 0; + */ + public static final int SQL_DATA_FEATURE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The server supports reconnecting to the session. If this feature is not
+   * present, the client should not attempt to reconnect to the session.
+   * 
+ * + * SQL_DATA_FEATURE_RECONNECT = 1; + */ + public static final int SQL_DATA_FEATURE_RECONNECT_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SqlDataFeature 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 SqlDataFeature forNumber(int value) { + switch (value) { + case 0: + return SQL_DATA_FEATURE_UNSPECIFIED; + case 1: + return SQL_DATA_FEATURE_RECONNECT; + 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 SqlDataFeature findValueByNumber(int number) { + return SqlDataFeature.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlDataFeature[] VALUES = values(); + + public static SqlDataFeature 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 SqlDataFeature(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlDataFeature) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabaseVersion.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabaseVersion.java new file mode 100644 index 000000000000..06e7c9e43456 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabaseVersion.java @@ -0,0 +1,1417 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The database engine type and version.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.SqlDatabaseVersion} + */ +@com.google.protobuf.Generated +public enum SqlDatabaseVersion implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown database version.
+   * 
+ * + * SQL_DATABASE_VERSION_UNSPECIFIED = 0; + */ + SQL_DATABASE_VERSION_UNSPECIFIED(0), + /** + * + * + *
+   * The database version is MySQL 5.1.
+   * 
+ * + * MYSQL_5_1 = 2 [deprecated = true]; + */ + @java.lang.Deprecated + MYSQL_5_1(2), + /** + * + * + *
+   * The database version is MySQL 5.5.
+   * 
+ * + * MYSQL_5_5 = 3 [deprecated = true]; + */ + @java.lang.Deprecated + MYSQL_5_5(3), + /** + * + * + *
+   * The database version is MySQL 5.6.
+   * 
+ * + * MYSQL_5_6 = 5; + */ + MYSQL_5_6(5), + /** + * + * + *
+   * The database version is MySQL 5.7.
+   * 
+ * + * MYSQL_5_7 = 6; + */ + MYSQL_5_7(6), + /** + * + * + *
+   * The database version is MySQL 8.
+   * 
+ * + * MYSQL_8_0 = 20; + */ + MYSQL_8_0(20), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 18.
+   * 
+ * + * MYSQL_8_0_18 = 41; + */ + MYSQL_8_0_18(41), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 26.
+   * 
+ * + * MYSQL_8_0_26 = 85; + */ + MYSQL_8_0_26(85), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 27.
+   * 
+ * + * MYSQL_8_0_27 = 111; + */ + MYSQL_8_0_27(111), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 28.
+   * 
+ * + * MYSQL_8_0_28 = 132; + */ + MYSQL_8_0_28(132), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 29.
+   * 
+ * + * MYSQL_8_0_29 = 148 [deprecated = true]; + */ + @java.lang.Deprecated + MYSQL_8_0_29(148), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 30.
+   * 
+ * + * MYSQL_8_0_30 = 174; + */ + MYSQL_8_0_30(174), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 31.
+   * 
+ * + * MYSQL_8_0_31 = 197; + */ + MYSQL_8_0_31(197), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 32.
+   * 
+ * + * MYSQL_8_0_32 = 213; + */ + MYSQL_8_0_32(213), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 33.
+   * 
+ * + * MYSQL_8_0_33 = 238; + */ + MYSQL_8_0_33(238), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 34.
+   * 
+ * + * MYSQL_8_0_34 = 239; + */ + MYSQL_8_0_34(239), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 35.
+   * 
+ * + * MYSQL_8_0_35 = 240; + */ + MYSQL_8_0_35(240), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 36.
+   * 
+ * + * MYSQL_8_0_36 = 241; + */ + MYSQL_8_0_36(241), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 37.
+   * 
+ * + * MYSQL_8_0_37 = 355; + */ + MYSQL_8_0_37(355), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 39.
+   * 
+ * + * MYSQL_8_0_39 = 357; + */ + MYSQL_8_0_39(357), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 40.
+   * 
+ * + * MYSQL_8_0_40 = 358; + */ + MYSQL_8_0_40(358), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 41.
+   * 
+ * + * MYSQL_8_0_41 = 488; + */ + MYSQL_8_0_41(488), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 42.
+   * 
+ * + * MYSQL_8_0_42 = 489; + */ + MYSQL_8_0_42(489), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 43.
+   * 
+ * + * MYSQL_8_0_43 = 553; + */ + MYSQL_8_0_43(553), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 44.
+   * 
+ * + * MYSQL_8_0_44 = 554; + */ + MYSQL_8_0_44(554), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 45.
+   * 
+ * + * MYSQL_8_0_45 = 555; + */ + MYSQL_8_0_45(555), + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 46.
+   * 
+ * + * MYSQL_8_0_46 = 556; + */ + MYSQL_8_0_46(556), + /** + * + * + *
+   * The database version is MySQL 8.4.
+   * 
+ * + * MYSQL_8_4 = 398; + */ + MYSQL_8_4(398), + /** + * + * + *
+   * The database version is MySQL 9.7.
+   * 
+ * + * MYSQL_9_7 = 654; + */ + MYSQL_9_7(654), + /** + * + * + *
+   * The database version is SQL Server 2017 Standard.
+   * 
+ * + * SQLSERVER_2017_STANDARD = 11; + */ + SQLSERVER_2017_STANDARD(11), + /** + * + * + *
+   * The database version is SQL Server 2017 Enterprise.
+   * 
+ * + * SQLSERVER_2017_ENTERPRISE = 14; + */ + SQLSERVER_2017_ENTERPRISE(14), + /** + * + * + *
+   * The database version is SQL Server 2017 Express.
+   * 
+ * + * SQLSERVER_2017_EXPRESS = 15; + */ + SQLSERVER_2017_EXPRESS(15), + /** + * + * + *
+   * The database version is SQL Server 2017 Web.
+   * 
+ * + * SQLSERVER_2017_WEB = 16; + */ + SQLSERVER_2017_WEB(16), + /** + * + * + *
+   * The database version is PostgreSQL 9.6.
+   * 
+ * + * POSTGRES_9_6 = 9; + */ + POSTGRES_9_6(9), + /** + * + * + *
+   * The database version is PostgreSQL 10.
+   * 
+ * + * POSTGRES_10 = 18; + */ + POSTGRES_10(18), + /** + * + * + *
+   * The database version is PostgreSQL 11.
+   * 
+ * + * POSTGRES_11 = 10; + */ + POSTGRES_11(10), + /** + * + * + *
+   * The database version is PostgreSQL 12.
+   * 
+ * + * POSTGRES_12 = 19; + */ + POSTGRES_12(19), + /** + * + * + *
+   * The database version is PostgreSQL 13.
+   * 
+ * + * POSTGRES_13 = 23; + */ + POSTGRES_13(23), + /** + * + * + *
+   * The database version is PostgreSQL 14.
+   * 
+ * + * POSTGRES_14 = 110; + */ + POSTGRES_14(110), + /** + * + * + *
+   * The database version is PostgreSQL 15.
+   * 
+ * + * POSTGRES_15 = 172; + */ + POSTGRES_15(172), + /** + * + * + *
+   * The database version is PostgreSQL 16.
+   * 
+ * + * POSTGRES_16 = 272; + */ + POSTGRES_16(272), + /** + * + * + *
+   * The database version is PostgreSQL 17.
+   * 
+ * + * POSTGRES_17 = 408; + */ + POSTGRES_17(408), + /** + * + * + *
+   * The database version is PostgreSQL 18.
+   * 
+ * + * POSTGRES_18 = 557; + */ + POSTGRES_18(557), + /** + * + * + *
+   * The database version is PostgreSQL 19.
+   * 
+ * + * POSTGRES_19 = 684; + */ + POSTGRES_19(684), + /** + * + * + *
+   * The database version is PostgreSQL 20.
+   * 
+ * + * POSTGRES_20 = 781; + */ + POSTGRES_20(781), + /** + * + * + *
+   * The database version is SQL Server 2019 Standard.
+   * 
+ * + * SQLSERVER_2019_STANDARD = 26; + */ + SQLSERVER_2019_STANDARD(26), + /** + * + * + *
+   * The database version is SQL Server 2019 Enterprise.
+   * 
+ * + * SQLSERVER_2019_ENTERPRISE = 27; + */ + SQLSERVER_2019_ENTERPRISE(27), + /** + * + * + *
+   * The database version is SQL Server 2019 Express.
+   * 
+ * + * SQLSERVER_2019_EXPRESS = 28; + */ + SQLSERVER_2019_EXPRESS(28), + /** + * + * + *
+   * The database version is SQL Server 2019 Web.
+   * 
+ * + * SQLSERVER_2019_WEB = 29; + */ + SQLSERVER_2019_WEB(29), + /** + * + * + *
+   * The database version is SQL Server 2022 Standard.
+   * 
+ * + * SQLSERVER_2022_STANDARD = 199; + */ + SQLSERVER_2022_STANDARD(199), + /** + * + * + *
+   * The database version is SQL Server 2022 Enterprise.
+   * 
+ * + * SQLSERVER_2022_ENTERPRISE = 200; + */ + SQLSERVER_2022_ENTERPRISE(200), + /** + * + * + *
+   * The database version is SQL Server 2022 Express.
+   * 
+ * + * SQLSERVER_2022_EXPRESS = 201; + */ + SQLSERVER_2022_EXPRESS(201), + /** + * + * + *
+   * The database version is SQL Server 2022 Web.
+   * 
+ * + * SQLSERVER_2022_WEB = 202; + */ + SQLSERVER_2022_WEB(202), + /** + * + * + *
+   * The database version is SQL Server 2025 Standard.
+   * 
+ * + * SQLSERVER_2025_STANDARD = 549; + */ + SQLSERVER_2025_STANDARD(549), + /** + * + * + *
+   * The database version is SQL Server 2025 Enterprise.
+   * 
+ * + * SQLSERVER_2025_ENTERPRISE = 550; + */ + SQLSERVER_2025_ENTERPRISE(550), + /** + * + * + *
+   * The database version is SQL Server 2025 Express.
+   * 
+ * + * SQLSERVER_2025_EXPRESS = 551; + */ + SQLSERVER_2025_EXPRESS(551), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDatabaseVersion"); + } + + /** + * + * + *
+   * This is an unknown database version.
+   * 
+ * + * SQL_DATABASE_VERSION_UNSPECIFIED = 0; + */ + public static final int SQL_DATABASE_VERSION_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The database version is MySQL 5.1.
+   * 
+ * + * MYSQL_5_1 = 2 [deprecated = true]; + */ + @java.lang.Deprecated public static final int MYSQL_5_1_VALUE = 2; + + /** + * + * + *
+   * The database version is MySQL 5.5.
+   * 
+ * + * MYSQL_5_5 = 3 [deprecated = true]; + */ + @java.lang.Deprecated public static final int MYSQL_5_5_VALUE = 3; + + /** + * + * + *
+   * The database version is MySQL 5.6.
+   * 
+ * + * MYSQL_5_6 = 5; + */ + public static final int MYSQL_5_6_VALUE = 5; + + /** + * + * + *
+   * The database version is MySQL 5.7.
+   * 
+ * + * MYSQL_5_7 = 6; + */ + public static final int MYSQL_5_7_VALUE = 6; + + /** + * + * + *
+   * The database version is MySQL 8.
+   * 
+ * + * MYSQL_8_0 = 20; + */ + public static final int MYSQL_8_0_VALUE = 20; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 18.
+   * 
+ * + * MYSQL_8_0_18 = 41; + */ + public static final int MYSQL_8_0_18_VALUE = 41; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 26.
+   * 
+ * + * MYSQL_8_0_26 = 85; + */ + public static final int MYSQL_8_0_26_VALUE = 85; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 27.
+   * 
+ * + * MYSQL_8_0_27 = 111; + */ + public static final int MYSQL_8_0_27_VALUE = 111; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 28.
+   * 
+ * + * MYSQL_8_0_28 = 132; + */ + public static final int MYSQL_8_0_28_VALUE = 132; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 29.
+   * 
+ * + * MYSQL_8_0_29 = 148 [deprecated = true]; + */ + @java.lang.Deprecated public static final int MYSQL_8_0_29_VALUE = 148; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 30.
+   * 
+ * + * MYSQL_8_0_30 = 174; + */ + public static final int MYSQL_8_0_30_VALUE = 174; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 31.
+   * 
+ * + * MYSQL_8_0_31 = 197; + */ + public static final int MYSQL_8_0_31_VALUE = 197; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 32.
+   * 
+ * + * MYSQL_8_0_32 = 213; + */ + public static final int MYSQL_8_0_32_VALUE = 213; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 33.
+   * 
+ * + * MYSQL_8_0_33 = 238; + */ + public static final int MYSQL_8_0_33_VALUE = 238; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 34.
+   * 
+ * + * MYSQL_8_0_34 = 239; + */ + public static final int MYSQL_8_0_34_VALUE = 239; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 35.
+   * 
+ * + * MYSQL_8_0_35 = 240; + */ + public static final int MYSQL_8_0_35_VALUE = 240; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 36.
+   * 
+ * + * MYSQL_8_0_36 = 241; + */ + public static final int MYSQL_8_0_36_VALUE = 241; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 37.
+   * 
+ * + * MYSQL_8_0_37 = 355; + */ + public static final int MYSQL_8_0_37_VALUE = 355; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 39.
+   * 
+ * + * MYSQL_8_0_39 = 357; + */ + public static final int MYSQL_8_0_39_VALUE = 357; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 40.
+   * 
+ * + * MYSQL_8_0_40 = 358; + */ + public static final int MYSQL_8_0_40_VALUE = 358; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 41.
+   * 
+ * + * MYSQL_8_0_41 = 488; + */ + public static final int MYSQL_8_0_41_VALUE = 488; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 42.
+   * 
+ * + * MYSQL_8_0_42 = 489; + */ + public static final int MYSQL_8_0_42_VALUE = 489; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 43.
+   * 
+ * + * MYSQL_8_0_43 = 553; + */ + public static final int MYSQL_8_0_43_VALUE = 553; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 44.
+   * 
+ * + * MYSQL_8_0_44 = 554; + */ + public static final int MYSQL_8_0_44_VALUE = 554; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 45.
+   * 
+ * + * MYSQL_8_0_45 = 555; + */ + public static final int MYSQL_8_0_45_VALUE = 555; + + /** + * + * + *
+   * The database major version is MySQL 8.0 and the minor version is 46.
+   * 
+ * + * MYSQL_8_0_46 = 556; + */ + public static final int MYSQL_8_0_46_VALUE = 556; + + /** + * + * + *
+   * The database version is MySQL 8.4.
+   * 
+ * + * MYSQL_8_4 = 398; + */ + public static final int MYSQL_8_4_VALUE = 398; + + /** + * + * + *
+   * The database version is MySQL 9.7.
+   * 
+ * + * MYSQL_9_7 = 654; + */ + public static final int MYSQL_9_7_VALUE = 654; + + /** + * + * + *
+   * The database version is SQL Server 2017 Standard.
+   * 
+ * + * SQLSERVER_2017_STANDARD = 11; + */ + public static final int SQLSERVER_2017_STANDARD_VALUE = 11; + + /** + * + * + *
+   * The database version is SQL Server 2017 Enterprise.
+   * 
+ * + * SQLSERVER_2017_ENTERPRISE = 14; + */ + public static final int SQLSERVER_2017_ENTERPRISE_VALUE = 14; + + /** + * + * + *
+   * The database version is SQL Server 2017 Express.
+   * 
+ * + * SQLSERVER_2017_EXPRESS = 15; + */ + public static final int SQLSERVER_2017_EXPRESS_VALUE = 15; + + /** + * + * + *
+   * The database version is SQL Server 2017 Web.
+   * 
+ * + * SQLSERVER_2017_WEB = 16; + */ + public static final int SQLSERVER_2017_WEB_VALUE = 16; + + /** + * + * + *
+   * The database version is PostgreSQL 9.6.
+   * 
+ * + * POSTGRES_9_6 = 9; + */ + public static final int POSTGRES_9_6_VALUE = 9; + + /** + * + * + *
+   * The database version is PostgreSQL 10.
+   * 
+ * + * POSTGRES_10 = 18; + */ + public static final int POSTGRES_10_VALUE = 18; + + /** + * + * + *
+   * The database version is PostgreSQL 11.
+   * 
+ * + * POSTGRES_11 = 10; + */ + public static final int POSTGRES_11_VALUE = 10; + + /** + * + * + *
+   * The database version is PostgreSQL 12.
+   * 
+ * + * POSTGRES_12 = 19; + */ + public static final int POSTGRES_12_VALUE = 19; + + /** + * + * + *
+   * The database version is PostgreSQL 13.
+   * 
+ * + * POSTGRES_13 = 23; + */ + public static final int POSTGRES_13_VALUE = 23; + + /** + * + * + *
+   * The database version is PostgreSQL 14.
+   * 
+ * + * POSTGRES_14 = 110; + */ + public static final int POSTGRES_14_VALUE = 110; + + /** + * + * + *
+   * The database version is PostgreSQL 15.
+   * 
+ * + * POSTGRES_15 = 172; + */ + public static final int POSTGRES_15_VALUE = 172; + + /** + * + * + *
+   * The database version is PostgreSQL 16.
+   * 
+ * + * POSTGRES_16 = 272; + */ + public static final int POSTGRES_16_VALUE = 272; + + /** + * + * + *
+   * The database version is PostgreSQL 17.
+   * 
+ * + * POSTGRES_17 = 408; + */ + public static final int POSTGRES_17_VALUE = 408; + + /** + * + * + *
+   * The database version is PostgreSQL 18.
+   * 
+ * + * POSTGRES_18 = 557; + */ + public static final int POSTGRES_18_VALUE = 557; + + /** + * + * + *
+   * The database version is PostgreSQL 19.
+   * 
+ * + * POSTGRES_19 = 684; + */ + public static final int POSTGRES_19_VALUE = 684; + + /** + * + * + *
+   * The database version is PostgreSQL 20.
+   * 
+ * + * POSTGRES_20 = 781; + */ + public static final int POSTGRES_20_VALUE = 781; + + /** + * + * + *
+   * The database version is SQL Server 2019 Standard.
+   * 
+ * + * SQLSERVER_2019_STANDARD = 26; + */ + public static final int SQLSERVER_2019_STANDARD_VALUE = 26; + + /** + * + * + *
+   * The database version is SQL Server 2019 Enterprise.
+   * 
+ * + * SQLSERVER_2019_ENTERPRISE = 27; + */ + public static final int SQLSERVER_2019_ENTERPRISE_VALUE = 27; + + /** + * + * + *
+   * The database version is SQL Server 2019 Express.
+   * 
+ * + * SQLSERVER_2019_EXPRESS = 28; + */ + public static final int SQLSERVER_2019_EXPRESS_VALUE = 28; + + /** + * + * + *
+   * The database version is SQL Server 2019 Web.
+   * 
+ * + * SQLSERVER_2019_WEB = 29; + */ + public static final int SQLSERVER_2019_WEB_VALUE = 29; + + /** + * + * + *
+   * The database version is SQL Server 2022 Standard.
+   * 
+ * + * SQLSERVER_2022_STANDARD = 199; + */ + public static final int SQLSERVER_2022_STANDARD_VALUE = 199; + + /** + * + * + *
+   * The database version is SQL Server 2022 Enterprise.
+   * 
+ * + * SQLSERVER_2022_ENTERPRISE = 200; + */ + public static final int SQLSERVER_2022_ENTERPRISE_VALUE = 200; + + /** + * + * + *
+   * The database version is SQL Server 2022 Express.
+   * 
+ * + * SQLSERVER_2022_EXPRESS = 201; + */ + public static final int SQLSERVER_2022_EXPRESS_VALUE = 201; + + /** + * + * + *
+   * The database version is SQL Server 2022 Web.
+   * 
+ * + * SQLSERVER_2022_WEB = 202; + */ + public static final int SQLSERVER_2022_WEB_VALUE = 202; + + /** + * + * + *
+   * The database version is SQL Server 2025 Standard.
+   * 
+ * + * SQLSERVER_2025_STANDARD = 549; + */ + public static final int SQLSERVER_2025_STANDARD_VALUE = 549; + + /** + * + * + *
+   * The database version is SQL Server 2025 Enterprise.
+   * 
+ * + * SQLSERVER_2025_ENTERPRISE = 550; + */ + public static final int SQLSERVER_2025_ENTERPRISE_VALUE = 550; + + /** + * + * + *
+   * The database version is SQL Server 2025 Express.
+   * 
+ * + * SQLSERVER_2025_EXPRESS = 551; + */ + public static final int SQLSERVER_2025_EXPRESS_VALUE = 551; + + 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 SqlDatabaseVersion 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 SqlDatabaseVersion forNumber(int value) { + switch (value) { + case 0: + return SQL_DATABASE_VERSION_UNSPECIFIED; + case 2: + return MYSQL_5_1; + case 3: + return MYSQL_5_5; + case 5: + return MYSQL_5_6; + case 6: + return MYSQL_5_7; + case 20: + return MYSQL_8_0; + case 41: + return MYSQL_8_0_18; + case 85: + return MYSQL_8_0_26; + case 111: + return MYSQL_8_0_27; + case 132: + return MYSQL_8_0_28; + case 148: + return MYSQL_8_0_29; + case 174: + return MYSQL_8_0_30; + case 197: + return MYSQL_8_0_31; + case 213: + return MYSQL_8_0_32; + case 238: + return MYSQL_8_0_33; + case 239: + return MYSQL_8_0_34; + case 240: + return MYSQL_8_0_35; + case 241: + return MYSQL_8_0_36; + case 355: + return MYSQL_8_0_37; + case 357: + return MYSQL_8_0_39; + case 358: + return MYSQL_8_0_40; + case 488: + return MYSQL_8_0_41; + case 489: + return MYSQL_8_0_42; + case 553: + return MYSQL_8_0_43; + case 554: + return MYSQL_8_0_44; + case 555: + return MYSQL_8_0_45; + case 556: + return MYSQL_8_0_46; + case 398: + return MYSQL_8_4; + case 654: + return MYSQL_9_7; + case 11: + return SQLSERVER_2017_STANDARD; + case 14: + return SQLSERVER_2017_ENTERPRISE; + case 15: + return SQLSERVER_2017_EXPRESS; + case 16: + return SQLSERVER_2017_WEB; + case 9: + return POSTGRES_9_6; + case 18: + return POSTGRES_10; + case 10: + return POSTGRES_11; + case 19: + return POSTGRES_12; + case 23: + return POSTGRES_13; + case 110: + return POSTGRES_14; + case 172: + return POSTGRES_15; + case 272: + return POSTGRES_16; + case 408: + return POSTGRES_17; + case 557: + return POSTGRES_18; + case 684: + return POSTGRES_19; + case 781: + return POSTGRES_20; + case 26: + return SQLSERVER_2019_STANDARD; + case 27: + return SQLSERVER_2019_ENTERPRISE; + case 28: + return SQLSERVER_2019_EXPRESS; + case 29: + return SQLSERVER_2019_WEB; + case 199: + return SQLSERVER_2022_STANDARD; + case 200: + return SQLSERVER_2022_ENTERPRISE; + case 201: + return SQLSERVER_2022_EXPRESS; + case 202: + return SQLSERVER_2022_WEB; + case 549: + return SQLSERVER_2025_STANDARD; + case 550: + return SQLSERVER_2025_ENTERPRISE; + case 551: + return SQLSERVER_2025_EXPRESS; + 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 SqlDatabaseVersion findValueByNumber(int number) { + return SqlDatabaseVersion.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(10); + } + + private static final SqlDatabaseVersion[] VALUES = values(); + + public static SqlDatabaseVersion 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 SqlDatabaseVersion(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlDatabaseVersion) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesDeleteRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesDeleteRequest.java new file mode 100644 index 000000000000..2449919b4d26 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesDeleteRequest.java @@ -0,0 +1,959 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest} */ +@com.google.protobuf.Generated +public final class SqlDatabasesDeleteRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest) + SqlDatabasesDeleteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDatabasesDeleteRequest"); + } + + // Use SqlDatabasesDeleteRequest.newBuilder() to construct. + private SqlDatabasesDeleteRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlDatabasesDeleteRequest() { + database_ = ""; + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest.class, + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest.Builder.class); + } + + public static final int DATABASE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * Name of the database to be deleted in the instance.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the database to be deleted in the instance.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest other = + (com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest) obj; + + if (!getDatabase().equals(other.getDatabase())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest) + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest.class, + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + database_ = ""; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesDeleteRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest build() { + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest result = + new com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.database_ = database_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest.getDefaultInstance()) + return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + database_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object database_ = ""; + + /** + * + * + *
+     * Name of the database to be deleted in the instance.
+     * 
+ * + * string database = 1; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the database to be deleted in the instance.
+     * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the database to be deleted in the instance.
+     * 
+ * + * string database = 1; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database to be deleted in the instance.
+     * 
+ * + * string database = 1; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database to be deleted in the instance.
+     * 
+ * + * string database = 1; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest) + private static final com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlDatabasesDeleteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesDeleteRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesDeleteRequestOrBuilder.java new file mode 100644 index 000000000000..9592b8b829d4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesDeleteRequestOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlDatabasesDeleteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the database to be deleted in the instance.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * Name of the database to be deleted in the instance.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesGetRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesGetRequest.java new file mode 100644 index 000000000000..243db46858eb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesGetRequest.java @@ -0,0 +1,958 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlDatabasesGetRequest} */ +@com.google.protobuf.Generated +public final class SqlDatabasesGetRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlDatabasesGetRequest) + SqlDatabasesGetRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDatabasesGetRequest"); + } + + // Use SqlDatabasesGetRequest.newBuilder() to construct. + private SqlDatabasesGetRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlDatabasesGetRequest() { + database_ = ""; + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest.class, + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest.Builder.class); + } + + public static final int DATABASE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * Name of the database in the instance.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the database in the instance.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest other = + (com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest) obj; + + if (!getDatabase().equals(other.getDatabase())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlDatabasesGetRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlDatabasesGetRequest) + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest.class, + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + database_ = ""; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesGetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest build() { + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest result = + new com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.database_ = database_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest.getDefaultInstance()) + return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + database_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object database_ = ""; + + /** + * + * + *
+     * Name of the database in the instance.
+     * 
+ * + * string database = 1; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the database in the instance.
+     * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the database in the instance.
+     * 
+ * + * string database = 1; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database in the instance.
+     * 
+ * + * string database = 1; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database in the instance.
+     * 
+ * + * string database = 1; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlDatabasesGetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlDatabasesGetRequest) + private static final com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlDatabasesGetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesGetRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesGetRequestOrBuilder.java new file mode 100644 index 000000000000..27b9042bcc4b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesGetRequestOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlDatabasesGetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlDatabasesGetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the database in the instance.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * Name of the database in the instance.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesInsertRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesInsertRequest.java new file mode 100644 index 000000000000..ef0fda2ed939 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesInsertRequest.java @@ -0,0 +1,965 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlDatabasesInsertRequest} */ +@com.google.protobuf.Generated +public final class SqlDatabasesInsertRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlDatabasesInsertRequest) + SqlDatabasesInsertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDatabasesInsertRequest"); + } + + // Use SqlDatabasesInsertRequest.newBuilder() to construct. + private SqlDatabasesInsertRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlDatabasesInsertRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest.class, + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.Database body_; + + /** + * .google.cloud.sql.v1beta4.Database body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.Database body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Database getBody() { + return body_ == null ? com.google.cloud.sql.v1beta4.Database.getDefaultInstance() : body_; + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseOrBuilder getBodyOrBuilder() { + return body_ == null ? com.google.cloud.sql.v1beta4.Database.getDefaultInstance() : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest other = + (com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlDatabasesInsertRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlDatabasesInsertRequest) + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest.class, + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesInsertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest build() { + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest result = + new com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.Database body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Database, + com.google.cloud.sql.v1beta4.Database.Builder, + com.google.cloud.sql.v1beta4.DatabaseOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.Database body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.Database body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.Database getBody() { + if (bodyBuilder_ == null) { + return body_ == null ? com.google.cloud.sql.v1beta4.Database.getDefaultInstance() : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.Database value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.Database.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.Database value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1beta4.Database.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + public com.google.cloud.sql.v1beta4.Database.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + public com.google.cloud.sql.v1beta4.DatabaseOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null ? com.google.cloud.sql.v1beta4.Database.getDefaultInstance() : body_; + } + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Database, + com.google.cloud.sql.v1beta4.Database.Builder, + com.google.cloud.sql.v1beta4.DatabaseOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Database, + com.google.cloud.sql.v1beta4.Database.Builder, + com.google.cloud.sql.v1beta4.DatabaseOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlDatabasesInsertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlDatabasesInsertRequest) + private static final com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlDatabasesInsertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesInsertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesInsertRequestOrBuilder.java new file mode 100644 index 000000000000..9f58e1343dca --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesInsertRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlDatabasesInsertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlDatabasesInsertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.Database body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.Database body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.Database getBody(); + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + com.google.cloud.sql.v1beta4.DatabaseOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesListRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesListRequest.java new file mode 100644 index 000000000000..22ea667a42bf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesListRequest.java @@ -0,0 +1,769 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlDatabasesListRequest} */ +@com.google.protobuf.Generated +public final class SqlDatabasesListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlDatabasesListRequest) + SqlDatabasesListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDatabasesListRequest"); + } + + // Use SqlDatabasesListRequest.newBuilder() to construct. + private SqlDatabasesListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlDatabasesListRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest.class, + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlDatabasesListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest other = + (com.google.cloud.sql.v1beta4.SqlDatabasesListRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesListRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesListRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlDatabasesListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlDatabasesListRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlDatabasesListRequest) + com.google.cloud.sql.v1beta4.SqlDatabasesListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest.class, + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlDatabasesListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlDatabasesListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesListRequest build() { + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesListRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlDatabasesListRequest result = + new com.google.cloud.sql.v1beta4.SqlDatabasesListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlDatabasesListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlDatabasesListRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlDatabasesListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlDatabasesListRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlDatabasesListRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlDatabasesListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlDatabasesListRequest) + private static final com.google.cloud.sql.v1beta4.SqlDatabasesListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlDatabasesListRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlDatabasesListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesListRequestOrBuilder.java new file mode 100644 index 000000000000..4fda9c19ea67 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesListRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlDatabasesListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlDatabasesListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesUpdateRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesUpdateRequest.java new file mode 100644 index 000000000000..e0f93663895e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesUpdateRequest.java @@ -0,0 +1,1154 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest} */ +@com.google.protobuf.Generated +public final class SqlDatabasesUpdateRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest) + SqlDatabasesUpdateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlDatabasesUpdateRequest"); + } + + // Use SqlDatabasesUpdateRequest.newBuilder() to construct. + private SqlDatabasesUpdateRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlDatabasesUpdateRequest() { + database_ = ""; + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesUpdateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesUpdateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest.class, + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest.Builder.class); + } + + private int bitField0_; + public static final int DATABASE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * Name of the database to be updated in the instance.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the database to be updated in the instance.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.Database body_; + + /** + * .google.cloud.sql.v1beta4.Database body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.Database body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Database getBody() { + return body_ == null ? com.google.cloud.sql.v1beta4.Database.getDefaultInstance() : body_; + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseOrBuilder getBodyOrBuilder() { + return body_ == null ? com.google.cloud.sql.v1beta4.Database.getDefaultInstance() : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, database_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest other = + (com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest) obj; + + if (!getDatabase().equals(other.getDatabase())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest) + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesUpdateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesUpdateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest.class, + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + database_ = ""; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlDatabasesUpdateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest build() { + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest result = + new com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.database_ = database_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest.getDefaultInstance()) + return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + database_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 database_ = ""; + + /** + * + * + *
+     * Name of the database to be updated in the instance.
+     * 
+ * + * string database = 1; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the database to be updated in the instance.
+     * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the database to be updated in the instance.
+     * 
+ * + * string database = 1; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database to be updated in the instance.
+     * 
+ * + * string database = 1; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database to be updated in the instance.
+     * 
+ * + * string database = 1; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + database_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.Database body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Database, + com.google.cloud.sql.v1beta4.Database.Builder, + com.google.cloud.sql.v1beta4.DatabaseOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.Database body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * .google.cloud.sql.v1beta4.Database body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.Database getBody() { + if (bodyBuilder_ == null) { + return body_ == null ? com.google.cloud.sql.v1beta4.Database.getDefaultInstance() : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.Database value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.Database.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.Database value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1beta4.Database.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000008); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + public com.google.cloud.sql.v1beta4.Database.Builder getBodyBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + public com.google.cloud.sql.v1beta4.DatabaseOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null ? com.google.cloud.sql.v1beta4.Database.getDefaultInstance() : body_; + } + } + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Database, + com.google.cloud.sql.v1beta4.Database.Builder, + com.google.cloud.sql.v1beta4.DatabaseOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Database, + com.google.cloud.sql.v1beta4.Database.Builder, + com.google.cloud.sql.v1beta4.DatabaseOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest) + private static final com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlDatabasesUpdateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesUpdateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesUpdateRequestOrBuilder.java new file mode 100644 index 000000000000..b357b219b9a2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlDatabasesUpdateRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlDatabasesUpdateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the database to be updated in the instance.
+   * 
+ * + * string database = 1; + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * Name of the database to be updated in the instance.
+   * 
+ * + * string database = 1; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.Database body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.Database body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.Database getBody(); + + /** .google.cloud.sql.v1beta4.Database body = 100; */ + com.google.cloud.sql.v1beta4.DatabaseOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlExternalSyncSettingError.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlExternalSyncSettingError.java new file mode 100644 index 000000000000..72eae417baaa --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlExternalSyncSettingError.java @@ -0,0 +1,2431 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * External primary instance migration setting error/warning.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlExternalSyncSettingError} + */ +@com.google.protobuf.Generated +public final class SqlExternalSyncSettingError extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlExternalSyncSettingError) + SqlExternalSyncSettingErrorOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlExternalSyncSettingError"); + } + + // Use SqlExternalSyncSettingError.newBuilder() to construct. + private SqlExternalSyncSettingError(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlExternalSyncSettingError() { + kind_ = ""; + type_ = 0; + detail_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlExternalSyncSettingError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlExternalSyncSettingError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.class, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder.class); + } + + /** + * Protobuf enum {@code + * google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType} + */ + public enum SqlExternalSyncSettingErrorType implements com.google.protobuf.ProtocolMessageEnum { + /** SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED = 0; */ + SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED(0), + /** CONNECTION_FAILURE = 1; */ + CONNECTION_FAILURE(1), + /** BINLOG_NOT_ENABLED = 2; */ + BINLOG_NOT_ENABLED(2), + /** INCOMPATIBLE_DATABASE_VERSION = 3; */ + INCOMPATIBLE_DATABASE_VERSION(3), + /** REPLICA_ALREADY_SETUP = 4; */ + REPLICA_ALREADY_SETUP(4), + /** + * + * + *
+     * The replication user is missing privileges that are required.
+     * 
+ * + * INSUFFICIENT_PRIVILEGE = 5; + */ + INSUFFICIENT_PRIVILEGE(5), + /** + * + * + *
+     * Unsupported migration type.
+     * 
+ * + * UNSUPPORTED_MIGRATION_TYPE = 6; + */ + UNSUPPORTED_MIGRATION_TYPE(6), + /** + * + * + *
+     * No pglogical extension installed on databases, applicable for postgres.
+     * 
+ * + * NO_PGLOGICAL_INSTALLED = 7; + */ + NO_PGLOGICAL_INSTALLED(7), + /** + * + * + *
+     * pglogical node already exists on databases, applicable for postgres.
+     * 
+ * + * PGLOGICAL_NODE_ALREADY_EXISTS = 8; + */ + PGLOGICAL_NODE_ALREADY_EXISTS(8), + /** + * + * + *
+     * The value of parameter wal_level is not set to logical.
+     * 
+ * + * INVALID_WAL_LEVEL = 9; + */ + INVALID_WAL_LEVEL(9), + /** + * + * + *
+     * The value of parameter shared_preload_libraries does not include
+     * pglogical.
+     * 
+ * + * INVALID_SHARED_PRELOAD_LIBRARY = 10; + */ + INVALID_SHARED_PRELOAD_LIBRARY(10), + /** + * + * + *
+     * The value of parameter max_replication_slots is not sufficient.
+     * 
+ * + * INSUFFICIENT_MAX_REPLICATION_SLOTS = 11; + */ + INSUFFICIENT_MAX_REPLICATION_SLOTS(11), + /** + * + * + *
+     * The value of parameter max_wal_senders is not sufficient.
+     * 
+ * + * INSUFFICIENT_MAX_WAL_SENDERS = 12; + */ + INSUFFICIENT_MAX_WAL_SENDERS(12), + /** + * + * + *
+     * The value of parameter max_worker_processes is not sufficient.
+     * 
+ * + * INSUFFICIENT_MAX_WORKER_PROCESSES = 13; + */ + INSUFFICIENT_MAX_WORKER_PROCESSES(13), + /** + * + * + *
+     * Extensions installed are either not supported or having unsupported
+     * versions
+     * 
+ * + * UNSUPPORTED_EXTENSIONS = 14; + */ + UNSUPPORTED_EXTENSIONS(14), + /** + * + * + *
+     * The value of parameter rds.logical_replication is not set to 1.
+     * 
+ * + * INVALID_RDS_LOGICAL_REPLICATION = 15; + */ + INVALID_RDS_LOGICAL_REPLICATION(15), + /** + * + * + *
+     * The primary instance logging setup doesn't allow EM sync.
+     * 
+ * + * INVALID_LOGGING_SETUP = 16; + */ + INVALID_LOGGING_SETUP(16), + /** + * + * + *
+     * The primary instance database parameter setup doesn't allow EM sync.
+     * 
+ * + * INVALID_DB_PARAM = 17; + */ + INVALID_DB_PARAM(17), + /** + * + * + *
+     * The gtid_mode is not supported, applicable for MySQL.
+     * 
+ * + * UNSUPPORTED_GTID_MODE = 18; + */ + UNSUPPORTED_GTID_MODE(18), + /** + * + * + *
+     * SQL Server Agent is not running.
+     * 
+ * + * SQLSERVER_AGENT_NOT_RUNNING = 19; + */ + SQLSERVER_AGENT_NOT_RUNNING(19), + /** + * + * + *
+     * The table definition is not support due to missing primary key or replica
+     * identity, applicable for postgres. Note that this is a warning and won't
+     * block the migration.
+     * 
+ * + * UNSUPPORTED_TABLE_DEFINITION = 20; + */ + UNSUPPORTED_TABLE_DEFINITION(20), + /** + * + * + *
+     * The customer has a definer that will break EM setup.
+     * 
+ * + * UNSUPPORTED_DEFINER = 21; + */ + UNSUPPORTED_DEFINER(21), + /** + * + * + *
+     * SQL Server @@SERVERNAME does not match actual host name.
+     * 
+ * + * SQLSERVER_SERVERNAME_MISMATCH = 22; + */ + SQLSERVER_SERVERNAME_MISMATCH(22), + /** + * + * + *
+     * The primary instance has been setup and will fail the setup.
+     * 
+ * + * PRIMARY_ALREADY_SETUP = 23; + */ + PRIMARY_ALREADY_SETUP(23), + /** + * + * + *
+     * The primary instance has unsupported binary log format.
+     * 
+ * + * UNSUPPORTED_BINLOG_FORMAT = 24; + */ + UNSUPPORTED_BINLOG_FORMAT(24), + /** + * + * + *
+     * The primary instance's binary log retention setting.
+     * 
+ * + * BINLOG_RETENTION_SETTING = 25; + */ + BINLOG_RETENTION_SETTING(25), + /** + * + * + *
+     * The primary instance has tables with unsupported storage engine.
+     * 
+ * + * UNSUPPORTED_STORAGE_ENGINE = 26; + */ + UNSUPPORTED_STORAGE_ENGINE(26), + /** + * + * + *
+     * Source has tables with limited support
+     * eg: PostgreSQL tables without primary keys.
+     * 
+ * + * LIMITED_SUPPORT_TABLES = 27; + */ + LIMITED_SUPPORT_TABLES(27), + /** + * + * + *
+     * The replica instance contains existing data.
+     * 
+ * + * EXISTING_DATA_IN_REPLICA = 28; + */ + EXISTING_DATA_IN_REPLICA(28), + /** + * + * + *
+     * The replication user is missing privileges that are optional.
+     * 
+ * + * MISSING_OPTIONAL_PRIVILEGES = 29; + */ + MISSING_OPTIONAL_PRIVILEGES(29), + /** + * + * + *
+     * Additional BACKUP_ADMIN privilege is granted to the replication user
+     * which may lock source MySQL 8 instance for DDLs during initial sync.
+     * 
+ * + * RISKY_BACKUP_ADMIN_PRIVILEGE = 30; + */ + RISKY_BACKUP_ADMIN_PRIVILEGE(30), + /** + * + * + *
+     * The Cloud Storage bucket is missing necessary permissions.
+     * 
+ * + * INSUFFICIENT_GCS_PERMISSIONS = 31; + */ + INSUFFICIENT_GCS_PERMISSIONS(31), + /** + * + * + *
+     * The Cloud Storage bucket has an error in the file or contains invalid
+     * file information.
+     * 
+ * + * INVALID_FILE_INFO = 32; + */ + INVALID_FILE_INFO(32), + /** + * + * + *
+     * The source instance has unsupported database settings for migration.
+     * 
+ * + * UNSUPPORTED_DATABASE_SETTINGS = 33; + */ + UNSUPPORTED_DATABASE_SETTINGS(33), + /** + * + * + *
+     * The replication user is missing parallel import specific privileges.
+     * (e.g. LOCK TABLES) for MySQL.
+     * 
+ * + * MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE = 34; + */ + MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE(34), + /** + * + * + *
+     * The global variable local_infile is off on external server replica.
+     * 
+ * + * LOCAL_INFILE_OFF = 35; + */ + LOCAL_INFILE_OFF(35), + /** + * + * + *
+     * This code instructs customers to turn on point-in-time recovery manually
+     * for the instance after promoting the Cloud SQL for PostgreSQL instance.
+     * 
+ * + * TURN_ON_PITR_AFTER_PROMOTE = 36; + */ + TURN_ON_PITR_AFTER_PROMOTE(36), + /** + * + * + *
+     * The minor version of replica database is incompatible with the source.
+     * 
+ * + * INCOMPATIBLE_DATABASE_MINOR_VERSION = 37; + */ + INCOMPATIBLE_DATABASE_MINOR_VERSION(37), + /** + * + * + *
+     * This warning message indicates that Cloud SQL uses the maximum number of
+     * subscriptions to migrate data from the source to the destination.
+     * 
+ * + * SOURCE_MAX_SUBSCRIPTIONS = 38; + */ + SOURCE_MAX_SUBSCRIPTIONS(38), + /** + * + * + *
+     * Unable to verify definers on the source for MySQL.
+     * 
+ * + * UNABLE_TO_VERIFY_DEFINERS = 39; + */ + UNABLE_TO_VERIFY_DEFINERS(39), + /** + * + * + *
+     * If a time out occurs while the subscription counts are calculated, then
+     * this value is set to 1. Otherwise, this value is set to 2.
+     * 
+ * + * SUBSCRIPTION_CALCULATION_STATUS = 40; + */ + SUBSCRIPTION_CALCULATION_STATUS(40), + /** + * + * + *
+     * Count of subscriptions needed to sync source data for PostgreSQL
+     * database.
+     * 
+ * + * PG_SUBSCRIPTION_COUNT = 41; + */ + PG_SUBSCRIPTION_COUNT(41), + /** + * + * + *
+     * Final parallel level that is used to do migration.
+     * 
+ * + * PG_SYNC_PARALLEL_LEVEL = 42; + */ + PG_SYNC_PARALLEL_LEVEL(42), + /** + * + * + *
+     * The disk size of the replica instance is smaller than the data size of
+     * the source instance.
+     * 
+ * + * INSUFFICIENT_DISK_SIZE = 43; + */ + INSUFFICIENT_DISK_SIZE(43), + /** + * + * + *
+     * The data size of the source instance is greater than 1 TB, the number of
+     * cores of the replica instance is less than 8, and the memory of the
+     * replica is less than 32 GB.
+     * 
+ * + * INSUFFICIENT_MACHINE_TIER = 44; + */ + INSUFFICIENT_MACHINE_TIER(44), + /** + * + * + *
+     * The warning message indicates the unsupported extensions will not be
+     * migrated to the destination.
+     * 
+ * + * UNSUPPORTED_EXTENSIONS_NOT_MIGRATED = 45; + */ + UNSUPPORTED_EXTENSIONS_NOT_MIGRATED(45), + /** + * + * + *
+     * The warning message indicates the pg_cron extension and settings will not
+     * be migrated to the destination.
+     * 
+ * + * EXTENSIONS_NOT_MIGRATED = 46; + */ + EXTENSIONS_NOT_MIGRATED(46), + /** + * + * + *
+     * The error message indicates that pg_cron flags are enabled on the
+     * destination which is not supported during the migration.
+     * 
+ * + * PG_CRON_FLAG_ENABLED_IN_REPLICA = 47; + */ + PG_CRON_FLAG_ENABLED_IN_REPLICA(47), + /** + * + * + *
+     * This error message indicates that the specified extensions are not
+     * enabled on destination instance. For example, before you can migrate
+     * data to the destination instance, you must enable the PGAudit extension
+     * on the instance.
+     * 
+ * + * EXTENSIONS_NOT_ENABLED_IN_REPLICA = 48; + */ + EXTENSIONS_NOT_ENABLED_IN_REPLICA(48), + /** + * + * + *
+     * The source database has generated columns that can't be migrated. Please
+     * change them to regular columns before migration.
+     * 
+ * + * UNSUPPORTED_COLUMNS = 49; + */ + UNSUPPORTED_COLUMNS(49), + /** + * + * + *
+     * The source database has users that aren't created in the replica.
+     * First, create all users, which are in the pg_user_mappings table
+     * of the source database, in the destination instance. Then, perform the
+     * migration.
+     * 
+ * + * USERS_NOT_CREATED_IN_REPLICA = 50; + */ + USERS_NOT_CREATED_IN_REPLICA(50), + /** + * + * + *
+     * The selected objects include system objects that aren't supported for
+     * migration.
+     * 
+ * + * UNSUPPORTED_SYSTEM_OBJECTS = 51; + */ + UNSUPPORTED_SYSTEM_OBJECTS(51), + /** + * + * + *
+     * The source database has tables with the FULL or NOTHING replica identity.
+     * Before starting your migration, either remove the identity or change it
+     * to DEFAULT. Note that this is an error and will block the migration.
+     * 
+ * + * UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY = 52; + */ + UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY(52), + /** + * + * + *
+     * The selected objects don't exist on the source instance.
+     * 
+ * + * SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE = 53; + */ + SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE(53), + /** + * + * + *
+     * PSC only destination instance does not have a network attachment URI.
+     * 
+ * + * PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI = 54; + */ + PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI(54), + /** + * + * + *
+     * Selected objects reference unselected objects. Based on their object type
+     * (foreign key constraint or view), selected objects will fail during
+     * migration.
+     * 
+ * + * SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS = 55; + */ + SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS(55), + /** + * + * + *
+     * The migration will delete existing data in the replica; set
+     * [replica_overwrite_enabled][google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
+     * in the request to acknowledge this. This is an error. MySQL only.
+     * 
+ * + * PROMPT_DELETE_EXISTING = 56; + */ + PROMPT_DELETE_EXISTING(56), + /** + * + * + *
+     * The migration will delete existing data in the replica;
+     * [replica_overwrite_enabled][google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
+     * was set in the request acknowledging this. This is a warning rather than
+     * an error. MySQL only.
+     * 
+ * + * WILL_DELETE_EXISTING = 57; + */ + WILL_DELETE_EXISTING(57), + /** + * + * + *
+     * The replication user is missing specific privileges to setup DDL
+     * replication. (e.g. CREATE EVENT TRIGGER, CREATE SCHEMA) for PostgreSQL.
+     * 
+ * + * PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE = 58; + */ + PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE(58), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlExternalSyncSettingErrorType"); + } + + /** SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED = 0; */ + public static final int SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED_VALUE = 0; + + /** CONNECTION_FAILURE = 1; */ + public static final int CONNECTION_FAILURE_VALUE = 1; + + /** BINLOG_NOT_ENABLED = 2; */ + public static final int BINLOG_NOT_ENABLED_VALUE = 2; + + /** INCOMPATIBLE_DATABASE_VERSION = 3; */ + public static final int INCOMPATIBLE_DATABASE_VERSION_VALUE = 3; + + /** REPLICA_ALREADY_SETUP = 4; */ + public static final int REPLICA_ALREADY_SETUP_VALUE = 4; + + /** + * + * + *
+     * The replication user is missing privileges that are required.
+     * 
+ * + * INSUFFICIENT_PRIVILEGE = 5; + */ + public static final int INSUFFICIENT_PRIVILEGE_VALUE = 5; + + /** + * + * + *
+     * Unsupported migration type.
+     * 
+ * + * UNSUPPORTED_MIGRATION_TYPE = 6; + */ + public static final int UNSUPPORTED_MIGRATION_TYPE_VALUE = 6; + + /** + * + * + *
+     * No pglogical extension installed on databases, applicable for postgres.
+     * 
+ * + * NO_PGLOGICAL_INSTALLED = 7; + */ + public static final int NO_PGLOGICAL_INSTALLED_VALUE = 7; + + /** + * + * + *
+     * pglogical node already exists on databases, applicable for postgres.
+     * 
+ * + * PGLOGICAL_NODE_ALREADY_EXISTS = 8; + */ + public static final int PGLOGICAL_NODE_ALREADY_EXISTS_VALUE = 8; + + /** + * + * + *
+     * The value of parameter wal_level is not set to logical.
+     * 
+ * + * INVALID_WAL_LEVEL = 9; + */ + public static final int INVALID_WAL_LEVEL_VALUE = 9; + + /** + * + * + *
+     * The value of parameter shared_preload_libraries does not include
+     * pglogical.
+     * 
+ * + * INVALID_SHARED_PRELOAD_LIBRARY = 10; + */ + public static final int INVALID_SHARED_PRELOAD_LIBRARY_VALUE = 10; + + /** + * + * + *
+     * The value of parameter max_replication_slots is not sufficient.
+     * 
+ * + * INSUFFICIENT_MAX_REPLICATION_SLOTS = 11; + */ + public static final int INSUFFICIENT_MAX_REPLICATION_SLOTS_VALUE = 11; + + /** + * + * + *
+     * The value of parameter max_wal_senders is not sufficient.
+     * 
+ * + * INSUFFICIENT_MAX_WAL_SENDERS = 12; + */ + public static final int INSUFFICIENT_MAX_WAL_SENDERS_VALUE = 12; + + /** + * + * + *
+     * The value of parameter max_worker_processes is not sufficient.
+     * 
+ * + * INSUFFICIENT_MAX_WORKER_PROCESSES = 13; + */ + public static final int INSUFFICIENT_MAX_WORKER_PROCESSES_VALUE = 13; + + /** + * + * + *
+     * Extensions installed are either not supported or having unsupported
+     * versions
+     * 
+ * + * UNSUPPORTED_EXTENSIONS = 14; + */ + public static final int UNSUPPORTED_EXTENSIONS_VALUE = 14; + + /** + * + * + *
+     * The value of parameter rds.logical_replication is not set to 1.
+     * 
+ * + * INVALID_RDS_LOGICAL_REPLICATION = 15; + */ + public static final int INVALID_RDS_LOGICAL_REPLICATION_VALUE = 15; + + /** + * + * + *
+     * The primary instance logging setup doesn't allow EM sync.
+     * 
+ * + * INVALID_LOGGING_SETUP = 16; + */ + public static final int INVALID_LOGGING_SETUP_VALUE = 16; + + /** + * + * + *
+     * The primary instance database parameter setup doesn't allow EM sync.
+     * 
+ * + * INVALID_DB_PARAM = 17; + */ + public static final int INVALID_DB_PARAM_VALUE = 17; + + /** + * + * + *
+     * The gtid_mode is not supported, applicable for MySQL.
+     * 
+ * + * UNSUPPORTED_GTID_MODE = 18; + */ + public static final int UNSUPPORTED_GTID_MODE_VALUE = 18; + + /** + * + * + *
+     * SQL Server Agent is not running.
+     * 
+ * + * SQLSERVER_AGENT_NOT_RUNNING = 19; + */ + public static final int SQLSERVER_AGENT_NOT_RUNNING_VALUE = 19; + + /** + * + * + *
+     * The table definition is not support due to missing primary key or replica
+     * identity, applicable for postgres. Note that this is a warning and won't
+     * block the migration.
+     * 
+ * + * UNSUPPORTED_TABLE_DEFINITION = 20; + */ + public static final int UNSUPPORTED_TABLE_DEFINITION_VALUE = 20; + + /** + * + * + *
+     * The customer has a definer that will break EM setup.
+     * 
+ * + * UNSUPPORTED_DEFINER = 21; + */ + public static final int UNSUPPORTED_DEFINER_VALUE = 21; + + /** + * + * + *
+     * SQL Server @@SERVERNAME does not match actual host name.
+     * 
+ * + * SQLSERVER_SERVERNAME_MISMATCH = 22; + */ + public static final int SQLSERVER_SERVERNAME_MISMATCH_VALUE = 22; + + /** + * + * + *
+     * The primary instance has been setup and will fail the setup.
+     * 
+ * + * PRIMARY_ALREADY_SETUP = 23; + */ + public static final int PRIMARY_ALREADY_SETUP_VALUE = 23; + + /** + * + * + *
+     * The primary instance has unsupported binary log format.
+     * 
+ * + * UNSUPPORTED_BINLOG_FORMAT = 24; + */ + public static final int UNSUPPORTED_BINLOG_FORMAT_VALUE = 24; + + /** + * + * + *
+     * The primary instance's binary log retention setting.
+     * 
+ * + * BINLOG_RETENTION_SETTING = 25; + */ + public static final int BINLOG_RETENTION_SETTING_VALUE = 25; + + /** + * + * + *
+     * The primary instance has tables with unsupported storage engine.
+     * 
+ * + * UNSUPPORTED_STORAGE_ENGINE = 26; + */ + public static final int UNSUPPORTED_STORAGE_ENGINE_VALUE = 26; + + /** + * + * + *
+     * Source has tables with limited support
+     * eg: PostgreSQL tables without primary keys.
+     * 
+ * + * LIMITED_SUPPORT_TABLES = 27; + */ + public static final int LIMITED_SUPPORT_TABLES_VALUE = 27; + + /** + * + * + *
+     * The replica instance contains existing data.
+     * 
+ * + * EXISTING_DATA_IN_REPLICA = 28; + */ + public static final int EXISTING_DATA_IN_REPLICA_VALUE = 28; + + /** + * + * + *
+     * The replication user is missing privileges that are optional.
+     * 
+ * + * MISSING_OPTIONAL_PRIVILEGES = 29; + */ + public static final int MISSING_OPTIONAL_PRIVILEGES_VALUE = 29; + + /** + * + * + *
+     * Additional BACKUP_ADMIN privilege is granted to the replication user
+     * which may lock source MySQL 8 instance for DDLs during initial sync.
+     * 
+ * + * RISKY_BACKUP_ADMIN_PRIVILEGE = 30; + */ + public static final int RISKY_BACKUP_ADMIN_PRIVILEGE_VALUE = 30; + + /** + * + * + *
+     * The Cloud Storage bucket is missing necessary permissions.
+     * 
+ * + * INSUFFICIENT_GCS_PERMISSIONS = 31; + */ + public static final int INSUFFICIENT_GCS_PERMISSIONS_VALUE = 31; + + /** + * + * + *
+     * The Cloud Storage bucket has an error in the file or contains invalid
+     * file information.
+     * 
+ * + * INVALID_FILE_INFO = 32; + */ + public static final int INVALID_FILE_INFO_VALUE = 32; + + /** + * + * + *
+     * The source instance has unsupported database settings for migration.
+     * 
+ * + * UNSUPPORTED_DATABASE_SETTINGS = 33; + */ + public static final int UNSUPPORTED_DATABASE_SETTINGS_VALUE = 33; + + /** + * + * + *
+     * The replication user is missing parallel import specific privileges.
+     * (e.g. LOCK TABLES) for MySQL.
+     * 
+ * + * MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE = 34; + */ + public static final int MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE_VALUE = 34; + + /** + * + * + *
+     * The global variable local_infile is off on external server replica.
+     * 
+ * + * LOCAL_INFILE_OFF = 35; + */ + public static final int LOCAL_INFILE_OFF_VALUE = 35; + + /** + * + * + *
+     * This code instructs customers to turn on point-in-time recovery manually
+     * for the instance after promoting the Cloud SQL for PostgreSQL instance.
+     * 
+ * + * TURN_ON_PITR_AFTER_PROMOTE = 36; + */ + public static final int TURN_ON_PITR_AFTER_PROMOTE_VALUE = 36; + + /** + * + * + *
+     * The minor version of replica database is incompatible with the source.
+     * 
+ * + * INCOMPATIBLE_DATABASE_MINOR_VERSION = 37; + */ + public static final int INCOMPATIBLE_DATABASE_MINOR_VERSION_VALUE = 37; + + /** + * + * + *
+     * This warning message indicates that Cloud SQL uses the maximum number of
+     * subscriptions to migrate data from the source to the destination.
+     * 
+ * + * SOURCE_MAX_SUBSCRIPTIONS = 38; + */ + public static final int SOURCE_MAX_SUBSCRIPTIONS_VALUE = 38; + + /** + * + * + *
+     * Unable to verify definers on the source for MySQL.
+     * 
+ * + * UNABLE_TO_VERIFY_DEFINERS = 39; + */ + public static final int UNABLE_TO_VERIFY_DEFINERS_VALUE = 39; + + /** + * + * + *
+     * If a time out occurs while the subscription counts are calculated, then
+     * this value is set to 1. Otherwise, this value is set to 2.
+     * 
+ * + * SUBSCRIPTION_CALCULATION_STATUS = 40; + */ + public static final int SUBSCRIPTION_CALCULATION_STATUS_VALUE = 40; + + /** + * + * + *
+     * Count of subscriptions needed to sync source data for PostgreSQL
+     * database.
+     * 
+ * + * PG_SUBSCRIPTION_COUNT = 41; + */ + public static final int PG_SUBSCRIPTION_COUNT_VALUE = 41; + + /** + * + * + *
+     * Final parallel level that is used to do migration.
+     * 
+ * + * PG_SYNC_PARALLEL_LEVEL = 42; + */ + public static final int PG_SYNC_PARALLEL_LEVEL_VALUE = 42; + + /** + * + * + *
+     * The disk size of the replica instance is smaller than the data size of
+     * the source instance.
+     * 
+ * + * INSUFFICIENT_DISK_SIZE = 43; + */ + public static final int INSUFFICIENT_DISK_SIZE_VALUE = 43; + + /** + * + * + *
+     * The data size of the source instance is greater than 1 TB, the number of
+     * cores of the replica instance is less than 8, and the memory of the
+     * replica is less than 32 GB.
+     * 
+ * + * INSUFFICIENT_MACHINE_TIER = 44; + */ + public static final int INSUFFICIENT_MACHINE_TIER_VALUE = 44; + + /** + * + * + *
+     * The warning message indicates the unsupported extensions will not be
+     * migrated to the destination.
+     * 
+ * + * UNSUPPORTED_EXTENSIONS_NOT_MIGRATED = 45; + */ + public static final int UNSUPPORTED_EXTENSIONS_NOT_MIGRATED_VALUE = 45; + + /** + * + * + *
+     * The warning message indicates the pg_cron extension and settings will not
+     * be migrated to the destination.
+     * 
+ * + * EXTENSIONS_NOT_MIGRATED = 46; + */ + public static final int EXTENSIONS_NOT_MIGRATED_VALUE = 46; + + /** + * + * + *
+     * The error message indicates that pg_cron flags are enabled on the
+     * destination which is not supported during the migration.
+     * 
+ * + * PG_CRON_FLAG_ENABLED_IN_REPLICA = 47; + */ + public static final int PG_CRON_FLAG_ENABLED_IN_REPLICA_VALUE = 47; + + /** + * + * + *
+     * This error message indicates that the specified extensions are not
+     * enabled on destination instance. For example, before you can migrate
+     * data to the destination instance, you must enable the PGAudit extension
+     * on the instance.
+     * 
+ * + * EXTENSIONS_NOT_ENABLED_IN_REPLICA = 48; + */ + public static final int EXTENSIONS_NOT_ENABLED_IN_REPLICA_VALUE = 48; + + /** + * + * + *
+     * The source database has generated columns that can't be migrated. Please
+     * change them to regular columns before migration.
+     * 
+ * + * UNSUPPORTED_COLUMNS = 49; + */ + public static final int UNSUPPORTED_COLUMNS_VALUE = 49; + + /** + * + * + *
+     * The source database has users that aren't created in the replica.
+     * First, create all users, which are in the pg_user_mappings table
+     * of the source database, in the destination instance. Then, perform the
+     * migration.
+     * 
+ * + * USERS_NOT_CREATED_IN_REPLICA = 50; + */ + public static final int USERS_NOT_CREATED_IN_REPLICA_VALUE = 50; + + /** + * + * + *
+     * The selected objects include system objects that aren't supported for
+     * migration.
+     * 
+ * + * UNSUPPORTED_SYSTEM_OBJECTS = 51; + */ + public static final int UNSUPPORTED_SYSTEM_OBJECTS_VALUE = 51; + + /** + * + * + *
+     * The source database has tables with the FULL or NOTHING replica identity.
+     * Before starting your migration, either remove the identity or change it
+     * to DEFAULT. Note that this is an error and will block the migration.
+     * 
+ * + * UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY = 52; + */ + public static final int UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY_VALUE = 52; + + /** + * + * + *
+     * The selected objects don't exist on the source instance.
+     * 
+ * + * SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE = 53; + */ + public static final int SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE_VALUE = 53; + + /** + * + * + *
+     * PSC only destination instance does not have a network attachment URI.
+     * 
+ * + * PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI = 54; + */ + public static final int PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI_VALUE = 54; + + /** + * + * + *
+     * Selected objects reference unselected objects. Based on their object type
+     * (foreign key constraint or view), selected objects will fail during
+     * migration.
+     * 
+ * + * SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS = 55; + */ + public static final int SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS_VALUE = 55; + + /** + * + * + *
+     * The migration will delete existing data in the replica; set
+     * [replica_overwrite_enabled][google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
+     * in the request to acknowledge this. This is an error. MySQL only.
+     * 
+ * + * PROMPT_DELETE_EXISTING = 56; + */ + public static final int PROMPT_DELETE_EXISTING_VALUE = 56; + + /** + * + * + *
+     * The migration will delete existing data in the replica;
+     * [replica_overwrite_enabled][google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
+     * was set in the request acknowledging this. This is a warning rather than
+     * an error. MySQL only.
+     * 
+ * + * WILL_DELETE_EXISTING = 57; + */ + public static final int WILL_DELETE_EXISTING_VALUE = 57; + + /** + * + * + *
+     * The replication user is missing specific privileges to setup DDL
+     * replication. (e.g. CREATE EVENT TRIGGER, CREATE SCHEMA) for PostgreSQL.
+     * 
+ * + * PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE = 58; + */ + public static final int PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE_VALUE = 58; + + 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 SqlExternalSyncSettingErrorType 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 SqlExternalSyncSettingErrorType forNumber(int value) { + switch (value) { + case 0: + return SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED; + case 1: + return CONNECTION_FAILURE; + case 2: + return BINLOG_NOT_ENABLED; + case 3: + return INCOMPATIBLE_DATABASE_VERSION; + case 4: + return REPLICA_ALREADY_SETUP; + case 5: + return INSUFFICIENT_PRIVILEGE; + case 6: + return UNSUPPORTED_MIGRATION_TYPE; + case 7: + return NO_PGLOGICAL_INSTALLED; + case 8: + return PGLOGICAL_NODE_ALREADY_EXISTS; + case 9: + return INVALID_WAL_LEVEL; + case 10: + return INVALID_SHARED_PRELOAD_LIBRARY; + case 11: + return INSUFFICIENT_MAX_REPLICATION_SLOTS; + case 12: + return INSUFFICIENT_MAX_WAL_SENDERS; + case 13: + return INSUFFICIENT_MAX_WORKER_PROCESSES; + case 14: + return UNSUPPORTED_EXTENSIONS; + case 15: + return INVALID_RDS_LOGICAL_REPLICATION; + case 16: + return INVALID_LOGGING_SETUP; + case 17: + return INVALID_DB_PARAM; + case 18: + return UNSUPPORTED_GTID_MODE; + case 19: + return SQLSERVER_AGENT_NOT_RUNNING; + case 20: + return UNSUPPORTED_TABLE_DEFINITION; + case 21: + return UNSUPPORTED_DEFINER; + case 22: + return SQLSERVER_SERVERNAME_MISMATCH; + case 23: + return PRIMARY_ALREADY_SETUP; + case 24: + return UNSUPPORTED_BINLOG_FORMAT; + case 25: + return BINLOG_RETENTION_SETTING; + case 26: + return UNSUPPORTED_STORAGE_ENGINE; + case 27: + return LIMITED_SUPPORT_TABLES; + case 28: + return EXISTING_DATA_IN_REPLICA; + case 29: + return MISSING_OPTIONAL_PRIVILEGES; + case 30: + return RISKY_BACKUP_ADMIN_PRIVILEGE; + case 31: + return INSUFFICIENT_GCS_PERMISSIONS; + case 32: + return INVALID_FILE_INFO; + case 33: + return UNSUPPORTED_DATABASE_SETTINGS; + case 34: + return MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE; + case 35: + return LOCAL_INFILE_OFF; + case 36: + return TURN_ON_PITR_AFTER_PROMOTE; + case 37: + return INCOMPATIBLE_DATABASE_MINOR_VERSION; + case 38: + return SOURCE_MAX_SUBSCRIPTIONS; + case 39: + return UNABLE_TO_VERIFY_DEFINERS; + case 40: + return SUBSCRIPTION_CALCULATION_STATUS; + case 41: + return PG_SUBSCRIPTION_COUNT; + case 42: + return PG_SYNC_PARALLEL_LEVEL; + case 43: + return INSUFFICIENT_DISK_SIZE; + case 44: + return INSUFFICIENT_MACHINE_TIER; + case 45: + return UNSUPPORTED_EXTENSIONS_NOT_MIGRATED; + case 46: + return EXTENSIONS_NOT_MIGRATED; + case 47: + return PG_CRON_FLAG_ENABLED_IN_REPLICA; + case 48: + return EXTENSIONS_NOT_ENABLED_IN_REPLICA; + case 49: + return UNSUPPORTED_COLUMNS; + case 50: + return USERS_NOT_CREATED_IN_REPLICA; + case 51: + return UNSUPPORTED_SYSTEM_OBJECTS; + case 52: + return UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY; + case 53: + return SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE; + case 54: + return PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI; + case 55: + return SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS; + case 56: + return PROMPT_DELETE_EXISTING; + case 57: + return WILL_DELETE_EXISTING; + case 58: + return PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE; + 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 SqlExternalSyncSettingErrorType findValueByNumber(int number) { + return SqlExternalSyncSettingErrorType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final SqlExternalSyncSettingErrorType[] VALUES = values(); + + public static SqlExternalSyncSettingErrorType 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 SqlExternalSyncSettingErrorType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType) + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * Can be `sql#externalSyncSettingError` or
+   * `sql#externalSyncSettingWarning`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * Can be `sql#externalSyncSettingError` or
+   * `sql#externalSyncSettingWarning`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private int type_ = 0; + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + getType() { + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + result = + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + .forNumber(type_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + .UNRECOGNIZED + : result; + } + + public static final int DETAIL_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object detail_ = ""; + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string detail = 3; + * + * @return The detail. + */ + @java.lang.Override + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detail_ = s; + return s; + } + } + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string detail = 3; + * + * @return The bytes for detail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detail_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (type_ + != com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + .SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(detail_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, detail_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (type_ + != com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + .SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(detail_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, detail_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError other = + (com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError) obj; + + if (!getKind().equals(other.getKind())) return false; + if (type_ != other.type_) return false; + if (!getDetail().equals(other.getDetail())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getDetail().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * External primary instance migration setting error/warning.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlExternalSyncSettingError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlExternalSyncSettingError) + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlExternalSyncSettingError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlExternalSyncSettingError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.class, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + type_ = 0; + detail_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlExternalSyncSettingError_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError build() { + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError buildPartial() { + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError result = + new com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.detail_ = detail_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError other) { + if (other == com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDetail().isEmpty()) { + detail_ = other.detail_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + detail_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * Can be `sql#externalSyncSettingError` or
+     * `sql#externalSyncSettingWarning`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Can be `sql#externalSyncSettingError` or
+     * `sql#externalSyncSettingWarning`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Can be `sql#externalSyncSettingError` or
+     * `sql#externalSyncSettingWarning`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Can be `sql#externalSyncSettingError` or
+     * `sql#externalSyncSettingWarning`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Can be `sql#externalSyncSettingError` or
+     * `sql#externalSyncSettingWarning`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int type_ = 0; + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + getType() { + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + result = + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError + .SqlExternalSyncSettingErrorType.forNumber(type_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifies the specific error that occurred.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000002); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object detail_ = ""; + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string detail = 3; + * + * @return The detail. + */ + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string detail = 3; + * + * @return The bytes for detail. + */ + public com.google.protobuf.ByteString getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string detail = 3; + * + * @param value The detail to set. + * @return This builder for chaining. + */ + public Builder setDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + detail_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string detail = 3; + * + * @return This builder for chaining. + */ + public Builder clearDetail() { + detail_ = getDefaultInstance().getDetail(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Additional information about the error encountered.
+     * 
+ * + * string detail = 3; + * + * @param value The bytes for detail to set. + * @return This builder for chaining. + */ + public Builder setDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + detail_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlExternalSyncSettingError) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlExternalSyncSettingError) + private static final com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError(); + } + + public static com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlExternalSyncSettingError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlExternalSyncSettingErrorOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlExternalSyncSettingErrorOrBuilder.java new file mode 100644 index 000000000000..4fd021ebb479 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlExternalSyncSettingErrorOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlExternalSyncSettingErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlExternalSyncSettingError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Can be `sql#externalSyncSettingError` or
+   * `sql#externalSyncSettingWarning`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * Can be `sql#externalSyncSettingError` or
+   * `sql#externalSyncSettingWarning`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * Identifies the specific error that occurred.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType type = 2; + * + * + * @return The type. + */ + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType + getType(); + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string detail = 3; + * + * @return The detail. + */ + java.lang.String getDetail(); + + /** + * + * + *
+   * Additional information about the error encountered.
+   * 
+ * + * string detail = 3; + * + * @return The bytes for detail. + */ + com.google.protobuf.ByteString getDetailBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFileType.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFileType.java new file mode 100644 index 000000000000..0ae0d1a94883 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFileType.java @@ -0,0 +1,215 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf enum {@code google.cloud.sql.v1beta4.SqlFileType} */ +@com.google.protobuf.Generated +public enum SqlFileType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unknown file type.
+   * 
+ * + * SQL_FILE_TYPE_UNSPECIFIED = 0; + */ + SQL_FILE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * File containing SQL statements.
+   * 
+ * + * SQL = 1; + */ + SQL(1), + /** + * + * + *
+   * File in CSV format.
+   * 
+ * + * CSV = 2; + */ + CSV(2), + /** BAK = 4; */ + BAK(4), + /** + * + * + *
+   * TDE certificate.
+   * 
+ * + * TDE = 8; + */ + TDE(8), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlFileType"); + } + + /** + * + * + *
+   * Unknown file type.
+   * 
+ * + * SQL_FILE_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_FILE_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * File containing SQL statements.
+   * 
+ * + * SQL = 1; + */ + public static final int SQL_VALUE = 1; + + /** + * + * + *
+   * File in CSV format.
+   * 
+ * + * CSV = 2; + */ + public static final int CSV_VALUE = 2; + + /** BAK = 4; */ + public static final int BAK_VALUE = 4; + + /** + * + * + *
+   * TDE certificate.
+   * 
+ * + * TDE = 8; + */ + public static final int TDE_VALUE = 8; + + 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 SqlFileType 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 SqlFileType forNumber(int value) { + switch (value) { + case 0: + return SQL_FILE_TYPE_UNSPECIFIED; + case 1: + return SQL; + case 2: + return CSV; + case 4: + return BAK; + case 8: + return TDE; + 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 SqlFileType findValueByNumber(int number) { + return SqlFileType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final SqlFileType[] VALUES = values(); + + public static SqlFileType 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 SqlFileType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlFileType) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagScope.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagScope.java new file mode 100644 index 000000000000..5c22d967bde3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagScope.java @@ -0,0 +1,193 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Scopes of a flag describe where the flag is used.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.SqlFlagScope} + */ +@com.google.protobuf.Generated +public enum SqlFlagScope implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Assume database flags if unspecified
+   * 
+ * + * SQL_FLAG_SCOPE_UNSPECIFIED = 0; + */ + SQL_FLAG_SCOPE_UNSPECIFIED(0), + /** + * + * + *
+   * database flags
+   * 
+ * + * SQL_FLAG_SCOPE_DATABASE = 1; + */ + SQL_FLAG_SCOPE_DATABASE(1), + /** + * + * + *
+   * connection pool configuration flags
+   * 
+ * + * SQL_FLAG_SCOPE_CONNECTION_POOL = 2; + */ + SQL_FLAG_SCOPE_CONNECTION_POOL(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlFlagScope"); + } + + /** + * + * + *
+   * Assume database flags if unspecified
+   * 
+ * + * SQL_FLAG_SCOPE_UNSPECIFIED = 0; + */ + public static final int SQL_FLAG_SCOPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * database flags
+   * 
+ * + * SQL_FLAG_SCOPE_DATABASE = 1; + */ + public static final int SQL_FLAG_SCOPE_DATABASE_VALUE = 1; + + /** + * + * + *
+   * connection pool configuration flags
+   * 
+ * + * SQL_FLAG_SCOPE_CONNECTION_POOL = 2; + */ + public static final int SQL_FLAG_SCOPE_CONNECTION_POOL_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 SqlFlagScope 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 SqlFlagScope forNumber(int value) { + switch (value) { + case 0: + return SQL_FLAG_SCOPE_UNSPECIFIED; + case 1: + return SQL_FLAG_SCOPE_DATABASE; + case 2: + return SQL_FLAG_SCOPE_CONNECTION_POOL; + 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 SqlFlagScope findValueByNumber(int number) { + return SqlFlagScope.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(18); + } + + private static final SqlFlagScope[] VALUES = values(); + + public static SqlFlagScope 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 SqlFlagScope(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlFlagScope) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagType.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagType.java new file mode 100644 index 000000000000..4afcceeca0a4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagType.java @@ -0,0 +1,302 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf enum {@code google.cloud.sql.v1beta4.SqlFlagType} */ +@com.google.protobuf.Generated +public enum SqlFlagType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown flag type.
+   * 
+ * + * SQL_FLAG_TYPE_UNSPECIFIED = 0; + */ + SQL_FLAG_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Boolean type flag.
+   * 
+ * + * BOOLEAN = 1; + */ + BOOLEAN(1), + /** + * + * + *
+   * String type flag.
+   * 
+ * + * STRING = 2; + */ + STRING(2), + /** + * + * + *
+   * Integer type flag.
+   * 
+ * + * INTEGER = 3; + */ + INTEGER(3), + /** + * + * + *
+   * Flag type used for a server startup option.
+   * 
+ * + * NONE = 4; + */ + NONE(4), + /** + * + * + *
+   * Type introduced specially for MySQL TimeZone offset. Accept a string value
+   * with the format [-12:59, 13:00].
+   * 
+ * + * MYSQL_TIMEZONE_OFFSET = 5; + */ + MYSQL_TIMEZONE_OFFSET(5), + /** + * + * + *
+   * Float type flag.
+   * 
+ * + * FLOAT = 6; + */ + FLOAT(6), + /** + * + * + *
+   * Comma-separated list of the strings in a SqlFlagType enum.
+   * 
+ * + * REPEATED_STRING = 7; + */ + REPEATED_STRING(7), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlFlagType"); + } + + /** + * + * + *
+   * This is an unknown flag type.
+   * 
+ * + * SQL_FLAG_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_FLAG_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Boolean type flag.
+   * 
+ * + * BOOLEAN = 1; + */ + public static final int BOOLEAN_VALUE = 1; + + /** + * + * + *
+   * String type flag.
+   * 
+ * + * STRING = 2; + */ + public static final int STRING_VALUE = 2; + + /** + * + * + *
+   * Integer type flag.
+   * 
+ * + * INTEGER = 3; + */ + public static final int INTEGER_VALUE = 3; + + /** + * + * + *
+   * Flag type used for a server startup option.
+   * 
+ * + * NONE = 4; + */ + public static final int NONE_VALUE = 4; + + /** + * + * + *
+   * Type introduced specially for MySQL TimeZone offset. Accept a string value
+   * with the format [-12:59, 13:00].
+   * 
+ * + * MYSQL_TIMEZONE_OFFSET = 5; + */ + public static final int MYSQL_TIMEZONE_OFFSET_VALUE = 5; + + /** + * + * + *
+   * Float type flag.
+   * 
+ * + * FLOAT = 6; + */ + public static final int FLOAT_VALUE = 6; + + /** + * + * + *
+   * Comma-separated list of the strings in a SqlFlagType enum.
+   * 
+ * + * REPEATED_STRING = 7; + */ + public static final int REPEATED_STRING_VALUE = 7; + + 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 SqlFlagType 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 SqlFlagType forNumber(int value) { + switch (value) { + case 0: + return SQL_FLAG_TYPE_UNSPECIFIED; + case 1: + return BOOLEAN; + case 2: + return STRING; + case 3: + return INTEGER; + case 4: + return NONE; + case 5: + return MYSQL_TIMEZONE_OFFSET; + case 6: + return FLOAT; + case 7: + return REPEATED_STRING; + 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 SqlFlagType findValueByNumber(int number) { + return SqlFlagType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(17); + } + + private static final SqlFlagType[] VALUES = values(); + + public static SqlFlagType 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 SqlFlagType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlFlagType) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsListRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsListRequest.java new file mode 100644 index 000000000000..dfd60ba71333 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsListRequest.java @@ -0,0 +1,810 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlFlagsListRequest} */ +@com.google.protobuf.Generated +public final class SqlFlagsListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlFlagsListRequest) + SqlFlagsListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlFlagsListRequest"); + } + + // Use SqlFlagsListRequest.newBuilder() to construct. + private SqlFlagsListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlFlagsListRequest() { + databaseVersion_ = ""; + flagScope_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlFlagsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlFlagsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlFlagsListRequest.class, + com.google.cloud.sql.v1beta4.SqlFlagsListRequest.Builder.class); + } + + private int bitField0_; + public static final int DATABASE_VERSION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object databaseVersion_ = ""; + + /** + * + * + *
+   * Database type and version you want to retrieve flags for. By default, this
+   * method returns flags for all database types and versions.
+   * 
+ * + * string database_version = 1; + * + * @return The databaseVersion. + */ + @java.lang.Override + public java.lang.String getDatabaseVersion() { + java.lang.Object ref = databaseVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + databaseVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * Database type and version you want to retrieve flags for. By default, this
+   * method returns flags for all database types and versions.
+   * 
+ * + * string database_version = 1; + * + * @return The bytes for databaseVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseVersionBytes() { + java.lang.Object ref = databaseVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + databaseVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FLAG_SCOPE_FIELD_NUMBER = 3; + private int flagScope_ = 0; + + /** + * + * + *
+   * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+   * Return list of database flags if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the flagScope field is set. + */ + @java.lang.Override + public boolean hasFlagScope() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+   * Return list of database flags if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for flagScope. + */ + @java.lang.Override + public int getFlagScopeValue() { + return flagScope_; + } + + /** + * + * + *
+   * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+   * Return list of database flags if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The flagScope. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlFlagScope getFlagScope() { + com.google.cloud.sql.v1beta4.SqlFlagScope result = + com.google.cloud.sql.v1beta4.SqlFlagScope.forNumber(flagScope_); + return result == null ? com.google.cloud.sql.v1beta4.SqlFlagScope.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.GeneratedMessage.isStringEmpty(databaseVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, databaseVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeEnum(3, flagScope_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(databaseVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, databaseVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, flagScope_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlFlagsListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlFlagsListRequest other = + (com.google.cloud.sql.v1beta4.SqlFlagsListRequest) obj; + + if (!getDatabaseVersion().equals(other.getDatabaseVersion())) return false; + if (hasFlagScope() != other.hasFlagScope()) return false; + if (hasFlagScope()) { + if (flagScope_ != other.flagScope_) return false; + } + if (!getUnknownFields().equals(other.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) + DATABASE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseVersion().hashCode(); + if (hasFlagScope()) { + hash = (37 * hash) + FLAG_SCOPE_FIELD_NUMBER; + hash = (53 * hash) + flagScope_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlFlagsListRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlFlagsListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlFlagsListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlFlagsListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlFlagsListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlFlagsListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlFlagsListRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlFlagsListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlFlagsListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlFlagsListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlFlagsListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlFlagsListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlFlagsListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlFlagsListRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlFlagsListRequest) + com.google.cloud.sql.v1beta4.SqlFlagsListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlFlagsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlFlagsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlFlagsListRequest.class, + com.google.cloud.sql.v1beta4.SqlFlagsListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlFlagsListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + databaseVersion_ = ""; + flagScope_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlFlagsListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlFlagsListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlFlagsListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlFlagsListRequest build() { + com.google.cloud.sql.v1beta4.SqlFlagsListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlFlagsListRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlFlagsListRequest result = + new com.google.cloud.sql.v1beta4.SqlFlagsListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlFlagsListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.databaseVersion_ = databaseVersion_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.flagScope_ = flagScope_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlFlagsListRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlFlagsListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlFlagsListRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlFlagsListRequest.getDefaultInstance()) + return this; + if (!other.getDatabaseVersion().isEmpty()) { + databaseVersion_ = other.databaseVersion_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasFlagScope()) { + setFlagScopeValue(other.getFlagScopeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + databaseVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 24: + { + flagScope_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object databaseVersion_ = ""; + + /** + * + * + *
+     * Database type and version you want to retrieve flags for. By default, this
+     * method returns flags for all database types and versions.
+     * 
+ * + * string database_version = 1; + * + * @return The databaseVersion. + */ + public java.lang.String getDatabaseVersion() { + java.lang.Object ref = databaseVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + databaseVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database type and version you want to retrieve flags for. By default, this
+     * method returns flags for all database types and versions.
+     * 
+ * + * string database_version = 1; + * + * @return The bytes for databaseVersion. + */ + public com.google.protobuf.ByteString getDatabaseVersionBytes() { + java.lang.Object ref = databaseVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + databaseVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database type and version you want to retrieve flags for. By default, this
+     * method returns flags for all database types and versions.
+     * 
+ * + * string database_version = 1; + * + * @param value The databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + databaseVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database type and version you want to retrieve flags for. By default, this
+     * method returns flags for all database types and versions.
+     * 
+ * + * string database_version = 1; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseVersion() { + databaseVersion_ = getDefaultInstance().getDatabaseVersion(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database type and version you want to retrieve flags for. By default, this
+     * method returns flags for all database types and versions.
+     * 
+ * + * string database_version = 1; + * + * @param value The bytes for databaseVersion to set. + * @return This builder for chaining. + */ + public Builder setDatabaseVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + databaseVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int flagScope_ = 0; + + /** + * + * + *
+     * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+     * Return list of database flags if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the flagScope field is set. + */ + @java.lang.Override + public boolean hasFlagScope() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+     * Return list of database flags if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for flagScope. + */ + @java.lang.Override + public int getFlagScopeValue() { + return flagScope_; + } + + /** + * + * + *
+     * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+     * Return list of database flags if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for flagScope to set. + * @return This builder for chaining. + */ + public Builder setFlagScopeValue(int value) { + flagScope_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+     * Return list of database flags if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The flagScope. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlFlagScope getFlagScope() { + com.google.cloud.sql.v1beta4.SqlFlagScope result = + com.google.cloud.sql.v1beta4.SqlFlagScope.forNumber(flagScope_); + return result == null ? com.google.cloud.sql.v1beta4.SqlFlagScope.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+     * Return list of database flags if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The flagScope to set. + * @return This builder for chaining. + */ + public Builder setFlagScope(com.google.cloud.sql.v1beta4.SqlFlagScope value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + flagScope_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+     * Return list of database flags if unspecified.
+     * 
+ * + * + * optional .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearFlagScope() { + bitField0_ = (bitField0_ & ~0x00000002); + flagScope_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlFlagsListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlFlagsListRequest) + private static final com.google.cloud.sql.v1beta4.SqlFlagsListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlFlagsListRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlFlagsListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlFlagsListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlFlagsListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsListRequestOrBuilder.java new file mode 100644 index 000000000000..fd67a07d971b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlFlagsListRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlFlagsListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlFlagsListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Database type and version you want to retrieve flags for. By default, this
+   * method returns flags for all database types and versions.
+   * 
+ * + * string database_version = 1; + * + * @return The databaseVersion. + */ + java.lang.String getDatabaseVersion(); + + /** + * + * + *
+   * Database type and version you want to retrieve flags for. By default, this
+   * method returns flags for all database types and versions.
+   * 
+ * + * string database_version = 1; + * + * @return The bytes for databaseVersion. + */ + com.google.protobuf.ByteString getDatabaseVersionBytes(); + + /** + * + * + *
+   * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+   * Return list of database flags if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the flagScope field is set. + */ + boolean hasFlagScope(); + + /** + * + * + *
+   * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+   * Return list of database flags if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for flagScope. + */ + int getFlagScopeValue(); + + /** + * + * + *
+   * Optional. Specify the scope of flags to be returned by SqlFlagsListService.
+   * Return list of database flags if unspecified.
+   * 
+ * + * + * optional .google.cloud.sql.v1beta4.SqlFlagScope flag_scope = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The flagScope. + */ + com.google.cloud.sql.v1beta4.SqlFlagScope getFlagScope(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstanceType.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstanceType.java new file mode 100644 index 000000000000..2f0c258e3769 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstanceType.java @@ -0,0 +1,235 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf enum {@code google.cloud.sql.v1beta4.SqlInstanceType} */ +@com.google.protobuf.Generated +public enum SqlInstanceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown Cloud SQL instance type.
+   * 
+ * + * SQL_INSTANCE_TYPE_UNSPECIFIED = 0; + */ + SQL_INSTANCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * A regular Cloud SQL instance that is not replicating from a primary
+   * instance.
+   * 
+ * + * CLOUD_SQL_INSTANCE = 1; + */ + CLOUD_SQL_INSTANCE(1), + /** + * + * + *
+   * An instance running on the customer's premises that is not managed by
+   * Cloud SQL.
+   * 
+ * + * ON_PREMISES_INSTANCE = 2; + */ + ON_PREMISES_INSTANCE(2), + /** + * + * + *
+   * A Cloud SQL instance acting as a read-replica.
+   * 
+ * + * READ_REPLICA_INSTANCE = 3; + */ + READ_REPLICA_INSTANCE(3), + /** + * + * + *
+   * A Cloud SQL read pool.
+   * 
+ * + * READ_POOL_INSTANCE = 5; + */ + READ_POOL_INSTANCE(5), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstanceType"); + } + + /** + * + * + *
+   * This is an unknown Cloud SQL instance type.
+   * 
+ * + * SQL_INSTANCE_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_INSTANCE_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * A regular Cloud SQL instance that is not replicating from a primary
+   * instance.
+   * 
+ * + * CLOUD_SQL_INSTANCE = 1; + */ + public static final int CLOUD_SQL_INSTANCE_VALUE = 1; + + /** + * + * + *
+   * An instance running on the customer's premises that is not managed by
+   * Cloud SQL.
+   * 
+ * + * ON_PREMISES_INSTANCE = 2; + */ + public static final int ON_PREMISES_INSTANCE_VALUE = 2; + + /** + * + * + *
+   * A Cloud SQL instance acting as a read-replica.
+   * 
+ * + * READ_REPLICA_INSTANCE = 3; + */ + public static final int READ_REPLICA_INSTANCE_VALUE = 3; + + /** + * + * + *
+   * A Cloud SQL read pool.
+   * 
+ * + * READ_POOL_INSTANCE = 5; + */ + public static final int READ_POOL_INSTANCE_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SqlInstanceType 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 SqlInstanceType forNumber(int value) { + switch (value) { + case 0: + return SQL_INSTANCE_TYPE_UNSPECIFIED; + case 1: + return CLOUD_SQL_INSTANCE; + case 2: + return ON_PREMISES_INSTANCE; + case 3: + return READ_REPLICA_INSTANCE; + case 5: + return READ_POOL_INSTANCE; + 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 SqlInstanceType findValueByNumber(int number) { + return SqlInstanceType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(9); + } + + private static final SqlInstanceType[] VALUES = values(); + + public static SqlInstanceType 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 SqlInstanceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlInstanceType) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAcquireSsrsLeaseRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAcquireSsrsLeaseRequest.java new file mode 100644 index 000000000000..bfe8ee0735ea --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAcquireSsrsLeaseRequest.java @@ -0,0 +1,1117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Request to acquire a lease for SSRS.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesAcquireSsrsLeaseRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest) + SqlInstancesAcquireSsrsLeaseRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesAcquireSsrsLeaseRequest"); + } + + // Use SqlInstancesAcquireSsrsLeaseRequest.newBuilder() to construct. + private SqlInstancesAcquireSsrsLeaseRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesAcquireSsrsLeaseRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+   * composed of lowercase letters, numbers, and hyphens, and it must start with
+   * a letter. The total length must be 98 characters or less (Example:
+   * instance-id).
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+   * composed of lowercase letters, numbers, and hyphens, and it must start with
+   * a letter. The total length must be 98 characters or less (Example:
+   * instance-id).
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. ID of the project that contains the instance (Example:
+   * project-id).
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. ID of the project that contains the instance (Example:
+   * project-id).
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body_; + + /** + * + * + *
+   * The body for request to acquire an SSRS lease.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The body for request to acquire an SSRS lease.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * The body for request to acquire an SSRS lease.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request to acquire a lease for SSRS.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest) + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+     * composed of lowercase letters, numbers, and hyphens, and it must start with
+     * a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+     * composed of lowercase letters, numbers, and hyphens, and it must start with
+     * a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+     * composed of lowercase letters, numbers, and hyphens, and it must start with
+     * a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+     * composed of lowercase letters, numbers, and hyphens, and it must start with
+     * a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+     * composed of lowercase letters, numbers, and hyphens, and it must start with
+     * a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest, + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequestOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * The body for request to acquire an SSRS lease.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The body for request to acquire an SSRS lease.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The body for request to acquire an SSRS lease.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + */ + public Builder setBody(com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The body for request to acquire an SSRS lease.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The body for request to acquire an SSRS lease.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest + .getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The body for request to acquire an SSRS lease.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The body for request to acquire an SSRS lease.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + */ + public com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The body for request to acquire an SSRS lease.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + */ + public com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequestOrBuilder + getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * The body for request to acquire an SSRS lease.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest, + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest, + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesAcquireSsrsLeaseRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAcquireSsrsLeaseRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAcquireSsrsLeaseRequestOrBuilder.java new file mode 100644 index 000000000000..804a9a90a678 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAcquireSsrsLeaseRequestOrBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesAcquireSsrsLeaseRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+   * composed of lowercase letters, numbers, and hyphens, and it must start with
+   * a letter. The total length must be 98 characters or less (Example:
+   * instance-id).
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This doesn't include the project ID. It's
+   * composed of lowercase letters, numbers, and hyphens, and it must start with
+   * a letter. The total length must be 98 characters or less (Example:
+   * instance-id).
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. ID of the project that contains the instance (Example:
+   * project-id).
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. ID of the project that contains the instance (Example:
+   * project-id).
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * The body for request to acquire an SSRS lease.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * The body for request to acquire an SSRS lease.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest getBody(); + + /** + * + * + *
+   * The body for request to acquire an SSRS lease.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest body = 100; + */ + com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAcquireSsrsLeaseResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAcquireSsrsLeaseResponse.java new file mode 100644 index 000000000000..17a0dc9a112c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAcquireSsrsLeaseResponse.java @@ -0,0 +1,647 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Acquire SSRS lease response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse} + */ +@com.google.protobuf.Generated +public final class SqlInstancesAcquireSsrsLeaseResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse) + SqlInstancesAcquireSsrsLeaseResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesAcquireSsrsLeaseResponse"); + } + + // Use SqlInstancesAcquireSsrsLeaseResponse.newBuilder() to construct. + private SqlInstancesAcquireSsrsLeaseResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesAcquireSsrsLeaseResponse() { + operationId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse.class, + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse.Builder.class); + } + + private int bitField0_; + public static final int OPERATION_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object operationId_ = ""; + + /** + * + * + *
+   * The unique identifier for this operation.
+   * 
+ * + * optional string operation_id = 1; + * + * @return Whether the operationId field is set. + */ + @java.lang.Override + public boolean hasOperationId() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The unique identifier for this operation.
+   * 
+ * + * optional string operation_id = 1; + * + * @return The operationId. + */ + @java.lang.Override + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationId_ = s; + return s; + } + } + + /** + * + * + *
+   * The unique identifier for this operation.
+   * 
+ * + * optional string operation_id = 1; + * + * @return The bytes for operationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = 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)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, operationId_); + } + 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.GeneratedMessage.computeStringSize(1, operationId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse other = + (com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse) obj; + + if (hasOperationId() != other.hasOperationId()) return false; + if (hasOperationId()) { + if (!getOperationId().equals(other.getOperationId())) return false; + } + if (!getUnknownFields().equals(other.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 (hasOperationId()) { + hash = (37 * hash) + OPERATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getOperationId().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Acquire SSRS lease response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse) + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse.class, + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + operationId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAcquireSsrsLeaseResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse build() { + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse result = + new com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.operationId_ = operationId_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse.getDefaultInstance()) + return this; + if (other.hasOperationId()) { + operationId_ = other.operationId_; + 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: + { + operationId_ = 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 operationId_ = ""; + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * optional string operation_id = 1; + * + * @return Whether the operationId field is set. + */ + public boolean hasOperationId() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * optional string operation_id = 1; + * + * @return The operationId. + */ + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * optional string operation_id = 1; + * + * @return The bytes for operationId. + */ + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * optional string operation_id = 1; + * + * @param value The operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + operationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * optional string operation_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperationId() { + operationId_ = getDefaultInstance().getOperationId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique identifier for this operation.
+     * 
+ * + * optional string operation_id = 1; + * + * @param value The bytes for operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + operationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse) + private static final com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesAcquireSsrsLeaseResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAcquireSsrsLeaseResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAcquireSsrsLeaseResponseOrBuilder.java new file mode 100644 index 000000000000..5b5f0fac17f1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAcquireSsrsLeaseResponseOrBuilder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesAcquireSsrsLeaseResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique identifier for this operation.
+   * 
+ * + * optional string operation_id = 1; + * + * @return Whether the operationId field is set. + */ + boolean hasOperationId(); + + /** + * + * + *
+   * The unique identifier for this operation.
+   * 
+ * + * optional string operation_id = 1; + * + * @return The operationId. + */ + java.lang.String getOperationId(); + + /** + * + * + *
+   * The unique identifier for this operation.
+   * 
+ * + * optional string operation_id = 1; + * + * @return The bytes for operationId. + */ + com.google.protobuf.ByteString getOperationIdBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddEntraIdCertificateRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddEntraIdCertificateRequest.java new file mode 100644 index 000000000000..819a5b0c8ce3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddEntraIdCertificateRequest.java @@ -0,0 +1,799 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Request for AddEntraIdCertificate RPC.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesAddEntraIdCertificateRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest) + SqlInstancesAddEntraIdCertificateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesAddEntraIdCertificateRequest"); + } + + // Use SqlInstancesAddEntraIdCertificateRequest.newBuilder() to construct. + private SqlInstancesAddEntraIdCertificateRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesAddEntraIdCertificateRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddEntraIdCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request for AddEntraIdCertificate RPC.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest) + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddEntraIdCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesAddEntraIdCertificateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddEntraIdCertificateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddEntraIdCertificateRequestOrBuilder.java new file mode 100644 index 000000000000..1b98539eab69 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddEntraIdCertificateRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesAddEntraIdCertificateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddServerCaRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddServerCaRequest.java new file mode 100644 index 000000000000..c6ad768d12b7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddServerCaRequest.java @@ -0,0 +1,770 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesAddServerCaRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest) + SqlInstancesAddServerCaRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesAddServerCaRequest"); + } + + // Use SqlInstancesAddServerCaRequest.newBuilder() to construct. + private SqlInstancesAddServerCaRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesAddServerCaRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest) + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesAddServerCaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddServerCaRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddServerCaRequestOrBuilder.java new file mode 100644 index 000000000000..ac0031e7cc1c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddServerCaRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesAddServerCaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddServerCertificateRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddServerCertificateRequest.java new file mode 100644 index 000000000000..7abcec8f172a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddServerCertificateRequest.java @@ -0,0 +1,799 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Request for AddServerCertificate RPC.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesAddServerCertificateRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest) + SqlInstancesAddServerCertificateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesAddServerCertificateRequest"); + } + + // Use SqlInstancesAddServerCertificateRequest.newBuilder() to construct. + private SqlInstancesAddServerCertificateRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesAddServerCertificateRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request for AddServerCertificate RPC.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest) + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesAddServerCertificateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesAddServerCertificateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddServerCertificateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddServerCertificateRequestOrBuilder.java new file mode 100644 index 000000000000..167b1ba32041 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesAddServerCertificateRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesAddServerCertificateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesCloneRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesCloneRequest.java new file mode 100644 index 000000000000..865db837b42a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesCloneRequest.java @@ -0,0 +1,981 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesCloneRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesCloneRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesCloneRequest) + SqlInstancesCloneRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesCloneRequest"); + } + + // Use SqlInstancesCloneRequest.newBuilder() to construct. + private SqlInstancesCloneRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesCloneRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesCloneRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesCloneRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * The ID of the Cloud SQL instance to be cloned (source). This does not
+   * include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * The ID of the Cloud SQL instance to be cloned (source). This does not
+   * include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the source Cloud SQL instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the source Cloud SQL instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.InstancesCloneRequest body_; + + /** + * .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesCloneRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesCloneRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesCloneRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesCloneRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesCloneRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesCloneRequest) + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesCloneRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesCloneRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesCloneRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * The ID of the Cloud SQL instance to be cloned (source). This does not
+     * include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The ID of the Cloud SQL instance to be cloned (source). This does not
+     * include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The ID of the Cloud SQL instance to be cloned (source). This does not
+     * include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The ID of the Cloud SQL instance to be cloned (source). This does not
+     * include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The ID of the Cloud SQL instance to be cloned (source). This does not
+     * include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the source Cloud SQL instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the source Cloud SQL instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the source Cloud SQL instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the source Cloud SQL instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the source Cloud SQL instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstancesCloneRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesCloneRequest, + com.google.cloud.sql.v1beta4.InstancesCloneRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesCloneRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.InstancesCloneRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesCloneRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.InstancesCloneRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesCloneRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.InstancesCloneRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1beta4.InstancesCloneRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesCloneRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesCloneRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesCloneRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesCloneRequest, + com.google.cloud.sql.v1beta4.InstancesCloneRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesCloneRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesCloneRequest, + com.google.cloud.sql.v1beta4.InstancesCloneRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesCloneRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesCloneRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesCloneRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesCloneRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesCloneRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesCloneRequestOrBuilder.java new file mode 100644 index 000000000000..0895429e207a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesCloneRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesCloneRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesCloneRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The ID of the Cloud SQL instance to be cloned (source). This does not
+   * include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * The ID of the Cloud SQL instance to be cloned (source). This does not
+   * include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the source Cloud SQL instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the source Cloud SQL instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.InstancesCloneRequest getBody(); + + /** .google.cloud.sql.v1beta4.InstancesCloneRequest body = 100; */ + com.google.cloud.sql.v1beta4.InstancesCloneRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesCreateEphemeralCertRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesCreateEphemeralCertRequest.java new file mode 100644 index 000000000000..41646a47569d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesCreateEphemeralCertRequest.java @@ -0,0 +1,989 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesCreateEphemeralCertRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest) + SqlInstancesCreateEphemeralCertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesCreateEphemeralCertRequest"); + } + + // Use SqlInstancesCreateEphemeralCertRequest.newBuilder() to construct. + private SqlInstancesCreateEphemeralCertRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesCreateEphemeralCertRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesCreateEphemeralCertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesCreateEphemeralCertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body_; + + /** + * .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest) + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesCreateEphemeralCertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesCreateEphemeralCertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesCreateEphemeralCertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest, + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.Builder, + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest + .getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; */ + public com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; */ + public com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest, + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.Builder, + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest, + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.Builder, + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesCreateEphemeralCertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesCreateEphemeralCertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesCreateEphemeralCertRequestOrBuilder.java new file mode 100644 index 000000000000..ab29796e1533 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesCreateEphemeralCertRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesCreateEphemeralCertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest getBody(); + + /** .google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest body = 100; */ + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDeleteRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDeleteRequest.java new file mode 100644 index 000000000000..09e6ed104648 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDeleteRequest.java @@ -0,0 +1,1657 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesDeleteRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesDeleteRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesDeleteRequest) + SqlInstancesDeleteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesDeleteRequest"); + } + + // Use SqlInstancesDeleteRequest.newBuilder() to construct. + private SqlInstancesDeleteRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesDeleteRequest() { + instance_ = ""; + project_ = ""; + finalBackupDescription_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest.Builder.class); + } + + private int bitField0_; + private int expirationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object expiration_; + + public enum ExpirationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + FINAL_BACKUP_TTL_DAYS(4), + FINAL_BACKUP_EXPIRY_TIME(6), + EXPIRATION_NOT_SET(0); + private final int value; + + private ExpirationCase(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 ExpirationCase valueOf(int value) { + return forNumber(value); + } + + public static ExpirationCase forNumber(int value) { + switch (value) { + case 4: + return FINAL_BACKUP_TTL_DAYS; + case 6: + return FINAL_BACKUP_EXPIRY_TIME; + case 0: + return EXPIRATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance to be deleted.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance to be deleted.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLE_FINAL_BACKUP_FIELD_NUMBER = 7; + private boolean enableFinalBackup_ = false; + + /** + * + * + *
+   * Flag to opt-in for final backup. By default, it is turned off.
+   * 
+ * + * optional bool enable_final_backup = 7; + * + * @return Whether the enableFinalBackup field is set. + */ + @java.lang.Override + public boolean hasEnableFinalBackup() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Flag to opt-in for final backup. By default, it is turned off.
+   * 
+ * + * optional bool enable_final_backup = 7; + * + * @return The enableFinalBackup. + */ + @java.lang.Override + public boolean getEnableFinalBackup() { + return enableFinalBackup_; + } + + public static final int FINAL_BACKUP_TTL_DAYS_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Optional. Retention period of the final backup.
+   * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the finalBackupTtlDays field is set. + */ + @java.lang.Override + public boolean hasFinalBackupTtlDays() { + return expirationCase_ == 4; + } + + /** + * + * + *
+   * Optional. Retention period of the final backup.
+   * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finalBackupTtlDays. + */ + @java.lang.Override + public long getFinalBackupTtlDays() { + if (expirationCase_ == 4) { + return (java.lang.Long) expiration_; + } + return 0L; + } + + public static final int FINAL_BACKUP_EXPIRY_TIME_FIELD_NUMBER = 6; + + /** + * + * + *
+   * Optional. Final Backup expiration time.
+   * Timestamp in UTC of when this resource is considered expired.
+   * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the finalBackupExpiryTime field is set. + */ + @java.lang.Override + public boolean hasFinalBackupExpiryTime() { + return expirationCase_ == 6; + } + + /** + * + * + *
+   * Optional. Final Backup expiration time.
+   * Timestamp in UTC of when this resource is considered expired.
+   * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The finalBackupExpiryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getFinalBackupExpiryTime() { + if (expirationCase_ == 6) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + /** + * + * + *
+   * Optional. Final Backup expiration time.
+   * Timestamp in UTC of when this resource is considered expired.
+   * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getFinalBackupExpiryTimeOrBuilder() { + if (expirationCase_ == 6) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int FINAL_BACKUP_DESCRIPTION_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object finalBackupDescription_ = ""; + + /** + * + * + *
+   * Optional. The description of the final backup.
+   * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finalBackupDescription. + */ + @java.lang.Override + public java.lang.String getFinalBackupDescription() { + java.lang.Object ref = finalBackupDescription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + finalBackupDescription_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The description of the final backup.
+   * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for finalBackupDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFinalBackupDescriptionBytes() { + java.lang.Object ref = finalBackupDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + finalBackupDescription_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (expirationCase_ == 4) { + output.writeInt64(4, (long) ((java.lang.Long) expiration_)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(finalBackupDescription_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, finalBackupDescription_); + } + if (expirationCase_ == 6) { + output.writeMessage(6, (com.google.protobuf.Timestamp) expiration_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(7, enableFinalBackup_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (expirationCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 4, (long) ((java.lang.Long) expiration_)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(finalBackupDescription_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, finalBackupDescription_); + } + if (expirationCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.protobuf.Timestamp) expiration_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, enableFinalBackup_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasEnableFinalBackup() != other.hasEnableFinalBackup()) return false; + if (hasEnableFinalBackup()) { + if (getEnableFinalBackup() != other.getEnableFinalBackup()) return false; + } + if (!getFinalBackupDescription().equals(other.getFinalBackupDescription())) return false; + if (!getExpirationCase().equals(other.getExpirationCase())) return false; + switch (expirationCase_) { + case 4: + if (getFinalBackupTtlDays() != other.getFinalBackupTtlDays()) return false; + break; + case 6: + if (!getFinalBackupExpiryTime().equals(other.getFinalBackupExpiryTime())) 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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasEnableFinalBackup()) { + hash = (37 * hash) + ENABLE_FINAL_BACKUP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableFinalBackup()); + } + hash = (37 * hash) + FINAL_BACKUP_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getFinalBackupDescription().hashCode(); + switch (expirationCase_) { + case 4: + hash = (37 * hash) + FINAL_BACKUP_TTL_DAYS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFinalBackupTtlDays()); + break; + case 6: + hash = (37 * hash) + FINAL_BACKUP_EXPIRY_TIME_FIELD_NUMBER; + hash = (53 * hash) + getFinalBackupExpiryTime().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesDeleteRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesDeleteRequest) + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + enableFinalBackup_ = false; + if (finalBackupExpiryTimeBuilder_ != null) { + finalBackupExpiryTimeBuilder_.clear(); + } + finalBackupDescription_ = ""; + expirationCase_ = 0; + expiration_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDeleteRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.enableFinalBackup_ = enableFinalBackup_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.finalBackupDescription_ = finalBackupDescription_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest result) { + result.expirationCase_ = expirationCase_; + result.expiration_ = this.expiration_; + if (expirationCase_ == 6 && finalBackupExpiryTimeBuilder_ != null) { + result.expiration_ = finalBackupExpiryTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasEnableFinalBackup()) { + setEnableFinalBackup(other.getEnableFinalBackup()); + } + if (!other.getFinalBackupDescription().isEmpty()) { + finalBackupDescription_ = other.finalBackupDescription_; + bitField0_ |= 0x00000020; + onChanged(); + } + switch (other.getExpirationCase()) { + case FINAL_BACKUP_TTL_DAYS: + { + setFinalBackupTtlDays(other.getFinalBackupTtlDays()); + break; + } + case FINAL_BACKUP_EXPIRY_TIME: + { + mergeFinalBackupExpiryTime(other.getFinalBackupExpiryTime()); + break; + } + case EXPIRATION_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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 32: + { + expiration_ = input.readInt64(); + expirationCase_ = 4; + break; + } // case 32 + case 42: + { + finalBackupDescription_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetFinalBackupExpiryTimeFieldBuilder().getBuilder(), extensionRegistry); + expirationCase_ = 6; + break; + } // case 50 + case 56: + { + enableFinalBackup_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 56 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int expirationCase_ = 0; + private java.lang.Object expiration_; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public Builder clearExpiration() { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance to be deleted.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be deleted.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be deleted.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be deleted.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be deleted.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean enableFinalBackup_; + + /** + * + * + *
+     * Flag to opt-in for final backup. By default, it is turned off.
+     * 
+ * + * optional bool enable_final_backup = 7; + * + * @return Whether the enableFinalBackup field is set. + */ + @java.lang.Override + public boolean hasEnableFinalBackup() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Flag to opt-in for final backup. By default, it is turned off.
+     * 
+ * + * optional bool enable_final_backup = 7; + * + * @return The enableFinalBackup. + */ + @java.lang.Override + public boolean getEnableFinalBackup() { + return enableFinalBackup_; + } + + /** + * + * + *
+     * Flag to opt-in for final backup. By default, it is turned off.
+     * 
+ * + * optional bool enable_final_backup = 7; + * + * @param value The enableFinalBackup to set. + * @return This builder for chaining. + */ + public Builder setEnableFinalBackup(boolean value) { + + enableFinalBackup_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Flag to opt-in for final backup. By default, it is turned off.
+     * 
+ * + * optional bool enable_final_backup = 7; + * + * @return This builder for chaining. + */ + public Builder clearEnableFinalBackup() { + bitField0_ = (bitField0_ & ~0x00000004); + enableFinalBackup_ = false; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Retention period of the final backup.
+     * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the finalBackupTtlDays field is set. + */ + public boolean hasFinalBackupTtlDays() { + return expirationCase_ == 4; + } + + /** + * + * + *
+     * Optional. Retention period of the final backup.
+     * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finalBackupTtlDays. + */ + public long getFinalBackupTtlDays() { + if (expirationCase_ == 4) { + return (java.lang.Long) expiration_; + } + return 0L; + } + + /** + * + * + *
+     * Optional. Retention period of the final backup.
+     * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The finalBackupTtlDays to set. + * @return This builder for chaining. + */ + public Builder setFinalBackupTtlDays(long value) { + + expirationCase_ = 4; + expiration_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Retention period of the final backup.
+     * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFinalBackupTtlDays() { + if (expirationCase_ == 4) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + finalBackupExpiryTimeBuilder_; + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the finalBackupExpiryTime field is set. + */ + @java.lang.Override + public boolean hasFinalBackupExpiryTime() { + return expirationCase_ == 6; + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The finalBackupExpiryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getFinalBackupExpiryTime() { + if (finalBackupExpiryTimeBuilder_ == null) { + if (expirationCase_ == 6) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (expirationCase_ == 6) { + return finalBackupExpiryTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFinalBackupExpiryTime(com.google.protobuf.Timestamp value) { + if (finalBackupExpiryTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + finalBackupExpiryTimeBuilder_.setMessage(value); + } + expirationCase_ = 6; + return this; + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFinalBackupExpiryTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (finalBackupExpiryTimeBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + finalBackupExpiryTimeBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 6; + return this; + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFinalBackupExpiryTime(com.google.protobuf.Timestamp value) { + if (finalBackupExpiryTimeBuilder_ == null) { + if (expirationCase_ == 6 + && expiration_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 6) { + finalBackupExpiryTimeBuilder_.mergeFrom(value); + } else { + finalBackupExpiryTimeBuilder_.setMessage(value); + } + } + expirationCase_ = 6; + return this; + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFinalBackupExpiryTime() { + if (finalBackupExpiryTimeBuilder_ == null) { + if (expirationCase_ == 6) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 6) { + expirationCase_ = 0; + expiration_ = null; + } + finalBackupExpiryTimeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getFinalBackupExpiryTimeBuilder() { + return internalGetFinalBackupExpiryTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getFinalBackupExpiryTimeOrBuilder() { + if ((expirationCase_ == 6) && (finalBackupExpiryTimeBuilder_ != null)) { + return finalBackupExpiryTimeBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 6) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Optional. Final Backup expiration time.
+     * Timestamp in UTC of when this resource is considered expired.
+     * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetFinalBackupExpiryTimeFieldBuilder() { + if (finalBackupExpiryTimeBuilder_ == null) { + if (!(expirationCase_ == 6)) { + expiration_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + finalBackupExpiryTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 6; + onChanged(); + return finalBackupExpiryTimeBuilder_; + } + + private java.lang.Object finalBackupDescription_ = ""; + + /** + * + * + *
+     * Optional. The description of the final backup.
+     * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finalBackupDescription. + */ + public java.lang.String getFinalBackupDescription() { + java.lang.Object ref = finalBackupDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + finalBackupDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The description of the final backup.
+     * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for finalBackupDescription. + */ + public com.google.protobuf.ByteString getFinalBackupDescriptionBytes() { + java.lang.Object ref = finalBackupDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + finalBackupDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The description of the final backup.
+     * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The finalBackupDescription to set. + * @return This builder for chaining. + */ + public Builder setFinalBackupDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + finalBackupDescription_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The description of the final backup.
+     * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFinalBackupDescription() { + finalBackupDescription_ = getDefaultInstance().getFinalBackupDescription(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The description of the final backup.
+     * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for finalBackupDescription to set. + * @return This builder for chaining. + */ + public Builder setFinalBackupDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + finalBackupDescription_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesDeleteRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesDeleteRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesDeleteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDeleteRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDeleteRequestOrBuilder.java new file mode 100644 index 000000000000..62d0df6ac62a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDeleteRequestOrBuilder.java @@ -0,0 +1,206 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesDeleteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesDeleteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance to be deleted.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance to be deleted.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Flag to opt-in for final backup. By default, it is turned off.
+   * 
+ * + * optional bool enable_final_backup = 7; + * + * @return Whether the enableFinalBackup field is set. + */ + boolean hasEnableFinalBackup(); + + /** + * + * + *
+   * Flag to opt-in for final backup. By default, it is turned off.
+   * 
+ * + * optional bool enable_final_backup = 7; + * + * @return The enableFinalBackup. + */ + boolean getEnableFinalBackup(); + + /** + * + * + *
+   * Optional. Retention period of the final backup.
+   * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the finalBackupTtlDays field is set. + */ + boolean hasFinalBackupTtlDays(); + + /** + * + * + *
+   * Optional. Retention period of the final backup.
+   * 
+ * + * int64 final_backup_ttl_days = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finalBackupTtlDays. + */ + long getFinalBackupTtlDays(); + + /** + * + * + *
+   * Optional. Final Backup expiration time.
+   * Timestamp in UTC of when this resource is considered expired.
+   * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the finalBackupExpiryTime field is set. + */ + boolean hasFinalBackupExpiryTime(); + + /** + * + * + *
+   * Optional. Final Backup expiration time.
+   * Timestamp in UTC of when this resource is considered expired.
+   * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The finalBackupExpiryTime. + */ + com.google.protobuf.Timestamp getFinalBackupExpiryTime(); + + /** + * + * + *
+   * Optional. Final Backup expiration time.
+   * Timestamp in UTC of when this resource is considered expired.
+   * 
+ * + * + * .google.protobuf.Timestamp final_backup_expiry_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getFinalBackupExpiryTimeOrBuilder(); + + /** + * + * + *
+   * Optional. The description of the final backup.
+   * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finalBackupDescription. + */ + java.lang.String getFinalBackupDescription(); + + /** + * + * + *
+   * Optional. The description of the final backup.
+   * 
+ * + * string final_backup_description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for finalBackupDescription. + */ + com.google.protobuf.ByteString getFinalBackupDescriptionBytes(); + + com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest.ExpirationCase getExpirationCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDemoteMasterRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDemoteMasterRequest.java new file mode 100644 index 000000000000..58ff0e1da34d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDemoteMasterRequest.java @@ -0,0 +1,979 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesDemoteMasterRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest) + SqlInstancesDemoteMasterRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesDemoteMasterRequest"); + } + + // Use SqlInstancesDemoteMasterRequest.newBuilder() to construct. + private SqlInstancesDemoteMasterRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesDemoteMasterRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteMasterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteMasterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body_; + + /** + * .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest) + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteMasterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteMasterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteMasterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance name.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance name.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance name.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest, + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest, + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest, + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesDemoteMasterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDemoteMasterRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDemoteMasterRequestOrBuilder.java new file mode 100644 index 000000000000..68475fb7d471 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDemoteMasterRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesDemoteMasterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest getBody(); + + /** .google.cloud.sql.v1beta4.InstancesDemoteMasterRequest body = 100; */ + com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDemoteRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDemoteRequest.java new file mode 100644 index 000000000000..e0c46afdd712 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDemoteRequest.java @@ -0,0 +1,1078 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance demote request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesDemoteRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesDemoteRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesDemoteRequest) + SqlInstancesDemoteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesDemoteRequest"); + } + + // Use SqlInstancesDemoteRequest.newBuilder() to construct. + private SqlInstancesDemoteRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesDemoteRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. The name of the Cloud SQL instance.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name of the Cloud SQL instance.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. The project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.InstancesDemoteRequest body_; + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesDemoteRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesDemoteRequest.getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesDemoteRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesDemoteRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance demote request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesDemoteRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesDemoteRequest) + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesDemoteRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Required. The name of the Cloud SQL instance.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name of the Cloud SQL instance.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name of the Cloud SQL instance.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the Cloud SQL instance.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the Cloud SQL instance.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. The project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstancesDemoteRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesDemoteRequest, + com.google.cloud.sql.v1beta4.InstancesDemoteRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesDemoteRequestOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.InstancesDemoteRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesDemoteRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + */ + public Builder setBody(com.google.cloud.sql.v1beta4.InstancesDemoteRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesDemoteRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.InstancesDemoteRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1beta4.InstancesDemoteRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + */ + public com.google.cloud.sql.v1beta4.InstancesDemoteRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + */ + public com.google.cloud.sql.v1beta4.InstancesDemoteRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesDemoteRequest.getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesDemoteRequest, + com.google.cloud.sql.v1beta4.InstancesDemoteRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesDemoteRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesDemoteRequest, + com.google.cloud.sql.v1beta4.InstancesDemoteRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesDemoteRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesDemoteRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesDemoteRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesDemoteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDemoteRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDemoteRequestOrBuilder.java new file mode 100644 index 000000000000..63dfcfcb32e5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesDemoteRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesDemoteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesDemoteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Cloud SQL instance.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. The name of the Cloud SQL instance.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. The project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. The project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.InstancesDemoteRequest getBody(); + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesDemoteRequest body = 100; + */ + com.google.cloud.sql.v1beta4.InstancesDemoteRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExecuteSqlRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExecuteSqlRequest.java new file mode 100644 index 000000000000..5119e4ea6a90 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExecuteSqlRequest.java @@ -0,0 +1,1077 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Execute SQL statements request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesExecuteSqlRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest) + SqlInstancesExecuteSqlRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesExecuteSqlRequest"); + } + + // Use SqlInstancesExecuteSqlRequest.newBuilder() to construct. + private SqlInstancesExecuteSqlRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesExecuteSqlRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.ExecuteSqlPayload body_; + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExecuteSqlPayload getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.ExecuteSqlPayload.getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExecuteSqlPayloadOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.ExecuteSqlPayload.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Execute SQL statements request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest) + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.ExecuteSqlPayload body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExecuteSqlPayload, + com.google.cloud.sql.v1beta4.ExecuteSqlPayload.Builder, + com.google.cloud.sql.v1beta4.ExecuteSqlPayloadOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.ExecuteSqlPayload getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.ExecuteSqlPayload.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + */ + public Builder setBody(com.google.cloud.sql.v1beta4.ExecuteSqlPayload value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + */ + public Builder setBody(com.google.cloud.sql.v1beta4.ExecuteSqlPayload.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.ExecuteSqlPayload value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1beta4.ExecuteSqlPayload.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + */ + public com.google.cloud.sql.v1beta4.ExecuteSqlPayload.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + */ + public com.google.cloud.sql.v1beta4.ExecuteSqlPayloadOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.ExecuteSqlPayload.getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * The request body.
+     * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExecuteSqlPayload, + com.google.cloud.sql.v1beta4.ExecuteSqlPayload.Builder, + com.google.cloud.sql.v1beta4.ExecuteSqlPayloadOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ExecuteSqlPayload, + com.google.cloud.sql.v1beta4.ExecuteSqlPayload.Builder, + com.google.cloud.sql.v1beta4.ExecuteSqlPayloadOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesExecuteSqlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExecuteSqlRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExecuteSqlRequestOrBuilder.java new file mode 100644 index 000000000000..877048fb28cd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExecuteSqlRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesExecuteSqlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.ExecuteSqlPayload getBody(); + + /** + * + * + *
+   * The request body.
+   * 
+ * + * .google.cloud.sql.v1beta4.ExecuteSqlPayload body = 100; + */ + com.google.cloud.sql.v1beta4.ExecuteSqlPayloadOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExecuteSqlResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExecuteSqlResponse.java new file mode 100644 index 000000000000..285c1d6439ce --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExecuteSqlResponse.java @@ -0,0 +1,3139 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Execute SQL statements response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse} + */ +@com.google.protobuf.Generated +public final class SqlInstancesExecuteSqlResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse) + SqlInstancesExecuteSqlResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesExecuteSqlResponse"); + } + + // Use SqlInstancesExecuteSqlResponse.newBuilder() to construct. + private SqlInstancesExecuteSqlResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesExecuteSqlResponse() { + messages_ = java.util.Collections.emptyList(); + results_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.class, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Builder.class); + } + + public interface MessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The full message string.
+     * For PostgreSQL, this is a formatted string that may include severity,
+     * code, and the notice/warning message.
+     * For MySQL, this contains the warning message.
+     * 
+ * + * optional string message = 1; + * + * @return Whether the message field is set. + */ + boolean hasMessage(); + + /** + * + * + *
+     * The full message string.
+     * For PostgreSQL, this is a formatted string that may include severity,
+     * code, and the notice/warning message.
+     * For MySQL, this contains the warning message.
+     * 
+ * + * optional string message = 1; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
+     * The full message string.
+     * For PostgreSQL, this is a formatted string that may include severity,
+     * code, and the notice/warning message.
+     * For MySQL, this contains the warning message.
+     * 
+ * + * optional string message = 1; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
+     * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+     * MySQL).
+     * 
+ * + * optional string severity = 2; + * + * @return Whether the severity field is set. + */ + boolean hasSeverity(); + + /** + * + * + *
+     * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+     * MySQL).
+     * 
+ * + * optional string severity = 2; + * + * @return The severity. + */ + java.lang.String getSeverity(); + + /** + * + * + *
+     * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+     * MySQL).
+     * 
+ * + * optional string severity = 2; + * + * @return The bytes for severity. + */ + com.google.protobuf.ByteString getSeverityBytes(); + } + + /** + * + * + *
+   * Represents a notice or warning message from the database.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message} + */ + public static final class Message extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message) + MessageOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Message"); + } + + // Use Message.newBuilder() to construct. + private Message(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Message() { + message_ = ""; + severity_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_Message_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_Message_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.class, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.Builder.class); + } + + private int bitField0_; + public static final int MESSAGE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
+     * The full message string.
+     * For PostgreSQL, this is a formatted string that may include severity,
+     * code, and the notice/warning message.
+     * For MySQL, this contains the warning message.
+     * 
+ * + * optional string message = 1; + * + * @return Whether the message field is set. + */ + @java.lang.Override + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The full message string.
+     * For PostgreSQL, this is a formatted string that may include severity,
+     * code, and the notice/warning message.
+     * For MySQL, this contains the warning message.
+     * 
+ * + * optional string message = 1; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + + /** + * + * + *
+     * The full message string.
+     * For PostgreSQL, this is a formatted string that may include severity,
+     * code, and the notice/warning message.
+     * For MySQL, this contains the warning message.
+     * 
+ * + * optional string message = 1; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object severity_ = ""; + + /** + * + * + *
+     * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+     * MySQL).
+     * 
+ * + * optional string severity = 2; + * + * @return Whether the severity field is set. + */ + @java.lang.Override + public boolean hasSeverity() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+     * MySQL).
+     * 
+ * + * optional string severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public java.lang.String getSeverity() { + java.lang.Object ref = severity_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + severity_ = s; + return s; + } + } + + /** + * + * + *
+     * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+     * MySQL).
+     * 
+ * + * optional string severity = 2; + * + * @return The bytes for severity. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSeverityBytes() { + java.lang.Object ref = severity_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + severity_ = 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)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, message_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, severity_); + } + 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.GeneratedMessage.computeStringSize(1, message_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, severity_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message other = + (com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message) obj; + + if (hasMessage() != other.hasMessage()) return false; + if (hasMessage()) { + if (!getMessage().equals(other.getMessage())) return false; + } + if (hasSeverity() != other.hasSeverity()) return false; + if (hasSeverity()) { + if (!getSeverity().equals(other.getSeverity())) return false; + } + if (!getUnknownFields().equals(other.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 (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + if (hasSeverity()) { + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + getSeverity().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Represents a notice or warning message from the database.
+     * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message) + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.MessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_Message_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_Message_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.class, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + message_ = ""; + severity_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_Message_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message build() { + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message result = + new com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.message_ = message_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.severity_ = severity_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message + .getDefaultInstance()) return this; + if (other.hasMessage()) { + message_ = other.message_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSeverity()) { + severity_ = other.severity_; + 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: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + severity_ = 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 message_ = ""; + + /** + * + * + *
+       * The full message string.
+       * For PostgreSQL, this is a formatted string that may include severity,
+       * code, and the notice/warning message.
+       * For MySQL, this contains the warning message.
+       * 
+ * + * optional string message = 1; + * + * @return Whether the message field is set. + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The full message string.
+       * For PostgreSQL, this is a formatted string that may include severity,
+       * code, and the notice/warning message.
+       * For MySQL, this contains the warning message.
+       * 
+ * + * optional string message = 1; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The full message string.
+       * For PostgreSQL, this is a formatted string that may include severity,
+       * code, and the notice/warning message.
+       * For MySQL, this contains the warning message.
+       * 
+ * + * optional string message = 1; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The full message string.
+       * For PostgreSQL, this is a formatted string that may include severity,
+       * code, and the notice/warning message.
+       * For MySQL, this contains the warning message.
+       * 
+ * + * optional string message = 1; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The full message string.
+       * For PostgreSQL, this is a formatted string that may include severity,
+       * code, and the notice/warning message.
+       * For MySQL, this contains the warning message.
+       * 
+ * + * optional string message = 1; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The full message string.
+       * For PostgreSQL, this is a formatted string that may include severity,
+       * code, and the notice/warning message.
+       * For MySQL, this contains the warning message.
+       * 
+ * + * optional string message = 1; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object severity_ = ""; + + /** + * + * + *
+       * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+       * MySQL).
+       * 
+ * + * optional string severity = 2; + * + * @return Whether the severity field is set. + */ + public boolean hasSeverity() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+       * MySQL).
+       * 
+ * + * optional string severity = 2; + * + * @return The severity. + */ + public java.lang.String getSeverity() { + java.lang.Object ref = severity_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + severity_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+       * MySQL).
+       * 
+ * + * optional string severity = 2; + * + * @return The bytes for severity. + */ + public com.google.protobuf.ByteString getSeverityBytes() { + java.lang.Object ref = severity_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + severity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+       * MySQL).
+       * 
+ * + * optional string severity = 2; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + severity_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+       * MySQL).
+       * 
+ * + * optional string severity = 2; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + severity_ = getDefaultInstance().getSeverity(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
+       * MySQL).
+       * 
+ * + * optional string severity = 2; + * + * @param value The bytes for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + severity_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message) + private static final com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Message parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int MESSAGES_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private java.util.List + messages_; + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + @java.lang.Override + public java.util.List + getMessagesList() { + return messages_; + } + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.MessageOrBuilder> + getMessagesOrBuilderList() { + return messages_; + } + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + @java.lang.Override + public int getMessagesCount() { + return messages_.size(); + } + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message getMessages( + int index) { + return messages_.get(index); + } + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.MessageOrBuilder + getMessagesOrBuilder(int index) { + return messages_.get(index); + } + + public static final int METADATA_FIELD_NUMBER = 6; + private com.google.cloud.sql.v1beta4.Metadata metadata_; + + /** + * + * + *
+   * The additional metadata information regarding the execution of the SQL
+   * statements.
+   * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The additional metadata information regarding the execution of the SQL
+   * statements.
+   * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Metadata getMetadata() { + return metadata_ == null + ? com.google.cloud.sql.v1beta4.Metadata.getDefaultInstance() + : metadata_; + } + + /** + * + * + *
+   * The additional metadata information regarding the execution of the SQL
+   * statements.
+   * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.MetadataOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? com.google.cloud.sql.v1beta4.Metadata.getDefaultInstance() + : metadata_; + } + + public static final int RESULTS_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private java.util.List results_; + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + @java.lang.Override + public java.util.List getResultsList() { + return results_; + } + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + @java.lang.Override + public java.util.List + getResultsOrBuilderList() { + return results_; + } + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.QueryResult getResults(int index) { + return results_.get(index); + } + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.QueryResultOrBuilder getResultsOrBuilder(int index) { + return results_.get(index); + } + + public static final int STATUS_FIELD_NUMBER = 8; + private com.google.rpc.Status status_; + + /** + * + * + *
+   * Contains the error from the database if the SQL execution failed.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Contains the error from the database if the SQL execution failed.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
+   * Contains the error from the database if the SQL execution failed.
+   * 
+ * + * .google.rpc.Status status = 8; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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(6, getMetadata()); + } + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(7, results_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(8, getStatus()); + } + for (int i = 0; i < messages_.size(); i++) { + output.writeMessage(9, messages_.get(i)); + } + 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(6, getMetadata()); + } + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, results_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getStatus()); + } + for (int i = 0; i < messages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, messages_.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.sql.v1beta4.SqlInstancesExecuteSqlResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse other = + (com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse) obj; + + if (!getMessagesList().equals(other.getMessagesList())) return false; + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getResultsList().equals(other.getResultsList())) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (!getUnknownFields().equals(other.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 (getMessagesCount() > 0) { + hash = (37 * hash) + MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getMessagesList().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Execute SQL statements response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse) + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.class, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMessagesFieldBuilder(); + internalGetMetadataFieldBuilder(); + internalGetResultsFieldBuilder(); + internalGetStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + } else { + messages_ = null; + messagesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + } else { + results_ = null; + resultsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExecuteSqlResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse build() { + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse result = + new com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse result) { + if (messagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.messages_ = messages_; + } else { + result.messages_ = messagesBuilder_.build(); + } + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.getDefaultInstance()) + return this; + if (messagesBuilder_ == null) { + if (!other.messages_.isEmpty()) { + if (messages_.isEmpty()) { + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMessagesIsMutable(); + messages_.addAll(other.messages_); + } + onChanged(); + } + } else { + if (!other.messages_.isEmpty()) { + if (messagesBuilder_.isEmpty()) { + messagesBuilder_.dispose(); + messagesBuilder_ = null; + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000001); + messagesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMessagesFieldBuilder() + : null; + } else { + messagesBuilder_.addAllMessages(other.messages_); + } + } + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000004); + resultsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetResultsFieldBuilder() + : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 50: + { + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 50 + case 58: + { + com.google.cloud.sql.v1beta4.QueryResult m = + input.readMessage( + com.google.cloud.sql.v1beta4.QueryResult.parser(), extensionRegistry); + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(m); + } else { + resultsBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: + { + input.readMessage(internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 66 + case 74: + { + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message m = + input.readMessage( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message + .parser(), + extensionRegistry); + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(m); + } else { + messagesBuilder_.addMessage(m); + } + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + messages_ = java.util.Collections.emptyList(); + + private void ensureMessagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + messages_ = + new java.util.ArrayList< + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message>(messages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.Builder, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.MessageOrBuilder> + messagesBuilder_; + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public java.util.List + getMessagesList() { + if (messagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(messages_); + } else { + return messagesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public int getMessagesCount() { + if (messagesBuilder_ == null) { + return messages_.size(); + } else { + return messagesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message getMessages( + int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder setMessages( + int index, com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.set(index, value); + onChanged(); + } else { + messagesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder setMessages( + int index, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.Builder + builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.set(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder addMessages( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(value); + onChanged(); + } else { + messagesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder addMessages( + int index, com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(index, value); + onChanged(); + } else { + messagesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder addMessages( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.Builder + builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder addMessages( + int index, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.Builder + builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder addAllMessages( + java.lang.Iterable< + ? extends com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message> + values) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, messages_); + onChanged(); + } else { + messagesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder clearMessages() { + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + messagesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public Builder removeMessages(int index) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.remove(index); + onChanged(); + } else { + messagesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.Builder + getMessagesBuilder(int index) { + return internalGetMessagesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.MessageOrBuilder + getMessagesOrBuilder(int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public java.util.List< + ? extends com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.MessageOrBuilder> + getMessagesOrBuilderList() { + if (messagesBuilder_ != null) { + return messagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(messages_); + } + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.Builder + addMessagesBuilder() { + return internalGetMessagesFieldBuilder() + .addBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message + .getDefaultInstance()); + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.Builder + addMessagesBuilder(int index) { + return internalGetMessagesFieldBuilder() + .addBuilder( + index, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message + .getDefaultInstance()); + } + + /** + * + * + *
+     * A list of notices and warnings generated during query execution.
+     * For PostgreSQL, this includes all notices and warnings.
+     * For MySQL, this includes warnings generated by the last executed statement.
+     * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+     * be executed after each statement.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + public java.util.List< + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.Builder> + getMessagesBuilderList() { + return internalGetMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.Builder, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.MessageOrBuilder> + internalGetMessagesFieldBuilder() { + if (messagesBuilder_ == null) { + messagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.Builder, + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.MessageOrBuilder>( + messages_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + messages_ = null; + } + return messagesBuilder_; + } + + private com.google.cloud.sql.v1beta4.Metadata metadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Metadata, + com.google.cloud.sql.v1beta4.Metadata.Builder, + com.google.cloud.sql.v1beta4.MetadataOrBuilder> + metadataBuilder_; + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + * + * @return The metadata. + */ + public com.google.cloud.sql.v1beta4.Metadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? com.google.cloud.sql.v1beta4.Metadata.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + */ + public Builder setMetadata(com.google.cloud.sql.v1beta4.Metadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + */ + public Builder setMetadata(com.google.cloud.sql.v1beta4.Metadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + */ + public Builder mergeMetadata(com.google.cloud.sql.v1beta4.Metadata value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && metadata_ != null + && metadata_ != com.google.cloud.sql.v1beta4.Metadata.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + if (metadata_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000002); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + */ + public com.google.cloud.sql.v1beta4.Metadata.Builder getMetadataBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetMetadataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + */ + public com.google.cloud.sql.v1beta4.MetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? com.google.cloud.sql.v1beta4.Metadata.getDefaultInstance() + : metadata_; + } + } + + /** + * + * + *
+     * The additional metadata information regarding the execution of the SQL
+     * statements.
+     * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Metadata, + com.google.cloud.sql.v1beta4.Metadata.Builder, + com.google.cloud.sql.v1beta4.MetadataOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Metadata, + com.google.cloud.sql.v1beta4.Metadata.Builder, + com.google.cloud.sql.v1beta4.MetadataOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private java.util.List results_ = + java.util.Collections.emptyList(); + + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + results_ = new java.util.ArrayList(results_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.QueryResult, + com.google.cloud.sql.v1beta4.QueryResult.Builder, + com.google.cloud.sql.v1beta4.QueryResultOrBuilder> + resultsBuilder_; + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public java.util.List getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public com.google.cloud.sql.v1beta4.QueryResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public Builder setResults(int index, com.google.cloud.sql.v1beta4.QueryResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public Builder setResults( + int index, com.google.cloud.sql.v1beta4.QueryResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public Builder addResults(com.google.cloud.sql.v1beta4.QueryResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public Builder addResults(int index, com.google.cloud.sql.v1beta4.QueryResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public Builder addResults(com.google.cloud.sql.v1beta4.QueryResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public Builder addResults( + int index, com.google.cloud.sql.v1beta4.QueryResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public Builder addAllResults( + java.lang.Iterable values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public com.google.cloud.sql.v1beta4.QueryResult.Builder getResultsBuilder(int index) { + return internalGetResultsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public com.google.cloud.sql.v1beta4.QueryResultOrBuilder getResultsOrBuilder(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public java.util.List + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public com.google.cloud.sql.v1beta4.QueryResult.Builder addResultsBuilder() { + return internalGetResultsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.QueryResult.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public com.google.cloud.sql.v1beta4.QueryResult.Builder addResultsBuilder(int index) { + return internalGetResultsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.QueryResult.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of results after executing all the SQL statements.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + public java.util.List + getResultsBuilderList() { + return internalGetResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.QueryResult, + com.google.cloud.sql.v1beta4.QueryResult.Builder, + com.google.cloud.sql.v1beta4.QueryResultOrBuilder> + internalGetResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.QueryResult, + com.google.cloud.sql.v1beta4.QueryResult.Builder, + com.google.cloud.sql.v1beta4.QueryResultOrBuilder>( + results_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000008); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
+     * Contains the error from the database if the SQL execution failed.
+     * 
+ * + * .google.rpc.Status status = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse) + private static final com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesExecuteSqlResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExecuteSqlResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExecuteSqlResponseOrBuilder.java new file mode 100644 index 000000000000..b25f5da48a48 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExecuteSqlResponseOrBuilder.java @@ -0,0 +1,245 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesExecuteSqlResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + java.util.List + getMessagesList(); + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message getMessages(int index); + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + int getMessagesCount(); + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + java.util.List< + ? extends com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.MessageOrBuilder> + getMessagesOrBuilderList(); + + /** + * + * + *
+   * A list of notices and warnings generated during query execution.
+   * For PostgreSQL, this includes all notices and warnings.
+   * For MySQL, this includes warnings generated by the last executed statement.
+   * To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
+   * be executed after each statement.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message messages = 9; + * + */ + com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.MessageOrBuilder getMessagesOrBuilder( + int index); + + /** + * + * + *
+   * The additional metadata information regarding the execution of the SQL
+   * statements.
+   * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + + /** + * + * + *
+   * The additional metadata information regarding the execution of the SQL
+   * statements.
+   * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + * + * @return The metadata. + */ + com.google.cloud.sql.v1beta4.Metadata getMetadata(); + + /** + * + * + *
+   * The additional metadata information regarding the execution of the SQL
+   * statements.
+   * 
+ * + * .google.cloud.sql.v1beta4.Metadata metadata = 6; + */ + com.google.cloud.sql.v1beta4.MetadataOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + java.util.List getResultsList(); + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + com.google.cloud.sql.v1beta4.QueryResult getResults(int index); + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + int getResultsCount(); + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + java.util.List + getResultsOrBuilderList(); + + /** + * + * + *
+   * The list of results after executing all the SQL statements.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.QueryResult results = 7; + */ + com.google.cloud.sql.v1beta4.QueryResultOrBuilder getResultsOrBuilder(int index); + + /** + * + * + *
+   * Contains the error from the database if the SQL execution failed.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+   * Contains the error from the database if the SQL execution failed.
+   * 
+ * + * .google.rpc.Status status = 8; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
+   * Contains the error from the database if the SQL execution failed.
+   * 
+ * + * .google.rpc.Status status = 8; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExportRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExportRequest.java new file mode 100644 index 000000000000..3cd7218af6df --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExportRequest.java @@ -0,0 +1,974 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesExportRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesExportRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesExportRequest) + SqlInstancesExportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesExportRequest"); + } + + // Use SqlInstancesExportRequest.newBuilder() to construct. + private SqlInstancesExportRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesExportRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * The Cloud SQL instance ID. This doesn't include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * The Cloud SQL instance ID. This doesn't include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance to be exported.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance to be exported.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.InstancesExportRequest body_; + + /** + * .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesExportRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesExportRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesExportRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesExportRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesExportRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesExportRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExportRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExportRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExportRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExportRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesExportRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesExportRequest) + com.google.cloud.sql.v1beta4.SqlInstancesExportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesExportRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesExportRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExportRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesExportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExportRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExportRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesExportRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesExportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesExportRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesExportRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesExportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesExportRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesExportRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * The Cloud SQL instance ID. This doesn't include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Cloud SQL instance ID. This doesn't include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Cloud SQL instance ID. This doesn't include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud SQL instance ID. This doesn't include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud SQL instance ID. This doesn't include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance to be exported.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be exported.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be exported.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be exported.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be exported.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstancesExportRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesExportRequest, + com.google.cloud.sql.v1beta4.InstancesExportRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesExportRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.InstancesExportRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesExportRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.InstancesExportRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesExportRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.InstancesExportRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1beta4.InstancesExportRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesExportRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesExportRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesExportRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesExportRequest, + com.google.cloud.sql.v1beta4.InstancesExportRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesExportRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesExportRequest, + com.google.cloud.sql.v1beta4.InstancesExportRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesExportRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesExportRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesExportRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesExportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesExportRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesExportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesExportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesExportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExportRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExportRequestOrBuilder.java new file mode 100644 index 000000000000..252a544d4601 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesExportRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesExportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesExportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Cloud SQL instance ID. This doesn't include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * The Cloud SQL instance ID. This doesn't include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance to be exported.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance to be exported.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.InstancesExportRequest getBody(); + + /** .google.cloud.sql.v1beta4.InstancesExportRequest body = 100; */ + com.google.cloud.sql.v1beta4.InstancesExportRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesFailoverRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesFailoverRequest.java new file mode 100644 index 000000000000..8bf3e15b1208 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesFailoverRequest.java @@ -0,0 +1,975 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesFailoverRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesFailoverRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesFailoverRequest) + SqlInstancesFailoverRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesFailoverRequest"); + } + + // Use SqlInstancesFailoverRequest.newBuilder() to construct. + private SqlInstancesFailoverRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesFailoverRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesFailoverRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesFailoverRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.InstancesFailoverRequest body_; + + /** + * .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesFailoverRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesFailoverRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesFailoverRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesFailoverRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesFailoverRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesFailoverRequest) + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesFailoverRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesFailoverRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesFailoverRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstancesFailoverRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesFailoverRequest, + com.google.cloud.sql.v1beta4.InstancesFailoverRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesFailoverRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.InstancesFailoverRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesFailoverRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.InstancesFailoverRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesFailoverRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.InstancesFailoverRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1beta4.InstancesFailoverRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesFailoverRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesFailoverRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesFailoverRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesFailoverRequest, + com.google.cloud.sql.v1beta4.InstancesFailoverRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesFailoverRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesFailoverRequest, + com.google.cloud.sql.v1beta4.InstancesFailoverRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesFailoverRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesFailoverRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesFailoverRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesFailoverRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesFailoverRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesFailoverRequestOrBuilder.java new file mode 100644 index 000000000000..0aaa16c26d86 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesFailoverRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesFailoverRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesFailoverRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.InstancesFailoverRequest getBody(); + + /** .google.cloud.sql.v1beta4.InstancesFailoverRequest body = 100; */ + com.google.cloud.sql.v1beta4.InstancesFailoverRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetDiskShrinkConfigRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetDiskShrinkConfigRequest.java new file mode 100644 index 000000000000..64e2550a1ded --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetDiskShrinkConfigRequest.java @@ -0,0 +1,799 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance get disk shrink config request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesGetDiskShrinkConfigRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest) + SqlInstancesGetDiskShrinkConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesGetDiskShrinkConfigRequest"); + } + + // Use SqlInstancesGetDiskShrinkConfigRequest.newBuilder() to construct. + private SqlInstancesGetDiskShrinkConfigRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesGetDiskShrinkConfigRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance get disk shrink config request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest) + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesGetDiskShrinkConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetDiskShrinkConfigRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetDiskShrinkConfigRequestOrBuilder.java new file mode 100644 index 000000000000..e0f7a13b779b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetDiskShrinkConfigRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesGetDiskShrinkConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetDiskShrinkConfigResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetDiskShrinkConfigResponse.java new file mode 100644 index 000000000000..19b3a8622236 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetDiskShrinkConfigResponse.java @@ -0,0 +1,896 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance get disk shrink config response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse} + */ +@com.google.protobuf.Generated +public final class SqlInstancesGetDiskShrinkConfigResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse) + SqlInstancesGetDiskShrinkConfigResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesGetDiskShrinkConfigResponse"); + } + + // Use SqlInstancesGetDiskShrinkConfigResponse.newBuilder() to construct. + private SqlInstancesGetDiskShrinkConfigResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesGetDiskShrinkConfigResponse() { + kind_ = ""; + message_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse.class, + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#getDiskShrinkConfig`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#getDiskShrinkConfig`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MINIMAL_TARGET_SIZE_GB_FIELD_NUMBER = 2; + private long minimalTargetSizeGb_ = 0L; + + /** + * + * + *
+   * The minimum size to which a disk can be shrunk in GigaBytes.
+   * 
+ * + * int64 minimal_target_size_gb = 2; + * + * @return The minimalTargetSizeGb. + */ + @java.lang.Override + public long getMinimalTargetSizeGb() { + return minimalTargetSizeGb_; + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
+   * Additional message to customers.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + + /** + * + * + *
+   * Additional message to customers.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (minimalTargetSizeGb_ != 0L) { + output.writeInt64(2, minimalTargetSizeGb_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, message_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (minimalTargetSizeGb_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, minimalTargetSizeGb_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, message_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse other = + (com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (getMinimalTargetSizeGb() != other.getMinimalTargetSizeGb()) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + MINIMAL_TARGET_SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMinimalTargetSizeGb()); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance get disk shrink config response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse) + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse.class, + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + minimalTargetSizeGb_ = 0L; + message_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetDiskShrinkConfigResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse build() { + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse result = + new com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.minimalTargetSizeGb_ = minimalTargetSizeGb_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.message_ = message_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse + .getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getMinimalTargetSizeGb() != 0L) { + setMinimalTargetSizeGb(other.getMinimalTargetSizeGb()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + minimalTargetSizeGb_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#getDiskShrinkConfig`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#getDiskShrinkConfig`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#getDiskShrinkConfig`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#getDiskShrinkConfig`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#getDiskShrinkConfig`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long minimalTargetSizeGb_; + + /** + * + * + *
+     * The minimum size to which a disk can be shrunk in GigaBytes.
+     * 
+ * + * int64 minimal_target_size_gb = 2; + * + * @return The minimalTargetSizeGb. + */ + @java.lang.Override + public long getMinimalTargetSizeGb() { + return minimalTargetSizeGb_; + } + + /** + * + * + *
+     * The minimum size to which a disk can be shrunk in GigaBytes.
+     * 
+ * + * int64 minimal_target_size_gb = 2; + * + * @param value The minimalTargetSizeGb to set. + * @return This builder for chaining. + */ + public Builder setMinimalTargetSizeGb(long value) { + + minimalTargetSizeGb_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The minimum size to which a disk can be shrunk in GigaBytes.
+     * 
+ * + * int64 minimal_target_size_gb = 2; + * + * @return This builder for chaining. + */ + public Builder clearMinimalTargetSizeGb() { + bitField0_ = (bitField0_ & ~0x00000002); + minimalTargetSizeGb_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + + /** + * + * + *
+     * Additional message to customers.
+     * 
+ * + * string message = 3; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Additional message to customers.
+     * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Additional message to customers.
+     * 
+ * + * string message = 3; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Additional message to customers.
+     * 
+ * + * string message = 3; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Additional message to customers.
+     * 
+ * + * string message = 3; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse) + private static final com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesGetDiskShrinkConfigResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetDiskShrinkConfigResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetDiskShrinkConfigResponseOrBuilder.java new file mode 100644 index 000000000000..728ab79a432c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetDiskShrinkConfigResponseOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesGetDiskShrinkConfigResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#getDiskShrinkConfig`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#getDiskShrinkConfig`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The minimum size to which a disk can be shrunk in GigaBytes.
+   * 
+ * + * int64 minimal_target_size_gb = 2; + * + * @return The minimalTargetSizeGb. + */ + long getMinimalTargetSizeGb(); + + /** + * + * + *
+   * Additional message to customers.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
+   * Additional message to customers.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetLatestRecoveryTimeRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetLatestRecoveryTimeRequest.java new file mode 100644 index 000000000000..3c79235b4136 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetLatestRecoveryTimeRequest.java @@ -0,0 +1,1111 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance get latest recovery time request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesGetLatestRecoveryTimeRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest) + SqlInstancesGetLatestRecoveryTimeRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesGetLatestRecoveryTimeRequest"); + } + + // Use SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() to construct. + private SqlInstancesGetLatestRecoveryTimeRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesGetLatestRecoveryTimeRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_INSTANCE_DELETION_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp sourceInstanceDeletionTime_; + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + * + * @return Whether the sourceInstanceDeletionTime field is set. + */ + @java.lang.Override + public boolean hasSourceInstanceDeletionTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + * + * @return The sourceInstanceDeletionTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSourceInstanceDeletionTime() { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSourceInstanceDeletionTimeOrBuilder() { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getSourceInstanceDeletionTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, getSourceInstanceDeletionTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasSourceInstanceDeletionTime() != other.hasSourceInstanceDeletionTime()) return false; + if (hasSourceInstanceDeletionTime()) { + if (!getSourceInstanceDeletionTime().equals(other.getSourceInstanceDeletionTime())) + return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasSourceInstanceDeletionTime()) { + hash = (37 * hash) + SOURCE_INSTANCE_DELETION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSourceInstanceDeletionTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance get latest recovery time request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest) + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSourceInstanceDeletionTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + sourceInstanceDeletionTime_ = null; + if (sourceInstanceDeletionTimeBuilder_ != null) { + sourceInstanceDeletionTimeBuilder_.dispose(); + sourceInstanceDeletionTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sourceInstanceDeletionTime_ = + sourceInstanceDeletionTimeBuilder_ == null + ? sourceInstanceDeletionTime_ + : sourceInstanceDeletionTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasSourceInstanceDeletionTime()) { + mergeSourceInstanceDeletionTime(other.getSourceInstanceDeletionTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetSourceInstanceDeletionTimeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp sourceInstanceDeletionTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + sourceInstanceDeletionTimeBuilder_; + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + * + * @return Whether the sourceInstanceDeletionTime field is set. + */ + public boolean hasSourceInstanceDeletionTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + * + * @return The sourceInstanceDeletionTime. + */ + public com.google.protobuf.Timestamp getSourceInstanceDeletionTime() { + if (sourceInstanceDeletionTimeBuilder_ == null) { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } else { + return sourceInstanceDeletionTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + public Builder setSourceInstanceDeletionTime(com.google.protobuf.Timestamp value) { + if (sourceInstanceDeletionTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceInstanceDeletionTime_ = value; + } else { + sourceInstanceDeletionTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + public Builder setSourceInstanceDeletionTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (sourceInstanceDeletionTimeBuilder_ == null) { + sourceInstanceDeletionTime_ = builderForValue.build(); + } else { + sourceInstanceDeletionTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + public Builder mergeSourceInstanceDeletionTime(com.google.protobuf.Timestamp value) { + if (sourceInstanceDeletionTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && sourceInstanceDeletionTime_ != null + && sourceInstanceDeletionTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getSourceInstanceDeletionTimeBuilder().mergeFrom(value); + } else { + sourceInstanceDeletionTime_ = value; + } + } else { + sourceInstanceDeletionTimeBuilder_.mergeFrom(value); + } + if (sourceInstanceDeletionTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + public Builder clearSourceInstanceDeletionTime() { + bitField0_ = (bitField0_ & ~0x00000004); + sourceInstanceDeletionTime_ = null; + if (sourceInstanceDeletionTimeBuilder_ != null) { + sourceInstanceDeletionTimeBuilder_.dispose(); + sourceInstanceDeletionTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getSourceInstanceDeletionTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetSourceInstanceDeletionTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getSourceInstanceDeletionTimeOrBuilder() { + if (sourceInstanceDeletionTimeBuilder_ != null) { + return sourceInstanceDeletionTimeBuilder_.getMessageOrBuilder(); + } else { + return sourceInstanceDeletionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : sourceInstanceDeletionTime_; + } + } + + /** + * + * + *
+     * The timestamp used to identify the time when the source instance is
+     * deleted. If this instance is deleted, then you must set the timestamp.
+     * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetSourceInstanceDeletionTimeFieldBuilder() { + if (sourceInstanceDeletionTimeBuilder_ == null) { + sourceInstanceDeletionTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSourceInstanceDeletionTime(), getParentForChildren(), isClean()); + sourceInstanceDeletionTime_ = null; + } + return sourceInstanceDeletionTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesGetLatestRecoveryTimeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetLatestRecoveryTimeRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetLatestRecoveryTimeRequestOrBuilder.java new file mode 100644 index 000000000000..5c0ef987817f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetLatestRecoveryTimeRequestOrBuilder.java @@ -0,0 +1,120 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesGetLatestRecoveryTimeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + * + * @return Whether the sourceInstanceDeletionTime field is set. + */ + boolean hasSourceInstanceDeletionTime(); + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + * + * @return The sourceInstanceDeletionTime. + */ + com.google.protobuf.Timestamp getSourceInstanceDeletionTime(); + + /** + * + * + *
+   * The timestamp used to identify the time when the source instance is
+   * deleted. If this instance is deleted, then you must set the timestamp.
+   * 
+ * + * optional .google.protobuf.Timestamp source_instance_deletion_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getSourceInstanceDeletionTimeOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetLatestRecoveryTimeResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetLatestRecoveryTimeResponse.java new file mode 100644 index 000000000000..636958ebd345 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetLatestRecoveryTimeResponse.java @@ -0,0 +1,1193 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance get latest recovery time response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse} + */ +@com.google.protobuf.Generated +public final class SqlInstancesGetLatestRecoveryTimeResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse) + SqlInstancesGetLatestRecoveryTimeResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesGetLatestRecoveryTimeResponse"); + } + + // Use SqlInstancesGetLatestRecoveryTimeResponse.newBuilder() to construct. + private SqlInstancesGetLatestRecoveryTimeResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesGetLatestRecoveryTimeResponse() { + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse.class, + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#getLatestRecoveryTime`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#getLatestRecoveryTime`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LATEST_RECOVERY_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp latestRecoveryTime_; + + /** + * + * + *
+   * Timestamp, identifies the latest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + * + * @return Whether the latestRecoveryTime field is set. + */ + @java.lang.Override + public boolean hasLatestRecoveryTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Timestamp, identifies the latest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + * + * @return The latestRecoveryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getLatestRecoveryTime() { + return latestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestRecoveryTime_; + } + + /** + * + * + *
+   * Timestamp, identifies the latest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getLatestRecoveryTimeOrBuilder() { + return latestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestRecoveryTime_; + } + + public static final int EARLIEST_RECOVERY_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp earliestRecoveryTime_; + + /** + * + * + *
+   * Timestamp, identifies the earliest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + * + * @return Whether the earliestRecoveryTime field is set. + */ + @java.lang.Override + public boolean hasEarliestRecoveryTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Timestamp, identifies the earliest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + * + * @return The earliestRecoveryTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEarliestRecoveryTime() { + return earliestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRecoveryTime_; + } + + /** + * + * + *
+   * Timestamp, identifies the earliest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEarliestRecoveryTimeOrBuilder() { + return earliestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRecoveryTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getLatestRecoveryTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getEarliestRecoveryTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getLatestRecoveryTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEarliestRecoveryTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse other = + (com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (hasLatestRecoveryTime() != other.hasLatestRecoveryTime()) return false; + if (hasLatestRecoveryTime()) { + if (!getLatestRecoveryTime().equals(other.getLatestRecoveryTime())) return false; + } + if (hasEarliestRecoveryTime() != other.hasEarliestRecoveryTime()) return false; + if (hasEarliestRecoveryTime()) { + if (!getEarliestRecoveryTime().equals(other.getEarliestRecoveryTime())) return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasLatestRecoveryTime()) { + hash = (37 * hash) + LATEST_RECOVERY_TIME_FIELD_NUMBER; + hash = (53 * hash) + getLatestRecoveryTime().hashCode(); + } + if (hasEarliestRecoveryTime()) { + hash = (37 * hash) + EARLIEST_RECOVERY_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEarliestRecoveryTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance get latest recovery time response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse) + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse.class, + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetLatestRecoveryTimeFieldBuilder(); + internalGetEarliestRecoveryTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + latestRecoveryTime_ = null; + if (latestRecoveryTimeBuilder_ != null) { + latestRecoveryTimeBuilder_.dispose(); + latestRecoveryTimeBuilder_ = null; + } + earliestRecoveryTime_ = null; + if (earliestRecoveryTimeBuilder_ != null) { + earliestRecoveryTimeBuilder_.dispose(); + earliestRecoveryTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetLatestRecoveryTimeResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse build() { + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse result = + new com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.latestRecoveryTime_ = + latestRecoveryTimeBuilder_ == null + ? latestRecoveryTime_ + : latestRecoveryTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.earliestRecoveryTime_ = + earliestRecoveryTimeBuilder_ == null + ? earliestRecoveryTime_ + : earliestRecoveryTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse + .getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasLatestRecoveryTime()) { + mergeLatestRecoveryTime(other.getLatestRecoveryTime()); + } + if (other.hasEarliestRecoveryTime()) { + mergeEarliestRecoveryTime(other.getEarliestRecoveryTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetLatestRecoveryTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetEarliestRecoveryTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#getLatestRecoveryTime`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#getLatestRecoveryTime`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#getLatestRecoveryTime`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#getLatestRecoveryTime`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#getLatestRecoveryTime`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp latestRecoveryTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + latestRecoveryTimeBuilder_; + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + * + * @return Whether the latestRecoveryTime field is set. + */ + public boolean hasLatestRecoveryTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + * + * @return The latestRecoveryTime. + */ + public com.google.protobuf.Timestamp getLatestRecoveryTime() { + if (latestRecoveryTimeBuilder_ == null) { + return latestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestRecoveryTime_; + } else { + return latestRecoveryTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + public Builder setLatestRecoveryTime(com.google.protobuf.Timestamp value) { + if (latestRecoveryTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + latestRecoveryTime_ = value; + } else { + latestRecoveryTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + public Builder setLatestRecoveryTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (latestRecoveryTimeBuilder_ == null) { + latestRecoveryTime_ = builderForValue.build(); + } else { + latestRecoveryTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + public Builder mergeLatestRecoveryTime(com.google.protobuf.Timestamp value) { + if (latestRecoveryTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && latestRecoveryTime_ != null + && latestRecoveryTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getLatestRecoveryTimeBuilder().mergeFrom(value); + } else { + latestRecoveryTime_ = value; + } + } else { + latestRecoveryTimeBuilder_.mergeFrom(value); + } + if (latestRecoveryTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + public Builder clearLatestRecoveryTime() { + bitField0_ = (bitField0_ & ~0x00000002); + latestRecoveryTime_ = null; + if (latestRecoveryTimeBuilder_ != null) { + latestRecoveryTimeBuilder_.dispose(); + latestRecoveryTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getLatestRecoveryTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetLatestRecoveryTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getLatestRecoveryTimeOrBuilder() { + if (latestRecoveryTimeBuilder_ != null) { + return latestRecoveryTimeBuilder_.getMessageOrBuilder(); + } else { + return latestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestRecoveryTime_; + } + } + + /** + * + * + *
+     * Timestamp, identifies the latest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetLatestRecoveryTimeFieldBuilder() { + if (latestRecoveryTimeBuilder_ == null) { + latestRecoveryTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getLatestRecoveryTime(), getParentForChildren(), isClean()); + latestRecoveryTime_ = null; + } + return latestRecoveryTimeBuilder_; + } + + private com.google.protobuf.Timestamp earliestRecoveryTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + earliestRecoveryTimeBuilder_; + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + * + * @return Whether the earliestRecoveryTime field is set. + */ + public boolean hasEarliestRecoveryTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + * + * @return The earliestRecoveryTime. + */ + public com.google.protobuf.Timestamp getEarliestRecoveryTime() { + if (earliestRecoveryTimeBuilder_ == null) { + return earliestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRecoveryTime_; + } else { + return earliestRecoveryTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + public Builder setEarliestRecoveryTime(com.google.protobuf.Timestamp value) { + if (earliestRecoveryTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + earliestRecoveryTime_ = value; + } else { + earliestRecoveryTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + public Builder setEarliestRecoveryTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (earliestRecoveryTimeBuilder_ == null) { + earliestRecoveryTime_ = builderForValue.build(); + } else { + earliestRecoveryTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + public Builder mergeEarliestRecoveryTime(com.google.protobuf.Timestamp value) { + if (earliestRecoveryTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && earliestRecoveryTime_ != null + && earliestRecoveryTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEarliestRecoveryTimeBuilder().mergeFrom(value); + } else { + earliestRecoveryTime_ = value; + } + } else { + earliestRecoveryTimeBuilder_.mergeFrom(value); + } + if (earliestRecoveryTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + public Builder clearEarliestRecoveryTime() { + bitField0_ = (bitField0_ & ~0x00000004); + earliestRecoveryTime_ = null; + if (earliestRecoveryTimeBuilder_ != null) { + earliestRecoveryTimeBuilder_.dispose(); + earliestRecoveryTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEarliestRecoveryTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEarliestRecoveryTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEarliestRecoveryTimeOrBuilder() { + if (earliestRecoveryTimeBuilder_ != null) { + return earliestRecoveryTimeBuilder_.getMessageOrBuilder(); + } else { + return earliestRecoveryTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRecoveryTime_; + } + } + + /** + * + * + *
+     * Timestamp, identifies the earliest recovery time of the source instance.
+     * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEarliestRecoveryTimeFieldBuilder() { + if (earliestRecoveryTimeBuilder_ == null) { + earliestRecoveryTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEarliestRecoveryTime(), getParentForChildren(), isClean()); + earliestRecoveryTime_ = null; + } + return earliestRecoveryTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse) + private static final com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesGetLatestRecoveryTimeResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetLatestRecoveryTimeResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetLatestRecoveryTimeResponseOrBuilder.java new file mode 100644 index 000000000000..78f81dd54bec --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetLatestRecoveryTimeResponseOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesGetLatestRecoveryTimeResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#getLatestRecoveryTime`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#getLatestRecoveryTime`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Timestamp, identifies the latest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + * + * @return Whether the latestRecoveryTime field is set. + */ + boolean hasLatestRecoveryTime(); + + /** + * + * + *
+   * Timestamp, identifies the latest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + * + * @return The latestRecoveryTime. + */ + com.google.protobuf.Timestamp getLatestRecoveryTime(); + + /** + * + * + *
+   * Timestamp, identifies the latest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp latest_recovery_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getLatestRecoveryTimeOrBuilder(); + + /** + * + * + *
+   * Timestamp, identifies the earliest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + * + * @return Whether the earliestRecoveryTime field is set. + */ + boolean hasEarliestRecoveryTime(); + + /** + * + * + *
+   * Timestamp, identifies the earliest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + * + * @return The earliestRecoveryTime. + */ + com.google.protobuf.Timestamp getEarliestRecoveryTime(); + + /** + * + * + *
+   * Timestamp, identifies the earliest recovery time of the source instance.
+   * 
+ * + * .google.protobuf.Timestamp earliest_recovery_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEarliestRecoveryTimeOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetRequest.java new file mode 100644 index 000000000000..eaaa74580f4a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetRequest.java @@ -0,0 +1,769 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesGetRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesGetRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesGetRequest) + SqlInstancesGetRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesGetRequest"); + } + + // Use SqlInstancesGetRequest.newBuilder() to construct. + private SqlInstancesGetRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesGetRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesGetRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesGetRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlInstancesGetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesGetRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesGetRequest) + com.google.cloud.sql.v1beta4.SqlInstancesGetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesGetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesGetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesGetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesGetRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesGetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesGetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesGetRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesGetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesGetRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesGetRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesGetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesGetRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesGetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesGetRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesGetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesGetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesGetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetRequestOrBuilder.java new file mode 100644 index 000000000000..127b36d7f430 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesGetRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesGetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesGetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesImportRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesImportRequest.java new file mode 100644 index 000000000000..8cce642172c3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesImportRequest.java @@ -0,0 +1,974 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesImportRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesImportRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesImportRequest) + SqlInstancesImportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesImportRequest"); + } + + // Use SqlInstancesImportRequest.newBuilder() to construct. + private SqlInstancesImportRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesImportRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesImportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesImportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.InstancesImportRequest body_; + + /** + * .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesImportRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesImportRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesImportRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesImportRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesImportRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesImportRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesImportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesImportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesImportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesImportRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesImportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesImportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesImportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesImportRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesImportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesImportRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesImportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesImportRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesImportRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesImportRequest) + com.google.cloud.sql.v1beta4.SqlInstancesImportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesImportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesImportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesImportRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesImportRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesImportRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesImportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesImportRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesImportRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesImportRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesImportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesImportRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesImportRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesImportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesImportRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesImportRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstancesImportRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesImportRequest, + com.google.cloud.sql.v1beta4.InstancesImportRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesImportRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.InstancesImportRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesImportRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.InstancesImportRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesImportRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.InstancesImportRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1beta4.InstancesImportRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesImportRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesImportRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesImportRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesImportRequest, + com.google.cloud.sql.v1beta4.InstancesImportRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesImportRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesImportRequest, + com.google.cloud.sql.v1beta4.InstancesImportRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesImportRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesImportRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesImportRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesImportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesImportRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesImportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesImportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesImportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesImportRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesImportRequestOrBuilder.java new file mode 100644 index 000000000000..f5615b03c2c4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesImportRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesImportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesImportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.InstancesImportRequest getBody(); + + /** .google.cloud.sql.v1beta4.InstancesImportRequest body = 100; */ + com.google.cloud.sql.v1beta4.InstancesImportRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesInsertRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesInsertRequest.java new file mode 100644 index 000000000000..b94e4c155b4e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesInsertRequest.java @@ -0,0 +1,791 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesInsertRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesInsertRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesInsertRequest) + SqlInstancesInsertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesInsertRequest"); + } + + // Use SqlInstancesInsertRequest.newBuilder() to construct. + private SqlInstancesInsertRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesInsertRequest() { + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest.Builder.class); + } + + private int bitField0_; + public static final int PROJECT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project to which the newly created Cloud SQL instances
+   * should belong.
+   * 
+ * + * string project = 1; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project to which the newly created Cloud SQL instances
+   * should belong.
+   * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.DatabaseInstance body_; + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest) obj; + + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesInsertRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesInsertRequest) + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesInsertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest.getDefaultInstance()) + return this; + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 project_ = ""; + + /** + * + * + *
+     * Project ID of the project to which the newly created Cloud SQL instances
+     * should belong.
+     * 
+ * + * string project = 1; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project to which the newly created Cloud SQL instances
+     * should belong.
+     * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project to which the newly created Cloud SQL instances
+     * should belong.
+     * 
+ * + * string project = 1; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project to which the newly created Cloud SQL instances
+     * should belong.
+     * 
+ * + * string project = 1; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project to which the newly created Cloud SQL instances
+     * should belong.
+     * 
+ * + * string project = 1; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.DatabaseInstance body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.DatabaseInstance.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000002); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.Builder getBodyBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesInsertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesInsertRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesInsertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesInsertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesInsertRequestOrBuilder.java new file mode 100644 index 000000000000..c971f0af5d61 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesInsertRequestOrBuilder.java @@ -0,0 +1,73 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesInsertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesInsertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Project ID of the project to which the newly created Cloud SQL instances
+   * should belong.
+   * 
+ * + * string project = 1; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project to which the newly created Cloud SQL instances
+   * should belong.
+   * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.DatabaseInstance getBody(); + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListEntraIdCertificatesRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListEntraIdCertificatesRequest.java new file mode 100644 index 000000000000..5b47e8f1463f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListEntraIdCertificatesRequest.java @@ -0,0 +1,805 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Request message for SqlInstancesService.ListEntraIdCertificates.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesListEntraIdCertificatesRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest) + SqlInstancesListEntraIdCertificatesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesListEntraIdCertificatesRequest"); + } + + // Use SqlInstancesListEntraIdCertificatesRequest.newBuilder() to construct. + private SqlInstancesListEntraIdCertificatesRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesListEntraIdCertificatesRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListEntraIdCertificatesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListEntraIdCertificatesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for SqlInstancesService.ListEntraIdCertificates.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest) + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListEntraIdCertificatesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListEntraIdCertificatesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListEntraIdCertificatesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesListEntraIdCertificatesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListEntraIdCertificatesRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListEntraIdCertificatesRequestOrBuilder.java new file mode 100644 index 000000000000..039009750588 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListEntraIdCertificatesRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesListEntraIdCertificatesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListRequest.java new file mode 100644 index 000000000000..dad49a290291 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListRequest.java @@ -0,0 +1,1130 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesListRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesListRequest) + SqlInstancesListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesListRequest"); + } + + // Use SqlInstancesListRequest.newBuilder() to construct. + private SqlInstancesListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesListRequest() { + filter_ = ""; + pageToken_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesListRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesListRequest.Builder.class); + } + + public static final int FILTER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * A filter expression that filters resources listed in the response.
+   * The expression is in the form of field:value. For example,
+   * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+   * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+   *
+   * Multiple filter queries are space-separated. For example.
+   * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+   * expression is an AND expression. However, you can include AND and OR
+   * expressions explicitly.
+   * 
+ * + * string filter = 1; + * + * @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; + } + } + + /** + * + * + *
+   * A filter expression that filters resources listed in the response.
+   * The expression is in the form of field:value. For example,
+   * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+   * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+   *
+   * Multiple filter queries are space-separated. For example.
+   * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+   * expression is an AND expression. However, you can include AND and OR
+   * expressions explicitly.
+   * 
+ * + * string filter = 1; + * + * @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 MAX_RESULTS_FIELD_NUMBER = 2; + private int maxResults_ = 0; + + /** + * + * + *
+   * The maximum number of instances to return. The service may return fewer
+   * than this value.
+   * If unspecified, at most 500 instances are returned.
+   * The maximum value is 1000; values above 1000 are coerced to 1000.
+   * 
+ * + * uint32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project for which to list Cloud SQL instances.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project for which to list Cloud SQL instances.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, filter_); + } + if (maxResults_ != 0) { + output.writeUInt32(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, filter_); + } + if (maxResults_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesListRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesListRequest) obj; + + if (!getFilter().equals(other.getFilter())) return false; + if (getMaxResults() != other.getMaxResults()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + MAX_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getMaxResults(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlInstancesListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesListRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesListRequest) + com.google.cloud.sql.v1beta4.SqlInstancesListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesListRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + filter_ = ""; + maxResults_ = 0; + pageToken_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesListRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxResults_ = maxResults_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesListRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesListRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesListRequest.getDefaultInstance()) + return this; + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getMaxResults() != 0) { + setMaxResults(other.getMaxResults()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + maxResults_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + project_ = 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 filter_ = ""; + + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * The expression is in the form of field:value. For example,
+     * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+     * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+     *
+     * Multiple filter queries are space-separated. For example.
+     * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+     * expression is an AND expression. However, you can include AND and OR
+     * expressions explicitly.
+     * 
+ * + * string filter = 1; + * + * @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; + } + } + + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * The expression is in the form of field:value. For example,
+     * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+     * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+     *
+     * Multiple filter queries are space-separated. For example.
+     * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+     * expression is an AND expression. However, you can include AND and OR
+     * expressions explicitly.
+     * 
+ * + * string filter = 1; + * + * @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; + } + } + + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * The expression is in the form of field:value. For example,
+     * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+     * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+     *
+     * Multiple filter queries are space-separated. For example.
+     * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+     * expression is an AND expression. However, you can include AND and OR
+     * expressions explicitly.
+     * 
+ * + * string filter = 1; + * + * @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_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * The expression is in the form of field:value. For example,
+     * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+     * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+     *
+     * Multiple filter queries are space-separated. For example.
+     * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+     * expression is an AND expression. However, you can include AND and OR
+     * expressions explicitly.
+     * 
+ * + * string filter = 1; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * The expression is in the form of field:value. For example,
+     * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+     * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+     *
+     * Multiple filter queries are space-separated. For example.
+     * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+     * expression is an AND expression. However, you can include AND and OR
+     * expressions explicitly.
+     * 
+ * + * string filter = 1; + * + * @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_ |= 0x00000001; + onChanged(); + return this; + } + + private int maxResults_; + + /** + * + * + *
+     * The maximum number of instances to return. The service may return fewer
+     * than this value.
+     * If unspecified, at most 500 instances are returned.
+     * The maximum value is 1000; values above 1000 are coerced to 1000.
+     * 
+ * + * uint32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + /** + * + * + *
+     * The maximum number of instances to return. The service may return fewer
+     * than this value.
+     * If unspecified, at most 500 instances are returned.
+     * The maximum value is 1000; values above 1000 are coerced to 1000.
+     * 
+ * + * uint32 max_results = 2; + * + * @param value The maxResults to set. + * @return This builder for chaining. + */ + public Builder setMaxResults(int value) { + + maxResults_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum number of instances to return. The service may return fewer
+     * than this value.
+     * If unspecified, at most 500 instances are returned.
+     * The maximum value is 1000; values above 1000 are coerced to 1000.
+     * 
+ * + * uint32 max_results = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxResults() { + bitField0_ = (bitField0_ & ~0x00000002); + maxResults_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project for which to list Cloud SQL instances.
+     * 
+ * + * string project = 4; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project for which to list Cloud SQL instances.
+     * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project for which to list Cloud SQL instances.
+     * 
+ * + * string project = 4; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project for which to list Cloud SQL instances.
+     * 
+ * + * string project = 4; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project for which to list Cloud SQL instances.
+     * 
+ * + * string project = 4; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesListRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesListRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListRequestOrBuilder.java new file mode 100644 index 000000000000..a0822f8a8915 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListRequestOrBuilder.java @@ -0,0 +1,140 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A filter expression that filters resources listed in the response.
+   * The expression is in the form of field:value. For example,
+   * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+   * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+   *
+   * Multiple filter queries are space-separated. For example.
+   * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+   * expression is an AND expression. However, you can include AND and OR
+   * expressions explicitly.
+   * 
+ * + * string filter = 1; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * A filter expression that filters resources listed in the response.
+   * The expression is in the form of field:value. For example,
+   * 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
+   * their JSON representation, such as 'settings.userLabels.auto_start:true'.
+   *
+   * Multiple filter queries are space-separated. For example.
+   * 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
+   * expression is an AND expression. However, you can include AND and OR
+   * expressions explicitly.
+   * 
+ * + * string filter = 1; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The maximum number of instances to return. The service may return fewer
+   * than this value.
+   * If unspecified, at most 500 instances are returned.
+   * The maximum value is 1000; values above 1000 are coerced to 1000.
+   * 
+ * + * uint32 max_results = 2; + * + * @return The maxResults. + */ + int getMaxResults(); + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Project ID of the project for which to list Cloud SQL instances.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project for which to list Cloud SQL instances.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListServerCasRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListServerCasRequest.java new file mode 100644 index 000000000000..7ee40af775c2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListServerCasRequest.java @@ -0,0 +1,775 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesListServerCasRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest) + SqlInstancesListServerCasRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesListServerCasRequest"); + } + + // Use SqlInstancesListServerCasRequest.newBuilder() to construct. + private SqlInstancesListServerCasRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesListServerCasRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCasRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCasRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest) + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCasRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCasRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCasRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesListServerCasRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListServerCasRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListServerCasRequestOrBuilder.java new file mode 100644 index 000000000000..5d19fce1e257 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListServerCasRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesListServerCasRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListServerCertificatesRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListServerCertificatesRequest.java new file mode 100644 index 000000000000..6f417ebb342f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListServerCertificatesRequest.java @@ -0,0 +1,786 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesListServerCertificatesRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest) + SqlInstancesListServerCertificatesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesListServerCertificatesRequest"); + } + + // Use SqlInstancesListServerCertificatesRequest.newBuilder() to construct. + private SqlInstancesListServerCertificatesRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesListServerCertificatesRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCertificatesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCertificatesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest) + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCertificatesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCertificatesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesListServerCertificatesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesListServerCertificatesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListServerCertificatesRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListServerCertificatesRequestOrBuilder.java new file mode 100644 index 000000000000..bbe1e249d35b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesListServerCertificatesRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesListServerCertificatesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPatchRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPatchRequest.java new file mode 100644 index 000000000000..c0ccdd5fe0c2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPatchRequest.java @@ -0,0 +1,1275 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesPatchRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesPatchRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesPatchRequest) + SqlInstancesPatchRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesPatchRequest"); + } + + // Use SqlInstancesPatchRequest.newBuilder() to construct. + private SqlInstancesPatchRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesPatchRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPatchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPatchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECONCILE_PSC_NETWORKING_FIELD_NUMBER = 4; + private boolean reconcilePscNetworking_ = false; + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config to
+   * reconcile the PSC networking.
+   * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reconcilePscNetworking field is set. + */ + @java.lang.Override + public boolean hasReconcilePscNetworking() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config to
+   * reconcile the PSC networking.
+   * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reconcilePscNetworking. + */ + @java.lang.Override + public boolean getReconcilePscNetworking() { + return reconcilePscNetworking_; + } + + public static final int RECONCILE_PSC_NETWORKING_FORCE_FIELD_NUMBER = 5; + private boolean reconcilePscNetworkingForce_ = false; + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config and force
+   * reconcile the PSC networking.
+   * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reconcilePscNetworkingForce field is set. + */ + @java.lang.Override + public boolean hasReconcilePscNetworkingForce() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config and force
+   * reconcile the PSC networking.
+   * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reconcilePscNetworkingForce. + */ + @java.lang.Override + public boolean getReconcilePscNetworkingForce() { + return reconcilePscNetworkingForce_; + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.DatabaseInstance body_; + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(4, reconcilePscNetworking_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(5, reconcilePscNetworkingForce_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, reconcilePscNetworking_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(5, reconcilePscNetworkingForce_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasReconcilePscNetworking() != other.hasReconcilePscNetworking()) return false; + if (hasReconcilePscNetworking()) { + if (getReconcilePscNetworking() != other.getReconcilePscNetworking()) return false; + } + if (hasReconcilePscNetworkingForce() != other.hasReconcilePscNetworkingForce()) return false; + if (hasReconcilePscNetworkingForce()) { + if (getReconcilePscNetworkingForce() != other.getReconcilePscNetworkingForce()) return false; + } + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasReconcilePscNetworking()) { + hash = (37 * hash) + RECONCILE_PSC_NETWORKING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconcilePscNetworking()); + } + if (hasReconcilePscNetworkingForce()) { + hash = (37 * hash) + RECONCILE_PSC_NETWORKING_FORCE_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconcilePscNetworkingForce()); + } + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesPatchRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesPatchRequest) + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPatchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPatchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + reconcilePscNetworking_ = false; + reconcilePscNetworkingForce_ = false; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPatchRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.reconcilePscNetworking_ = reconcilePscNetworking_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.reconcilePscNetworkingForce_ = reconcilePscNetworkingForce_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasReconcilePscNetworking()) { + setReconcilePscNetworking(other.getReconcilePscNetworking()); + } + if (other.hasReconcilePscNetworkingForce()) { + setReconcilePscNetworkingForce(other.getReconcilePscNetworkingForce()); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 32: + { + reconcilePscNetworking_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 40: + { + reconcilePscNetworkingForce_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 40 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean reconcilePscNetworking_; + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config to
+     * reconcile the PSC networking.
+     * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reconcilePscNetworking field is set. + */ + @java.lang.Override + public boolean hasReconcilePscNetworking() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config to
+     * reconcile the PSC networking.
+     * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reconcilePscNetworking. + */ + @java.lang.Override + public boolean getReconcilePscNetworking() { + return reconcilePscNetworking_; + } + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config to
+     * reconcile the PSC networking.
+     * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The reconcilePscNetworking to set. + * @return This builder for chaining. + */ + public Builder setReconcilePscNetworking(boolean value) { + + reconcilePscNetworking_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config to
+     * reconcile the PSC networking.
+     * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearReconcilePscNetworking() { + bitField0_ = (bitField0_ & ~0x00000004); + reconcilePscNetworking_ = false; + onChanged(); + return this; + } + + private boolean reconcilePscNetworkingForce_; + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config and force
+     * reconcile the PSC networking.
+     * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reconcilePscNetworkingForce field is set. + */ + @java.lang.Override + public boolean hasReconcilePscNetworkingForce() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config and force
+     * reconcile the PSC networking.
+     * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reconcilePscNetworkingForce. + */ + @java.lang.Override + public boolean getReconcilePscNetworkingForce() { + return reconcilePscNetworkingForce_; + } + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config and force
+     * reconcile the PSC networking.
+     * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The reconcilePscNetworkingForce to set. + * @return This builder for chaining. + */ + public Builder setReconcilePscNetworkingForce(boolean value) { + + reconcilePscNetworkingForce_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Set PSC config to the same value as the existing config and force
+     * reconcile the PSC networking.
+     * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearReconcilePscNetworkingForce() { + bitField0_ = (bitField0_ & ~0x00000008); + reconcilePscNetworkingForce_ = false; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.DatabaseInstance body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.DatabaseInstance.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000010); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.Builder getBodyBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesPatchRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesPatchRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesPatchRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPatchRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPatchRequestOrBuilder.java new file mode 100644 index 000000000000..c96db121f1fc --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPatchRequestOrBuilder.java @@ -0,0 +1,159 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesPatchRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesPatchRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config to
+   * reconcile the PSC networking.
+   * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reconcilePscNetworking field is set. + */ + boolean hasReconcilePscNetworking(); + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config to
+   * reconcile the PSC networking.
+   * 
+ * + * optional bool reconcile_psc_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reconcilePscNetworking. + */ + boolean getReconcilePscNetworking(); + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config and force
+   * reconcile the PSC networking.
+   * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reconcilePscNetworkingForce field is set. + */ + boolean hasReconcilePscNetworkingForce(); + + /** + * + * + *
+   * Optional. Set PSC config to the same value as the existing config and force
+   * reconcile the PSC networking.
+   * 
+ * + * + * optional bool reconcile_psc_networking_force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reconcilePscNetworkingForce. + */ + boolean getReconcilePscNetworkingForce(); + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.DatabaseInstance getBody(); + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPerformDiskShrinkRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPerformDiskShrinkRequest.java new file mode 100644 index 000000000000..801789a65a23 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPerformDiskShrinkRequest.java @@ -0,0 +1,1089 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance perform disk shrink request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesPerformDiskShrinkRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest) + SqlInstancesPerformDiskShrinkRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesPerformDiskShrinkRequest"); + } + + // Use SqlInstancesPerformDiskShrinkRequest.newBuilder() to construct. + private SqlInstancesPerformDiskShrinkRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesPerformDiskShrinkRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPerformDiskShrinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPerformDiskShrinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.PerformDiskShrinkContext body_; + + /** + * + * + *
+   * Perform disk shrink context.
+   * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Perform disk shrink context.
+   * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PerformDiskShrinkContext getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * Perform disk shrink context.
+   * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PerformDiskShrinkContextOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance perform disk shrink request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest) + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPerformDiskShrinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPerformDiskShrinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPerformDiskShrinkRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.PerformDiskShrinkContext body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext, + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.Builder, + com.google.cloud.sql.v1beta4.PerformDiskShrinkContextOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.PerformDiskShrinkContext getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + */ + public Builder setBody(com.google.cloud.sql.v1beta4.PerformDiskShrinkContext value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + */ + public Builder setBody( + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.PerformDiskShrinkContext value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + */ + public com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + */ + public com.google.cloud.sql.v1beta4.PerformDiskShrinkContextOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * Perform disk shrink context.
+     * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext, + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.Builder, + com.google.cloud.sql.v1beta4.PerformDiskShrinkContextOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext, + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext.Builder, + com.google.cloud.sql.v1beta4.PerformDiskShrinkContextOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesPerformDiskShrinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPerformDiskShrinkRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPerformDiskShrinkRequestOrBuilder.java new file mode 100644 index 000000000000..a764ca71a34c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPerformDiskShrinkRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesPerformDiskShrinkRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Perform disk shrink context.
+   * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * Perform disk shrink context.
+   * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.PerformDiskShrinkContext getBody(); + + /** + * + * + *
+   * Perform disk shrink context.
+   * 
+ * + * .google.cloud.sql.v1beta4.PerformDiskShrinkContext body = 100; + */ + com.google.cloud.sql.v1beta4.PerformDiskShrinkContextOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPointInTimeRestoreRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPointInTimeRestoreRequest.java new file mode 100644 index 000000000000..66d98e54a182 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPointInTimeRestoreRequest.java @@ -0,0 +1,948 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Request to perform a point in time restore on a Google Cloud Backup and
+ * Disaster Recovery managed instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesPointInTimeRestoreRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest) + SqlInstancesPointInTimeRestoreRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesPointInTimeRestoreRequest"); + } + + // Use SqlInstancesPointInTimeRestoreRequest.newBuilder() to construct. + private SqlInstancesPointInTimeRestoreRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesPointInTimeRestoreRequest() { + parent_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPointInTimeRestoreRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPointInTimeRestoreRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest.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 you created this instance.
+   * Format: projects/{project}
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 you created this instance.
+   * Format: projects/{project}
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 CONTEXT_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.PointInTimeRestoreContext context_; + + /** + * + * + *
+   * Required. The context for request to perform a PITR on a Google Cloud
+   * Backup and Disaster Recovery managed instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the context field is set. + */ + @java.lang.Override + public boolean hasContext() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The context for request to perform a PITR on a Google Cloud
+   * Backup and Disaster Recovery managed instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The context. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PointInTimeRestoreContext getContext() { + return context_ == null + ? com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.getDefaultInstance() + : context_; + } + + /** + * + * + *
+   * Required. The context for request to perform a PITR on a Google Cloud
+   * Backup and Disaster Recovery managed instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PointInTimeRestoreContextOrBuilder getContextOrBuilder() { + return context_ == null + ? com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.getDefaultInstance() + : context_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getContext()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasContext() != other.hasContext()) return false; + if (hasContext()) { + if (!getContext().equals(other.getContext())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasContext()) { + hash = (37 * hash) + CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request to perform a point in time restore on a Google Cloud Backup and
+   * Disaster Recovery managed instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest) + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPointInTimeRestoreRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPointInTimeRestoreRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetContextFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + context_ = null; + if (contextBuilder_ != null) { + contextBuilder_.dispose(); + contextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPointInTimeRestoreRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.context_ = contextBuilder_ == null ? context_ : contextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasContext()) { + mergeContext(other.getContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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 802: + { + input.readMessage(internalGetContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 you created this instance.
+     * Format: projects/{project}
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 you created this instance.
+     * Format: projects/{project}
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 you created this instance.
+     * Format: projects/{project}
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 you created this instance.
+     * Format: projects/{project}
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent resource where you created this instance.
+     * Format: projects/{project}
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.PointInTimeRestoreContext context_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext, + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.Builder, + com.google.cloud.sql.v1beta4.PointInTimeRestoreContextOrBuilder> + contextBuilder_; + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the context field is set. + */ + public boolean hasContext() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The context. + */ + public com.google.cloud.sql.v1beta4.PointInTimeRestoreContext getContext() { + if (contextBuilder_ == null) { + return context_ == null + ? com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.getDefaultInstance() + : context_; + } else { + return contextBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setContext(com.google.cloud.sql.v1beta4.PointInTimeRestoreContext value) { + if (contextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + context_ = value; + } else { + contextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setContext( + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.Builder builderForValue) { + if (contextBuilder_ == null) { + context_ = builderForValue.build(); + } else { + contextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeContext(com.google.cloud.sql.v1beta4.PointInTimeRestoreContext value) { + if (contextBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && context_ != null + && context_ + != com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.getDefaultInstance()) { + getContextBuilder().mergeFrom(value); + } else { + context_ = value; + } + } else { + contextBuilder_.mergeFrom(value); + } + if (context_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearContext() { + bitField0_ = (bitField0_ & ~0x00000002); + context_ = null; + if (contextBuilder_ != null) { + contextBuilder_.dispose(); + contextBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.Builder getContextBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetContextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.PointInTimeRestoreContextOrBuilder getContextOrBuilder() { + if (contextBuilder_ != null) { + return contextBuilder_.getMessageOrBuilder(); + } else { + return context_ == null + ? com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.getDefaultInstance() + : context_; + } + } + + /** + * + * + *
+     * Required. The context for request to perform a PITR on a Google Cloud
+     * Backup and Disaster Recovery managed instance.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext, + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.Builder, + com.google.cloud.sql.v1beta4.PointInTimeRestoreContextOrBuilder> + internalGetContextFieldBuilder() { + if (contextBuilder_ == null) { + contextBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext, + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext.Builder, + com.google.cloud.sql.v1beta4.PointInTimeRestoreContextOrBuilder>( + getContext(), getParentForChildren(), isClean()); + context_ = null; + } + return contextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesPointInTimeRestoreRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPointInTimeRestoreRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPointInTimeRestoreRequestOrBuilder.java new file mode 100644 index 000000000000..52a26fec362a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPointInTimeRestoreRequestOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesPointInTimeRestoreRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource where you created this instance.
+   * Format: projects/{project}
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent resource where you created this instance.
+   * Format: projects/{project}
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The context for request to perform a PITR on a Google Cloud
+   * Backup and Disaster Recovery managed instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the context field is set. + */ + boolean hasContext(); + + /** + * + * + *
+   * Required. The context for request to perform a PITR on a Google Cloud
+   * Backup and Disaster Recovery managed instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The context. + */ + com.google.cloud.sql.v1beta4.PointInTimeRestoreContext getContext(); + + /** + * + * + *
+   * Required. The context for request to perform a PITR on a Google Cloud
+   * Backup and Disaster Recovery managed instance.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PointInTimeRestoreContext context = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1beta4.PointInTimeRestoreContextOrBuilder getContextOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPreCheckMajorVersionUpgradeRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPreCheckMajorVersionUpgradeRequest.java new file mode 100644 index 000000000000..568e2e984de4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPreCheckMajorVersionUpgradeRequest.java @@ -0,0 +1,1155 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Request for Pre-checks for MVU
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesPreCheckMajorVersionUpgradeRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest) + SqlInstancesPreCheckMajorVersionUpgradeRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesPreCheckMajorVersionUpgradeRequest"); + } + + // Use SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() to construct. + private SqlInstancesPreCheckMajorVersionUpgradeRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesPreCheckMajorVersionUpgradeRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPreCheckMajorVersionUpgradeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPreCheckMajorVersionUpgradeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest.Builder + .class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 3; + private com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body_; + + /** + * + * + *
+   * Required. The context for request to perform the pre-check major version
+   * upgrade operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The context for request to perform the pre-check major version
+   * upgrade operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * Required. The context for request to perform the pre-check major version
+   * upgrade operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequestOrBuilder + getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request for Pre-checks for MVU
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest) + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPreCheckMajorVersionUpgradeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPreCheckMajorVersionUpgradeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPreCheckMajorVersionUpgradeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest, + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequestOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.Builder + builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBody( + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.Builder + getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequestOrBuilder + getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest + .getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * Required. The context for request to perform the pre-check major version
+     * upgrade operation.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest, + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest, + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesPreCheckMajorVersionUpgradeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser + parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser + getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPreCheckMajorVersionUpgradeRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPreCheckMajorVersionUpgradeRequestOrBuilder.java new file mode 100644 index 000000000000..06f9dd7cf050 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPreCheckMajorVersionUpgradeRequestOrBuilder.java @@ -0,0 +1,127 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesPreCheckMajorVersionUpgradeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Required. The context for request to perform the pre-check major version
+   * upgrade operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * Required. The context for request to perform the pre-check major version
+   * upgrade operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest getBody(); + + /** + * + * + *
+   * Required. The context for request to perform the pre-check major version
+   * upgrade operation.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest body = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequestOrBuilder + getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPromoteReplicaRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPromoteReplicaRequest.java new file mode 100644 index 000000000000..4797d45ad7cf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPromoteReplicaRequest.java @@ -0,0 +1,894 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesPromoteReplicaRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest) + SqlInstancesPromoteReplicaRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesPromoteReplicaRequest"); + } + + // Use SqlInstancesPromoteReplicaRequest.newBuilder() to construct. + private SqlInstancesPromoteReplicaRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesPromoteReplicaRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPromoteReplicaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPromoteReplicaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FAILOVER_FIELD_NUMBER = 3; + private boolean failover_ = false; + + /** + * + * + *
+   * Set to true to invoke a replica failover to the DR replica.
+   * As part of replica failover, the promote operation attempts
+   * to add the original primary instance as a replica of the promoted
+   * DR replica when the original primary instance comes back online.
+   * If set to false or not specified, then the original primary
+   * instance becomes an independent Cloud SQL primary instance.
+   * 
+ * + * bool failover = 3; + * + * @return The failover. + */ + @java.lang.Override + public boolean getFailover() { + return failover_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (failover_ != false) { + output.writeBool(3, failover_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (failover_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, failover_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (getFailover() != other.getFailover()) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + FAILOVER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFailover()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest) + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPromoteReplicaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPromoteReplicaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + failover_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesPromoteReplicaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.failover_ = failover_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getFailover() != false) { + setFailover(other.getFailover()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + failover_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean failover_; + + /** + * + * + *
+     * Set to true to invoke a replica failover to the DR replica.
+     * As part of replica failover, the promote operation attempts
+     * to add the original primary instance as a replica of the promoted
+     * DR replica when the original primary instance comes back online.
+     * If set to false or not specified, then the original primary
+     * instance becomes an independent Cloud SQL primary instance.
+     * 
+ * + * bool failover = 3; + * + * @return The failover. + */ + @java.lang.Override + public boolean getFailover() { + return failover_; + } + + /** + * + * + *
+     * Set to true to invoke a replica failover to the DR replica.
+     * As part of replica failover, the promote operation attempts
+     * to add the original primary instance as a replica of the promoted
+     * DR replica when the original primary instance comes back online.
+     * If set to false or not specified, then the original primary
+     * instance becomes an independent Cloud SQL primary instance.
+     * 
+ * + * bool failover = 3; + * + * @param value The failover to set. + * @return This builder for chaining. + */ + public Builder setFailover(boolean value) { + + failover_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Set to true to invoke a replica failover to the DR replica.
+     * As part of replica failover, the promote operation attempts
+     * to add the original primary instance as a replica of the promoted
+     * DR replica when the original primary instance comes back online.
+     * If set to false or not specified, then the original primary
+     * instance becomes an independent Cloud SQL primary instance.
+     * 
+ * + * bool failover = 3; + * + * @return This builder for chaining. + */ + public Builder clearFailover() { + bitField0_ = (bitField0_ & ~0x00000004); + failover_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesPromoteReplicaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPromoteReplicaRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPromoteReplicaRequestOrBuilder.java new file mode 100644 index 000000000000..a3c9bbb22942 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesPromoteReplicaRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesPromoteReplicaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Set to true to invoke a replica failover to the DR replica.
+   * As part of replica failover, the promote operation attempts
+   * to add the original primary instance as a replica of the promoted
+   * DR replica when the original primary instance comes back online.
+   * If set to false or not specified, then the original primary
+   * instance becomes an independent Cloud SQL primary instance.
+   * 
+ * + * bool failover = 3; + * + * @return The failover. + */ + boolean getFailover(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReencryptRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReencryptRequest.java new file mode 100644 index 000000000000..f9f0292002ea --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReencryptRequest.java @@ -0,0 +1,1079 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance reencrypt request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesReencryptRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesReencryptRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesReencryptRequest) + SqlInstancesReencryptRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesReencryptRequest"); + } + + // Use SqlInstancesReencryptRequest.newBuilder() to construct. + private SqlInstancesReencryptRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesReencryptRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReencryptRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReencryptRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 3; + private com.google.cloud.sql.v1beta4.InstancesReencryptRequest body_; + + /** + * + * + *
+   * Reencrypt body that users request
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Reencrypt body that users request
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesReencryptRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesReencryptRequest.getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * Reencrypt body that users request
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesReencryptRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesReencryptRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance reencrypt request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesReencryptRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesReencryptRequest) + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReencryptRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReencryptRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReencryptRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstancesReencryptRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesReencryptRequest, + com.google.cloud.sql.v1beta4.InstancesReencryptRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesReencryptRequestOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.InstancesReencryptRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesReencryptRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + */ + public Builder setBody(com.google.cloud.sql.v1beta4.InstancesReencryptRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesReencryptRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.InstancesReencryptRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1beta4.InstancesReencryptRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + */ + public com.google.cloud.sql.v1beta4.InstancesReencryptRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + */ + public com.google.cloud.sql.v1beta4.InstancesReencryptRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesReencryptRequest.getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * Reencrypt body that users request
+     * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesReencryptRequest, + com.google.cloud.sql.v1beta4.InstancesReencryptRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesReencryptRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesReencryptRequest, + com.google.cloud.sql.v1beta4.InstancesReencryptRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesReencryptRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesReencryptRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesReencryptRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesReencryptRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReencryptRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReencryptRequestOrBuilder.java new file mode 100644 index 000000000000..44a16f44df88 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReencryptRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesReencryptRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesReencryptRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Reencrypt body that users request
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * Reencrypt body that users request
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.InstancesReencryptRequest getBody(); + + /** + * + * + *
+   * Reencrypt body that users request
+   * 
+ * + * .google.cloud.sql.v1beta4.InstancesReencryptRequest body = 3; + */ + com.google.cloud.sql.v1beta4.InstancesReencryptRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReleaseSsrsLeaseRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReleaseSsrsLeaseRequest.java new file mode 100644 index 000000000000..152f34608213 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReleaseSsrsLeaseRequest.java @@ -0,0 +1,822 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Request to release a lease for SSRS.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesReleaseSsrsLeaseRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest) + SqlInstancesReleaseSsrsLeaseRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesReleaseSsrsLeaseRequest"); + } + + // Use SqlInstancesReleaseSsrsLeaseRequest.newBuilder() to construct. + private SqlInstancesReleaseSsrsLeaseRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesReleaseSsrsLeaseRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+   * It's composed of lowercase letters, numbers, and hyphens, and it must start
+   * with a letter. The total length must be 98 characters or less (Example:
+   * instance-id).
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+   * It's composed of lowercase letters, numbers, and hyphens, and it must start
+   * with a letter. The total length must be 98 characters or less (Example:
+   * instance-id).
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. The ID of the project that contains the instance (Example:
+   * project-id).
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The ID of the project that contains the instance (Example:
+   * project-id).
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request to release a lease for SSRS.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest) + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+     * It's composed of lowercase letters, numbers, and hyphens, and it must start
+     * with a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+     * It's composed of lowercase letters, numbers, and hyphens, and it must start
+     * with a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+     * It's composed of lowercase letters, numbers, and hyphens, and it must start
+     * with a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+     * It's composed of lowercase letters, numbers, and hyphens, and it must start
+     * with a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+     * It's composed of lowercase letters, numbers, and hyphens, and it must start
+     * with a letter. The total length must be 98 characters or less (Example:
+     * instance-id).
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. The ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID of the project that contains the instance (Example:
+     * project-id).
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesReleaseSsrsLeaseRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReleaseSsrsLeaseRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReleaseSsrsLeaseRequestOrBuilder.java new file mode 100644 index 000000000000..07b037c86380 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReleaseSsrsLeaseRequestOrBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesReleaseSsrsLeaseRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+   * It's composed of lowercase letters, numbers, and hyphens, and it must start
+   * with a letter. The total length must be 98 characters or less (Example:
+   * instance-id).
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. The Cloud SQL instance ID. This doesn't include the project ID.
+   * It's composed of lowercase letters, numbers, and hyphens, and it must start
+   * with a letter. The total length must be 98 characters or less (Example:
+   * instance-id).
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. The ID of the project that contains the instance (Example:
+   * project-id).
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. The ID of the project that contains the instance (Example:
+   * project-id).
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReleaseSsrsLeaseResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReleaseSsrsLeaseResponse.java new file mode 100644 index 000000000000..ab51ead66945 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReleaseSsrsLeaseResponse.java @@ -0,0 +1,607 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The response for the release of the SSRS lease.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse} + */ +@com.google.protobuf.Generated +public final class SqlInstancesReleaseSsrsLeaseResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse) + SqlInstancesReleaseSsrsLeaseResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesReleaseSsrsLeaseResponse"); + } + + // Use SqlInstancesReleaseSsrsLeaseResponse.newBuilder() to construct. + private SqlInstancesReleaseSsrsLeaseResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesReleaseSsrsLeaseResponse() { + operationId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse.class, + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse.Builder.class); + } + + public static final int OPERATION_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object operationId_ = ""; + + /** + * + * + *
+   * The operation ID.
+   * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + @java.lang.Override + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationId_ = s; + return s; + } + } + + /** + * + * + *
+   * The operation ID.
+   * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = 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.GeneratedMessage.isStringEmpty(operationId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, operationId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operationId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, operationId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse other = + (com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse) obj; + + if (!getOperationId().equals(other.getOperationId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OPERATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getOperationId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The response for the release of the SSRS lease.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse) + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse.class, + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + operationId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesReleaseSsrsLeaseResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse build() { + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse result = + new com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.operationId_ = operationId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse.getDefaultInstance()) + return this; + if (!other.getOperationId().isEmpty()) { + operationId_ = other.operationId_; + 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: + { + operationId_ = 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 operationId_ = ""; + + /** + * + * + *
+     * The operation ID.
+     * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The operation ID.
+     * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The operation ID.
+     * 
+ * + * string operation_id = 1; + * + * @param value The operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + operationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The operation ID.
+     * 
+ * + * string operation_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperationId() { + operationId_ = getDefaultInstance().getOperationId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The operation ID.
+     * 
+ * + * string operation_id = 1; + * + * @param value The bytes for operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + operationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse) + private static final com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesReleaseSsrsLeaseResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReleaseSsrsLeaseResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReleaseSsrsLeaseResponseOrBuilder.java new file mode 100644 index 000000000000..cc9cf30432d5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesReleaseSsrsLeaseResponseOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesReleaseSsrsLeaseResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The operation ID.
+   * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + java.lang.String getOperationId(); + + /** + * + * + *
+   * The operation ID.
+   * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + com.google.protobuf.ByteString getOperationIdBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRescheduleMaintenanceRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRescheduleMaintenanceRequest.java new file mode 100644 index 000000000000..82d8d592092a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRescheduleMaintenanceRequest.java @@ -0,0 +1,1024 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesRescheduleMaintenanceRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest) + SqlInstancesRescheduleMaintenanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesRescheduleMaintenanceRequest"); + } + + // Use SqlInstancesRescheduleMaintenanceRequest.newBuilder() to construct. + private SqlInstancesRescheduleMaintenanceRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesRescheduleMaintenanceRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body_; + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .getDefaultInstance() + : body_; + } + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder + getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest) + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Builder, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + */ + public Builder setBody( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + */ + public Builder setBody( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Builder + builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + */ + public Builder mergeBody( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + */ + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Builder + getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + */ + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder + getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .getDefaultInstance() + : body_; + } + } + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Builder, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Builder, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesRescheduleMaintenanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRescheduleMaintenanceRequestBody.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRescheduleMaintenanceRequestBody.java new file mode 100644 index 000000000000..aebc4d6abfde --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRescheduleMaintenanceRequestBody.java @@ -0,0 +1,2004 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Reschedule options for maintenance windows.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody} + */ +@com.google.protobuf.Generated +public final class SqlInstancesRescheduleMaintenanceRequestBody + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody) + SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesRescheduleMaintenanceRequestBody"); + } + + // Use SqlInstancesRescheduleMaintenanceRequestBody.newBuilder() to construct. + private SqlInstancesRescheduleMaintenanceRequestBody( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesRescheduleMaintenanceRequestBody() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.class, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Builder + .class); + } + + /** + * Protobuf enum {@code + * google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType} + */ + public enum RescheduleType implements com.google.protobuf.ProtocolMessageEnum { + /** RESCHEDULE_TYPE_UNSPECIFIED = 0; */ + RESCHEDULE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Reschedules maintenance to happen now (within 5 minutes).
+     * 
+ * + * IMMEDIATE = 1; + */ + IMMEDIATE(1), + /** + * + * + *
+     * Reschedules maintenance to occur within one week from the originally
+     * scheduled day and time.
+     * 
+ * + * NEXT_AVAILABLE_WINDOW = 2; + */ + NEXT_AVAILABLE_WINDOW(2), + /** + * + * + *
+     * Reschedules maintenance to a specific time and day.
+     * 
+ * + * SPECIFIC_TIME = 3; + */ + SPECIFIC_TIME(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RescheduleType"); + } + + /** RESCHEDULE_TYPE_UNSPECIFIED = 0; */ + public static final int RESCHEDULE_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Reschedules maintenance to happen now (within 5 minutes).
+     * 
+ * + * IMMEDIATE = 1; + */ + public static final int IMMEDIATE_VALUE = 1; + + /** + * + * + *
+     * Reschedules maintenance to occur within one week from the originally
+     * scheduled day and time.
+     * 
+ * + * NEXT_AVAILABLE_WINDOW = 2; + */ + public static final int NEXT_AVAILABLE_WINDOW_VALUE = 2; + + /** + * + * + *
+     * Reschedules maintenance to a specific time and day.
+     * 
+ * + * SPECIFIC_TIME = 3; + */ + public static final int SPECIFIC_TIME_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 RescheduleType 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 RescheduleType forNumber(int value) { + switch (value) { + case 0: + return RESCHEDULE_TYPE_UNSPECIFIED; + case 1: + return IMMEDIATE; + case 2: + return NEXT_AVAILABLE_WINDOW; + case 3: + return SPECIFIC_TIME; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RescheduleType findValueByNumber(int number) { + return RescheduleType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final RescheduleType[] VALUES = values(); + + public static RescheduleType 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 RescheduleType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType) + } + + public interface RescheduleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The type of the reschedule.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @return The enum numeric value on the wire for rescheduleType. + */ + int getRescheduleTypeValue(); + + /** + * + * + *
+     * Required. The type of the reschedule.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @return The rescheduleType. + */ + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + getRescheduleType(); + + /** + * + * + *
+     * Optional. Timestamp when the maintenance shall be rescheduled to if
+     * reschedule_type=SPECIFIC_TIME, in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the scheduleTime field is set. + */ + boolean hasScheduleTime(); + + /** + * + * + *
+     * Optional. Timestamp when the maintenance shall be rescheduled to if
+     * reschedule_type=SPECIFIC_TIME, in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The scheduleTime. + */ + com.google.protobuf.Timestamp getScheduleTime(); + + /** + * + * + *
+     * Optional. Timestamp when the maintenance shall be rescheduled to if
+     * reschedule_type=SPECIFIC_TIME, in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder(); + } + + /** + * Protobuf type {@code + * google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule} + */ + public static final class Reschedule extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) + RescheduleOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Reschedule"); + } + + // Use Reschedule.newBuilder() to construct. + private Reschedule(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Reschedule() { + rescheduleType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .class, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .Builder.class); + } + + private int bitField0_; + public static final int RESCHEDULE_TYPE_FIELD_NUMBER = 1; + private int rescheduleType_ = 0; + + /** + * + * + *
+     * Required. The type of the reschedule.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @return The enum numeric value on the wire for rescheduleType. + */ + @java.lang.Override + public int getRescheduleTypeValue() { + return rescheduleType_; + } + + /** + * + * + *
+     * Required. The type of the reschedule.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @return The rescheduleType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + getRescheduleType() { + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + result = + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleType.forNumber(rescheduleType_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + .UNRECOGNIZED + : result; + } + + public static final int SCHEDULE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp scheduleTime_; + + /** + * + * + *
+     * Optional. Timestamp when the maintenance shall be rescheduled to if
+     * reschedule_type=SPECIFIC_TIME, in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the scheduleTime field is set. + */ + @java.lang.Override + public boolean hasScheduleTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. Timestamp when the maintenance shall be rescheduled to if
+     * reschedule_type=SPECIFIC_TIME, in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The scheduleTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getScheduleTime() { + return scheduleTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleTime_; + } + + /** + * + * + *
+     * Optional. Timestamp when the maintenance shall be rescheduled to if
+     * reschedule_type=SPECIFIC_TIME, in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder() { + return scheduleTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (rescheduleType_ + != com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleType.RESCHEDULE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, rescheduleType_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getScheduleTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rescheduleType_ + != com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleType.RESCHEDULE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, rescheduleType_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getScheduleTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule other = + (com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) + obj; + + if (rescheduleType_ != other.rescheduleType_) return false; + if (hasScheduleTime() != other.hasScheduleTime()) return false; + if (hasScheduleTime()) { + if (!getScheduleTime().equals(other.getScheduleTime())) return false; + } + if (!getUnknownFields().equals(other.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) + RESCHEDULE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + rescheduleType_; + if (hasScheduleTime()) { + hash = (37 * hash) + SCHEDULE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getScheduleTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code + * google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .class, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetScheduleTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rescheduleType_ = 0; + scheduleTime_ = null; + if (scheduleTimeBuilder_ != null) { + scheduleTimeBuilder_.dispose(); + scheduleTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_Reschedule_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + build() { + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + result = + new com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rescheduleType_ = rescheduleType_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.scheduleTime_ = + scheduleTimeBuilder_ == null ? scheduleTime_ : scheduleTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .getDefaultInstance()) return this; + if (other.rescheduleType_ != 0) { + setRescheduleTypeValue(other.getRescheduleTypeValue()); + } + if (other.hasScheduleTime()) { + mergeScheduleTime(other.getScheduleTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + rescheduleType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetScheduleTimeFieldBuilder().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 rescheduleType_ = 0; + + /** + * + * + *
+       * Required. The type of the reschedule.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @return The enum numeric value on the wire for rescheduleType. + */ + @java.lang.Override + public int getRescheduleTypeValue() { + return rescheduleType_; + } + + /** + * + * + *
+       * Required. The type of the reschedule.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @param value The enum numeric value on the wire for rescheduleType to set. + * @return This builder for chaining. + */ + public Builder setRescheduleTypeValue(int value) { + rescheduleType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The type of the reschedule.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @return The rescheduleType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleType + getRescheduleType() { + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + result = + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleType.forNumber(rescheduleType_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * Required. The type of the reschedule.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @param value The rescheduleType to set. + * @return This builder for chaining. + */ + public Builder setRescheduleType( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + rescheduleType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The type of the reschedule.
+       * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType reschedule_type = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearRescheduleType() { + bitField0_ = (bitField0_ & ~0x00000001); + rescheduleType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp scheduleTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + scheduleTimeBuilder_; + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the scheduleTime field is set. + */ + public boolean hasScheduleTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The scheduleTime. + */ + public com.google.protobuf.Timestamp getScheduleTime() { + if (scheduleTimeBuilder_ == null) { + return scheduleTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleTime_; + } else { + return scheduleTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setScheduleTime(com.google.protobuf.Timestamp value) { + if (scheduleTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scheduleTime_ = value; + } else { + scheduleTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setScheduleTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (scheduleTimeBuilder_ == null) { + scheduleTime_ = builderForValue.build(); + } else { + scheduleTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeScheduleTime(com.google.protobuf.Timestamp value) { + if (scheduleTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && scheduleTime_ != null + && scheduleTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getScheduleTimeBuilder().mergeFrom(value); + } else { + scheduleTime_ = value; + } + } else { + scheduleTimeBuilder_.mergeFrom(value); + } + if (scheduleTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearScheduleTime() { + bitField0_ = (bitField0_ & ~0x00000002); + scheduleTime_ = null; + if (scheduleTimeBuilder_ != null) { + scheduleTimeBuilder_.dispose(); + scheduleTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getScheduleTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetScheduleTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder() { + if (scheduleTimeBuilder_ != null) { + return scheduleTimeBuilder_.getMessageOrBuilder(); + } else { + return scheduleTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleTime_; + } + } + + /** + * + * + *
+       * Optional. Timestamp when the maintenance shall be rescheduled to if
+       * reschedule_type=SPECIFIC_TIME, in
+       * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+       * `2012-11-15T16:19:00.094Z`.
+       * 
+ * + * + * .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetScheduleTimeFieldBuilder() { + if (scheduleTimeBuilder_ == null) { + scheduleTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getScheduleTime(), getParentForChildren(), isClean()); + scheduleTime_ = null; + } + return scheduleTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) + private static final com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Reschedule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int RESCHEDULE_FIELD_NUMBER = 3; + private com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + reschedule_; + + /** + * + * + *
+   * Required. The type of the reschedule the user wants.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + * + * @return Whether the reschedule field is set. + */ + @java.lang.Override + public boolean hasReschedule() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The type of the reschedule the user wants.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + * + * @return The reschedule. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + getReschedule() { + return reschedule_ == null + ? com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .getDefaultInstance() + : reschedule_; + } + + /** + * + * + *
+   * Required. The type of the reschedule the user wants.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleOrBuilder + getRescheduleOrBuilder() { + return reschedule_ == null + ? com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .getDefaultInstance() + : reschedule_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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(3, getReschedule()); + } + 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(3, getReschedule()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody other = + (com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody) obj; + + if (hasReschedule() != other.hasReschedule()) return false; + if (hasReschedule()) { + if (!getReschedule().equals(other.getReschedule())) return false; + } + if (!getUnknownFields().equals(other.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 (hasReschedule()) { + hash = (37 * hash) + RESCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getReschedule().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Reschedule options for maintenance windows.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody) + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.class, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Builder + .class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRescheduleFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + reschedule_ = null; + if (rescheduleBuilder_ != null) { + rescheduleBuilder_.dispose(); + rescheduleBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRescheduleMaintenanceRequestBody_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody build() { + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody result = + new com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.reschedule_ = rescheduleBuilder_ == null ? reschedule_ : rescheduleBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .getDefaultInstance()) return this; + if (other.hasReschedule()) { + mergeReschedule(other.getReschedule()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 26: + { + input.readMessage( + internalGetRescheduleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + reschedule_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .Builder, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleOrBuilder> + rescheduleBuilder_; + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + * + * @return Whether the reschedule field is set. + */ + public boolean hasReschedule() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + * + * @return The reschedule. + */ + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + getReschedule() { + if (rescheduleBuilder_ == null) { + return reschedule_ == null + ? com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .getDefaultInstance() + : reschedule_; + } else { + return rescheduleBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + public Builder setReschedule( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + value) { + if (rescheduleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reschedule_ = value; + } else { + rescheduleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + public Builder setReschedule( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.Builder + builderForValue) { + if (rescheduleBuilder_ == null) { + reschedule_ = builderForValue.build(); + } else { + rescheduleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + public Builder mergeReschedule( + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + value) { + if (rescheduleBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && reschedule_ != null + && reschedule_ + != com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule.getDefaultInstance()) { + getRescheduleBuilder().mergeFrom(value); + } else { + reschedule_ = value; + } + } else { + rescheduleBuilder_.mergeFrom(value); + } + if (reschedule_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + public Builder clearReschedule() { + bitField0_ = (bitField0_ & ~0x00000001); + reschedule_ = null; + if (rescheduleBuilder_ != null) { + rescheduleBuilder_.dispose(); + rescheduleBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .Builder + getRescheduleBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRescheduleFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleOrBuilder + getRescheduleOrBuilder() { + if (rescheduleBuilder_ != null) { + return rescheduleBuilder_.getMessageOrBuilder(); + } else { + return reschedule_ == null + ? com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .getDefaultInstance() + : reschedule_; + } + } + + /** + * + * + *
+     * Required. The type of the reschedule the user wants.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .Builder, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleOrBuilder> + internalGetRescheduleFieldBuilder() { + if (rescheduleBuilder_ == null) { + rescheduleBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .Reschedule, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + .Builder, + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + .RescheduleOrBuilder>(getReschedule(), getParentForChildren(), isClean()); + reschedule_ = null; + } + return rescheduleBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody) + private static final com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesRescheduleMaintenanceRequestBody parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser + getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder.java new file mode 100644 index 000000000000..c6d56766bc09 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder.java @@ -0,0 +1,73 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The type of the reschedule the user wants.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + * + * @return Whether the reschedule field is set. + */ + boolean hasReschedule(); + + /** + * + * + *
+   * Required. The type of the reschedule the user wants.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + * + * @return The reschedule. + */ + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule + getReschedule(); + + /** + * + * + *
+   * Required. The type of the reschedule the user wants.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule reschedule = 3; + * + */ + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleOrBuilder + getRescheduleOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRescheduleMaintenanceRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRescheduleMaintenanceRequestOrBuilder.java new file mode 100644 index 000000000000..d74dfdf05e64 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRescheduleMaintenanceRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesRescheduleMaintenanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody getBody(); + + /** + * .google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody body = 100; + */ + com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBodyOrBuilder + getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesResetReplicaSizeRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesResetReplicaSizeRequest.java new file mode 100644 index 000000000000..3c8f6836ef73 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesResetReplicaSizeRequest.java @@ -0,0 +1,794 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance reset replica size request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesResetReplicaSizeRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest) + SqlInstancesResetReplicaSizeRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesResetReplicaSizeRequest"); + } + + // Use SqlInstancesResetReplicaSizeRequest.newBuilder() to construct. + private SqlInstancesResetReplicaSizeRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesResetReplicaSizeRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesResetReplicaSizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesResetReplicaSizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance reset replica size request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest) + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesResetReplicaSizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesResetReplicaSizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesResetReplicaSizeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesResetReplicaSizeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesResetReplicaSizeRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesResetReplicaSizeRequestOrBuilder.java new file mode 100644 index 000000000000..269ae0126a5b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesResetReplicaSizeRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesResetReplicaSizeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesResetSslConfigRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesResetSslConfigRequest.java new file mode 100644 index 000000000000..27f6715b0fe6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesResetSslConfigRequest.java @@ -0,0 +1,1134 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesResetSslConfigRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest) + SqlInstancesResetSslConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesResetSslConfigRequest"); + } + + // Use SqlInstancesResetSslConfigRequest.newBuilder() to construct. + private SqlInstancesResetSslConfigRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesResetSslConfigRequest() { + instance_ = ""; + project_ = ""; + mode_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesResetSslConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesResetSslConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.Builder.class); + } + + /** + * + * + *
+   * Reset SSL mode to selectively refresh the SSL materials.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode} + */ + public enum ResetSslMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Reset SSL mode is not specified.
+     * 
+ * + * RESET_SSL_MODE_UNSPECIFIED = 0; + */ + RESET_SSL_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Refresh all TLS configs. This is the default behaviour.
+     * 
+ * + * ALL = 1; + */ + ALL(1), + /** + * + * + *
+     * Refreshes the replication-related TLS configuration settings provided by
+     * the primary instance.
+     * Not applicable to on-premises replication instances.
+     * 
+ * + * SYNC_FROM_PRIMARY = 2; + */ + SYNC_FROM_PRIMARY(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResetSslMode"); + } + + /** + * + * + *
+     * Reset SSL mode is not specified.
+     * 
+ * + * RESET_SSL_MODE_UNSPECIFIED = 0; + */ + public static final int RESET_SSL_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Refresh all TLS configs. This is the default behaviour.
+     * 
+ * + * ALL = 1; + */ + public static final int ALL_VALUE = 1; + + /** + * + * + *
+     * Refreshes the replication-related TLS configuration settings provided by
+     * the primary instance.
+     * Not applicable to on-premises replication instances.
+     * 
+ * + * SYNC_FROM_PRIMARY = 2; + */ + public static final int SYNC_FROM_PRIMARY_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 ResetSslMode 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 ResetSslMode forNumber(int value) { + switch (value) { + case 0: + return RESET_SSL_MODE_UNSPECIFIED; + case 1: + return ALL; + case 2: + return SYNC_FROM_PRIMARY; + 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 ResetSslMode findValueByNumber(int number) { + return ResetSslMode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ResetSslMode[] VALUES = values(); + + public static ResetSslMode 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 ResetSslMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode) + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODE_FIELD_NUMBER = 3; + private int mode_ = 0; + + /** + * + * + *
+   * Optional. Reset SSL mode to use.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + + /** + * + * + *
+   * Optional. Reset SSL mode to use.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode getMode() { + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode result = + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode.forNumber( + mode_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode.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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (mode_ + != com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode + .RESET_SSL_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, mode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (mode_ + != com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode + .RESET_SSL_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, 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.sql.v1beta4.SqlInstancesResetSslConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) 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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().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.sql.v1beta4.SqlInstancesResetSslConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest) + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesResetSslConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesResetSslConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + mode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesResetSslConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.mode_ = mode_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + 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 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int mode_ = 0; + + /** + * + * + *
+     * Optional. Reset SSL mode to use.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + + /** + * + * + *
+     * Optional. Reset SSL mode to use.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Reset SSL mode to use.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode getMode() { + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode result = + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode.forNumber( + mode_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. Reset SSL mode to use.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + mode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Reset SSL mode to use.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00000004); + mode_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesResetSslConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesResetSslConfigRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesResetSslConfigRequestOrBuilder.java new file mode 100644 index 000000000000..c86a0f2f5b9f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesResetSslConfigRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesResetSslConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Optional. Reset SSL mode to use.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + + /** + * + * + *
+   * Optional. Reset SSL mode to use.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode getMode(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRestartRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRestartRequest.java new file mode 100644 index 000000000000..0a8a2100d9e0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRestartRequest.java @@ -0,0 +1,770 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesRestartRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesRestartRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesRestartRequest) + SqlInstancesRestartRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesRestartRequest"); + } + + // Use SqlInstancesRestartRequest.newBuilder() to construct. + private SqlInstancesRestartRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesRestartRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRestartRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRestartRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance to be restarted.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance to be restarted.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesRestartRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesRestartRequest) + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRestartRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRestartRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRestartRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance to be restarted.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be restarted.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be restarted.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be restarted.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance to be restarted.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesRestartRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesRestartRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesRestartRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRestartRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRestartRequestOrBuilder.java new file mode 100644 index 000000000000..89bd67ce683e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRestartRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesRestartRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesRestartRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance to be restarted.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance to be restarted.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRestoreBackupRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRestoreBackupRequest.java new file mode 100644 index 000000000000..46cbbef5ca2a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRestoreBackupRequest.java @@ -0,0 +1,981 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesRestoreBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest) + SqlInstancesRestoreBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesRestoreBackupRequest"); + } + + // Use SqlInstancesRestoreBackupRequest.newBuilder() to construct. + private SqlInstancesRestoreBackupRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesRestoreBackupRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRestoreBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRestoreBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body_; + + /** + * .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest) + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRestoreBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRestoreBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRestoreBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest, + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest + .getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest, + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest, + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesRestoreBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRestoreBackupRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRestoreBackupRequestOrBuilder.java new file mode 100644 index 000000000000..04c9dcd19867 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRestoreBackupRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesRestoreBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest getBody(); + + /** .google.cloud.sql.v1beta4.InstancesRestoreBackupRequest body = 100; */ + com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateEntraIdCertificateRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateEntraIdCertificateRequest.java new file mode 100644 index 000000000000..2e3937e6ba94 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateEntraIdCertificateRequest.java @@ -0,0 +1,1133 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Request message for SqlInstancesService.RotateEntraIdCertificate.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesRotateEntraIdCertificateRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest) + SqlInstancesRotateEntraIdCertificateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesRotateEntraIdCertificateRequest"); + } + + // Use SqlInstancesRotateEntraIdCertificateRequest.newBuilder() to construct. + private SqlInstancesRotateEntraIdCertificateRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesRotateEntraIdCertificateRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateEntraIdCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body_; + + /** + * + * + *
+   * Required. Rotate Entra ID certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. Rotate Entra ID certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * Required. Rotate Entra ID certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequestOrBuilder + getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for SqlInstancesService.RotateEntraIdCertificate.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest) + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateEntraIdCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateEntraIdCertificateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest, + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequestOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * Required. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest + .getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.Builder + builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBody( + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest + .getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.Builder + getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequestOrBuilder + getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest + .getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * Required. Rotate Entra ID certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest, + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest, + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesRotateEntraIdCertificateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser + getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateEntraIdCertificateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateEntraIdCertificateRequestOrBuilder.java new file mode 100644 index 000000000000..2bb495d416e8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateEntraIdCertificateRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesRotateEntraIdCertificateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Required. Rotate Entra ID certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * Required. Rotate Entra ID certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest getBody(); + + /** + * + * + *
+   * Required. Rotate Entra ID certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateServerCaRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateServerCaRequest.java new file mode 100644 index 000000000000..ca25f75eef2d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateServerCaRequest.java @@ -0,0 +1,983 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesRotateServerCaRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest) + SqlInstancesRotateServerCaRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesRotateServerCaRequest"); + } + + // Use SqlInstancesRotateServerCaRequest.newBuilder() to construct. + private SqlInstancesRotateServerCaRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesRotateServerCaRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body_; + + /** + * .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest) + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest, + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest + .getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest, + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest, + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesRotateServerCaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateServerCaRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateServerCaRequestOrBuilder.java new file mode 100644 index 000000000000..ec2a898199df --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateServerCaRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesRotateServerCaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest getBody(); + + /** .google.cloud.sql.v1beta4.InstancesRotateServerCaRequest body = 100; */ + com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateServerCertificateRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateServerCertificateRequest.java new file mode 100644 index 000000000000..6570ddb3dea0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateServerCertificateRequest.java @@ -0,0 +1,1115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesRotateServerCertificateRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest) + SqlInstancesRotateServerCertificateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesRotateServerCertificateRequest"); + } + + // Use SqlInstancesRotateServerCertificateRequest.newBuilder() to construct. + private SqlInstancesRotateServerCertificateRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesRotateServerCertificateRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body_; + + /** + * + * + *
+   * Required. Rotate server certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. Rotate server certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.getDefaultInstance() + : body_; + } + + /** + * + * + *
+   * Required. Rotate server certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequestOrBuilder + getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest) + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCertificateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCertificateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesRotateServerCertificateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest, + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequestOrBuilder> + bodyBuilder_; + + /** + * + * + *
+     * Required. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest + .getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.Builder + builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBody( + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest + .getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.Builder + getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequestOrBuilder + getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest + .getDefaultInstance() + : body_; + } + } + + /** + * + * + *
+     * Required. Rotate server certificate request body.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest, + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest, + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesRotateServerCertificateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateServerCertificateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateServerCertificateRequestOrBuilder.java new file mode 100644 index 000000000000..cd5fef161759 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesRotateServerCertificateRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesRotateServerCertificateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Required. Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Required. Rotate server certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * + * + *
+   * Required. Rotate server certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest getBody(); + + /** + * + * + *
+   * Required. Rotate server certificate request body.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest body = 100 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStartExternalSyncRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStartExternalSyncRequest.java new file mode 100644 index 000000000000..cf6348f5b2f9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStartExternalSyncRequest.java @@ -0,0 +1,1956 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesStartExternalSyncRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest) + SqlInstancesStartExternalSyncRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesStartExternalSyncRequest"); + } + + // Use SqlInstancesStartExternalSyncRequest.newBuilder() to construct. + private SqlInstancesStartExternalSyncRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesStartExternalSyncRequest() { + instance_ = ""; + project_ = ""; + syncMode_ = 0; + syncParallelLevel_ = 0; + migrationType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStartExternalSyncRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStartExternalSyncRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.Builder.class); + } + + private int syncConfigCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object syncConfig_; + + public enum SyncConfigCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MYSQL_SYNC_CONFIG(6), + SYNCCONFIG_NOT_SET(0); + private final int value; + + private SyncConfigCase(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 SyncConfigCase valueOf(int value) { + return forNumber(value); + } + + public static SyncConfigCase forNumber(int value) { + switch (value) { + case 6: + return MYSQL_SYNC_CONFIG; + case 0: + return SYNCCONFIG_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SyncConfigCase getSyncConfigCase() { + return SyncConfigCase.forNumber(syncConfigCase_); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SYNC_MODE_FIELD_NUMBER = 3; + private int syncMode_ = 0; + + /** + * + * + *
+   * External sync mode.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @return The enum numeric value on the wire for syncMode. + */ + @java.lang.Override + public int getSyncModeValue() { + return syncMode_; + } + + /** + * + * + *
+   * External sync mode.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @return The syncMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + getSyncMode() { + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + result = + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .ExternalSyncMode.forNumber(syncMode_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .ExternalSyncMode.UNRECOGNIZED + : result; + } + + public static final int SKIP_VERIFICATION_FIELD_NUMBER = 4; + private boolean skipVerification_ = false; + + /** + * + * + *
+   * Whether to skip the verification step (VESS).
+   * 
+ * + * bool skip_verification = 4; + * + * @return The skipVerification. + */ + @java.lang.Override + public boolean getSkipVerification() { + return skipVerification_; + } + + public static final int MYSQL_SYNC_CONFIG_FIELD_NUMBER = 6; + + /** + * + * + *
+   * MySQL-specific settings for start external sync.
+   * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + * + * @return Whether the mysqlSyncConfig field is set. + */ + @java.lang.Override + public boolean hasMysqlSyncConfig() { + return syncConfigCase_ == 6; + } + + /** + * + * + *
+   * MySQL-specific settings for start external sync.
+   * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + * + * @return The mysqlSyncConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlSyncConfig getMysqlSyncConfig() { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance(); + } + + /** + * + * + *
+   * MySQL-specific settings for start external sync.
+   * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlSyncConfigOrBuilder getMysqlSyncConfigOrBuilder() { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance(); + } + + public static final int SYNC_PARALLEL_LEVEL_FIELD_NUMBER = 7; + private int syncParallelLevel_ = 0; + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Currently only applicable
+   * for MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for syncParallelLevel. + */ + @java.lang.Override + public int getSyncParallelLevelValue() { + return syncParallelLevel_; + } + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Currently only applicable
+   * for MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The syncParallelLevel. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel getSyncParallelLevel() { + com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel result = + com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel.forNumber(syncParallelLevel_); + return result == null + ? com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel.UNRECOGNIZED + : result; + } + + public static final int MIGRATION_TYPE_FIELD_NUMBER = 8; + private int migrationType_ = 0; + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for migrationType. + */ + @java.lang.Override + public int getMigrationTypeValue() { + return migrationType_; + } + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The migrationType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + getMigrationType() { + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + result = + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .forNumber(migrationType_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .UNRECOGNIZED + : result; + } + + public static final int REPLICA_OVERWRITE_ENABLED_FIELD_NUMBER = 9; + private boolean replicaOverwriteEnabled_ = false; + + /** + * + * + *
+   * Optional. MySQL only. True if end-user has confirmed that this SES call
+   * will wipe replica databases overlapping with the proposed selected_objects.
+   * If this field is not set and there are both overlapping and additional
+   * databases proposed, an error will be returned.
+   * 
+ * + * bool replica_overwrite_enabled = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaOverwriteEnabled. + */ + @java.lang.Override + public boolean getReplicaOverwriteEnabled() { + return replicaOverwriteEnabled_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (syncMode_ + != com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .ExternalSyncMode.EXTERNAL_SYNC_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, syncMode_); + } + if (skipVerification_ != false) { + output.writeBool(4, skipVerification_); + } + if (syncConfigCase_ == 6) { + output.writeMessage(6, (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_); + } + if (syncParallelLevel_ + != com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel + .EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, syncParallelLevel_); + } + if (migrationType_ + != com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .MIGRATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, migrationType_); + } + if (replicaOverwriteEnabled_ != false) { + output.writeBool(9, replicaOverwriteEnabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (syncMode_ + != com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .ExternalSyncMode.EXTERNAL_SYNC_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, syncMode_); + } + if (skipVerification_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, skipVerification_); + } + if (syncConfigCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_); + } + if (syncParallelLevel_ + != com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel + .EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, syncParallelLevel_); + } + if (migrationType_ + != com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .MIGRATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, migrationType_); + } + if (replicaOverwriteEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, replicaOverwriteEnabled_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (syncMode_ != other.syncMode_) return false; + if (getSkipVerification() != other.getSkipVerification()) return false; + if (syncParallelLevel_ != other.syncParallelLevel_) return false; + if (migrationType_ != other.migrationType_) return false; + if (getReplicaOverwriteEnabled() != other.getReplicaOverwriteEnabled()) return false; + if (!getSyncConfigCase().equals(other.getSyncConfigCase())) return false; + switch (syncConfigCase_) { + case 6: + if (!getMysqlSyncConfig().equals(other.getMysqlSyncConfig())) 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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + SYNC_MODE_FIELD_NUMBER; + hash = (53 * hash) + syncMode_; + hash = (37 * hash) + SKIP_VERIFICATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSkipVerification()); + hash = (37 * hash) + SYNC_PARALLEL_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + syncParallelLevel_; + hash = (37 * hash) + MIGRATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + migrationType_; + hash = (37 * hash) + REPLICA_OVERWRITE_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReplicaOverwriteEnabled()); + switch (syncConfigCase_) { + case 6: + hash = (37 * hash) + MYSQL_SYNC_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getMysqlSyncConfig().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest) + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStartExternalSyncRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStartExternalSyncRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.Builder.class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + syncMode_ = 0; + skipVerification_ = false; + if (mysqlSyncConfigBuilder_ != null) { + mysqlSyncConfigBuilder_.clear(); + } + syncParallelLevel_ = 0; + migrationType_ = 0; + replicaOverwriteEnabled_ = false; + syncConfigCase_ = 0; + syncConfig_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStartExternalSyncRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.syncMode_ = syncMode_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.skipVerification_ = skipVerification_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.syncParallelLevel_ = syncParallelLevel_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.migrationType_ = migrationType_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.replicaOverwriteEnabled_ = replicaOverwriteEnabled_; + } + } + + private void buildPartialOneofs( + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest result) { + result.syncConfigCase_ = syncConfigCase_; + result.syncConfig_ = this.syncConfig_; + if (syncConfigCase_ == 6 && mysqlSyncConfigBuilder_ != null) { + result.syncConfig_ = mysqlSyncConfigBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.syncMode_ != 0) { + setSyncModeValue(other.getSyncModeValue()); + } + if (other.getSkipVerification() != false) { + setSkipVerification(other.getSkipVerification()); + } + if (other.syncParallelLevel_ != 0) { + setSyncParallelLevelValue(other.getSyncParallelLevelValue()); + } + if (other.migrationType_ != 0) { + setMigrationTypeValue(other.getMigrationTypeValue()); + } + if (other.getReplicaOverwriteEnabled() != false) { + setReplicaOverwriteEnabled(other.getReplicaOverwriteEnabled()); + } + switch (other.getSyncConfigCase()) { + case MYSQL_SYNC_CONFIG: + { + mergeMysqlSyncConfig(other.getMysqlSyncConfig()); + break; + } + case SYNCCONFIG_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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + syncMode_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + skipVerification_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 50: + { + input.readMessage( + internalGetMysqlSyncConfigFieldBuilder().getBuilder(), extensionRegistry); + syncConfigCase_ = 6; + break; + } // case 50 + case 56: + { + syncParallelLevel_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 56 + case 64: + { + migrationType_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 64 + case 72: + { + replicaOverwriteEnabled_ = input.readBool(); + bitField0_ |= 0x00000080; + 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 syncConfigCase_ = 0; + private java.lang.Object syncConfig_; + + public SyncConfigCase getSyncConfigCase() { + return SyncConfigCase.forNumber(syncConfigCase_); + } + + public Builder clearSyncConfig() { + syncConfigCase_ = 0; + syncConfig_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int syncMode_ = 0; + + /** + * + * + *
+     * External sync mode.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @return The enum numeric value on the wire for syncMode. + */ + @java.lang.Override + public int getSyncModeValue() { + return syncMode_; + } + + /** + * + * + *
+     * External sync mode.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @param value The enum numeric value on the wire for syncMode to set. + * @return This builder for chaining. + */ + public Builder setSyncModeValue(int value) { + syncMode_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * External sync mode.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @return The syncMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .ExternalSyncMode + getSyncMode() { + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + result = + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .ExternalSyncMode.forNumber(syncMode_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .ExternalSyncMode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * External sync mode.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @param value The syncMode to set. + * @return This builder for chaining. + */ + public Builder setSyncMode( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + syncMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * External sync mode.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearSyncMode() { + bitField0_ = (bitField0_ & ~0x00000004); + syncMode_ = 0; + onChanged(); + return this; + } + + private boolean skipVerification_; + + /** + * + * + *
+     * Whether to skip the verification step (VESS).
+     * 
+ * + * bool skip_verification = 4; + * + * @return The skipVerification. + */ + @java.lang.Override + public boolean getSkipVerification() { + return skipVerification_; + } + + /** + * + * + *
+     * Whether to skip the verification step (VESS).
+     * 
+ * + * bool skip_verification = 4; + * + * @param value The skipVerification to set. + * @return This builder for chaining. + */ + public Builder setSkipVerification(boolean value) { + + skipVerification_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether to skip the verification step (VESS).
+     * 
+ * + * bool skip_verification = 4; + * + * @return This builder for chaining. + */ + public Builder clearSkipVerification() { + bitField0_ = (bitField0_ & ~0x00000008); + skipVerification_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.MySqlSyncConfig, + com.google.cloud.sql.v1beta4.MySqlSyncConfig.Builder, + com.google.cloud.sql.v1beta4.MySqlSyncConfigOrBuilder> + mysqlSyncConfigBuilder_; + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + * + * @return Whether the mysqlSyncConfig field is set. + */ + @java.lang.Override + public boolean hasMysqlSyncConfig() { + return syncConfigCase_ == 6; + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + * + * @return The mysqlSyncConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlSyncConfig getMysqlSyncConfig() { + if (mysqlSyncConfigBuilder_ == null) { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance(); + } else { + if (syncConfigCase_ == 6) { + return mysqlSyncConfigBuilder_.getMessage(); + } + return com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance(); + } + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + */ + public Builder setMysqlSyncConfig(com.google.cloud.sql.v1beta4.MySqlSyncConfig value) { + if (mysqlSyncConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + syncConfig_ = value; + onChanged(); + } else { + mysqlSyncConfigBuilder_.setMessage(value); + } + syncConfigCase_ = 6; + return this; + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + */ + public Builder setMysqlSyncConfig( + com.google.cloud.sql.v1beta4.MySqlSyncConfig.Builder builderForValue) { + if (mysqlSyncConfigBuilder_ == null) { + syncConfig_ = builderForValue.build(); + onChanged(); + } else { + mysqlSyncConfigBuilder_.setMessage(builderForValue.build()); + } + syncConfigCase_ = 6; + return this; + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + */ + public Builder mergeMysqlSyncConfig(com.google.cloud.sql.v1beta4.MySqlSyncConfig value) { + if (mysqlSyncConfigBuilder_ == null) { + if (syncConfigCase_ == 6 + && syncConfig_ != com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance()) { + syncConfig_ = + com.google.cloud.sql.v1beta4.MySqlSyncConfig.newBuilder( + (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + syncConfig_ = value; + } + onChanged(); + } else { + if (syncConfigCase_ == 6) { + mysqlSyncConfigBuilder_.mergeFrom(value); + } else { + mysqlSyncConfigBuilder_.setMessage(value); + } + } + syncConfigCase_ = 6; + return this; + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + */ + public Builder clearMysqlSyncConfig() { + if (mysqlSyncConfigBuilder_ == null) { + if (syncConfigCase_ == 6) { + syncConfigCase_ = 0; + syncConfig_ = null; + onChanged(); + } + } else { + if (syncConfigCase_ == 6) { + syncConfigCase_ = 0; + syncConfig_ = null; + } + mysqlSyncConfigBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + */ + public com.google.cloud.sql.v1beta4.MySqlSyncConfig.Builder getMysqlSyncConfigBuilder() { + return internalGetMysqlSyncConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlSyncConfigOrBuilder getMysqlSyncConfigOrBuilder() { + if ((syncConfigCase_ == 6) && (mysqlSyncConfigBuilder_ != null)) { + return mysqlSyncConfigBuilder_.getMessageOrBuilder(); + } else { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance(); + } + } + + /** + * + * + *
+     * MySQL-specific settings for start external sync.
+     * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.MySqlSyncConfig, + com.google.cloud.sql.v1beta4.MySqlSyncConfig.Builder, + com.google.cloud.sql.v1beta4.MySqlSyncConfigOrBuilder> + internalGetMysqlSyncConfigFieldBuilder() { + if (mysqlSyncConfigBuilder_ == null) { + if (!(syncConfigCase_ == 6)) { + syncConfig_ = com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance(); + } + mysqlSyncConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.MySqlSyncConfig, + com.google.cloud.sql.v1beta4.MySqlSyncConfig.Builder, + com.google.cloud.sql.v1beta4.MySqlSyncConfigOrBuilder>( + (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_, + getParentForChildren(), + isClean()); + syncConfig_ = null; + } + syncConfigCase_ = 6; + onChanged(); + return mysqlSyncConfigBuilder_; + } + + private int syncParallelLevel_ = 0; + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Currently only applicable
+     * for MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for syncParallelLevel. + */ + @java.lang.Override + public int getSyncParallelLevelValue() { + return syncParallelLevel_; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Currently only applicable
+     * for MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for syncParallelLevel to set. + * @return This builder for chaining. + */ + public Builder setSyncParallelLevelValue(int value) { + syncParallelLevel_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Currently only applicable
+     * for MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The syncParallelLevel. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel getSyncParallelLevel() { + com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel result = + com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel.forNumber(syncParallelLevel_); + return result == null + ? com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Currently only applicable
+     * for MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The syncParallelLevel to set. + * @return This builder for chaining. + */ + public Builder setSyncParallelLevel( + com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + syncParallelLevel_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Currently only applicable
+     * for MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSyncParallelLevel() { + bitField0_ = (bitField0_ & ~0x00000020); + syncParallelLevel_ = 0; + onChanged(); + return this; + } + + private int migrationType_ = 0; + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for migrationType. + */ + @java.lang.Override + public int getMigrationTypeValue() { + return migrationType_; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for migrationType to set. + * @return This builder for chaining. + */ + public Builder setMigrationTypeValue(int value) { + migrationType_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The migrationType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + getMigrationType() { + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + result = + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .MigrationType.forNumber(migrationType_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The migrationType to set. + * @return This builder for chaining. + */ + public Builder setMigrationType( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + migrationType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMigrationType() { + bitField0_ = (bitField0_ & ~0x00000040); + migrationType_ = 0; + onChanged(); + return this; + } + + private boolean replicaOverwriteEnabled_; + + /** + * + * + *
+     * Optional. MySQL only. True if end-user has confirmed that this SES call
+     * will wipe replica databases overlapping with the proposed selected_objects.
+     * If this field is not set and there are both overlapping and additional
+     * databases proposed, an error will be returned.
+     * 
+ * + * bool replica_overwrite_enabled = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaOverwriteEnabled. + */ + @java.lang.Override + public boolean getReplicaOverwriteEnabled() { + return replicaOverwriteEnabled_; + } + + /** + * + * + *
+     * Optional. MySQL only. True if end-user has confirmed that this SES call
+     * will wipe replica databases overlapping with the proposed selected_objects.
+     * If this field is not set and there are both overlapping and additional
+     * databases proposed, an error will be returned.
+     * 
+ * + * bool replica_overwrite_enabled = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The replicaOverwriteEnabled to set. + * @return This builder for chaining. + */ + public Builder setReplicaOverwriteEnabled(boolean value) { + + replicaOverwriteEnabled_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. MySQL only. True if end-user has confirmed that this SES call
+     * will wipe replica databases overlapping with the proposed selected_objects.
+     * If this field is not set and there are both overlapping and additional
+     * databases proposed, an error will be returned.
+     * 
+ * + * bool replica_overwrite_enabled = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearReplicaOverwriteEnabled() { + bitField0_ = (bitField0_ & ~0x00000080); + replicaOverwriteEnabled_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesStartExternalSyncRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStartExternalSyncRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStartExternalSyncRequestOrBuilder.java new file mode 100644 index 000000000000..33f309a5f46a --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStartExternalSyncRequestOrBuilder.java @@ -0,0 +1,247 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesStartExternalSyncRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * External sync mode.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @return The enum numeric value on the wire for syncMode. + */ + int getSyncModeValue(); + + /** + * + * + *
+   * External sync mode.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + * + * + * @return The syncMode. + */ + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + getSyncMode(); + + /** + * + * + *
+   * Whether to skip the verification step (VESS).
+   * 
+ * + * bool skip_verification = 4; + * + * @return The skipVerification. + */ + boolean getSkipVerification(); + + /** + * + * + *
+   * MySQL-specific settings for start external sync.
+   * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + * + * @return Whether the mysqlSyncConfig field is set. + */ + boolean hasMysqlSyncConfig(); + + /** + * + * + *
+   * MySQL-specific settings for start external sync.
+   * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + * + * @return The mysqlSyncConfig. + */ + com.google.cloud.sql.v1beta4.MySqlSyncConfig getMysqlSyncConfig(); + + /** + * + * + *
+   * MySQL-specific settings for start external sync.
+   * 
+ * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6; + */ + com.google.cloud.sql.v1beta4.MySqlSyncConfigOrBuilder getMysqlSyncConfigOrBuilder(); + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Currently only applicable
+   * for MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for syncParallelLevel. + */ + int getSyncParallelLevelValue(); + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Currently only applicable
+   * for MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The syncParallelLevel. + */ + com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel getSyncParallelLevel(); + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for migrationType. + */ + int getMigrationTypeValue(); + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The migrationType. + */ + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + getMigrationType(); + + /** + * + * + *
+   * Optional. MySQL only. True if end-user has confirmed that this SES call
+   * will wipe replica databases overlapping with the proposed selected_objects.
+   * If this field is not set and there are both overlapping and additional
+   * databases proposed, an error will be returned.
+   * 
+ * + * bool replica_overwrite_enabled = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaOverwriteEnabled. + */ + boolean getReplicaOverwriteEnabled(); + + com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.SyncConfigCase + getSyncConfigCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStartReplicaRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStartReplicaRequest.java new file mode 100644 index 000000000000..444c01bf1f74 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStartReplicaRequest.java @@ -0,0 +1,774 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesStartReplicaRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest) + SqlInstancesStartReplicaRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesStartReplicaRequest"); + } + + // Use SqlInstancesStartReplicaRequest.newBuilder() to construct. + private SqlInstancesStartReplicaRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesStartReplicaRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStartReplicaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStartReplicaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest) + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStartReplicaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStartReplicaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStartReplicaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesStartReplicaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStartReplicaRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStartReplicaRequestOrBuilder.java new file mode 100644 index 000000000000..52cad3be9683 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStartReplicaRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesStartReplicaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStopReplicaRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStopReplicaRequest.java new file mode 100644 index 000000000000..871dc990e936 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStopReplicaRequest.java @@ -0,0 +1,770 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesStopReplicaRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest) + SqlInstancesStopReplicaRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesStopReplicaRequest"); + } + + // Use SqlInstancesStopReplicaRequest.newBuilder() to construct. + private SqlInstancesStopReplicaRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesStopReplicaRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStopReplicaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStopReplicaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest) + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStopReplicaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStopReplicaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesStopReplicaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the read replica.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesStopReplicaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStopReplicaRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStopReplicaRequestOrBuilder.java new file mode 100644 index 000000000000..cb44e94006b3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesStopReplicaRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesStopReplicaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the read replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesSwitchoverRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesSwitchoverRequest.java new file mode 100644 index 000000000000..d236b983bcec --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesSwitchoverRequest.java @@ -0,0 +1,1106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance switchover request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest} + */ +@com.google.protobuf.Generated +public final class SqlInstancesSwitchoverRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest) + SqlInstancesSwitchoverRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesSwitchoverRequest"); + } + + // Use SqlInstancesSwitchoverRequest.newBuilder() to construct. + private SqlInstancesSwitchoverRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesSwitchoverRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesSwitchoverRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesSwitchoverRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * ID of the project that contains the replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * ID of the project that contains the replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DB_TIMEOUT_FIELD_NUMBER = 3; + private com.google.protobuf.Duration dbTimeout_; + + /** + * + * + *
+   * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+   * timeout, which is a sum of all database operations. Default value is 10
+   * minutes and can be modified to a maximum value of 24 hours.
+   * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dbTimeout field is set. + */ + @java.lang.Override + public boolean hasDbTimeout() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+   * timeout, which is a sum of all database operations. Default value is 10
+   * minutes and can be modified to a maximum value of 24 hours.
+   * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dbTimeout. + */ + @java.lang.Override + public com.google.protobuf.Duration getDbTimeout() { + return dbTimeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : dbTimeout_; + } + + /** + * + * + *
+   * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+   * timeout, which is a sum of all database operations. Default value is 10
+   * minutes and can be modified to a maximum value of 24 hours.
+   * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDbTimeoutOrBuilder() { + return dbTimeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : dbTimeout_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getDbTimeout()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getDbTimeout()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasDbTimeout() != other.hasDbTimeout()) return false; + if (hasDbTimeout()) { + if (!getDbTimeout().equals(other.getDbTimeout())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasDbTimeout()) { + hash = (37 * hash) + DB_TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getDbTimeout().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance switchover request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest) + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesSwitchoverRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesSwitchoverRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetDbTimeoutFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + dbTimeout_ = null; + if (dbTimeoutBuilder_ != null) { + dbTimeoutBuilder_.dispose(); + dbTimeoutBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesSwitchoverRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dbTimeout_ = dbTimeoutBuilder_ == null ? dbTimeout_ : dbTimeoutBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasDbTimeout()) { + mergeDbTimeout(other.getDbTimeout()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetDbTimeoutFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL read replica instance name.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * ID of the project that contains the replica.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the replica.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * ID of the project that contains the replica.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the replica.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * ID of the project that contains the replica.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Duration dbTimeout_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + dbTimeoutBuilder_; + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dbTimeout field is set. + */ + public boolean hasDbTimeout() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dbTimeout. + */ + public com.google.protobuf.Duration getDbTimeout() { + if (dbTimeoutBuilder_ == null) { + return dbTimeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : dbTimeout_; + } else { + return dbTimeoutBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDbTimeout(com.google.protobuf.Duration value) { + if (dbTimeoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dbTimeout_ = value; + } else { + dbTimeoutBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDbTimeout(com.google.protobuf.Duration.Builder builderForValue) { + if (dbTimeoutBuilder_ == null) { + dbTimeout_ = builderForValue.build(); + } else { + dbTimeoutBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDbTimeout(com.google.protobuf.Duration value) { + if (dbTimeoutBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && dbTimeout_ != null + && dbTimeout_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDbTimeoutBuilder().mergeFrom(value); + } else { + dbTimeout_ = value; + } + } else { + dbTimeoutBuilder_.mergeFrom(value); + } + if (dbTimeout_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDbTimeout() { + bitField0_ = (bitField0_ & ~0x00000004); + dbTimeout_ = null; + if (dbTimeoutBuilder_ != null) { + dbTimeoutBuilder_.dispose(); + dbTimeoutBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Duration.Builder getDbTimeoutBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetDbTimeoutFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.DurationOrBuilder getDbTimeoutOrBuilder() { + if (dbTimeoutBuilder_ != null) { + return dbTimeoutBuilder_.getMessageOrBuilder(); + } else { + return dbTimeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : dbTimeout_; + } + } + + /** + * + * + *
+     * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+     * timeout, which is a sum of all database operations. Default value is 10
+     * minutes and can be modified to a maximum value of 24 hours.
+     * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetDbTimeoutFieldBuilder() { + if (dbTimeoutBuilder_ == null) { + dbTimeoutBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDbTimeout(), getParentForChildren(), isClean()); + dbTimeout_ = null; + } + return dbTimeoutBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesSwitchoverRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesSwitchoverRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesSwitchoverRequestOrBuilder.java new file mode 100644 index 000000000000..10e324651639 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesSwitchoverRequestOrBuilder.java @@ -0,0 +1,126 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesSwitchoverRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL read replica instance name.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * ID of the project that contains the replica.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * ID of the project that contains the replica.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+   * timeout, which is a sum of all database operations. Default value is 10
+   * minutes and can be modified to a maximum value of 24 hours.
+   * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dbTimeout field is set. + */ + boolean hasDbTimeout(); + + /** + * + * + *
+   * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+   * timeout, which is a sum of all database operations. Default value is 10
+   * minutes and can be modified to a maximum value of 24 hours.
+   * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dbTimeout. + */ + com.google.protobuf.Duration getDbTimeout(); + + /** + * + * + *
+   * Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
+   * timeout, which is a sum of all database operations. Default value is 10
+   * minutes and can be modified to a maximum value of 24 hours.
+   * 
+ * + * .google.protobuf.Duration db_timeout = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.DurationOrBuilder getDbTimeoutOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesTruncateLogRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesTruncateLogRequest.java new file mode 100644 index 000000000000..a96facbb6712 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesTruncateLogRequest.java @@ -0,0 +1,975 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesTruncateLogRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest) + SqlInstancesTruncateLogRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesTruncateLogRequest"); + } + + // Use SqlInstancesTruncateLogRequest.newBuilder() to construct. + private SqlInstancesTruncateLogRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesTruncateLogRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesTruncateLogRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesTruncateLogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest body_; + + /** + * .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.InstancesTruncateLogRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest) + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesTruncateLogRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesTruncateLogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesTruncateLogRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the Cloud SQL project.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest, + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ + != com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; */ + public com.google.cloud.sql.v1beta4.InstancesTruncateLogRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest, + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest, + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.Builder, + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesTruncateLogRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesTruncateLogRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesTruncateLogRequestOrBuilder.java new file mode 100644 index 000000000000..cd7748cdda49 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesTruncateLogRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesTruncateLogRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the Cloud SQL project.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest getBody(); + + /** .google.cloud.sql.v1beta4.InstancesTruncateLogRequest body = 100; */ + com.google.cloud.sql.v1beta4.InstancesTruncateLogRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesUpdateRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesUpdateRequest.java new file mode 100644 index 000000000000..c1b7fd9e1baf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesUpdateRequest.java @@ -0,0 +1,973 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesUpdateRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesUpdateRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesUpdateRequest) + SqlInstancesUpdateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesUpdateRequest"); + } + + // Use SqlInstancesUpdateRequest.newBuilder() to construct. + private SqlInstancesUpdateRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesUpdateRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesUpdateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesUpdateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.DatabaseInstance body_; + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstance getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesUpdateRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesUpdateRequest) + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesUpdateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesUpdateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesUpdateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.DatabaseInstance body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.DatabaseInstance getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.DatabaseInstance.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.DatabaseInstance value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public com.google.cloud.sql.v1beta4.DatabaseInstance.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + public com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.DatabaseInstance.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DatabaseInstance, + com.google.cloud.sql.v1beta4.DatabaseInstance.Builder, + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesUpdateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesUpdateRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesUpdateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesUpdateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesUpdateRequestOrBuilder.java new file mode 100644 index 000000000000..bed63bb6630e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesUpdateRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesUpdateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesUpdateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.DatabaseInstance body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.DatabaseInstance getBody(); + + /** .google.cloud.sql.v1beta4.DatabaseInstance body = 100; */ + com.google.cloud.sql.v1beta4.DatabaseInstanceOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesVerifyExternalSyncSettingsRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesVerifyExternalSyncSettingsRequest.java new file mode 100644 index 000000000000..c9c6a8a78be3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesVerifyExternalSyncSettingsRequest.java @@ -0,0 +1,2941 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest} */ +@com.google.protobuf.Generated +public final class SqlInstancesVerifyExternalSyncSettingsRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest) + SqlInstancesVerifyExternalSyncSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesVerifyExternalSyncSettingsRequest"); + } + + // Use SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() to construct. + private SqlInstancesVerifyExternalSyncSettingsRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesVerifyExternalSyncSettingsRequest() { + instance_ = ""; + project_ = ""; + syncMode_ = 0; + migrationType_ = 0; + syncParallelLevel_ = 0; + selectedObjects_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.Builder + .class); + } + + /** + * Protobuf enum {@code + * google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode} + */ + public enum ExternalSyncMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown external sync mode, will be defaulted to ONLINE mode
+     * 
+ * + * EXTERNAL_SYNC_MODE_UNSPECIFIED = 0; + */ + EXTERNAL_SYNC_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Online external sync will set up replication after initial data external
+     * sync
+     * 
+ * + * ONLINE = 1; + */ + ONLINE(1), + /** + * + * + *
+     * Offline external sync only dumps and loads a one-time snapshot of
+     * the primary instance's data
+     * 
+ * + * OFFLINE = 2; + */ + OFFLINE(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExternalSyncMode"); + } + + /** + * + * + *
+     * Unknown external sync mode, will be defaulted to ONLINE mode
+     * 
+ * + * EXTERNAL_SYNC_MODE_UNSPECIFIED = 0; + */ + public static final int EXTERNAL_SYNC_MODE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Online external sync will set up replication after initial data external
+     * sync
+     * 
+ * + * ONLINE = 1; + */ + public static final int ONLINE_VALUE = 1; + + /** + * + * + *
+     * Offline external sync only dumps and loads a one-time snapshot of
+     * the primary instance's data
+     * 
+ * + * OFFLINE = 2; + */ + public static final int OFFLINE_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 ExternalSyncMode 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 ExternalSyncMode forNumber(int value) { + switch (value) { + case 0: + return EXTERNAL_SYNC_MODE_UNSPECIFIED; + case 1: + return ONLINE; + case 2: + return OFFLINE; + 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 ExternalSyncMode findValueByNumber(int number) { + return ExternalSyncMode.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ExternalSyncMode[] VALUES = values(); + + public static ExternalSyncMode 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 ExternalSyncMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode) + } + + /** + * + * + *
+   * MigrationType determines whether the migration is a physical file-based
+   * migration or a logical dump file-based migration.
+   * 
+ * + * Protobuf enum {@code + * google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType} + */ + public enum MigrationType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value is a logical dump file-based migration
+     * 
+ * + * MIGRATION_TYPE_UNSPECIFIED = 0; + */ + MIGRATION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Logical dump file-based migration
+     * 
+ * + * LOGICAL = 1; + */ + LOGICAL(1), + /** + * + * + *
+     * Physical file-based migration
+     * 
+ * + * PHYSICAL = 2; + */ + PHYSICAL(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MigrationType"); + } + + /** + * + * + *
+     * Default value is a logical dump file-based migration
+     * 
+ * + * MIGRATION_TYPE_UNSPECIFIED = 0; + */ + public static final int MIGRATION_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Logical dump file-based migration
+     * 
+ * + * LOGICAL = 1; + */ + public static final int LOGICAL_VALUE = 1; + + /** + * + * + *
+     * Physical file-based migration
+     * 
+ * + * PHYSICAL = 2; + */ + public static final int PHYSICAL_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 MigrationType 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 MigrationType forNumber(int value) { + switch (value) { + case 0: + return MIGRATION_TYPE_UNSPECIFIED; + case 1: + return LOGICAL; + case 2: + return PHYSICAL; + 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 MigrationType findValueByNumber(int number) { + return MigrationType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final MigrationType[] VALUES = values(); + + public static MigrationType 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 MigrationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType) + } + + private int syncConfigCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object syncConfig_; + + public enum SyncConfigCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MYSQL_SYNC_CONFIG(6), + SYNCCONFIG_NOT_SET(0); + private final int value; + + private SyncConfigCase(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 SyncConfigCase valueOf(int value) { + return forNumber(value); + } + + public static SyncConfigCase forNumber(int value) { + switch (value) { + case 6: + return MYSQL_SYNC_CONFIG; + case 0: + return SYNCCONFIG_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SyncConfigCase getSyncConfigCase() { + return SyncConfigCase.forNumber(syncConfigCase_); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERIFY_CONNECTION_ONLY_FIELD_NUMBER = 3; + private boolean verifyConnectionOnly_ = false; + + /** + * + * + *
+   * Flag to enable verifying connection only
+   * 
+ * + * bool verify_connection_only = 3; + * + * @return The verifyConnectionOnly. + */ + @java.lang.Override + public boolean getVerifyConnectionOnly() { + return verifyConnectionOnly_; + } + + public static final int SYNC_MODE_FIELD_NUMBER = 4; + private int syncMode_ = 0; + + /** + * + * + *
+   * External sync mode
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @return The enum numeric value on the wire for syncMode. + */ + @java.lang.Override + public int getSyncModeValue() { + return syncMode_; + } + + /** + * + * + *
+   * External sync mode
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @return The syncMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + getSyncMode() { + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + result = + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .ExternalSyncMode.forNumber(syncMode_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .ExternalSyncMode.UNRECOGNIZED + : result; + } + + public static final int VERIFY_REPLICATION_ONLY_FIELD_NUMBER = 5; + private boolean verifyReplicationOnly_ = false; + + /** + * + * + *
+   * Optional. Flag to verify settings required by replication setup only
+   * 
+ * + * bool verify_replication_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The verifyReplicationOnly. + */ + @java.lang.Override + public boolean getVerifyReplicationOnly() { + return verifyReplicationOnly_; + } + + public static final int MYSQL_SYNC_CONFIG_FIELD_NUMBER = 6; + + /** + * + * + *
+   * Optional. MySQL-specific settings for start external sync.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the mysqlSyncConfig field is set. + */ + @java.lang.Override + public boolean hasMysqlSyncConfig() { + return syncConfigCase_ == 6; + } + + /** + * + * + *
+   * Optional. MySQL-specific settings for start external sync.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mysqlSyncConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlSyncConfig getMysqlSyncConfig() { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance(); + } + + /** + * + * + *
+   * Optional. MySQL-specific settings for start external sync.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlSyncConfigOrBuilder getMysqlSyncConfigOrBuilder() { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance(); + } + + public static final int MIGRATION_TYPE_FIELD_NUMBER = 7; + private int migrationType_ = 0; + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for migrationType. + */ + @java.lang.Override + public int getMigrationTypeValue() { + return migrationType_; + } + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The migrationType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + getMigrationType() { + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + result = + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .forNumber(migrationType_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .UNRECOGNIZED + : result; + } + + public static final int SYNC_PARALLEL_LEVEL_FIELD_NUMBER = 8; + private int syncParallelLevel_ = 0; + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Only applicable for
+   * PostgreSQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for syncParallelLevel. + */ + @java.lang.Override + public int getSyncParallelLevelValue() { + return syncParallelLevel_; + } + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Only applicable for
+   * PostgreSQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The syncParallelLevel. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel getSyncParallelLevel() { + com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel result = + com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel.forNumber(syncParallelLevel_); + return result == null + ? com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel.UNRECOGNIZED + : result; + } + + public static final int SELECTED_OBJECTS_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private java.util.List selectedObjects_; + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getSelectedObjectsList() { + return selectedObjects_; + } + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getSelectedObjectsOrBuilderList() { + return selectedObjects_; + } + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getSelectedObjectsCount() { + return selectedObjects_.size(); + } + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject getSelectedObjects(int index) { + return selectedObjects_.get(index); + } + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExternalSyncSelectedObjectOrBuilder + getSelectedObjectsOrBuilder(int index) { + return selectedObjects_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (verifyConnectionOnly_ != false) { + output.writeBool(3, verifyConnectionOnly_); + } + if (syncMode_ + != com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .ExternalSyncMode.EXTERNAL_SYNC_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, syncMode_); + } + if (verifyReplicationOnly_ != false) { + output.writeBool(5, verifyReplicationOnly_); + } + if (syncConfigCase_ == 6) { + output.writeMessage(6, (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_); + } + if (migrationType_ + != com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .MIGRATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, migrationType_); + } + if (syncParallelLevel_ + != com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel + .EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, syncParallelLevel_); + } + for (int i = 0; i < selectedObjects_.size(); i++) { + output.writeMessage(9, selectedObjects_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (verifyConnectionOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, verifyConnectionOnly_); + } + if (syncMode_ + != com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .ExternalSyncMode.EXTERNAL_SYNC_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, syncMode_); + } + if (verifyReplicationOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, verifyReplicationOnly_); + } + if (syncConfigCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_); + } + if (migrationType_ + != com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .MIGRATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, migrationType_); + } + if (syncParallelLevel_ + != com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel + .EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, syncParallelLevel_); + } + for (int i = 0; i < selectedObjects_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, selectedObjects_.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.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest other = + (com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (getVerifyConnectionOnly() != other.getVerifyConnectionOnly()) return false; + if (syncMode_ != other.syncMode_) return false; + if (getVerifyReplicationOnly() != other.getVerifyReplicationOnly()) return false; + if (migrationType_ != other.migrationType_) return false; + if (syncParallelLevel_ != other.syncParallelLevel_) return false; + if (!getSelectedObjectsList().equals(other.getSelectedObjectsList())) return false; + if (!getSyncConfigCase().equals(other.getSyncConfigCase())) return false; + switch (syncConfigCase_) { + case 6: + if (!getMysqlSyncConfig().equals(other.getMysqlSyncConfig())) 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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + VERIFY_CONNECTION_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getVerifyConnectionOnly()); + hash = (37 * hash) + SYNC_MODE_FIELD_NUMBER; + hash = (53 * hash) + syncMode_; + hash = (37 * hash) + VERIFY_REPLICATION_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getVerifyReplicationOnly()); + hash = (37 * hash) + MIGRATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + migrationType_; + hash = (37 * hash) + SYNC_PARALLEL_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + syncParallelLevel_; + if (getSelectedObjectsCount() > 0) { + hash = (37 * hash) + SELECTED_OBJECTS_FIELD_NUMBER; + hash = (53 * hash) + getSelectedObjectsList().hashCode(); + } + switch (syncConfigCase_) { + case 6: + hash = (37 * hash) + MYSQL_SYNC_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getMysqlSyncConfig().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest) + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.class, + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + verifyConnectionOnly_ = false; + syncMode_ = 0; + verifyReplicationOnly_ = false; + if (mysqlSyncConfigBuilder_ != null) { + mysqlSyncConfigBuilder_.clear(); + } + migrationType_ = 0; + syncParallelLevel_ = 0; + if (selectedObjectsBuilder_ == null) { + selectedObjects_ = java.util.Collections.emptyList(); + } else { + selectedObjects_ = null; + selectedObjectsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + syncConfigCase_ = 0; + syncConfig_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest build() { + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest result = + new com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest result) { + if (selectedObjectsBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0)) { + selectedObjects_ = java.util.Collections.unmodifiableList(selectedObjects_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.selectedObjects_ = selectedObjects_; + } else { + result.selectedObjects_ = selectedObjectsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.verifyConnectionOnly_ = verifyConnectionOnly_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.syncMode_ = syncMode_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.verifyReplicationOnly_ = verifyReplicationOnly_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.migrationType_ = migrationType_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.syncParallelLevel_ = syncParallelLevel_; + } + } + + private void buildPartialOneofs( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest result) { + result.syncConfigCase_ = syncConfigCase_; + result.syncConfig_ = this.syncConfig_; + if (syncConfigCase_ == 6 && mysqlSyncConfigBuilder_ != null) { + result.syncConfig_ = mysqlSyncConfigBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .getDefaultInstance()) return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getVerifyConnectionOnly() != false) { + setVerifyConnectionOnly(other.getVerifyConnectionOnly()); + } + if (other.syncMode_ != 0) { + setSyncModeValue(other.getSyncModeValue()); + } + if (other.getVerifyReplicationOnly() != false) { + setVerifyReplicationOnly(other.getVerifyReplicationOnly()); + } + if (other.migrationType_ != 0) { + setMigrationTypeValue(other.getMigrationTypeValue()); + } + if (other.syncParallelLevel_ != 0) { + setSyncParallelLevelValue(other.getSyncParallelLevelValue()); + } + if (selectedObjectsBuilder_ == null) { + if (!other.selectedObjects_.isEmpty()) { + if (selectedObjects_.isEmpty()) { + selectedObjects_ = other.selectedObjects_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureSelectedObjectsIsMutable(); + selectedObjects_.addAll(other.selectedObjects_); + } + onChanged(); + } + } else { + if (!other.selectedObjects_.isEmpty()) { + if (selectedObjectsBuilder_.isEmpty()) { + selectedObjectsBuilder_.dispose(); + selectedObjectsBuilder_ = null; + selectedObjects_ = other.selectedObjects_; + bitField0_ = (bitField0_ & ~0x00000100); + selectedObjectsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetSelectedObjectsFieldBuilder() + : null; + } else { + selectedObjectsBuilder_.addAllMessages(other.selectedObjects_); + } + } + } + switch (other.getSyncConfigCase()) { + case MYSQL_SYNC_CONFIG: + { + mergeMysqlSyncConfig(other.getMysqlSyncConfig()); + break; + } + case SYNCCONFIG_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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + verifyConnectionOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + syncMode_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + verifyReplicationOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + input.readMessage( + internalGetMysqlSyncConfigFieldBuilder().getBuilder(), extensionRegistry); + syncConfigCase_ = 6; + break; + } // case 50 + case 56: + { + migrationType_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: + { + syncParallelLevel_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 74: + { + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject m = + input.readMessage( + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.parser(), + extensionRegistry); + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(m); + } else { + selectedObjectsBuilder_.addMessage(m); + } + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int syncConfigCase_ = 0; + private java.lang.Object syncConfig_; + + public SyncConfigCase getSyncConfigCase() { + return SyncConfigCase.forNumber(syncConfigCase_); + } + + public Builder clearSyncConfig() { + syncConfigCase_ = 0; + syncConfig_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean verifyConnectionOnly_; + + /** + * + * + *
+     * Flag to enable verifying connection only
+     * 
+ * + * bool verify_connection_only = 3; + * + * @return The verifyConnectionOnly. + */ + @java.lang.Override + public boolean getVerifyConnectionOnly() { + return verifyConnectionOnly_; + } + + /** + * + * + *
+     * Flag to enable verifying connection only
+     * 
+ * + * bool verify_connection_only = 3; + * + * @param value The verifyConnectionOnly to set. + * @return This builder for chaining. + */ + public Builder setVerifyConnectionOnly(boolean value) { + + verifyConnectionOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Flag to enable verifying connection only
+     * 
+ * + * bool verify_connection_only = 3; + * + * @return This builder for chaining. + */ + public Builder clearVerifyConnectionOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + verifyConnectionOnly_ = false; + onChanged(); + return this; + } + + private int syncMode_ = 0; + + /** + * + * + *
+     * External sync mode
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @return The enum numeric value on the wire for syncMode. + */ + @java.lang.Override + public int getSyncModeValue() { + return syncMode_; + } + + /** + * + * + *
+     * External sync mode
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @param value The enum numeric value on the wire for syncMode to set. + * @return This builder for chaining. + */ + public Builder setSyncModeValue(int value) { + syncMode_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * External sync mode
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @return The syncMode. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .ExternalSyncMode + getSyncMode() { + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + result = + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .ExternalSyncMode.forNumber(syncMode_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .ExternalSyncMode.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * External sync mode
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @param value The syncMode to set. + * @return This builder for chaining. + */ + public Builder setSyncMode( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + syncMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * External sync mode
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @return This builder for chaining. + */ + public Builder clearSyncMode() { + bitField0_ = (bitField0_ & ~0x00000008); + syncMode_ = 0; + onChanged(); + return this; + } + + private boolean verifyReplicationOnly_; + + /** + * + * + *
+     * Optional. Flag to verify settings required by replication setup only
+     * 
+ * + * bool verify_replication_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The verifyReplicationOnly. + */ + @java.lang.Override + public boolean getVerifyReplicationOnly() { + return verifyReplicationOnly_; + } + + /** + * + * + *
+     * Optional. Flag to verify settings required by replication setup only
+     * 
+ * + * bool verify_replication_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The verifyReplicationOnly to set. + * @return This builder for chaining. + */ + public Builder setVerifyReplicationOnly(boolean value) { + + verifyReplicationOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Flag to verify settings required by replication setup only
+     * 
+ * + * bool verify_replication_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearVerifyReplicationOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + verifyReplicationOnly_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.MySqlSyncConfig, + com.google.cloud.sql.v1beta4.MySqlSyncConfig.Builder, + com.google.cloud.sql.v1beta4.MySqlSyncConfigOrBuilder> + mysqlSyncConfigBuilder_; + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the mysqlSyncConfig field is set. + */ + @java.lang.Override + public boolean hasMysqlSyncConfig() { + return syncConfigCase_ == 6; + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mysqlSyncConfig. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlSyncConfig getMysqlSyncConfig() { + if (mysqlSyncConfigBuilder_ == null) { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance(); + } else { + if (syncConfigCase_ == 6) { + return mysqlSyncConfigBuilder_.getMessage(); + } + return com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setMysqlSyncConfig(com.google.cloud.sql.v1beta4.MySqlSyncConfig value) { + if (mysqlSyncConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + syncConfig_ = value; + onChanged(); + } else { + mysqlSyncConfigBuilder_.setMessage(value); + } + syncConfigCase_ = 6; + return this; + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setMysqlSyncConfig( + com.google.cloud.sql.v1beta4.MySqlSyncConfig.Builder builderForValue) { + if (mysqlSyncConfigBuilder_ == null) { + syncConfig_ = builderForValue.build(); + onChanged(); + } else { + mysqlSyncConfigBuilder_.setMessage(builderForValue.build()); + } + syncConfigCase_ = 6; + return this; + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeMysqlSyncConfig(com.google.cloud.sql.v1beta4.MySqlSyncConfig value) { + if (mysqlSyncConfigBuilder_ == null) { + if (syncConfigCase_ == 6 + && syncConfig_ != com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance()) { + syncConfig_ = + com.google.cloud.sql.v1beta4.MySqlSyncConfig.newBuilder( + (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + syncConfig_ = value; + } + onChanged(); + } else { + if (syncConfigCase_ == 6) { + mysqlSyncConfigBuilder_.mergeFrom(value); + } else { + mysqlSyncConfigBuilder_.setMessage(value); + } + } + syncConfigCase_ = 6; + return this; + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearMysqlSyncConfig() { + if (mysqlSyncConfigBuilder_ == null) { + if (syncConfigCase_ == 6) { + syncConfigCase_ = 0; + syncConfig_ = null; + onChanged(); + } + } else { + if (syncConfigCase_ == 6) { + syncConfigCase_ = 0; + syncConfig_ = null; + } + mysqlSyncConfigBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.MySqlSyncConfig.Builder getMysqlSyncConfigBuilder() { + return internalGetMysqlSyncConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.MySqlSyncConfigOrBuilder getMysqlSyncConfigOrBuilder() { + if ((syncConfigCase_ == 6) && (mysqlSyncConfigBuilder_ != null)) { + return mysqlSyncConfigBuilder_.getMessageOrBuilder(); + } else { + if (syncConfigCase_ == 6) { + return (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_; + } + return com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Optional. MySQL-specific settings for start external sync.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.MySqlSyncConfig, + com.google.cloud.sql.v1beta4.MySqlSyncConfig.Builder, + com.google.cloud.sql.v1beta4.MySqlSyncConfigOrBuilder> + internalGetMysqlSyncConfigFieldBuilder() { + if (mysqlSyncConfigBuilder_ == null) { + if (!(syncConfigCase_ == 6)) { + syncConfig_ = com.google.cloud.sql.v1beta4.MySqlSyncConfig.getDefaultInstance(); + } + mysqlSyncConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.MySqlSyncConfig, + com.google.cloud.sql.v1beta4.MySqlSyncConfig.Builder, + com.google.cloud.sql.v1beta4.MySqlSyncConfigOrBuilder>( + (com.google.cloud.sql.v1beta4.MySqlSyncConfig) syncConfig_, + getParentForChildren(), + isClean()); + syncConfig_ = null; + } + syncConfigCase_ = 6; + onChanged(); + return mysqlSyncConfigBuilder_; + } + + private int migrationType_ = 0; + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for migrationType. + */ + @java.lang.Override + public int getMigrationTypeValue() { + return migrationType_; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for migrationType to set. + * @return This builder for chaining. + */ + public Builder setMigrationTypeValue(int value) { + migrationType_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The migrationType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + getMigrationType() { + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + result = + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + .MigrationType.forNumber(migrationType_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The migrationType to set. + * @return This builder for chaining. + */ + public Builder setMigrationType( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + migrationType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. MigrationType configures the migration to use physical files or
+     * logical dump files. If not set, then the logical dump file configuration is
+     * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMigrationType() { + bitField0_ = (bitField0_ & ~0x00000040); + migrationType_ = 0; + onChanged(); + return this; + } + + private int syncParallelLevel_ = 0; + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Only applicable for
+     * PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for syncParallelLevel. + */ + @java.lang.Override + public int getSyncParallelLevelValue() { + return syncParallelLevel_; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Only applicable for
+     * PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for syncParallelLevel to set. + * @return This builder for chaining. + */ + public Builder setSyncParallelLevelValue(int value) { + syncParallelLevel_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Only applicable for
+     * PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The syncParallelLevel. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel getSyncParallelLevel() { + com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel result = + com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel.forNumber(syncParallelLevel_); + return result == null + ? com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Only applicable for
+     * PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The syncParallelLevel to set. + * @return This builder for chaining. + */ + public Builder setSyncParallelLevel( + com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + syncParallelLevel_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Parallel level for initial data sync. Only applicable for
+     * PostgreSQL.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSyncParallelLevel() { + bitField0_ = (bitField0_ & ~0x00000080); + syncParallelLevel_ = 0; + onChanged(); + return this; + } + + private java.util.List + selectedObjects_ = java.util.Collections.emptyList(); + + private void ensureSelectedObjectsIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + selectedObjects_ = + new java.util.ArrayList( + selectedObjects_); + bitField0_ |= 0x00000100; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject, + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.Builder, + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObjectOrBuilder> + selectedObjectsBuilder_; + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSelectedObjectsList() { + if (selectedObjectsBuilder_ == null) { + return java.util.Collections.unmodifiableList(selectedObjects_); + } else { + return selectedObjectsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getSelectedObjectsCount() { + if (selectedObjectsBuilder_ == null) { + return selectedObjects_.size(); + } else { + return selectedObjectsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject getSelectedObjects(int index) { + if (selectedObjectsBuilder_ == null) { + return selectedObjects_.get(index); + } else { + return selectedObjectsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSelectedObjects( + int index, com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject value) { + if (selectedObjectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSelectedObjectsIsMutable(); + selectedObjects_.set(index, value); + onChanged(); + } else { + selectedObjectsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSelectedObjects( + int index, + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.Builder builderForValue) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.set(index, builderForValue.build()); + onChanged(); + } else { + selectedObjectsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects( + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject value) { + if (selectedObjectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(value); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects( + int index, com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject value) { + if (selectedObjectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(index, value); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects( + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.Builder builderForValue) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(builderForValue.build()); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSelectedObjects( + int index, + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.Builder builderForValue) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.add(index, builderForValue.build()); + onChanged(); + } else { + selectedObjectsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllSelectedObjects( + java.lang.Iterable + values) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, selectedObjects_); + onChanged(); + } else { + selectedObjectsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSelectedObjects() { + if (selectedObjectsBuilder_ == null) { + selectedObjects_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + } else { + selectedObjectsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeSelectedObjects(int index) { + if (selectedObjectsBuilder_ == null) { + ensureSelectedObjectsIsMutable(); + selectedObjects_.remove(index); + onChanged(); + } else { + selectedObjectsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.Builder + getSelectedObjectsBuilder(int index) { + return internalGetSelectedObjectsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ExternalSyncSelectedObjectOrBuilder + getSelectedObjectsOrBuilder(int index) { + if (selectedObjectsBuilder_ == null) { + return selectedObjects_.get(index); + } else { + return selectedObjectsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends com.google.cloud.sql.v1beta4.ExternalSyncSelectedObjectOrBuilder> + getSelectedObjectsOrBuilderList() { + if (selectedObjectsBuilder_ != null) { + return selectedObjectsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(selectedObjects_); + } + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.Builder + addSelectedObjectsBuilder() { + return internalGetSelectedObjectsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.Builder + addSelectedObjectsBuilder(int index) { + return internalGetSelectedObjectsFieldBuilder() + .addBuilder( + index, com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. Migrate only the specified objects from the source instance. If
+     * this field is empty, then migrate all objects.
+     * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSelectedObjectsBuilderList() { + return internalGetSelectedObjectsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject, + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.Builder, + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObjectOrBuilder> + internalGetSelectedObjectsFieldBuilder() { + if (selectedObjectsBuilder_ == null) { + selectedObjectsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject, + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.Builder, + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObjectOrBuilder>( + selectedObjects_, + ((bitField0_ & 0x00000100) != 0), + getParentForChildren(), + isClean()); + selectedObjects_ = null; + } + return selectedObjectsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest) + private static final com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesVerifyExternalSyncSettingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser + getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesVerifyExternalSyncSettingsRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesVerifyExternalSyncSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..c15fd0e00c89 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesVerifyExternalSyncSettingsRequestOrBuilder.java @@ -0,0 +1,322 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesVerifyExternalSyncSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Flag to enable verifying connection only
+   * 
+ * + * bool verify_connection_only = 3; + * + * @return The verifyConnectionOnly. + */ + boolean getVerifyConnectionOnly(); + + /** + * + * + *
+   * External sync mode
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @return The enum numeric value on the wire for syncMode. + */ + int getSyncModeValue(); + + /** + * + * + *
+   * External sync mode
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 4; + * + * + * @return The syncMode. + */ + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode + getSyncMode(); + + /** + * + * + *
+   * Optional. Flag to verify settings required by replication setup only
+   * 
+ * + * bool verify_replication_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The verifyReplicationOnly. + */ + boolean getVerifyReplicationOnly(); + + /** + * + * + *
+   * Optional. MySQL-specific settings for start external sync.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the mysqlSyncConfig field is set. + */ + boolean hasMysqlSyncConfig(); + + /** + * + * + *
+   * Optional. MySQL-specific settings for start external sync.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mysqlSyncConfig. + */ + com.google.cloud.sql.v1beta4.MySqlSyncConfig getMysqlSyncConfig(); + + /** + * + * + *
+   * Optional. MySQL-specific settings for start external sync.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.MySqlSyncConfig mysql_sync_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.MySqlSyncConfigOrBuilder getMysqlSyncConfigOrBuilder(); + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for migrationType. + */ + int getMigrationTypeValue(); + + /** + * + * + *
+   * Optional. MigrationType configures the migration to use physical files or
+   * logical dump files. If not set, then the logical dump file configuration is
+   * used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The migrationType. + */ + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType + getMigrationType(); + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Only applicable for
+   * PostgreSQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for syncParallelLevel. + */ + int getSyncParallelLevelValue(); + + /** + * + * + *
+   * Optional. Parallel level for initial data sync. Only applicable for
+   * PostgreSQL.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.ExternalSyncParallelLevel sync_parallel_level = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The syncParallelLevel. + */ + com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel getSyncParallelLevel(); + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getSelectedObjectsList(); + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject getSelectedObjects(int index); + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getSelectedObjectsCount(); + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getSelectedObjectsOrBuilderList(); + + /** + * + * + *
+   * Optional. Migrate only the specified objects from the source instance. If
+   * this field is empty, then migrate all objects.
+   * 
+ * + * + * repeated .google.cloud.sql.v1beta4.ExternalSyncSelectedObject selected_objects = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.sql.v1beta4.ExternalSyncSelectedObjectOrBuilder getSelectedObjectsOrBuilder( + int index); + + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.SyncConfigCase + getSyncConfigCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesVerifyExternalSyncSettingsResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesVerifyExternalSyncSettingsResponse.java new file mode 100644 index 000000000000..02b882bce5cb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesVerifyExternalSyncSettingsResponse.java @@ -0,0 +1,1686 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Instance verify external sync settings response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse} + */ +@com.google.protobuf.Generated +public final class SqlInstancesVerifyExternalSyncSettingsResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse) + SqlInstancesVerifyExternalSyncSettingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlInstancesVerifyExternalSyncSettingsResponse"); + } + + // Use SqlInstancesVerifyExternalSyncSettingsResponse.newBuilder() to construct. + private SqlInstancesVerifyExternalSyncSettingsResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlInstancesVerifyExternalSyncSettingsResponse() { + kind_ = ""; + errors_ = java.util.Collections.emptyList(); + warnings_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse.class, + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse.Builder + .class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#migrationSettingErrorList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#migrationSettingErrorList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERRORS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List errors_; + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + @java.lang.Override + public java.util.List getErrorsList() { + return errors_; + } + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + @java.lang.Override + public java.util.List + getErrorsOrBuilderList() { + return errors_; + } + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + @java.lang.Override + public int getErrorsCount() { + return errors_.size(); + } + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError getErrors(int index) { + return errors_.get(index); + } + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder getErrorsOrBuilder( + int index) { + return errors_.get(index); + } + + public static final int WARNINGS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List warnings_; + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + @java.lang.Override + public java.util.List + getWarningsList() { + return warnings_; + } + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + @java.lang.Override + public java.util.List + getWarningsOrBuilderList() { + return warnings_; + } + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + @java.lang.Override + public int getWarningsCount() { + return warnings_.size(); + } + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError getWarnings(int index) { + return warnings_.get(index); + } + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder getWarningsOrBuilder( + int index) { + return warnings_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < errors_.size(); i++) { + output.writeMessage(2, errors_.get(i)); + } + for (int i = 0; i < warnings_.size(); i++) { + output.writeMessage(3, warnings_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < errors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, errors_.get(i)); + } + for (int i = 0; i < warnings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, warnings_.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.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse other = + (com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getErrorsList().equals(other.getErrorsList())) return false; + if (!getWarningsList().equals(other.getWarningsList())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getErrorsCount() > 0) { + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrorsList().hashCode(); + } + if (getWarningsCount() > 0) { + hash = (37 * hash) + WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + getWarningsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Instance verify external sync settings response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse) + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse.class, + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse.Builder + .class); + } + + // Construct using + // com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (errorsBuilder_ == null) { + errors_ = java.util.Collections.emptyList(); + } else { + errors_ = null; + errorsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (warningsBuilder_ == null) { + warnings_ = java.util.Collections.emptyList(); + } else { + warnings_ = null; + warningsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlInstancesVerifyExternalSyncSettingsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse build() { + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + buildPartial() { + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse result = + new com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse result) { + if (errorsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + errors_ = java.util.Collections.unmodifiableList(errors_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.errors_ = errors_; + } else { + result.errors_ = errorsBuilder_.build(); + } + if (warningsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + warnings_ = java.util.Collections.unmodifiableList(warnings_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.warnings_ = warnings_; + } else { + result.warnings_ = warningsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse) { + return mergeFrom( + (com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse other) { + if (other + == com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + .getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (errorsBuilder_ == null) { + if (!other.errors_.isEmpty()) { + if (errors_.isEmpty()) { + errors_ = other.errors_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureErrorsIsMutable(); + errors_.addAll(other.errors_); + } + onChanged(); + } + } else { + if (!other.errors_.isEmpty()) { + if (errorsBuilder_.isEmpty()) { + errorsBuilder_.dispose(); + errorsBuilder_ = null; + errors_ = other.errors_; + bitField0_ = (bitField0_ & ~0x00000002); + errorsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetErrorsFieldBuilder() + : null; + } else { + errorsBuilder_.addAllMessages(other.errors_); + } + } + } + if (warningsBuilder_ == null) { + if (!other.warnings_.isEmpty()) { + if (warnings_.isEmpty()) { + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureWarningsIsMutable(); + warnings_.addAll(other.warnings_); + } + onChanged(); + } + } else { + if (!other.warnings_.isEmpty()) { + if (warningsBuilder_.isEmpty()) { + warningsBuilder_.dispose(); + warningsBuilder_ = null; + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000004); + warningsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetWarningsFieldBuilder() + : null; + } else { + warningsBuilder_.addAllMessages(other.warnings_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError m = + input.readMessage( + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.parser(), + extensionRegistry); + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(m); + } else { + errorsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError m = + input.readMessage( + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.parser(), + extensionRegistry); + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(m); + } else { + warningsBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#migrationSettingErrorList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#migrationSettingErrorList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#migrationSettingErrorList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#migrationSettingErrorList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#migrationSettingErrorList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List errors_ = + java.util.Collections.emptyList(); + + private void ensureErrorsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + errors_ = + new java.util.ArrayList( + errors_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder> + errorsBuilder_; + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public java.util.List + getErrorsList() { + if (errorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(errors_); + } else { + return errorsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public int getErrorsCount() { + if (errorsBuilder_ == null) { + return errors_.size(); + } else { + return errorsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError getErrors(int index) { + if (errorsBuilder_ == null) { + return errors_.get(index); + } else { + return errorsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public Builder setErrors( + int index, com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.set(index, value); + onChanged(); + } else { + errorsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public Builder setErrors( + int index, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.set(index, builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public Builder addErrors(com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.add(value); + onChanged(); + } else { + errorsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public Builder addErrors( + int index, com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.add(index, value); + onChanged(); + } else { + errorsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public Builder addErrors( + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public Builder addErrors( + int index, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(index, builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public Builder addAllErrors( + java.lang.Iterable + values) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errors_); + onChanged(); + } else { + errorsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public Builder clearErrors() { + if (errorsBuilder_ == null) { + errors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + errorsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public Builder removeErrors(int index) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.remove(index); + onChanged(); + } else { + errorsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder getErrorsBuilder( + int index) { + return internalGetErrorsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder getErrorsOrBuilder( + int index) { + if (errorsBuilder_ == null) { + return errors_.get(index); + } else { + return errorsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public java.util.List< + ? extends com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder> + getErrorsOrBuilderList() { + if (errorsBuilder_ != null) { + return errorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errors_); + } + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder addErrorsBuilder() { + return internalGetErrorsFieldBuilder() + .addBuilder( + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.getDefaultInstance()); + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder addErrorsBuilder( + int index) { + return internalGetErrorsFieldBuilder() + .addBuilder( + index, com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.getDefaultInstance()); + } + + /** + * + * + *
+     * List of migration violations.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + public java.util.List + getErrorsBuilderList() { + return internalGetErrorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder> + internalGetErrorsFieldBuilder() { + if (errorsBuilder_ == null) { + errorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder>( + errors_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + errors_ = null; + } + return errorsBuilder_; + } + + private java.util.List warnings_ = + java.util.Collections.emptyList(); + + private void ensureWarningsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + warnings_ = + new java.util.ArrayList( + warnings_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder> + warningsBuilder_; + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public java.util.List + getWarningsList() { + if (warningsBuilder_ == null) { + return java.util.Collections.unmodifiableList(warnings_); + } else { + return warningsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public int getWarningsCount() { + if (warningsBuilder_ == null) { + return warnings_.size(); + } else { + return warningsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError getWarnings(int index) { + if (warningsBuilder_ == null) { + return warnings_.get(index); + } else { + return warningsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public Builder setWarnings( + int index, com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.set(index, value); + onChanged(); + } else { + warningsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public Builder setWarnings( + int index, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.set(index, builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public Builder addWarnings(com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(value); + onChanged(); + } else { + warningsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public Builder addWarnings( + int index, com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError value) { + if (warningsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(index, value); + onChanged(); + } else { + warningsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public Builder addWarnings( + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public Builder addWarnings( + int index, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder builderForValue) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.add(index, builderForValue.build()); + onChanged(); + } else { + warningsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public Builder addAllWarnings( + java.lang.Iterable + values) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, warnings_); + onChanged(); + } else { + warningsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public Builder clearWarnings() { + if (warningsBuilder_ == null) { + warnings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + warningsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public Builder removeWarnings(int index) { + if (warningsBuilder_ == null) { + ensureWarningsIsMutable(); + warnings_.remove(index); + onChanged(); + } else { + warningsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder getWarningsBuilder( + int index) { + return internalGetWarningsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder getWarningsOrBuilder( + int index) { + if (warningsBuilder_ == null) { + return warnings_.get(index); + } else { + return warningsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public java.util.List< + ? extends com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder> + getWarningsOrBuilderList() { + if (warningsBuilder_ != null) { + return warningsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(warnings_); + } + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder addWarningsBuilder() { + return internalGetWarningsFieldBuilder() + .addBuilder( + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.getDefaultInstance()); + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder addWarningsBuilder( + int index) { + return internalGetWarningsFieldBuilder() + .addBuilder( + index, com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.getDefaultInstance()); + } + + /** + * + * + *
+     * List of migration warnings.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + public java.util.List + getWarningsBuilderList() { + return internalGetWarningsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder> + internalGetWarningsFieldBuilder() { + if (warningsBuilder_ == null) { + warningsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.Builder, + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder>( + warnings_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + warnings_ = null; + } + return warningsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse) + private static final com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse(); + } + + public static com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlInstancesVerifyExternalSyncSettingsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser + parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser + getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesVerifyExternalSyncSettingsResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesVerifyExternalSyncSettingsResponseOrBuilder.java new file mode 100644 index 000000000000..40469ab20bc6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlInstancesVerifyExternalSyncSettingsResponseOrBuilder.java @@ -0,0 +1,166 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlInstancesVerifyExternalSyncSettingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#migrationSettingErrorList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#migrationSettingErrorList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + java.util.List getErrorsList(); + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError getErrors(int index); + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + int getErrorsCount(); + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + java.util.List + getErrorsOrBuilderList(); + + /** + * + * + *
+   * List of migration violations.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError errors = 2; + */ + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder getErrorsOrBuilder(int index); + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + java.util.List getWarningsList(); + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingError getWarnings(int index); + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + int getWarningsCount(); + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + java.util.List + getWarningsOrBuilderList(); + + /** + * + * + *
+   * List of migration warnings.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SqlExternalSyncSettingError warnings = 3; + */ + com.google.cloud.sql.v1beta4.SqlExternalSyncSettingErrorOrBuilder getWarningsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlIpAddressType.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlIpAddressType.java new file mode 100644 index 000000000000..63dd26da1bbc --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlIpAddressType.java @@ -0,0 +1,243 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf enum {@code google.cloud.sql.v1beta4.SqlIpAddressType} */ +@com.google.protobuf.Generated +public enum SqlIpAddressType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown IP address type.
+   * 
+ * + * SQL_IP_ADDRESS_TYPE_UNSPECIFIED = 0; + */ + SQL_IP_ADDRESS_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * IP address the customer is supposed to connect to. Usually this is the
+   * load balancer's IP address
+   * 
+ * + * PRIMARY = 1; + */ + PRIMARY(1), + /** + * + * + *
+   * Source IP address of the connection a read replica establishes to its
+   * external primary instance. This IP address can be allowlisted by the
+   * customer in case it has a firewall that filters incoming connection to its
+   * on premises primary instance.
+   * 
+ * + * OUTGOING = 2; + */ + OUTGOING(2), + /** + * + * + *
+   * Private IP used when using private IPs and network peering.
+   * 
+ * + * PRIVATE = 3; + */ + PRIVATE(3), + /** + * + * + *
+   * V1 IP of a migrated instance. We want the user to
+   * decommission this IP as soon as the migration is complete.
+   * Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
+   * 
+ * + * MIGRATED_1ST_GEN = 4; + */ + MIGRATED_1ST_GEN(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlIpAddressType"); + } + + /** + * + * + *
+   * This is an unknown IP address type.
+   * 
+ * + * SQL_IP_ADDRESS_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_IP_ADDRESS_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * IP address the customer is supposed to connect to. Usually this is the
+   * load balancer's IP address
+   * 
+ * + * PRIMARY = 1; + */ + public static final int PRIMARY_VALUE = 1; + + /** + * + * + *
+   * Source IP address of the connection a read replica establishes to its
+   * external primary instance. This IP address can be allowlisted by the
+   * customer in case it has a firewall that filters incoming connection to its
+   * on premises primary instance.
+   * 
+ * + * OUTGOING = 2; + */ + public static final int OUTGOING_VALUE = 2; + + /** + * + * + *
+   * Private IP used when using private IPs and network peering.
+   * 
+ * + * PRIVATE = 3; + */ + public static final int PRIVATE_VALUE = 3; + + /** + * + * + *
+   * V1 IP of a migrated instance. We want the user to
+   * decommission this IP as soon as the migration is complete.
+   * Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
+   * 
+ * + * MIGRATED_1ST_GEN = 4; + */ + public static final int MIGRATED_1ST_GEN_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 SqlIpAddressType 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 SqlIpAddressType forNumber(int value) { + switch (value) { + case 0: + return SQL_IP_ADDRESS_TYPE_UNSPECIFIED; + case 1: + return PRIMARY; + case 2: + return OUTGOING; + case 3: + return PRIVATE; + case 4: + return MIGRATED_1ST_GEN; + 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 SqlIpAddressType findValueByNumber(int number) { + return SqlIpAddressType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(8); + } + + private static final SqlIpAddressType[] VALUES = values(); + + public static SqlIpAddressType 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 SqlIpAddressType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlIpAddressType) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlMaintenanceType.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlMaintenanceType.java new file mode 100644 index 000000000000..a0170bfaf737 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlMaintenanceType.java @@ -0,0 +1,255 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The type of maintenance to be performed on the instance.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.SqlMaintenanceType} + */ +@com.google.protobuf.Generated +public enum SqlMaintenanceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Maintenance type is unspecified.
+   * 
+ * + * SQL_MAINTENANCE_TYPE_UNSPECIFIED = 0; + */ + SQL_MAINTENANCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Indicates that a standalone instance is undergoing maintenance. The
+   * instance can be either a primary instance or a replica.
+   * 
+ * + * INSTANCE_MAINTENANCE = 1; + */ + INSTANCE_MAINTENANCE(1), + /** + * + * + *
+   * Indicates that the primary instance and all of its replicas, including
+   * cascading replicas, are undergoing maintenance. Maintenance is performed on
+   * groups of replicas first, followed by the primary instance.
+   * 
+ * + * REPLICA_INCLUDED_MAINTENANCE = 2; + */ + REPLICA_INCLUDED_MAINTENANCE(2), + /** + * + * + *
+   * Indicates that the standalone instance is undergoing maintenance, initiated
+   * by self-service. The instance can be either a primary instance or a
+   * replica.
+   * 
+ * + * INSTANCE_SELF_SERVICE_MAINTENANCE = 3; + */ + INSTANCE_SELF_SERVICE_MAINTENANCE(3), + /** + * + * + *
+   * Indicates that the primary instance and all of its replicas are undergoing
+   * maintenance, initiated by self-service. Maintenance is performed on groups
+   * of replicas first, followed by the primary instance.
+   * 
+ * + * REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE = 4; + */ + REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlMaintenanceType"); + } + + /** + * + * + *
+   * Maintenance type is unspecified.
+   * 
+ * + * SQL_MAINTENANCE_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_MAINTENANCE_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Indicates that a standalone instance is undergoing maintenance. The
+   * instance can be either a primary instance or a replica.
+   * 
+ * + * INSTANCE_MAINTENANCE = 1; + */ + public static final int INSTANCE_MAINTENANCE_VALUE = 1; + + /** + * + * + *
+   * Indicates that the primary instance and all of its replicas, including
+   * cascading replicas, are undergoing maintenance. Maintenance is performed on
+   * groups of replicas first, followed by the primary instance.
+   * 
+ * + * REPLICA_INCLUDED_MAINTENANCE = 2; + */ + public static final int REPLICA_INCLUDED_MAINTENANCE_VALUE = 2; + + /** + * + * + *
+   * Indicates that the standalone instance is undergoing maintenance, initiated
+   * by self-service. The instance can be either a primary instance or a
+   * replica.
+   * 
+ * + * INSTANCE_SELF_SERVICE_MAINTENANCE = 3; + */ + public static final int INSTANCE_SELF_SERVICE_MAINTENANCE_VALUE = 3; + + /** + * + * + *
+   * Indicates that the primary instance and all of its replicas are undergoing
+   * maintenance, initiated by self-service. Maintenance is performed on groups
+   * of replicas first, followed by the primary instance.
+   * 
+ * + * REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE = 4; + */ + public static final int REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE_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 SqlMaintenanceType 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 SqlMaintenanceType forNumber(int value) { + switch (value) { + case 0: + return SQL_MAINTENANCE_TYPE_UNSPECIFIED; + case 1: + return INSTANCE_MAINTENANCE; + case 2: + return REPLICA_INCLUDED_MAINTENANCE; + case 3: + return INSTANCE_SELF_SERVICE_MAINTENANCE; + case 4: + return REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE; + 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 SqlMaintenanceType findValueByNumber(int number) { + return SqlMaintenanceType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(3); + } + + private static final SqlMaintenanceType[] VALUES = values(); + + public static SqlMaintenanceType 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 SqlMaintenanceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlMaintenanceType) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsCancelRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsCancelRequest.java new file mode 100644 index 000000000000..e80413ad504e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsCancelRequest.java @@ -0,0 +1,786 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The request payload to cancel an operation.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlOperationsCancelRequest} + */ +@com.google.protobuf.Generated +public final class SqlOperationsCancelRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlOperationsCancelRequest) + SqlOperationsCancelRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlOperationsCancelRequest"); + } + + // Use SqlOperationsCancelRequest.newBuilder() to construct. + private SqlOperationsCancelRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlOperationsCancelRequest() { + operation_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsCancelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsCancelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest.class, + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest.Builder.class); + } + + public static final int OPERATION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object operation_ = ""; + + /** + * + * + *
+   * Instance operation ID.
+   * 
+ * + * string operation = 1; + * + * @return The operation. + */ + @java.lang.Override + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operation_ = s; + return s; + } + } + + /** + * + * + *
+   * Instance operation ID.
+   * 
+ * + * string operation = 1; + * + * @return The bytes for operation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(operation_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, operation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operation_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, operation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest other = + (com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest) obj; + + if (!getOperation().equals(other.getOperation())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request payload to cancel an operation.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlOperationsCancelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlOperationsCancelRequest) + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsCancelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsCancelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest.class, + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + operation_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsCancelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest build() { + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest result = + new com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.operation_ = operation_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest.getDefaultInstance()) + return this; + if (!other.getOperation().isEmpty()) { + operation_ = other.operation_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + operation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 operation_ = ""; + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @return The operation. + */ + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @return The bytes for operation. + */ + public com.google.protobuf.ByteString getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @param value The operation to set. + * @return This builder for chaining. + */ + public Builder setOperation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperation() { + operation_ = getDefaultInstance().getOperation(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @param value The bytes for operation to set. + * @return This builder for chaining. + */ + public Builder setOperationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + operation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlOperationsCancelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlOperationsCancelRequest) + private static final com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlOperationsCancelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsCancelRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsCancelRequestOrBuilder.java new file mode 100644 index 000000000000..50bd59d8e409 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsCancelRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlOperationsCancelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlOperationsCancelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Instance operation ID.
+   * 
+ * + * string operation = 1; + * + * @return The operation. + */ + java.lang.String getOperation(); + + /** + * + * + *
+   * Instance operation ID.
+   * 
+ * + * string operation = 1; + * + * @return The bytes for operation. + */ + com.google.protobuf.ByteString getOperationBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsGetRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsGetRequest.java new file mode 100644 index 000000000000..d79eacf40cee --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsGetRequest.java @@ -0,0 +1,769 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlOperationsGetRequest} */ +@com.google.protobuf.Generated +public final class SqlOperationsGetRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlOperationsGetRequest) + SqlOperationsGetRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlOperationsGetRequest"); + } + + // Use SqlOperationsGetRequest.newBuilder() to construct. + private SqlOperationsGetRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlOperationsGetRequest() { + operation_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest.class, + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest.Builder.class); + } + + public static final int OPERATION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object operation_ = ""; + + /** + * + * + *
+   * Instance operation ID.
+   * 
+ * + * string operation = 1; + * + * @return The operation. + */ + @java.lang.Override + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operation_ = s; + return s; + } + } + + /** + * + * + *
+   * Instance operation ID.
+   * 
+ * + * string operation = 1; + * + * @return The bytes for operation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(operation_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, operation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operation_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, operation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlOperationsGetRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest other = + (com.google.cloud.sql.v1beta4.SqlOperationsGetRequest) obj; + + if (!getOperation().equals(other.getOperation())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsGetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsGetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsGetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsGetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsGetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsGetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsGetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsGetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsGetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsGetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsGetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsGetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlOperationsGetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlOperationsGetRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlOperationsGetRequest) + com.google.cloud.sql.v1beta4.SqlOperationsGetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest.class, + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlOperationsGetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + operation_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsGetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlOperationsGetRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlOperationsGetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlOperationsGetRequest build() { + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlOperationsGetRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlOperationsGetRequest result = + new com.google.cloud.sql.v1beta4.SqlOperationsGetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlOperationsGetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.operation_ = operation_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlOperationsGetRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlOperationsGetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlOperationsGetRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlOperationsGetRequest.getDefaultInstance()) + return this; + if (!other.getOperation().isEmpty()) { + operation_ = other.operation_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + operation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 operation_ = ""; + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @return The operation. + */ + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @return The bytes for operation. + */ + public com.google.protobuf.ByteString getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @param value The operation to set. + * @return This builder for chaining. + */ + public Builder setOperation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperation() { + operation_ = getDefaultInstance().getOperation(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Instance operation ID.
+     * 
+ * + * string operation = 1; + * + * @param value The bytes for operation to set. + * @return This builder for chaining. + */ + public Builder setOperationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + operation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlOperationsGetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlOperationsGetRequest) + private static final com.google.cloud.sql.v1beta4.SqlOperationsGetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlOperationsGetRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsGetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlOperationsGetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlOperationsGetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsGetRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsGetRequestOrBuilder.java new file mode 100644 index 000000000000..4516f5059db5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsGetRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlOperationsGetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlOperationsGetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Instance operation ID.
+   * 
+ * + * string operation = 1; + * + * @return The operation. + */ + java.lang.String getOperation(); + + /** + * + * + *
+   * Instance operation ID.
+   * 
+ * + * string operation = 1; + * + * @return The bytes for operation. + */ + com.google.protobuf.ByteString getOperationBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsListRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsListRequest.java new file mode 100644 index 000000000000..79ae34449488 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsListRequest.java @@ -0,0 +1,1063 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlOperationsListRequest} */ +@com.google.protobuf.Generated +public final class SqlOperationsListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlOperationsListRequest) + SqlOperationsListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlOperationsListRequest"); + } + + // Use SqlOperationsListRequest.newBuilder() to construct. + private SqlOperationsListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlOperationsListRequest() { + instance_ = ""; + pageToken_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlOperationsListRequest.class, + com.google.cloud.sql.v1beta4.SqlOperationsListRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_RESULTS_FIELD_NUMBER = 2; + private int maxResults_ = 0; + + /** + * + * + *
+   * Maximum number of operations per response.
+   * 
+ * + * uint32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (maxResults_ != 0) { + output.writeUInt32(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (maxResults_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlOperationsListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlOperationsListRequest other = + (com.google.cloud.sql.v1beta4.SqlOperationsListRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (getMaxResults() != other.getMaxResults()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + MAX_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getMaxResults(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsListRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsListRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlOperationsListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlOperationsListRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlOperationsListRequest) + com.google.cloud.sql.v1beta4.SqlOperationsListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlOperationsListRequest.class, + com.google.cloud.sql.v1beta4.SqlOperationsListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlOperationsListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + maxResults_ = 0; + pageToken_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlOperationsListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlOperationsListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlOperationsListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlOperationsListRequest build() { + com.google.cloud.sql.v1beta4.SqlOperationsListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlOperationsListRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlOperationsListRequest result = + new com.google.cloud.sql.v1beta4.SqlOperationsListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlOperationsListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxResults_ = maxResults_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlOperationsListRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlOperationsListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlOperationsListRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlOperationsListRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getMaxResults() != 0) { + setMaxResults(other.getMaxResults()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + maxResults_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int maxResults_; + + /** + * + * + *
+     * Maximum number of operations per response.
+     * 
+ * + * uint32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + /** + * + * + *
+     * Maximum number of operations per response.
+     * 
+ * + * uint32 max_results = 2; + * + * @param value The maxResults to set. + * @return This builder for chaining. + */ + public Builder setMaxResults(int value) { + + maxResults_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum number of operations per response.
+     * 
+ * + * uint32 max_results = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxResults() { + bitField0_ = (bitField0_ & ~0x00000002); + maxResults_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * A previously-returned page token representing part of the larger set of
+     * results to view.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlOperationsListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlOperationsListRequest) + private static final com.google.cloud.sql.v1beta4.SqlOperationsListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlOperationsListRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlOperationsListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlOperationsListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlOperationsListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsListRequestOrBuilder.java new file mode 100644 index 000000000000..b1f859a94a45 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlOperationsListRequestOrBuilder.java @@ -0,0 +1,121 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlOperationsListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlOperationsListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Maximum number of operations per response.
+   * 
+ * + * uint32 max_results = 2; + * + * @return The maxResults. + */ + int getMaxResults(); + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * A previously-returned page token representing part of the larger set of
+   * results to view.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlPricingPlan.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlPricingPlan.java new file mode 100644 index 000000000000..ce3123729b51 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlPricingPlan.java @@ -0,0 +1,193 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The pricing plan for this instance.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.SqlPricingPlan} + */ +@com.google.protobuf.Generated +public enum SqlPricingPlan implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown pricing plan for this instance.
+   * 
+ * + * SQL_PRICING_PLAN_UNSPECIFIED = 0; + */ + SQL_PRICING_PLAN_UNSPECIFIED(0), + /** + * + * + *
+   * The instance is billed at a monthly flat rate.
+   * 
+ * + * PACKAGE = 1; + */ + PACKAGE(1), + /** + * + * + *
+   * The instance is billed per usage.
+   * 
+ * + * PER_USE = 2; + */ + PER_USE(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlPricingPlan"); + } + + /** + * + * + *
+   * This is an unknown pricing plan for this instance.
+   * 
+ * + * SQL_PRICING_PLAN_UNSPECIFIED = 0; + */ + public static final int SQL_PRICING_PLAN_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The instance is billed at a monthly flat rate.
+   * 
+ * + * PACKAGE = 1; + */ + public static final int PACKAGE_VALUE = 1; + + /** + * + * + *
+   * The instance is billed per usage.
+   * 
+ * + * PER_USE = 2; + */ + public static final int PER_USE_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 SqlPricingPlan 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 SqlPricingPlan forNumber(int value) { + switch (value) { + case 0: + return SQL_PRICING_PLAN_UNSPECIFIED; + case 1: + return PACKAGE; + case 2: + return PER_USE; + 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 SqlPricingPlan findValueByNumber(int number) { + return SqlPricingPlan.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(12); + } + + private static final SqlPricingPlan[] VALUES = values(); + + public static SqlPricingPlan 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 SqlPricingPlan(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlPricingPlan) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlReplicationType.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlReplicationType.java new file mode 100644 index 000000000000..9ca9523069a3 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlReplicationType.java @@ -0,0 +1,195 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf enum {@code google.cloud.sql.v1beta4.SqlReplicationType} */ +@com.google.protobuf.Generated +public enum SqlReplicationType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown replication type for a Cloud SQL instance.
+   * 
+ * + * SQL_REPLICATION_TYPE_UNSPECIFIED = 0; + */ + SQL_REPLICATION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * The synchronous replication mode for First Generation instances. It is the
+   * default value.
+   * 
+ * + * SYNCHRONOUS = 1; + */ + SYNCHRONOUS(1), + /** + * + * + *
+   * The asynchronous replication mode for First Generation instances. It
+   * provides a slight performance gain, but if an outage occurs while this
+   * option is set to asynchronous, you can lose up to a few seconds of updates
+   * to your data.
+   * 
+ * + * ASYNCHRONOUS = 2; + */ + ASYNCHRONOUS(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlReplicationType"); + } + + /** + * + * + *
+   * This is an unknown replication type for a Cloud SQL instance.
+   * 
+ * + * SQL_REPLICATION_TYPE_UNSPECIFIED = 0; + */ + public static final int SQL_REPLICATION_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The synchronous replication mode for First Generation instances. It is the
+   * default value.
+   * 
+ * + * SYNCHRONOUS = 1; + */ + public static final int SYNCHRONOUS_VALUE = 1; + + /** + * + * + *
+   * The asynchronous replication mode for First Generation instances. It
+   * provides a slight performance gain, but if an outage occurs while this
+   * option is set to asynchronous, you can lose up to a few seconds of updates
+   * to your data.
+   * 
+ * + * ASYNCHRONOUS = 2; + */ + public static final int ASYNCHRONOUS_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 SqlReplicationType 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 SqlReplicationType forNumber(int value) { + switch (value) { + case 0: + return SQL_REPLICATION_TYPE_UNSPECIFIED; + case 1: + return SYNCHRONOUS; + case 2: + return ASYNCHRONOUS; + 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 SqlReplicationType findValueByNumber(int number) { + return SqlReplicationType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(13); + } + + private static final SqlReplicationType[] VALUES = values(); + + public static SqlReplicationType 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 SqlReplicationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlReplicationType) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerAuditConfig.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerAuditConfig.java new file mode 100644 index 000000000000..ac50d753da2c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerAuditConfig.java @@ -0,0 +1,1362 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * SQL Server specific audit configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlServerAuditConfig} + */ +@com.google.protobuf.Generated +public final class SqlServerAuditConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlServerAuditConfig) + SqlServerAuditConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlServerAuditConfig"); + } + + // Use SqlServerAuditConfig.newBuilder() to construct. + private SqlServerAuditConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlServerAuditConfig() { + kind_ = ""; + bucket_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerAuditConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerAuditConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlServerAuditConfig.class, + com.google.cloud.sql.v1beta4.SqlServerAuditConfig.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always sql#sqlServerAuditConfig
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always sql#sqlServerAuditConfig
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUCKET_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object bucket_ = ""; + + /** + * + * + *
+   * The name of the destination bucket (e.g., gs://mybucket).
+   * 
+ * + * string bucket = 2; + * + * @return The bucket. + */ + @java.lang.Override + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the destination bucket (e.g., gs://mybucket).
+   * 
+ * + * string bucket = 2; + * + * @return The bytes for bucket. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RETENTION_INTERVAL_FIELD_NUMBER = 3; + private com.google.protobuf.Duration retentionInterval_; + + /** + * + * + *
+   * How long to keep generated audit files.
+   * 
+ * + * .google.protobuf.Duration retention_interval = 3; + * + * @return Whether the retentionInterval field is set. + */ + @java.lang.Override + public boolean hasRetentionInterval() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * How long to keep generated audit files.
+   * 
+ * + * .google.protobuf.Duration retention_interval = 3; + * + * @return The retentionInterval. + */ + @java.lang.Override + public com.google.protobuf.Duration getRetentionInterval() { + return retentionInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionInterval_; + } + + /** + * + * + *
+   * How long to keep generated audit files.
+   * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getRetentionIntervalOrBuilder() { + return retentionInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionInterval_; + } + + public static final int UPLOAD_INTERVAL_FIELD_NUMBER = 4; + private com.google.protobuf.Duration uploadInterval_; + + /** + * + * + *
+   * How often to upload generated audit files.
+   * 
+ * + * .google.protobuf.Duration upload_interval = 4; + * + * @return Whether the uploadInterval field is set. + */ + @java.lang.Override + public boolean hasUploadInterval() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * How often to upload generated audit files.
+   * 
+ * + * .google.protobuf.Duration upload_interval = 4; + * + * @return The uploadInterval. + */ + @java.lang.Override + public com.google.protobuf.Duration getUploadInterval() { + return uploadInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : uploadInterval_; + } + + /** + * + * + *
+   * How often to upload generated audit files.
+   * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getUploadIntervalOrBuilder() { + return uploadInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : uploadInterval_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(bucket_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, bucket_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getRetentionInterval()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getUploadInterval()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(bucket_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, bucket_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRetentionInterval()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUploadInterval()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlServerAuditConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlServerAuditConfig other = + (com.google.cloud.sql.v1beta4.SqlServerAuditConfig) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getBucket().equals(other.getBucket())) return false; + if (hasRetentionInterval() != other.hasRetentionInterval()) return false; + if (hasRetentionInterval()) { + if (!getRetentionInterval().equals(other.getRetentionInterval())) return false; + } + if (hasUploadInterval() != other.hasUploadInterval()) return false; + if (hasUploadInterval()) { + if (!getUploadInterval().equals(other.getUploadInterval())) return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + if (hasRetentionInterval()) { + hash = (37 * hash) + RETENTION_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getRetentionInterval().hashCode(); + } + if (hasUploadInterval()) { + hash = (37 * hash) + UPLOAD_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getUploadInterval().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlServerAuditConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlServerAuditConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerAuditConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlServerAuditConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerAuditConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlServerAuditConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerAuditConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlServerAuditConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerAuditConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlServerAuditConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerAuditConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlServerAuditConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlServerAuditConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SQL Server specific audit configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlServerAuditConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlServerAuditConfig) + com.google.cloud.sql.v1beta4.SqlServerAuditConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerAuditConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerAuditConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlServerAuditConfig.class, + com.google.cloud.sql.v1beta4.SqlServerAuditConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlServerAuditConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRetentionIntervalFieldBuilder(); + internalGetUploadIntervalFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + bucket_ = ""; + retentionInterval_ = null; + if (retentionIntervalBuilder_ != null) { + retentionIntervalBuilder_.dispose(); + retentionIntervalBuilder_ = null; + } + uploadInterval_ = null; + if (uploadIntervalBuilder_ != null) { + uploadIntervalBuilder_.dispose(); + uploadIntervalBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerAuditConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerAuditConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlServerAuditConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerAuditConfig build() { + com.google.cloud.sql.v1beta4.SqlServerAuditConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerAuditConfig buildPartial() { + com.google.cloud.sql.v1beta4.SqlServerAuditConfig result = + new com.google.cloud.sql.v1beta4.SqlServerAuditConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlServerAuditConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.bucket_ = bucket_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.retentionInterval_ = + retentionIntervalBuilder_ == null + ? retentionInterval_ + : retentionIntervalBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.uploadInterval_ = + uploadIntervalBuilder_ == null ? uploadInterval_ : uploadIntervalBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlServerAuditConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlServerAuditConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlServerAuditConfig other) { + if (other == com.google.cloud.sql.v1beta4.SqlServerAuditConfig.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getBucket().isEmpty()) { + bucket_ = other.bucket_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasRetentionInterval()) { + mergeRetentionInterval(other.getRetentionInterval()); + } + if (other.hasUploadInterval()) { + mergeUploadInterval(other.getUploadInterval()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + bucket_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetRetentionIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetUploadIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always sql#sqlServerAuditConfig
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always sql#sqlServerAuditConfig
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always sql#sqlServerAuditConfig
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always sql#sqlServerAuditConfig
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always sql#sqlServerAuditConfig
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object bucket_ = ""; + + /** + * + * + *
+     * The name of the destination bucket (e.g., gs://mybucket).
+     * 
+ * + * string bucket = 2; + * + * @return The bucket. + */ + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the destination bucket (e.g., gs://mybucket).
+     * 
+ * + * string bucket = 2; + * + * @return The bytes for bucket. + */ + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the destination bucket (e.g., gs://mybucket).
+     * 
+ * + * string bucket = 2; + * + * @param value The bucket to set. + * @return This builder for chaining. + */ + public Builder setBucket(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bucket_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the destination bucket (e.g., gs://mybucket).
+     * 
+ * + * string bucket = 2; + * + * @return This builder for chaining. + */ + public Builder clearBucket() { + bucket_ = getDefaultInstance().getBucket(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the destination bucket (e.g., gs://mybucket).
+     * 
+ * + * string bucket = 2; + * + * @param value The bytes for bucket to set. + * @return This builder for chaining. + */ + public Builder setBucketBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bucket_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Duration retentionInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + retentionIntervalBuilder_; + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + * + * @return Whether the retentionInterval field is set. + */ + public boolean hasRetentionInterval() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + * + * @return The retentionInterval. + */ + public com.google.protobuf.Duration getRetentionInterval() { + if (retentionIntervalBuilder_ == null) { + return retentionInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionInterval_; + } else { + return retentionIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + public Builder setRetentionInterval(com.google.protobuf.Duration value) { + if (retentionIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retentionInterval_ = value; + } else { + retentionIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + public Builder setRetentionInterval(com.google.protobuf.Duration.Builder builderForValue) { + if (retentionIntervalBuilder_ == null) { + retentionInterval_ = builderForValue.build(); + } else { + retentionIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + public Builder mergeRetentionInterval(com.google.protobuf.Duration value) { + if (retentionIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && retentionInterval_ != null + && retentionInterval_ != com.google.protobuf.Duration.getDefaultInstance()) { + getRetentionIntervalBuilder().mergeFrom(value); + } else { + retentionInterval_ = value; + } + } else { + retentionIntervalBuilder_.mergeFrom(value); + } + if (retentionInterval_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + public Builder clearRetentionInterval() { + bitField0_ = (bitField0_ & ~0x00000004); + retentionInterval_ = null; + if (retentionIntervalBuilder_ != null) { + retentionIntervalBuilder_.dispose(); + retentionIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + public com.google.protobuf.Duration.Builder getRetentionIntervalBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetRetentionIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + public com.google.protobuf.DurationOrBuilder getRetentionIntervalOrBuilder() { + if (retentionIntervalBuilder_ != null) { + return retentionIntervalBuilder_.getMessageOrBuilder(); + } else { + return retentionInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionInterval_; + } + } + + /** + * + * + *
+     * How long to keep generated audit files.
+     * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetRetentionIntervalFieldBuilder() { + if (retentionIntervalBuilder_ == null) { + retentionIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getRetentionInterval(), getParentForChildren(), isClean()); + retentionInterval_ = null; + } + return retentionIntervalBuilder_; + } + + private com.google.protobuf.Duration uploadInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + uploadIntervalBuilder_; + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + * + * @return Whether the uploadInterval field is set. + */ + public boolean hasUploadInterval() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + * + * @return The uploadInterval. + */ + public com.google.protobuf.Duration getUploadInterval() { + if (uploadIntervalBuilder_ == null) { + return uploadInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : uploadInterval_; + } else { + return uploadIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + public Builder setUploadInterval(com.google.protobuf.Duration value) { + if (uploadIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + uploadInterval_ = value; + } else { + uploadIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + public Builder setUploadInterval(com.google.protobuf.Duration.Builder builderForValue) { + if (uploadIntervalBuilder_ == null) { + uploadInterval_ = builderForValue.build(); + } else { + uploadIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + public Builder mergeUploadInterval(com.google.protobuf.Duration value) { + if (uploadIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && uploadInterval_ != null + && uploadInterval_ != com.google.protobuf.Duration.getDefaultInstance()) { + getUploadIntervalBuilder().mergeFrom(value); + } else { + uploadInterval_ = value; + } + } else { + uploadIntervalBuilder_.mergeFrom(value); + } + if (uploadInterval_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + public Builder clearUploadInterval() { + bitField0_ = (bitField0_ & ~0x00000008); + uploadInterval_ = null; + if (uploadIntervalBuilder_ != null) { + uploadIntervalBuilder_.dispose(); + uploadIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + public com.google.protobuf.Duration.Builder getUploadIntervalBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetUploadIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + public com.google.protobuf.DurationOrBuilder getUploadIntervalOrBuilder() { + if (uploadIntervalBuilder_ != null) { + return uploadIntervalBuilder_.getMessageOrBuilder(); + } else { + return uploadInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : uploadInterval_; + } + } + + /** + * + * + *
+     * How often to upload generated audit files.
+     * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetUploadIntervalFieldBuilder() { + if (uploadIntervalBuilder_ == null) { + uploadIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getUploadInterval(), getParentForChildren(), isClean()); + uploadInterval_ = null; + } + return uploadIntervalBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlServerAuditConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlServerAuditConfig) + private static final com.google.cloud.sql.v1beta4.SqlServerAuditConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlServerAuditConfig(); + } + + public static com.google.cloud.sql.v1beta4.SqlServerAuditConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlServerAuditConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerAuditConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerAuditConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerAuditConfigOrBuilder.java new file mode 100644 index 000000000000..460c9787c777 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerAuditConfigOrBuilder.java @@ -0,0 +1,154 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlServerAuditConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlServerAuditConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always sql#sqlServerAuditConfig
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always sql#sqlServerAuditConfig
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The name of the destination bucket (e.g., gs://mybucket).
+   * 
+ * + * string bucket = 2; + * + * @return The bucket. + */ + java.lang.String getBucket(); + + /** + * + * + *
+   * The name of the destination bucket (e.g., gs://mybucket).
+   * 
+ * + * string bucket = 2; + * + * @return The bytes for bucket. + */ + com.google.protobuf.ByteString getBucketBytes(); + + /** + * + * + *
+   * How long to keep generated audit files.
+   * 
+ * + * .google.protobuf.Duration retention_interval = 3; + * + * @return Whether the retentionInterval field is set. + */ + boolean hasRetentionInterval(); + + /** + * + * + *
+   * How long to keep generated audit files.
+   * 
+ * + * .google.protobuf.Duration retention_interval = 3; + * + * @return The retentionInterval. + */ + com.google.protobuf.Duration getRetentionInterval(); + + /** + * + * + *
+   * How long to keep generated audit files.
+   * 
+ * + * .google.protobuf.Duration retention_interval = 3; + */ + com.google.protobuf.DurationOrBuilder getRetentionIntervalOrBuilder(); + + /** + * + * + *
+   * How often to upload generated audit files.
+   * 
+ * + * .google.protobuf.Duration upload_interval = 4; + * + * @return Whether the uploadInterval field is set. + */ + boolean hasUploadInterval(); + + /** + * + * + *
+   * How often to upload generated audit files.
+   * 
+ * + * .google.protobuf.Duration upload_interval = 4; + * + * @return The uploadInterval. + */ + com.google.protobuf.Duration getUploadInterval(); + + /** + * + * + *
+   * How often to upload generated audit files.
+   * 
+ * + * .google.protobuf.Duration upload_interval = 4; + */ + com.google.protobuf.DurationOrBuilder getUploadIntervalOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerDatabaseDetails.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerDatabaseDetails.java new file mode 100644 index 000000000000..10efbb859692 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerDatabaseDetails.java @@ -0,0 +1,694 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Represents a Sql Server database on the Cloud SQL instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlServerDatabaseDetails} + */ +@com.google.protobuf.Generated +public final class SqlServerDatabaseDetails extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlServerDatabaseDetails) + SqlServerDatabaseDetailsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlServerDatabaseDetails"); + } + + // Use SqlServerDatabaseDetails.newBuilder() to construct. + private SqlServerDatabaseDetails(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlServerDatabaseDetails() { + recoveryModel_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerDatabaseDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerDatabaseDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.class, + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.Builder.class); + } + + public static final int COMPATIBILITY_LEVEL_FIELD_NUMBER = 1; + private int compatibilityLevel_ = 0; + + /** + * + * + *
+   * The version of SQL Server with which the database is to be made compatible
+   * 
+ * + * int32 compatibility_level = 1; + * + * @return The compatibilityLevel. + */ + @java.lang.Override + public int getCompatibilityLevel() { + return compatibilityLevel_; + } + + public static final int RECOVERY_MODEL_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object recoveryModel_ = ""; + + /** + * + * + *
+   * The recovery model of a SQL Server database
+   * 
+ * + * string recovery_model = 2; + * + * @return The recoveryModel. + */ + @java.lang.Override + public java.lang.String getRecoveryModel() { + java.lang.Object ref = recoveryModel_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recoveryModel_ = s; + return s; + } + } + + /** + * + * + *
+   * The recovery model of a SQL Server database
+   * 
+ * + * string recovery_model = 2; + * + * @return The bytes for recoveryModel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecoveryModelBytes() { + java.lang.Object ref = recoveryModel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recoveryModel_ = 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 (compatibilityLevel_ != 0) { + output.writeInt32(1, compatibilityLevel_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(recoveryModel_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, recoveryModel_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (compatibilityLevel_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, compatibilityLevel_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(recoveryModel_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, recoveryModel_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails other = + (com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails) obj; + + if (getCompatibilityLevel() != other.getCompatibilityLevel()) return false; + if (!getRecoveryModel().equals(other.getRecoveryModel())) return false; + if (!getUnknownFields().equals(other.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) + COMPATIBILITY_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getCompatibilityLevel(); + hash = (37 * hash) + RECOVERY_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getRecoveryModel().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Represents a Sql Server database on the Cloud SQL instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlServerDatabaseDetails} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlServerDatabaseDetails) + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerDatabaseDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerDatabaseDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.class, + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + compatibilityLevel_ = 0; + recoveryModel_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerDatabaseDetails_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails build() { + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails buildPartial() { + com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails result = + new com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.compatibilityLevel_ = compatibilityLevel_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recoveryModel_ = recoveryModel_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails other) { + if (other == com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.getDefaultInstance()) + return this; + if (other.getCompatibilityLevel() != 0) { + setCompatibilityLevel(other.getCompatibilityLevel()); + } + if (!other.getRecoveryModel().isEmpty()) { + recoveryModel_ = other.recoveryModel_; + 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 8: + { + compatibilityLevel_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + recoveryModel_ = 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 int compatibilityLevel_; + + /** + * + * + *
+     * The version of SQL Server with which the database is to be made compatible
+     * 
+ * + * int32 compatibility_level = 1; + * + * @return The compatibilityLevel. + */ + @java.lang.Override + public int getCompatibilityLevel() { + return compatibilityLevel_; + } + + /** + * + * + *
+     * The version of SQL Server with which the database is to be made compatible
+     * 
+ * + * int32 compatibility_level = 1; + * + * @param value The compatibilityLevel to set. + * @return This builder for chaining. + */ + public Builder setCompatibilityLevel(int value) { + + compatibilityLevel_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The version of SQL Server with which the database is to be made compatible
+     * 
+ * + * int32 compatibility_level = 1; + * + * @return This builder for chaining. + */ + public Builder clearCompatibilityLevel() { + bitField0_ = (bitField0_ & ~0x00000001); + compatibilityLevel_ = 0; + onChanged(); + return this; + } + + private java.lang.Object recoveryModel_ = ""; + + /** + * + * + *
+     * The recovery model of a SQL Server database
+     * 
+ * + * string recovery_model = 2; + * + * @return The recoveryModel. + */ + public java.lang.String getRecoveryModel() { + java.lang.Object ref = recoveryModel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recoveryModel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The recovery model of a SQL Server database
+     * 
+ * + * string recovery_model = 2; + * + * @return The bytes for recoveryModel. + */ + public com.google.protobuf.ByteString getRecoveryModelBytes() { + java.lang.Object ref = recoveryModel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recoveryModel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The recovery model of a SQL Server database
+     * 
+ * + * string recovery_model = 2; + * + * @param value The recoveryModel to set. + * @return This builder for chaining. + */ + public Builder setRecoveryModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + recoveryModel_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The recovery model of a SQL Server database
+     * 
+ * + * string recovery_model = 2; + * + * @return This builder for chaining. + */ + public Builder clearRecoveryModel() { + recoveryModel_ = getDefaultInstance().getRecoveryModel(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The recovery model of a SQL Server database
+     * 
+ * + * string recovery_model = 2; + * + * @param value The bytes for recoveryModel to set. + * @return This builder for chaining. + */ + public Builder setRecoveryModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + recoveryModel_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlServerDatabaseDetails) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlServerDatabaseDetails) + private static final com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails(); + } + + public static com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlServerDatabaseDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerDatabaseDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerDatabaseDetailsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerDatabaseDetailsOrBuilder.java new file mode 100644 index 000000000000..16c1f8e38b2d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerDatabaseDetailsOrBuilder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlServerDatabaseDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlServerDatabaseDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The version of SQL Server with which the database is to be made compatible
+   * 
+ * + * int32 compatibility_level = 1; + * + * @return The compatibilityLevel. + */ + int getCompatibilityLevel(); + + /** + * + * + *
+   * The recovery model of a SQL Server database
+   * 
+ * + * string recovery_model = 2; + * + * @return The recoveryModel. + */ + java.lang.String getRecoveryModel(); + + /** + * + * + *
+   * The recovery model of a SQL Server database
+   * 
+ * + * string recovery_model = 2; + * + * @return The bytes for recoveryModel. + */ + com.google.protobuf.ByteString getRecoveryModelBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerEntraIdConfig.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerEntraIdConfig.java new file mode 100644 index 000000000000..7afadc6c0db9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerEntraIdConfig.java @@ -0,0 +1,974 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * SQL Server Entra ID configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlServerEntraIdConfig} + */ +@com.google.protobuf.Generated +public final class SqlServerEntraIdConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlServerEntraIdConfig) + SqlServerEntraIdConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlServerEntraIdConfig"); + } + + // Use SqlServerEntraIdConfig.newBuilder() to construct. + private SqlServerEntraIdConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlServerEntraIdConfig() { + kind_ = ""; + tenantId_ = ""; + applicationId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerEntraIdConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerEntraIdConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.class, + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * Output only. This is always sql#sqlServerEntraIdConfig
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. This is always sql#sqlServerEntraIdConfig
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TENANT_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object tenantId_ = ""; + + /** + * + * + *
+   * Optional. The tenant ID for the Entra ID configuration.
+   * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The tenantId. + */ + @java.lang.Override + public java.lang.String getTenantId() { + java.lang.Object ref = tenantId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tenantId_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The tenant ID for the Entra ID configuration.
+   * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for tenantId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTenantIdBytes() { + java.lang.Object ref = tenantId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tenantId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APPLICATION_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object applicationId_ = ""; + + /** + * + * + *
+   * Optional. The application ID for the Entra ID configuration.
+   * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The applicationId. + */ + @java.lang.Override + public java.lang.String getApplicationId() { + java.lang.Object ref = applicationId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + applicationId_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The application ID for the Entra ID configuration.
+   * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for applicationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApplicationIdBytes() { + java.lang.Object ref = applicationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationId_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tenantId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, tenantId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, applicationId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tenantId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, tenantId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, applicationId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig other = + (com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getTenantId().equals(other.getTenantId())) return false; + if (!getApplicationId().equals(other.getApplicationId())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + TENANT_ID_FIELD_NUMBER; + hash = (53 * hash) + getTenantId().hashCode(); + hash = (37 * hash) + APPLICATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getApplicationId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SQL Server Entra ID configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlServerEntraIdConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlServerEntraIdConfig) + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerEntraIdConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerEntraIdConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.class, + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + tenantId_ = ""; + applicationId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlServerEntraIdConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig build() { + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig buildPartial() { + com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig result = + new com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tenantId_ = tenantId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.applicationId_ = applicationId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig other) { + if (other == com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTenantId().isEmpty()) { + tenantId_ = other.tenantId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getApplicationId().isEmpty()) { + applicationId_ = other.applicationId_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + tenantId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + applicationId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * Output only. This is always sql#sqlServerEntraIdConfig
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. This is always sql#sqlServerEntraIdConfig
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. This is always sql#sqlServerEntraIdConfig
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This is always sql#sqlServerEntraIdConfig
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This is always sql#sqlServerEntraIdConfig
+     * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object tenantId_ = ""; + + /** + * + * + *
+     * Optional. The tenant ID for the Entra ID configuration.
+     * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The tenantId. + */ + public java.lang.String getTenantId() { + java.lang.Object ref = tenantId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tenantId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The tenant ID for the Entra ID configuration.
+     * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for tenantId. + */ + public com.google.protobuf.ByteString getTenantIdBytes() { + java.lang.Object ref = tenantId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tenantId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The tenant ID for the Entra ID configuration.
+     * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The tenantId to set. + * @return This builder for chaining. + */ + public Builder setTenantId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tenantId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The tenant ID for the Entra ID configuration.
+     * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearTenantId() { + tenantId_ = getDefaultInstance().getTenantId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The tenant ID for the Entra ID configuration.
+     * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for tenantId to set. + * @return This builder for chaining. + */ + public Builder setTenantIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tenantId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object applicationId_ = ""; + + /** + * + * + *
+     * Optional. The application ID for the Entra ID configuration.
+     * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The applicationId. + */ + public java.lang.String getApplicationId() { + java.lang.Object ref = applicationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + applicationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The application ID for the Entra ID configuration.
+     * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for applicationId. + */ + public com.google.protobuf.ByteString getApplicationIdBytes() { + java.lang.Object ref = applicationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The application ID for the Entra ID configuration.
+     * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The applicationId to set. + * @return This builder for chaining. + */ + public Builder setApplicationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + applicationId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The application ID for the Entra ID configuration.
+     * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearApplicationId() { + applicationId_ = getDefaultInstance().getApplicationId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The application ID for the Entra ID configuration.
+     * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for applicationId to set. + * @return This builder for chaining. + */ + public Builder setApplicationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + applicationId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlServerEntraIdConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlServerEntraIdConfig) + private static final com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig(); + } + + public static com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlServerEntraIdConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerEntraIdConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerEntraIdConfigOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerEntraIdConfigOrBuilder.java new file mode 100644 index 000000000000..77fc8deaaab0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerEntraIdConfigOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlServerEntraIdConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlServerEntraIdConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. This is always sql#sqlServerEntraIdConfig
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * Output only. This is always sql#sqlServerEntraIdConfig
+   * 
+ * + * string kind = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Optional. The tenant ID for the Entra ID configuration.
+   * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The tenantId. + */ + java.lang.String getTenantId(); + + /** + * + * + *
+   * Optional. The tenant ID for the Entra ID configuration.
+   * 
+ * + * string tenant_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for tenantId. + */ + com.google.protobuf.ByteString getTenantIdBytes(); + + /** + * + * + *
+   * Optional. The application ID for the Entra ID configuration.
+   * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The applicationId. + */ + java.lang.String getApplicationId(); + + /** + * + * + *
+   * Optional. The application ID for the Entra ID configuration.
+   * 
+ * + * string application_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for applicationId. + */ + com.google.protobuf.ByteString getApplicationIdBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerUserDetails.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerUserDetails.java new file mode 100644 index 000000000000..3154f5595c12 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerUserDetails.java @@ -0,0 +1,794 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Represents a Sql Server user on the Cloud SQL instance.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlServerUserDetails} + */ +@com.google.protobuf.Generated +public final class SqlServerUserDetails extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlServerUserDetails) + SqlServerUserDetailsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlServerUserDetails"); + } + + // Use SqlServerUserDetails.newBuilder() to construct. + private SqlServerUserDetails(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlServerUserDetails() { + serverRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlServerUserDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlServerUserDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlServerUserDetails.class, + com.google.cloud.sql.v1beta4.SqlServerUserDetails.Builder.class); + } + + public static final int DISABLED_FIELD_NUMBER = 1; + private boolean disabled_ = false; + + /** + * + * + *
+   * If the user has been disabled
+   * 
+ * + * bool disabled = 1; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + public static final int SERVER_ROLES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList serverRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @return A list containing the serverRoles. + */ + public com.google.protobuf.ProtocolStringList getServerRolesList() { + return serverRoles_; + } + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @return The count of serverRoles. + */ + public int getServerRolesCount() { + return serverRoles_.size(); + } + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @param index The index of the element to return. + * @return The serverRoles at the given index. + */ + public java.lang.String getServerRoles(int index) { + return serverRoles_.get(index); + } + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @param index The index of the value to return. + * @return The bytes of the serverRoles at the given index. + */ + public com.google.protobuf.ByteString getServerRolesBytes(int index) { + return serverRoles_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (disabled_ != false) { + output.writeBool(1, disabled_); + } + for (int i = 0; i < serverRoles_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, serverRoles_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (disabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, disabled_); + } + { + int dataSize = 0; + for (int i = 0; i < serverRoles_.size(); i++) { + dataSize += computeStringSizeNoTag(serverRoles_.getRaw(i)); + } + size += dataSize; + size += 1 * getServerRolesList().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.sql.v1beta4.SqlServerUserDetails)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlServerUserDetails other = + (com.google.cloud.sql.v1beta4.SqlServerUserDetails) obj; + + if (getDisabled() != other.getDisabled()) return false; + if (!getServerRolesList().equals(other.getServerRolesList())) return false; + if (!getUnknownFields().equals(other.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) + DISABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisabled()); + if (getServerRolesCount() > 0) { + hash = (37 * hash) + SERVER_ROLES_FIELD_NUMBER; + hash = (53 * hash) + getServerRolesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlServerUserDetails parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlServerUserDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerUserDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlServerUserDetails parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerUserDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlServerUserDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerUserDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlServerUserDetails parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerUserDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlServerUserDetails parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlServerUserDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlServerUserDetails parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlServerUserDetails prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Represents a Sql Server user on the Cloud SQL instance.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlServerUserDetails} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlServerUserDetails) + com.google.cloud.sql.v1beta4.SqlServerUserDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlServerUserDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlServerUserDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlServerUserDetails.class, + com.google.cloud.sql.v1beta4.SqlServerUserDetails.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlServerUserDetails.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + disabled_ = false; + serverRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlServerUserDetails_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerUserDetails getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlServerUserDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerUserDetails build() { + com.google.cloud.sql.v1beta4.SqlServerUserDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerUserDetails buildPartial() { + com.google.cloud.sql.v1beta4.SqlServerUserDetails result = + new com.google.cloud.sql.v1beta4.SqlServerUserDetails(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlServerUserDetails result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.disabled_ = disabled_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + serverRoles_.makeImmutable(); + result.serverRoles_ = serverRoles_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlServerUserDetails) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlServerUserDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlServerUserDetails other) { + if (other == com.google.cloud.sql.v1beta4.SqlServerUserDetails.getDefaultInstance()) + return this; + if (other.getDisabled() != false) { + setDisabled(other.getDisabled()); + } + if (!other.serverRoles_.isEmpty()) { + if (serverRoles_.isEmpty()) { + serverRoles_ = other.serverRoles_; + bitField0_ |= 0x00000002; + } else { + ensureServerRolesIsMutable(); + serverRoles_.addAll(other.serverRoles_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + disabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureServerRolesIsMutable(); + serverRoles_.add(s); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean disabled_; + + /** + * + * + *
+     * If the user has been disabled
+     * 
+ * + * bool disabled = 1; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + /** + * + * + *
+     * If the user has been disabled
+     * 
+ * + * bool disabled = 1; + * + * @param value The disabled to set. + * @return This builder for chaining. + */ + public Builder setDisabled(boolean value) { + + disabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * If the user has been disabled
+     * 
+ * + * bool disabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearDisabled() { + bitField0_ = (bitField0_ & ~0x00000001); + disabled_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList serverRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureServerRolesIsMutable() { + if (!serverRoles_.isModifiable()) { + serverRoles_ = new com.google.protobuf.LazyStringArrayList(serverRoles_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @return A list containing the serverRoles. + */ + public com.google.protobuf.ProtocolStringList getServerRolesList() { + serverRoles_.makeImmutable(); + return serverRoles_; + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @return The count of serverRoles. + */ + public int getServerRolesCount() { + return serverRoles_.size(); + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @param index The index of the element to return. + * @return The serverRoles at the given index. + */ + public java.lang.String getServerRoles(int index) { + return serverRoles_.get(index); + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @param index The index of the value to return. + * @return The bytes of the serverRoles at the given index. + */ + public com.google.protobuf.ByteString getServerRolesBytes(int index) { + return serverRoles_.getByteString(index); + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @param index The index to set the value at. + * @param value The serverRoles to set. + * @return This builder for chaining. + */ + public Builder setServerRoles(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerRolesIsMutable(); + serverRoles_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @param value The serverRoles to add. + * @return This builder for chaining. + */ + public Builder addServerRoles(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerRolesIsMutable(); + serverRoles_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @param values The serverRoles to add. + * @return This builder for chaining. + */ + public Builder addAllServerRoles(java.lang.Iterable values) { + ensureServerRolesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, serverRoles_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @return This builder for chaining. + */ + public Builder clearServerRoles() { + serverRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * The server roles for this user
+     * 
+ * + * repeated string server_roles = 2; + * + * @param value The bytes of the serverRoles to add. + * @return This builder for chaining. + */ + public Builder addServerRolesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureServerRolesIsMutable(); + serverRoles_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlServerUserDetails) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlServerUserDetails) + private static final com.google.cloud.sql.v1beta4.SqlServerUserDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlServerUserDetails(); + } + + public static com.google.cloud.sql.v1beta4.SqlServerUserDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlServerUserDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerUserDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerUserDetailsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerUserDetailsOrBuilder.java new file mode 100644 index 000000000000..6b41d2c96109 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlServerUserDetailsOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlServerUserDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlServerUserDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If the user has been disabled
+   * 
+ * + * bool disabled = 1; + * + * @return The disabled. + */ + boolean getDisabled(); + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @return A list containing the serverRoles. + */ + java.util.List getServerRolesList(); + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @return The count of serverRoles. + */ + int getServerRolesCount(); + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @param index The index of the element to return. + * @return The serverRoles at the given index. + */ + java.lang.String getServerRoles(int index); + + /** + * + * + *
+   * The server roles for this user
+   * 
+ * + * repeated string server_roles = 2; + * + * @param index The index of the value to return. + * @return The bytes of the serverRoles at the given index. + */ + com.google.protobuf.ByteString getServerRolesBytes(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsDeleteRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsDeleteRequest.java new file mode 100644 index 000000000000..792a210f5bd8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsDeleteRequest.java @@ -0,0 +1,959 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest} */ +@com.google.protobuf.Generated +public final class SqlSslCertsDeleteRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest) + SqlSslCertsDeleteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlSslCertsDeleteRequest"); + } + + // Use SqlSslCertsDeleteRequest.newBuilder() to construct. + private SqlSslCertsDeleteRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlSslCertsDeleteRequest() { + instance_ = ""; + project_ = ""; + sha1Fingerprint_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest.class, + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SHA1_FINGERPRINT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object sha1Fingerprint_ = ""; + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The sha1Fingerprint. + */ + @java.lang.Override + public java.lang.String getSha1Fingerprint() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sha1Fingerprint_ = s; + return s; + } + } + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The bytes for sha1Fingerprint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSha1FingerprintBytes() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sha1Fingerprint_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sha1Fingerprint_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, sha1Fingerprint_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sha1Fingerprint_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, sha1Fingerprint_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest other = + (com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getSha1Fingerprint().equals(other.getSha1Fingerprint())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + SHA1_FINGERPRINT_FIELD_NUMBER; + hash = (53 * hash) + getSha1Fingerprint().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest) + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest.class, + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + sha1Fingerprint_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsDeleteRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest build() { + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest result = + new com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sha1Fingerprint_ = sha1Fingerprint_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSha1Fingerprint().isEmpty()) { + sha1Fingerprint_ = other.sha1Fingerprint_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + sha1Fingerprint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object sha1Fingerprint_ = ""; + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @return The sha1Fingerprint. + */ + public java.lang.String getSha1Fingerprint() { + java.lang.Object ref = sha1Fingerprint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sha1Fingerprint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @return The bytes for sha1Fingerprint. + */ + public com.google.protobuf.ByteString getSha1FingerprintBytes() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sha1Fingerprint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @param value The sha1Fingerprint to set. + * @return This builder for chaining. + */ + public Builder setSha1Fingerprint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sha1Fingerprint_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @return This builder for chaining. + */ + public Builder clearSha1Fingerprint() { + sha1Fingerprint_ = getDefaultInstance().getSha1Fingerprint(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @param value The bytes for sha1Fingerprint to set. + * @return This builder for chaining. + */ + public Builder setSha1FingerprintBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sha1Fingerprint_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest) + private static final com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlSslCertsDeleteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsDeleteRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsDeleteRequestOrBuilder.java new file mode 100644 index 000000000000..32c4839362d5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsDeleteRequestOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlSslCertsDeleteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The sha1Fingerprint. + */ + java.lang.String getSha1Fingerprint(); + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The bytes for sha1Fingerprint. + */ + com.google.protobuf.ByteString getSha1FingerprintBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsGetRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsGetRequest.java new file mode 100644 index 000000000000..0cbfaabcbf15 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsGetRequest.java @@ -0,0 +1,958 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlSslCertsGetRequest} */ +@com.google.protobuf.Generated +public final class SqlSslCertsGetRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlSslCertsGetRequest) + SqlSslCertsGetRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlSslCertsGetRequest"); + } + + // Use SqlSslCertsGetRequest.newBuilder() to construct. + private SqlSslCertsGetRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlSslCertsGetRequest() { + instance_ = ""; + project_ = ""; + sha1Fingerprint_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest.class, + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SHA1_FINGERPRINT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object sha1Fingerprint_ = ""; + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The sha1Fingerprint. + */ + @java.lang.Override + public java.lang.String getSha1Fingerprint() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sha1Fingerprint_ = s; + return s; + } + } + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The bytes for sha1Fingerprint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSha1FingerprintBytes() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sha1Fingerprint_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sha1Fingerprint_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, sha1Fingerprint_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sha1Fingerprint_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, sha1Fingerprint_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest other = + (com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getSha1Fingerprint().equals(other.getSha1Fingerprint())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + SHA1_FINGERPRINT_FIELD_NUMBER; + hash = (53 * hash) + getSha1Fingerprint().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlSslCertsGetRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlSslCertsGetRequest) + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest.class, + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + sha1Fingerprint_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsGetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest build() { + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest result = + new com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sha1Fingerprint_ = sha1Fingerprint_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSha1Fingerprint().isEmpty()) { + sha1Fingerprint_ = other.sha1Fingerprint_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + sha1Fingerprint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object sha1Fingerprint_ = ""; + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @return The sha1Fingerprint. + */ + public java.lang.String getSha1Fingerprint() { + java.lang.Object ref = sha1Fingerprint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sha1Fingerprint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @return The bytes for sha1Fingerprint. + */ + public com.google.protobuf.ByteString getSha1FingerprintBytes() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sha1Fingerprint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @param value The sha1Fingerprint to set. + * @return This builder for chaining. + */ + public Builder setSha1Fingerprint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sha1Fingerprint_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @return This builder for chaining. + */ + public Builder clearSha1Fingerprint() { + sha1Fingerprint_ = getDefaultInstance().getSha1Fingerprint(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Sha1 FingerPrint.
+     * 
+ * + * string sha1_fingerprint = 3; + * + * @param value The bytes for sha1Fingerprint to set. + * @return This builder for chaining. + */ + public Builder setSha1FingerprintBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sha1Fingerprint_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlSslCertsGetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlSslCertsGetRequest) + private static final com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlSslCertsGetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsGetRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsGetRequestOrBuilder.java new file mode 100644 index 000000000000..9499face4fc4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsGetRequestOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlSslCertsGetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlSslCertsGetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The sha1Fingerprint. + */ + java.lang.String getSha1Fingerprint(); + + /** + * + * + *
+   * Sha1 FingerPrint.
+   * 
+ * + * string sha1_fingerprint = 3; + * + * @return The bytes for sha1Fingerprint. + */ + com.google.protobuf.ByteString getSha1FingerprintBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsInsertRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsInsertRequest.java new file mode 100644 index 000000000000..fe86ff9622cf --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsInsertRequest.java @@ -0,0 +1,974 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlSslCertsInsertRequest} */ +@com.google.protobuf.Generated +public final class SqlSslCertsInsertRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlSslCertsInsertRequest) + SqlSslCertsInsertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlSslCertsInsertRequest"); + } + + // Use SqlSslCertsInsertRequest.newBuilder() to construct. + private SqlSslCertsInsertRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlSslCertsInsertRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest.class, + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.SslCertsInsertRequest body_; + + /** + * .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsInsertRequest getBody() { + return body_ == null + ? com.google.cloud.sql.v1beta4.SslCertsInsertRequest.getDefaultInstance() + : body_; + } + + /** .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsInsertRequestOrBuilder getBodyOrBuilder() { + return body_ == null + ? com.google.cloud.sql.v1beta4.SslCertsInsertRequest.getDefaultInstance() + : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest other = + (com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlSslCertsInsertRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlSslCertsInsertRequest) + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest.class, + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsInsertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest build() { + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest result = + new com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.SslCertsInsertRequest body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCertsInsertRequest, + com.google.cloud.sql.v1beta4.SslCertsInsertRequest.Builder, + com.google.cloud.sql.v1beta4.SslCertsInsertRequestOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.SslCertsInsertRequest getBody() { + if (bodyBuilder_ == null) { + return body_ == null + ? com.google.cloud.sql.v1beta4.SslCertsInsertRequest.getDefaultInstance() + : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.SslCertsInsertRequest value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; */ + public Builder setBody( + com.google.cloud.sql.v1beta4.SslCertsInsertRequest.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.SslCertsInsertRequest value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1beta4.SslCertsInsertRequest.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; */ + public com.google.cloud.sql.v1beta4.SslCertsInsertRequest.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; */ + public com.google.cloud.sql.v1beta4.SslCertsInsertRequestOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null + ? com.google.cloud.sql.v1beta4.SslCertsInsertRequest.getDefaultInstance() + : body_; + } + } + + /** .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCertsInsertRequest, + com.google.cloud.sql.v1beta4.SslCertsInsertRequest.Builder, + com.google.cloud.sql.v1beta4.SslCertsInsertRequestOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCertsInsertRequest, + com.google.cloud.sql.v1beta4.SslCertsInsertRequest.Builder, + com.google.cloud.sql.v1beta4.SslCertsInsertRequestOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlSslCertsInsertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlSslCertsInsertRequest) + private static final com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlSslCertsInsertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsInsertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsInsertRequestOrBuilder.java new file mode 100644 index 000000000000..f8942535e6e4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsInsertRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlSslCertsInsertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlSslCertsInsertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.SslCertsInsertRequest getBody(); + + /** .google.cloud.sql.v1beta4.SslCertsInsertRequest body = 100; */ + com.google.cloud.sql.v1beta4.SslCertsInsertRequestOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsListRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsListRequest.java new file mode 100644 index 000000000000..87813f88a03d --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsListRequest.java @@ -0,0 +1,769 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlSslCertsListRequest} */ +@com.google.protobuf.Generated +public final class SqlSslCertsListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlSslCertsListRequest) + SqlSslCertsListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlSslCertsListRequest"); + } + + // Use SqlSslCertsListRequest.newBuilder() to construct. + private SqlSslCertsListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlSslCertsListRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest.class, + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlSslCertsListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest other = + (com.google.cloud.sql.v1beta4.SqlSslCertsListRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsListRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsListRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlSslCertsListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlSslCertsListRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlSslCertsListRequest) + com.google.cloud.sql.v1beta4.SqlSslCertsListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest.class, + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlSslCertsListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_SqlSslCertsListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlSslCertsListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsListRequest build() { + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsListRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlSslCertsListRequest result = + new com.google.cloud.sql.v1beta4.SqlSslCertsListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlSslCertsListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlSslCertsListRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlSslCertsListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlSslCertsListRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlSslCertsListRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Cloud SQL instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlSslCertsListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlSslCertsListRequest) + private static final com.google.cloud.sql.v1beta4.SqlSslCertsListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlSslCertsListRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlSslCertsListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlSslCertsListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSslCertsListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsListRequestOrBuilder.java new file mode 100644 index 000000000000..597340f2e9cb --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSslCertsListRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlSslCertsListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlSslCertsListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Cloud SQL instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSubOperationType.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSubOperationType.java new file mode 100644 index 000000000000..208f7417b1a6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSubOperationType.java @@ -0,0 +1,693 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The sub operation type based on the operation type.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlSubOperationType} + */ +@com.google.protobuf.Generated +public final class SqlSubOperationType extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlSubOperationType) + SqlSubOperationTypeOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlSubOperationType"); + } + + // Use SqlSubOperationType.newBuilder() to construct. + private SqlSubOperationType(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlSubOperationType() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlSubOperationType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlSubOperationType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlSubOperationType.class, + com.google.cloud.sql.v1beta4.SqlSubOperationType.Builder.class); + } + + private int subOperationDetailsCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object subOperationDetails_; + + public enum SubOperationDetailsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MAINTENANCE_TYPE(1), + SUBOPERATIONDETAILS_NOT_SET(0); + private final int value; + + private SubOperationDetailsCase(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 SubOperationDetailsCase valueOf(int value) { + return forNumber(value); + } + + public static SubOperationDetailsCase forNumber(int value) { + switch (value) { + case 1: + return MAINTENANCE_TYPE; + case 0: + return SUBOPERATIONDETAILS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SubOperationDetailsCase getSubOperationDetailsCase() { + return SubOperationDetailsCase.forNumber(subOperationDetailsCase_); + } + + public static final int MAINTENANCE_TYPE_FIELD_NUMBER = 1; + + /** + * + * + *
+   * The type of maintenance to be performed on the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlMaintenanceType maintenance_type = 1; + * + * @return Whether the maintenanceType field is set. + */ + public boolean hasMaintenanceType() { + return subOperationDetailsCase_ == 1; + } + + /** + * + * + *
+   * The type of maintenance to be performed on the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlMaintenanceType maintenance_type = 1; + * + * @return The enum numeric value on the wire for maintenanceType. + */ + public int getMaintenanceTypeValue() { + if (subOperationDetailsCase_ == 1) { + return (java.lang.Integer) subOperationDetails_; + } + return 0; + } + + /** + * + * + *
+   * The type of maintenance to be performed on the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlMaintenanceType maintenance_type = 1; + * + * @return The maintenanceType. + */ + public com.google.cloud.sql.v1beta4.SqlMaintenanceType getMaintenanceType() { + if (subOperationDetailsCase_ == 1) { + com.google.cloud.sql.v1beta4.SqlMaintenanceType result = + com.google.cloud.sql.v1beta4.SqlMaintenanceType.forNumber( + (java.lang.Integer) subOperationDetails_); + return result == null ? com.google.cloud.sql.v1beta4.SqlMaintenanceType.UNRECOGNIZED : result; + } + return com.google.cloud.sql.v1beta4.SqlMaintenanceType.SQL_MAINTENANCE_TYPE_UNSPECIFIED; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (subOperationDetailsCase_ == 1) { + output.writeEnum(1, ((java.lang.Integer) subOperationDetails_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (subOperationDetailsCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize( + 1, ((java.lang.Integer) subOperationDetails_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlSubOperationType)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlSubOperationType other = + (com.google.cloud.sql.v1beta4.SqlSubOperationType) obj; + + if (!getSubOperationDetailsCase().equals(other.getSubOperationDetailsCase())) return false; + switch (subOperationDetailsCase_) { + case 1: + if (getMaintenanceTypeValue() != other.getMaintenanceTypeValue()) 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 (subOperationDetailsCase_) { + case 1: + hash = (37 * hash) + MAINTENANCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceTypeValue(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlSubOperationType parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSubOperationType parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSubOperationType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSubOperationType parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSubOperationType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlSubOperationType parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSubOperationType parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSubOperationType parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSubOperationType parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSubOperationType parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlSubOperationType parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlSubOperationType parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlSubOperationType prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The sub operation type based on the operation type.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlSubOperationType} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlSubOperationType) + com.google.cloud.sql.v1beta4.SqlSubOperationTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlSubOperationType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlSubOperationType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlSubOperationType.class, + com.google.cloud.sql.v1beta4.SqlSubOperationType.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlSubOperationType.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + subOperationDetailsCase_ = 0; + subOperationDetails_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SqlSubOperationType_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSubOperationType getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlSubOperationType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSubOperationType build() { + com.google.cloud.sql.v1beta4.SqlSubOperationType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSubOperationType buildPartial() { + com.google.cloud.sql.v1beta4.SqlSubOperationType result = + new com.google.cloud.sql.v1beta4.SqlSubOperationType(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlSubOperationType result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.sql.v1beta4.SqlSubOperationType result) { + result.subOperationDetailsCase_ = subOperationDetailsCase_; + result.subOperationDetails_ = this.subOperationDetails_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlSubOperationType) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlSubOperationType) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlSubOperationType other) { + if (other == com.google.cloud.sql.v1beta4.SqlSubOperationType.getDefaultInstance()) + return this; + switch (other.getSubOperationDetailsCase()) { + case MAINTENANCE_TYPE: + { + setMaintenanceTypeValue(other.getMaintenanceTypeValue()); + break; + } + case SUBOPERATIONDETAILS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + subOperationDetailsCase_ = 1; + subOperationDetails_ = rawValue; + 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 subOperationDetailsCase_ = 0; + private java.lang.Object subOperationDetails_; + + public SubOperationDetailsCase getSubOperationDetailsCase() { + return SubOperationDetailsCase.forNumber(subOperationDetailsCase_); + } + + public Builder clearSubOperationDetails() { + subOperationDetailsCase_ = 0; + subOperationDetails_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * The type of maintenance to be performed on the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlMaintenanceType maintenance_type = 1; + * + * @return Whether the maintenanceType field is set. + */ + @java.lang.Override + public boolean hasMaintenanceType() { + return subOperationDetailsCase_ == 1; + } + + /** + * + * + *
+     * The type of maintenance to be performed on the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlMaintenanceType maintenance_type = 1; + * + * @return The enum numeric value on the wire for maintenanceType. + */ + @java.lang.Override + public int getMaintenanceTypeValue() { + if (subOperationDetailsCase_ == 1) { + return ((java.lang.Integer) subOperationDetails_).intValue(); + } + return 0; + } + + /** + * + * + *
+     * The type of maintenance to be performed on the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlMaintenanceType maintenance_type = 1; + * + * @param value The enum numeric value on the wire for maintenanceType to set. + * @return This builder for chaining. + */ + public Builder setMaintenanceTypeValue(int value) { + subOperationDetailsCase_ = 1; + subOperationDetails_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of maintenance to be performed on the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlMaintenanceType maintenance_type = 1; + * + * @return The maintenanceType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlMaintenanceType getMaintenanceType() { + if (subOperationDetailsCase_ == 1) { + com.google.cloud.sql.v1beta4.SqlMaintenanceType result = + com.google.cloud.sql.v1beta4.SqlMaintenanceType.forNumber( + (java.lang.Integer) subOperationDetails_); + return result == null + ? com.google.cloud.sql.v1beta4.SqlMaintenanceType.UNRECOGNIZED + : result; + } + return com.google.cloud.sql.v1beta4.SqlMaintenanceType.SQL_MAINTENANCE_TYPE_UNSPECIFIED; + } + + /** + * + * + *
+     * The type of maintenance to be performed on the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlMaintenanceType maintenance_type = 1; + * + * @param value The maintenanceType to set. + * @return This builder for chaining. + */ + public Builder setMaintenanceType(com.google.cloud.sql.v1beta4.SqlMaintenanceType value) { + if (value == null) { + throw new NullPointerException(); + } + subOperationDetailsCase_ = 1; + subOperationDetails_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of maintenance to be performed on the instance.
+     * 
+ * + * .google.cloud.sql.v1beta4.SqlMaintenanceType maintenance_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearMaintenanceType() { + if (subOperationDetailsCase_ == 1) { + subOperationDetailsCase_ = 0; + subOperationDetails_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlSubOperationType) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlSubOperationType) + private static final com.google.cloud.sql.v1beta4.SqlSubOperationType DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlSubOperationType(); + } + + public static com.google.cloud.sql.v1beta4.SqlSubOperationType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlSubOperationType parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlSubOperationType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSubOperationTypeOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSubOperationTypeOrBuilder.java new file mode 100644 index 000000000000..69fcb6f291fd --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSubOperationTypeOrBuilder.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlSubOperationTypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlSubOperationType) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The type of maintenance to be performed on the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlMaintenanceType maintenance_type = 1; + * + * @return Whether the maintenanceType field is set. + */ + boolean hasMaintenanceType(); + + /** + * + * + *
+   * The type of maintenance to be performed on the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlMaintenanceType maintenance_type = 1; + * + * @return The enum numeric value on the wire for maintenanceType. + */ + int getMaintenanceTypeValue(); + + /** + * + * + *
+   * The type of maintenance to be performed on the instance.
+   * 
+ * + * .google.cloud.sql.v1beta4.SqlMaintenanceType maintenance_type = 1; + * + * @return The maintenanceType. + */ + com.google.cloud.sql.v1beta4.SqlMaintenanceType getMaintenanceType(); + + com.google.cloud.sql.v1beta4.SqlSubOperationType.SubOperationDetailsCase + getSubOperationDetailsCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSuspensionReason.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSuspensionReason.java new file mode 100644 index 000000000000..32faa50ad995 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlSuspensionReason.java @@ -0,0 +1,271 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The suspension reason of the database instance if the state is SUSPENDED.
+ * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.SqlSuspensionReason} + */ +@com.google.protobuf.Generated +public enum SqlSuspensionReason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown suspension reason.
+   * 
+ * + * SQL_SUSPENSION_REASON_UNSPECIFIED = 0; + */ + SQL_SUSPENSION_REASON_UNSPECIFIED(0), + /** + * + * + *
+   * The instance is suspended due to billing issues (for example:, account
+   * issue)
+   * 
+ * + * BILLING_ISSUE = 2; + */ + BILLING_ISSUE(2), + /** + * + * + *
+   * The instance is suspended due to illegal content (for example:, child
+   * pornography, copyrighted material, etc.).
+   * 
+ * + * LEGAL_ISSUE = 3; + */ + LEGAL_ISSUE(3), + /** + * + * + *
+   * The instance is causing operational issues (for example:, causing the
+   * database to crash).
+   * 
+ * + * OPERATIONAL_ISSUE = 4; + */ + OPERATIONAL_ISSUE(4), + /** + * + * + *
+   * The KMS key used by the instance is either revoked or denied access to
+   * 
+ * + * KMS_KEY_ISSUE = 5; + */ + KMS_KEY_ISSUE(5), + /** + * + * + *
+   * The project is suspended due to abuse detected by Ares.
+   * 
+ * + * PROJECT_ABUSE = 8; + */ + PROJECT_ABUSE(8), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlSuspensionReason"); + } + + /** + * + * + *
+   * This is an unknown suspension reason.
+   * 
+ * + * SQL_SUSPENSION_REASON_UNSPECIFIED = 0; + */ + public static final int SQL_SUSPENSION_REASON_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The instance is suspended due to billing issues (for example:, account
+   * issue)
+   * 
+ * + * BILLING_ISSUE = 2; + */ + public static final int BILLING_ISSUE_VALUE = 2; + + /** + * + * + *
+   * The instance is suspended due to illegal content (for example:, child
+   * pornography, copyrighted material, etc.).
+   * 
+ * + * LEGAL_ISSUE = 3; + */ + public static final int LEGAL_ISSUE_VALUE = 3; + + /** + * + * + *
+   * The instance is causing operational issues (for example:, causing the
+   * database to crash).
+   * 
+ * + * OPERATIONAL_ISSUE = 4; + */ + public static final int OPERATIONAL_ISSUE_VALUE = 4; + + /** + * + * + *
+   * The KMS key used by the instance is either revoked or denied access to
+   * 
+ * + * KMS_KEY_ISSUE = 5; + */ + public static final int KMS_KEY_ISSUE_VALUE = 5; + + /** + * + * + *
+   * The project is suspended due to abuse detected by Ares.
+   * 
+ * + * PROJECT_ABUSE = 8; + */ + public static final int PROJECT_ABUSE_VALUE = 8; + + 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 SqlSuspensionReason 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 SqlSuspensionReason forNumber(int value) { + switch (value) { + case 0: + return SQL_SUSPENSION_REASON_UNSPECIFIED; + case 2: + return BILLING_ISSUE; + case 3: + return LEGAL_ISSUE; + case 4: + return OPERATIONAL_ISSUE; + case 5: + return KMS_KEY_ISSUE; + case 8: + return PROJECT_ABUSE; + 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 SqlSuspensionReason findValueByNumber(int number) { + return SqlSuspensionReason.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(11); + } + + private static final SqlSuspensionReason[] VALUES = values(); + + public static SqlSuspensionReason 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 SqlSuspensionReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlSuspensionReason) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersListRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersListRequest.java new file mode 100644 index 000000000000..55b9a555e9d1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersListRequest.java @@ -0,0 +1,580 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_tiers.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlTiersListRequest} */ +@com.google.protobuf.Generated +public final class SqlTiersListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlTiersListRequest) + SqlTiersListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlTiersListRequest"); + } + + // Use SqlTiersListRequest.newBuilder() to construct. + private SqlTiersListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlTiersListRequest() { + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_SqlTiersListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_SqlTiersListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlTiersListRequest.class, + com.google.cloud.sql.v1beta4.SqlTiersListRequest.Builder.class); + } + + public static final int PROJECT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project for which to list tiers.
+   * 
+ * + * string project = 1; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project for which to list tiers.
+   * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlTiersListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlTiersListRequest other = + (com.google.cloud.sql.v1beta4.SqlTiersListRequest) obj; + + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlTiersListRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlTiersListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlTiersListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlTiersListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlTiersListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlTiersListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlTiersListRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlTiersListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlTiersListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlTiersListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlTiersListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlTiersListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlTiersListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlTiersListRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlTiersListRequest) + com.google.cloud.sql.v1beta4.SqlTiersListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_SqlTiersListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_SqlTiersListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlTiersListRequest.class, + com.google.cloud.sql.v1beta4.SqlTiersListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlTiersListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_SqlTiersListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlTiersListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlTiersListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlTiersListRequest build() { + com.google.cloud.sql.v1beta4.SqlTiersListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlTiersListRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlTiersListRequest result = + new com.google.cloud.sql.v1beta4.SqlTiersListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlTiersListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlTiersListRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlTiersListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlTiersListRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlTiersListRequest.getDefaultInstance()) + return this; + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + project_ = 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 project_ = ""; + + /** + * + * + *
+     * Project ID of the project for which to list tiers.
+     * 
+ * + * string project = 1; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project for which to list tiers.
+     * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project for which to list tiers.
+     * 
+ * + * string project = 1; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project for which to list tiers.
+     * 
+ * + * string project = 1; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project for which to list tiers.
+     * 
+ * + * string project = 1; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlTiersListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlTiersListRequest) + private static final com.google.cloud.sql.v1beta4.SqlTiersListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlTiersListRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlTiersListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlTiersListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlTiersListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersListRequestOrBuilder.java new file mode 100644 index 000000000000..b81ede5f96ca --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlTiersListRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_tiers.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlTiersListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlTiersListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Project ID of the project for which to list tiers.
+   * 
+ * + * string project = 1; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project for which to list tiers.
+   * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUpdateTrack.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUpdateTrack.java new file mode 100644 index 000000000000..3fdfbeae42f2 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUpdateTrack.java @@ -0,0 +1,224 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf enum {@code google.cloud.sql.v1beta4.SqlUpdateTrack} */ +@com.google.protobuf.Generated +public enum SqlUpdateTrack implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * This is an unknown maintenance timing preference.
+   * 
+ * + * SQL_UPDATE_TRACK_UNSPECIFIED = 0; + */ + SQL_UPDATE_TRACK_UNSPECIFIED(0), + /** + * + * + *
+   * For an instance with a scheduled maintenance window, this maintenance
+   * timing indicates that the maintenance update is scheduled 7 to 14 days
+   * after the notification is sent out. Also referred to as `Week 1` (Console)
+   * and `preview` (gcloud CLI).
+   * 
+ * + * canary = 1; + */ + canary(1), + /** + * + * + *
+   * For an instance with a scheduled maintenance window, this maintenance
+   * timing indicates that the maintenance update is scheduled 15 to 21 days
+   * after the notification is sent out. Also referred to as `Week 2` (Console)
+   * and `production` (gcloud CLI).
+   * 
+ * + * stable = 2; + */ + stable(2), + /** + * + * + *
+   * For instance with a scheduled maintenance window, this maintenance
+   * timing indicates that the maintenance update is scheduled 35 to 42 days
+   * after the notification is sent out.
+   * 
+ * + * week5 = 3; + */ + week5(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlUpdateTrack"); + } + + /** + * + * + *
+   * This is an unknown maintenance timing preference.
+   * 
+ * + * SQL_UPDATE_TRACK_UNSPECIFIED = 0; + */ + public static final int SQL_UPDATE_TRACK_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * For an instance with a scheduled maintenance window, this maintenance
+   * timing indicates that the maintenance update is scheduled 7 to 14 days
+   * after the notification is sent out. Also referred to as `Week 1` (Console)
+   * and `preview` (gcloud CLI).
+   * 
+ * + * canary = 1; + */ + public static final int canary_VALUE = 1; + + /** + * + * + *
+   * For an instance with a scheduled maintenance window, this maintenance
+   * timing indicates that the maintenance update is scheduled 15 to 21 days
+   * after the notification is sent out. Also referred to as `Week 2` (Console)
+   * and `production` (gcloud CLI).
+   * 
+ * + * stable = 2; + */ + public static final int stable_VALUE = 2; + + /** + * + * + *
+   * For instance with a scheduled maintenance window, this maintenance
+   * timing indicates that the maintenance update is scheduled 35 to 42 days
+   * after the notification is sent out.
+   * 
+ * + * week5 = 3; + */ + public static final int week5_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 SqlUpdateTrack 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 SqlUpdateTrack forNumber(int value) { + switch (value) { + case 0: + return SQL_UPDATE_TRACK_UNSPECIFIED; + case 1: + return canary; + case 2: + return stable; + case 3: + return week5; + 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 SqlUpdateTrack findValueByNumber(int number) { + return SqlUpdateTrack.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto.getDescriptor() + .getEnumTypes() + .get(16); + } + + private static final SqlUpdateTrack[] VALUES = values(); + + public static SqlUpdateTrack 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 SqlUpdateTrack(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.SqlUpdateTrack) +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersDeleteRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersDeleteRequest.java new file mode 100644 index 000000000000..400743f0a10f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersDeleteRequest.java @@ -0,0 +1,1147 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlUsersDeleteRequest} */ +@com.google.protobuf.Generated +public final class SqlUsersDeleteRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlUsersDeleteRequest) + SqlUsersDeleteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlUsersDeleteRequest"); + } + + // Use SqlUsersDeleteRequest.newBuilder() to construct. + private SqlUsersDeleteRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlUsersDeleteRequest() { + host_ = ""; + instance_ = ""; + name_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest.class, + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest.Builder.class); + } + + public static final int HOST_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object host_ = ""; + + /** + * + * + *
+   * Host of the user in the instance.
+   * 
+ * + * string host = 1; + * + * @return The host. + */ + @java.lang.Override + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } + } + + /** + * + * + *
+   * Host of the user in the instance.
+   * 
+ * + * string host = 1; + * + * @return The bytes for host. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @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 PROJECT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(host_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, host_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, host_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest other = + (com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest) obj; + + if (!getHost().equals(other.getHost())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getName().equals(other.getName())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlUsersDeleteRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlUsersDeleteRequest) + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersDeleteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersDeleteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest.class, + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + host_ = ""; + instance_ = ""; + name_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersDeleteRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest build() { + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest result = + new com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.host_ = host_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest.getDefaultInstance()) + return this; + if (!other.getHost().isEmpty()) { + host_ = other.host_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + host_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + project_ = 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 host_ = ""; + + /** + * + * + *
+     * Host of the user in the instance.
+     * 
+ * + * string host = 1; + * + * @return The host. + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Host of the user in the instance.
+     * 
+ * + * string host = 1; + * + * @return The bytes for host. + */ + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Host of the user in the instance.
+     * 
+ * + * string host = 1; + * + * @param value The host to set. + * @return This builder for chaining. + */ + public Builder setHost(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + host_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Host of the user in the instance.
+     * 
+ * + * string host = 1; + * + * @return This builder for chaining. + */ + public Builder clearHost() { + host_ = getDefaultInstance().getHost(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Host of the user in the instance.
+     * 
+ * + * string host = 1; + * + * @param value The bytes for host to set. + * @return This builder for chaining. + */ + public Builder setHostBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + host_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlUsersDeleteRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlUsersDeleteRequest) + private static final com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlUsersDeleteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersDeleteRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersDeleteRequestOrBuilder.java new file mode 100644 index 000000000000..3080fee1e2c6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersDeleteRequestOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlUsersDeleteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlUsersDeleteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Host of the user in the instance.
+   * 
+ * + * string host = 1; + * + * @return The host. + */ + java.lang.String getHost(); + + /** + * + * + *
+   * Host of the user in the instance.
+   * 
+ * + * string host = 1; + * + * @return The bytes for host. + */ + com.google.protobuf.ByteString getHostBytes(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersGetRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersGetRequest.java new file mode 100644 index 000000000000..4993b442907e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersGetRequest.java @@ -0,0 +1,1163 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Request message for Users Get RPC
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlUsersGetRequest} + */ +@com.google.protobuf.Generated +public final class SqlUsersGetRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlUsersGetRequest) + SqlUsersGetRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlUsersGetRequest"); + } + + // Use SqlUsersGetRequest.newBuilder() to construct. + private SqlUsersGetRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlUsersGetRequest() { + instance_ = ""; + name_ = ""; + project_ = ""; + host_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlUsersGetRequest.class, + com.google.cloud.sql.v1beta4.SqlUsersGetRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * User of the instance.
+   * 
+ * + * string name = 2; + * + * @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; + } + } + + /** + * + * + *
+   * User of the instance.
+   * 
+ * + * string name = 2; + * + * @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 PROJECT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HOST_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object host_ = ""; + + /** + * + * + *
+   * Host of a user of the instance.
+   * 
+ * + * string host = 4; + * + * @return The host. + */ + @java.lang.Override + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } + } + + /** + * + * + *
+   * Host of a user of the instance.
+   * 
+ * + * string host = 4; + * + * @return The bytes for host. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, host_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, project_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, host_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlUsersGetRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlUsersGetRequest other = + (com.google.cloud.sql.v1beta4.SqlUsersGetRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getName().equals(other.getName())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getHost().equals(other.getHost())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlUsersGetRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersGetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersGetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersGetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersGetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersGetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersGetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersGetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersGetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersGetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersGetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersGetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlUsersGetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for Users Get RPC
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SqlUsersGetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlUsersGetRequest) + com.google.cloud.sql.v1beta4.SqlUsersGetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersGetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersGetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlUsersGetRequest.class, + com.google.cloud.sql.v1beta4.SqlUsersGetRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlUsersGetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + name_ = ""; + project_ = ""; + host_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersGetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersGetRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlUsersGetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersGetRequest build() { + com.google.cloud.sql.v1beta4.SqlUsersGetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersGetRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlUsersGetRequest result = + new com.google.cloud.sql.v1beta4.SqlUsersGetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlUsersGetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.host_ = host_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlUsersGetRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlUsersGetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlUsersGetRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlUsersGetRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getHost().isEmpty()) { + host_ = other.host_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + host_ = 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 instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * User of the instance.
+     * 
+ * + * string name = 2; + * + * @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; + } + } + + /** + * + * + *
+     * User of the instance.
+     * 
+ * + * string name = 2; + * + * @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; + } + } + + /** + * + * + *
+     * User of the instance.
+     * 
+ * + * string name = 2; + * + * @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; + } + + /** + * + * + *
+     * User of the instance.
+     * 
+ * + * string name = 2; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * User of the instance.
+     * 
+ * + * string name = 2; + * + * @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; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 3; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object host_ = ""; + + /** + * + * + *
+     * Host of a user of the instance.
+     * 
+ * + * string host = 4; + * + * @return The host. + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Host of a user of the instance.
+     * 
+ * + * string host = 4; + * + * @return The bytes for host. + */ + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Host of a user of the instance.
+     * 
+ * + * string host = 4; + * + * @param value The host to set. + * @return This builder for chaining. + */ + public Builder setHost(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + host_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Host of a user of the instance.
+     * 
+ * + * string host = 4; + * + * @return This builder for chaining. + */ + public Builder clearHost() { + host_ = getDefaultInstance().getHost(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Host of a user of the instance.
+     * 
+ * + * string host = 4; + * + * @param value The bytes for host to set. + * @return This builder for chaining. + */ + public Builder setHostBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + host_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlUsersGetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlUsersGetRequest) + private static final com.google.cloud.sql.v1beta4.SqlUsersGetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlUsersGetRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersGetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlUsersGetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersGetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersGetRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersGetRequestOrBuilder.java new file mode 100644 index 000000000000..cbd9ee429837 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersGetRequestOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlUsersGetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlUsersGetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * User of the instance.
+   * 
+ * + * string name = 2; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * User of the instance.
+   * 
+ * + * string name = 2; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 3; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Host of a user of the instance.
+   * 
+ * + * string host = 4; + * + * @return The host. + */ + java.lang.String getHost(); + + /** + * + * + *
+   * Host of a user of the instance.
+   * 
+ * + * string host = 4; + * + * @return The bytes for host. + */ + com.google.protobuf.ByteString getHostBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersInsertRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersInsertRequest.java new file mode 100644 index 000000000000..448e78f58347 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersInsertRequest.java @@ -0,0 +1,964 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlUsersInsertRequest} */ +@com.google.protobuf.Generated +public final class SqlUsersInsertRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlUsersInsertRequest) + SqlUsersInsertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlUsersInsertRequest"); + } + + // Use SqlUsersInsertRequest.newBuilder() to construct. + private SqlUsersInsertRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlUsersInsertRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest.class, + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.User body_; + + /** + * .google.cloud.sql.v1beta4.User body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.cloud.sql.v1beta4.User body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.User getBody() { + return body_ == null ? com.google.cloud.sql.v1beta4.User.getDefaultInstance() : body_; + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.UserOrBuilder getBodyOrBuilder() { + return body_ == null ? com.google.cloud.sql.v1beta4.User.getDefaultInstance() : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlUsersInsertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest other = + (com.google.cloud.sql.v1beta4.SqlUsersInsertRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlUsersInsertRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersInsertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersInsertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersInsertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersInsertRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersInsertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersInsertRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersInsertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersInsertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersInsertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlUsersInsertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlUsersInsertRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlUsersInsertRequest) + com.google.cloud.sql.v1beta4.SqlUsersInsertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest.class, + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlUsersInsertRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersInsertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersInsertRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlUsersInsertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersInsertRequest build() { + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersInsertRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlUsersInsertRequest result = + new com.google.cloud.sql.v1beta4.SqlUsersInsertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlUsersInsertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlUsersInsertRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlUsersInsertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlUsersInsertRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlUsersInsertRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.User body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.User, + com.google.cloud.sql.v1beta4.User.Builder, + com.google.cloud.sql.v1beta4.UserOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.User body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.cloud.sql.v1beta4.User body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.User getBody() { + if (bodyBuilder_ == null) { + return body_ == null ? com.google.cloud.sql.v1beta4.User.getDefaultInstance() : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.User value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.User.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.User value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1beta4.User.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000004); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + public com.google.cloud.sql.v1beta4.User.Builder getBodyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + public com.google.cloud.sql.v1beta4.UserOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null ? com.google.cloud.sql.v1beta4.User.getDefaultInstance() : body_; + } + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.User, + com.google.cloud.sql.v1beta4.User.Builder, + com.google.cloud.sql.v1beta4.UserOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.User, + com.google.cloud.sql.v1beta4.User.Builder, + com.google.cloud.sql.v1beta4.UserOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlUsersInsertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlUsersInsertRequest) + private static final com.google.cloud.sql.v1beta4.SqlUsersInsertRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlUsersInsertRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersInsertRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlUsersInsertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersInsertRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersInsertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersInsertRequestOrBuilder.java new file mode 100644 index 000000000000..deaf112387fa --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersInsertRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlUsersInsertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlUsersInsertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * .google.cloud.sql.v1beta4.User body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.User body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.User getBody(); + + /** .google.cloud.sql.v1beta4.User body = 100; */ + com.google.cloud.sql.v1beta4.UserOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersListRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersListRequest.java new file mode 100644 index 000000000000..156b4ba60c88 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersListRequest.java @@ -0,0 +1,769 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlUsersListRequest} */ +@com.google.protobuf.Generated +public final class SqlUsersListRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlUsersListRequest) + SqlUsersListRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlUsersListRequest"); + } + + // Use SqlUsersListRequest.newBuilder() to construct. + private SqlUsersListRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlUsersListRequest() { + instance_ = ""; + project_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlUsersListRequest.class, + com.google.cloud.sql.v1beta4.SqlUsersListRequest.Builder.class); + } + + public static final int INSTANCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = 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.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, project_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, project_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlUsersListRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlUsersListRequest other = + (com.google.cloud.sql.v1beta4.SqlUsersListRequest) obj; + + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getUnknownFields().equals(other.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) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlUsersListRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersListRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersListRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersListRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersListRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersListRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersListRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersListRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersListRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersListRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersListRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersListRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlUsersListRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlUsersListRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlUsersListRequest) + com.google.cloud.sql.v1beta4.SqlUsersListRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersListRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersListRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlUsersListRequest.class, + com.google.cloud.sql.v1beta4.SqlUsersListRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlUsersListRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = ""; + project_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersListRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersListRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlUsersListRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersListRequest build() { + com.google.cloud.sql.v1beta4.SqlUsersListRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersListRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlUsersListRequest result = + new com.google.cloud.sql.v1beta4.SqlUsersListRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlUsersListRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.project_ = project_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlUsersListRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlUsersListRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlUsersListRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlUsersListRequest.getDefaultInstance()) + return this; + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + 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: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + project_ = 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 instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 1; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 2; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlUsersListRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlUsersListRequest) + private static final com.google.cloud.sql.v1beta4.SqlUsersListRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlUsersListRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersListRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlUsersListRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersListRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersListRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersListRequestOrBuilder.java new file mode 100644 index 000000000000..cb29ff27d6d4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersListRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlUsersListRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlUsersListRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 1; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 2; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersUpdateRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersUpdateRequest.java new file mode 100644 index 000000000000..b9069215fde7 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersUpdateRequest.java @@ -0,0 +1,1796 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** Protobuf type {@code google.cloud.sql.v1beta4.SqlUsersUpdateRequest} */ +@com.google.protobuf.Generated +public final class SqlUsersUpdateRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SqlUsersUpdateRequest) + SqlUsersUpdateRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlUsersUpdateRequest"); + } + + // Use SqlUsersUpdateRequest.newBuilder() to construct. + private SqlUsersUpdateRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SqlUsersUpdateRequest() { + host_ = ""; + instance_ = ""; + name_ = ""; + project_ = ""; + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersUpdateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersUpdateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest.class, + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest.Builder.class); + } + + private int bitField0_; + public static final int HOST_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object host_ = ""; + + /** + * + * + *
+   * Optional. Host of the user in the instance.
+   * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The host. + */ + @java.lang.Override + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Host of the user in the instance.
+   * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for host. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @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 PROJECT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_ROLES_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList databaseRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + public com.google.protobuf.ProtocolStringList getDatabaseRolesList() { + return databaseRoles_; + } + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + public int getDatabaseRolesCount() { + return databaseRoles_.size(); + } + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + public java.lang.String getDatabaseRoles(int index) { + return databaseRoles_.get(index); + } + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + public com.google.protobuf.ByteString getDatabaseRolesBytes(int index) { + return databaseRoles_.getByteString(index); + } + + public static final int REVOKE_EXISTING_ROLES_FIELD_NUMBER = 6; + private boolean revokeExistingRoles_ = false; + + /** + * + * + *
+   * Optional. Specifies whether to revoke existing roles that are not present
+   * in the `database_roles` field. If `false` or unset, the database roles
+   * specified in `database_roles` are added to the user's existing roles.
+   * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the revokeExistingRoles field is set. + */ + @java.lang.Override + public boolean hasRevokeExistingRoles() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Specifies whether to revoke existing roles that are not present
+   * in the `database_roles` field. If `false` or unset, the database roles
+   * specified in `database_roles` are added to the user's existing roles.
+   * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The revokeExistingRoles. + */ + @java.lang.Override + public boolean getRevokeExistingRoles() { + return revokeExistingRoles_; + } + + public static final int BODY_FIELD_NUMBER = 100; + private com.google.cloud.sql.v1beta4.User body_; + + /** + * .google.cloud.sql.v1beta4.User body = 100; + * + * @return Whether the body field is set. + */ + @java.lang.Override + public boolean hasBody() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.cloud.sql.v1beta4.User body = 100; + * + * @return The body. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.User getBody() { + return body_ == null ? com.google.cloud.sql.v1beta4.User.getDefaultInstance() : body_; + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.UserOrBuilder getBodyOrBuilder() { + return body_ == null ? com.google.cloud.sql.v1beta4.User.getDefaultInstance() : body_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(host_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, host_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, project_); + } + for (int i = 0; i < databaseRoles_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, databaseRoles_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(6, revokeExistingRoles_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(100, getBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, host_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, project_); + } + { + int dataSize = 0; + for (int i = 0; i < databaseRoles_.size(); i++) { + dataSize += computeStringSizeNoTag(databaseRoles_.getRaw(i)); + } + size += dataSize; + size += 1 * getDatabaseRolesList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, revokeExistingRoles_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(100, getBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest other = + (com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest) obj; + + if (!getHost().equals(other.getHost())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getName().equals(other.getName())) return false; + if (!getProject().equals(other.getProject())) return false; + if (!getDatabaseRolesList().equals(other.getDatabaseRolesList())) return false; + if (hasRevokeExistingRoles() != other.hasRevokeExistingRoles()) return false; + if (hasRevokeExistingRoles()) { + if (getRevokeExistingRoles() != other.getRevokeExistingRoles()) return false; + } + if (hasBody() != other.hasBody()) return false; + if (hasBody()) { + if (!getBody().equals(other.getBody())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + if (getDatabaseRolesCount() > 0) { + hash = (37 * hash) + DATABASE_ROLES_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseRolesList().hashCode(); + } + if (hasRevokeExistingRoles()) { + hash = (37 * hash) + REVOKE_EXISTING_ROLES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRevokeExistingRoles()); + } + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.cloud.sql.v1beta4.SqlUsersUpdateRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SqlUsersUpdateRequest) + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersUpdateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersUpdateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest.class, + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBodyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + host_ = ""; + instance_ = ""; + name_ = ""; + project_ = ""; + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + revokeExistingRoles_ = false; + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_SqlUsersUpdateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest build() { + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest buildPartial() { + com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest result = + new com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.host_ = host_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + databaseRoles_.makeImmutable(); + result.databaseRoles_ = databaseRoles_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.revokeExistingRoles_ = revokeExistingRoles_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.body_ = bodyBuilder_ == null ? body_ : bodyBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest other) { + if (other == com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest.getDefaultInstance()) + return this; + if (!other.getHost().isEmpty()) { + host_ = other.host_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.databaseRoles_.isEmpty()) { + if (databaseRoles_.isEmpty()) { + databaseRoles_ = other.databaseRoles_; + bitField0_ |= 0x00000010; + } else { + ensureDatabaseRolesIsMutable(); + databaseRoles_.addAll(other.databaseRoles_); + } + onChanged(); + } + if (other.hasRevokeExistingRoles()) { + setRevokeExistingRoles(other.getRevokeExistingRoles()); + } + if (other.hasBody()) { + mergeBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + host_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(s); + break; + } // case 42 + case 48: + { + revokeExistingRoles_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 802: + { + input.readMessage(internalGetBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 802 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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 host_ = ""; + + /** + * + * + *
+     * Optional. Host of the user in the instance.
+     * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The host. + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Host of the user in the instance.
+     * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for host. + */ + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Host of the user in the instance.
+     * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The host to set. + * @return This builder for chaining. + */ + public Builder setHost(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + host_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Host of the user in the instance.
+     * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearHost() { + host_ = getDefaultInstance().getHost(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Host of the user in the instance.
+     * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for host to set. + * @return This builder for chaining. + */ + public Builder setHostBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + host_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Database instance ID. This does not include the project ID.
+     * 
+ * + * string instance = 2; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the user in the instance.
+     * 
+ * + * string name = 3; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Project ID of the project that contains the instance.
+     * 
+ * + * string project = 4; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList databaseRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDatabaseRolesIsMutable() { + if (!databaseRoles_.isModifiable()) { + databaseRoles_ = new com.google.protobuf.LazyStringArrayList(databaseRoles_); + } + bitField0_ |= 0x00000010; + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + public com.google.protobuf.ProtocolStringList getDatabaseRolesList() { + databaseRoles_.makeImmutable(); + return databaseRoles_; + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + public int getDatabaseRolesCount() { + return databaseRoles_.size(); + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + public java.lang.String getDatabaseRoles(int index) { + return databaseRoles_.get(index); + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + public com.google.protobuf.ByteString getDatabaseRolesBytes(int index) { + return databaseRoles_.getByteString(index); + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The databaseRoles to set. + * @return This builder for chaining. + */ + public Builder setDatabaseRoles(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseRolesIsMutable(); + databaseRoles_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addDatabaseRoles(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addAllDatabaseRoles(java.lang.Iterable values) { + ensureDatabaseRolesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, databaseRoles_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseRoles() { + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. List of database roles to grant to the user. body.database_roles
+     * will be ignored for update request.
+     * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addDatabaseRolesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean revokeExistingRoles_; + + /** + * + * + *
+     * Optional. Specifies whether to revoke existing roles that are not present
+     * in the `database_roles` field. If `false` or unset, the database roles
+     * specified in `database_roles` are added to the user's existing roles.
+     * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the revokeExistingRoles field is set. + */ + @java.lang.Override + public boolean hasRevokeExistingRoles() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. Specifies whether to revoke existing roles that are not present
+     * in the `database_roles` field. If `false` or unset, the database roles
+     * specified in `database_roles` are added to the user's existing roles.
+     * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The revokeExistingRoles. + */ + @java.lang.Override + public boolean getRevokeExistingRoles() { + return revokeExistingRoles_; + } + + /** + * + * + *
+     * Optional. Specifies whether to revoke existing roles that are not present
+     * in the `database_roles` field. If `false` or unset, the database roles
+     * specified in `database_roles` are added to the user's existing roles.
+     * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The revokeExistingRoles to set. + * @return This builder for chaining. + */ + public Builder setRevokeExistingRoles(boolean value) { + + revokeExistingRoles_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Specifies whether to revoke existing roles that are not present
+     * in the `database_roles` field. If `false` or unset, the database roles
+     * specified in `database_roles` are added to the user's existing roles.
+     * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRevokeExistingRoles() { + bitField0_ = (bitField0_ & ~0x00000020); + revokeExistingRoles_ = false; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.User body_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.User, + com.google.cloud.sql.v1beta4.User.Builder, + com.google.cloud.sql.v1beta4.UserOrBuilder> + bodyBuilder_; + + /** + * .google.cloud.sql.v1beta4.User body = 100; + * + * @return Whether the body field is set. + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * .google.cloud.sql.v1beta4.User body = 100; + * + * @return The body. + */ + public com.google.cloud.sql.v1beta4.User getBody() { + if (bodyBuilder_ == null) { + return body_ == null ? com.google.cloud.sql.v1beta4.User.getDefaultInstance() : body_; + } else { + return bodyBuilder_.getMessage(); + } + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.User value) { + if (bodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + body_ = value; + } else { + bodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + public Builder setBody(com.google.cloud.sql.v1beta4.User.Builder builderForValue) { + if (bodyBuilder_ == null) { + body_ = builderForValue.build(); + } else { + bodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + public Builder mergeBody(com.google.cloud.sql.v1beta4.User value) { + if (bodyBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && body_ != null + && body_ != com.google.cloud.sql.v1beta4.User.getDefaultInstance()) { + getBodyBuilder().mergeFrom(value); + } else { + body_ = value; + } + } else { + bodyBuilder_.mergeFrom(value); + } + if (body_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000040); + body_ = null; + if (bodyBuilder_ != null) { + bodyBuilder_.dispose(); + bodyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + public com.google.cloud.sql.v1beta4.User.Builder getBodyBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetBodyFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + public com.google.cloud.sql.v1beta4.UserOrBuilder getBodyOrBuilder() { + if (bodyBuilder_ != null) { + return bodyBuilder_.getMessageOrBuilder(); + } else { + return body_ == null ? com.google.cloud.sql.v1beta4.User.getDefaultInstance() : body_; + } + } + + /** .google.cloud.sql.v1beta4.User body = 100; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.User, + com.google.cloud.sql.v1beta4.User.Builder, + com.google.cloud.sql.v1beta4.UserOrBuilder> + internalGetBodyFieldBuilder() { + if (bodyBuilder_ == null) { + bodyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.User, + com.google.cloud.sql.v1beta4.User.Builder, + com.google.cloud.sql.v1beta4.UserOrBuilder>( + getBody(), getParentForChildren(), isClean()); + body_ = null; + } + return bodyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SqlUsersUpdateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SqlUsersUpdateRequest) + private static final com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest(); + } + + public static com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SqlUsersUpdateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersUpdateRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersUpdateRequestOrBuilder.java new file mode 100644 index 000000000000..be5cec0877b1 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SqlUsersUpdateRequestOrBuilder.java @@ -0,0 +1,237 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SqlUsersUpdateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SqlUsersUpdateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Host of the user in the instance.
+   * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The host. + */ + java.lang.String getHost(); + + /** + * + * + *
+   * Optional. Host of the user in the instance.
+   * 
+ * + * string host = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for host. + */ + com.google.protobuf.ByteString getHostBytes(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Database instance ID. This does not include the project ID.
+   * 
+ * + * string instance = 2; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Name of the user in the instance.
+   * 
+ * + * string name = 3; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Project ID of the project that contains the instance.
+   * 
+ * + * string project = 4; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + java.util.List getDatabaseRolesList(); + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + int getDatabaseRolesCount(); + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + java.lang.String getDatabaseRoles(int index); + + /** + * + * + *
+   * Optional. List of database roles to grant to the user. body.database_roles
+   * will be ignored for update request.
+   * 
+ * + * repeated string database_roles = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + com.google.protobuf.ByteString getDatabaseRolesBytes(int index); + + /** + * + * + *
+   * Optional. Specifies whether to revoke existing roles that are not present
+   * in the `database_roles` field. If `false` or unset, the database roles
+   * specified in `database_roles` are added to the user's existing roles.
+   * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the revokeExistingRoles field is set. + */ + boolean hasRevokeExistingRoles(); + + /** + * + * + *
+   * Optional. Specifies whether to revoke existing roles that are not present
+   * in the `database_roles` field. If `false` or unset, the database roles
+   * specified in `database_roles` are added to the user's existing roles.
+   * 
+ * + * optional bool revoke_existing_roles = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The revokeExistingRoles. + */ + boolean getRevokeExistingRoles(); + + /** + * .google.cloud.sql.v1beta4.User body = 100; + * + * @return Whether the body field is set. + */ + boolean hasBody(); + + /** + * .google.cloud.sql.v1beta4.User body = 100; + * + * @return The body. + */ + com.google.cloud.sql.v1beta4.User getBody(); + + /** .google.cloud.sql.v1beta4.User body = 100; */ + com.google.cloud.sql.v1beta4.UserOrBuilder getBodyOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCert.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCert.java new file mode 100644 index 000000000000..db732b82f1ff --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCert.java @@ -0,0 +1,2344 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * SslCerts Resource
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SslCert} + */ +@com.google.protobuf.Generated +public final class SslCert extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SslCert) + SslCertOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslCert"); + } + + // Use SslCert.newBuilder() to construct. + private SslCert(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SslCert() { + kind_ = ""; + certSerialNumber_ = ""; + cert_ = ""; + commonName_ = ""; + sha1Fingerprint_ = ""; + instance_ = ""; + selfLink_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCert_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCert_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SslCert.class, + com.google.cloud.sql.v1beta4.SslCert.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#sslCert`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#sslCert`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CERT_SERIAL_NUMBER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object certSerialNumber_ = ""; + + /** + * + * + *
+   * Serial number, as extracted from the certificate.
+   * 
+ * + * string cert_serial_number = 2; + * + * @return The certSerialNumber. + */ + @java.lang.Override + public java.lang.String getCertSerialNumber() { + java.lang.Object ref = certSerialNumber_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certSerialNumber_ = s; + return s; + } + } + + /** + * + * + *
+   * Serial number, as extracted from the certificate.
+   * 
+ * + * string cert_serial_number = 2; + * + * @return The bytes for certSerialNumber. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCertSerialNumberBytes() { + java.lang.Object ref = certSerialNumber_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certSerialNumber_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CERT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object cert_ = ""; + + /** + * + * + *
+   * PEM representation.
+   * 
+ * + * string cert = 3; + * + * @return The cert. + */ + @java.lang.Override + public java.lang.String getCert() { + java.lang.Object ref = cert_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cert_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM representation.
+   * 
+ * + * string cert = 3; + * + * @return The bytes for cert. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCertBytes() { + java.lang.Object ref = cert_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cert_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * The time when the certificate was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time when the certificate was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * The time when the certificate was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int COMMON_NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object commonName_ = ""; + + /** + * + * + *
+   * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+   * 
+ * + * string common_name = 5; + * + * @return The commonName. + */ + @java.lang.Override + public java.lang.String getCommonName() { + java.lang.Object ref = commonName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + commonName_ = s; + return s; + } + } + + /** + * + * + *
+   * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+   * 
+ * + * string common_name = 5; + * + * @return The bytes for commonName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCommonNameBytes() { + java.lang.Object ref = commonName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + commonName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRATION_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp expirationTime_; + + /** + * + * + *
+   * The time when the certificate expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + * + * @return Whether the expirationTime field is set. + */ + @java.lang.Override + public boolean hasExpirationTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time when the certificate expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + * + * @return The expirationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpirationTime() { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + + /** + * + * + *
+   * The time when the certificate expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder() { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + + public static final int SHA1_FINGERPRINT_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object sha1Fingerprint_ = ""; + + /** + * + * + *
+   * Sha1 Fingerprint.
+   * 
+ * + * string sha1_fingerprint = 7; + * + * @return The sha1Fingerprint. + */ + @java.lang.Override + public java.lang.String getSha1Fingerprint() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sha1Fingerprint_ = s; + return s; + } + } + + /** + * + * + *
+   * Sha1 Fingerprint.
+   * 
+ * + * string sha1_fingerprint = 7; + * + * @return The bytes for sha1Fingerprint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSha1FingerprintBytes() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sha1Fingerprint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 8; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 8; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELF_LINK_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object selfLink_ = ""; + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 9; + * + * @return The selfLink. + */ + @java.lang.Override + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } + } + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 9; + * + * @return The bytes for selfLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(certSerialNumber_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, certSerialNumber_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cert_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, cert_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(commonName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, commonName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getExpirationTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sha1Fingerprint_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, sha1Fingerprint_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, selfLink_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(certSerialNumber_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, certSerialNumber_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cert_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, cert_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(commonName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, commonName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getExpirationTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sha1Fingerprint_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, sha1Fingerprint_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selfLink_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, selfLink_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SslCert)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SslCert other = (com.google.cloud.sql.v1beta4.SslCert) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getCertSerialNumber().equals(other.getCertSerialNumber())) return false; + if (!getCert().equals(other.getCert())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getCommonName().equals(other.getCommonName())) return false; + if (hasExpirationTime() != other.hasExpirationTime()) return false; + if (hasExpirationTime()) { + if (!getExpirationTime().equals(other.getExpirationTime())) return false; + } + if (!getSha1Fingerprint().equals(other.getSha1Fingerprint())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getSelfLink().equals(other.getSelfLink())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + CERT_SERIAL_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getCertSerialNumber().hashCode(); + hash = (37 * hash) + CERT_FIELD_NUMBER; + hash = (53 * hash) + getCert().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + COMMON_NAME_FIELD_NUMBER; + hash = (53 * hash) + getCommonName().hashCode(); + if (hasExpirationTime()) { + hash = (37 * hash) + EXPIRATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpirationTime().hashCode(); + } + hash = (37 * hash) + SHA1_FINGERPRINT_FIELD_NUMBER; + hash = (53 * hash) + getSha1Fingerprint().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + SELF_LINK_FIELD_NUMBER; + hash = (53 * hash) + getSelfLink().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SslCert parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCert parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCert parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCert parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCert parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCert parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCert parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCert parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCert parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCert parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCert parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCert parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SslCert prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SslCerts Resource
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SslCert} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SslCert) + com.google.cloud.sql.v1beta4.SslCertOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCert_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCert_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SslCert.class, + com.google.cloud.sql.v1beta4.SslCert.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SslCert.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + internalGetExpirationTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + certSerialNumber_ = ""; + cert_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + commonName_ = ""; + expirationTime_ = null; + if (expirationTimeBuilder_ != null) { + expirationTimeBuilder_.dispose(); + expirationTimeBuilder_ = null; + } + sha1Fingerprint_ = ""; + instance_ = ""; + selfLink_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCert_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCert getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCert build() { + com.google.cloud.sql.v1beta4.SslCert result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCert buildPartial() { + com.google.cloud.sql.v1beta4.SslCert result = new com.google.cloud.sql.v1beta4.SslCert(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SslCert result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.certSerialNumber_ = certSerialNumber_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cert_ = cert_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.commonName_ = commonName_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.expirationTime_ = + expirationTimeBuilder_ == null ? expirationTime_ : expirationTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.sha1Fingerprint_ = sha1Fingerprint_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.selfLink_ = selfLink_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SslCert) { + return mergeFrom((com.google.cloud.sql.v1beta4.SslCert) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SslCert other) { + if (other == com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getCertSerialNumber().isEmpty()) { + certSerialNumber_ = other.certSerialNumber_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getCert().isEmpty()) { + cert_ = other.cert_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.getCommonName().isEmpty()) { + commonName_ = other.commonName_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasExpirationTime()) { + mergeExpirationTime(other.getExpirationTime()); + } + if (!other.getSha1Fingerprint().isEmpty()) { + sha1Fingerprint_ = other.sha1Fingerprint_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (!other.getSelfLink().isEmpty()) { + selfLink_ = other.selfLink_; + bitField0_ |= 0x00000100; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + certSerialNumber_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + cert_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + commonName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetExpirationTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + sha1Fingerprint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + selfLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#sslCert`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#sslCert`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#sslCert`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#sslCert`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#sslCert`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object certSerialNumber_ = ""; + + /** + * + * + *
+     * Serial number, as extracted from the certificate.
+     * 
+ * + * string cert_serial_number = 2; + * + * @return The certSerialNumber. + */ + public java.lang.String getCertSerialNumber() { + java.lang.Object ref = certSerialNumber_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certSerialNumber_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Serial number, as extracted from the certificate.
+     * 
+ * + * string cert_serial_number = 2; + * + * @return The bytes for certSerialNumber. + */ + public com.google.protobuf.ByteString getCertSerialNumberBytes() { + java.lang.Object ref = certSerialNumber_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certSerialNumber_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Serial number, as extracted from the certificate.
+     * 
+ * + * string cert_serial_number = 2; + * + * @param value The certSerialNumber to set. + * @return This builder for chaining. + */ + public Builder setCertSerialNumber(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + certSerialNumber_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Serial number, as extracted from the certificate.
+     * 
+ * + * string cert_serial_number = 2; + * + * @return This builder for chaining. + */ + public Builder clearCertSerialNumber() { + certSerialNumber_ = getDefaultInstance().getCertSerialNumber(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Serial number, as extracted from the certificate.
+     * 
+ * + * string cert_serial_number = 2; + * + * @param value The bytes for certSerialNumber to set. + * @return This builder for chaining. + */ + public Builder setCertSerialNumberBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + certSerialNumber_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object cert_ = ""; + + /** + * + * + *
+     * PEM representation.
+     * 
+ * + * string cert = 3; + * + * @return The cert. + */ + public java.lang.String getCert() { + java.lang.Object ref = cert_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cert_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM representation.
+     * 
+ * + * string cert = 3; + * + * @return The bytes for cert. + */ + public com.google.protobuf.ByteString getCertBytes() { + java.lang.Object ref = cert_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cert_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM representation.
+     * 
+ * + * string cert = 3; + * + * @param value The cert to set. + * @return This builder for chaining. + */ + public Builder setCert(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + cert_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation.
+     * 
+ * + * string cert = 3; + * + * @return This builder for chaining. + */ + public Builder clearCert() { + cert_ = getDefaultInstance().getCert(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM representation.
+     * 
+ * + * string cert = 3; + * + * @param value The bytes for cert to set. + * @return This builder for chaining. + */ + public Builder setCertBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + cert_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * The time when the certificate was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * The time when the certificate was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @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(); + } + } + + /** + * + * + *
+     * The time when the certificate was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the certificate was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the certificate was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time when the certificate was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the certificate was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time when the certificate was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * The time when the certificate was created in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private java.lang.Object commonName_ = ""; + + /** + * + * + *
+     * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+     * 
+ * + * string common_name = 5; + * + * @return The commonName. + */ + public java.lang.String getCommonName() { + java.lang.Object ref = commonName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + commonName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+     * 
+ * + * string common_name = 5; + * + * @return The bytes for commonName. + */ + public com.google.protobuf.ByteString getCommonNameBytes() { + java.lang.Object ref = commonName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + commonName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+     * 
+ * + * string common_name = 5; + * + * @param value The commonName to set. + * @return This builder for chaining. + */ + public Builder setCommonName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + commonName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+     * 
+ * + * string common_name = 5; + * + * @return This builder for chaining. + */ + public Builder clearCommonName() { + commonName_ = getDefaultInstance().getCommonName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+     * 
+ * + * string common_name = 5; + * + * @param value The bytes for commonName to set. + * @return This builder for chaining. + */ + public Builder setCommonNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + commonName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expirationTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expirationTimeBuilder_; + + /** + * + * + *
+     * The time when the certificate expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + * + * @return Whether the expirationTime field is set. + */ + public boolean hasExpirationTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * The time when the certificate expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + * + * @return The expirationTime. + */ + public com.google.protobuf.Timestamp getExpirationTime() { + if (expirationTimeBuilder_ == null) { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } else { + return expirationTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time when the certificate expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public Builder setExpirationTime(com.google.protobuf.Timestamp value) { + if (expirationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expirationTime_ = value; + } else { + expirationTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the certificate expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public Builder setExpirationTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expirationTimeBuilder_ == null) { + expirationTime_ = builderForValue.build(); + } else { + expirationTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the certificate expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public Builder mergeExpirationTime(com.google.protobuf.Timestamp value) { + if (expirationTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && expirationTime_ != null + && expirationTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpirationTimeBuilder().mergeFrom(value); + } else { + expirationTime_ = value; + } + } else { + expirationTimeBuilder_.mergeFrom(value); + } + if (expirationTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time when the certificate expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public Builder clearExpirationTime() { + bitField0_ = (bitField0_ & ~0x00000020); + expirationTime_ = null; + if (expirationTimeBuilder_ != null) { + expirationTimeBuilder_.dispose(); + expirationTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the certificate expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getExpirationTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetExpirationTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time when the certificate expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder() { + if (expirationTimeBuilder_ != null) { + return expirationTimeBuilder_.getMessageOrBuilder(); + } else { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + } + + /** + * + * + *
+     * The time when the certificate expires in
+     * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+     * `2012-11-15T16:19:00.094Z`.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExpirationTimeFieldBuilder() { + if (expirationTimeBuilder_ == null) { + expirationTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpirationTime(), getParentForChildren(), isClean()); + expirationTime_ = null; + } + return expirationTimeBuilder_; + } + + private java.lang.Object sha1Fingerprint_ = ""; + + /** + * + * + *
+     * Sha1 Fingerprint.
+     * 
+ * + * string sha1_fingerprint = 7; + * + * @return The sha1Fingerprint. + */ + public java.lang.String getSha1Fingerprint() { + java.lang.Object ref = sha1Fingerprint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sha1Fingerprint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Sha1 Fingerprint.
+     * 
+ * + * string sha1_fingerprint = 7; + * + * @return The bytes for sha1Fingerprint. + */ + public com.google.protobuf.ByteString getSha1FingerprintBytes() { + java.lang.Object ref = sha1Fingerprint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sha1Fingerprint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Sha1 Fingerprint.
+     * 
+ * + * string sha1_fingerprint = 7; + * + * @param value The sha1Fingerprint to set. + * @return This builder for chaining. + */ + public Builder setSha1Fingerprint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sha1Fingerprint_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Sha1 Fingerprint.
+     * 
+ * + * string sha1_fingerprint = 7; + * + * @return This builder for chaining. + */ + public Builder clearSha1Fingerprint() { + sha1Fingerprint_ = getDefaultInstance().getSha1Fingerprint(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * Sha1 Fingerprint.
+     * 
+ * + * string sha1_fingerprint = 7; + * + * @param value The bytes for sha1Fingerprint to set. + * @return This builder for chaining. + */ + public Builder setSha1FingerprintBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sha1Fingerprint_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 8; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 8; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 8; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 8; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the database instance.
+     * 
+ * + * string instance = 8; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object selfLink_ = ""; + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 9; + * + * @return The selfLink. + */ + public java.lang.String getSelfLink() { + java.lang.Object ref = selfLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selfLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 9; + * + * @return The bytes for selfLink. + */ + public com.google.protobuf.ByteString getSelfLinkBytes() { + java.lang.Object ref = selfLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selfLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 9; + * + * @param value The selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selfLink_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 9; + * + * @return This builder for chaining. + */ + public Builder clearSelfLink() { + selfLink_ = getDefaultInstance().getSelfLink(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI of this resource.
+     * 
+ * + * string self_link = 9; + * + * @param value The bytes for selfLink to set. + * @return This builder for chaining. + */ + public Builder setSelfLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selfLink_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SslCert) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SslCert) + private static final com.google.cloud.sql.v1beta4.SslCert DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SslCert(); + } + + public static com.google.cloud.sql.v1beta4.SslCert getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslCert parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCert getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertDetail.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertDetail.java new file mode 100644 index 000000000000..28b438775116 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertDetail.java @@ -0,0 +1,894 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * SslCertDetail.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SslCertDetail} + */ +@com.google.protobuf.Generated +public final class SslCertDetail extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SslCertDetail) + SslCertDetailOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslCertDetail"); + } + + // Use SslCertDetail.newBuilder() to construct. + private SslCertDetail(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SslCertDetail() { + certPrivateKey_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SslCertDetail.class, + com.google.cloud.sql.v1beta4.SslCertDetail.Builder.class); + } + + private int bitField0_; + public static final int CERT_INFO_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.SslCert certInfo_; + + /** + * + * + *
+   * The public information about the cert.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + * + * @return Whether the certInfo field is set. + */ + @java.lang.Override + public boolean hasCertInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The public information about the cert.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + * + * @return The certInfo. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCert getCertInfo() { + return certInfo_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : certInfo_; + } + + /** + * + * + *
+   * The public information about the cert.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getCertInfoOrBuilder() { + return certInfo_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : certInfo_; + } + + public static final int CERT_PRIVATE_KEY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object certPrivateKey_ = ""; + + /** + * + * + *
+   * The private key for the client cert, in pem format.  Keep private in order
+   * to protect your security.
+   * 
+ * + * string cert_private_key = 2; + * + * @return The certPrivateKey. + */ + @java.lang.Override + public java.lang.String getCertPrivateKey() { + java.lang.Object ref = certPrivateKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certPrivateKey_ = s; + return s; + } + } + + /** + * + * + *
+   * The private key for the client cert, in pem format.  Keep private in order
+   * to protect your security.
+   * 
+ * + * string cert_private_key = 2; + * + * @return The bytes for certPrivateKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCertPrivateKeyBytes() { + java.lang.Object ref = certPrivateKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certPrivateKey_ = 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, getCertInfo()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(certPrivateKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, certPrivateKey_); + } + 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, getCertInfo()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(certPrivateKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, certPrivateKey_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SslCertDetail)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SslCertDetail other = + (com.google.cloud.sql.v1beta4.SslCertDetail) obj; + + if (hasCertInfo() != other.hasCertInfo()) return false; + if (hasCertInfo()) { + if (!getCertInfo().equals(other.getCertInfo())) return false; + } + if (!getCertPrivateKey().equals(other.getCertPrivateKey())) return false; + if (!getUnknownFields().equals(other.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 (hasCertInfo()) { + hash = (37 * hash) + CERT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getCertInfo().hashCode(); + } + hash = (37 * hash) + CERT_PRIVATE_KEY_FIELD_NUMBER; + hash = (53 * hash) + getCertPrivateKey().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SslCertDetail parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertDetail parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertDetail parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertDetail parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertDetail parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertDetail parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertDetail parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SslCertDetail prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SslCertDetail.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SslCertDetail} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SslCertDetail) + com.google.cloud.sql.v1beta4.SslCertDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SslCertDetail.class, + com.google.cloud.sql.v1beta4.SslCertDetail.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SslCertDetail.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCertInfoFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + certInfo_ = null; + if (certInfoBuilder_ != null) { + certInfoBuilder_.dispose(); + certInfoBuilder_ = null; + } + certPrivateKey_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertDetail_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertDetail getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SslCertDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertDetail build() { + com.google.cloud.sql.v1beta4.SslCertDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertDetail buildPartial() { + com.google.cloud.sql.v1beta4.SslCertDetail result = + new com.google.cloud.sql.v1beta4.SslCertDetail(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SslCertDetail result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.certInfo_ = certInfoBuilder_ == null ? certInfo_ : certInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.certPrivateKey_ = certPrivateKey_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SslCertDetail) { + return mergeFrom((com.google.cloud.sql.v1beta4.SslCertDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SslCertDetail other) { + if (other == com.google.cloud.sql.v1beta4.SslCertDetail.getDefaultInstance()) return this; + if (other.hasCertInfo()) { + mergeCertInfo(other.getCertInfo()); + } + if (!other.getCertPrivateKey().isEmpty()) { + certPrivateKey_ = other.certPrivateKey_; + 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: + { + input.readMessage( + internalGetCertInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + certPrivateKey_ = 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 com.google.cloud.sql.v1beta4.SslCert certInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + certInfoBuilder_; + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + * + * @return Whether the certInfo field is set. + */ + public boolean hasCertInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + * + * @return The certInfo. + */ + public com.google.cloud.sql.v1beta4.SslCert getCertInfo() { + if (certInfoBuilder_ == null) { + return certInfo_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : certInfo_; + } else { + return certInfoBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + */ + public Builder setCertInfo(com.google.cloud.sql.v1beta4.SslCert value) { + if (certInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + certInfo_ = value; + } else { + certInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + */ + public Builder setCertInfo(com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (certInfoBuilder_ == null) { + certInfo_ = builderForValue.build(); + } else { + certInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + */ + public Builder mergeCertInfo(com.google.cloud.sql.v1beta4.SslCert value) { + if (certInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && certInfo_ != null + && certInfo_ != com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()) { + getCertInfoBuilder().mergeFrom(value); + } else { + certInfo_ = value; + } + } else { + certInfoBuilder_.mergeFrom(value); + } + if (certInfo_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + */ + public Builder clearCertInfo() { + bitField0_ = (bitField0_ & ~0x00000001); + certInfo_ = null; + if (certInfoBuilder_ != null) { + certInfoBuilder_.dispose(); + certInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder getCertInfoBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetCertInfoFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + */ + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getCertInfoOrBuilder() { + if (certInfoBuilder_ != null) { + return certInfoBuilder_.getMessageOrBuilder(); + } else { + return certInfo_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : certInfo_; + } + } + + /** + * + * + *
+     * The public information about the cert.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + internalGetCertInfoFieldBuilder() { + if (certInfoBuilder_ == null) { + certInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder>( + getCertInfo(), getParentForChildren(), isClean()); + certInfo_ = null; + } + return certInfoBuilder_; + } + + private java.lang.Object certPrivateKey_ = ""; + + /** + * + * + *
+     * The private key for the client cert, in pem format.  Keep private in order
+     * to protect your security.
+     * 
+ * + * string cert_private_key = 2; + * + * @return The certPrivateKey. + */ + public java.lang.String getCertPrivateKey() { + java.lang.Object ref = certPrivateKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + certPrivateKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The private key for the client cert, in pem format.  Keep private in order
+     * to protect your security.
+     * 
+ * + * string cert_private_key = 2; + * + * @return The bytes for certPrivateKey. + */ + public com.google.protobuf.ByteString getCertPrivateKeyBytes() { + java.lang.Object ref = certPrivateKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + certPrivateKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The private key for the client cert, in pem format.  Keep private in order
+     * to protect your security.
+     * 
+ * + * string cert_private_key = 2; + * + * @param value The certPrivateKey to set. + * @return This builder for chaining. + */ + public Builder setCertPrivateKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + certPrivateKey_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The private key for the client cert, in pem format.  Keep private in order
+     * to protect your security.
+     * 
+ * + * string cert_private_key = 2; + * + * @return This builder for chaining. + */ + public Builder clearCertPrivateKey() { + certPrivateKey_ = getDefaultInstance().getCertPrivateKey(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The private key for the client cert, in pem format.  Keep private in order
+     * to protect your security.
+     * 
+ * + * string cert_private_key = 2; + * + * @param value The bytes for certPrivateKey to set. + * @return This builder for chaining. + */ + public Builder setCertPrivateKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + certPrivateKey_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SslCertDetail) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SslCertDetail) + private static final com.google.cloud.sql.v1beta4.SslCertDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SslCertDetail(); + } + + public static com.google.cloud.sql.v1beta4.SslCertDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslCertDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertDetailOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertDetailOrBuilder.java new file mode 100644 index 000000000000..410df5ca7886 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertDetailOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SslCertDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SslCertDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The public information about the cert.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + * + * @return Whether the certInfo field is set. + */ + boolean hasCertInfo(); + + /** + * + * + *
+   * The public information about the cert.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + * + * @return The certInfo. + */ + com.google.cloud.sql.v1beta4.SslCert getCertInfo(); + + /** + * + * + *
+   * The public information about the cert.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert cert_info = 1; + */ + com.google.cloud.sql.v1beta4.SslCertOrBuilder getCertInfoOrBuilder(); + + /** + * + * + *
+   * The private key for the client cert, in pem format.  Keep private in order
+   * to protect your security.
+   * 
+ * + * string cert_private_key = 2; + * + * @return The certPrivateKey. + */ + java.lang.String getCertPrivateKey(); + + /** + * + * + *
+   * The private key for the client cert, in pem format.  Keep private in order
+   * to protect your security.
+   * 
+ * + * string cert_private_key = 2; + * + * @return The bytes for certPrivateKey. + */ + com.google.protobuf.ByteString getCertPrivateKeyBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertOrBuilder.java new file mode 100644 index 000000000000..a6484794f46f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertOrBuilder.java @@ -0,0 +1,296 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SslCertOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SslCert) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#sslCert`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#sslCert`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Serial number, as extracted from the certificate.
+   * 
+ * + * string cert_serial_number = 2; + * + * @return The certSerialNumber. + */ + java.lang.String getCertSerialNumber(); + + /** + * + * + *
+   * Serial number, as extracted from the certificate.
+   * 
+ * + * string cert_serial_number = 2; + * + * @return The bytes for certSerialNumber. + */ + com.google.protobuf.ByteString getCertSerialNumberBytes(); + + /** + * + * + *
+   * PEM representation.
+   * 
+ * + * string cert = 3; + * + * @return The cert. + */ + java.lang.String getCert(); + + /** + * + * + *
+   * PEM representation.
+   * 
+ * + * string cert = 3; + * + * @return The bytes for cert. + */ + com.google.protobuf.ByteString getCertBytes(); + + /** + * + * + *
+   * The time when the certificate was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * The time when the certificate was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * The time when the certificate was created in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+   * 
+ * + * string common_name = 5; + * + * @return The commonName. + */ + java.lang.String getCommonName(); + + /** + * + * + *
+   * User supplied name.  Constrained to [a-zA-Z.-_ ]+.
+   * 
+ * + * string common_name = 5; + * + * @return The bytes for commonName. + */ + com.google.protobuf.ByteString getCommonNameBytes(); + + /** + * + * + *
+   * The time when the certificate expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + * + * @return Whether the expirationTime field is set. + */ + boolean hasExpirationTime(); + + /** + * + * + *
+   * The time when the certificate expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + * + * @return The expirationTime. + */ + com.google.protobuf.Timestamp getExpirationTime(); + + /** + * + * + *
+   * The time when the certificate expires in
+   * [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
+   * `2012-11-15T16:19:00.094Z`.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder(); + + /** + * + * + *
+   * Sha1 Fingerprint.
+   * 
+ * + * string sha1_fingerprint = 7; + * + * @return The sha1Fingerprint. + */ + java.lang.String getSha1Fingerprint(); + + /** + * + * + *
+   * Sha1 Fingerprint.
+   * 
+ * + * string sha1_fingerprint = 7; + * + * @return The bytes for sha1Fingerprint. + */ + com.google.protobuf.ByteString getSha1FingerprintBytes(); + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 8; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * Name of the database instance.
+   * 
+ * + * string instance = 8; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 9; + * + * @return The selfLink. + */ + java.lang.String getSelfLink(); + + /** + * + * + *
+   * The URI of this resource.
+   * 
+ * + * string self_link = 9; + * + * @return The bytes for selfLink. + */ + com.google.protobuf.ByteString getSelfLinkBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsCreateEphemeralRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsCreateEphemeralRequest.java new file mode 100644 index 000000000000..686b4ffc6746 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsCreateEphemeralRequest.java @@ -0,0 +1,786 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * SslCerts create ephemeral certificate request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest} + */ +@com.google.protobuf.Generated +public final class SslCertsCreateEphemeralRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest) + SslCertsCreateEphemeralRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslCertsCreateEphemeralRequest"); + } + + // Use SslCertsCreateEphemeralRequest.newBuilder() to construct. + private SslCertsCreateEphemeralRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SslCertsCreateEphemeralRequest() { + publicKey_ = ""; + accessToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsCreateEphemeralRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsCreateEphemeralRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.class, + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.Builder.class); + } + + public static final int PUBLIC_KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object publicKey_ = ""; + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @return The publicKey. + */ + @java.lang.Override + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } + } + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @return The bytes for publicKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACCESS_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object accessToken_ = ""; + + /** + * + * + *
+   * Access token to include in the signed certificate.
+   * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @return The accessToken. + */ + @java.lang.Override + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Access token to include in the signed certificate.
+   * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @return The bytes for accessToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = 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.GeneratedMessage.isStringEmpty(publicKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, publicKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(accessToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, accessToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(publicKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, publicKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(accessToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, accessToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest other = + (com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest) obj; + + if (!getPublicKey().equals(other.getPublicKey())) return false; + if (!getAccessToken().equals(other.getAccessToken())) return false; + if (!getUnknownFields().equals(other.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) + PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getPublicKey().hashCode(); + hash = (37 * hash) + ACCESS_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAccessToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SslCerts create ephemeral certificate request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest) + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsCreateEphemeralRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsCreateEphemeralRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.class, + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + publicKey_ = ""; + accessToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsCreateEphemeralRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest build() { + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest buildPartial() { + com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest result = + new com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.publicKey_ = publicKey_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.accessToken_ = accessToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest other) { + if (other == com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.getDefaultInstance()) + return this; + if (!other.getPublicKey().isEmpty()) { + publicKey_ = other.publicKey_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAccessToken().isEmpty()) { + accessToken_ = other.accessToken_; + 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: + { + publicKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + accessToken_ = 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 publicKey_ = ""; + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @return The publicKey. + */ + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @return The bytes for publicKey. + */ + public com.google.protobuf.ByteString getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @param value The publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + publicKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @return This builder for chaining. + */ + public Builder clearPublicKey() { + publicKey_ = getDefaultInstance().getPublicKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * PEM encoded public key to include in the signed certificate.
+     * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @param value The bytes for publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + publicKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object accessToken_ = ""; + + /** + * + * + *
+     * Access token to include in the signed certificate.
+     * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @return The accessToken. + */ + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Access token to include in the signed certificate.
+     * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @return The bytes for accessToken. + */ + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Access token to include in the signed certificate.
+     * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @param value The accessToken to set. + * @return This builder for chaining. + */ + public Builder setAccessToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + accessToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Access token to include in the signed certificate.
+     * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @return This builder for chaining. + */ + public Builder clearAccessToken() { + accessToken_ = getDefaultInstance().getAccessToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Access token to include in the signed certificate.
+     * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @param value The bytes for accessToken to set. + * @return This builder for chaining. + */ + public Builder setAccessTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + accessToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest) + private static final com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest(); + } + + public static com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslCertsCreateEphemeralRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsCreateEphemeralRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsCreateEphemeralRequestOrBuilder.java new file mode 100644 index 000000000000..9b9d76f1b98b --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsCreateEphemeralRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SslCertsCreateEphemeralRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @return The publicKey. + */ + java.lang.String getPublicKey(); + + /** + * + * + *
+   * PEM encoded public key to include in the signed certificate.
+   * 
+ * + * string public_key = 1 [json_name = "public_key"]; + * + * @return The bytes for publicKey. + */ + com.google.protobuf.ByteString getPublicKeyBytes(); + + /** + * + * + *
+   * Access token to include in the signed certificate.
+   * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @return The accessToken. + */ + java.lang.String getAccessToken(); + + /** + * + * + *
+   * Access token to include in the signed certificate.
+   * 
+ * + * string access_token = 2 [json_name = "access_token"]; + * + * @return The bytes for accessToken. + */ + com.google.protobuf.ByteString getAccessTokenBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsInsertRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsInsertRequest.java new file mode 100644 index 000000000000..9320217ba216 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsInsertRequest.java @@ -0,0 +1,603 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * SslCerts insert request.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SslCertsInsertRequest} + */ +@com.google.protobuf.Generated +public final class SslCertsInsertRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SslCertsInsertRequest) + SslCertsInsertRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslCertsInsertRequest"); + } + + // Use SslCertsInsertRequest.newBuilder() to construct. + private SslCertsInsertRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SslCertsInsertRequest() { + commonName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SslCertsInsertRequest.class, + com.google.cloud.sql.v1beta4.SslCertsInsertRequest.Builder.class); + } + + public static final int COMMON_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object commonName_ = ""; + + /** + * + * + *
+   * User supplied name.  Must be a distinct name from the other certificates
+   * for this instance.
+   * 
+ * + * string common_name = 1; + * + * @return The commonName. + */ + @java.lang.Override + public java.lang.String getCommonName() { + java.lang.Object ref = commonName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + commonName_ = s; + return s; + } + } + + /** + * + * + *
+   * User supplied name.  Must be a distinct name from the other certificates
+   * for this instance.
+   * 
+ * + * string common_name = 1; + * + * @return The bytes for commonName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCommonNameBytes() { + java.lang.Object ref = commonName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + commonName_ = 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.GeneratedMessage.isStringEmpty(commonName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, commonName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(commonName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, commonName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SslCertsInsertRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SslCertsInsertRequest other = + (com.google.cloud.sql.v1beta4.SslCertsInsertRequest) obj; + + if (!getCommonName().equals(other.getCommonName())) return false; + if (!getUnknownFields().equals(other.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) + COMMON_NAME_FIELD_NUMBER; + hash = (53 * hash) + getCommonName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SslCertsInsertRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SslCerts insert request.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SslCertsInsertRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SslCertsInsertRequest) + com.google.cloud.sql.v1beta4.SslCertsInsertRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsInsertRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsInsertRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SslCertsInsertRequest.class, + com.google.cloud.sql.v1beta4.SslCertsInsertRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SslCertsInsertRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + commonName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsInsertRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsInsertRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SslCertsInsertRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsInsertRequest build() { + com.google.cloud.sql.v1beta4.SslCertsInsertRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsInsertRequest buildPartial() { + com.google.cloud.sql.v1beta4.SslCertsInsertRequest result = + new com.google.cloud.sql.v1beta4.SslCertsInsertRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SslCertsInsertRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.commonName_ = commonName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SslCertsInsertRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.SslCertsInsertRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SslCertsInsertRequest other) { + if (other == com.google.cloud.sql.v1beta4.SslCertsInsertRequest.getDefaultInstance()) + return this; + if (!other.getCommonName().isEmpty()) { + commonName_ = other.commonName_; + 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: + { + commonName_ = 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 commonName_ = ""; + + /** + * + * + *
+     * User supplied name.  Must be a distinct name from the other certificates
+     * for this instance.
+     * 
+ * + * string common_name = 1; + * + * @return The commonName. + */ + public java.lang.String getCommonName() { + java.lang.Object ref = commonName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + commonName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * User supplied name.  Must be a distinct name from the other certificates
+     * for this instance.
+     * 
+ * + * string common_name = 1; + * + * @return The bytes for commonName. + */ + public com.google.protobuf.ByteString getCommonNameBytes() { + java.lang.Object ref = commonName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + commonName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * User supplied name.  Must be a distinct name from the other certificates
+     * for this instance.
+     * 
+ * + * string common_name = 1; + * + * @param value The commonName to set. + * @return This builder for chaining. + */ + public Builder setCommonName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + commonName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * User supplied name.  Must be a distinct name from the other certificates
+     * for this instance.
+     * 
+ * + * string common_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearCommonName() { + commonName_ = getDefaultInstance().getCommonName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * User supplied name.  Must be a distinct name from the other certificates
+     * for this instance.
+     * 
+ * + * string common_name = 1; + * + * @param value The bytes for commonName to set. + * @return This builder for chaining. + */ + public Builder setCommonNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + commonName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SslCertsInsertRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SslCertsInsertRequest) + private static final com.google.cloud.sql.v1beta4.SslCertsInsertRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SslCertsInsertRequest(); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslCertsInsertRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsInsertRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsInsertRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsInsertRequestOrBuilder.java new file mode 100644 index 000000000000..e913bca29625 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsInsertRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SslCertsInsertRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SslCertsInsertRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * User supplied name.  Must be a distinct name from the other certificates
+   * for this instance.
+   * 
+ * + * string common_name = 1; + * + * @return The commonName. + */ + java.lang.String getCommonName(); + + /** + * + * + *
+   * User supplied name.  Must be a distinct name from the other certificates
+   * for this instance.
+   * 
+ * + * string common_name = 1; + * + * @return The bytes for commonName. + */ + com.google.protobuf.ByteString getCommonNameBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsInsertResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsInsertResponse.java new file mode 100644 index 000000000000..37298a7eecb9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsInsertResponse.java @@ -0,0 +1,1476 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * SslCert insert response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SslCertsInsertResponse} + */ +@com.google.protobuf.Generated +public final class SslCertsInsertResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SslCertsInsertResponse) + SslCertsInsertResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslCertsInsertResponse"); + } + + // Use SslCertsInsertResponse.newBuilder() to construct. + private SslCertsInsertResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SslCertsInsertResponse() { + kind_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsInsertResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsInsertResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SslCertsInsertResponse.class, + com.google.cloud.sql.v1beta4.SslCertsInsertResponse.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#sslCertsInsert`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#sslCertsInsert`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPERATION_FIELD_NUMBER = 2; + private com.google.cloud.sql.v1beta4.Operation operation_; + + /** + * + * + *
+   * The operation to track the ssl certs insert request.
+   * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + * + * @return Whether the operation field is set. + */ + @java.lang.Override + public boolean hasOperation() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The operation to track the ssl certs insert request.
+   * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + * + * @return The operation. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Operation getOperation() { + return operation_ == null + ? com.google.cloud.sql.v1beta4.Operation.getDefaultInstance() + : operation_; + } + + /** + * + * + *
+   * The operation to track the ssl certs insert request.
+   * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.OperationOrBuilder getOperationOrBuilder() { + return operation_ == null + ? com.google.cloud.sql.v1beta4.Operation.getDefaultInstance() + : operation_; + } + + public static final int SERVER_CA_CERT_FIELD_NUMBER = 3; + private com.google.cloud.sql.v1beta4.SslCert serverCaCert_; + + /** + * + * + *
+   * The server Certificate Authority's certificate.  If this is missing you can
+   * force a new one to be generated by calling resetSslConfig method on
+   * instances resource.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + * + * @return Whether the serverCaCert field is set. + */ + @java.lang.Override + public boolean hasServerCaCert() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The server Certificate Authority's certificate.  If this is missing you can
+   * force a new one to be generated by calling resetSslConfig method on
+   * instances resource.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + * + * @return The serverCaCert. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCert getServerCaCert() { + return serverCaCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : serverCaCert_; + } + + /** + * + * + *
+   * The server Certificate Authority's certificate.  If this is missing you can
+   * force a new one to be generated by calling resetSslConfig method on
+   * instances resource.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getServerCaCertOrBuilder() { + return serverCaCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : serverCaCert_; + } + + public static final int CLIENT_CERT_FIELD_NUMBER = 4; + private com.google.cloud.sql.v1beta4.SslCertDetail clientCert_; + + /** + * + * + *
+   * The new client certificate and private key.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + * + * @return Whether the clientCert field is set. + */ + @java.lang.Override + public boolean hasClientCert() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The new client certificate and private key.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + * + * @return The clientCert. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertDetail getClientCert() { + return clientCert_ == null + ? com.google.cloud.sql.v1beta4.SslCertDetail.getDefaultInstance() + : clientCert_; + } + + /** + * + * + *
+   * The new client certificate and private key.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertDetailOrBuilder getClientCertOrBuilder() { + return clientCert_ == null + ? com.google.cloud.sql.v1beta4.SslCertDetail.getDefaultInstance() + : clientCert_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getOperation()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getServerCaCert()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getClientCert()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOperation()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getServerCaCert()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getClientCert()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SslCertsInsertResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SslCertsInsertResponse other = + (com.google.cloud.sql.v1beta4.SslCertsInsertResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (hasOperation() != other.hasOperation()) return false; + if (hasOperation()) { + if (!getOperation().equals(other.getOperation())) return false; + } + if (hasServerCaCert() != other.hasServerCaCert()) return false; + if (hasServerCaCert()) { + if (!getServerCaCert().equals(other.getServerCaCert())) return false; + } + if (hasClientCert() != other.hasClientCert()) return false; + if (hasClientCert()) { + if (!getClientCert().equals(other.getClientCert())) return false; + } + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (hasOperation()) { + hash = (37 * hash) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + } + if (hasServerCaCert()) { + hash = (37 * hash) + SERVER_CA_CERT_FIELD_NUMBER; + hash = (53 * hash) + getServerCaCert().hashCode(); + } + if (hasClientCert()) { + hash = (37 * hash) + CLIENT_CERT_FIELD_NUMBER; + hash = (53 * hash) + getClientCert().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SslCertsInsertResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SslCert insert response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SslCertsInsertResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SslCertsInsertResponse) + com.google.cloud.sql.v1beta4.SslCertsInsertResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsInsertResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsInsertResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SslCertsInsertResponse.class, + com.google.cloud.sql.v1beta4.SslCertsInsertResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SslCertsInsertResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOperationFieldBuilder(); + internalGetServerCaCertFieldBuilder(); + internalGetClientCertFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + operation_ = null; + if (operationBuilder_ != null) { + operationBuilder_.dispose(); + operationBuilder_ = null; + } + serverCaCert_ = null; + if (serverCaCertBuilder_ != null) { + serverCaCertBuilder_.dispose(); + serverCaCertBuilder_ = null; + } + clientCert_ = null; + if (clientCertBuilder_ != null) { + clientCertBuilder_.dispose(); + clientCertBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsInsertResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsInsertResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SslCertsInsertResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsInsertResponse build() { + com.google.cloud.sql.v1beta4.SslCertsInsertResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsInsertResponse buildPartial() { + com.google.cloud.sql.v1beta4.SslCertsInsertResponse result = + new com.google.cloud.sql.v1beta4.SslCertsInsertResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SslCertsInsertResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.operation_ = operationBuilder_ == null ? operation_ : operationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.serverCaCert_ = + serverCaCertBuilder_ == null ? serverCaCert_ : serverCaCertBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.clientCert_ = clientCertBuilder_ == null ? clientCert_ : clientCertBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SslCertsInsertResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.SslCertsInsertResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SslCertsInsertResponse other) { + if (other == com.google.cloud.sql.v1beta4.SslCertsInsertResponse.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasOperation()) { + mergeOperation(other.getOperation()); + } + if (other.hasServerCaCert()) { + mergeServerCaCert(other.getServerCaCert()); + } + if (other.hasClientCert()) { + mergeClientCert(other.getClientCert()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetOperationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetServerCaCertFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetClientCertFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#sslCertsInsert`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#sslCertsInsert`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#sslCertsInsert`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#sslCertsInsert`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#sslCertsInsert`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.Operation operation_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Operation, + com.google.cloud.sql.v1beta4.Operation.Builder, + com.google.cloud.sql.v1beta4.OperationOrBuilder> + operationBuilder_; + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + * + * @return Whether the operation field is set. + */ + public boolean hasOperation() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + * + * @return The operation. + */ + public com.google.cloud.sql.v1beta4.Operation getOperation() { + if (operationBuilder_ == null) { + return operation_ == null + ? com.google.cloud.sql.v1beta4.Operation.getDefaultInstance() + : operation_; + } else { + return operationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + */ + public Builder setOperation(com.google.cloud.sql.v1beta4.Operation value) { + if (operationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + } else { + operationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + */ + public Builder setOperation(com.google.cloud.sql.v1beta4.Operation.Builder builderForValue) { + if (operationBuilder_ == null) { + operation_ = builderForValue.build(); + } else { + operationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + */ + public Builder mergeOperation(com.google.cloud.sql.v1beta4.Operation value) { + if (operationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && operation_ != null + && operation_ != com.google.cloud.sql.v1beta4.Operation.getDefaultInstance()) { + getOperationBuilder().mergeFrom(value); + } else { + operation_ = value; + } + } else { + operationBuilder_.mergeFrom(value); + } + if (operation_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + */ + public Builder clearOperation() { + bitField0_ = (bitField0_ & ~0x00000002); + operation_ = null; + if (operationBuilder_ != null) { + operationBuilder_.dispose(); + operationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + */ + public com.google.cloud.sql.v1beta4.Operation.Builder getOperationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetOperationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + */ + public com.google.cloud.sql.v1beta4.OperationOrBuilder getOperationOrBuilder() { + if (operationBuilder_ != null) { + return operationBuilder_.getMessageOrBuilder(); + } else { + return operation_ == null + ? com.google.cloud.sql.v1beta4.Operation.getDefaultInstance() + : operation_; + } + } + + /** + * + * + *
+     * The operation to track the ssl certs insert request.
+     * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Operation, + com.google.cloud.sql.v1beta4.Operation.Builder, + com.google.cloud.sql.v1beta4.OperationOrBuilder> + internalGetOperationFieldBuilder() { + if (operationBuilder_ == null) { + operationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Operation, + com.google.cloud.sql.v1beta4.Operation.Builder, + com.google.cloud.sql.v1beta4.OperationOrBuilder>( + getOperation(), getParentForChildren(), isClean()); + operation_ = null; + } + return operationBuilder_; + } + + private com.google.cloud.sql.v1beta4.SslCert serverCaCert_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + serverCaCertBuilder_; + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + * + * @return Whether the serverCaCert field is set. + */ + public boolean hasServerCaCert() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + * + * @return The serverCaCert. + */ + public com.google.cloud.sql.v1beta4.SslCert getServerCaCert() { + if (serverCaCertBuilder_ == null) { + return serverCaCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : serverCaCert_; + } else { + return serverCaCertBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + */ + public Builder setServerCaCert(com.google.cloud.sql.v1beta4.SslCert value) { + if (serverCaCertBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serverCaCert_ = value; + } else { + serverCaCertBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + */ + public Builder setServerCaCert(com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (serverCaCertBuilder_ == null) { + serverCaCert_ = builderForValue.build(); + } else { + serverCaCertBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + */ + public Builder mergeServerCaCert(com.google.cloud.sql.v1beta4.SslCert value) { + if (serverCaCertBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && serverCaCert_ != null + && serverCaCert_ != com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()) { + getServerCaCertBuilder().mergeFrom(value); + } else { + serverCaCert_ = value; + } + } else { + serverCaCertBuilder_.mergeFrom(value); + } + if (serverCaCert_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + */ + public Builder clearServerCaCert() { + bitField0_ = (bitField0_ & ~0x00000004); + serverCaCert_ = null; + if (serverCaCertBuilder_ != null) { + serverCaCertBuilder_.dispose(); + serverCaCertBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder getServerCaCertBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetServerCaCertFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + */ + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getServerCaCertOrBuilder() { + if (serverCaCertBuilder_ != null) { + return serverCaCertBuilder_.getMessageOrBuilder(); + } else { + return serverCaCert_ == null + ? com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance() + : serverCaCert_; + } + } + + /** + * + * + *
+     * The server Certificate Authority's certificate.  If this is missing you can
+     * force a new one to be generated by calling resetSslConfig method on
+     * instances resource.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + internalGetServerCaCertFieldBuilder() { + if (serverCaCertBuilder_ == null) { + serverCaCertBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder>( + getServerCaCert(), getParentForChildren(), isClean()); + serverCaCert_ = null; + } + return serverCaCertBuilder_; + } + + private com.google.cloud.sql.v1beta4.SslCertDetail clientCert_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCertDetail, + com.google.cloud.sql.v1beta4.SslCertDetail.Builder, + com.google.cloud.sql.v1beta4.SslCertDetailOrBuilder> + clientCertBuilder_; + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + * + * @return Whether the clientCert field is set. + */ + public boolean hasClientCert() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + * + * @return The clientCert. + */ + public com.google.cloud.sql.v1beta4.SslCertDetail getClientCert() { + if (clientCertBuilder_ == null) { + return clientCert_ == null + ? com.google.cloud.sql.v1beta4.SslCertDetail.getDefaultInstance() + : clientCert_; + } else { + return clientCertBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + */ + public Builder setClientCert(com.google.cloud.sql.v1beta4.SslCertDetail value) { + if (clientCertBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clientCert_ = value; + } else { + clientCertBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + */ + public Builder setClientCert( + com.google.cloud.sql.v1beta4.SslCertDetail.Builder builderForValue) { + if (clientCertBuilder_ == null) { + clientCert_ = builderForValue.build(); + } else { + clientCertBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + */ + public Builder mergeClientCert(com.google.cloud.sql.v1beta4.SslCertDetail value) { + if (clientCertBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && clientCert_ != null + && clientCert_ != com.google.cloud.sql.v1beta4.SslCertDetail.getDefaultInstance()) { + getClientCertBuilder().mergeFrom(value); + } else { + clientCert_ = value; + } + } else { + clientCertBuilder_.mergeFrom(value); + } + if (clientCert_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + */ + public Builder clearClientCert() { + bitField0_ = (bitField0_ & ~0x00000008); + clientCert_ = null; + if (clientCertBuilder_ != null) { + clientCertBuilder_.dispose(); + clientCertBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + */ + public com.google.cloud.sql.v1beta4.SslCertDetail.Builder getClientCertBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetClientCertFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + */ + public com.google.cloud.sql.v1beta4.SslCertDetailOrBuilder getClientCertOrBuilder() { + if (clientCertBuilder_ != null) { + return clientCertBuilder_.getMessageOrBuilder(); + } else { + return clientCert_ == null + ? com.google.cloud.sql.v1beta4.SslCertDetail.getDefaultInstance() + : clientCert_; + } + } + + /** + * + * + *
+     * The new client certificate and private key.
+     * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCertDetail, + com.google.cloud.sql.v1beta4.SslCertDetail.Builder, + com.google.cloud.sql.v1beta4.SslCertDetailOrBuilder> + internalGetClientCertFieldBuilder() { + if (clientCertBuilder_ == null) { + clientCertBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SslCertDetail, + com.google.cloud.sql.v1beta4.SslCertDetail.Builder, + com.google.cloud.sql.v1beta4.SslCertDetailOrBuilder>( + getClientCert(), getParentForChildren(), isClean()); + clientCert_ = null; + } + return clientCertBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SslCertsInsertResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SslCertsInsertResponse) + private static final com.google.cloud.sql.v1beta4.SslCertsInsertResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SslCertsInsertResponse(); + } + + public static com.google.cloud.sql.v1beta4.SslCertsInsertResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslCertsInsertResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsInsertResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsInsertResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsInsertResponseOrBuilder.java new file mode 100644 index 000000000000..20acd7d85dc0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsInsertResponseOrBuilder.java @@ -0,0 +1,171 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SslCertsInsertResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SslCertsInsertResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#sslCertsInsert`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#sslCertsInsert`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The operation to track the ssl certs insert request.
+   * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + * + * @return Whether the operation field is set. + */ + boolean hasOperation(); + + /** + * + * + *
+   * The operation to track the ssl certs insert request.
+   * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + * + * @return The operation. + */ + com.google.cloud.sql.v1beta4.Operation getOperation(); + + /** + * + * + *
+   * The operation to track the ssl certs insert request.
+   * 
+ * + * .google.cloud.sql.v1beta4.Operation operation = 2; + */ + com.google.cloud.sql.v1beta4.OperationOrBuilder getOperationOrBuilder(); + + /** + * + * + *
+   * The server Certificate Authority's certificate.  If this is missing you can
+   * force a new one to be generated by calling resetSslConfig method on
+   * instances resource.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + * + * @return Whether the serverCaCert field is set. + */ + boolean hasServerCaCert(); + + /** + * + * + *
+   * The server Certificate Authority's certificate.  If this is missing you can
+   * force a new one to be generated by calling resetSslConfig method on
+   * instances resource.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + * + * @return The serverCaCert. + */ + com.google.cloud.sql.v1beta4.SslCert getServerCaCert(); + + /** + * + * + *
+   * The server Certificate Authority's certificate.  If this is missing you can
+   * force a new one to be generated by calling resetSslConfig method on
+   * instances resource.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCert server_ca_cert = 3; + */ + com.google.cloud.sql.v1beta4.SslCertOrBuilder getServerCaCertOrBuilder(); + + /** + * + * + *
+   * The new client certificate and private key.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + * + * @return Whether the clientCert field is set. + */ + boolean hasClientCert(); + + /** + * + * + *
+   * The new client certificate and private key.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + * + * @return The clientCert. + */ + com.google.cloud.sql.v1beta4.SslCertDetail getClientCert(); + + /** + * + * + *
+   * The new client certificate and private key.
+   * 
+ * + * .google.cloud.sql.v1beta4.SslCertDetail client_cert = 4; + */ + com.google.cloud.sql.v1beta4.SslCertDetailOrBuilder getClientCertOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsListResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsListResponse.java new file mode 100644 index 000000000000..a6cf64680b6c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsListResponse.java @@ -0,0 +1,1110 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * SslCerts list response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SslCertsListResponse} + */ +@com.google.protobuf.Generated +public final class SslCertsListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SslCertsListResponse) + SslCertsListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SslCertsListResponse"); + } + + // Use SslCertsListResponse.newBuilder() to construct. + private SslCertsListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SslCertsListResponse() { + kind_ = ""; + items_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SslCertsListResponse.class, + com.google.cloud.sql.v1beta4.SslCertsListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#sslCertsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#sslCertsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCert getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.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.sql.v1beta4.SslCertsListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SslCertsListResponse other = + (com.google.cloud.sql.v1beta4.SslCertsListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SslCertsListResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertsListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertsListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SslCertsListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsListResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertsListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertsListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SslCertsListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SslCertsListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SslCertsListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * SslCerts list response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SslCertsListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SslCertsListResponse) + com.google.cloud.sql.v1beta4.SslCertsListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SslCertsListResponse.class, + com.google.cloud.sql.v1beta4.SslCertsListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SslCertsListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SslCertsListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SslCertsListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsListResponse build() { + com.google.cloud.sql.v1beta4.SslCertsListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsListResponse buildPartial() { + com.google.cloud.sql.v1beta4.SslCertsListResponse result = + new com.google.cloud.sql.v1beta4.SslCertsListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.sql.v1beta4.SslCertsListResponse result) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SslCertsListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SslCertsListResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.SslCertsListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SslCertsListResponse other) { + if (other == com.google.cloud.sql.v1beta4.SslCertsListResponse.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1beta4.SslCert m = + input.readMessage( + com.google.cloud.sql.v1beta4.SslCert.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#sslCertsList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#sslCertsList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#sslCertsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#sslCertsList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#sslCertsList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public com.google.cloud.sql.v1beta4.SslCert getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1beta4.SslCert value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public Builder setItems( + int index, com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.SslCert value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1beta4.SslCert value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public Builder addItems( + int index, com.google.cloud.sql.v1beta4.SslCert.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public com.google.cloud.sql.v1beta4.SslCertOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public com.google.cloud.sql.v1beta4.SslCert.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.SslCert.getDefaultInstance()); + } + + /** + * + * + *
+     * List of client certificates for the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.SslCert, + com.google.cloud.sql.v1beta4.SslCert.Builder, + com.google.cloud.sql.v1beta4.SslCertOrBuilder>( + items_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SslCertsListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SslCertsListResponse) + private static final com.google.cloud.sql.v1beta4.SslCertsListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SslCertsListResponse(); + } + + public static com.google.cloud.sql.v1beta4.SslCertsListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SslCertsListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SslCertsListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsListResponseOrBuilder.java new file mode 100644 index 000000000000..6d62873b5f58 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SslCertsListResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SslCertsListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SslCertsListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#sslCertsList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#sslCertsList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + com.google.cloud.sql.v1beta4.SslCert getItems(int index); + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + int getItemsCount(); + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + java.util.List getItemsOrBuilderList(); + + /** + * + * + *
+   * List of client certificates for the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.SslCert items = 2; + */ + com.google.cloud.sql.v1beta4.SslCertOrBuilder getItemsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StartSession.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StartSession.java new file mode 100644 index 000000000000..ffbded969011 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StartSession.java @@ -0,0 +1,1033 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Start a new session. The client must send this as the first message to the
+ * server to start a new session. The client may immediately send Data messages
+ * without waiting for a reply from the server.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.StartSession} + */ +@com.google.protobuf.Generated +public final class StartSession extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.StartSession) + StartSessionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StartSession"); + } + + // Use StartSession.newBuilder() to construct. + private StartSession(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private StartSession() { + locationId_ = ""; + instanceId_ = ""; + sessionId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StartSession_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StartSession_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.StartSession.class, + com.google.cloud.sql.v1beta4.StartSession.Builder.class); + } + + public static final int LOCATION_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object locationId_ = ""; + + /** + * + * + *
+   * Required. `location_id` is used to route the
+   * request to a specific region. Use the same region which was used to create
+   * the instance. Use the format `locations/{location}`, for example:
+   * `locations/us-central1`.
+   * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The locationId. + */ + @java.lang.Override + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. `location_id` is used to route the
+   * request to a specific region. Use the same region which was used to create
+   * the instance. Use the format `locations/{location}`, for example:
+   * `locations/us-central1`.
+   * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for locationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationId_ = 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 Cloud SQL instance resource name, for example:
+   * projects/example-project/instances/example-instance
+   * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 Cloud SQL instance resource name, for example:
+   * projects/example-project/instances/example-instance
+   * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 SESSION_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object sessionId_ = ""; + + /** + * + * + *
+   * Optional. The session id, chosen by the client. This should be an
+   * unguessable string. If the client does not intend to reconnect to this
+   * session, the client may leave session_id unset.
+   * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The sessionId. + */ + @java.lang.Override + public java.lang.String getSessionId() { + java.lang.Object ref = sessionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sessionId_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The session id, chosen by the client. This should be an
+   * unguessable string. If the client does not intend to reconnect to this
+   * session, the client may leave session_id unset.
+   * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for sessionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSessionIdBytes() { + java.lang.Object ref = sessionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sessionId_ = 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.GeneratedMessage.isStringEmpty(locationId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, locationId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instanceId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sessionId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, sessionId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(locationId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, locationId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instanceId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sessionId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, sessionId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.StartSession)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.StartSession other = + (com.google.cloud.sql.v1beta4.StartSession) obj; + + if (!getLocationId().equals(other.getLocationId())) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (!getSessionId().equals(other.getSessionId())) return false; + if (!getUnknownFields().equals(other.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) + LOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getLocationId().hashCode(); + hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + hash = (37 * hash) + SESSION_ID_FIELD_NUMBER; + hash = (53 * hash) + getSessionId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.StartSession parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.StartSession parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StartSession parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.StartSession parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StartSession parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.StartSession parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StartSession parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.StartSession parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StartSession parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.StartSession parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StartSession parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.StartSession parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.StartSession prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Start a new session. The client must send this as the first message to the
+   * server to start a new session. The client may immediately send Data messages
+   * without waiting for a reply from the server.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.StartSession} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.StartSession) + com.google.cloud.sql.v1beta4.StartSessionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StartSession_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StartSession_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.StartSession.class, + com.google.cloud.sql.v1beta4.StartSession.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.StartSession.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + locationId_ = ""; + instanceId_ = ""; + sessionId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StartSession_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.StartSession getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.StartSession.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.StartSession build() { + com.google.cloud.sql.v1beta4.StartSession result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.StartSession buildPartial() { + com.google.cloud.sql.v1beta4.StartSession result = + new com.google.cloud.sql.v1beta4.StartSession(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.StartSession result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.locationId_ = locationId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceId_ = instanceId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sessionId_ = sessionId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.StartSession) { + return mergeFrom((com.google.cloud.sql.v1beta4.StartSession) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.StartSession other) { + if (other == com.google.cloud.sql.v1beta4.StartSession.getDefaultInstance()) return this; + if (!other.getLocationId().isEmpty()) { + locationId_ = other.locationId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSessionId().isEmpty()) { + sessionId_ = other.sessionId_; + 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: + { + locationId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + sessionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object locationId_ = ""; + + /** + * + * + *
+     * Required. `location_id` is used to route the
+     * request to a specific region. Use the same region which was used to create
+     * the instance. Use the format `locations/{location}`, for example:
+     * `locations/us-central1`.
+     * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The locationId. + */ + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. `location_id` is used to route the
+     * request to a specific region. Use the same region which was used to create
+     * the instance. Use the format `locations/{location}`, for example:
+     * `locations/us-central1`.
+     * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for locationId. + */ + public com.google.protobuf.ByteString getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. `location_id` is used to route the
+     * request to a specific region. Use the same region which was used to create
+     * the instance. Use the format `locations/{location}`, for example:
+     * `locations/us-central1`.
+     * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The locationId to set. + * @return This builder for chaining. + */ + public Builder setLocationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + locationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. `location_id` is used to route the
+     * request to a specific region. Use the same region which was used to create
+     * the instance. Use the format `locations/{location}`, for example:
+     * `locations/us-central1`.
+     * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearLocationId() { + locationId_ = getDefaultInstance().getLocationId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. `location_id` is used to route the
+     * request to a specific region. Use the same region which was used to create
+     * the instance. Use the format `locations/{location}`, for example:
+     * `locations/us-central1`.
+     * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for locationId to set. + * @return This builder for chaining. + */ + public Builder setLocationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + locationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + + /** + * + * + *
+     * Required. The Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 java.lang.Object sessionId_ = ""; + + /** + * + * + *
+     * Optional. The session id, chosen by the client. This should be an
+     * unguessable string. If the client does not intend to reconnect to this
+     * session, the client may leave session_id unset.
+     * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The sessionId. + */ + public java.lang.String getSessionId() { + java.lang.Object ref = sessionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sessionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The session id, chosen by the client. This should be an
+     * unguessable string. If the client does not intend to reconnect to this
+     * session, the client may leave session_id unset.
+     * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for sessionId. + */ + public com.google.protobuf.ByteString getSessionIdBytes() { + java.lang.Object ref = sessionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sessionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The session id, chosen by the client. This should be an
+     * unguessable string. If the client does not intend to reconnect to this
+     * session, the client may leave session_id unset.
+     * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The sessionId to set. + * @return This builder for chaining. + */ + public Builder setSessionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sessionId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The session id, chosen by the client. This should be an
+     * unguessable string. If the client does not intend to reconnect to this
+     * session, the client may leave session_id unset.
+     * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearSessionId() { + sessionId_ = getDefaultInstance().getSessionId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The session id, chosen by the client. This should be an
+     * unguessable string. If the client does not intend to reconnect to this
+     * session, the client may leave session_id unset.
+     * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for sessionId to set. + * @return This builder for chaining. + */ + public Builder setSessionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sessionId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.StartSession) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.StartSession) + private static final com.google.cloud.sql.v1beta4.StartSession DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.StartSession(); + } + + public static com.google.cloud.sql.v1beta4.StartSession getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StartSession parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.StartSession getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StartSessionOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StartSessionOrBuilder.java new file mode 100644 index 000000000000..de8baa563f98 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StartSessionOrBuilder.java @@ -0,0 +1,122 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface StartSessionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.StartSession) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. `location_id` is used to route the
+   * request to a specific region. Use the same region which was used to create
+   * the instance. Use the format `locations/{location}`, for example:
+   * `locations/us-central1`.
+   * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The locationId. + */ + java.lang.String getLocationId(); + + /** + * + * + *
+   * Required. `location_id` is used to route the
+   * request to a specific region. Use the same region which was used to create
+   * the instance. Use the format `locations/{location}`, for example:
+   * `locations/us-central1`.
+   * 
+ * + * string location_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for locationId. + */ + com.google.protobuf.ByteString getLocationIdBytes(); + + /** + * + * + *
+   * Required. The Cloud SQL instance resource name, for example:
+   * projects/example-project/instances/example-instance
+   * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + + /** + * + * + *
+   * Required. The Cloud SQL instance resource name, for example:
+   * projects/example-project/instances/example-instance
+   * 
+ * + * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * Optional. The session id, chosen by the client. This should be an
+   * unguessable string. If the client does not intend to reconnect to this
+   * session, the client may leave session_id unset.
+   * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The sessionId. + */ + java.lang.String getSessionId(); + + /** + * + * + *
+   * Optional. The session id, chosen by the client. This should be an
+   * unguessable string. If the client does not intend to reconnect to this
+   * session, the client may leave session_id unset.
+   * 
+ * + * string session_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for sessionId. + */ + com.google.protobuf.ByteString getSessionIdBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StreamSqlDataRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StreamSqlDataRequest.java new file mode 100644 index 000000000000..121cbb752cf9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StreamSqlDataRequest.java @@ -0,0 +1,2249 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Message sent from the client to `SqlDataService`.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.StreamSqlDataRequest} + */ +@com.google.protobuf.Generated +public final class StreamSqlDataRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.StreamSqlDataRequest) + StreamSqlDataRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StreamSqlDataRequest"); + } + + // Use StreamSqlDataRequest.newBuilder() to construct. + private StreamSqlDataRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private StreamSqlDataRequest() { + instanceId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StreamSqlDataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StreamSqlDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.StreamSqlDataRequest.class, + com.google.cloud.sql.v1beta4.StreamSqlDataRequest.Builder.class); + } + + private int bitField0_; + private int messageCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object message_; + + public enum MessageCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + START_SESSION(5), + CONTINUE_SESSION(6), + DATA(7), + TERMINATE_SESSION(8), + MESSAGE_NOT_SET(0); + private final int value; + + private MessageCase(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 MessageCase valueOf(int value) { + return forNumber(value); + } + + public static MessageCase forNumber(int value) { + switch (value) { + case 5: + return START_SESSION; + case 6: + return CONTINUE_SESSION; + case 7: + return DATA; + case 8: + return TERMINATE_SESSION; + case 0: + return MESSAGE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MessageCase getMessageCase() { + return MessageCase.forNumber(messageCase_); + } + + public static final int ACK_FIELD_NUMBER = 4; + private com.google.cloud.sql.v1beta4.Ack ack_; + + /** + * + * + *
+   * Optional. Acknowledges data received by the client.
+   * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the ack field is set. + */ + @java.lang.Override + public boolean hasAck() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Acknowledges data received by the client.
+   * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ack. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Ack getAck() { + return ack_ == null ? com.google.cloud.sql.v1beta4.Ack.getDefaultInstance() : ack_; + } + + /** + * + * + *
+   * Optional. Acknowledges data received by the client.
+   * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AckOrBuilder getAckOrBuilder() { + return ack_ == null ? com.google.cloud.sql.v1beta4.Ack.getDefaultInstance() : ack_; + } + + public static final int START_SESSION_FIELD_NUMBER = 5; + + /** + * + * + *
+   * Starts a new session. When starting a new session, this is the first
+   * message the client sends.
+   * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + * + * @return Whether the startSession field is set. + */ + @java.lang.Override + public boolean hasStartSession() { + return messageCase_ == 5; + } + + /** + * + * + *
+   * Starts a new session. When starting a new session, this is the first
+   * message the client sends.
+   * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + * + * @return The startSession. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.StartSession getStartSession() { + if (messageCase_ == 5) { + return (com.google.cloud.sql.v1beta4.StartSession) message_; + } + return com.google.cloud.sql.v1beta4.StartSession.getDefaultInstance(); + } + + /** + * + * + *
+   * Starts a new session. When starting a new session, this is the first
+   * message the client sends.
+   * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.StartSessionOrBuilder getStartSessionOrBuilder() { + if (messageCase_ == 5) { + return (com.google.cloud.sql.v1beta4.StartSession) message_; + } + return com.google.cloud.sql.v1beta4.StartSession.getDefaultInstance(); + } + + public static final int CONTINUE_SESSION_FIELD_NUMBER = 6; + + /** + * + * + *
+   * Continues an existing session. When continuing an existing session, this
+   * is the first message the client sends.
+   * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + * + * @return Whether the continueSession field is set. + */ + @java.lang.Override + public boolean hasContinueSession() { + return messageCase_ == 6; + } + + /** + * + * + *
+   * Continues an existing session. When continuing an existing session, this
+   * is the first message the client sends.
+   * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + * + * @return The continueSession. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ContinueSession getContinueSession() { + if (messageCase_ == 6) { + return (com.google.cloud.sql.v1beta4.ContinueSession) message_; + } + return com.google.cloud.sql.v1beta4.ContinueSession.getDefaultInstance(); + } + + /** + * + * + *
+   * Continues an existing session. When continuing an existing session, this
+   * is the first message the client sends.
+   * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ContinueSessionOrBuilder getContinueSessionOrBuilder() { + if (messageCase_ == 6) { + return (com.google.cloud.sql.v1beta4.ContinueSession) message_; + } + return com.google.cloud.sql.v1beta4.ContinueSession.getDefaultInstance(); + } + + public static final int DATA_FIELD_NUMBER = 7; + + /** + * + * + *
+   * Database data.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + * + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return messageCase_ == 7; + } + + /** + * + * + *
+   * Database data.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + * + * @return The data. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataPacket getData() { + if (messageCase_ == 7) { + return (com.google.cloud.sql.v1beta4.DataPacket) message_; + } + return com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance(); + } + + /** + * + * + *
+   * Database data.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataPacketOrBuilder getDataOrBuilder() { + if (messageCase_ == 7) { + return (com.google.cloud.sql.v1beta4.DataPacket) message_; + } + return com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance(); + } + + public static final int TERMINATE_SESSION_FIELD_NUMBER = 8; + + /** + * + * + *
+   * Terminates the session. This closes the connection to the database.
+   * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + * + * @return Whether the terminateSession field is set. + */ + @java.lang.Override + public boolean hasTerminateSession() { + return messageCase_ == 8; + } + + /** + * + * + *
+   * Terminates the session. This closes the connection to the database.
+   * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + * + * @return The terminateSession. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.TerminateSession getTerminateSession() { + if (messageCase_ == 8) { + return (com.google.cloud.sql.v1beta4.TerminateSession) message_; + } + return com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance(); + } + + /** + * + * + *
+   * Terminates the session. This closes the connection to the database.
+   * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.TerminateSessionOrBuilder getTerminateSessionOrBuilder() { + if (messageCase_ == 8) { + return (com.google.cloud.sql.v1beta4.TerminateSession) message_; + } + return com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance(); + } + + public static final int INSTANCE_ID_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceId_ = ""; + + /** + * + * + *
+   * Optional. Deprecated: Use `StartSession.instance_id` or
+   * `ContinueSession.instance_id` instead.
+   * The Cloud SQL instance resource name, for example:
+   * projects/example-project/instances/example-instance
+   * 
+ * + * + * string instance_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
+   * Optional. Deprecated: Use `StartSession.instance_id` or
+   * `ContinueSession.instance_id` instead.
+   * The Cloud SQL instance resource name, for example:
+   * projects/example-project/instances/example-instance
+   * 
+ * + * + * string instance_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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(4, getAck()); + } + if (messageCase_ == 5) { + output.writeMessage(5, (com.google.cloud.sql.v1beta4.StartSession) message_); + } + if (messageCase_ == 6) { + output.writeMessage(6, (com.google.cloud.sql.v1beta4.ContinueSession) message_); + } + if (messageCase_ == 7) { + output.writeMessage(7, (com.google.cloud.sql.v1beta4.DataPacket) message_); + } + if (messageCase_ == 8) { + output.writeMessage(8, (com.google.cloud.sql.v1beta4.TerminateSession) message_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, instanceId_); + } + 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(4, getAck()); + } + if (messageCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.cloud.sql.v1beta4.StartSession) message_); + } + if (messageCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.sql.v1beta4.ContinueSession) message_); + } + if (messageCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.cloud.sql.v1beta4.DataPacket) message_); + } + if (messageCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.sql.v1beta4.TerminateSession) message_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, instanceId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.StreamSqlDataRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.StreamSqlDataRequest other = + (com.google.cloud.sql.v1beta4.StreamSqlDataRequest) obj; + + if (hasAck() != other.hasAck()) return false; + if (hasAck()) { + if (!getAck().equals(other.getAck())) return false; + } + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (!getMessageCase().equals(other.getMessageCase())) return false; + switch (messageCase_) { + case 5: + if (!getStartSession().equals(other.getStartSession())) return false; + break; + case 6: + if (!getContinueSession().equals(other.getContinueSession())) return false; + break; + case 7: + if (!getData().equals(other.getData())) return false; + break; + case 8: + if (!getTerminateSession().equals(other.getTerminateSession())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAck()) { + hash = (37 * hash) + ACK_FIELD_NUMBER; + hash = (53 * hash) + getAck().hashCode(); + } + hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + switch (messageCase_) { + case 5: + hash = (37 * hash) + START_SESSION_FIELD_NUMBER; + hash = (53 * hash) + getStartSession().hashCode(); + break; + case 6: + hash = (37 * hash) + CONTINUE_SESSION_FIELD_NUMBER; + hash = (53 * hash) + getContinueSession().hashCode(); + break; + case 7: + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + break; + case 8: + hash = (37 * hash) + TERMINATE_SESSION_FIELD_NUMBER; + hash = (53 * hash) + getTerminateSession().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.StreamSqlDataRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Message sent from the client to `SqlDataService`.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.StreamSqlDataRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.StreamSqlDataRequest) + com.google.cloud.sql.v1beta4.StreamSqlDataRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StreamSqlDataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StreamSqlDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.StreamSqlDataRequest.class, + com.google.cloud.sql.v1beta4.StreamSqlDataRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.StreamSqlDataRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAckFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + ack_ = null; + if (ackBuilder_ != null) { + ackBuilder_.dispose(); + ackBuilder_ = null; + } + if (startSessionBuilder_ != null) { + startSessionBuilder_.clear(); + } + if (continueSessionBuilder_ != null) { + continueSessionBuilder_.clear(); + } + if (dataBuilder_ != null) { + dataBuilder_.clear(); + } + if (terminateSessionBuilder_ != null) { + terminateSessionBuilder_.clear(); + } + instanceId_ = ""; + messageCase_ = 0; + message_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StreamSqlDataRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.StreamSqlDataRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.StreamSqlDataRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.StreamSqlDataRequest build() { + com.google.cloud.sql.v1beta4.StreamSqlDataRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.StreamSqlDataRequest buildPartial() { + com.google.cloud.sql.v1beta4.StreamSqlDataRequest result = + new com.google.cloud.sql.v1beta4.StreamSqlDataRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.StreamSqlDataRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ack_ = ackBuilder_ == null ? ack_ : ackBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.instanceId_ = instanceId_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.sql.v1beta4.StreamSqlDataRequest result) { + result.messageCase_ = messageCase_; + result.message_ = this.message_; + if (messageCase_ == 5 && startSessionBuilder_ != null) { + result.message_ = startSessionBuilder_.build(); + } + if (messageCase_ == 6 && continueSessionBuilder_ != null) { + result.message_ = continueSessionBuilder_.build(); + } + if (messageCase_ == 7 && dataBuilder_ != null) { + result.message_ = dataBuilder_.build(); + } + if (messageCase_ == 8 && terminateSessionBuilder_ != null) { + result.message_ = terminateSessionBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.StreamSqlDataRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.StreamSqlDataRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.StreamSqlDataRequest other) { + if (other == com.google.cloud.sql.v1beta4.StreamSqlDataRequest.getDefaultInstance()) + return this; + if (other.hasAck()) { + mergeAck(other.getAck()); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + bitField0_ |= 0x00000020; + onChanged(); + } + switch (other.getMessageCase()) { + case START_SESSION: + { + mergeStartSession(other.getStartSession()); + break; + } + case CONTINUE_SESSION: + { + mergeContinueSession(other.getContinueSession()); + break; + } + case DATA: + { + mergeData(other.getData()); + break; + } + case TERMINATE_SESSION: + { + mergeTerminateSession(other.getTerminateSession()); + break; + } + case MESSAGE_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 34: + { + input.readMessage(internalGetAckFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetStartSessionFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetContinueSessionFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage(internalGetDataFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage( + internalGetTerminateSessionFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 8; + break; + } // case 66 + case 74: + { + instanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int messageCase_ = 0; + private java.lang.Object message_; + + public MessageCase getMessageCase() { + return MessageCase.forNumber(messageCase_); + } + + public Builder clearMessage() { + messageCase_ = 0; + message_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.Ack ack_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Ack, + com.google.cloud.sql.v1beta4.Ack.Builder, + com.google.cloud.sql.v1beta4.AckOrBuilder> + ackBuilder_; + + /** + * + * + *
+     * Optional. Acknowledges data received by the client.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the ack field is set. + */ + public boolean hasAck() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. Acknowledges data received by the client.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ack. + */ + public com.google.cloud.sql.v1beta4.Ack getAck() { + if (ackBuilder_ == null) { + return ack_ == null ? com.google.cloud.sql.v1beta4.Ack.getDefaultInstance() : ack_; + } else { + return ackBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Acknowledges data received by the client.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setAck(com.google.cloud.sql.v1beta4.Ack value) { + if (ackBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ack_ = value; + } else { + ackBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Acknowledges data received by the client.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setAck(com.google.cloud.sql.v1beta4.Ack.Builder builderForValue) { + if (ackBuilder_ == null) { + ack_ = builderForValue.build(); + } else { + ackBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Acknowledges data received by the client.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder mergeAck(com.google.cloud.sql.v1beta4.Ack value) { + if (ackBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && ack_ != null + && ack_ != com.google.cloud.sql.v1beta4.Ack.getDefaultInstance()) { + getAckBuilder().mergeFrom(value); + } else { + ack_ = value; + } + } else { + ackBuilder_.mergeFrom(value); + } + if (ack_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Acknowledges data received by the client.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearAck() { + bitField0_ = (bitField0_ & ~0x00000001); + ack_ = null; + if (ackBuilder_ != null) { + ackBuilder_.dispose(); + ackBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Acknowledges data received by the client.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.cloud.sql.v1beta4.Ack.Builder getAckBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetAckFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Acknowledges data received by the client.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.cloud.sql.v1beta4.AckOrBuilder getAckOrBuilder() { + if (ackBuilder_ != null) { + return ackBuilder_.getMessageOrBuilder(); + } else { + return ack_ == null ? com.google.cloud.sql.v1beta4.Ack.getDefaultInstance() : ack_; + } + } + + /** + * + * + *
+     * Optional. Acknowledges data received by the client.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Ack, + com.google.cloud.sql.v1beta4.Ack.Builder, + com.google.cloud.sql.v1beta4.AckOrBuilder> + internalGetAckFieldBuilder() { + if (ackBuilder_ == null) { + ackBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Ack, + com.google.cloud.sql.v1beta4.Ack.Builder, + com.google.cloud.sql.v1beta4.AckOrBuilder>( + getAck(), getParentForChildren(), isClean()); + ack_ = null; + } + return ackBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.StartSession, + com.google.cloud.sql.v1beta4.StartSession.Builder, + com.google.cloud.sql.v1beta4.StartSessionOrBuilder> + startSessionBuilder_; + + /** + * + * + *
+     * Starts a new session. When starting a new session, this is the first
+     * message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + * + * @return Whether the startSession field is set. + */ + @java.lang.Override + public boolean hasStartSession() { + return messageCase_ == 5; + } + + /** + * + * + *
+     * Starts a new session. When starting a new session, this is the first
+     * message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + * + * @return The startSession. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.StartSession getStartSession() { + if (startSessionBuilder_ == null) { + if (messageCase_ == 5) { + return (com.google.cloud.sql.v1beta4.StartSession) message_; + } + return com.google.cloud.sql.v1beta4.StartSession.getDefaultInstance(); + } else { + if (messageCase_ == 5) { + return startSessionBuilder_.getMessage(); + } + return com.google.cloud.sql.v1beta4.StartSession.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Starts a new session. When starting a new session, this is the first
+     * message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + */ + public Builder setStartSession(com.google.cloud.sql.v1beta4.StartSession value) { + if (startSessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + startSessionBuilder_.setMessage(value); + } + messageCase_ = 5; + return this; + } + + /** + * + * + *
+     * Starts a new session. When starting a new session, this is the first
+     * message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + */ + public Builder setStartSession( + com.google.cloud.sql.v1beta4.StartSession.Builder builderForValue) { + if (startSessionBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + startSessionBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 5; + return this; + } + + /** + * + * + *
+     * Starts a new session. When starting a new session, this is the first
+     * message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + */ + public Builder mergeStartSession(com.google.cloud.sql.v1beta4.StartSession value) { + if (startSessionBuilder_ == null) { + if (messageCase_ == 5 + && message_ != com.google.cloud.sql.v1beta4.StartSession.getDefaultInstance()) { + message_ = + com.google.cloud.sql.v1beta4.StartSession.newBuilder( + (com.google.cloud.sql.v1beta4.StartSession) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 5) { + startSessionBuilder_.mergeFrom(value); + } else { + startSessionBuilder_.setMessage(value); + } + } + messageCase_ = 5; + return this; + } + + /** + * + * + *
+     * Starts a new session. When starting a new session, this is the first
+     * message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + */ + public Builder clearStartSession() { + if (startSessionBuilder_ == null) { + if (messageCase_ == 5) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 5) { + messageCase_ = 0; + message_ = null; + } + startSessionBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Starts a new session. When starting a new session, this is the first
+     * message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + */ + public com.google.cloud.sql.v1beta4.StartSession.Builder getStartSessionBuilder() { + return internalGetStartSessionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Starts a new session. When starting a new session, this is the first
+     * message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.StartSessionOrBuilder getStartSessionOrBuilder() { + if ((messageCase_ == 5) && (startSessionBuilder_ != null)) { + return startSessionBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 5) { + return (com.google.cloud.sql.v1beta4.StartSession) message_; + } + return com.google.cloud.sql.v1beta4.StartSession.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Starts a new session. When starting a new session, this is the first
+     * message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.StartSession, + com.google.cloud.sql.v1beta4.StartSession.Builder, + com.google.cloud.sql.v1beta4.StartSessionOrBuilder> + internalGetStartSessionFieldBuilder() { + if (startSessionBuilder_ == null) { + if (!(messageCase_ == 5)) { + message_ = com.google.cloud.sql.v1beta4.StartSession.getDefaultInstance(); + } + startSessionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.StartSession, + com.google.cloud.sql.v1beta4.StartSession.Builder, + com.google.cloud.sql.v1beta4.StartSessionOrBuilder>( + (com.google.cloud.sql.v1beta4.StartSession) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 5; + onChanged(); + return startSessionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ContinueSession, + com.google.cloud.sql.v1beta4.ContinueSession.Builder, + com.google.cloud.sql.v1beta4.ContinueSessionOrBuilder> + continueSessionBuilder_; + + /** + * + * + *
+     * Continues an existing session. When continuing an existing session, this
+     * is the first message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + * + * @return Whether the continueSession field is set. + */ + @java.lang.Override + public boolean hasContinueSession() { + return messageCase_ == 6; + } + + /** + * + * + *
+     * Continues an existing session. When continuing an existing session, this
+     * is the first message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + * + * @return The continueSession. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ContinueSession getContinueSession() { + if (continueSessionBuilder_ == null) { + if (messageCase_ == 6) { + return (com.google.cloud.sql.v1beta4.ContinueSession) message_; + } + return com.google.cloud.sql.v1beta4.ContinueSession.getDefaultInstance(); + } else { + if (messageCase_ == 6) { + return continueSessionBuilder_.getMessage(); + } + return com.google.cloud.sql.v1beta4.ContinueSession.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Continues an existing session. When continuing an existing session, this
+     * is the first message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + */ + public Builder setContinueSession(com.google.cloud.sql.v1beta4.ContinueSession value) { + if (continueSessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + continueSessionBuilder_.setMessage(value); + } + messageCase_ = 6; + return this; + } + + /** + * + * + *
+     * Continues an existing session. When continuing an existing session, this
+     * is the first message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + */ + public Builder setContinueSession( + com.google.cloud.sql.v1beta4.ContinueSession.Builder builderForValue) { + if (continueSessionBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + continueSessionBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 6; + return this; + } + + /** + * + * + *
+     * Continues an existing session. When continuing an existing session, this
+     * is the first message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + */ + public Builder mergeContinueSession(com.google.cloud.sql.v1beta4.ContinueSession value) { + if (continueSessionBuilder_ == null) { + if (messageCase_ == 6 + && message_ != com.google.cloud.sql.v1beta4.ContinueSession.getDefaultInstance()) { + message_ = + com.google.cloud.sql.v1beta4.ContinueSession.newBuilder( + (com.google.cloud.sql.v1beta4.ContinueSession) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 6) { + continueSessionBuilder_.mergeFrom(value); + } else { + continueSessionBuilder_.setMessage(value); + } + } + messageCase_ = 6; + return this; + } + + /** + * + * + *
+     * Continues an existing session. When continuing an existing session, this
+     * is the first message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + */ + public Builder clearContinueSession() { + if (continueSessionBuilder_ == null) { + if (messageCase_ == 6) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 6) { + messageCase_ = 0; + message_ = null; + } + continueSessionBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Continues an existing session. When continuing an existing session, this
+     * is the first message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + */ + public com.google.cloud.sql.v1beta4.ContinueSession.Builder getContinueSessionBuilder() { + return internalGetContinueSessionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Continues an existing session. When continuing an existing session, this
+     * is the first message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.ContinueSessionOrBuilder getContinueSessionOrBuilder() { + if ((messageCase_ == 6) && (continueSessionBuilder_ != null)) { + return continueSessionBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 6) { + return (com.google.cloud.sql.v1beta4.ContinueSession) message_; + } + return com.google.cloud.sql.v1beta4.ContinueSession.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Continues an existing session. When continuing an existing session, this
+     * is the first message the client sends.
+     * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ContinueSession, + com.google.cloud.sql.v1beta4.ContinueSession.Builder, + com.google.cloud.sql.v1beta4.ContinueSessionOrBuilder> + internalGetContinueSessionFieldBuilder() { + if (continueSessionBuilder_ == null) { + if (!(messageCase_ == 6)) { + message_ = com.google.cloud.sql.v1beta4.ContinueSession.getDefaultInstance(); + } + continueSessionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.ContinueSession, + com.google.cloud.sql.v1beta4.ContinueSession.Builder, + com.google.cloud.sql.v1beta4.ContinueSessionOrBuilder>( + (com.google.cloud.sql.v1beta4.ContinueSession) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 6; + onChanged(); + return continueSessionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DataPacket, + com.google.cloud.sql.v1beta4.DataPacket.Builder, + com.google.cloud.sql.v1beta4.DataPacketOrBuilder> + dataBuilder_; + + /** + * + * + *
+     * Database data.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + * + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return messageCase_ == 7; + } + + /** + * + * + *
+     * Database data.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + * + * @return The data. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataPacket getData() { + if (dataBuilder_ == null) { + if (messageCase_ == 7) { + return (com.google.cloud.sql.v1beta4.DataPacket) message_; + } + return com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance(); + } else { + if (messageCase_ == 7) { + return dataBuilder_.getMessage(); + } + return com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Database data.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + */ + public Builder setData(com.google.cloud.sql.v1beta4.DataPacket value) { + if (dataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + dataBuilder_.setMessage(value); + } + messageCase_ = 7; + return this; + } + + /** + * + * + *
+     * Database data.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + */ + public Builder setData(com.google.cloud.sql.v1beta4.DataPacket.Builder builderForValue) { + if (dataBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + dataBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 7; + return this; + } + + /** + * + * + *
+     * Database data.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + */ + public Builder mergeData(com.google.cloud.sql.v1beta4.DataPacket value) { + if (dataBuilder_ == null) { + if (messageCase_ == 7 + && message_ != com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance()) { + message_ = + com.google.cloud.sql.v1beta4.DataPacket.newBuilder( + (com.google.cloud.sql.v1beta4.DataPacket) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 7) { + dataBuilder_.mergeFrom(value); + } else { + dataBuilder_.setMessage(value); + } + } + messageCase_ = 7; + return this; + } + + /** + * + * + *
+     * Database data.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + */ + public Builder clearData() { + if (dataBuilder_ == null) { + if (messageCase_ == 7) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 7) { + messageCase_ = 0; + message_ = null; + } + dataBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Database data.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + */ + public com.google.cloud.sql.v1beta4.DataPacket.Builder getDataBuilder() { + return internalGetDataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Database data.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataPacketOrBuilder getDataOrBuilder() { + if ((messageCase_ == 7) && (dataBuilder_ != null)) { + return dataBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 7) { + return (com.google.cloud.sql.v1beta4.DataPacket) message_; + } + return com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Database data.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DataPacket, + com.google.cloud.sql.v1beta4.DataPacket.Builder, + com.google.cloud.sql.v1beta4.DataPacketOrBuilder> + internalGetDataFieldBuilder() { + if (dataBuilder_ == null) { + if (!(messageCase_ == 7)) { + message_ = com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance(); + } + dataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DataPacket, + com.google.cloud.sql.v1beta4.DataPacket.Builder, + com.google.cloud.sql.v1beta4.DataPacketOrBuilder>( + (com.google.cloud.sql.v1beta4.DataPacket) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 7; + onChanged(); + return dataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.TerminateSession, + com.google.cloud.sql.v1beta4.TerminateSession.Builder, + com.google.cloud.sql.v1beta4.TerminateSessionOrBuilder> + terminateSessionBuilder_; + + /** + * + * + *
+     * Terminates the session. This closes the connection to the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + * + * @return Whether the terminateSession field is set. + */ + @java.lang.Override + public boolean hasTerminateSession() { + return messageCase_ == 8; + } + + /** + * + * + *
+     * Terminates the session. This closes the connection to the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + * + * @return The terminateSession. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.TerminateSession getTerminateSession() { + if (terminateSessionBuilder_ == null) { + if (messageCase_ == 8) { + return (com.google.cloud.sql.v1beta4.TerminateSession) message_; + } + return com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance(); + } else { + if (messageCase_ == 8) { + return terminateSessionBuilder_.getMessage(); + } + return com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Terminates the session. This closes the connection to the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + */ + public Builder setTerminateSession(com.google.cloud.sql.v1beta4.TerminateSession value) { + if (terminateSessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + terminateSessionBuilder_.setMessage(value); + } + messageCase_ = 8; + return this; + } + + /** + * + * + *
+     * Terminates the session. This closes the connection to the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + */ + public Builder setTerminateSession( + com.google.cloud.sql.v1beta4.TerminateSession.Builder builderForValue) { + if (terminateSessionBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + terminateSessionBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 8; + return this; + } + + /** + * + * + *
+     * Terminates the session. This closes the connection to the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + */ + public Builder mergeTerminateSession(com.google.cloud.sql.v1beta4.TerminateSession value) { + if (terminateSessionBuilder_ == null) { + if (messageCase_ == 8 + && message_ != com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance()) { + message_ = + com.google.cloud.sql.v1beta4.TerminateSession.newBuilder( + (com.google.cloud.sql.v1beta4.TerminateSession) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 8) { + terminateSessionBuilder_.mergeFrom(value); + } else { + terminateSessionBuilder_.setMessage(value); + } + } + messageCase_ = 8; + return this; + } + + /** + * + * + *
+     * Terminates the session. This closes the connection to the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + */ + public Builder clearTerminateSession() { + if (terminateSessionBuilder_ == null) { + if (messageCase_ == 8) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 8) { + messageCase_ = 0; + message_ = null; + } + terminateSessionBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Terminates the session. This closes the connection to the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + */ + public com.google.cloud.sql.v1beta4.TerminateSession.Builder getTerminateSessionBuilder() { + return internalGetTerminateSessionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Terminates the session. This closes the connection to the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.TerminateSessionOrBuilder getTerminateSessionOrBuilder() { + if ((messageCase_ == 8) && (terminateSessionBuilder_ != null)) { + return terminateSessionBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 8) { + return (com.google.cloud.sql.v1beta4.TerminateSession) message_; + } + return com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Terminates the session. This closes the connection to the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.TerminateSession, + com.google.cloud.sql.v1beta4.TerminateSession.Builder, + com.google.cloud.sql.v1beta4.TerminateSessionOrBuilder> + internalGetTerminateSessionFieldBuilder() { + if (terminateSessionBuilder_ == null) { + if (!(messageCase_ == 8)) { + message_ = com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance(); + } + terminateSessionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.TerminateSession, + com.google.cloud.sql.v1beta4.TerminateSession.Builder, + com.google.cloud.sql.v1beta4.TerminateSessionOrBuilder>( + (com.google.cloud.sql.v1beta4.TerminateSession) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 8; + onChanged(); + return terminateSessionBuilder_; + } + + private java.lang.Object instanceId_ = ""; + + /** + * + * + *
+     * Optional. Deprecated: Use `StartSession.instance_id` or
+     * `ContinueSession.instance_id` instead.
+     * The Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
+     * Optional. Deprecated: Use `StartSession.instance_id` or
+     * `ContinueSession.instance_id` instead.
+     * The Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
+     * Optional. Deprecated: Use `StartSession.instance_id` or
+     * `ContinueSession.instance_id` instead.
+     * The Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @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_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Deprecated: Use `StartSession.instance_id` or
+     * `ContinueSession.instance_id` instead.
+     * The Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Deprecated: Use `StartSession.instance_id` or
+     * `ContinueSession.instance_id` instead.
+     * The Cloud SQL instance resource name, for example:
+     * projects/example-project/instances/example-instance
+     * 
+ * + * + * string instance_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @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_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.StreamSqlDataRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.StreamSqlDataRequest) + private static final com.google.cloud.sql.v1beta4.StreamSqlDataRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.StreamSqlDataRequest(); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamSqlDataRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.StreamSqlDataRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StreamSqlDataRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StreamSqlDataRequestOrBuilder.java new file mode 100644 index 000000000000..9f8f76cba59f --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StreamSqlDataRequestOrBuilder.java @@ -0,0 +1,257 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface StreamSqlDataRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.StreamSqlDataRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Acknowledges data received by the client.
+   * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the ack field is set. + */ + boolean hasAck(); + + /** + * + * + *
+   * Optional. Acknowledges data received by the client.
+   * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ack. + */ + com.google.cloud.sql.v1beta4.Ack getAck(); + + /** + * + * + *
+   * Optional. Acknowledges data received by the client.
+   * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.cloud.sql.v1beta4.AckOrBuilder getAckOrBuilder(); + + /** + * + * + *
+   * Starts a new session. When starting a new session, this is the first
+   * message the client sends.
+   * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + * + * @return Whether the startSession field is set. + */ + boolean hasStartSession(); + + /** + * + * + *
+   * Starts a new session. When starting a new session, this is the first
+   * message the client sends.
+   * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + * + * @return The startSession. + */ + com.google.cloud.sql.v1beta4.StartSession getStartSession(); + + /** + * + * + *
+   * Starts a new session. When starting a new session, this is the first
+   * message the client sends.
+   * 
+ * + * .google.cloud.sql.v1beta4.StartSession start_session = 5; + */ + com.google.cloud.sql.v1beta4.StartSessionOrBuilder getStartSessionOrBuilder(); + + /** + * + * + *
+   * Continues an existing session. When continuing an existing session, this
+   * is the first message the client sends.
+   * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + * + * @return Whether the continueSession field is set. + */ + boolean hasContinueSession(); + + /** + * + * + *
+   * Continues an existing session. When continuing an existing session, this
+   * is the first message the client sends.
+   * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + * + * @return The continueSession. + */ + com.google.cloud.sql.v1beta4.ContinueSession getContinueSession(); + + /** + * + * + *
+   * Continues an existing session. When continuing an existing session, this
+   * is the first message the client sends.
+   * 
+ * + * .google.cloud.sql.v1beta4.ContinueSession continue_session = 6; + */ + com.google.cloud.sql.v1beta4.ContinueSessionOrBuilder getContinueSessionOrBuilder(); + + /** + * + * + *
+   * Database data.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + * + * @return Whether the data field is set. + */ + boolean hasData(); + + /** + * + * + *
+   * Database data.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + * + * @return The data. + */ + com.google.cloud.sql.v1beta4.DataPacket getData(); + + /** + * + * + *
+   * Database data.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 7; + */ + com.google.cloud.sql.v1beta4.DataPacketOrBuilder getDataOrBuilder(); + + /** + * + * + *
+   * Terminates the session. This closes the connection to the database.
+   * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + * + * @return Whether the terminateSession field is set. + */ + boolean hasTerminateSession(); + + /** + * + * + *
+   * Terminates the session. This closes the connection to the database.
+   * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + * + * @return The terminateSession. + */ + com.google.cloud.sql.v1beta4.TerminateSession getTerminateSession(); + + /** + * + * + *
+   * Terminates the session. This closes the connection to the database.
+   * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 8; + */ + com.google.cloud.sql.v1beta4.TerminateSessionOrBuilder getTerminateSessionOrBuilder(); + + /** + * + * + *
+   * Optional. Deprecated: Use `StartSession.instance_id` or
+   * `ContinueSession.instance_id` instead.
+   * The Cloud SQL instance resource name, for example:
+   * projects/example-project/instances/example-instance
+   * 
+ * + * + * string instance_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + + /** + * + * + *
+   * Optional. Deprecated: Use `StartSession.instance_id` or
+   * `ContinueSession.instance_id` instead.
+   * The Cloud SQL instance resource name, for example:
+   * projects/example-project/instances/example-instance
+   * 
+ * + * + * string instance_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + com.google.cloud.sql.v1beta4.StreamSqlDataRequest.MessageCase getMessageCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StreamSqlDataResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StreamSqlDataResponse.java new file mode 100644 index 000000000000..3efc8c831ab6 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StreamSqlDataResponse.java @@ -0,0 +1,1728 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Message sent from SqlDataService back to the client.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.StreamSqlDataResponse} + */ +@com.google.protobuf.Generated +public final class StreamSqlDataResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.StreamSqlDataResponse) + StreamSqlDataResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StreamSqlDataResponse"); + } + + // Use StreamSqlDataResponse.newBuilder() to construct. + private StreamSqlDataResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private StreamSqlDataResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StreamSqlDataResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StreamSqlDataResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.StreamSqlDataResponse.class, + com.google.cloud.sql.v1beta4.StreamSqlDataResponse.Builder.class); + } + + private int bitField0_; + private int messageCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object message_; + + public enum MessageCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SESSION_METADATA(3), + DATA(4), + TERMINATE_SESSION(5), + MESSAGE_NOT_SET(0); + private final int value; + + private MessageCase(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 MessageCase valueOf(int value) { + return forNumber(value); + } + + public static MessageCase forNumber(int value) { + switch (value) { + case 3: + return SESSION_METADATA; + case 4: + return DATA; + case 5: + return TERMINATE_SESSION; + case 0: + return MESSAGE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MessageCase getMessageCase() { + return MessageCase.forNumber(messageCase_); + } + + public static final int ACK_FIELD_NUMBER = 2; + private com.google.cloud.sql.v1beta4.Ack ack_; + + /** + * + * + *
+   * Acknowledges data received by the server.
+   * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + * + * @return Whether the ack field is set. + */ + @java.lang.Override + public boolean hasAck() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Acknowledges data received by the server.
+   * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + * + * @return The ack. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Ack getAck() { + return ack_ == null ? com.google.cloud.sql.v1beta4.Ack.getDefaultInstance() : ack_; + } + + /** + * + * + *
+   * Acknowledges data received by the server.
+   * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.AckOrBuilder getAckOrBuilder() { + return ack_ == null ? com.google.cloud.sql.v1beta4.Ack.getDefaultInstance() : ack_; + } + + public static final int SESSION_METADATA_FIELD_NUMBER = 3; + + /** + * + * + *
+   * The first message from the server to the client, containing metadata
+   * about this session.
+   * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + * + * @return Whether the sessionMetadata field is set. + */ + @java.lang.Override + public boolean hasSessionMetadata() { + return messageCase_ == 3; + } + + /** + * + * + *
+   * The first message from the server to the client, containing metadata
+   * about this session.
+   * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + * + * @return The sessionMetadata. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SessionMetadata getSessionMetadata() { + if (messageCase_ == 3) { + return (com.google.cloud.sql.v1beta4.SessionMetadata) message_; + } + return com.google.cloud.sql.v1beta4.SessionMetadata.getDefaultInstance(); + } + + /** + * + * + *
+   * The first message from the server to the client, containing metadata
+   * about this session.
+   * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SessionMetadataOrBuilder getSessionMetadataOrBuilder() { + if (messageCase_ == 3) { + return (com.google.cloud.sql.v1beta4.SessionMetadata) message_; + } + return com.google.cloud.sql.v1beta4.SessionMetadata.getDefaultInstance(); + } + + public static final int DATA_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Data from the database.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + * + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return messageCase_ == 4; + } + + /** + * + * + *
+   * Data from the database.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + * + * @return The data. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataPacket getData() { + if (messageCase_ == 4) { + return (com.google.cloud.sql.v1beta4.DataPacket) message_; + } + return com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance(); + } + + /** + * + * + *
+   * Data from the database.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataPacketOrBuilder getDataOrBuilder() { + if (messageCase_ == 4) { + return (com.google.cloud.sql.v1beta4.DataPacket) message_; + } + return com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance(); + } + + public static final int TERMINATE_SESSION_FIELD_NUMBER = 5; + + /** + * + * + *
+   * Terminates the session. This indicates that the database connection
+   * is closed. When the client receives this message, it should not
+   * attempt to reconnect.
+   * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + * + * @return Whether the terminateSession field is set. + */ + @java.lang.Override + public boolean hasTerminateSession() { + return messageCase_ == 5; + } + + /** + * + * + *
+   * Terminates the session. This indicates that the database connection
+   * is closed. When the client receives this message, it should not
+   * attempt to reconnect.
+   * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + * + * @return The terminateSession. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.TerminateSession getTerminateSession() { + if (messageCase_ == 5) { + return (com.google.cloud.sql.v1beta4.TerminateSession) message_; + } + return com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance(); + } + + /** + * + * + *
+   * Terminates the session. This indicates that the database connection
+   * is closed. When the client receives this message, it should not
+   * attempt to reconnect.
+   * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.TerminateSessionOrBuilder getTerminateSessionOrBuilder() { + if (messageCase_ == 5) { + return (com.google.cloud.sql.v1beta4.TerminateSession) message_; + } + return com.google.cloud.sql.v1beta4.TerminateSession.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAck()); + } + if (messageCase_ == 3) { + output.writeMessage(3, (com.google.cloud.sql.v1beta4.SessionMetadata) message_); + } + if (messageCase_ == 4) { + output.writeMessage(4, (com.google.cloud.sql.v1beta4.DataPacket) message_); + } + if (messageCase_ == 5) { + output.writeMessage(5, (com.google.cloud.sql.v1beta4.TerminateSession) message_); + } + 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(2, getAck()); + } + if (messageCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.sql.v1beta4.SessionMetadata) message_); + } + if (messageCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.sql.v1beta4.DataPacket) message_); + } + if (messageCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.cloud.sql.v1beta4.TerminateSession) message_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.StreamSqlDataResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.StreamSqlDataResponse other = + (com.google.cloud.sql.v1beta4.StreamSqlDataResponse) obj; + + if (hasAck() != other.hasAck()) return false; + if (hasAck()) { + if (!getAck().equals(other.getAck())) return false; + } + if (!getMessageCase().equals(other.getMessageCase())) return false; + switch (messageCase_) { + case 3: + if (!getSessionMetadata().equals(other.getSessionMetadata())) return false; + break; + case 4: + if (!getData().equals(other.getData())) return false; + break; + case 5: + if (!getTerminateSession().equals(other.getTerminateSession())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAck()) { + hash = (37 * hash) + ACK_FIELD_NUMBER; + hash = (53 * hash) + getAck().hashCode(); + } + switch (messageCase_) { + case 3: + hash = (37 * hash) + SESSION_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getSessionMetadata().hashCode(); + break; + case 4: + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + break; + case 5: + hash = (37 * hash) + TERMINATE_SESSION_FIELD_NUMBER; + hash = (53 * hash) + getTerminateSession().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.StreamSqlDataResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Message sent from SqlDataService back to the client.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.StreamSqlDataResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.StreamSqlDataResponse) + com.google.cloud.sql.v1beta4.StreamSqlDataResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StreamSqlDataResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StreamSqlDataResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.StreamSqlDataResponse.class, + com.google.cloud.sql.v1beta4.StreamSqlDataResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.StreamSqlDataResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAckFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + ack_ = null; + if (ackBuilder_ != null) { + ackBuilder_.dispose(); + ackBuilder_ = null; + } + if (sessionMetadataBuilder_ != null) { + sessionMetadataBuilder_.clear(); + } + if (dataBuilder_ != null) { + dataBuilder_.clear(); + } + if (terminateSessionBuilder_ != null) { + terminateSessionBuilder_.clear(); + } + messageCase_ = 0; + message_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_StreamSqlDataResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.StreamSqlDataResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.StreamSqlDataResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.StreamSqlDataResponse build() { + com.google.cloud.sql.v1beta4.StreamSqlDataResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.StreamSqlDataResponse buildPartial() { + com.google.cloud.sql.v1beta4.StreamSqlDataResponse result = + new com.google.cloud.sql.v1beta4.StreamSqlDataResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.StreamSqlDataResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ack_ = ackBuilder_ == null ? ack_ : ackBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.sql.v1beta4.StreamSqlDataResponse result) { + result.messageCase_ = messageCase_; + result.message_ = this.message_; + if (messageCase_ == 3 && sessionMetadataBuilder_ != null) { + result.message_ = sessionMetadataBuilder_.build(); + } + if (messageCase_ == 4 && dataBuilder_ != null) { + result.message_ = dataBuilder_.build(); + } + if (messageCase_ == 5 && terminateSessionBuilder_ != null) { + result.message_ = terminateSessionBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.StreamSqlDataResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.StreamSqlDataResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.StreamSqlDataResponse other) { + if (other == com.google.cloud.sql.v1beta4.StreamSqlDataResponse.getDefaultInstance()) + return this; + if (other.hasAck()) { + mergeAck(other.getAck()); + } + switch (other.getMessageCase()) { + case SESSION_METADATA: + { + mergeSessionMetadata(other.getSessionMetadata()); + break; + } + case DATA: + { + mergeData(other.getData()); + break; + } + case TERMINATE_SESSION: + { + mergeTerminateSession(other.getTerminateSession()); + break; + } + case MESSAGE_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 18: + { + input.readMessage(internalGetAckFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetSessionMetadataFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(internalGetDataFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetTerminateSessionFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 5; + 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 messageCase_ = 0; + private java.lang.Object message_; + + public MessageCase getMessageCase() { + return MessageCase.forNumber(messageCase_); + } + + public Builder clearMessage() { + messageCase_ = 0; + message_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.Ack ack_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Ack, + com.google.cloud.sql.v1beta4.Ack.Builder, + com.google.cloud.sql.v1beta4.AckOrBuilder> + ackBuilder_; + + /** + * + * + *
+     * Acknowledges data received by the server.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + * + * @return Whether the ack field is set. + */ + public boolean hasAck() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Acknowledges data received by the server.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + * + * @return The ack. + */ + public com.google.cloud.sql.v1beta4.Ack getAck() { + if (ackBuilder_ == null) { + return ack_ == null ? com.google.cloud.sql.v1beta4.Ack.getDefaultInstance() : ack_; + } else { + return ackBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Acknowledges data received by the server.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + */ + public Builder setAck(com.google.cloud.sql.v1beta4.Ack value) { + if (ackBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ack_ = value; + } else { + ackBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Acknowledges data received by the server.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + */ + public Builder setAck(com.google.cloud.sql.v1beta4.Ack.Builder builderForValue) { + if (ackBuilder_ == null) { + ack_ = builderForValue.build(); + } else { + ackBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Acknowledges data received by the server.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + */ + public Builder mergeAck(com.google.cloud.sql.v1beta4.Ack value) { + if (ackBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && ack_ != null + && ack_ != com.google.cloud.sql.v1beta4.Ack.getDefaultInstance()) { + getAckBuilder().mergeFrom(value); + } else { + ack_ = value; + } + } else { + ackBuilder_.mergeFrom(value); + } + if (ack_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Acknowledges data received by the server.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + */ + public Builder clearAck() { + bitField0_ = (bitField0_ & ~0x00000001); + ack_ = null; + if (ackBuilder_ != null) { + ackBuilder_.dispose(); + ackBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Acknowledges data received by the server.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + */ + public com.google.cloud.sql.v1beta4.Ack.Builder getAckBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetAckFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Acknowledges data received by the server.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + */ + public com.google.cloud.sql.v1beta4.AckOrBuilder getAckOrBuilder() { + if (ackBuilder_ != null) { + return ackBuilder_.getMessageOrBuilder(); + } else { + return ack_ == null ? com.google.cloud.sql.v1beta4.Ack.getDefaultInstance() : ack_; + } + } + + /** + * + * + *
+     * Acknowledges data received by the server.
+     * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Ack, + com.google.cloud.sql.v1beta4.Ack.Builder, + com.google.cloud.sql.v1beta4.AckOrBuilder> + internalGetAckFieldBuilder() { + if (ackBuilder_ == null) { + ackBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Ack, + com.google.cloud.sql.v1beta4.Ack.Builder, + com.google.cloud.sql.v1beta4.AckOrBuilder>( + getAck(), getParentForChildren(), isClean()); + ack_ = null; + } + return ackBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SessionMetadata, + com.google.cloud.sql.v1beta4.SessionMetadata.Builder, + com.google.cloud.sql.v1beta4.SessionMetadataOrBuilder> + sessionMetadataBuilder_; + + /** + * + * + *
+     * The first message from the server to the client, containing metadata
+     * about this session.
+     * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + * + * @return Whether the sessionMetadata field is set. + */ + @java.lang.Override + public boolean hasSessionMetadata() { + return messageCase_ == 3; + } + + /** + * + * + *
+     * The first message from the server to the client, containing metadata
+     * about this session.
+     * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + * + * @return The sessionMetadata. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SessionMetadata getSessionMetadata() { + if (sessionMetadataBuilder_ == null) { + if (messageCase_ == 3) { + return (com.google.cloud.sql.v1beta4.SessionMetadata) message_; + } + return com.google.cloud.sql.v1beta4.SessionMetadata.getDefaultInstance(); + } else { + if (messageCase_ == 3) { + return sessionMetadataBuilder_.getMessage(); + } + return com.google.cloud.sql.v1beta4.SessionMetadata.getDefaultInstance(); + } + } + + /** + * + * + *
+     * The first message from the server to the client, containing metadata
+     * about this session.
+     * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + */ + public Builder setSessionMetadata(com.google.cloud.sql.v1beta4.SessionMetadata value) { + if (sessionMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + sessionMetadataBuilder_.setMessage(value); + } + messageCase_ = 3; + return this; + } + + /** + * + * + *
+     * The first message from the server to the client, containing metadata
+     * about this session.
+     * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + */ + public Builder setSessionMetadata( + com.google.cloud.sql.v1beta4.SessionMetadata.Builder builderForValue) { + if (sessionMetadataBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + sessionMetadataBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 3; + return this; + } + + /** + * + * + *
+     * The first message from the server to the client, containing metadata
+     * about this session.
+     * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + */ + public Builder mergeSessionMetadata(com.google.cloud.sql.v1beta4.SessionMetadata value) { + if (sessionMetadataBuilder_ == null) { + if (messageCase_ == 3 + && message_ != com.google.cloud.sql.v1beta4.SessionMetadata.getDefaultInstance()) { + message_ = + com.google.cloud.sql.v1beta4.SessionMetadata.newBuilder( + (com.google.cloud.sql.v1beta4.SessionMetadata) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 3) { + sessionMetadataBuilder_.mergeFrom(value); + } else { + sessionMetadataBuilder_.setMessage(value); + } + } + messageCase_ = 3; + return this; + } + + /** + * + * + *
+     * The first message from the server to the client, containing metadata
+     * about this session.
+     * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + */ + public Builder clearSessionMetadata() { + if (sessionMetadataBuilder_ == null) { + if (messageCase_ == 3) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 3) { + messageCase_ = 0; + message_ = null; + } + sessionMetadataBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The first message from the server to the client, containing metadata
+     * about this session.
+     * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + */ + public com.google.cloud.sql.v1beta4.SessionMetadata.Builder getSessionMetadataBuilder() { + return internalGetSessionMetadataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The first message from the server to the client, containing metadata
+     * about this session.
+     * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SessionMetadataOrBuilder getSessionMetadataOrBuilder() { + if ((messageCase_ == 3) && (sessionMetadataBuilder_ != null)) { + return sessionMetadataBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 3) { + return (com.google.cloud.sql.v1beta4.SessionMetadata) message_; + } + return com.google.cloud.sql.v1beta4.SessionMetadata.getDefaultInstance(); + } + } + + /** + * + * + *
+     * The first message from the server to the client, containing metadata
+     * about this session.
+     * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SessionMetadata, + com.google.cloud.sql.v1beta4.SessionMetadata.Builder, + com.google.cloud.sql.v1beta4.SessionMetadataOrBuilder> + internalGetSessionMetadataFieldBuilder() { + if (sessionMetadataBuilder_ == null) { + if (!(messageCase_ == 3)) { + message_ = com.google.cloud.sql.v1beta4.SessionMetadata.getDefaultInstance(); + } + sessionMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SessionMetadata, + com.google.cloud.sql.v1beta4.SessionMetadata.Builder, + com.google.cloud.sql.v1beta4.SessionMetadataOrBuilder>( + (com.google.cloud.sql.v1beta4.SessionMetadata) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 3; + onChanged(); + return sessionMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DataPacket, + com.google.cloud.sql.v1beta4.DataPacket.Builder, + com.google.cloud.sql.v1beta4.DataPacketOrBuilder> + dataBuilder_; + + /** + * + * + *
+     * Data from the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + * + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return messageCase_ == 4; + } + + /** + * + * + *
+     * Data from the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + * + * @return The data. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataPacket getData() { + if (dataBuilder_ == null) { + if (messageCase_ == 4) { + return (com.google.cloud.sql.v1beta4.DataPacket) message_; + } + return com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance(); + } else { + if (messageCase_ == 4) { + return dataBuilder_.getMessage(); + } + return com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Data from the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + */ + public Builder setData(com.google.cloud.sql.v1beta4.DataPacket value) { + if (dataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + dataBuilder_.setMessage(value); + } + messageCase_ = 4; + return this; + } + + /** + * + * + *
+     * Data from the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + */ + public Builder setData(com.google.cloud.sql.v1beta4.DataPacket.Builder builderForValue) { + if (dataBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + dataBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 4; + return this; + } + + /** + * + * + *
+     * Data from the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + */ + public Builder mergeData(com.google.cloud.sql.v1beta4.DataPacket value) { + if (dataBuilder_ == null) { + if (messageCase_ == 4 + && message_ != com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance()) { + message_ = + com.google.cloud.sql.v1beta4.DataPacket.newBuilder( + (com.google.cloud.sql.v1beta4.DataPacket) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 4) { + dataBuilder_.mergeFrom(value); + } else { + dataBuilder_.setMessage(value); + } + } + messageCase_ = 4; + return this; + } + + /** + * + * + *
+     * Data from the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + */ + public Builder clearData() { + if (dataBuilder_ == null) { + if (messageCase_ == 4) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 4) { + messageCase_ = 0; + message_ = null; + } + dataBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Data from the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + */ + public com.google.cloud.sql.v1beta4.DataPacket.Builder getDataBuilder() { + return internalGetDataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Data from the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.DataPacketOrBuilder getDataOrBuilder() { + if ((messageCase_ == 4) && (dataBuilder_ != null)) { + return dataBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 4) { + return (com.google.cloud.sql.v1beta4.DataPacket) message_; + } + return com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Data from the database.
+     * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DataPacket, + com.google.cloud.sql.v1beta4.DataPacket.Builder, + com.google.cloud.sql.v1beta4.DataPacketOrBuilder> + internalGetDataFieldBuilder() { + if (dataBuilder_ == null) { + if (!(messageCase_ == 4)) { + message_ = com.google.cloud.sql.v1beta4.DataPacket.getDefaultInstance(); + } + dataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.DataPacket, + com.google.cloud.sql.v1beta4.DataPacket.Builder, + com.google.cloud.sql.v1beta4.DataPacketOrBuilder>( + (com.google.cloud.sql.v1beta4.DataPacket) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 4; + onChanged(); + return dataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.TerminateSession, + com.google.cloud.sql.v1beta4.TerminateSession.Builder, + com.google.cloud.sql.v1beta4.TerminateSessionOrBuilder> + terminateSessionBuilder_; + + /** + * + * + *
+     * Terminates the session. This indicates that the database connection
+     * is closed. When the client receives this message, it should not
+     * attempt to reconnect.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + * + * @return Whether the terminateSession field is set. + */ + @java.lang.Override + public boolean hasTerminateSession() { + return messageCase_ == 5; + } + + /** + * + * + *
+     * Terminates the session. This indicates that the database connection
+     * is closed. When the client receives this message, it should not
+     * attempt to reconnect.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + * + * @return The terminateSession. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.TerminateSession getTerminateSession() { + if (terminateSessionBuilder_ == null) { + if (messageCase_ == 5) { + return (com.google.cloud.sql.v1beta4.TerminateSession) message_; + } + return com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance(); + } else { + if (messageCase_ == 5) { + return terminateSessionBuilder_.getMessage(); + } + return com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Terminates the session. This indicates that the database connection
+     * is closed. When the client receives this message, it should not
+     * attempt to reconnect.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + */ + public Builder setTerminateSession(com.google.cloud.sql.v1beta4.TerminateSession value) { + if (terminateSessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + terminateSessionBuilder_.setMessage(value); + } + messageCase_ = 5; + return this; + } + + /** + * + * + *
+     * Terminates the session. This indicates that the database connection
+     * is closed. When the client receives this message, it should not
+     * attempt to reconnect.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + */ + public Builder setTerminateSession( + com.google.cloud.sql.v1beta4.TerminateSession.Builder builderForValue) { + if (terminateSessionBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + terminateSessionBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 5; + return this; + } + + /** + * + * + *
+     * Terminates the session. This indicates that the database connection
+     * is closed. When the client receives this message, it should not
+     * attempt to reconnect.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + */ + public Builder mergeTerminateSession(com.google.cloud.sql.v1beta4.TerminateSession value) { + if (terminateSessionBuilder_ == null) { + if (messageCase_ == 5 + && message_ != com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance()) { + message_ = + com.google.cloud.sql.v1beta4.TerminateSession.newBuilder( + (com.google.cloud.sql.v1beta4.TerminateSession) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 5) { + terminateSessionBuilder_.mergeFrom(value); + } else { + terminateSessionBuilder_.setMessage(value); + } + } + messageCase_ = 5; + return this; + } + + /** + * + * + *
+     * Terminates the session. This indicates that the database connection
+     * is closed. When the client receives this message, it should not
+     * attempt to reconnect.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + */ + public Builder clearTerminateSession() { + if (terminateSessionBuilder_ == null) { + if (messageCase_ == 5) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 5) { + messageCase_ = 0; + message_ = null; + } + terminateSessionBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Terminates the session. This indicates that the database connection
+     * is closed. When the client receives this message, it should not
+     * attempt to reconnect.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + */ + public com.google.cloud.sql.v1beta4.TerminateSession.Builder getTerminateSessionBuilder() { + return internalGetTerminateSessionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Terminates the session. This indicates that the database connection
+     * is closed. When the client receives this message, it should not
+     * attempt to reconnect.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.TerminateSessionOrBuilder getTerminateSessionOrBuilder() { + if ((messageCase_ == 5) && (terminateSessionBuilder_ != null)) { + return terminateSessionBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 5) { + return (com.google.cloud.sql.v1beta4.TerminateSession) message_; + } + return com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Terminates the session. This indicates that the database connection
+     * is closed. When the client receives this message, it should not
+     * attempt to reconnect.
+     * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.TerminateSession, + com.google.cloud.sql.v1beta4.TerminateSession.Builder, + com.google.cloud.sql.v1beta4.TerminateSessionOrBuilder> + internalGetTerminateSessionFieldBuilder() { + if (terminateSessionBuilder_ == null) { + if (!(messageCase_ == 5)) { + message_ = com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance(); + } + terminateSessionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.TerminateSession, + com.google.cloud.sql.v1beta4.TerminateSession.Builder, + com.google.cloud.sql.v1beta4.TerminateSessionOrBuilder>( + (com.google.cloud.sql.v1beta4.TerminateSession) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 5; + onChanged(); + return terminateSessionBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.StreamSqlDataResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.StreamSqlDataResponse) + private static final com.google.cloud.sql.v1beta4.StreamSqlDataResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.StreamSqlDataResponse(); + } + + public static com.google.cloud.sql.v1beta4.StreamSqlDataResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamSqlDataResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.StreamSqlDataResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StreamSqlDataResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StreamSqlDataResponseOrBuilder.java new file mode 100644 index 000000000000..28a13f0bd036 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/StreamSqlDataResponseOrBuilder.java @@ -0,0 +1,187 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface StreamSqlDataResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.StreamSqlDataResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Acknowledges data received by the server.
+   * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + * + * @return Whether the ack field is set. + */ + boolean hasAck(); + + /** + * + * + *
+   * Acknowledges data received by the server.
+   * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + * + * @return The ack. + */ + com.google.cloud.sql.v1beta4.Ack getAck(); + + /** + * + * + *
+   * Acknowledges data received by the server.
+   * 
+ * + * .google.cloud.sql.v1beta4.Ack ack = 2; + */ + com.google.cloud.sql.v1beta4.AckOrBuilder getAckOrBuilder(); + + /** + * + * + *
+   * The first message from the server to the client, containing metadata
+   * about this session.
+   * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + * + * @return Whether the sessionMetadata field is set. + */ + boolean hasSessionMetadata(); + + /** + * + * + *
+   * The first message from the server to the client, containing metadata
+   * about this session.
+   * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + * + * @return The sessionMetadata. + */ + com.google.cloud.sql.v1beta4.SessionMetadata getSessionMetadata(); + + /** + * + * + *
+   * The first message from the server to the client, containing metadata
+   * about this session.
+   * 
+ * + * .google.cloud.sql.v1beta4.SessionMetadata session_metadata = 3; + */ + com.google.cloud.sql.v1beta4.SessionMetadataOrBuilder getSessionMetadataOrBuilder(); + + /** + * + * + *
+   * Data from the database.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + * + * @return Whether the data field is set. + */ + boolean hasData(); + + /** + * + * + *
+   * Data from the database.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + * + * @return The data. + */ + com.google.cloud.sql.v1beta4.DataPacket getData(); + + /** + * + * + *
+   * Data from the database.
+   * 
+ * + * .google.cloud.sql.v1beta4.DataPacket data = 4; + */ + com.google.cloud.sql.v1beta4.DataPacketOrBuilder getDataOrBuilder(); + + /** + * + * + *
+   * Terminates the session. This indicates that the database connection
+   * is closed. When the client receives this message, it should not
+   * attempt to reconnect.
+   * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + * + * @return Whether the terminateSession field is set. + */ + boolean hasTerminateSession(); + + /** + * + * + *
+   * Terminates the session. This indicates that the database connection
+   * is closed. When the client receives this message, it should not
+   * attempt to reconnect.
+   * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + * + * @return The terminateSession. + */ + com.google.cloud.sql.v1beta4.TerminateSession getTerminateSession(); + + /** + * + * + *
+   * Terminates the session. This indicates that the database connection
+   * is closed. When the client receives this message, it should not
+   * attempt to reconnect.
+   * 
+ * + * .google.cloud.sql.v1beta4.TerminateSession terminate_session = 5; + */ + com.google.cloud.sql.v1beta4.TerminateSessionOrBuilder getTerminateSessionOrBuilder(); + + com.google.cloud.sql.v1beta4.StreamSqlDataResponse.MessageCase getMessageCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SyncFlags.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SyncFlags.java new file mode 100644 index 000000000000..b16b1d7bc87e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SyncFlags.java @@ -0,0 +1,792 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Initial sync flags for certain Cloud SQL APIs.
+ * Currently used for the MySQL external server initial dump.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SyncFlags} + */ +@com.google.protobuf.Generated +public final class SyncFlags extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.SyncFlags) + SyncFlagsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SyncFlags"); + } + + // Use SyncFlags.newBuilder() to construct. + private SyncFlags(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SyncFlags() { + name_ = ""; + value_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SyncFlags_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SyncFlags_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SyncFlags.class, + com.google.cloud.sql.v1beta4.SyncFlags.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the flag.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the flag.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + + /** + * + * + *
+   * The value of the flag. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + + /** + * + * + *
+   * The value of the flag. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.SyncFlags)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.SyncFlags other = (com.google.cloud.sql.v1beta4.SyncFlags) obj; + + if (!getName().equals(other.getName())) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.SyncFlags parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SyncFlags parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SyncFlags parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SyncFlags parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SyncFlags parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.SyncFlags parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SyncFlags parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SyncFlags parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SyncFlags parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SyncFlags parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.SyncFlags parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.SyncFlags parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.SyncFlags prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Initial sync flags for certain Cloud SQL APIs.
+   * Currently used for the MySQL external server initial dump.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.SyncFlags} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.SyncFlags) + com.google.cloud.sql.v1beta4.SyncFlagsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SyncFlags_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SyncFlags_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.SyncFlags.class, + com.google.cloud.sql.v1beta4.SyncFlags.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.SyncFlags.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + value_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_SyncFlags_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SyncFlags getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.SyncFlags.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SyncFlags build() { + com.google.cloud.sql.v1beta4.SyncFlags result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SyncFlags buildPartial() { + com.google.cloud.sql.v1beta4.SyncFlags result = + new com.google.cloud.sql.v1beta4.SyncFlags(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.SyncFlags result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.SyncFlags) { + return mergeFrom((com.google.cloud.sql.v1beta4.SyncFlags) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.SyncFlags other) { + if (other == com.google.cloud.sql.v1beta4.SyncFlags.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + 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: + { + value_ = 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_ = ""; + + /** + * + * + *
+     * The name of the flag.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the flag.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the flag.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the flag.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the flag.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + + /** + * + * + *
+     * The value of the flag. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The value of the flag. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The value of the flag. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of the flag. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of the flag. This field must be omitted if the flag
+     * doesn't take a value.
+     * 
+ * + * string value = 2; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.SyncFlags) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.SyncFlags) + private static final com.google.cloud.sql.v1beta4.SyncFlags DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.SyncFlags(); + } + + public static com.google.cloud.sql.v1beta4.SyncFlags getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SyncFlags parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.SyncFlags getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SyncFlagsOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SyncFlagsOrBuilder.java new file mode 100644 index 000000000000..1c0d2c60e13c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/SyncFlagsOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface SyncFlagsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.SyncFlags) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the flag.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the flag.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The value of the flag. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The value. + */ + java.lang.String getValue(); + + /** + * + * + *
+   * The value of the flag. This field must be omitted if the flag
+   * doesn't take a value.
+   * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TerminateSession.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TerminateSession.java new file mode 100644 index 000000000000..bdd1c4c44282 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TerminateSession.java @@ -0,0 +1,683 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Indicates that the session is permanently ended.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.TerminateSession} + */ +@com.google.protobuf.Generated +public final class TerminateSession extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.TerminateSession) + TerminateSessionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TerminateSession"); + } + + // Use TerminateSession.newBuilder() to construct. + private TerminateSession(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TerminateSession() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_TerminateSession_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_TerminateSession_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.TerminateSession.class, + com.google.cloud.sql.v1beta4.TerminateSession.Builder.class); + } + + private int bitField0_; + public static final int STATUS_FIELD_NUMBER = 1; + private com.google.rpc.Status status_; + + /** + * + * + *
+   * Required. The session termination status.
+   * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The session termination status.
+   * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
+   * Required. The session termination status.
+   * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getStatus()); + } + 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, getStatus()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.TerminateSession)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.TerminateSession other = + (com.google.cloud.sql.v1beta4.TerminateSession) obj; + + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (!getUnknownFields().equals(other.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 (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.TerminateSession parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.TerminateSession parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TerminateSession parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.TerminateSession parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TerminateSession parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.TerminateSession parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TerminateSession parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.TerminateSession parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TerminateSession parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.TerminateSession parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TerminateSession parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.TerminateSession parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.TerminateSession prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Indicates that the session is permanently ended.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.TerminateSession} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.TerminateSession) + com.google.cloud.sql.v1beta4.TerminateSessionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_TerminateSession_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_TerminateSession_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.TerminateSession.class, + com.google.cloud.sql.v1beta4.TerminateSession.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.TerminateSession.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlDataProto + .internal_static_google_cloud_sql_v1beta4_TerminateSession_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.TerminateSession getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.TerminateSession build() { + com.google.cloud.sql.v1beta4.TerminateSession result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.TerminateSession buildPartial() { + com.google.cloud.sql.v1beta4.TerminateSession result = + new com.google.cloud.sql.v1beta4.TerminateSession(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.TerminateSession result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.TerminateSession) { + return mergeFrom((com.google.cloud.sql.v1beta4.TerminateSession) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.TerminateSession other) { + if (other == com.google.cloud.sql.v1beta4.TerminateSession.getDefaultInstance()) return this; + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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(internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
+     * Required. The session termination status.
+     * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The session termination status.
+     * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The session termination status.
+     * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The session termination status.
+     * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The session termination status.
+     * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The session termination status.
+     * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000001); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The session termination status.
+     * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The session termination status.
+     * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
+     * Required. The session termination status.
+     * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.TerminateSession) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.TerminateSession) + private static final com.google.cloud.sql.v1beta4.TerminateSession DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.TerminateSession(); + } + + public static com.google.cloud.sql.v1beta4.TerminateSession getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TerminateSession parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.TerminateSession getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TerminateSessionOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TerminateSessionOrBuilder.java new file mode 100644 index 000000000000..2760a756357e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TerminateSessionOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface TerminateSessionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.TerminateSession) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The session termination status.
+   * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+   * Required. The session termination status.
+   * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
+   * Required. The session termination status.
+   * 
+ * + * .google.rpc.Status status = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Tier.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Tier.java new file mode 100644 index 000000000000..fc1a08444a53 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Tier.java @@ -0,0 +1,1272 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_tiers.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * A Google Cloud SQL service tier resource.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Tier} + */ +@com.google.protobuf.Generated +public final class Tier extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.Tier) + TierOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Tier"); + } + + // Use Tier.newBuilder() to construct. + private Tier(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Tier() { + tier_ = ""; + kind_ = ""; + region_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_Tier_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_Tier_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Tier.class, + com.google.cloud.sql.v1beta4.Tier.Builder.class); + } + + public static final int TIER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object tier_ = ""; + + /** + * + * + *
+   * An identifier for the machine type, for example, `db-custom-1-3840`. For
+   * related information, see [Pricing](/sql/pricing).
+   * 
+ * + * string tier = 1; + * + * @return The tier. + */ + @java.lang.Override + public java.lang.String getTier() { + java.lang.Object ref = tier_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tier_ = s; + return s; + } + } + + /** + * + * + *
+   * An identifier for the machine type, for example, `db-custom-1-3840`. For
+   * related information, see [Pricing](/sql/pricing).
+   * 
+ * + * string tier = 1; + * + * @return The bytes for tier. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTierBytes() { + java.lang.Object ref = tier_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RAM_FIELD_NUMBER = 2; + private long rAM_ = 0L; + + /** + * + * + *
+   * The maximum RAM usage of this tier in bytes.
+   * 
+ * + * int64 RAM = 2 [json_name = "RAM"]; + * + * @return The rAM. + */ + @java.lang.Override + public long getRAM() { + return rAM_; + } + + public static final int KIND_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#tier`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#tier`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISK_QUOTA_FIELD_NUMBER = 4; + private long diskQuota_ = 0L; + + /** + * + * + *
+   * The maximum disk size of this tier in bytes.
+   * 
+ * + * int64 Disk_Quota = 4 [json_name = "DiskQuota"]; + * + * @return The diskQuota. + */ + @java.lang.Override + public long getDiskQuota() { + return diskQuota_; + } + + public static final int REGION_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList region_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @return A list containing the region. + */ + public com.google.protobuf.ProtocolStringList getRegionList() { + return region_; + } + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @return The count of region. + */ + public int getRegionCount() { + return region_.size(); + } + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @param index The index of the element to return. + * @return The region at the given index. + */ + public java.lang.String getRegion(int index) { + return region_.get(index); + } + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @param index The index of the value to return. + * @return The bytes of the region at the given index. + */ + public com.google.protobuf.ByteString getRegionBytes(int index) { + return region_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tier_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tier_); + } + if (rAM_ != 0L) { + output.writeInt64(2, rAM_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + if (diskQuota_ != 0L) { + output.writeInt64(4, diskQuota_); + } + for (int i = 0; i < region_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, region_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tier_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tier_); + } + if (rAM_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, rAM_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + if (diskQuota_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, diskQuota_); + } + { + int dataSize = 0; + for (int i = 0; i < region_.size(); i++) { + dataSize += computeStringSizeNoTag(region_.getRaw(i)); + } + size += dataSize; + size += 1 * getRegionList().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.sql.v1beta4.Tier)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.Tier other = (com.google.cloud.sql.v1beta4.Tier) obj; + + if (!getTier().equals(other.getTier())) return false; + if (getRAM() != other.getRAM()) return false; + if (!getKind().equals(other.getKind())) return false; + if (getDiskQuota() != other.getDiskQuota()) return false; + if (!getRegionList().equals(other.getRegionList())) return false; + if (!getUnknownFields().equals(other.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) + TIER_FIELD_NUMBER; + hash = (53 * hash) + getTier().hashCode(); + hash = (37 * hash) + RAM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRAM()); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + DISK_QUOTA_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDiskQuota()); + if (getRegionCount() > 0) { + hash = (37 * hash) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegionList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.Tier parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Tier parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Tier parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Tier parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Tier parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Tier parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Tier parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Tier parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Tier parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Tier parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Tier parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Tier parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.Tier prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A Google Cloud SQL service tier resource.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Tier} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.Tier) + com.google.cloud.sql.v1beta4.TierOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_Tier_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_Tier_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Tier.class, + com.google.cloud.sql.v1beta4.Tier.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.Tier.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tier_ = ""; + rAM_ = 0L; + kind_ = ""; + diskQuota_ = 0L; + region_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_Tier_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Tier getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.Tier.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Tier build() { + com.google.cloud.sql.v1beta4.Tier result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Tier buildPartial() { + com.google.cloud.sql.v1beta4.Tier result = new com.google.cloud.sql.v1beta4.Tier(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.Tier result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tier_ = tier_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.rAM_ = rAM_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.diskQuota_ = diskQuota_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + region_.makeImmutable(); + result.region_ = region_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.Tier) { + return mergeFrom((com.google.cloud.sql.v1beta4.Tier) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.Tier other) { + if (other == com.google.cloud.sql.v1beta4.Tier.getDefaultInstance()) return this; + if (!other.getTier().isEmpty()) { + tier_ = other.tier_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getRAM() != 0L) { + setRAM(other.getRAM()); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getDiskQuota() != 0L) { + setDiskQuota(other.getDiskQuota()); + } + if (!other.region_.isEmpty()) { + if (region_.isEmpty()) { + region_ = other.region_; + bitField0_ |= 0x00000010; + } else { + ensureRegionIsMutable(); + region_.addAll(other.region_); + } + 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: + { + tier_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + rAM_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + diskQuota_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRegionIsMutable(); + region_.add(s); + 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 tier_ = ""; + + /** + * + * + *
+     * An identifier for the machine type, for example, `db-custom-1-3840`. For
+     * related information, see [Pricing](/sql/pricing).
+     * 
+ * + * string tier = 1; + * + * @return The tier. + */ + public java.lang.String getTier() { + java.lang.Object ref = tier_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tier_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * An identifier for the machine type, for example, `db-custom-1-3840`. For
+     * related information, see [Pricing](/sql/pricing).
+     * 
+ * + * string tier = 1; + * + * @return The bytes for tier. + */ + public com.google.protobuf.ByteString getTierBytes() { + java.lang.Object ref = tier_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * An identifier for the machine type, for example, `db-custom-1-3840`. For
+     * related information, see [Pricing](/sql/pricing).
+     * 
+ * + * string tier = 1; + * + * @param value The tier to set. + * @return This builder for chaining. + */ + public Builder setTier(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tier_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * An identifier for the machine type, for example, `db-custom-1-3840`. For
+     * related information, see [Pricing](/sql/pricing).
+     * 
+ * + * string tier = 1; + * + * @return This builder for chaining. + */ + public Builder clearTier() { + tier_ = getDefaultInstance().getTier(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * An identifier for the machine type, for example, `db-custom-1-3840`. For
+     * related information, see [Pricing](/sql/pricing).
+     * 
+ * + * string tier = 1; + * + * @param value The bytes for tier to set. + * @return This builder for chaining. + */ + public Builder setTierBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tier_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long rAM_; + + /** + * + * + *
+     * The maximum RAM usage of this tier in bytes.
+     * 
+ * + * int64 RAM = 2 [json_name = "RAM"]; + * + * @return The rAM. + */ + @java.lang.Override + public long getRAM() { + return rAM_; + } + + /** + * + * + *
+     * The maximum RAM usage of this tier in bytes.
+     * 
+ * + * int64 RAM = 2 [json_name = "RAM"]; + * + * @param value The rAM to set. + * @return This builder for chaining. + */ + public Builder setRAM(long value) { + + rAM_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum RAM usage of this tier in bytes.
+     * 
+ * + * int64 RAM = 2 [json_name = "RAM"]; + * + * @return This builder for chaining. + */ + public Builder clearRAM() { + bitField0_ = (bitField0_ & ~0x00000002); + rAM_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#tier`.
+     * 
+ * + * string kind = 3; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#tier`.
+     * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#tier`.
+     * 
+ * + * string kind = 3; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#tier`.
+     * 
+ * + * string kind = 3; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#tier`.
+     * 
+ * + * string kind = 3; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private long diskQuota_; + + /** + * + * + *
+     * The maximum disk size of this tier in bytes.
+     * 
+ * + * int64 Disk_Quota = 4 [json_name = "DiskQuota"]; + * + * @return The diskQuota. + */ + @java.lang.Override + public long getDiskQuota() { + return diskQuota_; + } + + /** + * + * + *
+     * The maximum disk size of this tier in bytes.
+     * 
+ * + * int64 Disk_Quota = 4 [json_name = "DiskQuota"]; + * + * @param value The diskQuota to set. + * @return This builder for chaining. + */ + public Builder setDiskQuota(long value) { + + diskQuota_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum disk size of this tier in bytes.
+     * 
+ * + * int64 Disk_Quota = 4 [json_name = "DiskQuota"]; + * + * @return This builder for chaining. + */ + public Builder clearDiskQuota() { + bitField0_ = (bitField0_ & ~0x00000008); + diskQuota_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList region_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureRegionIsMutable() { + if (!region_.isModifiable()) { + region_ = new com.google.protobuf.LazyStringArrayList(region_); + } + bitField0_ |= 0x00000010; + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @return A list containing the region. + */ + public com.google.protobuf.ProtocolStringList getRegionList() { + region_.makeImmutable(); + return region_; + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @return The count of region. + */ + public int getRegionCount() { + return region_.size(); + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @param index The index of the element to return. + * @return The region at the given index. + */ + public java.lang.String getRegion(int index) { + return region_.get(index); + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @param index The index of the value to return. + * @return The bytes of the region at the given index. + */ + public com.google.protobuf.ByteString getRegionBytes(int index) { + return region_.getByteString(index); + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @param index The index to set the value at. + * @param value The region to set. + * @return This builder for chaining. + */ + public Builder setRegion(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegionIsMutable(); + region_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @param value The region to add. + * @return This builder for chaining. + */ + public Builder addRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegionIsMutable(); + region_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @param values The region to add. + * @return This builder for chaining. + */ + public Builder addAllRegion(java.lang.Iterable values) { + ensureRegionIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, region_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @return This builder for chaining. + */ + public Builder clearRegion() { + region_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * The applicable regions for this tier.
+     * 
+ * + * repeated string region = 5; + * + * @param value The bytes of the region to add. + * @return This builder for chaining. + */ + public Builder addRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRegionIsMutable(); + region_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.Tier) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.Tier) + private static final com.google.cloud.sql.v1beta4.Tier DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.Tier(); + } + + public static com.google.cloud.sql.v1beta4.Tier getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Tier parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Tier getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TierOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TierOrBuilder.java new file mode 100644 index 000000000000..06a57b670063 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TierOrBuilder.java @@ -0,0 +1,162 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_tiers.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface TierOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.Tier) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * An identifier for the machine type, for example, `db-custom-1-3840`. For
+   * related information, see [Pricing](/sql/pricing).
+   * 
+ * + * string tier = 1; + * + * @return The tier. + */ + java.lang.String getTier(); + + /** + * + * + *
+   * An identifier for the machine type, for example, `db-custom-1-3840`. For
+   * related information, see [Pricing](/sql/pricing).
+   * 
+ * + * string tier = 1; + * + * @return The bytes for tier. + */ + com.google.protobuf.ByteString getTierBytes(); + + /** + * + * + *
+   * The maximum RAM usage of this tier in bytes.
+   * 
+ * + * int64 RAM = 2 [json_name = "RAM"]; + * + * @return The rAM. + */ + long getRAM(); + + /** + * + * + *
+   * This is always `sql#tier`.
+   * 
+ * + * string kind = 3; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#tier`.
+   * 
+ * + * string kind = 3; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The maximum disk size of this tier in bytes.
+   * 
+ * + * int64 Disk_Quota = 4 [json_name = "DiskQuota"]; + * + * @return The diskQuota. + */ + long getDiskQuota(); + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @return A list containing the region. + */ + java.util.List getRegionList(); + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @return The count of region. + */ + int getRegionCount(); + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @param index The index of the element to return. + * @return The region at the given index. + */ + java.lang.String getRegion(int index); + + /** + * + * + *
+   * The applicable regions for this tier.
+   * 
+ * + * repeated string region = 5; + * + * @param index The index of the value to return. + * @return The bytes of the region at the given index. + */ + com.google.protobuf.ByteString getRegionBytes(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TiersListResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TiersListResponse.java new file mode 100644 index 000000000000..a7d5da333aac --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TiersListResponse.java @@ -0,0 +1,1106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_tiers.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Tiers list response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.TiersListResponse} + */ +@com.google.protobuf.Generated +public final class TiersListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.TiersListResponse) + TiersListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TiersListResponse"); + } + + // Use TiersListResponse.newBuilder() to construct. + private TiersListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TiersListResponse() { + kind_ = ""; + items_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_TiersListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_TiersListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.TiersListResponse.class, + com.google.cloud.sql.v1beta4.TiersListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#tiersList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#tiersList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Tier getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.TierOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.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.sql.v1beta4.TiersListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.TiersListResponse other = + (com.google.cloud.sql.v1beta4.TiersListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.TiersListResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.TiersListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TiersListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.TiersListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TiersListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.TiersListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TiersListResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.TiersListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TiersListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.TiersListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TiersListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.TiersListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.TiersListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Tiers list response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.TiersListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.TiersListResponse) + com.google.cloud.sql.v1beta4.TiersListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_TiersListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_TiersListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.TiersListResponse.class, + com.google.cloud.sql.v1beta4.TiersListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.TiersListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlTiersProto + .internal_static_google_cloud_sql_v1beta4_TiersListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.TiersListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.TiersListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.TiersListResponse build() { + com.google.cloud.sql.v1beta4.TiersListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.TiersListResponse buildPartial() { + com.google.cloud.sql.v1beta4.TiersListResponse result = + new com.google.cloud.sql.v1beta4.TiersListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1beta4.TiersListResponse result) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.TiersListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.TiersListResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.TiersListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.TiersListResponse other) { + if (other == com.google.cloud.sql.v1beta4.TiersListResponse.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1beta4.Tier m = + input.readMessage( + com.google.cloud.sql.v1beta4.Tier.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#tiersList`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#tiersList`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#tiersList`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#tiersList`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#tiersList`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Tier, + com.google.cloud.sql.v1beta4.Tier.Builder, + com.google.cloud.sql.v1beta4.TierOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public com.google.cloud.sql.v1beta4.Tier getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1beta4.Tier value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1beta4.Tier.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.Tier value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1beta4.Tier value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.Tier.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1beta4.Tier.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public com.google.cloud.sql.v1beta4.Tier.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public com.google.cloud.sql.v1beta4.TierOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public com.google.cloud.sql.v1beta4.Tier.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.Tier.getDefaultInstance()); + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public com.google.cloud.sql.v1beta4.Tier.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.Tier.getDefaultInstance()); + } + + /** + * + * + *
+     * List of tiers.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Tier, + com.google.cloud.sql.v1beta4.Tier.Builder, + com.google.cloud.sql.v1beta4.TierOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.Tier, + com.google.cloud.sql.v1beta4.Tier.Builder, + com.google.cloud.sql.v1beta4.TierOrBuilder>( + items_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.TiersListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.TiersListResponse) + private static final com.google.cloud.sql.v1beta4.TiersListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.TiersListResponse(); + } + + public static com.google.cloud.sql.v1beta4.TiersListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TiersListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.TiersListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TiersListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TiersListResponseOrBuilder.java new file mode 100644 index 000000000000..0b7dd6751e30 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TiersListResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_tiers.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface TiersListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.TiersListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#tiersList`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#tiersList`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + com.google.cloud.sql.v1beta4.Tier getItems(int index); + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + int getItemsCount(); + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + java.util.List getItemsOrBuilderList(); + + /** + * + * + *
+   * List of tiers.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.Tier items = 2; + */ + com.google.cloud.sql.v1beta4.TierOrBuilder getItemsOrBuilder(int index); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TruncateLogContext.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TruncateLogContext.java new file mode 100644 index 000000000000..95226b30530e --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TruncateLogContext.java @@ -0,0 +1,792 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * Database Instance truncate log context.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.TruncateLogContext} + */ +@com.google.protobuf.Generated +public final class TruncateLogContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.TruncateLogContext) + TruncateLogContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TruncateLogContext"); + } + + // Use TruncateLogContext.newBuilder() to construct. + private TruncateLogContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TruncateLogContext() { + kind_ = ""; + logType_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_TruncateLogContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_TruncateLogContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.TruncateLogContext.class, + com.google.cloud.sql.v1beta4.TruncateLogContext.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#truncateLogContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#truncateLogContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOG_TYPE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object logType_ = ""; + + /** + * + * + *
+   * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+   * `MYSQL_SLOW_TABLE`.
+   * 
+ * + * string log_type = 2; + * + * @return The logType. + */ + @java.lang.Override + public java.lang.String getLogType() { + java.lang.Object ref = logType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logType_ = s; + return s; + } + } + + /** + * + * + *
+   * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+   * `MYSQL_SLOW_TABLE`.
+   * 
+ * + * string log_type = 2; + * + * @return The bytes for logType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLogTypeBytes() { + java.lang.Object ref = logType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logType_ = 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.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(logType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, logType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(logType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, logType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.TruncateLogContext)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.TruncateLogContext other = + (com.google.cloud.sql.v1beta4.TruncateLogContext) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getLogType().equals(other.getLogType())) return false; + if (!getUnknownFields().equals(other.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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + LOG_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getLogType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.TruncateLogContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.TruncateLogContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TruncateLogContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.TruncateLogContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TruncateLogContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.TruncateLogContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TruncateLogContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.TruncateLogContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TruncateLogContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.TruncateLogContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.TruncateLogContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.TruncateLogContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.TruncateLogContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Database Instance truncate log context.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.TruncateLogContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.TruncateLogContext) + com.google.cloud.sql.v1beta4.TruncateLogContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_TruncateLogContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_TruncateLogContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.TruncateLogContext.class, + com.google.cloud.sql.v1beta4.TruncateLogContext.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.TruncateLogContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + logType_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlResourcesProto + .internal_static_google_cloud_sql_v1beta4_TruncateLogContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.TruncateLogContext getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.TruncateLogContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.TruncateLogContext build() { + com.google.cloud.sql.v1beta4.TruncateLogContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.TruncateLogContext buildPartial() { + com.google.cloud.sql.v1beta4.TruncateLogContext result = + new com.google.cloud.sql.v1beta4.TruncateLogContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.TruncateLogContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.logType_ = logType_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.TruncateLogContext) { + return mergeFrom((com.google.cloud.sql.v1beta4.TruncateLogContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.TruncateLogContext other) { + if (other == com.google.cloud.sql.v1beta4.TruncateLogContext.getDefaultInstance()) + return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getLogType().isEmpty()) { + logType_ = other.logType_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + logType_ = 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 kind_ = ""; + + /** + * + * + *
+     * This is always `sql#truncateLogContext`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#truncateLogContext`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#truncateLogContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#truncateLogContext`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#truncateLogContext`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object logType_ = ""; + + /** + * + * + *
+     * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+     * `MYSQL_SLOW_TABLE`.
+     * 
+ * + * string log_type = 2; + * + * @return The logType. + */ + public java.lang.String getLogType() { + java.lang.Object ref = logType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+     * `MYSQL_SLOW_TABLE`.
+     * 
+ * + * string log_type = 2; + * + * @return The bytes for logType. + */ + public com.google.protobuf.ByteString getLogTypeBytes() { + java.lang.Object ref = logType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+     * `MYSQL_SLOW_TABLE`.
+     * 
+ * + * string log_type = 2; + * + * @param value The logType to set. + * @return This builder for chaining. + */ + public Builder setLogType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + logType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+     * `MYSQL_SLOW_TABLE`.
+     * 
+ * + * string log_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearLogType() { + logType_ = getDefaultInstance().getLogType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+     * `MYSQL_SLOW_TABLE`.
+     * 
+ * + * string log_type = 2; + * + * @param value The bytes for logType to set. + * @return This builder for chaining. + */ + public Builder setLogTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + logType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.TruncateLogContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.TruncateLogContext) + private static final com.google.cloud.sql.v1beta4.TruncateLogContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.TruncateLogContext(); + } + + public static com.google.cloud.sql.v1beta4.TruncateLogContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TruncateLogContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.TruncateLogContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TruncateLogContextOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TruncateLogContextOrBuilder.java new file mode 100644 index 000000000000..269797acf3fc --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/TruncateLogContextOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface TruncateLogContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.TruncateLogContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#truncateLogContext`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#truncateLogContext`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+   * `MYSQL_SLOW_TABLE`.
+   * 
+ * + * string log_type = 2; + * + * @return The logType. + */ + java.lang.String getLogType(); + + /** + * + * + *
+   * The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
+   * `MYSQL_SLOW_TABLE`.
+   * 
+ * + * string log_type = 2; + * + * @return The bytes for logType. + */ + com.google.protobuf.ByteString getLogTypeBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UpdateBackupRequest.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UpdateBackupRequest.java new file mode 100644 index 000000000000..7a4952e2d188 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UpdateBackupRequest.java @@ -0,0 +1,1014 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The request payload to update the backup.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.UpdateBackupRequest} + */ +@com.google.protobuf.Generated +public final class UpdateBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.UpdateBackupRequest) + UpdateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateBackupRequest"); + } + + // Use UpdateBackupRequest.newBuilder() to construct. + private UpdateBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateBackupRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.UpdateBackupRequest.class, + com.google.cloud.sql.v1beta4.UpdateBackupRequest.Builder.class); + } + + private int bitField0_; + public static final int BACKUP_FIELD_NUMBER = 1; + private com.google.cloud.sql.v1beta4.Backup backup_; + + /** + * + * + *
+   * Required. The backup to update.
+   * The backup’s `name` field is used to identify the backup to update.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The backup to update.
+   * The backup’s `name` field is used to identify the backup to update.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.Backup getBackup() { + return backup_ == null ? com.google.cloud.sql.v1beta4.Backup.getDefaultInstance() : backup_; + } + + /** + * + * + *
+   * Required. The backup to update.
+   * The backup’s `name` field is used to identify the backup to update.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.BackupOrBuilder getBackupOrBuilder() { + return backup_ == null ? com.google.cloud.sql.v1beta4.Backup.getDefaultInstance() : backup_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * The list of fields that you can update. You can update only the description
+   * and retention period of the final backup.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The list of fields that you can update. You can update only the description
+   * and retention period of the final backup.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * The list of fields that you can update. You can update only the description
+   * and retention period of the final backup.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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, getBackup()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + 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, getBackup()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.UpdateBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.UpdateBackupRequest other = + (com.google.cloud.sql.v1beta4.UpdateBackupRequest) obj; + + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.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 (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.UpdateBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.UpdateBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UpdateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.UpdateBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UpdateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.UpdateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UpdateBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.UpdateBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UpdateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.UpdateBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UpdateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.UpdateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.UpdateBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request payload to update the backup.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.UpdateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.UpdateBackupRequest) + com.google.cloud.sql.v1beta4.UpdateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.UpdateBackupRequest.class, + com.google.cloud.sql.v1beta4.UpdateBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.UpdateBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackupFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.UpdateBackupRequest getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.UpdateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.UpdateBackupRequest build() { + com.google.cloud.sql.v1beta4.UpdateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.UpdateBackupRequest buildPartial() { + com.google.cloud.sql.v1beta4.UpdateBackupRequest result = + new com.google.cloud.sql.v1beta4.UpdateBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.UpdateBackupRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backup_ = backupBuilder_ == null ? backup_ : backupBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.UpdateBackupRequest) { + return mergeFrom((com.google.cloud.sql.v1beta4.UpdateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.UpdateBackupRequest other) { + if (other == com.google.cloud.sql.v1beta4.UpdateBackupRequest.getDefaultInstance()) + return this; + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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(internalGetBackupFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.sql.v1beta4.Backup backup_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Backup, + com.google.cloud.sql.v1beta4.Backup.Builder, + com.google.cloud.sql.v1beta4.BackupOrBuilder> + backupBuilder_; + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.cloud.sql.v1beta4.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null ? com.google.cloud.sql.v1beta4.Backup.getDefaultInstance() : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.sql.v1beta4.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + } else { + backupBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.sql.v1beta4.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.cloud.sql.v1beta4.Backup value) { + if (backupBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && backup_ != null + && backup_ != com.google.cloud.sql.v1beta4.Backup.getDefaultInstance()) { + getBackupBuilder().mergeFrom(value); + } else { + backup_ = value; + } + } else { + backupBuilder_.mergeFrom(value); + } + if (backup_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + bitField0_ = (bitField0_ & ~0x00000001); + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.Backup.Builder getBackupBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetBackupFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.sql.v1beta4.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null ? com.google.cloud.sql.v1beta4.Backup.getDefaultInstance() : backup_; + } + } + + /** + * + * + *
+     * Required. The backup to update.
+     * The backup’s `name` field is used to identify the backup to update.
+     * Format: projects/{project}/backups/{backup}
+     * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Backup, + com.google.cloud.sql.v1beta4.Backup.Builder, + com.google.cloud.sql.v1beta4.BackupOrBuilder> + internalGetBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.Backup, + com.google.cloud.sql.v1beta4.Backup.Builder, + com.google.cloud.sql.v1beta4.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * The list of fields that you can update. You can update only the description
+     * and retention period of the final backup.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.UpdateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.UpdateBackupRequest) + private static final com.google.cloud.sql.v1beta4.UpdateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.UpdateBackupRequest(); + } + + public static com.google.cloud.sql.v1beta4.UpdateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.UpdateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UpdateBackupRequestOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UpdateBackupRequestOrBuilder.java new file mode 100644 index 000000000000..95c44b6c0ef0 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UpdateBackupRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface UpdateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.UpdateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The backup to update.
+   * The backup’s `name` field is used to identify the backup to update.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + + /** + * + * + *
+   * Required. The backup to update.
+   * The backup’s `name` field is used to identify the backup to update.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.cloud.sql.v1beta4.Backup getBackup(); + + /** + * + * + *
+   * Required. The backup to update.
+   * The backup’s `name` field is used to identify the backup to update.
+   * Format: projects/{project}/backups/{backup}
+   * 
+ * + * .google.cloud.sql.v1beta4.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.sql.v1beta4.BackupOrBuilder getBackupOrBuilder(); + + /** + * + * + *
+   * The list of fields that you can update. You can update only the description
+   * and retention period of the final backup.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * The list of fields that you can update. You can update only the description
+   * and retention period of the final backup.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * The list of fields that you can update. You can update only the description
+   * and retention period of the final backup.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/User.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/User.java new file mode 100644 index 000000000000..11aeaa44ca30 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/User.java @@ -0,0 +1,4108 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * A Cloud SQL user resource.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.User} + */ +@com.google.protobuf.Generated +public final class User extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.User) + UserOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "User"); + } + + // Use User.newBuilder() to construct. + private User(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private User() { + kind_ = ""; + password_ = ""; + etag_ = ""; + name_ = ""; + host_ = ""; + instance_ = ""; + project_ = ""; + type_ = 0; + iamEmail_ = ""; + dualPasswordType_ = 0; + iamStatus_ = 0; + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.User.class, + com.google.cloud.sql.v1beta4.User.Builder.class); + } + + /** + * + * + *
+   * The user type.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.User.SqlUserType} + */ + public enum SqlUserType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The database's built-in user type.
+     * 
+ * + * BUILT_IN = 0; + */ + BUILT_IN(0), + /** + * + * + *
+     * Cloud IAM user.
+     * 
+ * + * CLOUD_IAM_USER = 1; + */ + CLOUD_IAM_USER(1), + /** + * + * + *
+     * Cloud IAM service account.
+     * 
+ * + * CLOUD_IAM_SERVICE_ACCOUNT = 2; + */ + CLOUD_IAM_SERVICE_ACCOUNT(2), + /** + * + * + *
+     * Cloud IAM group. Not used for login.
+     * 
+ * + * CLOUD_IAM_GROUP = 3; + */ + CLOUD_IAM_GROUP(3), + /** + * + * + *
+     * Read-only. Login for a user that belongs to the Cloud IAM group.
+     * 
+ * + * CLOUD_IAM_GROUP_USER = 4; + */ + CLOUD_IAM_GROUP_USER(4), + /** + * + * + *
+     * Read-only. Login for a service account that belongs to the
+     * Cloud IAM group.
+     * 
+ * + * CLOUD_IAM_GROUP_SERVICE_ACCOUNT = 5; + */ + CLOUD_IAM_GROUP_SERVICE_ACCOUNT(5), + /** + * + * + *
+     * Cloud IAM workforce identity user managed via workforce identity
+     * federation.
+     * 
+ * + * CLOUD_IAM_WORKFORCE_IDENTITY = 6; + */ + CLOUD_IAM_WORKFORCE_IDENTITY(6), + /** + * + * + *
+     * Microsoft Entra ID user.
+     * 
+ * + * ENTRAID_USER = 7; + */ + ENTRAID_USER(7), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SqlUserType"); + } + + /** + * + * + *
+     * The database's built-in user type.
+     * 
+ * + * BUILT_IN = 0; + */ + public static final int BUILT_IN_VALUE = 0; + + /** + * + * + *
+     * Cloud IAM user.
+     * 
+ * + * CLOUD_IAM_USER = 1; + */ + public static final int CLOUD_IAM_USER_VALUE = 1; + + /** + * + * + *
+     * Cloud IAM service account.
+     * 
+ * + * CLOUD_IAM_SERVICE_ACCOUNT = 2; + */ + public static final int CLOUD_IAM_SERVICE_ACCOUNT_VALUE = 2; + + /** + * + * + *
+     * Cloud IAM group. Not used for login.
+     * 
+ * + * CLOUD_IAM_GROUP = 3; + */ + public static final int CLOUD_IAM_GROUP_VALUE = 3; + + /** + * + * + *
+     * Read-only. Login for a user that belongs to the Cloud IAM group.
+     * 
+ * + * CLOUD_IAM_GROUP_USER = 4; + */ + public static final int CLOUD_IAM_GROUP_USER_VALUE = 4; + + /** + * + * + *
+     * Read-only. Login for a service account that belongs to the
+     * Cloud IAM group.
+     * 
+ * + * CLOUD_IAM_GROUP_SERVICE_ACCOUNT = 5; + */ + public static final int CLOUD_IAM_GROUP_SERVICE_ACCOUNT_VALUE = 5; + + /** + * + * + *
+     * Cloud IAM workforce identity user managed via workforce identity
+     * federation.
+     * 
+ * + * CLOUD_IAM_WORKFORCE_IDENTITY = 6; + */ + public static final int CLOUD_IAM_WORKFORCE_IDENTITY_VALUE = 6; + + /** + * + * + *
+     * Microsoft Entra ID user.
+     * 
+ * + * ENTRAID_USER = 7; + */ + public static final int ENTRAID_USER_VALUE = 7; + + 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 SqlUserType 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 SqlUserType forNumber(int value) { + switch (value) { + case 0: + return BUILT_IN; + case 1: + return CLOUD_IAM_USER; + case 2: + return CLOUD_IAM_SERVICE_ACCOUNT; + case 3: + return CLOUD_IAM_GROUP; + case 4: + return CLOUD_IAM_GROUP_USER; + case 5: + return CLOUD_IAM_GROUP_SERVICE_ACCOUNT; + case 6: + return CLOUD_IAM_WORKFORCE_IDENTITY; + case 7: + return ENTRAID_USER; + 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 SqlUserType findValueByNumber(int number) { + return SqlUserType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.User.getDescriptor().getEnumTypes().get(0); + } + + private static final SqlUserType[] VALUES = values(); + + public static SqlUserType 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 SqlUserType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.User.SqlUserType) + } + + /** + * + * + *
+   * The type of retained password.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.User.DualPasswordType} + */ + public enum DualPasswordType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The default value.
+     * 
+ * + * DUAL_PASSWORD_TYPE_UNSPECIFIED = 0; + */ + DUAL_PASSWORD_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Do not update the user's dual password status.
+     * 
+ * + * NO_MODIFY_DUAL_PASSWORD = 1; + */ + NO_MODIFY_DUAL_PASSWORD(1), + /** + * + * + *
+     * No dual password usable for connecting using this user.
+     * 
+ * + * NO_DUAL_PASSWORD = 2; + */ + NO_DUAL_PASSWORD(2), + /** + * + * + *
+     * Dual password usable for connecting using this user.
+     * 
+ * + * DUAL_PASSWORD = 3; + */ + DUAL_PASSWORD(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DualPasswordType"); + } + + /** + * + * + *
+     * The default value.
+     * 
+ * + * DUAL_PASSWORD_TYPE_UNSPECIFIED = 0; + */ + public static final int DUAL_PASSWORD_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Do not update the user's dual password status.
+     * 
+ * + * NO_MODIFY_DUAL_PASSWORD = 1; + */ + public static final int NO_MODIFY_DUAL_PASSWORD_VALUE = 1; + + /** + * + * + *
+     * No dual password usable for connecting using this user.
+     * 
+ * + * NO_DUAL_PASSWORD = 2; + */ + public static final int NO_DUAL_PASSWORD_VALUE = 2; + + /** + * + * + *
+     * Dual password usable for connecting using this user.
+     * 
+ * + * DUAL_PASSWORD = 3; + */ + public static final int DUAL_PASSWORD_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 DualPasswordType 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 DualPasswordType forNumber(int value) { + switch (value) { + case 0: + return DUAL_PASSWORD_TYPE_UNSPECIFIED; + case 1: + return NO_MODIFY_DUAL_PASSWORD; + case 2: + return NO_DUAL_PASSWORD; + case 3: + return DUAL_PASSWORD; + 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 DualPasswordType findValueByNumber(int number) { + return DualPasswordType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.User.getDescriptor().getEnumTypes().get(1); + } + + private static final DualPasswordType[] VALUES = values(); + + public static DualPasswordType 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 DualPasswordType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.User.DualPasswordType) + } + + /** + * + * + *
+   * Indicates if a group is available for IAM database authentication.
+   * 
+ * + * Protobuf enum {@code google.cloud.sql.v1beta4.User.IamStatus} + */ + public enum IamStatus implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The default value for users that are not of type CLOUD_IAM_GROUP.
+     * Only CLOUD_IAM_GROUP users will be inactive or active.
+     * Users with an IamStatus of IAM_STATUS_UNSPECIFIED will not
+     * display whether they are active or inactive as that is not applicable to
+     * them.
+     * 
+ * + * IAM_STATUS_UNSPECIFIED = 0; + */ + IAM_STATUS_UNSPECIFIED(0), + /** + * + * + *
+     * INACTIVE indicates a group is not available for IAM database
+     * authentication.
+     * 
+ * + * INACTIVE = 1; + */ + INACTIVE(1), + /** + * + * + *
+     * ACTIVE indicates a group is available for IAM database authentication.
+     * 
+ * + * ACTIVE = 2; + */ + ACTIVE(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "IamStatus"); + } + + /** + * + * + *
+     * The default value for users that are not of type CLOUD_IAM_GROUP.
+     * Only CLOUD_IAM_GROUP users will be inactive or active.
+     * Users with an IamStatus of IAM_STATUS_UNSPECIFIED will not
+     * display whether they are active or inactive as that is not applicable to
+     * them.
+     * 
+ * + * IAM_STATUS_UNSPECIFIED = 0; + */ + public static final int IAM_STATUS_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * INACTIVE indicates a group is not available for IAM database
+     * authentication.
+     * 
+ * + * INACTIVE = 1; + */ + public static final int INACTIVE_VALUE = 1; + + /** + * + * + *
+     * ACTIVE indicates a group is available for IAM database authentication.
+     * 
+ * + * ACTIVE = 2; + */ + public static final int ACTIVE_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 IamStatus 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 IamStatus forNumber(int value) { + switch (value) { + case 0: + return IAM_STATUS_UNSPECIFIED; + case 1: + return INACTIVE; + case 2: + return ACTIVE; + 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 IamStatus findValueByNumber(int number) { + return IamStatus.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.User.getDescriptor().getEnumTypes().get(2); + } + + private static final IamStatus[] VALUES = values(); + + public static IamStatus 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 IamStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.sql.v1beta4.User.IamStatus) + } + + private int bitField0_; + private int userDetailsCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object userDetails_; + + public enum UserDetailsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SQLSERVER_USER_DETAILS(9), + USERDETAILS_NOT_SET(0); + private final int value; + + private UserDetailsCase(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 UserDetailsCase valueOf(int value) { + return forNumber(value); + } + + public static UserDetailsCase forNumber(int value) { + switch (value) { + case 9: + return SQLSERVER_USER_DETAILS; + case 0: + return USERDETAILS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public UserDetailsCase getUserDetailsCase() { + return UserDetailsCase.forNumber(userDetailsCase_); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always `sql#user`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always `sql#user`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + + /** + * + * + *
+   * The password for the user.
+   * 
+ * + * string password = 2; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + + /** + * + * + *
+   * The password for the user.
+   * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the user in the Cloud SQL instance. Can be omitted for
+   * `update` because it is already specified in the URL.
+   * 
+ * + * string name = 4; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the user in the Cloud SQL instance. Can be omitted for
+   * `update` because it is already specified in the URL.
+   * 
+ * + * string name = 4; + * + * @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 HOST_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object host_ = ""; + + /** + * + * + *
+   * Optional. The host from which the user can connect. For `insert`
+   * operations, host defaults to an empty string. For `update`
+   * operations, host is specified as part of the request URL. The host name
+   * cannot be updated after insertion.  For a MySQL instance, it's required;
+   * for a PostgreSQL or SQL Server instance, it's optional.
+   * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The host. + */ + @java.lang.Override + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The host from which the user can connect. For `insert`
+   * operations, host defaults to an empty string. For `update`
+   * operations, host is specified as part of the request URL. The host name
+   * cannot be updated after insertion.  For a MySQL instance, it's required;
+   * for a PostgreSQL or SQL Server instance, it's optional.
+   * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for host. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object instance_ = ""; + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * Can be omitted for <b>update</b> because it is already specified on the
+   * URL.
+   * 
+ * + * string instance = 6; + * + * @return The instance. + */ + @java.lang.Override + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * Can be omitted for <b>update</b> because it is already specified on the
+   * URL.
+   * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable. Can be omitted for
+   * <b>update</b> because it is already specified on the URL.
+   * 
+ * + * string project = 7; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable. Can be omitted for
+   * <b>update</b> because it is already specified on the URL.
+   * 
+ * + * string project = 7; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 8; + private int type_ = 0; + + /** + * + * + *
+   * The user type. It determines the method to authenticate the user during
+   * login. The default is the database's built-in user type.
+   * 
+ * + * .google.cloud.sql.v1beta4.User.SqlUserType type = 8; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * The user type. It determines the method to authenticate the user during
+   * login. The default is the database's built-in user type.
+   * 
+ * + * .google.cloud.sql.v1beta4.User.SqlUserType type = 8; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.User.SqlUserType getType() { + com.google.cloud.sql.v1beta4.User.SqlUserType result = + com.google.cloud.sql.v1beta4.User.SqlUserType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1beta4.User.SqlUserType.UNRECOGNIZED : result; + } + + public static final int SQLSERVER_USER_DETAILS_FIELD_NUMBER = 9; + + /** + * .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; + * + * @return Whether the sqlserverUserDetails field is set. + */ + @java.lang.Override + public boolean hasSqlserverUserDetails() { + return userDetailsCase_ == 9; + } + + /** + * .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; + * + * @return The sqlserverUserDetails. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerUserDetails getSqlserverUserDetails() { + if (userDetailsCase_ == 9) { + return (com.google.cloud.sql.v1beta4.SqlServerUserDetails) userDetails_; + } + return com.google.cloud.sql.v1beta4.SqlServerUserDetails.getDefaultInstance(); + } + + /** .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerUserDetailsOrBuilder + getSqlserverUserDetailsOrBuilder() { + if (userDetailsCase_ == 9) { + return (com.google.cloud.sql.v1beta4.SqlServerUserDetails) userDetails_; + } + return com.google.cloud.sql.v1beta4.SqlServerUserDetails.getDefaultInstance(); + } + + public static final int IAM_EMAIL_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object iamEmail_ = ""; + + /** + * + * + *
+   * Optional. The full email for an IAM user. For normal database users, this
+   * will not be filled. Only applicable to MySQL database users.
+   * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The iamEmail. + */ + @java.lang.Override + public java.lang.String getIamEmail() { + java.lang.Object ref = iamEmail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + iamEmail_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The full email for an IAM user. For normal database users, this
+   * will not be filled. Only applicable to MySQL database users.
+   * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for iamEmail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIamEmailBytes() { + java.lang.Object ref = iamEmail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + iamEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_POLICY_FIELD_NUMBER = 12; + private com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy passwordPolicy_; + + /** + * + * + *
+   * User level password validation policy.
+   * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + * + * @return Whether the passwordPolicy field is set. + */ + @java.lang.Override + public boolean hasPasswordPolicy() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * User level password validation policy.
+   * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + * + * @return The passwordPolicy. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy getPasswordPolicy() { + return passwordPolicy_ == null + ? com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.getDefaultInstance() + : passwordPolicy_; + } + + /** + * + * + *
+   * User level password validation policy.
+   * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.UserPasswordValidationPolicyOrBuilder + getPasswordPolicyOrBuilder() { + return passwordPolicy_ == null + ? com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.getDefaultInstance() + : passwordPolicy_; + } + + public static final int DUAL_PASSWORD_TYPE_FIELD_NUMBER = 13; + private int dualPasswordType_ = 0; + + /** + * + * + *
+   * Dual password status for the user.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.User.DualPasswordType dual_password_type = 13; + * + * @return Whether the dualPasswordType field is set. + */ + @java.lang.Override + public boolean hasDualPasswordType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Dual password status for the user.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.User.DualPasswordType dual_password_type = 13; + * + * @return The enum numeric value on the wire for dualPasswordType. + */ + @java.lang.Override + public int getDualPasswordTypeValue() { + return dualPasswordType_; + } + + /** + * + * + *
+   * Dual password status for the user.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.User.DualPasswordType dual_password_type = 13; + * + * @return The dualPasswordType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.User.DualPasswordType getDualPasswordType() { + com.google.cloud.sql.v1beta4.User.DualPasswordType result = + com.google.cloud.sql.v1beta4.User.DualPasswordType.forNumber(dualPasswordType_); + return result == null + ? com.google.cloud.sql.v1beta4.User.DualPasswordType.UNRECOGNIZED + : result; + } + + public static final int IAM_STATUS_FIELD_NUMBER = 14; + private int iamStatus_ = 0; + + /** + * + * + *
+   * Indicates if a group is active or inactive for IAM database authentication.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.User.IamStatus iam_status = 14; + * + * @return Whether the iamStatus field is set. + */ + @java.lang.Override + public boolean hasIamStatus() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Indicates if a group is active or inactive for IAM database authentication.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.User.IamStatus iam_status = 14; + * + * @return The enum numeric value on the wire for iamStatus. + */ + @java.lang.Override + public int getIamStatusValue() { + return iamStatus_; + } + + /** + * + * + *
+   * Indicates if a group is active or inactive for IAM database authentication.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.User.IamStatus iam_status = 14; + * + * @return The iamStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.User.IamStatus getIamStatus() { + com.google.cloud.sql.v1beta4.User.IamStatus result = + com.google.cloud.sql.v1beta4.User.IamStatus.forNumber(iamStatus_); + return result == null ? com.google.cloud.sql.v1beta4.User.IamStatus.UNRECOGNIZED : result; + } + + public static final int DATABASE_ROLES_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList databaseRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + public com.google.protobuf.ProtocolStringList getDatabaseRolesList() { + return databaseRoles_; + } + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + public int getDatabaseRolesCount() { + return databaseRoles_.size(); + } + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + public java.lang.String getDatabaseRoles(int index) { + return databaseRoles_.get(index); + } + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + public com.google.protobuf.ByteString getDatabaseRolesBytes(int index) { + return databaseRoles_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, password_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, host_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, project_); + } + if (type_ != com.google.cloud.sql.v1beta4.User.SqlUserType.BUILT_IN.getNumber()) { + output.writeEnum(8, type_); + } + if (userDetailsCase_ == 9) { + output.writeMessage(9, (com.google.cloud.sql.v1beta4.SqlServerUserDetails) userDetails_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(iamEmail_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, iamEmail_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(12, getPasswordPolicy()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeEnum(13, dualPasswordType_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeEnum(14, iamStatus_); + } + for (int i = 0; i < databaseRoles_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 15, databaseRoles_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, password_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, host_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instance_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, instance_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, project_); + } + if (type_ != com.google.cloud.sql.v1beta4.User.SqlUserType.BUILT_IN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, type_); + } + if (userDetailsCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.cloud.sql.v1beta4.SqlServerUserDetails) userDetails_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(iamEmail_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, iamEmail_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getPasswordPolicy()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, dualPasswordType_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(14, iamStatus_); + } + { + int dataSize = 0; + for (int i = 0; i < databaseRoles_.size(); i++) { + dataSize += computeStringSizeNoTag(databaseRoles_.getRaw(i)); + } + size += dataSize; + size += 1 * getDatabaseRolesList().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.sql.v1beta4.User)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.User other = (com.google.cloud.sql.v1beta4.User) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getName().equals(other.getName())) return false; + if (!getHost().equals(other.getHost())) return false; + if (!getInstance().equals(other.getInstance())) return false; + if (!getProject().equals(other.getProject())) return false; + if (type_ != other.type_) return false; + if (!getIamEmail().equals(other.getIamEmail())) return false; + if (hasPasswordPolicy() != other.hasPasswordPolicy()) return false; + if (hasPasswordPolicy()) { + if (!getPasswordPolicy().equals(other.getPasswordPolicy())) return false; + } + if (hasDualPasswordType() != other.hasDualPasswordType()) return false; + if (hasDualPasswordType()) { + if (dualPasswordType_ != other.dualPasswordType_) return false; + } + if (hasIamStatus() != other.hasIamStatus()) return false; + if (hasIamStatus()) { + if (iamStatus_ != other.iamStatus_) return false; + } + if (!getDatabaseRolesList().equals(other.getDatabaseRolesList())) return false; + if (!getUserDetailsCase().equals(other.getUserDetailsCase())) return false; + switch (userDetailsCase_) { + case 9: + if (!getSqlserverUserDetails().equals(other.getSqlserverUserDetails())) 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) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + IAM_EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getIamEmail().hashCode(); + if (hasPasswordPolicy()) { + hash = (37 * hash) + PASSWORD_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPasswordPolicy().hashCode(); + } + if (hasDualPasswordType()) { + hash = (37 * hash) + DUAL_PASSWORD_TYPE_FIELD_NUMBER; + hash = (53 * hash) + dualPasswordType_; + } + if (hasIamStatus()) { + hash = (37 * hash) + IAM_STATUS_FIELD_NUMBER; + hash = (53 * hash) + iamStatus_; + } + if (getDatabaseRolesCount() > 0) { + hash = (37 * hash) + DATABASE_ROLES_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseRolesList().hashCode(); + } + switch (userDetailsCase_) { + case 9: + hash = (37 * hash) + SQLSERVER_USER_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getSqlserverUserDetails().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.User parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.User parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.User parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.User parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.User parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.User parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.User parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.User parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.User parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.User parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.User parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.User parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.User prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A Cloud SQL user resource.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.User} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.User) + com.google.cloud.sql.v1beta4.UserOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.User.class, + com.google.cloud.sql.v1beta4.User.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.User.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPasswordPolicyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + password_ = ""; + etag_ = ""; + name_ = ""; + host_ = ""; + instance_ = ""; + project_ = ""; + type_ = 0; + if (sqlserverUserDetailsBuilder_ != null) { + sqlserverUserDetailsBuilder_.clear(); + } + iamEmail_ = ""; + passwordPolicy_ = null; + if (passwordPolicyBuilder_ != null) { + passwordPolicyBuilder_.dispose(); + passwordPolicyBuilder_ = null; + } + dualPasswordType_ = 0; + iamStatus_ = 0; + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + userDetailsCase_ = 0; + userDetails_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_User_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.User getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.User.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.User build() { + com.google.cloud.sql.v1beta4.User result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.User buildPartial() { + com.google.cloud.sql.v1beta4.User result = new com.google.cloud.sql.v1beta4.User(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.User result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.password_ = password_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.host_ = host_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.instance_ = instance_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.iamEmail_ = iamEmail_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000400) != 0)) { + result.passwordPolicy_ = + passwordPolicyBuilder_ == null ? passwordPolicy_ : passwordPolicyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.dualPasswordType_ = dualPasswordType_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.iamStatus_ = iamStatus_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + databaseRoles_.makeImmutable(); + result.databaseRoles_ = databaseRoles_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.sql.v1beta4.User result) { + result.userDetailsCase_ = userDetailsCase_; + result.userDetails_ = this.userDetails_; + if (userDetailsCase_ == 9 && sqlserverUserDetailsBuilder_ != null) { + result.userDetails_ = sqlserverUserDetailsBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.User) { + return mergeFrom((com.google.cloud.sql.v1beta4.User) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.User other) { + if (other == com.google.cloud.sql.v1beta4.User.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getHost().isEmpty()) { + host_ = other.host_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getIamEmail().isEmpty()) { + iamEmail_ = other.iamEmail_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (other.hasPasswordPolicy()) { + mergePasswordPolicy(other.getPasswordPolicy()); + } + if (other.hasDualPasswordType()) { + setDualPasswordTypeValue(other.getDualPasswordTypeValue()); + } + if (other.hasIamStatus()) { + setIamStatusValue(other.getIamStatusValue()); + } + if (!other.databaseRoles_.isEmpty()) { + if (databaseRoles_.isEmpty()) { + databaseRoles_ = other.databaseRoles_; + bitField0_ |= 0x00002000; + } else { + ensureDatabaseRolesIsMutable(); + databaseRoles_.addAll(other.databaseRoles_); + } + onChanged(); + } + switch (other.getUserDetailsCase()) { + case SQLSERVER_USER_DETAILS: + { + mergeSqlserverUserDetails(other.getSqlserverUserDetails()); + break; + } + case USERDETAILS_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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + host_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + instance_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 74: + { + input.readMessage( + internalGetSqlserverUserDetailsFieldBuilder().getBuilder(), extensionRegistry); + userDetailsCase_ = 9; + break; + } // case 74 + case 90: + { + iamEmail_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 90 + case 98: + { + input.readMessage( + internalGetPasswordPolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 98 + case 104: + { + dualPasswordType_ = input.readEnum(); + bitField0_ |= 0x00000800; + break; + } // case 104 + case 112: + { + iamStatus_ = input.readEnum(); + bitField0_ |= 0x00001000; + break; + } // case 112 + case 122: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(s); + break; + } // case 122 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int userDetailsCase_ = 0; + private java.lang.Object userDetails_; + + public UserDetailsCase getUserDetailsCase() { + return UserDetailsCase.forNumber(userDetailsCase_); + } + + public Builder clearUserDetails() { + userDetailsCase_ = 0; + userDetails_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always `sql#user`.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always `sql#user`.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always `sql#user`.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#user`.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always `sql#user`.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + + /** + * + * + *
+     * The password for the user.
+     * 
+ * + * string password = 2; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The password for the user.
+     * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The password for the user.
+     * 
+ * + * string password = 2; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for the user.
+     * 
+ * + * string password = 2; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The password for the user.
+     * 
+ * + * string password = 2; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 3; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 3; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 3; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This field is deprecated and will be removed from a future version of the
+     * API.
+     * 
+ * + * string etag = 3; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the user in the Cloud SQL instance. Can be omitted for
+     * `update` because it is already specified in the URL.
+     * 
+ * + * string name = 4; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the user in the Cloud SQL instance. Can be omitted for
+     * `update` because it is already specified in the URL.
+     * 
+ * + * string name = 4; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the user in the Cloud SQL instance. Can be omitted for
+     * `update` because it is already specified in the URL.
+     * 
+ * + * string name = 4; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the user in the Cloud SQL instance. Can be omitted for
+     * `update` because it is already specified in the URL.
+     * 
+ * + * string name = 4; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the user in the Cloud SQL instance. Can be omitted for
+     * `update` because it is already specified in the URL.
+     * 
+ * + * string name = 4; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object host_ = ""; + + /** + * + * + *
+     * Optional. The host from which the user can connect. For `insert`
+     * operations, host defaults to an empty string. For `update`
+     * operations, host is specified as part of the request URL. The host name
+     * cannot be updated after insertion.  For a MySQL instance, it's required;
+     * for a PostgreSQL or SQL Server instance, it's optional.
+     * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The host. + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The host from which the user can connect. For `insert`
+     * operations, host defaults to an empty string. For `update`
+     * operations, host is specified as part of the request URL. The host name
+     * cannot be updated after insertion.  For a MySQL instance, it's required;
+     * for a PostgreSQL or SQL Server instance, it's optional.
+     * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for host. + */ + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The host from which the user can connect. For `insert`
+     * operations, host defaults to an empty string. For `update`
+     * operations, host is specified as part of the request URL. The host name
+     * cannot be updated after insertion.  For a MySQL instance, it's required;
+     * for a PostgreSQL or SQL Server instance, it's optional.
+     * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The host to set. + * @return This builder for chaining. + */ + public Builder setHost(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + host_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The host from which the user can connect. For `insert`
+     * operations, host defaults to an empty string. For `update`
+     * operations, host is specified as part of the request URL. The host name
+     * cannot be updated after insertion.  For a MySQL instance, it's required;
+     * for a PostgreSQL or SQL Server instance, it's optional.
+     * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearHost() { + host_ = getDefaultInstance().getHost(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The host from which the user can connect. For `insert`
+     * operations, host defaults to an empty string. For `update`
+     * operations, host is specified as part of the request URL. The host name
+     * cannot be updated after insertion.  For a MySQL instance, it's required;
+     * for a PostgreSQL or SQL Server instance, it's optional.
+     * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for host to set. + * @return This builder for chaining. + */ + public Builder setHostBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + host_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * Can be omitted for <b>update</b> because it is already specified on the
+     * URL.
+     * 
+ * + * string instance = 6; + * + * @return The instance. + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * Can be omitted for <b>update</b> because it is already specified on the
+     * URL.
+     * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + public com.google.protobuf.ByteString getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * Can be omitted for <b>update</b> because it is already specified on the
+     * URL.
+     * 
+ * + * string instance = 6; + * + * @param value The instance to set. + * @return This builder for chaining. + */ + public Builder setInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * Can be omitted for <b>update</b> because it is already specified on the
+     * URL.
+     * 
+ * + * string instance = 6; + * + * @return This builder for chaining. + */ + public Builder clearInstance() { + instance_ = getDefaultInstance().getInstance(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the Cloud SQL instance. This does not include the project ID.
+     * Can be omitted for <b>update</b> because it is already specified on the
+     * URL.
+     * 
+ * + * string instance = 6; + * + * @param value The bytes for instance to set. + * @return This builder for chaining. + */ + public Builder setInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instance_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable. Can be omitted for
+     * <b>update</b> because it is already specified on the URL.
+     * 
+ * + * string project = 7; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable. Can be omitted for
+     * <b>update</b> because it is already specified on the URL.
+     * 
+ * + * string project = 7; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable. Can be omitted for
+     * <b>update</b> because it is already specified on the URL.
+     * 
+ * + * string project = 7; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable. Can be omitted for
+     * <b>update</b> because it is already specified on the URL.
+     * 
+ * + * string project = 7; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * The project ID of the project containing the Cloud SQL database. The Google
+     * apps domain is prefixed if applicable. Can be omitted for
+     * <b>update</b> because it is already specified on the URL.
+     * 
+ * + * string project = 7; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private int type_ = 0; + + /** + * + * + *
+     * The user type. It determines the method to authenticate the user during
+     * login. The default is the database's built-in user type.
+     * 
+ * + * .google.cloud.sql.v1beta4.User.SqlUserType type = 8; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * The user type. It determines the method to authenticate the user during
+     * login. The default is the database's built-in user type.
+     * 
+ * + * .google.cloud.sql.v1beta4.User.SqlUserType type = 8; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The user type. It determines the method to authenticate the user during
+     * login. The default is the database's built-in user type.
+     * 
+ * + * .google.cloud.sql.v1beta4.User.SqlUserType type = 8; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.User.SqlUserType getType() { + com.google.cloud.sql.v1beta4.User.SqlUserType result = + com.google.cloud.sql.v1beta4.User.SqlUserType.forNumber(type_); + return result == null ? com.google.cloud.sql.v1beta4.User.SqlUserType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The user type. It determines the method to authenticate the user during
+     * login. The default is the database's built-in user type.
+     * 
+ * + * .google.cloud.sql.v1beta4.User.SqlUserType type = 8; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.sql.v1beta4.User.SqlUserType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The user type. It determines the method to authenticate the user during
+     * login. The default is the database's built-in user type.
+     * 
+ * + * .google.cloud.sql.v1beta4.User.SqlUserType type = 8; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000080); + type_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlServerUserDetails, + com.google.cloud.sql.v1beta4.SqlServerUserDetails.Builder, + com.google.cloud.sql.v1beta4.SqlServerUserDetailsOrBuilder> + sqlserverUserDetailsBuilder_; + + /** + * .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; + * + * @return Whether the sqlserverUserDetails field is set. + */ + @java.lang.Override + public boolean hasSqlserverUserDetails() { + return userDetailsCase_ == 9; + } + + /** + * .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; + * + * @return The sqlserverUserDetails. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerUserDetails getSqlserverUserDetails() { + if (sqlserverUserDetailsBuilder_ == null) { + if (userDetailsCase_ == 9) { + return (com.google.cloud.sql.v1beta4.SqlServerUserDetails) userDetails_; + } + return com.google.cloud.sql.v1beta4.SqlServerUserDetails.getDefaultInstance(); + } else { + if (userDetailsCase_ == 9) { + return sqlserverUserDetailsBuilder_.getMessage(); + } + return com.google.cloud.sql.v1beta4.SqlServerUserDetails.getDefaultInstance(); + } + } + + /** .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; */ + public Builder setSqlserverUserDetails( + com.google.cloud.sql.v1beta4.SqlServerUserDetails value) { + if (sqlserverUserDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userDetails_ = value; + onChanged(); + } else { + sqlserverUserDetailsBuilder_.setMessage(value); + } + userDetailsCase_ = 9; + return this; + } + + /** .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; */ + public Builder setSqlserverUserDetails( + com.google.cloud.sql.v1beta4.SqlServerUserDetails.Builder builderForValue) { + if (sqlserverUserDetailsBuilder_ == null) { + userDetails_ = builderForValue.build(); + onChanged(); + } else { + sqlserverUserDetailsBuilder_.setMessage(builderForValue.build()); + } + userDetailsCase_ = 9; + return this; + } + + /** .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; */ + public Builder mergeSqlserverUserDetails( + com.google.cloud.sql.v1beta4.SqlServerUserDetails value) { + if (sqlserverUserDetailsBuilder_ == null) { + if (userDetailsCase_ == 9 + && userDetails_ + != com.google.cloud.sql.v1beta4.SqlServerUserDetails.getDefaultInstance()) { + userDetails_ = + com.google.cloud.sql.v1beta4.SqlServerUserDetails.newBuilder( + (com.google.cloud.sql.v1beta4.SqlServerUserDetails) userDetails_) + .mergeFrom(value) + .buildPartial(); + } else { + userDetails_ = value; + } + onChanged(); + } else { + if (userDetailsCase_ == 9) { + sqlserverUserDetailsBuilder_.mergeFrom(value); + } else { + sqlserverUserDetailsBuilder_.setMessage(value); + } + } + userDetailsCase_ = 9; + return this; + } + + /** .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; */ + public Builder clearSqlserverUserDetails() { + if (sqlserverUserDetailsBuilder_ == null) { + if (userDetailsCase_ == 9) { + userDetailsCase_ = 0; + userDetails_ = null; + onChanged(); + } + } else { + if (userDetailsCase_ == 9) { + userDetailsCase_ = 0; + userDetails_ = null; + } + sqlserverUserDetailsBuilder_.clear(); + } + return this; + } + + /** .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; */ + public com.google.cloud.sql.v1beta4.SqlServerUserDetails.Builder + getSqlserverUserDetailsBuilder() { + return internalGetSqlserverUserDetailsFieldBuilder().getBuilder(); + } + + /** .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.SqlServerUserDetailsOrBuilder + getSqlserverUserDetailsOrBuilder() { + if ((userDetailsCase_ == 9) && (sqlserverUserDetailsBuilder_ != null)) { + return sqlserverUserDetailsBuilder_.getMessageOrBuilder(); + } else { + if (userDetailsCase_ == 9) { + return (com.google.cloud.sql.v1beta4.SqlServerUserDetails) userDetails_; + } + return com.google.cloud.sql.v1beta4.SqlServerUserDetails.getDefaultInstance(); + } + } + + /** .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlServerUserDetails, + com.google.cloud.sql.v1beta4.SqlServerUserDetails.Builder, + com.google.cloud.sql.v1beta4.SqlServerUserDetailsOrBuilder> + internalGetSqlserverUserDetailsFieldBuilder() { + if (sqlserverUserDetailsBuilder_ == null) { + if (!(userDetailsCase_ == 9)) { + userDetails_ = com.google.cloud.sql.v1beta4.SqlServerUserDetails.getDefaultInstance(); + } + sqlserverUserDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.SqlServerUserDetails, + com.google.cloud.sql.v1beta4.SqlServerUserDetails.Builder, + com.google.cloud.sql.v1beta4.SqlServerUserDetailsOrBuilder>( + (com.google.cloud.sql.v1beta4.SqlServerUserDetails) userDetails_, + getParentForChildren(), + isClean()); + userDetails_ = null; + } + userDetailsCase_ = 9; + onChanged(); + return sqlserverUserDetailsBuilder_; + } + + private java.lang.Object iamEmail_ = ""; + + /** + * + * + *
+     * Optional. The full email for an IAM user. For normal database users, this
+     * will not be filled. Only applicable to MySQL database users.
+     * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The iamEmail. + */ + public java.lang.String getIamEmail() { + java.lang.Object ref = iamEmail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + iamEmail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The full email for an IAM user. For normal database users, this
+     * will not be filled. Only applicable to MySQL database users.
+     * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for iamEmail. + */ + public com.google.protobuf.ByteString getIamEmailBytes() { + java.lang.Object ref = iamEmail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + iamEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The full email for an IAM user. For normal database users, this
+     * will not be filled. Only applicable to MySQL database users.
+     * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The iamEmail to set. + * @return This builder for chaining. + */ + public Builder setIamEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + iamEmail_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The full email for an IAM user. For normal database users, this
+     * will not be filled. Only applicable to MySQL database users.
+     * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearIamEmail() { + iamEmail_ = getDefaultInstance().getIamEmail(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The full email for an IAM user. For normal database users, this
+     * will not be filled. Only applicable to MySQL database users.
+     * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for iamEmail to set. + * @return This builder for chaining. + */ + public Builder setIamEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + iamEmail_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy passwordPolicy_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy, + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.Builder, + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicyOrBuilder> + passwordPolicyBuilder_; + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + * + * @return Whether the passwordPolicy field is set. + */ + public boolean hasPasswordPolicy() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + * + * @return The passwordPolicy. + */ + public com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy getPasswordPolicy() { + if (passwordPolicyBuilder_ == null) { + return passwordPolicy_ == null + ? com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.getDefaultInstance() + : passwordPolicy_; + } else { + return passwordPolicyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + */ + public Builder setPasswordPolicy( + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy value) { + if (passwordPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + passwordPolicy_ = value; + } else { + passwordPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + */ + public Builder setPasswordPolicy( + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.Builder builderForValue) { + if (passwordPolicyBuilder_ == null) { + passwordPolicy_ = builderForValue.build(); + } else { + passwordPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + */ + public Builder mergePasswordPolicy( + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy value) { + if (passwordPolicyBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && passwordPolicy_ != null + && passwordPolicy_ + != com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.getDefaultInstance()) { + getPasswordPolicyBuilder().mergeFrom(value); + } else { + passwordPolicy_ = value; + } + } else { + passwordPolicyBuilder_.mergeFrom(value); + } + if (passwordPolicy_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + */ + public Builder clearPasswordPolicy() { + bitField0_ = (bitField0_ & ~0x00000400); + passwordPolicy_ = null; + if (passwordPolicyBuilder_ != null) { + passwordPolicyBuilder_.dispose(); + passwordPolicyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + */ + public com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.Builder + getPasswordPolicyBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return internalGetPasswordPolicyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + */ + public com.google.cloud.sql.v1beta4.UserPasswordValidationPolicyOrBuilder + getPasswordPolicyOrBuilder() { + if (passwordPolicyBuilder_ != null) { + return passwordPolicyBuilder_.getMessageOrBuilder(); + } else { + return passwordPolicy_ == null + ? com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.getDefaultInstance() + : passwordPolicy_; + } + } + + /** + * + * + *
+     * User level password validation policy.
+     * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy, + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.Builder, + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicyOrBuilder> + internalGetPasswordPolicyFieldBuilder() { + if (passwordPolicyBuilder_ == null) { + passwordPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy, + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.Builder, + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicyOrBuilder>( + getPasswordPolicy(), getParentForChildren(), isClean()); + passwordPolicy_ = null; + } + return passwordPolicyBuilder_; + } + + private int dualPasswordType_ = 0; + + /** + * + * + *
+     * Dual password status for the user.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.User.DualPasswordType dual_password_type = 13; + * + * + * @return Whether the dualPasswordType field is set. + */ + @java.lang.Override + public boolean hasDualPasswordType() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Dual password status for the user.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.User.DualPasswordType dual_password_type = 13; + * + * + * @return The enum numeric value on the wire for dualPasswordType. + */ + @java.lang.Override + public int getDualPasswordTypeValue() { + return dualPasswordType_; + } + + /** + * + * + *
+     * Dual password status for the user.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.User.DualPasswordType dual_password_type = 13; + * + * + * @param value The enum numeric value on the wire for dualPasswordType to set. + * @return This builder for chaining. + */ + public Builder setDualPasswordTypeValue(int value) { + dualPasswordType_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Dual password status for the user.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.User.DualPasswordType dual_password_type = 13; + * + * + * @return The dualPasswordType. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.User.DualPasswordType getDualPasswordType() { + com.google.cloud.sql.v1beta4.User.DualPasswordType result = + com.google.cloud.sql.v1beta4.User.DualPasswordType.forNumber(dualPasswordType_); + return result == null + ? com.google.cloud.sql.v1beta4.User.DualPasswordType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Dual password status for the user.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.User.DualPasswordType dual_password_type = 13; + * + * + * @param value The dualPasswordType to set. + * @return This builder for chaining. + */ + public Builder setDualPasswordType(com.google.cloud.sql.v1beta4.User.DualPasswordType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000800; + dualPasswordType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Dual password status for the user.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.User.DualPasswordType dual_password_type = 13; + * + * + * @return This builder for chaining. + */ + public Builder clearDualPasswordType() { + bitField0_ = (bitField0_ & ~0x00000800); + dualPasswordType_ = 0; + onChanged(); + return this; + } + + private int iamStatus_ = 0; + + /** + * + * + *
+     * Indicates if a group is active or inactive for IAM database authentication.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.User.IamStatus iam_status = 14; + * + * @return Whether the iamStatus field is set. + */ + @java.lang.Override + public boolean hasIamStatus() { + return ((bitField0_ & 0x00001000) != 0); + } + + /** + * + * + *
+     * Indicates if a group is active or inactive for IAM database authentication.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.User.IamStatus iam_status = 14; + * + * @return The enum numeric value on the wire for iamStatus. + */ + @java.lang.Override + public int getIamStatusValue() { + return iamStatus_; + } + + /** + * + * + *
+     * Indicates if a group is active or inactive for IAM database authentication.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.User.IamStatus iam_status = 14; + * + * @param value The enum numeric value on the wire for iamStatus to set. + * @return This builder for chaining. + */ + public Builder setIamStatusValue(int value) { + iamStatus_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates if a group is active or inactive for IAM database authentication.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.User.IamStatus iam_status = 14; + * + * @return The iamStatus. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.User.IamStatus getIamStatus() { + com.google.cloud.sql.v1beta4.User.IamStatus result = + com.google.cloud.sql.v1beta4.User.IamStatus.forNumber(iamStatus_); + return result == null ? com.google.cloud.sql.v1beta4.User.IamStatus.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Indicates if a group is active or inactive for IAM database authentication.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.User.IamStatus iam_status = 14; + * + * @param value The iamStatus to set. + * @return This builder for chaining. + */ + public Builder setIamStatus(com.google.cloud.sql.v1beta4.User.IamStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00001000; + iamStatus_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates if a group is active or inactive for IAM database authentication.
+     * 
+ * + * optional .google.cloud.sql.v1beta4.User.IamStatus iam_status = 14; + * + * @return This builder for chaining. + */ + public Builder clearIamStatus() { + bitField0_ = (bitField0_ & ~0x00001000); + iamStatus_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList databaseRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDatabaseRolesIsMutable() { + if (!databaseRoles_.isModifiable()) { + databaseRoles_ = new com.google.protobuf.LazyStringArrayList(databaseRoles_); + } + bitField0_ |= 0x00002000; + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + public com.google.protobuf.ProtocolStringList getDatabaseRolesList() { + databaseRoles_.makeImmutable(); + return databaseRoles_; + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + public int getDatabaseRolesCount() { + return databaseRoles_.size(); + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + public java.lang.String getDatabaseRoles(int index) { + return databaseRoles_.get(index); + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + public com.google.protobuf.ByteString getDatabaseRolesBytes(int index) { + return databaseRoles_.getByteString(index); + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The databaseRoles to set. + * @return This builder for chaining. + */ + public Builder setDatabaseRoles(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseRolesIsMutable(); + databaseRoles_.set(index, value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addDatabaseRoles(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addAllDatabaseRoles(java.lang.Iterable values) { + ensureDatabaseRolesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, databaseRoles_); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseRoles() { + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Role memberships of the user
+     * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addDatabaseRolesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.User) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.User) + private static final com.google.cloud.sql.v1beta4.User DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.User(); + } + + public static com.google.cloud.sql.v1beta4.User getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public User parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.User getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UserOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UserOrBuilder.java new file mode 100644 index 000000000000..eb478f6f7926 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UserOrBuilder.java @@ -0,0 +1,474 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface UserOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.User) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always `sql#user`.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always `sql#user`.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * The password for the user.
+   * 
+ * + * string password = 2; + * + * @return The password. + */ + java.lang.String getPassword(); + + /** + * + * + *
+   * The password for the user.
+   * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * This field is deprecated and will be removed from a future version of the
+   * API.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * The name of the user in the Cloud SQL instance. Can be omitted for
+   * `update` because it is already specified in the URL.
+   * 
+ * + * string name = 4; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the user in the Cloud SQL instance. Can be omitted for
+   * `update` because it is already specified in the URL.
+   * 
+ * + * string name = 4; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The host from which the user can connect. For `insert`
+   * operations, host defaults to an empty string. For `update`
+   * operations, host is specified as part of the request URL. The host name
+   * cannot be updated after insertion.  For a MySQL instance, it's required;
+   * for a PostgreSQL or SQL Server instance, it's optional.
+   * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The host. + */ + java.lang.String getHost(); + + /** + * + * + *
+   * Optional. The host from which the user can connect. For `insert`
+   * operations, host defaults to an empty string. For `update`
+   * operations, host is specified as part of the request URL. The host name
+   * cannot be updated after insertion.  For a MySQL instance, it's required;
+   * for a PostgreSQL or SQL Server instance, it's optional.
+   * 
+ * + * string host = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for host. + */ + com.google.protobuf.ByteString getHostBytes(); + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * Can be omitted for <b>update</b> because it is already specified on the
+   * URL.
+   * 
+ * + * string instance = 6; + * + * @return The instance. + */ + java.lang.String getInstance(); + + /** + * + * + *
+   * The name of the Cloud SQL instance. This does not include the project ID.
+   * Can be omitted for <b>update</b> because it is already specified on the
+   * URL.
+   * 
+ * + * string instance = 6; + * + * @return The bytes for instance. + */ + com.google.protobuf.ByteString getInstanceBytes(); + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable. Can be omitted for
+   * <b>update</b> because it is already specified on the URL.
+   * 
+ * + * string project = 7; + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * The project ID of the project containing the Cloud SQL database. The Google
+   * apps domain is prefixed if applicable. Can be omitted for
+   * <b>update</b> because it is already specified on the URL.
+   * 
+ * + * string project = 7; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * The user type. It determines the method to authenticate the user during
+   * login. The default is the database's built-in user type.
+   * 
+ * + * .google.cloud.sql.v1beta4.User.SqlUserType type = 8; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * The user type. It determines the method to authenticate the user during
+   * login. The default is the database's built-in user type.
+   * 
+ * + * .google.cloud.sql.v1beta4.User.SqlUserType type = 8; + * + * @return The type. + */ + com.google.cloud.sql.v1beta4.User.SqlUserType getType(); + + /** + * .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; + * + * @return Whether the sqlserverUserDetails field is set. + */ + boolean hasSqlserverUserDetails(); + + /** + * .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; + * + * @return The sqlserverUserDetails. + */ + com.google.cloud.sql.v1beta4.SqlServerUserDetails getSqlserverUserDetails(); + + /** .google.cloud.sql.v1beta4.SqlServerUserDetails sqlserver_user_details = 9; */ + com.google.cloud.sql.v1beta4.SqlServerUserDetailsOrBuilder getSqlserverUserDetailsOrBuilder(); + + /** + * + * + *
+   * Optional. The full email for an IAM user. For normal database users, this
+   * will not be filled. Only applicable to MySQL database users.
+   * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The iamEmail. + */ + java.lang.String getIamEmail(); + + /** + * + * + *
+   * Optional. The full email for an IAM user. For normal database users, this
+   * will not be filled. Only applicable to MySQL database users.
+   * 
+ * + * string iam_email = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for iamEmail. + */ + com.google.protobuf.ByteString getIamEmailBytes(); + + /** + * + * + *
+   * User level password validation policy.
+   * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + * + * @return Whether the passwordPolicy field is set. + */ + boolean hasPasswordPolicy(); + + /** + * + * + *
+   * User level password validation policy.
+   * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + * + * @return The passwordPolicy. + */ + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy getPasswordPolicy(); + + /** + * + * + *
+   * User level password validation policy.
+   * 
+ * + * .google.cloud.sql.v1beta4.UserPasswordValidationPolicy password_policy = 12; + */ + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicyOrBuilder getPasswordPolicyOrBuilder(); + + /** + * + * + *
+   * Dual password status for the user.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.User.DualPasswordType dual_password_type = 13; + * + * @return Whether the dualPasswordType field is set. + */ + boolean hasDualPasswordType(); + + /** + * + * + *
+   * Dual password status for the user.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.User.DualPasswordType dual_password_type = 13; + * + * @return The enum numeric value on the wire for dualPasswordType. + */ + int getDualPasswordTypeValue(); + + /** + * + * + *
+   * Dual password status for the user.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.User.DualPasswordType dual_password_type = 13; + * + * @return The dualPasswordType. + */ + com.google.cloud.sql.v1beta4.User.DualPasswordType getDualPasswordType(); + + /** + * + * + *
+   * Indicates if a group is active or inactive for IAM database authentication.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.User.IamStatus iam_status = 14; + * + * @return Whether the iamStatus field is set. + */ + boolean hasIamStatus(); + + /** + * + * + *
+   * Indicates if a group is active or inactive for IAM database authentication.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.User.IamStatus iam_status = 14; + * + * @return The enum numeric value on the wire for iamStatus. + */ + int getIamStatusValue(); + + /** + * + * + *
+   * Indicates if a group is active or inactive for IAM database authentication.
+   * 
+ * + * optional .google.cloud.sql.v1beta4.User.IamStatus iam_status = 14; + * + * @return The iamStatus. + */ + com.google.cloud.sql.v1beta4.User.IamStatus getIamStatus(); + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + java.util.List getDatabaseRolesList(); + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + int getDatabaseRolesCount(); + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + java.lang.String getDatabaseRoles(int index); + + /** + * + * + *
+   * Optional. Role memberships of the user
+   * 
+ * + * repeated string database_roles = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + com.google.protobuf.ByteString getDatabaseRolesBytes(int index); + + com.google.cloud.sql.v1beta4.User.UserDetailsCase getUserDetailsCase(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UserPasswordValidationPolicy.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UserPasswordValidationPolicy.java new file mode 100644 index 000000000000..4f034ea36116 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UserPasswordValidationPolicy.java @@ -0,0 +1,1306 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * User level password validation policy.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.UserPasswordValidationPolicy} + */ +@com.google.protobuf.Generated +public final class UserPasswordValidationPolicy extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.UserPasswordValidationPolicy) + UserPasswordValidationPolicyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UserPasswordValidationPolicy"); + } + + // Use UserPasswordValidationPolicy.newBuilder() to construct. + private UserPasswordValidationPolicy(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UserPasswordValidationPolicy() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_UserPasswordValidationPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_UserPasswordValidationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.class, + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.Builder.class); + } + + private int bitField0_; + public static final int ALLOWED_FAILED_ATTEMPTS_FIELD_NUMBER = 1; + private int allowedFailedAttempts_ = 0; + + /** + * + * + *
+   * Number of failed login attempts allowed before user get locked.
+   * 
+ * + * int32 allowed_failed_attempts = 1; + * + * @return The allowedFailedAttempts. + */ + @java.lang.Override + public int getAllowedFailedAttempts() { + return allowedFailedAttempts_; + } + + public static final int PASSWORD_EXPIRATION_DURATION_FIELD_NUMBER = 2; + private com.google.protobuf.Duration passwordExpirationDuration_; + + /** + * + * + *
+   * Expiration duration after password is updated.
+   * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + * + * @return Whether the passwordExpirationDuration field is set. + */ + @java.lang.Override + public boolean hasPasswordExpirationDuration() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Expiration duration after password is updated.
+   * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + * + * @return The passwordExpirationDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getPasswordExpirationDuration() { + return passwordExpirationDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordExpirationDuration_; + } + + /** + * + * + *
+   * Expiration duration after password is updated.
+   * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getPasswordExpirationDurationOrBuilder() { + return passwordExpirationDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordExpirationDuration_; + } + + public static final int ENABLE_FAILED_ATTEMPTS_CHECK_FIELD_NUMBER = 3; + private boolean enableFailedAttemptsCheck_ = false; + + /** + * + * + *
+   * If true, failed login attempts check will be enabled.
+   * 
+ * + * bool enable_failed_attempts_check = 3; + * + * @return The enableFailedAttemptsCheck. + */ + @java.lang.Override + public boolean getEnableFailedAttemptsCheck() { + return enableFailedAttemptsCheck_; + } + + public static final int STATUS_FIELD_NUMBER = 4; + private com.google.cloud.sql.v1beta4.PasswordStatus status_; + + /** + * + * + *
+   * Output only. Read-only password status.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. Read-only password status.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The status. + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PasswordStatus getStatus() { + return status_ == null + ? com.google.cloud.sql.v1beta4.PasswordStatus.getDefaultInstance() + : status_; + } + + /** + * + * + *
+   * Output only. Read-only password status.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.PasswordStatusOrBuilder getStatusOrBuilder() { + return status_ == null + ? com.google.cloud.sql.v1beta4.PasswordStatus.getDefaultInstance() + : status_; + } + + public static final int ENABLE_PASSWORD_VERIFICATION_FIELD_NUMBER = 5; + private boolean enablePasswordVerification_ = false; + + /** + * + * + *
+   * If true, the user must specify the current password before changing the
+   * password. This flag is supported only for MySQL.
+   * 
+ * + * bool enable_password_verification = 5; + * + * @return The enablePasswordVerification. + */ + @java.lang.Override + public boolean getEnablePasswordVerification() { + return enablePasswordVerification_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (allowedFailedAttempts_ != 0) { + output.writeInt32(1, allowedFailedAttempts_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getPasswordExpirationDuration()); + } + if (enableFailedAttemptsCheck_ != false) { + output.writeBool(3, enableFailedAttemptsCheck_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getStatus()); + } + if (enablePasswordVerification_ != false) { + output.writeBool(5, enablePasswordVerification_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (allowedFailedAttempts_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, allowedFailedAttempts_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getPasswordExpirationDuration()); + } + if (enableFailedAttemptsCheck_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, enableFailedAttemptsCheck_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStatus()); + } + if (enablePasswordVerification_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, enablePasswordVerification_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy other = + (com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy) obj; + + if (getAllowedFailedAttempts() != other.getAllowedFailedAttempts()) return false; + if (hasPasswordExpirationDuration() != other.hasPasswordExpirationDuration()) return false; + if (hasPasswordExpirationDuration()) { + if (!getPasswordExpirationDuration().equals(other.getPasswordExpirationDuration())) + return false; + } + if (getEnableFailedAttemptsCheck() != other.getEnableFailedAttemptsCheck()) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (getEnablePasswordVerification() != other.getEnablePasswordVerification()) return false; + if (!getUnknownFields().equals(other.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) + ALLOWED_FAILED_ATTEMPTS_FIELD_NUMBER; + hash = (53 * hash) + getAllowedFailedAttempts(); + if (hasPasswordExpirationDuration()) { + hash = (37 * hash) + PASSWORD_EXPIRATION_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getPasswordExpirationDuration().hashCode(); + } + hash = (37 * hash) + ENABLE_FAILED_ATTEMPTS_CHECK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableFailedAttemptsCheck()); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (37 * hash) + ENABLE_PASSWORD_VERIFICATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnablePasswordVerification()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * User level password validation policy.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.UserPasswordValidationPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.UserPasswordValidationPolicy) + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_UserPasswordValidationPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_UserPasswordValidationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.class, + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPasswordExpirationDurationFieldBuilder(); + internalGetStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + allowedFailedAttempts_ = 0; + passwordExpirationDuration_ = null; + if (passwordExpirationDurationBuilder_ != null) { + passwordExpirationDurationBuilder_.dispose(); + passwordExpirationDurationBuilder_ = null; + } + enableFailedAttemptsCheck_ = false; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + enablePasswordVerification_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_UserPasswordValidationPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy build() { + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy buildPartial() { + com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy result = + new com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.allowedFailedAttempts_ = allowedFailedAttempts_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.passwordExpirationDuration_ = + passwordExpirationDurationBuilder_ == null + ? passwordExpirationDuration_ + : passwordExpirationDurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.enableFailedAttemptsCheck_ = enableFailedAttemptsCheck_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.enablePasswordVerification_ = enablePasswordVerification_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy) { + return mergeFrom((com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy other) { + if (other == com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.getDefaultInstance()) + return this; + if (other.getAllowedFailedAttempts() != 0) { + setAllowedFailedAttempts(other.getAllowedFailedAttempts()); + } + if (other.hasPasswordExpirationDuration()) { + mergePasswordExpirationDuration(other.getPasswordExpirationDuration()); + } + if (other.getEnableFailedAttemptsCheck() != false) { + setEnableFailedAttemptsCheck(other.getEnableFailedAttemptsCheck()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.getEnablePasswordVerification() != false) { + setEnablePasswordVerification(other.getEnablePasswordVerification()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + allowedFailedAttempts_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetPasswordExpirationDurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + enableFailedAttemptsCheck_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage(internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + enablePasswordVerification_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int allowedFailedAttempts_; + + /** + * + * + *
+     * Number of failed login attempts allowed before user get locked.
+     * 
+ * + * int32 allowed_failed_attempts = 1; + * + * @return The allowedFailedAttempts. + */ + @java.lang.Override + public int getAllowedFailedAttempts() { + return allowedFailedAttempts_; + } + + /** + * + * + *
+     * Number of failed login attempts allowed before user get locked.
+     * 
+ * + * int32 allowed_failed_attempts = 1; + * + * @param value The allowedFailedAttempts to set. + * @return This builder for chaining. + */ + public Builder setAllowedFailedAttempts(int value) { + + allowedFailedAttempts_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of failed login attempts allowed before user get locked.
+     * 
+ * + * int32 allowed_failed_attempts = 1; + * + * @return This builder for chaining. + */ + public Builder clearAllowedFailedAttempts() { + bitField0_ = (bitField0_ & ~0x00000001); + allowedFailedAttempts_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Duration passwordExpirationDuration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + passwordExpirationDurationBuilder_; + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + * + * @return Whether the passwordExpirationDuration field is set. + */ + public boolean hasPasswordExpirationDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + * + * @return The passwordExpirationDuration. + */ + public com.google.protobuf.Duration getPasswordExpirationDuration() { + if (passwordExpirationDurationBuilder_ == null) { + return passwordExpirationDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordExpirationDuration_; + } else { + return passwordExpirationDurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + public Builder setPasswordExpirationDuration(com.google.protobuf.Duration value) { + if (passwordExpirationDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + passwordExpirationDuration_ = value; + } else { + passwordExpirationDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + public Builder setPasswordExpirationDuration( + com.google.protobuf.Duration.Builder builderForValue) { + if (passwordExpirationDurationBuilder_ == null) { + passwordExpirationDuration_ = builderForValue.build(); + } else { + passwordExpirationDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + public Builder mergePasswordExpirationDuration(com.google.protobuf.Duration value) { + if (passwordExpirationDurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && passwordExpirationDuration_ != null + && passwordExpirationDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getPasswordExpirationDurationBuilder().mergeFrom(value); + } else { + passwordExpirationDuration_ = value; + } + } else { + passwordExpirationDurationBuilder_.mergeFrom(value); + } + if (passwordExpirationDuration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + public Builder clearPasswordExpirationDuration() { + bitField0_ = (bitField0_ & ~0x00000002); + passwordExpirationDuration_ = null; + if (passwordExpirationDurationBuilder_ != null) { + passwordExpirationDurationBuilder_.dispose(); + passwordExpirationDurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + public com.google.protobuf.Duration.Builder getPasswordExpirationDurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetPasswordExpirationDurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + public com.google.protobuf.DurationOrBuilder getPasswordExpirationDurationOrBuilder() { + if (passwordExpirationDurationBuilder_ != null) { + return passwordExpirationDurationBuilder_.getMessageOrBuilder(); + } else { + return passwordExpirationDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : passwordExpirationDuration_; + } + } + + /** + * + * + *
+     * Expiration duration after password is updated.
+     * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetPasswordExpirationDurationFieldBuilder() { + if (passwordExpirationDurationBuilder_ == null) { + passwordExpirationDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getPasswordExpirationDuration(), getParentForChildren(), isClean()); + passwordExpirationDuration_ = null; + } + return passwordExpirationDurationBuilder_; + } + + private boolean enableFailedAttemptsCheck_; + + /** + * + * + *
+     * If true, failed login attempts check will be enabled.
+     * 
+ * + * bool enable_failed_attempts_check = 3; + * + * @return The enableFailedAttemptsCheck. + */ + @java.lang.Override + public boolean getEnableFailedAttemptsCheck() { + return enableFailedAttemptsCheck_; + } + + /** + * + * + *
+     * If true, failed login attempts check will be enabled.
+     * 
+ * + * bool enable_failed_attempts_check = 3; + * + * @param value The enableFailedAttemptsCheck to set. + * @return This builder for chaining. + */ + public Builder setEnableFailedAttemptsCheck(boolean value) { + + enableFailedAttemptsCheck_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If true, failed login attempts check will be enabled.
+     * 
+ * + * bool enable_failed_attempts_check = 3; + * + * @return This builder for chaining. + */ + public Builder clearEnableFailedAttemptsCheck() { + bitField0_ = (bitField0_ & ~0x00000004); + enableFailedAttemptsCheck_ = false; + onChanged(); + return this; + } + + private com.google.cloud.sql.v1beta4.PasswordStatus status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PasswordStatus, + com.google.cloud.sql.v1beta4.PasswordStatus.Builder, + com.google.cloud.sql.v1beta4.PasswordStatusOrBuilder> + statusBuilder_; + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The status. + */ + public com.google.cloud.sql.v1beta4.PasswordStatus getStatus() { + if (statusBuilder_ == null) { + return status_ == null + ? com.google.cloud.sql.v1beta4.PasswordStatus.getDefaultInstance() + : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStatus(com.google.cloud.sql.v1beta4.PasswordStatus value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStatus(com.google.cloud.sql.v1beta4.PasswordStatus.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStatus(com.google.cloud.sql.v1beta4.PasswordStatus value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && status_ != null + && status_ != com.google.cloud.sql.v1beta4.PasswordStatus.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000008); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.PasswordStatus.Builder getStatusBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.sql.v1beta4.PasswordStatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null + ? com.google.cloud.sql.v1beta4.PasswordStatus.getDefaultInstance() + : status_; + } + } + + /** + * + * + *
+     * Output only. Read-only password status.
+     * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PasswordStatus, + com.google.cloud.sql.v1beta4.PasswordStatus.Builder, + com.google.cloud.sql.v1beta4.PasswordStatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.sql.v1beta4.PasswordStatus, + com.google.cloud.sql.v1beta4.PasswordStatus.Builder, + com.google.cloud.sql.v1beta4.PasswordStatusOrBuilder>( + getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private boolean enablePasswordVerification_; + + /** + * + * + *
+     * If true, the user must specify the current password before changing the
+     * password. This flag is supported only for MySQL.
+     * 
+ * + * bool enable_password_verification = 5; + * + * @return The enablePasswordVerification. + */ + @java.lang.Override + public boolean getEnablePasswordVerification() { + return enablePasswordVerification_; + } + + /** + * + * + *
+     * If true, the user must specify the current password before changing the
+     * password. This flag is supported only for MySQL.
+     * 
+ * + * bool enable_password_verification = 5; + * + * @param value The enablePasswordVerification to set. + * @return This builder for chaining. + */ + public Builder setEnablePasswordVerification(boolean value) { + + enablePasswordVerification_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * If true, the user must specify the current password before changing the
+     * password. This flag is supported only for MySQL.
+     * 
+ * + * bool enable_password_verification = 5; + * + * @return This builder for chaining. + */ + public Builder clearEnablePasswordVerification() { + bitField0_ = (bitField0_ & ~0x00000010); + enablePasswordVerification_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.UserPasswordValidationPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.UserPasswordValidationPolicy) + private static final com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy(); + } + + public static com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserPasswordValidationPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.UserPasswordValidationPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UserPasswordValidationPolicyOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UserPasswordValidationPolicyOrBuilder.java new file mode 100644 index 000000000000..0cb289817565 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UserPasswordValidationPolicyOrBuilder.java @@ -0,0 +1,148 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface UserPasswordValidationPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.UserPasswordValidationPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Number of failed login attempts allowed before user get locked.
+   * 
+ * + * int32 allowed_failed_attempts = 1; + * + * @return The allowedFailedAttempts. + */ + int getAllowedFailedAttempts(); + + /** + * + * + *
+   * Expiration duration after password is updated.
+   * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + * + * @return Whether the passwordExpirationDuration field is set. + */ + boolean hasPasswordExpirationDuration(); + + /** + * + * + *
+   * Expiration duration after password is updated.
+   * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + * + * @return The passwordExpirationDuration. + */ + com.google.protobuf.Duration getPasswordExpirationDuration(); + + /** + * + * + *
+   * Expiration duration after password is updated.
+   * 
+ * + * .google.protobuf.Duration password_expiration_duration = 2; + */ + com.google.protobuf.DurationOrBuilder getPasswordExpirationDurationOrBuilder(); + + /** + * + * + *
+   * If true, failed login attempts check will be enabled.
+   * 
+ * + * bool enable_failed_attempts_check = 3; + * + * @return The enableFailedAttemptsCheck. + */ + boolean getEnableFailedAttemptsCheck(); + + /** + * + * + *
+   * Output only. Read-only password status.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+   * Output only. Read-only password status.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The status. + */ + com.google.cloud.sql.v1beta4.PasswordStatus getStatus(); + + /** + * + * + *
+   * Output only. Read-only password status.
+   * 
+ * + * + * .google.cloud.sql.v1beta4.PasswordStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.sql.v1beta4.PasswordStatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
+   * If true, the user must specify the current password before changing the
+   * password. This flag is supported only for MySQL.
+   * 
+ * + * bool enable_password_verification = 5; + * + * @return The enablePasswordVerification. + */ + boolean getEnablePasswordVerification(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UsersListResponse.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UsersListResponse.java new file mode 100644 index 000000000000..37436aa346a9 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UsersListResponse.java @@ -0,0 +1,1316 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * User list response.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.UsersListResponse} + */ +@com.google.protobuf.Generated +public final class UsersListResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.UsersListResponse) + UsersListResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UsersListResponse"); + } + + // Use UsersListResponse.newBuilder() to construct. + private UsersListResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UsersListResponse() { + kind_ = ""; + items_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_UsersListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_UsersListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.UsersListResponse.class, + com.google.cloud.sql.v1beta4.UsersListResponse.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + + /** + * + * + *
+   * This is always <b>sql#usersList</b>.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + + /** + * + * + *
+   * This is always <b>sql#usersList</b>.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List items_; + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.User getItems(int index) { + return items_.get(index); + } + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + @java.lang.Override + public com.google.cloud.sql.v1beta4.UserOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * Unused.
+   * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_users.proto;l=313 + * @return The nextPageToken. + */ + @java.lang.Override + @java.lang.Deprecated + 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; + } + } + + /** + * + * + *
+   * Unused.
+   * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_users.proto;l=313 + * @return The bytes for nextPageToken. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.UsersListResponse)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.UsersListResponse other = + (com.google.cloud.sql.v1beta4.UsersListResponse) obj; + + if (!getKind().equals(other.getKind())) return false; + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.UsersListResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.UsersListResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UsersListResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.UsersListResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UsersListResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.UsersListResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UsersListResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.UsersListResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UsersListResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.UsersListResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.UsersListResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.UsersListResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.UsersListResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * User list response.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.UsersListResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.UsersListResponse) + com.google.cloud.sql.v1beta4.UsersListResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_UsersListResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_UsersListResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.UsersListResponse.class, + com.google.cloud.sql.v1beta4.UsersListResponse.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.UsersListResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kind_ = ""; + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlUsersProto + .internal_static_google_cloud_sql_v1beta4_UsersListResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.UsersListResponse getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.UsersListResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.UsersListResponse build() { + com.google.cloud.sql.v1beta4.UsersListResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.UsersListResponse buildPartial() { + com.google.cloud.sql.v1beta4.UsersListResponse result = + new com.google.cloud.sql.v1beta4.UsersListResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.sql.v1beta4.UsersListResponse result) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.UsersListResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.UsersListResponse) { + return mergeFrom((com.google.cloud.sql.v1beta4.UsersListResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.UsersListResponse other) { + if (other == com.google.cloud.sql.v1beta4.UsersListResponse.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + 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: + { + kind_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.sql.v1beta4.User m = + input.readMessage( + com.google.cloud.sql.v1beta4.User.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kind_ = ""; + + /** + * + * + *
+     * This is always <b>sql#usersList</b>.
+     * 
+ * + * string kind = 1; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * This is always <b>sql#usersList</b>.
+     * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * This is always <b>sql#usersList</b>.
+     * 
+ * + * string kind = 1; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always <b>sql#usersList</b>.
+     * 
+ * + * string kind = 1; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * This is always <b>sql#usersList</b>.
+     * 
+ * + * string kind = 1; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kind_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.User, + com.google.cloud.sql.v1beta4.User.Builder, + com.google.cloud.sql.v1beta4.UserOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public com.google.cloud.sql.v1beta4.User getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1beta4.User value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public Builder setItems(int index, com.google.cloud.sql.v1beta4.User.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.User value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1beta4.User value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public Builder addItems(com.google.cloud.sql.v1beta4.User.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public Builder addItems(int index, com.google.cloud.sql.v1beta4.User.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public com.google.cloud.sql.v1beta4.User.Builder getItemsBuilder(int index) { + return internalGetItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public com.google.cloud.sql.v1beta4.UserOrBuilder getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public com.google.cloud.sql.v1beta4.User.Builder addItemsBuilder() { + return internalGetItemsFieldBuilder() + .addBuilder(com.google.cloud.sql.v1beta4.User.getDefaultInstance()); + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public com.google.cloud.sql.v1beta4.User.Builder addItemsBuilder(int index) { + return internalGetItemsFieldBuilder() + .addBuilder(index, com.google.cloud.sql.v1beta4.User.getDefaultInstance()); + } + + /** + * + * + *
+     * List of user resources in the instance.
+     * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + public java.util.List getItemsBuilderList() { + return internalGetItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.User, + com.google.cloud.sql.v1beta4.User.Builder, + com.google.cloud.sql.v1beta4.UserOrBuilder> + internalGetItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.sql.v1beta4.User, + com.google.cloud.sql.v1beta4.User.Builder, + com.google.cloud.sql.v1beta4.UserOrBuilder>( + items_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * Unused.
+     * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_users.proto;l=313 + * @return The nextPageToken. + */ + @java.lang.Deprecated + 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; + } + } + + /** + * + * + *
+     * Unused.
+     * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_users.proto;l=313 + * @return The bytes for nextPageToken. + */ + @java.lang.Deprecated + 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; + } + } + + /** + * + * + *
+     * Unused.
+     * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_users.proto;l=313 + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unused.
+     * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_users.proto;l=313 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Unused.
+     * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_users.proto;l=313 + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.UsersListResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.UsersListResponse) + private static final com.google.cloud.sql.v1beta4.UsersListResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.UsersListResponse(); + } + + public static com.google.cloud.sql.v1beta4.UsersListResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UsersListResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.UsersListResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UsersListResponseOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UsersListResponseOrBuilder.java new file mode 100644 index 000000000000..2a56b010ca56 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/UsersListResponseOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql_users.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface UsersListResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.UsersListResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is always <b>sql#usersList</b>.
+   * 
+ * + * string kind = 1; + * + * @return The kind. + */ + java.lang.String getKind(); + + /** + * + * + *
+   * This is always <b>sql#usersList</b>.
+   * 
+ * + * string kind = 1; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + java.util.List getItemsList(); + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + com.google.cloud.sql.v1beta4.User getItems(int index); + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + int getItemsCount(); + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + java.util.List getItemsOrBuilderList(); + + /** + * + * + *
+   * List of user resources in the instance.
+   * 
+ * + * repeated .google.cloud.sql.v1beta4.User items = 2; + */ + com.google.cloud.sql.v1beta4.UserOrBuilder getItemsOrBuilder(int index); + + /** + * + * + *
+   * Unused.
+   * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_users.proto;l=313 + * @return The nextPageToken. + */ + @java.lang.Deprecated + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * Unused.
+   * 
+ * + * string next_page_token = 3 [deprecated = true]; + * + * @deprecated google.cloud.sql.v1beta4.UsersListResponse.next_page_token is deprecated. See + * google/cloud/sql/v1beta4/cloud_sql_users.proto;l=313 + * @return The bytes for nextPageToken. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Value.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Value.java new file mode 100644 index 000000000000..c80c3b732e24 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/Value.java @@ -0,0 +1,689 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +/** + * + * + *
+ * The cell value of the table.
+ * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Value} + */ +@com.google.protobuf.Generated +public final class Value extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.sql.v1beta4.Value) + ValueOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Value"); + } + + // Use Value.newBuilder() to construct. + private Value(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Value() { + value_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Value_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Value_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Value.class, + com.google.cloud.sql.v1beta4.Value.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + + /** + * + * + *
+   * The cell value represented in string format.
+   * 
+ * + * string value = 1; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + + /** + * + * + *
+   * The cell value represented in string format.
+   * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NULL_VALUE_FIELD_NUMBER = 2; + private boolean nullValue_ = false; + + /** + * + * + *
+   * If cell value is null, then this flag will be set to true.
+   * 
+ * + * bool null_value = 2; + * + * @return The nullValue. + */ + @java.lang.Override + public boolean getNullValue() { + return nullValue_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessage.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, value_); + } + if (nullValue_ != false) { + output.writeBool(2, nullValue_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, value_); + } + if (nullValue_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, nullValue_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.sql.v1beta4.Value)) { + return super.equals(obj); + } + com.google.cloud.sql.v1beta4.Value other = (com.google.cloud.sql.v1beta4.Value) obj; + + if (!getValue().equals(other.getValue())) return false; + if (getNullValue() != other.getNullValue()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (37 * hash) + NULL_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getNullValue()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.sql.v1beta4.Value parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Value parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Value parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Value parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Value parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.sql.v1beta4.Value parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Value parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Value parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Value parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Value parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.sql.v1beta4.Value parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.sql.v1beta4.Value parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.sql.v1beta4.Value prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The cell value of the table.
+   * 
+ * + * Protobuf type {@code google.cloud.sql.v1beta4.Value} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.sql.v1beta4.Value) + com.google.cloud.sql.v1beta4.ValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Value_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Value_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.sql.v1beta4.Value.class, + com.google.cloud.sql.v1beta4.Value.Builder.class); + } + + // Construct using com.google.cloud.sql.v1beta4.Value.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = ""; + nullValue_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.sql.v1beta4.CloudSqlServiceProto + .internal_static_google_cloud_sql_v1beta4_Value_descriptor; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Value getDefaultInstanceForType() { + return com.google.cloud.sql.v1beta4.Value.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Value build() { + com.google.cloud.sql.v1beta4.Value result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Value buildPartial() { + com.google.cloud.sql.v1beta4.Value result = new com.google.cloud.sql.v1beta4.Value(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.sql.v1beta4.Value result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nullValue_ = nullValue_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.sql.v1beta4.Value) { + return mergeFrom((com.google.cloud.sql.v1beta4.Value) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.sql.v1beta4.Value other) { + if (other == com.google.cloud.sql.v1beta4.Value.getDefaultInstance()) return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getNullValue() != false) { + setNullValue(other.getNullValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + value_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + nullValue_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object value_ = ""; + + /** + * + * + *
+     * The cell value represented in string format.
+     * 
+ * + * string value = 1; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The cell value represented in string format.
+     * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The cell value represented in string format.
+     * 
+ * + * string value = 1; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The cell value represented in string format.
+     * 
+ * + * string value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The cell value represented in string format.
+     * 
+ * + * string value = 1; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean nullValue_; + + /** + * + * + *
+     * If cell value is null, then this flag will be set to true.
+     * 
+ * + * bool null_value = 2; + * + * @return The nullValue. + */ + @java.lang.Override + public boolean getNullValue() { + return nullValue_; + } + + /** + * + * + *
+     * If cell value is null, then this flag will be set to true.
+     * 
+ * + * bool null_value = 2; + * + * @param value The nullValue to set. + * @return This builder for chaining. + */ + public Builder setNullValue(boolean value) { + + nullValue_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * If cell value is null, then this flag will be set to true.
+     * 
+ * + * bool null_value = 2; + * + * @return This builder for chaining. + */ + public Builder clearNullValue() { + bitField0_ = (bitField0_ & ~0x00000002); + nullValue_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.sql.v1beta4.Value) + } + + // @@protoc_insertion_point(class_scope:google.cloud.sql.v1beta4.Value) + private static final com.google.cloud.sql.v1beta4.Value DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.sql.v1beta4.Value(); + } + + public static com.google.cloud.sql.v1beta4.Value getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Value parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.sql.v1beta4.Value getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ValueOrBuilder.java b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ValueOrBuilder.java new file mode 100644 index 000000000000..03a2075ca8ca --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/java/com/google/cloud/sql/v1beta4/ValueOrBuilder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/sql/v1beta4/cloud_sql.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.sql.v1beta4; + +@com.google.protobuf.Generated +public interface ValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.sql.v1beta4.Value) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The cell value represented in string format.
+   * 
+ * + * string value = 1; + * + * @return The value. + */ + java.lang.String getValue(); + + /** + * + * + *
+   * The cell value represented in string format.
+   * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+   * If cell value is null, then this flag will be set to true.
+   * 
+ * + * bool null_value = 2; + * + * @return The nullValue. + */ + boolean getNullValue(); +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql.proto b/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql.proto new file mode 100644 index 000000000000..dbf6a25598d5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql.proto @@ -0,0 +1,1749 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1beta4; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/sql/v1beta4/cloud_sql_resources.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1beta4/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlServiceProto"; +option java_package = "com.google.cloud.sql.v1beta4"; + +service SqlBackupRunsService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Deletes the backup taken by a backup run. + rpc Delete(SqlBackupRunsDeleteRequest) returns (Operation) { + option (google.api.http) = { + delete: "/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}" + }; + } + + // Retrieves a resource containing information about a backup run. + rpc Get(SqlBackupRunsGetRequest) returns (BackupRun) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}" + }; + } + + // Creates a new backup run on demand. + rpc Insert(SqlBackupRunsInsertRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns" + body: "body" + }; + } + + // Lists all backup runs associated with the project or a given instance and + // configuration in the reverse chronological order of the backup initiation + // time. + rpc List(SqlBackupRunsListRequest) returns (BackupRunsListResponse) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns" + }; + } +} + +service SqlDatabasesService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Deletes a database from a Cloud SQL instance. + rpc Delete(SqlDatabasesDeleteRequest) returns (Operation) { + option (google.api.http) = { + delete: "/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}" + }; + } + + // Retrieves a resource containing information about a database inside a Cloud + // SQL instance. + rpc Get(SqlDatabasesGetRequest) returns (Database) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}" + }; + } + + // Inserts a resource containing information about a database inside a Cloud + // SQL instance. + // + // **Note:** You can't modify the default character set and collation. + rpc Insert(SqlDatabasesInsertRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/databases" + body: "body" + }; + } + + // Lists databases in the specified Cloud SQL instance. + rpc List(SqlDatabasesListRequest) returns (DatabasesListResponse) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}/databases" + }; + } + + // Partially updates a resource containing information about a database inside + // a Cloud SQL instance. This method supports patch semantics. + rpc Patch(SqlDatabasesUpdateRequest) returns (Operation) { + option (google.api.http) = { + patch: "/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}" + body: "body" + }; + } + + // Updates a resource containing information about a database inside a Cloud + // SQL instance. + rpc Update(SqlDatabasesUpdateRequest) returns (Operation) { + option (google.api.http) = { + put: "/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}" + body: "body" + }; + } +} + +service SqlFlagsService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Lists all available database flags for Cloud SQL instances. + rpc List(SqlFlagsListRequest) returns (FlagsListResponse) { + option (google.api.http) = { + get: "/sql/v1beta4/flags" + }; + } +} + +service SqlInstancesService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Add a new trusted Certificate Authority (CA) version for the specified + // instance. Required to prepare for a certificate rotation. If a CA version + // was previously added but never used in a certificate rotation, this + // operation replaces that version. There cannot be more than one CA version + // waiting to be rotated in. For instances that have enabled Certificate + // Authority Service (CAS) based server CA, use AddServerCertificate to add a + // new server certificate. + rpc AddServerCa(SqlInstancesAddServerCaRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/addServerCa" + }; + } + + // Add a new trusted server certificate version for the specified instance + // using Certificate Authority Service (CAS) server CA. Required to prepare + // for a certificate rotation. If a server certificate version was previously + // added but never used in a certificate rotation, this operation replaces + // that version. There cannot be more than one certificate version waiting to + // be rotated in. For instances not using CAS server CA, use AddServerCa + // instead. + rpc AddServerCertificate(SqlInstancesAddServerCertificateRequest) + returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/addServerCertificate" + }; + } + + // Adds a new Entra ID certificate for the specified instance. If an Entra ID + // certificate was previously added but never used in a certificate rotation, + // this operation replaces that version. + rpc AddEntraIdCertificate(SqlInstancesAddEntraIdCertificateRequest) + returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/addEntraIdCertificate" + }; + } + + // Creates a Cloud SQL instance as a clone of the source instance. Using this + // operation might cause your instance to restart. + rpc Clone(SqlInstancesCloneRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/clone" + body: "body" + }; + } + + // Deletes a Cloud SQL instance. + rpc Delete(SqlInstancesDeleteRequest) returns (Operation) { + option (google.api.http) = { + delete: "/sql/v1beta4/projects/{project}/instances/{instance}" + }; + } + + // Demotes the stand-alone instance to be a Cloud SQL read replica for an + // external database server. + rpc DemoteMaster(SqlInstancesDemoteMasterRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster" + body: "body" + }; + } + + // Demotes an existing standalone instance to be a Cloud SQL read replica + // for an external database server. + rpc Demote(SqlInstancesDemoteRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/demote" + body: "body" + }; + } + + // Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL + // dump or CSV file. + rpc Export(SqlInstancesExportRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/export" + body: "body" + }; + } + + // Initiates a manual failover of a high availability (HA) primary instance + // to a standby instance, which becomes the primary instance. Users are + // then rerouted to the new primary. For more information, see the + // [Overview of high + // availability](https://cloud.google.com/sql/docs/mysql/high-availability) + // page in the Cloud SQL documentation. + // If using Legacy HA (MySQL only), this causes the instance to failover to + // its failover replica instance. + rpc Failover(SqlInstancesFailoverRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/failover" + body: "body" + }; + } + + // Reencrypt CMEK instance with latest key version. + rpc Reencrypt(SqlInstancesReencryptRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/reencrypt" + body: "body" + }; + } + + // Retrieves a resource containing information about a Cloud SQL instance. + rpc Get(SqlInstancesGetRequest) returns (DatabaseInstance) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}" + }; + } + + // Imports data into a Cloud SQL instance from a SQL dump or CSV file in + // Cloud Storage. + rpc Import(SqlInstancesImportRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/import" + body: "body" + }; + } + + // Creates a new Cloud SQL instance. + rpc Insert(SqlInstancesInsertRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances" + body: "body" + }; + } + + // Lists instances under a given project. + rpc List(SqlInstancesListRequest) returns (InstancesListResponse) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances" + }; + } + + // Lists all of the trusted Certificate Authorities (CAs) for the specified + // instance. There can be up to three CAs listed: the CA that was used to sign + // the certificate that is currently in use, a CA that has been added but not + // yet used to sign a certificate, and a CA used to sign a certificate that + // has previously rotated out. + rpc ListServerCas(SqlInstancesListServerCasRequest) + returns (InstancesListServerCasResponse) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}/listServerCas" + }; + } + + // Lists all versions of server certificates and certificate authorities (CAs) + // for the specified instance. There can be up to three sets of certs listed: + // the certificate that is currently in use, a future that has been added but + // not yet used to sign a certificate, and a certificate that has been rotated + // out. For instances not using Certificate Authority Service (CAS) server CA, + // use ListServerCas instead. + rpc ListServerCertificates(SqlInstancesListServerCertificatesRequest) + returns (InstancesListServerCertificatesResponse) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}/listServerCertificates" + }; + } + + // Lists all versions of EntraID certificates for the specified instance. + // There can be up to three sets of certificates listed: the certificate that + // is currently in use, a future that has been added but not yet used to sign + // a certificate, and a certificate that has been rotated out. + rpc ListEntraIdCertificates(SqlInstancesListEntraIdCertificatesRequest) + returns (InstancesListEntraIdCertificatesResponse) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}/listEntraIdCertificates" + }; + } + + // Partially updates settings of a Cloud SQL instance by merging the request + // with the current configuration. This method supports patch semantics. + rpc Patch(SqlInstancesPatchRequest) returns (Operation) { + option (google.api.http) = { + patch: "/sql/v1beta4/projects/{project}/instances/{instance}" + body: "body" + }; + } + + // Promotes the read replica instance to be an independent Cloud SQL + // primary instance. + // Using this operation might cause your instance to restart. + rpc PromoteReplica(SqlInstancesPromoteReplicaRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica" + }; + } + + // Switches over from the primary instance to the DR replica + // instance. + rpc Switchover(SqlInstancesSwitchoverRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/switchover" + }; + } + + // Deletes all client certificates and generates a new server SSL certificate + // for the instance. + rpc ResetSslConfig(SqlInstancesResetSslConfigRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig" + }; + } + + // Restarts a Cloud SQL instance. + rpc Restart(SqlInstancesRestartRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/restart" + }; + } + + // Restores a backup of a Cloud SQL instance. Using this operation might cause + // your instance to restart. + rpc RestoreBackup(SqlInstancesRestoreBackupRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup" + body: "body" + }; + } + + // Rotates the server certificate to one signed by the Certificate Authority + // (CA) version previously added with the addServerCA method. For instances + // that have enabled Certificate Authority Service (CAS) based server CA, + // use RotateServerCertificate to rotate the server certificate. + rpc RotateServerCa(SqlInstancesRotateServerCaRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa" + body: "body" + }; + } + + // Rotates the server certificate version to one previously added with the + // addServerCertificate method. For instances not using Certificate Authority + // Service (CAS) server CA, use RotateServerCa instead. + rpc RotateServerCertificate(SqlInstancesRotateServerCertificateRequest) + returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCertificate" + body: "body" + }; + } + + // Rotates the Entra Id certificate version to one previously added with the + // addEntraIdCertificate method. + rpc RotateEntraIdCertificate(SqlInstancesRotateEntraIdCertificateRequest) + returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/rotateEntraIdCertificate" + body: "body" + }; + } + + // Starts the replication in the read replica instance. + rpc StartReplica(SqlInstancesStartReplicaRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/startReplica" + }; + } + + // Stops the replication in the read replica instance. + rpc StopReplica(SqlInstancesStopReplicaRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/stopReplica" + }; + } + + // Truncate MySQL general and slow query log tables + // MySQL only. + rpc TruncateLog(SqlInstancesTruncateLogRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/truncateLog" + body: "body" + }; + } + + // Updates settings of a Cloud SQL instance. Using this operation might cause + // your instance to restart. + rpc Update(SqlInstancesUpdateRequest) returns (Operation) { + option (google.api.http) = { + put: "/sql/v1beta4/projects/{project}/instances/{instance}" + body: "body" + }; + } + + // Generates a short-lived X509 certificate containing the provided public key + // and signed by a private key specific to the target instance. Users may use + // the certificate to authenticate as themselves when connecting to the + // database. + rpc CreateEphemeral(SqlInstancesCreateEphemeralCertRequest) + returns (SslCert) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral" + body: "body" + }; + } + + // Reschedules the maintenance on the given instance. + rpc RescheduleMaintenance(SqlInstancesRescheduleMaintenanceRequest) + returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance" + body: "body" + }; + } + + // Verify External primary instance external sync settings. + rpc VerifyExternalSyncSettings(SqlInstancesVerifyExternalSyncSettingsRequest) + returns (SqlInstancesVerifyExternalSyncSettingsResponse) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings" + body: "*" + }; + } + + // Start External primary instance migration. + rpc StartExternalSync(SqlInstancesStartExternalSyncRequest) + returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync" + body: "*" + }; + } + + // Perform Disk Shrink on primary instance. + rpc PerformDiskShrink(SqlInstancesPerformDiskShrinkRequest) + returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/performDiskShrink" + body: "body" + }; + } + + // Get Disk Shrink Config for a given instance. + rpc GetDiskShrinkConfig(SqlInstancesGetDiskShrinkConfigRequest) + returns (SqlInstancesGetDiskShrinkConfigResponse) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}/getDiskShrinkConfig" + }; + } + + // Reset Replica Size to primary instance disk size. + rpc ResetReplicaSize(SqlInstancesResetReplicaSizeRequest) + returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/resetReplicaSize" + body: "*" + }; + } + + // Get Latest Recovery Time for a given instance. + rpc GetLatestRecoveryTime(SqlInstancesGetLatestRecoveryTimeRequest) + returns (SqlInstancesGetLatestRecoveryTimeResponse) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}/getLatestRecoveryTime" + }; + } + + // Execute SQL statements. + rpc ExecuteSql(SqlInstancesExecuteSqlRequest) + returns (SqlInstancesExecuteSqlResponse) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/executeSql" + body: "body" + }; + } + + // Acquire a lease for the setup of SQL Server Reporting Services (SSRS). + rpc AcquireSsrsLease(SqlInstancesAcquireSsrsLeaseRequest) + returns (SqlInstancesAcquireSsrsLeaseResponse) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/acquireSsrsLease" + body: "body" + }; + } + + // Release a lease for the setup of SQL Server Reporting Services (SSRS). + rpc ReleaseSsrsLease(SqlInstancesReleaseSsrsLeaseRequest) + returns (SqlInstancesReleaseSsrsLeaseResponse) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/releaseSsrsLease" + }; + } + + // Execute MVU Pre-checks + rpc PreCheckMajorVersionUpgrade( + SqlInstancesPreCheckMajorVersionUpgradeRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/preCheckMajorVersionUpgrade" + body: "body" + }; + } + + // Point in time restore for an instance managed by Google Cloud Backup and + // Disaster Recovery. + rpc PointInTimeRestore(SqlInstancesPointInTimeRestoreRequest) + returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/{parent=projects/*}:pointInTimeRestore" + body: "context" + }; + } +} + +service SqlOperationsService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Retrieves an instance operation that has been performed on an instance. + rpc Get(SqlOperationsGetRequest) returns (Operation) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/operations/{operation}" + }; + } + + // Lists all instance operations that have been performed on the given Cloud + // SQL instance in the reverse chronological order of the start time. + rpc List(SqlOperationsListRequest) returns (OperationsListResponse) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/operations" + }; + } + + // Cancels an instance operation that has been performed on an instance. + // Ordinarily, this method name should be `CancelSqlOperation`. + rpc Cancel(SqlOperationsCancelRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/operations/{operation}/cancel" + }; + } +} + +service SqlSslCertsService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Deletes the SSL certificate. For First Generation instances, the + // certificate remains valid until the instance is restarted. + rpc Delete(SqlSslCertsDeleteRequest) returns (Operation) { + option (google.api.http) = { + delete: "/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}" + }; + } + + // Retrieves a particular SSL certificate. Does not include the private key + // (required for usage). The private key must be saved from the response to + // initial creation. + rpc Get(SqlSslCertsGetRequest) returns (SslCert) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}" + }; + } + + // Creates an SSL certificate and returns it along with the private key and + // server certificate authority. The new certificate will not be usable until + // the instance is restarted. + rpc Insert(SqlSslCertsInsertRequest) returns (SslCertsInsertResponse) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts" + body: "body" + }; + } + + // Lists all of the current SSL certificates for the instance. + rpc List(SqlSslCertsListRequest) returns (SslCertsListResponse) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts" + }; + } +} + +service SqlBackupsService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Creates a backup for a Cloud SQL instance. This API can be used only to + // create on-demand backups. + rpc CreateBackup(CreateBackupRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/{parent=projects/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent, backup"; + } + + // Retrieves a resource containing information about a backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/sql/v1beta4/{name=projects/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all backups associated with the project. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/sql/v1beta4/{parent=projects/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the retention period and the description of the backup. You can use + // this API to update final backups only. + rpc UpdateBackup(UpdateBackupRequest) returns (Operation) { + option (google.api.http) = { + patch: "/sql/v1beta4/{backup.name=projects/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup, update_mask"; + } + + // Deletes the backup. + rpc DeleteBackup(DeleteBackupRequest) returns (Operation) { + option (google.api.http) = { + delete: "/sql/v1beta4/{name=projects/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request payload to create the backup +message CreateBackupRequest { + // Required. The parent resource where this backup is created. + // Format: projects/{project} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "sqladmin.googleapis.com/Backup" + } + ]; + + // Required. The Backup to create. + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request payload to get the backup. +message GetBackupRequest { + // Required. The name of the backup to retrieve. + // Format: projects/{project}/backups/{backup} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "sqladmin.googleapis.com/Backup" } + ]; +} + +// The request payload to list the backups. +message ListBackupsRequest { + // Required. The parent that owns this collection of backups. + // Format: projects/{project} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "sqladmin.googleapis.com/Backup" + } + ]; + + // The maximum number of backups to return per response. The service might + // return fewer backups than this value. If a value for this parameter isn't + // specified, then, at most, 500 backups are returned. The maximum value is + // 2,000. Any values that you set, which are greater than 2,000, are changed + // to 2,000. + int32 page_size = 2; + + // A page token, received from a previous `ListBackups` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListBackups` must match + // the call that provided the page token. + string page_token = 3; + + // Multiple filter queries are separated by spaces. For example, + // 'instance:abc AND type:FINAL, 'location:us', + // 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by + // type, instance, backupInterval.startTime (creation time), or location. + string filter = 4; +} + +// The response payload containing a list of the backups. +message ListBackupsResponse { + // A list of backups. + repeated Backup backups = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, then there aren't subsequent pages. + string next_page_token = 2; + + // If a region isn't unavailable or if an unknown error occurs, then a warning + // message is returned. + repeated ApiWarning warnings = 3; +} + +// The request payload to update the backup. +message UpdateBackupRequest { + // Required. The backup to update. + // The backup’s `name` field is used to identify the backup to update. + // Format: projects/{project}/backups/{backup} + Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields that you can update. You can update only the description + // and retention period of the final backup. + google.protobuf.FieldMask update_mask = 2; +} + +// The request payload to delete the backup. +message DeleteBackupRequest { + // Required. The name of the backup to delete. + // Format: projects/{project}/backups/{backup} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "sqladmin.googleapis.com/Backup" } + ]; +} + +message SqlBackupRunsDeleteRequest { + // The ID of the backup run to delete. To find a backup run ID, use the + // [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/backupRuns/list) + // method. + int64 id = 1; + + // Cloud SQL instance ID. This does not include the project ID. + string instance = 2; + + // Project ID of the project that contains the instance. + string project = 3; +} + +message SqlBackupRunsGetRequest { + // The ID of this backup run. + int64 id = 1; + + // Cloud SQL instance ID. This does not include the project ID. + string instance = 2; + + // Project ID of the project that contains the instance. + string project = 3; +} + +message SqlBackupRunsInsertRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + BackupRun body = 100; +} + +message SqlBackupRunsListRequest { + // Cloud SQL instance ID, or "-" for all instances. This does not include + // the project ID. + string instance = 1; + + // Maximum number of backup runs per response. + int32 max_results = 2; + + // A previously-returned page token representing part of the larger set of + // results to view. + string page_token = 3; + + // Project ID of the project that contains the instance. + string project = 4; +} + +message SqlDatabasesDeleteRequest { + // Name of the database to be deleted in the instance. + string database = 1; + + // Database instance ID. This does not include the project ID. + string instance = 2; + + // Project ID of the project that contains the instance. + string project = 3; +} + +message SqlDatabasesGetRequest { + // Name of the database in the instance. + string database = 1; + + // Database instance ID. This does not include the project ID. + string instance = 2; + + // Project ID of the project that contains the instance. + string project = 3; +} + +message SqlDatabasesInsertRequest { + // Database instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + Database body = 100; +} + +message SqlDatabasesListRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +message SqlDatabasesUpdateRequest { + // Name of the database to be updated in the instance. + string database = 1; + + // Database instance ID. This does not include the project ID. + string instance = 2; + + // Project ID of the project that contains the instance. + string project = 3; + + Database body = 100; +} + +message SqlFlagsListRequest { + // Database type and version you want to retrieve flags for. By default, this + // method returns flags for all database types and versions. + string database_version = 1; + + // Optional. Specify the scope of flags to be returned by SqlFlagsListService. + // Return list of database flags if unspecified. + optional SqlFlagScope flag_scope = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +message SqlInstancesAddServerCaRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +// Request for AddServerCertificate RPC. +message SqlInstancesAddServerCertificateRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for AddEntraIdCertificate RPC. +message SqlInstancesAddEntraIdCertificateRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; +} + +message SqlInstancesCloneRequest { + // The ID of the Cloud SQL instance to be cloned (source). This does not + // include the project ID. + string instance = 1; + + // Project ID of the source Cloud SQL instance. + string project = 2; + + InstancesCloneRequest body = 100; +} + +message SqlInstancesDeleteRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance to be deleted. + string project = 2; + + // Flag to opt-in for final backup. By default, it is turned off. + optional bool enable_final_backup = 7; + + oneof expiration { + // Optional. Retention period of the final backup. + int64 final_backup_ttl_days = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Final Backup expiration time. + // Timestamp in UTC of when this resource is considered expired. + google.protobuf.Timestamp final_backup_expiry_time = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The description of the final backup. + string final_backup_description = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +message SqlInstancesDemoteMasterRequest { + // Cloud SQL instance name. + string instance = 1; + + // ID of the project that contains the instance. + string project = 2; + + InstancesDemoteMasterRequest body = 100; +} + +// Instance demote request. +message SqlInstancesDemoteRequest { + // Required. The name of the Cloud SQL instance. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; + + // The request body. + InstancesDemoteRequest body = 100; +} + +message SqlInstancesExportRequest { + // The Cloud SQL instance ID. This doesn't include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance to be exported. + string project = 2; + + InstancesExportRequest body = 100; +} + +message SqlInstancesFailoverRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // ID of the project that contains the read replica. + string project = 2; + + InstancesFailoverRequest body = 100; +} + +message SqlInstancesGetRequest { + // Database instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +message SqlInstancesImportRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + InstancesImportRequest body = 100; +} + +message SqlInstancesInsertRequest { + // Project ID of the project to which the newly created Cloud SQL instances + // should belong. + string project = 1; + + DatabaseInstance body = 100; +} + +message SqlInstancesListRequest { + // A filter expression that filters resources listed in the response. + // The expression is in the form of field:value. For example, + // 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per + // their JSON representation, such as 'settings.userLabels.auto_start:true'. + // + // Multiple filter queries are space-separated. For example. + // 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each + // expression is an AND expression. However, you can include AND and OR + // expressions explicitly. + string filter = 1; + + // The maximum number of instances to return. The service may return fewer + // than this value. + // If unspecified, at most 500 instances are returned. + // The maximum value is 1000; values above 1000 are coerced to 1000. + uint32 max_results = 2; + + // A previously-returned page token representing part of the larger set of + // results to view. + string page_token = 3; + + // Project ID of the project for which to list Cloud SQL instances. + string project = 4; +} + +message SqlInstancesListServerCasRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +message SqlInstancesListServerCertificatesRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for SqlInstancesService.ListEntraIdCertificates. +message SqlInstancesListEntraIdCertificatesRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; +} + +message SqlInstancesPatchRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // Optional. Set PSC config to the same value as the existing config to + // reconcile the PSC networking. + optional bool reconcile_psc_networking = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set PSC config to the same value as the existing config and force + // reconcile the PSC networking. + optional bool reconcile_psc_networking_force = 5 + [(google.api.field_behavior) = OPTIONAL]; + + DatabaseInstance body = 100; +} + +message SqlInstancesPromoteReplicaRequest { + // Cloud SQL read replica instance name. + string instance = 1; + + // ID of the project that contains the read replica. + string project = 2; + + // Set to true to invoke a replica failover to the DR replica. + // As part of replica failover, the promote operation attempts + // to add the original primary instance as a replica of the promoted + // DR replica when the original primary instance comes back online. + // If set to false or not specified, then the original primary + // instance becomes an independent Cloud SQL primary instance. + bool failover = 3; +} + +// Instance switchover request. +message SqlInstancesSwitchoverRequest { + // Cloud SQL read replica instance name. + string instance = 1; + + // ID of the project that contains the replica. + string project = 2; + + // Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations + // timeout, which is a sum of all database operations. Default value is 10 + // minutes and can be modified to a maximum value of 24 hours. + google.protobuf.Duration db_timeout = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +message SqlInstancesResetSslConfigRequest { + // Reset SSL mode to selectively refresh the SSL materials. + enum ResetSslMode { + // Reset SSL mode is not specified. + RESET_SSL_MODE_UNSPECIFIED = 0; + + // Refresh all TLS configs. This is the default behaviour. + ALL = 1; + + // Refreshes the replication-related TLS configuration settings provided by + // the primary instance. + // Not applicable to on-premises replication instances. + SYNC_FROM_PRIMARY = 2; + } + + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // Optional. Reset SSL mode to use. + ResetSslMode mode = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +message SqlInstancesRestartRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance to be restarted. + string project = 2; +} + +message SqlInstancesRestoreBackupRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + InstancesRestoreBackupRequest body = 100; +} + +message SqlInstancesRotateServerCaRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + InstancesRotateServerCaRequest body = 100; +} + +message SqlInstancesRotateServerCertificateRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Rotate server certificate request body. + InstancesRotateServerCertificateRequest body = 100 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for SqlInstancesService.RotateEntraIdCertificate. +message SqlInstancesRotateEntraIdCertificateRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Rotate Entra ID certificate request body. + InstancesRotateEntraIdCertificateRequest body = 100 + [(google.api.field_behavior) = REQUIRED]; +} + +message SqlInstancesStartReplicaRequest { + // Cloud SQL read replica instance name. + string instance = 1; + + // ID of the project that contains the read replica. + string project = 2; +} + +message SqlInstancesStopReplicaRequest { + // Cloud SQL read replica instance name. + string instance = 1; + + // ID of the project that contains the read replica. + string project = 2; +} + +message SqlInstancesTruncateLogRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the Cloud SQL project. + string project = 2; + + InstancesTruncateLogRequest body = 100; +} + +message SqlInstancesUpdateRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + DatabaseInstance body = 100; +} + +// Instance reencrypt request. +message SqlInstancesReencryptRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // ID of the project that contains the instance. + string project = 2; + + // Reencrypt body that users request + InstancesReencryptRequest body = 3; +} + +// Database Instance reencrypt request. +message InstancesReencryptRequest { + // Configuration specific to backup re-encryption + optional BackupReencryptionConfig backup_reencryption_config = 1; +} + +// Backup Reencryption Config +message BackupReencryptionConfig { + // Backup type for re-encryption + enum BackupType { + // Unknown backup type, will be defaulted to AUTOMATIC backup type + BACKUP_TYPE_UNSPECIFIED = 0; + + // Reencrypt automatic backups + AUTOMATED = 1; + + // Reencrypt on-demand backups + ON_DEMAND = 2; + } + + // Backup re-encryption limit + optional int32 backup_limit = 1; + + // Type of backups users want to re-encrypt. + optional BackupType backup_type = 2; +} + +message SqlInstancesRescheduleMaintenanceRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // ID of the project that contains the instance. + string project = 2; + + SqlInstancesRescheduleMaintenanceRequestBody body = 100; +} + +// Instance perform disk shrink request. +message SqlInstancesPerformDiskShrinkRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // Perform disk shrink context. + PerformDiskShrinkContext body = 100; +} + +// External Sync parallel level. +enum ExternalSyncParallelLevel { + // Unknown sync parallel level. Will be defaulted to OPTIMAL. + EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED = 0; + + // Minimal parallel level. + MIN = 1; + + // Optimal parallel level. + OPTIMAL = 2; + + // Maximum parallel level. + MAX = 3; +} + +// The selected object that Cloud SQL migrates. +message ExternalSyncSelectedObject { + // The name of the database that Cloud SQL migrates. + string database = 1; +} + +message SqlInstancesVerifyExternalSyncSettingsRequest { + enum ExternalSyncMode { + // Unknown external sync mode, will be defaulted to ONLINE mode + EXTERNAL_SYNC_MODE_UNSPECIFIED = 0; + + // Online external sync will set up replication after initial data external + // sync + ONLINE = 1; + + // Offline external sync only dumps and loads a one-time snapshot of + // the primary instance's data + OFFLINE = 2; + } + + // MigrationType determines whether the migration is a physical file-based + // migration or a logical dump file-based migration. + enum MigrationType { + // Default value is a logical dump file-based migration + MIGRATION_TYPE_UNSPECIFIED = 0; + + // Logical dump file-based migration + LOGICAL = 1; + + // Physical file-based migration + PHYSICAL = 2; + } + + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // Flag to enable verifying connection only + bool verify_connection_only = 3; + + // External sync mode + ExternalSyncMode sync_mode = 4; + + // Optional. Flag to verify settings required by replication setup only + bool verify_replication_only = 5 [(google.api.field_behavior) = OPTIONAL]; + + oneof sync_config { + // Optional. MySQL-specific settings for start external sync. + MySqlSyncConfig mysql_sync_config = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. MigrationType configures the migration to use physical files or + // logical dump files. If not set, then the logical dump file configuration is + // used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + MigrationType migration_type = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Parallel level for initial data sync. Only applicable for + // PostgreSQL. + ExternalSyncParallelLevel sync_parallel_level = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Migrate only the specified objects from the source instance. If + // this field is empty, then migrate all objects. + repeated ExternalSyncSelectedObject selected_objects = 9 + [(google.api.field_behavior) = OPTIONAL]; +} + +message SqlInstancesStartExternalSyncRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // ID of the project that contains the instance. + string project = 2; + + // External sync mode. + SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; + + // Whether to skip the verification step (VESS). + bool skip_verification = 4; + + oneof sync_config { + // MySQL-specific settings for start external sync. + MySqlSyncConfig mysql_sync_config = 6; + } + + // Optional. Parallel level for initial data sync. Currently only applicable + // for MySQL. + ExternalSyncParallelLevel sync_parallel_level = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. MigrationType configures the migration to use physical files or + // logical dump files. If not set, then the logical dump file configuration is + // used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL. + SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType migration_type = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. MySQL only. True if end-user has confirmed that this SES call + // will wipe replica databases overlapping with the proposed selected_objects. + // If this field is not set and there are both overlapping and additional + // databases proposed, an error will be returned. + bool replica_overwrite_enabled = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Instance reset replica size request. +message SqlInstancesResetReplicaSizeRequest { + // Cloud SQL read replica instance name. + string instance = 1; + + // ID of the project that contains the read replica. + string project = 2; +} + +message SqlOperationsGetRequest { + // Instance operation ID. + string operation = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +message SqlOperationsListRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Maximum number of operations per response. + uint32 max_results = 2; + + // A previously-returned page token representing part of the larger set of + // results to view. + string page_token = 3; + + // Project ID of the project that contains the instance. + string project = 4; +} + +// The request payload to cancel an operation. +message SqlOperationsCancelRequest { + // Instance operation ID. + string operation = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +message SqlInstancesCreateEphemeralCertRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the Cloud SQL project. + string project = 2; + + SslCertsCreateEphemeralRequest body = 100; +} + +message SqlSslCertsDeleteRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // Sha1 FingerPrint. + string sha1_fingerprint = 3; +} + +message SqlSslCertsGetRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // Sha1 FingerPrint. + string sha1_fingerprint = 3; +} + +message SqlSslCertsInsertRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + SslCertsInsertRequest body = 100; +} + +message SqlSslCertsListRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +// Instance get disk shrink config request. +message SqlInstancesGetDiskShrinkConfigRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +// Instance get latest recovery time request. +message SqlInstancesGetLatestRecoveryTimeRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // The timestamp used to identify the time when the source instance is + // deleted. If this instance is deleted, then you must set the timestamp. + optional google.protobuf.Timestamp source_instance_deletion_time = 3; +} + +// Instance get latest recovery time response. +message SqlInstancesGetLatestRecoveryTimeResponse { + // This is always `sql#getLatestRecoveryTime`. + string kind = 1; + + // Timestamp, identifies the latest recovery time of the source instance. + google.protobuf.Timestamp latest_recovery_time = 2; + + // Timestamp, identifies the earliest recovery time of the source instance. + google.protobuf.Timestamp earliest_recovery_time = 3; +} + +// Execute SQL statements request. +message SqlInstancesExecuteSqlRequest { + // Required. Database instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; + + // The request body. + ExecuteSqlPayload body = 100; +} + +// Request to release a lease for SSRS. +message SqlInstancesReleaseSsrsLeaseRequest { + // Required. The Cloud SQL instance ID. This doesn't include the project ID. + // It's composed of lowercase letters, numbers, and hyphens, and it must start + // with a letter. The total length must be 98 characters or less (Example: + // instance-id). + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the project that contains the instance (Example: + // project-id). + string project = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The response for the release of the SSRS lease. +message SqlInstancesReleaseSsrsLeaseResponse { + // The operation ID. + string operation_id = 1; +} + +// The request payload used to execute SQL statements. +message ExecuteSqlPayload { + // Controls how the API should respond when the SQL execution result exceeds + // 10 MB. + enum PartialResultMode { + // Unspecified mode, effectively the same as `FAIL_PARTIAL_RESULT`. + PARTIAL_RESULT_MODE_UNSPECIFIED = 0; + + // Throw an error if the result exceeds 10 MB or if only a partial result + // can be retrieved. Don't return the result. + FAIL_PARTIAL_RESULT = 1; + + // Return a truncated result and set `partial_result` to true if the result + // exceeds 10 MB or if only a partial result can be retrieved due to error. + // Don't throw an error. + ALLOW_PARTIAL_RESULT = 2; + } + + // Optional. The name of an existing database user to connect to the database. + // When `auto_iam_authn` is set to true, this field is ignored and the API + // caller's IAM user is used. + string user = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. SQL statements to run on the database. It can be a single + // statement or a sequence of statements separated by semicolons. + string sql_statement = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Name of the database on which the statement will be executed. + string database = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Credentials for the database connection. + oneof user_password { + // Optional. When set to true, the API caller identity associated with the + // request is used for database authentication. The API caller must be an + // IAM user in the database. + bool auto_iam_authn = 11 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The maximum number of rows returned per SQL statement. + int64 row_limit = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls how the API should respond when the SQL execution result + // is incomplete due to the size limit or another error. The default mode is + // to throw an error. + PartialResultMode partial_result_mode = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the name of the application that is making the request. + // This field is used for telemetry. Only alphanumeric characters, dashes, and + // underscores are allowed. The maximum length is 32 characters. + string application = 16 [(google.api.field_behavior) = OPTIONAL]; +} + +// Execute SQL statements response. +message SqlInstancesExecuteSqlResponse { + // Represents a notice or warning message from the database. + message Message { + // The full message string. + // For PostgreSQL, this is a formatted string that may include severity, + // code, and the notice/warning message. + // For MySQL, this contains the warning message. + optional string message = 1; + + // The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for + // MySQL). + optional string severity = 2; + } + + // A list of notices and warnings generated during query execution. + // For PostgreSQL, this includes all notices and warnings. + // For MySQL, this includes warnings generated by the last executed statement. + // To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must + // be executed after each statement. + repeated Message messages = 9; + + // The additional metadata information regarding the execution of the SQL + // statements. + Metadata metadata = 6; + + // The list of results after executing all the SQL statements. + repeated QueryResult results = 7; + + // Contains the error from the database if the SQL execution failed. + google.rpc.Status status = 8; +} + +// QueryResult contains the result of executing a single SQL statement. +message QueryResult { + // List of columns included in the result. This also includes the data type + // of the column. + repeated Column columns = 1; + + // Rows returned by the SQL statement. + repeated Row rows = 2; + + // Message related to the SQL execution result. + string message = 3; + + // Set to true if the SQL execution's result is truncated due to size limits + // or an error retrieving results. + bool partial_result = 4; + + // If results were truncated due to an error, details of that error. + google.rpc.Status status = 8; +} + +// Contains the name and datatype of a column. +message Column { + // Name of the column. + string name = 1; + + // Datatype of the column. + string type = 2; +} + +// Contains the values for a row. +message Row { + // The values for the row. + repeated Value values = 1; +} + +// The cell value of the table. +message Value { + // The cell value represented in string format. + string value = 1; + + // If cell value is null, then this flag will be set to true. + bool null_value = 2; +} + +// The additional metadata information regarding the execution of the SQL +// statements. +message Metadata { + // The time taken to execute the SQL statements. + google.protobuf.Duration sql_statement_execution_time = 1; +} + +// Request to acquire a lease for SSRS. +message SqlInstancesAcquireSsrsLeaseRequest { + // Required. Cloud SQL instance ID. This doesn't include the project ID. It's + // composed of lowercase letters, numbers, and hyphens, and it must start with + // a letter. The total length must be 98 characters or less (Example: + // instance-id). + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. ID of the project that contains the instance (Example: + // project-id). + string project = 2 [(google.api.field_behavior) = REQUIRED]; + + // The body for request to acquire an SSRS lease. + InstancesAcquireSsrsLeaseRequest body = 100; +} + +// Request for Pre-checks for MVU +message SqlInstancesPreCheckMajorVersionUpgradeRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project ID of the project that contains the instance. + string project = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The context for request to perform the pre-check major version + // upgrade operation. + InstancesPreCheckMajorVersionUpgradeRequest body = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Acquire SSRS lease response. +message SqlInstancesAcquireSsrsLeaseResponse { + // The unique identifier for this operation. + optional string operation_id = 1; +} + +// Request to perform a point in time restore on a Google Cloud Backup and +// Disaster Recovery managed instance. +message SqlInstancesPointInTimeRestoreRequest { + // Required. The parent resource where you created this instance. + // Format: projects/{project} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The context for request to perform a PITR on a Google Cloud + // Backup and Disaster Recovery managed instance. + PointInTimeRestoreContext context = 100 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_connect.proto b/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_connect.proto new file mode 100644 index 000000000000..6a03cec98456 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_connect.proto @@ -0,0 +1,242 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1beta4; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/sql/v1beta4/cloud_sql_resources.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1beta4/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlConnectProto"; +option java_package = "com.google.cloud.sql.v1beta4"; + +// Cloud SQL connect service. +service SqlConnectService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Retrieves connect settings about a Cloud SQL instance. + rpc GetConnectSettings(GetConnectSettingsRequest) returns (ConnectSettings) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}/connectSettings" + }; + } + + // Retrieves connect settings about a Cloud SQL instance using the instance + // DNS name. + rpc ResolveConnectSettings(ResolveConnectSettingsRequest) + returns (ConnectSettings) { + option (google.api.http) = { + get: "/sql/v1beta4/locations/{location}/dns/{dns_name}:resolveConnectSettings" + }; + } + + // Generates a short-lived X509 certificate containing the provided public key + // and signed by a private key specific to the target instance. Users may use + // the certificate to authenticate as themselves when connecting to the + // database. + rpc GenerateEphemeralCert(GenerateEphemeralCertRequest) + returns (GenerateEphemeralCertResponse) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}:generateEphemeralCert" + body: "*" + }; + } +} + +// Connect settings retrieval request. +message GetConnectSettingsRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // Optional. Optional snapshot read timestamp to trade freshness for + // performance. + google.protobuf.Timestamp read_time = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Connect settings retrieval request. +message ResolveConnectSettingsRequest { + // Required. Cloud SQL instance ID. This does not include the project ID. + string dns_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The region of the instance. + string location = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Connect settings retrieval response. +message ConnectSettings { + // Various Certificate Authority (CA) modes for certificate signing. + enum CaMode { + // CA mode is unspecified. It is effectively the same as + // `GOOGLE_MANAGED_INTERNAL_CA`. + CA_MODE_UNSPECIFIED = 0; + + // Google-managed self-signed internal CA. + GOOGLE_MANAGED_INTERNAL_CA = 1; + + // Google-managed regional CA part of root CA hierarchy hosted on Google + // Cloud's Certificate Authority Service (CAS). + GOOGLE_MANAGED_CAS_CA = 2; + + // Customer-managed CA hosted on Google Cloud's Certificate Authority + // Service (CAS). + CUSTOMER_MANAGED_CAS_CA = 3; + } + + // Details of a single read pool node of a read pool. + message ConnectPoolNodeConfig { + // Output only. The name of the read pool node. Doesn't include the project + // ID. + optional string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Mappings containing IP addresses that can be used to connect + // to the read pool node. + repeated IpMapping ip_addresses = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The DNS name of the read pool node. + optional string dns_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of DNS names used by this read pool node. + repeated DnsNameMapping dns_names = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // MdxProtocolSupport describes parts of the MDX protocol supported by this + // instance. + enum MdxProtocolSupport { + // Not specified. + MDX_PROTOCOL_SUPPORT_UNSPECIFIED = 0; + + // Client should send the client protocol type in the MDX request. + CLIENT_PROTOCOL_TYPE = 1; + } + + // This is always `sql#connectSettings`. + string kind = 1; + + // SSL configuration. + SslCert server_ca_cert = 2; + + // The assigned IP addresses for the instance. + repeated IpMapping ip_addresses = 3; + + // The cloud region for the instance. e.g. `us-central1`, `europe-west1`. + // The region cannot be changed after instance creation. + string region = 4; + + // The database engine type and version. The `databaseVersion` + // field cannot be changed after instance creation. + // MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default), + // or `MYSQL_5_6`. + // PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`, + // `POSTGRES_11` or `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`. + // SQL Server instances: `SQLSERVER_2017_STANDARD` (default), + // `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`, + // `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`, + // `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or + // `SQLSERVER_2019_WEB`. + SqlDatabaseVersion database_version = 31; + + // `SECOND_GEN`: Cloud SQL database instance. + // `EXTERNAL`: A database server that is not managed by Google. + // This property is read-only; use the `tier` property in the `settings` + // object to determine the database type. + SqlBackendType backend_type = 32; + + // Whether PSC connectivity is enabled for this instance. + bool psc_enabled = 33; + + // The dns name of the instance. + string dns_name = 34; + + // Specify what type of CA is used for the server certificate. + CaMode server_ca_mode = 35; + + // Custom subject alternative names for the server certificate. + repeated string custom_subject_alternative_names = 37; + + // Output only. The list of DNS names used by this instance. + repeated DnsNameMapping dns_names = 38 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The number of read pool nodes in a read pool. + optional int32 node_count = 63; + + // Output only. Entries containing information about each read pool node of + // the read pool. + repeated ConnectPoolNodeConfig nodes = 64 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Output only. mdx_protocol_support controls how the client uses + // metadata exchange when connecting to the instance. The values in the list + // representing parts of the MDX protocol that are supported by this instance. + // When the list is empty, the instance does not support MDX, so the client + // must not send an MDX request. The default is empty. + repeated MdxProtocolSupport mdx_protocol_support = 39 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Output only. Connection name of the Cloud SQL instance used in + // connection strings, in the format project:region:instance. + string connection_name = 40 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Ephemeral certificate creation request. +message GenerateEphemeralCertRequest { + // Cloud SQL instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + // PEM encoded public key to include in the signed certificate. + string public_key = 3 [json_name = "public_key"]; + + // Optional. Access token to include in the signed certificate. + string access_token = 4 + [json_name = "access_token", (google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional snapshot read timestamp to trade freshness for + // performance. + google.protobuf.Timestamp read_time = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, it will contain the cert valid duration. + google.protobuf.Duration valid_duration = 12 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Ephemeral certificate creation request. +message GenerateEphemeralCertResponse { + // Generated cert + SslCert ephemeral_cert = 1; +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_data.proto b/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_data.proto new file mode 100644 index 000000000000..bbc0f61fe21c --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_data.proto @@ -0,0 +1,221 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1beta4; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1beta4/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlDataProto"; +option java_package = "com.google.cloud.sql.v1beta4"; + +// Service for streaming data to and from Cloud SQL instances. +service SqlDataService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // `StreamSqlData` establishes a bidirectional stream to a Cloud SQL instance, + // and then streams data to and from the instance. + // + // The first message from the client MUST be a `StreamSqlDataRequest` request + // with configuration settings, including required values for the + // `connection_settings` field. Subsequent messages from the client may + // contain the `payload` field. + // + // Messages from the server may contain the `payload` field. + // + // The `payload` fields of the request and response streams contain the raw + // data of the database's native wire protocol (e.g., PostgreSQL wire + // protocol). The database client is responsible for generating and parsing + // this data. + // + // Any errors on initial connection (e.g., connection failure, authorization + // issues, network problems) will result in the stream being terminated with + // an appropriate RPC status exception. + // + // After a successful connection is made, if an error occurs, then the server + // terminates connection and returns the appropriate RPC status exception. + // + // Add the request params headers to the request to ensure that + // the streaming request is routed to the correct service for your database. + // + // Use this format for the request params header: + // + // `x-goog-request-params`: + // location_id={location_path}&instance_id={instance_path}` + // + // `location_path` is `locations/{location_name}` + // `instance_path` is `projects/{project_name}/instances/{instance_name}` + // + // for example: + // `x-goog-request-params`: + // `location_id=locations/us-central1&instance_id=projects/myproject/instances/instancename` + rpc StreamSqlData(stream StreamSqlDataRequest) + returns (stream StreamSqlDataResponse) {} +} + +// Message sent from the client to `SqlDataService`. +message StreamSqlDataRequest { + // Optional. Acknowledges data received by the client. + Ack ack = 4 [(google.api.field_behavior) = OPTIONAL]; + + // The message to the server. + oneof message { + // Starts a new session. When starting a new session, this is the first + // message the client sends. + StartSession start_session = 5; + + // Continues an existing session. When continuing an existing session, this + // is the first message the client sends. + ContinueSession continue_session = 6; + + // Database data. + DataPacket data = 7; + + // Terminates the session. This closes the connection to the database. + TerminateSession terminate_session = 8; + } + + // Optional. Deprecated: Use `StartSession.instance_id` or + // `ContinueSession.instance_id` instead. + // The Cloud SQL instance resource name, for example: + // projects/example-project/instances/example-instance + string instance_id = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudsql.googleapis.com/Instance" + } + ]; +} + +// Start a new session. The client must send this as the first message to the +// server to start a new session. The client may immediately send Data messages +// without waiting for a reply from the server. +message StartSession { + // Required. `location_id` is used to route the + // request to a specific region. Use the same region which was used to create + // the instance. Use the format `locations/{location}`, for example: + // `locations/us-central1`. + string location_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Cloud SQL instance resource name, for example: + // projects/example-project/instances/example-instance + string instance_id = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsql.googleapis.com/Instance" + } + ]; + + // Optional. The session id, chosen by the client. This should be an + // unguessable string. If the client does not intend to reconnect to this + // session, the client may leave session_id unset. + string session_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Reconnects to an existing session. The client must send this as the first +// message to the server to reconnect to an existing session. The client may +// immediately send Data messages without waiting for a reply from the server. +message ContinueSession { + // Required. `location_id` is used to route the + // request to a specific region. Use the same region which was used to create + // the instance. Use the format `locations/{location}`, for example: + // `locations/us-central1`. + string location_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Cloud SQL instance resource name, for example: + // projects/example-project/instances/example-instance + string instance_id = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsql.googleapis.com/Instance" + } + ]; + + // Required. The id of the session to reconnect. + string session_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent from SqlDataService back to the client. +message StreamSqlDataResponse { + // Acknowledges data received by the server. + Ack ack = 2; + + // A message from the server to the client. + oneof message { + // The first message from the server to the client, containing metadata + // about this session. + SessionMetadata session_metadata = 3; + + // Data from the database. + DataPacket data = 4; + + // Terminates the session. This indicates that the database connection + // is closed. When the client receives this message, it should not + // attempt to reconnect. + TerminateSession terminate_session = 5; + } +} + +// Metadata from the server to the client about the session. The server will +// always send this as the first message +message SessionMetadata { + // The features supported by the server for this session. This field is used + // by the client to determine which features are available on the server. + // The features supported by the server for this session. + repeated SqlDataFeature supported_features = 1; +} + +// Contains data being sent or received by the database. +message DataPacket { + // Optional. The absolute byte offset of the first byte in this payload. + // 0 for new connections or resumed connections that hasn't acked any bytes + // from server. Non-zero for resumed connections + int64 first_byte_offset = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Raw data being sent or received by the database. + bytes data = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Acknowledges data received by the client or server. +message Ack { + // Required. The absolute number of bytes processed in the session. + int64 received_offset = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Indicates that the session is permanently ended. +message TerminateSession { + // Required. The session termination status. + google.rpc.Status status = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The session features. The server must send the supported features in its +// first message to the client. +enum SqlDataFeature { + // The feature is not specified. This value should not be used. + SQL_DATA_FEATURE_UNSPECIFIED = 0; + + // The server supports reconnecting to the session. If this feature is not + // present, the client should not attempt to reconnect to the session. + SQL_DATA_FEATURE_RECONNECT = 1; +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_iam_policies.proto b/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_iam_policies.proto new file mode 100644 index 000000000000..b115c94055c5 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_iam_policies.proto @@ -0,0 +1,30 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1beta4; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1beta4/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlIamPoliciesProto"; +option java_package = "com.google.cloud.sql.v1beta4"; + +// Service for providing IAM Meta APIs for Cloud SQL. +service SqlIamPoliciesService { + option (google.api.default_host) = "sqladmin.googleapis.com"; +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_resources.proto b/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_resources.proto new file mode 100644 index 000000000000..6f15bce476f4 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_resources.proto @@ -0,0 +1,4266 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1beta4; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/type/interval.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1beta4/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlResourcesProto"; +option java_package = "com.google.cloud.sql.v1beta4"; +option (google.api.resource_definition) = { + type: "backupdr.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}" +}; +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/ServiceConnectionPolicy" + pattern: "projects/{project}/regions/{region}/serviceConnectionPolicies/{service_connection_policy}" +}; +option (google.api.resource_definition) = { + type: "cloudsql.googleapis.com/Instance" + pattern: "projects/{project}/instances/{instance}" +}; + +// An entry for an Access Control list. +message AclEntry { + // The allowlisted value for the access control list. + string value = 1; + + // The time when this access control entry expires in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp expiration_time = 2; + + // Optional. A label to identify this entry. + string name = 3 [(google.api.field_behavior) = OPTIONAL]; + + // This is always `sql#aclEntry`. + string kind = 4; +} + +// An Admin API warning message. +message ApiWarning { + enum SqlApiWarningCode { + // An unknown or unset warning type from Cloud SQL API. + SQL_API_WARNING_CODE_UNSPECIFIED = 0; + + // Warning when one or more regions are not reachable. The returned result + // set may be incomplete. + REGION_UNREACHABLE = 1; + + // Warning when user provided maxResults parameter exceeds the limit. The + // returned result set may be incomplete. + MAX_RESULTS_EXCEEDS_LIMIT = 2; + + // Warning when user tries to create/update a user with credentials that + // have previously been compromised by a public data breach. + COMPROMISED_CREDENTIALS = 3; + + // Warning when the operation succeeds but some non-critical workflow state + // failed. + INTERNAL_STATE_FAILURE = 4; + } + + // Code to uniquely identify the warning type. + SqlApiWarningCode code = 1; + + // The warning message. + string message = 2; + + // The region name for REGION_UNREACHABLE warning. + string region = 3; +} + +// We currently only support backup retention by specifying the number +// of backups we will retain. +message BackupRetentionSettings { + // The units that retained_backups specifies, we only support COUNT. + enum RetentionUnit { + // Backup retention unit is unspecified, will be treated as COUNT. + RETENTION_UNIT_UNSPECIFIED = 0; + + // Retention will be by count, eg. "retain the most recent 7 backups". + COUNT = 1; + } + + // The unit that 'retained_backups' represents. + RetentionUnit retention_unit = 1; + + // Depending on the value of retention_unit, this is used to determine + // if a backup needs to be deleted. If retention_unit is 'COUNT', we will + // retain this many backups. + google.protobuf.Int32Value retained_backups = 2; +} + +// Database instance backup configuration. +message BackupConfiguration { + // This value contains the storage location of the transactional logs + // used to perform point-in-time recovery (PITR) for the database. + enum TransactionalLogStorageState { + // Unspecified. + TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED = 0; + + // The transaction logs used for PITR for the instance are stored + // on a data disk. + DISK = 1; + + // The transaction logs used for PITR for the instance are switching from + // being stored on a data disk to being stored in Cloud Storage. + // Only applicable to MySQL. + SWITCHING_TO_CLOUD_STORAGE = 2; + + // The transaction logs used for PITR for the instance are now stored + // in Cloud Storage. Previously, they were stored on a data disk. + // Only applicable to MySQL. + SWITCHED_TO_CLOUD_STORAGE = 3; + + // The transaction logs used for PITR for the instance are stored in + // Cloud Storage. Only applicable to MySQL and PostgreSQL. + CLOUD_STORAGE = 4; + } + + // Backup tier that manages the backups for the instance. + enum BackupTier { + // Unspecified. + BACKUP_TIER_UNSPECIFIED = 0; + + // Instance is managed by Cloud SQL. + STANDARD = 1; + + // Deprecated: ADVANCED is deprecated. Please use ENHANCED instead. + ADVANCED = 2 [deprecated = true]; + + // Instance is managed by Google Cloud Backup and DR Service. + ENHANCED = 3; + } + + // Start time for the daily backup configuration in UTC timezone in the 24 + // hour format - `HH:MM`. + string start_time = 1; + + // Whether this configuration is enabled. + google.protobuf.BoolValue enabled = 2; + + // This is always `sql#backupConfiguration`. + string kind = 3; + + // (MySQL only) Whether binary log is enabled. If backup configuration is + // disabled, binarylog must be disabled as well. + google.protobuf.BoolValue binary_log_enabled = 4; + + // Reserved for future use. + google.protobuf.BoolValue replication_log_archiving_enabled = 5; + + // Location of the backup + string location = 6; + + // Whether point in time recovery is enabled. + google.protobuf.BoolValue point_in_time_recovery_enabled = 7; + + // The number of days of transaction logs we retain for point in time + // restore, from 1-7. + google.protobuf.Int32Value transaction_log_retention_days = 9; + + // Backup retention settings. + BackupRetentionSettings backup_retention_settings = 10; + + // Output only. This value contains the storage location of transactional logs + // for the database for point-in-time recovery. + optional TransactionalLogStorageState transactional_log_storage_state = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Backup tier that manages the backups for the instance. + optional BackupTier backup_tier = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A BackupRun resource. +message BackupRun { + // This is always `sql#backupRun`. + string kind = 1; + + // The status of this run. + SqlBackupRunStatus status = 2; + + // The time the run was enqueued in UTC timezone in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp enqueued_time = 3; + + // The identifier for this backup run. Unique only for a specific Cloud SQL + // instance. + int64 id = 4; + + // The time the backup operation actually started in UTC timezone in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp start_time = 5; + + // The time the backup operation completed in UTC timezone in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp end_time = 6; + + // Information about why the backup operation failed. This is only present if + // the run has the FAILED status. + OperationError error = 7; + + // The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL". + // This field defaults to "ON_DEMAND" and is ignored, when specified for + // insert requests. + SqlBackupRunType type = 8; + + // The description of this run, only applicable to on-demand backups. + string description = 9; + + // The start time of the backup window during which this the backup was + // attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for + // example `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp window_start_time = 10; + + // Name of the database instance. + string instance = 11; + + // The URI of this resource. + string self_link = 12; + + // Location of the backups. + string location = 13; + + // Output only. The instance database version at the time this backup was + // made. + SqlDatabaseVersion database_version = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Encryption configuration specific to a backup. + DiskEncryptionConfiguration disk_encryption_configuration = 16; + + // Encryption status specific to a backup. + DiskEncryptionStatus disk_encryption_status = 17; + + // Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT. + SqlBackupKind backup_kind = 19; + + // Backup time zone to prevent restores to an instance with + // a different time zone. Now relevant only for SQL Server. + string time_zone = 23; + + // Output only. The maximum chargeable bytes for the backup. + optional int64 max_chargeable_bytes = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A backup resource. +message Backup { + option (google.api.resource) = { + type: "sqladmin.googleapis.com/Backup" + pattern: "projects/{project}/backups/{backup}" + }; + + // The backup type. + enum SqlBackupType { + // This is an unknown backup type. + SQL_BACKUP_TYPE_UNSPECIFIED = 0; + + // The backup schedule triggers a backup automatically. + AUTOMATED = 1; + + // The user triggers a backup manually. + ON_DEMAND = 2; + + // The backup that's created when the instance is deleted. + FINAL = 3; + } + + // The backup's state + enum SqlBackupState { + // The state of the backup is unknown. + SQL_BACKUP_STATE_UNSPECIFIED = 0; + + // The backup that's added to a queue. + ENQUEUED = 1; + + // The backup is in progress. + RUNNING = 2; + + // The backup failed. + FAILED = 3; + + // The backup is successful. + SUCCESSFUL = 4; + + // The backup is being deleted. + DELETING = 5; + + // Deletion of the backup failed. + DELETION_FAILED = 6; + } + + // Output only. The resource name of the backup. + // Format: projects/{project}/backups/{backup}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This is always `sql#backup`. + string kind = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The URI of this resource. + string self_link = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of this backup. The type can be "AUTOMATED", + // "ON_DEMAND", or “FINAL”. + SqlBackupType type = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The description of this backup. + string description = 5; + + // The name of the database instance. + string instance = 6; + + // The storage location of the backups. The location can be multi-regional. + string location = 7; + + // Output only. This output contains the following values: + // start_time: All database writes up to this time are available. + // end_time: Any database writes after this time aren't available. + google.type.Interval backup_interval = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of this backup. + SqlBackupState state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information about why the backup operation fails (for example, + // when the backup state fails). + OperationError error = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This output contains the encryption configuration for a backup + // and the resource name of the KMS key for disk encryption. + string kms_key = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This output contains the encryption status for a backup and + // the version of the KMS key that's used to encrypt the Cloud SQL instance. + string kms_key_version = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT. + SqlBackupKind backup_kind = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This output contains a backup time zone. If a Cloud SQL for + // SQL Server instance has a different time zone from the backup's time zone, + // then the restore to the instance doesn't happen. + string time_zone = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + oneof expiration { + // Input only. The time-to-live (TTL) interval for this resource (in days). + // For example: ttlDays:7, means 7 days from the current time. The + // expiration time can't exceed 365 days from the time that the backup is + // created. + int64 ttl_days = 16 [(google.api.field_behavior) = INPUT_ONLY]; + + // Backup expiration time. + // A UTC timestamp of when this resource expired. + google.protobuf.Timestamp expiry_time = 17; + } + + // Output only. The database version of the instance of at the time this + // backup was made. + SqlDatabaseVersion database_version = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The maximum chargeable bytes for the backup. + optional int64 max_chargeable_bytes = 23 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Output only. Timestamp in UTC of when the instance associated + // with this backup is deleted. + google.protobuf.Timestamp instance_deletion_time = 24 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Output only. Instance setting of the source instance that's + // associated with this backup. + DatabaseInstance instance_settings = 25 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. The mapping to backup run resource used for IAM validations. + string backup_run = 26 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This status indicates whether the backup satisfies PZS. + // + // The status is reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 27 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This status indicates whether the backup satisfies PZI. + // + // The status is reserved for future use. + google.protobuf.BoolValue satisfies_pzi = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Backup run list results. +message BackupRunsListResponse { + // This is always `sql#backupRunsList`. + string kind = 1; + + // A list of backup runs in reverse chronological order of the enqueued time. + repeated BackupRun items = 2; + + // The continuation token, used to page through large result sets. Provide + // this value in a subsequent request to return the next page of results. + string next_page_token = 3; +} + +// Binary log coordinates. +message BinLogCoordinates { + // Name of the binary log file for a Cloud SQL instance. + string bin_log_file_name = 1; + + // Position (offset) within the binary log file. + int64 bin_log_position = 2; + + // This is always `sql#binLogCoordinates`. + string kind = 3; +} + +// Backup context. +message BackupContext { + // The identifier of the backup. + int64 backup_id = 1; + + // This is always `sql#backupContext`. + string kind = 2; + + // The name of the backup. + // Format: projects/{project}/backups/{backup} + string name = 3; +} + +// Database instance clone context. +message CloneContext { + // This is always `sql#cloneContext`. + string kind = 1; + + // Reserved for future use. + int64 pitr_timestamp_ms = 2; + + // Name of the Cloud SQL instance to be created as a clone. + string destination_instance_name = 3; + + // Binary log coordinates, if specified, identify the position up to which the + // source instance is cloned. If not specified, the source instance is + // cloned up to the most recent binary log coordinates. + BinLogCoordinates bin_log_coordinates = 4; + + // Timestamp, if specified, identifies the time to which the source instance + // is cloned. + google.protobuf.Timestamp point_in_time = 5; + + // The name of the allocated ip range for the private ip Cloud SQL instance. + // For example: "google-managed-services-default". If set, the cloned instance + // ip will be created in the allocated range. The range name must comply with + // [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name + // must be 1-63 characters long and match the regular expression + // [a-z]([-a-z0-9]*[a-z0-9])?. + // Reserved for future use. + string allocated_ip_range = 6; + + // (SQL Server only) Clone only the specified databases from the source + // instance. Clone all databases if empty. + repeated string database_names = 9; + + // Optional. Copy clone and point-in-time recovery clone of an instance to the + // specified zone. If no zone is specified, clone to the same primary zone as + // the source instance. + optional string preferred_zone = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Copy clone and point-in-time recovery clone of a regional + // instance in the specified zones. If not specified, clone to the same + // secondary zone as the source instance. This value cannot be the same as the + // preferred_zone field. + optional string preferred_secondary_zone = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // The timestamp used to identify the time when the source instance is + // deleted. If this instance is deleted, then you must set the timestamp. + optional google.protobuf.Timestamp source_instance_deletion_time = 12; + + // Optional. The project ID of the destination project where the cloned + // instance will be created. To perform a cross-project clone, this field is + // required. If not specified, the clone is created in the same project + // as the source instance. + optional string destination_project = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The fully qualified URI of the VPC network to which the cloned + // instance will be connected via private services access for private IP. For + // example:`projects/my-network-project/global/networks/my-network`. This + // field is only required for cross-project cloning. + optional string destination_network = 14 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; +} + +// Represents a SQL database on the Cloud SQL instance. +message Database { + // This is always `sql#database`. + string kind = 1; + + // The Cloud SQL charset value. + string charset = 2; + + // The Cloud SQL collation value. + string collation = 3; + + // This field is deprecated and will be removed from a future version of the + // API. + string etag = 4; + + // The name of the database in the Cloud SQL instance. This does not include + // the project ID or instance name. + string name = 5; + + // The name of the Cloud SQL instance. This does not include the project ID. + string instance = 6; + + // The URI of this resource. + string self_link = 7; + + // The project ID of the project containing the Cloud SQL database. The Google + // apps domain is prefixed if applicable. + string project = 8; + + oneof database_details { + SqlServerDatabaseDetails sqlserver_database_details = 9; + } +} + +// Represents a Sql Server database on the Cloud SQL instance. +message SqlServerDatabaseDetails { + // The version of SQL Server with which the database is to be made compatible + int32 compatibility_level = 1; + + // The recovery model of a SQL Server database + string recovery_model = 2; +} + +// Database flags for Cloud SQL instances. +message DatabaseFlags { + // The name of the flag. These flags are passed at instance startup, so + // include both server options and system variables. Flags are + // specified with underscores, not hyphens. For more information, see + // [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags) + // in the Cloud SQL documentation. + string name = 1; + + // The value of the flag. Boolean flags are set to `on` for true + // and `off` for false. This field must be omitted if the flag + // doesn't take a value. + string value = 2; +} + +// Initial sync flags for certain Cloud SQL APIs. +// Currently used for the MySQL external server initial dump. +message SyncFlags { + // The name of the flag. + string name = 1; + + // The value of the flag. This field must be omitted if the flag + // doesn't take a value. + string value = 2; +} + +// Reference to another Cloud SQL instance. +message InstanceReference { + // The name of the Cloud SQL instance being referenced. + // This does not include the project ID. + string name = 1; + + // The region of the Cloud SQL instance being referenced. + string region = 2; + + // The project ID of the Cloud SQL instance being referenced. + // The default is the same project ID as the instance references it. + string project = 3; +} + +// A Cloud SQL instance resource. +message DatabaseInstance { + // The current serving state of the database instance. + enum SqlInstanceState { + // The state of the instance is unknown. + SQL_INSTANCE_STATE_UNSPECIFIED = 0; + + // The instance is running, or has been stopped by owner. + RUNNABLE = 1; + + // The instance is not available, for example due to problems with billing. + SUSPENDED = 2; + + // The instance is being deleted. + PENDING_DELETE = 3; + + // The instance is being created. + PENDING_CREATE = 4; + + // The instance is down for maintenance. + MAINTENANCE = 5; + + // The creation of the instance failed or a fatal error occurred during + // maintenance. + FAILED = 6; + + // Deprecated + ONLINE_MAINTENANCE = 7 [deprecated = true]; + + // (Applicable to read pool nodes only.) The read pool node needs to be + // repaired. The database might be unavailable. + REPAIRING = 8; + } + + message SqlFailoverReplica { + // The name of the failover replica. If specified at instance creation, a + // failover replica is created for the instance. The name + // doesn't include the project ID. + string name = 1; + + // The availability status of the failover replica. A false status indicates + // that the failover replica is out of sync. The primary instance can only + // failover to the failover replica when the status is true. + google.protobuf.BoolValue available = 2; + } + + // Any scheduled maintenance for this instance. + message SqlScheduledMaintenance { + // The start time of any upcoming scheduled maintenance for this instance. + google.protobuf.Timestamp start_time = 1; + + bool can_defer = 2 [deprecated = true]; + + // If the scheduled maintenance can be rescheduled. + bool can_reschedule = 3; + + // Maintenance cannot be rescheduled to start beyond this deadline. + optional google.protobuf.Timestamp schedule_deadline_time = 4; + } + + // This message wraps up the information written by out-of-disk detection job. + message SqlOutOfDiskReport { + // This enum lists all possible states regarding out-of-disk issues. + enum SqlOutOfDiskState { + // Unspecified state + SQL_OUT_OF_DISK_STATE_UNSPECIFIED = 0; + + // The instance has plenty space on data disk + NORMAL = 1; + + // Data disk is almost used up. It is shutdown to prevent data + // corruption. + SOFT_SHUTDOWN = 2; + } + + // This field represents the state generated by the proactive database + // wellness job for OutOfDisk issues. + // * Writers: + // * the proactive database wellness job for OOD. + // * Readers: + // * the proactive database wellness job + optional SqlOutOfDiskState sql_out_of_disk_state = 1; + + // The minimum recommended increase size in GigaBytes + // This field is consumed by the frontend + // * Writers: + // * the proactive database wellness job for OOD. + // * Readers: + optional int32 sql_min_recommended_increase_size_gb = 2; + } + + // The SQL network architecture for the instance. + enum SqlNetworkArchitecture { + SQL_NETWORK_ARCHITECTURE_UNSPECIFIED = 0; + + // The instance uses the new network architecture. + NEW_NETWORK_ARCHITECTURE = 1; + + // The instance uses the old network architecture. + OLD_NETWORK_ARCHITECTURE = 2; + } + + // Details of a single read pool node of a read pool. + message PoolNodeConfig { + // Output only. The name of the read pool node, to be used for retrieving + // metrics and logs. + optional string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The zone of the read pool node. + optional string gce_zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Mappings containing IP addresses that can be used to connect + // to the read pool node. + repeated IpMapping ip_addresses = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The DNS name of the read pool node. + optional string dns_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the read pool node. + optional SqlInstanceState state = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of DNS names used by this read pool node. + repeated DnsNameMapping dns_names = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Private Service Connect (PSC) service attachment of the + // read pool node. + optional string psc_service_attachment_link = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of settings for requested automatically-setup + // Private Service Connect (PSC) consumer endpoints that can be used to + // connect to this read pool node. + repeated PscAutoConnectionConfig psc_auto_connections = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // This is always `sql#instance`. + string kind = 1; + + // The current serving state of the Cloud SQL instance. + SqlInstanceState state = 2; + + // The database engine type and version. The `databaseVersion` field cannot + // be changed after instance creation. + SqlDatabaseVersion database_version = 3; + + // The user settings. + Settings settings = 4; + + // This field is deprecated and will be removed from a future version of the + // API. Use the `settings.settingsVersion` field instead. + string etag = 5; + + // The name and status of the failover replica. + SqlFailoverReplica failover_replica = 6; + + // The name of the instance which will act as primary in the replication + // setup. + string master_instance_name = 7; + + // The replicas of the instance. + repeated string replica_names = 8; + + // The maximum disk size of the instance in bytes. + google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; + + // The current disk usage of the instance in bytes. This property has been + // deprecated. Use the + // "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud + // Monitoring API instead. Please see [this + // announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ) + // for details. + google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; + + // The assigned IP addresses for the instance. + repeated IpMapping ip_addresses = 11; + + // SSL configuration. + SslCert server_ca_cert = 12; + + // The instance type. + SqlInstanceType instance_type = 13; + + // The project ID of the project containing the Cloud SQL instance. The Google + // apps domain is prefixed if applicable. + string project = 14; + + // The IPv6 address assigned to the instance. + // (Deprecated) This property was applicable only + // to First Generation instances. + string ipv6_address = 15 [deprecated = true]; + + // The service account email address assigned to the instance. \This + // property is read-only. + string service_account_email_address = 16; + + // Configuration specific to on-premises instances. + OnPremisesConfiguration on_premises_configuration = 17; + + // Configuration specific to failover replicas and read replicas. + ReplicaConfiguration replica_configuration = 18; + + // The backend type. + // `SECOND_GEN`: Cloud SQL database instance. + // `EXTERNAL`: A database server that is not managed by Google. + // + // This property is read-only; use the `tier` property in the `settings` + // object to determine the database type. + SqlBackendType backend_type = 19; + + // The URI of this resource. + string self_link = 20; + + // If the instance state is SUSPENDED, the reason for the suspension. + repeated SqlSuspensionReason suspension_reason = 21; + + // Connection name of the Cloud SQL instance used in connection strings. + string connection_name = 22; + + // Name of the Cloud SQL instance. This does not include the project ID. + string name = 23; + + // The geographical region of the Cloud SQL instance. + // + // It can be one of the + // [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r) + // where Cloud SQL operates: + // + // For example, `asia-east1`, `europe-west1`, and `us-central1`. + // The default value is `us-central1`. + string region = 24; + + // The Compute Engine zone that the instance is currently serving from. This + // value could be different from the zone that was specified when the instance + // was created if the instance has failed over to its secondary zone. WARNING: + // Changing this might restart the instance. + string gce_zone = 25; + + // The Compute Engine zone that the failover instance is currently serving + // from for a regional instance. This value could be different + // from the zone that was specified when the instance + // was created if the instance has failed over to its secondary/failover zone. + string secondary_gce_zone = 34; + + // Disk encryption configuration specific to an instance. + DiskEncryptionConfiguration disk_encryption_configuration = 26; + + // Disk encryption status specific to an instance. + DiskEncryptionStatus disk_encryption_status = 27; + + // Initial root password. Use only on creation. You must set root passwords + // before you can connect to PostgreSQL instances. + string root_password = 29; + + // The start time of any upcoming scheduled maintenance for this instance. + SqlScheduledMaintenance scheduled_maintenance = 30; + + // This status indicates whether the instance satisfies PZS. + // + // The status is reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 35; + + // Output only. Stores the current database version running on the instance + // including minor version such as `MYSQL_8_0_18`. + string database_installed_version = 40 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // This field represents the report generated by the proactive database + // wellness job for OutOfDisk issues. + // * Writers: + // * the proactive database wellness job for OOD. + // * Readers: + // * the proactive database wellness job + optional SqlOutOfDiskReport out_of_disk_report = 38; + + // Output only. The time when the instance was created in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp create_time = 39 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List all maintenance versions applicable on the instance + repeated string available_maintenance_versions = 41 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The current software version on the instance. + string maintenance_version = 42; + + // Output only. All database versions that are available for upgrade. + repeated AvailableDatabaseVersion upgradable_database_versions = 45 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The SQL network architecture for the instance. + optional SqlNetworkArchitecture sql_network_architecture = 47; + + // Output only. The link to service attachment of PSC instance. + optional string psc_service_attachment_link = 48 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The dns name of the instance. + optional string dns_name = 49 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. DEPRECATED: please use write_endpoint instead. + optional string primary_dns_name = 51 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The dns name of the primary instance in a replication group. + optional string write_endpoint = 52 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A primary instance and disaster recovery (DR) replica pair. + // A DR replica is a cross-region replica that you designate + // for failover in the event that the primary instance + // experiences regional failure. + // Applicable to MySQL and PostgreSQL. + optional ReplicationCluster replication_cluster = 54; + + // Gemini instance configuration. + optional GeminiInstanceConfig gemini_config = 55; + + // Output only. This status indicates whether the instance satisfies PZI. + // + // The status is reserved for future use. + google.protobuf.BoolValue satisfies_pzi = 56 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Whether Cloud SQL is enabled to switch storing point-in-time + // recovery log files from a data disk to Cloud Storage. + optional google.protobuf.BoolValue + switch_transaction_logs_to_cloud_storage_enabled = 57 + [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. Determines whether an in-place major version upgrade of + // replicas happens when an in-place major version upgrade of a primary + // instance is initiated. + optional google.protobuf.BoolValue + include_replicas_for_major_version_upgrade = 59 + [(google.api.field_behavior) = INPUT_ONLY]; + + // Optional. Input only. Immutable. Tag keys and tag values that are bound to + // this instance. You must represent each item in the map as: + // `"" : ""`. + // + // For example, a single resource can have the following tags: + // ``` + // "123/environment": "production", + // "123/costCenter": "marketing", + // ``` + // + // For more information on tag creation and management, see + // https://cloud.google.com/resource-manager/docs/tags/tags-overview. + map tags = 60 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; + + // The number of read pool nodes in a read pool. + optional int32 node_count = 63; + + // Output only. Entries containing information about each read pool node of + // the read pool. + repeated PoolNodeConfig nodes = 64 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of DNS names used by this instance. + repeated DnsNameMapping dns_names = 67 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// DNS metadata. +message DnsNameMapping { + // The connection type of the DNS name. + enum ConnectionType { + // Unknown connection type. + CONNECTION_TYPE_UNSPECIFIED = 0; + + // Public IP. + PUBLIC = 1; + + // Private services access (private IP). + PRIVATE_SERVICES_ACCESS = 2; + + // Private Service Connect. + PRIVATE_SERVICE_CONNECT = 3; + } + + // The scope that the DNS name applies to. + enum DnsScope { + // DNS scope not set. This value should not be used. + DNS_SCOPE_UNSPECIFIED = 0; + + // Indicates an instance-level DNS name. + INSTANCE = 1; + + // Indicates a cluster-level DNS name. + CLUSTER = 2; + } + + // The system responsible for managing the DNS record. + enum RecordManager { + // Record manager not set. This value should not be used. + RECORD_MANAGER_UNSPECIFIED = 0; + + // The record may be managed by the customer. It is not automatically + // managed by Cloud SQL automation. + CUSTOMER = 1; + + // The record is managed by Cloud SQL, which will create, update, and delete + // the DNS records for the zone automatically when the Cloud SQL database + // instance is created or updated. + CLOUD_SQL_AUTOMATION = 2; + } + + // Output only. The DNS name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The connection type of the DNS name. + ConnectionType connection_type = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The scope that the DNS name applies to. + DnsScope dns_scope = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The manager for this DNS record. + RecordManager record_manager = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Gemini instance configuration. +message GeminiInstanceConfig { + // Output only. Whether Gemini is enabled. + optional bool entitled = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the vacuum management is enabled. + optional bool google_vacuum_mgmt_enabled = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether canceling the out-of-memory (OOM) session is enabled. + optional bool oom_session_cancel_enabled = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the active query is enabled. + optional bool active_query_enabled = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the index advisor is enabled. + optional bool index_advisor_enabled = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the flag recommender is enabled. + optional bool flag_recommender_enabled = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A primary instance and disaster recovery (DR) replica pair. +// A DR replica is a cross-region replica that you designate for failover +// in the event that the primary instance has regional failure. +// Applicable to MySQL and PostgreSQL. +message ReplicationCluster { + // Output only. If set, this field indicates this instance has a private + // service access (PSA) DNS endpoint that is pointing to the primary instance + // of the cluster. If this instance is the primary, then the DNS endpoint + // points to this instance. After a switchover or replica failover operation, + // this DNS endpoint points to the promoted instance. This is a read-only + // field, returned to the user as information. This field can exist even if a + // standalone instance doesn't have a DR replica yet or the DR replica is + // deleted. + optional string psa_write_endpoint = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. If the instance is a primary instance, then this field identifies + // the disaster recovery (DR) replica. A DR replica is an optional + // configuration for Enterprise Plus edition instances. If the instance is a + // read replica, then the field is not set. Set this field to a replica name + // to designate a DR replica for a primary instance. Remove the replica name + // to remove the DR replica designation. + optional string failover_dr_replica_name = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Read-only field that indicates whether the replica is a DR + // replica. This field is not set if the instance is a primary instance. + optional bool dr_replica = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// An available database version. It can be a major or a minor version. +message AvailableDatabaseVersion { + // The version's major version name. + optional string major_version = 3; + + // The database version name. For MySQL 8.0, this string provides the database + // major and minor version. + optional string name = 8; + + // The database version's display name. + optional string display_name = 9; +} + +// Database list response. +message DatabasesListResponse { + // This is always `sql#databasesList`. + string kind = 1; + + // List of database resources in the instance. + repeated Database items = 2; +} + +// Read-replica configuration for connecting to the on-premises primary +// instance. +message DemoteMasterConfiguration { + // This is always `sql#demoteMasterConfiguration`. + string kind = 1; + + // MySQL specific configuration when replicating from a MySQL on-premises + // primary instance. Replication configuration information such as the + // username, password, certificates, and keys are not stored in the instance + // metadata. The configuration information is used only to set up the + // replication connection and is stored by MySQL in a file named + // `master.info` in the data directory. + DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; +} + +// Database instance demote primary instance context. +message DemoteMasterContext { + // This is always `sql#demoteMasterContext`. + string kind = 1; + + // Verify the GTID consistency for demote operation. Default value: + // `True`. Setting this flag to `false` enables you to bypass the GTID + // consistency check between on-premises primary instance and Cloud SQL + // instance during the demotion operation but also exposes you to the risk of + // future replication failures. Change the value only if you know the reason + // for the GTID divergence and are confident that doing so will not cause any + // replication issues. + google.protobuf.BoolValue verify_gtid_consistency = 2; + + // The name of the instance which will act as on-premises primary instance + // in the replication setup. + string master_instance_name = 3; + + // Configuration specific to read-replicas replicating from the on-premises + // primary instance. + DemoteMasterConfiguration replica_configuration = 4; + + // Flag to skip replication setup on the instance. + bool skip_replication_setup = 5; +} + +// Read-replica configuration specific to MySQL databases. +message DemoteMasterMySqlReplicaConfiguration { + // This is always `sql#demoteMasterMysqlReplicaConfiguration`. + string kind = 1; + + // The username for the replication connection. + string username = 2; + + // The password for the replication connection. + string password = 3; + + // PEM representation of the replica's private key. The corresponding public + // key is encoded in the client's certificate. The format of the replica's + // private key can be either PKCS #1 or PKCS #8. + string client_key = 4; + + // PEM representation of the replica's x509 certificate. + string client_certificate = 5; + + // PEM representation of the trusted CA's x509 certificate. + string ca_certificate = 6; +} + +// This context is used to demote an existing standalone instance to be +// a Cloud SQL read replica for an external database server. +message DemoteContext { + // This is always `sql#demoteContext`. + string kind = 1; + + // Required. The name of the instance which acts as an on-premises primary + // instance in the replication setup. + string source_representative_instance_name = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +enum SqlFileType { + // Unknown file type. + SQL_FILE_TYPE_UNSPECIFIED = 0; + + // File containing SQL statements. + SQL = 1; + + // File in CSV format. + CSV = 2; + + BAK = 4; + + // TDE certificate. + TDE = 8; +} + +// Database instance export context. +message ExportContext { + message SqlCsvExportOptions { + // The select query used to extract the data. + string select_query = 1; + + // Specifies the character that should appear before a data character that + // needs to be escaped. + string escape_character = 2; + + // Specifies the quoting character to be used when a data value is quoted. + string quote_character = 3; + + // Specifies the character that separates columns within each row (line) of + // the file. + string fields_terminated_by = 4; + + // This is used to separate lines. If a line does not contain all fields, + // the rest of the columns are set to their default values. + string lines_terminated_by = 6; + } + + message SqlExportOptions { + // Options for exporting from MySQL. + message MysqlExportOptions { + // Option to include SQL statement required to set up replication. If set + // to `1`, the dump file includes a CHANGE MASTER TO statement with the + // binary log coordinates, and --set-gtid-purged is set to ON. If set to + // `2`, the CHANGE MASTER TO statement is written as a SQL comment and + // has no effect. If set to any value other than `1`, --set-gtid-purged + // is set to OFF. + google.protobuf.Int32Value master_data = 1; + } + + // Options for exporting from a Cloud SQL for PostgreSQL instance. + message PostgresExportOptions { + // Optional. Use this option to include DROP <object> + // SQL statements. Use these statements to delete database objects before + // running the import operation. + google.protobuf.BoolValue clean = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Option to include an IF EXISTS SQL statement with each DROP + // statement produced by clean. + google.protobuf.BoolValue if_exists = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Tables to export, or that were exported, from the specified database. If + // you specify tables, specify one and only one database. For PostgreSQL + // instances, you can specify only one table. + repeated string tables = 1; + + // Export only schemas. + google.protobuf.BoolValue schema_only = 2; + + MysqlExportOptions mysql_export_options = 3; + + // Optional. The number of threads to use for parallel export. + google.protobuf.Int32Value threads = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether or not the export should be parallel. + google.protobuf.BoolValue parallel = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Options for exporting from a Cloud SQL for PostgreSQL instance. + PostgresExportOptions postgres_export_options = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Options for exporting BAK files (SQL Server-only) + message SqlBakExportOptions { + // Whether or not the export should be striped. + google.protobuf.BoolValue striped = 1; + + // Option for specifying how many stripes to use for the export. + // If blank, and the value of the striped field is true, + // the number of stripes is automatically chosen. + google.protobuf.Int32Value stripe_count = 2; + + // Type of this bak file will be export, FULL or DIFF, SQL Server only + BakType bak_type = 4; + + // Deprecated: copy_only is deprecated. Use differential_base instead + google.protobuf.BoolValue copy_only = 5 [deprecated = true]; + + // Whether or not the backup can be used as a differential base + // copy_only backup can not be served as differential base + google.protobuf.BoolValue differential_base = 6; + + // Optional. The begin timestamp when transaction log will be included in + // the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) + // format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all + // available logs from the beginning of retention period will be included. + // Only applied to Cloud SQL for SQL Server. + google.protobuf.Timestamp export_log_start_time = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The end timestamp when transaction log will be included in the + // export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format + // (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all + // available logs until current time will be included. Only applied to Cloud + // SQL for SQL Server. + google.protobuf.Timestamp export_log_end_time = 8 + [(google.api.field_behavior) = OPTIONAL]; + } + + message SqlTdeExportOptions { + // Required. Path to the TDE certificate public key + // in the form gs://bucketName/fileName. + // The instance must have write access to the location. + // Applicable only for SQL Server instances. + string certificate_path = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Path to the TDE certificate private key + // in the form gs://bucketName/fileName. + // The instance must have write access to the location. + // Applicable only for SQL Server instances. + string private_key_path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Password that encrypts the private key. + string private_key_password = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Certificate name. + // Applicable only for SQL Server instances. + string name = 5 [(google.api.field_behavior) = REQUIRED]; + } + + // The path to the file in Google Cloud Storage where the export will be + // stored. The URI is in the form `gs://bucketName/fileName`. If the file + // already exists, the request succeeds, but the operation fails. If + // `fileType` is `SQL` and the filename ends with .gz, + // the contents are compressed. + string uri = 1; + + // Databases to be exported.
`MySQL instances:` If + // `fileType` is `SQL` and no database is specified, all + // databases are exported, except for the `mysql` system database. + // If `fileType` is `CSV`, you can specify one database, + // either by using this property or by using the + // `csvExportOptions.selectQuery` property, which takes precedence + // over this property.
`PostgreSQL instances:` If you don't specify a + // database by name, all user databases in the instance are + // exported. This excludes system databases and Cloud SQL databases used to + // manage internal operations. Exporting all user databases is only available + // for directory-formatted parallel export. If `fileType` is `CSV`, + // this database must match the one specified in the + // `csvExportOptions.selectQuery` property.
`SQL Server + // instances:` You must specify one database to be exported, and the + // `fileType` must be `BAK`. + repeated string databases = 2; + + // This is always `sql#exportContext`. + string kind = 3; + + // Options for exporting data as SQL statements. + SqlExportOptions sql_export_options = 4; + + // Options for exporting data as CSV. `MySQL` and `PostgreSQL` + // instances only. + SqlCsvExportOptions csv_export_options = 5; + + // The file type for the specified uri. + SqlFileType file_type = 6; + + // Whether to perform a serverless export. + google.protobuf.BoolValue offload = 8; + + // Options for exporting data as BAK files. + SqlBakExportOptions bak_export_options = 9; + + // Optional. Export parameters specific to SQL Server TDE certificates + SqlTdeExportOptions tde_export_options = 10 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Database instance failover context. +message FailoverContext { + // The current settings version of this instance. Request will be rejected if + // this version doesn't match the current settings version. + int64 settings_version = 1; + + // This is always `sql#failoverContext`. + string kind = 2; +} + +// A flag resource. +message Flag { + // This is the name of the flag. Flag names always use underscores, not + // hyphens, for example: `max_allowed_packet` + string name = 1; + + // The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`, + // `INTEGER` or `NONE`. `NONE` is used for flags which do not take a + // value, such as `skip_grant_tables`. + SqlFlagType type = 2; + + // The database version this flag applies to. Can be + // MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`, + // or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`, + // `POSTGRES_11` or `POSTGRES_12`. SQL Server instances: + // `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`, + // `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`, + // `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or + // `SQLSERVER_2019_WEB`. + // See [the complete + // list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion). + repeated SqlDatabaseVersion applies_to = 3; + + // For `STRING` flags, a list of strings that the value can be set to. + repeated string allowed_string_values = 4; + + // For `INTEGER` flags, the minimum allowed value. + google.protobuf.Int64Value min_value = 5; + + // For `INTEGER` flags, the maximum allowed value. + google.protobuf.Int64Value max_value = 6; + + // Indicates whether changing this flag will trigger a database restart. Only + // applicable to Second Generation instances. + google.protobuf.BoolValue requires_restart = 7; + + // This is always `sql#flag`. + string kind = 8; + + // Whether or not the flag is considered in beta. + google.protobuf.BoolValue in_beta = 9; + + // Use this field if only certain integers are accepted. Can be combined + // with min_value and max_value to add additional values. + repeated int64 allowed_int_values = 10; + + // Scope of flag. + SqlFlagScope flag_scope = 15; + + // Recommended flag value for UI display. + oneof recommended_value { + // Recommended flag value in string format for UI display. + string recommended_string_value = 16; + + // Recommended flag value in integer format for UI display. + google.protobuf.Int64Value recommended_int_value = 17; + } +} + +// Flags list response. +message FlagsListResponse { + // This is always `sql#flagsList`. + string kind = 1; + + // List of flags. + repeated Flag items = 2; +} + +// Database instance import context. +message ImportContext { + message SqlImportOptions { + message PostgresImportOptions { + // Optional. The --clean flag for the pg_restore utility. This flag + // applies only if you enabled Cloud SQL to import files in parallel. + google.protobuf.BoolValue clean = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The --if-exists flag for the pg_restore utility. This flag + // applies only if you enabled Cloud SQL to import files in parallel. + google.protobuf.BoolValue if_exists = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The number of threads to use for parallel import. + google.protobuf.Int32Value threads = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether or not the import should be parallel. + google.protobuf.BoolValue parallel = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Options for importing from a Cloud SQL for PostgreSQL instance. + PostgresImportOptions postgres_import_options = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + message SqlCsvImportOptions { + // The table to which CSV data is imported. + string table = 1; + + // The columns to which CSV data is imported. If not specified, all columns + // of the database table are loaded with CSV data. + repeated string columns = 2; + + // Specifies the character that should appear before a data character that + // needs to be escaped. + string escape_character = 4; + + // Specifies the quoting character to be used when a data value is quoted. + string quote_character = 5; + + // Specifies the character that separates columns within each row (line) of + // the file. + string fields_terminated_by = 6; + + // This is used to separate lines. If a line does not contain all fields, + // the rest of the columns are set to their default values. + string lines_terminated_by = 8; + } + + message SqlBakImportOptions { + message EncryptionOptions { + // Path to the Certificate (.cer) in Cloud Storage, in the form + // `gs://bucketName/fileName`. The instance must have write permissions + // to the bucket and read access to the file. + string cert_path = 1; + + // Path to the Certificate Private Key (.pvk) in Cloud Storage, in the + // form `gs://bucketName/fileName`. The instance must have write + // permissions to the bucket and read access to the file. + string pvk_path = 2; + + // Password that encrypts the private key + string pvk_password = 3; + + // Optional. Whether the imported file remains encrypted. + google.protobuf.BoolValue keep_encrypted = 5 + [(google.api.field_behavior) = OPTIONAL]; + } + + EncryptionOptions encryption_options = 1; + + // Whether or not the backup set being restored is striped. + // Applies only to Cloud SQL for SQL Server. + google.protobuf.BoolValue striped = 2; + + // Whether or not the backup importing will restore database + // with NORECOVERY option. + // Applies only to Cloud SQL for SQL Server. + google.protobuf.BoolValue no_recovery = 4; + + // Whether or not the backup importing request will just bring database + // online without downloading Bak content only one of "no_recovery" and + // "recovery_only" can be true otherwise error will return. Applies only to + // Cloud SQL for SQL Server. + google.protobuf.BoolValue recovery_only = 5; + + // Type of the bak content, FULL or DIFF. + BakType bak_type = 6; + + // Optional. The timestamp when the import should stop. This timestamp is in + // the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example, + // `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT + // keyword and applies to Cloud SQL for SQL Server only. + google.protobuf.Timestamp stop_at = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The marked transaction where the import should stop. This field + // is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL + // Server only. + string stop_at_mark = 8 [(google.api.field_behavior) = OPTIONAL]; + } + + message SqlTdeImportOptions { + // Required. Path to the TDE certificate public key + // in the form gs://bucketName/fileName. + // The instance must have read access to the file. + // Applicable only for SQL Server instances. + string certificate_path = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Path to the TDE certificate private key + // in the form gs://bucketName/fileName. + // The instance must have read access to the file. + // Applicable only for SQL Server instances. + string private_key_path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Password that encrypts the private key. + string private_key_password = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Certificate name. + // Applicable only for SQL Server instances. + string name = 5 [(google.api.field_behavior) = REQUIRED]; + } + + // Path to the import file in Cloud Storage, in the form + // `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported + // when `fileType` is `SQL`. The instance must have + // write permissions to the bucket and read access to the file. + string uri = 1; + + // The target database for the import. If `fileType` is `SQL`, this field + // is required only if the import file does not specify a database, and is + // overridden by any database specification in the import file. For entire + // instance parallel import operations, the database is overridden by the + // database name stored in subdirectory name. If + // `fileType` is `CSV`, one database must be specified. + string database = 2; + + // This is always `sql#importContext`. + string kind = 3; + + // The file type for the specified uri. + // * `SQL`: The file contains SQL statements. + // * `CSV`: The file contains CSV data. + // * `BAK`: The file contains backup data for a SQL Server instance. + SqlFileType file_type = 4; + + // Options for importing data as CSV. + SqlCsvImportOptions csv_import_options = 5; + + // The PostgreSQL user for this import operation. PostgreSQL instances only. + string import_user = 6; + + // Import parameters specific to SQL Server .BAK files + SqlBakImportOptions bak_import_options = 7; + + // Optional. Options for importing data from SQL statements. + SqlImportOptions sql_import_options = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Import parameters specific to SQL Server .TDE files + // Import parameters specific to SQL Server TDE certificates + SqlTdeImportOptions tde_import_options = 9 + [(google.api.field_behavior) = OPTIONAL]; +} + +enum BakType { + // Default type. + BAK_TYPE_UNSPECIFIED = 0; + + // Full backup. + FULL = 1; + + // Differential backup. + DIFF = 2; + + // SQL Server Transaction Log + TLOG = 3; +} + +// Database instance clone request. +message InstancesCloneRequest { + // Contains details about the clone operation. + CloneContext clone_context = 1; +} + +// Database demote primary instance request. +message InstancesDemoteMasterRequest { + // Contains details about the demoteMaster operation. + DemoteMasterContext demote_master_context = 1; +} + +// This request is used to demote an existing standalone instance to be a +// Cloud SQL read replica for an external database server. +message InstancesDemoteRequest { + // Required. This context is used to demote an existing standalone instance to + // be a Cloud SQL read replica for an external database server. + DemoteContext demote_context = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Database instance export request. +message InstancesExportRequest { + // Contains details about the export operation. + ExportContext export_context = 1; +} + +// Instance failover request. +message InstancesFailoverRequest { + // Failover Context. + FailoverContext failover_context = 1; +} + +// Database instance import request. +message InstancesImportRequest { + // Contains details about the import operation. + ImportContext import_context = 1; +} + +// Request for Pre-checks for MVU +message InstancesPreCheckMajorVersionUpgradeRequest { + // Required. Contains details about the pre-check major version upgrade + // operation. + PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// MySQL-specific external server sync settings. +message MySqlSyncConfig { + // Flags to use for the initial dump. + repeated SyncFlags initial_sync_flags = 1; +} + +// Database instances list response. +message InstancesListResponse { + // This is always `sql#instancesList`. + string kind = 1; + + // List of warnings that occurred while handling the request. + repeated ApiWarning warnings = 2; + + // List of database instance resources. + repeated DatabaseInstance items = 3; + + // The continuation token, used to page through large result sets. Provide + // this value in a subsequent request to return the next page of results. + string next_page_token = 4; +} + +// Instances ListServerCas response. +message InstancesListServerCasResponse { + // List of server CA certificates for the instance. + repeated SslCert certs = 1; + + string active_version = 2; + + // This is always `sql#instancesListServerCas`. + string kind = 3; +} + +// Instances ListServerCertificatess response. +message InstancesListServerCertificatesResponse { + // List of server CA certificates for the instance. + repeated SslCert ca_certs = 1; + + // List of server certificates for the instance, signed by the corresponding + // CA from the `ca_certs` list. + repeated SslCert server_certs = 2; + + // The `sha1_fingerprint` of the active certificate from `server_certs`. + string active_version = 3; + + // This is always `sql#instancesListServerCertificates`. + string kind = 4; +} + +// Instances ListEntraIdCertificates response. +message InstancesListEntraIdCertificatesResponse { + // List of Entra ID certificates for the instance. + repeated SslCert certs = 1; + + // The `sha1_fingerprint` of the active certificate from `certs`. + string active_version = 2; + + // This is always `sql#instancesListEntraIdCertificates`. + string kind = 3; +} + +// Database instance restore backup request. +message InstancesRestoreBackupRequest { + // Parameters required to perform the restore backup operation. + RestoreBackupContext restore_backup_context = 1; + + // The name of the backup that's used to restore a Cloud SQL instance: + // Format: projects/{project-id}/backups/{backup-uid}. Only one of + // restore_backup_context, backup, backupdr_backup can be passed to the input. + string backup = 2 [ + (google.api.resource_reference) = { type: "sqladmin.googleapis.com/Backup" } + ]; + + // The name of the backup that's used to restore a Cloud SQL instance: + // Format: + // "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}". + // Only one of restore_backup_context, backup, backupdr_backup can be + // passed to the input. + string backupdr_backup = 4 [ + (google.api.resource_reference) = { type: "backupdr.googleapis.com/Backup" } + ]; + + // Optional. By using this parameter, Cloud SQL overrides any instance + // settings stored in the backup you are restoring from. You can't change the + // instance's major database version and you can only increase the disk size. + // You can use this field to restore new instances only. This field is not + // applicable for restore to existing instances. + DatabaseInstance restore_instance_settings = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This field has the same purpose as restore_instance_settings, + // changes any instance settings stored in the backup you are restoring from. + // With the difference that these fields are cleared in the settings. + repeated string restore_instance_clear_overrides_field_names = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Rotate Server CA request. +message InstancesRotateServerCaRequest { + // Contains details about the rotate server CA operation. + RotateServerCaContext rotate_server_ca_context = 1; +} + +// Rotate Server Certificate request. +message InstancesRotateServerCertificateRequest { + // Optional. Contains details about the rotate server CA operation. + RotateServerCertificateContext rotate_server_certificate_context = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Rotate Entra ID Certificate request. +message InstancesRotateEntraIdCertificateRequest { + // Optional. Contains details about the rotate Entra ID certificate operation. + RotateEntraIdCertificateContext rotate_entra_id_certificate_context = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Instance truncate log request. +message InstancesTruncateLogRequest { + // Contains details about the truncate log operation. + TruncateLogContext truncate_log_context = 1; +} + +// Request to acquire an SSRS lease for an instance. +message InstancesAcquireSsrsLeaseRequest { + // Contains details about the acquire SSRS lease operation. + AcquireSsrsLeaseContext acquire_ssrs_lease_context = 1; +} + +// Context to perform a point-in-time restore of an instance managed by +// Backup and Disaster Recovery (DR) Service. +message PointInTimeRestoreContext { + // The Backup and Disaster Recovery (DR) Service Datasource URI. + // Format: + // projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}. + optional string datasource = 1; + + // Required. The date and time to which you want to restore the instance. + google.protobuf.Timestamp point_in_time = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Target instance name. + optional string target_instance = 3; + + // Optional. The resource link for the VPC network from which the Cloud SQL + // instance is accessible for private IP. For example, + // `/projects/myProject/global/networks/default`. + optional string private_network = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the allocated IP range for the internal IP Cloud SQL + // instance. For example: "google-managed-services-default". If you set this, + // then Cloud SQL creates the IP address for the cloned instance in the + // allocated range. This range must comply with [RFC + // 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the + // name must be 1-63 characters long and match the regular expression + // [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use. + optional string allocated_ip_range = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Point-in-time recovery of an instance to the specified zone. If + // no zone is specified, then clone to the same primary zone as the source + // instance. + optional string preferred_zone = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Point-in-time recovery of a regional instance in the specified + // zones. If not specified, clone to the same secondary zone as the source + // instance. This value cannot be the same as the preferred_zone field. + optional string preferred_secondary_zone = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the instance settings that will be overridden from the + // source instance. This field is only applicable for cross project PITRs. + DatabaseInstance target_instance_settings = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the instance settings that will be cleared from the + // source instance. This field is only applicable for cross project PITRs. + repeated string target_instance_clear_settings_field_names = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The region of the target instance where the datasource will be + // restored. For example: "us-central1". + optional string region = 13 [(google.api.field_behavior) = OPTIONAL]; +} + +// Perform disk shrink context. +message PerformDiskShrinkContext { + // The target disk shrink size in GigaBytes. + int64 target_size_gb = 1; +} + +// Structured PreCheckResponse containing message, type, and required +// actions. +message PreCheckResponse { + // The type of message which can be an info, a warning, or an error that + // requires user intervention. + enum MessageType { + // Default unspecified value to prevent unintended behavior changes. + MESSAGE_TYPE_UNSPECIFIED = 0; + + // General informational messages that don't require action. + INFO = 1; + + // Warnings that might impact the upgrade but don't block it. + WARNING = 2; + + // Errors that a user must resolve before proceeding with the upgrade. + ERROR = 3; + } + + // The message to be displayed to the user. + optional string message = 2; + + // The type of message whether it is an info, warning, or error. + optional MessageType message_type = 3; + + // The actions that the user needs to take. Use repeated for multiple + // actions. + repeated string actions_required = 4; +} + +// Pre-check major version upgrade context. +message PreCheckMajorVersionUpgradeContext { + // Required. The target database version to upgrade to. + SqlDatabaseVersion target_database_version = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Output only. The responses from the precheck operation. + repeated PreCheckResponse pre_check_response = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. This is always `sql#preCheckMajorVersionUpgradeContext`. + string kind = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Instance get disk shrink config response. +message SqlInstancesGetDiskShrinkConfigResponse { + // This is always `sql#getDiskShrinkConfig`. + string kind = 1; + + // The minimum size to which a disk can be shrunk in GigaBytes. + int64 minimal_target_size_gb = 2; + + // Additional message to customers. + string message = 3; +} + +// Instance verify external sync settings response. +message SqlInstancesVerifyExternalSyncSettingsResponse { + // This is always `sql#migrationSettingErrorList`. + string kind = 1; + + // List of migration violations. + repeated SqlExternalSyncSettingError errors = 2; + + // List of migration warnings. + repeated SqlExternalSyncSettingError warnings = 3; +} + +// External primary instance migration setting error/warning. +message SqlExternalSyncSettingError { + enum SqlExternalSyncSettingErrorType { + SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED = 0; + + CONNECTION_FAILURE = 1; + + BINLOG_NOT_ENABLED = 2; + + INCOMPATIBLE_DATABASE_VERSION = 3; + + REPLICA_ALREADY_SETUP = 4; + + // The replication user is missing privileges that are required. + INSUFFICIENT_PRIVILEGE = 5; + + // Unsupported migration type. + UNSUPPORTED_MIGRATION_TYPE = 6; + + // No pglogical extension installed on databases, applicable for postgres. + NO_PGLOGICAL_INSTALLED = 7; + + // pglogical node already exists on databases, applicable for postgres. + PGLOGICAL_NODE_ALREADY_EXISTS = 8; + + // The value of parameter wal_level is not set to logical. + INVALID_WAL_LEVEL = 9; + + // The value of parameter shared_preload_libraries does not include + // pglogical. + INVALID_SHARED_PRELOAD_LIBRARY = 10; + + // The value of parameter max_replication_slots is not sufficient. + INSUFFICIENT_MAX_REPLICATION_SLOTS = 11; + + // The value of parameter max_wal_senders is not sufficient. + INSUFFICIENT_MAX_WAL_SENDERS = 12; + + // The value of parameter max_worker_processes is not sufficient. + INSUFFICIENT_MAX_WORKER_PROCESSES = 13; + + // Extensions installed are either not supported or having unsupported + // versions + UNSUPPORTED_EXTENSIONS = 14; + + // The value of parameter rds.logical_replication is not set to 1. + INVALID_RDS_LOGICAL_REPLICATION = 15; + + // The primary instance logging setup doesn't allow EM sync. + INVALID_LOGGING_SETUP = 16; + + // The primary instance database parameter setup doesn't allow EM sync. + INVALID_DB_PARAM = 17; + + // The gtid_mode is not supported, applicable for MySQL. + UNSUPPORTED_GTID_MODE = 18; + + // SQL Server Agent is not running. + SQLSERVER_AGENT_NOT_RUNNING = 19; + + // The table definition is not support due to missing primary key or replica + // identity, applicable for postgres. Note that this is a warning and won't + // block the migration. + UNSUPPORTED_TABLE_DEFINITION = 20; + + // The customer has a definer that will break EM setup. + UNSUPPORTED_DEFINER = 21; + + // SQL Server @@SERVERNAME does not match actual host name. + SQLSERVER_SERVERNAME_MISMATCH = 22; + + // The primary instance has been setup and will fail the setup. + PRIMARY_ALREADY_SETUP = 23; + + // The primary instance has unsupported binary log format. + UNSUPPORTED_BINLOG_FORMAT = 24; + + // The primary instance's binary log retention setting. + BINLOG_RETENTION_SETTING = 25; + + // The primary instance has tables with unsupported storage engine. + UNSUPPORTED_STORAGE_ENGINE = 26; + + // Source has tables with limited support + // eg: PostgreSQL tables without primary keys. + LIMITED_SUPPORT_TABLES = 27; + + // The replica instance contains existing data. + EXISTING_DATA_IN_REPLICA = 28; + + // The replication user is missing privileges that are optional. + MISSING_OPTIONAL_PRIVILEGES = 29; + + // Additional BACKUP_ADMIN privilege is granted to the replication user + // which may lock source MySQL 8 instance for DDLs during initial sync. + RISKY_BACKUP_ADMIN_PRIVILEGE = 30; + + // The Cloud Storage bucket is missing necessary permissions. + INSUFFICIENT_GCS_PERMISSIONS = 31; + + // The Cloud Storage bucket has an error in the file or contains invalid + // file information. + INVALID_FILE_INFO = 32; + + // The source instance has unsupported database settings for migration. + UNSUPPORTED_DATABASE_SETTINGS = 33; + + // The replication user is missing parallel import specific privileges. + // (e.g. LOCK TABLES) for MySQL. + MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE = 34; + + // The global variable local_infile is off on external server replica. + LOCAL_INFILE_OFF = 35; + + // This code instructs customers to turn on point-in-time recovery manually + // for the instance after promoting the Cloud SQL for PostgreSQL instance. + TURN_ON_PITR_AFTER_PROMOTE = 36; + + // The minor version of replica database is incompatible with the source. + INCOMPATIBLE_DATABASE_MINOR_VERSION = 37; + + // This warning message indicates that Cloud SQL uses the maximum number of + // subscriptions to migrate data from the source to the destination. + SOURCE_MAX_SUBSCRIPTIONS = 38; + + // Unable to verify definers on the source for MySQL. + UNABLE_TO_VERIFY_DEFINERS = 39; + + // If a time out occurs while the subscription counts are calculated, then + // this value is set to 1. Otherwise, this value is set to 2. + SUBSCRIPTION_CALCULATION_STATUS = 40; + + // Count of subscriptions needed to sync source data for PostgreSQL + // database. + PG_SUBSCRIPTION_COUNT = 41; + + // Final parallel level that is used to do migration. + PG_SYNC_PARALLEL_LEVEL = 42; + + // The disk size of the replica instance is smaller than the data size of + // the source instance. + INSUFFICIENT_DISK_SIZE = 43; + + // The data size of the source instance is greater than 1 TB, the number of + // cores of the replica instance is less than 8, and the memory of the + // replica is less than 32 GB. + INSUFFICIENT_MACHINE_TIER = 44; + + // The warning message indicates the unsupported extensions will not be + // migrated to the destination. + UNSUPPORTED_EXTENSIONS_NOT_MIGRATED = 45; + + // The warning message indicates the pg_cron extension and settings will not + // be migrated to the destination. + EXTENSIONS_NOT_MIGRATED = 46; + + // The error message indicates that pg_cron flags are enabled on the + // destination which is not supported during the migration. + PG_CRON_FLAG_ENABLED_IN_REPLICA = 47; + + // This error message indicates that the specified extensions are not + // enabled on destination instance. For example, before you can migrate + // data to the destination instance, you must enable the PGAudit extension + // on the instance. + EXTENSIONS_NOT_ENABLED_IN_REPLICA = 48; + + // The source database has generated columns that can't be migrated. Please + // change them to regular columns before migration. + UNSUPPORTED_COLUMNS = 49; + + // The source database has users that aren't created in the replica. + // First, create all users, which are in the pg_user_mappings table + // of the source database, in the destination instance. Then, perform the + // migration. + USERS_NOT_CREATED_IN_REPLICA = 50; + + // The selected objects include system objects that aren't supported for + // migration. + UNSUPPORTED_SYSTEM_OBJECTS = 51; + + // The source database has tables with the FULL or NOTHING replica identity. + // Before starting your migration, either remove the identity or change it + // to DEFAULT. Note that this is an error and will block the migration. + UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY = 52; + + // The selected objects don't exist on the source instance. + SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE = 53; + + // PSC only destination instance does not have a network attachment URI. + PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI = 54; + + // Selected objects reference unselected objects. Based on their object type + // (foreign key constraint or view), selected objects will fail during + // migration. + SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS = 55; + + // The migration will delete existing data in the replica; set + // [replica_overwrite_enabled][google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled] + // in the request to acknowledge this. This is an error. MySQL only. + PROMPT_DELETE_EXISTING = 56; + + // The migration will delete existing data in the replica; + // [replica_overwrite_enabled][google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled] + // was set in the request acknowledging this. This is a warning rather than + // an error. MySQL only. + WILL_DELETE_EXISTING = 57; + + // The replication user is missing specific privileges to setup DDL + // replication. (e.g. CREATE EVENT TRIGGER, CREATE SCHEMA) for PostgreSQL. + PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE = 58; + } + + // Can be `sql#externalSyncSettingError` or + // `sql#externalSyncSettingWarning`. + string kind = 1; + + // Identifies the specific error that occurred. + SqlExternalSyncSettingErrorType type = 2; + + // Additional information about the error encountered. + string detail = 3; +} + +// IP Management configuration. +message IpConfiguration { + // The SSL options for database connections. + enum SslMode { + // The SSL mode is unknown. + SSL_MODE_UNSPECIFIED = 0; + + // Allow non-SSL/non-TLS and SSL/TLS connections. + // For SSL connections to MySQL and PostgreSQL, the client certificate + // isn't verified. + // + // When this value is used, the legacy `require_ssl` flag must be false or + // cleared to avoid a conflict between the values of the two flags. + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 1; + + // Only allow connections encrypted with SSL/TLS. + // For SSL connections to MySQL and PostgreSQL, the client certificate + // isn't verified. + // + // When this value is used, the legacy `require_ssl` flag must be false or + // cleared to avoid a conflict between the values of the two flags. + ENCRYPTED_ONLY = 2; + + // Only allow connections encrypted with SSL/TLS and with valid + // client certificates. + // + // When this value is used, the legacy `require_ssl` flag must be true or + // cleared to avoid the conflict between values of two flags. + // PostgreSQL clients or users that connect using IAM database + // authentication must use either the + // [Cloud SQL Auth + // Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or + // [Cloud SQL + // Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors) + // to enforce client identity verification. + // + // Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server. + TRUSTED_CLIENT_CERTIFICATE_REQUIRED = 3; + } + + // Various Certificate Authority (CA) modes for certificate signing. + enum CaMode { + // CA mode is unspecified. It is effectively the same as + // `GOOGLE_MANAGED_INTERNAL_CA`. + CA_MODE_UNSPECIFIED = 0; + + // Google-managed self-signed internal CA. + GOOGLE_MANAGED_INTERNAL_CA = 1; + + // Google-managed regional CA part of root CA hierarchy hosted on Google + // Cloud's Certificate Authority Service (CAS). + GOOGLE_MANAGED_CAS_CA = 2; + + // Customer-managed CA hosted on Google Cloud's Certificate Authority + // Service (CAS). + CUSTOMER_MANAGED_CAS_CA = 3; + } + + // Settings for automatic server certificate rotation. + enum ServerCertificateRotationMode { + // Unspecified: no automatic server certificate rotation. + SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED = 0; + + // No automatic server certificate rotation. The user must [manage server + // certificate + // rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas) + // on their side. + NO_AUTOMATIC_ROTATION = 1; + + // Automatic server certificate rotation during Cloud SQL scheduled + // maintenance or self-service maintenance updates. Requires + // `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or + // `CUSTOMER_MANAGED_CAS_CA`. + AUTOMATIC_ROTATION_DURING_MAINTENANCE = 2; + } + + // Whether the instance is assigned a public IP address or not. + google.protobuf.BoolValue ipv4_enabled = 1; + + // The resource link for the VPC network from which the Cloud SQL instance is + // accessible for private IP. For example, + // `/projects/myProject/global/networks/default`. This setting can + // be updated, but it cannot be removed after it is set. + string private_network = 2; + + // Use `ssl_mode` instead. + // + // Whether SSL/TLS connections over IP are enforced. + // If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. + // For SSL/TLS connections, the client certificate won't be verified. If + // set to true, then only allow connections encrypted with SSL/TLS and with + // valid client certificates. If you want to enforce SSL/TLS without enforcing + // the requirement for valid client certificates, then use the `ssl_mode` flag + // instead of the legacy `require_ssl` flag. + google.protobuf.BoolValue require_ssl = 3; + + // The list of external networks that are allowed to connect to the instance + // using the IP. In 'CIDR' notation, also known as 'slash' notation (for + // example: `157.197.200.0/24`). + repeated AclEntry authorized_networks = 4; + + // The name of the allocated ip range for the private ip Cloud SQL instance. + // For example: "google-managed-services-default". If set, the instance ip + // will be created in the allocated range. The range name must comply with + // [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name + // must be 1-63 characters long and match the regular expression + // `[a-z]([-a-z0-9]*[a-z0-9])?.` + string allocated_ip_range = 6; + + // Controls connectivity to private IP instances from Google services, + // such as BigQuery. + google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; + + // Specify how SSL/TLS is enforced in database connections. If you must use + // the `require_ssl` flag for backward compatibility, then only the following + // value pairs are valid: + // + // For PostgreSQL and MySQL: + // + // * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` + // * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false` + // * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true` + // + // For SQL Server: + // + // * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` + // * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true` + // + // The value of `ssl_mode` has priority over the value of `require_ssl`. + // + // For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and + // `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL + // connections, while `require_ssl=false` means accept both non-SSL + // and SSL connections. In this case, MySQL and PostgreSQL databases respect + // `ssl_mode` and accepts only SSL connections. + SslMode ssl_mode = 8; + + // PSC settings for this instance. + optional PscConfig psc_config = 9; + + // Specify what type of CA is used for the server certificate. + optional CaMode server_ca_mode = 10; + + // Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance. + repeated string custom_subject_alternative_names = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The resource name of the server CA pool for an instance with + // `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`. + // Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID} + optional string server_ca_pool = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls the automatic server certificate rotation feature. This + // feature is disabled by default. When enabled, the server certificate will + // be automatically rotated during Cloud SQL scheduled maintenance or + // self-service maintenance updates up to six months before it expires. This + // setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA + // or CUSTOMER_MANAGED_CAS_CA. + optional ServerCertificateRotationMode server_certificate_rotation_mode = 16 + [(google.api.field_behavior) = OPTIONAL]; +} + +// PSC settings for a Cloud SQL instance. +message PscConfig { + // Whether PSC connectivity is enabled for this instance. + optional bool psc_enabled = 1; + + // Optional. The list of consumer projects that are allow-listed for PSC + // connections to this instance. This instance can be connected to with PSC + // from any network in these projects. + // + // Each consumer project in this list may be represented by a project number + // (numeric) or by a project id (alphanumeric). + repeated string allowed_consumer_projects = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of settings for requested Private Service Connect + // consumer endpoints that can be used to connect to this Cloud SQL instance. + repeated PscAutoConnectionConfig psc_auto_connections = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The network attachment of the consumer network that the + // Private Service Connect enabled Cloud SQL instance is + // authorized to connect via PSC interface. + // format: projects/PROJECT/regions/REGION/networkAttachments/ID + string network_attachment_uri = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether Private Service Connect DNS automation is + // enabled for this instance. When enabled, Cloud SQL provisions a universal + // DNS record across all networks configured with Private Service Connect + // auto-connections. This will default to true for new instances when + // Private Service Connect is enabled. + optional bool psc_auto_dns_enabled = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether Private Service Connect write endpoint DNS + // automation is enabled for this instance. When enabled, Cloud SQL provisions + // a universal global DNS record across all networks configured with Private + // Service Connect auto-connections that points to the cluster primary + // instance. This feature is only supported for Enterprise Plus edition. This + // will default to true for new enterprise plus instances when + // `psc_auto_dns_enabled` is enabled. + optional bool psc_write_endpoint_dns_enabled = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to set up the PSC service connection policy + // automatically. + optional bool psc_auto_connection_policy_enabled = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The status of automated DNS provisioning. +enum AutoDnsStatus { + // Unspecified status. This means status is missing from dependency service. + AUTO_DNS_STATUS_UNSPECIFIED = 0; + + // DNS provisioning is OK. + AUTO_DNS_OK = 1; + + // DNS provisioning failed. + AUTO_DNS_FAILED = 2; + + // DNS provisioning status is not recognized by Cloud SQL. + AUTO_DNS_UNKNOWN = 3; +} + +// Settings for an automatically-setup Private Service Connect consumer endpoint +// that is used to connect to a Cloud SQL instance. +message PscAutoConnectionConfig { + // Optional. This is the project ID of consumer service project of this + // consumer endpoint. + // + // Optional. This is only applicable if consumer_network is a shared vpc + // network. + string consumer_project = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The consumer network of this consumer endpoint. This must be a + // resource path that includes both the host project and the network name. + // + // For example, `projects/project1/global/networks/network1`. + // + // The consumer host project of this network might be different from the + // consumer service project. + string consumer_network = 2 [(google.api.field_behavior) = OPTIONAL]; + + // The IP address of the consumer endpoint. + optional string ip_address = 3 + [(google.api.field_info).format = IPV4_OR_IPV6]; + + // The connection status of the consumer endpoint. + optional string status = 4; + + // The connection policy status of the consumer network. + optional string consumer_network_status = 5; + + // Output only. The service connection policy created automatically for the + // consumer network when `psc_auto_connection_policy_enabled` is true. It is + // in the format of: + // `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}` + // The `policy_id` is in format of `$NETWORK-$RANDOM`. + optional string service_connection_policy = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ServiceConnectionPolicy" + } + ]; + + // Output only. The status of service connection policy creation. + optional string service_connection_policy_creation_result = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The status of automated DNS provisioning. + optional AutoDnsStatus instance_auto_dns_status = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The status of automated DNS provisioning for the write + // endpoint. + optional AutoDnsStatus write_endpoint_auto_dns_status = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Database instance IP mapping +message IpMapping { + // The type of this IP address. A `PRIMARY` address is a public address that + // can accept incoming connections. A `PRIVATE` address is a private address + // that can accept incoming connections. An `OUTGOING` address is the source + // address of connections originating from the instance, if supported. + SqlIpAddressType type = 1; + + // The IP address assigned. + string ip_address = 2; + + // The due time for this IP to be retired in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. This field is only available when + // the IP is scheduled to be retired. + google.protobuf.Timestamp time_to_retire = 3; +} + +// Preferred location. This specifies where a Cloud SQL instance is located. +// Note that if the preferred location is not available, the instance will be +// located as close as possible within the region. Only one location may be +// specified. +message LocationPreference { + // The App Engine application to follow, it must be in the same region as the + // Cloud SQL instance. WARNING: Changing this might restart the instance. + string follow_gae_application = 1 [deprecated = true]; + + // The preferred Compute Engine zone (for example: us-central1-a, + // us-central1-b, etc.). WARNING: Changing this might restart the instance. + string zone = 2; + + // The preferred Compute Engine zone for the secondary/failover + // (for example: us-central1-a, us-central1-b, etc.). + // To disable this field, set it to 'no_secondary_zone'. + string secondary_zone = 4; + + // This is always `sql#locationPreference`. + string kind = 3; +} + +// Maintenance window. This specifies when a Cloud SQL instance +// is restarted for system maintenance purposes. +message MaintenanceWindow { + // Hour of day - 0 to 23. Specify in the UTC time zone. + google.protobuf.Int32Value hour = 1; + + // Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`, + // `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone. + // Returned in output as an integer, 1 to 7, where `1` equals Monday. + google.protobuf.Int32Value day = 2; + + // Maintenance timing settings: `canary`, `stable`, or `week5`. + // For more information, see [About maintenance on Cloud SQL + // instances](https://cloud.google.com/sql/docs/mysql/maintenance). + SqlUpdateTrack update_track = 3; + + // This is always `sql#maintenanceWindow`. + string kind = 4; +} + +// Deny Maintenance Periods. This specifies a date range during when all CSA +// rollout will be denied. +message DenyMaintenancePeriod { + // "deny maintenance period" start date. If the year of the start date is + // empty, the year of the end date also must be empty. In this case, it means + // the deny maintenance period recurs every year. The date is in format + // yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01 + string start_date = 1; + + // "deny maintenance period" end date. If the year of the end date is empty, + // the year of the start date also must be empty. In this case, it means the + // deny maintenance period recurs every year. The date is in format yyyy-mm-dd + // i.e., 2020-11-01, or mm-dd, i.e., 11-01 + string end_date = 2; + + // Time in UTC when the "deny maintenance period" starts on start_date and + // ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00 + string time = 3; +} + +// Insights configuration. This specifies when Cloud SQL Insights feature is +// enabled and optional configuration. +message InsightsConfig { + // Whether Query Insights feature is enabled. + bool query_insights_enabled = 1; + + // Whether Query Insights will record client address when enabled. + bool record_client_address = 2; + + // Whether Query Insights will record application tags from query when + // enabled. + bool record_application_tags = 3; + + // Maximum query length stored in bytes. Default value: 1024 bytes. + // Range: 256-4500 bytes. Query lengths greater than this field value will be + // truncated to this value. When unset, query length will be the default + // value. Changing query length will restart the database. + google.protobuf.Int32Value query_string_length = 4; + + // Number of query execution plans captured by Insights per minute + // for all queries combined. Default is 5. + google.protobuf.Int32Value query_plans_per_minute = 5; + + // Optional. Whether enhanced query insights feature is enabled. + google.protobuf.BoolValue enhanced_query_insights_enabled = 8 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Read-replica configuration specific to MySQL databases. +message MySqlReplicaConfiguration { + // Path to a SQL dump file in Google Cloud Storage from which the replica + // instance is to be created. The URI is in the form gs://bucketName/fileName. + // Compressed gzip files (.gz) are also supported. + // Dumps have the binlog co-ordinates from which replication + // begins. This can be accomplished by setting --master-data to 1 when using + // mysqldump. + string dump_file_path = 1; + + // The username for the replication connection. + string username = 2; + + // The password for the replication connection. + string password = 3; + + // Seconds to wait between connect retries. MySQL's default is 60 seconds. + google.protobuf.Int32Value connect_retry_interval = 4; + + // Interval in milliseconds between replication heartbeats. + google.protobuf.Int64Value master_heartbeat_period = 5; + + // PEM representation of the trusted CA's x509 certificate. + string ca_certificate = 6; + + // PEM representation of the replica's x509 certificate. + string client_certificate = 7; + + // PEM representation of the replica's private key. The corresponding public + // key is encoded in the client's certificate. + string client_key = 8; + + // A list of permissible ciphers to use for SSL encryption. + string ssl_cipher = 9; + + // Whether or not to check the primary instance's Common Name value in the + // certificate that it sends during the SSL handshake. + google.protobuf.BoolValue verify_server_certificate = 10; + + // This is always `sql#mysqlReplicaConfiguration`. + string kind = 11; +} + +// A list of objects that the user selects for replication from an external +// source instance. +message SelectedObjects { + // Required. The name of the database to migrate. + string database = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// On-premises instance configuration. +message OnPremisesConfiguration { + // SslOption defines the SSL mode to be used for replica connection to the + // on-premises source. + enum SslOption { + // Unknown SSL option i.e. SSL option not specified by user. + SSL_OPTION_UNSPECIFIED = 0; + + // SSL is disabled for replica connection to the on-premises source. + DISABLE = 1; + + // SSL is required for replica connection to the on-premises source. + REQUIRE = 2; + + // Verify CA is required for replica connection to the on-premises source. + VERIFY_CA = 3; + } + + // The host and port of the on-premises instance in host:port format + string host_port = 1; + + // This is always `sql#onPremisesConfiguration`. + string kind = 2; + + // The username for connecting to on-premises instance. + string username = 3; + + // The password for connecting to on-premises instance. + string password = 4; + + // PEM representation of the trusted CA's x509 certificate. + string ca_certificate = 5; + + // PEM representation of the replica's x509 certificate. + string client_certificate = 6; + + // PEM representation of the replica's private key. The corresponding public + // key is encoded in the client's certificate. + string client_key = 7; + + // The dump file to create the Cloud SQL replica. + string dump_file_path = 8; + + // The reference to Cloud SQL instance if the source is Cloud SQL. + InstanceReference source_instance = 15; + + // Optional. A list of objects that the user selects for replication from an + // external source instance. + repeated SelectedObjects selected_objects = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. SslOption for replica connection to the on-premises source. + SslOption ssl_option = 18 [(google.api.field_behavior) = OPTIONAL]; +} + +// Disk encryption configuration for an instance. +message DiskEncryptionConfiguration { + // Resource name of KMS key for disk encryption + string kms_key_name = 1; + + // This is always `sql#diskEncryptionConfiguration`. + string kind = 2; +} + +// Disk encryption status for an instance. +message DiskEncryptionStatus { + // KMS key version used to encrypt the Cloud SQL instance resource + string kms_key_version_name = 1; + + // This is always `sql#diskEncryptionStatus`. + string kind = 2; +} + +// The type of maintenance to be performed on the instance. +enum SqlMaintenanceType { + // Maintenance type is unspecified. + SQL_MAINTENANCE_TYPE_UNSPECIFIED = 0; + + // Indicates that a standalone instance is undergoing maintenance. The + // instance can be either a primary instance or a replica. + INSTANCE_MAINTENANCE = 1; + + // Indicates that the primary instance and all of its replicas, including + // cascading replicas, are undergoing maintenance. Maintenance is performed on + // groups of replicas first, followed by the primary instance. + REPLICA_INCLUDED_MAINTENANCE = 2; + + // Indicates that the standalone instance is undergoing maintenance, initiated + // by self-service. The instance can be either a primary instance or a + // replica. + INSTANCE_SELF_SERVICE_MAINTENANCE = 3; + + // Indicates that the primary instance and all of its replicas are undergoing + // maintenance, initiated by self-service. Maintenance is performed on groups + // of replicas first, followed by the primary instance. + REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE = 4; +} + +// The sub operation type based on the operation type. +message SqlSubOperationType { + // Sub operation details corresponding to the operation type. + oneof sub_operation_details { + // The type of maintenance to be performed on the instance. + SqlMaintenanceType maintenance_type = 1; + } +} + +// An Operation resource. For successful operations that return an +// Operation resource, only the fields relevant to the operation are populated +// in the resource. +message Operation { + // The type of Cloud SQL operation. + enum SqlOperationType { + // Unknown operation type. + SQL_OPERATION_TYPE_UNSPECIFIED = 0; + + // Imports data into a Cloud SQL instance. + IMPORT = 1; + + // Exports data from a Cloud SQL instance to a Cloud Storage + // bucket. + EXPORT = 2; + + // Creates a new Cloud SQL instance. + CREATE = 3; + + // Updates the settings of a Cloud SQL instance. + UPDATE = 4; + + // Deletes a Cloud SQL instance. + DELETE = 5; + + // Restarts the Cloud SQL instance. + RESTART = 6; + + BACKUP = 7 [deprecated = true]; + + SNAPSHOT = 8 [deprecated = true]; + + // Performs instance backup. + BACKUP_VOLUME = 9; + + // Deletes an instance backup. + DELETE_VOLUME = 10; + + // Restores an instance backup. + RESTORE_VOLUME = 11; + + // Injects a privileged user in mysql for MOB instances. + INJECT_USER = 12; + + // Clones a Cloud SQL instance. + CLONE = 14; + + // Stops replication on a Cloud SQL read replica instance. + STOP_REPLICA = 15; + + // Starts replication on a Cloud SQL read replica instance. + START_REPLICA = 16; + + // Promotes a Cloud SQL replica instance. + PROMOTE_REPLICA = 17; + + // Creates a Cloud SQL replica instance. + CREATE_REPLICA = 18; + + // Creates a new user in a Cloud SQL instance. + CREATE_USER = 19; + + // Deletes a user from a Cloud SQL instance. + DELETE_USER = 20; + + // Updates an existing user in a Cloud SQL instance. If a user with the + // specified username doesn't exist, a new user is created. + UPDATE_USER = 21; + + // Creates a database in the Cloud SQL instance. + CREATE_DATABASE = 22; + + // Deletes a database in the Cloud SQL instance. + DELETE_DATABASE = 23; + + // Updates a database in the Cloud SQL instance. + UPDATE_DATABASE = 24; + + // Performs failover of an HA-enabled Cloud SQL + // failover replica. + FAILOVER = 25; + + // Deletes the backup taken by a backup run. + DELETE_BACKUP = 26; + + RECREATE_REPLICA = 27; + + // Truncates a general or slow log table in MySQL. + TRUNCATE_LOG = 28; + + // Demotes the stand-alone instance to be a Cloud SQL + // read replica for an external database server. + DEMOTE_MASTER = 29; + + // Indicates that the instance is currently in maintenance. Maintenance + // typically causes the instance to be unavailable for 1-3 minutes. + MAINTENANCE = 30; + + // This field is deprecated, and will be removed in future version of API. + ENABLE_PRIVATE_IP = 31 [deprecated = true]; + + DEFER_MAINTENANCE = 32 [deprecated = true]; + + // Creates clone instance. + CREATE_CLONE = 33 [deprecated = true]; + + // Reschedule maintenance to another time. + RESCHEDULE_MAINTENANCE = 34; + + // Starts external sync of a Cloud SQL EM replica to an external primary + // instance. + START_EXTERNAL_SYNC = 35; + + // Recovers logs from an instance's old data disk. + LOG_CLEANUP = 36; + + // Performs auto-restart of an HA-enabled Cloud SQL database for auto + // recovery. + AUTO_RESTART = 37; + + // Re-encrypts CMEK instances with latest key version. + REENCRYPT = 38; + + // Switches the roles of the primary and replica pair. The target instance + // should be the replica. + SWITCHOVER = 39; + + // Update a backup. + UPDATE_BACKUP = 40; + + // Acquire a lease for the setup of SQL Server Reporting Services (SSRS). + ACQUIRE_SSRS_LEASE = 42; + + // Release a lease for the setup of SQL Server Reporting Services (SSRS). + RELEASE_SSRS_LEASE = 43; + + // Reconfigures old primary after a promote replica operation. Effect of a + // promote operation to the old primary is executed in this operation, + // asynchronously from the promote replica operation executed to the + // replica. + RECONFIGURE_OLD_PRIMARY = 44; + + // Indicates that the instance, its read replicas, and its cascading + // replicas are in maintenance. Maintenance typically gets initiated on + // groups of replicas first, followed by the primary instance. For each + // instance, maintenance typically causes the instance to be unavailable for + // 1-3 minutes. + CLUSTER_MAINTENANCE = 45 [deprecated = true]; + + // Indicates that the instance (and any of its replicas) are currently in + // maintenance. This is initiated as a self-service request by using SSM. + // Maintenance typically causes the instance to be unavailable for 1-3 + // minutes. + SELF_SERVICE_MAINTENANCE = 46 [deprecated = true]; + + // Switches a primary instance to a replica. This operation runs as part of + // a switchover operation to the original primary instance. + SWITCHOVER_TO_REPLICA = 47; + + // Updates the major version of a Cloud SQL instance. + MAJOR_VERSION_UPGRADE = 48; + + // Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead. + ADVANCED_BACKUP = 49 [deprecated = true]; + + // Changes the BackupTier of a Cloud SQL instance. + MANAGE_BACKUP = 50; + + // Creates a backup for an Enhanced BackupTier Cloud SQL instance. + ENHANCED_BACKUP = 51; + + // Repairs entire read pool or specified read pool nodes in the read pool. + REPAIR_READ_POOL = 52; + + // Creates a Cloud SQL read pool instance. + CREATE_READ_POOL = 53; + + // Pre-checks for major version upgrade. + PRE_CHECK_MAJOR_VERSION_UPGRADE = 54; + + // This operation type represents individual steps in a multi-step setup + // migration workflow: including configuration, replication, + // switchover/back, and data reseeding, as defined by operation's intent. + SETUP_MIGRATION = 58; + + // Sends a message to a Cloud SQL agent. + AGENT_SEND_MESSAGE = 59; + } + + // The status of an operation. + enum SqlOperationStatus { + // The state of the operation is unknown. + SQL_OPERATION_STATUS_UNSPECIFIED = 0; + + // The operation has been queued, but has not started yet. + PENDING = 1; + + // The operation is running. + RUNNING = 2; + + // The operation completed. + DONE = 3; + } + + // This is always `sql#operation`. + string kind = 1; + + string target_link = 2; + + // The status of an operation. + SqlOperationStatus status = 3; + + // The email address of the user who initiated this operation. + string user = 4; + + // The time this operation was enqueued in UTC timezone in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp insert_time = 5; + + // The time this operation actually started in UTC timezone in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp start_time = 6; + + // The time this operation finished in UTC timezone in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp end_time = 7; + + // If errors occurred during processing of this operation, this field will be + // populated. + OperationErrors error = 8; + + // An Admin API warning message. + ApiWarning api_warning = 19; + + // The type of the operation. Valid values are: + // * `CREATE` + // * `DELETE` + // * `UPDATE` + // * `RESTART` + // * `IMPORT` + // * `EXPORT` + // * `BACKUP_VOLUME` + // * `RESTORE_VOLUME` + // * `CREATE_USER` + // * `DELETE_USER` + // * `CREATE_DATABASE` + // * `DELETE_DATABASE` + SqlOperationType operation_type = 9; + + // The context for import operation, if applicable. + ImportContext import_context = 10; + + // The context for export operation, if applicable. + ExportContext export_context = 11; + + // The context for backup operation, if applicable. + BackupContext backup_context = 17; + + // The context for pre-check major version upgrade operation, if applicable. + // This field is only populated when the operation_type is + // PRE_CHECK_MAJOR_VERSION_UPGRADE. + // The PreCheckMajorVersionUpgradeContext message itself contains the details + // for that pre-check, such as the target database version for the upgrade + // and the results of the check (including any warnings or errors found). + PreCheckMajorVersionUpgradeContext pre_check_major_version_upgrade_context = + 50; + + // An identifier that uniquely identifies the operation. You can use this + // identifier to retrieve the Operations resource that has information about + // the operation. + string name = 12; + + // Name of the resource on which this operation runs. + string target_id = 13; + + // The URI of this resource. + string self_link = 14; + + // The project ID of the target instance related to this operation. + string target_project = 15; + + // The context for acquire SSRS lease operation, if applicable. + AcquireSsrsLeaseContext acquire_ssrs_lease_context = 20; + + // Optional. The sub operation based on the operation type. + SqlSubOperationType sub_operation_type = 48 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Database instance operation error. +message OperationError { + // This is always `sql#operationError`. + string kind = 1; + + // Identifies the specific error that occurred. + string code = 2; + + // Additional information about the error encountered. + string message = 3; +} + +// Database instance operation errors list wrapper. +message OperationErrors { + // This is always `sql#operationErrors`. + string kind = 1; + + // The list of errors encountered while processing this operation. + repeated OperationError errors = 2; +} + +// Database instance local user password validation policy. +// This message defines the password policy for local database users. +// When enabled, it enforces constraints on password complexity, length, +// and reuse. Keep this policy enabled to help prevent unauthorized access. +message PasswordValidationPolicy { + // The complexity choices of the password. + enum Complexity { + // Complexity check is not specified. + COMPLEXITY_UNSPECIFIED = 0; + + // A combination of lowercase, uppercase, numeric, and non-alphanumeric + // characters. + COMPLEXITY_DEFAULT = 1; + } + + // Minimum number of characters allowed. + google.protobuf.Int32Value min_length = 1; + + // The complexity of the password. + Complexity complexity = 2; + + // Number of previous passwords that cannot be reused. + google.protobuf.Int32Value reuse_interval = 3; + + // Disallow username as a part of the password. + google.protobuf.BoolValue disallow_username_substring = 4; + + // Minimum interval after which the password can be changed. This flag is only + // supported for PostgreSQL. + google.protobuf.Duration password_change_interval = 5; + + // Whether to enable the password policy or not. When enabled, passwords must + // meet complexity requirements. Keep this policy enabled to help prevent + // unauthorized access. Disabling this policy allows weak passwords. + google.protobuf.BoolValue enable_password_policy = 6; + + // This field is deprecated and will be removed in a future version of the + // API. + google.protobuf.BoolValue disallow_compromised_credentials = 7 + [deprecated = true]; +} + +// Operations list response. +message OperationsListResponse { + // This is always `sql#operationsList`. + string kind = 1; + + // List of operation resources. + repeated Operation items = 2; + + // The continuation token, used to page through large result sets. Provide + // this value in a subsequent request to return the next page of results. + string next_page_token = 3; +} + +// Read-replica configuration for connecting to the primary instance. +message ReplicaConfiguration { + // This is always `sql#replicaConfiguration`. + string kind = 1; + + // MySQL specific configuration when replicating from a MySQL on-premises + // primary instance. Replication configuration information such as the + // username, password, certificates, and keys are not stored in the instance + // metadata. The configuration information is used only to set up the + // replication connection and is stored by MySQL in a file named + // `master.info` in the data directory. + MySqlReplicaConfiguration mysql_replica_configuration = 2; + + // Specifies if the replica is the failover target. If the field is set to + // `true` the replica will be designated as a failover replica. In case the + // primary instance fails, the replica instance will be promoted as the new + // primary instance. Only one replica can be specified as failover target, and + // the replica has to be in different zone with the primary instance. + google.protobuf.BoolValue failover_target = 3; + + // Optional. Specifies if a SQL Server replica is a cascadable replica. A + // cascadable replica is a SQL Server cross region replica that supports + // replica(s) under it. + google.protobuf.BoolValue cascadable_replica = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Database instance restore from backup context. +// Backup context contains source instance id and project id. +message RestoreBackupContext { + // This is always `sql#restoreBackupContext`. + string kind = 1; + + // The ID of the backup run to restore from. + int64 backup_run_id = 2; + + // The ID of the instance that the backup was taken from. + string instance_id = 3; + + // The full project ID of the source instance. + string project = 4; +} + +// Instance rotate server CA context. +message RotateServerCaContext { + // This is always `sql#rotateServerCaContext`. + string kind = 1; + + // The fingerprint of the next version to be rotated to. If left unspecified, + // will be rotated to the most recently added server CA version. + string next_version = 2; +} + +// Instance rotate server certificate context. +message RotateServerCertificateContext { + // Optional. This is always `sql#rotateServerCertificateContext`. + string kind = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The fingerprint of the next version to be rotated to. If left + // unspecified, will be rotated to the most recently added server certificate + // version. + string next_version = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Instance rotate Entra ID certificate context. +message RotateEntraIdCertificateContext { + // Optional. This is always `sql#rotateEntraIdCertificateContext`. + string kind = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The fingerprint of the next version to be rotated to. If left + // unspecified, will be rotated to the most recently added Entra ID + // certificate version. + string next_version = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Data cache configurations. +message DataCacheConfig { + // Whether data cache is enabled for the instance. + bool data_cache_enabled = 1; +} + +// Config used to determine the final backup settings for the instance. +message FinalBackupConfig { + // Whether the final backup is enabled for the instance. + optional bool enabled = 1; + + // The number of days to retain the final backup after the instance deletion. + // The final backup will be purged at (time_of_instance_deletion + + // retention_days). + optional int32 retention_days = 3; +} + +// Database instance settings. +message Settings { + // Specifies when the instance is activated. + enum SqlActivationPolicy { + // Unknown activation plan. + SQL_ACTIVATION_POLICY_UNSPECIFIED = 0; + + // The instance is always up and running. + ALWAYS = 1; + + // The instance never starts. + NEVER = 2; + + // The instance starts upon receiving requests. + ON_DEMAND = 3 [deprecated = true]; + } + + // The list of Cloud SQL editions available to users. + enum Edition { + // The instance did not specify the edition. + EDITION_UNSPECIFIED = 0; + + // The instance is an enterprise edition. + ENTERPRISE = 2; + + // The instance is an Enterprise Plus edition. + ENTERPRISE_PLUS = 3; + + // This instance is a Cloud SQL developer edition instance. + DEVELOPER = 5; + } + + // The options for enforcing Cloud SQL connectors in the instance. + enum ConnectorEnforcement { + // The requirement for Cloud SQL connectors is unknown. + CONNECTOR_ENFORCEMENT_UNSPECIFIED = 0; + + // Do not require Cloud SQL connectors. + NOT_REQUIRED = 1; + + // Require all connections to use Cloud SQL connectors, including the + // Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors. + // Note: This disables all existing authorized networks. + REQUIRED = 2; + } + + // ExecuteSql API's access to the instance. + enum DataApiAccess { + // Unspecified, effectively the same as `DISALLOW_DATA_API`. + DATA_API_ACCESS_UNSPECIFIED = 0; + + // Disallow using ExecuteSql API to connect to the instance. + DISALLOW_DATA_API = 1; + + // Allow using ExecuteSql API to connect to the instance. For private IP + // instances, this allows authorized users to access the instance from + // the public internet using ExecuteSql API. + ALLOW_DATA_API = 2; + } + + // The version of instance settings. This is a required field for update + // method to make sure concurrent updates are handled properly. During update, + // use the most recent settingsVersion value for this instance and do not try + // to update this value. + google.protobuf.Int64Value settings_version = 1; + + // The App Engine app IDs that can access this instance. + // (Deprecated) Applied to First Generation instances only. + repeated string authorized_gae_applications = 2 [deprecated = true]; + + // The tier (or machine type) for this instance, for example + // `db-custom-1-3840`. WARNING: Changing this restarts the instance. + string tier = 3; + + // This is always `sql#settings`. + string kind = 4; + + // User-provided labels, represented as a dictionary where each label is a + // single key value pair. + map user_labels = 5; + + // Availability type. Potential values: + // * `ZONAL`: The instance serves data from only one zone. Outages in that + // zone affect data accessibility. + // * `REGIONAL`: The instance can serve data from more than one zone in a + // region (it is highly available)./ + // + // For more information, see [Overview of the High Availability + // Configuration](https://cloud.google.com/sql/docs/mysql/high-availability). + SqlAvailabilityType availability_type = 6; + + // The pricing plan for this instance. This can be either `PER_USE` or + // `PACKAGE`. Only `PER_USE` is supported for Second Generation instances. + SqlPricingPlan pricing_plan = 7; + + // The type of replication this instance uses. This can be either + // `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only + // applicable to First Generation instances. + SqlReplicationType replication_type = 8 [deprecated = true]; + + // The maximum size to which storage capacity can be automatically increased. + // The default value is 0, which specifies that there is no limit. + google.protobuf.Int64Value storage_auto_resize_limit = 9; + + // The activation policy specifies when the instance is activated; it is + // applicable only when the instance state is RUNNABLE. Valid values: + // * `ALWAYS`: The instance is on, and remains so even in the absence of + // connection requests. + // * `NEVER`: The instance is off; it is not activated, even if a + // connection request arrives. + SqlActivationPolicy activation_policy = 10; + + // The settings for IP Management. This allows to enable or disable the + // instance IP and manage which external networks can connect to the instance. + // The IPv4 address cannot be disabled for Second Generation instances. + IpConfiguration ip_configuration = 11; + + // Configuration to increase storage size automatically. The default value is + // true. + google.protobuf.BoolValue storage_auto_resize = 12; + + // The location preference settings. This allows the instance to be located as + // near as possible to either an App Engine app or Compute Engine zone for + // better performance. App Engine co-location was only applicable to First + // Generation instances. + LocationPreference location_preference = 13; + + // The database flags passed to the instance at startup. + repeated DatabaseFlags database_flags = 14; + + // The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for + // First Generation instances. + SqlDataDiskType data_disk_type = 15; + + // The maintenance window for this instance. This specifies when the instance + // can be restarted for maintenance purposes. + MaintenanceWindow maintenance_window = 16; + + // The daily backup configuration for the instance. + BackupConfiguration backup_configuration = 17; + + // Configuration specific to read replica instances. Indicates whether + // replication is enabled or not. WARNING: Changing this restarts the + // instance. + google.protobuf.BoolValue database_replication_enabled = 18; + + // Configuration specific to read replica instances. Indicates whether + // database flags for crash-safe replication are enabled. This property was + // only applicable to First Generation instances. + google.protobuf.BoolValue crash_safe_replication_enabled = 19 + [deprecated = true]; + + // The size of data disk, in GB. The data disk size minimum is 10GB. + google.protobuf.Int64Value data_disk_size_gb = 20; + + // Active Directory configuration, relevant only for Cloud SQL for SQL Server. + SqlActiveDirectoryConfig active_directory_config = 22; + + // The name of server Instance collation. + string collation = 23; + + // Deny maintenance periods + repeated DenyMaintenancePeriod deny_maintenance_periods = 24; + + // Insights configuration, for now relevant only for Postgres. + InsightsConfig insights_config = 25; + + // The local user password validation policy of the instance. + PasswordValidationPolicy password_validation_policy = 27; + + // SQL Server specific audit configuration. + SqlServerAuditConfig sql_server_audit_config = 29; + + // Optional. The edition type of the Cloud SQL instance. + Edition edition = 38 [(google.api.field_behavior) = OPTIONAL]; + + // Specifies if connections must use Cloud SQL connectors. + // Option values include the following: `NOT_REQUIRED` (Cloud SQL instances + // can be connected without Cloud SQL + // Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL + // Connectors) + // + // Note that using REQUIRED disables all existing authorized networks. If + // this field is not specified when creating a new instance, NOT_REQUIRED is + // used. If this field is not specified when patching or updating an existing + // instance, it is left unchanged in the instance. + ConnectorEnforcement connector_enforcement = 32; + + // Configuration to protect against accidental instance deletion. + google.protobuf.BoolValue deletion_protection_enabled = 33; + + // Server timezone, relevant only for Cloud SQL for SQL Server. + string time_zone = 34; + + // Specifies advanced machine configuration for the instances relevant only + // for SQL Server. + AdvancedMachineFeatures advanced_machine_features = 35; + + // Configuration for data cache. + DataCacheConfig data_cache_config = 37; + + // Optional. Configuration value for recreation of replica after certain + // replication lag. + google.protobuf.Int32Value replication_lag_max_seconds = 39 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When this parameter is set to true, Cloud SQL instances can + // connect to Vertex AI to pass requests for real-time predictions and + // insights to the AI. The default value is false. This applies only to Cloud + // SQL for MySQL and Cloud SQL for PostgreSQL instances. + google.protobuf.BoolValue enable_google_ml_integration = 40 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. By default, Cloud SQL instances have schema extraction disabled + // for Dataplex. When this parameter is set to true, schema extraction for + // Dataplex on Cloud SQL instances is activated. + google.protobuf.BoolValue enable_dataplex_integration = 41 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When this parameter is set to true, Cloud SQL retains backups of + // the instance even after the instance is deleted. The ON_DEMAND backup will + // be retained until customer deletes the backup or the project. The AUTOMATED + // backup will be retained based on the backups retention setting. + google.protobuf.BoolValue retain_backups_on_delete = 42 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Provisioned number of I/O operations per second for the data + // disk. This field is only used for hyperdisk-balanced disk types. + optional int64 data_disk_provisioned_iops = 43 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Provisioned throughput measured in MiB per second for the data + // disk. This field is only used for hyperdisk-balanced disk types. + optional int64 data_disk_provisioned_throughput = 44 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The managed connection pooling configuration for the instance. + optional ConnectionPoolConfig connection_pool_config = 45 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The final backup configuration for the instance. + optional FinalBackupConfig final_backup_config = 47 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The read pool auto-scale configuration for the instance. + optional ReadPoolAutoScaleConfig read_pool_auto_scale_config = 48 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configures whether the replica is in accelerated mode. This + // feature is in private preview and requires allowlisting to take effect. + google.protobuf.BoolValue accelerated_replica_mode = 49 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud SQL for MySQL auto-upgrade configuration. When this + // parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor + // versions. The MySQL version must be 8.0.35 or higher. + optional bool auto_upgrade_enabled = 50 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Microsoft Entra ID configuration for the SQL Server instance. + SqlServerEntraIdConfig entraid_config = 52 + [(google.api.field_behavior) = OPTIONAL]; + + // This parameter controls whether to allow using ExecuteSql API to connect to + // the instance. Not allowed by default. + optional DataApiAccess data_api_access = 53; + + // Optional. Configuration for Performance Capture, provides diagnostic + // metrics during high load situations. + PerformanceCaptureConfig performance_capture_config = 54 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Performance capture configuration. +message PerformanceCaptureConfig { + // Defines the categories of long-running transactions eligible for automatic + // termination by the Performance Capture. + enum TransactionKillType { + // Unspecified. + TRANSACTION_KILL_TYPE_UNSPECIFIED = 0; + + // Only read-only transactions are eligible for termination. + READ_ONLY_TRANSACTIONS = 1; + + // All transactions are eligible for termination, including those with write + // operations (such as INSERT, UPDATE, DELETE, or DDL). + ALL_TRANSACTIONS = 2; + } + + // Optional. Enables or disables the performance capture feature. + optional bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the interval in seconds between consecutive probes that + // check if any trigger condition thresholds have been reached. + optional int32 probing_interval_seconds = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum number of consecutive probe threshold that + // triggers performance capture. + optional int32 probe_threshold = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum number of MySQL `Threads_running` to + // trigger the performance capture on the primary instance. + optional int32 running_threads_threshold = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum number of seconds replica must be lagging + // behind primary instance to trigger the performance capture on replica. + optional int32 seconds_behind_source_threshold = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the amount of time in seconds that a transaction needs + // to have been open before the watcher starts recording it. + optional int32 transaction_duration_threshold = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum percentage of CPU utilization to trigger + // the performance capture. Valid integers range from `10` to `99`. Enter `0` + // to disable the check. + optional int32 cpu_utilization_threshold_percent = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum percentage of memory usage to trigger the + // performance capture. + // Valid integers range from `10` to `99`. Enter `0` to disable the check. + optional int32 memory_usage_threshold_percent = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum allowed number of transactions in lock wait + // state to trigger the performance capture. Valid integers range from `10` to + // `10000`. Enter `0` to disable the check. + optional int32 transaction_lock_wait_threshold_count = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum allowed number of semaphore waits to + // trigger the performance capture. Valid integers range from `10` to `10000`. + // Enter `0` to disable the check. + optional int32 semaphore_wait_threshold_count = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum number of undo log entries in the history + // list length to trigger the performance capture. Valid integers range from + // `10000` to `10000000`. Enter `0` to disable the check. + optional int32 history_list_length_threshold_count = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the amount of time in seconds that a transaction needs + // to have been open before the watcher starts terminating it. Valid integers + // range from `60` to `604800` (7 days). Enter `0` to disable. If enabled + // (i.e., > 0), this value must be greater than or equal to + // `transaction_duration_threshold`. Configurations where + // `0 < transaction_kill_threshold_seconds < transaction_duration_threshold` + // will be rejected. + optional int32 transaction_kill_threshold_seconds = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a customer-defined list of users to exclude from + // transaction termination. Entries can be in the format 'user@host' or just + // 'user'. A standalone 'user' implies 'user@%', excluding the user from any + // host. Wildcard '%' is allowed in the host part of the 'user@host' format. + // Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]` + repeated string transaction_kill_excluded_user_hosts = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Determines which transactions are allowed to be terminated when + // they exceed `transaction_kill_threshold_seconds`. This allows protecting + // write-heavy transactions from auto-termination if desired. Defaults to + // `READ_ONLY_TRANSACTIONS` if unspecified. + optional TransactionKillType transaction_kill_type = 17 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies options for controlling advanced machine features. +message AdvancedMachineFeatures { + // The number of threads per physical core. + int32 threads_per_core = 1; +} + +// SslCerts Resource +message SslCert { + // This is always `sql#sslCert`. + string kind = 1; + + // Serial number, as extracted from the certificate. + string cert_serial_number = 2; + + // PEM representation. + string cert = 3; + + // The time when the certificate was created in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp create_time = 4; + + // User supplied name. Constrained to [a-zA-Z.-_ ]+. + string common_name = 5; + + // The time when the certificate expires in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp expiration_time = 6; + + // Sha1 Fingerprint. + string sha1_fingerprint = 7; + + // Name of the database instance. + string instance = 8; + + // The URI of this resource. + string self_link = 9; +} + +// SslCertDetail. +message SslCertDetail { + // The public information about the cert. + SslCert cert_info = 1; + + // The private key for the client cert, in pem format. Keep private in order + // to protect your security. + string cert_private_key = 2; +} + +// SslCerts create ephemeral certificate request. +message SslCertsCreateEphemeralRequest { + // PEM encoded public key to include in the signed certificate. + string public_key = 1 [json_name = "public_key"]; + + // Access token to include in the signed certificate. + string access_token = 2 [json_name = "access_token"]; +} + +// SslCerts insert request. +message SslCertsInsertRequest { + // User supplied name. Must be a distinct name from the other certificates + // for this instance. + string common_name = 1; +} + +// Reschedule options for maintenance windows. +message SqlInstancesRescheduleMaintenanceRequestBody { + enum RescheduleType { + RESCHEDULE_TYPE_UNSPECIFIED = 0; + + // Reschedules maintenance to happen now (within 5 minutes). + IMMEDIATE = 1; + + // Reschedules maintenance to occur within one week from the originally + // scheduled day and time. + NEXT_AVAILABLE_WINDOW = 2; + + // Reschedules maintenance to a specific time and day. + SPECIFIC_TIME = 3; + } + + message Reschedule { + // Required. The type of the reschedule. + RescheduleType reschedule_type = 1; + + // Optional. Timestamp when the maintenance shall be rescheduled to if + // reschedule_type=SPECIFIC_TIME, in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp schedule_time = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The type of the reschedule the user wants. + Reschedule reschedule = 3; +} + +// SslCert insert response. +message SslCertsInsertResponse { + // This is always `sql#sslCertsInsert`. + string kind = 1; + + // The operation to track the ssl certs insert request. + Operation operation = 2; + + // The server Certificate Authority's certificate. If this is missing you can + // force a new one to be generated by calling resetSslConfig method on + // instances resource. + SslCert server_ca_cert = 3; + + // The new client certificate and private key. + SslCertDetail client_cert = 4; +} + +// SslCerts list response. +message SslCertsListResponse { + // This is always `sql#sslCertsList`. + string kind = 1; + + // List of client certificates for the instance. + repeated SslCert items = 2; +} + +// Database Instance truncate log context. +message TruncateLogContext { + // This is always `sql#truncateLogContext`. + string kind = 1; + + // The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and + // `MYSQL_SLOW_TABLE`. + string log_type = 2; +} + +// Active Directory configuration, relevant only for Cloud SQL for SQL Server. +message SqlActiveDirectoryConfig { + // The modes of Active Directory configuration. + enum ActiveDirectoryMode { + // Unspecified mode. + ACTIVE_DIRECTORY_MODE_UNSPECIFIED = 0; + + // Managed Active Directory mode. This is the fallback option to maintain + // backward compatibility. + MANAGED_ACTIVE_DIRECTORY = 1; + + // Deprecated: Use CUSTOMER_MANAGED_ACTIVE_DIRECTORY instead. + SELF_MANAGED_ACTIVE_DIRECTORY = 2 [deprecated = true]; + + // Customer-managed Active Directory mode. + CUSTOMER_MANAGED_ACTIVE_DIRECTORY = 3; + } + + // This is always sql#activeDirectoryConfig. + string kind = 1; + + // The name of the domain (e.g., mydomain.com). + string domain = 2; + + // Optional. The mode of the Active Directory configuration. + ActiveDirectoryMode mode = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Domain controller IPv4 addresses used to bootstrap Active + // Directory. + repeated string dns_servers = 4 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. The secret manager key storing the administrator credential. + // (e.g., projects/{project}/secrets/{secret}). + string admin_credential_secret_name = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The organizational unit distinguished name. This is the full + // hierarchical path to the organizational unit. + string organizational_unit = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// SQL Server specific audit configuration. +message SqlServerAuditConfig { + // This is always sql#sqlServerAuditConfig + string kind = 1; + + // The name of the destination bucket (e.g., gs://mybucket). + string bucket = 2; + + // How long to keep generated audit files. + google.protobuf.Duration retention_interval = 3; + + // How often to upload generated audit files. + google.protobuf.Duration upload_interval = 4; +} + +// SQL Server Entra ID configuration. +message SqlServerEntraIdConfig { + // Output only. This is always sql#sqlServerEntraIdConfig + string kind = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The tenant ID for the Entra ID configuration. + string tenant_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The application ID for the Entra ID configuration. + string application_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The status of a backup run. +enum SqlBackupRunStatus { + // The status of the run is unknown. + SQL_BACKUP_RUN_STATUS_UNSPECIFIED = 0; + + // The backup operation was enqueued. + ENQUEUED = 1; + + // The backup is overdue across a given backup window. Indicates a + // problem. Example: Long-running operation in progress during + // the whole window. + OVERDUE = 2; + + // The backup is in progress. + RUNNING = 3; + + // The backup failed. + FAILED = 4; + + // The backup was successful. + SUCCESSFUL = 5; + + // The backup was skipped (without problems) for a given backup + // window. Example: Instance was idle. + SKIPPED = 6; + + // The backup is about to be deleted. + DELETION_PENDING = 7; + + // The backup deletion failed. + DELETION_FAILED = 8; + + // The backup has been deleted. + DELETED = 9; +} + +enum SqlBackupRunType { + // This is an unknown BackupRun type. + SQL_BACKUP_RUN_TYPE_UNSPECIFIED = 0; + + // The backup schedule automatically triggers a backup. + AUTOMATED = 1; + + // The user manually triggers a backup. + ON_DEMAND = 2; +} + +// Defines the supported backup kinds +enum SqlBackupKind { + // This is an unknown BackupKind. + SQL_BACKUP_KIND_UNSPECIFIED = 0; + + // Snapshot-based backups. + SNAPSHOT = 1; + + // Physical backups. + PHYSICAL = 2; +} + +enum SqlBackendType { + // This is an unknown backend type for instance. + SQL_BACKEND_TYPE_UNSPECIFIED = 0; + + // V1 speckle instance. + FIRST_GEN = 1 [deprecated = true]; + + // V2 speckle instance. + SECOND_GEN = 2; + + // On premises instance. + EXTERNAL = 3; +} + +enum SqlIpAddressType { + // This is an unknown IP address type. + SQL_IP_ADDRESS_TYPE_UNSPECIFIED = 0; + + // IP address the customer is supposed to connect to. Usually this is the + // load balancer's IP address + PRIMARY = 1; + + // Source IP address of the connection a read replica establishes to its + // external primary instance. This IP address can be allowlisted by the + // customer in case it has a firewall that filters incoming connection to its + // on premises primary instance. + OUTGOING = 2; + + // Private IP used when using private IPs and network peering. + PRIVATE = 3; + + // V1 IP of a migrated instance. We want the user to + // decommission this IP as soon as the migration is complete. + // Note: V1 instances with V1 ip addresses will be counted as PRIMARY. + MIGRATED_1ST_GEN = 4; +} + +enum SqlInstanceType { + // This is an unknown Cloud SQL instance type. + SQL_INSTANCE_TYPE_UNSPECIFIED = 0; + + // A regular Cloud SQL instance that is not replicating from a primary + // instance. + CLOUD_SQL_INSTANCE = 1; + + // An instance running on the customer's premises that is not managed by + // Cloud SQL. + ON_PREMISES_INSTANCE = 2; + + // A Cloud SQL instance acting as a read-replica. + READ_REPLICA_INSTANCE = 3; + + // A Cloud SQL read pool. + READ_POOL_INSTANCE = 5; +} + +// Connection pool flags for Cloud SQL instances managed connection pool +// configuration. +message ConnectionPoolFlags { + // Required. The name of the flag. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The value of the flag. Boolean flags are set to `on` for true + // and `off` for false. This field must be omitted if the flag + // doesn't take a value. + string value = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The read pool auto-scale configuration. +message ReadPoolAutoScaleConfig { + // Target metric for read pool auto scaling. + message TargetMetric { + // The metric name to be used for auto scaling. + optional string metric = 1; + + // The target value for the metric. + optional float target_value = 2; + } + + // Indicates whether read pool auto scaling is enabled. + optional bool enabled = 1; + + // Minimum number of read pool nodes to be maintained. + optional int32 min_node_count = 2; + + // Maximum number of read pool nodes to be maintained. + optional int32 max_node_count = 3; + + // Optional. Target metrics for read pool auto scaling. + repeated TargetMetric target_metrics = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Indicates whether read pool auto scaling supports scale in operations + // (removing nodes). + optional bool disable_scale_in = 5; + + // The cooldown period for scale in operations. + optional int32 scale_in_cooldown_seconds = 6; + + // The cooldown period for scale out operations. + optional int32 scale_out_cooldown_seconds = 7; +} + +// The managed connection pooling configuration. +message ConnectionPoolConfig { + // Whether managed connection pooling is enabled. + optional bool connection_pooling_enabled = 1; + + // Optional. List of connection pool configuration flags. + repeated ConnectionPoolFlags flags = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Number of connection poolers. + optional int32 pooler_count = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The database engine type and version. +enum SqlDatabaseVersion { + // This is an unknown database version. + SQL_DATABASE_VERSION_UNSPECIFIED = 0; + + // The database version is MySQL 5.1. + MYSQL_5_1 = 2 [deprecated = true]; + + // The database version is MySQL 5.5. + MYSQL_5_5 = 3 [deprecated = true]; + + // The database version is MySQL 5.6. + MYSQL_5_6 = 5; + + // The database version is MySQL 5.7. + MYSQL_5_7 = 6; + + // The database version is MySQL 8. + MYSQL_8_0 = 20; + + // The database major version is MySQL 8.0 and the minor version is 18. + MYSQL_8_0_18 = 41; + + // The database major version is MySQL 8.0 and the minor version is 26. + MYSQL_8_0_26 = 85; + + // The database major version is MySQL 8.0 and the minor version is 27. + MYSQL_8_0_27 = 111; + + // The database major version is MySQL 8.0 and the minor version is 28. + MYSQL_8_0_28 = 132; + + // The database major version is MySQL 8.0 and the minor version is 29. + MYSQL_8_0_29 = 148 [deprecated = true]; + + // The database major version is MySQL 8.0 and the minor version is 30. + MYSQL_8_0_30 = 174; + + // The database major version is MySQL 8.0 and the minor version is 31. + MYSQL_8_0_31 = 197; + + // The database major version is MySQL 8.0 and the minor version is 32. + MYSQL_8_0_32 = 213; + + // The database major version is MySQL 8.0 and the minor version is 33. + MYSQL_8_0_33 = 238; + + // The database major version is MySQL 8.0 and the minor version is 34. + MYSQL_8_0_34 = 239; + + // The database major version is MySQL 8.0 and the minor version is 35. + MYSQL_8_0_35 = 240; + + // The database major version is MySQL 8.0 and the minor version is 36. + MYSQL_8_0_36 = 241; + + // The database major version is MySQL 8.0 and the minor version is 37. + MYSQL_8_0_37 = 355; + + // The database major version is MySQL 8.0 and the minor version is 39. + MYSQL_8_0_39 = 357; + + // The database major version is MySQL 8.0 and the minor version is 40. + MYSQL_8_0_40 = 358; + + // The database major version is MySQL 8.0 and the minor version is 41. + MYSQL_8_0_41 = 488; + + // The database major version is MySQL 8.0 and the minor version is 42. + MYSQL_8_0_42 = 489; + + // The database major version is MySQL 8.0 and the minor version is 43. + MYSQL_8_0_43 = 553; + + // The database major version is MySQL 8.0 and the minor version is 44. + MYSQL_8_0_44 = 554; + + // The database major version is MySQL 8.0 and the minor version is 45. + MYSQL_8_0_45 = 555; + + // The database major version is MySQL 8.0 and the minor version is 46. + MYSQL_8_0_46 = 556; + + // The database version is MySQL 8.4. + MYSQL_8_4 = 398; + + // The database version is MySQL 9.7. + MYSQL_9_7 = 654; + + // The database version is SQL Server 2017 Standard. + SQLSERVER_2017_STANDARD = 11; + + // The database version is SQL Server 2017 Enterprise. + SQLSERVER_2017_ENTERPRISE = 14; + + // The database version is SQL Server 2017 Express. + SQLSERVER_2017_EXPRESS = 15; + + // The database version is SQL Server 2017 Web. + SQLSERVER_2017_WEB = 16; + + // The database version is PostgreSQL 9.6. + POSTGRES_9_6 = 9; + + // The database version is PostgreSQL 10. + POSTGRES_10 = 18; + + // The database version is PostgreSQL 11. + POSTGRES_11 = 10; + + // The database version is PostgreSQL 12. + POSTGRES_12 = 19; + + // The database version is PostgreSQL 13. + POSTGRES_13 = 23; + + // The database version is PostgreSQL 14. + POSTGRES_14 = 110; + + // The database version is PostgreSQL 15. + POSTGRES_15 = 172; + + // The database version is PostgreSQL 16. + POSTGRES_16 = 272; + + // The database version is PostgreSQL 17. + POSTGRES_17 = 408; + + // The database version is PostgreSQL 18. + POSTGRES_18 = 557; + + // The database version is PostgreSQL 19. + POSTGRES_19 = 684; + + // The database version is PostgreSQL 20. + POSTGRES_20 = 781; + + // The database version is SQL Server 2019 Standard. + SQLSERVER_2019_STANDARD = 26; + + // The database version is SQL Server 2019 Enterprise. + SQLSERVER_2019_ENTERPRISE = 27; + + // The database version is SQL Server 2019 Express. + SQLSERVER_2019_EXPRESS = 28; + + // The database version is SQL Server 2019 Web. + SQLSERVER_2019_WEB = 29; + + // The database version is SQL Server 2022 Standard. + SQLSERVER_2022_STANDARD = 199; + + // The database version is SQL Server 2022 Enterprise. + SQLSERVER_2022_ENTERPRISE = 200; + + // The database version is SQL Server 2022 Express. + SQLSERVER_2022_EXPRESS = 201; + + // The database version is SQL Server 2022 Web. + SQLSERVER_2022_WEB = 202; + + // The database version is SQL Server 2025 Standard. + SQLSERVER_2025_STANDARD = 549; + + // The database version is SQL Server 2025 Enterprise. + SQLSERVER_2025_ENTERPRISE = 550; + + // The database version is SQL Server 2025 Express. + SQLSERVER_2025_EXPRESS = 551; +} + +// The suspension reason of the database instance if the state is SUSPENDED. +enum SqlSuspensionReason { + // This is an unknown suspension reason. + SQL_SUSPENSION_REASON_UNSPECIFIED = 0; + + // The instance is suspended due to billing issues (for example:, account + // issue) + BILLING_ISSUE = 2; + + // The instance is suspended due to illegal content (for example:, child + // pornography, copyrighted material, etc.). + LEGAL_ISSUE = 3; + + // The instance is causing operational issues (for example:, causing the + // database to crash). + OPERATIONAL_ISSUE = 4; + + // The KMS key used by the instance is either revoked or denied access to + KMS_KEY_ISSUE = 5; + + // The project is suspended due to abuse detected by Ares. + PROJECT_ABUSE = 8; +} + +// The pricing plan for this instance. +enum SqlPricingPlan { + // This is an unknown pricing plan for this instance. + SQL_PRICING_PLAN_UNSPECIFIED = 0; + + // The instance is billed at a monthly flat rate. + PACKAGE = 1; + + // The instance is billed per usage. + PER_USE = 2; +} + +enum SqlReplicationType { + // This is an unknown replication type for a Cloud SQL instance. + SQL_REPLICATION_TYPE_UNSPECIFIED = 0; + + // The synchronous replication mode for First Generation instances. It is the + // default value. + SYNCHRONOUS = 1; + + // The asynchronous replication mode for First Generation instances. It + // provides a slight performance gain, but if an outage occurs while this + // option is set to asynchronous, you can lose up to a few seconds of updates + // to your data. + ASYNCHRONOUS = 2; +} + +// The type of disk that is used for a v2 instance to use. +enum SqlDataDiskType { + // This is an unknown data disk type. + SQL_DATA_DISK_TYPE_UNSPECIFIED = 0; + + // An SSD data disk. + PD_SSD = 1; + + // An HDD data disk. + PD_HDD = 2; + + // This field is deprecated and will be removed from a future version of the + // API. + OBSOLETE_LOCAL_SSD = 3 [deprecated = true]; + + // A Hyperdisk Balanced data disk. + HYPERDISK_BALANCED = 4; +} + +// The availability type of the given Cloud SQL instance. +enum SqlAvailabilityType { + // This is an unknown Availability type. + SQL_AVAILABILITY_TYPE_UNSPECIFIED = 0; + + // Zonal available instance. + ZONAL = 1; + + // Regional available instance. + REGIONAL = 2; +} + +enum SqlUpdateTrack { + // This is an unknown maintenance timing preference. + SQL_UPDATE_TRACK_UNSPECIFIED = 0; + + // For an instance with a scheduled maintenance window, this maintenance + // timing indicates that the maintenance update is scheduled 7 to 14 days + // after the notification is sent out. Also referred to as `Week 1` (Console) + // and `preview` (gcloud CLI). + canary = 1; + + // For an instance with a scheduled maintenance window, this maintenance + // timing indicates that the maintenance update is scheduled 15 to 21 days + // after the notification is sent out. Also referred to as `Week 2` (Console) + // and `production` (gcloud CLI). + stable = 2; + + // For instance with a scheduled maintenance window, this maintenance + // timing indicates that the maintenance update is scheduled 35 to 42 days + // after the notification is sent out. + week5 = 3; +} + +// Acquire SSRS lease context. +message AcquireSsrsLeaseContext { + // The username to be used as the setup login to connect to the database + // server for SSRS setup. + optional string setup_login = 1; + + // The username to be used as the service login to connect to the report + // database for SSRS setup. + optional string service_login = 2; + + // The report database to be used for the SSRS setup. + optional string report_database = 3; + + // Lease duration needed for the SSRS setup. + optional google.protobuf.Duration duration = 4; +} + +enum SqlFlagType { + // This is an unknown flag type. + SQL_FLAG_TYPE_UNSPECIFIED = 0; + + // Boolean type flag. + BOOLEAN = 1; + + // String type flag. + STRING = 2; + + // Integer type flag. + INTEGER = 3; + + // Flag type used for a server startup option. + NONE = 4; + + // Type introduced specially for MySQL TimeZone offset. Accept a string value + // with the format [-12:59, 13:00]. + MYSQL_TIMEZONE_OFFSET = 5; + + // Float type flag. + FLOAT = 6; + + // Comma-separated list of the strings in a SqlFlagType enum. + REPEATED_STRING = 7; +} + +// Scopes of a flag describe where the flag is used. +enum SqlFlagScope { + // Assume database flags if unspecified + SQL_FLAG_SCOPE_UNSPECIFIED = 0; + + // database flags + SQL_FLAG_SCOPE_DATABASE = 1; + + // connection pool configuration flags + SQL_FLAG_SCOPE_CONNECTION_POOL = 2; +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_tiers.proto b/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_tiers.proto new file mode 100644 index 000000000000..8c2f712c8b99 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_tiers.proto @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1beta4; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1beta4/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlTiersProto"; +option java_package = "com.google.cloud.sql.v1beta4"; + +// Service for providing machine types (tiers) for Cloud SQL. +service SqlTiersService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Lists all available machine types (tiers) for Cloud SQL, for example, + // `db-custom-1-3840`. For related information, see [Pricing](/sql/pricing). + rpc List(SqlTiersListRequest) returns (TiersListResponse) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/tiers" + }; + } +} + +message SqlTiersListRequest { + // Project ID of the project for which to list tiers. + string project = 1; +} + +// Tiers list response. +message TiersListResponse { + // This is always `sql#tiersList`. + string kind = 1; + + // List of tiers. + repeated Tier items = 2; +} + +// A Google Cloud SQL service tier resource. +message Tier { + // An identifier for the machine type, for example, `db-custom-1-3840`. For + // related information, see [Pricing](/sql/pricing). + string tier = 1; + + // The maximum RAM usage of this tier in bytes. + int64 RAM = 2 [json_name = "RAM"]; + + // This is always `sql#tier`. + string kind = 3; + + // The maximum disk size of this tier in bytes. + int64 Disk_Quota = 4 [json_name = "DiskQuota"]; + + // The applicable regions for this tier. + repeated string region = 5; +} diff --git a/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_users.proto b/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_users.proto new file mode 100644 index 000000000000..b5c5a272f8e8 --- /dev/null +++ b/java-sql/proto-google-cloud-sql-v1beta4/src/main/proto/google/cloud/sql/v1beta4/cloud_sql_users.proto @@ -0,0 +1,315 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.sql.v1beta4; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/sql/v1beta4/cloud_sql_resources.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/sql/apiv1beta4/sqlpb;sqlpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSqlUsersProto"; +option java_package = "com.google.cloud.sql.v1beta4"; + +service SqlUsersService { + option (google.api.default_host) = "sqladmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/sqlservice.admin"; + + // Deletes a user from a Cloud SQL instance. + rpc Delete(SqlUsersDeleteRequest) returns (Operation) { + option (google.api.http) = { + delete: "/sql/v1beta4/projects/{project}/instances/{instance}/users" + }; + } + + // Retrieves a resource containing information about a user. + rpc Get(SqlUsersGetRequest) returns (User) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}/users/{name}" + }; + } + + // Creates a new user in a Cloud SQL instance. + rpc Insert(SqlUsersInsertRequest) returns (Operation) { + option (google.api.http) = { + post: "/sql/v1beta4/projects/{project}/instances/{instance}/users" + body: "body" + }; + } + + // Lists users in the specified Cloud SQL instance. + rpc List(SqlUsersListRequest) returns (UsersListResponse) { + option (google.api.http) = { + get: "/sql/v1beta4/projects/{project}/instances/{instance}/users" + }; + } + + // Updates an existing user in a Cloud SQL instance. + rpc Update(SqlUsersUpdateRequest) returns (Operation) { + option (google.api.http) = { + put: "/sql/v1beta4/projects/{project}/instances/{instance}/users" + body: "body" + }; + } +} + +message SqlUsersDeleteRequest { + // Host of the user in the instance. + string host = 1; + + // Database instance ID. This does not include the project ID. + string instance = 2; + + // Name of the user in the instance. + string name = 3; + + // Project ID of the project that contains the instance. + string project = 4; +} + +// Request message for Users Get RPC +message SqlUsersGetRequest { + // Database instance ID. This does not include the project ID. + string instance = 1; + + // User of the instance. + string name = 2; + + // Project ID of the project that contains the instance. + string project = 3; + + // Host of a user of the instance. + string host = 4; +} + +message SqlUsersInsertRequest { + // Database instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; + + User body = 100; +} + +message SqlUsersListRequest { + // Database instance ID. This does not include the project ID. + string instance = 1; + + // Project ID of the project that contains the instance. + string project = 2; +} + +message SqlUsersUpdateRequest { + // Optional. Host of the user in the instance. + string host = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Database instance ID. This does not include the project ID. + string instance = 2; + + // Name of the user in the instance. + string name = 3; + + // Project ID of the project that contains the instance. + string project = 4; + + // Optional. List of database roles to grant to the user. body.database_roles + // will be ignored for update request. + repeated string database_roles = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether to revoke existing roles that are not present + // in the `database_roles` field. If `false` or unset, the database roles + // specified in `database_roles` are added to the user's existing roles. + optional bool revoke_existing_roles = 6 + [(google.api.field_behavior) = OPTIONAL]; + + User body = 100; +} + +// User level password validation policy. +message UserPasswordValidationPolicy { + // Number of failed login attempts allowed before user get locked. + int32 allowed_failed_attempts = 1; + + // Expiration duration after password is updated. + google.protobuf.Duration password_expiration_duration = 2; + + // If true, failed login attempts check will be enabled. + bool enable_failed_attempts_check = 3; + + // Output only. Read-only password status. + PasswordStatus status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // If true, the user must specify the current password before changing the + // password. This flag is supported only for MySQL. + bool enable_password_verification = 5; +} + +// Read-only password status. +message PasswordStatus { + // If true, user does not have login privileges. + bool locked = 1; + + // The expiration time of the current password. + google.protobuf.Timestamp password_expiration_time = 2; +} + +// A Cloud SQL user resource. +message User { + // The user type. + enum SqlUserType { + // The database's built-in user type. + BUILT_IN = 0; + + // Cloud IAM user. + CLOUD_IAM_USER = 1; + + // Cloud IAM service account. + CLOUD_IAM_SERVICE_ACCOUNT = 2; + + // Cloud IAM group. Not used for login. + CLOUD_IAM_GROUP = 3; + + // Read-only. Login for a user that belongs to the Cloud IAM group. + CLOUD_IAM_GROUP_USER = 4; + + // Read-only. Login for a service account that belongs to the + // Cloud IAM group. + CLOUD_IAM_GROUP_SERVICE_ACCOUNT = 5; + + // Cloud IAM workforce identity user managed via workforce identity + // federation. + CLOUD_IAM_WORKFORCE_IDENTITY = 6; + + // Microsoft Entra ID user. + ENTRAID_USER = 7; + } + + // The type of retained password. + enum DualPasswordType { + // The default value. + DUAL_PASSWORD_TYPE_UNSPECIFIED = 0; + + // Do not update the user's dual password status. + NO_MODIFY_DUAL_PASSWORD = 1; + + // No dual password usable for connecting using this user. + NO_DUAL_PASSWORD = 2; + + // Dual password usable for connecting using this user. + DUAL_PASSWORD = 3; + } + + // Indicates if a group is available for IAM database authentication. + enum IamStatus { + // The default value for users that are not of type CLOUD_IAM_GROUP. + // Only CLOUD_IAM_GROUP users will be inactive or active. + // Users with an IamStatus of IAM_STATUS_UNSPECIFIED will not + // display whether they are active or inactive as that is not applicable to + // them. + IAM_STATUS_UNSPECIFIED = 0; + + // INACTIVE indicates a group is not available for IAM database + // authentication. + INACTIVE = 1; + + // ACTIVE indicates a group is available for IAM database authentication. + ACTIVE = 2; + } + + // This is always `sql#user`. + string kind = 1; + + // The password for the user. + string password = 2; + + // This field is deprecated and will be removed from a future version of the + // API. + string etag = 3; + + // The name of the user in the Cloud SQL instance. Can be omitted for + // `update` because it is already specified in the URL. + string name = 4; + + // Optional. The host from which the user can connect. For `insert` + // operations, host defaults to an empty string. For `update` + // operations, host is specified as part of the request URL. The host name + // cannot be updated after insertion. For a MySQL instance, it's required; + // for a PostgreSQL or SQL Server instance, it's optional. + string host = 5 [(google.api.field_behavior) = OPTIONAL]; + + // The name of the Cloud SQL instance. This does not include the project ID. + // Can be omitted for update because it is already specified on the + // URL. + string instance = 6; + + // The project ID of the project containing the Cloud SQL database. The Google + // apps domain is prefixed if applicable. Can be omitted for + // update because it is already specified on the URL. + string project = 7; + + // The user type. It determines the method to authenticate the user during + // login. The default is the database's built-in user type. + SqlUserType type = 8; + + // User details for specific database type + oneof user_details { + SqlServerUserDetails sqlserver_user_details = 9; + } + + // Optional. The full email for an IAM user. For normal database users, this + // will not be filled. Only applicable to MySQL database users. + string iam_email = 11 [(google.api.field_behavior) = OPTIONAL]; + + // User level password validation policy. + UserPasswordValidationPolicy password_policy = 12; + + // Dual password status for the user. + optional DualPasswordType dual_password_type = 13; + + // Indicates if a group is active or inactive for IAM database authentication. + optional IamStatus iam_status = 14; + + // Optional. Role memberships of the user + repeated string database_roles = 15 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents a Sql Server user on the Cloud SQL instance. +message SqlServerUserDetails { + // If the user has been disabled + bool disabled = 1; + + // The server roles for this user + repeated string server_roles = 2; +} + +// User list response. +message UsersListResponse { + // This is always sql#usersList. + string kind = 1; + + // List of user resources in the instance. + repeated User items = 2; + + // Unused. + string next_page_token = 3 [deprecated = true]; +} diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..ec0e7764f9a9 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupRunsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1.SqlBackupRunsServiceClient; +import com.google.cloud.sql.v1.SqlBackupRunsServiceSettings; +import com.google.cloud.sql.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 + SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings = + SqlBackupRunsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlBackupRunsService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..a07dfacdd687 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupRunsService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1.SqlBackupRunsServiceClient; +import com.google.cloud.sql.v1.SqlBackupRunsServiceSettings; +import com.google.cloud.sql.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 + SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings = + SqlBackupRunsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlBackupRunsService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..0cb72576b050 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupRunsService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1.SqlBackupRunsServiceClient; +import com.google.cloud.sql.v1.SqlBackupRunsServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings = + SqlBackupRunsServiceSettings.newHttpJsonBuilder().build(); + SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlBackupRunsService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/delete/AsyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/delete/AsyncDelete.java new file mode 100644 index 000000000000..ab6e32500eb1 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/delete/AsyncDelete.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupRunsService_Delete_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest; +import com.google.cloud.sql.v1.SqlBackupRunsServiceClient; + +public class AsyncDelete { + + public static void main(String[] args) throws Exception { + asyncDelete(); + } + + public static void asyncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsDeleteRequest request = + SqlBackupRunsDeleteRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlBackupRunsServiceClient.deleteCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlBackupRunsService_Delete_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/delete/SyncDelete.java new file mode 100644 index 000000000000..35e70c5e32f3 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/delete/SyncDelete.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupRunsService_Delete_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupRunsDeleteRequest; +import com.google.cloud.sql.v1.SqlBackupRunsServiceClient; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsDeleteRequest request = + SqlBackupRunsDeleteRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlBackupRunsServiceClient.delete(request); + } + } +} +// [END sqladmin_v1_generated_SqlBackupRunsService_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/get/AsyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/get/AsyncGet.java new file mode 100644 index 000000000000..5996a764cfb6 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/get/AsyncGet.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupRunsService_Get_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.BackupRun; +import com.google.cloud.sql.v1.SqlBackupRunsGetRequest; +import com.google.cloud.sql.v1.SqlBackupRunsServiceClient; + +public class AsyncGet { + + public static void main(String[] args) throws Exception { + asyncGet(); + } + + public static void asyncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsGetRequest request = + SqlBackupRunsGetRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlBackupRunsServiceClient.getCallable().futureCall(request); + // Do something. + BackupRun response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlBackupRunsService_Get_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/get/SyncGet.java new file mode 100644 index 000000000000..f7e9223057a4 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/get/SyncGet.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupRunsService_Get_sync] +import com.google.cloud.sql.v1.BackupRun; +import com.google.cloud.sql.v1.SqlBackupRunsGetRequest; +import com.google.cloud.sql.v1.SqlBackupRunsServiceClient; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsGetRequest request = + SqlBackupRunsGetRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + BackupRun response = sqlBackupRunsServiceClient.get(request); + } + } +} +// [END sqladmin_v1_generated_SqlBackupRunsService_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/insert/AsyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/insert/AsyncInsert.java new file mode 100644 index 000000000000..62c0fb21ef43 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/insert/AsyncInsert.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupRunsService_Insert_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.BackupRun; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupRunsInsertRequest; +import com.google.cloud.sql.v1.SqlBackupRunsServiceClient; + +public class AsyncInsert { + + public static void main(String[] args) throws Exception { + asyncInsert(); + } + + public static void asyncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsInsertRequest request = + SqlBackupRunsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(BackupRun.newBuilder().build()) + .build(); + ApiFuture future = sqlBackupRunsServiceClient.insertCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlBackupRunsService_Insert_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/insert/SyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/insert/SyncInsert.java new file mode 100644 index 000000000000..af58c7ed237d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/insert/SyncInsert.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupRunsService_Insert_sync] +import com.google.cloud.sql.v1.BackupRun; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupRunsInsertRequest; +import com.google.cloud.sql.v1.SqlBackupRunsServiceClient; + +public class SyncInsert { + + public static void main(String[] args) throws Exception { + syncInsert(); + } + + public static void syncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsInsertRequest request = + SqlBackupRunsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(BackupRun.newBuilder().build()) + .build(); + Operation response = sqlBackupRunsServiceClient.insert(request); + } + } +} +// [END sqladmin_v1_generated_SqlBackupRunsService_Insert_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/list/AsyncList.java new file mode 100644 index 000000000000..8e6cbb4f7d86 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/list/AsyncList.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupRunsService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.BackupRunsListResponse; +import com.google.cloud.sql.v1.SqlBackupRunsListRequest; +import com.google.cloud.sql.v1.SqlBackupRunsServiceClient; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsListRequest request = + SqlBackupRunsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlBackupRunsServiceClient.listCallable().futureCall(request); + // Do something. + BackupRunsListResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlBackupRunsService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/list/SyncList.java new file mode 100644 index 000000000000..1a47f0895741 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservice/list/SyncList.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupRunsService_List_sync] +import com.google.cloud.sql.v1.BackupRunsListResponse; +import com.google.cloud.sql.v1.SqlBackupRunsListRequest; +import com.google.cloud.sql.v1.SqlBackupRunsServiceClient; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsListRequest request = + SqlBackupRunsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + BackupRunsListResponse response = sqlBackupRunsServiceClient.list(request); + } + } +} +// [END sqladmin_v1_generated_SqlBackupRunsService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservicesettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservicesettings/delete/SyncDelete.java new file mode 100644 index 000000000000..13357f825c4c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackuprunsservicesettings/delete/SyncDelete.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupRunsServiceSettings_Delete_sync] +import com.google.cloud.sql.v1.SqlBackupRunsServiceSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlBackupRunsServiceSettings.Builder sqlBackupRunsServiceSettingsBuilder = + SqlBackupRunsServiceSettings.newBuilder(); + sqlBackupRunsServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlBackupRunsServiceSettingsBuilder + .deleteSettings() + .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()); + SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings = + sqlBackupRunsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlBackupRunsServiceSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..2c944843d45a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; +import com.google.cloud.sql.v1.SqlBackupsServiceSettings; +import com.google.cloud.sql.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 + SqlBackupsServiceSettings sqlBackupsServiceSettings = + SqlBackupsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlBackupsServiceClient sqlBackupsServiceClient = + SqlBackupsServiceClient.create(sqlBackupsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlBackupsService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..054e361c04ea --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1.SqlBackupsServiceClient; +import com.google.cloud.sql.v1.SqlBackupsServiceSettings; +import com.google.cloud.sql.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 + SqlBackupsServiceSettings sqlBackupsServiceSettings = + SqlBackupsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlBackupsServiceClient sqlBackupsServiceClient = + SqlBackupsServiceClient.create(sqlBackupsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlBackupsService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..db56e83a485e --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1.SqlBackupsServiceClient; +import com.google.cloud.sql.v1.SqlBackupsServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlBackupsServiceSettings sqlBackupsServiceSettings = + SqlBackupsServiceSettings.newHttpJsonBuilder().build(); + SqlBackupsServiceClient sqlBackupsServiceClient = + SqlBackupsServiceClient.create(sqlBackupsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlBackupsService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/createbackup/AsyncCreateBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/createbackup/AsyncCreateBackup.java new file mode 100644 index 000000000000..6008df2ff3e4 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/createbackup/AsyncCreateBackup.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_CreateBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.CreateBackupRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.ProjectName; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class AsyncCreateBackup { + + public static void main(String[] args) throws Exception { + asyncCreateBackup(); + } + + public static void asyncCreateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setBackup(Backup.newBuilder().build()) + .build(); + ApiFuture future = + sqlBackupsServiceClient.createBackupCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_CreateBackup_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/createbackup/SyncCreateBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/createbackup/SyncCreateBackup.java new file mode 100644 index 000000000000..7535a3bd9a89 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/createbackup/SyncCreateBackup.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_CreateBackup_sync] +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.CreateBackupRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.ProjectName; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class SyncCreateBackup { + + public static void main(String[] args) throws Exception { + syncCreateBackup(); + } + + public static void syncCreateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setBackup(Backup.newBuilder().build()) + .build(); + Operation response = sqlBackupsServiceClient.createBackup(request); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_CreateBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/createbackup/SyncCreateBackupProjectnameBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/createbackup/SyncCreateBackupProjectnameBackup.java new file mode 100644 index 000000000000..ec5ec9e301e0 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/createbackup/SyncCreateBackupProjectnameBackup.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_CreateBackup_ProjectnameBackup_sync] +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.ProjectName; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class SyncCreateBackupProjectnameBackup { + + public static void main(String[] args) throws Exception { + syncCreateBackupProjectnameBackup(); + } + + public static void syncCreateBackupProjectnameBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + Backup backup = Backup.newBuilder().build(); + Operation response = sqlBackupsServiceClient.createBackup(parent, backup); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_CreateBackup_ProjectnameBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/createbackup/SyncCreateBackupStringBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/createbackup/SyncCreateBackupStringBackup.java new file mode 100644 index 000000000000..a3c90d78f9a1 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/createbackup/SyncCreateBackupStringBackup.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_CreateBackup_StringBackup_sync] +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.ProjectName; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class SyncCreateBackupStringBackup { + + public static void main(String[] args) throws Exception { + syncCreateBackupStringBackup(); + } + + public static void syncCreateBackupStringBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + Backup backup = Backup.newBuilder().build(); + Operation response = sqlBackupsServiceClient.createBackup(parent, backup); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_CreateBackup_StringBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/deletebackup/AsyncDeleteBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/deletebackup/AsyncDeleteBackup.java new file mode 100644 index 000000000000..de799cd4f522 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/deletebackup/AsyncDeleteBackup.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_DeleteBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.BackupName; +import com.google.cloud.sql.v1.DeleteBackupRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class AsyncDeleteBackup { + + public static void main(String[] args) throws Exception { + asyncDeleteBackup(); + } + + public static void asyncDeleteBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .build(); + ApiFuture future = + sqlBackupsServiceClient.deleteBackupCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_DeleteBackup_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/deletebackup/SyncDeleteBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/deletebackup/SyncDeleteBackup.java new file mode 100644 index 000000000000..a95162ee875a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/deletebackup/SyncDeleteBackup.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_DeleteBackup_sync] +import com.google.cloud.sql.v1.BackupName; +import com.google.cloud.sql.v1.DeleteBackupRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class SyncDeleteBackup { + + public static void main(String[] args) throws Exception { + syncDeleteBackup(); + } + + public static void syncDeleteBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .build(); + Operation response = sqlBackupsServiceClient.deleteBackup(request); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_DeleteBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/deletebackup/SyncDeleteBackupBackupname.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/deletebackup/SyncDeleteBackupBackupname.java new file mode 100644 index 000000000000..09092a8d3be6 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/deletebackup/SyncDeleteBackupBackupname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_DeleteBackup_Backupname_sync] +import com.google.cloud.sql.v1.BackupName; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class SyncDeleteBackupBackupname { + + public static void main(String[] args) throws Exception { + syncDeleteBackupBackupname(); + } + + public static void syncDeleteBackupBackupname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + Operation response = sqlBackupsServiceClient.deleteBackup(name); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_DeleteBackup_Backupname_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/deletebackup/SyncDeleteBackupString.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/deletebackup/SyncDeleteBackupString.java new file mode 100644 index 000000000000..3d307a459086 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/deletebackup/SyncDeleteBackupString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_DeleteBackup_String_sync] +import com.google.cloud.sql.v1.BackupName; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class SyncDeleteBackupString { + + public static void main(String[] args) throws Exception { + syncDeleteBackupString(); + } + + public static void syncDeleteBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + String name = BackupName.of("[PROJECT]", "[BACKUP]").toString(); + Operation response = sqlBackupsServiceClient.deleteBackup(name); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_DeleteBackup_String_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/getbackup/AsyncGetBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/getbackup/AsyncGetBackup.java new file mode 100644 index 000000000000..73401a870203 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/getbackup/AsyncGetBackup.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_GetBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.BackupName; +import com.google.cloud.sql.v1.GetBackupRequest; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class AsyncGetBackup { + + public static void main(String[] args) throws Exception { + asyncGetBackup(); + } + + public static void asyncGetBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + GetBackupRequest request = + GetBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .build(); + ApiFuture future = sqlBackupsServiceClient.getBackupCallable().futureCall(request); + // Do something. + Backup response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_GetBackup_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/getbackup/SyncGetBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/getbackup/SyncGetBackup.java new file mode 100644 index 000000000000..58f11b84a432 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/getbackup/SyncGetBackup.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_GetBackup_sync] +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.BackupName; +import com.google.cloud.sql.v1.GetBackupRequest; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class SyncGetBackup { + + public static void main(String[] args) throws Exception { + syncGetBackup(); + } + + public static void syncGetBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + GetBackupRequest request = + GetBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .build(); + Backup response = sqlBackupsServiceClient.getBackup(request); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_GetBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/getbackup/SyncGetBackupBackupname.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/getbackup/SyncGetBackupBackupname.java new file mode 100644 index 000000000000..3cc0abf7da76 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/getbackup/SyncGetBackupBackupname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_GetBackup_Backupname_sync] +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.BackupName; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class SyncGetBackupBackupname { + + public static void main(String[] args) throws Exception { + syncGetBackupBackupname(); + } + + public static void syncGetBackupBackupname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + Backup response = sqlBackupsServiceClient.getBackup(name); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_GetBackup_Backupname_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/getbackup/SyncGetBackupString.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/getbackup/SyncGetBackupString.java new file mode 100644 index 000000000000..74c9f055c38a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/getbackup/SyncGetBackupString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_GetBackup_String_sync] +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.BackupName; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class SyncGetBackupString { + + public static void main(String[] args) throws Exception { + syncGetBackupString(); + } + + public static void syncGetBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + String name = BackupName.of("[PROJECT]", "[BACKUP]").toString(); + Backup response = sqlBackupsServiceClient.getBackup(name); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_GetBackup_String_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/AsyncListBackups.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/AsyncListBackups.java new file mode 100644 index 000000000000..f96720efdcf0 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/AsyncListBackups.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_ListBackups_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.ListBackupsRequest; +import com.google.cloud.sql.v1.ProjectName; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class AsyncListBackups { + + public static void main(String[] args) throws Exception { + asyncListBackups(); + } + + public static void asyncListBackups() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + sqlBackupsServiceClient.listBackupsPagedCallable().futureCall(request); + // Do something. + for (Backup element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_ListBackups_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/AsyncListBackupsPaged.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/AsyncListBackupsPaged.java new file mode 100644 index 000000000000..285607f01791 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/AsyncListBackupsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_ListBackups_Paged_async] +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.ListBackupsRequest; +import com.google.cloud.sql.v1.ListBackupsResponse; +import com.google.cloud.sql.v1.ProjectName; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; +import com.google.common.base.Strings; + +public class AsyncListBackupsPaged { + + public static void main(String[] args) throws Exception { + asyncListBackupsPaged(); + } + + public static void asyncListBackupsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListBackupsResponse response = sqlBackupsServiceClient.listBackupsCallable().call(request); + for (Backup element : response.getBackupsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_ListBackups_Paged_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/SyncListBackups.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/SyncListBackups.java new file mode 100644 index 000000000000..2640b753420c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/SyncListBackups.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_ListBackups_sync] +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.ListBackupsRequest; +import com.google.cloud.sql.v1.ProjectName; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class SyncListBackups { + + public static void main(String[] args) throws Exception { + syncListBackups(); + } + + public static void syncListBackups() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + for (Backup element : sqlBackupsServiceClient.listBackups(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_ListBackups_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/SyncListBackupsProjectname.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/SyncListBackupsProjectname.java new file mode 100644 index 000000000000..1362efa2f756 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/SyncListBackupsProjectname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_ListBackups_Projectname_sync] +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.ProjectName; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class SyncListBackupsProjectname { + + public static void main(String[] args) throws Exception { + syncListBackupsProjectname(); + } + + public static void syncListBackupsProjectname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (Backup element : sqlBackupsServiceClient.listBackups(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_ListBackups_Projectname_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/SyncListBackupsString.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/SyncListBackupsString.java new file mode 100644 index 000000000000..2833d75313d6 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/listbackups/SyncListBackupsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_ListBackups_String_sync] +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.ProjectName; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; + +public class SyncListBackupsString { + + public static void main(String[] args) throws Exception { + syncListBackupsString(); + } + + public static void syncListBackupsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (Backup element : sqlBackupsServiceClient.listBackups(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_ListBackups_String_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/updatebackup/AsyncUpdateBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/updatebackup/AsyncUpdateBackup.java new file mode 100644 index 000000000000..dae8ee1e1259 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/updatebackup/AsyncUpdateBackup.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_UpdateBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; +import com.google.cloud.sql.v1.UpdateBackupRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateBackup { + + public static void main(String[] args) throws Exception { + asyncUpdateBackup(); + } + + public static void asyncUpdateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder() + .setBackup(Backup.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + sqlBackupsServiceClient.updateBackupCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_UpdateBackup_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/updatebackup/SyncUpdateBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/updatebackup/SyncUpdateBackup.java new file mode 100644 index 000000000000..61b327fc8b3e --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/updatebackup/SyncUpdateBackup.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_UpdateBackup_sync] +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; +import com.google.cloud.sql.v1.UpdateBackupRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBackup { + + public static void main(String[] args) throws Exception { + syncUpdateBackup(); + } + + public static void syncUpdateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder() + .setBackup(Backup.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Operation response = sqlBackupsServiceClient.updateBackup(request); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_UpdateBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/updatebackup/SyncUpdateBackupBackupFieldmask.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/updatebackup/SyncUpdateBackupBackupFieldmask.java new file mode 100644 index 000000000000..6f4d40d3ea85 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservice/updatebackup/SyncUpdateBackupBackupFieldmask.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsService_UpdateBackup_BackupFieldmask_sync] +import com.google.cloud.sql.v1.Backup; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlBackupsServiceClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBackupBackupFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateBackupBackupFieldmask(); + } + + public static void syncUpdateBackupBackupFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Operation response = sqlBackupsServiceClient.updateBackup(backup, updateMask); + } + } +} +// [END sqladmin_v1_generated_SqlBackupsService_UpdateBackup_BackupFieldmask_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservicesettings/createbackup/SyncCreateBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservicesettings/createbackup/SyncCreateBackup.java new file mode 100644 index 000000000000..3728065c8813 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlbackupsservicesettings/createbackup/SyncCreateBackup.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlBackupsServiceSettings_CreateBackup_sync] +import com.google.cloud.sql.v1.SqlBackupsServiceSettings; +import java.time.Duration; + +public class SyncCreateBackup { + + public static void main(String[] args) throws Exception { + syncCreateBackup(); + } + + public static void syncCreateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlBackupsServiceSettings.Builder sqlBackupsServiceSettingsBuilder = + SqlBackupsServiceSettings.newBuilder(); + sqlBackupsServiceSettingsBuilder + .createBackupSettings() + .setRetrySettings( + sqlBackupsServiceSettingsBuilder + .createBackupSettings() + .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()); + SqlBackupsServiceSettings sqlBackupsServiceSettings = sqlBackupsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlBackupsServiceSettings_CreateBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..12f2ee75f404 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlConnectService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1.SqlConnectServiceClient; +import com.google.cloud.sql.v1.SqlConnectServiceSettings; +import com.google.cloud.sql.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 + SqlConnectServiceSettings sqlConnectServiceSettings = + SqlConnectServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlConnectServiceClient sqlConnectServiceClient = + SqlConnectServiceClient.create(sqlConnectServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlConnectService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..062e4f34a748 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlConnectService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1.SqlConnectServiceClient; +import com.google.cloud.sql.v1.SqlConnectServiceSettings; +import com.google.cloud.sql.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 + SqlConnectServiceSettings sqlConnectServiceSettings = + SqlConnectServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlConnectServiceClient sqlConnectServiceClient = + SqlConnectServiceClient.create(sqlConnectServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlConnectService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..43b9b79dc684 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlConnectService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1.SqlConnectServiceClient; +import com.google.cloud.sql.v1.SqlConnectServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlConnectServiceSettings sqlConnectServiceSettings = + SqlConnectServiceSettings.newHttpJsonBuilder().build(); + SqlConnectServiceClient sqlConnectServiceClient = + SqlConnectServiceClient.create(sqlConnectServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlConnectService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/generateephemeralcert/AsyncGenerateEphemeralCert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/generateephemeralcert/AsyncGenerateEphemeralCert.java new file mode 100644 index 000000000000..b1c3af6db039 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/generateephemeralcert/AsyncGenerateEphemeralCert.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlConnectService_GenerateEphemeralCert_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.GenerateEphemeralCertRequest; +import com.google.cloud.sql.v1.GenerateEphemeralCertResponse; +import com.google.cloud.sql.v1.SqlConnectServiceClient; +import com.google.protobuf.Duration; +import com.google.protobuf.Timestamp; + +public class AsyncGenerateEphemeralCert { + + public static void main(String[] args) throws Exception { + asyncGenerateEphemeralCert(); + } + + public static void asyncGenerateEphemeralCert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) { + GenerateEphemeralCertRequest request = + GenerateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setPublicKey("publicKey1446899510") + .setAccessToken("accessToken-1042689291") + .setReadTime(Timestamp.newBuilder().build()) + .setValidDuration(Duration.newBuilder().build()) + .build(); + ApiFuture future = + sqlConnectServiceClient.generateEphemeralCertCallable().futureCall(request); + // Do something. + GenerateEphemeralCertResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlConnectService_GenerateEphemeralCert_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/generateephemeralcert/SyncGenerateEphemeralCert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/generateephemeralcert/SyncGenerateEphemeralCert.java new file mode 100644 index 000000000000..fd68aad9ac93 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/generateephemeralcert/SyncGenerateEphemeralCert.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlConnectService_GenerateEphemeralCert_sync] +import com.google.cloud.sql.v1.GenerateEphemeralCertRequest; +import com.google.cloud.sql.v1.GenerateEphemeralCertResponse; +import com.google.cloud.sql.v1.SqlConnectServiceClient; +import com.google.protobuf.Duration; +import com.google.protobuf.Timestamp; + +public class SyncGenerateEphemeralCert { + + public static void main(String[] args) throws Exception { + syncGenerateEphemeralCert(); + } + + public static void syncGenerateEphemeralCert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) { + GenerateEphemeralCertRequest request = + GenerateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setPublicKey("publicKey1446899510") + .setAccessToken("accessToken-1042689291") + .setReadTime(Timestamp.newBuilder().build()) + .setValidDuration(Duration.newBuilder().build()) + .build(); + GenerateEphemeralCertResponse response = + sqlConnectServiceClient.generateEphemeralCert(request); + } + } +} +// [END sqladmin_v1_generated_SqlConnectService_GenerateEphemeralCert_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/getconnectsettings/AsyncGetConnectSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/getconnectsettings/AsyncGetConnectSettings.java new file mode 100644 index 000000000000..522c10afe8d6 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/getconnectsettings/AsyncGetConnectSettings.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlConnectService_GetConnectSettings_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.ConnectSettings; +import com.google.cloud.sql.v1.GetConnectSettingsRequest; +import com.google.cloud.sql.v1.SqlConnectServiceClient; +import com.google.protobuf.Timestamp; + +public class AsyncGetConnectSettings { + + public static void main(String[] args) throws Exception { + asyncGetConnectSettings(); + } + + public static void asyncGetConnectSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) { + GetConnectSettingsRequest request = + GetConnectSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReadTime(Timestamp.newBuilder().build()) + .build(); + ApiFuture future = + sqlConnectServiceClient.getConnectSettingsCallable().futureCall(request); + // Do something. + ConnectSettings response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlConnectService_GetConnectSettings_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/getconnectsettings/SyncGetConnectSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/getconnectsettings/SyncGetConnectSettings.java new file mode 100644 index 000000000000..6f46a0afc1eb --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/getconnectsettings/SyncGetConnectSettings.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlConnectService_GetConnectSettings_sync] +import com.google.cloud.sql.v1.ConnectSettings; +import com.google.cloud.sql.v1.GetConnectSettingsRequest; +import com.google.cloud.sql.v1.SqlConnectServiceClient; +import com.google.protobuf.Timestamp; + +public class SyncGetConnectSettings { + + public static void main(String[] args) throws Exception { + syncGetConnectSettings(); + } + + public static void syncGetConnectSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) { + GetConnectSettingsRequest request = + GetConnectSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReadTime(Timestamp.newBuilder().build()) + .build(); + ConnectSettings response = sqlConnectServiceClient.getConnectSettings(request); + } + } +} +// [END sqladmin_v1_generated_SqlConnectService_GetConnectSettings_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/resolveconnectsettings/AsyncResolveConnectSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/resolveconnectsettings/AsyncResolveConnectSettings.java new file mode 100644 index 000000000000..a45eaa3e06b0 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/resolveconnectsettings/AsyncResolveConnectSettings.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlConnectService_ResolveConnectSettings_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.ConnectSettings; +import com.google.cloud.sql.v1.ResolveConnectSettingsRequest; +import com.google.cloud.sql.v1.SqlConnectServiceClient; + +public class AsyncResolveConnectSettings { + + public static void main(String[] args) throws Exception { + asyncResolveConnectSettings(); + } + + public static void asyncResolveConnectSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) { + ResolveConnectSettingsRequest request = + ResolveConnectSettingsRequest.newBuilder() + .setDnsName("dnsName1813886804") + .setLocation("location1901043637") + .build(); + ApiFuture future = + sqlConnectServiceClient.resolveConnectSettingsCallable().futureCall(request); + // Do something. + ConnectSettings response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlConnectService_ResolveConnectSettings_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/resolveconnectsettings/SyncResolveConnectSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/resolveconnectsettings/SyncResolveConnectSettings.java new file mode 100644 index 000000000000..1166ac154d1b --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservice/resolveconnectsettings/SyncResolveConnectSettings.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlConnectService_ResolveConnectSettings_sync] +import com.google.cloud.sql.v1.ConnectSettings; +import com.google.cloud.sql.v1.ResolveConnectSettingsRequest; +import com.google.cloud.sql.v1.SqlConnectServiceClient; + +public class SyncResolveConnectSettings { + + public static void main(String[] args) throws Exception { + syncResolveConnectSettings(); + } + + public static void syncResolveConnectSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) { + ResolveConnectSettingsRequest request = + ResolveConnectSettingsRequest.newBuilder() + .setDnsName("dnsName1813886804") + .setLocation("location1901043637") + .build(); + ConnectSettings response = sqlConnectServiceClient.resolveConnectSettings(request); + } + } +} +// [END sqladmin_v1_generated_SqlConnectService_ResolveConnectSettings_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservicesettings/getconnectsettings/SyncGetConnectSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservicesettings/getconnectsettings/SyncGetConnectSettings.java new file mode 100644 index 000000000000..0d18311bf55f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlconnectservicesettings/getconnectsettings/SyncGetConnectSettings.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlConnectServiceSettings_GetConnectSettings_sync] +import com.google.cloud.sql.v1.SqlConnectServiceSettings; +import java.time.Duration; + +public class SyncGetConnectSettings { + + public static void main(String[] args) throws Exception { + syncGetConnectSettings(); + } + + public static void syncGetConnectSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlConnectServiceSettings.Builder sqlConnectServiceSettingsBuilder = + SqlConnectServiceSettings.newBuilder(); + sqlConnectServiceSettingsBuilder + .getConnectSettingsSettings() + .setRetrySettings( + sqlConnectServiceSettingsBuilder + .getConnectSettingsSettings() + .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()); + SqlConnectServiceSettings sqlConnectServiceSettings = sqlConnectServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlConnectServiceSettings_GetConnectSettings_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..3bfcd9cf6fa9 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; +import com.google.cloud.sql.v1.SqlDatabasesServiceSettings; +import com.google.cloud.sql.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 + SqlDatabasesServiceSettings sqlDatabasesServiceSettings = + SqlDatabasesServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlDatabasesServiceClient sqlDatabasesServiceClient = + SqlDatabasesServiceClient.create(sqlDatabasesServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..a16909654b79 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; +import com.google.cloud.sql.v1.SqlDatabasesServiceSettings; +import com.google.cloud.sql.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 + SqlDatabasesServiceSettings sqlDatabasesServiceSettings = + SqlDatabasesServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlDatabasesServiceClient sqlDatabasesServiceClient = + SqlDatabasesServiceClient.create(sqlDatabasesServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..67e5629ce491 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; +import com.google.cloud.sql.v1.SqlDatabasesServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlDatabasesServiceSettings sqlDatabasesServiceSettings = + SqlDatabasesServiceSettings.newHttpJsonBuilder().build(); + SqlDatabasesServiceClient sqlDatabasesServiceClient = + SqlDatabasesServiceClient.create(sqlDatabasesServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/delete/AsyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/delete/AsyncDelete.java new file mode 100644 index 000000000000..28dea1687c49 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/delete/AsyncDelete.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_Delete_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlDatabasesDeleteRequest; +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; + +public class AsyncDelete { + + public static void main(String[] args) throws Exception { + asyncDelete(); + } + + public static void asyncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesDeleteRequest request = + SqlDatabasesDeleteRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlDatabasesServiceClient.deleteCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_Delete_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/delete/SyncDelete.java new file mode 100644 index 000000000000..2212a417204c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/delete/SyncDelete.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_Delete_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlDatabasesDeleteRequest; +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesDeleteRequest request = + SqlDatabasesDeleteRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlDatabasesServiceClient.delete(request); + } + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/get/AsyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/get/AsyncGet.java new file mode 100644 index 000000000000..68475174672a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/get/AsyncGet.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_Get_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Database; +import com.google.cloud.sql.v1.SqlDatabasesGetRequest; +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; + +public class AsyncGet { + + public static void main(String[] args) throws Exception { + asyncGet(); + } + + public static void asyncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesGetRequest request = + SqlDatabasesGetRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlDatabasesServiceClient.getCallable().futureCall(request); + // Do something. + Database response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_Get_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/get/SyncGet.java new file mode 100644 index 000000000000..e633f3d92d0a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/get/SyncGet.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_Get_sync] +import com.google.cloud.sql.v1.Database; +import com.google.cloud.sql.v1.SqlDatabasesGetRequest; +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesGetRequest request = + SqlDatabasesGetRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Database response = sqlDatabasesServiceClient.get(request); + } + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/insert/AsyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/insert/AsyncInsert.java new file mode 100644 index 000000000000..3371966930b9 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/insert/AsyncInsert.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_Insert_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Database; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlDatabasesInsertRequest; +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; + +public class AsyncInsert { + + public static void main(String[] args) throws Exception { + asyncInsert(); + } + + public static void asyncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesInsertRequest request = + SqlDatabasesInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + ApiFuture future = sqlDatabasesServiceClient.insertCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_Insert_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/insert/SyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/insert/SyncInsert.java new file mode 100644 index 000000000000..56e96bdc10eb --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/insert/SyncInsert.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_Insert_sync] +import com.google.cloud.sql.v1.Database; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlDatabasesInsertRequest; +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; + +public class SyncInsert { + + public static void main(String[] args) throws Exception { + syncInsert(); + } + + public static void syncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesInsertRequest request = + SqlDatabasesInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + Operation response = sqlDatabasesServiceClient.insert(request); + } + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_Insert_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/list/AsyncList.java new file mode 100644 index 000000000000..7ed3062620e5 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/list/AsyncList.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.DatabasesListResponse; +import com.google.cloud.sql.v1.SqlDatabasesListRequest; +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesListRequest request = + SqlDatabasesListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlDatabasesServiceClient.listCallable().futureCall(request); + // Do something. + DatabasesListResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/list/SyncList.java new file mode 100644 index 000000000000..54c1c38161b1 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/list/SyncList.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_List_sync] +import com.google.cloud.sql.v1.DatabasesListResponse; +import com.google.cloud.sql.v1.SqlDatabasesListRequest; +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesListRequest request = + SqlDatabasesListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + DatabasesListResponse response = sqlDatabasesServiceClient.list(request); + } + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/patch/AsyncPatch.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/patch/AsyncPatch.java new file mode 100644 index 000000000000..05ee14afe1de --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/patch/AsyncPatch.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_Patch_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Database; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; +import com.google.cloud.sql.v1.SqlDatabasesUpdateRequest; + +public class AsyncPatch { + + public static void main(String[] args) throws Exception { + asyncPatch(); + } + + public static void asyncPatch() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + ApiFuture future = sqlDatabasesServiceClient.patchCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_Patch_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/patch/SyncPatch.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/patch/SyncPatch.java new file mode 100644 index 000000000000..8cd12ade4290 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/patch/SyncPatch.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_Patch_sync] +import com.google.cloud.sql.v1.Database; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; +import com.google.cloud.sql.v1.SqlDatabasesUpdateRequest; + +public class SyncPatch { + + public static void main(String[] args) throws Exception { + syncPatch(); + } + + public static void syncPatch() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + Operation response = sqlDatabasesServiceClient.patch(request); + } + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_Patch_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/update/AsyncUpdate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/update/AsyncUpdate.java new file mode 100644 index 000000000000..c3d207dab415 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/update/AsyncUpdate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_Update_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Database; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; +import com.google.cloud.sql.v1.SqlDatabasesUpdateRequest; + +public class AsyncUpdate { + + public static void main(String[] args) throws Exception { + asyncUpdate(); + } + + public static void asyncUpdate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + ApiFuture future = sqlDatabasesServiceClient.updateCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_Update_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/update/SyncUpdate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/update/SyncUpdate.java new file mode 100644 index 000000000000..0602b610d311 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservice/update/SyncUpdate.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesService_Update_sync] +import com.google.cloud.sql.v1.Database; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlDatabasesServiceClient; +import com.google.cloud.sql.v1.SqlDatabasesUpdateRequest; + +public class SyncUpdate { + + public static void main(String[] args) throws Exception { + syncUpdate(); + } + + public static void syncUpdate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + Operation response = sqlDatabasesServiceClient.update(request); + } + } +} +// [END sqladmin_v1_generated_SqlDatabasesService_Update_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservicesettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservicesettings/delete/SyncDelete.java new file mode 100644 index 000000000000..87a4f248e36d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqldatabasesservicesettings/delete/SyncDelete.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlDatabasesServiceSettings_Delete_sync] +import com.google.cloud.sql.v1.SqlDatabasesServiceSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlDatabasesServiceSettings.Builder sqlDatabasesServiceSettingsBuilder = + SqlDatabasesServiceSettings.newBuilder(); + sqlDatabasesServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlDatabasesServiceSettingsBuilder + .deleteSettings() + .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()); + SqlDatabasesServiceSettings sqlDatabasesServiceSettings = + sqlDatabasesServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlDatabasesServiceSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..a00e6492c15b --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlFlagsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1.SqlFlagsServiceClient; +import com.google.cloud.sql.v1.SqlFlagsServiceSettings; +import com.google.cloud.sql.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 + SqlFlagsServiceSettings sqlFlagsServiceSettings = + SqlFlagsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlFlagsServiceClient sqlFlagsServiceClient = + SqlFlagsServiceClient.create(sqlFlagsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlFlagsService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..11d01d5a0b31 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlFlagsService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1.SqlFlagsServiceClient; +import com.google.cloud.sql.v1.SqlFlagsServiceSettings; +import com.google.cloud.sql.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 + SqlFlagsServiceSettings sqlFlagsServiceSettings = + SqlFlagsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlFlagsServiceClient sqlFlagsServiceClient = + SqlFlagsServiceClient.create(sqlFlagsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlFlagsService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..dc64ec9a1744 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlFlagsService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1.SqlFlagsServiceClient; +import com.google.cloud.sql.v1.SqlFlagsServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlFlagsServiceSettings sqlFlagsServiceSettings = + SqlFlagsServiceSettings.newHttpJsonBuilder().build(); + SqlFlagsServiceClient sqlFlagsServiceClient = + SqlFlagsServiceClient.create(sqlFlagsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlFlagsService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/list/AsyncList.java new file mode 100644 index 000000000000..79f8f586ebd0 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/list/AsyncList.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlFlagsService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.FlagsListResponse; +import com.google.cloud.sql.v1.SqlFlagScope; +import com.google.cloud.sql.v1.SqlFlagsListRequest; +import com.google.cloud.sql.v1.SqlFlagsServiceClient; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlFlagsServiceClient sqlFlagsServiceClient = SqlFlagsServiceClient.create()) { + SqlFlagsListRequest request = + SqlFlagsListRequest.newBuilder() + .setDatabaseVersion("databaseVersion1250955997") + .setFlagScope(SqlFlagScope.forNumber(0)) + .build(); + ApiFuture future = + sqlFlagsServiceClient.listCallable().futureCall(request); + // Do something. + FlagsListResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlFlagsService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/list/SyncList.java new file mode 100644 index 000000000000..d02a998d59d4 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservice/list/SyncList.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlFlagsService_List_sync] +import com.google.cloud.sql.v1.FlagsListResponse; +import com.google.cloud.sql.v1.SqlFlagScope; +import com.google.cloud.sql.v1.SqlFlagsListRequest; +import com.google.cloud.sql.v1.SqlFlagsServiceClient; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlFlagsServiceClient sqlFlagsServiceClient = SqlFlagsServiceClient.create()) { + SqlFlagsListRequest request = + SqlFlagsListRequest.newBuilder() + .setDatabaseVersion("databaseVersion1250955997") + .setFlagScope(SqlFlagScope.forNumber(0)) + .build(); + FlagsListResponse response = sqlFlagsServiceClient.list(request); + } + } +} +// [END sqladmin_v1_generated_SqlFlagsService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservicesettings/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservicesettings/list/SyncList.java new file mode 100644 index 000000000000..dabbe4690c1e --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlflagsservicesettings/list/SyncList.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlFlagsServiceSettings_List_sync] +import com.google.cloud.sql.v1.SqlFlagsServiceSettings; +import java.time.Duration; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlFlagsServiceSettings.Builder sqlFlagsServiceSettingsBuilder = + SqlFlagsServiceSettings.newBuilder(); + sqlFlagsServiceSettingsBuilder + .listSettings() + .setRetrySettings( + sqlFlagsServiceSettingsBuilder + .listSettings() + .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()); + SqlFlagsServiceSettings sqlFlagsServiceSettings = sqlFlagsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlFlagsServiceSettings_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/acquiressrslease/AsyncAcquireSsrsLease.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/acquiressrslease/AsyncAcquireSsrsLease.java new file mode 100644 index 000000000000..8ba3d8b0bbe9 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/acquiressrslease/AsyncAcquireSsrsLease.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_AcquireSsrsLease_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncAcquireSsrsLease { + + public static void main(String[] args) throws Exception { + asyncAcquireSsrsLease(); + } + + public static void asyncAcquireSsrsLease() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAcquireSsrsLeaseRequest request = + SqlInstancesAcquireSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.acquireSsrsLeaseCallable().futureCall(request); + // Do something. + SqlInstancesAcquireSsrsLeaseResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_AcquireSsrsLease_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/acquiressrslease/SyncAcquireSsrsLease.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/acquiressrslease/SyncAcquireSsrsLease.java new file mode 100644 index 000000000000..c0defbdc144f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/acquiressrslease/SyncAcquireSsrsLease.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_AcquireSsrsLease_sync] +import com.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncAcquireSsrsLease { + + public static void main(String[] args) throws Exception { + syncAcquireSsrsLease(); + } + + public static void syncAcquireSsrsLease() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAcquireSsrsLeaseRequest request = + SqlInstancesAcquireSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build()) + .build(); + SqlInstancesAcquireSsrsLeaseResponse response = + sqlInstancesServiceClient.acquireSsrsLease(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_AcquireSsrsLease_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addentraidcertificate/AsyncAddEntraIdCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addentraidcertificate/AsyncAddEntraIdCertificate.java new file mode 100644 index 000000000000..0afc429a9fea --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addentraidcertificate/AsyncAddEntraIdCertificate.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_AddEntraIdCertificate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncAddEntraIdCertificate { + + public static void main(String[] args) throws Exception { + asyncAddEntraIdCertificate(); + } + + public static void asyncAddEntraIdCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAddEntraIdCertificateRequest request = + SqlInstancesAddEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.addEntraIdCertificateCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_AddEntraIdCertificate_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addentraidcertificate/SyncAddEntraIdCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addentraidcertificate/SyncAddEntraIdCertificate.java new file mode 100644 index 000000000000..c9cd6480d4af --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addentraidcertificate/SyncAddEntraIdCertificate.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_AddEntraIdCertificate_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncAddEntraIdCertificate { + + public static void main(String[] args) throws Exception { + syncAddEntraIdCertificate(); + } + + public static void syncAddEntraIdCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAddEntraIdCertificateRequest request = + SqlInstancesAddEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.addEntraIdCertificate(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_AddEntraIdCertificate_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addserverca/AsyncAddServerCa.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addserverca/AsyncAddServerCa.java new file mode 100644 index 000000000000..452bf216778b --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addserverca/AsyncAddServerCa.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_AddServerCa_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncAddServerCa { + + public static void main(String[] args) throws Exception { + asyncAddServerCa(); + } + + public static void asyncAddServerCa() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAddServerCaRequest request = + SqlInstancesAddServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.addServerCaCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_AddServerCa_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addserverca/SyncAddServerCa.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addserverca/SyncAddServerCa.java new file mode 100644 index 000000000000..ebf58345a4b1 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addserverca/SyncAddServerCa.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_AddServerCa_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesAddServerCaRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncAddServerCa { + + public static void main(String[] args) throws Exception { + syncAddServerCa(); + } + + public static void syncAddServerCa() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAddServerCaRequest request = + SqlInstancesAddServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.addServerCa(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_AddServerCa_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addservercertificate/AsyncAddServerCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addservercertificate/AsyncAddServerCertificate.java new file mode 100644 index 000000000000..e0d4f06bb7a8 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addservercertificate/AsyncAddServerCertificate.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_AddServerCertificate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncAddServerCertificate { + + public static void main(String[] args) throws Exception { + asyncAddServerCertificate(); + } + + public static void asyncAddServerCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAddServerCertificateRequest request = + SqlInstancesAddServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.addServerCertificateCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_AddServerCertificate_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addservercertificate/SyncAddServerCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addservercertificate/SyncAddServerCertificate.java new file mode 100644 index 000000000000..eadd3b1bea14 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/addservercertificate/SyncAddServerCertificate.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_AddServerCertificate_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncAddServerCertificate { + + public static void main(String[] args) throws Exception { + syncAddServerCertificate(); + } + + public static void syncAddServerCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAddServerCertificateRequest request = + SqlInstancesAddServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.addServerCertificate(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_AddServerCertificate_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/clone/AsyncClone.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/clone/AsyncClone.java new file mode 100644 index 000000000000..8026e0d04139 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/clone/AsyncClone.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Clone_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesCloneRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesCloneRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncClone { + + public static void main(String[] args) throws Exception { + asyncClone(); + } + + public static void asyncClone() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesCloneRequest request = + SqlInstancesCloneRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesCloneRequest.newBuilder().build()) + .build(); + ApiFuture future = sqlInstancesServiceClient.cloneCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Clone_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/clone/SyncClone.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/clone/SyncClone.java new file mode 100644 index 000000000000..6833c7b97e7b --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/clone/SyncClone.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Clone_sync] +import com.google.cloud.sql.v1.InstancesCloneRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesCloneRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncClone { + + public static void main(String[] args) throws Exception { + syncClone(); + } + + public static void syncClone() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesCloneRequest request = + SqlInstancesCloneRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesCloneRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.clone(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Clone_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..560132add43c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesServiceSettings; +import com.google.cloud.sql.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 + SqlInstancesServiceSettings sqlInstancesServiceSettings = + SqlInstancesServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlInstancesServiceClient sqlInstancesServiceClient = + SqlInstancesServiceClient.create(sqlInstancesServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..4e1fbf746017 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesServiceSettings; +import com.google.cloud.sql.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 + SqlInstancesServiceSettings sqlInstancesServiceSettings = + SqlInstancesServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlInstancesServiceClient sqlInstancesServiceClient = + SqlInstancesServiceClient.create(sqlInstancesServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..c3dc2ec4981d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlInstancesServiceSettings sqlInstancesServiceSettings = + SqlInstancesServiceSettings.newHttpJsonBuilder().build(); + SqlInstancesServiceClient sqlInstancesServiceClient = + SqlInstancesServiceClient.create(sqlInstancesServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/createephemeral/AsyncCreateEphemeral.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/createephemeral/AsyncCreateEphemeral.java new file mode 100644 index 000000000000..ead3661e3fdc --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/createephemeral/AsyncCreateEphemeral.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_CreateEphemeral_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SslCert; +import com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest; + +public class AsyncCreateEphemeral { + + public static void main(String[] args) throws Exception { + asyncCreateEphemeral(); + } + + public static void asyncCreateEphemeral() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesCreateEphemeralCertRequest request = + SqlInstancesCreateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsCreateEphemeralRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.createEphemeralCallable().futureCall(request); + // Do something. + SslCert response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_CreateEphemeral_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/createephemeral/SyncCreateEphemeral.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/createephemeral/SyncCreateEphemeral.java new file mode 100644 index 000000000000..890bc3b7baea --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/createephemeral/SyncCreateEphemeral.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_CreateEphemeral_sync] +import com.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SslCert; +import com.google.cloud.sql.v1.SslCertsCreateEphemeralRequest; + +public class SyncCreateEphemeral { + + public static void main(String[] args) throws Exception { + syncCreateEphemeral(); + } + + public static void syncCreateEphemeral() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesCreateEphemeralCertRequest request = + SqlInstancesCreateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsCreateEphemeralRequest.newBuilder().build()) + .build(); + SslCert response = sqlInstancesServiceClient.createEphemeral(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_CreateEphemeral_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/delete/AsyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/delete/AsyncDelete.java new file mode 100644 index 000000000000..51461447fcae --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/delete/AsyncDelete.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Delete_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesDeleteRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncDelete { + + public static void main(String[] args) throws Exception { + asyncDelete(); + } + + public static void asyncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesDeleteRequest request = + SqlInstancesDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setEnableFinalBackup(true) + .setFinalBackupDescription("finalBackupDescription-293551612") + .build(); + ApiFuture future = sqlInstancesServiceClient.deleteCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Delete_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/delete/SyncDelete.java new file mode 100644 index 000000000000..fca7b47b5d78 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/delete/SyncDelete.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Delete_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesDeleteRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesDeleteRequest request = + SqlInstancesDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setEnableFinalBackup(true) + .setFinalBackupDescription("finalBackupDescription-293551612") + .build(); + Operation response = sqlInstancesServiceClient.delete(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/demote/AsyncDemote.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/demote/AsyncDemote.java new file mode 100644 index 000000000000..fda2783e0aac --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/demote/AsyncDemote.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Demote_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesDemoteRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesDemoteRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncDemote { + + public static void main(String[] args) throws Exception { + asyncDemote(); + } + + public static void asyncDemote() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesDemoteRequest request = + SqlInstancesDemoteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteRequest.newBuilder().build()) + .build(); + ApiFuture future = sqlInstancesServiceClient.demoteCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Demote_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/demote/SyncDemote.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/demote/SyncDemote.java new file mode 100644 index 000000000000..6d20ada61d42 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/demote/SyncDemote.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Demote_sync] +import com.google.cloud.sql.v1.InstancesDemoteRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesDemoteRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncDemote { + + public static void main(String[] args) throws Exception { + syncDemote(); + } + + public static void syncDemote() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesDemoteRequest request = + SqlInstancesDemoteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.demote(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Demote_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/demotemaster/AsyncDemoteMaster.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/demotemaster/AsyncDemoteMaster.java new file mode 100644 index 000000000000..466321039c05 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/demotemaster/AsyncDemoteMaster.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_DemoteMaster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesDemoteMasterRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncDemoteMaster { + + public static void main(String[] args) throws Exception { + asyncDemoteMaster(); + } + + public static void asyncDemoteMaster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesDemoteMasterRequest request = + SqlInstancesDemoteMasterRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteMasterRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.demoteMasterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_DemoteMaster_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/demotemaster/SyncDemoteMaster.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/demotemaster/SyncDemoteMaster.java new file mode 100644 index 000000000000..5872b4e3d708 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/demotemaster/SyncDemoteMaster.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_DemoteMaster_sync] +import com.google.cloud.sql.v1.InstancesDemoteMasterRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncDemoteMaster { + + public static void main(String[] args) throws Exception { + syncDemoteMaster(); + } + + public static void syncDemoteMaster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesDemoteMasterRequest request = + SqlInstancesDemoteMasterRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteMasterRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.demoteMaster(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_DemoteMaster_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/executesql/AsyncExecuteSql.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/executesql/AsyncExecuteSql.java new file mode 100644 index 000000000000..754501db24f5 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/executesql/AsyncExecuteSql.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_ExecuteSql_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.ExecuteSqlPayload; +import com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest; +import com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncExecuteSql { + + public static void main(String[] args) throws Exception { + asyncExecuteSql(); + } + + public static void asyncExecuteSql() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesExecuteSqlRequest request = + SqlInstancesExecuteSqlRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(ExecuteSqlPayload.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.executeSqlCallable().futureCall(request); + // Do something. + SqlInstancesExecuteSqlResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_ExecuteSql_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/executesql/SyncExecuteSql.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/executesql/SyncExecuteSql.java new file mode 100644 index 000000000000..ccf110e58447 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/executesql/SyncExecuteSql.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_ExecuteSql_sync] +import com.google.cloud.sql.v1.ExecuteSqlPayload; +import com.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest; +import com.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncExecuteSql { + + public static void main(String[] args) throws Exception { + syncExecuteSql(); + } + + public static void syncExecuteSql() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesExecuteSqlRequest request = + SqlInstancesExecuteSqlRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(ExecuteSqlPayload.newBuilder().build()) + .build(); + SqlInstancesExecuteSqlResponse response = sqlInstancesServiceClient.executeSql(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_ExecuteSql_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/export/AsyncExport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/export/AsyncExport.java new file mode 100644 index 000000000000..960c75f58d33 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/export/AsyncExport.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Export_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesExportRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesExportRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncExport { + + public static void main(String[] args) throws Exception { + asyncExport(); + } + + public static void asyncExport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesExportRequest request = + SqlInstancesExportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesExportRequest.newBuilder().build()) + .build(); + ApiFuture future = sqlInstancesServiceClient.exportCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Export_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/export/SyncExport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/export/SyncExport.java new file mode 100644 index 000000000000..668f4a09ff6d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/export/SyncExport.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Export_sync] +import com.google.cloud.sql.v1.InstancesExportRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesExportRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncExport { + + public static void main(String[] args) throws Exception { + syncExport(); + } + + public static void syncExport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesExportRequest request = + SqlInstancesExportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesExportRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.export(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Export_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/failover/AsyncFailover.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/failover/AsyncFailover.java new file mode 100644 index 000000000000..db1a750b6948 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/failover/AsyncFailover.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Failover_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesFailoverRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesFailoverRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncFailover { + + public static void main(String[] args) throws Exception { + asyncFailover(); + } + + public static void asyncFailover() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesFailoverRequest request = + SqlInstancesFailoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesFailoverRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.failoverCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Failover_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/failover/SyncFailover.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/failover/SyncFailover.java new file mode 100644 index 000000000000..bc3f72e5b3db --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/failover/SyncFailover.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Failover_sync] +import com.google.cloud.sql.v1.InstancesFailoverRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesFailoverRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncFailover { + + public static void main(String[] args) throws Exception { + syncFailover(); + } + + public static void syncFailover() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesFailoverRequest request = + SqlInstancesFailoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesFailoverRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.failover(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Failover_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/get/AsyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/get/AsyncGet.java new file mode 100644 index 000000000000..efb794eebf0e --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/get/AsyncGet.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Get_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.DatabaseInstance; +import com.google.cloud.sql.v1.SqlInstancesGetRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncGet { + + public static void main(String[] args) throws Exception { + asyncGet(); + } + + public static void asyncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesGetRequest request = + SqlInstancesGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.getCallable().futureCall(request); + // Do something. + DatabaseInstance response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Get_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/get/SyncGet.java new file mode 100644 index 000000000000..fee786020e43 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/get/SyncGet.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Get_sync] +import com.google.cloud.sql.v1.DatabaseInstance; +import com.google.cloud.sql.v1.SqlInstancesGetRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesGetRequest request = + SqlInstancesGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + DatabaseInstance response = sqlInstancesServiceClient.get(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/getdiskshrinkconfig/AsyncGetDiskShrinkConfig.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/getdiskshrinkconfig/AsyncGetDiskShrinkConfig.java new file mode 100644 index 000000000000..9faaf72dae2a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/getdiskshrinkconfig/AsyncGetDiskShrinkConfig.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_GetDiskShrinkConfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest; +import com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncGetDiskShrinkConfig { + + public static void main(String[] args) throws Exception { + asyncGetDiskShrinkConfig(); + } + + public static void asyncGetDiskShrinkConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesGetDiskShrinkConfigRequest request = + SqlInstancesGetDiskShrinkConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.getDiskShrinkConfigCallable().futureCall(request); + // Do something. + SqlInstancesGetDiskShrinkConfigResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_GetDiskShrinkConfig_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/getdiskshrinkconfig/SyncGetDiskShrinkConfig.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/getdiskshrinkconfig/SyncGetDiskShrinkConfig.java new file mode 100644 index 000000000000..2add6b168141 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/getdiskshrinkconfig/SyncGetDiskShrinkConfig.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_GetDiskShrinkConfig_sync] +import com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest; +import com.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncGetDiskShrinkConfig { + + public static void main(String[] args) throws Exception { + syncGetDiskShrinkConfig(); + } + + public static void syncGetDiskShrinkConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesGetDiskShrinkConfigRequest request = + SqlInstancesGetDiskShrinkConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + SqlInstancesGetDiskShrinkConfigResponse response = + sqlInstancesServiceClient.getDiskShrinkConfig(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_GetDiskShrinkConfig_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/getlatestrecoverytime/AsyncGetLatestRecoveryTime.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/getlatestrecoverytime/AsyncGetLatestRecoveryTime.java new file mode 100644 index 000000000000..487eca4d9edf --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/getlatestrecoverytime/AsyncGetLatestRecoveryTime.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_GetLatestRecoveryTime_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest; +import com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.protobuf.Timestamp; + +public class AsyncGetLatestRecoveryTime { + + public static void main(String[] args) throws Exception { + asyncGetLatestRecoveryTime(); + } + + public static void asyncGetLatestRecoveryTime() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesGetLatestRecoveryTimeRequest request = + SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSourceInstanceDeletionTime(Timestamp.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.getLatestRecoveryTimeCallable().futureCall(request); + // Do something. + SqlInstancesGetLatestRecoveryTimeResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_GetLatestRecoveryTime_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/getlatestrecoverytime/SyncGetLatestRecoveryTime.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/getlatestrecoverytime/SyncGetLatestRecoveryTime.java new file mode 100644 index 000000000000..4d4b234b4d43 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/getlatestrecoverytime/SyncGetLatestRecoveryTime.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_GetLatestRecoveryTime_sync] +import com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest; +import com.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.protobuf.Timestamp; + +public class SyncGetLatestRecoveryTime { + + public static void main(String[] args) throws Exception { + syncGetLatestRecoveryTime(); + } + + public static void syncGetLatestRecoveryTime() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesGetLatestRecoveryTimeRequest request = + SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSourceInstanceDeletionTime(Timestamp.newBuilder().build()) + .build(); + SqlInstancesGetLatestRecoveryTimeResponse response = + sqlInstancesServiceClient.getLatestRecoveryTime(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_GetLatestRecoveryTime_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/import/AsyncImport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/import/AsyncImport.java new file mode 100644 index 000000000000..a26c2a415673 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/import/AsyncImport.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Import_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesImportRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesImportRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncImport { + + public static void main(String[] args) throws Exception { + asyncImport(); + } + + public static void asyncImport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesImportRequest request = + SqlInstancesImportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesImportRequest.newBuilder().build()) + .build(); + ApiFuture future = sqlInstancesServiceClient.importCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Import_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/import/SyncImport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/import/SyncImport.java new file mode 100644 index 000000000000..c1da3e1247fd --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/import/SyncImport.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Import_sync] +import com.google.cloud.sql.v1.InstancesImportRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesImportRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncImport { + + public static void main(String[] args) throws Exception { + syncImport(); + } + + public static void syncImport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesImportRequest request = + SqlInstancesImportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesImportRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.import_(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Import_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/insert/AsyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/insert/AsyncInsert.java new file mode 100644 index 000000000000..1727deb260b5 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/insert/AsyncInsert.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Insert_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.DatabaseInstance; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesInsertRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncInsert { + + public static void main(String[] args) throws Exception { + asyncInsert(); + } + + public static void asyncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesInsertRequest request = + SqlInstancesInsertRequest.newBuilder() + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + ApiFuture future = sqlInstancesServiceClient.insertCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Insert_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/insert/SyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/insert/SyncInsert.java new file mode 100644 index 000000000000..24e4242c1a5f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/insert/SyncInsert.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Insert_sync] +import com.google.cloud.sql.v1.DatabaseInstance; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesInsertRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncInsert { + + public static void main(String[] args) throws Exception { + syncInsert(); + } + + public static void syncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesInsertRequest request = + SqlInstancesInsertRequest.newBuilder() + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.insert(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Insert_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/list/AsyncList.java new file mode 100644 index 000000000000..ee33b9a517f7 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/list/AsyncList.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesListResponse; +import com.google.cloud.sql.v1.SqlInstancesListRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListRequest request = + SqlInstancesListRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.listCallable().futureCall(request); + // Do something. + InstancesListResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/list/SyncList.java new file mode 100644 index 000000000000..4e58c70e8137 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/list/SyncList.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_List_sync] +import com.google.cloud.sql.v1.InstancesListResponse; +import com.google.cloud.sql.v1.SqlInstancesListRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListRequest request = + SqlInstancesListRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + InstancesListResponse response = sqlInstancesServiceClient.list(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listentraidcertificates/AsyncListEntraIdCertificates.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listentraidcertificates/AsyncListEntraIdCertificates.java new file mode 100644 index 000000000000..cd6077e697b2 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listentraidcertificates/AsyncListEntraIdCertificates.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_ListEntraIdCertificates_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse; +import com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncListEntraIdCertificates { + + public static void main(String[] args) throws Exception { + asyncListEntraIdCertificates(); + } + + public static void asyncListEntraIdCertificates() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListEntraIdCertificatesRequest request = + SqlInstancesListEntraIdCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.listEntraIdCertificatesCallable().futureCall(request); + // Do something. + InstancesListEntraIdCertificatesResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_ListEntraIdCertificates_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listentraidcertificates/SyncListEntraIdCertificates.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listentraidcertificates/SyncListEntraIdCertificates.java new file mode 100644 index 000000000000..2e4dd4c5f2cb --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listentraidcertificates/SyncListEntraIdCertificates.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_ListEntraIdCertificates_sync] +import com.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse; +import com.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncListEntraIdCertificates { + + public static void main(String[] args) throws Exception { + syncListEntraIdCertificates(); + } + + public static void syncListEntraIdCertificates() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListEntraIdCertificatesRequest request = + SqlInstancesListEntraIdCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + InstancesListEntraIdCertificatesResponse response = + sqlInstancesServiceClient.listEntraIdCertificates(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_ListEntraIdCertificates_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listservercas/AsyncListServerCas.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listservercas/AsyncListServerCas.java new file mode 100644 index 000000000000..8ece76524481 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listservercas/AsyncListServerCas.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_ListServerCas_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesListServerCasResponse; +import com.google.cloud.sql.v1.SqlInstancesListServerCasRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncListServerCas { + + public static void main(String[] args) throws Exception { + asyncListServerCas(); + } + + public static void asyncListServerCas() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListServerCasRequest request = + SqlInstancesListServerCasRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.listServerCasCallable().futureCall(request); + // Do something. + InstancesListServerCasResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_ListServerCas_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listservercas/SyncListServerCas.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listservercas/SyncListServerCas.java new file mode 100644 index 000000000000..5fad47e10662 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listservercas/SyncListServerCas.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_ListServerCas_sync] +import com.google.cloud.sql.v1.InstancesListServerCasResponse; +import com.google.cloud.sql.v1.SqlInstancesListServerCasRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncListServerCas { + + public static void main(String[] args) throws Exception { + syncListServerCas(); + } + + public static void syncListServerCas() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListServerCasRequest request = + SqlInstancesListServerCasRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + InstancesListServerCasResponse response = sqlInstancesServiceClient.listServerCas(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_ListServerCas_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listservercertificates/AsyncListServerCertificates.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listservercertificates/AsyncListServerCertificates.java new file mode 100644 index 000000000000..883024fc59c6 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listservercertificates/AsyncListServerCertificates.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_ListServerCertificates_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesListServerCertificatesResponse; +import com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncListServerCertificates { + + public static void main(String[] args) throws Exception { + asyncListServerCertificates(); + } + + public static void asyncListServerCertificates() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListServerCertificatesRequest request = + SqlInstancesListServerCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.listServerCertificatesCallable().futureCall(request); + // Do something. + InstancesListServerCertificatesResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_ListServerCertificates_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listservercertificates/SyncListServerCertificates.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listservercertificates/SyncListServerCertificates.java new file mode 100644 index 000000000000..8bd3b60f0339 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/listservercertificates/SyncListServerCertificates.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_ListServerCertificates_sync] +import com.google.cloud.sql.v1.InstancesListServerCertificatesResponse; +import com.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncListServerCertificates { + + public static void main(String[] args) throws Exception { + syncListServerCertificates(); + } + + public static void syncListServerCertificates() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListServerCertificatesRequest request = + SqlInstancesListServerCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + InstancesListServerCertificatesResponse response = + sqlInstancesServiceClient.listServerCertificates(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_ListServerCertificates_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/patch/AsyncPatch.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/patch/AsyncPatch.java new file mode 100644 index 000000000000..a39f31715ddc --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/patch/AsyncPatch.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Patch_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.DatabaseInstance; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesPatchRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncPatch { + + public static void main(String[] args) throws Exception { + asyncPatch(); + } + + public static void asyncPatch() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPatchRequest request = + SqlInstancesPatchRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReconcilePscNetworking(true) + .setReconcilePscNetworkingForce(true) + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + ApiFuture future = sqlInstancesServiceClient.patchCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Patch_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/patch/SyncPatch.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/patch/SyncPatch.java new file mode 100644 index 000000000000..921e3dfa70e1 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/patch/SyncPatch.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Patch_sync] +import com.google.cloud.sql.v1.DatabaseInstance; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesPatchRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncPatch { + + public static void main(String[] args) throws Exception { + syncPatch(); + } + + public static void syncPatch() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPatchRequest request = + SqlInstancesPatchRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReconcilePscNetworking(true) + .setReconcilePscNetworkingForce(true) + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.patch(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Patch_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/performdiskshrink/AsyncPerformDiskShrink.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/performdiskshrink/AsyncPerformDiskShrink.java new file mode 100644 index 000000000000..2669e9bcbb65 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/performdiskshrink/AsyncPerformDiskShrink.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_PerformDiskShrink_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.PerformDiskShrinkContext; +import com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncPerformDiskShrink { + + public static void main(String[] args) throws Exception { + asyncPerformDiskShrink(); + } + + public static void asyncPerformDiskShrink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPerformDiskShrinkRequest request = + SqlInstancesPerformDiskShrinkRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(PerformDiskShrinkContext.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.performDiskShrinkCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_PerformDiskShrink_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/performdiskshrink/SyncPerformDiskShrink.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/performdiskshrink/SyncPerformDiskShrink.java new file mode 100644 index 000000000000..689e2ec45cd9 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/performdiskshrink/SyncPerformDiskShrink.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_PerformDiskShrink_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.PerformDiskShrinkContext; +import com.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncPerformDiskShrink { + + public static void main(String[] args) throws Exception { + syncPerformDiskShrink(); + } + + public static void syncPerformDiskShrink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPerformDiskShrinkRequest request = + SqlInstancesPerformDiskShrinkRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(PerformDiskShrinkContext.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.performDiskShrink(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_PerformDiskShrink_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/pointintimerestore/AsyncPointInTimeRestore.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/pointintimerestore/AsyncPointInTimeRestore.java new file mode 100644 index 000000000000..79d86f2ec70d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/pointintimerestore/AsyncPointInTimeRestore.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_PointInTimeRestore_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.PointInTimeRestoreContext; +import com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncPointInTimeRestore { + + public static void main(String[] args) throws Exception { + asyncPointInTimeRestore(); + } + + public static void asyncPointInTimeRestore() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPointInTimeRestoreRequest request = + SqlInstancesPointInTimeRestoreRequest.newBuilder() + .setParent("parent-995424086") + .setContext(PointInTimeRestoreContext.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.pointInTimeRestoreCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_PointInTimeRestore_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/pointintimerestore/SyncPointInTimeRestore.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/pointintimerestore/SyncPointInTimeRestore.java new file mode 100644 index 000000000000..dd5a8d6ac7ac --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/pointintimerestore/SyncPointInTimeRestore.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_PointInTimeRestore_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.PointInTimeRestoreContext; +import com.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncPointInTimeRestore { + + public static void main(String[] args) throws Exception { + syncPointInTimeRestore(); + } + + public static void syncPointInTimeRestore() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPointInTimeRestoreRequest request = + SqlInstancesPointInTimeRestoreRequest.newBuilder() + .setParent("parent-995424086") + .setContext(PointInTimeRestoreContext.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.pointInTimeRestore(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_PointInTimeRestore_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/precheckmajorversionupgrade/AsyncPreCheckMajorVersionUpgrade.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/precheckmajorversionupgrade/AsyncPreCheckMajorVersionUpgrade.java new file mode 100644 index 000000000000..6806b0407b88 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/precheckmajorversionupgrade/AsyncPreCheckMajorVersionUpgrade.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_PreCheckMajorVersionUpgrade_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncPreCheckMajorVersionUpgrade { + + public static void main(String[] args) throws Exception { + asyncPreCheckMajorVersionUpgrade(); + } + + public static void asyncPreCheckMajorVersionUpgrade() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPreCheckMajorVersionUpgradeRequest request = + SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.preCheckMajorVersionUpgradeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_PreCheckMajorVersionUpgrade_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/precheckmajorversionupgrade/SyncPreCheckMajorVersionUpgrade.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/precheckmajorversionupgrade/SyncPreCheckMajorVersionUpgrade.java new file mode 100644 index 000000000000..94271e769b6f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/precheckmajorversionupgrade/SyncPreCheckMajorVersionUpgrade.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_PreCheckMajorVersionUpgrade_sync] +import com.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncPreCheckMajorVersionUpgrade { + + public static void main(String[] args) throws Exception { + syncPreCheckMajorVersionUpgrade(); + } + + public static void syncPreCheckMajorVersionUpgrade() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPreCheckMajorVersionUpgradeRequest request = + SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.preCheckMajorVersionUpgrade(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_PreCheckMajorVersionUpgrade_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/promotereplica/AsyncPromoteReplica.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/promotereplica/AsyncPromoteReplica.java new file mode 100644 index 000000000000..00e512d624ae --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/promotereplica/AsyncPromoteReplica.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_PromoteReplica_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncPromoteReplica { + + public static void main(String[] args) throws Exception { + asyncPromoteReplica(); + } + + public static void asyncPromoteReplica() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPromoteReplicaRequest request = + SqlInstancesPromoteReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setFailover(true) + .build(); + ApiFuture future = + sqlInstancesServiceClient.promoteReplicaCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_PromoteReplica_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/promotereplica/SyncPromoteReplica.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/promotereplica/SyncPromoteReplica.java new file mode 100644 index 000000000000..b3165292df56 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/promotereplica/SyncPromoteReplica.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_PromoteReplica_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncPromoteReplica { + + public static void main(String[] args) throws Exception { + syncPromoteReplica(); + } + + public static void syncPromoteReplica() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPromoteReplicaRequest request = + SqlInstancesPromoteReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setFailover(true) + .build(); + Operation response = sqlInstancesServiceClient.promoteReplica(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_PromoteReplica_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/reencrypt/AsyncReencrypt.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/reencrypt/AsyncReencrypt.java new file mode 100644 index 000000000000..52ccd20d9322 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/reencrypt/AsyncReencrypt.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Reencrypt_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesReencryptRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesReencryptRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncReencrypt { + + public static void main(String[] args) throws Exception { + asyncReencrypt(); + } + + public static void asyncReencrypt() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesReencryptRequest request = + SqlInstancesReencryptRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesReencryptRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.reencryptCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Reencrypt_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/reencrypt/SyncReencrypt.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/reencrypt/SyncReencrypt.java new file mode 100644 index 000000000000..953428636587 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/reencrypt/SyncReencrypt.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Reencrypt_sync] +import com.google.cloud.sql.v1.InstancesReencryptRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesReencryptRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncReencrypt { + + public static void main(String[] args) throws Exception { + syncReencrypt(); + } + + public static void syncReencrypt() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesReencryptRequest request = + SqlInstancesReencryptRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesReencryptRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.reencrypt(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Reencrypt_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/releasessrslease/AsyncReleaseSsrsLease.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/releasessrslease/AsyncReleaseSsrsLease.java new file mode 100644 index 000000000000..c37adf67df62 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/releasessrslease/AsyncReleaseSsrsLease.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_ReleaseSsrsLease_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest; +import com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncReleaseSsrsLease { + + public static void main(String[] args) throws Exception { + asyncReleaseSsrsLease(); + } + + public static void asyncReleaseSsrsLease() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesReleaseSsrsLeaseRequest request = + SqlInstancesReleaseSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.releaseSsrsLeaseCallable().futureCall(request); + // Do something. + SqlInstancesReleaseSsrsLeaseResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_ReleaseSsrsLease_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/releasessrslease/SyncReleaseSsrsLease.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/releasessrslease/SyncReleaseSsrsLease.java new file mode 100644 index 000000000000..5712c41c5687 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/releasessrslease/SyncReleaseSsrsLease.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_ReleaseSsrsLease_sync] +import com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest; +import com.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncReleaseSsrsLease { + + public static void main(String[] args) throws Exception { + syncReleaseSsrsLease(); + } + + public static void syncReleaseSsrsLease() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesReleaseSsrsLeaseRequest request = + SqlInstancesReleaseSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + SqlInstancesReleaseSsrsLeaseResponse response = + sqlInstancesServiceClient.releaseSsrsLease(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_ReleaseSsrsLease_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/reschedulemaintenance/AsyncRescheduleMaintenance.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/reschedulemaintenance/AsyncRescheduleMaintenance.java new file mode 100644 index 000000000000..dd3aecfe6abe --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/reschedulemaintenance/AsyncRescheduleMaintenance.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_RescheduleMaintenance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest; +import com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncRescheduleMaintenance { + + public static void main(String[] args) throws Exception { + asyncRescheduleMaintenance(); + } + + public static void asyncRescheduleMaintenance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRescheduleMaintenanceRequest request = + SqlInstancesRescheduleMaintenanceRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.rescheduleMaintenanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_RescheduleMaintenance_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/reschedulemaintenance/SyncRescheduleMaintenance.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/reschedulemaintenance/SyncRescheduleMaintenance.java new file mode 100644 index 000000000000..656f9922b748 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/reschedulemaintenance/SyncRescheduleMaintenance.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_RescheduleMaintenance_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest; +import com.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncRescheduleMaintenance { + + public static void main(String[] args) throws Exception { + syncRescheduleMaintenance(); + } + + public static void syncRescheduleMaintenance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRescheduleMaintenanceRequest request = + SqlInstancesRescheduleMaintenanceRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.rescheduleMaintenance(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_RescheduleMaintenance_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/resetreplicasize/AsyncResetReplicaSize.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/resetreplicasize/AsyncResetReplicaSize.java new file mode 100644 index 000000000000..d4f98f0cd6c6 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/resetreplicasize/AsyncResetReplicaSize.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_ResetReplicaSize_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncResetReplicaSize { + + public static void main(String[] args) throws Exception { + asyncResetReplicaSize(); + } + + public static void asyncResetReplicaSize() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesResetReplicaSizeRequest request = + SqlInstancesResetReplicaSizeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.resetReplicaSizeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_ResetReplicaSize_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/resetreplicasize/SyncResetReplicaSize.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/resetreplicasize/SyncResetReplicaSize.java new file mode 100644 index 000000000000..eb027fa97677 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/resetreplicasize/SyncResetReplicaSize.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_ResetReplicaSize_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncResetReplicaSize { + + public static void main(String[] args) throws Exception { + syncResetReplicaSize(); + } + + public static void syncResetReplicaSize() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesResetReplicaSizeRequest request = + SqlInstancesResetReplicaSizeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.resetReplicaSize(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_ResetReplicaSize_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/resetsslconfig/AsyncResetSslConfig.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/resetsslconfig/AsyncResetSslConfig.java new file mode 100644 index 000000000000..4816464b183e --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/resetsslconfig/AsyncResetSslConfig.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_ResetSslConfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncResetSslConfig { + + public static void main(String[] args) throws Exception { + asyncResetSslConfig(); + } + + public static void asyncResetSslConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesResetSslConfigRequest request = + SqlInstancesResetSslConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.resetSslConfigCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_ResetSslConfig_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/resetsslconfig/SyncResetSslConfig.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/resetsslconfig/SyncResetSslConfig.java new file mode 100644 index 000000000000..aa0b8fe0e742 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/resetsslconfig/SyncResetSslConfig.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_ResetSslConfig_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncResetSslConfig { + + public static void main(String[] args) throws Exception { + syncResetSslConfig(); + } + + public static void syncResetSslConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesResetSslConfigRequest request = + SqlInstancesResetSslConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.resetSslConfig(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_ResetSslConfig_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/restart/AsyncRestart.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/restart/AsyncRestart.java new file mode 100644 index 000000000000..09591d08d31f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/restart/AsyncRestart.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Restart_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesRestartRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncRestart { + + public static void main(String[] args) throws Exception { + asyncRestart(); + } + + public static void asyncRestart() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRestartRequest request = + SqlInstancesRestartRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlInstancesServiceClient.restartCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Restart_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/restart/SyncRestart.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/restart/SyncRestart.java new file mode 100644 index 000000000000..6c43c58d9d1d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/restart/SyncRestart.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Restart_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesRestartRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncRestart { + + public static void main(String[] args) throws Exception { + syncRestart(); + } + + public static void syncRestart() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRestartRequest request = + SqlInstancesRestartRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.restart(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Restart_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/restorebackup/AsyncRestoreBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/restorebackup/AsyncRestoreBackup.java new file mode 100644 index 000000000000..e9a8838001c4 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/restorebackup/AsyncRestoreBackup.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_RestoreBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesRestoreBackupRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncRestoreBackup { + + public static void main(String[] args) throws Exception { + asyncRestoreBackup(); + } + + public static void asyncRestoreBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRestoreBackupRequest request = + SqlInstancesRestoreBackupRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRestoreBackupRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.restoreBackupCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_RestoreBackup_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/restorebackup/SyncRestoreBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/restorebackup/SyncRestoreBackup.java new file mode 100644 index 000000000000..b45240e88fd4 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/restorebackup/SyncRestoreBackup.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_RestoreBackup_sync] +import com.google.cloud.sql.v1.InstancesRestoreBackupRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncRestoreBackup { + + public static void main(String[] args) throws Exception { + syncRestoreBackup(); + } + + public static void syncRestoreBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRestoreBackupRequest request = + SqlInstancesRestoreBackupRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRestoreBackupRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.restoreBackup(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_RestoreBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateentraidcertificate/AsyncRotateEntraIdCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateentraidcertificate/AsyncRotateEntraIdCertificate.java new file mode 100644 index 000000000000..e391775d83d7 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateentraidcertificate/AsyncRotateEntraIdCertificate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_RotateEntraIdCertificate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncRotateEntraIdCertificate { + + public static void main(String[] args) throws Exception { + asyncRotateEntraIdCertificate(); + } + + public static void asyncRotateEntraIdCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRotateEntraIdCertificateRequest request = + SqlInstancesRotateEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.rotateEntraIdCertificateCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_RotateEntraIdCertificate_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateentraidcertificate/SyncRotateEntraIdCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateentraidcertificate/SyncRotateEntraIdCertificate.java new file mode 100644 index 000000000000..94f23cf04713 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateentraidcertificate/SyncRotateEntraIdCertificate.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_RotateEntraIdCertificate_sync] +import com.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncRotateEntraIdCertificate { + + public static void main(String[] args) throws Exception { + syncRotateEntraIdCertificate(); + } + + public static void syncRotateEntraIdCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRotateEntraIdCertificateRequest request = + SqlInstancesRotateEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.rotateEntraIdCertificate(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_RotateEntraIdCertificate_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateserverca/AsyncRotateServerCa.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateserverca/AsyncRotateServerCa.java new file mode 100644 index 000000000000..2d7ed8ec88ef --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateserverca/AsyncRotateServerCa.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_RotateServerCa_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesRotateServerCaRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncRotateServerCa { + + public static void main(String[] args) throws Exception { + asyncRotateServerCa(); + } + + public static void asyncRotateServerCa() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRotateServerCaRequest request = + SqlInstancesRotateServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCaRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.rotateServerCaCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_RotateServerCa_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateserverca/SyncRotateServerCa.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateserverca/SyncRotateServerCa.java new file mode 100644 index 000000000000..cda6228cd447 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateserverca/SyncRotateServerCa.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_RotateServerCa_sync] +import com.google.cloud.sql.v1.InstancesRotateServerCaRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncRotateServerCa { + + public static void main(String[] args) throws Exception { + syncRotateServerCa(); + } + + public static void syncRotateServerCa() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRotateServerCaRequest request = + SqlInstancesRotateServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCaRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.rotateServerCa(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_RotateServerCa_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateservercertificate/AsyncRotateServerCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateservercertificate/AsyncRotateServerCertificate.java new file mode 100644 index 000000000000..80102e138127 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateservercertificate/AsyncRotateServerCertificate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_RotateServerCertificate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class AsyncRotateServerCertificate { + + public static void main(String[] args) throws Exception { + asyncRotateServerCertificate(); + } + + public static void asyncRotateServerCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRotateServerCertificateRequest request = + SqlInstancesRotateServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCertificateRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.rotateServerCertificateCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_RotateServerCertificate_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateservercertificate/SyncRotateServerCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateservercertificate/SyncRotateServerCertificate.java new file mode 100644 index 000000000000..d49c6c0f3abd --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/rotateservercertificate/SyncRotateServerCertificate.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_RotateServerCertificate_sync] +import com.google.cloud.sql.v1.InstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; + +public class SyncRotateServerCertificate { + + public static void main(String[] args) throws Exception { + syncRotateServerCertificate(); + } + + public static void syncRotateServerCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRotateServerCertificateRequest request = + SqlInstancesRotateServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCertificateRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.rotateServerCertificate(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_RotateServerCertificate_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/startexternalsync/AsyncStartExternalSync.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/startexternalsync/AsyncStartExternalSync.java new file mode 100644 index 000000000000..c3d7602f13f6 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/startexternalsync/AsyncStartExternalSync.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_StartExternalSync_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.ExternalSyncParallelLevel; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest; + +public class AsyncStartExternalSync { + + public static void main(String[] args) throws Exception { + asyncStartExternalSync(); + } + + public static void asyncStartExternalSync() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesStartExternalSyncRequest request = + SqlInstancesStartExternalSyncRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSkipVerification(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .setReplicaOverwriteEnabled(true) + .build(); + ApiFuture future = + sqlInstancesServiceClient.startExternalSyncCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_StartExternalSync_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/startexternalsync/SyncStartExternalSync.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/startexternalsync/SyncStartExternalSync.java new file mode 100644 index 000000000000..650c09566b44 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/startexternalsync/SyncStartExternalSync.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_StartExternalSync_sync] +import com.google.cloud.sql.v1.ExternalSyncParallelLevel; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest; + +public class SyncStartExternalSync { + + public static void main(String[] args) throws Exception { + syncStartExternalSync(); + } + + public static void syncStartExternalSync() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesStartExternalSyncRequest request = + SqlInstancesStartExternalSyncRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSkipVerification(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .setReplicaOverwriteEnabled(true) + .build(); + Operation response = sqlInstancesServiceClient.startExternalSync(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_StartExternalSync_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/startreplica/AsyncStartReplica.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/startreplica/AsyncStartReplica.java new file mode 100644 index 000000000000..5ebaeebe73b9 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/startreplica/AsyncStartReplica.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_StartReplica_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest; + +public class AsyncStartReplica { + + public static void main(String[] args) throws Exception { + asyncStartReplica(); + } + + public static void asyncStartReplica() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesStartReplicaRequest request = + SqlInstancesStartReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.startReplicaCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_StartReplica_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/startreplica/SyncStartReplica.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/startreplica/SyncStartReplica.java new file mode 100644 index 000000000000..5d143399cc07 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/startreplica/SyncStartReplica.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_StartReplica_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesStartReplicaRequest; + +public class SyncStartReplica { + + public static void main(String[] args) throws Exception { + syncStartReplica(); + } + + public static void syncStartReplica() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesStartReplicaRequest request = + SqlInstancesStartReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.startReplica(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_StartReplica_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/stopreplica/AsyncStopReplica.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/stopreplica/AsyncStopReplica.java new file mode 100644 index 000000000000..bf627c6c9fc1 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/stopreplica/AsyncStopReplica.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_StopReplica_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest; + +public class AsyncStopReplica { + + public static void main(String[] args) throws Exception { + asyncStopReplica(); + } + + public static void asyncStopReplica() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesStopReplicaRequest request = + SqlInstancesStopReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.stopReplicaCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_StopReplica_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/stopreplica/SyncStopReplica.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/stopreplica/SyncStopReplica.java new file mode 100644 index 000000000000..f63d0f04ec36 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/stopreplica/SyncStopReplica.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_StopReplica_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesStopReplicaRequest; + +public class SyncStopReplica { + + public static void main(String[] args) throws Exception { + syncStopReplica(); + } + + public static void syncStopReplica() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesStopReplicaRequest request = + SqlInstancesStopReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.stopReplica(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_StopReplica_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/switchover/AsyncSwitchover.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/switchover/AsyncSwitchover.java new file mode 100644 index 000000000000..97c6aa39ea97 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/switchover/AsyncSwitchover.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Switchover_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest; +import com.google.protobuf.Duration; + +public class AsyncSwitchover { + + public static void main(String[] args) throws Exception { + asyncSwitchover(); + } + + public static void asyncSwitchover() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesSwitchoverRequest request = + SqlInstancesSwitchoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setDbTimeout(Duration.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.switchoverCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Switchover_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/switchover/SyncSwitchover.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/switchover/SyncSwitchover.java new file mode 100644 index 000000000000..c35d6cf63a8c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/switchover/SyncSwitchover.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Switchover_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesSwitchoverRequest; +import com.google.protobuf.Duration; + +public class SyncSwitchover { + + public static void main(String[] args) throws Exception { + syncSwitchover(); + } + + public static void syncSwitchover() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesSwitchoverRequest request = + SqlInstancesSwitchoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setDbTimeout(Duration.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.switchover(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Switchover_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/truncatelog/AsyncTruncateLog.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/truncatelog/AsyncTruncateLog.java new file mode 100644 index 000000000000..600f36a68f4f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/truncatelog/AsyncTruncateLog.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_TruncateLog_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.InstancesTruncateLogRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest; + +public class AsyncTruncateLog { + + public static void main(String[] args) throws Exception { + asyncTruncateLog(); + } + + public static void asyncTruncateLog() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesTruncateLogRequest request = + SqlInstancesTruncateLogRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesTruncateLogRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.truncateLogCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_TruncateLog_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/truncatelog/SyncTruncateLog.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/truncatelog/SyncTruncateLog.java new file mode 100644 index 000000000000..892feddc4a16 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/truncatelog/SyncTruncateLog.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_TruncateLog_sync] +import com.google.cloud.sql.v1.InstancesTruncateLogRequest; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesTruncateLogRequest; + +public class SyncTruncateLog { + + public static void main(String[] args) throws Exception { + syncTruncateLog(); + } + + public static void syncTruncateLog() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesTruncateLogRequest request = + SqlInstancesTruncateLogRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesTruncateLogRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.truncateLog(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_TruncateLog_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/update/AsyncUpdate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/update/AsyncUpdate.java new file mode 100644 index 000000000000..6ee3cb35a9ac --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/update/AsyncUpdate.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Update_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.DatabaseInstance; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesUpdateRequest; + +public class AsyncUpdate { + + public static void main(String[] args) throws Exception { + asyncUpdate(); + } + + public static void asyncUpdate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesUpdateRequest request = + SqlInstancesUpdateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + ApiFuture future = sqlInstancesServiceClient.updateCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Update_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/update/SyncUpdate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/update/SyncUpdate.java new file mode 100644 index 000000000000..6af3e7e5c3b7 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/update/SyncUpdate.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_Update_sync] +import com.google.cloud.sql.v1.DatabaseInstance; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesUpdateRequest; + +public class SyncUpdate { + + public static void main(String[] args) throws Exception { + syncUpdate(); + } + + public static void syncUpdate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesUpdateRequest request = + SqlInstancesUpdateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.update(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_Update_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/verifyexternalsyncsettings/AsyncVerifyExternalSyncSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/verifyexternalsyncsettings/AsyncVerifyExternalSyncSettings.java new file mode 100644 index 000000000000..ad862236796c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/verifyexternalsyncsettings/AsyncVerifyExternalSyncSettings.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_VerifyExternalSyncSettings_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.ExternalSyncParallelLevel; +import com.google.cloud.sql.v1.ExternalSyncSelectedObject; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest; +import com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse; +import java.util.ArrayList; + +public class AsyncVerifyExternalSyncSettings { + + public static void main(String[] args) throws Exception { + asyncVerifyExternalSyncSettings(); + } + + public static void asyncVerifyExternalSyncSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesVerifyExternalSyncSettingsRequest request = + SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setVerifyConnectionOnly(true) + .setVerifyReplicationOnly(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .addAllSelectedObjects(new ArrayList()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.verifyExternalSyncSettingsCallable().futureCall(request); + // Do something. + SqlInstancesVerifyExternalSyncSettingsResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_VerifyExternalSyncSettings_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/verifyexternalsyncsettings/SyncVerifyExternalSyncSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/verifyexternalsyncsettings/SyncVerifyExternalSyncSettings.java new file mode 100644 index 000000000000..8091506ba089 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservice/verifyexternalsyncsettings/SyncVerifyExternalSyncSettings.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesService_VerifyExternalSyncSettings_sync] +import com.google.cloud.sql.v1.ExternalSyncParallelLevel; +import com.google.cloud.sql.v1.ExternalSyncSelectedObject; +import com.google.cloud.sql.v1.SqlInstancesServiceClient; +import com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest; +import com.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse; +import java.util.ArrayList; + +public class SyncVerifyExternalSyncSettings { + + public static void main(String[] args) throws Exception { + syncVerifyExternalSyncSettings(); + } + + public static void syncVerifyExternalSyncSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesVerifyExternalSyncSettingsRequest request = + SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setVerifyConnectionOnly(true) + .setVerifyReplicationOnly(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .addAllSelectedObjects(new ArrayList()) + .build(); + SqlInstancesVerifyExternalSyncSettingsResponse response = + sqlInstancesServiceClient.verifyExternalSyncSettings(request); + } + } +} +// [END sqladmin_v1_generated_SqlInstancesService_VerifyExternalSyncSettings_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservicesettings/addserverca/SyncAddServerCa.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservicesettings/addserverca/SyncAddServerCa.java new file mode 100644 index 000000000000..d66ab216094a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlinstancesservicesettings/addserverca/SyncAddServerCa.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlInstancesServiceSettings_AddServerCa_sync] +import com.google.cloud.sql.v1.SqlInstancesServiceSettings; +import java.time.Duration; + +public class SyncAddServerCa { + + public static void main(String[] args) throws Exception { + syncAddServerCa(); + } + + public static void syncAddServerCa() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlInstancesServiceSettings.Builder sqlInstancesServiceSettingsBuilder = + SqlInstancesServiceSettings.newBuilder(); + sqlInstancesServiceSettingsBuilder + .addServerCaSettings() + .setRetrySettings( + sqlInstancesServiceSettingsBuilder + .addServerCaSettings() + .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()); + SqlInstancesServiceSettings sqlInstancesServiceSettings = + sqlInstancesServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlInstancesServiceSettings_AddServerCa_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/cancel/AsyncCancel.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/cancel/AsyncCancel.java new file mode 100644 index 000000000000..6597a12a685c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/cancel/AsyncCancel.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlOperationsService_Cancel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.SqlOperationsCancelRequest; +import com.google.cloud.sql.v1.SqlOperationsServiceClient; +import com.google.protobuf.Empty; + +public class AsyncCancel { + + public static void main(String[] args) throws Exception { + asyncCancel(); + } + + public static void asyncCancel() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create()) { + SqlOperationsCancelRequest request = + SqlOperationsCancelRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlOperationsServiceClient.cancelCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlOperationsService_Cancel_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/cancel/SyncCancel.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/cancel/SyncCancel.java new file mode 100644 index 000000000000..c353bbb08689 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/cancel/SyncCancel.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlOperationsService_Cancel_sync] +import com.google.cloud.sql.v1.SqlOperationsCancelRequest; +import com.google.cloud.sql.v1.SqlOperationsServiceClient; +import com.google.protobuf.Empty; + +public class SyncCancel { + + public static void main(String[] args) throws Exception { + syncCancel(); + } + + public static void syncCancel() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create()) { + SqlOperationsCancelRequest request = + SqlOperationsCancelRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + sqlOperationsServiceClient.cancel(request); + } + } +} +// [END sqladmin_v1_generated_SqlOperationsService_Cancel_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..059bbe6d93a7 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlOperationsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1.SqlOperationsServiceClient; +import com.google.cloud.sql.v1.SqlOperationsServiceSettings; +import com.google.cloud.sql.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 + SqlOperationsServiceSettings sqlOperationsServiceSettings = + SqlOperationsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create(sqlOperationsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlOperationsService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..5705720ef742 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlOperationsService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1.SqlOperationsServiceClient; +import com.google.cloud.sql.v1.SqlOperationsServiceSettings; +import com.google.cloud.sql.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 + SqlOperationsServiceSettings sqlOperationsServiceSettings = + SqlOperationsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create(sqlOperationsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlOperationsService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..2214a4a59509 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlOperationsService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1.SqlOperationsServiceClient; +import com.google.cloud.sql.v1.SqlOperationsServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlOperationsServiceSettings sqlOperationsServiceSettings = + SqlOperationsServiceSettings.newHttpJsonBuilder().build(); + SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create(sqlOperationsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlOperationsService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/get/AsyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/get/AsyncGet.java new file mode 100644 index 000000000000..3b740702f51d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/get/AsyncGet.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlOperationsService_Get_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlOperationsGetRequest; +import com.google.cloud.sql.v1.SqlOperationsServiceClient; + +public class AsyncGet { + + public static void main(String[] args) throws Exception { + asyncGet(); + } + + public static void asyncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create()) { + SqlOperationsGetRequest request = + SqlOperationsGetRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlOperationsServiceClient.getCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlOperationsService_Get_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/get/SyncGet.java new file mode 100644 index 000000000000..25a1b50ff328 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/get/SyncGet.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlOperationsService_Get_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlOperationsGetRequest; +import com.google.cloud.sql.v1.SqlOperationsServiceClient; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create()) { + SqlOperationsGetRequest request = + SqlOperationsGetRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + Operation response = sqlOperationsServiceClient.get(request); + } + } +} +// [END sqladmin_v1_generated_SqlOperationsService_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/list/AsyncList.java new file mode 100644 index 000000000000..c0942c876a5b --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/list/AsyncList.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlOperationsService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.OperationsListResponse; +import com.google.cloud.sql.v1.SqlOperationsListRequest; +import com.google.cloud.sql.v1.SqlOperationsServiceClient; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create()) { + SqlOperationsListRequest request = + SqlOperationsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlOperationsServiceClient.listCallable().futureCall(request); + // Do something. + OperationsListResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlOperationsService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/list/SyncList.java new file mode 100644 index 000000000000..6ac6338d76fc --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservice/list/SyncList.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlOperationsService_List_sync] +import com.google.cloud.sql.v1.OperationsListResponse; +import com.google.cloud.sql.v1.SqlOperationsListRequest; +import com.google.cloud.sql.v1.SqlOperationsServiceClient; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create()) { + SqlOperationsListRequest request = + SqlOperationsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + OperationsListResponse response = sqlOperationsServiceClient.list(request); + } + } +} +// [END sqladmin_v1_generated_SqlOperationsService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservicesettings/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservicesettings/get/SyncGet.java new file mode 100644 index 000000000000..37c472dd3087 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqloperationsservicesettings/get/SyncGet.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlOperationsServiceSettings_Get_sync] +import com.google.cloud.sql.v1.SqlOperationsServiceSettings; +import java.time.Duration; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlOperationsServiceSettings.Builder sqlOperationsServiceSettingsBuilder = + SqlOperationsServiceSettings.newBuilder(); + sqlOperationsServiceSettingsBuilder + .getSettings() + .setRetrySettings( + sqlOperationsServiceSettingsBuilder + .getSettings() + .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()); + SqlOperationsServiceSettings sqlOperationsServiceSettings = + sqlOperationsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlOperationsServiceSettings_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..c8189fe99b46 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlSslCertsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1.SqlSslCertsServiceSettings; +import com.google.cloud.sql.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 + SqlSslCertsServiceSettings sqlSslCertsServiceSettings = + SqlSslCertsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlSslCertsServiceClient sqlSslCertsServiceClient = + SqlSslCertsServiceClient.create(sqlSslCertsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlSslCertsService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..cb8bb0ff2cd5 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlSslCertsService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1.SqlSslCertsServiceSettings; +import com.google.cloud.sql.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 + SqlSslCertsServiceSettings sqlSslCertsServiceSettings = + SqlSslCertsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlSslCertsServiceClient sqlSslCertsServiceClient = + SqlSslCertsServiceClient.create(sqlSslCertsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlSslCertsService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..304375d9a0ae --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlSslCertsService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1.SqlSslCertsServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlSslCertsServiceSettings sqlSslCertsServiceSettings = + SqlSslCertsServiceSettings.newHttpJsonBuilder().build(); + SqlSslCertsServiceClient sqlSslCertsServiceClient = + SqlSslCertsServiceClient.create(sqlSslCertsServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlSslCertsService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/delete/AsyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/delete/AsyncDelete.java new file mode 100644 index 000000000000..829e06bae5c8 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/delete/AsyncDelete.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlSslCertsService_Delete_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlSslCertsDeleteRequest; +import com.google.cloud.sql.v1.SqlSslCertsServiceClient; + +public class AsyncDelete { + + public static void main(String[] args) throws Exception { + asyncDelete(); + } + + public static void asyncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsDeleteRequest request = + SqlSslCertsDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + ApiFuture future = sqlSslCertsServiceClient.deleteCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlSslCertsService_Delete_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/delete/SyncDelete.java new file mode 100644 index 000000000000..f6a9f5915d4c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/delete/SyncDelete.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlSslCertsService_Delete_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlSslCertsDeleteRequest; +import com.google.cloud.sql.v1.SqlSslCertsServiceClient; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsDeleteRequest request = + SqlSslCertsDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + Operation response = sqlSslCertsServiceClient.delete(request); + } + } +} +// [END sqladmin_v1_generated_SqlSslCertsService_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/get/AsyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/get/AsyncGet.java new file mode 100644 index 000000000000..f2b55060e2ef --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/get/AsyncGet.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlSslCertsService_Get_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.SqlSslCertsGetRequest; +import com.google.cloud.sql.v1.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1.SslCert; + +public class AsyncGet { + + public static void main(String[] args) throws Exception { + asyncGet(); + } + + public static void asyncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsGetRequest request = + SqlSslCertsGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + ApiFuture future = sqlSslCertsServiceClient.getCallable().futureCall(request); + // Do something. + SslCert response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlSslCertsService_Get_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/get/SyncGet.java new file mode 100644 index 000000000000..9342e314f33b --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/get/SyncGet.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlSslCertsService_Get_sync] +import com.google.cloud.sql.v1.SqlSslCertsGetRequest; +import com.google.cloud.sql.v1.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1.SslCert; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsGetRequest request = + SqlSslCertsGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + SslCert response = sqlSslCertsServiceClient.get(request); + } + } +} +// [END sqladmin_v1_generated_SqlSslCertsService_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/insert/AsyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/insert/AsyncInsert.java new file mode 100644 index 000000000000..d32774291db4 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/insert/AsyncInsert.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlSslCertsService_Insert_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.SqlSslCertsInsertRequest; +import com.google.cloud.sql.v1.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1.SslCertsInsertRequest; +import com.google.cloud.sql.v1.SslCertsInsertResponse; + +public class AsyncInsert { + + public static void main(String[] args) throws Exception { + asyncInsert(); + } + + public static void asyncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsInsertRequest request = + SqlSslCertsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsInsertRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlSslCertsServiceClient.insertCallable().futureCall(request); + // Do something. + SslCertsInsertResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlSslCertsService_Insert_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/insert/SyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/insert/SyncInsert.java new file mode 100644 index 000000000000..984d1509cbf0 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/insert/SyncInsert.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlSslCertsService_Insert_sync] +import com.google.cloud.sql.v1.SqlSslCertsInsertRequest; +import com.google.cloud.sql.v1.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1.SslCertsInsertRequest; +import com.google.cloud.sql.v1.SslCertsInsertResponse; + +public class SyncInsert { + + public static void main(String[] args) throws Exception { + syncInsert(); + } + + public static void syncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsInsertRequest request = + SqlSslCertsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsInsertRequest.newBuilder().build()) + .build(); + SslCertsInsertResponse response = sqlSslCertsServiceClient.insert(request); + } + } +} +// [END sqladmin_v1_generated_SqlSslCertsService_Insert_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/list/AsyncList.java new file mode 100644 index 000000000000..06fd259b1112 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/list/AsyncList.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlSslCertsService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.SqlSslCertsListRequest; +import com.google.cloud.sql.v1.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1.SslCertsListResponse; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsListRequest request = + SqlSslCertsListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlSslCertsServiceClient.listCallable().futureCall(request); + // Do something. + SslCertsListResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlSslCertsService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/list/SyncList.java new file mode 100644 index 000000000000..81ce960865b6 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservice/list/SyncList.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlSslCertsService_List_sync] +import com.google.cloud.sql.v1.SqlSslCertsListRequest; +import com.google.cloud.sql.v1.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1.SslCertsListResponse; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsListRequest request = + SqlSslCertsListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + SslCertsListResponse response = sqlSslCertsServiceClient.list(request); + } + } +} +// [END sqladmin_v1_generated_SqlSslCertsService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservicesettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservicesettings/delete/SyncDelete.java new file mode 100644 index 000000000000..86116e23a0c7 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlsslcertsservicesettings/delete/SyncDelete.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlSslCertsServiceSettings_Delete_sync] +import com.google.cloud.sql.v1.SqlSslCertsServiceSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlSslCertsServiceSettings.Builder sqlSslCertsServiceSettingsBuilder = + SqlSslCertsServiceSettings.newBuilder(); + sqlSslCertsServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlSslCertsServiceSettingsBuilder + .deleteSettings() + .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()); + SqlSslCertsServiceSettings sqlSslCertsServiceSettings = + sqlSslCertsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlSslCertsServiceSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..a6b027810087 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlTiersService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1.SqlTiersServiceClient; +import com.google.cloud.sql.v1.SqlTiersServiceSettings; +import com.google.cloud.sql.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 + SqlTiersServiceSettings sqlTiersServiceSettings = + SqlTiersServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlTiersServiceClient sqlTiersServiceClient = + SqlTiersServiceClient.create(sqlTiersServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlTiersService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..46b42b82cfe9 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlTiersService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1.SqlTiersServiceClient; +import com.google.cloud.sql.v1.SqlTiersServiceSettings; +import com.google.cloud.sql.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 + SqlTiersServiceSettings sqlTiersServiceSettings = + SqlTiersServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlTiersServiceClient sqlTiersServiceClient = + SqlTiersServiceClient.create(sqlTiersServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlTiersService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..0a76f08239f2 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlTiersService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1.SqlTiersServiceClient; +import com.google.cloud.sql.v1.SqlTiersServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlTiersServiceSettings sqlTiersServiceSettings = + SqlTiersServiceSettings.newHttpJsonBuilder().build(); + SqlTiersServiceClient sqlTiersServiceClient = + SqlTiersServiceClient.create(sqlTiersServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlTiersService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/list/AsyncList.java new file mode 100644 index 000000000000..9a2e6f8af3e6 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/list/AsyncList.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlTiersService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.SqlTiersListRequest; +import com.google.cloud.sql.v1.SqlTiersServiceClient; +import com.google.cloud.sql.v1.TiersListResponse; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlTiersServiceClient sqlTiersServiceClient = SqlTiersServiceClient.create()) { + SqlTiersListRequest request = + SqlTiersListRequest.newBuilder().setProject("project-309310695").build(); + ApiFuture future = + sqlTiersServiceClient.listCallable().futureCall(request); + // Do something. + TiersListResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlTiersService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/list/SyncList.java new file mode 100644 index 000000000000..1c6e7a3e8e73 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservice/list/SyncList.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlTiersService_List_sync] +import com.google.cloud.sql.v1.SqlTiersListRequest; +import com.google.cloud.sql.v1.SqlTiersServiceClient; +import com.google.cloud.sql.v1.TiersListResponse; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlTiersServiceClient sqlTiersServiceClient = SqlTiersServiceClient.create()) { + SqlTiersListRequest request = + SqlTiersListRequest.newBuilder().setProject("project-309310695").build(); + TiersListResponse response = sqlTiersServiceClient.list(request); + } + } +} +// [END sqladmin_v1_generated_SqlTiersService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservicesettings/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservicesettings/list/SyncList.java new file mode 100644 index 000000000000..1a8b58892cf1 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqltiersservicesettings/list/SyncList.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlTiersServiceSettings_List_sync] +import com.google.cloud.sql.v1.SqlTiersServiceSettings; +import java.time.Duration; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlTiersServiceSettings.Builder sqlTiersServiceSettingsBuilder = + SqlTiersServiceSettings.newBuilder(); + sqlTiersServiceSettingsBuilder + .listSettings() + .setRetrySettings( + sqlTiersServiceSettingsBuilder + .listSettings() + .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()); + SqlTiersServiceSettings sqlTiersServiceSettings = sqlTiersServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlTiersServiceSettings_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..996d11deb2bb --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlUsersService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1.SqlUsersServiceClient; +import com.google.cloud.sql.v1.SqlUsersServiceSettings; +import com.google.cloud.sql.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 + SqlUsersServiceSettings sqlUsersServiceSettings = + SqlUsersServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlUsersServiceClient sqlUsersServiceClient = + SqlUsersServiceClient.create(sqlUsersServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlUsersService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..b2b6a1183cb4 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlUsersService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1.SqlUsersServiceClient; +import com.google.cloud.sql.v1.SqlUsersServiceSettings; +import com.google.cloud.sql.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 + SqlUsersServiceSettings sqlUsersServiceSettings = + SqlUsersServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlUsersServiceClient sqlUsersServiceClient = + SqlUsersServiceClient.create(sqlUsersServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlUsersService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..089280d7bbf7 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlUsersService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1.SqlUsersServiceClient; +import com.google.cloud.sql.v1.SqlUsersServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlUsersServiceSettings sqlUsersServiceSettings = + SqlUsersServiceSettings.newHttpJsonBuilder().build(); + SqlUsersServiceClient sqlUsersServiceClient = + SqlUsersServiceClient.create(sqlUsersServiceSettings); + } +} +// [END sqladmin_v1_generated_SqlUsersService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/delete/AsyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/delete/AsyncDelete.java new file mode 100644 index 000000000000..3147b13f05d7 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/delete/AsyncDelete.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlUsersService_Delete_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlUsersDeleteRequest; +import com.google.cloud.sql.v1.SqlUsersServiceClient; + +public class AsyncDelete { + + public static void main(String[] args) throws Exception { + asyncDelete(); + } + + public static void asyncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersDeleteRequest request = + SqlUsersDeleteRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlUsersServiceClient.deleteCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlUsersService_Delete_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/delete/SyncDelete.java new file mode 100644 index 000000000000..5a6fb7dcf554 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/delete/SyncDelete.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlUsersService_Delete_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlUsersDeleteRequest; +import com.google.cloud.sql.v1.SqlUsersServiceClient; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersDeleteRequest request = + SqlUsersDeleteRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .build(); + Operation response = sqlUsersServiceClient.delete(request); + } + } +} +// [END sqladmin_v1_generated_SqlUsersService_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/get/AsyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/get/AsyncGet.java new file mode 100644 index 000000000000..dab87f98970f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/get/AsyncGet.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlUsersService_Get_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.SqlUsersGetRequest; +import com.google.cloud.sql.v1.SqlUsersServiceClient; +import com.google.cloud.sql.v1.User; + +public class AsyncGet { + + public static void main(String[] args) throws Exception { + asyncGet(); + } + + public static void asyncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersGetRequest request = + SqlUsersGetRequest.newBuilder() + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .setHost("host3208616") + .build(); + ApiFuture future = sqlUsersServiceClient.getCallable().futureCall(request); + // Do something. + User response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlUsersService_Get_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/get/SyncGet.java new file mode 100644 index 000000000000..271afcac41b7 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/get/SyncGet.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlUsersService_Get_sync] +import com.google.cloud.sql.v1.SqlUsersGetRequest; +import com.google.cloud.sql.v1.SqlUsersServiceClient; +import com.google.cloud.sql.v1.User; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersGetRequest request = + SqlUsersGetRequest.newBuilder() + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .setHost("host3208616") + .build(); + User response = sqlUsersServiceClient.get(request); + } + } +} +// [END sqladmin_v1_generated_SqlUsersService_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/insert/AsyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/insert/AsyncInsert.java new file mode 100644 index 000000000000..4a64af812ff1 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/insert/AsyncInsert.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlUsersService_Insert_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlUsersInsertRequest; +import com.google.cloud.sql.v1.SqlUsersServiceClient; +import com.google.cloud.sql.v1.User; + +public class AsyncInsert { + + public static void main(String[] args) throws Exception { + asyncInsert(); + } + + public static void asyncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersInsertRequest request = + SqlUsersInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(User.newBuilder().build()) + .build(); + ApiFuture future = sqlUsersServiceClient.insertCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlUsersService_Insert_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/insert/SyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/insert/SyncInsert.java new file mode 100644 index 000000000000..cbee69021838 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/insert/SyncInsert.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlUsersService_Insert_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlUsersInsertRequest; +import com.google.cloud.sql.v1.SqlUsersServiceClient; +import com.google.cloud.sql.v1.User; + +public class SyncInsert { + + public static void main(String[] args) throws Exception { + syncInsert(); + } + + public static void syncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersInsertRequest request = + SqlUsersInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(User.newBuilder().build()) + .build(); + Operation response = sqlUsersServiceClient.insert(request); + } + } +} +// [END sqladmin_v1_generated_SqlUsersService_Insert_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/list/AsyncList.java new file mode 100644 index 000000000000..ce5d343b0c9e --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/list/AsyncList.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlUsersService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.SqlUsersListRequest; +import com.google.cloud.sql.v1.SqlUsersServiceClient; +import com.google.cloud.sql.v1.UsersListResponse; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersListRequest request = + SqlUsersListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlUsersServiceClient.listCallable().futureCall(request); + // Do something. + UsersListResponse response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlUsersService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/list/SyncList.java new file mode 100644 index 000000000000..4a6737030b94 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/list/SyncList.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlUsersService_List_sync] +import com.google.cloud.sql.v1.SqlUsersListRequest; +import com.google.cloud.sql.v1.SqlUsersServiceClient; +import com.google.cloud.sql.v1.UsersListResponse; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersListRequest request = + SqlUsersListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + UsersListResponse response = sqlUsersServiceClient.list(request); + } + } +} +// [END sqladmin_v1_generated_SqlUsersService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/update/AsyncUpdate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/update/AsyncUpdate.java new file mode 100644 index 000000000000..d26fd33c4338 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/update/AsyncUpdate.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlUsersService_Update_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlUsersServiceClient; +import com.google.cloud.sql.v1.SqlUsersUpdateRequest; +import com.google.cloud.sql.v1.User; +import java.util.ArrayList; + +public class AsyncUpdate { + + public static void main(String[] args) throws Exception { + asyncUpdate(); + } + + public static void asyncUpdate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersUpdateRequest request = + SqlUsersUpdateRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .addAllDatabaseRoles(new ArrayList()) + .setRevokeExistingRoles(true) + .setBody(User.newBuilder().build()) + .build(); + ApiFuture future = sqlUsersServiceClient.updateCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1_generated_SqlUsersService_Update_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/update/SyncUpdate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/update/SyncUpdate.java new file mode 100644 index 000000000000..51aa5967b097 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservice/update/SyncUpdate.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlUsersService_Update_sync] +import com.google.cloud.sql.v1.Operation; +import com.google.cloud.sql.v1.SqlUsersServiceClient; +import com.google.cloud.sql.v1.SqlUsersUpdateRequest; +import com.google.cloud.sql.v1.User; +import java.util.ArrayList; + +public class SyncUpdate { + + public static void main(String[] args) throws Exception { + syncUpdate(); + } + + public static void syncUpdate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersUpdateRequest request = + SqlUsersUpdateRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .addAllDatabaseRoles(new ArrayList()) + .setRevokeExistingRoles(true) + .setBody(User.newBuilder().build()) + .build(); + Operation response = sqlUsersServiceClient.update(request); + } + } +} +// [END sqladmin_v1_generated_SqlUsersService_Update_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservicesettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservicesettings/delete/SyncDelete.java new file mode 100644 index 000000000000..b71360cf370e --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/sqlusersservicesettings/delete/SyncDelete.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.samples; + +// [START sqladmin_v1_generated_SqlUsersServiceSettings_Delete_sync] +import com.google.cloud.sql.v1.SqlUsersServiceSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlUsersServiceSettings.Builder sqlUsersServiceSettingsBuilder = + SqlUsersServiceSettings.newBuilder(); + sqlUsersServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlUsersServiceSettingsBuilder + .deleteSettings() + .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()); + SqlUsersServiceSettings sqlUsersServiceSettings = sqlUsersServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlUsersServiceSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlbackuprunsservicestubsettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlbackuprunsservicestubsettings/delete/SyncDelete.java new file mode 100644 index 000000000000..633e313dd316 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlbackuprunsservicestubsettings/delete/SyncDelete.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub.samples; + +// [START sqladmin_v1_generated_SqlBackupRunsServiceStubSettings_Delete_sync] +import com.google.cloud.sql.v1.stub.SqlBackupRunsServiceStubSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlBackupRunsServiceStubSettings.Builder sqlBackupRunsServiceSettingsBuilder = + SqlBackupRunsServiceStubSettings.newBuilder(); + sqlBackupRunsServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlBackupRunsServiceSettingsBuilder + .deleteSettings() + .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()); + SqlBackupRunsServiceStubSettings sqlBackupRunsServiceSettings = + sqlBackupRunsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlBackupRunsServiceStubSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlbackupsservicestubsettings/createbackup/SyncCreateBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlbackupsservicestubsettings/createbackup/SyncCreateBackup.java new file mode 100644 index 000000000000..879369f506d9 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlbackupsservicestubsettings/createbackup/SyncCreateBackup.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub.samples; + +// [START sqladmin_v1_generated_SqlBackupsServiceStubSettings_CreateBackup_sync] +import com.google.cloud.sql.v1.stub.SqlBackupsServiceStubSettings; +import java.time.Duration; + +public class SyncCreateBackup { + + public static void main(String[] args) throws Exception { + syncCreateBackup(); + } + + public static void syncCreateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlBackupsServiceStubSettings.Builder sqlBackupsServiceSettingsBuilder = + SqlBackupsServiceStubSettings.newBuilder(); + sqlBackupsServiceSettingsBuilder + .createBackupSettings() + .setRetrySettings( + sqlBackupsServiceSettingsBuilder + .createBackupSettings() + .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()); + SqlBackupsServiceStubSettings sqlBackupsServiceSettings = + sqlBackupsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlBackupsServiceStubSettings_CreateBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlconnectservicestubsettings/getconnectsettings/SyncGetConnectSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlconnectservicestubsettings/getconnectsettings/SyncGetConnectSettings.java new file mode 100644 index 000000000000..c0ee44c7bd96 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlconnectservicestubsettings/getconnectsettings/SyncGetConnectSettings.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub.samples; + +// [START sqladmin_v1_generated_SqlConnectServiceStubSettings_GetConnectSettings_sync] +import com.google.cloud.sql.v1.stub.SqlConnectServiceStubSettings; +import java.time.Duration; + +public class SyncGetConnectSettings { + + public static void main(String[] args) throws Exception { + syncGetConnectSettings(); + } + + public static void syncGetConnectSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlConnectServiceStubSettings.Builder sqlConnectServiceSettingsBuilder = + SqlConnectServiceStubSettings.newBuilder(); + sqlConnectServiceSettingsBuilder + .getConnectSettingsSettings() + .setRetrySettings( + sqlConnectServiceSettingsBuilder + .getConnectSettingsSettings() + .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()); + SqlConnectServiceStubSettings sqlConnectServiceSettings = + sqlConnectServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlConnectServiceStubSettings_GetConnectSettings_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqldatabasesservicestubsettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqldatabasesservicestubsettings/delete/SyncDelete.java new file mode 100644 index 000000000000..bcc034540f32 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqldatabasesservicestubsettings/delete/SyncDelete.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub.samples; + +// [START sqladmin_v1_generated_SqlDatabasesServiceStubSettings_Delete_sync] +import com.google.cloud.sql.v1.stub.SqlDatabasesServiceStubSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlDatabasesServiceStubSettings.Builder sqlDatabasesServiceSettingsBuilder = + SqlDatabasesServiceStubSettings.newBuilder(); + sqlDatabasesServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlDatabasesServiceSettingsBuilder + .deleteSettings() + .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()); + SqlDatabasesServiceStubSettings sqlDatabasesServiceSettings = + sqlDatabasesServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlDatabasesServiceStubSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlflagsservicestubsettings/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlflagsservicestubsettings/list/SyncList.java new file mode 100644 index 000000000000..de5bedc4cd0e --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlflagsservicestubsettings/list/SyncList.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub.samples; + +// [START sqladmin_v1_generated_SqlFlagsServiceStubSettings_List_sync] +import com.google.cloud.sql.v1.stub.SqlFlagsServiceStubSettings; +import java.time.Duration; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlFlagsServiceStubSettings.Builder sqlFlagsServiceSettingsBuilder = + SqlFlagsServiceStubSettings.newBuilder(); + sqlFlagsServiceSettingsBuilder + .listSettings() + .setRetrySettings( + sqlFlagsServiceSettingsBuilder + .listSettings() + .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()); + SqlFlagsServiceStubSettings sqlFlagsServiceSettings = sqlFlagsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlFlagsServiceStubSettings_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlinstancesservicestubsettings/addserverca/SyncAddServerCa.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlinstancesservicestubsettings/addserverca/SyncAddServerCa.java new file mode 100644 index 000000000000..195e82082114 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlinstancesservicestubsettings/addserverca/SyncAddServerCa.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub.samples; + +// [START sqladmin_v1_generated_SqlInstancesServiceStubSettings_AddServerCa_sync] +import com.google.cloud.sql.v1.stub.SqlInstancesServiceStubSettings; +import java.time.Duration; + +public class SyncAddServerCa { + + public static void main(String[] args) throws Exception { + syncAddServerCa(); + } + + public static void syncAddServerCa() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlInstancesServiceStubSettings.Builder sqlInstancesServiceSettingsBuilder = + SqlInstancesServiceStubSettings.newBuilder(); + sqlInstancesServiceSettingsBuilder + .addServerCaSettings() + .setRetrySettings( + sqlInstancesServiceSettingsBuilder + .addServerCaSettings() + .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()); + SqlInstancesServiceStubSettings sqlInstancesServiceSettings = + sqlInstancesServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlInstancesServiceStubSettings_AddServerCa_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqloperationsservicestubsettings/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqloperationsservicestubsettings/get/SyncGet.java new file mode 100644 index 000000000000..759327e78835 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqloperationsservicestubsettings/get/SyncGet.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub.samples; + +// [START sqladmin_v1_generated_SqlOperationsServiceStubSettings_Get_sync] +import com.google.cloud.sql.v1.stub.SqlOperationsServiceStubSettings; +import java.time.Duration; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlOperationsServiceStubSettings.Builder sqlOperationsServiceSettingsBuilder = + SqlOperationsServiceStubSettings.newBuilder(); + sqlOperationsServiceSettingsBuilder + .getSettings() + .setRetrySettings( + sqlOperationsServiceSettingsBuilder + .getSettings() + .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()); + SqlOperationsServiceStubSettings sqlOperationsServiceSettings = + sqlOperationsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlOperationsServiceStubSettings_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlsslcertsservicestubsettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlsslcertsservicestubsettings/delete/SyncDelete.java new file mode 100644 index 000000000000..e77a8f82a5dd --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlsslcertsservicestubsettings/delete/SyncDelete.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub.samples; + +// [START sqladmin_v1_generated_SqlSslCertsServiceStubSettings_Delete_sync] +import com.google.cloud.sql.v1.stub.SqlSslCertsServiceStubSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlSslCertsServiceStubSettings.Builder sqlSslCertsServiceSettingsBuilder = + SqlSslCertsServiceStubSettings.newBuilder(); + sqlSslCertsServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlSslCertsServiceSettingsBuilder + .deleteSettings() + .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()); + SqlSslCertsServiceStubSettings sqlSslCertsServiceSettings = + sqlSslCertsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlSslCertsServiceStubSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqltiersservicestubsettings/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqltiersservicestubsettings/list/SyncList.java new file mode 100644 index 000000000000..ac710240b0fb --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqltiersservicestubsettings/list/SyncList.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub.samples; + +// [START sqladmin_v1_generated_SqlTiersServiceStubSettings_List_sync] +import com.google.cloud.sql.v1.stub.SqlTiersServiceStubSettings; +import java.time.Duration; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlTiersServiceStubSettings.Builder sqlTiersServiceSettingsBuilder = + SqlTiersServiceStubSettings.newBuilder(); + sqlTiersServiceSettingsBuilder + .listSettings() + .setRetrySettings( + sqlTiersServiceSettingsBuilder + .listSettings() + .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()); + SqlTiersServiceStubSettings sqlTiersServiceSettings = sqlTiersServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlTiersServiceStubSettings_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlusersservicestubsettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlusersservicestubsettings/delete/SyncDelete.java new file mode 100644 index 000000000000..fdfb20531d63 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1/stub/sqlusersservicestubsettings/delete/SyncDelete.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1.stub.samples; + +// [START sqladmin_v1_generated_SqlUsersServiceStubSettings_Delete_sync] +import com.google.cloud.sql.v1.stub.SqlUsersServiceStubSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlUsersServiceStubSettings.Builder sqlUsersServiceSettingsBuilder = + SqlUsersServiceStubSettings.newBuilder(); + sqlUsersServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlUsersServiceSettingsBuilder + .deleteSettings() + .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()); + SqlUsersServiceStubSettings sqlUsersServiceSettings = sqlUsersServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1_generated_SqlUsersServiceStubSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..55e32ed9ad88 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupRunsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceClient; +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings = + SqlBackupRunsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlBackupRunsService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..6c0a8f6c40f3 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupRunsService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceClient; +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings = + SqlBackupRunsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlBackupRunsService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..63b05fc74707 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupRunsService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceClient; +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings = + SqlBackupRunsServiceSettings.newHttpJsonBuilder().build(); + SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlBackupRunsService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/delete/AsyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/delete/AsyncDelete.java new file mode 100644 index 000000000000..f6b3662bca0c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/delete/AsyncDelete.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupRunsService_Delete_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceClient; + +public class AsyncDelete { + + public static void main(String[] args) throws Exception { + asyncDelete(); + } + + public static void asyncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsDeleteRequest request = + SqlBackupRunsDeleteRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlBackupRunsServiceClient.deleteCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupRunsService_Delete_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/delete/SyncDelete.java new file mode 100644 index 000000000000..856bb72af66d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/delete/SyncDelete.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupRunsService_Delete_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceClient; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsDeleteRequest request = + SqlBackupRunsDeleteRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlBackupRunsServiceClient.delete(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupRunsService_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/get/AsyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/get/AsyncGet.java new file mode 100644 index 000000000000..b9789e4d8f67 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/get/AsyncGet.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupRunsService_Get_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.BackupRun; +import com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceClient; + +public class AsyncGet { + + public static void main(String[] args) throws Exception { + asyncGet(); + } + + public static void asyncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsGetRequest request = + SqlBackupRunsGetRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlBackupRunsServiceClient.getCallable().futureCall(request); + // Do something. + BackupRun response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupRunsService_Get_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/get/SyncGet.java new file mode 100644 index 000000000000..7b47118753ca --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/get/SyncGet.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupRunsService_Get_sync] +import com.google.cloud.sql.v1beta4.BackupRun; +import com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceClient; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsGetRequest request = + SqlBackupRunsGetRequest.newBuilder() + .setId(3355) + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + BackupRun response = sqlBackupRunsServiceClient.get(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupRunsService_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/insert/AsyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/insert/AsyncInsert.java new file mode 100644 index 000000000000..4c454a67bbb6 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/insert/AsyncInsert.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupRunsService_Insert_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.BackupRun; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceClient; + +public class AsyncInsert { + + public static void main(String[] args) throws Exception { + asyncInsert(); + } + + public static void asyncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsInsertRequest request = + SqlBackupRunsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(BackupRun.newBuilder().build()) + .build(); + ApiFuture future = sqlBackupRunsServiceClient.insertCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupRunsService_Insert_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/insert/SyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/insert/SyncInsert.java new file mode 100644 index 000000000000..0c77a8d1cb58 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/insert/SyncInsert.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupRunsService_Insert_sync] +import com.google.cloud.sql.v1beta4.BackupRun; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceClient; + +public class SyncInsert { + + public static void main(String[] args) throws Exception { + syncInsert(); + } + + public static void syncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsInsertRequest request = + SqlBackupRunsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(BackupRun.newBuilder().build()) + .build(); + Operation response = sqlBackupRunsServiceClient.insert(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupRunsService_Insert_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/list/AsyncList.java new file mode 100644 index 000000000000..a1a1dbd2c29f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/list/AsyncList.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupRunsService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.BackupRunsListResponse; +import com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceClient; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsListRequest request = + SqlBackupRunsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlBackupRunsServiceClient.listCallable().futureCall(request); + // Do something. + BackupRunsListResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupRunsService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/list/SyncList.java new file mode 100644 index 000000000000..165598cec721 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservice/list/SyncList.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupRunsService_List_sync] +import com.google.cloud.sql.v1beta4.BackupRunsListResponse; +import com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest; +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceClient; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient = + SqlBackupRunsServiceClient.create()) { + SqlBackupRunsListRequest request = + SqlBackupRunsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + BackupRunsListResponse response = sqlBackupRunsServiceClient.list(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupRunsService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservicesettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservicesettings/delete/SyncDelete.java new file mode 100644 index 000000000000..f0e912e235ee --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackuprunsservicesettings/delete/SyncDelete.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupRunsServiceSettings_Delete_sync] +import com.google.cloud.sql.v1beta4.SqlBackupRunsServiceSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlBackupRunsServiceSettings.Builder sqlBackupRunsServiceSettingsBuilder = + SqlBackupRunsServiceSettings.newBuilder(); + sqlBackupRunsServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlBackupRunsServiceSettingsBuilder + .deleteSettings() + .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()); + SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings = + sqlBackupRunsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlBackupRunsServiceSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..3491d4545a38 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlBackupsServiceSettings sqlBackupsServiceSettings = + SqlBackupsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlBackupsServiceClient sqlBackupsServiceClient = + SqlBackupsServiceClient.create(sqlBackupsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..061e4e627424 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlBackupsServiceSettings sqlBackupsServiceSettings = + SqlBackupsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlBackupsServiceClient sqlBackupsServiceClient = + SqlBackupsServiceClient.create(sqlBackupsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..67a7990c8b5d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlBackupsServiceSettings sqlBackupsServiceSettings = + SqlBackupsServiceSettings.newHttpJsonBuilder().build(); + SqlBackupsServiceClient sqlBackupsServiceClient = + SqlBackupsServiceClient.create(sqlBackupsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/createbackup/AsyncCreateBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/createbackup/AsyncCreateBackup.java new file mode 100644 index 000000000000..0b2c907a9f45 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/createbackup/AsyncCreateBackup.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_CreateBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.CreateBackupRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.ProjectName; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class AsyncCreateBackup { + + public static void main(String[] args) throws Exception { + asyncCreateBackup(); + } + + public static void asyncCreateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setBackup(Backup.newBuilder().build()) + .build(); + ApiFuture future = + sqlBackupsServiceClient.createBackupCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_CreateBackup_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/createbackup/SyncCreateBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/createbackup/SyncCreateBackup.java new file mode 100644 index 000000000000..bfb877a4c227 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/createbackup/SyncCreateBackup.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_CreateBackup_sync] +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.CreateBackupRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.ProjectName; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class SyncCreateBackup { + + public static void main(String[] args) throws Exception { + syncCreateBackup(); + } + + public static void syncCreateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setBackup(Backup.newBuilder().build()) + .build(); + Operation response = sqlBackupsServiceClient.createBackup(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_CreateBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/createbackup/SyncCreateBackupProjectnameBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/createbackup/SyncCreateBackupProjectnameBackup.java new file mode 100644 index 000000000000..231d00b56f90 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/createbackup/SyncCreateBackupProjectnameBackup.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_CreateBackup_ProjectnameBackup_sync] +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.ProjectName; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class SyncCreateBackupProjectnameBackup { + + public static void main(String[] args) throws Exception { + syncCreateBackupProjectnameBackup(); + } + + public static void syncCreateBackupProjectnameBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + Backup backup = Backup.newBuilder().build(); + Operation response = sqlBackupsServiceClient.createBackup(parent, backup); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_CreateBackup_ProjectnameBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/createbackup/SyncCreateBackupStringBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/createbackup/SyncCreateBackupStringBackup.java new file mode 100644 index 000000000000..b22956983a97 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/createbackup/SyncCreateBackupStringBackup.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_CreateBackup_StringBackup_sync] +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.ProjectName; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class SyncCreateBackupStringBackup { + + public static void main(String[] args) throws Exception { + syncCreateBackupStringBackup(); + } + + public static void syncCreateBackupStringBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + Backup backup = Backup.newBuilder().build(); + Operation response = sqlBackupsServiceClient.createBackup(parent, backup); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_CreateBackup_StringBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/deletebackup/AsyncDeleteBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/deletebackup/AsyncDeleteBackup.java new file mode 100644 index 000000000000..3f715b541e11 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/deletebackup/AsyncDeleteBackup.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_DeleteBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.BackupName; +import com.google.cloud.sql.v1beta4.DeleteBackupRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class AsyncDeleteBackup { + + public static void main(String[] args) throws Exception { + asyncDeleteBackup(); + } + + public static void asyncDeleteBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .build(); + ApiFuture future = + sqlBackupsServiceClient.deleteBackupCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_DeleteBackup_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/deletebackup/SyncDeleteBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/deletebackup/SyncDeleteBackup.java new file mode 100644 index 000000000000..b86159cb4050 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/deletebackup/SyncDeleteBackup.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_DeleteBackup_sync] +import com.google.cloud.sql.v1beta4.BackupName; +import com.google.cloud.sql.v1beta4.DeleteBackupRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class SyncDeleteBackup { + + public static void main(String[] args) throws Exception { + syncDeleteBackup(); + } + + public static void syncDeleteBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .build(); + Operation response = sqlBackupsServiceClient.deleteBackup(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_DeleteBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/deletebackup/SyncDeleteBackupBackupname.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/deletebackup/SyncDeleteBackupBackupname.java new file mode 100644 index 000000000000..526aad92b96f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/deletebackup/SyncDeleteBackupBackupname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_DeleteBackup_Backupname_sync] +import com.google.cloud.sql.v1beta4.BackupName; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class SyncDeleteBackupBackupname { + + public static void main(String[] args) throws Exception { + syncDeleteBackupBackupname(); + } + + public static void syncDeleteBackupBackupname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + Operation response = sqlBackupsServiceClient.deleteBackup(name); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_DeleteBackup_Backupname_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/deletebackup/SyncDeleteBackupString.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/deletebackup/SyncDeleteBackupString.java new file mode 100644 index 000000000000..5104312bbf11 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/deletebackup/SyncDeleteBackupString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_DeleteBackup_String_sync] +import com.google.cloud.sql.v1beta4.BackupName; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class SyncDeleteBackupString { + + public static void main(String[] args) throws Exception { + syncDeleteBackupString(); + } + + public static void syncDeleteBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + String name = BackupName.of("[PROJECT]", "[BACKUP]").toString(); + Operation response = sqlBackupsServiceClient.deleteBackup(name); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_DeleteBackup_String_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/getbackup/AsyncGetBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/getbackup/AsyncGetBackup.java new file mode 100644 index 000000000000..e052238679f8 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/getbackup/AsyncGetBackup.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_GetBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.BackupName; +import com.google.cloud.sql.v1beta4.GetBackupRequest; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class AsyncGetBackup { + + public static void main(String[] args) throws Exception { + asyncGetBackup(); + } + + public static void asyncGetBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + GetBackupRequest request = + GetBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .build(); + ApiFuture future = sqlBackupsServiceClient.getBackupCallable().futureCall(request); + // Do something. + Backup response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_GetBackup_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/getbackup/SyncGetBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/getbackup/SyncGetBackup.java new file mode 100644 index 000000000000..e57e764f6dba --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/getbackup/SyncGetBackup.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_GetBackup_sync] +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.BackupName; +import com.google.cloud.sql.v1beta4.GetBackupRequest; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class SyncGetBackup { + + public static void main(String[] args) throws Exception { + syncGetBackup(); + } + + public static void syncGetBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + GetBackupRequest request = + GetBackupRequest.newBuilder() + .setName(BackupName.of("[PROJECT]", "[BACKUP]").toString()) + .build(); + Backup response = sqlBackupsServiceClient.getBackup(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_GetBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/getbackup/SyncGetBackupBackupname.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/getbackup/SyncGetBackupBackupname.java new file mode 100644 index 000000000000..b134bf83afcf --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/getbackup/SyncGetBackupBackupname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_GetBackup_Backupname_sync] +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.BackupName; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class SyncGetBackupBackupname { + + public static void main(String[] args) throws Exception { + syncGetBackupBackupname(); + } + + public static void syncGetBackupBackupname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + BackupName name = BackupName.of("[PROJECT]", "[BACKUP]"); + Backup response = sqlBackupsServiceClient.getBackup(name); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_GetBackup_Backupname_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/getbackup/SyncGetBackupString.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/getbackup/SyncGetBackupString.java new file mode 100644 index 000000000000..d9d39d9f39bd --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/getbackup/SyncGetBackupString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_GetBackup_String_sync] +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.BackupName; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class SyncGetBackupString { + + public static void main(String[] args) throws Exception { + syncGetBackupString(); + } + + public static void syncGetBackupString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + String name = BackupName.of("[PROJECT]", "[BACKUP]").toString(); + Backup response = sqlBackupsServiceClient.getBackup(name); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_GetBackup_String_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/AsyncListBackups.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/AsyncListBackups.java new file mode 100644 index 000000000000..84a1117f3487 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/AsyncListBackups.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_ListBackups_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.ListBackupsRequest; +import com.google.cloud.sql.v1beta4.ProjectName; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class AsyncListBackups { + + public static void main(String[] args) throws Exception { + asyncListBackups(); + } + + public static void asyncListBackups() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + sqlBackupsServiceClient.listBackupsPagedCallable().futureCall(request); + // Do something. + for (Backup element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_ListBackups_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/AsyncListBackupsPaged.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/AsyncListBackupsPaged.java new file mode 100644 index 000000000000..61485bb6c71b --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/AsyncListBackupsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_ListBackups_Paged_async] +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.ListBackupsRequest; +import com.google.cloud.sql.v1beta4.ListBackupsResponse; +import com.google.cloud.sql.v1beta4.ProjectName; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; +import com.google.common.base.Strings; + +public class AsyncListBackupsPaged { + + public static void main(String[] args) throws Exception { + asyncListBackupsPaged(); + } + + public static void asyncListBackupsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListBackupsResponse response = sqlBackupsServiceClient.listBackupsCallable().call(request); + for (Backup element : response.getBackupsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_ListBackups_Paged_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/SyncListBackups.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/SyncListBackups.java new file mode 100644 index 000000000000..9f5d765fc1a8 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/SyncListBackups.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_ListBackups_sync] +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.ListBackupsRequest; +import com.google.cloud.sql.v1beta4.ProjectName; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class SyncListBackups { + + public static void main(String[] args) throws Exception { + syncListBackups(); + } + + public static void syncListBackups() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + for (Backup element : sqlBackupsServiceClient.listBackups(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_ListBackups_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/SyncListBackupsProjectname.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/SyncListBackupsProjectname.java new file mode 100644 index 000000000000..7d3e5dbcdc3a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/SyncListBackupsProjectname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_ListBackups_Projectname_sync] +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.ProjectName; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class SyncListBackupsProjectname { + + public static void main(String[] args) throws Exception { + syncListBackupsProjectname(); + } + + public static void syncListBackupsProjectname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (Backup element : sqlBackupsServiceClient.listBackups(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_ListBackups_Projectname_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/SyncListBackupsString.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/SyncListBackupsString.java new file mode 100644 index 000000000000..257c546fc192 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/listbackups/SyncListBackupsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_ListBackups_String_sync] +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.ProjectName; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; + +public class SyncListBackupsString { + + public static void main(String[] args) throws Exception { + syncListBackupsString(); + } + + public static void syncListBackupsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (Backup element : sqlBackupsServiceClient.listBackups(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_ListBackups_String_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/updatebackup/AsyncUpdateBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/updatebackup/AsyncUpdateBackup.java new file mode 100644 index 000000000000..76d3faff483b --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/updatebackup/AsyncUpdateBackup.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_UpdateBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; +import com.google.cloud.sql.v1beta4.UpdateBackupRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateBackup { + + public static void main(String[] args) throws Exception { + asyncUpdateBackup(); + } + + public static void asyncUpdateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder() + .setBackup(Backup.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + sqlBackupsServiceClient.updateBackupCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_UpdateBackup_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/updatebackup/SyncUpdateBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/updatebackup/SyncUpdateBackup.java new file mode 100644 index 000000000000..56e507cc2256 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/updatebackup/SyncUpdateBackup.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_UpdateBackup_sync] +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; +import com.google.cloud.sql.v1beta4.UpdateBackupRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBackup { + + public static void main(String[] args) throws Exception { + syncUpdateBackup(); + } + + public static void syncUpdateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder() + .setBackup(Backup.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Operation response = sqlBackupsServiceClient.updateBackup(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_UpdateBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/updatebackup/SyncUpdateBackupBackupFieldmask.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/updatebackup/SyncUpdateBackupBackupFieldmask.java new file mode 100644 index 000000000000..254d5798f366 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservice/updatebackup/SyncUpdateBackupBackupFieldmask.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsService_UpdateBackup_BackupFieldmask_sync] +import com.google.cloud.sql.v1beta4.Backup; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlBackupsServiceClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBackupBackupFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateBackupBackupFieldmask(); + } + + public static void syncUpdateBackupBackupFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlBackupsServiceClient sqlBackupsServiceClient = SqlBackupsServiceClient.create()) { + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Operation response = sqlBackupsServiceClient.updateBackup(backup, updateMask); + } + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsService_UpdateBackup_BackupFieldmask_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservicesettings/createbackup/SyncCreateBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservicesettings/createbackup/SyncCreateBackup.java new file mode 100644 index 000000000000..08eb6f2c2391 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlbackupsservicesettings/createbackup/SyncCreateBackup.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsServiceSettings_CreateBackup_sync] +import com.google.cloud.sql.v1beta4.SqlBackupsServiceSettings; +import java.time.Duration; + +public class SyncCreateBackup { + + public static void main(String[] args) throws Exception { + syncCreateBackup(); + } + + public static void syncCreateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlBackupsServiceSettings.Builder sqlBackupsServiceSettingsBuilder = + SqlBackupsServiceSettings.newBuilder(); + sqlBackupsServiceSettingsBuilder + .createBackupSettings() + .setRetrySettings( + sqlBackupsServiceSettingsBuilder + .createBackupSettings() + .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()); + SqlBackupsServiceSettings sqlBackupsServiceSettings = sqlBackupsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsServiceSettings_CreateBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..31fef8067742 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlConnectService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1beta4.SqlConnectServiceClient; +import com.google.cloud.sql.v1beta4.SqlConnectServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlConnectServiceSettings sqlConnectServiceSettings = + SqlConnectServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlConnectServiceClient sqlConnectServiceClient = + SqlConnectServiceClient.create(sqlConnectServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlConnectService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..b56de3701e6c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlConnectService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1beta4.SqlConnectServiceClient; +import com.google.cloud.sql.v1beta4.SqlConnectServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlConnectServiceSettings sqlConnectServiceSettings = + SqlConnectServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlConnectServiceClient sqlConnectServiceClient = + SqlConnectServiceClient.create(sqlConnectServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlConnectService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..f69fcdab3db5 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlConnectService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1beta4.SqlConnectServiceClient; +import com.google.cloud.sql.v1beta4.SqlConnectServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlConnectServiceSettings sqlConnectServiceSettings = + SqlConnectServiceSettings.newHttpJsonBuilder().build(); + SqlConnectServiceClient sqlConnectServiceClient = + SqlConnectServiceClient.create(sqlConnectServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlConnectService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/generateephemeralcert/AsyncGenerateEphemeralCert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/generateephemeralcert/AsyncGenerateEphemeralCert.java new file mode 100644 index 000000000000..64b60fa67b7f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/generateephemeralcert/AsyncGenerateEphemeralCert.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlConnectService_GenerateEphemeralCert_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest; +import com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse; +import com.google.cloud.sql.v1beta4.SqlConnectServiceClient; +import com.google.protobuf.Duration; +import com.google.protobuf.Timestamp; + +public class AsyncGenerateEphemeralCert { + + public static void main(String[] args) throws Exception { + asyncGenerateEphemeralCert(); + } + + public static void asyncGenerateEphemeralCert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) { + GenerateEphemeralCertRequest request = + GenerateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setPublicKey("publicKey1446899510") + .setAccessToken("accessToken-1042689291") + .setReadTime(Timestamp.newBuilder().build()) + .setValidDuration(Duration.newBuilder().build()) + .build(); + ApiFuture future = + sqlConnectServiceClient.generateEphemeralCertCallable().futureCall(request); + // Do something. + GenerateEphemeralCertResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlConnectService_GenerateEphemeralCert_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/generateephemeralcert/SyncGenerateEphemeralCert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/generateephemeralcert/SyncGenerateEphemeralCert.java new file mode 100644 index 000000000000..77e9f1eb54b8 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/generateephemeralcert/SyncGenerateEphemeralCert.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlConnectService_GenerateEphemeralCert_sync] +import com.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest; +import com.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse; +import com.google.cloud.sql.v1beta4.SqlConnectServiceClient; +import com.google.protobuf.Duration; +import com.google.protobuf.Timestamp; + +public class SyncGenerateEphemeralCert { + + public static void main(String[] args) throws Exception { + syncGenerateEphemeralCert(); + } + + public static void syncGenerateEphemeralCert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) { + GenerateEphemeralCertRequest request = + GenerateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setPublicKey("publicKey1446899510") + .setAccessToken("accessToken-1042689291") + .setReadTime(Timestamp.newBuilder().build()) + .setValidDuration(Duration.newBuilder().build()) + .build(); + GenerateEphemeralCertResponse response = + sqlConnectServiceClient.generateEphemeralCert(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlConnectService_GenerateEphemeralCert_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/getconnectsettings/AsyncGetConnectSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/getconnectsettings/AsyncGetConnectSettings.java new file mode 100644 index 000000000000..63ca01d009b1 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/getconnectsettings/AsyncGetConnectSettings.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlConnectService_GetConnectSettings_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.ConnectSettings; +import com.google.cloud.sql.v1beta4.GetConnectSettingsRequest; +import com.google.cloud.sql.v1beta4.SqlConnectServiceClient; +import com.google.protobuf.Timestamp; + +public class AsyncGetConnectSettings { + + public static void main(String[] args) throws Exception { + asyncGetConnectSettings(); + } + + public static void asyncGetConnectSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) { + GetConnectSettingsRequest request = + GetConnectSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReadTime(Timestamp.newBuilder().build()) + .build(); + ApiFuture future = + sqlConnectServiceClient.getConnectSettingsCallable().futureCall(request); + // Do something. + ConnectSettings response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlConnectService_GetConnectSettings_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/getconnectsettings/SyncGetConnectSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/getconnectsettings/SyncGetConnectSettings.java new file mode 100644 index 000000000000..428347206ca9 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/getconnectsettings/SyncGetConnectSettings.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlConnectService_GetConnectSettings_sync] +import com.google.cloud.sql.v1beta4.ConnectSettings; +import com.google.cloud.sql.v1beta4.GetConnectSettingsRequest; +import com.google.cloud.sql.v1beta4.SqlConnectServiceClient; +import com.google.protobuf.Timestamp; + +public class SyncGetConnectSettings { + + public static void main(String[] args) throws Exception { + syncGetConnectSettings(); + } + + public static void syncGetConnectSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) { + GetConnectSettingsRequest request = + GetConnectSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReadTime(Timestamp.newBuilder().build()) + .build(); + ConnectSettings response = sqlConnectServiceClient.getConnectSettings(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlConnectService_GetConnectSettings_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/resolveconnectsettings/AsyncResolveConnectSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/resolveconnectsettings/AsyncResolveConnectSettings.java new file mode 100644 index 000000000000..a7c093d93032 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/resolveconnectsettings/AsyncResolveConnectSettings.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlConnectService_ResolveConnectSettings_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.ConnectSettings; +import com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest; +import com.google.cloud.sql.v1beta4.SqlConnectServiceClient; + +public class AsyncResolveConnectSettings { + + public static void main(String[] args) throws Exception { + asyncResolveConnectSettings(); + } + + public static void asyncResolveConnectSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) { + ResolveConnectSettingsRequest request = + ResolveConnectSettingsRequest.newBuilder() + .setDnsName("dnsName1813886804") + .setLocation("location1901043637") + .build(); + ApiFuture future = + sqlConnectServiceClient.resolveConnectSettingsCallable().futureCall(request); + // Do something. + ConnectSettings response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlConnectService_ResolveConnectSettings_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/resolveconnectsettings/SyncResolveConnectSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/resolveconnectsettings/SyncResolveConnectSettings.java new file mode 100644 index 000000000000..9dcb4f3a8183 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservice/resolveconnectsettings/SyncResolveConnectSettings.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlConnectService_ResolveConnectSettings_sync] +import com.google.cloud.sql.v1beta4.ConnectSettings; +import com.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest; +import com.google.cloud.sql.v1beta4.SqlConnectServiceClient; + +public class SyncResolveConnectSettings { + + public static void main(String[] args) throws Exception { + syncResolveConnectSettings(); + } + + public static void syncResolveConnectSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlConnectServiceClient sqlConnectServiceClient = SqlConnectServiceClient.create()) { + ResolveConnectSettingsRequest request = + ResolveConnectSettingsRequest.newBuilder() + .setDnsName("dnsName1813886804") + .setLocation("location1901043637") + .build(); + ConnectSettings response = sqlConnectServiceClient.resolveConnectSettings(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlConnectService_ResolveConnectSettings_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservicesettings/getconnectsettings/SyncGetConnectSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservicesettings/getconnectsettings/SyncGetConnectSettings.java new file mode 100644 index 000000000000..a7562f641404 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlconnectservicesettings/getconnectsettings/SyncGetConnectSettings.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlConnectServiceSettings_GetConnectSettings_sync] +import com.google.cloud.sql.v1beta4.SqlConnectServiceSettings; +import java.time.Duration; + +public class SyncGetConnectSettings { + + public static void main(String[] args) throws Exception { + syncGetConnectSettings(); + } + + public static void syncGetConnectSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlConnectServiceSettings.Builder sqlConnectServiceSettingsBuilder = + SqlConnectServiceSettings.newBuilder(); + sqlConnectServiceSettingsBuilder + .getConnectSettingsSettings() + .setRetrySettings( + sqlConnectServiceSettingsBuilder + .getConnectSettingsSettings() + .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()); + SqlConnectServiceSettings sqlConnectServiceSettings = sqlConnectServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlConnectServiceSettings_GetConnectSettings_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..4108019bca3f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlDatabasesServiceSettings sqlDatabasesServiceSettings = + SqlDatabasesServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlDatabasesServiceClient sqlDatabasesServiceClient = + SqlDatabasesServiceClient.create(sqlDatabasesServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..1a58743c39dd --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlDatabasesServiceSettings sqlDatabasesServiceSettings = + SqlDatabasesServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlDatabasesServiceClient sqlDatabasesServiceClient = + SqlDatabasesServiceClient.create(sqlDatabasesServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..2f7f6b1007d6 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlDatabasesServiceSettings sqlDatabasesServiceSettings = + SqlDatabasesServiceSettings.newHttpJsonBuilder().build(); + SqlDatabasesServiceClient sqlDatabasesServiceClient = + SqlDatabasesServiceClient.create(sqlDatabasesServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/delete/AsyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/delete/AsyncDelete.java new file mode 100644 index 000000000000..e6e2ab551071 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/delete/AsyncDelete.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_Delete_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; + +public class AsyncDelete { + + public static void main(String[] args) throws Exception { + asyncDelete(); + } + + public static void asyncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesDeleteRequest request = + SqlDatabasesDeleteRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlDatabasesServiceClient.deleteCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_Delete_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/delete/SyncDelete.java new file mode 100644 index 000000000000..29cbfe1c2678 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/delete/SyncDelete.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_Delete_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesDeleteRequest request = + SqlDatabasesDeleteRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlDatabasesServiceClient.delete(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/get/AsyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/get/AsyncGet.java new file mode 100644 index 000000000000..7271d4108481 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/get/AsyncGet.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_Get_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Database; +import com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; + +public class AsyncGet { + + public static void main(String[] args) throws Exception { + asyncGet(); + } + + public static void asyncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesGetRequest request = + SqlDatabasesGetRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlDatabasesServiceClient.getCallable().futureCall(request); + // Do something. + Database response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_Get_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/get/SyncGet.java new file mode 100644 index 000000000000..28c9f7ff7435 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/get/SyncGet.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_Get_sync] +import com.google.cloud.sql.v1beta4.Database; +import com.google.cloud.sql.v1beta4.SqlDatabasesGetRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesGetRequest request = + SqlDatabasesGetRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Database response = sqlDatabasesServiceClient.get(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/insert/AsyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/insert/AsyncInsert.java new file mode 100644 index 000000000000..f3d0ede38ff3 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/insert/AsyncInsert.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_Insert_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Database; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; + +public class AsyncInsert { + + public static void main(String[] args) throws Exception { + asyncInsert(); + } + + public static void asyncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesInsertRequest request = + SqlDatabasesInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + ApiFuture future = sqlDatabasesServiceClient.insertCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_Insert_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/insert/SyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/insert/SyncInsert.java new file mode 100644 index 000000000000..82eeec9e36a0 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/insert/SyncInsert.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_Insert_sync] +import com.google.cloud.sql.v1beta4.Database; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; + +public class SyncInsert { + + public static void main(String[] args) throws Exception { + syncInsert(); + } + + public static void syncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesInsertRequest request = + SqlDatabasesInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + Operation response = sqlDatabasesServiceClient.insert(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_Insert_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/list/AsyncList.java new file mode 100644 index 000000000000..21fdda4d679b --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/list/AsyncList.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.DatabasesListResponse; +import com.google.cloud.sql.v1beta4.SqlDatabasesListRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesListRequest request = + SqlDatabasesListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlDatabasesServiceClient.listCallable().futureCall(request); + // Do something. + DatabasesListResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/list/SyncList.java new file mode 100644 index 000000000000..686c01ffe2a8 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/list/SyncList.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_List_sync] +import com.google.cloud.sql.v1beta4.DatabasesListResponse; +import com.google.cloud.sql.v1beta4.SqlDatabasesListRequest; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesListRequest request = + SqlDatabasesListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + DatabasesListResponse response = sqlDatabasesServiceClient.list(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/patch/AsyncPatch.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/patch/AsyncPatch.java new file mode 100644 index 000000000000..135e5b8064a1 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/patch/AsyncPatch.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_Patch_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Database; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; +import com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest; + +public class AsyncPatch { + + public static void main(String[] args) throws Exception { + asyncPatch(); + } + + public static void asyncPatch() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + ApiFuture future = sqlDatabasesServiceClient.patchCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_Patch_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/patch/SyncPatch.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/patch/SyncPatch.java new file mode 100644 index 000000000000..155c1c2b3bb7 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/patch/SyncPatch.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_Patch_sync] +import com.google.cloud.sql.v1beta4.Database; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; +import com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest; + +public class SyncPatch { + + public static void main(String[] args) throws Exception { + syncPatch(); + } + + public static void syncPatch() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + Operation response = sqlDatabasesServiceClient.patch(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_Patch_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/update/AsyncUpdate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/update/AsyncUpdate.java new file mode 100644 index 000000000000..8e524b5a1a88 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/update/AsyncUpdate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_Update_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Database; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; +import com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest; + +public class AsyncUpdate { + + public static void main(String[] args) throws Exception { + asyncUpdate(); + } + + public static void asyncUpdate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + ApiFuture future = sqlDatabasesServiceClient.updateCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_Update_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/update/SyncUpdate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/update/SyncUpdate.java new file mode 100644 index 000000000000..f65ed56deb58 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservice/update/SyncUpdate.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesService_Update_sync] +import com.google.cloud.sql.v1beta4.Database; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceClient; +import com.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest; + +public class SyncUpdate { + + public static void main(String[] args) throws Exception { + syncUpdate(); + } + + public static void syncUpdate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDatabasesServiceClient sqlDatabasesServiceClient = SqlDatabasesServiceClient.create()) { + SqlDatabasesUpdateRequest request = + SqlDatabasesUpdateRequest.newBuilder() + .setDatabase("database1789464955") + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(Database.newBuilder().build()) + .build(); + Operation response = sqlDatabasesServiceClient.update(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesService_Update_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservicesettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservicesettings/delete/SyncDelete.java new file mode 100644 index 000000000000..478fea8f02d5 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldatabasesservicesettings/delete/SyncDelete.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesServiceSettings_Delete_sync] +import com.google.cloud.sql.v1beta4.SqlDatabasesServiceSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlDatabasesServiceSettings.Builder sqlDatabasesServiceSettingsBuilder = + SqlDatabasesServiceSettings.newBuilder(); + sqlDatabasesServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlDatabasesServiceSettingsBuilder + .deleteSettings() + .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()); + SqlDatabasesServiceSettings sqlDatabasesServiceSettings = + sqlDatabasesServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesServiceSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldataservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldataservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..5ba25d2905ca --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldataservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDataService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1beta4.SqlDataServiceClient; +import com.google.cloud.sql.v1beta4.SqlDataServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlDataServiceSettings sqlDataServiceSettings = + SqlDataServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlDataServiceClient sqlDataServiceClient = SqlDataServiceClient.create(sqlDataServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlDataService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldataservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldataservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..a0e63ede7d41 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldataservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDataService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1beta4.SqlDataServiceClient; +import com.google.cloud.sql.v1beta4.SqlDataServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlDataServiceSettings sqlDataServiceSettings = + SqlDataServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlDataServiceClient sqlDataServiceClient = SqlDataServiceClient.create(sqlDataServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlDataService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldataservice/streamsqldata/AsyncStreamSqlData.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldataservice/streamsqldata/AsyncStreamSqlData.java new file mode 100644 index 000000000000..8c86ef680afc --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldataservice/streamsqldata/AsyncStreamSqlData.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDataService_StreamSqlData_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.sql.v1beta4.Ack; +import com.google.cloud.sql.v1beta4.InstanceName; +import com.google.cloud.sql.v1beta4.SqlDataServiceClient; +import com.google.cloud.sql.v1beta4.StreamSqlDataRequest; +import com.google.cloud.sql.v1beta4.StreamSqlDataResponse; + +public class AsyncStreamSqlData { + + public static void main(String[] args) throws Exception { + asyncStreamSqlData(); + } + + public static void asyncStreamSqlData() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlDataServiceClient sqlDataServiceClient = SqlDataServiceClient.create()) { + BidiStream bidiStream = + sqlDataServiceClient.streamSqlDataCallable().call(); + StreamSqlDataRequest request = + StreamSqlDataRequest.newBuilder() + .setAck(Ack.newBuilder().build()) + .setInstanceId(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .build(); + bidiStream.send(request); + for (StreamSqlDataResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END sqladmin_v1beta4_generated_SqlDataService_StreamSqlData_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldataservicesettings/streamsqldata/SyncStreamSqlData.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldataservicesettings/streamsqldata/SyncStreamSqlData.java new file mode 100644 index 000000000000..31ae4d56fe1c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqldataservicesettings/streamsqldata/SyncStreamSqlData.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlDataServiceSettings_StreamSqlData_sync] +import com.google.cloud.sql.v1beta4.SqlDataServiceSettings; +import java.time.Duration; + +public class SyncStreamSqlData { + + public static void main(String[] args) throws Exception { + syncStreamSqlData(); + } + + public static void syncStreamSqlData() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlDataServiceSettings.Builder sqlDataServiceSettingsBuilder = + SqlDataServiceSettings.newBuilder(); + sqlDataServiceSettingsBuilder + .streamSqlDataSettings() + .setRetrySettings( + sqlDataServiceSettingsBuilder + .streamSqlDataSettings() + .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()); + SqlDataServiceSettings sqlDataServiceSettings = sqlDataServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlDataServiceSettings_StreamSqlData_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..e7feb445196a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlFlagsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1beta4.SqlFlagsServiceClient; +import com.google.cloud.sql.v1beta4.SqlFlagsServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlFlagsServiceSettings sqlFlagsServiceSettings = + SqlFlagsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlFlagsServiceClient sqlFlagsServiceClient = + SqlFlagsServiceClient.create(sqlFlagsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlFlagsService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..b1bbcc43d5cd --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlFlagsService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1beta4.SqlFlagsServiceClient; +import com.google.cloud.sql.v1beta4.SqlFlagsServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlFlagsServiceSettings sqlFlagsServiceSettings = + SqlFlagsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlFlagsServiceClient sqlFlagsServiceClient = + SqlFlagsServiceClient.create(sqlFlagsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlFlagsService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..c4a842051457 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlFlagsService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1beta4.SqlFlagsServiceClient; +import com.google.cloud.sql.v1beta4.SqlFlagsServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlFlagsServiceSettings sqlFlagsServiceSettings = + SqlFlagsServiceSettings.newHttpJsonBuilder().build(); + SqlFlagsServiceClient sqlFlagsServiceClient = + SqlFlagsServiceClient.create(sqlFlagsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlFlagsService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/list/AsyncList.java new file mode 100644 index 000000000000..7e95ba2e6c5c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/list/AsyncList.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlFlagsService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.FlagsListResponse; +import com.google.cloud.sql.v1beta4.SqlFlagScope; +import com.google.cloud.sql.v1beta4.SqlFlagsListRequest; +import com.google.cloud.sql.v1beta4.SqlFlagsServiceClient; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlFlagsServiceClient sqlFlagsServiceClient = SqlFlagsServiceClient.create()) { + SqlFlagsListRequest request = + SqlFlagsListRequest.newBuilder() + .setDatabaseVersion("databaseVersion1250955997") + .setFlagScope(SqlFlagScope.forNumber(0)) + .build(); + ApiFuture future = + sqlFlagsServiceClient.listCallable().futureCall(request); + // Do something. + FlagsListResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlFlagsService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/list/SyncList.java new file mode 100644 index 000000000000..346eb5eb48fd --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservice/list/SyncList.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlFlagsService_List_sync] +import com.google.cloud.sql.v1beta4.FlagsListResponse; +import com.google.cloud.sql.v1beta4.SqlFlagScope; +import com.google.cloud.sql.v1beta4.SqlFlagsListRequest; +import com.google.cloud.sql.v1beta4.SqlFlagsServiceClient; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlFlagsServiceClient sqlFlagsServiceClient = SqlFlagsServiceClient.create()) { + SqlFlagsListRequest request = + SqlFlagsListRequest.newBuilder() + .setDatabaseVersion("databaseVersion1250955997") + .setFlagScope(SqlFlagScope.forNumber(0)) + .build(); + FlagsListResponse response = sqlFlagsServiceClient.list(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlFlagsService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservicesettings/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservicesettings/list/SyncList.java new file mode 100644 index 000000000000..4dc05dc6e5a1 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlflagsservicesettings/list/SyncList.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlFlagsServiceSettings_List_sync] +import com.google.cloud.sql.v1beta4.SqlFlagsServiceSettings; +import java.time.Duration; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlFlagsServiceSettings.Builder sqlFlagsServiceSettingsBuilder = + SqlFlagsServiceSettings.newBuilder(); + sqlFlagsServiceSettingsBuilder + .listSettings() + .setRetrySettings( + sqlFlagsServiceSettingsBuilder + .listSettings() + .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()); + SqlFlagsServiceSettings sqlFlagsServiceSettings = sqlFlagsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlFlagsServiceSettings_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/acquiressrslease/AsyncAcquireSsrsLease.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/acquiressrslease/AsyncAcquireSsrsLease.java new file mode 100644 index 000000000000..5f01be826162 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/acquiressrslease/AsyncAcquireSsrsLease.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_AcquireSsrsLease_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncAcquireSsrsLease { + + public static void main(String[] args) throws Exception { + asyncAcquireSsrsLease(); + } + + public static void asyncAcquireSsrsLease() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAcquireSsrsLeaseRequest request = + SqlInstancesAcquireSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.acquireSsrsLeaseCallable().futureCall(request); + // Do something. + SqlInstancesAcquireSsrsLeaseResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_AcquireSsrsLease_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/acquiressrslease/SyncAcquireSsrsLease.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/acquiressrslease/SyncAcquireSsrsLease.java new file mode 100644 index 000000000000..38d1ca6d944f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/acquiressrslease/SyncAcquireSsrsLease.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_AcquireSsrsLease_sync] +import com.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncAcquireSsrsLease { + + public static void main(String[] args) throws Exception { + syncAcquireSsrsLease(); + } + + public static void syncAcquireSsrsLease() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAcquireSsrsLeaseRequest request = + SqlInstancesAcquireSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesAcquireSsrsLeaseRequest.newBuilder().build()) + .build(); + SqlInstancesAcquireSsrsLeaseResponse response = + sqlInstancesServiceClient.acquireSsrsLease(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_AcquireSsrsLease_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addentraidcertificate/AsyncAddEntraIdCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addentraidcertificate/AsyncAddEntraIdCertificate.java new file mode 100644 index 000000000000..b98ecd78672b --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addentraidcertificate/AsyncAddEntraIdCertificate.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_AddEntraIdCertificate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncAddEntraIdCertificate { + + public static void main(String[] args) throws Exception { + asyncAddEntraIdCertificate(); + } + + public static void asyncAddEntraIdCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAddEntraIdCertificateRequest request = + SqlInstancesAddEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.addEntraIdCertificateCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_AddEntraIdCertificate_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addentraidcertificate/SyncAddEntraIdCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addentraidcertificate/SyncAddEntraIdCertificate.java new file mode 100644 index 000000000000..a6574f457cc0 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addentraidcertificate/SyncAddEntraIdCertificate.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_AddEntraIdCertificate_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncAddEntraIdCertificate { + + public static void main(String[] args) throws Exception { + syncAddEntraIdCertificate(); + } + + public static void syncAddEntraIdCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAddEntraIdCertificateRequest request = + SqlInstancesAddEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.addEntraIdCertificate(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_AddEntraIdCertificate_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addserverca/AsyncAddServerCa.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addserverca/AsyncAddServerCa.java new file mode 100644 index 000000000000..515c5b8a67f6 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addserverca/AsyncAddServerCa.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_AddServerCa_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncAddServerCa { + + public static void main(String[] args) throws Exception { + asyncAddServerCa(); + } + + public static void asyncAddServerCa() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAddServerCaRequest request = + SqlInstancesAddServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.addServerCaCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_AddServerCa_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addserverca/SyncAddServerCa.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addserverca/SyncAddServerCa.java new file mode 100644 index 000000000000..fa95bed36ce8 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addserverca/SyncAddServerCa.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_AddServerCa_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncAddServerCa { + + public static void main(String[] args) throws Exception { + syncAddServerCa(); + } + + public static void syncAddServerCa() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAddServerCaRequest request = + SqlInstancesAddServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.addServerCa(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_AddServerCa_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addservercertificate/AsyncAddServerCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addservercertificate/AsyncAddServerCertificate.java new file mode 100644 index 000000000000..437058cf1d09 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addservercertificate/AsyncAddServerCertificate.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_AddServerCertificate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncAddServerCertificate { + + public static void main(String[] args) throws Exception { + asyncAddServerCertificate(); + } + + public static void asyncAddServerCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAddServerCertificateRequest request = + SqlInstancesAddServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.addServerCertificateCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_AddServerCertificate_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addservercertificate/SyncAddServerCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addservercertificate/SyncAddServerCertificate.java new file mode 100644 index 000000000000..87451437776a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/addservercertificate/SyncAddServerCertificate.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_AddServerCertificate_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncAddServerCertificate { + + public static void main(String[] args) throws Exception { + syncAddServerCertificate(); + } + + public static void syncAddServerCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesAddServerCertificateRequest request = + SqlInstancesAddServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.addServerCertificate(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_AddServerCertificate_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/clone/AsyncClone.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/clone/AsyncClone.java new file mode 100644 index 000000000000..dfe8b4005a9d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/clone/AsyncClone.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Clone_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesCloneRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncClone { + + public static void main(String[] args) throws Exception { + asyncClone(); + } + + public static void asyncClone() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesCloneRequest request = + SqlInstancesCloneRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesCloneRequest.newBuilder().build()) + .build(); + ApiFuture future = sqlInstancesServiceClient.cloneCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Clone_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/clone/SyncClone.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/clone/SyncClone.java new file mode 100644 index 000000000000..cee304743821 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/clone/SyncClone.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Clone_sync] +import com.google.cloud.sql.v1beta4.InstancesCloneRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesCloneRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncClone { + + public static void main(String[] args) throws Exception { + syncClone(); + } + + public static void syncClone() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesCloneRequest request = + SqlInstancesCloneRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesCloneRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.clone(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Clone_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..e1f447225dc8 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlInstancesServiceSettings sqlInstancesServiceSettings = + SqlInstancesServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlInstancesServiceClient sqlInstancesServiceClient = + SqlInstancesServiceClient.create(sqlInstancesServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..ac283b19b80e --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlInstancesServiceSettings sqlInstancesServiceSettings = + SqlInstancesServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlInstancesServiceClient sqlInstancesServiceClient = + SqlInstancesServiceClient.create(sqlInstancesServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..1803d2d68fd9 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlInstancesServiceSettings sqlInstancesServiceSettings = + SqlInstancesServiceSettings.newHttpJsonBuilder().build(); + SqlInstancesServiceClient sqlInstancesServiceClient = + SqlInstancesServiceClient.create(sqlInstancesServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/createephemeral/AsyncCreateEphemeral.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/createephemeral/AsyncCreateEphemeral.java new file mode 100644 index 000000000000..402927fb696f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/createephemeral/AsyncCreateEphemeral.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_CreateEphemeral_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SslCert; +import com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest; + +public class AsyncCreateEphemeral { + + public static void main(String[] args) throws Exception { + asyncCreateEphemeral(); + } + + public static void asyncCreateEphemeral() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesCreateEphemeralCertRequest request = + SqlInstancesCreateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsCreateEphemeralRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.createEphemeralCallable().futureCall(request); + // Do something. + SslCert response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_CreateEphemeral_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/createephemeral/SyncCreateEphemeral.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/createephemeral/SyncCreateEphemeral.java new file mode 100644 index 000000000000..534e2e09c7b7 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/createephemeral/SyncCreateEphemeral.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_CreateEphemeral_sync] +import com.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SslCert; +import com.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest; + +public class SyncCreateEphemeral { + + public static void main(String[] args) throws Exception { + syncCreateEphemeral(); + } + + public static void syncCreateEphemeral() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesCreateEphemeralCertRequest request = + SqlInstancesCreateEphemeralCertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsCreateEphemeralRequest.newBuilder().build()) + .build(); + SslCert response = sqlInstancesServiceClient.createEphemeral(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_CreateEphemeral_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/delete/AsyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/delete/AsyncDelete.java new file mode 100644 index 000000000000..94de8a52137c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/delete/AsyncDelete.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Delete_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncDelete { + + public static void main(String[] args) throws Exception { + asyncDelete(); + } + + public static void asyncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesDeleteRequest request = + SqlInstancesDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setEnableFinalBackup(true) + .setFinalBackupDescription("finalBackupDescription-293551612") + .build(); + ApiFuture future = sqlInstancesServiceClient.deleteCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Delete_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/delete/SyncDelete.java new file mode 100644 index 000000000000..eb58c86754bc --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/delete/SyncDelete.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Delete_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesDeleteRequest request = + SqlInstancesDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setEnableFinalBackup(true) + .setFinalBackupDescription("finalBackupDescription-293551612") + .build(); + Operation response = sqlInstancesServiceClient.delete(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/demote/AsyncDemote.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/demote/AsyncDemote.java new file mode 100644 index 000000000000..720fd012d208 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/demote/AsyncDemote.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Demote_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesDemoteRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncDemote { + + public static void main(String[] args) throws Exception { + asyncDemote(); + } + + public static void asyncDemote() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesDemoteRequest request = + SqlInstancesDemoteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteRequest.newBuilder().build()) + .build(); + ApiFuture future = sqlInstancesServiceClient.demoteCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Demote_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/demote/SyncDemote.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/demote/SyncDemote.java new file mode 100644 index 000000000000..437f6254926d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/demote/SyncDemote.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Demote_sync] +import com.google.cloud.sql.v1beta4.InstancesDemoteRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncDemote { + + public static void main(String[] args) throws Exception { + syncDemote(); + } + + public static void syncDemote() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesDemoteRequest request = + SqlInstancesDemoteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.demote(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Demote_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/demotemaster/AsyncDemoteMaster.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/demotemaster/AsyncDemoteMaster.java new file mode 100644 index 000000000000..6fda6ac96594 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/demotemaster/AsyncDemoteMaster.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_DemoteMaster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncDemoteMaster { + + public static void main(String[] args) throws Exception { + asyncDemoteMaster(); + } + + public static void asyncDemoteMaster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesDemoteMasterRequest request = + SqlInstancesDemoteMasterRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteMasterRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.demoteMasterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_DemoteMaster_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/demotemaster/SyncDemoteMaster.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/demotemaster/SyncDemoteMaster.java new file mode 100644 index 000000000000..3fcd08085a47 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/demotemaster/SyncDemoteMaster.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_DemoteMaster_sync] +import com.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncDemoteMaster { + + public static void main(String[] args) throws Exception { + syncDemoteMaster(); + } + + public static void syncDemoteMaster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesDemoteMasterRequest request = + SqlInstancesDemoteMasterRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesDemoteMasterRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.demoteMaster(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_DemoteMaster_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/executesql/AsyncExecuteSql.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/executesql/AsyncExecuteSql.java new file mode 100644 index 000000000000..214f5f82911f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/executesql/AsyncExecuteSql.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_ExecuteSql_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.ExecuteSqlPayload; +import com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncExecuteSql { + + public static void main(String[] args) throws Exception { + asyncExecuteSql(); + } + + public static void asyncExecuteSql() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesExecuteSqlRequest request = + SqlInstancesExecuteSqlRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(ExecuteSqlPayload.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.executeSqlCallable().futureCall(request); + // Do something. + SqlInstancesExecuteSqlResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ExecuteSql_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/executesql/SyncExecuteSql.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/executesql/SyncExecuteSql.java new file mode 100644 index 000000000000..877bc11e1eaa --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/executesql/SyncExecuteSql.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_ExecuteSql_sync] +import com.google.cloud.sql.v1beta4.ExecuteSqlPayload; +import com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncExecuteSql { + + public static void main(String[] args) throws Exception { + syncExecuteSql(); + } + + public static void syncExecuteSql() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesExecuteSqlRequest request = + SqlInstancesExecuteSqlRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(ExecuteSqlPayload.newBuilder().build()) + .build(); + SqlInstancesExecuteSqlResponse response = sqlInstancesServiceClient.executeSql(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ExecuteSql_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/export/AsyncExport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/export/AsyncExport.java new file mode 100644 index 000000000000..6b205cd7bdf2 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/export/AsyncExport.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Export_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesExportRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesExportRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncExport { + + public static void main(String[] args) throws Exception { + asyncExport(); + } + + public static void asyncExport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesExportRequest request = + SqlInstancesExportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesExportRequest.newBuilder().build()) + .build(); + ApiFuture future = sqlInstancesServiceClient.exportCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Export_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/export/SyncExport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/export/SyncExport.java new file mode 100644 index 000000000000..f974f8ddc897 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/export/SyncExport.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Export_sync] +import com.google.cloud.sql.v1beta4.InstancesExportRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesExportRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncExport { + + public static void main(String[] args) throws Exception { + syncExport(); + } + + public static void syncExport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesExportRequest request = + SqlInstancesExportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesExportRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.export(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Export_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/failover/AsyncFailover.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/failover/AsyncFailover.java new file mode 100644 index 000000000000..6dc5b245ad91 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/failover/AsyncFailover.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Failover_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesFailoverRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncFailover { + + public static void main(String[] args) throws Exception { + asyncFailover(); + } + + public static void asyncFailover() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesFailoverRequest request = + SqlInstancesFailoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesFailoverRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.failoverCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Failover_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/failover/SyncFailover.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/failover/SyncFailover.java new file mode 100644 index 000000000000..07aeb2811fb9 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/failover/SyncFailover.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Failover_sync] +import com.google.cloud.sql.v1beta4.InstancesFailoverRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncFailover { + + public static void main(String[] args) throws Exception { + syncFailover(); + } + + public static void syncFailover() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesFailoverRequest request = + SqlInstancesFailoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesFailoverRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.failover(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Failover_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/get/AsyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/get/AsyncGet.java new file mode 100644 index 000000000000..001c615107e7 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/get/AsyncGet.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Get_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.DatabaseInstance; +import com.google.cloud.sql.v1beta4.SqlInstancesGetRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncGet { + + public static void main(String[] args) throws Exception { + asyncGet(); + } + + public static void asyncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesGetRequest request = + SqlInstancesGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.getCallable().futureCall(request); + // Do something. + DatabaseInstance response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Get_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/get/SyncGet.java new file mode 100644 index 000000000000..03c574d419b7 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/get/SyncGet.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Get_sync] +import com.google.cloud.sql.v1beta4.DatabaseInstance; +import com.google.cloud.sql.v1beta4.SqlInstancesGetRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesGetRequest request = + SqlInstancesGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + DatabaseInstance response = sqlInstancesServiceClient.get(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/getdiskshrinkconfig/AsyncGetDiskShrinkConfig.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/getdiskshrinkconfig/AsyncGetDiskShrinkConfig.java new file mode 100644 index 000000000000..a750ba307f33 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/getdiskshrinkconfig/AsyncGetDiskShrinkConfig.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_GetDiskShrinkConfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncGetDiskShrinkConfig { + + public static void main(String[] args) throws Exception { + asyncGetDiskShrinkConfig(); + } + + public static void asyncGetDiskShrinkConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesGetDiskShrinkConfigRequest request = + SqlInstancesGetDiskShrinkConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.getDiskShrinkConfigCallable().futureCall(request); + // Do something. + SqlInstancesGetDiskShrinkConfigResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_GetDiskShrinkConfig_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/getdiskshrinkconfig/SyncGetDiskShrinkConfig.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/getdiskshrinkconfig/SyncGetDiskShrinkConfig.java new file mode 100644 index 000000000000..fc24a75214fc --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/getdiskshrinkconfig/SyncGetDiskShrinkConfig.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_GetDiskShrinkConfig_sync] +import com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncGetDiskShrinkConfig { + + public static void main(String[] args) throws Exception { + syncGetDiskShrinkConfig(); + } + + public static void syncGetDiskShrinkConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesGetDiskShrinkConfigRequest request = + SqlInstancesGetDiskShrinkConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + SqlInstancesGetDiskShrinkConfigResponse response = + sqlInstancesServiceClient.getDiskShrinkConfig(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_GetDiskShrinkConfig_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/getlatestrecoverytime/AsyncGetLatestRecoveryTime.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/getlatestrecoverytime/AsyncGetLatestRecoveryTime.java new file mode 100644 index 000000000000..40360a96cb83 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/getlatestrecoverytime/AsyncGetLatestRecoveryTime.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_GetLatestRecoveryTime_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.protobuf.Timestamp; + +public class AsyncGetLatestRecoveryTime { + + public static void main(String[] args) throws Exception { + asyncGetLatestRecoveryTime(); + } + + public static void asyncGetLatestRecoveryTime() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesGetLatestRecoveryTimeRequest request = + SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSourceInstanceDeletionTime(Timestamp.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.getLatestRecoveryTimeCallable().futureCall(request); + // Do something. + SqlInstancesGetLatestRecoveryTimeResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_GetLatestRecoveryTime_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/getlatestrecoverytime/SyncGetLatestRecoveryTime.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/getlatestrecoverytime/SyncGetLatestRecoveryTime.java new file mode 100644 index 000000000000..f590e3c6fdf8 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/getlatestrecoverytime/SyncGetLatestRecoveryTime.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_GetLatestRecoveryTime_sync] +import com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.protobuf.Timestamp; + +public class SyncGetLatestRecoveryTime { + + public static void main(String[] args) throws Exception { + syncGetLatestRecoveryTime(); + } + + public static void syncGetLatestRecoveryTime() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesGetLatestRecoveryTimeRequest request = + SqlInstancesGetLatestRecoveryTimeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSourceInstanceDeletionTime(Timestamp.newBuilder().build()) + .build(); + SqlInstancesGetLatestRecoveryTimeResponse response = + sqlInstancesServiceClient.getLatestRecoveryTime(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_GetLatestRecoveryTime_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/import/AsyncImport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/import/AsyncImport.java new file mode 100644 index 000000000000..0fe5c64893d4 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/import/AsyncImport.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Import_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesImportRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesImportRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncImport { + + public static void main(String[] args) throws Exception { + asyncImport(); + } + + public static void asyncImport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesImportRequest request = + SqlInstancesImportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesImportRequest.newBuilder().build()) + .build(); + ApiFuture future = sqlInstancesServiceClient.importCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Import_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/import/SyncImport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/import/SyncImport.java new file mode 100644 index 000000000000..987b9ccc3a84 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/import/SyncImport.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Import_sync] +import com.google.cloud.sql.v1beta4.InstancesImportRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesImportRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncImport { + + public static void main(String[] args) throws Exception { + syncImport(); + } + + public static void syncImport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesImportRequest request = + SqlInstancesImportRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesImportRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.import_(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Import_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/insert/AsyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/insert/AsyncInsert.java new file mode 100644 index 000000000000..2b559c11b538 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/insert/AsyncInsert.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Insert_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.DatabaseInstance; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncInsert { + + public static void main(String[] args) throws Exception { + asyncInsert(); + } + + public static void asyncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesInsertRequest request = + SqlInstancesInsertRequest.newBuilder() + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + ApiFuture future = sqlInstancesServiceClient.insertCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Insert_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/insert/SyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/insert/SyncInsert.java new file mode 100644 index 000000000000..8c5d7ed0556e --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/insert/SyncInsert.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Insert_sync] +import com.google.cloud.sql.v1beta4.DatabaseInstance; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesInsertRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncInsert { + + public static void main(String[] args) throws Exception { + syncInsert(); + } + + public static void syncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesInsertRequest request = + SqlInstancesInsertRequest.newBuilder() + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.insert(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Insert_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/list/AsyncList.java new file mode 100644 index 000000000000..803ed0361616 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/list/AsyncList.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesListResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesListRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListRequest request = + SqlInstancesListRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.listCallable().futureCall(request); + // Do something. + InstancesListResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/list/SyncList.java new file mode 100644 index 000000000000..64432c728147 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/list/SyncList.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_List_sync] +import com.google.cloud.sql.v1beta4.InstancesListResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesListRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListRequest request = + SqlInstancesListRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + InstancesListResponse response = sqlInstancesServiceClient.list(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listentraidcertificates/AsyncListEntraIdCertificates.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listentraidcertificates/AsyncListEntraIdCertificates.java new file mode 100644 index 000000000000..ef54d4cefeb4 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listentraidcertificates/AsyncListEntraIdCertificates.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_ListEntraIdCertificates_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncListEntraIdCertificates { + + public static void main(String[] args) throws Exception { + asyncListEntraIdCertificates(); + } + + public static void asyncListEntraIdCertificates() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListEntraIdCertificatesRequest request = + SqlInstancesListEntraIdCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.listEntraIdCertificatesCallable().futureCall(request); + // Do something. + InstancesListEntraIdCertificatesResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ListEntraIdCertificates_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listentraidcertificates/SyncListEntraIdCertificates.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listentraidcertificates/SyncListEntraIdCertificates.java new file mode 100644 index 000000000000..6afe15f15610 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listentraidcertificates/SyncListEntraIdCertificates.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_ListEntraIdCertificates_sync] +import com.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncListEntraIdCertificates { + + public static void main(String[] args) throws Exception { + syncListEntraIdCertificates(); + } + + public static void syncListEntraIdCertificates() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListEntraIdCertificatesRequest request = + SqlInstancesListEntraIdCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + InstancesListEntraIdCertificatesResponse response = + sqlInstancesServiceClient.listEntraIdCertificates(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ListEntraIdCertificates_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listservercas/AsyncListServerCas.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listservercas/AsyncListServerCas.java new file mode 100644 index 000000000000..1583e8a7057a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listservercas/AsyncListServerCas.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_ListServerCas_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesListServerCasResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncListServerCas { + + public static void main(String[] args) throws Exception { + asyncListServerCas(); + } + + public static void asyncListServerCas() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListServerCasRequest request = + SqlInstancesListServerCasRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.listServerCasCallable().futureCall(request); + // Do something. + InstancesListServerCasResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ListServerCas_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listservercas/SyncListServerCas.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listservercas/SyncListServerCas.java new file mode 100644 index 000000000000..e71d23f83217 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listservercas/SyncListServerCas.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_ListServerCas_sync] +import com.google.cloud.sql.v1beta4.InstancesListServerCasResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncListServerCas { + + public static void main(String[] args) throws Exception { + syncListServerCas(); + } + + public static void syncListServerCas() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListServerCasRequest request = + SqlInstancesListServerCasRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + InstancesListServerCasResponse response = sqlInstancesServiceClient.listServerCas(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ListServerCas_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listservercertificates/AsyncListServerCertificates.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listservercertificates/AsyncListServerCertificates.java new file mode 100644 index 000000000000..ba275f1c48f5 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listservercertificates/AsyncListServerCertificates.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_ListServerCertificates_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncListServerCertificates { + + public static void main(String[] args) throws Exception { + asyncListServerCertificates(); + } + + public static void asyncListServerCertificates() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListServerCertificatesRequest request = + SqlInstancesListServerCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.listServerCertificatesCallable().futureCall(request); + // Do something. + InstancesListServerCertificatesResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ListServerCertificates_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listservercertificates/SyncListServerCertificates.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listservercertificates/SyncListServerCertificates.java new file mode 100644 index 000000000000..151b15bffa81 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/listservercertificates/SyncListServerCertificates.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_ListServerCertificates_sync] +import com.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncListServerCertificates { + + public static void main(String[] args) throws Exception { + syncListServerCertificates(); + } + + public static void syncListServerCertificates() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesListServerCertificatesRequest request = + SqlInstancesListServerCertificatesRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + InstancesListServerCertificatesResponse response = + sqlInstancesServiceClient.listServerCertificates(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ListServerCertificates_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/patch/AsyncPatch.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/patch/AsyncPatch.java new file mode 100644 index 000000000000..fa1fd7c9bf1a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/patch/AsyncPatch.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Patch_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.DatabaseInstance; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncPatch { + + public static void main(String[] args) throws Exception { + asyncPatch(); + } + + public static void asyncPatch() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPatchRequest request = + SqlInstancesPatchRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReconcilePscNetworking(true) + .setReconcilePscNetworkingForce(true) + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + ApiFuture future = sqlInstancesServiceClient.patchCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Patch_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/patch/SyncPatch.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/patch/SyncPatch.java new file mode 100644 index 000000000000..fa49448ad5a4 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/patch/SyncPatch.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Patch_sync] +import com.google.cloud.sql.v1beta4.DatabaseInstance; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesPatchRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncPatch { + + public static void main(String[] args) throws Exception { + syncPatch(); + } + + public static void syncPatch() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPatchRequest request = + SqlInstancesPatchRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setReconcilePscNetworking(true) + .setReconcilePscNetworkingForce(true) + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.patch(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Patch_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/performdiskshrink/AsyncPerformDiskShrink.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/performdiskshrink/AsyncPerformDiskShrink.java new file mode 100644 index 000000000000..6472a2017a49 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/performdiskshrink/AsyncPerformDiskShrink.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_PerformDiskShrink_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.PerformDiskShrinkContext; +import com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncPerformDiskShrink { + + public static void main(String[] args) throws Exception { + asyncPerformDiskShrink(); + } + + public static void asyncPerformDiskShrink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPerformDiskShrinkRequest request = + SqlInstancesPerformDiskShrinkRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(PerformDiskShrinkContext.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.performDiskShrinkCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_PerformDiskShrink_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/performdiskshrink/SyncPerformDiskShrink.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/performdiskshrink/SyncPerformDiskShrink.java new file mode 100644 index 000000000000..1936d32e0d42 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/performdiskshrink/SyncPerformDiskShrink.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_PerformDiskShrink_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.PerformDiskShrinkContext; +import com.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncPerformDiskShrink { + + public static void main(String[] args) throws Exception { + syncPerformDiskShrink(); + } + + public static void syncPerformDiskShrink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPerformDiskShrinkRequest request = + SqlInstancesPerformDiskShrinkRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(PerformDiskShrinkContext.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.performDiskShrink(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_PerformDiskShrink_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/pointintimerestore/AsyncPointInTimeRestore.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/pointintimerestore/AsyncPointInTimeRestore.java new file mode 100644 index 000000000000..0eb0b59b3173 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/pointintimerestore/AsyncPointInTimeRestore.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_PointInTimeRestore_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.PointInTimeRestoreContext; +import com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncPointInTimeRestore { + + public static void main(String[] args) throws Exception { + asyncPointInTimeRestore(); + } + + public static void asyncPointInTimeRestore() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPointInTimeRestoreRequest request = + SqlInstancesPointInTimeRestoreRequest.newBuilder() + .setParent("parent-995424086") + .setContext(PointInTimeRestoreContext.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.pointInTimeRestoreCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_PointInTimeRestore_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/pointintimerestore/SyncPointInTimeRestore.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/pointintimerestore/SyncPointInTimeRestore.java new file mode 100644 index 000000000000..e964aa4fda25 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/pointintimerestore/SyncPointInTimeRestore.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_PointInTimeRestore_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.PointInTimeRestoreContext; +import com.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncPointInTimeRestore { + + public static void main(String[] args) throws Exception { + syncPointInTimeRestore(); + } + + public static void syncPointInTimeRestore() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPointInTimeRestoreRequest request = + SqlInstancesPointInTimeRestoreRequest.newBuilder() + .setParent("parent-995424086") + .setContext(PointInTimeRestoreContext.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.pointInTimeRestore(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_PointInTimeRestore_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/precheckmajorversionupgrade/AsyncPreCheckMajorVersionUpgrade.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/precheckmajorversionupgrade/AsyncPreCheckMajorVersionUpgrade.java new file mode 100644 index 000000000000..aed6da95fd01 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/precheckmajorversionupgrade/AsyncPreCheckMajorVersionUpgrade.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_PreCheckMajorVersionUpgrade_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncPreCheckMajorVersionUpgrade { + + public static void main(String[] args) throws Exception { + asyncPreCheckMajorVersionUpgrade(); + } + + public static void asyncPreCheckMajorVersionUpgrade() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPreCheckMajorVersionUpgradeRequest request = + SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.preCheckMajorVersionUpgradeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_PreCheckMajorVersionUpgrade_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/precheckmajorversionupgrade/SyncPreCheckMajorVersionUpgrade.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/precheckmajorversionupgrade/SyncPreCheckMajorVersionUpgrade.java new file mode 100644 index 000000000000..64a02d7ac7c2 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/precheckmajorversionupgrade/SyncPreCheckMajorVersionUpgrade.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_PreCheckMajorVersionUpgrade_sync] +import com.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncPreCheckMajorVersionUpgrade { + + public static void main(String[] args) throws Exception { + syncPreCheckMajorVersionUpgrade(); + } + + public static void syncPreCheckMajorVersionUpgrade() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPreCheckMajorVersionUpgradeRequest request = + SqlInstancesPreCheckMajorVersionUpgradeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesPreCheckMajorVersionUpgradeRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.preCheckMajorVersionUpgrade(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_PreCheckMajorVersionUpgrade_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/promotereplica/AsyncPromoteReplica.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/promotereplica/AsyncPromoteReplica.java new file mode 100644 index 000000000000..3452deda3ca2 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/promotereplica/AsyncPromoteReplica.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_PromoteReplica_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncPromoteReplica { + + public static void main(String[] args) throws Exception { + asyncPromoteReplica(); + } + + public static void asyncPromoteReplica() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPromoteReplicaRequest request = + SqlInstancesPromoteReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setFailover(true) + .build(); + ApiFuture future = + sqlInstancesServiceClient.promoteReplicaCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_PromoteReplica_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/promotereplica/SyncPromoteReplica.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/promotereplica/SyncPromoteReplica.java new file mode 100644 index 000000000000..a0cc476bcb04 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/promotereplica/SyncPromoteReplica.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_PromoteReplica_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncPromoteReplica { + + public static void main(String[] args) throws Exception { + syncPromoteReplica(); + } + + public static void syncPromoteReplica() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesPromoteReplicaRequest request = + SqlInstancesPromoteReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setFailover(true) + .build(); + Operation response = sqlInstancesServiceClient.promoteReplica(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_PromoteReplica_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/reencrypt/AsyncReencrypt.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/reencrypt/AsyncReencrypt.java new file mode 100644 index 000000000000..8ec301897b7f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/reencrypt/AsyncReencrypt.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Reencrypt_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesReencryptRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncReencrypt { + + public static void main(String[] args) throws Exception { + asyncReencrypt(); + } + + public static void asyncReencrypt() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesReencryptRequest request = + SqlInstancesReencryptRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesReencryptRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.reencryptCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Reencrypt_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/reencrypt/SyncReencrypt.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/reencrypt/SyncReencrypt.java new file mode 100644 index 000000000000..deb9eed5668f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/reencrypt/SyncReencrypt.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Reencrypt_sync] +import com.google.cloud.sql.v1beta4.InstancesReencryptRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncReencrypt { + + public static void main(String[] args) throws Exception { + syncReencrypt(); + } + + public static void syncReencrypt() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesReencryptRequest request = + SqlInstancesReencryptRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesReencryptRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.reencrypt(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Reencrypt_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/releasessrslease/AsyncReleaseSsrsLease.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/releasessrslease/AsyncReleaseSsrsLease.java new file mode 100644 index 000000000000..a6992b50621c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/releasessrslease/AsyncReleaseSsrsLease.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_ReleaseSsrsLease_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncReleaseSsrsLease { + + public static void main(String[] args) throws Exception { + asyncReleaseSsrsLease(); + } + + public static void asyncReleaseSsrsLease() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesReleaseSsrsLeaseRequest request = + SqlInstancesReleaseSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.releaseSsrsLeaseCallable().futureCall(request); + // Do something. + SqlInstancesReleaseSsrsLeaseResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ReleaseSsrsLease_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/releasessrslease/SyncReleaseSsrsLease.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/releasessrslease/SyncReleaseSsrsLease.java new file mode 100644 index 000000000000..bb6ebcdad676 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/releasessrslease/SyncReleaseSsrsLease.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_ReleaseSsrsLease_sync] +import com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncReleaseSsrsLease { + + public static void main(String[] args) throws Exception { + syncReleaseSsrsLease(); + } + + public static void syncReleaseSsrsLease() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesReleaseSsrsLeaseRequest request = + SqlInstancesReleaseSsrsLeaseRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + SqlInstancesReleaseSsrsLeaseResponse response = + sqlInstancesServiceClient.releaseSsrsLease(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ReleaseSsrsLease_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/reschedulemaintenance/AsyncRescheduleMaintenance.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/reschedulemaintenance/AsyncRescheduleMaintenance.java new file mode 100644 index 000000000000..d462611d76a0 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/reschedulemaintenance/AsyncRescheduleMaintenance.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_RescheduleMaintenance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncRescheduleMaintenance { + + public static void main(String[] args) throws Exception { + asyncRescheduleMaintenance(); + } + + public static void asyncRescheduleMaintenance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRescheduleMaintenanceRequest request = + SqlInstancesRescheduleMaintenanceRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.rescheduleMaintenanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_RescheduleMaintenance_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/reschedulemaintenance/SyncRescheduleMaintenance.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/reschedulemaintenance/SyncRescheduleMaintenance.java new file mode 100644 index 000000000000..14d27b760479 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/reschedulemaintenance/SyncRescheduleMaintenance.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_RescheduleMaintenance_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncRescheduleMaintenance { + + public static void main(String[] args) throws Exception { + syncRescheduleMaintenance(); + } + + public static void syncRescheduleMaintenance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRescheduleMaintenanceRequest request = + SqlInstancesRescheduleMaintenanceRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SqlInstancesRescheduleMaintenanceRequestBody.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.rescheduleMaintenance(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_RescheduleMaintenance_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/resetreplicasize/AsyncResetReplicaSize.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/resetreplicasize/AsyncResetReplicaSize.java new file mode 100644 index 000000000000..b9fe6561df3e --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/resetreplicasize/AsyncResetReplicaSize.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_ResetReplicaSize_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncResetReplicaSize { + + public static void main(String[] args) throws Exception { + asyncResetReplicaSize(); + } + + public static void asyncResetReplicaSize() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesResetReplicaSizeRequest request = + SqlInstancesResetReplicaSizeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.resetReplicaSizeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ResetReplicaSize_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/resetreplicasize/SyncResetReplicaSize.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/resetreplicasize/SyncResetReplicaSize.java new file mode 100644 index 000000000000..fb1ebc1b0531 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/resetreplicasize/SyncResetReplicaSize.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_ResetReplicaSize_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncResetReplicaSize { + + public static void main(String[] args) throws Exception { + syncResetReplicaSize(); + } + + public static void syncResetReplicaSize() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesResetReplicaSizeRequest request = + SqlInstancesResetReplicaSizeRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.resetReplicaSize(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ResetReplicaSize_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/resetsslconfig/AsyncResetSslConfig.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/resetsslconfig/AsyncResetSslConfig.java new file mode 100644 index 000000000000..eed3ead97dcd --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/resetsslconfig/AsyncResetSslConfig.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_ResetSslConfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncResetSslConfig { + + public static void main(String[] args) throws Exception { + asyncResetSslConfig(); + } + + public static void asyncResetSslConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesResetSslConfigRequest request = + SqlInstancesResetSslConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.resetSslConfigCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ResetSslConfig_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/resetsslconfig/SyncResetSslConfig.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/resetsslconfig/SyncResetSslConfig.java new file mode 100644 index 000000000000..d4e759f773a0 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/resetsslconfig/SyncResetSslConfig.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_ResetSslConfig_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncResetSslConfig { + + public static void main(String[] args) throws Exception { + syncResetSslConfig(); + } + + public static void syncResetSslConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesResetSslConfigRequest request = + SqlInstancesResetSslConfigRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.resetSslConfig(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_ResetSslConfig_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/restart/AsyncRestart.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/restart/AsyncRestart.java new file mode 100644 index 000000000000..8e1a7278b87d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/restart/AsyncRestart.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Restart_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncRestart { + + public static void main(String[] args) throws Exception { + asyncRestart(); + } + + public static void asyncRestart() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRestartRequest request = + SqlInstancesRestartRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlInstancesServiceClient.restartCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Restart_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/restart/SyncRestart.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/restart/SyncRestart.java new file mode 100644 index 000000000000..abf5b52c82e7 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/restart/SyncRestart.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Restart_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesRestartRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncRestart { + + public static void main(String[] args) throws Exception { + syncRestart(); + } + + public static void syncRestart() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRestartRequest request = + SqlInstancesRestartRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.restart(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Restart_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/restorebackup/AsyncRestoreBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/restorebackup/AsyncRestoreBackup.java new file mode 100644 index 000000000000..5c8ad1bca1e1 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/restorebackup/AsyncRestoreBackup.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_RestoreBackup_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncRestoreBackup { + + public static void main(String[] args) throws Exception { + asyncRestoreBackup(); + } + + public static void asyncRestoreBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRestoreBackupRequest request = + SqlInstancesRestoreBackupRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRestoreBackupRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.restoreBackupCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_RestoreBackup_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/restorebackup/SyncRestoreBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/restorebackup/SyncRestoreBackup.java new file mode 100644 index 000000000000..88e564e59479 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/restorebackup/SyncRestoreBackup.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_RestoreBackup_sync] +import com.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncRestoreBackup { + + public static void main(String[] args) throws Exception { + syncRestoreBackup(); + } + + public static void syncRestoreBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRestoreBackupRequest request = + SqlInstancesRestoreBackupRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRestoreBackupRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.restoreBackup(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_RestoreBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateentraidcertificate/AsyncRotateEntraIdCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateentraidcertificate/AsyncRotateEntraIdCertificate.java new file mode 100644 index 000000000000..74b13266f72c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateentraidcertificate/AsyncRotateEntraIdCertificate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_RotateEntraIdCertificate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncRotateEntraIdCertificate { + + public static void main(String[] args) throws Exception { + asyncRotateEntraIdCertificate(); + } + + public static void asyncRotateEntraIdCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRotateEntraIdCertificateRequest request = + SqlInstancesRotateEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.rotateEntraIdCertificateCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_RotateEntraIdCertificate_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateentraidcertificate/SyncRotateEntraIdCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateentraidcertificate/SyncRotateEntraIdCertificate.java new file mode 100644 index 000000000000..e9c44b4b091c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateentraidcertificate/SyncRotateEntraIdCertificate.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_RotateEntraIdCertificate_sync] +import com.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncRotateEntraIdCertificate { + + public static void main(String[] args) throws Exception { + syncRotateEntraIdCertificate(); + } + + public static void syncRotateEntraIdCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRotateEntraIdCertificateRequest request = + SqlInstancesRotateEntraIdCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateEntraIdCertificateRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.rotateEntraIdCertificate(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_RotateEntraIdCertificate_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateserverca/AsyncRotateServerCa.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateserverca/AsyncRotateServerCa.java new file mode 100644 index 000000000000..4b713a6e928a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateserverca/AsyncRotateServerCa.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_RotateServerCa_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncRotateServerCa { + + public static void main(String[] args) throws Exception { + asyncRotateServerCa(); + } + + public static void asyncRotateServerCa() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRotateServerCaRequest request = + SqlInstancesRotateServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCaRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.rotateServerCaCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_RotateServerCa_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateserverca/SyncRotateServerCa.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateserverca/SyncRotateServerCa.java new file mode 100644 index 000000000000..d6474f4ea3ef --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateserverca/SyncRotateServerCa.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_RotateServerCa_sync] +import com.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncRotateServerCa { + + public static void main(String[] args) throws Exception { + syncRotateServerCa(); + } + + public static void syncRotateServerCa() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRotateServerCaRequest request = + SqlInstancesRotateServerCaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCaRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.rotateServerCa(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_RotateServerCa_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateservercertificate/AsyncRotateServerCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateservercertificate/AsyncRotateServerCertificate.java new file mode 100644 index 000000000000..c210f94f307d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateservercertificate/AsyncRotateServerCertificate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_RotateServerCertificate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class AsyncRotateServerCertificate { + + public static void main(String[] args) throws Exception { + asyncRotateServerCertificate(); + } + + public static void asyncRotateServerCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRotateServerCertificateRequest request = + SqlInstancesRotateServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCertificateRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.rotateServerCertificateCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_RotateServerCertificate_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateservercertificate/SyncRotateServerCertificate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateservercertificate/SyncRotateServerCertificate.java new file mode 100644 index 000000000000..c9298bfaf325 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/rotateservercertificate/SyncRotateServerCertificate.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_RotateServerCertificate_sync] +import com.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; + +public class SyncRotateServerCertificate { + + public static void main(String[] args) throws Exception { + syncRotateServerCertificate(); + } + + public static void syncRotateServerCertificate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesRotateServerCertificateRequest request = + SqlInstancesRotateServerCertificateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesRotateServerCertificateRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.rotateServerCertificate(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_RotateServerCertificate_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/startexternalsync/AsyncStartExternalSync.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/startexternalsync/AsyncStartExternalSync.java new file mode 100644 index 000000000000..74ee3c6f444d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/startexternalsync/AsyncStartExternalSync.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_StartExternalSync_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest; + +public class AsyncStartExternalSync { + + public static void main(String[] args) throws Exception { + asyncStartExternalSync(); + } + + public static void asyncStartExternalSync() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesStartExternalSyncRequest request = + SqlInstancesStartExternalSyncRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSkipVerification(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .setReplicaOverwriteEnabled(true) + .build(); + ApiFuture future = + sqlInstancesServiceClient.startExternalSyncCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_StartExternalSync_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/startexternalsync/SyncStartExternalSync.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/startexternalsync/SyncStartExternalSync.java new file mode 100644 index 000000000000..3f9a03bf1f2d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/startexternalsync/SyncStartExternalSync.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_StartExternalSync_sync] +import com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest; + +public class SyncStartExternalSync { + + public static void main(String[] args) throws Exception { + syncStartExternalSync(); + } + + public static void syncStartExternalSync() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesStartExternalSyncRequest request = + SqlInstancesStartExternalSyncRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSkipVerification(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .setReplicaOverwriteEnabled(true) + .build(); + Operation response = sqlInstancesServiceClient.startExternalSync(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_StartExternalSync_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/startreplica/AsyncStartReplica.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/startreplica/AsyncStartReplica.java new file mode 100644 index 000000000000..1540cb22b58e --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/startreplica/AsyncStartReplica.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_StartReplica_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest; + +public class AsyncStartReplica { + + public static void main(String[] args) throws Exception { + asyncStartReplica(); + } + + public static void asyncStartReplica() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesStartReplicaRequest request = + SqlInstancesStartReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.startReplicaCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_StartReplica_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/startreplica/SyncStartReplica.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/startreplica/SyncStartReplica.java new file mode 100644 index 000000000000..cdcd77ef8490 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/startreplica/SyncStartReplica.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_StartReplica_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest; + +public class SyncStartReplica { + + public static void main(String[] args) throws Exception { + syncStartReplica(); + } + + public static void syncStartReplica() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesStartReplicaRequest request = + SqlInstancesStartReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.startReplica(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_StartReplica_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/stopreplica/AsyncStopReplica.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/stopreplica/AsyncStopReplica.java new file mode 100644 index 000000000000..7ad334d28c89 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/stopreplica/AsyncStopReplica.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_StopReplica_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest; + +public class AsyncStopReplica { + + public static void main(String[] args) throws Exception { + asyncStopReplica(); + } + + public static void asyncStopReplica() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesStopReplicaRequest request = + SqlInstancesStopReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlInstancesServiceClient.stopReplicaCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_StopReplica_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/stopreplica/SyncStopReplica.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/stopreplica/SyncStopReplica.java new file mode 100644 index 000000000000..5198bd8d4101 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/stopreplica/SyncStopReplica.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_StopReplica_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest; + +public class SyncStopReplica { + + public static void main(String[] args) throws Exception { + syncStopReplica(); + } + + public static void syncStopReplica() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesStopReplicaRequest request = + SqlInstancesStopReplicaRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + Operation response = sqlInstancesServiceClient.stopReplica(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_StopReplica_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/switchover/AsyncSwitchover.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/switchover/AsyncSwitchover.java new file mode 100644 index 000000000000..7c3408289872 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/switchover/AsyncSwitchover.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Switchover_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest; +import com.google.protobuf.Duration; + +public class AsyncSwitchover { + + public static void main(String[] args) throws Exception { + asyncSwitchover(); + } + + public static void asyncSwitchover() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesSwitchoverRequest request = + SqlInstancesSwitchoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setDbTimeout(Duration.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.switchoverCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Switchover_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/switchover/SyncSwitchover.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/switchover/SyncSwitchover.java new file mode 100644 index 000000000000..342030e5cffa --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/switchover/SyncSwitchover.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Switchover_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest; +import com.google.protobuf.Duration; + +public class SyncSwitchover { + + public static void main(String[] args) throws Exception { + syncSwitchover(); + } + + public static void syncSwitchover() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesSwitchoverRequest request = + SqlInstancesSwitchoverRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setDbTimeout(Duration.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.switchover(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Switchover_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/truncatelog/AsyncTruncateLog.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/truncatelog/AsyncTruncateLog.java new file mode 100644 index 000000000000..c6e5eb161de3 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/truncatelog/AsyncTruncateLog.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_TruncateLog_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest; + +public class AsyncTruncateLog { + + public static void main(String[] args) throws Exception { + asyncTruncateLog(); + } + + public static void asyncTruncateLog() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesTruncateLogRequest request = + SqlInstancesTruncateLogRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesTruncateLogRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.truncateLogCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_TruncateLog_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/truncatelog/SyncTruncateLog.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/truncatelog/SyncTruncateLog.java new file mode 100644 index 000000000000..0f59f6eb97eb --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/truncatelog/SyncTruncateLog.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_TruncateLog_sync] +import com.google.cloud.sql.v1beta4.InstancesTruncateLogRequest; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest; + +public class SyncTruncateLog { + + public static void main(String[] args) throws Exception { + syncTruncateLog(); + } + + public static void syncTruncateLog() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesTruncateLogRequest request = + SqlInstancesTruncateLogRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(InstancesTruncateLogRequest.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.truncateLog(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_TruncateLog_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/update/AsyncUpdate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/update/AsyncUpdate.java new file mode 100644 index 000000000000..8513c62d2b6e --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/update/AsyncUpdate.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Update_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.DatabaseInstance; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest; + +public class AsyncUpdate { + + public static void main(String[] args) throws Exception { + asyncUpdate(); + } + + public static void asyncUpdate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesUpdateRequest request = + SqlInstancesUpdateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + ApiFuture future = sqlInstancesServiceClient.updateCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Update_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/update/SyncUpdate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/update/SyncUpdate.java new file mode 100644 index 000000000000..a764dbc138f1 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/update/SyncUpdate.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_Update_sync] +import com.google.cloud.sql.v1beta4.DatabaseInstance; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest; + +public class SyncUpdate { + + public static void main(String[] args) throws Exception { + syncUpdate(); + } + + public static void syncUpdate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesUpdateRequest request = + SqlInstancesUpdateRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(DatabaseInstance.newBuilder().build()) + .build(); + Operation response = sqlInstancesServiceClient.update(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_Update_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/verifyexternalsyncsettings/AsyncVerifyExternalSyncSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/verifyexternalsyncsettings/AsyncVerifyExternalSyncSettings.java new file mode 100644 index 000000000000..e46ef7d3f719 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/verifyexternalsyncsettings/AsyncVerifyExternalSyncSettings.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_VerifyExternalSyncSettings_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel; +import com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse; +import java.util.ArrayList; + +public class AsyncVerifyExternalSyncSettings { + + public static void main(String[] args) throws Exception { + asyncVerifyExternalSyncSettings(); + } + + public static void asyncVerifyExternalSyncSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesVerifyExternalSyncSettingsRequest request = + SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setVerifyConnectionOnly(true) + .setVerifyReplicationOnly(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .addAllSelectedObjects(new ArrayList()) + .build(); + ApiFuture future = + sqlInstancesServiceClient.verifyExternalSyncSettingsCallable().futureCall(request); + // Do something. + SqlInstancesVerifyExternalSyncSettingsResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_VerifyExternalSyncSettings_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/verifyexternalsyncsettings/SyncVerifyExternalSyncSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/verifyexternalsyncsettings/SyncVerifyExternalSyncSettings.java new file mode 100644 index 000000000000..0ee429a40865 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservice/verifyexternalsyncsettings/SyncVerifyExternalSyncSettings.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesService_VerifyExternalSyncSettings_sync] +import com.google.cloud.sql.v1beta4.ExternalSyncParallelLevel; +import com.google.cloud.sql.v1beta4.ExternalSyncSelectedObject; +import com.google.cloud.sql.v1beta4.SqlInstancesServiceClient; +import com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest; +import com.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse; +import java.util.ArrayList; + +public class SyncVerifyExternalSyncSettings { + + public static void main(String[] args) throws Exception { + syncVerifyExternalSyncSettings(); + } + + public static void syncVerifyExternalSyncSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlInstancesServiceClient sqlInstancesServiceClient = SqlInstancesServiceClient.create()) { + SqlInstancesVerifyExternalSyncSettingsRequest request = + SqlInstancesVerifyExternalSyncSettingsRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setVerifyConnectionOnly(true) + .setVerifyReplicationOnly(true) + .setSyncParallelLevel(ExternalSyncParallelLevel.forNumber(0)) + .addAllSelectedObjects(new ArrayList()) + .build(); + SqlInstancesVerifyExternalSyncSettingsResponse response = + sqlInstancesServiceClient.verifyExternalSyncSettings(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesService_VerifyExternalSyncSettings_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservicesettings/addserverca/SyncAddServerCa.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservicesettings/addserverca/SyncAddServerCa.java new file mode 100644 index 000000000000..72efa1167405 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlinstancesservicesettings/addserverca/SyncAddServerCa.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesServiceSettings_AddServerCa_sync] +import com.google.cloud.sql.v1beta4.SqlInstancesServiceSettings; +import java.time.Duration; + +public class SyncAddServerCa { + + public static void main(String[] args) throws Exception { + syncAddServerCa(); + } + + public static void syncAddServerCa() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlInstancesServiceSettings.Builder sqlInstancesServiceSettingsBuilder = + SqlInstancesServiceSettings.newBuilder(); + sqlInstancesServiceSettingsBuilder + .addServerCaSettings() + .setRetrySettings( + sqlInstancesServiceSettingsBuilder + .addServerCaSettings() + .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()); + SqlInstancesServiceSettings sqlInstancesServiceSettings = + sqlInstancesServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesServiceSettings_AddServerCa_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/cancel/AsyncCancel.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/cancel/AsyncCancel.java new file mode 100644 index 000000000000..457f0265ae31 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/cancel/AsyncCancel.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlOperationsService_Cancel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest; +import com.google.cloud.sql.v1beta4.SqlOperationsServiceClient; +import com.google.protobuf.Empty; + +public class AsyncCancel { + + public static void main(String[] args) throws Exception { + asyncCancel(); + } + + public static void asyncCancel() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create()) { + SqlOperationsCancelRequest request = + SqlOperationsCancelRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlOperationsServiceClient.cancelCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlOperationsService_Cancel_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/cancel/SyncCancel.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/cancel/SyncCancel.java new file mode 100644 index 000000000000..43c82c34decd --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/cancel/SyncCancel.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlOperationsService_Cancel_sync] +import com.google.cloud.sql.v1beta4.SqlOperationsCancelRequest; +import com.google.cloud.sql.v1beta4.SqlOperationsServiceClient; +import com.google.protobuf.Empty; + +public class SyncCancel { + + public static void main(String[] args) throws Exception { + syncCancel(); + } + + public static void syncCancel() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create()) { + SqlOperationsCancelRequest request = + SqlOperationsCancelRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + sqlOperationsServiceClient.cancel(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlOperationsService_Cancel_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..1a118b1b5f59 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlOperationsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1beta4.SqlOperationsServiceClient; +import com.google.cloud.sql.v1beta4.SqlOperationsServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlOperationsServiceSettings sqlOperationsServiceSettings = + SqlOperationsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create(sqlOperationsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlOperationsService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..e8e8e2a76e01 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlOperationsService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1beta4.SqlOperationsServiceClient; +import com.google.cloud.sql.v1beta4.SqlOperationsServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlOperationsServiceSettings sqlOperationsServiceSettings = + SqlOperationsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create(sqlOperationsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlOperationsService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..735786554180 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlOperationsService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1beta4.SqlOperationsServiceClient; +import com.google.cloud.sql.v1beta4.SqlOperationsServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlOperationsServiceSettings sqlOperationsServiceSettings = + SqlOperationsServiceSettings.newHttpJsonBuilder().build(); + SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create(sqlOperationsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlOperationsService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/get/AsyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/get/AsyncGet.java new file mode 100644 index 000000000000..76cd3eeac32a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/get/AsyncGet.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlOperationsService_Get_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlOperationsGetRequest; +import com.google.cloud.sql.v1beta4.SqlOperationsServiceClient; + +public class AsyncGet { + + public static void main(String[] args) throws Exception { + asyncGet(); + } + + public static void asyncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create()) { + SqlOperationsGetRequest request = + SqlOperationsGetRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlOperationsServiceClient.getCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlOperationsService_Get_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/get/SyncGet.java new file mode 100644 index 000000000000..79d245ccf0f8 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/get/SyncGet.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlOperationsService_Get_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlOperationsGetRequest; +import com.google.cloud.sql.v1beta4.SqlOperationsServiceClient; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create()) { + SqlOperationsGetRequest request = + SqlOperationsGetRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .build(); + Operation response = sqlOperationsServiceClient.get(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlOperationsService_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/list/AsyncList.java new file mode 100644 index 000000000000..6426c2fdd085 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/list/AsyncList.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlOperationsService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.OperationsListResponse; +import com.google.cloud.sql.v1beta4.SqlOperationsListRequest; +import com.google.cloud.sql.v1beta4.SqlOperationsServiceClient; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create()) { + SqlOperationsListRequest request = + SqlOperationsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlOperationsServiceClient.listCallable().futureCall(request); + // Do something. + OperationsListResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlOperationsService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/list/SyncList.java new file mode 100644 index 000000000000..c991fdac2d8c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservice/list/SyncList.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlOperationsService_List_sync] +import com.google.cloud.sql.v1beta4.OperationsListResponse; +import com.google.cloud.sql.v1beta4.SqlOperationsListRequest; +import com.google.cloud.sql.v1beta4.SqlOperationsServiceClient; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlOperationsServiceClient sqlOperationsServiceClient = + SqlOperationsServiceClient.create()) { + SqlOperationsListRequest request = + SqlOperationsListRequest.newBuilder() + .setInstance("instance555127957") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + OperationsListResponse response = sqlOperationsServiceClient.list(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlOperationsService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservicesettings/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservicesettings/get/SyncGet.java new file mode 100644 index 000000000000..7a73ff1d275b --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqloperationsservicesettings/get/SyncGet.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlOperationsServiceSettings_Get_sync] +import com.google.cloud.sql.v1beta4.SqlOperationsServiceSettings; +import java.time.Duration; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlOperationsServiceSettings.Builder sqlOperationsServiceSettingsBuilder = + SqlOperationsServiceSettings.newBuilder(); + sqlOperationsServiceSettingsBuilder + .getSettings() + .setRetrySettings( + sqlOperationsServiceSettingsBuilder + .getSettings() + .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()); + SqlOperationsServiceSettings sqlOperationsServiceSettings = + sqlOperationsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlOperationsServiceSettings_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..f6afd464606a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlSslCertsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlSslCertsServiceSettings sqlSslCertsServiceSettings = + SqlSslCertsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlSslCertsServiceClient sqlSslCertsServiceClient = + SqlSslCertsServiceClient.create(sqlSslCertsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlSslCertsService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..0e19464405f8 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlSslCertsService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlSslCertsServiceSettings sqlSslCertsServiceSettings = + SqlSslCertsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlSslCertsServiceClient sqlSslCertsServiceClient = + SqlSslCertsServiceClient.create(sqlSslCertsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlSslCertsService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..cf370c1e5888 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlSslCertsService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlSslCertsServiceSettings sqlSslCertsServiceSettings = + SqlSslCertsServiceSettings.newHttpJsonBuilder().build(); + SqlSslCertsServiceClient sqlSslCertsServiceClient = + SqlSslCertsServiceClient.create(sqlSslCertsServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlSslCertsService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/delete/AsyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/delete/AsyncDelete.java new file mode 100644 index 000000000000..cd31c9091a7f --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/delete/AsyncDelete.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlSslCertsService_Delete_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceClient; + +public class AsyncDelete { + + public static void main(String[] args) throws Exception { + asyncDelete(); + } + + public static void asyncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsDeleteRequest request = + SqlSslCertsDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + ApiFuture future = sqlSslCertsServiceClient.deleteCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlSslCertsService_Delete_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/delete/SyncDelete.java new file mode 100644 index 000000000000..de35bbbce22a --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/delete/SyncDelete.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlSslCertsService_Delete_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceClient; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsDeleteRequest request = + SqlSslCertsDeleteRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + Operation response = sqlSslCertsServiceClient.delete(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlSslCertsService_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/get/AsyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/get/AsyncGet.java new file mode 100644 index 000000000000..b7cc4b6f0479 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/get/AsyncGet.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlSslCertsService_Get_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1beta4.SslCert; + +public class AsyncGet { + + public static void main(String[] args) throws Exception { + asyncGet(); + } + + public static void asyncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsGetRequest request = + SqlSslCertsGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + ApiFuture future = sqlSslCertsServiceClient.getCallable().futureCall(request); + // Do something. + SslCert response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlSslCertsService_Get_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/get/SyncGet.java new file mode 100644 index 000000000000..de30c7bab3d6 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/get/SyncGet.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlSslCertsService_Get_sync] +import com.google.cloud.sql.v1beta4.SqlSslCertsGetRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1beta4.SslCert; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsGetRequest request = + SqlSslCertsGetRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setSha1Fingerprint("sha1Fingerprint163009183") + .build(); + SslCert response = sqlSslCertsServiceClient.get(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlSslCertsService_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/insert/AsyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/insert/AsyncInsert.java new file mode 100644 index 000000000000..3b5654bbee49 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/insert/AsyncInsert.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlSslCertsService_Insert_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1beta4.SslCertsInsertRequest; +import com.google.cloud.sql.v1beta4.SslCertsInsertResponse; + +public class AsyncInsert { + + public static void main(String[] args) throws Exception { + asyncInsert(); + } + + public static void asyncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsInsertRequest request = + SqlSslCertsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsInsertRequest.newBuilder().build()) + .build(); + ApiFuture future = + sqlSslCertsServiceClient.insertCallable().futureCall(request); + // Do something. + SslCertsInsertResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlSslCertsService_Insert_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/insert/SyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/insert/SyncInsert.java new file mode 100644 index 000000000000..f5ef00181598 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/insert/SyncInsert.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlSslCertsService_Insert_sync] +import com.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1beta4.SslCertsInsertRequest; +import com.google.cloud.sql.v1beta4.SslCertsInsertResponse; + +public class SyncInsert { + + public static void main(String[] args) throws Exception { + syncInsert(); + } + + public static void syncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsInsertRequest request = + SqlSslCertsInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(SslCertsInsertRequest.newBuilder().build()) + .build(); + SslCertsInsertResponse response = sqlSslCertsServiceClient.insert(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlSslCertsService_Insert_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/list/AsyncList.java new file mode 100644 index 000000000000..f5d5c1f32647 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/list/AsyncList.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlSslCertsService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.SqlSslCertsListRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1beta4.SslCertsListResponse; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsListRequest request = + SqlSslCertsListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlSslCertsServiceClient.listCallable().futureCall(request); + // Do something. + SslCertsListResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlSslCertsService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/list/SyncList.java new file mode 100644 index 000000000000..17b3b819f101 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservice/list/SyncList.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlSslCertsService_List_sync] +import com.google.cloud.sql.v1beta4.SqlSslCertsListRequest; +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceClient; +import com.google.cloud.sql.v1beta4.SslCertsListResponse; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlSslCertsServiceClient sqlSslCertsServiceClient = SqlSslCertsServiceClient.create()) { + SqlSslCertsListRequest request = + SqlSslCertsListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + SslCertsListResponse response = sqlSslCertsServiceClient.list(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlSslCertsService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservicesettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservicesettings/delete/SyncDelete.java new file mode 100644 index 000000000000..7005c332b827 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlsslcertsservicesettings/delete/SyncDelete.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlSslCertsServiceSettings_Delete_sync] +import com.google.cloud.sql.v1beta4.SqlSslCertsServiceSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlSslCertsServiceSettings.Builder sqlSslCertsServiceSettingsBuilder = + SqlSslCertsServiceSettings.newBuilder(); + sqlSslCertsServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlSslCertsServiceSettingsBuilder + .deleteSettings() + .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()); + SqlSslCertsServiceSettings sqlSslCertsServiceSettings = + sqlSslCertsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlSslCertsServiceSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..3fa35fb6e8bf --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlTiersService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1beta4.SqlTiersServiceClient; +import com.google.cloud.sql.v1beta4.SqlTiersServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlTiersServiceSettings sqlTiersServiceSettings = + SqlTiersServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlTiersServiceClient sqlTiersServiceClient = + SqlTiersServiceClient.create(sqlTiersServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlTiersService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..95c9c38b8406 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlTiersService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1beta4.SqlTiersServiceClient; +import com.google.cloud.sql.v1beta4.SqlTiersServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlTiersServiceSettings sqlTiersServiceSettings = + SqlTiersServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlTiersServiceClient sqlTiersServiceClient = + SqlTiersServiceClient.create(sqlTiersServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlTiersService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..42d24e3754d4 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlTiersService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1beta4.SqlTiersServiceClient; +import com.google.cloud.sql.v1beta4.SqlTiersServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlTiersServiceSettings sqlTiersServiceSettings = + SqlTiersServiceSettings.newHttpJsonBuilder().build(); + SqlTiersServiceClient sqlTiersServiceClient = + SqlTiersServiceClient.create(sqlTiersServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlTiersService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/list/AsyncList.java new file mode 100644 index 000000000000..0868db64a833 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/list/AsyncList.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlTiersService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.SqlTiersListRequest; +import com.google.cloud.sql.v1beta4.SqlTiersServiceClient; +import com.google.cloud.sql.v1beta4.TiersListResponse; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlTiersServiceClient sqlTiersServiceClient = SqlTiersServiceClient.create()) { + SqlTiersListRequest request = + SqlTiersListRequest.newBuilder().setProject("project-309310695").build(); + ApiFuture future = + sqlTiersServiceClient.listCallable().futureCall(request); + // Do something. + TiersListResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlTiersService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/list/SyncList.java new file mode 100644 index 000000000000..881e3c8c84c6 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservice/list/SyncList.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlTiersService_List_sync] +import com.google.cloud.sql.v1beta4.SqlTiersListRequest; +import com.google.cloud.sql.v1beta4.SqlTiersServiceClient; +import com.google.cloud.sql.v1beta4.TiersListResponse; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlTiersServiceClient sqlTiersServiceClient = SqlTiersServiceClient.create()) { + SqlTiersListRequest request = + SqlTiersListRequest.newBuilder().setProject("project-309310695").build(); + TiersListResponse response = sqlTiersServiceClient.list(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlTiersService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservicesettings/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservicesettings/list/SyncList.java new file mode 100644 index 000000000000..a31031f916a8 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqltiersservicesettings/list/SyncList.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlTiersServiceSettings_List_sync] +import com.google.cloud.sql.v1beta4.SqlTiersServiceSettings; +import java.time.Duration; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlTiersServiceSettings.Builder sqlTiersServiceSettingsBuilder = + SqlTiersServiceSettings.newBuilder(); + sqlTiersServiceSettingsBuilder + .listSettings() + .setRetrySettings( + sqlTiersServiceSettingsBuilder + .listSettings() + .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()); + SqlTiersServiceSettings sqlTiersServiceSettings = sqlTiersServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlTiersServiceSettings_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/create/SyncCreateSetCredentialsProvider.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..67a154c2d597 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.sql.v1beta4.SqlUsersServiceClient; +import com.google.cloud.sql.v1beta4.SqlUsersServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlUsersServiceSettings sqlUsersServiceSettings = + SqlUsersServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SqlUsersServiceClient sqlUsersServiceClient = + SqlUsersServiceClient.create(sqlUsersServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlUsersService_Create_SetCredentialsProvider_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/create/SyncCreateSetEndpoint.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..7a87290bede9 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersService_Create_SetEndpoint_sync] +import com.google.cloud.sql.v1beta4.SqlUsersServiceClient; +import com.google.cloud.sql.v1beta4.SqlUsersServiceSettings; +import com.google.cloud.sql.v1beta4.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 + SqlUsersServiceSettings sqlUsersServiceSettings = + SqlUsersServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SqlUsersServiceClient sqlUsersServiceClient = + SqlUsersServiceClient.create(sqlUsersServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlUsersService_Create_SetEndpoint_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/create/SyncCreateUseHttpJsonTransport.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..31b0211439b3 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.sql.v1beta4.SqlUsersServiceClient; +import com.google.cloud.sql.v1beta4.SqlUsersServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlUsersServiceSettings sqlUsersServiceSettings = + SqlUsersServiceSettings.newHttpJsonBuilder().build(); + SqlUsersServiceClient sqlUsersServiceClient = + SqlUsersServiceClient.create(sqlUsersServiceSettings); + } +} +// [END sqladmin_v1beta4_generated_SqlUsersService_Create_UseHttpJsonTransport_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/delete/AsyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/delete/AsyncDelete.java new file mode 100644 index 000000000000..6b6016c686b4 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/delete/AsyncDelete.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersService_Delete_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlUsersServiceClient; + +public class AsyncDelete { + + public static void main(String[] args) throws Exception { + asyncDelete(); + } + + public static void asyncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersDeleteRequest request = + SqlUsersDeleteRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .build(); + ApiFuture future = sqlUsersServiceClient.deleteCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlUsersService_Delete_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/delete/SyncDelete.java new file mode 100644 index 000000000000..ee500ff6d7b0 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/delete/SyncDelete.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersService_Delete_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlUsersDeleteRequest; +import com.google.cloud.sql.v1beta4.SqlUsersServiceClient; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersDeleteRequest request = + SqlUsersDeleteRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .build(); + Operation response = sqlUsersServiceClient.delete(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlUsersService_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/get/AsyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/get/AsyncGet.java new file mode 100644 index 000000000000..ebbbc517ad49 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/get/AsyncGet.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersService_Get_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.SqlUsersGetRequest; +import com.google.cloud.sql.v1beta4.SqlUsersServiceClient; +import com.google.cloud.sql.v1beta4.User; + +public class AsyncGet { + + public static void main(String[] args) throws Exception { + asyncGet(); + } + + public static void asyncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersGetRequest request = + SqlUsersGetRequest.newBuilder() + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .setHost("host3208616") + .build(); + ApiFuture future = sqlUsersServiceClient.getCallable().futureCall(request); + // Do something. + User response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlUsersService_Get_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/get/SyncGet.java new file mode 100644 index 000000000000..133afa4cf884 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/get/SyncGet.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersService_Get_sync] +import com.google.cloud.sql.v1beta4.SqlUsersGetRequest; +import com.google.cloud.sql.v1beta4.SqlUsersServiceClient; +import com.google.cloud.sql.v1beta4.User; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersGetRequest request = + SqlUsersGetRequest.newBuilder() + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .setHost("host3208616") + .build(); + User response = sqlUsersServiceClient.get(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlUsersService_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/insert/AsyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/insert/AsyncInsert.java new file mode 100644 index 000000000000..f29a86524f9c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/insert/AsyncInsert.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersService_Insert_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlUsersInsertRequest; +import com.google.cloud.sql.v1beta4.SqlUsersServiceClient; +import com.google.cloud.sql.v1beta4.User; + +public class AsyncInsert { + + public static void main(String[] args) throws Exception { + asyncInsert(); + } + + public static void asyncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersInsertRequest request = + SqlUsersInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(User.newBuilder().build()) + .build(); + ApiFuture future = sqlUsersServiceClient.insertCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlUsersService_Insert_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/insert/SyncInsert.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/insert/SyncInsert.java new file mode 100644 index 000000000000..8d400897a437 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/insert/SyncInsert.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersService_Insert_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlUsersInsertRequest; +import com.google.cloud.sql.v1beta4.SqlUsersServiceClient; +import com.google.cloud.sql.v1beta4.User; + +public class SyncInsert { + + public static void main(String[] args) throws Exception { + syncInsert(); + } + + public static void syncInsert() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersInsertRequest request = + SqlUsersInsertRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .setBody(User.newBuilder().build()) + .build(); + Operation response = sqlUsersServiceClient.insert(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlUsersService_Insert_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/list/AsyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/list/AsyncList.java new file mode 100644 index 000000000000..ea9977e520b8 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/list/AsyncList.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersService_List_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.SqlUsersListRequest; +import com.google.cloud.sql.v1beta4.SqlUsersServiceClient; +import com.google.cloud.sql.v1beta4.UsersListResponse; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersListRequest request = + SqlUsersListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + ApiFuture future = + sqlUsersServiceClient.listCallable().futureCall(request); + // Do something. + UsersListResponse response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlUsersService_List_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/list/SyncList.java new file mode 100644 index 000000000000..7766b55d705c --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/list/SyncList.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersService_List_sync] +import com.google.cloud.sql.v1beta4.SqlUsersListRequest; +import com.google.cloud.sql.v1beta4.SqlUsersServiceClient; +import com.google.cloud.sql.v1beta4.UsersListResponse; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersListRequest request = + SqlUsersListRequest.newBuilder() + .setInstance("instance555127957") + .setProject("project-309310695") + .build(); + UsersListResponse response = sqlUsersServiceClient.list(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlUsersService_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/update/AsyncUpdate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/update/AsyncUpdate.java new file mode 100644 index 000000000000..d5f216059e04 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/update/AsyncUpdate.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersService_Update_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlUsersServiceClient; +import com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest; +import com.google.cloud.sql.v1beta4.User; +import java.util.ArrayList; + +public class AsyncUpdate { + + public static void main(String[] args) throws Exception { + asyncUpdate(); + } + + public static void asyncUpdate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersUpdateRequest request = + SqlUsersUpdateRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .addAllDatabaseRoles(new ArrayList()) + .setRevokeExistingRoles(true) + .setBody(User.newBuilder().build()) + .build(); + ApiFuture future = sqlUsersServiceClient.updateCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END sqladmin_v1beta4_generated_SqlUsersService_Update_async] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/update/SyncUpdate.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/update/SyncUpdate.java new file mode 100644 index 000000000000..138d115a8699 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservice/update/SyncUpdate.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersService_Update_sync] +import com.google.cloud.sql.v1beta4.Operation; +import com.google.cloud.sql.v1beta4.SqlUsersServiceClient; +import com.google.cloud.sql.v1beta4.SqlUsersUpdateRequest; +import com.google.cloud.sql.v1beta4.User; +import java.util.ArrayList; + +public class SyncUpdate { + + public static void main(String[] args) throws Exception { + syncUpdate(); + } + + public static void syncUpdate() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SqlUsersServiceClient sqlUsersServiceClient = SqlUsersServiceClient.create()) { + SqlUsersUpdateRequest request = + SqlUsersUpdateRequest.newBuilder() + .setHost("host3208616") + .setInstance("instance555127957") + .setName("name3373707") + .setProject("project-309310695") + .addAllDatabaseRoles(new ArrayList()) + .setRevokeExistingRoles(true) + .setBody(User.newBuilder().build()) + .build(); + Operation response = sqlUsersServiceClient.update(request); + } + } +} +// [END sqladmin_v1beta4_generated_SqlUsersService_Update_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservicesettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservicesettings/delete/SyncDelete.java new file mode 100644 index 000000000000..341090c6fe53 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/sqlusersservicesettings/delete/SyncDelete.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersServiceSettings_Delete_sync] +import com.google.cloud.sql.v1beta4.SqlUsersServiceSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlUsersServiceSettings.Builder sqlUsersServiceSettingsBuilder = + SqlUsersServiceSettings.newBuilder(); + sqlUsersServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlUsersServiceSettingsBuilder + .deleteSettings() + .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()); + SqlUsersServiceSettings sqlUsersServiceSettings = sqlUsersServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlUsersServiceSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlbackuprunsservicestubsettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlbackuprunsservicestubsettings/delete/SyncDelete.java new file mode 100644 index 000000000000..eee871d51431 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlbackuprunsservicestubsettings/delete/SyncDelete.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupRunsServiceStubSettings_Delete_sync] +import com.google.cloud.sql.v1beta4.stub.SqlBackupRunsServiceStubSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlBackupRunsServiceStubSettings.Builder sqlBackupRunsServiceSettingsBuilder = + SqlBackupRunsServiceStubSettings.newBuilder(); + sqlBackupRunsServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlBackupRunsServiceSettingsBuilder + .deleteSettings() + .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()); + SqlBackupRunsServiceStubSettings sqlBackupRunsServiceSettings = + sqlBackupRunsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlBackupRunsServiceStubSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlbackupsservicestubsettings/createbackup/SyncCreateBackup.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlbackupsservicestubsettings/createbackup/SyncCreateBackup.java new file mode 100644 index 000000000000..cc08b8c8441d --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlbackupsservicestubsettings/createbackup/SyncCreateBackup.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub.samples; + +// [START sqladmin_v1beta4_generated_SqlBackupsServiceStubSettings_CreateBackup_sync] +import com.google.cloud.sql.v1beta4.stub.SqlBackupsServiceStubSettings; +import java.time.Duration; + +public class SyncCreateBackup { + + public static void main(String[] args) throws Exception { + syncCreateBackup(); + } + + public static void syncCreateBackup() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlBackupsServiceStubSettings.Builder sqlBackupsServiceSettingsBuilder = + SqlBackupsServiceStubSettings.newBuilder(); + sqlBackupsServiceSettingsBuilder + .createBackupSettings() + .setRetrySettings( + sqlBackupsServiceSettingsBuilder + .createBackupSettings() + .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()); + SqlBackupsServiceStubSettings sqlBackupsServiceSettings = + sqlBackupsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlBackupsServiceStubSettings_CreateBackup_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlconnectservicestubsettings/getconnectsettings/SyncGetConnectSettings.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlconnectservicestubsettings/getconnectsettings/SyncGetConnectSettings.java new file mode 100644 index 000000000000..2bfa2f0b5c23 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlconnectservicestubsettings/getconnectsettings/SyncGetConnectSettings.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub.samples; + +// [START sqladmin_v1beta4_generated_SqlConnectServiceStubSettings_GetConnectSettings_sync] +import com.google.cloud.sql.v1beta4.stub.SqlConnectServiceStubSettings; +import java.time.Duration; + +public class SyncGetConnectSettings { + + public static void main(String[] args) throws Exception { + syncGetConnectSettings(); + } + + public static void syncGetConnectSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlConnectServiceStubSettings.Builder sqlConnectServiceSettingsBuilder = + SqlConnectServiceStubSettings.newBuilder(); + sqlConnectServiceSettingsBuilder + .getConnectSettingsSettings() + .setRetrySettings( + sqlConnectServiceSettingsBuilder + .getConnectSettingsSettings() + .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()); + SqlConnectServiceStubSettings sqlConnectServiceSettings = + sqlConnectServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlConnectServiceStubSettings_GetConnectSettings_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqldatabasesservicestubsettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqldatabasesservicestubsettings/delete/SyncDelete.java new file mode 100644 index 000000000000..35ac7ace1224 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqldatabasesservicestubsettings/delete/SyncDelete.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub.samples; + +// [START sqladmin_v1beta4_generated_SqlDatabasesServiceStubSettings_Delete_sync] +import com.google.cloud.sql.v1beta4.stub.SqlDatabasesServiceStubSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlDatabasesServiceStubSettings.Builder sqlDatabasesServiceSettingsBuilder = + SqlDatabasesServiceStubSettings.newBuilder(); + sqlDatabasesServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlDatabasesServiceSettingsBuilder + .deleteSettings() + .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()); + SqlDatabasesServiceStubSettings sqlDatabasesServiceSettings = + sqlDatabasesServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlDatabasesServiceStubSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqldataservicestubsettings/streamsqldata/SyncStreamSqlData.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqldataservicestubsettings/streamsqldata/SyncStreamSqlData.java new file mode 100644 index 000000000000..2ce12bba7f6e --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqldataservicestubsettings/streamsqldata/SyncStreamSqlData.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub.samples; + +// [START sqladmin_v1beta4_generated_SqlDataServiceStubSettings_StreamSqlData_sync] +import com.google.cloud.sql.v1beta4.stub.SqlDataServiceStubSettings; +import java.time.Duration; + +public class SyncStreamSqlData { + + public static void main(String[] args) throws Exception { + syncStreamSqlData(); + } + + public static void syncStreamSqlData() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlDataServiceStubSettings.Builder sqlDataServiceSettingsBuilder = + SqlDataServiceStubSettings.newBuilder(); + sqlDataServiceSettingsBuilder + .streamSqlDataSettings() + .setRetrySettings( + sqlDataServiceSettingsBuilder + .streamSqlDataSettings() + .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()); + SqlDataServiceStubSettings sqlDataServiceSettings = sqlDataServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlDataServiceStubSettings_StreamSqlData_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlflagsservicestubsettings/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlflagsservicestubsettings/list/SyncList.java new file mode 100644 index 000000000000..148f03c13f36 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlflagsservicestubsettings/list/SyncList.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub.samples; + +// [START sqladmin_v1beta4_generated_SqlFlagsServiceStubSettings_List_sync] +import com.google.cloud.sql.v1beta4.stub.SqlFlagsServiceStubSettings; +import java.time.Duration; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlFlagsServiceStubSettings.Builder sqlFlagsServiceSettingsBuilder = + SqlFlagsServiceStubSettings.newBuilder(); + sqlFlagsServiceSettingsBuilder + .listSettings() + .setRetrySettings( + sqlFlagsServiceSettingsBuilder + .listSettings() + .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()); + SqlFlagsServiceStubSettings sqlFlagsServiceSettings = sqlFlagsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlFlagsServiceStubSettings_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlinstancesservicestubsettings/addserverca/SyncAddServerCa.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlinstancesservicestubsettings/addserverca/SyncAddServerCa.java new file mode 100644 index 000000000000..01f8397c74a9 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlinstancesservicestubsettings/addserverca/SyncAddServerCa.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub.samples; + +// [START sqladmin_v1beta4_generated_SqlInstancesServiceStubSettings_AddServerCa_sync] +import com.google.cloud.sql.v1beta4.stub.SqlInstancesServiceStubSettings; +import java.time.Duration; + +public class SyncAddServerCa { + + public static void main(String[] args) throws Exception { + syncAddServerCa(); + } + + public static void syncAddServerCa() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlInstancesServiceStubSettings.Builder sqlInstancesServiceSettingsBuilder = + SqlInstancesServiceStubSettings.newBuilder(); + sqlInstancesServiceSettingsBuilder + .addServerCaSettings() + .setRetrySettings( + sqlInstancesServiceSettingsBuilder + .addServerCaSettings() + .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()); + SqlInstancesServiceStubSettings sqlInstancesServiceSettings = + sqlInstancesServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlInstancesServiceStubSettings_AddServerCa_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqloperationsservicestubsettings/get/SyncGet.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqloperationsservicestubsettings/get/SyncGet.java new file mode 100644 index 000000000000..553a734e9ff7 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqloperationsservicestubsettings/get/SyncGet.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub.samples; + +// [START sqladmin_v1beta4_generated_SqlOperationsServiceStubSettings_Get_sync] +import com.google.cloud.sql.v1beta4.stub.SqlOperationsServiceStubSettings; +import java.time.Duration; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlOperationsServiceStubSettings.Builder sqlOperationsServiceSettingsBuilder = + SqlOperationsServiceStubSettings.newBuilder(); + sqlOperationsServiceSettingsBuilder + .getSettings() + .setRetrySettings( + sqlOperationsServiceSettingsBuilder + .getSettings() + .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()); + SqlOperationsServiceStubSettings sqlOperationsServiceSettings = + sqlOperationsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlOperationsServiceStubSettings_Get_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlsslcertsservicestubsettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlsslcertsservicestubsettings/delete/SyncDelete.java new file mode 100644 index 000000000000..4643169e1c12 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlsslcertsservicestubsettings/delete/SyncDelete.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub.samples; + +// [START sqladmin_v1beta4_generated_SqlSslCertsServiceStubSettings_Delete_sync] +import com.google.cloud.sql.v1beta4.stub.SqlSslCertsServiceStubSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlSslCertsServiceStubSettings.Builder sqlSslCertsServiceSettingsBuilder = + SqlSslCertsServiceStubSettings.newBuilder(); + sqlSslCertsServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlSslCertsServiceSettingsBuilder + .deleteSettings() + .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()); + SqlSslCertsServiceStubSettings sqlSslCertsServiceSettings = + sqlSslCertsServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlSslCertsServiceStubSettings_Delete_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqltiersservicestubsettings/list/SyncList.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqltiersservicestubsettings/list/SyncList.java new file mode 100644 index 000000000000..3173dab485d1 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqltiersservicestubsettings/list/SyncList.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub.samples; + +// [START sqladmin_v1beta4_generated_SqlTiersServiceStubSettings_List_sync] +import com.google.cloud.sql.v1beta4.stub.SqlTiersServiceStubSettings; +import java.time.Duration; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlTiersServiceStubSettings.Builder sqlTiersServiceSettingsBuilder = + SqlTiersServiceStubSettings.newBuilder(); + sqlTiersServiceSettingsBuilder + .listSettings() + .setRetrySettings( + sqlTiersServiceSettingsBuilder + .listSettings() + .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()); + SqlTiersServiceStubSettings sqlTiersServiceSettings = sqlTiersServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlTiersServiceStubSettings_List_sync] diff --git a/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlusersservicestubsettings/delete/SyncDelete.java b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlusersservicestubsettings/delete/SyncDelete.java new file mode 100644 index 000000000000..4c4546e2a8b3 --- /dev/null +++ b/java-sql/samples/snippets/generated/com/google/cloud/sql/v1beta4/stub/sqlusersservicestubsettings/delete/SyncDelete.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.sql.v1beta4.stub.samples; + +// [START sqladmin_v1beta4_generated_SqlUsersServiceStubSettings_Delete_sync] +import com.google.cloud.sql.v1beta4.stub.SqlUsersServiceStubSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SqlUsersServiceStubSettings.Builder sqlUsersServiceSettingsBuilder = + SqlUsersServiceStubSettings.newBuilder(); + sqlUsersServiceSettingsBuilder + .deleteSettings() + .setRetrySettings( + sqlUsersServiceSettingsBuilder + .deleteSettings() + .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()); + SqlUsersServiceStubSettings sqlUsersServiceSettings = sqlUsersServiceSettingsBuilder.build(); + } +} +// [END sqladmin_v1beta4_generated_SqlUsersServiceStubSettings_Delete_sync] diff --git a/librarian.yaml b/librarian.yaml index 54a3b941c04e..2e577a2901a4 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -5530,6 +5530,17 @@ libraries: billing_not_required: true rest_documentation: https://cloud.google.com/speech-to-text/docs/reference/rest rpc_documentation: https://cloud.google.com/speech-to-text/docs/reference/rpc + - name: sql + version: 0.1.0-SNAPSHOT + apis: + - path: google/cloud/sql/v1 + java: + additional_protos: + - path: google/cloud/location/locations.proto + - path: google/cloud/sql/v1beta4 + java: + additional_protos: + - path: google/cloud/location/locations.proto - name: storage version: 2.71.0-SNAPSHOT apis: diff --git a/pom.xml b/pom.xml index e5be1f4aec3d..6d55c4492086 100644 --- a/pom.xml +++ b/pom.xml @@ -248,6 +248,7 @@ java-spanner-jdbc java-spanneradapter java-speech + java-sql java-storage java-storage-nio java-storage-transfer diff --git a/versions.txt b/versions.txt index b2c558da8644..b09bd5667265 100644 --- a/versions.txt +++ b/versions.txt @@ -1092,3 +1092,10 @@ google-maps-isochrones-bom:0.0.0:0.1.0-SNAPSHOT proto-google-maps-isochrones-v1:0.0.0:0.1.0-SNAPSHOT grpc-google-maps-isochrones-v1:0.0.0:0.1.0-SNAPSHOT google-maps-isochrones:0.0.0:0.1.0-SNAPSHOT +google-cloud-sql-parent:0.0.0:0.1.0-SNAPSHOT +google-cloud-sql-bom:0.0.0:0.1.0-SNAPSHOT +proto-google-cloud-sql-v1:0.0.0:0.1.0-SNAPSHOT +grpc-google-cloud-sql-v1:0.0.0:0.1.0-SNAPSHOT +google-cloud-sql:0.0.0:0.1.0-SNAPSHOT +proto-google-cloud-sql-v1beta4:0.0.0:0.1.0-SNAPSHOT +grpc-google-cloud-sql-v1beta4:0.0.0:0.1.0-SNAPSHOT